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
|
---|---|---|---|---|---|
<?php
/*
* This file is part of the Sonata project.
*
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sonata\BlockBundle\Block;
use Sonata\AdminBundle\Validator\ErrorElement;
use Sonata\BlockBundle\Model\BlockInterface;
interface BlockServiceManagerInterface
{
/**
* @param string $name
* @param string $service
*
* @return void
*/
public function add($name, $service);
/**
* Return the block service linked to the link
*
* @param BlockInterface $block
*
* @return BlockServiceInterface
*/
public function get(BlockInterface $block);
/**
* @param array $blockServices
*
* @return void
*/
public function setServices(array $blockServices);
/**
* @return array
*/
public function getServices();
/**
*
* @param string $name
*
* @return boolean
*/
public function has($name);
/**
* @param $name
*
* @return BlockServiceInterface
*/
public function getService($name);
/**
* @return array
*/
public function getLoadedServices();
/**
* @param ErrorElement $errorElement
* @param BlockInterface $block
*/
public function validate(ErrorElement $errorElement, BlockInterface $block);
}
| ntsetsbold/delguur | vendor/sonata-project/block-bundle/Block/BlockServiceManagerInterface.php | PHP | mit | 1,461 |
/*
* Clickspark JavaScript utility v1.0.0
* https://github.com/ymc-thzi/clickspark.js
*
* Thomas Zinnbauer @ YMC
*
* 2015 YMC AG | Sonnenstrasse 4 | CH-8280 Kreuzlingen | Switzerland
* http://www.ymc.ch
*
*/
csDefaultSpecs={particleImagePath:"",particleCount:35,particleSpeed:12,particleSize:12,particleRotationSpeed:0},$.fn.clickSpark=function(e){void 0==e&&(e={particleImagePath:csDefaultSpecs.particleImagePath,particleCount:csDefaultSpecs.particleCount,particleSpeed:csDefaultSpecs.particleSpeed,particleSize:csDefaultSpecs.particleSize,particleRotationSpeed:csDefaultSpecs.particleRotationSpeed}),$(this).on("click",function(t){clickSpark.setParticleImagePath(e.particleImagePath),clickSpark.setParticleCount(e.particleCount),clickSpark.setParticleSpeed(e.particleSpeed),clickSpark.setParticleSize(e.particleSize),clickSpark.setParticleRotationSpeed(e.particleRotationSpeed),clickSpark.stdFuncOCl(t)})};var clickSpark=function(){function e(){o()}function t(e){void 0!=e&&(f=e)}function a(e){void 0!=e&&(v=e)}function i(e){void 0!=e&&(h=e)}function c(e){void 0!=e&&(w=e)}function n(e){void 0!=e&&(S=e)}function o(){$(document).ready(function(){$("body").prepend('<div class="cs-canvas-container"><canvas id="cs-particle-canvas"></canvas></div>'),$(".cs-canvas-container").hide(),$("#cs-particle-canvas").hide(),$(".cs-canvas-container").css({position:"absolute",zIndex:99999,width:500,height:500})})}function s(){var e={};return g&&(e.x=g.width/2,e.y=g.height/2,e.rotation=0),e.speed=A(0,h),e.angle=A(0,360)*(Math.PI/180),e.rotationSpeed=A(-1*S,S),e.size=w,e}function r(){g=document.getElementById("cs-particle-canvas"),""==f?(defaultImg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAc5pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx4bXA6Q3JlYXRvclRvb2w+QWRvYmUgRmlyZXdvcmtzIENTNTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KaBqfRAAAATZJREFUOBGtlM2NwjAQhd+MAndaSAu5cuBAC9RAAyuxVICQtgFqoAUOHLi6BbfAnY3ineeNTXYvKA6WRv59X8bxzAj+teUhLCqgeSg2CGhsuzZbmN3NPARu3uHcAu62F67lJnlkg+VXaAKwC20GEEJLjeJoUsGb+Hj7EJc2M2x1COtWsOuAddp81StwqQKO171ceDbC6FHX4mRzXmtsc1phSw+F/yjMcLKrbcZS0nm78lm+sTUomv4fpb3RPfXkaHy13xcbDRkIanK0f/7BeuHQwsgeJIdBISXKGD41YcM4mgQk7E8UT6DdCfNvANIhr8y1Cd48pcZRJi2pz9WikSdHmf1M2iJEL6KeHGUZYfbbeul1XawexuEDgEk6D/i0Scz+/oMvO56nLpWhXIKofFs9S25MqbQ/ard2fSmw8JoAAAAASUVORK5CYII=",particleImg=new Image,particleImg.src=defaultImg):(particleImg=new Image,particleImg.src=f),g&&"function"==typeof g.getContext&&(m=g.getContext("2d"),bodyWidth=document.body.clientWidth,m.canvas.width=$(".cs-canvas-container").width()>bodyWidth?bodyWidth:2*$(".cs-canvas-container").width(),m.canvas.height=$(".cs-canvas-container").height()),l()}function l(){for(var e=0;v>e;e++)k.push(s())}function d(){m.clearRect(0,0,window.innerWidth,window.innerHeight);for(var e=0;v>e;e++){var t=k[e];t.size=t.size*(.96+A(1,10)/100),t.x=t.x+t.speed*Math.cos(t.angle),t.y=t.y+t.speed*Math.sin(t.angle),t.rotation=t.rotation+t.rotationSpeed,m.save(),m.translate(t.x,t.y),m.rotate(t.rotation*Math.PI/180),m.drawImage(particleImg,-(particleImg.width/2),-(particleImg.height/2),t.size,t.size),m.restore()}}function p(){if(R){var e=b;b=Date.now(),requestAnimationFrame(p,b-e),d()}}function A(e,t){return Math.random()*(t-e)+e}function u(e){b=Date.now();var t,a;"click"==e.type?(t=e.pageX,a=e.pageY):(t=e.offset().left+e.width()/2,a=e.offset().top+e.height()/2),k=[],particle=null,r(),$(".cs-canvas-container").width()>bodyWidth?$(".cs-canvas-container").css("left",t-$(".cs-canvas-container").width()/2):$(".cs-canvas-container").css("left",t-$(".cs-canvas-container").width()),$(".cs-canvas-container").css("top",a-$(".cs-canvas-container").height()/2),$(".cs-canvas-container").show(),$("#cs-particle-canvas").show(),window.setTimeout(function(){$("#cs-particle-canvas").fadeOut()},400),R=!0,p(),window.setTimeout(function(){$("#cs-particle-canvas").hide(),$(".cs-canvas-container").hide(),R=!1},800)}var g,m,f=csDefaultSpecs.particleImagePath,v=csDefaultSpecs.particleCount,h=csDefaultSpecs.particleSpeed,S=csDefaultSpecs.particleRotationSpeed,w=csDefaultSpecs.particleSize,I=60,C=1e3/I,b=0,R=!1,k=[];return e(),window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){var a=C;t>a&&(a-=t-a,0>a&&(a=0)),window.setTimeout(e,a)}}(),{setParticleImagePath:function(e){t(e)},setParticleCount:function(e){a(e)},setParticleSpeed:function(e){i(e)},setParticleSize:function(e){c(e)},setParticleRotationSpeed:function(e){n(e)},init:function(){u(element)},fireParticles:function(e){u(e)},stdFuncOCl:function(e){u(e)}}}(); | boneskull/cdnjs | ajax/libs/clickspark.js/1.8.0/clickspark.min.js | JavaScript | mit | 5,207 |
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v5.0.3
* @link http://www.ag-grid.com/
* @license MIT
*/
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 __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = require("../utils");
var masterSlaveService_1 = require("../masterSlaveService");
var gridOptionsWrapper_1 = require("../gridOptionsWrapper");
var columnController_1 = require("../columnController/columnController");
var rowRenderer_1 = require("../rendering/rowRenderer");
var floatingRowModel_1 = require("../rowControllers/floatingRowModel");
var borderLayout_1 = require("../layout/borderLayout");
var logger_1 = require("../logger");
var context_1 = require("../context/context");
var eventService_1 = require("../eventService");
var events_1 = require("../events");
var dragService_1 = require("../dragAndDrop/dragService");
var constants_1 = require("../constants");
var selectionController_1 = require("../selectionController");
var csvCreator_1 = require("../csvCreator");
var mouseEventService_1 = require("./mouseEventService");
var focusedCellController_1 = require("../focusedCellController");
// in the html below, it is important that there are no white space between some of the divs, as if there is white space,
// it won't render correctly in safari, as safari renders white space as a gap
var gridHtml = '<div>' +
// header
'<div class="ag-header">' +
'<div class="ag-pinned-left-header"></div>' +
'<div class="ag-pinned-right-header"></div>' +
'<div class="ag-header-viewport">' +
'<div class="ag-header-container"></div>' +
'</div>' +
'<div class="ag-header-overlay"></div>' +
'</div>' +
// floating top
'<div class="ag-floating-top">' +
'<div class="ag-pinned-left-floating-top"></div>' +
'<div class="ag-pinned-right-floating-top"></div>' +
'<div class="ag-floating-top-viewport">' +
'<div class="ag-floating-top-container"></div>' +
'</div>' +
'</div>' +
// floating bottom
'<div class="ag-floating-bottom">' +
'<div class="ag-pinned-left-floating-bottom"></div>' +
'<div class="ag-pinned-right-floating-bottom"></div>' +
'<div class="ag-floating-bottom-viewport">' +
'<div class="ag-floating-bottom-container"></div>' +
'</div>' +
'</div>' +
// body
'<div class="ag-body">' +
'<div class="ag-pinned-left-cols-viewport">' +
'<div class="ag-pinned-left-cols-container"></div>' +
'</div>' +
'<div class="ag-pinned-right-cols-viewport">' +
'<div class="ag-pinned-right-cols-container"></div>' +
'</div>' +
'<div class="ag-body-viewport-wrapper">' +
'<div class="ag-body-viewport">' +
'<div class="ag-body-container"></div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
var gridForPrintHtml = '<div>' +
// header
'<div class="ag-header-container"></div>' +
// floating
'<div class="ag-floating-top-container"></div>' +
// body
'<div class="ag-body-container"></div>' +
// floating bottom
'<div class="ag-floating-bottom-container"></div>' +
'</div>';
// wrapping in outer div, and wrapper, is needed to center the loading icon
// The idea for centering came from here: http://www.vanseodesign.com/css/vertical-centering/
var mainOverlayTemplate = '<div class="ag-overlay-panel">' +
'<div class="ag-overlay-wrapper ag-overlay-[OVERLAY_NAME]-wrapper">[OVERLAY_TEMPLATE]</div>' +
'</div>';
var defaultLoadingOverlayTemplate = '<span class="ag-overlay-loading-center">[LOADING...]</span>';
var defaultNoRowsOverlayTemplate = '<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>';
var GridPanel = (function () {
function GridPanel() {
this.requestAnimationFrameExists = typeof requestAnimationFrame === 'function';
this.scrollLagCounter = 0;
this.scrollLagTicking = false;
this.lastLeftPosition = -1;
this.lastTopPosition = -1;
this.animationThreadCount = 0;
this.destroyFunctions = [];
}
GridPanel.prototype.agWire = function (loggerFactory) {
// makes code below more readable if we pull 'forPrint' out
this.forPrint = this.gridOptionsWrapper.isForPrint();
this.scrollWidth = utils_1.Utils.getScrollbarWidth();
this.logger = loggerFactory.create('GridPanel');
this.findElements();
};
GridPanel.prototype.destroy = function () {
this.destroyFunctions.forEach(function (func) { return func(); });
};
GridPanel.prototype.onRowDataChanged = function () {
if (this.rowModel.isEmpty() && !this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
this.showNoRowsOverlay();
}
else {
this.hideOverlay();
}
};
GridPanel.prototype.getLayout = function () {
return this.layout;
};
GridPanel.prototype.init = function () {
this.addEventListeners();
this.addDragListeners();
this.useScrollLag = this.isUseScrollLag();
this.layout = new borderLayout_1.BorderLayout({
overlays: {
loading: utils_1.Utils.loadTemplate(this.createLoadingOverlayTemplate()),
noRows: utils_1.Utils.loadTemplate(this.createNoRowsOverlayTemplate())
},
center: this.eRoot,
dontFill: this.forPrint,
name: 'eGridPanel'
});
this.layout.addSizeChangeListener(this.sizeHeaderAndBody.bind(this));
this.addScrollListener();
this.setLeftAndRightBounds();
if (this.gridOptionsWrapper.isSuppressHorizontalScroll()) {
this.eBodyViewport.style.overflowX = 'hidden';
}
if (this.gridOptionsWrapper.isRowModelDefault() && !this.gridOptionsWrapper.getRowData()) {
this.showLoadingOverlay();
}
this.setWidthsOfContainers();
this.showPinnedColContainersIfNeeded();
this.sizeHeaderAndBody();
this.disableBrowserDragging();
this.addShortcutKeyListeners();
this.addCellListeners();
if (this.$scope) {
this.addAngularApplyCheck();
}
};
GridPanel.prototype.addAngularApplyCheck = function () {
var _this = this;
// this makes sure if we queue up requests, we only execute oe
var applyTriggered = false;
var listener = function () {
// only need to do one apply at a time
if (applyTriggered) {
return;
}
applyTriggered = true; // mark 'need apply' to true
setTimeout(function () {
applyTriggered = false;
_this.$scope.$apply();
}, 0);
};
// these are the events we need to do an apply after - these are the ones that can end up
// with columns added or removed
this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
this.eventService.addEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
this.destroyFunctions.push(function () {
_this.eventService.removeEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, listener);
_this.eventService.removeEventListener(events_1.Events.EVENT_VIRTUAL_COLUMNS_CHANGED, listener);
});
};
// if we do not do this, then the user can select a pic in the grid (eg an image in a custom cell renderer)
// and then that will start the browser native drag n' drop, which messes up with our own drag and drop.
GridPanel.prototype.disableBrowserDragging = function () {
this.eRoot.addEventListener('dragstart', function (event) {
if (event.target instanceof HTMLImageElement) {
event.preventDefault();
return false;
}
});
};
GridPanel.prototype.addEventListeners = function () {
this.eventService.addEventListener(events_1.Events.EVENT_DISPLAYED_COLUMNS_CHANGED, this.onDisplayedColumnsChanged.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_COLUMN_RESIZED, this.onColumnResized.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_FLOATING_ROW_DATA_CHANGED, this.sizeHeaderAndBody.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_HEADER_HEIGHT_CHANGED, this.sizeHeaderAndBody.bind(this));
this.eventService.addEventListener(events_1.Events.EVENT_ROW_DATA_CHANGED, this.onRowDataChanged.bind(this));
};
GridPanel.prototype.addDragListeners = function () {
var _this = this;
if (this.forPrint // no range select when doing 'for print'
|| !this.gridOptionsWrapper.isEnableRangeSelection() // no range selection if no property
|| utils_1.Utils.missing(this.rangeController)) {
return;
}
var containers = [this.ePinnedLeftColsContainer, this.ePinnedRightColsContainer, this.eBodyContainer,
this.eFloatingTop, this.eFloatingBottom];
containers.forEach(function (container) {
_this.dragService.addDragSource({
dragStartPixels: 0,
eElement: container,
onDragStart: _this.rangeController.onDragStart.bind(_this.rangeController),
onDragStop: _this.rangeController.onDragStop.bind(_this.rangeController),
onDragging: _this.rangeController.onDragging.bind(_this.rangeController)
});
});
};
GridPanel.prototype.addCellListeners = function () {
var _this = this;
var eventNames = ['click', 'mousedown', 'dblclick', 'contextmenu'];
var that = this;
eventNames.forEach(function (eventName) {
_this.eAllCellContainers.forEach(function (container) {
return container.addEventListener(eventName, function (mouseEvent) {
var eventSource = this;
that.processMouseEvent(eventName, mouseEvent, eventSource);
});
});
});
};
GridPanel.prototype.processMouseEvent = function (eventName, mouseEvent, eventSource) {
var cell = this.mouseEventService.getCellForMouseEvent(mouseEvent);
if (utils_1.Utils.exists(cell)) {
//console.log(`row = ${cell.rowIndex}, floating = ${floating}`);
this.rowRenderer.onMouseEvent(eventName, mouseEvent, eventSource, cell);
}
// if we don't do this, then middle click will never result in a 'click' event, as 'mousedown'
// will be consumed by the browser to mean 'scroll' (as you can scroll with the middle mouse
// button in the browser). so this property allows the user to receive middle button clicks if
// they want.
if (this.gridOptionsWrapper.isSuppressMiddleClickScrolls() && mouseEvent.which === 2) {
mouseEvent.preventDefault();
}
};
GridPanel.prototype.addShortcutKeyListeners = function () {
var _this = this;
this.eAllCellContainers.forEach(function (container) {
container.addEventListener('keydown', function (event) {
if (event.ctrlKey || event.metaKey) {
switch (event.which) {
case constants_1.Constants.KEY_A: return _this.onCtrlAndA(event);
case constants_1.Constants.KEY_C: return _this.onCtrlAndC(event);
case constants_1.Constants.KEY_V: return _this.onCtrlAndV(event);
case constants_1.Constants.KEY_D: return _this.onCtrlAndD(event);
}
}
});
});
};
GridPanel.prototype.onCtrlAndA = function (event) {
if (this.rangeController && this.rowModel.isRowsToRender()) {
var rowEnd;
var floatingStart;
var floatingEnd;
if (this.floatingRowModel.isEmpty(constants_1.Constants.FLOATING_TOP)) {
floatingStart = null;
}
else {
floatingStart = constants_1.Constants.FLOATING_TOP;
}
if (this.floatingRowModel.isEmpty(constants_1.Constants.FLOATING_BOTTOM)) {
floatingEnd = null;
rowEnd = this.rowModel.getRowCount() - 1;
}
else {
floatingEnd = constants_1.Constants.FLOATING_BOTTOM;
rowEnd = this.floatingRowModel.getFloatingBottomRowData().length = 1;
}
var allDisplayedColumns = this.columnController.getAllDisplayedColumns();
if (utils_1.Utils.missingOrEmpty(allDisplayedColumns)) {
return;
}
this.rangeController.setRange({
rowStart: 0,
floatingStart: floatingStart,
rowEnd: rowEnd,
floatingEnd: floatingEnd,
columnStart: allDisplayedColumns[0],
columnEnd: allDisplayedColumns[allDisplayedColumns.length - 1]
});
}
event.preventDefault();
return false;
};
GridPanel.prototype.onCtrlAndC = function (event) {
if (!this.clipboardService) {
return;
}
var focusedCell = this.focusedCellController.getFocusedCell();
this.clipboardService.copyToClipboard();
event.preventDefault();
// the copy operation results in loosing focus on the cell,
// because of the trickery the copy logic uses with a temporary
// widget. so we set it back again.
if (focusedCell) {
this.focusedCellController.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.floating, true);
}
return false;
};
GridPanel.prototype.onCtrlAndV = function (event) {
if (!this.rangeController) {
return;
}
this.clipboardService.pasteFromClipboard();
return false;
};
GridPanel.prototype.onCtrlAndD = function (event) {
if (!this.clipboardService) {
return;
}
this.clipboardService.copyRangeDown();
event.preventDefault();
return false;
};
GridPanel.prototype.getPinnedLeftFloatingTop = function () {
return this.ePinnedLeftFloatingTop;
};
GridPanel.prototype.getPinnedRightFloatingTop = function () {
return this.ePinnedRightFloatingTop;
};
GridPanel.prototype.getFloatingTopContainer = function () {
return this.eFloatingTopContainer;
};
GridPanel.prototype.getPinnedLeftFloatingBottom = function () {
return this.ePinnedLeftFloatingBottom;
};
GridPanel.prototype.getPinnedRightFloatingBottom = function () {
return this.ePinnedRightFloatingBottom;
};
GridPanel.prototype.getFloatingBottomContainer = function () {
return this.eFloatingBottomContainer;
};
GridPanel.prototype.createOverlayTemplate = function (name, defaultTemplate, userProvidedTemplate) {
var template = mainOverlayTemplate
.replace('[OVERLAY_NAME]', name);
if (userProvidedTemplate) {
template = template.replace('[OVERLAY_TEMPLATE]', userProvidedTemplate);
}
else {
template = template.replace('[OVERLAY_TEMPLATE]', defaultTemplate);
}
return template;
};
GridPanel.prototype.createLoadingOverlayTemplate = function () {
var userProvidedTemplate = this.gridOptionsWrapper.getOverlayLoadingTemplate();
var templateNotLocalised = this.createOverlayTemplate('loading', defaultLoadingOverlayTemplate, userProvidedTemplate);
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var templateLocalised = templateNotLocalised.replace('[LOADING...]', localeTextFunc('loadingOoo', 'Loading...'));
return templateLocalised;
};
GridPanel.prototype.createNoRowsOverlayTemplate = function () {
var userProvidedTemplate = this.gridOptionsWrapper.getOverlayNoRowsTemplate();
var templateNotLocalised = this.createOverlayTemplate('no-rows', defaultNoRowsOverlayTemplate, userProvidedTemplate);
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var templateLocalised = templateNotLocalised.replace('[NO_ROWS_TO_SHOW]', localeTextFunc('noRowsToShow', 'No Rows To Show'));
return templateLocalised;
};
GridPanel.prototype.ensureIndexVisible = function (index) {
this.logger.log('ensureIndexVisible: ' + index);
var lastRow = this.rowModel.getRowCount();
if (typeof index !== 'number' || index < 0 || index >= lastRow) {
console.warn('invalid row index for ensureIndexVisible: ' + index);
return;
}
var nodeAtIndex = this.rowModel.getRow(index);
var rowTopPixel = nodeAtIndex.rowTop;
var rowBottomPixel = rowTopPixel + nodeAtIndex.rowHeight;
var viewportTopPixel = this.eBodyViewport.scrollTop;
var viewportHeight = this.eBodyViewport.offsetHeight;
var scrollShowing = this.isHorizontalScrollShowing();
if (scrollShowing) {
viewportHeight -= this.scrollWidth;
}
var viewportBottomPixel = viewportTopPixel + viewportHeight;
var viewportScrolledPastRow = viewportTopPixel > rowTopPixel;
var viewportScrolledBeforeRow = viewportBottomPixel < rowBottomPixel;
var eViewportToScroll = this.columnController.isPinningRight() ? this.ePinnedRightColsViewport : this.eBodyViewport;
if (viewportScrolledPastRow) {
// if row is before, scroll up with row at top
eViewportToScroll.scrollTop = rowTopPixel;
}
else if (viewportScrolledBeforeRow) {
// if row is below, scroll down with row at bottom
var newScrollPosition = rowBottomPixel - viewportHeight;
eViewportToScroll.scrollTop = newScrollPosition;
}
// otherwise, row is already in view, so do nothing
};
// + moveColumnController
GridPanel.prototype.getCenterWidth = function () {
return this.eBodyViewport.clientWidth;
};
GridPanel.prototype.isHorizontalScrollShowing = function () {
var result = this.eBodyViewport.clientWidth < this.eBodyViewport.scrollWidth;
return result;
};
GridPanel.prototype.isVerticalScrollShowing = function () {
if (this.columnController.isPinningRight()) {
// if pinning right, then the scroll bar can show, however for some reason
// it overlays the grid and doesn't take space.
return false;
}
else {
return this.eBodyViewport.clientHeight < this.eBodyViewport.scrollHeight;
}
};
// gets called every 500 ms. we use this to set padding on right pinned column
GridPanel.prototype.periodicallyCheck = function () {
if (this.columnController.isPinningRight()) {
var bodyHorizontalScrollShowing = this.eBodyViewport.clientWidth < this.eBodyViewport.scrollWidth;
if (bodyHorizontalScrollShowing) {
this.ePinnedRightColsContainer.style.marginBottom = this.scrollWidth + 'px';
}
else {
this.ePinnedRightColsContainer.style.marginBottom = '';
}
}
};
GridPanel.prototype.ensureColumnVisible = function (key) {
var column = this.columnController.getGridColumn(key);
if (!column) {
return;
}
if (column.isPinned()) {
console.warn('calling ensureIndexVisible on a ' + column.getPinned() + ' pinned column doesn\'t make sense for column ' + column.getColId());
return;
}
if (!this.columnController.isColumnDisplayed(column)) {
console.warn('column is not currently visible');
return;
}
var colLeftPixel = column.getLeft();
var colRightPixel = colLeftPixel + column.getActualWidth();
var viewportLeftPixel = this.eBodyViewport.scrollLeft;
var viewportWidth = this.eBodyViewport.offsetWidth;
var scrollShowing = this.eBodyViewport.clientHeight < this.eBodyViewport.scrollHeight;
if (scrollShowing) {
viewportWidth -= this.scrollWidth;
}
var viewportRightPixel = viewportLeftPixel + viewportWidth;
var viewportScrolledPastCol = viewportLeftPixel > colLeftPixel;
var viewportScrolledBeforeCol = viewportRightPixel < colRightPixel;
if (viewportScrolledPastCol) {
// if viewport's left side is after col's left side, scroll right to pull col into viewport at left
this.eBodyViewport.scrollLeft = colLeftPixel;
}
else if (viewportScrolledBeforeCol) {
// if viewport's right side is before col's right side, scroll left to pull col into viewport at right
var newScrollPosition = colRightPixel - viewportWidth;
this.eBodyViewport.scrollLeft = newScrollPosition;
}
// otherwise, col is already in view, so do nothing
};
GridPanel.prototype.showLoadingOverlay = function () {
if (!this.gridOptionsWrapper.isSuppressLoadingOverlay()) {
this.layout.showOverlay('loading');
}
};
GridPanel.prototype.showNoRowsOverlay = function () {
if (!this.gridOptionsWrapper.isSuppressNoRowsOverlay()) {
this.layout.showOverlay('noRows');
}
};
GridPanel.prototype.hideOverlay = function () {
this.layout.hideOverlay();
};
GridPanel.prototype.getWidthForSizeColsToFit = function () {
var availableWidth = this.eBody.clientWidth;
var scrollShowing = this.isVerticalScrollShowing();
if (scrollShowing) {
availableWidth -= this.scrollWidth;
}
return availableWidth;
};
// method will call itself if no available width. this covers if the grid
// isn't visible, but is just about to be visible.
GridPanel.prototype.sizeColumnsToFit = function (nextTimeout) {
var _this = this;
var availableWidth = this.getWidthForSizeColsToFit();
if (availableWidth > 0) {
this.columnController.sizeColumnsToFit(availableWidth);
}
else {
if (nextTimeout === undefined) {
setTimeout(function () {
_this.sizeColumnsToFit(100);
}, 0);
}
else if (nextTimeout === 100) {
setTimeout(function () {
_this.sizeColumnsToFit(-1);
}, 100);
}
else {
console.log('ag-Grid: tried to call sizeColumnsToFit() but the grid is coming back with ' +
'zero width, maybe the grid is not visible yet on the screen?');
}
}
};
GridPanel.prototype.getBodyContainer = function () {
return this.eBodyContainer;
};
GridPanel.prototype.getDropTargetBodyContainers = function () {
if (this.forPrint) {
return [this.eBodyContainer, this.eFloatingTopContainer, this.eFloatingBottomContainer];
}
else {
return [this.eBodyViewport, this.eFloatingTopViewport, this.eFloatingBottomViewport];
}
};
GridPanel.prototype.getBodyViewport = function () {
return this.eBodyViewport;
};
GridPanel.prototype.getPinnedLeftColsContainer = function () {
return this.ePinnedLeftColsContainer;
};
GridPanel.prototype.getDropTargetLeftContainers = function () {
if (this.forPrint) {
return [];
}
else {
return [this.ePinnedLeftColsViewport, this.ePinnedLeftFloatingBottom, this.ePinnedLeftFloatingTop];
}
};
GridPanel.prototype.getPinnedRightColsContainer = function () {
return this.ePinnedRightColsContainer;
};
GridPanel.prototype.getDropTargetPinnedRightContainers = function () {
if (this.forPrint) {
return [];
}
else {
return [this.ePinnedRightColsViewport, this.ePinnedRightFloatingBottom, this.ePinnedRightFloatingTop];
}
};
GridPanel.prototype.getHeaderContainer = function () {
return this.eHeaderContainer;
};
GridPanel.prototype.getHeaderOverlay = function () {
return this.eHeaderOverlay;
};
GridPanel.prototype.getRoot = function () {
return this.eRoot;
};
GridPanel.prototype.getPinnedLeftHeader = function () {
return this.ePinnedLeftHeader;
};
GridPanel.prototype.getPinnedRightHeader = function () {
return this.ePinnedRightHeader;
};
GridPanel.prototype.queryHtmlElement = function (selector) {
return this.eRoot.querySelector(selector);
};
GridPanel.prototype.findElements = function () {
if (this.forPrint) {
this.eRoot = utils_1.Utils.loadTemplate(gridForPrintHtml);
utils_1.Utils.addCssClass(this.eRoot, 'ag-root');
utils_1.Utils.addCssClass(this.eRoot, 'ag-font-style');
utils_1.Utils.addCssClass(this.eRoot, 'ag-no-scrolls');
}
else {
this.eRoot = utils_1.Utils.loadTemplate(gridHtml);
utils_1.Utils.addCssClass(this.eRoot, 'ag-root');
utils_1.Utils.addCssClass(this.eRoot, 'ag-font-style');
utils_1.Utils.addCssClass(this.eRoot, 'ag-scrolls');
}
if (this.forPrint) {
this.eHeaderContainer = this.queryHtmlElement('.ag-header-container');
this.eBodyContainer = this.queryHtmlElement('.ag-body-container');
this.eFloatingTopContainer = this.queryHtmlElement('.ag-floating-top-container');
this.eFloatingBottomContainer = this.queryHtmlElement('.ag-floating-bottom-container');
this.eAllCellContainers = [this.eBodyContainer, this.eFloatingTopContainer, this.eFloatingBottomContainer];
}
else {
this.eBody = this.queryHtmlElement('.ag-body');
this.eBodyContainer = this.queryHtmlElement('.ag-body-container');
this.eBodyViewport = this.queryHtmlElement('.ag-body-viewport');
this.eBodyViewportWrapper = this.queryHtmlElement('.ag-body-viewport-wrapper');
this.ePinnedLeftColsContainer = this.queryHtmlElement('.ag-pinned-left-cols-container');
this.ePinnedRightColsContainer = this.queryHtmlElement('.ag-pinned-right-cols-container');
this.ePinnedLeftColsViewport = this.queryHtmlElement('.ag-pinned-left-cols-viewport');
this.ePinnedRightColsViewport = this.queryHtmlElement('.ag-pinned-right-cols-viewport');
this.ePinnedLeftHeader = this.queryHtmlElement('.ag-pinned-left-header');
this.ePinnedRightHeader = this.queryHtmlElement('.ag-pinned-right-header');
this.eHeader = this.queryHtmlElement('.ag-header');
this.eHeaderContainer = this.queryHtmlElement('.ag-header-container');
this.eHeaderOverlay = this.queryHtmlElement('.ag-header-overlay');
this.eHeaderViewport = this.queryHtmlElement('.ag-header-viewport');
this.eFloatingTop = this.queryHtmlElement('.ag-floating-top');
this.ePinnedLeftFloatingTop = this.queryHtmlElement('.ag-pinned-left-floating-top');
this.ePinnedRightFloatingTop = this.queryHtmlElement('.ag-pinned-right-floating-top');
this.eFloatingTopContainer = this.queryHtmlElement('.ag-floating-top-container');
this.eFloatingTopViewport = this.queryHtmlElement('.ag-floating-top-viewport');
this.eFloatingBottom = this.queryHtmlElement('.ag-floating-bottom');
this.ePinnedLeftFloatingBottom = this.queryHtmlElement('.ag-pinned-left-floating-bottom');
this.ePinnedRightFloatingBottom = this.queryHtmlElement('.ag-pinned-right-floating-bottom');
this.eFloatingBottomContainer = this.queryHtmlElement('.ag-floating-bottom-container');
this.eFloatingBottomViewport = this.queryHtmlElement('.ag-floating-bottom-viewport');
this.eAllCellContainers = [this.ePinnedLeftColsContainer, this.ePinnedRightColsContainer, this.eBodyContainer,
this.eFloatingTop, this.eFloatingBottom];
// IE9, Chrome, Safari, Opera
this.ePinnedLeftColsViewport.addEventListener('mousewheel', this.pinnedLeftMouseWheelListener.bind(this));
this.eBodyViewport.addEventListener('mousewheel', this.centerMouseWheelListener.bind(this));
// Firefox
this.ePinnedLeftColsViewport.addEventListener('DOMMouseScroll', this.pinnedLeftMouseWheelListener.bind(this));
this.eBodyViewport.addEventListener('DOMMouseScroll', this.centerMouseWheelListener.bind(this));
}
};
GridPanel.prototype.getHeaderViewport = function () {
return this.eHeaderViewport;
};
GridPanel.prototype.centerMouseWheelListener = function (event) {
// we are only interested in mimicking the mouse wheel if we are pinning on the right,
// as if we are not pinning on the right, then we have scrollbars in the center body, and
// as such we just use the default browser wheel behaviour.
if (this.columnController.isPinningRight()) {
return this.generalMouseWheelListener(event, this.ePinnedRightColsViewport);
}
};
GridPanel.prototype.pinnedLeftMouseWheelListener = function (event) {
var targetPanel;
if (this.columnController.isPinningRight()) {
targetPanel = this.ePinnedRightColsViewport;
}
else {
targetPanel = this.eBodyViewport;
}
return this.generalMouseWheelListener(event, targetPanel);
};
GridPanel.prototype.generalMouseWheelListener = function (event, targetPanel) {
var wheelEvent = utils_1.Utils.normalizeWheel(event);
// we need to detect in which direction scroll is happening to allow trackpads scroll horizontally
// horizontal scroll
if (Math.abs(wheelEvent.pixelX) > Math.abs(wheelEvent.pixelY)) {
var newLeftPosition = this.eBodyViewport.scrollLeft + wheelEvent.pixelX;
this.eBodyViewport.scrollLeft = newLeftPosition;
}
else {
var newTopPosition = this.eBodyViewport.scrollTop + wheelEvent.pixelY;
targetPanel.scrollTop = newTopPosition;
}
// allow the option to pass mouse wheel events ot the browser
// https://github.com/ceolter/ag-grid/issues/800
// in the future, this should be tied in with 'forPrint' option, or have an option 'no vertical scrolls'
if (!this.gridOptionsWrapper.isSuppressPreventDefaultOnMouseWheel()) {
// if we don't prevent default, then the whole browser will scroll also as well as the grid
event.preventDefault();
}
return false;
};
GridPanel.prototype.onColumnResized = function () {
this.setWidthsOfContainers();
};
GridPanel.prototype.onDisplayedColumnsChanged = function () {
this.setWidthsOfContainers();
this.showPinnedColContainersIfNeeded();
this.sizeHeaderAndBody();
};
GridPanel.prototype.setWidthsOfContainers = function () {
this.logger.log('setWidthsOfContainers()');
this.showPinnedColContainersIfNeeded();
var mainRowWidth = this.columnController.getBodyContainerWidth() + 'px';
this.eBodyContainer.style.width = mainRowWidth;
if (this.forPrint) {
// pinned col doesn't exist when doing forPrint
return;
}
this.eFloatingBottomContainer.style.width = mainRowWidth;
this.eFloatingTopContainer.style.width = mainRowWidth;
var pinnedLeftWidth = this.columnController.getPinnedLeftContainerWidth() + 'px';
this.ePinnedLeftColsContainer.style.width = pinnedLeftWidth;
this.ePinnedLeftFloatingBottom.style.width = pinnedLeftWidth;
this.ePinnedLeftFloatingTop.style.width = pinnedLeftWidth;
this.eBodyViewportWrapper.style.marginLeft = pinnedLeftWidth;
var pinnedRightWidth = this.columnController.getPinnedRightContainerWidth() + 'px';
this.ePinnedRightColsContainer.style.width = pinnedRightWidth;
this.ePinnedRightFloatingBottom.style.width = pinnedRightWidth;
this.ePinnedRightFloatingTop.style.width = pinnedRightWidth;
this.eBodyViewportWrapper.style.marginRight = pinnedRightWidth;
};
GridPanel.prototype.showPinnedColContainersIfNeeded = function () {
// no need to do this if not using scrolls
if (this.forPrint) {
return;
}
//some browsers had layout issues with the blank divs, so if blank,
//we don't display them
if (this.columnController.isPinningLeft()) {
this.ePinnedLeftHeader.style.display = 'inline-block';
this.ePinnedLeftColsViewport.style.display = 'inline';
}
else {
this.ePinnedLeftHeader.style.display = 'none';
this.ePinnedLeftColsViewport.style.display = 'none';
}
if (this.columnController.isPinningRight()) {
this.ePinnedRightHeader.style.display = 'inline-block';
this.ePinnedRightColsViewport.style.display = 'inline';
this.eBodyViewport.style.overflowY = 'hidden';
}
else {
this.ePinnedRightHeader.style.display = 'none';
this.ePinnedRightColsViewport.style.display = 'none';
this.eBodyViewport.style.overflowY = 'auto';
}
};
GridPanel.prototype.sizeHeaderAndBody = function () {
if (this.forPrint) {
// if doing 'for print', then the header and footers are laid
// out naturally by the browser. it whatever size that's needed to fit.
return;
}
this.setLeftAndRightBounds();
var heightOfContainer = this.layout.getCentreHeight();
if (!heightOfContainer) {
return;
}
var headerHeight = this.gridOptionsWrapper.getHeaderHeight();
var numberOfRowsInHeader = this.columnController.getHeaderRowCount();
var totalHeaderHeight = headerHeight * numberOfRowsInHeader;
this.eHeader.style['height'] = totalHeaderHeight + 'px';
// padding top covers the header and the floating rows on top
var floatingTopHeight = this.floatingRowModel.getFloatingTopTotalHeight();
var paddingTop = totalHeaderHeight + floatingTopHeight;
// bottom is just the bottom floating rows
var floatingBottomHeight = this.floatingRowModel.getFloatingBottomTotalHeight();
var floatingBottomTop = heightOfContainer - floatingBottomHeight;
var heightOfCentreRows = heightOfContainer - totalHeaderHeight - floatingBottomHeight - floatingTopHeight;
this.eBody.style.paddingTop = paddingTop + 'px';
this.eBody.style.paddingBottom = floatingBottomHeight + 'px';
this.eFloatingTop.style.top = totalHeaderHeight + 'px';
this.eFloatingTop.style.height = floatingTopHeight + 'px';
this.eFloatingBottom.style.height = floatingBottomHeight + 'px';
this.eFloatingBottom.style.top = floatingBottomTop + 'px';
this.ePinnedLeftColsViewport.style.height = heightOfCentreRows + 'px';
this.ePinnedRightColsViewport.style.height = heightOfCentreRows + 'px';
};
GridPanel.prototype.setHorizontalScrollPosition = function (hScrollPosition) {
this.eBodyViewport.scrollLeft = hScrollPosition;
};
// tries to scroll by pixels, but returns what the result actually was
GridPanel.prototype.scrollHorizontally = function (pixels) {
var oldScrollPosition = this.eBodyViewport.scrollLeft;
this.setHorizontalScrollPosition(oldScrollPosition + pixels);
var newScrollPosition = this.eBodyViewport.scrollLeft;
return newScrollPosition - oldScrollPosition;
};
GridPanel.prototype.getHorizontalScrollPosition = function () {
if (this.forPrint) {
return 0;
}
else {
return this.eBodyViewport.scrollLeft;
}
};
GridPanel.prototype.turnOnAnimationForABit = function () {
var _this = this;
if (this.gridOptionsWrapper.isSuppressColumnMoveAnimation()) {
return;
}
this.animationThreadCount++;
var animationThreadCountCopy = this.animationThreadCount;
utils_1.Utils.addCssClass(this.eRoot, 'ag-column-moving');
setTimeout(function () {
if (_this.animationThreadCount === animationThreadCountCopy) {
utils_1.Utils.removeCssClass(_this.eRoot, 'ag-column-moving');
}
}, 300);
};
GridPanel.prototype.addScrollListener = function () {
var _this = this;
// if printing, then no scrolling, so no point in listening for scroll events
if (this.forPrint) {
return;
}
var that = this;
function onBodyViewportScroll() {
// we are always interested in horizontal scrolls of the body
var newLeftPosition = that.eBodyViewport.scrollLeft;
if (newLeftPosition !== that.lastLeftPosition) {
that.lastLeftPosition = newLeftPosition;
that.horizontallyScrollHeaderCenterAndFloatingCenter();
that.masterSlaveService.fireHorizontalScrollEvent(newLeftPosition);
that.setLeftAndRightBounds();
}
// if we are pinning to the right, then it's the right pinned container
// that has the scroll.
if (!that.columnController.isPinningRight()) {
var newTopPosition = that.eBodyViewport.scrollTop;
if (newTopPosition !== that.lastTopPosition) {
that.lastTopPosition = newTopPosition;
that.verticallyScrollLeftPinned(newTopPosition);
that.rowRenderer.drawVirtualRows();
}
}
}
function onPinnedRightScroll() {
var newTopPosition = that.ePinnedRightColsViewport.scrollTop;
if (newTopPosition !== that.lastTopPosition) {
that.lastTopPosition = newTopPosition;
that.verticallyScrollLeftPinned(newTopPosition);
that.verticallyScrollBody(newTopPosition);
that.rowRenderer.drawVirtualRows();
}
}
if (this.useScrollLag) {
this.eBodyViewport.addEventListener('scroll', this.debounce.bind(this, onBodyViewportScroll));
this.ePinnedRightColsViewport.addEventListener('scroll', this.debounce.bind(this, onPinnedRightScroll));
}
else {
this.eBodyViewport.addEventListener('scroll', onBodyViewportScroll);
this.ePinnedRightColsViewport.addEventListener('scroll', onPinnedRightScroll);
}
// this means the pinned panel was moved, which can only
// happen when the user is navigating in the pinned container
// as the pinned col should never scroll. so we rollback
// the scroll on the pinned.
this.ePinnedLeftColsViewport.addEventListener('scroll', function () {
_this.ePinnedLeftColsViewport.scrollTop = 0;
});
};
GridPanel.prototype.setLeftAndRightBounds = function () {
if (this.gridOptionsWrapper.isForPrint()) {
return;
}
var scrollPosition = this.eBodyViewport.scrollLeft;
var totalWidth = this.eBody.offsetWidth;
this.columnController.setWidthAndScrollPosition(totalWidth, scrollPosition);
};
GridPanel.prototype.isUseScrollLag = function () {
// if we are in IE or Safari, then we only redraw if there was no scroll event
// in the 50ms following this scroll event. without this, these browsers have
// a bad scrolling feel, where the redraws clog the scroll experience
// (makes the scroll clunky and sticky). this method is like throttling
// the scroll events.
// let the user override scroll lag option
if (this.gridOptionsWrapper.isSuppressScrollLag()) {
return false;
}
else if (this.gridOptionsWrapper.getIsScrollLag()) {
return this.gridOptionsWrapper.getIsScrollLag()();
}
else {
return utils_1.Utils.isBrowserIE() || utils_1.Utils.isBrowserSafari();
}
};
GridPanel.prototype.debounce = function (callback) {
var _this = this;
if (this.requestAnimationFrameExists && utils_1.Utils.isBrowserSafari()) {
if (!this.scrollLagTicking) {
this.scrollLagTicking = true;
requestAnimationFrame(function () {
callback();
_this.scrollLagTicking = false;
});
}
}
else {
this.scrollLagCounter++;
var scrollLagCounterCopy = this.scrollLagCounter;
setTimeout(function () {
if (_this.scrollLagCounter === scrollLagCounterCopy) {
callback();
}
}, 50);
}
};
GridPanel.prototype.horizontallyScrollHeaderCenterAndFloatingCenter = function () {
var bodyLeftPosition = this.eBodyViewport.scrollLeft;
this.eHeaderContainer.style.left = -bodyLeftPosition + 'px';
this.eFloatingBottomContainer.style.left = -bodyLeftPosition + 'px';
this.eFloatingTopContainer.style.left = -bodyLeftPosition + 'px';
};
GridPanel.prototype.verticallyScrollLeftPinned = function (bodyTopPosition) {
this.ePinnedLeftColsContainer.style.top = -bodyTopPosition + 'px';
};
GridPanel.prototype.verticallyScrollBody = function (position) {
this.eBodyViewport.scrollTop = position;
};
GridPanel.prototype.getVerticalScrollPosition = function () {
if (this.forPrint) {
return 0;
}
else {
return this.eBodyViewport.scrollTop;
}
};
GridPanel.prototype.getBodyViewportClientRect = function () {
if (this.forPrint) {
return this.eBodyContainer.getBoundingClientRect();
}
else {
return this.eBodyViewport.getBoundingClientRect();
}
};
GridPanel.prototype.getFloatingTopClientRect = function () {
if (this.forPrint) {
return this.eFloatingTopContainer.getBoundingClientRect();
}
else {
return this.eFloatingTop.getBoundingClientRect();
}
};
GridPanel.prototype.getFloatingBottomClientRect = function () {
if (this.forPrint) {
return this.eFloatingBottomContainer.getBoundingClientRect();
}
else {
return this.eFloatingBottom.getBoundingClientRect();
}
};
GridPanel.prototype.getPinnedLeftColsViewportClientRect = function () {
return this.ePinnedLeftColsViewport.getBoundingClientRect();
};
GridPanel.prototype.getPinnedRightColsViewportClientRect = function () {
return this.ePinnedRightColsViewport.getBoundingClientRect();
};
GridPanel.prototype.addScrollEventListener = function (listener) {
this.eBodyViewport.addEventListener('scroll', listener);
};
GridPanel.prototype.removeScrollEventListener = function (listener) {
this.eBodyViewport.removeEventListener('scroll', listener);
};
__decorate([
context_1.Autowired('masterSlaveService'),
__metadata('design:type', masterSlaveService_1.MasterSlaveService)
], GridPanel.prototype, "masterSlaveService", void 0);
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], GridPanel.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', columnController_1.ColumnController)
], GridPanel.prototype, "columnController", void 0);
__decorate([
context_1.Autowired('rowRenderer'),
__metadata('design:type', rowRenderer_1.RowRenderer)
], GridPanel.prototype, "rowRenderer", void 0);
__decorate([
context_1.Autowired('floatingRowModel'),
__metadata('design:type', floatingRowModel_1.FloatingRowModel)
], GridPanel.prototype, "floatingRowModel", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], GridPanel.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('rowModel'),
__metadata('design:type', Object)
], GridPanel.prototype, "rowModel", void 0);
__decorate([
context_1.Optional('rangeController'),
__metadata('design:type', Object)
], GridPanel.prototype, "rangeController", void 0);
__decorate([
context_1.Autowired('dragService'),
__metadata('design:type', dragService_1.DragService)
], GridPanel.prototype, "dragService", void 0);
__decorate([
context_1.Autowired('selectionController'),
__metadata('design:type', selectionController_1.SelectionController)
], GridPanel.prototype, "selectionController", void 0);
__decorate([
context_1.Optional('clipboardService'),
__metadata('design:type', Object)
], GridPanel.prototype, "clipboardService", void 0);
__decorate([
context_1.Autowired('csvCreator'),
__metadata('design:type', csvCreator_1.CsvCreator)
], GridPanel.prototype, "csvCreator", void 0);
__decorate([
context_1.Autowired('mouseEventService'),
__metadata('design:type', mouseEventService_1.MouseEventService)
], GridPanel.prototype, "mouseEventService", void 0);
__decorate([
context_1.Autowired('focusedCellController'),
__metadata('design:type', focusedCellController_1.FocusedCellController)
], GridPanel.prototype, "focusedCellController", void 0);
__decorate([
context_1.Autowired('$scope'),
__metadata('design:type', Object)
], GridPanel.prototype, "$scope", void 0);
__decorate([
__param(0, context_1.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], GridPanel.prototype, "agWire", null);
__decorate([
context_1.PreDestroy,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridPanel.prototype, "destroy", null);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], GridPanel.prototype, "init", null);
GridPanel = __decorate([
context_1.Bean('gridPanel'),
__metadata('design:paramtypes', [])
], GridPanel);
return GridPanel;
})();
exports.GridPanel = GridPanel;
| dada0423/cdnjs | ajax/libs/ag-grid/5.0.3/lib/gridPanel/gridPanel.js | JavaScript | mit | 48,247 |
/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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.
*/
package android.support.v4.app;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
class TaskStackBuilderJellybean {
public static PendingIntent getActivitiesPendingIntent(Context context, int requestCode,
Intent[] intents, int flags, Bundle options) {
return PendingIntent.getActivities(context, requestCode, intents, flags, options);
}
}
| madhavanks26/com.vliesaputra.deviceinformation | src/com/vliesaputra/cordova/plugins/android/support/v4/src/jellybean/android/support/v4/app/TaskStackBuilderJellybean.java | Java | mit | 1,065 |
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: /Users/ex3ndr/Develop/actor-proprietary/actor-apps/core/src/main/java/im/actor/model/entity/MessageState.java
//
#include "IOSClass.h"
#include "J2ObjC_source.h"
#include "im/actor/model/entity/MessageState.h"
#include "java/lang/Enum.h"
#include "java/lang/IllegalArgumentException.h"
__attribute__((unused)) static void AMMessageStateEnum_initWithInt_withNSString_withInt_(AMMessageStateEnum *self, jint value, NSString *__name, jint __ordinal);
__attribute__((unused)) static AMMessageStateEnum *new_AMMessageStateEnum_initWithInt_withNSString_withInt_(jint value, NSString *__name, jint __ordinal) NS_RETURNS_RETAINED;
J2OBJC_INITIALIZED_DEFN(AMMessageStateEnum)
AMMessageStateEnum *AMMessageStateEnum_values_[6];
@implementation AMMessageStateEnum
- (instancetype)initWithInt:(jint)value
withNSString:(NSString *)__name
withInt:(jint)__ordinal {
AMMessageStateEnum_initWithInt_withNSString_withInt_(self, value, __name, __ordinal);
return self;
}
- (jint)getValue {
return value_;
}
+ (AMMessageStateEnum *)fromValueWithInt:(jint)value {
return AMMessageStateEnum_fromValueWithInt_(value);
}
IOSObjectArray *AMMessageStateEnum_values() {
AMMessageStateEnum_initialize();
return [IOSObjectArray arrayWithObjects:AMMessageStateEnum_values_ count:6 type:AMMessageStateEnum_class_()];
}
+ (IOSObjectArray *)values {
return AMMessageStateEnum_values();
}
+ (AMMessageStateEnum *)valueOfWithNSString:(NSString *)name {
return AMMessageStateEnum_valueOfWithNSString_(name);
}
AMMessageStateEnum *AMMessageStateEnum_valueOfWithNSString_(NSString *name) {
AMMessageStateEnum_initialize();
for (int i = 0; i < 6; i++) {
AMMessageStateEnum *e = AMMessageStateEnum_values_[i];
if ([name isEqual:[e name]]) {
return e;
}
}
@throw [[JavaLangIllegalArgumentException alloc] initWithNSString:name];
return nil;
}
- (id)copyWithZone:(NSZone *)zone {
return self;
}
+ (void)initialize {
if (self == [AMMessageStateEnum class]) {
AMMessageStateEnum_PENDING = new_AMMessageStateEnum_initWithInt_withNSString_withInt_(1, @"PENDING", 0);
AMMessageStateEnum_SENT = new_AMMessageStateEnum_initWithInt_withNSString_withInt_(2, @"SENT", 1);
AMMessageStateEnum_RECEIVED = new_AMMessageStateEnum_initWithInt_withNSString_withInt_(3, @"RECEIVED", 2);
AMMessageStateEnum_READ = new_AMMessageStateEnum_initWithInt_withNSString_withInt_(4, @"READ", 3);
AMMessageStateEnum_ERROR = new_AMMessageStateEnum_initWithInt_withNSString_withInt_(5, @"ERROR", 4);
AMMessageStateEnum_UNKNOWN = new_AMMessageStateEnum_initWithInt_withNSString_withInt_(6, @"UNKNOWN", 5);
J2OBJC_SET_INITIALIZED(AMMessageStateEnum)
}
}
@end
void AMMessageStateEnum_initWithInt_withNSString_withInt_(AMMessageStateEnum *self, jint value, NSString *__name, jint __ordinal) {
(void) JavaLangEnum_initWithNSString_withInt_(self, __name, __ordinal);
self->value_ = value;
}
AMMessageStateEnum *new_AMMessageStateEnum_initWithInt_withNSString_withInt_(jint value, NSString *__name, jint __ordinal) {
AMMessageStateEnum *self = [AMMessageStateEnum alloc];
AMMessageStateEnum_initWithInt_withNSString_withInt_(self, value, __name, __ordinal);
return self;
}
AMMessageStateEnum *AMMessageStateEnum_fromValueWithInt_(jint value) {
AMMessageStateEnum_initialize();
switch (value) {
case 1:
return AMMessageStateEnum_PENDING;
case 2:
return AMMessageStateEnum_SENT;
case 3:
return AMMessageStateEnum_RECEIVED;
case 4:
return AMMessageStateEnum_READ;
case 5:
return AMMessageStateEnum_ERROR;
default:
case 6:
return AMMessageStateEnum_UNKNOWN;
}
}
J2OBJC_CLASS_TYPE_LITERAL_SOURCE(AMMessageStateEnum)
| Jeremy-Meng/actor-platform | actor-apps/core-cocoa/src/im/actor/model/entity/MessageState.m | Matlab | mit | 3,802 |
/**
* The following features are still outstanding: popup delay, animation as a
* function, placement as a function, inside, support for more triggers than
* just mouse enter/leave, and selector delegatation.
*/
angular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip'])
.directive('uibPopoverTemplatePopup', function() {
return {
replace: true,
scope: { title: '@', contentExp: '&', placement: '@', popupClass: '@', animation: '&', isOpen: '&',
originScope: '&' },
templateUrl: 'uib/template/popover/popover-template.html'
};
})
.directive('uibPopoverTemplate', ['$uibTooltip', function($uibTooltip) {
return $uibTooltip('uibPopoverTemplate', 'popover', 'click', {
useContentExp: true
});
}])
.directive('uibPopoverHtmlPopup', function() {
return {
replace: true,
scope: { contentExp: '&', title: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },
templateUrl: 'uib/template/popover/popover-html.html'
};
})
.directive('uibPopoverHtml', ['$uibTooltip', function($uibTooltip) {
return $uibTooltip('uibPopoverHtml', 'popover', 'click', {
useContentExp: true
});
}])
.directive('uibPopoverPopup', function() {
return {
replace: true,
scope: { title: '@', content: '@', placement: '@', popupClass: '@', animation: '&', isOpen: '&' },
templateUrl: 'uib/template/popover/popover.html'
};
})
.directive('uibPopover', ['$uibTooltip', function($uibTooltip) {
return $uibTooltip('uibPopover', 'popover', 'click');
}]);
| PedroF20/angular-tracemysteps | node_modules/angular-ui-bootstrap/src/popover/popover.js | JavaScript | mit | 1,516 |
/*jshint strict:false */
/*global enyo:false */
enyo.kind({
name: 'ToDo.NotepadFooterView',
tag: 'footer',
id: 'footer',
showing: false,
components: [{
tag: 'span',
id: 'todo-count',
components: [{
name: 'count',
id: 'count-number',
tag: 'strong'
}, {
name: 'countText',
id: 'countText',
tag: 'span'
}]
}, {
tag: 'ul',
id: 'filters',
components: [{
tag: 'li',
components: [{
tag: 'a',
id: 'tagAll',
attributes: {
class: 'selected',
href: '#/'
},
content: 'All'
}]
}, {
tag: 'li',
components: [{
tag: 'a',
id: 'tagActive',
attributes: {
href: '#/active'
},
content: 'Active'
}]
}, {
tag: 'li',
components: [{
tag: 'a',
id: 'tagComplete',
attributes: {
href: '#/completed'
},
content: 'Completed'
}]
}]
}, {
kind: 'enyo.Button',
name: 'clear-completed',
id: 'clear-completed',
controller: 'ToDo.notepadcontroller',
showing: false,
handlers: {
ontap: 'clearCompleted'
},
clearCompleted: function (inSender, inEvent) {
this.bubble('onClearCompleted');
inEvent.preventDefault();
return true;
}
}]
});
| chrisfcarroll/todomvc | examples/enyo_backbone/js/views/NotepadFooterView.js | JavaScript | mit | 1,184 |
/**
* Supported keybindings:
*
* Motion:
* h, j, k, l
* gj, gk
* e, E, w, W, b, B, ge, gE
* f<character>, F<character>, t<character>, T<character>
* $, ^, 0, -, +, _
* gg, G
* %
* '<character>, `<character>
*
* Operator:
* d, y, c
* dd, yy, cc
* g~, g~g~
* >, <, >>, <<
*
* Operator-Motion:
* x, X, D, Y, C, ~
*
* Action:
* a, i, s, A, I, S, o, O
* zz, z., z<CR>, zt, zb, z-
* J
* u, Ctrl-r
* m<character>
* r<character>
*
* Modes:
* ESC - leave insert mode, visual mode, and clear input state.
* Ctrl-[, Ctrl-c - same as ESC.
*
* Registers: unnamed, -, a-z, A-Z, 0-9
* (Does not respect the special case for number registers when delete
* operator is made with these commands: %, (, ), , /, ?, n, N, {, } )
* TODO: Implement the remaining registers.
* Marks: a-z, A-Z, and 0-9
* TODO: Implement the remaining special marks. They have more complex
* behavior.
*
* Events:
* 'vim-mode-change' - raised on the editor anytime the current mode changes,
* Event object: {mode: "visual", subMode: "linewise"}
*
* Code structure:
* 1. Default keymap
* 2. Variable declarations and short basic helpers
* 3. Instance (External API) implementation
* 4. Internal state tracking objects (input state, counter) implementation
* and instanstiation
* 5. Key handler (the main command dispatcher) implementation
* 6. Motion, operator, and action implementations
* 7. Helper functions for the key handler, motions, operators, and actions
* 8. Set up Vim to work as a keymap for CodeMirror.
*/
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/dialog/dialog"), require("../addon/edit/matchbrackets.js"));
else if (typeof define == "function" && define.amd) // AMD
define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/dialog/dialog", "../addon/edit/matchbrackets"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
'use strict';
var defaultKeymap = [
// Key to key mapping. This goes first to make it possible to override
// existing mappings.
{ keys: ['<Left>'], type: 'keyToKey', toKeys: ['h'] },
{ keys: ['<Right>'], type: 'keyToKey', toKeys: ['l'] },
{ keys: ['<Up>'], type: 'keyToKey', toKeys: ['k'] },
{ keys: ['<Down>'], type: 'keyToKey', toKeys: ['j'] },
{ keys: ['<Space>'], type: 'keyToKey', toKeys: ['l'] },
{ keys: ['<BS>'], type: 'keyToKey', toKeys: ['h'] },
{ keys: ['<C-Space>'], type: 'keyToKey', toKeys: ['W'] },
{ keys: ['<C-BS>'], type: 'keyToKey', toKeys: ['B'] },
{ keys: ['<S-Space>'], type: 'keyToKey', toKeys: ['w'] },
{ keys: ['<S-BS>'], type: 'keyToKey', toKeys: ['b'] },
{ keys: ['<C-n>'], type: 'keyToKey', toKeys: ['j'] },
{ keys: ['<C-p>'], type: 'keyToKey', toKeys: ['k'] },
{ keys: ['<C-[>'], type: 'keyToKey', toKeys: ['<Esc>'] },
{ keys: ['<C-c>'], type: 'keyToKey', toKeys: ['<Esc>'] },
{ keys: ['s'], type: 'keyToKey', toKeys: ['c', 'l'], context: 'normal' },
{ keys: ['s'], type: 'keyToKey', toKeys: ['x', 'i'], context: 'visual'},
{ keys: ['S'], type: 'keyToKey', toKeys: ['c', 'c'], context: 'normal' },
{ keys: ['S'], type: 'keyToKey', toKeys: ['d', 'c', 'c'], context: 'visual' },
{ keys: ['<Home>'], type: 'keyToKey', toKeys: ['0'] },
{ keys: ['<End>'], type: 'keyToKey', toKeys: ['$'] },
{ keys: ['<PageUp>'], type: 'keyToKey', toKeys: ['<C-b>'] },
{ keys: ['<PageDown>'], type: 'keyToKey', toKeys: ['<C-f>'] },
{ keys: ['<CR>'], type: 'keyToKey', toKeys: ['j', '^'], context: 'normal' },
// Motions
{ keys: ['H'], type: 'motion',
motion: 'moveToTopLine',
motionArgs: { linewise: true, toJumplist: true }},
{ keys: ['M'], type: 'motion',
motion: 'moveToMiddleLine',
motionArgs: { linewise: true, toJumplist: true }},
{ keys: ['L'], type: 'motion',
motion: 'moveToBottomLine',
motionArgs: { linewise: true, toJumplist: true }},
{ keys: ['h'], type: 'motion',
motion: 'moveByCharacters',
motionArgs: { forward: false }},
{ keys: ['l'], type: 'motion',
motion: 'moveByCharacters',
motionArgs: { forward: true }},
{ keys: ['j'], type: 'motion',
motion: 'moveByLines',
motionArgs: { forward: true, linewise: true }},
{ keys: ['k'], type: 'motion',
motion: 'moveByLines',
motionArgs: { forward: false, linewise: true }},
{ keys: ['g','j'], type: 'motion',
motion: 'moveByDisplayLines',
motionArgs: { forward: true }},
{ keys: ['g','k'], type: 'motion',
motion: 'moveByDisplayLines',
motionArgs: { forward: false }},
{ keys: ['w'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: true, wordEnd: false }},
{ keys: ['W'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: true, wordEnd: false, bigWord: true }},
{ keys: ['e'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: true, wordEnd: true, inclusive: true }},
{ keys: ['E'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: true, wordEnd: true, bigWord: true,
inclusive: true }},
{ keys: ['b'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: false, wordEnd: false }},
{ keys: ['B'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: false, wordEnd: false, bigWord: true }},
{ keys: ['g', 'e'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: false, wordEnd: true, inclusive: true }},
{ keys: ['g', 'E'], type: 'motion',
motion: 'moveByWords',
motionArgs: { forward: false, wordEnd: true, bigWord: true,
inclusive: true }},
{ keys: ['{'], type: 'motion', motion: 'moveByParagraph',
motionArgs: { forward: false, toJumplist: true }},
{ keys: ['}'], type: 'motion', motion: 'moveByParagraph',
motionArgs: { forward: true, toJumplist: true }},
{ keys: ['<C-f>'], type: 'motion',
motion: 'moveByPage', motionArgs: { forward: true }},
{ keys: ['<C-b>'], type: 'motion',
motion: 'moveByPage', motionArgs: { forward: false }},
{ keys: ['<C-d>'], type: 'motion',
motion: 'moveByScroll',
motionArgs: { forward: true, explicitRepeat: true }},
{ keys: ['<C-u>'], type: 'motion',
motion: 'moveByScroll',
motionArgs: { forward: false, explicitRepeat: true }},
{ keys: ['g', 'g'], type: 'motion',
motion: 'moveToLineOrEdgeOfDocument',
motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }},
{ keys: ['G'], type: 'motion',
motion: 'moveToLineOrEdgeOfDocument',
motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }},
{ keys: ['0'], type: 'motion', motion: 'moveToStartOfLine' },
{ keys: ['^'], type: 'motion',
motion: 'moveToFirstNonWhiteSpaceCharacter' },
{ keys: ['+'], type: 'motion',
motion: 'moveByLines',
motionArgs: { forward: true, toFirstChar:true }},
{ keys: ['-'], type: 'motion',
motion: 'moveByLines',
motionArgs: { forward: false, toFirstChar:true }},
{ keys: ['_'], type: 'motion',
motion: 'moveByLines',
motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }},
{ keys: ['$'], type: 'motion',
motion: 'moveToEol',
motionArgs: { inclusive: true }},
{ keys: ['%'], type: 'motion',
motion: 'moveToMatchedSymbol',
motionArgs: { inclusive: true, toJumplist: true }},
{ keys: ['f', 'character'], type: 'motion',
motion: 'moveToCharacter',
motionArgs: { forward: true , inclusive: true }},
{ keys: ['F', 'character'], type: 'motion',
motion: 'moveToCharacter',
motionArgs: { forward: false }},
{ keys: ['t', 'character'], type: 'motion',
motion: 'moveTillCharacter',
motionArgs: { forward: true, inclusive: true }},
{ keys: ['T', 'character'], type: 'motion',
motion: 'moveTillCharacter',
motionArgs: { forward: false }},
{ keys: [';'], type: 'motion', motion: 'repeatLastCharacterSearch',
motionArgs: { forward: true }},
{ keys: [','], type: 'motion', motion: 'repeatLastCharacterSearch',
motionArgs: { forward: false }},
{ keys: ['\'', 'character'], type: 'motion', motion: 'goToMark',
motionArgs: {toJumplist: true, linewise: true}},
{ keys: ['`', 'character'], type: 'motion', motion: 'goToMark',
motionArgs: {toJumplist: true}},
{ keys: [']', '`'], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } },
{ keys: ['[', '`'], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } },
{ keys: [']', '\''], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } },
{ keys: ['[', '\''], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } },
// the next two aren't motions but must come before more general motion declarations
{ keys: [']', 'p'], type: 'action', action: 'paste', isEdit: true,
actionArgs: { after: true, isEdit: true, matchIndent: true}},
{ keys: ['[', 'p'], type: 'action', action: 'paste', isEdit: true,
actionArgs: { after: false, isEdit: true, matchIndent: true}},
{ keys: [']', 'character'], type: 'motion',
motion: 'moveToSymbol',
motionArgs: { forward: true, toJumplist: true}},
{ keys: ['[', 'character'], type: 'motion',
motion: 'moveToSymbol',
motionArgs: { forward: false, toJumplist: true}},
{ keys: ['|'], type: 'motion',
motion: 'moveToColumn',
motionArgs: { }},
{ keys: ['o'], type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: { },context:'visual'},
// Operators
{ keys: ['d'], type: 'operator', operator: 'delete' },
{ keys: ['y'], type: 'operator', operator: 'yank' },
{ keys: ['c'], type: 'operator', operator: 'change' },
{ keys: ['>'], type: 'operator', operator: 'indent',
operatorArgs: { indentRight: true }},
{ keys: ['<'], type: 'operator', operator: 'indent',
operatorArgs: { indentRight: false }},
{ keys: ['g', '~'], type: 'operator', operator: 'swapcase' },
{ keys: ['n'], type: 'motion', motion: 'findNext',
motionArgs: { forward: true, toJumplist: true }},
{ keys: ['N'], type: 'motion', motion: 'findNext',
motionArgs: { forward: false, toJumplist: true }},
// Operator-Motion dual commands
{ keys: ['x'], type: 'operatorMotion', operator: 'delete',
motion: 'moveByCharacters', motionArgs: { forward: true },
operatorMotionArgs: { visualLine: false }},
{ keys: ['X'], type: 'operatorMotion', operator: 'delete',
motion: 'moveByCharacters', motionArgs: { forward: false },
operatorMotionArgs: { visualLine: true }},
{ keys: ['D'], type: 'operatorMotion', operator: 'delete',
motion: 'moveToEol', motionArgs: { inclusive: true },
operatorMotionArgs: { visualLine: true }},
{ keys: ['Y'], type: 'operatorMotion', operator: 'yank',
motion: 'moveToEol', motionArgs: { inclusive: true },
operatorMotionArgs: { visualLine: true }},
{ keys: ['C'], type: 'operatorMotion',
operator: 'change',
motion: 'moveToEol', motionArgs: { inclusive: true },
operatorMotionArgs: { visualLine: true }},
{ keys: ['~'], type: 'operatorMotion',
operator: 'swapcase', operatorArgs: { shouldMoveCursor: true },
motion: 'moveByCharacters', motionArgs: { forward: true }},
// Actions
{ keys: ['<C-i>'], type: 'action', action: 'jumpListWalk',
actionArgs: { forward: true }},
{ keys: ['<C-o>'], type: 'action', action: 'jumpListWalk',
actionArgs: { forward: false }},
{ keys: ['<C-e>'], type: 'action',
action: 'scroll',
actionArgs: { forward: true, linewise: true }},
{ keys: ['<C-y>'], type: 'action',
action: 'scroll',
actionArgs: { forward: false, linewise: true }},
{ keys: ['a'], type: 'action', action: 'enterInsertMode', isEdit: true,
actionArgs: { insertAt: 'charAfter' }},
{ keys: ['A'], type: 'action', action: 'enterInsertMode', isEdit: true,
actionArgs: { insertAt: 'eol' }},
{ keys: ['i'], type: 'action', action: 'enterInsertMode', isEdit: true,
actionArgs: { insertAt: 'inplace' }},
{ keys: ['I'], type: 'action', action: 'enterInsertMode', isEdit: true,
actionArgs: { insertAt: 'firstNonBlank' }},
{ keys: ['o'], type: 'action', action: 'newLineAndEnterInsertMode',
isEdit: true, interlaceInsertRepeat: true,
actionArgs: { after: true }},
{ keys: ['O'], type: 'action', action: 'newLineAndEnterInsertMode',
isEdit: true, interlaceInsertRepeat: true,
actionArgs: { after: false }},
{ keys: ['v'], type: 'action', action: 'toggleVisualMode' },
{ keys: ['V'], type: 'action', action: 'toggleVisualMode',
actionArgs: { linewise: true }},
{ keys: ['g', 'v'], type: 'action', action: 'reselectLastSelection' },
{ keys: ['J'], type: 'action', action: 'joinLines', isEdit: true },
{ keys: ['p'], type: 'action', action: 'paste', isEdit: true,
actionArgs: { after: true, isEdit: true }},
{ keys: ['P'], type: 'action', action: 'paste', isEdit: true,
actionArgs: { after: false, isEdit: true }},
{ keys: ['r', 'character'], type: 'action', action: 'replace', isEdit: true },
{ keys: ['@', 'character'], type: 'action', action: 'replayMacro' },
{ keys: ['q', 'character'], type: 'action', action: 'enterMacroRecordMode' },
// Handle Replace-mode as a special case of insert mode.
{ keys: ['R'], type: 'action', action: 'enterInsertMode', isEdit: true,
actionArgs: { replace: true }},
{ keys: ['u'], type: 'action', action: 'undo' },
{ keys: ['<C-r>'], type: 'action', action: 'redo' },
{ keys: ['m', 'character'], type: 'action', action: 'setMark' },
{ keys: ['"', 'character'], type: 'action', action: 'setRegister' },
{ keys: ['z', 'z'], type: 'action', action: 'scrollToCursor',
actionArgs: { position: 'center' }},
{ keys: ['z', '.'], type: 'action', action: 'scrollToCursor',
actionArgs: { position: 'center' },
motion: 'moveToFirstNonWhiteSpaceCharacter' },
{ keys: ['z', 't'], type: 'action', action: 'scrollToCursor',
actionArgs: { position: 'top' }},
{ keys: ['z', '<CR>'], type: 'action', action: 'scrollToCursor',
actionArgs: { position: 'top' },
motion: 'moveToFirstNonWhiteSpaceCharacter' },
{ keys: ['z', '-'], type: 'action', action: 'scrollToCursor',
actionArgs: { position: 'bottom' }},
{ keys: ['z', 'b'], type: 'action', action: 'scrollToCursor',
actionArgs: { position: 'bottom' },
motion: 'moveToFirstNonWhiteSpaceCharacter' },
{ keys: ['.'], type: 'action', action: 'repeatLastEdit' },
{ keys: ['<C-a>'], type: 'action', action: 'incrementNumberToken',
isEdit: true,
actionArgs: {increase: true, backtrack: false}},
{ keys: ['<C-x>'], type: 'action', action: 'incrementNumberToken',
isEdit: true,
actionArgs: {increase: false, backtrack: false}},
// Text object motions
{ keys: ['a', 'character'], type: 'motion',
motion: 'textObjectManipulation' },
{ keys: ['i', 'character'], type: 'motion',
motion: 'textObjectManipulation',
motionArgs: { textObjectInner: true }},
// Search
{ keys: ['/'], type: 'search',
searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }},
{ keys: ['?'], type: 'search',
searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }},
{ keys: ['*'], type: 'search',
searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},
{ keys: ['#'], type: 'search',
searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }},
{ keys: ['g', '*'], type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }},
{ keys: ['g', '#'], type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }},
// Ex command
{ keys: [':'], type: 'ex' }
];
var Pos = CodeMirror.Pos;
var Vim = function() {
CodeMirror.defineOption('vimMode', false, function(cm, val) {
if (val) {
cm.setOption('keyMap', 'vim');
cm.setOption('disableInput', true);
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
cm.on('beforeSelectionChange', beforeSelectionChange);
cm.on('cursorActivity', onCursorActivity);
maybeInitVimState(cm);
CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm));
} else if (cm.state.vim) {
cm.setOption('keyMap', 'default');
cm.setOption('disableInput', false);
cm.off('beforeSelectionChange', beforeSelectionChange);
cm.off('cursorActivity', onCursorActivity);
CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm));
cm.state.vim = null;
}
});
function beforeSelectionChange(cm, obj) {
var vim = cm.state.vim;
if (vim.insertMode || vim.exMode) return;
var head = obj.ranges[0].head;
var anchor = obj.ranges[0].anchor;
if (head.ch && head.ch == cm.doc.getLine(head.line).length) {
var pos = Pos(head.line, head.ch - 1);
obj.update([{anchor: cursorEqual(head, anchor) ? pos : anchor,
head: pos}]);
}
}
function getOnPasteFn(cm) {
var vim = cm.state.vim;
if (!vim.onPasteFn) {
vim.onPasteFn = function() {
if (!vim.insertMode) {
cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));
actions.enterInsertMode(cm, {}, vim);
}
};
}
return vim.onPasteFn;
}
var numberRegex = /[\d]/;
var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)];
function makeKeyRange(start, size) {
var keys = [];
for (var i = start; i < start + size; i++) {
keys.push(String.fromCharCode(i));
}
return keys;
}
var upperCaseAlphabet = makeKeyRange(65, 26);
var lowerCaseAlphabet = makeKeyRange(97, 26);
var numbers = makeKeyRange(48, 10);
var specialSymbols = '~`!@#$%^&*()_-+=[{}]\\|/?.,<>:;"\''.split('');
var specialKeys = ['Left', 'Right', 'Up', 'Down', 'Space', 'Backspace',
'Esc', 'Home', 'End', 'PageUp', 'PageDown', 'Enter'];
var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);
var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':']);
function isLine(cm, line) {
return line >= cm.firstLine() && line <= cm.lastLine();
}
function isLowerCase(k) {
return (/^[a-z]$/).test(k);
}
function isMatchableSymbol(k) {
return '()[]{}'.indexOf(k) != -1;
}
function isNumber(k) {
return numberRegex.test(k);
}
function isUpperCase(k) {
return (/^[A-Z]$/).test(k);
}
function isWhiteSpaceString(k) {
return (/^\s*$/).test(k);
}
function inArray(val, arr) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == val) {
return true;
}
}
return false;
}
var options = {};
function defineOption(name, defaultValue, type) {
if (defaultValue === undefined) { throw Error('defaultValue is required'); }
if (!type) { type = 'string'; }
options[name] = {
type: type,
defaultValue: defaultValue
};
setOption(name, defaultValue);
}
function setOption(name, value) {
var option = options[name];
if (!option) {
throw Error('Unknown option: ' + name);
}
if (option.type == 'boolean') {
if (value && value !== true) {
throw Error('Invalid argument: ' + name + '=' + value);
} else if (value !== false) {
// Boolean options are set to true if value is not defined.
value = true;
}
}
option.value = option.type == 'boolean' ? !!value : value;
}
function getOption(name) {
var option = options[name];
if (!option) {
throw Error('Unknown option: ' + name);
}
return option.value;
}
var createCircularJumpList = function() {
var size = 100;
var pointer = -1;
var head = 0;
var tail = 0;
var buffer = new Array(size);
function add(cm, oldCur, newCur) {
var current = pointer % size;
var curMark = buffer[current];
function useNextSlot(cursor) {
var next = ++pointer % size;
var trashMark = buffer[next];
if (trashMark) {
trashMark.clear();
}
buffer[next] = cm.setBookmark(cursor);
}
if (curMark) {
var markPos = curMark.find();
// avoid recording redundant cursor position
if (markPos && !cursorEqual(markPos, oldCur)) {
useNextSlot(oldCur);
}
} else {
useNextSlot(oldCur);
}
useNextSlot(newCur);
head = pointer;
tail = pointer - size + 1;
if (tail < 0) {
tail = 0;
}
}
function move(cm, offset) {
pointer += offset;
if (pointer > head) {
pointer = head;
} else if (pointer < tail) {
pointer = tail;
}
var mark = buffer[(size + pointer) % size];
// skip marks that are temporarily removed from text buffer
if (mark && !mark.find()) {
var inc = offset > 0 ? 1 : -1;
var newCur;
var oldCur = cm.getCursor();
do {
pointer += inc;
mark = buffer[(size + pointer) % size];
// skip marks that are the same as current position
if (mark &&
(newCur = mark.find()) &&
!cursorEqual(oldCur, newCur)) {
break;
}
} while (pointer < head && pointer > tail);
}
return mark;
}
return {
cachedCursor: undefined, //used for # and * jumps
add: add,
move: move
};
};
// Returns an object to track the changes associated insert mode. It
// clones the object that is passed in, or creates an empty object one if
// none is provided.
var createInsertModeChanges = function(c) {
if (c) {
// Copy construction
return {
changes: c.changes,
expectCursorActivityForChange: c.expectCursorActivityForChange
};
}
return {
// Change list
changes: [],
// Set to true on change, false on cursorActivity.
expectCursorActivityForChange: false
};
};
function MacroModeState() {
this.latestRegister = undefined;
this.isPlaying = false;
this.isRecording = false;
this.replaySearchQueries = [];
this.onRecordingDone = undefined;
this.lastInsertModeChanges = createInsertModeChanges();
}
MacroModeState.prototype = {
exitMacroRecordMode: function() {
var macroModeState = vimGlobalState.macroModeState;
macroModeState.onRecordingDone(); // close dialog
macroModeState.onRecordingDone = undefined;
macroModeState.isRecording = false;
},
enterMacroRecordMode: function(cm, registerName) {
var register =
vimGlobalState.registerController.getRegister(registerName);
if (register) {
register.clear();
this.latestRegister = registerName;
this.onRecordingDone = cm.openDialog(
'(recording)['+registerName+']', null, {bottom:true});
this.isRecording = true;
}
}
};
function maybeInitVimState(cm) {
if (!cm.state.vim) {
// Store instance state in the CodeMirror object.
cm.state.vim = {
inputState: new InputState(),
// Vim's input state that triggered the last edit, used to repeat
// motions and operators with '.'.
lastEditInputState: undefined,
// Vim's action command before the last edit, used to repeat actions
// with '.' and insert mode repeat.
lastEditActionCommand: undefined,
// When using jk for navigation, if you move from a longer line to a
// shorter line, the cursor may clip to the end of the shorter line.
// If j is pressed again and cursor goes to the next line, the
// cursor should go back to its horizontal position on the longer
// line if it can. This is to keep track of the horizontal position.
lastHPos: -1,
// Doing the same with screen-position for gj/gk
lastHSPos: -1,
// The last motion command run. Cleared if a non-motion command gets
// executed in between.
lastMotion: null,
marks: {},
insertMode: false,
// Repeat count for changes made in insert mode, triggered by key
// sequences like 3,i. Only exists when insertMode is true.
insertModeRepeat: undefined,
visualMode: false,
// If we are in visual line mode. No effect if visualMode is false.
visualLine: false,
lastSelection: null
};
}
return cm.state.vim;
}
var vimGlobalState;
function resetVimGlobalState() {
vimGlobalState = {
// The current search query.
searchQuery: null,
// Whether we are searching backwards.
searchIsReversed: false,
// Replace part of the last substituted pattern
lastSubstituteReplacePart: undefined,
jumpList: createCircularJumpList(),
macroModeState: new MacroModeState,
// Recording latest f, t, F or T motion command.
lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''},
registerController: new RegisterController({})
};
for (var optionName in options) {
var option = options[optionName];
option.value = option.defaultValue;
}
}
var vimApi= {
buildKeyMap: function() {
// TODO: Convert keymap into dictionary format for fast lookup.
},
// Testing hook, though it might be useful to expose the register
// controller anyways.
getRegisterController: function() {
return vimGlobalState.registerController;
},
// Testing hook.
resetVimGlobalState_: resetVimGlobalState,
// Testing hook.
getVimGlobalState_: function() {
return vimGlobalState;
},
// Testing hook.
maybeInitVimState_: maybeInitVimState,
InsertModeKey: InsertModeKey,
map: function(lhs, rhs, ctx) {
// Add user defined key bindings.
exCommandDispatcher.map(lhs, rhs, ctx);
},
setOption: setOption,
getOption: getOption,
defineOption: defineOption,
defineEx: function(name, prefix, func){
if (name.indexOf(prefix) !== 0) {
throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered');
}
exCommands[name]=func;
exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'};
},
// This is the outermost function called by CodeMirror, after keys have
// been mapped to their Vim equivalents.
handleKey: function(cm, key) {
var command;
var vim = maybeInitVimState(cm);
var macroModeState = vimGlobalState.macroModeState;
if (macroModeState.isRecording) {
if (key == 'q') {
macroModeState.exitMacroRecordMode();
vim.inputState = new InputState();
return;
}
}
if (key == '<Esc>') {
// Clear input state and get back to normal mode.
vim.inputState = new InputState();
if (vim.visualMode) {
exitVisualMode(cm);
}
return;
}
// Enter visual mode when the mouse selects text.
if (!vim.visualMode &&
!cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) {
vim.visualMode = true;
vim.visualLine = false;
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"});
cm.on('mousedown', exitVisualMode);
}
if (key != '0' || (key == '0' && vim.inputState.getRepeat() === 0)) {
// Have to special case 0 since it's both a motion and a number.
command = commandDispatcher.matchCommand(key, defaultKeymap, vim);
}
if (!command) {
if (isNumber(key)) {
// Increment count unless count is 0 and key is 0.
vim.inputState.pushRepeatDigit(key);
}
if (macroModeState.isRecording) {
logKey(macroModeState, key);
}
return;
}
if (command.type == 'keyToKey') {
// TODO: prevent infinite recursion.
for (var i = 0; i < command.toKeys.length; i++) {
this.handleKey(cm, command.toKeys[i]);
}
} else {
if (macroModeState.isRecording) {
logKey(macroModeState, key);
}
commandDispatcher.processCommand(cm, vim, command);
}
},
handleEx: function(cm, input) {
exCommandDispatcher.processCommand(cm, input);
}
};
// Represents the current input state.
function InputState() {
this.prefixRepeat = [];
this.motionRepeat = [];
this.operator = null;
this.operatorArgs = null;
this.motion = null;
this.motionArgs = null;
this.keyBuffer = []; // For matching multi-key commands.
this.registerName = null; // Defaults to the unnamed register.
}
InputState.prototype.pushRepeatDigit = function(n) {
if (!this.operator) {
this.prefixRepeat = this.prefixRepeat.concat(n);
} else {
this.motionRepeat = this.motionRepeat.concat(n);
}
};
InputState.prototype.getRepeat = function() {
var repeat = 0;
if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {
repeat = 1;
if (this.prefixRepeat.length > 0) {
repeat *= parseInt(this.prefixRepeat.join(''), 10);
}
if (this.motionRepeat.length > 0) {
repeat *= parseInt(this.motionRepeat.join(''), 10);
}
}
return repeat;
};
/*
* Register stores information about copy and paste registers. Besides
* text, a register must store whether it is linewise (i.e., when it is
* pasted, should it insert itself into a new line, or should the text be
* inserted at the cursor position.)
*/
function Register(text, linewise) {
this.clear();
this.keyBuffer = [text || ''];
this.insertModeChanges = [];
this.searchQueries = [];
this.linewise = !!linewise;
}
Register.prototype = {
setText: function(text, linewise) {
this.keyBuffer = [text || ''];
this.linewise = !!linewise;
},
pushText: function(text, linewise) {
// if this register has ever been set to linewise, use linewise.
if (linewise) {
if (!this.linewise) {
this.keyBuffer.push('\n');
}
this.linewise = true;
}
this.keyBuffer.push(text);
},
pushInsertModeChanges: function(changes) {
this.insertModeChanges.push(createInsertModeChanges(changes));
},
pushSearchQuery: function(query) {
this.searchQueries.push(query);
},
clear: function() {
this.keyBuffer = [];
this.insertModeChanges = [];
this.searchQueries = [];
this.linewise = false;
},
toString: function() {
return this.keyBuffer.join('');
}
};
/*
* vim registers allow you to keep many independent copy and paste buffers.
* See http://usevim.com/2012/04/13/registers/ for an introduction.
*
* RegisterController keeps the state of all the registers. An initial
* state may be passed in. The unnamed register '"' will always be
* overridden.
*/
function RegisterController(registers) {
this.registers = registers;
this.unnamedRegister = registers['"'] = new Register();
registers['.'] = new Register();
registers[':'] = new Register();
}
RegisterController.prototype = {
pushText: function(registerName, operator, text, linewise) {
if (linewise && text.charAt(0) == '\n') {
text = text.slice(1) + '\n';
}
if (linewise && text.charAt(text.length - 1) !== '\n'){
text += '\n';
}
// Lowercase and uppercase registers refer to the same register.
// Uppercase just means append.
var register = this.isValidRegister(registerName) ?
this.getRegister(registerName) : null;
// if no register/an invalid register was specified, things go to the
// default registers
if (!register) {
switch (operator) {
case 'yank':
// The 0 register contains the text from the most recent yank.
this.registers['0'] = new Register(text, linewise);
break;
case 'delete':
case 'change':
if (text.indexOf('\n') == -1) {
// Delete less than 1 line. Update the small delete register.
this.registers['-'] = new Register(text, linewise);
} else {
// Shift down the contents of the numbered registers and put the
// deleted text into register 1.
this.shiftNumericRegisters_();
this.registers['1'] = new Register(text, linewise);
}
break;
}
// Make sure the unnamed register is set to what just happened
this.unnamedRegister.setText(text, linewise);
return;
}
// If we've gotten to this point, we've actually specified a register
var append = isUpperCase(registerName);
if (append) {
register.pushText(text, linewise);
} else {
register.setText(text, linewise);
}
// The unnamed register always has the same value as the last used
// register.
this.unnamedRegister.setText(register.toString(), linewise);
},
// Gets the register named @name. If one of @name doesn't already exist,
// create it. If @name is invalid, return the unnamedRegister.
getRegister: function(name) {
if (!this.isValidRegister(name)) {
return this.unnamedRegister;
}
name = name.toLowerCase();
if (!this.registers[name]) {
this.registers[name] = new Register();
}
return this.registers[name];
},
isValidRegister: function(name) {
return name && inArray(name, validRegisters);
},
shiftNumericRegisters_: function() {
for (var i = 9; i >= 2; i--) {
this.registers[i] = this.getRegister('' + (i - 1));
}
}
};
var commandDispatcher = {
matchCommand: function(key, keyMap, vim) {
var inputState = vim.inputState;
var keys = inputState.keyBuffer.concat(key);
var matchedCommands = [];
var selectedCharacter;
for (var i = 0; i < keyMap.length; i++) {
var command = keyMap[i];
if (matchKeysPartial(keys, command.keys)) {
if (inputState.operator && command.type == 'action') {
// Ignore matched action commands after an operator. Operators
// only operate on motions. This check is really for text
// objects since aW, a[ etcs conflicts with a.
continue;
}
// Match commands that take <character> as an argument.
if (command.keys[keys.length - 1] == 'character') {
selectedCharacter = keys[keys.length - 1];
if (selectedCharacter.length>1){
switch(selectedCharacter){
case '<CR>':
selectedCharacter='\n';
break;
case '<Space>':
selectedCharacter=' ';
break;
default:
continue;
}
}
}
// Add the command to the list of matched commands. Choose the best
// command later.
matchedCommands.push(command);
}
}
// Returns the command if it is a full match, or null if not.
function getFullyMatchedCommandOrNull(command) {
if (keys.length < command.keys.length) {
// Matches part of a multi-key command. Buffer and wait for next
// stroke.
inputState.keyBuffer.push(key);
return null;
} else {
if (command.keys[keys.length - 1] == 'character') {
inputState.selectedCharacter = selectedCharacter;
}
// Clear the buffer since a full match was found.
inputState.keyBuffer = [];
return command;
}
}
if (!matchedCommands.length) {
// Clear the buffer since there were no matches.
inputState.keyBuffer = [];
return null;
} else if (matchedCommands.length == 1) {
return getFullyMatchedCommandOrNull(matchedCommands[0]);
} else {
// Find the best match in the list of matchedCommands.
var context = vim.visualMode ? 'visual' : 'normal';
var bestMatch; // Default to first in the list.
for (var i = 0; i < matchedCommands.length; i++) {
var current = matchedCommands[i];
if (current.context == context) {
bestMatch = current;
break;
} else if (!bestMatch && !current.context) {
// Only set an imperfect match to best match if no best match is
// set and the imperfect match is not restricted to another
// context.
bestMatch = current;
}
}
return getFullyMatchedCommandOrNull(bestMatch);
}
},
processCommand: function(cm, vim, command) {
vim.inputState.repeatOverride = command.repeatOverride;
switch (command.type) {
case 'motion':
this.processMotion(cm, vim, command);
break;
case 'operator':
this.processOperator(cm, vim, command);
break;
case 'operatorMotion':
this.processOperatorMotion(cm, vim, command);
break;
case 'action':
this.processAction(cm, vim, command);
break;
case 'search':
this.processSearch(cm, vim, command);
break;
case 'ex':
case 'keyToEx':
this.processEx(cm, vim, command);
break;
default:
break;
}
},
processMotion: function(cm, vim, command) {
vim.inputState.motion = command.motion;
vim.inputState.motionArgs = copyArgs(command.motionArgs);
this.evalInput(cm, vim);
},
processOperator: function(cm, vim, command) {
var inputState = vim.inputState;
if (inputState.operator) {
if (inputState.operator == command.operator) {
// Typing an operator twice like 'dd' makes the operator operate
// linewise
inputState.motion = 'expandToLine';
inputState.motionArgs = { linewise: true };
this.evalInput(cm, vim);
return;
} else {
// 2 different operators in a row doesn't make sense.
vim.inputState = new InputState();
}
}
inputState.operator = command.operator;
inputState.operatorArgs = copyArgs(command.operatorArgs);
if (vim.visualMode) {
// Operating on a selection in visual mode. We don't need a motion.
this.evalInput(cm, vim);
}
},
processOperatorMotion: function(cm, vim, command) {
var visualMode = vim.visualMode;
var operatorMotionArgs = copyArgs(command.operatorMotionArgs);
if (operatorMotionArgs) {
// Operator motions may have special behavior in visual mode.
if (visualMode && operatorMotionArgs.visualLine) {
vim.visualLine = true;
}
}
this.processOperator(cm, vim, command);
if (!visualMode) {
this.processMotion(cm, vim, command);
}
},
processAction: function(cm, vim, command) {
var inputState = vim.inputState;
var repeat = inputState.getRepeat();
var repeatIsExplicit = !!repeat;
var actionArgs = copyArgs(command.actionArgs) || {};
if (inputState.selectedCharacter) {
actionArgs.selectedCharacter = inputState.selectedCharacter;
}
// Actions may or may not have motions and operators. Do these first.
if (command.operator) {
this.processOperator(cm, vim, command);
}
if (command.motion) {
this.processMotion(cm, vim, command);
}
if (command.motion || command.operator) {
this.evalInput(cm, vim);
}
actionArgs.repeat = repeat || 1;
actionArgs.repeatIsExplicit = repeatIsExplicit;
actionArgs.registerName = inputState.registerName;
vim.inputState = new InputState();
vim.lastMotion = null;
if (command.isEdit) {
this.recordLastEdit(vim, inputState, command);
}
actions[command.action](cm, actionArgs, vim);
},
processSearch: function(cm, vim, command) {
if (!cm.getSearchCursor) {
// Search depends on SearchCursor.
return;
}
var forward = command.searchArgs.forward;
var wholeWordOnly = command.searchArgs.wholeWordOnly;
getSearchState(cm).setReversed(!forward);
var promptPrefix = (forward) ? '/' : '?';
var originalQuery = getSearchState(cm).getQuery();
var originalScrollPos = cm.getScrollInfo();
function handleQuery(query, ignoreCase, smartCase) {
try {
updateSearchQuery(cm, query, ignoreCase, smartCase);
} catch (e) {
showConfirm(cm, 'Invalid regex: ' + query);
return;
}
commandDispatcher.processMotion(cm, vim, {
type: 'motion',
motion: 'findNext',
motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist }
});
}
function onPromptClose(query) {
cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
handleQuery(query, true /** ignoreCase */, true /** smartCase */);
var macroModeState = vimGlobalState.macroModeState;
if (macroModeState.isRecording) {
logSearchQuery(macroModeState, query);
}
}
function onPromptKeyUp(_e, query) {
var parsedQuery;
try {
parsedQuery = updateSearchQuery(cm, query,
true /** ignoreCase */, true /** smartCase */);
} catch (e) {
// Swallow bad regexes for incremental search.
}
if (parsedQuery) {
cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);
} else {
clearSearchHighlight(cm);
cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
}
}
function onPromptKeyDown(e, _query, close) {
var keyName = CodeMirror.keyName(e);
if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') {
updateSearchQuery(cm, originalQuery);
clearSearchHighlight(cm);
cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
CodeMirror.e_stop(e);
close();
cm.focus();
}
}
switch (command.searchArgs.querySrc) {
case 'prompt':
var macroModeState = vimGlobalState.macroModeState;
if (macroModeState.isPlaying) {
var query = macroModeState.replaySearchQueries.shift();
handleQuery(query, true /** ignoreCase */, false /** smartCase */);
} else {
showPrompt(cm, {
onClose: onPromptClose,
prefix: promptPrefix,
desc: searchPromptDesc,
onKeyUp: onPromptKeyUp,
onKeyDown: onPromptKeyDown
});
}
break;
case 'wordUnderCursor':
var word = expandWordUnderCursor(cm, false /** inclusive */,
true /** forward */, false /** bigWord */,
true /** noSymbol */);
var isKeyword = true;
if (!word) {
word = expandWordUnderCursor(cm, false /** inclusive */,
true /** forward */, false /** bigWord */,
false /** noSymbol */);
isKeyword = false;
}
if (!word) {
return;
}
var query = cm.getLine(word.start.line).substring(word.start.ch,
word.end.ch);
if (isKeyword && wholeWordOnly) {
query = '\\b' + query + '\\b';
} else {
query = escapeRegex(query);
}
// cachedCursor is used to save the old position of the cursor
// when * or # causes vim to seek for the nearest word and shift
// the cursor before entering the motion.
vimGlobalState.jumpList.cachedCursor = cm.getCursor();
cm.setCursor(word.start);
handleQuery(query, true /** ignoreCase */, false /** smartCase */);
break;
}
},
processEx: function(cm, vim, command) {
function onPromptClose(input) {
// Give the prompt some time to close so that if processCommand shows
// an error, the elements don't overlap.
exCommandDispatcher.processCommand(cm, input);
}
function onPromptKeyDown(e, _input, close) {
var keyName = CodeMirror.keyName(e);
if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') {
CodeMirror.e_stop(e);
close();
cm.focus();
}
}
if (command.type == 'keyToEx') {
// Handle user defined Ex to Ex mappings
exCommandDispatcher.processCommand(cm, command.exArgs.input);
} else {
if (vim.visualMode) {
showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
onKeyDown: onPromptKeyDown});
} else {
showPrompt(cm, { onClose: onPromptClose, prefix: ':',
onKeyDown: onPromptKeyDown});
}
}
},
evalInput: function(cm, vim) {
// If the motion comand is set, execute both the operator and motion.
// Otherwise return.
var inputState = vim.inputState;
var motion = inputState.motion;
var motionArgs = inputState.motionArgs || {};
var operator = inputState.operator;
var operatorArgs = inputState.operatorArgs || {};
var registerName = inputState.registerName;
var selectionEnd = copyCursor(cm.getCursor('head'));
var selectionStart = copyCursor(cm.getCursor('anchor'));
// The difference between cur and selection cursors are that cur is
// being operated on and ignores that there is a selection.
var curStart = copyCursor(selectionEnd);
var curOriginal = copyCursor(curStart);
var curEnd;
var repeat;
if (operator) {
this.recordLastEdit(vim, inputState);
}
if (inputState.repeatOverride !== undefined) {
// If repeatOverride is specified, that takes precedence over the
// input state's repeat. Used by Ex mode and can be user defined.
repeat = inputState.repeatOverride;
} else {
repeat = inputState.getRepeat();
}
if (repeat > 0 && motionArgs.explicitRepeat) {
motionArgs.repeatIsExplicit = true;
} else if (motionArgs.noRepeat ||
(!motionArgs.explicitRepeat && repeat === 0)) {
repeat = 1;
motionArgs.repeatIsExplicit = false;
}
if (inputState.selectedCharacter) {
// If there is a character input, stick it in all of the arg arrays.
motionArgs.selectedCharacter = operatorArgs.selectedCharacter =
inputState.selectedCharacter;
}
motionArgs.repeat = repeat;
vim.inputState = new InputState();
if (motion) {
var motionResult = motions[motion](cm, motionArgs, vim);
vim.lastMotion = motions[motion];
if (!motionResult) {
return;
}
if (motionArgs.toJumplist) {
var jumpList = vimGlobalState.jumpList;
// if the current motion is # or *, use cachedCursor
var cachedCursor = jumpList.cachedCursor;
if (cachedCursor) {
recordJumpPosition(cm, cachedCursor, motionResult);
delete jumpList.cachedCursor;
} else {
recordJumpPosition(cm, curOriginal, motionResult);
}
}
if (motionResult instanceof Array) {
curStart = motionResult[0];
curEnd = motionResult[1];
} else {
curEnd = motionResult;
}
// TODO: Handle null returns from motion commands better.
if (!curEnd) {
curEnd = Pos(curStart.line, curStart.ch);
}
if (vim.visualMode) {
// Check if the selection crossed over itself. Will need to shift
// the start point if that happened.
if (cursorIsBefore(selectionStart, selectionEnd) &&
(cursorEqual(selectionStart, curEnd) ||
cursorIsBefore(curEnd, selectionStart))) {
// The end of the selection has moved from after the start to
// before the start. We will shift the start right by 1.
selectionStart.ch += 1;
} else if (cursorIsBefore(selectionEnd, selectionStart) &&
(cursorEqual(selectionStart, curEnd) ||
cursorIsBefore(selectionStart, curEnd))) {
// The opposite happened. We will shift the start left by 1.
selectionStart.ch -= 1;
}
selectionEnd = curEnd;
selectionStart = (motionResult instanceof Array) ? curStart : selectionStart;
if (vim.visualLine) {
if (cursorIsBefore(selectionStart, selectionEnd)) {
selectionStart.ch = 0;
var lastLine = cm.lastLine();
if (selectionEnd.line > lastLine) {
selectionEnd.line = lastLine;
}
selectionEnd.ch = lineLength(cm, selectionEnd.line);
} else {
selectionEnd.ch = 0;
selectionStart.ch = lineLength(cm, selectionStart.line);
}
}
cm.setSelection(selectionStart, selectionEnd);
updateMark(cm, vim, '<',
cursorIsBefore(selectionStart, selectionEnd) ? selectionStart
: selectionEnd);
updateMark(cm, vim, '>',
cursorIsBefore(selectionStart, selectionEnd) ? selectionEnd
: selectionStart);
} else if (!operator) {
curEnd = clipCursorToContent(cm, curEnd);
cm.setCursor(curEnd.line, curEnd.ch);
}
}
if (operator) {
var inverted = false;
vim.lastMotion = null;
operatorArgs.repeat = repeat; // Indent in visual mode needs this.
if (vim.visualMode) {
curStart = selectionStart;
curEnd = selectionEnd;
motionArgs.inclusive = true;
}
// Swap start and end if motion was backward.
if (curEnd && cursorIsBefore(curEnd, curStart)) {
var tmp = curStart;
curStart = curEnd;
curEnd = tmp;
inverted = true;
} else if (!curEnd) {
curEnd = copyCursor(curStart);
}
if (motionArgs.inclusive && !(vim.visualMode && inverted)) {
// Move the selection end one to the right to include the last
// character.
curEnd.ch++;
}
if (operatorArgs.selOffset) {
// Replaying a visual mode operation
curEnd.line = curStart.line + operatorArgs.selOffset.line;
if (operatorArgs.selOffset.line) {curEnd.ch = operatorArgs.selOffset.ch; }
else { curEnd.ch = curStart.ch + operatorArgs.selOffset.ch; }
} else if (vim.visualMode) {
var selOffset = Pos();
selOffset.line = curEnd.line - curStart.line;
if (selOffset.line) { selOffset.ch = curEnd.ch; }
else { selOffset.ch = curEnd.ch - curStart.ch; }
operatorArgs.selOffset = selOffset;
}
var linewise = motionArgs.linewise ||
(vim.visualMode && vim.visualLine) ||
operatorArgs.linewise;
if (linewise) {
// Expand selection to entire line.
expandSelectionToLine(cm, curStart, curEnd);
} else if (motionArgs.forward) {
// Clip to trailing newlines only if the motion goes forward.
clipToLine(cm, curStart, curEnd);
}
operatorArgs.registerName = registerName;
// Keep track of linewise as it affects how paste and change behave.
operatorArgs.linewise = linewise;
operators[operator](cm, operatorArgs, vim, curStart,
curEnd, curOriginal);
if (vim.visualMode) {
exitVisualMode(cm);
}
}
},
recordLastEdit: function(vim, inputState, actionCommand) {
var macroModeState = vimGlobalState.macroModeState;
if (macroModeState.isPlaying) { return; }
vim.lastEditInputState = inputState;
vim.lastEditActionCommand = actionCommand;
macroModeState.lastInsertModeChanges.changes = [];
macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;
}
};
/**
* typedef {Object{line:number,ch:number}} Cursor An object containing the
* position of the cursor.
*/
// All of the functions below return Cursor objects.
var motions = {
moveToTopLine: function(cm, motionArgs) {
var line = getUserVisibleLines(cm).top + motionArgs.repeat -1;
return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
},
moveToMiddleLine: function(cm) {
var range = getUserVisibleLines(cm);
var line = Math.floor((range.top + range.bottom) * 0.5);
return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
},
moveToBottomLine: function(cm, motionArgs) {
var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1;
return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line)));
},
expandToLine: function(cm, motionArgs) {
// Expands forward to end of line, and then to next line if repeat is
// >1. Does not handle backward motion!
var cur = cm.getCursor();
return Pos(cur.line + motionArgs.repeat - 1, Infinity);
},
findNext: function(cm, motionArgs) {
var state = getSearchState(cm);
var query = state.getQuery();
if (!query) {
return;
}
var prev = !motionArgs.forward;
// If search is initiated with ? instead of /, negate direction.
prev = (state.isReversed()) ? !prev : prev;
highlightSearchMatches(cm, query);
return findNext(cm, prev/** prev */, query, motionArgs.repeat);
},
goToMark: function(cm, motionArgs, vim) {
var mark = vim.marks[motionArgs.selectedCharacter];
if (mark) {
var pos = mark.find();
return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos;
}
return null;
},
moveToOtherHighlightedEnd: function(cm) {
var curEnd = copyCursor(cm.getCursor('head'));
var curStart = copyCursor(cm.getCursor('anchor'));
if (cursorIsBefore(curStart, curEnd)) {
curEnd.ch += 1;
} else if (cursorIsBefore(curEnd, curStart)) {
curStart.ch -= 1;
}
return ([curEnd,curStart]);
},
jumpToMark: function(cm, motionArgs, vim) {
var best = cm.getCursor();
for (var i = 0; i < motionArgs.repeat; i++) {
var cursor = best;
for (var key in vim.marks) {
if (!isLowerCase(key)) {
continue;
}
var mark = vim.marks[key].find();
var isWrongDirection = (motionArgs.forward) ?
cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark);
if (isWrongDirection) {
continue;
}
if (motionArgs.linewise && (mark.line == cursor.line)) {
continue;
}
var equal = cursorEqual(cursor, best);
var between = (motionArgs.forward) ?
cusrorIsBetween(cursor, mark, best) :
cusrorIsBetween(best, mark, cursor);
if (equal || between) {
best = mark;
}
}
}
if (motionArgs.linewise) {
// Vim places the cursor on the first non-whitespace character of
// the line if there is one, else it places the cursor at the end
// of the line, regardless of whether a mark was found.
best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line)));
}
return best;
},
moveByCharacters: function(cm, motionArgs) {
var cur = cm.getCursor();
var repeat = motionArgs.repeat;
var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;
return Pos(cur.line, ch);
},
moveByLines: function(cm, motionArgs, vim) {
var cur = cm.getCursor();
var endCh = cur.ch;
// Depending what our last motion was, we may want to do different
// things. If our last motion was moving vertically, we want to
// preserve the HPos from our last horizontal move. If our last motion
// was going to the end of a line, moving vertically we should go to
// the end of the line, etc.
switch (vim.lastMotion) {
case this.moveByLines:
case this.moveByDisplayLines:
case this.moveByScroll:
case this.moveToColumn:
case this.moveToEol:
endCh = vim.lastHPos;
break;
default:
vim.lastHPos = endCh;
}
var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0);
var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;
var first = cm.firstLine();
var last = cm.lastLine();
// Vim cancels linewise motions that start on an edge and move beyond
// that edge. It does not cancel motions that do not start on an edge.
if ((line < first && cur.line == first) ||
(line > last && cur.line == last)) {
return;
}
if (motionArgs.toFirstChar){
endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));
vim.lastHPos = endCh;
}
vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left;
return Pos(line, endCh);
},
moveByDisplayLines: function(cm, motionArgs, vim) {
var cur = cm.getCursor();
switch (vim.lastMotion) {
case this.moveByDisplayLines:
case this.moveByScroll:
case this.moveByLines:
case this.moveToColumn:
case this.moveToEol:
break;
default:
vim.lastHSPos = cm.charCoords(cur,'div').left;
}
var repeat = motionArgs.repeat;
var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos);
if (res.hitSide) {
if (motionArgs.forward) {
var lastCharCoords = cm.charCoords(res, 'div');
var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };
var res = cm.coordsChar(goalCoords, 'div');
} else {
var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div');
resCoords.left = vim.lastHSPos;
res = cm.coordsChar(resCoords, 'div');
}
}
vim.lastHPos = res.ch;
return res;
},
moveByPage: function(cm, motionArgs) {
// CodeMirror only exposes functions that move the cursor page down, so
// doing this bad hack to move the cursor and move it back. evalInput
// will move the cursor to where it should be in the end.
var curStart = cm.getCursor();
var repeat = motionArgs.repeat;
cm.moveV((motionArgs.forward ? repeat : -repeat), 'page');
var curEnd = cm.getCursor();
cm.setCursor(curStart);
return curEnd;
},
moveByParagraph: function(cm, motionArgs) {
var line = cm.getCursor().line;
var repeat = motionArgs.repeat;
var inc = motionArgs.forward ? 1 : -1;
for (var i = 0; i < repeat; i++) {
if ((!motionArgs.forward && line === cm.firstLine() ) ||
(motionArgs.forward && line == cm.lastLine())) {
break;
}
line += inc;
while (line !== cm.firstLine() && line != cm.lastLine() && cm.getLine(line)) {
line += inc;
}
}
return Pos(line, 0);
},
moveByScroll: function(cm, motionArgs, vim) {
var scrollbox = cm.getScrollInfo();
var curEnd = null;
var repeat = motionArgs.repeat;
if (!repeat) {
repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight());
}
var orig = cm.charCoords(cm.getCursor(), 'local');
motionArgs.repeat = repeat;
var curEnd = motions.moveByDisplayLines(cm, motionArgs, vim);
if (!curEnd) {
return null;
}
var dest = cm.charCoords(curEnd, 'local');
cm.scrollTo(null, scrollbox.top + dest.top - orig.top);
return curEnd;
},
moveByWords: function(cm, motionArgs) {
return moveToWord(cm, motionArgs.repeat, !!motionArgs.forward,
!!motionArgs.wordEnd, !!motionArgs.bigWord);
},
moveTillCharacter: function(cm, motionArgs) {
var repeat = motionArgs.repeat;
var curEnd = moveToCharacter(cm, repeat, motionArgs.forward,
motionArgs.selectedCharacter);
var increment = motionArgs.forward ? -1 : 1;
recordLastCharacterSearch(increment, motionArgs);
if (!curEnd) return null;
curEnd.ch += increment;
return curEnd;
},
moveToCharacter: function(cm, motionArgs) {
var repeat = motionArgs.repeat;
recordLastCharacterSearch(0, motionArgs);
return moveToCharacter(cm, repeat, motionArgs.forward,
motionArgs.selectedCharacter) || cm.getCursor();
},
moveToSymbol: function(cm, motionArgs) {
var repeat = motionArgs.repeat;
return findSymbol(cm, repeat, motionArgs.forward,
motionArgs.selectedCharacter) || cm.getCursor();
},
moveToColumn: function(cm, motionArgs, vim) {
var repeat = motionArgs.repeat;
// repeat is equivalent to which column we want to move to!
vim.lastHPos = repeat - 1;
vim.lastHSPos = cm.charCoords(cm.getCursor(),'div').left;
return moveToColumn(cm, repeat);
},
moveToEol: function(cm, motionArgs, vim) {
var cur = cm.getCursor();
vim.lastHPos = Infinity;
var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity);
var end=cm.clipPos(retval);
end.ch--;
vim.lastHSPos = cm.charCoords(end,'div').left;
return retval;
},
moveToFirstNonWhiteSpaceCharacter: function(cm) {
// Go to the start of the line where the text begins, or the end for
// whitespace-only lines
var cursor = cm.getCursor();
return Pos(cursor.line,
findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)));
},
moveToMatchedSymbol: function(cm) {
var cursor = cm.getCursor();
var line = cursor.line;
var ch = cursor.ch;
var lineText = cm.getLine(line);
var symbol;
do {
symbol = lineText.charAt(ch++);
if (symbol && isMatchableSymbol(symbol)) {
var ignoreStyle = ["string", "comment"];
var style = cm.getTokenTypeAt(Pos(line, ch));
if (ignoreStyle.indexOf(style) < 0) {
break;
}
}
} while (symbol);
if (symbol) {
var matched = cm.findMatchingBracket(Pos(line, ch-1));
return matched.to;
} else {
return cursor;
}
},
moveToStartOfLine: function(cm) {
var cursor = cm.getCursor();
return Pos(cursor.line, 0);
},
moveToLineOrEdgeOfDocument: function(cm, motionArgs) {
var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();
if (motionArgs.repeatIsExplicit) {
lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');
}
return Pos(lineNum,
findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)));
},
textObjectManipulation: function(cm, motionArgs) {
// TODO: lots of possible exceptions that can be thrown here. Try da(
// outside of a () block.
// TODO: adding <> >< to this map doesn't work, presumably because
// they're operators
var mirroredPairs = {'(': ')', ')': '(',
'{': '}', '}': '{',
'[': ']', ']': '['};
var selfPaired = {'\'': true, '"': true};
var character = motionArgs.selectedCharacter;
// 'b' refers to '()' block.
// 'B' refers to '{}' block.
if (character == 'b') {
character = '(';
} else if (character == 'B') {
character = '{';
}
// Inclusive is the difference between a and i
// TODO: Instead of using the additional text object map to perform text
// object operations, merge the map into the defaultKeyMap and use
// motionArgs to define behavior. Define separate entries for 'aw',
// 'iw', 'a[', 'i[', etc.
var inclusive = !motionArgs.textObjectInner;
var tmp;
if (mirroredPairs[character]) {
tmp = selectCompanionObject(cm, character, inclusive);
} else if (selfPaired[character]) {
tmp = findBeginningAndEnd(cm, character, inclusive);
} else if (character === 'W') {
tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,
true /** bigWord */);
} else if (character === 'w') {
tmp = expandWordUnderCursor(cm, inclusive, true /** forward */,
false /** bigWord */);
} else {
// No text object defined for this, don't move.
return null;
}
return [tmp.start, tmp.end];
},
repeatLastCharacterSearch: function(cm, motionArgs) {
var lastSearch = vimGlobalState.lastChararacterSearch;
var repeat = motionArgs.repeat;
var forward = motionArgs.forward === lastSearch.forward;
var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1);
cm.moveH(-increment, 'char');
motionArgs.inclusive = forward ? true : false;
var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter);
if (!curEnd) {
cm.moveH(increment, 'char');
return cm.getCursor();
}
curEnd.ch += increment;
return curEnd;
}
};
var operators = {
change: function(cm, operatorArgs, _vim, curStart, curEnd) {
vimGlobalState.registerController.pushText(
operatorArgs.registerName, 'change', cm.getRange(curStart, curEnd),
operatorArgs.linewise);
if (operatorArgs.linewise) {
// Push the next line back down, if there is a next line.
var replacement = curEnd.line > cm.lastLine() ? '' : '\n';
cm.replaceRange(replacement, curStart, curEnd);
cm.indentLine(curStart.line, 'smart');
// null ch so setCursor moves to end of line.
curStart.ch = null;
} else {
// Exclude trailing whitespace if the range is not all whitespace.
var text = cm.getRange(curStart, curEnd);
if (!isWhiteSpaceString(text)) {
var match = (/\s+$/).exec(text);
if (match) {
curEnd = offsetCursor(curEnd, 0, - match[0].length);
}
}
cm.replaceRange('', curStart, curEnd);
}
actions.enterInsertMode(cm, {}, cm.state.vim);
cm.setCursor(curStart);
},
// delete is a javascript keyword.
'delete': function(cm, operatorArgs, _vim, curStart, curEnd) {
// If the ending line is past the last line, inclusive, instead of
// including the trailing \n, include the \n before the starting line
if (operatorArgs.linewise &&
curEnd.line > cm.lastLine() && curStart.line > cm.firstLine()) {
curStart.line--;
curStart.ch = lineLength(cm, curStart.line);
}
vimGlobalState.registerController.pushText(
operatorArgs.registerName, 'delete', cm.getRange(curStart, curEnd),
operatorArgs.linewise);
cm.replaceRange('', curStart, curEnd);
if (operatorArgs.linewise) {
cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));
} else {
cm.setCursor(curStart);
}
},
indent: function(cm, operatorArgs, vim, curStart, curEnd) {
var startLine = curStart.line;
var endLine = curEnd.line;
// In visual mode, n> shifts the selection right n times, instead of
// shifting n lines right once.
var repeat = (vim.visualMode) ? operatorArgs.repeat : 1;
if (operatorArgs.linewise) {
// The only way to delete a newline is to delete until the start of
// the next line, so in linewise mode evalInput will include the next
// line. We don't want this in indent, so we go back a line.
endLine--;
}
for (var i = startLine; i <= endLine; i++) {
for (var j = 0; j < repeat; j++) {
cm.indentLine(i, operatorArgs.indentRight);
}
}
cm.setCursor(curStart);
cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));
},
swapcase: function(cm, operatorArgs, _vim, curStart, curEnd, curOriginal) {
var toSwap = cm.getRange(curStart, curEnd);
var swapped = '';
for (var i = 0; i < toSwap.length; i++) {
var character = toSwap.charAt(i);
swapped += isUpperCase(character) ? character.toLowerCase() :
character.toUpperCase();
}
cm.replaceRange(swapped, curStart, curEnd);
if (!operatorArgs.shouldMoveCursor) {
cm.setCursor(curOriginal);
}
},
yank: function(cm, operatorArgs, _vim, curStart, curEnd, curOriginal) {
vimGlobalState.registerController.pushText(
operatorArgs.registerName, 'yank',
cm.getRange(curStart, curEnd), operatorArgs.linewise);
cm.setCursor(curOriginal);
}
};
var actions = {
jumpListWalk: function(cm, actionArgs, vim) {
if (vim.visualMode) {
return;
}
var repeat = actionArgs.repeat;
var forward = actionArgs.forward;
var jumpList = vimGlobalState.jumpList;
var mark = jumpList.move(cm, forward ? repeat : -repeat);
var markPos = mark ? mark.find() : undefined;
markPos = markPos ? markPos : cm.getCursor();
cm.setCursor(markPos);
},
scroll: function(cm, actionArgs, vim) {
if (vim.visualMode) {
return;
}
var repeat = actionArgs.repeat || 1;
var lineHeight = cm.defaultTextHeight();
var top = cm.getScrollInfo().top;
var delta = lineHeight * repeat;
var newPos = actionArgs.forward ? top + delta : top - delta;
var cursor = copyCursor(cm.getCursor());
var cursorCoords = cm.charCoords(cursor, 'local');
if (actionArgs.forward) {
if (newPos > cursorCoords.top) {
cursor.line += (newPos - cursorCoords.top) / lineHeight;
cursor.line = Math.ceil(cursor.line);
cm.setCursor(cursor);
cursorCoords = cm.charCoords(cursor, 'local');
cm.scrollTo(null, cursorCoords.top);
} else {
// Cursor stays within bounds. Just reposition the scroll window.
cm.scrollTo(null, newPos);
}
} else {
var newBottom = newPos + cm.getScrollInfo().clientHeight;
if (newBottom < cursorCoords.bottom) {
cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight;
cursor.line = Math.floor(cursor.line);
cm.setCursor(cursor);
cursorCoords = cm.charCoords(cursor, 'local');
cm.scrollTo(
null, cursorCoords.bottom - cm.getScrollInfo().clientHeight);
} else {
// Cursor stays within bounds. Just reposition the scroll window.
cm.scrollTo(null, newPos);
}
}
},
scrollToCursor: function(cm, actionArgs) {
var lineNum = cm.getCursor().line;
var charCoords = cm.charCoords(Pos(lineNum, 0), 'local');
var height = cm.getScrollInfo().clientHeight;
var y = charCoords.top;
var lineHeight = charCoords.bottom - y;
switch (actionArgs.position) {
case 'center': y = y - (height / 2) + lineHeight;
break;
case 'bottom': y = y - height + lineHeight*1.4;
break;
case 'top': y = y + lineHeight*0.4;
break;
}
cm.scrollTo(null, y);
},
replayMacro: function(cm, actionArgs, vim) {
var registerName = actionArgs.selectedCharacter;
var repeat = actionArgs.repeat;
var macroModeState = vimGlobalState.macroModeState;
if (registerName == '@') {
registerName = macroModeState.latestRegister;
}
while(repeat--){
executeMacroRegister(cm, vim, macroModeState, registerName);
}
},
enterMacroRecordMode: function(cm, actionArgs) {
var macroModeState = vimGlobalState.macroModeState;
var registerName = actionArgs.selectedCharacter;
macroModeState.enterMacroRecordMode(cm, registerName);
},
enterInsertMode: function(cm, actionArgs, vim) {
if (cm.getOption('readOnly')) { return; }
vim.insertMode = true;
vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;
var insertAt = (actionArgs) ? actionArgs.insertAt : null;
if (insertAt == 'eol') {
var cursor = cm.getCursor();
cursor = Pos(cursor.line, lineLength(cm, cursor.line));
cm.setCursor(cursor);
} else if (insertAt == 'charAfter') {
cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));
} else if (insertAt == 'firstNonBlank') {
cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));
}
cm.setOption('keyMap', 'vim-insert');
cm.setOption('disableInput', false);
if (actionArgs && actionArgs.replace) {
// Handle Replace-mode as a special case of insert mode.
cm.toggleOverwrite(true);
cm.setOption('keyMap', 'vim-replace');
CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"});
} else {
cm.setOption('keyMap', 'vim-insert');
CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"});
}
if (!vimGlobalState.macroModeState.isPlaying) {
// Only record if not replaying.
cm.on('change', onChange);
CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
}
},
toggleVisualMode: function(cm, actionArgs, vim) {
var repeat = actionArgs.repeat;
var curStart = cm.getCursor();
var curEnd;
// TODO: The repeat should actually select number of characters/lines
// equal to the repeat times the size of the previous visual
// operation.
if (!vim.visualMode) {
cm.on('mousedown', exitVisualMode);
vim.visualMode = true;
vim.visualLine = !!actionArgs.linewise;
if (vim.visualLine) {
curStart.ch = 0;
curEnd = clipCursorToContent(
cm, Pos(curStart.line + repeat - 1, lineLength(cm, curStart.line)),
true /** includeLineBreak */);
} else {
curEnd = clipCursorToContent(
cm, Pos(curStart.line, curStart.ch + repeat),
true /** includeLineBreak */);
}
// Make the initial selection.
if (!actionArgs.repeatIsExplicit && !vim.visualLine) {
// This is a strange case. Here the implicit repeat is 1. The
// following commands lets the cursor hover over the 1 character
// selection.
cm.setCursor(curEnd);
cm.setSelection(curEnd, curStart);
} else {
cm.setSelection(curStart, curEnd);
}
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : ""});
} else {
curStart = cm.getCursor('anchor');
curEnd = cm.getCursor('head');
if (!vim.visualLine && actionArgs.linewise) {
// Shift-V pressed in characterwise visual mode. Switch to linewise
// visual mode instead of exiting visual mode.
vim.visualLine = true;
curStart.ch = cursorIsBefore(curStart, curEnd) ? 0 :
lineLength(cm, curStart.line);
curEnd.ch = cursorIsBefore(curStart, curEnd) ?
lineLength(cm, curEnd.line) : 0;
cm.setSelection(curStart, curEnd);
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: "linewise"});
} else if (vim.visualLine && !actionArgs.linewise) {
// v pressed in linewise visual mode. Switch to characterwise visual
// mode instead of exiting visual mode.
vim.visualLine = false;
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"});
} else {
exitVisualMode(cm);
}
}
updateMark(cm, vim, '<', cursorIsBefore(curStart, curEnd) ? curStart
: curEnd);
updateMark(cm, vim, '>', cursorIsBefore(curStart, curEnd) ? curEnd
: curStart);
},
reselectLastSelection: function(cm, _actionArgs, vim) {
if (vim.lastSelection) {
var lastSelection = vim.lastSelection;
cm.setSelection(lastSelection.curStart, lastSelection.curEnd);
if (lastSelection.visualLine) {
vim.visualMode = true;
vim.visualLine = true;
}
else {
vim.visualMode = true;
vim.visualLine = false;
}
CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : ""});
}
},
joinLines: function(cm, actionArgs, vim) {
var curStart, curEnd;
if (vim.visualMode) {
curStart = cm.getCursor('anchor');
curEnd = cm.getCursor('head');
curEnd.ch = lineLength(cm, curEnd.line) - 1;
} else {
// Repeat is the number of lines to join. Minimum 2 lines.
var repeat = Math.max(actionArgs.repeat, 2);
curStart = cm.getCursor();
curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1,
Infinity));
}
var finalCh = 0;
cm.operation(function() {
for (var i = curStart.line; i < curEnd.line; i++) {
finalCh = lineLength(cm, curStart.line);
var tmp = Pos(curStart.line + 1,
lineLength(cm, curStart.line + 1));
var text = cm.getRange(curStart, tmp);
text = text.replace(/\n\s*/g, ' ');
cm.replaceRange(text, curStart, tmp);
}
var curFinalPos = Pos(curStart.line, finalCh);
cm.setCursor(curFinalPos);
});
},
newLineAndEnterInsertMode: function(cm, actionArgs, vim) {
vim.insertMode = true;
var insertAt = copyCursor(cm.getCursor());
if (insertAt.line === cm.firstLine() && !actionArgs.after) {
// Special case for inserting newline before start of document.
cm.replaceRange('\n', Pos(cm.firstLine(), 0));
cm.setCursor(cm.firstLine(), 0);
} else {
insertAt.line = (actionArgs.after) ? insertAt.line :
insertAt.line - 1;
insertAt.ch = lineLength(cm, insertAt.line);
cm.setCursor(insertAt);
var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||
CodeMirror.commands.newlineAndIndent;
newlineFn(cm);
}
this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim);
},
paste: function(cm, actionArgs) {
var cur = copyCursor(cm.getCursor());
var register = vimGlobalState.registerController.getRegister(
actionArgs.registerName);
var text = register.toString();
if (!text) {
return;
}
if (actionArgs.matchIndent) {
// length that considers tabs and cm.options.tabSize
var whitespaceLength = function(str) {
var tabs = (str.split("\t").length - 1);
var spaces = (str.split(" ").length - 1);
return tabs * cm.options.tabSize + spaces * 1;
};
var currentLine = cm.getLine(cm.getCursor().line);
var indent = whitespaceLength(currentLine.match(/^\s*/)[0]);
// chomp last newline b/c don't want it to match /^\s*/gm
var chompedText = text.replace(/\n$/, '');
var wasChomped = text !== chompedText;
var firstIndent = whitespaceLength(text.match(/^\s*/)[0]);
var text = chompedText.replace(/^\s*/gm, function(wspace) {
var newIndent = indent + (whitespaceLength(wspace) - firstIndent);
if (newIndent < 0) {
return "";
}
else if (cm.options.indentWithTabs) {
var quotient = Math.floor(newIndent / cm.options.tabSize);
return Array(quotient + 1).join('\t');
}
else {
return Array(newIndent + 1).join(' ');
}
});
text += wasChomped ? "\n" : "";
}
if (actionArgs.repeat > 1) {
var text = Array(actionArgs.repeat + 1).join(text);
}
var linewise = register.linewise;
if (linewise) {
if (actionArgs.after) {
// Move the newline at the end to the start instead, and paste just
// before the newline character of the line we are on right now.
text = '\n' + text.slice(0, text.length - 1);
cur.ch = lineLength(cm, cur.line);
} else {
cur.ch = 0;
}
} else {
cur.ch += actionArgs.after ? 1 : 0;
}
cm.replaceRange(text, cur);
// Now fine tune the cursor to where we want it.
var curPosFinal;
var idx;
if (linewise && actionArgs.after) {
curPosFinal = Pos(
cur.line + 1,
findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)));
} else if (linewise && !actionArgs.after) {
curPosFinal = Pos(
cur.line,
findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)));
} else if (!linewise && actionArgs.after) {
idx = cm.indexFromPos(cur);
curPosFinal = cm.posFromIndex(idx + text.length - 1);
} else {
idx = cm.indexFromPos(cur);
curPosFinal = cm.posFromIndex(idx + text.length);
}
cm.setCursor(curPosFinal);
},
undo: function(cm, actionArgs) {
cm.operation(function() {
repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();
cm.setCursor(cm.getCursor('anchor'));
});
},
redo: function(cm, actionArgs) {
repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();
},
setRegister: function(_cm, actionArgs, vim) {
vim.inputState.registerName = actionArgs.selectedCharacter;
},
setMark: function(cm, actionArgs, vim) {
var markName = actionArgs.selectedCharacter;
updateMark(cm, vim, markName, cm.getCursor());
},
replace: function(cm, actionArgs, vim) {
var replaceWith = actionArgs.selectedCharacter;
var curStart = cm.getCursor();
var replaceTo;
var curEnd;
if (vim.visualMode){
curStart=cm.getCursor('start');
curEnd=cm.getCursor('end');
// workaround to catch the character under the cursor
// existing workaround doesn't cover actions
curEnd=cm.clipPos(Pos(curEnd.line, curEnd.ch+1));
}else{
var line = cm.getLine(curStart.line);
replaceTo = curStart.ch + actionArgs.repeat;
if (replaceTo > line.length) {
replaceTo=line.length;
}
curEnd = Pos(curStart.line, replaceTo);
}
if (replaceWith=='\n'){
if (!vim.visualMode) cm.replaceRange('', curStart, curEnd);
// special case, where vim help says to replace by just one line-break
(CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm);
}else {
var replaceWithStr=cm.getRange(curStart, curEnd);
//replace all characters in range by selected, but keep linebreaks
replaceWithStr=replaceWithStr.replace(/[^\n]/g,replaceWith);
cm.replaceRange(replaceWithStr, curStart, curEnd);
if (vim.visualMode){
cm.setCursor(curStart);
exitVisualMode(cm);
}else{
cm.setCursor(offsetCursor(curEnd, 0, -1));
}
}
},
incrementNumberToken: function(cm, actionArgs) {
var cur = cm.getCursor();
var lineStr = cm.getLine(cur.line);
var re = /-?\d+/g;
var match;
var start;
var end;
var numberStr;
var token;
while ((match = re.exec(lineStr)) !== null) {
token = match[0];
start = match.index;
end = start + token.length;
if (cur.ch < end)break;
}
if (!actionArgs.backtrack && (end <= cur.ch))return;
if (token) {
var increment = actionArgs.increase ? 1 : -1;
var number = parseInt(token) + (increment * actionArgs.repeat);
var from = Pos(cur.line, start);
var to = Pos(cur.line, end);
numberStr = number.toString();
cm.replaceRange(numberStr, from, to);
} else {
return;
}
cm.setCursor(Pos(cur.line, start + numberStr.length - 1));
},
repeatLastEdit: function(cm, actionArgs, vim) {
var lastEditInputState = vim.lastEditInputState;
if (!lastEditInputState) { return; }
var repeat = actionArgs.repeat;
if (repeat && actionArgs.repeatIsExplicit) {
vim.lastEditInputState.repeatOverride = repeat;
} else {
repeat = vim.lastEditInputState.repeatOverride || repeat;
}
repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */);
}
};
/*
* Below are miscellaneous utility functions used by vim.js
*/
/**
* Clips cursor to ensure that line is within the buffer's range
* If includeLineBreak is true, then allow cur.ch == lineLength.
*/
function clipCursorToContent(cm, cur, includeLineBreak) {
var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );
var maxCh = lineLength(cm, line) - 1;
maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;
var ch = Math.min(Math.max(0, cur.ch), maxCh);
return Pos(line, ch);
}
function copyArgs(args) {
var ret = {};
for (var prop in args) {
if (args.hasOwnProperty(prop)) {
ret[prop] = args[prop];
}
}
return ret;
}
function offsetCursor(cur, offsetLine, offsetCh) {
return Pos(cur.line + offsetLine, cur.ch + offsetCh);
}
function matchKeysPartial(pressed, mapped) {
for (var i = 0; i < pressed.length; i++) {
// 'character' means any character. For mark, register commads, etc.
if (pressed[i] != mapped[i] && mapped[i] != 'character') {
return false;
}
}
return true;
}
function repeatFn(cm, fn, repeat) {
return function() {
for (var i = 0; i < repeat; i++) {
fn(cm);
}
};
}
function copyCursor(cur) {
return Pos(cur.line, cur.ch);
}
function cursorEqual(cur1, cur2) {
return cur1.ch == cur2.ch && cur1.line == cur2.line;
}
function cursorIsBefore(cur1, cur2) {
if (cur1.line < cur2.line) {
return true;
}
if (cur1.line == cur2.line && cur1.ch < cur2.ch) {
return true;
}
return false;
}
function cusrorIsBetween(cur1, cur2, cur3) {
// returns true if cur2 is between cur1 and cur3.
var cur1before2 = cursorIsBefore(cur1, cur2);
var cur2before3 = cursorIsBefore(cur2, cur3);
return cur1before2 && cur2before3;
}
function lineLength(cm, lineNum) {
return cm.getLine(lineNum).length;
}
function reverse(s){
return s.split('').reverse().join('');
}
function trim(s) {
if (s.trim) {
return s.trim();
}
return s.replace(/^\s+|\s+$/g, '');
}
function escapeRegex(s) {
return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1');
}
function exitVisualMode(cm) {
cm.off('mousedown', exitVisualMode);
var vim = cm.state.vim;
// can't use selection state here because yank has already reset its cursor
vim.lastSelection = {'curStart': vim.marks['<'].find(),
'curEnd': vim.marks['>'].find(), 'visualMode': vim.visualMode,
'visualLine': vim.visualLine};
vim.visualMode = false;
vim.visualLine = false;
var selectionStart = cm.getCursor('anchor');
var selectionEnd = cm.getCursor('head');
if (!cursorEqual(selectionStart, selectionEnd)) {
// Clear the selection and set the cursor only if the selection has not
// already been cleared. Otherwise we risk moving the cursor somewhere
// it's not supposed to be.
cm.setCursor(clipCursorToContent(cm, selectionEnd));
}
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
}
// Remove any trailing newlines from the selection. For
// example, with the caret at the start of the last word on the line,
// 'dw' should word, but not the newline, while 'w' should advance the
// caret to the first character of the next line.
function clipToLine(cm, curStart, curEnd) {
var selection = cm.getRange(curStart, curEnd);
// Only clip if the selection ends with trailing newline + whitespace
if (/\n\s*$/.test(selection)) {
var lines = selection.split('\n');
// We know this is all whitepsace.
lines.pop();
// Cases:
// 1. Last word is an empty line - do not clip the trailing '\n'
// 2. Last word is not an empty line - clip the trailing '\n'
var line;
// Find the line containing the last word, and clip all whitespace up
// to it.
for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {
curEnd.line--;
curEnd.ch = 0;
}
// If the last word is not an empty line, clip an additional newline
if (line) {
curEnd.line--;
curEnd.ch = lineLength(cm, curEnd.line);
} else {
curEnd.ch = 0;
}
}
}
// Expand the selection to line ends.
function expandSelectionToLine(_cm, curStart, curEnd) {
curStart.ch = 0;
curEnd.ch = 0;
curEnd.line++;
}
function findFirstNonWhiteSpaceCharacter(text) {
if (!text) {
return 0;
}
var firstNonWS = text.search(/\S/);
return firstNonWS == -1 ? text.length : firstNonWS;
}
function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) {
var cur = cm.getCursor();
var line = cm.getLine(cur.line);
var idx = cur.ch;
// Seek to first word or non-whitespace character, depending on if
// noSymbol is true.
var textAfterIdx = line.substring(idx);
var firstMatchedChar;
if (noSymbol) {
firstMatchedChar = textAfterIdx.search(/\w/);
} else {
firstMatchedChar = textAfterIdx.search(/\S/);
}
if (firstMatchedChar == -1) {
return null;
}
idx += firstMatchedChar;
textAfterIdx = line.substring(idx);
var textBeforeIdx = line.substring(0, idx);
var matchRegex;
// Greedy matchers for the "word" we are trying to expand.
if (bigWord) {
matchRegex = /^\S+/;
} else {
if ((/\w/).test(line.charAt(idx))) {
matchRegex = /^\w+/;
} else {
matchRegex = /^[^\w\s]+/;
}
}
var wordAfterRegex = matchRegex.exec(textAfterIdx);
var wordStart = idx;
var wordEnd = idx + wordAfterRegex[0].length;
// TODO: Find a better way to do this. It will be slow on very long lines.
var revTextBeforeIdx = reverse(textBeforeIdx);
var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx);
if (wordBeforeRegex) {
wordStart -= wordBeforeRegex[0].length;
}
if (inclusive) {
// If present, trim all whitespace after word.
// Otherwise, trim all whitespace before word.
var textAfterWordEnd = line.substring(wordEnd);
var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length;
if (whitespacesAfterWord > 0) {
wordEnd += whitespacesAfterWord;
} else {
var revTrim = revTextBeforeIdx.length - wordStart;
var textBeforeWordStart = revTextBeforeIdx.substring(revTrim);
var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length;
wordStart -= whitespacesBeforeWord;
}
}
return { start: Pos(cur.line, wordStart),
end: Pos(cur.line, wordEnd) };
}
function recordJumpPosition(cm, oldCur, newCur) {
if (!cursorEqual(oldCur, newCur)) {
vimGlobalState.jumpList.add(cm, oldCur, newCur);
}
}
function recordLastCharacterSearch(increment, args) {
vimGlobalState.lastChararacterSearch.increment = increment;
vimGlobalState.lastChararacterSearch.forward = args.forward;
vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter;
}
var symbolToMode = {
'(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket',
'[': 'section', ']': 'section',
'*': 'comment', '/': 'comment',
'm': 'method', 'M': 'method',
'#': 'preprocess'
};
var findSymbolModes = {
bracket: {
isComplete: function(state) {
if (state.nextCh === state.symb) {
state.depth++;
if (state.depth >= 1)return true;
} else if (state.nextCh === state.reverseSymb) {
state.depth--;
}
return false;
}
},
section: {
init: function(state) {
state.curMoveThrough = true;
state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}';
},
isComplete: function(state) {
return state.index === 0 && state.nextCh === state.symb;
}
},
comment: {
isComplete: function(state) {
var found = state.lastCh === '*' && state.nextCh === '/';
state.lastCh = state.nextCh;
return found;
}
},
// TODO: The original Vim implementation only operates on level 1 and 2.
// The current implementation doesn't check for code block level and
// therefore it operates on any levels.
method: {
init: function(state) {
state.symb = (state.symb === 'm' ? '{' : '}');
state.reverseSymb = state.symb === '{' ? '}' : '{';
},
isComplete: function(state) {
if (state.nextCh === state.symb)return true;
return false;
}
},
preprocess: {
init: function(state) {
state.index = 0;
},
isComplete: function(state) {
if (state.nextCh === '#') {
var token = state.lineText.match(/#(\w+)/)[1];
if (token === 'endif') {
if (state.forward && state.depth === 0) {
return true;
}
state.depth++;
} else if (token === 'if') {
if (!state.forward && state.depth === 0) {
return true;
}
state.depth--;
}
if (token === 'else' && state.depth === 0)return true;
}
return false;
}
}
};
function findSymbol(cm, repeat, forward, symb) {
var cur = copyCursor(cm.getCursor());
var increment = forward ? 1 : -1;
var endLine = forward ? cm.lineCount() : -1;
var curCh = cur.ch;
var line = cur.line;
var lineText = cm.getLine(line);
var state = {
lineText: lineText,
nextCh: lineText.charAt(curCh),
lastCh: null,
index: curCh,
symb: symb,
reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb],
forward: forward,
depth: 0,
curMoveThrough: false
};
var mode = symbolToMode[symb];
if (!mode)return cur;
var init = findSymbolModes[mode].init;
var isComplete = findSymbolModes[mode].isComplete;
if (init) { init(state); }
while (line !== endLine && repeat) {
state.index += increment;
state.nextCh = state.lineText.charAt(state.index);
if (!state.nextCh) {
line += increment;
state.lineText = cm.getLine(line) || '';
if (increment > 0) {
state.index = 0;
} else {
var lineLen = state.lineText.length;
state.index = (lineLen > 0) ? (lineLen-1) : 0;
}
state.nextCh = state.lineText.charAt(state.index);
}
if (isComplete(state)) {
cur.line = line;
cur.ch = state.index;
repeat--;
}
}
if (state.nextCh || state.curMoveThrough) {
return Pos(line, state.index);
}
return cur;
}
/*
* Returns the boundaries of the next word. If the cursor in the middle of
* the word, then returns the boundaries of the current word, starting at
* the cursor. If the cursor is at the start/end of a word, and we are going
* forward/backward, respectively, find the boundaries of the next word.
*
* @param {CodeMirror} cm CodeMirror object.
* @param {Cursor} cur The cursor position.
* @param {boolean} forward True to search forward. False to search
* backward.
* @param {boolean} bigWord True if punctuation count as part of the word.
* False if only [a-zA-Z0-9] characters count as part of the word.
* @param {boolean} emptyLineIsWord True if empty lines should be treated
* as words.
* @return {Object{from:number, to:number, line: number}} The boundaries of
* the word, or null if there are no more words.
*/
function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
var lineNum = cur.line;
var pos = cur.ch;
var line = cm.getLine(lineNum);
var dir = forward ? 1 : -1;
var regexps = bigWord ? bigWordRegexp : wordRegexp;
if (emptyLineIsWord && line == '') {
lineNum += dir;
line = cm.getLine(lineNum);
if (!isLine(cm, lineNum)) {
return null;
}
pos = (forward) ? 0 : line.length;
}
while (true) {
if (emptyLineIsWord && line == '') {
return { from: 0, to: 0, line: lineNum };
}
var stop = (dir > 0) ? line.length : -1;
var wordStart = stop, wordEnd = stop;
// Find bounds of next word.
while (pos != stop) {
var foundWord = false;
for (var i = 0; i < regexps.length && !foundWord; ++i) {
if (regexps[i].test(line.charAt(pos))) {
wordStart = pos;
// Advance to end of word.
while (pos != stop && regexps[i].test(line.charAt(pos))) {
pos += dir;
}
wordEnd = pos;
foundWord = wordStart != wordEnd;
if (wordStart == cur.ch && lineNum == cur.line &&
wordEnd == wordStart + dir) {
// We started at the end of a word. Find the next one.
continue;
} else {
return {
from: Math.min(wordStart, wordEnd + 1),
to: Math.max(wordStart, wordEnd),
line: lineNum };
}
}
}
if (!foundWord) {
pos += dir;
}
}
// Advance to next/prev line.
lineNum += dir;
if (!isLine(cm, lineNum)) {
return null;
}
line = cm.getLine(lineNum);
pos = (dir > 0) ? 0 : line.length;
}
// Should never get here.
throw new Error('The impossible happened.');
}
/**
* @param {CodeMirror} cm CodeMirror object.
* @param {int} repeat Number of words to move past.
* @param {boolean} forward True to search forward. False to search
* backward.
* @param {boolean} wordEnd True to move to end of word. False to move to
* beginning of word.
* @param {boolean} bigWord True if punctuation count as part of the word.
* False if only alphabet characters count as part of the word.
* @return {Cursor} The position the cursor should move to.
*/
function moveToWord(cm, repeat, forward, wordEnd, bigWord) {
var cur = cm.getCursor();
var curStart = copyCursor(cur);
var words = [];
if (forward && !wordEnd || !forward && wordEnd) {
repeat++;
}
// For 'e', empty lines are not considered words, go figure.
var emptyLineIsWord = !(forward && wordEnd);
for (var i = 0; i < repeat; i++) {
var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord);
if (!word) {
var eodCh = lineLength(cm, cm.lastLine());
words.push(forward
? {line: cm.lastLine(), from: eodCh, to: eodCh}
: {line: 0, from: 0, to: 0});
break;
}
words.push(word);
cur = Pos(word.line, forward ? (word.to - 1) : word.from);
}
var shortCircuit = words.length != repeat;
var firstWord = words[0];
var lastWord = words.pop();
if (forward && !wordEnd) {
// w
if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {
// We did not start in the middle of a word. Discard the extra word at the end.
lastWord = words.pop();
}
return Pos(lastWord.line, lastWord.from);
} else if (forward && wordEnd) {
return Pos(lastWord.line, lastWord.to - 1);
} else if (!forward && wordEnd) {
// ge
if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {
// We did not start in the middle of a word. Discard the extra word at the end.
lastWord = words.pop();
}
return Pos(lastWord.line, lastWord.to);
} else {
// b
return Pos(lastWord.line, lastWord.from);
}
}
function moveToCharacter(cm, repeat, forward, character) {
var cur = cm.getCursor();
var start = cur.ch;
var idx;
for (var i = 0; i < repeat; i ++) {
var line = cm.getLine(cur.line);
idx = charIdxInLine(start, line, character, forward, true);
if (idx == -1) {
return null;
}
start = idx;
}
return Pos(cm.getCursor().line, idx);
}
function moveToColumn(cm, repeat) {
// repeat is always >= 1, so repeat - 1 always corresponds
// to the column we want to go to.
var line = cm.getCursor().line;
return clipCursorToContent(cm, Pos(line, repeat - 1));
}
function updateMark(cm, vim, markName, pos) {
if (!inArray(markName, validMarks)) {
return;
}
if (vim.marks[markName]) {
vim.marks[markName].clear();
}
vim.marks[markName] = cm.setBookmark(pos);
}
function charIdxInLine(start, line, character, forward, includeChar) {
// Search for char in line.
// motion_options: {forward, includeChar}
// If includeChar = true, include it too.
// If forward = true, search forward, else search backwards.
// If char is not found on this line, do nothing
var idx;
if (forward) {
idx = line.indexOf(character, start + 1);
if (idx != -1 && !includeChar) {
idx -= 1;
}
} else {
idx = line.lastIndexOf(character, start - 1);
if (idx != -1 && !includeChar) {
idx += 1;
}
}
return idx;
}
// TODO: perhaps this finagling of start and end positions belonds
// in codmirror/replaceRange?
function selectCompanionObject(cm, symb, inclusive) {
var cur = cm.getCursor(), start, end;
var bracketRegexp = ({
'(': /[()]/, ')': /[()]/,
'[': /[[\]]/, ']': /[[\]]/,
'{': /[{}]/, '}': /[{}]/})[symb];
var openSym = ({
'(': '(', ')': '(',
'[': '[', ']': '[',
'{': '{', '}': '{'})[symb];
var curChar = cm.getLine(cur.line).charAt(cur.ch);
// Due to the behavior of scanForBracket, we need to add an offset if the
// cursor is on a matching open bracket.
var offset = curChar === openSym ? 1 : 0;
start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp});
end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp});
if (!start || !end) {
return { start: cur, end: cur };
}
start = start.pos;
end = end.pos;
if ((start.line == end.line && start.ch > end.ch)
|| (start.line > end.line)) {
var tmp = start;
start = end;
end = tmp;
}
if (inclusive) {
end.ch += 1;
} else {
start.ch += 1;
}
return { start: start, end: end };
}
// Takes in a symbol and a cursor and tries to simulate text objects that
// have identical opening and closing symbols
// TODO support across multiple lines
function findBeginningAndEnd(cm, symb, inclusive) {
var cur = copyCursor(cm.getCursor());
var line = cm.getLine(cur.line);
var chars = line.split('');
var start, end, i, len;
var firstIndex = chars.indexOf(symb);
// the decision tree is to always look backwards for the beginning first,
// but if the cursor is in front of the first instance of the symb,
// then move the cursor forward
if (cur.ch < firstIndex) {
cur.ch = firstIndex;
// Why is this line even here???
// cm.setCursor(cur.line, firstIndex+1);
}
// otherwise if the cursor is currently on the closing symbol
else if (firstIndex < cur.ch && chars[cur.ch] == symb) {
end = cur.ch; // assign end to the current cursor
--cur.ch; // make sure to look backwards
}
// if we're currently on the symbol, we've got a start
if (chars[cur.ch] == symb && !end) {
start = cur.ch + 1; // assign start to ahead of the cursor
} else {
// go backwards to find the start
for (i = cur.ch; i > -1 && !start; i--) {
if (chars[i] == symb) {
start = i + 1;
}
}
}
// look forwards for the end symbol
if (start && !end) {
for (i = start, len = chars.length; i < len && !end; i++) {
if (chars[i] == symb) {
end = i;
}
}
}
// nothing found
if (!start || !end) {
return { start: cur, end: cur };
}
// include the symbols
if (inclusive) {
--start; ++end;
}
return {
start: Pos(cur.line, start),
end: Pos(cur.line, end)
};
}
// Search functions
defineOption('pcre', true, 'boolean');
function SearchState() {}
SearchState.prototype = {
getQuery: function() {
return vimGlobalState.query;
},
setQuery: function(query) {
vimGlobalState.query = query;
},
getOverlay: function() {
return this.searchOverlay;
},
setOverlay: function(overlay) {
this.searchOverlay = overlay;
},
isReversed: function() {
return vimGlobalState.isReversed;
},
setReversed: function(reversed) {
vimGlobalState.isReversed = reversed;
}
};
function getSearchState(cm) {
var vim = cm.state.vim;
return vim.searchState_ || (vim.searchState_ = new SearchState());
}
function dialog(cm, template, shortText, onClose, options) {
if (cm.openDialog) {
cm.openDialog(template, onClose, { bottom: true, value: options.value,
onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp });
}
else {
onClose(prompt(shortText, ''));
}
}
function findUnescapedSlashes(str) {
var escapeNextChar = false;
var slashes = [];
for (var i = 0; i < str.length; i++) {
var c = str.charAt(i);
if (!escapeNextChar && c == '/') {
slashes.push(i);
}
escapeNextChar = !escapeNextChar && (c == '\\');
}
return slashes;
}
// Translates a search string from ex (vim) syntax into javascript form.
function translateRegex(str) {
// When these match, add a '\' if unescaped or remove one if escaped.
var specials = ['|', '(', ')', '{'];
// Remove, but never add, a '\' for these.
var unescape = ['}'];
var escapeNextChar = false;
var out = [];
for (var i = -1; i < str.length; i++) {
var c = str.charAt(i) || '';
var n = str.charAt(i+1) || '';
var specialComesNext = (specials.indexOf(n) != -1);
if (escapeNextChar) {
if (c !== '\\' || !specialComesNext) {
out.push(c);
}
escapeNextChar = false;
} else {
if (c === '\\') {
escapeNextChar = true;
// Treat the unescape list as special for removing, but not adding '\'.
if (unescape.indexOf(n) != -1) {
specialComesNext = true;
}
// Not passing this test means removing a '\'.
if (!specialComesNext || n === '\\') {
out.push(c);
}
} else {
out.push(c);
if (specialComesNext && n !== '\\') {
out.push('\\');
}
}
}
}
return out.join('');
}
// Translates the replace part of a search and replace from ex (vim) syntax into
// javascript form. Similar to translateRegex, but additionally fixes back references
// (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'.
function translateRegexReplace(str) {
var escapeNextChar = false;
var out = [];
for (var i = -1; i < str.length; i++) {
var c = str.charAt(i) || '';
var n = str.charAt(i+1) || '';
if (escapeNextChar) {
// At any point in the loop, escapeNextChar is true if the previous
// character was a '\' and was not escaped.
out.push(c);
escapeNextChar = false;
} else {
if (c === '\\') {
escapeNextChar = true;
if ((isNumber(n) || n === '$')) {
out.push('$');
} else if (n !== '/' && n !== '\\') {
out.push('\\');
}
} else {
if (c === '$') {
out.push('$');
}
out.push(c);
if (n === '/') {
out.push('\\');
}
}
}
}
return out.join('');
}
// Unescape \ and / in the replace part, for PCRE mode.
function unescapeRegexReplace(str) {
var stream = new CodeMirror.StringStream(str);
var output = [];
while (!stream.eol()) {
// Search for \.
while (stream.peek() && stream.peek() != '\\') {
output.push(stream.next());
}
if (stream.match('\\/', true)) {
// \/ => /
output.push('/');
} else if (stream.match('\\\\', true)) {
// \\ => \
output.push('\\');
} else {
// Don't change anything
output.push(stream.next());
}
}
return output.join('');
}
/**
* Extract the regular expression from the query and return a Regexp object.
* Returns null if the query is blank.
* If ignoreCase is passed in, the Regexp object will have the 'i' flag set.
* If smartCase is passed in, and the query contains upper case letters,
* then ignoreCase is overridden, and the 'i' flag will not be set.
* If the query contains the /i in the flag part of the regular expression,
* then both ignoreCase and smartCase are ignored, and 'i' will be passed
* through to the Regex object.
*/
function parseQuery(query, ignoreCase, smartCase) {
// Check if the query is already a regex.
if (query instanceof RegExp) { return query; }
// First try to extract regex + flags from the input. If no flags found,
// extract just the regex. IE does not accept flags directly defined in
// the regex string in the form /regex/flags
var slashes = findUnescapedSlashes(query);
var regexPart;
var forceIgnoreCase;
if (!slashes.length) {
// Query looks like 'regexp'
regexPart = query;
} else {
// Query looks like 'regexp/...'
regexPart = query.substring(0, slashes[0]);
var flagsPart = query.substring(slashes[0]);
forceIgnoreCase = (flagsPart.indexOf('i') != -1);
}
if (!regexPart) {
return null;
}
if (!getOption('pcre')) {
regexPart = translateRegex(regexPart);
}
if (smartCase) {
ignoreCase = (/^[^A-Z]*$/).test(regexPart);
}
var regexp = new RegExp(regexPart,
(ignoreCase || forceIgnoreCase) ? 'i' : undefined);
return regexp;
}
function showConfirm(cm, text) {
if (cm.openNotification) {
cm.openNotification('<span style="color: red">' + text + '</span>',
{bottom: true, duration: 5000});
} else {
alert(text);
}
}
function makePrompt(prefix, desc) {
var raw = '';
if (prefix) {
raw += '<span style="font-family: monospace">' + prefix + '</span>';
}
raw += '<input type="text"/> ' +
'<span style="color: #888">';
if (desc) {
raw += '<span style="color: #888">';
raw += desc;
raw += '</span>';
}
return raw;
}
var searchPromptDesc = '(Javascript regexp)';
function showPrompt(cm, options) {
var shortText = (options.prefix || '') + ' ' + (options.desc || '');
var prompt = makePrompt(options.prefix, options.desc);
dialog(cm, prompt, shortText, options.onClose, options);
}
function regexEqual(r1, r2) {
if (r1 instanceof RegExp && r2 instanceof RegExp) {
var props = ['global', 'multiline', 'ignoreCase', 'source'];
for (var i = 0; i < props.length; i++) {
var prop = props[i];
if (r1[prop] !== r2[prop]) {
return false;
}
}
return true;
}
return false;
}
// Returns true if the query is valid.
function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {
if (!rawQuery) {
return;
}
var state = getSearchState(cm);
var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase);
if (!query) {
return;
}
highlightSearchMatches(cm, query);
if (regexEqual(query, state.getQuery())) {
return query;
}
state.setQuery(query);
return query;
}
function searchOverlay(query) {
if (query.source.charAt(0) == '^') {
var matchSol = true;
}
return {
token: function(stream) {
if (matchSol && !stream.sol()) {
stream.skipToEnd();
return;
}
var match = stream.match(query, false);
if (match) {
if (match[0].length == 0) {
// Matched empty string, skip to next.
stream.next();
return 'searching';
}
if (!stream.sol()) {
// Backtrack 1 to match \b
stream.backUp(1);
if (!query.exec(stream.next() + match[0])) {
stream.next();
return null;
}
}
stream.match(query);
return 'searching';
}
while (!stream.eol()) {
stream.next();
if (stream.match(query, false)) break;
}
},
query: query
};
}
function highlightSearchMatches(cm, query) {
var overlay = getSearchState(cm).getOverlay();
if (!overlay || query != overlay.query) {
if (overlay) {
cm.removeOverlay(overlay);
}
overlay = searchOverlay(query);
cm.addOverlay(overlay);
getSearchState(cm).setOverlay(overlay);
}
}
function findNext(cm, prev, query, repeat) {
if (repeat === undefined) { repeat = 1; }
return cm.operation(function() {
var pos = cm.getCursor();
var cursor = cm.getSearchCursor(query, pos);
for (var i = 0; i < repeat; i++) {
var found = cursor.find(prev);
if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); }
if (!found) {
// SearchCursor may have returned null because it hit EOF, wrap
// around and try again.
cursor = cm.getSearchCursor(query,
(prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) );
if (!cursor.find(prev)) {
return;
}
}
}
return cursor.from();
});
}
function clearSearchHighlight(cm) {
cm.removeOverlay(getSearchState(cm).getOverlay());
getSearchState(cm).setOverlay(null);
}
/**
* Check if pos is in the specified range, INCLUSIVE.
* Range can be specified with 1 or 2 arguments.
* If the first range argument is an array, treat it as an array of line
* numbers. Match pos against any of the lines.
* If the first range argument is a number,
* if there is only 1 range argument, check if pos has the same line
* number
* if there are 2 range arguments, then check if pos is in between the two
* range arguments.
*/
function isInRange(pos, start, end) {
if (typeof pos != 'number') {
// Assume it is a cursor position. Get the line number.
pos = pos.line;
}
if (start instanceof Array) {
return inArray(pos, start);
} else {
if (end) {
return (pos >= start && pos <= end);
} else {
return pos == start;
}
}
}
function getUserVisibleLines(cm) {
var scrollInfo = cm.getScrollInfo();
var occludeToleranceTop = 6;
var occludeToleranceBottom = 10;
var from = cm.coordsChar({left:0, top: occludeToleranceTop + scrollInfo.top}, 'local');
var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + scrollInfo.top;
var to = cm.coordsChar({left:0, top: bottomY}, 'local');
return {top: from.line, bottom: to.line};
}
// Ex command handling
// Care must be taken when adding to the default Ex command map. For any
// pair of commands that have a shared prefix, at least one of their
// shortNames must not match the prefix of the other command.
var defaultExCommandMap = [
{ name: 'map' },
{ name: 'nmap', shortName: 'nm' },
{ name: 'vmap', shortName: 'vm' },
{ name: 'unmap' },
{ name: 'write', shortName: 'w' },
{ name: 'undo', shortName: 'u' },
{ name: 'redo', shortName: 'red' },
{ name: 'set', shortName: 'set' },
{ name: 'sort', shortName: 'sor' },
{ name: 'substitute', shortName: 's' },
{ name: 'nohlsearch', shortName: 'noh' },
{ name: 'delmarks', shortName: 'delm' },
{ name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }
];
Vim.ExCommandDispatcher = function() {
this.buildCommandMap_();
};
Vim.ExCommandDispatcher.prototype = {
processCommand: function(cm, input) {
var vim = cm.state.vim;
var commandHistoryRegister = vimGlobalState.registerController.getRegister(':');
var previousCommand = commandHistoryRegister.toString();
if (vim.visualMode) {
exitVisualMode(cm);
}
var inputStream = new CodeMirror.StringStream(input);
// update ": with the latest command whether valid or invalid
commandHistoryRegister.setText(input);
var params = {};
params.input = input;
try {
this.parseInput_(cm, inputStream, params);
} catch(e) {
showConfirm(cm, e);
throw e;
}
var commandName;
if (!params.commandName) {
// If only a line range is defined, move to the line.
if (params.line !== undefined) {
commandName = 'move';
}
} else {
var command = this.matchCommand_(params.commandName);
if (command) {
commandName = command.name;
if (command.excludeFromCommandHistory) {
commandHistoryRegister.setText(previousCommand);
}
this.parseCommandArgs_(inputStream, params, command);
if (command.type == 'exToKey') {
// Handle Ex to Key mapping.
for (var i = 0; i < command.toKeys.length; i++) {
CodeMirror.Vim.handleKey(cm, command.toKeys[i]);
}
return;
} else if (command.type == 'exToEx') {
// Handle Ex to Ex mapping.
this.processCommand(cm, command.toInput);
return;
}
}
}
if (!commandName) {
showConfirm(cm, 'Not an editor command ":' + input + '"');
return;
}
try {
exCommands[commandName](cm, params);
} catch(e) {
showConfirm(cm, e);
throw e;
}
},
parseInput_: function(cm, inputStream, result) {
inputStream.eatWhile(':');
// Parse range.
if (inputStream.eat('%')) {
result.line = cm.firstLine();
result.lineEnd = cm.lastLine();
} else {
result.line = this.parseLineSpec_(cm, inputStream);
if (result.line !== undefined && inputStream.eat(',')) {
result.lineEnd = this.parseLineSpec_(cm, inputStream);
}
}
// Parse command name.
var commandMatch = inputStream.match(/^(\w+)/);
if (commandMatch) {
result.commandName = commandMatch[1];
} else {
result.commandName = inputStream.match(/.*/)[0];
}
return result;
},
parseLineSpec_: function(cm, inputStream) {
var numberMatch = inputStream.match(/^(\d+)/);
if (numberMatch) {
return parseInt(numberMatch[1], 10) - 1;
}
switch (inputStream.next()) {
case '.':
return cm.getCursor().line;
case '$':
return cm.lastLine();
case '\'':
var mark = cm.state.vim.marks[inputStream.next()];
if (mark && mark.find()) {
return mark.find().line;
}
throw new Error('Mark not set');
default:
inputStream.backUp(1);
return undefined;
}
},
parseCommandArgs_: function(inputStream, params, command) {
if (inputStream.eol()) {
return;
}
params.argString = inputStream.match(/.*/)[0];
// Parse command-line arguments
var delim = command.argDelimiter || /\s+/;
var args = trim(params.argString).split(delim);
if (args.length && args[0]) {
params.args = args;
}
},
matchCommand_: function(commandName) {
// Return the command in the command map that matches the shortest
// prefix of the passed in command name. The match is guaranteed to be
// unambiguous if the defaultExCommandMap's shortNames are set up
// correctly. (see @code{defaultExCommandMap}).
for (var i = commandName.length; i > 0; i--) {
var prefix = commandName.substring(0, i);
if (this.commandMap_[prefix]) {
var command = this.commandMap_[prefix];
if (command.name.indexOf(commandName) === 0) {
return command;
}
}
}
return null;
},
buildCommandMap_: function() {
this.commandMap_ = {};
for (var i = 0; i < defaultExCommandMap.length; i++) {
var command = defaultExCommandMap[i];
var key = command.shortName || command.name;
this.commandMap_[key] = command;
}
},
map: function(lhs, rhs, ctx) {
if (lhs != ':' && lhs.charAt(0) == ':') {
if (ctx) { throw Error('Mode not supported for ex mappings'); }
var commandName = lhs.substring(1);
if (rhs != ':' && rhs.charAt(0) == ':') {
// Ex to Ex mapping
this.commandMap_[commandName] = {
name: commandName,
type: 'exToEx',
toInput: rhs.substring(1),
user: true
};
} else {
// Ex to key mapping
this.commandMap_[commandName] = {
name: commandName,
type: 'exToKey',
toKeys: parseKeyString(rhs),
user: true
};
}
} else {
if (rhs != ':' && rhs.charAt(0) == ':') {
// Key to Ex mapping.
var mapping = {
keys: parseKeyString(lhs),
type: 'keyToEx',
exArgs: { input: rhs.substring(1) },
user: true};
if (ctx) { mapping.context = ctx; }
defaultKeymap.unshift(mapping);
} else {
// Key to key mapping
var mapping = {
keys: parseKeyString(lhs),
type: 'keyToKey',
toKeys: parseKeyString(rhs),
user: true
};
if (ctx) { mapping.context = ctx; }
defaultKeymap.unshift(mapping);
}
}
},
unmap: function(lhs, ctx) {
var arrayEquals = function(a, b) {
if (a === b) return true;
if (a == null || b == null) return true;
if (a.length != b.length) return false;
for (var i = 0; i < a.length; i++) {
if (a[i] !== b[i]) return false;
}
return true;
};
if (lhs != ':' && lhs.charAt(0) == ':') {
// Ex to Ex or Ex to key mapping
if (ctx) { throw Error('Mode not supported for ex mappings'); }
var commandName = lhs.substring(1);
if (this.commandMap_[commandName] && this.commandMap_[commandName].user) {
delete this.commandMap_[commandName];
return;
}
} else {
// Key to Ex or key to key mapping
var keys = parseKeyString(lhs);
for (var i = 0; i < defaultKeymap.length; i++) {
if (arrayEquals(keys, defaultKeymap[i].keys)
&& defaultKeymap[i].context === ctx
&& defaultKeymap[i].user) {
defaultKeymap.splice(i, 1);
return;
}
}
}
throw Error('No such mapping.');
}
};
// Converts a key string sequence of the form a<C-w>bd<Left> into Vim's
// keymap representation.
function parseKeyString(str) {
var key, match;
var keys = [];
while (str) {
match = (/<\w+-.+?>|<\w+>|./).exec(str);
if (match === null)break;
key = match[0];
str = str.substring(match.index + key.length);
keys.push(key);
}
return keys;
}
var exCommands = {
map: function(cm, params, ctx) {
var mapArgs = params.args;
if (!mapArgs || mapArgs.length < 2) {
if (cm) {
showConfirm(cm, 'Invalid mapping: ' + params.input);
}
return;
}
exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx);
},
nmap: function(cm, params) { this.map(cm, params, 'normal'); },
vmap: function(cm, params) { this.map(cm, params, 'visual'); },
unmap: function(cm, params, ctx) {
var mapArgs = params.args;
if (!mapArgs || mapArgs.length < 1) {
if (cm) {
showConfirm(cm, 'No such mapping: ' + params.input);
}
return;
}
exCommandDispatcher.unmap(mapArgs[0], ctx);
},
move: function(cm, params) {
commandDispatcher.processCommand(cm, cm.state.vim, {
type: 'motion',
motion: 'moveToLineOrEdgeOfDocument',
motionArgs: { forward: false, explicitRepeat: true,
linewise: true },
repeatOverride: params.line+1});
},
set: function(cm, params) {
var setArgs = params.args;
if (!setArgs || setArgs.length < 1) {
if (cm) {
showConfirm(cm, 'Invalid mapping: ' + params.input);
}
return;
}
var expr = setArgs[0].split('=');
var optionName = expr[0];
var value = expr[1];
var forceGet = false;
if (optionName.charAt(optionName.length - 1) == '?') {
// If post-fixed with ?, then the set is actually a get.
if (value) { throw Error('Trailing characters: ' + params.argString); }
optionName = optionName.substring(0, optionName.length - 1);
forceGet = true;
}
if (value === undefined && optionName.substring(0, 2) == 'no') {
// To set boolean options to false, the option name is prefixed with
// 'no'.
optionName = optionName.substring(2);
value = false;
}
var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean';
if (optionIsBoolean && value == undefined) {
// Calling set with a boolean option sets it to true.
value = true;
}
if (!optionIsBoolean && !value || forceGet) {
var oldValue = getOption(optionName);
// If no value is provided, then we assume this is a get.
if (oldValue === true || oldValue === false) {
showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);
} else {
showConfirm(cm, ' ' + optionName + '=' + oldValue);
}
} else {
setOption(optionName, value);
}
},
registers: function(cm,params) {
var regArgs = params.args;
var registers = vimGlobalState.registerController.registers;
var regInfo = '----------Registers----------<br><br>';
if (!regArgs) {
for (var registerName in registers) {
var text = registers[registerName].toString();
if (text.length) {
regInfo += '"' + registerName + ' ' + text + '<br>';
}
}
} else {
var registerName;
regArgs = regArgs.join('');
for (var i = 0; i < regArgs.length; i++) {
registerName = regArgs.charAt(i);
if (!vimGlobalState.registerController.isValidRegister(registerName)) {
continue;
}
var register = registers[registerName] || new Register();
regInfo += '"' + registerName + ' ' + register.toString() + '<br>';
}
}
showConfirm(cm, regInfo);
},
sort: function(cm, params) {
var reverse, ignoreCase, unique, number;
function parseArgs() {
if (params.argString) {
var args = new CodeMirror.StringStream(params.argString);
if (args.eat('!')) { reverse = true; }
if (args.eol()) { return; }
if (!args.eatSpace()) { return 'Invalid arguments'; }
var opts = args.match(/[a-z]+/);
if (opts) {
opts = opts[0];
ignoreCase = opts.indexOf('i') != -1;
unique = opts.indexOf('u') != -1;
var decimal = opts.indexOf('d') != -1 && 1;
var hex = opts.indexOf('x') != -1 && 1;
var octal = opts.indexOf('o') != -1 && 1;
if (decimal + hex + octal > 1) { return 'Invalid arguments'; }
number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
}
if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; }
}
}
var err = parseArgs();
if (err) {
showConfirm(cm, err + ': ' + params.argString);
return;
}
var lineStart = params.line || cm.firstLine();
var lineEnd = params.lineEnd || params.line || cm.lastLine();
if (lineStart == lineEnd) { return; }
var curStart = Pos(lineStart, 0);
var curEnd = Pos(lineEnd, lineLength(cm, lineEnd));
var text = cm.getRange(curStart, curEnd).split('\n');
var numberRegex = (number == 'decimal') ? /(-?)([\d]+)/ :
(number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i :
(number == 'octal') ? /([0-7]+)/ : null;
var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null;
var numPart = [], textPart = [];
if (number) {
for (var i = 0; i < text.length; i++) {
if (numberRegex.exec(text[i])) {
numPart.push(text[i]);
} else {
textPart.push(text[i]);
}
}
} else {
textPart = text;
}
function compareFn(a, b) {
if (reverse) { var tmp; tmp = a; a = b; b = tmp; }
if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); }
var anum = number && numberRegex.exec(a);
var bnum = number && numberRegex.exec(b);
if (!anum) { return a < b ? -1 : 1; }
anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix);
bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix);
return anum - bnum;
}
numPart.sort(compareFn);
textPart.sort(compareFn);
text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart);
if (unique) { // Remove duplicate lines
var textOld = text;
var lastLine;
text = [];
for (var i = 0; i < textOld.length; i++) {
if (textOld[i] != lastLine) {
text.push(textOld[i]);
}
lastLine = textOld[i];
}
}
cm.replaceRange(text.join('\n'), curStart, curEnd);
},
substitute: function(cm, params) {
if (!cm.getSearchCursor) {
throw new Error('Search feature not available. Requires searchcursor.js or ' +
'any other getSearchCursor implementation.');
}
var argString = params.argString;
var slashes = argString ? findUnescapedSlashes(argString) : [];
var replacePart = '';
if (slashes.length) {
if (slashes[0] !== 0) {
showConfirm(cm, 'Substitutions should be of the form ' +
':s/pattern/replace/');
return;
}
var regexPart = argString.substring(slashes[0] + 1, slashes[1]);
var flagsPart;
var count;
var confirm = false; // Whether to confirm each replace.
if (slashes[1]) {
replacePart = argString.substring(slashes[1] + 1, slashes[2]);
if (getOption('pcre')) {
replacePart = unescapeRegexReplace(replacePart);
} else {
replacePart = translateRegexReplace(replacePart);
}
vimGlobalState.lastSubstituteReplacePart = replacePart;
}
if (slashes[2]) {
// After the 3rd slash, we can have flags followed by a space followed
// by count.
var trailing = argString.substring(slashes[2] + 1).split(' ');
flagsPart = trailing[0];
count = parseInt(trailing[1]);
}
if (flagsPart) {
if (flagsPart.indexOf('c') != -1) {
confirm = true;
flagsPart.replace('c', '');
}
regexPart = regexPart + '/' + flagsPart;
}
}
if (regexPart) {
// If regex part is empty, then use the previous query. Otherwise use
// the regex part as the new query.
try {
updateSearchQuery(cm, regexPart, true /** ignoreCase */,
true /** smartCase */);
} catch (e) {
showConfirm(cm, 'Invalid regex: ' + regexPart);
return;
}
}
replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart;
if (replacePart === undefined) {
showConfirm(cm, 'No previous substitute regular expression');
return;
}
var state = getSearchState(cm);
var query = state.getQuery();
var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;
var lineEnd = params.lineEnd || lineStart;
if (count) {
lineStart = lineEnd;
lineEnd = lineStart + count - 1;
}
var startPos = clipCursorToContent(cm, Pos(lineStart, 0));
var cursor = cm.getSearchCursor(query, startPos);
doReplace(cm, confirm, lineStart, lineEnd, cursor, query, replacePart);
},
redo: CodeMirror.commands.redo,
undo: CodeMirror.commands.undo,
write: function(cm) {
if (CodeMirror.commands.save) {
// If a save command is defined, call it.
CodeMirror.commands.save(cm);
} else {
// Saves to text area if no save command is defined.
cm.save();
}
},
nohlsearch: function(cm) {
clearSearchHighlight(cm);
},
delmarks: function(cm, params) {
if (!params.argString || !trim(params.argString)) {
showConfirm(cm, 'Argument required');
return;
}
var state = cm.state.vim;
var stream = new CodeMirror.StringStream(trim(params.argString));
while (!stream.eol()) {
stream.eatSpace();
// Record the streams position at the beginning of the loop for use
// in error messages.
var count = stream.pos;
if (!stream.match(/[a-zA-Z]/, false)) {
showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
return;
}
var sym = stream.next();
// Check if this symbol is part of a range
if (stream.match('-', true)) {
// This symbol is part of a range.
// The range must terminate at an alphabetic character.
if (!stream.match(/[a-zA-Z]/, false)) {
showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
return;
}
var startMark = sym;
var finishMark = stream.next();
// The range must terminate at an alphabetic character which
// shares the same case as the start of the range.
if (isLowerCase(startMark) && isLowerCase(finishMark) ||
isUpperCase(startMark) && isUpperCase(finishMark)) {
var start = startMark.charCodeAt(0);
var finish = finishMark.charCodeAt(0);
if (start >= finish) {
showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
return;
}
// Because marks are always ASCII values, and we have
// determined that they are the same case, we can use
// their char codes to iterate through the defined range.
for (var j = 0; j <= finish - start; j++) {
var mark = String.fromCharCode(start + j);
delete state.marks[mark];
}
} else {
showConfirm(cm, 'Invalid argument: ' + startMark + '-');
return;
}
} else {
// This symbol is a valid mark, and is not part of a range.
delete state.marks[sym];
}
}
}
};
var exCommandDispatcher = new Vim.ExCommandDispatcher();
/**
* @param {CodeMirror} cm CodeMirror instance we are in.
* @param {boolean} confirm Whether to confirm each replace.
* @param {Cursor} lineStart Line to start replacing from.
* @param {Cursor} lineEnd Line to stop replacing at.
* @param {RegExp} query Query for performing matches with.
* @param {string} replaceWith Text to replace matches with. May contain $1,
* $2, etc for replacing captured groups using Javascript replace.
*/
function doReplace(cm, confirm, lineStart, lineEnd, searchCursor, query,
replaceWith) {
// Set up all the functions.
cm.state.vim.exMode = true;
var done = false;
var lastPos = searchCursor.from();
function replaceAll() {
cm.operation(function() {
while (!done) {
replace();
next();
}
stop();
});
}
function replace() {
var text = cm.getRange(searchCursor.from(), searchCursor.to());
var newText = text.replace(query, replaceWith);
searchCursor.replace(newText);
}
function next() {
var found = searchCursor.findNext();
if (!found) {
done = true;
} else if (isInRange(searchCursor.from(), lineStart, lineEnd)) {
cm.scrollIntoView(searchCursor.from(), 30);
cm.setSelection(searchCursor.from(), searchCursor.to());
lastPos = searchCursor.from();
done = false;
} else {
done = true;
}
}
function stop(close) {
if (close) { close(); }
cm.focus();
if (lastPos) {
cm.setCursor(lastPos);
var vim = cm.state.vim;
vim.exMode = false;
vim.lastHPos = vim.lastHSPos = lastPos.ch;
}
}
function onPromptKeyDown(e, _value, close) {
// Swallow all keys.
CodeMirror.e_stop(e);
var keyName = CodeMirror.keyName(e);
switch (keyName) {
case 'Y':
replace(); next(); break;
case 'N':
next(); break;
case 'A':
cm.operation(replaceAll); break;
case 'L':
replace();
// fall through and exit.
case 'Q':
case 'Esc':
case 'Ctrl-C':
case 'Ctrl-[':
stop(close);
break;
}
if (done) { stop(close); }
}
// Actually do replace.
next();
if (done) {
showConfirm(cm, 'No matches for ' + query.source);
return;
}
if (!confirm) {
replaceAll();
return;
}
showPrompt(cm, {
prefix: 'replace with <strong>' + replaceWith + '</strong> (y/n/a/q/l)',
onKeyDown: onPromptKeyDown
});
}
// Register Vim with CodeMirror
function buildVimKeyMap() {
/**
* Handle the raw key event from CodeMirror. Translate the
* Shift + key modifier to the resulting letter, while preserving other
* modifers.
*/
function cmKeyToVimKey(key, modifier) {
var vimKey = key;
if (isUpperCase(vimKey) && modifier == 'Ctrl') {
vimKey = vimKey.toLowerCase();
}
if (modifier) {
// Vim will parse modifier+key combination as a single key.
vimKey = modifier.charAt(0) + '-' + vimKey;
}
var specialKey = ({Enter:'CR',Backspace:'BS',Delete:'Del'})[vimKey];
vimKey = specialKey ? specialKey : vimKey;
vimKey = vimKey.length > 1 ? '<'+ vimKey + '>' : vimKey;
return vimKey;
}
// Closure to bind CodeMirror, key, modifier.
function keyMapper(vimKey) {
return function(cm) {
CodeMirror.Vim.handleKey(cm, vimKey);
};
}
var cmToVimKeymap = {
'nofallthrough': true,
'style': 'fat-cursor'
};
function bindKeys(keys, modifier) {
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!modifier && key.length == 1) {
// Wrap all keys without modifiers with '' to identify them by their
// key characters instead of key identifiers.
key = "'" + key + "'";
}
var vimKey = cmKeyToVimKey(keys[i], modifier);
var cmKey = modifier ? modifier + '-' + key : key;
cmToVimKeymap[cmKey] = keyMapper(vimKey);
}
}
bindKeys(upperCaseAlphabet);
bindKeys(lowerCaseAlphabet);
bindKeys(upperCaseAlphabet, 'Ctrl');
bindKeys(specialSymbols);
bindKeys(specialSymbols, 'Ctrl');
bindKeys(numbers);
bindKeys(numbers, 'Ctrl');
bindKeys(specialKeys);
bindKeys(specialKeys, 'Ctrl');
return cmToVimKeymap;
}
CodeMirror.keyMap.vim = buildVimKeyMap();
function exitInsertMode(cm) {
var vim = cm.state.vim;
var macroModeState = vimGlobalState.macroModeState;
var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.');
var isPlaying = macroModeState.isPlaying;
if (!isPlaying) {
cm.off('change', onChange);
CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
}
if (!isPlaying && vim.insertModeRepeat > 1) {
// Perform insert mode repeat for commands like 3,a and 3,o.
repeatLastEdit(cm, vim, vim.insertModeRepeat - 1,
true /** repeatForInsert */);
vim.lastEditInputState.repeatOverride = vim.insertModeRepeat;
}
delete vim.insertModeRepeat;
vim.insertMode = false;
cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1);
cm.setOption('keyMap', 'vim');
cm.setOption('disableInput', true);
cm.toggleOverwrite(false); // exit replace mode if we were in it.
// update the ". register before exiting insert mode
insertModeChangeRegister.setText(macroModeState.lastInsertModeChanges.changes.join(''));
CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
if (macroModeState.isRecording) {
logInsertModeChange(macroModeState);
}
}
CodeMirror.keyMap['vim-insert'] = {
// TODO: override navigation keys so that Esc will cancel automatic
// indentation from o, O, i_<CR>
'Esc': exitInsertMode,
'Ctrl-[': exitInsertMode,
'Ctrl-C': exitInsertMode,
'Ctrl-N': 'autocomplete',
'Ctrl-P': 'autocomplete',
'Enter': function(cm) {
var fn = CodeMirror.commands.newlineAndIndentContinueComment ||
CodeMirror.commands.newlineAndIndent;
fn(cm);
},
fallthrough: ['default']
};
CodeMirror.keyMap['vim-replace'] = {
'Backspace': 'goCharLeft',
fallthrough: ['vim-insert']
};
function executeMacroRegister(cm, vim, macroModeState, registerName) {
var register = vimGlobalState.registerController.getRegister(registerName);
var keyBuffer = register.keyBuffer;
var imc = 0;
macroModeState.isPlaying = true;
macroModeState.replaySearchQueries = register.searchQueries.slice(0);
for (var i = 0; i < keyBuffer.length; i++) {
var text = keyBuffer[i];
var match, key;
while (text) {
// Pull off one command key, which is either a single character
// or a special sequence wrapped in '<' and '>', e.g. '<Space>'.
match = (/<\w+-.+?>|<\w+>|./).exec(text);
key = match[0];
text = text.substring(match.index + key.length);
CodeMirror.Vim.handleKey(cm, key);
if (vim.insertMode) {
repeatInsertModeChanges(
cm, register.insertModeChanges[imc++].changes, 1);
exitInsertMode(cm);
}
}
};
macroModeState.isPlaying = false;
}
function logKey(macroModeState, key) {
if (macroModeState.isPlaying) { return; }
var registerName = macroModeState.latestRegister;
var register = vimGlobalState.registerController.getRegister(registerName);
if (register) {
register.pushText(key);
}
}
function logInsertModeChange(macroModeState) {
if (macroModeState.isPlaying) { return; }
var registerName = macroModeState.latestRegister;
var register = vimGlobalState.registerController.getRegister(registerName);
if (register) {
register.pushInsertModeChanges(macroModeState.lastInsertModeChanges);
}
}
function logSearchQuery(macroModeState, query) {
if (macroModeState.isPlaying) { return; }
var registerName = macroModeState.latestRegister;
var register = vimGlobalState.registerController.getRegister(registerName);
if (register) {
register.pushSearchQuery(query);
}
}
/**
* Listens for changes made in insert mode.
* Should only be active in insert mode.
*/
function onChange(_cm, changeObj) {
var macroModeState = vimGlobalState.macroModeState;
var lastChange = macroModeState.lastInsertModeChanges;
if (!macroModeState.isPlaying) {
while(changeObj) {
lastChange.expectCursorActivityForChange = true;
if (changeObj.origin == '+input' || changeObj.origin == 'paste'
|| changeObj.origin === undefined /* only in testing */) {
var text = changeObj.text.join('\n');
lastChange.changes.push(text);
}
// Change objects may be chained with next.
changeObj = changeObj.next;
}
}
}
/**
* Listens for any kind of cursor activity on CodeMirror.
*/
function onCursorActivity(cm) {
var vim = cm.state.vim;
if (vim.insertMode) {
// Tracking cursor activity in insert mode (for macro support).
var macroModeState = vimGlobalState.macroModeState;
if (macroModeState.isPlaying) { return; }
var lastChange = macroModeState.lastInsertModeChanges;
if (lastChange.expectCursorActivityForChange) {
lastChange.expectCursorActivityForChange = false;
} else {
// Cursor moved outside the context of an edit. Reset the change.
lastChange.changes = [];
}
} else if (cm.doc.history.lastSelOrigin == '*mouse') {
// Reset lastHPos if mouse click was done in normal mode.
vim.lastHPos = cm.doc.getCursor().ch;
}
}
/** Wrapper for special keys pressed in insert mode */
function InsertModeKey(keyName) {
this.keyName = keyName;
}
/**
* Handles raw key down events from the text area.
* - Should only be active in insert mode.
* - For recording deletes in insert mode.
*/
function onKeyEventTargetKeyDown(e) {
var macroModeState = vimGlobalState.macroModeState;
var lastChange = macroModeState.lastInsertModeChanges;
var keyName = CodeMirror.keyName(e);
function onKeyFound() {
lastChange.changes.push(new InsertModeKey(keyName));
return true;
}
if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {
CodeMirror.lookupKey(keyName, ['vim-insert'], onKeyFound);
}
}
/**
* Repeats the last edit, which includes exactly 1 command and at most 1
* insert. Operator and motion commands are read from lastEditInputState,
* while action commands are read from lastEditActionCommand.
*
* If repeatForInsert is true, then the function was called by
* exitInsertMode to repeat the insert mode changes the user just made. The
* corresponding enterInsertMode call was made with a count.
*/
function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
var macroModeState = vimGlobalState.macroModeState;
macroModeState.isPlaying = true;
var isAction = !!vim.lastEditActionCommand;
var cachedInputState = vim.inputState;
function repeatCommand() {
if (isAction) {
commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand);
} else {
commandDispatcher.evalInput(cm, vim);
}
}
function repeatInsert(repeat) {
if (macroModeState.lastInsertModeChanges.changes.length > 0) {
// For some reason, repeat cw in desktop VIM does not repeat
// insert mode changes. Will conform to that behavior.
repeat = !vim.lastEditActionCommand ? 1 : repeat;
var changeObject = macroModeState.lastInsertModeChanges;
// This isn't strictly necessary, but since lastInsertModeChanges is
// supposed to be immutable during replay, this helps catch bugs.
macroModeState.lastInsertModeChanges = {};
repeatInsertModeChanges(cm, changeObject.changes, repeat);
macroModeState.lastInsertModeChanges = changeObject;
}
}
vim.inputState = vim.lastEditInputState;
if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) {
// o and O repeat have to be interlaced with insert repeats so that the
// insertions appear on separate lines instead of the last line.
for (var i = 0; i < repeat; i++) {
repeatCommand();
repeatInsert(1);
}
} else {
if (!repeatForInsert) {
// Hack to get the cursor to end up at the right place. If I is
// repeated in insert mode repeat, cursor will be 1 insert
// change set left of where it should be.
repeatCommand();
}
repeatInsert(repeat);
}
vim.inputState = cachedInputState;
if (vim.insertMode && !repeatForInsert) {
// Don't exit insert mode twice. If repeatForInsert is set, then we
// were called by an exitInsertMode call lower on the stack.
exitInsertMode(cm);
}
macroModeState.isPlaying = false;
};
function repeatInsertModeChanges(cm, changes, repeat) {
function keyHandler(binding) {
if (typeof binding == 'string') {
CodeMirror.commands[binding](cm);
} else {
binding(cm);
}
return true;
}
for (var i = 0; i < repeat; i++) {
for (var j = 0; j < changes.length; j++) {
var change = changes[j];
if (change instanceof InsertModeKey) {
CodeMirror.lookupKey(change.keyName, ['vim-insert'], keyHandler);
} else {
var cur = cm.getCursor();
cm.replaceRange(change, cur, cur);
}
}
}
}
resetVimGlobalState();
return vimApi;
};
// Initialize Vim and make it available as an API.
CodeMirror.Vim = Vim();
});
| pc035860/cdnjs | ajax/libs/codemirror/4.1.0/keymap/vim.js | JavaScript | mit | 159,270 |
.c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:gray;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-title{font:14px sans-serif}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #CCC}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#FFF}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max,.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000} | nareshs435/cdnjs | ajax/libs/c3/0.4.11-rc1/c3.min.css | CSS | mit | 2,043 |
YUI.add("base-build",function(f){var c=f.Base,a=f.Lang,b="initializer",d="destructor",e;c._build=function(B,p,z,s,t,o){var u=c._build,x=u._ctor(p,o),q=u._cfg(p,o),h=u._mixCust,m=q.aggregates,g=q.custom,k=x._yuibuild.dynamic,w,v,A,j,n,y,r;if(k&&m){for(w=0,v=m.length;w<v;++w){A=m[w];if(p.hasOwnProperty(A)){x[A]=a.isArray(p[A])?[]:{};}}}for(w=0,v=z.length;w<v;w++){j=z[w];n=j.prototype;y=n[b];r=n[d];delete n[b];delete n[d];f.mix(x,j,true,null,1);h(x,j,m,g);if(y){n[b]=y;}if(r){n[d]=r;}x._yuibuild.exts.push(j);}if(s){f.mix(x.prototype,s,true);}if(t){f.mix(x,u._clean(t,m,g),true);h(x,t,m,g);}x.prototype.hasImpl=u._impl;if(k){x.NAME=B;x.prototype.constructor=x;}return x;};e=c._build;f.mix(e,{_mixCust:function(i,h,l,k){if(l){f.aggregate(i,h,true,l);}if(k){for(var g in k){if(k.hasOwnProperty(g)){k[g](g,i,h);}}}},_tmpl:function(g){function h(){h.superclass.constructor.apply(this,arguments);}f.extend(h,g);return h;},_impl:function(m){var p=this._getClasses(),o,h,g,n,q,k;for(o=0,h=p.length;o<h;o++){g=p[o];if(g._yuibuild){n=g._yuibuild.exts;q=n.length;for(k=0;k<q;k++){if(n[k]===m){return true;}}}}return false;},_ctor:function(g,h){var j=(h&&false===h.dynamic)?false:true,k=(j)?e._tmpl(g):g,i=k._yuibuild;if(!i){i=k._yuibuild={};}i.id=i.id||null;i.exts=i.exts||[];i.dynamic=j;return k;},_cfg:function(g,h){var i=[],l={},k,j=(h&&h.aggregates),n=(h&&h.custom),m=g;while(m&&m.prototype){k=m._buildCfg;if(k){if(k.aggregates){i=i.concat(k.aggregates);}if(k.custom){f.mix(l,k.custom,true);}}m=m.superclass?m.superclass.constructor:null;}if(j){i=i.concat(j);}if(n){f.mix(l,h.cfgBuild,true);}return{aggregates:i,custom:l};},_clean:function(o,n,j){var m,h,g,k=f.merge(o);for(m in j){if(k.hasOwnProperty(m)){delete k[m];}}for(h=0,g=n.length;h<g;h++){m=n[h];if(k.hasOwnProperty(m)){delete k[m];}}return k;}});c.build=function(i,g,j,h){return e(i,g,j,null,null,h);};c.create=function(g,j,i,h,k){return e(g,j,i,h,k);};c.mix=function(g,h){return e(null,g,h,null,null,{dynamic:false});};c._buildCfg={custom:{ATTRS:function(l,j,h){j.ATTRS=j.ATTRS||{};if(h.ATTRS){var i=h.ATTRS,k=j.ATTRS,g;for(g in i){if(i.hasOwnProperty(g)){k[g]=k[g]||{};f.mix(k[g],i[g],true);}}}}},aggregates:["_PLUG","_UNPLUG"]};},"@VERSION@",{requires:["base-base"]}); | hanbyul-here/cdnjs | ajax/libs/yui/3.4.0pr3/base-build/base-build-min.js | JavaScript | mit | 2,226 |
YUI.add('view-node-map', function(Y) {
/**
View extension that adds a static `getByNode()` method that returns the nearest
View instance associated with the given Node (similar to Widget's `getByNode()`
method).
@module app
@submodule view-node-map
@since 3.5.0
**/
var buildCfg = Y.namespace('View._buildCfg'),
instances = {};
/**
View extension that adds a static `getByNode()` method that returns the nearest
View instance associated with the given Node (similar to Widget's `getByNode()`
method).
Note that it's important to call `destroy()` on a View instance using this
extension when you plan to stop using it. This ensures that all internal
references to that View are cleared to prevent memory leaks.
@class View.NodeMap
@extensionfor View
@since 3.5.0
**/
function NodeMap() {}
// Tells Base.create() to mix the static getByNode method into built classes.
// We're cheating and modifying Y.View here, because right now there's no better
// way to do it.
buildCfg.aggregates || (buildCfg.aggregates = []);
buildCfg.aggregates.push('getByNode');
/**
Returns the nearest View instance associated with the given Node. The Node may
be a View container or any child of a View container.
Note that only instances of Views that have the Y.View.NodeMap extension mixed
in will be returned. The base View class doesn't provide this functionality by
default due to the additional memory management overhead involved in maintaining
a mapping of Nodes to View instances.
@method getByNode
@param {Node|HTMLElement|String} node Node instance, selector string, or
HTMLElement.
@return {View} Closest View instance associated with the given Node, or `null`
if no associated View instance was found.
@static
@since 3.5.0
**/
NodeMap.getByNode = function (node) {
var view;
Y.one(node).ancestor(function (ancestor) {
return (view = instances[Y.stamp(ancestor, true)]) || false;
}, true);
return view || null;
};
// To make this testable.
NodeMap._instances = instances;
NodeMap.prototype = {
initializer: function () {
instances[Y.stamp(this.get('container'))] = this;
},
destructor: function () {
var stamp = Y.stamp(this.get('container'), true);
if (stamp in instances) {
delete instances[stamp];
}
}
};
Y.View.NodeMap = NodeMap;
}, '@VERSION@' ,{requires:['view']});
| humbletim/cdnjs | ajax/libs/yui/3.6.0/view-node-map/view-node-map-debug.js | JavaScript | mit | 2,378 |
'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": [
"a.m.",
"p.m."
],
"DAY": [
"Domingo",
"Lunes",
"Martes",
"Mi\u00e9rcoles",
"Jueves",
"Viernes",
"S\u00e1bado"
],
"MONTH": [
"Qulla puquy",
"Hatun puquy",
"Pauqar waray",
"Ayriwa",
"Aymuray",
"Inti raymi",
"Anta Sitwa",
"Qhapaq Sitwa",
"Uma raymi",
"Kantaray",
"Ayamarq\u02bca",
"Kapaq Raymi"
],
"SHORTDAY": [
"Dom",
"Lun",
"Mar",
"Mi\u00e9",
"Jue",
"Vie",
"Sab"
],
"SHORTMONTH": [
"Qul",
"Hat",
"Pau",
"Ayr",
"Aym",
"Int",
"Ant",
"Qha",
"Uma",
"Kan",
"Aya",
"Kap"
],
"fullDate": "EEEE, d MMMM, y",
"longDate": "y MMMM d",
"medium": "y MMM d hh:mm:ss a",
"mediumDate": "y MMM d",
"mediumTime": "hh:mm:ss a",
"short": "dd/MM/y hh:mm a",
"shortDate": "dd/MM/y",
"shortTime": "hh:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"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\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "qu-ec",
"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;}
});
}]);
| simudream/cdnjs | ajax/libs/angular.js/1.4.0-beta.0/i18n/angular-locale_qu-ec.js | JavaScript | mit | 2,358 |
'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": [
"a.m.",
"p.m."
],
"DAY": [
"Domingo",
"Lunes",
"Martes",
"Mi\u00e9rcoles",
"Jueves",
"Viernes",
"S\u00e1bado"
],
"MONTH": [
"Qulla puquy",
"Hatun puquy",
"Pauqar waray",
"Ayriwa",
"Aymuray",
"Inti raymi",
"Anta Sitwa",
"Qhapaq Sitwa",
"Uma raymi",
"Kantaray",
"Ayamarq\u02bca",
"Kapaq Raymi"
],
"SHORTDAY": [
"Dom",
"Lun",
"Mar",
"Mi\u00e9",
"Jue",
"Vie",
"Sab"
],
"SHORTMONTH": [
"Qul",
"Hat",
"Pau",
"Ayr",
"Aym",
"Int",
"Ant",
"Qha",
"Uma",
"Kan",
"Aya",
"Kap"
],
"fullDate": "EEEE, d MMMM, y",
"longDate": "y MMMM d",
"medium": "y MMM d hh:mm:ss a",
"mediumDate": "y MMM d",
"mediumTime": "hh:mm:ss a",
"short": "dd/MM/y hh:mm a",
"shortDate": "dd/MM/y",
"shortTime": "hh:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "Bs",
"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\u00a0-",
"negSuf": "",
"posPre": "\u00a4\u00a0",
"posSuf": ""
}
]
},
"id": "qu-bo",
"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;}
});
}]);
| sufuf3/cdnjs | ajax/libs/angular.js/1.3.9/i18n/angular-locale_qu-bo.js | JavaScript | mit | 2,359 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.resource}.
"""
from twisted.trial.unittest import TestCase
from twisted.web.error import UnsupportedMethod
from twisted.web.resource import (
NOT_FOUND, FORBIDDEN, Resource, ErrorPage, NoResource, ForbiddenResource,
getChildForRequest)
from twisted.web.test.requesthelper import DummyRequest
class ErrorPageTests(TestCase):
"""
Tests for L{ErrorPage}, L{NoResource}, and L{ForbiddenResource}.
"""
errorPage = ErrorPage
noResource = NoResource
forbiddenResource = ForbiddenResource
def test_getChild(self):
"""
The C{getChild} method of L{ErrorPage} returns the L{ErrorPage} it is
called on.
"""
page = self.errorPage(321, "foo", "bar")
self.assertIdentical(page.getChild(b"name", object()), page)
def _pageRenderingTest(self, page, code, brief, detail):
request = DummyRequest([b''])
template = (
u"\n"
u"<html>\n"
u" <head><title>%s - %s</title></head>\n"
u" <body>\n"
u" <h1>%s</h1>\n"
u" <p>%s</p>\n"
u" </body>\n"
u"</html>\n")
expected = template % (code, brief, brief, detail)
self.assertEqual(
page.render(request), expected.encode('utf-8'))
self.assertEqual(request.responseCode, code)
self.assertEqual(
request.outgoingHeaders,
{b'content-type': b'text/html; charset=utf-8'})
def test_errorPageRendering(self):
"""
L{ErrorPage.render} returns a C{bytes} describing the error defined by
the response code and message passed to L{ErrorPage.__init__}. It also
uses that response code to set the response code on the L{Request}
passed in.
"""
code = 321
brief = "brief description text"
detail = "much longer text might go here"
page = self.errorPage(code, brief, detail)
self._pageRenderingTest(page, code, brief, detail)
def test_noResourceRendering(self):
"""
L{NoResource} sets the HTTP I{NOT FOUND} code.
"""
detail = "long message"
page = self.noResource(detail)
self._pageRenderingTest(page, NOT_FOUND, "No Such Resource", detail)
def test_forbiddenResourceRendering(self):
"""
L{ForbiddenResource} sets the HTTP I{FORBIDDEN} code.
"""
detail = "longer message"
page = self.forbiddenResource(detail)
self._pageRenderingTest(page, FORBIDDEN, "Forbidden Resource", detail)
class DynamicChild(Resource):
"""
A L{Resource} to be created on the fly by L{DynamicChildren}.
"""
def __init__(self, path, request):
Resource.__init__(self)
self.path = path
self.request = request
class DynamicChildren(Resource):
"""
A L{Resource} with dynamic children.
"""
def getChild(self, path, request):
return DynamicChild(path, request)
class BytesReturnedRenderable(Resource):
"""
A L{Resource} with minimal capabilities to render a response.
"""
def __init__(self, response):
"""
@param response: A C{bytes} object giving the value to return from
C{render_GET}.
"""
Resource.__init__(self)
self._response = response
def render_GET(self, request):
"""
Render a response to a I{GET} request by returning a short byte string
to be written by the server.
"""
return self._response
class ImplicitAllowedMethods(Resource):
"""
A L{Resource} which implicitly defines its allowed methods by defining
renderers to handle them.
"""
def render_GET(self, request):
pass
def render_PUT(self, request):
pass
class ResourceTests(TestCase):
"""
Tests for L{Resource}.
"""
def test_staticChildren(self):
"""
L{Resource.putChild} adds a I{static} child to the resource. That child
is returned from any call to L{Resource.getChildWithDefault} for the
child's path.
"""
resource = Resource()
child = Resource()
sibling = Resource()
resource.putChild(b"foo", child)
resource.putChild(b"bar", sibling)
self.assertIdentical(
child, resource.getChildWithDefault(b"foo", DummyRequest([])))
def test_dynamicChildren(self):
"""
L{Resource.getChildWithDefault} delegates to L{Resource.getChild} when
the requested path is not associated with any static child.
"""
path = b"foo"
request = DummyRequest([])
resource = DynamicChildren()
child = resource.getChildWithDefault(path, request)
self.assertIsInstance(child, DynamicChild)
self.assertEqual(child.path, path)
self.assertIdentical(child.request, request)
def test_defaultHEAD(self):
"""
When not otherwise overridden, L{Resource.render} treats a I{HEAD}
request as if it were a I{GET} request.
"""
expected = b"insert response here"
request = DummyRequest([])
request.method = b'HEAD'
resource = BytesReturnedRenderable(expected)
self.assertEqual(expected, resource.render(request))
def test_explicitAllowedMethods(self):
"""
The L{UnsupportedMethod} raised by L{Resource.render} for an unsupported
request method has a C{allowedMethods} attribute set to the value of the
C{allowedMethods} attribute of the L{Resource}, if it has one.
"""
expected = [b'GET', b'HEAD', b'PUT']
resource = Resource()
resource.allowedMethods = expected
request = DummyRequest([])
request.method = b'FICTIONAL'
exc = self.assertRaises(UnsupportedMethod, resource.render, request)
self.assertEqual(set(expected), set(exc.allowedMethods))
def test_implicitAllowedMethods(self):
"""
The L{UnsupportedMethod} raised by L{Resource.render} for an unsupported
request method has a C{allowedMethods} attribute set to a list of the
methods supported by the L{Resource}, as determined by the
I{render_}-prefixed methods which it defines, if C{allowedMethods} is
not explicitly defined by the L{Resource}.
"""
expected = set([b'GET', b'HEAD', b'PUT'])
resource = ImplicitAllowedMethods()
request = DummyRequest([])
request.method = b'FICTIONAL'
exc = self.assertRaises(UnsupportedMethod, resource.render, request)
self.assertEqual(expected, set(exc.allowedMethods))
class GetChildForRequestTests(TestCase):
"""
Tests for L{getChildForRequest}.
"""
def test_exhaustedPostPath(self):
"""
L{getChildForRequest} returns whatever resource has been reached by the
time the request's C{postpath} is empty.
"""
request = DummyRequest([])
resource = Resource()
result = getChildForRequest(resource, request)
self.assertIdentical(resource, result)
def test_leafResource(self):
"""
L{getChildForRequest} returns the first resource it encounters with a
C{isLeaf} attribute set to C{True}.
"""
request = DummyRequest([b"foo", b"bar"])
resource = Resource()
resource.isLeaf = True
result = getChildForRequest(resource, request)
self.assertIdentical(resource, result)
def test_postPathToPrePath(self):
"""
As path segments from the request are traversed, they are taken from
C{postpath} and put into C{prepath}.
"""
request = DummyRequest([b"foo", b"bar"])
root = Resource()
child = Resource()
child.isLeaf = True
root.putChild(b"foo", child)
self.assertIdentical(child, getChildForRequest(root, request))
self.assertEqual(request.prepath, [b"foo"])
self.assertEqual(request.postpath, [b"bar"])
| nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/web/test/test_resource.py | Python | mit | 8,158 |
<?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\Event;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
/**
* Allows to create a response for the return value of a controller.
*
* Call setResponse() to set the response that will be returned for the
* current request. The propagation of this event is stopped as soon as a
* response is set.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
final class ViewEvent extends RequestEvent
{
/**
* The return value of the controller.
*
* @var mixed
*/
private $controllerResult;
public function __construct(HttpKernelInterface $kernel, Request $request, int $requestType, $controllerResult)
{
parent::__construct($kernel, $request, $requestType);
$this->controllerResult = $controllerResult;
}
/**
* Returns the return value of the controller.
*
* @return mixed The controller return value
*/
public function getControllerResult()
{
return $this->controllerResult;
}
/**
* Assigns the return value of the controller.
*
* @param mixed $controllerResult The controller return value
*/
public function setControllerResult($controllerResult): void
{
$this->controllerResult = $controllerResult;
}
}
| maidmaid/symfony | src/Symfony/Component/HttpKernel/Event/ViewEvent.php | PHP | mit | 1,582 |
/**
* Module dependencies.
*/
//var http = require('http')
// , req = http.IncomingMessage.prototype;
var req = exports = module.exports = {};
/**
* Initiate a login session for `user`.
*
* Options:
* - `session` Save login state in session, defaults to _true_
*
* Examples:
*
* req.logIn(user, { session: false });
*
* req.logIn(user, function(err) {
* if (err) { throw err; }
* // session saved
* });
*
* @param {User} user
* @param {Object} options
* @param {Function} done
* @api public
*/
req.login =
req.logIn = function(user, options, done) {
if (typeof options == 'function') {
done = options;
options = {};
}
options = options || {};
var property = 'user';
if (this._passport && this._passport.instance) {
property = this._passport.instance._userProperty || 'user';
}
var session = (options.session === undefined) ? true : options.session;
this[property] = user;
if (session) {
if (!this._passport) { throw new Error('passport.initialize() middleware not in use'); }
if (typeof done != 'function') { throw new Error('req#login requires a callback function'); }
var self = this;
this._passport.instance._sm.logIn(this, user, function(err) {
if (err) { self[property] = null; return done(err); }
done();
});
} else {
done && done();
}
};
/**
* Terminate an existing login session.
*
* @api public
*/
req.logout =
req.logOut = function() {
var property = 'user';
if (this._passport && this._passport.instance) {
property = this._passport.instance._userProperty || 'user';
}
this[property] = null;
if (this._passport) {
this._passport.instance._sm.logOut(this);
}
};
/**
* Test if request is authenticated.
*
* @return {Boolean}
* @api public
*/
req.isAuthenticated = function() {
var property = 'user';
if (this._passport && this._passport.instance) {
property = this._passport.instance._userProperty || 'user';
}
return (this[property]) ? true : false;
};
/**
* Test if request is unauthenticated.
*
* @return {Boolean}
* @api public
*/
req.isUnauthenticated = function() {
return !this.isAuthenticated();
};
| EdwardStudy/myghostblog | versions/1.25.7/node_modules/passport/lib/http/request.js | JavaScript | mit | 2,206 |
/*
* JavaScript Templates Test
* https://github.com/blueimp/JavaScript-Templates
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*global beforeEach, afterEach, describe, it, require */
;(function (context, expect, tmpl) {
'use strict'
if (context.require === undefined) {
// Override the template loading method:
tmpl.load = function (id) {
switch (id) {
case 'template':
return '{%=o.value%}'
}
}
}
var data
beforeEach(function () {
// Initialize the sample data:
data = {
value: 'value',
nullValue: null,
falseValue: false,
zeroValue: 0,
special: '<>&"\'\x00',
list: [1, 2, 3, 4, 5],
func: function () {
return this.value
},
deep: {
value: 'value'
}
}
})
afterEach(function () {
// Purge the template cache:
tmpl.cache = {}
})
describe('Template loading', function () {
it('String template', function () {
expect(
tmpl('{%=o.value%}', data)
).to.be(
'value'
)
})
it('Load template by id', function () {
expect(
tmpl('template', data)
).to.be(
'value'
)
})
it('Retun function when called without data parameter', function () {
expect(
tmpl('{%=o.value%}')(data)
).to.be(
'value'
)
})
it('Cache templates loaded by id', function () {
tmpl('template')
expect(
tmpl.cache.template
).to.be.a('function')
})
})
describe('Interpolation', function () {
it('Escape HTML special characters with {%=o.prop%}', function () {
expect(
tmpl('{%=o.special%}', data)
).to.be(
'<>&"''
)
})
it('Allow HTML special characters with {%#o.prop%}', function () {
expect(
tmpl('{%#o.special%}', data)
).to.be(
'<>&"\'\x00'
)
})
it('Function call', function () {
expect(
tmpl('{%=o.func()%}', data)
).to.be(
'value'
)
})
it('Dot notation', function () {
expect(
tmpl('{%=o.deep.value%}', data)
).to.be(
'value'
)
})
it('Handle single quotes', function () {
expect(
tmpl('\'single quotes\'{%=": \'"%}', data)
).to.be(
"'single quotes': '"
)
})
it('Handle double quotes', function () {
expect(
tmpl('"double quotes"{%=": \\""%}', data)
).to.be(
'"double quotes": "'
)
})
it('Handle backslashes', function () {
expect(
tmpl('\\backslashes\\{%=": \\\\"%}', data)
).to.be(
'\\backslashes\\: \\'
)
})
it('Interpolate escaped falsy values except undefined or null', function () {
expect(
tmpl(
'{%=o.undefinedValue%}' +
'{%=o.nullValue%}' +
'{%=o.falseValue%}' +
'{%=o.zeroValue%}',
data
)
).to.be(
'false0'
)
})
it('Interpolate unescaped falsy values except undefined or null', function () {
expect(
tmpl(
'{%#o.undefinedValue%}' +
'{%#o.nullValue%}' +
'{%#o.falseValue%}' +
'{%#o.zeroValue%}',
data
)
).to.be(
'false0'
)
})
it('Preserve whitespace', function () {
expect(
tmpl(
'\n\r\t{%=o.value%} \n\r\t{%=o.value%} ',
data
)
).to.be(
'\n\r\tvalue \n\r\tvalue '
)
})
})
describe('Evaluation', function () {
it('Escape HTML special characters with print(data)', function () {
expect(
tmpl('{% print(o.special); %}', data)
).to.be(
'<>&"''
)
})
it('Allow HTML special characters with print(data, true)', function () {
expect(
tmpl('{% print(o.special, true); %}', data)
).to.be(
'<>&"\'\x00'
)
})
it('Print out escaped falsy values except undefined or null', function () {
expect(
tmpl(
'{% print(o.undefinedValue); %}' +
'{% print(o.nullValue); %}' +
'{% print(o.falseValue); %}' +
'{% print(o.zeroValue); %}',
data
)
).to.be(
'false0'
)
})
it('Print out unescaped falsy values except undefined or null', function () {
expect(
tmpl(
'{% print(o.undefinedValue, true); %}' +
'{% print(o.nullValue, true); %}' +
'{% print(o.falseValue, true); %}' +
'{% print(o.zeroValue, true); %}',
data
)
).to.be(
'false0'
)
})
it('Include template', function () {
expect(
tmpl('{% include("template", {value: "value"}); %}', data)
).to.be(
'value'
)
})
it('If condition', function () {
expect(
tmpl('{% if (o.value) { %}true{% } else { %}false{% } %}', data)
).to.be(
'true'
)
})
it('Else condition', function () {
expect(
tmpl(
'{% if (o.undefinedValue) { %}false{% } else { %}true{% } %}',
data
)
).to.be(
'true'
)
})
it('For loop', function () {
expect(
tmpl(
'{% for (var i=0; i<o.list.length; i++) { %}' +
'{%=o.list[i]%}{% } %}',
data
)
).to.be(
'12345'
)
})
it('For loop print call', function () {
expect(
tmpl(
'{% for (var i=0; i<o.list.length; i++) {' +
'print(o.list[i]);} %}',
data
)
).to.be(
'12345'
)
})
it('For loop include template', function () {
expect(
tmpl(
'{% for (var i=0; i<o.list.length; i++) {' +
'include("template", {value: o.list[i]});} %}',
data
).replace(/[\r\n]/g, '')
).to.be(
'12345'
)
})
it('Modulo operator', function () {
expect(
tmpl(
'{% if (o.list.length % 5 === 0) { %}5 list items{% } %}',
data
).replace(/[\r\n]/g, '')
).to.be(
'5 list items'
)
})
})
}(
this,
this.expect || require('expect.js'),
this.tmpl || require('../js/tmpl')
))
| dflm25/codeigniteres.club | public/plugins/ckeditor/plugins/RichFilemanager-master/scripts/javascript-templates/test/test.js | JavaScript | mit | 6,461 |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - Test Markdown</title>
<link rel="stylesheet" href="../css/reveal.css">
<link rel="stylesheet" href="qunit-2.5.0.css">
</head>
<body style="overflow: auto;">
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<div class="reveal" style="display: none;">
<div class="slides">
<!-- <section data-markdown="example.md" data-separator="^\n\n\n" data-separator-vertical="^\n\n"></section> -->
<!-- Slides are separated by newline + three dashes + newline, vertical slides identical but two dashes -->
<section data-markdown data-separator="^\n---\n$" data-separator-vertical="^\n--\n$">
<script type="text/template">
## Slide 1.1
--
## Slide 1.2
---
## Slide 2
</script>
</section>
</div>
</div>
<script src="../js/reveal.js"></script>
<script src="../plugin/markdown/marked.js"></script>
<script src="../plugin/markdown/markdown.js"></script>
<script src="qunit-2.5.0.js"></script>
<script src="test-markdown.js"></script>
</body>
</html>
| agross/git-reveal | test/test-markdown.html | HTML | mit | 1,128 |
/*!
* Ladda 0.9.2 (2014-03-11, 08:41)
* http://lab.hakim.se/ladda
* MIT licensed
*
* Copyright (C) 2013 Hakim El Hattab, http://hakim.se
*/
(function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(["spin"],e):t.Ladda=e(t.Spinner)})(this,function(t){"use strict";function e(t){if(t===void 0)return console.warn("Ladda button target must be defined."),void 0;t.querySelector(".ladda-label")||(t.innerHTML='<span class="ladda-label">'+t.innerHTML+"</span>");var e,n=document.createElement("span");n.className="ladda-spinner",t.appendChild(n);var r,a={start:function(){return e||(e=o(t)),t.setAttribute("disabled",""),t.setAttribute("data-loading",""),clearTimeout(r),e.spin(n),this.setProgress(0),this},startAfter:function(t){return clearTimeout(r),r=setTimeout(function(){a.start()},t),this},stop:function(){return t.removeAttribute("disabled"),t.removeAttribute("data-loading"),clearTimeout(r),e&&(r=setTimeout(function(){e.stop()},1e3)),this},toggle:function(){return this.isLoading()?this.stop():this.start(),this},setProgress:function(e){e=Math.max(Math.min(e,1),0);var n=t.querySelector(".ladda-progress");0===e&&n&&n.parentNode?n.parentNode.removeChild(n):(n||(n=document.createElement("div"),n.className="ladda-progress",t.appendChild(n)),n.style.width=(e||0)*t.offsetWidth+"px")},enable:function(){return this.stop(),this},disable:function(){return this.stop(),t.setAttribute("disabled",""),this},isLoading:function(){return t.hasAttribute("data-loading")}};return u.push(a),a}function n(t,e){for(;t.parentNode&&t.tagName!==e;)t=t.parentNode;return e===t.tagName?t:void 0}function r(t){for(var e=["input","textarea"],n=[],r=0;e.length>r;r++)for(var a=t.getElementsByTagName(e[r]),i=0;a.length>i;i++)a[i].hasAttribute("required")&&n.push(a[i]);return n}function a(t,a){a=a||{};var i=[];"string"==typeof t?i=s(document.querySelectorAll(t)):"object"==typeof t&&"string"==typeof t.nodeName&&(i=[t]);for(var o=0,u=i.length;u>o;o++)(function(){var t=i[o];if("function"==typeof t.addEventListener){var s=e(t),u=-1;t.addEventListener("click",function(){var e=!0,i=n(t,"FORM");if(i!==void 0)for(var o=r(i),d=0;o.length>d;d++)""===o[d].value.replace(/^\s+|\s+$/g,"")&&(e=!1);e&&(s.startAfter(1),"number"==typeof a.timeout&&(clearTimeout(u),u=setTimeout(s.stop,a.timeout)),"function"==typeof a.callback&&a.callback.apply(null,[s]))},!1)}})()}function i(){for(var t=0,e=u.length;e>t;t++)u[t].stop()}function o(e){var n,r=e.offsetHeight;0===r&&(r=parseFloat(window.getComputedStyle(e).height)),r>32&&(r*=.8),e.hasAttribute("data-spinner-size")&&(r=parseInt(e.getAttribute("data-spinner-size"),10)),e.hasAttribute("data-spinner-color")&&(n=e.getAttribute("data-spinner-color"));var a=12,i=.2*r,o=.6*i,s=7>i?2:3;return new t({color:n||"#fff",lines:a,radius:i,length:o,width:s,zIndex:"auto",top:"auto",left:"auto",className:""})}function s(t){for(var e=[],n=0;t.length>n;n++)e.push(t[n]);return e}var u=[];return{bind:a,create:e,stopAll:i}}); | ekkymelynda/devguide | LTR/starters/assets/js/plugins/buttons/ladda.min.js | JavaScript | mit | 2,985 |
var isObject = require('./isObject'),
now = require('./now'),
toNumber = require('./toNumber');
/** Used as the `TypeError` message for "Functions" methods. */
var FUNC_ERROR_TEXT = 'Expected a function';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
nativeMin = Math.min;
/**
* Creates a debounced function that delays invoking `func` until after `wait`
* milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide an options object to indicate whether `func` should be invoked on
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent calls
* to the debounced function return the result of the last `func` invocation.
*
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
* on the trailing edge of the timeout only if the debounced function is
* invoked more than once during the `wait` timeout.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Function
* @param {Function} func The function to debounce.
* @param {number} [wait=0] The number of milliseconds to delay.
* @param {Object} [options={}] The options object.
* @param {boolean} [options.leading=false]
* Specify invoking on the leading edge of the timeout.
* @param {number} [options.maxWait]
* The maximum time `func` is allowed to be delayed before it's invoked.
* @param {boolean} [options.trailing=true]
* Specify invoking on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function.
* @example
*
* // Avoid costly calculations while the window size is in flux.
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
*
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
* jQuery(element).on('click', _.debounce(sendMail, 300, {
* 'leading': true,
* 'trailing': false
* }));
*
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
* var source = new EventSource('/stream');
* jQuery(source).on('message', debounced);
*
* // Cancel the trailing debounced invocation.
* jQuery(window).on('popstate', debounced.cancel);
*/
function debounce(func, wait, options) {
var lastArgs,
lastThis,
maxWait,
result,
timerId,
lastCallTime,
lastInvokeTime = 0,
leading = false,
maxing = false,
trailing = true;
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
wait = toNumber(wait) || 0;
if (isObject(options)) {
leading = !!options.leading;
maxing = 'maxWait' in options;
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
trailing = 'trailing' in options ? !!options.trailing : trailing;
}
function invokeFunc(time) {
var args = lastArgs,
thisArg = lastThis;
lastArgs = lastThis = undefined;
lastInvokeTime = time;
result = func.apply(thisArg, args);
return result;
}
function leadingEdge(time) {
// Reset any `maxWait` timer.
lastInvokeTime = time;
// Start the timer for the trailing edge.
timerId = setTimeout(timerExpired, wait);
// Invoke the leading edge.
return leading ? invokeFunc(time) : result;
}
function remainingWait(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime,
result = wait - timeSinceLastCall;
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
}
function shouldInvoke(time) {
var timeSinceLastCall = time - lastCallTime,
timeSinceLastInvoke = time - lastInvokeTime;
// Either this is the first call, activity has stopped and we're at the
// trailing edge, the system time has gone backwards and we're treating
// it as the trailing edge, or we've hit the `maxWait` limit.
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
}
function timerExpired() {
var time = now();
if (shouldInvoke(time)) {
return trailingEdge(time);
}
// Restart the timer.
timerId = setTimeout(timerExpired, remainingWait(time));
}
function trailingEdge(time) {
timerId = undefined;
// Only invoke if we have `lastArgs` which means `func` has been
// debounced at least once.
if (trailing && lastArgs) {
return invokeFunc(time);
}
lastArgs = lastThis = undefined;
return result;
}
function cancel() {
if (timerId !== undefined) {
clearTimeout(timerId);
}
lastInvokeTime = 0;
lastArgs = lastCallTime = lastThis = timerId = undefined;
}
function flush() {
return timerId === undefined ? result : trailingEdge(now());
}
function debounced() {
var time = now(),
isInvoking = shouldInvoke(time);
lastArgs = arguments;
lastThis = this;
lastCallTime = time;
if (isInvoking) {
if (timerId === undefined) {
return leadingEdge(lastCallTime);
}
if (maxing) {
// Handle invocations in a tight loop.
timerId = setTimeout(timerExpired, wait);
return invokeFunc(lastCallTime);
}
}
if (timerId === undefined) {
timerId = setTimeout(timerExpired, wait);
}
return result;
}
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
}
module.exports = debounce;
| 9min/kanban_app | node_modules/babel-preset-es2015/node_modules/babel-plugin-transform-es2015-classes/node_modules/babel-traverse/node_modules/lodash/debounce.js | JavaScript | mit | 5,926 |
ace.define("ace/mode/sh_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=t.reservedKeywords="!|{|}|case|do|done|elif|else|esac|fi|for|if|in|then|until|while|&|;|export|local|read|typeset|unset|elif|select|set",o=t.languageConstructs="[|]|alias|bg|bind|break|builtin|cd|command|compgen|complete|continue|dirs|disown|echo|enable|eval|exec|exit|fc|fg|getopts|hash|help|history|jobs|kill|let|logout|popd|printf|pushd|pwd|return|set|shift|shopt|source|suspend|test|times|trap|type|ulimit|umask|unalias|wait",u=function(){var e=this.createKeywordMapper({keyword:s,"support.function.builtin":o,"invalid.deprecated":"debugger"},"identifier"),t="(?:(?:[1-9]\\d*)|(?:0))",n="(?:\\.\\d+)",r="(?:\\d+)",i="(?:(?:"+r+"?"+n+")|(?:"+r+"\\.))",u="(?:(?:"+i+"|"+r+")"+")",a="(?:"+u+"|"+i+")",f="(?:&"+r+")",l="[a-zA-Z_][a-zA-Z0-9_]*",c="(?:(?:\\$"+l+")|(?:"+l+"=))",h="(?:\\$(?:SHLVL|\\$|\\!|\\?))",p="(?:"+l+"\\s*\\(\\))";this.$rules={start:[{token:"constant",regex:/\\./},{token:["text","comment"],regex:/(^|\s)(#.*)$/},{token:"string",regex:'"',push:[{token:"constant.language.escape",regex:/\\(?:[$abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/},{token:"constant",regex:/\$\w+/},{token:"string",regex:'"',next:"pop"},{defaultToken:"string"}]},{token:"variable.language",regex:h},{token:"variable",regex:c},{token:"support.function",regex:p},{token:"support.function",regex:f},{token:"string",start:"'",end:"'"},{token:"constant.numeric",regex:a},{token:"constant.numeric",regex:t+"\\b"},{token:e,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator",regex:"\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!="},{token:"paren.lparen",regex:"[\\[\\(\\{]"},{token:"paren.rparen",regex:"[\\]\\)\\}]"}]},this.normalizeRules()};r.inherits(u,i),t.ShHighlightRules=u}),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n,r){var i=e.getLine(n),s=i.match(this.foldingStartMarker);if(s){var o=s.index;if(s[1])return this.openingBracketBlock(e,s[1],n,o);var u=e.getCommentFoldRange(n,o+s[0].length,1);return u&&!u.isMultiLine()&&(r?u=this.getSectionRange(e,n):t!="all"&&(u=null)),u}if(t==="markbegin")return;var s=i.match(this.foldingStopMarker);if(s){var o=s.index+s[0].length;return s[1]?this.closingBracketBlock(e,s[1],n,o):e.getCommentFoldRange(n,o,-1)}},this.getSectionRange=function(e,t){var n=e.getLine(t),r=n.search(/\S/),s=t,o=n.length;t+=1;var u=t,a=e.getLength();while(++t<a){n=e.getLine(t);var f=n.search(/\S/);if(f===-1)continue;if(r>f)break;var l=this.getFoldWidgetRange(e,"all",t);if(l){if(l.start.row<=s)break;if(l.isMultiLine())t=l.end.row;else if(r==f)break}u=t}return new i(s,o,u,e.getLine(u).length)}}.call(o.prototype)}),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){"use strict";var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f,l={},c=function(e){var t=-1;e.multiSelect&&(t=e.selection.id,l.rangeCount!=e.multiSelect.rangeCount&&(l={rangeCount:e.multiSelect.rangeCount}));if(l[t])return f=l[t];f=l[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},h=function(){this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){c(n);var a=n.getSelectionRange(),l=r.doc.getTextRange(a);if(l!==""&&l!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+l+"}",selection:!1};if(h.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])||n.inMultiSelectMode?(h.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(h.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){c(n);var p=u.substring(s.column,s.column+1);if(p=="}"){var d=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(d!==null&&h.isAutoInsertedClosing(s,u,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else{if(i=="\n"||i=="\r\n"){c(n);var v="";h.isMaybeInsertedClosing(s,u)&&(v=o.stringRepeat("}",f.maybeInsertedBrackets),h.clearMaybeInsertedClosing());var p=u.substring(s.column,s.column+1);if(p==="}"){var m=r.findMatchingBracket({row:s.row,column:s.column+1},"}");if(!m)return null;var g=this.$getIndent(r.getLine(m.row))}else{if(!v){h.clearMaybeInsertedClosing();return}var g=this.$getIndent(u)}var y=g+r.getTabString();return{text:"\n"+y+"\n"+g+v,selection:[1,y.length,1,y.length]}}h.clearMaybeInsertedClosing()}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;f.maybeInsertedBrackets--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){c(n);var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(h.isSaneInsertion(n,r))return h.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){c(n);var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&h.isAutoInsertedClosing(u,a,i))return h.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){c(n);var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var p=r.getTokens(o.start.row),d=0,v,m=-1;for(var g=0;g<p.length;g++){v=p[g],v.type=="string"?m=-1:m<0&&(m=v.value.indexOf(s));if(v.value.length+d>o.start.column)break;d+=p[g].value.length}if(!v||m<0&&v.type!=="comment"&&(v.type!=="string"||o.start.column!==v.value.length+d-1&&v.value.lastIndexOf(s)===v.value.length-1)){if(!h.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(v&&v.type==="string"){var y=f.substring(a.column,a.column+1);if(y==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){c(n);var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};h.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},h.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},h.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,f.autoInsertedLineEnd[0])||(f.autoInsertedBrackets=0),f.autoInsertedRow=r.row,f.autoInsertedLineEnd=n+i.substr(r.column),f.autoInsertedBrackets++},h.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(f.maybeInsertedBrackets=0),f.maybeInsertedRow=r.row,f.maybeInsertedLineStart=i.substr(0,r.column)+n,f.maybeInsertedLineEnd=i.substr(r.column),f.maybeInsertedBrackets++},h.isAutoInsertedClosing=function(e,t,n){return f.autoInsertedBrackets>0&&e.row===f.autoInsertedRow&&n===f.autoInsertedLineEnd[0]&&t.substr(e.column)===f.autoInsertedLineEnd},h.isMaybeInsertedClosing=function(e,t){return f.maybeInsertedBrackets>0&&e.row===f.maybeInsertedRow&&t.substr(e.column)===f.maybeInsertedLineEnd&&t.substr(0,e.column)==f.maybeInsertedLineStart},h.popAutoInsertedClosing=function(){f.autoInsertedLineEnd=f.autoInsertedLineEnd.substr(1),f.autoInsertedBrackets--},h.clearMaybeInsertedClosing=function(){f&&(f.maybeInsertedBrackets=0,f.maybeInsertedRow=-1)},r.inherits(h,i),t.CstyleBehaviour=h}),ace.define("ace/mode/sh",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"],function(e,t,n){"use strict";var r=e("../lib/oop"),i=e("./text").Mode,s=e("./sh_highlight_rules").ShHighlightRules,o=e("../range").Range,u=e("./folding/cstyle").FoldMode,a=e("./behaviour/cstyle").CstyleBehaviour,f=function(){this.HighlightRules=s,this.foldingRules=new u,this.$behaviour=new a};r.inherits(f,i),function(){this.lineCommentStart="#",this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.getTokenizer().getLineTokens(t,e),s=i.tokens;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"){var o=t.match(/^.*[\{\(\[\:]\s*$/);o&&(r+=n)}return r};var e={pass:1,"return":1,raise:1,"break":1,"continue":1};this.checkOutdent=function(t,n,r){if(r!=="\r\n"&&r!=="\r"&&r!=="\n")return!1;var i=this.getTokenizer().getLineTokens(n.trim(),t).tokens;if(!i)return!1;do var s=i.pop();while(s&&(s.type=="comment"||s.type=="text"&&s.value.match(/^\s+$/)));return s?s.type=="keyword"&&e[s.value]:!1},this.autoOutdent=function(e,t,n){n+=1;var r=this.$getIndent(t.getLine(n)),i=t.getTabString();r.slice(-i.length)==i&&t.remove(new o(n,r.length-i.length,n,r.length))},this.$id="ace/mode/sh"}.call(f.prototype),t.Mode=f}) | tunnckoCore/jsdelivr | files/ace/1.1.4/noconflict/mode-sh.js | JavaScript | mit | 11,177 |
/*
* Performs a exclusive map waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @param {Function} selector Selector to invoke for every item in the current subscription.
* @param {Any} [thisArg] An optional context to invoke with the selector parameter.
* @returns {Observable} An exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusiveMap = function (selector, thisArg) {
var sources = this,
selectorFunc = bindCallback(selector, thisArg, 3);
return new AnonymousObservable(function (observer) {
var index = 0,
hasCurrent = false,
isStopped = true,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) {
var result;
try {
result = selectorFunc(x, index++, innerSource);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
},
function (e) { observer.onError(e); },
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
function (e) { observer.onError(e); },
function () {
isStopped = true;
if (g.length === 1 && !hasCurrent) {
observer.onCompleted();
}
}));
return g;
}, this);
};
| mobilifyclub/marvel | node_modules/bower/node_modules/inquirer/node_modules/rx/src/core/linq/observable/exclusivemap.js | JavaScript | mit | 2,135 |
/*! jQuery UI - v1.10.4 - 2014-01-17
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.effect.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.effect-blind.js, jquery.ui.effect-bounce.js, jquery.ui.effect-clip.js, jquery.ui.effect-drop.js, jquery.ui.effect-explode.js, jquery.ui.effect-fade.js, jquery.ui.effect-fold.js, jquery.ui.effect-highlight.js, jquery.ui.effect-pulsate.js, jquery.ui.effect-scale.js, jquery.ui.effect-shake.js, jquery.ui.effect-slide.js, jquery.ui.effect-transfer.js, jquery.ui.menu.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.spinner.js, jquery.ui.tabs.js, jquery.ui.tooltip.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
(function(t,e){function i(e,i){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(n=e.parentNode,o=n.name,e.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap=#"+o+"]")[0],!!a&&s(a)):!1):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r?e.href||i:i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var s,n,o=t(this[0]);o.length&&o[0]!==document;){if(s=o.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(n=parseInt(o.css("zIndex"),10),!isNaN(n)&&0!==n))return n;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var s=t.attr(e,"tabindex"),n=isNaN(s);return(n||s>=0)&&i(e,!n)}}),t("<a>").outerWidth(1).jquery||t.each(["Width","Height"],function(i,s){function n(e,i,s,n){return t.each(o,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),n&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var o="Width"===s?["Left","Right"]:["Top","Bottom"],a=s.toLowerCase(),r={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+s]=function(i){return i===e?r["inner"+s].call(this):this.each(function(){t(this).css(a,n(this,i)+"px")})},t.fn["outer"+s]=function(e,i){return"number"!=typeof e?r["outer"+s].call(this,e):this.each(function(){t(this).css(a,n(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;n.length>s;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)}})})(jQuery),function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})}(jQuery),function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,o="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=e.pageX,l=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,o=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var o=!1,a=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(document).scrollTop()<s.scrollSensitivity?n=t(document).scrollTop(t(document).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<s.scrollSensitivity&&(n=t(document).scrollTop(t(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(document).scrollLeft()<s.scrollSensitivity?n=t(document).scrollLeft(t(document).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<s.scrollSensitivity&&(n=t(document).scrollLeft(t(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(i,e)}}),t.ui.plugin.add("draggable","snap",{start:function(){var e=t(this).data("ui-draggable"),i=e.options;e.snapElements=[],t(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=t(this),s=i.offset();this!==e.element[0]&&e.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(e,i){var s,n,o,a,r,h,l,c,u,d,p=t(this).data("ui-draggable"),f=p.options,g=f.snapTolerance,m=i.offset.left,v=m+p.helperProportions.width,_=i.offset.top,b=_+p.helperProportions.height;for(u=p.snapElements.length-1;u>=0;u--)r=p.snapElements[u].left,h=r+p.snapElements[u].width,l=p.snapElements[u].top,c=l+p.snapElements[u].height,r-g>v||m>h+g||l-g>b||_>c+g||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(s=g>=Math.abs(l-b),n=g>=Math.abs(c-_),o=g>=Math.abs(r-v),a=g>=Math.abs(h-m),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||o||a,"outer"!==f.snapMode&&(s=g>=Math.abs(l-_),n=g>=Math.abs(c-b),o=g>=Math.abs(r-m),a=g>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||o||a||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||o||a||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;
this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,o,a=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,h=a+t.helperProportions.width,l=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return a>=c&&d>=h&&r>=u&&p>=l;case"intersect":return a+t.helperProportions.width/2>c&&d>h-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>l-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,o=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(o,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||l>=u&&p>=l||u>r&&l>p)&&(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=t.ui.intersect(e,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),o.length&&(s=t.data(o[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}}(jQuery),function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),o="ui-resizable-"+s,n=t("<div class='ui-resizable-handle "+o+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(t(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,o,a=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),a.containment&&(s+=t(a.containment).scrollLeft()||0,n+=t(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},o=this.originalMousePosition,a=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-o.left||0,d=e.pageY-o.top||0,p=this._change[a];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,o,a,r=this.options;a={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,n=a.minWidth/this.aspectRatio,s=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),n>a.minHeight&&(a.minHeight=n),a.maxWidth>s&&(a.maxWidth=s),a.maxHeight>o&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidth<t.width,o=i(t.height)&&e.maxHeight&&e.maxHeight<t.height,a=i(t.width)&&e.minWidth&&e.minWidth>t.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return a&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),a&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),o&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,o=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,o,a,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,o=l.containerSize.height,a=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:a,h=t.ui.hasScroll(p)?p.scrollHeight:o,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,o,a=t(this).data("ui-resizable"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?h.top:0),a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top,i=Math.abs((a._helper?a.offset.left-u.left:a.offset.left-u.left)+a.sizeDiff.width),s=Math.abs((a._helper?a.offset.top-u.top:a.offset.top-h.top)+a.sizeDiff.height),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o&&(i-=Math.abs(a.parentData.left)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),o={},a=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),v&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):(p-l>0?(e.size.height=p,e.position.top=o.top-u):(e.size.height=l,e.position.top=o.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=o.left-c):(e.size.width=h,e.position.left=o.left+n.width-h))}})}(jQuery),function(t){t.widget("ui.selectable",t.ui.mouse,{version:"1.10.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e=t(i.options.filter,i.element[0]),e.addClass("ui-selectee"),e.each(function(){var e=t(this),i=e.offset();t.data(this,"selectable-item",{element:this,$element:e,left:i.left,top:i.top,right:i.left+e.outerWidth(),bottom:i.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=t("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||o>i.right||i.top>h||a>i.bottom):"fit"===n.tolerance&&(l=i.left>o&&r>i.right&&i.top>a&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}})}(jQuery),function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):undefined}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-t(document).scrollTop()<a.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-a.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<a.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+a.scrollSpeed)),e.pageX-t(document).scrollLeft()<a.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-a.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<a.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;
this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,o=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return n?this.floating?a&&"right"===a||"down"===o?2:1:o&&("down"===o?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return this.floating&&o?"right"===o&&s||"left"===o&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td> </td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,o,a,r,h,l,c,u,d,p,f=null,g=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],g=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[g].containerCache.over||(this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1);else{for(a=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],o=this.items.length-1;o>=0;o--)t.contains(this.containers[g].element[0],this.items[o].item[0])&&this.items[o].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[o].top,this.items[o].height))&&(u=this.items[o].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[o][l]-c)&&(d=!0,u+=this.items[o][l]),a>Math.abs(u-c)&&(a=Math.abs(u-c),r=this.items[o],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[g])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[g].element,!0),this._trigger("change",s,this._uiHash()),this.containers[g]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[g],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[g]._trigger("over",s,this._uiHash(this)),this.containers[g].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})}(jQuery),function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function s(e,i){var s,n,a={};for(s in i)n=i[s],e[s]!==n&&(o[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(a[s]=n));return a}var n=["add","remove","toggle"],o={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),o=function(){t.each(n,function(t,i){e[i]&&a[i+"Class"](e[i])})},o(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,o,a,r){return"boolean"==typeof n||n===e?o?t.effects.animateClass.call(this,n?{add:s}:{remove:s},o,a,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,o,a)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.4",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,o;for(o=0;s.length>o;o++)null!==s[o]&&(n=t.data(i+s[o]),n===e&&(n=""),t.css(s[o],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(o)&&o.call(n[0]),t.isFunction(e)&&e()}var n=t(this),o=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):a.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,o=i.queue,a=t.effects.effect[i.effect];return t.fx.off||!a?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):o===!1?this.each(e):this.queue(o||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()}(jQuery),function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))
},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),o.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,o=this.element.parent(),a=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),o=n.attr("id");s||(s=a+"-header-"+e,i.attr("id",s)),o||(o=a+"-panel-"+e,n.attr("id",o)),i.attr("aria-controls",o),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=o.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n[0]===s[0],a=o&&i.collapsible,r=a?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:a?t():n,newPanel:r};e.preventDefault(),o&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=a?!1:this.headers.index(n),this.active=o?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),o||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true",tabIndex:0,"aria-expanded":"true"})},_animate:function(t,e,n){var o,a,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(a=d),a=a||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(o=t.show().outerHeight(),e.animate(i,{duration:r,easing:a,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(s,{duration:r,easing:a,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(o-e.outerHeight()-l),l=0)}}),undefined):e.animate(i,r,a,p):t.animate(s,r,a,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})}(jQuery),function(t){t.widget("ui.autocomplete",{version:"1.10.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o?!0:a?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:case o.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):undefined},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[t](e),undefined):(this.search(null,e),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})}(jQuery),function(t){var e,i="ui-button ui-widget ui-state-default ui-corner-all",s="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",n=function(){var e=t(this);setTimeout(function(){e.find(":ui-button").button("refresh")},1)},o=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,n),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var s=this,a=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===a.label&&(a.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){a.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){a.disabled||t(this).removeClass(h)}).bind("click"+this.eventNamespace,function(t){a.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){s.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return a.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(a.disabled)return!1;t(this).addClass("ui-state-active"),s.buttonElement.attr("aria-pressed","true");var e=s.element[0];o(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return a.disabled?!1:(t(this).addClass("ui-state-active"),e=this,s.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return a.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return a.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",a.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+s).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(this.element.prop("disabled",!!e),e&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?o(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(s),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),n=this.options.icons,o=n.primary&&n.secondary,a=[];n.primary||n.secondary?(this.options.text&&a.push("ui-button-text-icon"+(o?"s":n.primary?"-primary":"-secondary")),n.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(a.push(o?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(o.inline?e.parent()[0]:o.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.4"}});var o,a="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,a,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,a,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,o,r){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],a,p)),n(p.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],a,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,a);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,a),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,a)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,o){var a,r,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(a=s||{},"string"==typeof s&&(a={},a[s]=o),c&&(this._curInst===c&&this._hideDatepicker(),r=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,a),null!==h&&a.dateFormat!==e&&a.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&a.dateFormat!==e&&a.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in a&&(a.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,r),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");
break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,o=t.datepicker._getInst(i.target);return t.datepicker._get(o,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(o,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,o,a,r,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),o=s?s.apply(e,[e,i]):{},o!==!1&&(n(i.settings,o),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each(function(){return a|="fixed"===t(this).css("position"),!a}),r={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),r=t.datepicker._checkOffset(i,r,a),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:r.left+"px",top:r.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,o=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],a=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,r=this._curInst;!r||e&&r!==t.data(e,a)||this._datepickerShowing&&(i=this._get(r,"showAnim"),s=this._get(r,"duration"),n=function(){t.datepicker._tidyDialog(r)},t.effects&&(t.effects.effect[i]||t.effects[i])?r.dpDiv.hide(i,t.datepicker._get(r,"showOptions"),s,n):r.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(r,"onClose"),o&&o.apply(r.input?r.input[0]:null,[r.input?r.input.val():"",r]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var o,a,r,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,g=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,v=-1,_=-1,b=-1,y=!1,w=function(t){var e=i.length>o+1&&i.charAt(o+1)===t;return e&&o++,e},x=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),o=s.substring(l).match(n);if(!o)throw"Missing number at position "+l;return l+=o[0].length,parseInt(o[0],10)},k=function(i,n,o){var a=-1,r=t.map(w(i)?o:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(r,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(a=i[0],l+=n.length,!1):e}),-1!==a)return a+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(o))throw"Unexpected literal at position "+l;l++};for(o=0;i.length>o;o++)if(y)"'"!==i.charAt(o)||w("'")?D():y=!1;else switch(i.charAt(o)){case"d":_=x("d");break;case"D":k("D",d,p);break;case"o":b=x("o");break;case"m":v=x("m");break;case"M":v=k("M",f,g);break;case"y":m=x("y");break;case"@":h=new Date(x("@")),m=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((x("!")-this._ticksTo1970)/1e4),m=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":w("'")?D():y=!0;break;default:D()}if(s.length>l&&(r=s.substr(l),!/^\s+/.test(r)))throw"Extra/unparsed characters found in date: "+r;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),b>-1)for(v=1,_=b;;){if(a=this._getDaysInMonth(m,v-1),a>=_)break;v++,_-=a}if(h=this._daylightSavingAdjust(new Date(m,v-1,_)),h.getFullYear()!==m||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,v,_,b,y,w,x,k,D,C,I,P,T,M,S,z,A,E,H,N,W,O,F,R,L=new Date,j=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),V=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),q=this._getNumberOfMonths(t),U=this._get(t,"showCurrentAtPos"),Q=this._get(t,"stepMonths"),X=1!==q[0]||1!==q[1],$=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-U,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-q[0]*q[1]+1,J.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-Q,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":V?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+Q,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":V?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?$:j,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",x=0;q[0]>x;x++){for(k="",this.maxRows=4,D=0;q[1]>D;D++){if(C=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",P="",X){if(P+="<div class='ui-datepicker-group",q[1]>1)switch(D){case 0:P+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left");break;case q[1]-1:P+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:P+=" ui-datepicker-group-middle",I=""}P+="'>"}for(P+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===x?Y?o:s:"")+(/all|right/.test(I)&&0===x?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,G,J,x>0||D>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",T=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,T+="<th"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(P+=T+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),z=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((z+S)/7),E=X?this.maxRows>A?this.maxRows:A:A,this.maxRows=E,H=this._daylightSavingAdjust(new Date(te,Z,1-z)),N=0;E>N;N++){for(P+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(H)+"</td>":"",w=0;7>w;w++)O=m?m.apply(t.input?t.input[0]:null,[H]):[!0,""],F=H.getMonth()!==Z,R=F&&!_||!O[0]||G&&G>H||J&&H>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(H.getTime()===C.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===H.getTime()&&b.getTime()===C.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!v?"":" "+O[1]+(H.getTime()===$.getTime()?" "+this._currentClass:"")+(H.getTime()===j.getTime()?" ui-datepicker-today":""))+"'"+(F&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"'")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(F&&!v?" ":R?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===j.getTime()?" ui-state-highlight":"")+(H.getTime()===$.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);P+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),P+="</tbody></table>"+(X?"</div>"+(q[0]>0&&D===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=P}y+=k}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(_||(b+=y+(!o&&m&&v?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!o&&m&&v?"":" ")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.4"}(jQuery),function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",e)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&t(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",e)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html(" "),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},o={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(o).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){s.position=[o.position.left-i.document.scrollLeft(),o.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";
this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,o=!1,a={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(o=!0),t in i&&(a[t]=s)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})}(jQuery),function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var o,a,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",g=i.test(u),m={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),o=t.effects.createWrapper(h).css({overflow:"hidden"}),a=o[p](),r=parseFloat(o.css(f))||0,m[p]=v?a:0,g||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),m[f]=v?r:a+r),v&&(o.css(p,0),g||o.css(f,r+a)),o.animate(m,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}}(jQuery),function(t){t.effects.effect.bounce=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(a,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),g=e.duration/f,m=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=a.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(a,r),a.show(),t.effects.createWrapper(a),d||(d=a["top"===v?"outerHeight":"outerWidth"]()/3),c&&(o={opacity:1},o[v]=0,a.css("opacity",0).css(v,_?2*-d:2*d).animate(o,g,m)),l&&(d/=Math.pow(2,p-1)),o={},o[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,a.animate(n,g,m).animate(o,g,m),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,a.animate(n,g,m)),a.queue(function(){l&&a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),a.dequeue()}}(jQuery),function(t){t.effects.effect.clip=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(a,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(a,r),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n="IMG"===a[0].tagName?s:a,o=n[d](),l&&(n.css(d,0),n.css(p,o/2)),f[d]=l?o:0,f[p]=l?0:o/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||a.hide(),t.effects.restore(a,r),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","opacity","height","width"],a=t.effects.setMode(n,e.mode||"hide"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,o),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),g||p.hide(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),g="show"===f,m=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*_,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*v,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*v,top:-o*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(g?l*v:0),top:h+(g?c*_:0),opacity:g?0:1}).animate({left:r+(g?0:l*v),top:h+(g?0:c*_),opacity:g?1:0},e.duration||500,e.easing,s)}}(jQuery),function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}}(jQuery),function(t){t.effects.effect.fold=function(e,i){var s,n,o=t(this),a=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(o,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],g=e.duration/2,m={},v={};t.effects.save(o,a),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),m[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(m,g,e.easing).animate(v,g,e.easing,function(){l&&o.hide(),t.effects.restore(o,a),t.effects.removeWrapper(o),i()})}}(jQuery),function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],o=t.effects.setMode(s,e.mode||"show"),a={backgroundColor:s.css("backgroundColor")};"hide"===o&&(a.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(a,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&s.hide(),t.effects.restore(s,n),i()}})}}(jQuery),function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),o=t.effects.setMode(n,e.mode||"show"),a="show"===o,r="hide"===o,h=a||"hide"===o,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((a||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),o="hide"===n,a=parseInt(e.percent,10)||150,r=a/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:o?a:100,from:o?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),o=t.effects.setMode(s,e.mode||"effect"),a=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===o?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?a/100:1,x:"vertical"!==r?a/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==o&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===o?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===o&&(n.from.opacity=0,n.to.opacity=1),"hide"===o&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,o,a=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(a,e.mode||"effect"),f=e.restore||"effect"!==p,g=e.scale||"both",m=e.origin||["middle","center"],v=a.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&a.show(),s={height:a.height(),width:a.width(),outerHeight:a.outerHeight(),outerWidth:a.outerWidth()},"toggle"===e.mode&&"show"===p?(a.from=e.to||b,a.to=e.from||s):(a.from=e.from||("show"===p?b:s),a.to=e.to||("hide"===p?b:s)),o={from:{y:a.from.height/s.height,x:a.from.width/s.width},to:{y:a.to.height/s.height,x:a.to.width/s.width}},("box"===g||"both"===g)&&(o.from.y!==o.to.y&&(_=_.concat(u),a.from=t.effects.setTransition(a,u,o.from.y,a.from),a.to=t.effects.setTransition(a,u,o.to.y,a.to)),o.from.x!==o.to.x&&(_=_.concat(d),a.from=t.effects.setTransition(a,d,o.from.x,a.from),a.to=t.effects.setTransition(a,d,o.to.x,a.to))),("content"===g||"both"===g)&&o.from.y!==o.to.y&&(_=_.concat(c).concat(l),a.from=t.effects.setTransition(a,c,o.from.y,a.from),a.to=t.effects.setTransition(a,c,o.to.y,a.to)),t.effects.save(a,_),a.show(),t.effects.createWrapper(a),a.css("overflow","hidden").css(a.from),m&&(n=t.effects.getBaseline(m,s),a.from.top=(s.outerHeight-a.outerHeight())*n.y,a.from.left=(s.outerWidth-a.outerWidth())*n.x,a.to.top=(s.outerHeight-a.to.outerHeight)*n.y,a.to.left=(s.outerWidth-a.to.outerWidth)*n.x),a.css(a.from),("content"===g||"both"===g)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),a.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*o.from.y,width:s.width*o.from.x,outerHeight:s.outerHeight*o.from.y,outerWidth:s.outerWidth*o.from.x},i.to={height:s.height*o.to.y,width:s.width*o.to.x,outerHeight:s.height*o.to.y,outerWidth:s.width*o.to.x},o.from.y!==o.to.y&&(i.from=t.effects.setTransition(i,u,o.from.y,i.from),i.to=t.effects.setTransition(i,u,o.to.y,i.to)),o.from.x!==o.to.x&&(i.from=t.effects.setTransition(i,d,o.from.x,i.from),i.to=t.effects.setTransition(i,d,o.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),a.animate(a.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===a.to.opacity&&a.css("opacity",a.from.opacity),"hide"===p&&a.hide(),t.effects.restore(a,_),f||("static"===v?a.css({position:"relative",top:a.to.top,left:a.to.left}):t.each(["top","left"],function(t,e){a.css(e,function(e,i){var s=parseInt(i,10),n=t?a.to.left:a.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(a),i()}})}}(jQuery),function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","height","width"],a=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},g={},m={},v=n.queue(),_=v.length;for(t.effects.save(n,o),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,g[d]=(p?"+=":"-=")+2*h,m[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(g,u,e.easing).animate(m,u,e.easing);n.animate(g,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}}(jQuery),function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),o=["position","top","bottom","left","right","width","height"],a=t.effects.setMode(n,e.mode||"show"),r="show"===a,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,o),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),t.effects.restore(n,o),t.effects.removeWrapper(n),i()}})}}(jQuery),function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}}(jQuery),function(t){t.widget("ui.menu",{version:"1.10.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&t(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,o,a,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",o=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),o===n?a=!0:o=n+o,r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=a&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(o=String.fromCharCode(e.keyCode),r=RegExp("^"+i(o),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=o,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})}(jQuery),function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var o,a=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(o!==e)return o;var i,s,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=n.children()[0];return t("body").append(n),i=a.offsetWidth,n.css("overflow","scroll"),s=a.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),o=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var o,p,g,m,v,_,b=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return _=n(b),b[0].preventDefault&&(e.at="left top"),p=_.width,g=_.height,m=_.offset,v=t.extend({},m),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=g:"center"===e.at[1]&&(v.top+=g/2),o=i(k.at,p,g),v.left+=o[0],v.top+=o[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),_=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,C=d+_+s(this,"marginBottom")+w.height,I=t.extend({},v),P=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?I.left-=u:"center"===e.my[0]&&(I.left-=u/2),"bottom"===e.my[1]?I.top-=d:"center"===e.my[1]&&(I.top-=d/2),I.left+=P[0],I.top+=P[1],t.support.offsetFractions||(I.left=h(I.left),I.top=h(I.top)),n={marginLeft:f,marginTop:_},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](I,{targetWidth:p,targetHeight:g,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:C,offset:[o[0]+P[0],o[1]+P[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=m.left-I.left,s=i+p-u,n=m.top-I.top,o=n+g-d,h={target:{element:b,left:m.left,top:m.top,width:p,height:g},element:{element:c,left:I.left,top:I.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>o?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>g&&g>r(n+o)&&(h.vertical="middle"),h.important=a(r(i),r(s))>a(r(n),r(o))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(I,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-o-n;e.collisionWidth>o?h>0&&0>=l?(i=t.left+h+e.collisionWidth-o-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+o-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=a(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,o=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-o-n;e.collisionHeight>o?h>0&&0>=l?(i=t.top+h+e.collisionHeight-o-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+o-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=a(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,a=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-a-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-a-o,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,a=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-a-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-a-o,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,o,a=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)e.style[o]=s[o];e.appendChild(r),i=a||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()}(jQuery),function(t,e){t.widget("ui.progressbar",{version:"1.10.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()
},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})}(jQuery),function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,o.addClass("ui-state-active").focus(),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),o!==!1&&this.values(e,i))):i!==this.value()&&(o=this._trigger("slide",t,{handle:this.handles[e],value:i}),o!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,o,a,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(a=this.options.step,n=o=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:o=this._valueMin();break;case t.ui.keyCode.END:o=this._valueMax();break;case t.ui.keyCode.PAGE_UP:o=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:o=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;o=this._trimAlignValue(n+a);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;o=this._trimAlignValue(n-a)}this._slide(i,r,o)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})}(jQuery),function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>▼</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})}(jQuery),function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(o,""))===decodeURIComponent(location.href.replace(o,""))}var n=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,o){return t(o).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),o=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:o=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,o),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var o,a,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(o=n.hash,a=e.element.find(e._sanitizeSelector(o))):(r=e._tabId(l),o="#"+r,a=e.element.find(o),a.length||(a=e._createPanel(r),a.insertAfter(e.panels[i-1]||e.tablist)),a.attr("aria-live","polite")),a.length&&(e.panels=e.panels.add(a)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":o.substring(1),"aria-labelledby":h}),a.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,o=this.tabs.eq(e),a=o.find(".ui-tabs-anchor"),r=this._getPanelForTab(o),h={tab:o,panel:r};s(a[0])||(this.xhr=t.ajax(this._ajaxSettings(a,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}(jQuery),function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.4",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;
return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=o),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function o(t){l.of=t,a.is(":hidden")||a.position(l)}var a,r,h,l=t.extend({},this.options.position);if(n){if(a=this._find(s),a.length)return a.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),a=this._tooltip(s),e(s,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:o}),o(i)):a.position(t.extend({of:s},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){a.is(":visible")&&(o(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:a}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(a)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),o.stop(!0),this._hide(o,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:o}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})}(jQuery); | siscia/jsdelivr | files/jquery.ui/1.10.4/jquery-ui.min.js | JavaScript | mit | 228,478 |
define("ace/theme/dreamweaver",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dreamweaver",t.cssText='.ace-dreamweaver .ace_gutter {background: #e8e8e8;color: #333;}.ace-dreamweaver .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-dreamweaver {background-color: #FFFFFF;color: black;}.ace-dreamweaver .ace_fold {background-color: #757AD8;}.ace-dreamweaver .ace_cursor {color: black;}.ace-dreamweaver .ace_invisible {color: rgb(191, 191, 191);}.ace-dreamweaver .ace_storage,.ace-dreamweaver .ace_keyword {color: blue;}.ace-dreamweaver .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-dreamweaver .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-dreamweaver .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_invalid {background-color: rgb(153, 0, 0);color: white;}.ace-dreamweaver .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-dreamweaver .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-dreamweaver .ace_support.ace_type,.ace-dreamweaver .ace_support.ace_class {color: #009;}.ace-dreamweaver .ace_support.ace_php_tag {color: #f00;}.ace-dreamweaver .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-dreamweaver .ace_string {color: #00F;}.ace-dreamweaver .ace_comment {color: rgb(76, 136, 107);}.ace-dreamweaver .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-dreamweaver .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-dreamweaver .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-dreamweaver .ace_variable {color: #06F}.ace-dreamweaver .ace_xml-pe {color: rgb(104, 104, 91);}.ace-dreamweaver .ace_entity.ace_name.ace_function {color: #00F;}.ace-dreamweaver .ace_heading {color: rgb(12, 7, 255);}.ace-dreamweaver .ace_list {color:rgb(185, 6, 144);}.ace-dreamweaver .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-dreamweaver .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-dreamweaver .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-dreamweaver .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-dreamweaver .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-dreamweaver .ace_gutter-active-line {background-color : #DCDCDC;}.ace-dreamweaver .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-dreamweaver .ace_meta.ace_tag {color:#009;}.ace-dreamweaver .ace_meta.ace_tag.ace_anchor {color:#060;}.ace-dreamweaver .ace_meta.ace_tag.ace_form {color:#F90;}.ace-dreamweaver .ace_meta.ace_tag.ace_image {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_script {color:#900;}.ace-dreamweaver .ace_meta.ace_tag.ace_style {color:#909;}.ace-dreamweaver .ace_meta.ace_tag.ace_table {color:#099;}.ace-dreamweaver .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-dreamweaver .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}';var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) | sujonvidia/cdnjs | ajax/libs/ace/1.1.8/theme-dreamweaver.js | JavaScript | mit | 3,134 |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Xunit;
using System;
using System.Text;
namespace System.Globalization.Extensions.Tests
{
/// <summary>
/// Class to read data obtained from http://www.unicode.org/Public/idna. For more information read the information
/// contained in Data\6.0\IdnaTest.txt
///
/// The structure of the data set is a semicolon deliminated list with the following columns:
///
/// Column 1: type - T for transitional, N for nontransitional, B for both
/// Column 2: source - the source string to be tested
/// Column 3: toUnicode - the result of applying toUnicode to the source, using the specified type
/// Column 4: toASCII - the result of applying toASCII to the source, using nontransitional
///
/// If the value of toUnicode or toASCII is the same as source, the column will be blank.
/// </summary>
public class Unicode_6_0_IdnaTest : IConformanceIdnaTest
{
public IdnType Type { get; set; }
public string Source { get; set; }
public ConformanceIdnaTestResult GetUnicodeResult { get; set; }
public ConformanceIdnaTestResult GetASCIIResult { get; set; }
public int LineNumber { get; set; }
public Unicode_6_0_IdnaTest(string line, int lineNumber)
{
var split = line.Split(';');
Type = ConvertStringToType(split[0].Trim());
Source = EscapedToLiteralString(split[1], lineNumber);
GetUnicodeResult = new ConformanceIdnaTestResult(EscapedToLiteralString(split[2], lineNumber), Source);
GetASCIIResult = new ConformanceIdnaTestResult(EscapedToLiteralString(split[3], lineNumber), GetUnicodeResult.Value);
LineNumber = lineNumber;
}
private static IdnType ConvertStringToType(string idnType)
{
switch (idnType)
{
case "T":
return IdnType.Transitional;
case "N":
return IdnType.Nontransitional;
case "B":
return IdnType.Both;
default:
throw new ArgumentOutOfRangeException("idnType", "Unknown idnType");
}
}
/// <summary>
/// This will convert strings with escaped sequences to literal characters. The input string is
/// expected to have escaped sequences in the form of '\uXXXX'.
///
/// Example: "a\u0020b" will be converted to 'a b'.
/// </summary>
private static string EscapedToLiteralString(string escaped, int lineNumber)
{
var sb = new StringBuilder();
for (int i = 0; i < escaped.Length; i++)
{
if (i + 1 < escaped.Length && escaped[i] == '\\' && escaped[i + 1] == 'u')
{
// Verify that the escaped sequence is not malformed
if (i + 5 >= escaped.Length)
Assert.False(true, "There was a problem converting to literal string on Line " + lineNumber);
var codepoint = Convert.ToInt32(escaped.Substring(i + 2, 4), 16);
sb.Append((char)codepoint);
i += 5;
}
else
{
sb.Append(escaped[i]);
}
}
return sb.ToString().Trim();
}
}
}
| kyulee1/corefx | src/System.Globalization.Extensions/tests/IdnMapping/Data/Unicode_6_0/Unicode_6_0_IdnaTest.cs | C# | mit | 3,562 |
<?php
namespace Concrete\Core\Authentication;
use User;
use Page;
use Loader;
use Controller;
abstract class AuthenticationTypeController extends Controller implements AuthenticationTypeControllerInterface {
protected $authenticationType;
abstract public function getAuthenticationTypeIconHTML();
abstract public function view();
/**
* @param AuthenticationType $type This type may be null only for access points that do not rely on the type.
*/
public function __construct(AuthenticationType $type=null) {
$this->authenticationType = $type;
}
public function getAuthenticationType() {
if (!$this->authenticationType) {
$this->authenticationType = \AuthenticationType::getByHandle($this->getHandle());
}
return $this->authenticationType;
}
public function completeAuthentication(User $u) {
$c = Page::getByPath('/login');
$controller = $c->getPageController();
$controller->finishAuthentication($this->getAuthenticationType());
}
/**
* @return string
*/
abstract function getHandle();
}
| syntax-3rror/proyC | concrete/src/Authentication/AuthenticationTypeController.php | PHP | mit | 1,079 |
<?php
/*
* Copyright 2014 Google Inc.
*
* 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.
*/
class Google_Service_PeopleService_Event extends Google_Model
{
protected $dateType = 'Google_Service_PeopleService_Date';
protected $dateDataType = '';
public $formattedType;
protected $metadataType = 'Google_Service_PeopleService_FieldMetadata';
protected $metadataDataType = '';
public $type;
/**
* @param Google_Service_PeopleService_Date
*/
public function setDate(Google_Service_PeopleService_Date $date)
{
$this->date = $date;
}
/**
* @return Google_Service_PeopleService_Date
*/
public function getDate()
{
return $this->date;
}
public function setFormattedType($formattedType)
{
$this->formattedType = $formattedType;
}
public function getFormattedType()
{
return $this->formattedType;
}
/**
* @param Google_Service_PeopleService_FieldMetadata
*/
public function setMetadata(Google_Service_PeopleService_FieldMetadata $metadata)
{
$this->metadata = $metadata;
}
/**
* @return Google_Service_PeopleService_FieldMetadata
*/
public function getMetadata()
{
return $this->metadata;
}
public function setType($type)
{
$this->type = $type;
}
public function getType()
{
return $this->type;
}
}
| phil-davis/core | apps/files_external/3rdparty/google/apiclient-services/src/Google/Service/PeopleService/Event.php | PHP | mit | 1,820 |
<?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\Form;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\Exception\InvalidArgumentException;
use Symfony\Component\Form\Exception\BadMethodCallException;
/**
* A builder for {@link Button} instances.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface
{
/**
* @var bool
*/
protected $locked = false;
/**
* @var bool
*/
private $disabled;
/**
* @var ResolvedFormTypeInterface
*/
private $type;
/**
* @var string
*/
private $name;
/**
* @var array
*/
private $attributes = array();
/**
* @var array
*/
private $options;
/**
* Creates a new button builder.
*
* @param string $name The name of the button.
* @param array $options The button's options.
*
* @throws InvalidArgumentException If the name is empty.
*/
public function __construct($name, array $options = array())
{
if (empty($name) && 0 != $name) {
throw new InvalidArgumentException('Buttons cannot have empty names.');
}
$this->name = (string) $name;
$this->options = $options;
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param string|int|FormBuilderInterface $child
* @param string|FormTypeInterface $type
* @param array $options
*
* @throws BadMethodCallException
*/
public function add($child, $type = null, array $options = array())
{
throw new BadMethodCallException('Buttons cannot have children.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param string $name
* @param string|FormTypeInterface $type
* @param array $options
*
* @throws BadMethodCallException
*/
public function create($name, $type = null, array $options = array())
{
throw new BadMethodCallException('Buttons cannot have children.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param string $name
*
* @throws BadMethodCallException
*/
public function get($name)
{
throw new BadMethodCallException('Buttons cannot have children.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param string $name
*
* @throws BadMethodCallException
*/
public function remove($name)
{
throw new BadMethodCallException('Buttons cannot have children.');
}
/**
* Unsupported method.
*
* @param string $name
*
* @return bool Always returns false.
*/
public function has($name)
{
return false;
}
/**
* Returns the children.
*
* @return array Always returns an empty array.
*/
public function all()
{
return array();
}
/**
* Creates the button.
*
* @return Button The button
*/
public function getForm()
{
return new Button($this->getFormConfig());
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param string $eventName
* @param callable $listener
* @param int $priority
*
* @throws BadMethodCallException
*/
public function addEventListener($eventName, $listener, $priority = 0)
{
throw new BadMethodCallException('Buttons do not support event listeners.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param EventSubscriberInterface $subscriber
*
* @throws BadMethodCallException
*/
public function addEventSubscriber(EventSubscriberInterface $subscriber)
{
throw new BadMethodCallException('Buttons do not support event subscribers.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param DataTransformerInterface $viewTransformer
* @param bool $forcePrepend
*
* @throws BadMethodCallException
*/
public function addViewTransformer(DataTransformerInterface $viewTransformer, $forcePrepend = false)
{
throw new BadMethodCallException('Buttons do not support data transformers.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @throws BadMethodCallException
*/
public function resetViewTransformers()
{
throw new BadMethodCallException('Buttons do not support data transformers.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param DataTransformerInterface $modelTransformer
* @param bool $forceAppend
*
* @throws BadMethodCallException
*/
public function addModelTransformer(DataTransformerInterface $modelTransformer, $forceAppend = false)
{
throw new BadMethodCallException('Buttons do not support data transformers.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @throws BadMethodCallException
*/
public function resetModelTransformers()
{
throw new BadMethodCallException('Buttons do not support data transformers.');
}
/**
* {@inheritdoc}
*/
public function setAttribute($name, $value)
{
$this->attributes[$name] = $value;
return $this;
}
/**
* {@inheritdoc}
*/
public function setAttributes(array $attributes)
{
$this->attributes = $attributes;
return $this;
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param DataMapperInterface $dataMapper
*
* @throws BadMethodCallException
*/
public function setDataMapper(DataMapperInterface $dataMapper = null)
{
throw new BadMethodCallException('Buttons do not support data mappers.');
}
/**
* Set whether the button is disabled.
*
* @param bool $disabled Whether the button is disabled
*
* @return ButtonBuilder The button builder.
*/
public function setDisabled($disabled)
{
$this->disabled = $disabled;
return $this;
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param mixed $emptyData
*
* @throws BadMethodCallException
*/
public function setEmptyData($emptyData)
{
throw new BadMethodCallException('Buttons do not support empty data.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param bool $errorBubbling
*
* @throws BadMethodCallException
*/
public function setErrorBubbling($errorBubbling)
{
throw new BadMethodCallException('Buttons do not support error bubbling.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param bool $required
*
* @throws BadMethodCallException
*/
public function setRequired($required)
{
throw new BadMethodCallException('Buttons cannot be required.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param null $propertyPath
*
* @throws BadMethodCallException
*/
public function setPropertyPath($propertyPath)
{
throw new BadMethodCallException('Buttons do not support property paths.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param bool $mapped
*
* @throws BadMethodCallException
*/
public function setMapped($mapped)
{
throw new BadMethodCallException('Buttons do not support data mapping.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param bool $byReference
*
* @throws BadMethodCallException
*/
public function setByReference($byReference)
{
throw new BadMethodCallException('Buttons do not support data mapping.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param bool $virtual
*
* @throws BadMethodCallException
*
* @deprecated since version 2.3, to be removed in 3.0. Use
* {@link setInheritData()} instead.
*/
public function setVirtual($virtual)
{
throw new BadMethodCallException('Buttons cannot be virtual.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param bool $compound
*
* @throws BadMethodCallException
*/
public function setCompound($compound)
{
throw new BadMethodCallException('Buttons cannot be compound.');
}
/**
* Sets the type of the button.
*
* @param ResolvedFormTypeInterface $type The type of the button.
*
* @return ButtonBuilder The button builder.
*/
public function setType(ResolvedFormTypeInterface $type)
{
$this->type = $type;
return $this;
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param mixed $data
*
* @throws BadMethodCallException
*/
public function setData($data)
{
throw new BadMethodCallException('Buttons do not support data.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param bool $locked
*
* @throws BadMethodCallException
*/
public function setDataLocked($locked)
{
throw new BadMethodCallException('Buttons do not support data locking.');
}
/**
* Unsupported method.
*
* This method should not be invoked.
*
* @param FormFactoryInterface $formFactory
*
* @throws BadMethodCallException
*/
public function setFormFactory(FormFactoryInterface $formFactory)
{
throw new BadMethodCallException('Buttons do not support form factories.');
}
/**
* Unsupported method.
*
* @param string $action
*
* @throws BadMethodCallException
*/
public function setAction($action)
{
throw new BadMethodCallException('Buttons do not support actions.');
}
/**
* Unsupported method.
*
* @param string $method
*
* @throws BadMethodCallException
*/
public function setMethod($method)
{
throw new BadMethodCallException('Buttons do not support methods.');
}
/**
* Unsupported method.
*
* @param RequestHandlerInterface $requestHandler
*
* @throws BadMethodCallException
*/
public function setRequestHandler(RequestHandlerInterface $requestHandler)
{
throw new BadMethodCallException('Buttons do not support request handlers.');
}
/**
* Unsupported method.
*
* @param bool $initialize
*
* @return ButtonBuilder
*
* @throws BadMethodCallException
*/
public function setAutoInitialize($initialize)
{
if (true === $initialize) {
throw new BadMethodCallException('Buttons do not support automatic initialization.');
}
return $this;
}
/**
* Unsupported method.
*
* @param bool $inheritData
*
* @throws BadMethodCallException
*/
public function setInheritData($inheritData)
{
throw new BadMethodCallException('Buttons do not support data inheritance.');
}
/**
* Builds and returns the button configuration.
*
* @return FormConfigInterface
*/
public function getFormConfig()
{
// This method should be idempotent, so clone the builder
$config = clone $this;
$config->locked = true;
return $config;
}
/**
* Unsupported method.
*/
public function getEventDispatcher()
{
}
/**
* {@inheritdoc}
*/
public function getName()
{
return $this->name;
}
/**
* Unsupported method.
*/
public function getPropertyPath()
{
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getMapped()
{
return false;
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getByReference()
{
return false;
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*
* @deprecated since version 2.3, to be removed in 3.0. Use
* {@link getInheritData()} instead.
*/
public function getVirtual()
{
return false;
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getCompound()
{
return false;
}
/**
* Returns the form type used to construct the button.
*
* @return ResolvedFormTypeInterface The button's type.
*/
public function getType()
{
return $this->type;
}
/**
* Unsupported method.
*
* @return array Always returns an empty array.
*/
public function getViewTransformers()
{
return array();
}
/**
* Unsupported method.
*
* @return array Always returns an empty array.
*/
public function getModelTransformers()
{
return array();
}
/**
* Unsupported method.
*/
public function getDataMapper()
{
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getRequired()
{
return false;
}
/**
* Returns whether the button is disabled.
*
* @return bool Whether the button is disabled.
*/
public function getDisabled()
{
return $this->disabled;
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getErrorBubbling()
{
return false;
}
/**
* Unsupported method.
*/
public function getEmptyData()
{
}
/**
* Returns additional attributes of the button.
*
* @return array An array of key-value combinations.
*/
public function getAttributes()
{
return $this->attributes;
}
/**
* Returns whether the attribute with the given name exists.
*
* @param string $name The attribute name.
*
* @return bool Whether the attribute exists.
*/
public function hasAttribute($name)
{
return array_key_exists($name, $this->attributes);
}
/**
* Returns the value of the given attribute.
*
* @param string $name The attribute name.
* @param mixed $default The value returned if the attribute does not exist.
*
* @return mixed The attribute value.
*/
public function getAttribute($name, $default = null)
{
return array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default;
}
/**
* Unsupported method.
*/
public function getData()
{
}
/**
* Unsupported method.
*/
public function getDataClass()
{
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getDataLocked()
{
return false;
}
/**
* Unsupported method.
*/
public function getFormFactory()
{
}
/**
* Unsupported method.
*/
public function getAction()
{
}
/**
* Unsupported method.
*/
public function getMethod()
{
}
/**
* Unsupported method.
*/
public function getRequestHandler()
{
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getAutoInitialize()
{
return false;
}
/**
* Unsupported method.
*
* @return bool Always returns false.
*/
public function getInheritData()
{
return false;
}
/**
* Returns all options passed during the construction of the button.
*
* @return array The passed options.
*/
public function getOptions()
{
return $this->options;
}
/**
* Returns whether a specific option exists.
*
* @param string $name The option name,
*
* @return bool Whether the option exists.
*/
public function hasOption($name)
{
return array_key_exists($name, $this->options);
}
/**
* Returns the value of a specific option.
*
* @param string $name The option name.
* @param mixed $default The value returned if the option does not exist.
*
* @return mixed The option value.
*/
public function getOption($name, $default = null)
{
return array_key_exists($name, $this->options) ? $this->options[$name] : $default;
}
/**
* Unsupported method.
*
* @return int Always returns 0.
*/
public function count()
{
return 0;
}
/**
* Unsupported method.
*
* @return \EmptyIterator Always returns an empty iterator.
*/
public function getIterator()
{
return new \EmptyIterator();
}
}
| nassafou/bweb | vendor/symfony/symfony/src/Symfony/Component/Form/ButtonBuilder.php | PHP | mit | 18,092 |
// Copyright (c) 2020 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
// Based on https://github.com/mjosaarinen/tiny_sha3/blob/master/sha3.c
// by Markku-Juhani O. Saarinen <mjos@iki.fi>
#include <crypto/sha3.h>
#include <crypto/common.h>
#include <span.h>
#include <algorithm>
#include <array> // For std::begin and std::end.
#include <stdint.h>
// Internal implementation code.
namespace
{
uint64_t Rotl(uint64_t x, int n) { return (x << n) | (x >> (64 - n)); }
} // namespace
void KeccakF(uint64_t (&st)[25])
{
static constexpr uint64_t RNDC[24] = {
0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000,
0x000000000000808b, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009,
0x000000000000008a, 0x0000000000000088, 0x0000000080008009, 0x000000008000000a,
0x000000008000808b, 0x800000000000008b, 0x8000000000008089, 0x8000000000008003,
0x8000000000008002, 0x8000000000000080, 0x000000000000800a, 0x800000008000000a,
0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008
};
static constexpr int ROUNDS = 24;
for (int round = 0; round < ROUNDS; ++round) {
uint64_t bc0, bc1, bc2, bc3, bc4, t;
// Theta
bc0 = st[0] ^ st[5] ^ st[10] ^ st[15] ^ st[20];
bc1 = st[1] ^ st[6] ^ st[11] ^ st[16] ^ st[21];
bc2 = st[2] ^ st[7] ^ st[12] ^ st[17] ^ st[22];
bc3 = st[3] ^ st[8] ^ st[13] ^ st[18] ^ st[23];
bc4 = st[4] ^ st[9] ^ st[14] ^ st[19] ^ st[24];
t = bc4 ^ Rotl(bc1, 1); st[0] ^= t; st[5] ^= t; st[10] ^= t; st[15] ^= t; st[20] ^= t;
t = bc0 ^ Rotl(bc2, 1); st[1] ^= t; st[6] ^= t; st[11] ^= t; st[16] ^= t; st[21] ^= t;
t = bc1 ^ Rotl(bc3, 1); st[2] ^= t; st[7] ^= t; st[12] ^= t; st[17] ^= t; st[22] ^= t;
t = bc2 ^ Rotl(bc4, 1); st[3] ^= t; st[8] ^= t; st[13] ^= t; st[18] ^= t; st[23] ^= t;
t = bc3 ^ Rotl(bc0, 1); st[4] ^= t; st[9] ^= t; st[14] ^= t; st[19] ^= t; st[24] ^= t;
// Rho Pi
t = st[1];
bc0 = st[10]; st[10] = Rotl(t, 1); t = bc0;
bc0 = st[7]; st[7] = Rotl(t, 3); t = bc0;
bc0 = st[11]; st[11] = Rotl(t, 6); t = bc0;
bc0 = st[17]; st[17] = Rotl(t, 10); t = bc0;
bc0 = st[18]; st[18] = Rotl(t, 15); t = bc0;
bc0 = st[3]; st[3] = Rotl(t, 21); t = bc0;
bc0 = st[5]; st[5] = Rotl(t, 28); t = bc0;
bc0 = st[16]; st[16] = Rotl(t, 36); t = bc0;
bc0 = st[8]; st[8] = Rotl(t, 45); t = bc0;
bc0 = st[21]; st[21] = Rotl(t, 55); t = bc0;
bc0 = st[24]; st[24] = Rotl(t, 2); t = bc0;
bc0 = st[4]; st[4] = Rotl(t, 14); t = bc0;
bc0 = st[15]; st[15] = Rotl(t, 27); t = bc0;
bc0 = st[23]; st[23] = Rotl(t, 41); t = bc0;
bc0 = st[19]; st[19] = Rotl(t, 56); t = bc0;
bc0 = st[13]; st[13] = Rotl(t, 8); t = bc0;
bc0 = st[12]; st[12] = Rotl(t, 25); t = bc0;
bc0 = st[2]; st[2] = Rotl(t, 43); t = bc0;
bc0 = st[20]; st[20] = Rotl(t, 62); t = bc0;
bc0 = st[14]; st[14] = Rotl(t, 18); t = bc0;
bc0 = st[22]; st[22] = Rotl(t, 39); t = bc0;
bc0 = st[9]; st[9] = Rotl(t, 61); t = bc0;
bc0 = st[6]; st[6] = Rotl(t, 20); t = bc0;
st[1] = Rotl(t, 44);
// Chi Iota
bc0 = st[0]; bc1 = st[1]; bc2 = st[2]; bc3 = st[3]; bc4 = st[4];
st[0] = bc0 ^ (~bc1 & bc2) ^ RNDC[round];
st[1] = bc1 ^ (~bc2 & bc3);
st[2] = bc2 ^ (~bc3 & bc4);
st[3] = bc3 ^ (~bc4 & bc0);
st[4] = bc4 ^ (~bc0 & bc1);
bc0 = st[5]; bc1 = st[6]; bc2 = st[7]; bc3 = st[8]; bc4 = st[9];
st[5] = bc0 ^ (~bc1 & bc2);
st[6] = bc1 ^ (~bc2 & bc3);
st[7] = bc2 ^ (~bc3 & bc4);
st[8] = bc3 ^ (~bc4 & bc0);
st[9] = bc4 ^ (~bc0 & bc1);
bc0 = st[10]; bc1 = st[11]; bc2 = st[12]; bc3 = st[13]; bc4 = st[14];
st[10] = bc0 ^ (~bc1 & bc2);
st[11] = bc1 ^ (~bc2 & bc3);
st[12] = bc2 ^ (~bc3 & bc4);
st[13] = bc3 ^ (~bc4 & bc0);
st[14] = bc4 ^ (~bc0 & bc1);
bc0 = st[15]; bc1 = st[16]; bc2 = st[17]; bc3 = st[18]; bc4 = st[19];
st[15] = bc0 ^ (~bc1 & bc2);
st[16] = bc1 ^ (~bc2 & bc3);
st[17] = bc2 ^ (~bc3 & bc4);
st[18] = bc3 ^ (~bc4 & bc0);
st[19] = bc4 ^ (~bc0 & bc1);
bc0 = st[20]; bc1 = st[21]; bc2 = st[22]; bc3 = st[23]; bc4 = st[24];
st[20] = bc0 ^ (~bc1 & bc2);
st[21] = bc1 ^ (~bc2 & bc3);
st[22] = bc2 ^ (~bc3 & bc4);
st[23] = bc3 ^ (~bc4 & bc0);
st[24] = bc4 ^ (~bc0 & bc1);
}
}
SHA3_256& SHA3_256::Write(Span<const unsigned char> data)
{
if (m_bufsize && m_bufsize + data.size() >= sizeof(m_buffer)) {
// Fill the buffer and process it.
std::copy(data.begin(), data.begin() + sizeof(m_buffer) - m_bufsize, m_buffer + m_bufsize);
data = data.subspan(sizeof(m_buffer) - m_bufsize);
m_state[m_pos++] ^= ReadLE64(m_buffer);
m_bufsize = 0;
if (m_pos == RATE_BUFFERS) {
KeccakF(m_state);
m_pos = 0;
}
}
while (data.size() >= sizeof(m_buffer)) {
// Process chunks directly from the buffer.
m_state[m_pos++] ^= ReadLE64(data.data());
data = data.subspan(8);
if (m_pos == RATE_BUFFERS) {
KeccakF(m_state);
m_pos = 0;
}
}
if (data.size()) {
// Keep the remainder in the buffer.
std::copy(data.begin(), data.end(), m_buffer + m_bufsize);
m_bufsize += data.size();
}
return *this;
}
SHA3_256& SHA3_256::Finalize(Span<unsigned char> output)
{
assert(output.size() == OUTPUT_SIZE);
std::fill(m_buffer + m_bufsize, m_buffer + sizeof(m_buffer), 0);
m_buffer[m_bufsize] ^= 0x06;
m_state[m_pos] ^= ReadLE64(m_buffer);
m_state[RATE_BUFFERS - 1] ^= 0x8000000000000000;
KeccakF(m_state);
for (unsigned i = 0; i < 4; ++i) {
WriteLE64(output.data() + 8 * i, m_state[i]);
}
return *this;
}
SHA3_256& SHA3_256::Reset()
{
m_bufsize = 0;
m_pos = 0;
std::fill(std::begin(m_state), std::end(m_state), 0);
return *this;
}
| sstone/bitcoin | src/crypto/sha3.cpp | C++ | mit | 6,301 |
(function () {
var UI = baidu.editor.ui,
UIBase = UI.UIBase,
uiUtils = UI.uiUtils,
utils = baidu.editor.utils,
domUtils = baidu.editor.dom.domUtils;
var allMenus = [],//存储所有快捷菜单
timeID,
isSubMenuShow = false;//是否有子pop显示
var ShortCutMenu = UI.ShortCutMenu = function (options) {
this.initOptions (options);
this.initShortCutMenu ();
};
ShortCutMenu.postHide = hideAllMenu;
ShortCutMenu.prototype = {
isHidden : true ,
SPACE : 5 ,
initShortCutMenu : function () {
this.items = this.items || [];
this.initUIBase ();
this.initItems ();
this.initEvent ();
allMenus.push (this);
} ,
initEvent : function () {
var me = this,
doc = me.editor.document;
domUtils.on (doc , "mousemove" , function (e) {
if (me.isHidden === false) {
//有pop显示就不隐藏快捷菜单
if (me.getSubMenuMark () || me.eventType == "contextmenu") return;
var flag = true,
el = me.getDom (),
wt = el.offsetWidth,
ht = el.offsetHeight,
distanceX = wt / 2 + me.SPACE,//距离中心X标准
distanceY = ht / 2,//距离中心Y标准
x = Math.abs (e.screenX - me.left),//离中心距离横坐标
y = Math.abs (e.screenY - me.top);//离中心距离纵坐标
clearTimeout (timeID);
timeID = setTimeout (function () {
if (y > 0 && y < distanceY) {
me.setOpacity (el , "1");
} else if (y > distanceY && y < distanceY + 70) {
me.setOpacity (el , "0.5");
flag = false;
} else if (y > distanceY + 70 && y < distanceY + 140) {
me.hide ();
}
if (flag && x > 0 && x < distanceX) {
me.setOpacity (el , "1")
} else if (x > distanceX && x < distanceX + 70) {
me.setOpacity (el , "0.5")
} else if (x > distanceX + 70 && x < distanceX + 140) {
me.hide ();
}
});
}
});
//ie\ff下 mouseout不准
if (browser.chrome) {
domUtils.on (doc , "mouseout" , function (e) {
var relatedTgt = e.relatedTarget || e.toElement;
if (relatedTgt == null || relatedTgt.tagName == "HTML") {
me.hide ();
}
});
}
me.editor.addListener ("afterhidepop" , function () {
if (!me.isHidden) {
isSubMenuShow = true;
}
});
} ,
initItems : function () {
if (utils.isArray (this.items)) {
for (var i = 0, len = this.items.length ; i < len ; i++) {
var item = this.items[i].toLowerCase ();
if (UI[item]) {
this.items[i] = new UI[item] (this.editor);
this.items[i].className += " edui-shortcutsubmenu ";
}
}
}
} ,
setOpacity : function (el , value) {
if (browser.ie && browser.version < 9) {
el.style.filter = "alpha(opacity = " + parseFloat (value) * 100 + ");"
} else {
el.style.opacity = value;
}
} ,
getSubMenuMark : function () {
isSubMenuShow = false;
var layerEle = uiUtils.getFixedLayer ();
var list = domUtils.getElementsByTagName (layerEle , "div" , function (node) {
return domUtils.hasClass (node , "edui-shortcutsubmenu edui-popup")
});
for (var i = 0, node ; node = list[i++] ;) {
if (node.style.display != "none") {
isSubMenuShow = true;
}
}
return isSubMenuShow;
} ,
show : function (e , hasContextmenu) {
var me = this,
offset = {},
el = this.getDom (),
fixedlayer = uiUtils.getFixedLayer ();
function setPos (offset) {
if (offset.left < 0) {
offset.left = 0;
}
if (offset.top < 0) {
offset.top = 0;
}
el.style.cssText = "position:absolute;left:" + offset.left + "px;top:" + offset.top + "px;";
}
function setPosByCxtMenu (menu) {
if (!menu.tagName) {
menu = menu.getDom ();
}
offset.left = parseInt (menu.style.left);
offset.top = parseInt (menu.style.top);
offset.top -= el.offsetHeight + 15;
setPos (offset);
}
me.eventType = e.type;
el.style.cssText = "display:block;left:-9999px";
if (e.type == "contextmenu" && hasContextmenu) {
var menu = domUtils.getElementsByTagName (fixedlayer , "div" , "edui-contextmenu")[0];
if (menu) {
setPosByCxtMenu (menu)
} else {
me.editor.addListener ("aftershowcontextmenu" , function (type , menu) {
setPosByCxtMenu (menu);
});
}
} else {
offset = uiUtils.getViewportOffsetByEvent (e);
offset.top -= el.offsetHeight + me.SPACE;
offset.left += me.SPACE + 20;
setPos (offset);
me.setOpacity (el , 0.2);
}
me.isHidden = false;
me.left = e.screenX + el.offsetWidth / 2 - me.SPACE;
me.top = e.screenY - (el.offsetHeight / 2) - me.SPACE;
if (me.editor) {
el.style.zIndex = me.editor.container.style.zIndex * 1 + 10;
fixedlayer.style.zIndex = el.style.zIndex - 1;
}
} ,
hide : function () {
if (this.getDom ()) {
this.getDom ().style.display = "none";
}
this.isHidden = true;
} ,
postRender : function () {
if (utils.isArray (this.items)) {
for (var i = 0, item ; item = this.items[i++] ;) {
item.postRender ();
}
}
} ,
getHtmlTpl : function () {
var buff;
if (utils.isArray (this.items)) {
buff = [];
for (var i = 0 ; i < this.items.length ; i++) {
buff[i] = this.items[i].renderHtml ();
}
buff = buff.join ("");
} else {
buff = this.items;
}
return '<div id="##" class="%% edui-toolbar" data-src="shortcutmenu" onmousedown="return false;" onselectstart="return false;" >' +
buff +
'</div>';
}
};
utils.inherits (ShortCutMenu , UIBase);
function hideAllMenu (e) {
var tgt = e.target || e.srcElement,
cur = domUtils.findParent (tgt , function (node) {
return domUtils.hasClass (node , "edui-shortcutmenu") || domUtils.hasClass (node , "edui-popup");
} , true);
if (!cur) {
for (var i = 0, menu ; menu = allMenus[i++] ;) {
menu.hide ()
}
}
}
domUtils.on (document , 'mousedown' , function (e) {
hideAllMenu (e);
});
domUtils.on (window , 'scroll' , function (e) {
hideAllMenu (e);
});
}) ();
| asdzhizhuo/ueditor | _src/ui/shortcutmenu.js | JavaScript | mit | 8,191 |
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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 GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.tools;
import java.io.IOException;
import java.net.URI;
import java.util.Iterator;
import java.util.Set;
import javax.tools.JavaFileObject.Kind;
/**
* Forwards calls to a given file manager. Subclasses of this class
* might override some of these methods and might also provide
* additional fields and methods.
*
* @param <M> the kind of file manager forwarded to by this object
* @author Peter von der Ahé
* @since 1.6
*/
public class ForwardingJavaFileManager<M extends JavaFileManager> implements JavaFileManager {
/**
* The file manager which all methods are delegated to.
*/
protected final M fileManager;
/**
* Creates a new instance of ForwardingJavaFileManager.
* @param fileManager delegate to this file manager
*/
protected ForwardingJavaFileManager(M fileManager) {
fileManager.getClass(); // null check
this.fileManager = fileManager;
}
/**
* @throws SecurityException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
public ClassLoader getClassLoader(Location location) {
return fileManager.getClassLoader(location);
}
/**
* @throws IOException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
public Iterable<JavaFileObject> list(Location location,
String packageName,
Set<Kind> kinds,
boolean recurse)
throws IOException
{
return fileManager.list(location, packageName, kinds, recurse);
}
/**
* @throws IllegalStateException {@inheritDoc}
*/
public String inferBinaryName(Location location, JavaFileObject file) {
return fileManager.inferBinaryName(location, file);
}
/**
* @throws IllegalArgumentException {@inheritDoc}
*/
public boolean isSameFile(FileObject a, FileObject b) {
return fileManager.isSameFile(a, b);
}
/**
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
public boolean handleOption(String current, Iterator<String> remaining) {
return fileManager.handleOption(current, remaining);
}
public boolean hasLocation(Location location) {
return fileManager.hasLocation(location);
}
public int isSupportedOption(String option) {
return fileManager.isSupportedOption(option);
}
/**
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
public JavaFileObject getJavaFileForInput(Location location,
String className,
Kind kind)
throws IOException
{
return fileManager.getJavaFileForInput(location, className, kind);
}
/**
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
public JavaFileObject getJavaFileForOutput(Location location,
String className,
Kind kind,
FileObject sibling)
throws IOException
{
return fileManager.getJavaFileForOutput(location, className, kind, sibling);
}
/**
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
public FileObject getFileForInput(Location location,
String packageName,
String relativeName)
throws IOException
{
return fileManager.getFileForInput(location, packageName, relativeName);
}
/**
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*/
public FileObject getFileForOutput(Location location,
String packageName,
String relativeName,
FileObject sibling)
throws IOException
{
return fileManager.getFileForOutput(location, packageName, relativeName, sibling);
}
public void flush() throws IOException {
fileManager.flush();
}
public void close() throws IOException {
fileManager.close();
}
}
| rokn/Count_Words_2015 | testing/openjdk/langtools/src/share/classes/javax/tools/ForwardingJavaFileManager.java | Java | mit | 5,719 |
// angular-formly version 3.0.5 built with ♥ by Astrism <astrisms@gmail.com>, Kent C. Dodds <kent@doddsfamily.us> (ó ì_í)=óò=(ì_í ò)
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("angular")):"function"==typeof define&&define.amd?define(["angular"],t):"object"==typeof exports?exports.ngFormly=t(require("angular")):e.ngFormly=t(e.angular)}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n="formly",o=r(1),i=o.module(n,[]);r(11)(i),r(14)(i),r(6)(i),e.exports=n},function(e,t,r){"use strict";var n=r(15);n.version||(n=window.angular),e.exports=n},function(e){"use strict";e.exports=function(e){e.directive("formlyCustomValidation",["formlyUtil","$q",function(e,t){function r(e){return e&&angular.isFunction(e.then)}return{require:"ngModel",link:function(n,o,i,a){var l=n.$eval(i.formlyCustomValidation);if(l){var s=a.hasOwnProperty("$validators");angular.forEach(l,function(o,i){if(s){var l=!angular.isString(o),f=l?"$asyncValidators":"$validators";a[f][i]=function(i,a){var s=e.formlyEval(n,o,i,a);return l?r(s)?s:s?t.when(s):t.reject(s):s}}else a.$parsers.unshift(function(t){var r=e.formlyEval(n,o,a.$modelValue,t);return a.$setValidity(i,r),t})})}}}}])}},function(e,t,r){"use strict";var n=r(1);e.exports=function(e){function t(e,t,o,i,a,l,s,f){function u(e){var t=n.element("<a></a>");return t.append(e).html()}function p(e){var t=a.getType(e.type,!0,e),r=e.template||t&&t.template,n=e.templateUrl||t&&t.templateUrl;if(!r&&!n)throw s.getFieldError("template-type-type-not-supported","template type '"+e.type+"' not supported. On element:",e);return c(r||n,!r)}function c(r,n){if(n){var o={cache:i};return e.get(r,o).then(function(e){return e.data})["catch"](function(e){f("problem-loading-template-for-templateurl","Problem loading template for "+r,e)})}return t.when(r)}function m(e){var r=y(e);return function(e){if(r){if(n.isArray(r)){r.forEach(s.checkWrapper);var o=r.map(function(e){return c(e.template||e.templateUrl,!e.template)});return t.all(o).then(function(t){t.forEach(function(e,t){s.checkWrapperTemplate(e,r[t])}),t.reverse();var n=t.shift();return t.forEach(function(e){n=d(n,e)}),d(n,e)})}s.checkWrapper(r);var i=r.template||r.templateUrl;return c(i,!r.template).then(function(t){return s.checkWrapperTemplate(t,r),d(t,e)})}return t.when(e)}}function d(e,t){var r=n.element("<a></a>");r.append(e);var o=r.find("formly-transclude");return o.replaceWith(t),r.html()}function y(e){var t=e.wrapper;if(null===t)return"";var o=t;t?n.isString(t)?o=a.getWrapper(t):n.isArray(t)&&(o=t.map(function(e){return a.getWrapper(e)})):o=a.getWrapperByType(e.type),o=r(o);var i=a.getWrapper(),l=a.getType(e.type,!0,e);if(l&&l.wrapper){var s=r(l.wrapper).map(a.getWrapper);o=o.concat(s)}return i&&o.push(i),o.length>1?o:1===o.length?o[0]:void 0}function h(e){function t(e){var t=0;return t+=n.isDefined(e.template)?1:0,t+=n.isDefined(e.type)?1:0,t+=n.isDefined(e.templateUrl)?1:0}var r=t(e);if(0===r)throw s.getFieldError("you-must-provide-one-of-type-template-or-templateurl-for-a-field","You must provide one of type, template, or templateUrl for a field",e);if(r>1)throw s.getFieldError("you-must-only-provide-a-type-template-or-templateurl-for-a-field","You must only provide a type, template, or templateUrl for a field",e);var o=["type","template","templateUrl","key","model","expressionProperties","data","templateOptions","wrapper","modelOptions","watcher","validators","noFormControl","hide","ngModelAttrs","optionsTypes","link","controller","formControl","value","runExpressions"],i=Object.keys(e).filter(function(e){return-1===o.indexOf(e)});if(i.length)throw s.getFieldError("you-have-specified-field-properties-that-are-not-allowed","You have specified field properties that are not allowed: "+JSON.stringify(i.join(", ")),e)}return{restrict:"AE",transclude:!0,scope:{options:"=",model:"=",formId:"=?",index:"=?",fields:"=?",form:"=?"},controller:["$scope","$interval","$parse","$controller",function(e,o,i,s){function u(){var r=e.options,o=p();n.forEach(r.expressionProperties,function(n,a){var s=i(a).assign,f=t.when(l.formlyEval(e,n,o));f.then(function(e){s(r,e)})})}function p(t){return e.model&&e.options.key?(n.isDefined(t)&&(e.model[e.options.key]=t),e.model[e.options.key]):void 0}function c(e){l.reverseDeepMerge(e,{data:{},templateOptions:{}})}function m(e,t){t&&d(e,t.defaultOptions);var o=r(e.optionsTypes).reverse();n.forEach(o,function(t){d(e,a.getType(t,!0,e).defaultOptions)})}function d(e,t){t&&(n.isFunction(t)&&(t=t(e)),l.reverseDeepMerge(e,t))}function y(e,t){n.extend(e,{key:e.key||t||0,value:p,runExpressions:u})}function v(e,t,r){function o(){i(),r.cancel(u)}if(!t.noFormControl){var i,a=2e3,l=5,s=0,u=r(function(){if(s++,!n.isDefined(t.key))return o();var r=e.form&&e.form[e.id];r?(t.formControl=r,o()):l*s>a&&(f("couldnt-set-the-formcontrol-after-timems","Couldn't set the formControl after "+a+"ms",e),o())},l);i=e.$on("$destroy",o)}}function g(e,t){t.model&&e.$watch("options.model",u,!0)}function w(e){var t=void 0===arguments[1]?{}:arguments[1],r=void 0===arguments[2]?{}:arguments[2];n.forEach([r.controller,t.controller],function(t){t&&s(t,{$scope:e})})}var x=e.options,O=x.type&&a.getType(x.type);c(x),m(x,O),h(x),e.id=l.getFieldId(e.formId,x,e.index),y(x,e.index),u(),v(e,x,o),g(e,x),w(e,x,O)}],link:function(e,r){function i(t){r.html(u(t)),o(r.contents())(e),s&&s.link&&s.link.apply(d,c),e.options.link&&e.options.link.apply(d,c)}function l(r){return function(o){var i=t.when(o);return n.forEach(r,function(r){i=i.then(function(o){return t.when(r(o,e.options,e)).then(function(e){return n.isString(e)?e:u(e)})})}),i}}var s=e.options.type&&a.getType(e.options.type),c=arguments,d=this;p(e.options).then(l(a.templateManipulators.preWrapper)).then(m(e.options)).then(l(a.templateManipulators.postWrapper)).then(i)["catch"](function(t){f("there-was-a-problem-setting-the-template-for-this-field","There was a problem setting the template for this field ",e.options,t)})}}}function r(e){return e&&!n.isArray(e)?e=[e]:e||(e=[]),e}e.directive("formlyField",t),t.tests=null,t.$inject=["$http","$q","$compile","$templateCache","formlyConfig","formlyUtil","formlyUsability","formlyWarn"]}},function(e){"use strict";e.exports=function(e){e.directive("formlyFocus",["$timeout","$document",function(e,t){return{link:function(r,n,o){var i=null,a=n[0],l=t[0];o.$observe("formlyFocus",function(t){"true"===t?e(function(){i=l.activeElement,a.focus()},~~o.focusWait):"false"===t&&l.activeElement===a&&(a.blur(),o.hasOwnProperty("refocus")&&i&&i.focus())})}}}])}},function(e,t,r){"use strict";var n=function(e){return Array.isArray(e)?e:Array.from(e)},o=Array.prototype.slice,i=r(1);e.exports=function(e){function t(e){var t=1;return{restrict:"E",template:function(e,t){var r=t.hasOwnProperty("noNgForm")?"div":"ng-form";return"\n <"+r+' class="formly"\n name="form"\n role="form">\n <div formly-field\n ng-repeat="field in fields track by $index"\n ng-if="!field.hide"\n class="formly-field {{field.type ? \'formly-field-\' + field.type : \'\'}}"\n options="field"\n model="field.model || model"\n fields="fields"\n form="form"\n form-id="formId"\n index="$index">\n </div>\n <div ng-transclude></div>\n </'+r+">\n "},replace:!0,transclude:!0,scope:{fields:"=",model:"=?",form:"=?"},controller:["$scope",function(r){function a(e,t){e.key=e.key||t||0}function l(t,n){if(i.isDefined(t.watcher)){var o=t.watcher;i.isArray(o)||(o=[o]),i.forEach(o,function(o){if(!i.isDefined(o.listener))throw e.getFieldError("all-field-watchers-must-have-a-listener","All field watchers must have a listener",t);var a=s(o,t,n),l=f(o,t,n),u=o.type||"$watch";o.stopWatching=r[u](a,l,o.watchDeep)})}}function s(e,t,r){var a=e.expression||"model['"+t.key+"']";if(i.isFunction(a)){var l=a;a=function(){var t=u.apply(void 0,[e,r].concat(o.call(arguments)));return l.apply(void 0,n(t))},a.displayName="Formly Watch Expression for field for "+t.key}return a}function f(e,t,r){var a=e.listener;if(i.isFunction(a)){var l=a;a=function(){var t=u.apply(void 0,[e,r].concat(o.call(arguments)));return l.apply(void 0,n(t))},a.displayName="Formly Watch Listener for field for "+t.key}return a}function u(e,t){for(var o=arguments.length,i=Array(o>2?o-2:0),a=2;o>a;a++)i[a-2]=arguments[a];return[r.fields[t]].concat(n(i),[e.stopWatching])}r.formId="formly_"+t++,i.forEach(r.fields,a),i.forEach(r.fields,l),r.$watch("model",function(e){i.forEach(r.fields,function(t){t.runExpressions&&t.runExpressions(e)})},!0)}],link:function(t,r,n){if(n.hasOwnProperty("result"))throw e.getFormlyError('The "result" attribute on a formly-form is no longer valid. Use "model" instead');if("form"!==n.name)throw e.getFormlyError('The "name" attribute on a formly-form is no longer valid. Use "form" instead');if(!n.hasOwnProperty("model")||!t.model)throw e.getFormlyError('The "model" attribute is required on a formly-form.')}}}e.directive("formlyForm",t),t.tests=null,t.$inject=["formlyUsability"]}},function(e,t,r){"use strict";e.exports=function(e){r(2)(e),r(3)(e),r(5)(e),r(4)(e)}},function(e,t,r){"use strict";var n=r(1);e.exports=function(e){function t(e){function t(e){if(n.isArray(e))n.forEach(e,t);else{if(!n.isObject(e))throw E("You must provide an object or array for setType. You provided: "+JSON.stringify(arguments));o(e),g[e.name]=e}}function r(e,t,r){if(!e)return void 0;var n=g[e];if(n||t!==!0)return n;throw E('There is no type by the name of "'+e+'": '+JSON.stringify(r))}function o(e){if(!e.name)throw E("You must provide a name for setType. You provided: "+JSON.stringify(arguments));if(!(e.defaultOptions||e.template||e.templateUrl))throw E("You must provide defaultOptions OR a template OR templateUrl for setType. You provided none of these: "+JSON.stringify(arguments));if(e.template&&e.templateUrl)throw E("You must provide at most a template OR templateUrl for setType. You provided both: "+JSON.stringify(arguments));e.overwriteOk?delete e.overwriteOk:u(e.name,g,e,"types")}function i(e,t){return n.isArray(e)?e.map(function(e){return i(e)}):n.isObject(e)?(e.types=a(e),e.name=l(e,t),s(e),w[e.name]=e,e):n.isString(e)?i({template:e,name:t}):void 0}function a(e){return n.isString(e.types)?[e.types]:n.isDefined(e.types)?e.types:[]}function l(e,t){return e.name||t||e.types.join(" ")||x}function s(t){e.checkWrapper(t),t.template&&e.checkWrapperTemplate(t.template,t),t.overwriteOk?delete t.overwriteOk:u(t.name,w,t,"templateWrappers"),f(t)}function f(e){var t=!n.isArray(e.types)||!e.types.every(n.isString);if(t)throw E("Attempted to create a template wrapper with types that is not a string or an array of strings")}function u(e,t,r,n){t.hasOwnProperty(e)&&h(["Attempting to overwrite "+e+" on "+n+" which is currently",""+JSON.stringify(t[e])+" with "+JSON.stringify(r),'To supress this warning, specify the property "overwriteOk: true"'].join(" "))}function p(e){return w[e||x]}function c(e){var t=[];for(var r in w)w.hasOwnProperty(r)&&w[r].types&&-1!==w[r].types.indexOf(e)&&t.push(w[r]);return 1===t.length?t[0]:t.length>1?t:void 0}function m(e){var t=w[e];return delete w[e],t}function d(e){var t=c(e);if(t)return n.isArray(t)?(t.forEach(function(e){return m(e.name)}),t):m(t.name)}function y(e,t,r){function o(){var e=n.extend(f.ngModelBoundAttributes||{},{"ng-disabled":"disabled","ng-required":"required","ng-pattern":"pattern","ng-maxlength":"maxlength","ng-minlength":"minlength"}),r=n.extend(f.ngModelInvokedAttributes||{},{"ng-change":"onChange","ng-keydown":"onKeydown","ng-keyup":"onKeyup","ng-keypress":"onKeypress","ng-click":"onClick","ng-focus":"onFocus","ng-blur":"onBlur"}),o=n.extend(f.ngModelAttributes||{},{"formly-focus":"focus",placeholder:"placeholder",min:"min",max:"max",tabindex:"tabindex",type:"type"});a(u,e,t),a(u,o,t,"{{","}}"),a(u,r,t,function(e){return n.isString(e)?"$eval(":""},function(e){return n.isString(e)?")":"(model[options.key], options, this, $event)"})}function i(e){e=e||{},n.forEach(e.bound,function(e,t){l(u,t,"options.ngModelAttrs.bound['"+t+"']")}),n.forEach(e.unbound,function(e,t){l(u,t,r.$eval(e))})}function a(e,t,r){var o=void 0===arguments[3]?"":arguments[3],i=void 0===arguments[4]?"":arguments[4],a=r.templateOptions,s=r.expressionProperties;(a||s)&&(a=a||{},s=s||{},n.forEach(t,function(t,r){if(n.isDefined(a[t])||n.isDefined(s["templateOptions."+t])){var f=n.isFunction(o)?o(t):o,u=n.isFunction(i)?i(t):i;l(e,""+r,""+f+"options.templateOptions['"+t+"']"+u)}}))}function l(e,t,r){e.attr(t)||e.attr(t,r)}var s=n.element("<a></a>"),f=t.data;if(f.noTouchy)return e;s.append(e);var u=n.element(s[0].querySelectorAll("[ng-model]"));return u&&u.length?(i(t.ngModelAttrs),l(u,"id",r.id),l(u,"name",r.id),n.isDefined(t.validators)&&l(u,"formly-custom-validation","options.validators"),n.isDefined(t.modelOptions)&&(l(u,"ng-model-options","options.modelOptions"),t.modelOptions.getterSetter&&u.attr("ng-model","options.value")),o(),s.html()):e}function h(){O.disableWarnings||console.warn.apply(console,arguments)}var v=this,g={},w={},x="default",O=this,E=e.getFormlyError;n.extend(this,{setType:t,getType:r,setWrapper:i,getWrapper:p,getWrapperByType:c,removeWrapperByName:m,removeWrappersForType:d,disableWarnings:!1,templateManipulators:{preWrapper:[y],postWrapper:[]},$get:function(){return v}})}e.provider("formlyConfig",t),t.tests=null,t.$inject=["formlyUsabilityProvider"]}},function(e){"use strict";e.exports=function(e){e.constant("formlyErrorAndWarningsUrlPrefix","https://github.com/formly-js/angular-formly/wiki/Errors-and-Warnings#")}},function(e,t,r){"use strict";var n=r(1);e.exports=function(e){e.provider("formlyUsability",function(){function e(e,t,o){return arguments.length<3&&(o=t,t=e,e=null),new Error(r(e,t)+(" Field definition: "+n.toJson(o)))}function t(e,t){return t||(t=e,e=null),new Error(r(e,t))}function r(e,t){var r="";return null!==e&&(r=""+l+e),"Formly Error: "+t+". "+r}function o(e){if(e.template&&e.templateUrl)throw t("Template wrappers can only have a templateUrl or a template. This one provided both: "+JSON.stringify(e));if(!e.template&&!e.templateUrl)throw t("Template wrappers must have one of a templateUrl or a template. This one provided neither: "+JSON.stringify(e))}function i(e,r){var n="<formly-transclude></formly-transclude>";if(-1===e.indexOf(n))throw t('Template wrapper templates must use "'+n+'" somewhere in them. This one does not have "<formly-transclude></formly-transclude>" in it: '+e+"\nAdditional information: "+JSON.stringify(r))}var a=this,l="https://github.com/formly-js/angular-formly/wiki/Errors-and-Warnings#";n.extend(this,{getFormlyError:t,getFieldError:e,checkWrapper:o,checkWrapperTemplate:i,$get:function(){return a}})})}},function(e){"use strict";e.exports=function(e){e.constant("formlyVersion","3.0.5")}},function(e,t,r){"use strict";e.exports=function(e){r(9)(e),r(7)(e),r(10)(e),r(8)(e)}},function(e,t,r){"use strict";var n=Array.prototype.slice,o=r(1);e.exports=function(e){e.factory("formlyUtil",function(){function e(e,t,r,n){return o.isFunction(t)?t(n,r,e):e.$eval(t,{$viewValue:n,$modelValue:r})}function t(e,t,r){var n=t.type;return!n&&t.template?n="template":!n&&t.templateUrl&&(n="templateUrl"),[e,n,t.key,r].join("_")}function r(){var e=arguments[0],t={};return o.forEach([].concat(n.call(arguments)).reverse(),function(e){e&&o.forEach(e,function(e,n){if("object"!=typeof e||null===e||Object.getPrototypeOf(e)!==i&&Object.getPrototypeOf(e)!==a)o.isDefined(e)&&(t[n]=e);else{var l=t[n];!l&&o.isArray(e)?l=[]:l||(l={}),t[n]=r(l,e)}})}),o.forEach(e,function(t,r){delete e[r]}),o.forEach(t,function(t,r){e[r]=t}),t=e}var i=Object.getPrototypeOf({}),a=Object.getPrototypeOf([]);return{formlyEval:e,getFieldId:t,reverseDeepMerge:r}})}},function(e){"use strict";var t=function(e){return Array.isArray(e)?e:Array.from(e)};e.exports=function(e){e.factory("formlyWarn",["formlyConfig","formlyErrorAndWarningsUrlPrefix","$log",function(e,r,n){return function(){if(!e.disableWarnings){var o=Array.prototype.slice.call(arguments),i=o.shift();o.unshift("Formly Warning:"),o.push(""+r+i),n.warn.apply(n,t(o))}}}])}},function(e,t,r){"use strict";e.exports=function(e){r(12)(e),r(13)(e)}},function(t){t.exports=e}])});
//# sourceMappingURL=formly.min.js.map | gaearon/cdnjs | ajax/libs/angular-formly/3.0.5/formly.min.js | JavaScript | mit | 16,587 |
YUI.add('loader-base', function (Y, NAME) {
/**
* The YUI loader core
* @module loader
* @submodule loader-base
*/
(function() {
var VERSION = Y.version,
BUILD = '/build/',
ROOT = VERSION + '/',
CDN_BASE = Y.Env.base,
GALLERY_VERSION = 'gallery-2014.07.31-18-26',
TNT = '2in3',
TNT_VERSION = '4',
YUI2_VERSION = '2.9.0',
COMBO_BASE = CDN_BASE + 'combo?',
META = {
version: VERSION,
root: ROOT,
base: Y.Env.base,
comboBase: COMBO_BASE,
skin: {
defaultSkin: 'sam',
base: 'assets/skins/',
path: 'skin.css',
after: [
'cssreset',
'cssfonts',
'cssgrids',
'cssbase',
'cssreset-context',
'cssfonts-context'
]
},
groups: {},
patterns: {}
},
groups = META.groups,
yui2Update = function(tnt, yui2, config) {
var root = TNT + '.' +
(tnt || TNT_VERSION) + '/' +
(yui2 || YUI2_VERSION) + BUILD,
base = (config && config.base) ? config.base : CDN_BASE,
combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
groups.yui2.base = base + root;
groups.yui2.root = root;
groups.yui2.comboBase = combo;
},
galleryUpdate = function(tag, config) {
var root = (tag || GALLERY_VERSION) + BUILD,
base = (config && config.base) ? config.base : CDN_BASE,
combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;
groups.gallery.base = base + root;
groups.gallery.root = root;
groups.gallery.comboBase = combo;
};
groups[VERSION] = {};
groups.gallery = {
ext: false,
combine: true,
comboBase: COMBO_BASE,
update: galleryUpdate,
patterns: {
'gallery-': {},
'lang/gallery-': {},
'gallerycss-': {
type: 'css'
}
}
};
groups.yui2 = {
combine: true,
ext: false,
comboBase: COMBO_BASE,
update: yui2Update,
patterns: {
'yui2-': {
configFn: function(me) {
if (/-skin|reset|fonts|grids|base/.test(me.name)) {
me.type = 'css';
me.path = me.path.replace(/\.js/, '.css');
// this makes skins in builds earlier than
// 2.6.0 work as long as combine is false
me.path = me.path.replace(/\/yui2-skin/,
'/assets/skins/sam/yui2-skin');
}
}
}
}
};
galleryUpdate();
yui2Update();
if (YUI.Env[VERSION]) {
Y.mix(META, YUI.Env[VERSION], false, [
'modules',
'groups',
'skin'
], 0, true);
}
YUI.Env[VERSION] = META;
}());
/*jslint forin: true, maxlen: 350 */
/**
* Loader dynamically loads script and css files. It includes the dependency
* information for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It can also load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files.
*
* @module loader
* @main loader
* @submodule loader-base
*/
var NOT_FOUND = {},
NO_REQUIREMENTS = [],
MAX_URL_LENGTH = 1024,
GLOBAL_ENV = YUI.Env,
GLOBAL_LOADED = GLOBAL_ENV._loaded,
CSS = 'css',
JS = 'js',
INTL = 'intl',
DEFAULT_SKIN = 'sam',
VERSION = Y.version,
ROOT_LANG = '',
YObject = Y.Object,
oeach = YObject.each,
yArray = Y.Array,
_queue = GLOBAL_ENV._loaderQueue,
META = GLOBAL_ENV[VERSION],
SKIN_PREFIX = 'skin-',
L = Y.Lang,
ON_PAGE = GLOBAL_ENV.mods,
modulekey,
_path = function(dir, file, type, nomin) {
var path = dir + '/' + file;
if (!nomin) {
path += '-min';
}
path += '.' + (type || CSS);
return path;
};
if (!YUI.Env._cssLoaded) {
YUI.Env._cssLoaded = {};
}
/**
* The component metadata is stored in Y.Env.meta.
* Part of the loader module.
* @property meta
* @for YUI
*/
Y.Env.meta = META;
/**
* Loader dynamically loads script and css files. It includes the dependency
* info for the version of the library in use, and will automatically pull in
* dependencies for the modules requested. It can load the
* files from the Yahoo! CDN, and it can utilize the combo service provided on
* this network to reduce the number of http connections required to download
* YUI files. You can also specify an external, custom combo service to host
* your modules as well.
var Y = YUI();
var loader = new Y.Loader({
filter: 'debug',
base: '../../',
root: 'build/',
combine: true,
require: ['node', 'dd', 'console']
});
var out = loader.resolve(true);
* If the Loader needs to be patched before it is used for the first time, it
* should be done through the `doBeforeLoader` hook. Simply make the patch
* available via configuration before YUI is loaded:
YUI_config = YUI_config || {};
YUI_config.doBeforeLoader = function (config) {
var resolve = this.context.Loader.prototype.resolve;
this.context.Loader.prototype.resolve = function () {
// do something here
return resolve.apply(this, arguments);
};
};
* @constructor
* @class Loader
* @param {Object} config an optional set of configuration options.
* @param {String} config.base The base dir which to fetch this module from
* @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`
* @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`
* @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>
* @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config.
* @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies
* @param {Boolean} [config.async=true] Fetch files in async
* @param {Array} config.ignore: A list of modules that should never be dynamically loaded
* @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page
* @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes
* @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes
* @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes
* @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout
* @param {Object} config.context Execution context for all callbacks
* @param {Function} config.onSuccess Callback for the 'success' event
* @param {Function} config.onFailure Callback for the 'failure' event
* @param {Function} config.onTimeout Callback for the 'timeout' event
* @param {Function} config.onProgress Callback executed each time a script or css file is loaded
* @param {Object} config.modules A list of module definitions. See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata
* @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`.
* @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.
* @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward.
* @param {Function} config.doBeforeLoader An optional hook that allows for the patching of the loader instance. The `Y` instance is available as `this.context` and the only argument to the function is the Loader configuration object.
*/
Y.Loader = function(o) {
var self = this;
//Catch no config passed.
o = o || {};
modulekey = META.md5;
/**
* Internal callback to handle multiple internal insert() calls
* so that css is inserted prior to js
* @property _internalCallback
* @private
*/
// self._internalCallback = null;
/**
* Callback that will be executed when the loader is finished
* with an insert
* @method onSuccess
* @type function
*/
// self.onSuccess = null;
/**
* Callback that will be executed if there is a failure
* @method onFailure
* @type function
*/
// self.onFailure = null;
/**
* Callback executed each time a script or css file is loaded
* @method onProgress
* @type function
*/
// self.onProgress = null;
/**
* Callback that will be executed if a timeout occurs
* @method onTimeout
* @type function
*/
// self.onTimeout = null;
/**
* The execution context for all callbacks
* @property context
* @default {YUI} the YUI instance
*/
self.context = Y;
// Hook that allows the patching of loader
if (o.doBeforeLoader) {
o.doBeforeLoader.apply(self, arguments);
}
/**
* Data that is passed to all callbacks
* @property data
*/
// self.data = null;
/**
* Node reference or id where new nodes should be inserted before
* @property insertBefore
* @type string|HTMLElement
*/
// self.insertBefore = null;
/**
* The charset attribute for inserted nodes
* @property charset
* @type string
* @deprecated , use cssAttributes or jsAttributes.
*/
// self.charset = null;
/**
* An object literal containing attributes to add to link nodes
* @property cssAttributes
* @type object
*/
// self.cssAttributes = null;
/**
* An object literal containing attributes to add to script nodes
* @property jsAttributes
* @type object
*/
// self.jsAttributes = null;
/**
* The base directory.
* @property base
* @type string
* @default http://yui.yahooapis.com/[YUI VERSION]/build/
*/
self.base = Y.Env.meta.base + Y.Env.meta.root;
/**
* Base path for the combo service
* @property comboBase
* @type string
* @default http://yui.yahooapis.com/combo?
*/
self.comboBase = Y.Env.meta.comboBase;
/*
* Base path for language packs.
*/
// self.langBase = Y.Env.meta.langBase;
// self.lang = "";
/**
* If configured, the loader will attempt to use the combo
* service for YUI resources and configured external resources.
* @property combine
* @type boolean
* @default true if a base dir isn't in the config
*/
self.combine = o.base &&
(o.base.indexOf(self.comboBase.substr(0, 20)) > -1);
/**
* The default seperator to use between files in a combo URL
* @property comboSep
* @type {String}
* @default Ampersand
*/
self.comboSep = '&';
/**
* Max url length for combo urls. The default is 1024. This is the URL
* limit for the Yahoo! hosted combo servers. If consuming
* a different combo service that has a different URL limit
* it is possible to override this default by supplying
* the maxURLLength config option. The config option will
* only take effect if lower than the default.
*
* @property maxURLLength
* @type int
*/
self.maxURLLength = MAX_URL_LENGTH;
/**
* Ignore modules registered on the YUI global
* @property ignoreRegistered
* @default false
*/
self.ignoreRegistered = o.ignoreRegistered;
/**
* Root path to prepend to module path for the combo
* service
* @property root
* @type string
* @default [YUI VERSION]/build/
*/
self.root = Y.Env.meta.root;
/**
* Timeout value in milliseconds. If set, self value will be used by
* the get utility. the timeout event will fire if
* a timeout occurs.
* @property timeout
* @type int
*/
self.timeout = 0;
/**
* A list of modules that should not be loaded, even if
* they turn up in the dependency tree
* @property ignore
* @type string[]
*/
// self.ignore = null;
/**
* A list of modules that should always be loaded, even
* if they have already been inserted into the page.
* @property force
* @type string[]
*/
// self.force = null;
self.forceMap = {};
/**
* Should we allow rollups
* @property allowRollup
* @type boolean
* @default false
*/
self.allowRollup = false;
/**
* A filter to apply to result urls. This filter will modify the default
* path for all modules. The default path for the YUI library is the
* minified version of the files (e.g., event-min.js). The filter property
* can be a predefined filter or a custom filter. The valid predefined
* filters are:
* <dl>
* <dt>DEBUG</dt>
* <dd>Selects the debug versions of the library (e.g., event-debug.js).
* This option will automatically include the Logger widget</dd>
* <dt>RAW</dt>
* <dd>Selects the non-minified version of the library (e.g., event.js).
* </dd>
* </dl>
* You can also define a custom filter, which must be an object literal
* containing a search expression and a replace string:
*
* myFilter: {
* 'searchExp': "-min\\.js",
* 'replaceStr': "-debug.js"
* }
*
* @property filter
* @type string| {searchExp: string, replaceStr: string}
*/
// self.filter = null;
/**
* per-component filter specification. If specified for a given
* component, this overrides the filter config.
* @property filters
* @type object
*/
self.filters = {};
/**
* The list of requested modules
* @property required
* @type {string: boolean}
*/
self.required = {};
/**
* If a module name is predefined when requested, it is checked againsts
* the patterns provided in this property. If there is a match, the
* module is added with the default configuration.
*
* At the moment only supporting module prefixes, but anticipate
* supporting at least regular expressions.
* @property patterns
* @type Object
*/
// self.patterns = Y.merge(Y.Env.meta.patterns);
self.patterns = {};
/**
* Internal loader instance metadata. Use accessor `getModuleInfo()` instead.
*/
self.moduleInfo = {};
self.groups = Y.merge(Y.Env.meta.groups);
/**
* Provides the information used to skin the skinnable components.
* The following skin definition would result in 'skin1' and 'skin2'
* being loaded for calendar (if calendar was requested), and
* 'sam' for all other skinnable components:
*
* skin: {
* // The default skin, which is automatically applied if not
* // overriden by a component-specific skin definition.
* // Change this in to apply a different skin globally
* defaultSkin: 'sam',
*
* // This is combined with the loader base property to get
* // the default root directory for a skin. ex:
* // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/
* base: 'assets/skins/',
*
* // Any component-specific overrides can be specified here,
* // making it possible to load different skins for different
* // components. It is possible to load more than one skin
* // for a given component as well.
* overrides: {
* calendar: ['skin1', 'skin2']
* }
* }
* @property skin
* @type {Object}
*/
self.skin = Y.merge(Y.Env.meta.skin);
/*
* Map of conditional modules
* @since 3.2.0
*/
self.conditions = {};
// map of modules with a hash of modules that meet the requirement
// self.provides = {};
self.config = o;
self._internal = true;
self._populateConditionsCache();
/**
* Set when beginning to compute the dependency tree.
* Composed of what YUI reports to be loaded combined
* with what has been loaded by any instance on the page
* with the version number specified in the metadata.
* @property loaded
* @type {string: boolean}
*/
self.loaded = GLOBAL_LOADED[VERSION];
/**
* Should Loader fetch scripts in `async`, defaults to `true`
* @property async
*/
self.async = true;
self._inspectPage();
self._internal = false;
self._config(o);
self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};
self.testresults = null;
if (Y.config.tests) {
self.testresults = Y.config.tests;
}
/**
* List of rollup files found in the library metadata
* @property rollups
*/
// self.rollups = null;
/**
* Whether or not to load optional dependencies for
* the requested modules
* @property loadOptional
* @type boolean
* @default false
*/
// self.loadOptional = false;
/**
* All of the derived dependencies in sorted order, which
* will be populated when either calculate() or insert()
* is called
* @property sorted
* @type string[]
*/
self.sorted = [];
/*
* A list of modules to attach to the YUI instance when complete.
* If not supplied, the sorted list of dependencies are applied.
* @property attaching
*/
// self.attaching = null;
/**
* Flag to indicate the dependency tree needs to be recomputed
* if insert is called again.
* @property dirty
* @type boolean
* @default true
*/
self.dirty = true;
/**
* List of modules inserted by the utility
* @property inserted
* @type {string: boolean}
*/
self.inserted = {};
/**
* List of skipped modules during insert() because the module
* was not defined
* @property skipped
*/
self.skipped = {};
// Y.on('yui:load', self.loadNext, self);
self.tested = {};
/*
* Cached sorted calculate results
* @property results
* @since 3.2.0
*/
//self.results = {};
if (self.ignoreRegistered) {
//Clear inpage already processed modules.
self._resetModules();
}
};
Y.Loader.prototype = {
/**
* Gets the module info from the local moduleInfo hash, or from the
* default metadata and populate the local moduleInfo hash.
* @method getModuleInfo
* @param {string} name of the module
* @public
*/
getModuleInfo: function(name) {
var m = this.moduleInfo[name],
rawMetaModules, globalRenderedMods, internal, v;
if (m) {
return m;
}
rawMetaModules = META.modules;
globalRenderedMods = GLOBAL_ENV._renderedMods;
internal = this._internal;
/*
The logic here is:
- if the `moduleInfo[name]` is avilable,
then short circuit
- otherwise, if the module is in the globalCache (cross Y instance),
then port it from the global registry into `moduleInfo[name]`
- otherwise, if the module has raw metadata (from meta modules)
then add it to the global registry and to `moduleInfo[name]`
*/
if (globalRenderedMods && globalRenderedMods.hasOwnProperty(name) && !this.ignoreRegistered) {
this.moduleInfo[name] = Y.merge(globalRenderedMods[name]);
} else {
if (rawMetaModules.hasOwnProperty(name)) {
this._internal = true; // making sure that modules from raw data are marked as internal
v = this.addModule(rawMetaModules[name], name);
// Inspect the page for the CSS module and mark it as loaded.
if (v && v.type === CSS) {
if (this.isCSSLoaded(v.name, true)) {
Y.log('Found CSS module on page: ' + v.name, 'info', 'loader');
this.loaded[v.name] = true;
}
}
this._internal = internal;
}
}
return this.moduleInfo[name];
},
/**
* Expand the names that are aliases to other modules.
* @method _expandAliases
* @param {string[]} list a module name or a list of names to be expanded
* @private
* @return {array}
*/
_expandAliases: function(list) {
var expanded = [],
aliases = YUI.Env.aliases,
i, name;
list = Y.Array(list);
for (i = 0; i < list.length; i += 1) {
name = list[i];
expanded.push.apply(expanded, aliases[name] ? aliases[name] : [name]);
}
return expanded;
},
/**
* Populate the conditions cache from raw modules, this is necessary
* because no other module will require a conditional module, instead
* the condition has to be executed and then the module is analyzed
* to be included in the final requirement list. Without this cache
* conditional modules will be simply ignored.
* @method _populateConditionsCache
* @private
*/
_populateConditionsCache: function() {
var rawMetaModules = META.modules,
cache = GLOBAL_ENV._conditions,
i, j, t, trigger;
// if we have conditions in cache and cache is enabled
// we should port them to this loader instance
if (cache && !this.ignoreRegistered) {
for (i in cache) {
if (cache.hasOwnProperty(i)) {
this.conditions[i] = Y.merge(cache[i]);
}
}
} else {
for (i in rawMetaModules) {
if (rawMetaModules.hasOwnProperty(i) && rawMetaModules[i].condition) {
t = this._expandAliases(rawMetaModules[i].condition.trigger);
for (j = 0; j < t.length; j += 1) {
trigger = t[j];
this.conditions[trigger] = this.conditions[trigger] || {};
this.conditions[trigger][rawMetaModules[i].name || i] = rawMetaModules[i].condition;
}
}
}
GLOBAL_ENV._conditions = this.conditions;
}
},
/**
* Reset modules in the module cache to a pre-processed state so additional
* computations with a different skin or language will work as expected.
* @method _resetModules
* @private
*/
_resetModules: function() {
var self = this, i, o,
mod, name, details;
for (i in self.moduleInfo) {
if (self.moduleInfo.hasOwnProperty(i) && self.moduleInfo[i]) {
mod = self.moduleInfo[i];
name = mod.name;
details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);
if (details) {
self.moduleInfo[name]._reset = true;
self.moduleInfo[name].requires = details.requires || [];
self.moduleInfo[name].optional = details.optional || [];
self.moduleInfo[name].supersedes = details.supercedes || [];
}
if (mod.defaults) {
for (o in mod.defaults) {
if (mod.defaults.hasOwnProperty(o)) {
if (mod[o]) {
mod[o] = mod.defaults[o];
}
}
}
}
mod.langCache = undefined;
mod.skinCache = undefined;
if (mod.skinnable) {
self._addSkin(self.skin.defaultSkin, mod.name);
}
}
}
},
/**
Regex that matches a CSS URL. Used to guess the file type when it's not
specified.
@property REGEX_CSS
@type RegExp
@final
@protected
@since 3.5.0
**/
REGEX_CSS: /\.css(?:[?;].*)?$/i,
/**
* Default filters for raw and debug
* @property FILTER_DEFS
* @type Object
* @final
* @protected
*/
FILTER_DEFS: {
RAW: {
'searchExp': '-min\\.js',
'replaceStr': '.js'
},
DEBUG: {
'searchExp': '-min\\.js',
'replaceStr': '-debug.js'
},
COVERAGE: {
'searchExp': '-min\\.js',
'replaceStr': '-coverage.js'
}
},
/*
* Check the pages meta-data and cache the result.
* @method _inspectPage
* @private
*/
_inspectPage: function() {
var self = this, v, m, req, mr, i;
for (i in ON_PAGE) {
if (ON_PAGE.hasOwnProperty(i)) {
v = ON_PAGE[i];
if (v.details) {
m = self.getModuleInfo(v.name);
req = v.details.requires;
mr = m && m.requires;
if (m) {
if (!m._inspected && req && mr.length !== req.length) {
// console.log('deleting ' + m.name);
delete m.expanded;
}
} else {
m = self.addModule(v.details, i);
}
m._inspected = true;
}
}
}
},
/*
* returns true if b is not loaded, and is required directly or by means of modules it supersedes.
* @private
* @method _requires
* @param {String} mod1 The first module to compare
* @param {String} mod2 The second module to compare
*/
_requires: function(mod1, mod2) {
var i, rm, after_map, s,
m = this.getModuleInfo(mod1),
other = this.getModuleInfo(mod2);
if (!m || !other) {
return false;
}
rm = m.expanded_map;
after_map = m.after_map;
// check if this module should be sorted after the other
// do this first to short circut circular deps
if (after_map && (mod2 in after_map)) {
return true;
}
after_map = other.after_map;
// and vis-versa
if (after_map && (mod1 in after_map)) {
return false;
}
// check if this module requires one the other supersedes
s = other.supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod1, s[i])) {
return true;
}
}
}
s = m.supersedes;
if (s) {
for (i = 0; i < s.length; i++) {
if (this._requires(mod2, s[i])) {
return false;
}
}
}
// check if this module requires the other directly
// if (r && yArray.indexOf(r, mod2) > -1) {
if (rm && (mod2 in rm)) {
return true;
}
// external css files should be sorted below yui css
if (m.ext && m.type === CSS && !other.ext && other.type === CSS) {
return true;
}
return false;
},
/**
* Apply a new config to the Loader instance
* @method _config
* @private
* @param {Object} o The new configuration
*/
_config: function(o) {
var i, j, val, a, f, group, groupName, self = this,
mods = [], mod, modInfo;
// apply config values
if (o) {
for (i in o) {
if (o.hasOwnProperty(i)) {
val = o[i];
//TODO This should be a case
if (i === 'require') {
self.require(val);
} else if (i === 'skin') {
//If the config.skin is a string, format to the expected object
if (typeof val === 'string') {
self.skin.defaultSkin = o.skin;
val = {
defaultSkin: val
};
}
Y.mix(self.skin, val, true);
} else if (i === 'groups') {
for (j in val) {
if (val.hasOwnProperty(j)) {
// Y.log('group: ' + j);
groupName = j;
group = val[j];
self.addGroup(group, groupName);
if (group.aliases) {
for (a in group.aliases) {
if (group.aliases.hasOwnProperty(a)) {
self.addAlias(group.aliases[a], a);
}
}
}
}
}
} else if (i === 'modules') {
// add a hash of module definitions
for (j in val) {
if (val.hasOwnProperty(j)) {
self.addModule(val[j], j);
}
}
} else if (i === 'aliases') {
for (j in val) {
if (val.hasOwnProperty(j)) {
self.addAlias(val[j], j);
}
}
} else if (i === 'gallery') {
if (this.groups.gallery.update) {
this.groups.gallery.update(val, o);
}
} else if (i === 'yui2' || i === '2in3') {
if (this.groups.yui2.update) {
this.groups.yui2.update(o['2in3'], o.yui2, o);
}
} else {
self[i] = val;
}
}
}
}
// fix filter
f = self.filter;
if (L.isString(f)) {
f = f.toUpperCase();
self.filterName = f;
self.filter = self.FILTER_DEFS[f];
if (f === 'DEBUG') {
self.require('yui-log', 'dump');
}
}
if (self.filterName && self.coverage) {
if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {
for (i = 0; i < self.coverage.length; i++) {
mod = self.coverage[i];
modInfo = self.getModuleInfo(mod);
if (modInfo && modInfo.use) {
mods = mods.concat(modInfo.use);
} else {
mods.push(mod);
}
}
self.filters = self.filters || {};
Y.Array.each(mods, function(mod) {
self.filters[mod] = self.FILTER_DEFS.COVERAGE;
});
self.filterName = 'RAW';
self.filter = self.FILTER_DEFS[self.filterName];
}
}
},
/**
* Returns the skin module name for the specified skin name. If a
* module name is supplied, the returned skin module name is
* specific to the module passed in.
* @method formatSkin
* @param {string} skin the name of the skin.
* @param {string} mod optional: the name of a module to skin.
* @return {string} the full skin module name.
*/
formatSkin: function(skin, mod) {
var s = SKIN_PREFIX + skin;
if (mod) {
s = s + '-' + mod;
}
return s;
},
/**
* Adds the skin def to the module info
* @method _addSkin
* @param {string} skin the name of the skin.
* @param {string} mod the name of the module.
* @param {string} parent parent module if this is a skin of a
* submodule or plugin.
* @return {string} the module name for the skin.
* @private
*/
_addSkin: function(skin, mod, parent) {
var pkg, name, nmod,
sinf = this.skin,
mdef = mod && this.getModuleInfo(mod),
ext = mdef && mdef.ext;
// Add a module definition for the module-specific skin css
if (mod) {
name = this.formatSkin(skin, mod);
if (!this.getModuleInfo(name)) {
pkg = mdef.pkg || mod;
nmod = {
skin: true,
name: name,
group: mdef.group,
type: 'css',
after: sinf.after,
path: (parent || pkg) + '/' + sinf.base + skin +
'/' + mod + '.css',
ext: ext
};
if (mdef.base) {
nmod.base = mdef.base;
}
if (mdef.configFn) {
nmod.configFn = mdef.configFn;
}
this.addModule(nmod, name);
Y.log('Adding skin (' + name + '), ' + parent + ', ' + pkg + ', ' + nmod.path, 'info', 'loader');
}
}
return name;
},
/**
* Adds an alias module to the system
* @method addAlias
* @param {Array} use An array of modules that makes up this alias
* @param {String} name The name of the alias
* @example
* var loader = new Y.Loader({});
* loader.addAlias([ 'node', 'yql' ], 'davglass');
* loader.require(['davglass']);
* var out = loader.resolve(true);
*
* //out.js will contain Node and YQL modules
*/
addAlias: function(use, name) {
YUI.Env.aliases[name] = use;
this.addModule({
name: name,
use: use
});
},
/**
* Add a new module group
* @method addGroup
* @param {Object} config An object containing the group configuration data
* @param {String} config.name required, the group name
* @param {String} config.base The base directory for this module group
* @param {String} config.root The root path to add to each combo resource path
* @param {Boolean} config.combine Should the request be combined
* @param {String} config.comboBase Combo service base path
* @param {Object} config.modules The group of modules
* @param {String} name the group name.
* @example
* var loader = new Y.Loader({});
* loader.addGroup({
* name: 'davglass',
* combine: true,
* comboBase: '/combo?',
* root: '',
* modules: {
* //Module List here
* }
* }, 'davglass');
*/
addGroup: function(o, name) {
var mods = o.modules,
self = this,
defaultBase = o.defaultBase || Y.config.defaultBase,
i, v;
name = name || o.name;
o.name = name;
self.groups[name] = o;
if (!o.base && defaultBase && o.root) {
o.base = defaultBase + o.root;
}
if (o.patterns) {
for (i in o.patterns) {
if (o.patterns.hasOwnProperty(i)) {
o.patterns[i].group = name;
self.patterns[i] = o.patterns[i];
}
}
}
if (mods) {
for (i in mods) {
if (mods.hasOwnProperty(i)) {
v = mods[i];
if (typeof v === 'string') {
v = { name: i, fullpath: v };
}
v.group = name;
self.addModule(v, i);
}
}
}
},
/**
* Add a new module to the component metadata.
* @method addModule
* @param {Object} config An object containing the module data.
* @param {String} config.name Required, the component name
* @param {String} config.type Required, the component type (js or css)
* @param {String} config.path Required, the path to the script from `base`
* @param {Array} config.requires Array of modules required by this component
* @param {Array} [config.optional] Array of optional modules for this component
* @param {Array} [config.supersedes] Array of the modules this component replaces
* @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one
* @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array
* @param {Number} [config.rollup] The number of superseded modules required for automatic rollup
* @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`
* @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in
* @param {Object} [config.submodules] Hash of submodules
* @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.
* @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]`
* @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to four fields:
* @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load
* @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.
* @param {String} [config.condition.ua] The UA name of <a href="UA.html">Y.UA</a> object that returns true when the module is to be loaded. e.g., `"ie"`, `"nodejs"`.
* @param {String} [config.condition.when] Specifies the load order of the conditional module
* with regard to the position of the trigger module.
* This should be one of three values: `before`, `after`, or `instead`. The default is `after`.
* @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`
* @param {Function} [config.configFn] A function to exectute when configuring this module
* @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.
* @param {String[]} [config.optionalRequires] List of dependencies that
may optionally be loaded by this loader. This is targeted mostly at
polyfills, since they should not be in the list of requires because
polyfills are assumed to be available in the global scope.
* @param {Function} [config.test] Test to be called when this module is
added as an optional dependency of another module. If the test function
returns `false`, the module will be ignored and will not be attached to
this YUI instance.
* @param {String} [name] The module name, required if not in the module data.
* @return {Object} the module definition or null if the object passed in did not provide all required attributes.
*/
addModule: function(o, name) {
name = name || o.name;
if (typeof o === 'string') {
o = { name: name, fullpath: o };
}
var subs, i, l, t, sup, s, smod, plugins, plug,
j, langs, packName, supName, flatSup, flatLang, lang, ret,
overrides, skinname, when, g, p,
modInfo = this.moduleInfo[name],
conditions = this.conditions, trigger;
//Only merge this data if the temp flag is set
//from an earlier pass from a pattern or else
//an override module (YUI_config) can not be used to
//replace a default module.
if (modInfo && modInfo.temp) {
//This catches temp modules loaded via a pattern
// The module will be added twice, once from the pattern and
// Once from the actual add call, this ensures that properties
// that were added to the module the first time around (group: gallery)
// are also added the second time around too.
o = Y.merge(modInfo, o);
}
o.name = name;
if (!o || !o.name) {
return null;
}
if (!o.type) {
//Always assume it's javascript unless the CSS pattern is matched.
o.type = JS;
p = o.path || o.fullpath;
if (p && this.REGEX_CSS.test(p)) {
Y.log('Auto determined module type as CSS', 'warn', 'loader');
o.type = CSS;
}
}
if (!o.path && !o.fullpath) {
o.path = _path(name, name, o.type);
}
o.supersedes = o.supersedes || o.use;
o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;
// Handle submodule logic
subs = o.submodules;
this.moduleInfo[name] = o;
o.requires = o.requires || [];
/*
Only allowing the cascade of requires information, since
optional and supersedes are far more fine grained than
a blanket requires is.
*/
if (this.requires) {
for (i = 0; i < this.requires.length; i++) {
o.requires.push(this.requires[i]);
}
}
if (o.group && this.groups && this.groups[o.group]) {
g = this.groups[o.group];
if (g.requires) {
for (i = 0; i < g.requires.length; i++) {
o.requires.push(g.requires[i]);
}
}
}
if (!o.defaults) {
o.defaults = {
requires: o.requires ? [].concat(o.requires) : null,
supersedes: o.supersedes ? [].concat(o.supersedes) : null,
optional: o.optional ? [].concat(o.optional) : null
};
}
if (o.skinnable && o.ext && o.temp) {
skinname = this._addSkin(this.skin.defaultSkin, name);
o.requires.unshift(skinname);
}
if (o.requires.length) {
o.requires = this.filterRequires(o.requires) || [];
}
if (!o.langPack && o.lang) {
langs = yArray(o.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
smod = this.getModuleInfo(packName);
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
}
}
if (subs) {
sup = o.supersedes || [];
l = 0;
for (i in subs) {
if (subs.hasOwnProperty(i)) {
s = subs[i];
s.path = s.path || _path(name, i, o.type);
s.pkg = name;
s.group = o.group;
if (s.supersedes) {
sup = sup.concat(s.supersedes);
}
smod = this.addModule(s, i);
sup.push(i);
if (smod.skinnable) {
o.skinnable = true;
overrides = this.skin.overrides;
if (overrides && overrides[i]) {
for (j = 0; j < overrides[i].length; j++) {
skinname = this._addSkin(overrides[i][j],
i, name);
sup.push(skinname);
}
}
skinname = this._addSkin(this.skin.defaultSkin,
i, name);
sup.push(skinname);
}
// looks like we are expected to work out the metadata
// for the parent module language packs from what is
// specified in the child modules.
if (s.lang && s.lang.length) {
langs = yArray(s.lang);
for (j = 0; j < langs.length; j++) {
lang = langs[j];
packName = this.getLangPackName(lang, name);
supName = this.getLangPackName(lang, i);
smod = this.getModuleInfo(packName);
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
flatSup = flatSup || yArray.hash(smod.supersedes);
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
o.lang = o.lang || [];
flatLang = flatLang || yArray.hash(o.lang);
if (!(lang in flatLang)) {
o.lang.push(lang);
}
// Y.log('pack ' + packName + ' should supersede ' + supName);
// Add rollup file, need to add to supersedes list too
// default packages
packName = this.getLangPackName(ROOT_LANG, name);
supName = this.getLangPackName(ROOT_LANG, i);
smod = this.getModuleInfo(packName);
if (!smod) {
smod = this._addLangPack(lang, o, packName);
}
if (!(supName in flatSup)) {
smod.supersedes.push(supName);
}
// Y.log('pack ' + packName + ' should supersede ' + supName);
// Add rollup file, need to add to supersedes list too
}
}
l++;
}
}
//o.supersedes = YObject.keys(yArray.hash(sup));
o.supersedes = yArray.dedupe(sup);
if (this.allowRollup) {
o.rollup = (l < 4) ? l : Math.min(l - 1, 4);
}
}
plugins = o.plugins;
if (plugins) {
for (i in plugins) {
if (plugins.hasOwnProperty(i)) {
plug = plugins[i];
plug.pkg = name;
plug.path = plug.path || _path(name, i, o.type);
plug.requires = plug.requires || [];
plug.group = o.group;
this.addModule(plug, i);
if (o.skinnable) {
this._addSkin(this.skin.defaultSkin, i, name);
}
}
}
}
if (o.condition) {
t = this._expandAliases(o.condition.trigger);
for (i = 0; i < t.length; i++) {
trigger = t[i];
when = o.condition.when;
conditions[trigger] = conditions[trigger] || {};
conditions[trigger][name] = o.condition;
// the 'when' attribute can be 'before', 'after', or 'instead'
// the default is after.
if (when && when !== 'after') {
if (when === 'instead') { // replace the trigger
o.supersedes = o.supersedes || [];
o.supersedes.push(trigger);
}
// before the trigger
// the trigger requires the conditional mod,
// so it should appear before the conditional
// mod if we do not intersede.
} else { // after the trigger
o.after = o.after || [];
o.after.push(trigger);
}
}
}
if (o.supersedes) {
o.supersedes = this.filterRequires(o.supersedes);
}
if (o.after) {
o.after = this.filterRequires(o.after);
o.after_map = yArray.hash(o.after);
}
// this.dirty = true;
if (o.configFn) {
ret = o.configFn(o);
if (ret === false) {
Y.log('Config function returned false for ' + name + ', skipping.', 'info', 'loader');
delete this.moduleInfo[name];
delete GLOBAL_ENV._renderedMods[name];
o = null;
}
}
//Add to global cache
if (o) {
if (!GLOBAL_ENV._renderedMods) {
GLOBAL_ENV._renderedMods = {};
}
GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);
GLOBAL_ENV._conditions = conditions;
}
return o;
},
/**
* Add a requirement for one or more module
* @method require
* @param {string[] | string*} what the modules to load.
*/
require: function(what) {
var a = (typeof what === 'string') ? yArray(arguments) : what;
this.dirty = true;
this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a)));
this._explodeRollups();
},
/**
* Grab all the items that were asked for, check to see if the Loader
* meta-data contains a "use" array. If it doesm remove the asked item and replace it with
* the content of the "use".
* This will make asking for: "dd"
* Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"
* @private
* @method _explodeRollups
*/
_explodeRollups: function() {
var self = this, m, m2, i, a, v, len, len2,
r = self.required;
if (!self.allowRollup) {
for (i in r) {
if (r.hasOwnProperty(i)) {
m = self.getModule(i);
if (m && m.use) {
len = m.use.length;
for (a = 0; a < len; a++) {
m2 = self.getModule(m.use[a]);
if (m2 && m2.use) {
len2 = m2.use.length;
for (v = 0; v < len2; v++) {
r[m2.use[v]] = true;
}
} else {
r[m.use[a]] = true;
}
}
}
}
}
self.required = r;
}
},
/**
* Explodes the required array to remove aliases and replace them with real modules
* @method filterRequires
* @param {Array} r The original requires array
* @return {Array} The new array of exploded requirements
*/
filterRequires: function(r) {
if (r) {
if (!Y.Lang.isArray(r)) {
r = [r];
}
r = Y.Array(r);
var c = [], i, mod, o, m;
for (i = 0; i < r.length; i++) {
mod = this.getModule(r[i]);
if (mod && mod.use) {
for (o = 0; o < mod.use.length; o++) {
//Must walk the other modules in case a module is a rollup of rollups (datatype)
m = this.getModule(mod.use[o]);
if (m && m.use && (m.name !== mod.name)) {
c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));
} else {
c.push(mod.use[o]);
}
}
} else {
c.push(r[i]);
}
}
r = c;
}
return r;
},
/**
Returns `true` if the module can be attached to the YUI instance. Runs
the module's test if there is one and caches its result.
@method _canBeAttached
@param {String} module Name of the module to check.
@return {Boolean} Result of the module's test if it has one, or `true`.
**/
_canBeAttached: function (m) {
m = this.getModule(m);
if (m && m.test) {
if (!m.hasOwnProperty('_testResult')) {
m._testResult = m.test(Y);
}
return m._testResult;
}
// return `true` for modules not registered as Loader will know what
// to do with them later on
return true;
},
/**
* Returns an object containing properties for all modules required
* in order to load the requested module
* @method getRequires
* @param {object} mod The module definition from moduleInfo.
* @return {array} the expanded requirement list.
*/
getRequires: function(mod) {
if (!mod) {
//console.log('returning no reqs for ' + mod.name);
return NO_REQUIREMENTS;
}
if (mod._parsed) {
//console.log('returning requires for ' + mod.name, mod.requires);
return mod.expanded || NO_REQUIREMENTS;
}
//TODO add modue cache here out of scope..
var i, m, j, length, add, packName, lang, testresults = this.testresults,
name = mod.name, cond,
adddef = ON_PAGE[name] && ON_PAGE[name].details,
optReqs = mod.optionalRequires,
d, go, def,
r, old_mod,
o, skinmod, skindef, skinpar, skinname,
intl = mod.lang || mod.intl,
ftests = Y.Features && Y.Features.tests.load,
hash, reparse;
// console.log(name);
// pattern match leaves module stub that needs to be filled out
if (mod.temp && adddef) {
old_mod = mod;
mod = this.addModule(adddef, name);
mod.group = old_mod.group;
mod.pkg = old_mod.pkg;
delete mod.expanded;
}
// console.log('cache: ' + mod.langCache + ' == ' + this.lang);
//If a skin or a lang is different, reparse..
reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));
if (mod.expanded && !reparse) {
//Y.log('Already expanded ' + name + ', ' + mod.expanded);
return mod.expanded;
}
// Optional dependencies are dependencies that may or may not be
// available.
// This feature was designed specifically to be used when transpiling
// ES6 modules, in order to use polyfills and regular scripts that define
// global variables without having to import them since they should be
// available in the global scope.
if (optReqs) {
for (i = 0, length = optReqs.length; i < length; i++) {
if (this._canBeAttached(optReqs[i])) {
mod.requires.push(optReqs[i]);
}
}
}
d = [];
hash = {};
r = this.filterRequires(mod.requires);
if (mod.lang) {
//If a module has a lang attribute, auto add the intl requirement.
d.unshift('intl');
r.unshift('intl');
intl = true;
}
o = this.filterRequires(mod.optional);
// Y.log("getRequires: " + name + " (dirty:" + this.dirty +
// ", expanded:" + mod.expanded + ")");
mod._parsed = true;
mod.langCache = this.lang;
mod.skinCache = this.skin.defaultSkin;
for (i = 0; i < r.length; i++) {
//Y.log(name + ' requiring ' + r[i], 'info', 'loader');
if (!hash[r[i]]) {
d.push(r[i]);
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
// get the requirements from superseded modules, if any
r = this.filterRequires(mod.supersedes);
if (r) {
for (i = 0; i < r.length; i++) {
if (!hash[r[i]]) {
// if this module has submodules, the requirements list is
// expanded to include the submodules. This is so we can
// prevent dups when a submodule is already loaded and the
// parent is requested.
if (mod.submodules) {
d.push(r[i]);
}
hash[r[i]] = true;
m = this.getModule(r[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
if (o && this.loadOptional) {
for (i = 0; i < o.length; i++) {
if (!hash[o[i]]) {
d.push(o[i]);
hash[o[i]] = true;
m = this.getModuleInfo(o[i]);
if (m) {
add = this.getRequires(m);
intl = intl || (m.expanded_map &&
(INTL in m.expanded_map));
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
cond = this.conditions[name];
if (cond) {
//Set the module to not parsed since we have conditionals and this could change the dependency tree.
mod._parsed = false;
if (testresults && ftests) {
oeach(testresults, function(result, id) {
var condmod = ftests[id].name;
if (!hash[condmod] && ftests[id].trigger === name) {
if (result && ftests[id]) {
hash[condmod] = true;
d.push(condmod);
}
}
});
} else {
for (i in cond) {
if (cond.hasOwnProperty(i)) {
if (!hash[i]) {
def = cond[i];
//first see if they've specfied a ua check
//then see if they've got a test fn & if it returns true
//otherwise just having a condition block is enough
go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||
(def.test && def.test(Y, r)));
if (go) {
hash[i] = true;
d.push(i);
m = this.getModule(i);
if (m) {
add = this.getRequires(m);
for (j = 0; j < add.length; j++) {
d.push(add[j]);
}
}
}
}
}
}
}
}
// Create skin modules
if (mod.skinnable) {
skindef = this.skin.overrides;
for (i in YUI.Env.aliases) {
if (YUI.Env.aliases.hasOwnProperty(i)) {
if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {
skinpar = i;
}
}
}
if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {
skinname = name;
if (skindef[skinpar]) {
skinname = skinpar;
}
for (i = 0; i < skindef[skinname].length; i++) {
skinmod = this._addSkin(skindef[skinname][i], name);
if (!this.isCSSLoaded(skinmod, this._boot)) {
d.push(skinmod);
}
}
} else {
skinmod = this._addSkin(this.skin.defaultSkin, name);
if (!this.isCSSLoaded(skinmod, this._boot)) {
d.push(skinmod);
}
}
}
mod._parsed = false;
if (intl) {
if (mod.lang && !mod.langPack && Y.Intl) {
lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);
//Y.log('Best lang: ' + lang + ', this.lang: ' + this.lang + ', mod.lang: ' + mod.lang);
packName = this.getLangPackName(lang, name);
if (packName) {
d.unshift(packName);
}
}
d.unshift(INTL);
}
mod.expanded_map = yArray.hash(d);
mod.expanded = YObject.keys(mod.expanded_map);
return mod.expanded;
},
/**
* Check to see if named css module is already loaded on the page
* @method isCSSLoaded
* @param {String} name The name of the css file
* @param {Boolean} skip To skip the short-circuit for ignoreRegister
* @return Boolean
*/
isCSSLoaded: function(name, skip) {
//TODO - Make this call a batching call with name being an array
if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {
Y.log('isCSSLoaded was skipped for ' + name, 'warn', 'loader');
return false;
}
var el = YUI.Env.cssStampEl,
ret = false,
mod = YUI.Env._cssLoaded[name],
style = el.currentStyle; //IE
if (mod !== undefined) {
//Y.log('isCSSLoaded was cached for ' + name, 'warn', 'loader');
return mod;
}
//Add the classname to the element
el.className = name;
if (!style) {
style = Y.config.doc.defaultView.getComputedStyle(el, null);
}
if (style && style.display === 'none') {
ret = true;
}
Y.log('Has Skin? ' + name + ' : ' + ret, 'info', 'loader');
el.className = ''; //Reset the classname to ''
YUI.Env._cssLoaded[name] = ret;
return ret;
},
/**
* Returns a hash of module names the supplied module satisfies.
* @method getProvides
* @param {string} name The name of the module.
* @return {object} what this module provides.
*/
getProvides: function(name) {
var m = this.getModule(name), o, s;
// supmap = this.provides;
if (!m) {
return NOT_FOUND;
}
if (m && !m.provides) {
o = {};
s = m.supersedes;
if (s) {
yArray.each(s, function(v) {
Y.mix(o, this.getProvides(v));
}, this);
}
o[name] = true;
m.provides = o;
}
return m.provides;
},
/**
* Calculates the dependency tree, the result is stored in the sorted
* property.
* @method calculate
* @param {object} o optional options object.
* @param {string} type optional argument to prune modules.
*/
calculate: function(o, type) {
if (o || type || this.dirty) {
if (o) {
this._config(o);
}
if (!this._init) {
this._setup();
}
this._explode();
if (this.allowRollup) {
this._rollup();
} else {
this._explodeRollups();
}
this._reduce();
this._sort();
}
},
/**
* Creates a "psuedo" package for languages provided in the lang array
* @method _addLangPack
* @private
* @param {String} lang The language to create
* @param {Object} m The module definition to create the language pack around
* @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)
* @return {Object} The module definition
*/
_addLangPack: function(lang, m, packName) {
var name = m.name,
packPath, conf,
existing = this.getModuleInfo(packName);
if (!existing) {
packPath = _path((m.pkg || name), packName, JS, true);
conf = {
path: packPath,
intl: true,
langPack: true,
ext: m.ext,
group: m.group,
supersedes: []
};
if (m.root) {
conf.root = m.root;
}
if (m.base) {
conf.base = m.base;
}
if (m.configFn) {
conf.configFn = m.configFn;
}
this.addModule(conf, packName);
if (lang) {
Y.Env.lang = Y.Env.lang || {};
Y.Env.lang[lang] = Y.Env.lang[lang] || {};
Y.Env.lang[lang][name] = true;
}
}
return this.getModuleInfo(packName);
},
/**
* Investigates the current YUI configuration on the page. By default,
* modules already detected will not be loaded again unless a force
* option is encountered. Called by calculate()
* @method _setup
* @private
*/
_setup: function() {
var info = this.moduleInfo, name, i, j, m, l,
packName;
for (name in info) {
if (info.hasOwnProperty(name)) {
m = info[name];
if (m) {
// remove dups
//m.requires = YObject.keys(yArray.hash(m.requires));
m.requires = yArray.dedupe(m.requires);
// Create lang pack modules
//if (m.lang && m.lang.length) {
if (m.lang) {
// Setup root package if the module has lang defined,
// it needs to provide a root language pack
packName = this.getLangPackName(ROOT_LANG, name);
this._addLangPack(null, m, packName);
}
}
}
}
//l = Y.merge(this.inserted);
l = {};
// available modules
if (!this.ignoreRegistered) {
Y.mix(l, GLOBAL_ENV.mods);
}
// add the ignore list to the list of loaded packages
if (this.ignore) {
Y.mix(l, yArray.hash(this.ignore));
}
// expand the list to include superseded modules
for (j in l) {
if (l.hasOwnProperty(j)) {
Y.mix(l, this.getProvides(j));
}
}
// remove modules on the force list from the loaded list
if (this.force) {
for (i = 0; i < this.force.length; i++) {
if (this.force[i] in l) {
delete l[this.force[i]];
}
}
}
Y.mix(this.loaded, l);
this._init = true;
},
/**
* Builds a module name for a language pack
* @method getLangPackName
* @param {string} lang the language code.
* @param {string} mname the module to build it for.
* @return {string} the language pack module name.
*/
getLangPackName: function(lang, mname) {
return ('lang/' + mname + ((lang) ? '_' + lang : ''));
},
/**
* Inspects the required modules list looking for additional
* dependencies. Expands the required list to include all
* required modules. Called by calculate()
* @method _explode
* @private
*/
_explode: function() {
//TODO Move done out of scope
var r = this.required, m, reqs, done = {},
self = this, name, expound;
// the setup phase is over, all modules have been created
self.dirty = false;
self._explodeRollups();
r = self.required;
for (name in r) {
if (r.hasOwnProperty(name)) {
if (!done[name]) {
done[name] = true;
m = self.getModule(name);
if (m) {
expound = m.expound;
if (expound) {
r[expound] = self.getModule(expound);
reqs = self.getRequires(r[expound]);
Y.mix(r, yArray.hash(reqs));
}
reqs = self.getRequires(m);
Y.mix(r, yArray.hash(reqs));
}
}
}
}
// Y.log('After explode: ' + YObject.keys(r));
},
/**
* The default method used to test a module against a pattern
* @method _patternTest
* @private
* @param {String} mname The module being tested
* @param {String} pname The pattern to match
*/
_patternTest: function(mname, pname) {
return (mname.indexOf(pname) > -1);
},
/**
* Get's the loader meta data for the requested module
* @method getModule
* @param {String} mname The module name to get
* @return {Object} The module metadata
*/
getModule: function(mname) {
//TODO: Remove name check - it's a quick hack to fix pattern WIP
if (!mname) {
return null;
}
var p, found, pname,
m = this.getModuleInfo(mname),
patterns = this.patterns;
// check the patterns library to see if we should automatically add
// the module with defaults
if (!m || (m && m.ext)) {
// Y.log('testing patterns ' + YObject.keys(patterns));
for (pname in patterns) {
if (patterns.hasOwnProperty(pname)) {
// Y.log('testing pattern ' + i);
p = patterns[pname];
//There is no test method, create a default one that tests
// the pattern against the mod name
if (!p.test) {
p.test = this._patternTest;
}
if (p.test(mname, pname)) {
// use the metadata supplied for the pattern
// as the module definition.
found = p;
break;
}
}
}
}
if (!m) {
if (found) {
if (p.action) {
// Y.log('executing pattern action: ' + pname);
p.action.call(this, mname, pname);
} else {
Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
pname, 'info', 'loader');
// ext true or false?
m = this.addModule(Y.merge(found, {
test: void 0,
temp: true
}), mname);
if (m && found.configFn) {
m.configFn = found.configFn;
}
}
}
} else {
if (found && m && found.configFn && !m.configFn) {
m.configFn = found.configFn;
m.configFn(m);
}
}
return m;
},
// impl in rollup submodule
_rollup: function() { },
/**
* Remove superceded modules and loaded modules. Called by
* calculate() after we have the mega list of all dependencies
* @method _reduce
* @return {object} the reduced dependency hash.
* @private
*/
_reduce: function(r) {
r = r || this.required;
var i, j, s, m, type = this.loadType,
ignore = this.ignore ? yArray.hash(this.ignore) : false;
for (i in r) {
if (r.hasOwnProperty(i)) {
m = this.getModule(i);
// remove if already loaded
if (((this.loaded[i] || ON_PAGE[i]) &&
!this.forceMap[i] && !this.ignoreRegistered) ||
(type && m && m.type !== type)) {
delete r[i];
}
if (ignore && ignore[i]) {
delete r[i];
}
// remove anything this module supersedes
s = m && m.supersedes;
if (s) {
for (j = 0; j < s.length; j++) {
if (s[j] in r) {
delete r[s[j]];
}
}
}
}
}
return r;
},
/**
* Handles the queue when a module has been loaded for all cases
* @method _finish
* @private
* @param {String} msg The message from Loader
* @param {Boolean} success A boolean denoting success or failure
*/
_finish: function(msg, success) {
Y.log('loader finishing: ' + msg + ', ' + Y.id + ', ' +
this.data, 'info', 'loader');
_queue.running = false;
var onEnd = this.onEnd;
if (onEnd) {
onEnd.call(this.context, {
msg: msg,
data: this.data,
success: success
});
}
this._continue();
},
/**
* The default Loader onSuccess handler, calls this.onSuccess with a payload
* @method _onSuccess
* @private
*/
_onSuccess: function() {
var self = this, skipped = Y.merge(self.skipped), fn,
failed = [], rreg = self.requireRegistration,
success, msg, i, mod;
for (i in skipped) {
if (skipped.hasOwnProperty(i)) {
delete self.inserted[i];
}
}
self.skipped = {};
for (i in self.inserted) {
if (self.inserted.hasOwnProperty(i)) {
mod = self.getModule(i);
if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) {
failed.push(i);
} else {
Y.mix(self.loaded, self.getProvides(i));
}
}
}
fn = self.onSuccess;
msg = (failed.length) ? 'notregistered' : 'success';
success = !(failed.length);
if (fn) {
fn.call(self.context, {
msg: msg,
data: self.data,
success: success,
failed: failed,
skipped: skipped
});
}
self._finish(msg, success);
},
/**
* The default Loader onProgress handler, calls this.onProgress with a payload
* @method _onProgress
* @private
*/
_onProgress: function(e) {
var self = this, i;
//set the internal cache to what just came in.
if (e.data && e.data.length) {
for (i = 0; i < e.data.length; i++) {
e.data[i] = self.getModule(e.data[i].name);
}
}
if (self.onProgress) {
self.onProgress.call(self.context, {
name: e.url,
data: e.data
});
}
},
/**
* The default Loader onFailure handler, calls this.onFailure with a payload
* @method _onFailure
* @private
*/
_onFailure: function(o) {
var f = this.onFailure, msg = [], i = 0, len = o.errors.length;
for (i; i < len; i++) {
msg.push(o.errors[i].error);
}
msg = msg.join(',');
Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader');
if (f) {
f.call(this.context, {
msg: msg,
data: this.data,
success: false
});
}
this._finish(msg, false);
},
/**
* The default Loader onTimeout handler, calls this.onTimeout with a payload
* @method _onTimeout
* @param {Get.Transaction} transaction The Transaction object from `Y.Get`
* @private
*/
_onTimeout: function(transaction) {
Y.log('loader timeout: ' + Y.id, 'error', 'loader');
var f = this.onTimeout;
if (f) {
f.call(this.context, {
msg: 'timeout',
data: this.data,
success: false,
transaction: transaction
});
}
},
/**
* Sorts the dependency tree. The last step of calculate()
* @method _sort
* @private
*/
_sort: function() {
var name,
// Object containing module names.
required = this.required,
// Keep track of whether we've visited a module.
visited = {};
// Will contain modules names, in the correct order,
// according to dependencies.
this.sorted = [];
for (name in required) {
if (!visited[name] && required.hasOwnProperty(name)) {
this._visit(name, visited);
}
}
},
/**
* Recursively visits the dependencies of the module name
* passed in, and appends each module name to the `sorted` property.
* @param {String} name The name of a module.
* @param {Object} visited Keeps track of whether a module was visited.
* @method _visit
* @private
*/
_visit: function (name, visited) {
var required, condition, moduleInfo, dependency, dependencies,
trigger, isAfter, i, l;
visited[name] = true;
required = this.required;
moduleInfo = this.moduleInfo[name];
condition = this.conditions[name] || {};
if (moduleInfo) {
// Recurse on each dependency of this module,
// figuring out its dependencies, and so on.
dependencies = moduleInfo.expanded || moduleInfo.requires;
for (i = 0, l = dependencies.length; i < l; ++i) {
dependency = dependencies[i];
trigger = condition[dependency];
// We cannot process this dependency yet if it must
// appear after our current module.
isAfter = trigger && (!trigger.when || trigger.when === "after");
// Is this module name in the required list of modules,
// and have we not already visited it?
if (required[dependency] && !visited[dependency] && !isAfter) {
this._visit(dependency, visited);
}
}
}
this.sorted.push(name);
},
/**
* Handles the actual insertion of script/link tags
* @method _insert
* @private
* @param {Object} source The YUI instance the request came from
* @param {Object} o The metadata to include
* @param {String} type JS or CSS
* @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta
*/
_insert: function(source, o, type, skipcalc) {
Y.log('private _insert() ' + (type || '') + ', ' + Y.id, "info", "loader");
// restore the state at the time of the request
if (source) {
this._config(source);
}
// build the dependency list
// don't include type so we can process CSS and script in
// one pass when the type is not specified.
var modules = this.resolve(!skipcalc),
self = this, comp = 0, actions = 0,
mods = {}, deps, complete;
self._refetch = [];
if (type) {
//Filter out the opposite type and reset the array so the checks later work
modules[((type === JS) ? CSS : JS)] = [];
}
if (!self.fetchCSS) {
modules.css = [];
}
if (modules.js.length) {
comp++;
}
if (modules.css.length) {
comp++;
}
//console.log('Resolved Modules: ', modules);
complete = function(d) {
actions++;
var errs = {}, i = 0, o = 0, u = '', fn,
modName, resMods;
if (d && d.errors) {
for (i = 0; i < d.errors.length; i++) {
if (d.errors[i].request) {
u = d.errors[i].request.url;
} else {
u = d.errors[i];
}
errs[u] = u;
}
}
if (d && d.data && d.data.length && (d.type === 'success')) {
for (i = 0; i < d.data.length; i++) {
self.inserted[d.data[i].name] = true;
//If the external module has a skin or a lang, reprocess it
if (d.data[i].lang || d.data[i].skinnable) {
delete self.inserted[d.data[i].name];
self._refetch.push(d.data[i].name);
}
}
}
if (actions === comp) {
self._loading = null;
Y.log('Loader actions complete!', 'info', 'loader');
if (self._refetch.length) {
//Get the deps for the new meta-data and reprocess
Y.log('Found potential modules to refetch', 'info', 'loader');
for (i = 0; i < self._refetch.length; i++) {
deps = self.getRequires(self.getModule(self._refetch[i]));
for (o = 0; o < deps.length; o++) {
if (!self.inserted[deps[o]]) {
//We wouldn't be to this point without the module being here
mods[deps[o]] = deps[o];
}
}
}
mods = Y.Object.keys(mods);
if (mods.length) {
Y.log('Refetching modules with new meta-data', 'info', 'loader');
self.require(mods);
resMods = self.resolve(true);
if (resMods.cssMods.length) {
for (i=0; i < resMods.cssMods.length; i++) {
modName = resMods.cssMods[i].name;
delete YUI.Env._cssLoaded[modName];
if (self.isCSSLoaded(modName)) {
self.inserted[modName] = true;
delete self.required[modName];
}
}
self.sorted = [];
self._sort();
}
d = null; //bail
self._insert(); //insert the new deps
}
}
if (d && d.fn) {
Y.log('Firing final Loader callback!', 'info', 'loader');
fn = d.fn;
delete d.fn;
fn.call(self, d);
}
}
};
this._loading = true;
if (!modules.js.length && !modules.css.length) {
Y.log('No modules resolved..', 'warn', 'loader');
actions = -1;
complete({
fn: self._onSuccess
});
return;
}
if (modules.css.length) { //Load CSS first
Y.log('Loading CSS modules', 'info', 'loader');
Y.Get.css(modules.css, {
data: modules.cssMods,
attributes: self.cssAttributes,
insertBefore: self.insertBefore,
charset: self.charset,
timeout: self.timeout,
context: self,
onProgress: function(e) {
self._onProgress.call(self, e);
},
onTimeout: function(d) {
self._onTimeout.call(self, d);
},
onSuccess: function(d) {
d.type = 'success';
d.fn = self._onSuccess;
complete.call(self, d);
},
onFailure: function(d) {
d.type = 'failure';
d.fn = self._onFailure;
complete.call(self, d);
}
});
}
if (modules.js.length) {
Y.log('Loading JS modules', 'info', 'loader');
Y.Get.js(modules.js, {
data: modules.jsMods,
insertBefore: self.insertBefore,
attributes: self.jsAttributes,
charset: self.charset,
timeout: self.timeout,
autopurge: false,
context: self,
async: self.async,
onProgress: function(e) {
self._onProgress.call(self, e);
},
onTimeout: function(d) {
self._onTimeout.call(self, d);
},
onSuccess: function(d) {
d.type = 'success';
d.fn = self._onSuccess;
complete.call(self, d);
},
onFailure: function(d) {
d.type = 'failure';
d.fn = self._onFailure;
complete.call(self, d);
}
});
}
},
/**
* Once a loader operation is completely finished, process any additional queued items.
* @method _continue
* @private
*/
_continue: function() {
if (!(_queue.running) && _queue.size() > 0) {
_queue.running = true;
_queue.next()();
}
},
/**
* inserts the requested modules and their dependencies.
* <code>type</code> can be "js" or "css". Both script and
* css are inserted if type is not provided.
* @method insert
* @param {object} o optional options object.
* @param {string} type the type of dependency to insert.
*/
insert: function(o, type, skipsort) {
Y.log('public insert() ' + (type || '') + ', ' + Y.Object.keys(this.required), "info", "loader");
var self = this, copy = Y.merge(this);
delete copy.require;
delete copy.dirty;
_queue.add(function() {
self._insert(copy, o, type, skipsort);
});
this._continue();
},
/**
* Executed every time a module is loaded, and if we are in a load
* cycle, we attempt to load the next script. Public so that it
* is possible to call this if using a method other than
* Y.register to determine when scripts are fully loaded
* @method loadNext
* @deprecated
* @param {string} mname optional the name of the module that has
* been loaded (which is usually why it is time to load the next
* one).
*/
loadNext: function() {
Y.log('loadNext was called..', 'error', 'loader');
return;
},
/**
* Apply filter defined for this instance to a url/path
* @method _filter
* @param {string} u the string to filter.
* @param {string} name the name of the module, if we are processing
* a single module as opposed to a combined url.
* @return {string} the filtered string.
* @private
*/
_filter: function(u, name, group) {
var f = this.filter,
hasFilter = name && (name in this.filters),
modFilter = hasFilter && this.filters[name],
groupName = group || (this.getModuleInfo(name) || {}).group || null;
if (groupName && this.groups[groupName] && this.groups[groupName].filter) {
modFilter = this.groups[groupName].filter;
hasFilter = true;
}
if (u) {
if (hasFilter) {
f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;
}
if (f) {
u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);
}
}
return u;
},
/**
* Generates the full url for a module
* @method _url
* @param {string} path the path fragment.
* @param {String} name The name of the module
* @param {String} [base] The base url to use. Defaults to self.base
* @return {string} the full url.
* @private
*/
_url: function(path, name, base) {
return this._filter((base || this.base || '') + path, name);
},
/**
* Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.
* @method resolve
* @param {Boolean} [calc=false] Perform a loader.calculate() before anything else
* @param {Array} [sorted=loader.sorted] An override for the loader.sorted array
* @return {Object} Object hash (js and css) of two arrays of file lists
* @example This method can be used as an off-line dep calculator
*
* var Y = YUI();
* var loader = new Y.Loader({
* filter: 'debug',
* base: '../../',
* root: 'build/',
* combine: true,
* require: ['node', 'dd', 'console']
* });
* var out = loader.resolve(true);
*
*/
resolve: function(calc, sorted) {
var self = this,
resolved = { js: [], jsMods: [], css: [], cssMods: [] },
addSingle,
usePathogen = Y.config.comboLoader && Y.config.customComboBase;
if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) {
self._resetModules();
}
if (calc) {
self.calculate();
}
sorted = sorted || self.sorted;
addSingle = function(mod) {
if (mod) {
var group = (mod.group && self.groups[mod.group]) || NOT_FOUND,
url;
//Always assume it's async
if (group.async === false) {
mod.async = group.async;
}
url = (mod.fullpath) ? self._filter(mod.fullpath, mod.name) :
self._url(mod.path, mod.name, group.base || mod.base);
if (mod.attributes || mod.async === false) {
url = {
url: url,
async: mod.async
};
if (mod.attributes) {
url.attributes = mod.attributes;
}
}
resolved[mod.type].push(url);
resolved[mod.type + 'Mods'].push(mod);
} else {
Y.log('Undefined Module', 'warn', 'loader');
}
};
/*jslint vars: true */
var inserted = (self.ignoreRegistered) ? {} : self.inserted,
comboSources,
maxURLLength,
comboMeta,
comboBase,
comboSep,
group,
mod,
len,
i,
hasComboModule = false;
/*jslint vars: false */
for (i = 0, len = sorted.length; i < len; i++) {
mod = self.getModule(sorted[i]);
if (!mod || inserted[mod.name]) {
continue;
}
group = self.groups[mod.group];
comboBase = self.comboBase;
if (group) {
if (!group.combine || mod.fullpath) {
//This is not a combo module, skip it and load it singly later.
addSingle(mod);
continue;
}
mod.combine = true;
if (typeof group.root === 'string') {
mod.root = group.root;
}
comboBase = group.comboBase || comboBase;
comboSep = group.comboSep;
maxURLLength = group.maxURLLength;
} else {
if (!self.combine) {
//This is not a combo module, skip it and load it singly later.
addSingle(mod);
continue;
}
}
if (!mod.combine && mod.ext) {
addSingle(mod);
continue;
}
hasComboModule = true;
comboSources = comboSources || {};
comboSources[comboBase] = comboSources[comboBase] ||
{ js: [], jsMods: [], css: [], cssMods: [] };
comboMeta = comboSources[comboBase];
comboMeta.group = mod.group;
comboMeta.comboSep = comboSep || self.comboSep;
comboMeta.maxURLLength = maxURLLength || self.maxURLLength;
comboMeta[mod.type + 'Mods'].push(mod);
if (mod.type === JS || mod.type === CSS) {
resolved[mod.type + 'Mods'].push(mod);
}
}
//only encode if we have something to encode
if (hasComboModule) {
if (usePathogen) {
resolved = this._pathogenEncodeComboSources(resolved);
} else {
resolved = this._encodeComboSources(resolved, comboSources);
}
}
return resolved;
},
/**
* Encodes combo sources and appends them to an object hash of arrays from `loader.resolve`.
*
* @method _encodeComboSources
* @param {Object} resolved The object hash of arrays in which to attach the encoded combo sources.
* @param {Object} comboSources An object containing relevant data about modules.
* @return Object
* @private
*/
_encodeComboSources: function(resolved, comboSources) {
var fragSubset,
modules,
tmpBase,
baseLen,
frags,
frag,
type,
mod,
maxURLLength,
comboBase,
comboMeta,
comboSep,
i,
len,
self = this;
for (comboBase in comboSources) {
if (comboSources.hasOwnProperty(comboBase)) {
comboMeta = comboSources[comboBase];
comboSep = comboMeta.comboSep;
maxURLLength = comboMeta.maxURLLength;
Y.log('Using maxURLLength of ' + maxURLLength, 'info', 'loader');
for (type in comboMeta) {
if (type === JS || type === CSS) {
modules = comboMeta[type + 'Mods'];
frags = [];
for (i = 0, len = modules.length; i < len; i += 1) {
mod = modules[i];
frag = ((typeof mod.root === 'string') ? mod.root : self.root) + (mod.path || mod.fullpath);
frags.push(
self._filter(frag, mod.name)
);
}
tmpBase = comboBase + frags.join(comboSep);
baseLen = tmpBase.length;
if (maxURLLength <= comboBase.length) {
Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + comboBase.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader');
maxURLLength = MAX_URL_LENGTH;
}
if (frags.length) {
if (baseLen > maxURLLength) {
Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader');
fragSubset = [];
for (i = 0, len = frags.length; i < len; i++) {
fragSubset.push(frags[i]);
tmpBase = comboBase + fragSubset.join(comboSep);
if (tmpBase.length > maxURLLength) {
frag = fragSubset.pop();
tmpBase = comboBase + fragSubset.join(comboSep);
resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
fragSubset = [];
if (frag) {
fragSubset.push(frag);
}
}
}
if (fragSubset.length) {
tmpBase = comboBase + fragSubset.join(comboSep);
resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
}
} else {
resolved[type].push(self._filter(tmpBase, null, comboMeta.group));
}
}
}
}
}
}
return resolved;
},
/**
Shortcut to calculate, resolve and load all modules.
var loader = new Y.Loader({
ignoreRegistered: true,
modules: {
mod: {
path: 'mod.js'
}
},
requires: [ 'mod' ]
});
loader.load(function() {
console.log('All modules have loaded..');
});
@method load
@param {Function} cb Executed after all load operations are complete
*/
load: function(cb) {
if (!cb) {
Y.log('No callback supplied to load()', 'error', 'loader');
return;
}
var self = this,
out = self.resolve(true);
self.data = out;
self.onEnd = function() {
cb.apply(self.context || self, arguments);
};
self.insert();
}
};
}, '@VERSION@', {"requires": ["get", "features"]});
| Timbioz/cdnjs | ajax/libs/yui/3.18.0/loader-base/loader-base-debug.js | JavaScript | mit | 100,380 |
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){Array.prototype.reduce||(Array.prototype.reduce=function(a){var b,c=Object(this),d=c.length>>>0,e=0;if(2===arguments.length)b=arguments[1];else{for(;d>e&&!(e in c);)e++;if(e>=d)throw new TypeError("Reduce of empty array with no initial value");b=c[e++]}for(;d>e;e++)e in c&&(b=a(b,c[e],e,c));return b}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(a){for(var b=Object(this),c=b.length>>>0,d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d});var b,c="function"==typeof define&&define.amd,d=function(b){var c="Comic Sans MS"===b?"Courier New":"Comic Sans MS",d=a("<div>").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),e=d.css("fontFamily",c).width(),f=d.css("fontFamily",b+","+c).width();return d.remove(),e!==f},e=navigator.userAgent,f={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:/MSIE|Trident/i.test(e),isFF:/firefox/i.test(e),isWebkit:/webkit/i.test(e),isSafari:/safari/i.test(e),jqueryVersion:parseFloat(a.fn.jquery),isSupportAmd:c,hasCodeMirror:c?require.specified("CodeMirror"):!!window.CodeMirror,isFontInstalled:d,isW3CRangeSupport:!!document.createRange},g=function(){var b=function(a){return function(b){return a===b}},c=function(a,b){return a===b},d=function(a){return function(b,c){return b[a]===c[a]}},e=function(){return!0},f=function(){return!1},g=function(a){return function(){return!a.apply(a,arguments)}},h=function(a,b){return function(c){return a(c)&&b(c)}},i=function(a){return a},j=0,k=function(a){var b=++j+"";return a?a+b:b},l=function(b){var c=a(document);return{top:b.top+c.scrollTop(),left:b.left+c.scrollLeft(),width:b.right-b.left,height:b.bottom-b.top}},m=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b},n=function(a,b){return b=b||"",b+a.split(".").map(function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}).join("")};return{eq:b,eq2:c,peq2:d,ok:e,fail:f,self:i,not:g,and:h,uniqueId:k,rect2bnd:l,invertObject:m,namespaceToCamel:n}}(),h=function(){var b=function(a){return a[0]},c=function(a){return a[a.length-1]},d=function(a){return a.slice(0,a.length-1)},e=function(a){return a.slice(1)},f=function(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c];if(b(e))return e}},h=function(a,b){for(var c=0,d=a.length;d>c;c++)if(!b(a[c]))return!1;return!0},i=function(b,c){return-1!==a.inArray(c,b)},j=function(a,b){return b=b||g.self,a.reduce(function(a,c){return a+b(c)},0)},k=function(a){for(var b=[],c=-1,d=a.length;++c<d;)b[c]=a[c];return b},l=function(a,d){if(!a.length)return[];var f=e(a);return f.reduce(function(a,b){var e=c(a);return d(c(e),b)?e[e.length]=b:a[a.length]=[b],a},[[b(a)]])},m=function(a){for(var b=[],c=0,d=a.length;d>c;c++)a[c]&&b.push(a[c]);return b},n=function(a){for(var b=[],c=0,d=a.length;d>c;c++)i(b,a[c])||b.push(a[c]);return b},o=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c+1]},p=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c-1]};return{head:b,last:c,initial:d,tail:e,prev:p,next:o,find:f,contains:i,all:h,sum:j,from:k,clusterBy:l,compact:m,unique:n}}(),i=String.fromCharCode(160),j="\ufeff",k=function(){var b=function(b){return b&&a(b).hasClass("note-editable")},c=function(b){return b&&a(b).hasClass("note-control-sizing")},d=function(b){var c;if(b.hasClass("note-air-editor")){var d=h.last(b.attr("id").split("-"));return c=function(b){return function(){return a(b+d)}},{editor:function(){return b},holder:function(){return b.data("holder")},editable:function(){return b},popover:c("#note-popover-"),handle:c("#note-handle-"),dialog:c("#note-dialog-")}}return c=function(a){return function(){return b.find(a)}},{editor:function(){return b},holder:function(){return b.data("holder")},dropzone:c(".note-dropzone"),toolbar:c(".note-toolbar"),editable:c(".note-editable"),codable:c(".note-codable"),statusbar:c(".note-statusbar"),popover:c(".note-popover"),handle:c(".note-handle"),dialog:c(".note-dialog")}},e=function(b){var c=a(b).closest(".note-editor, .note-air-editor, .note-air-layout");if(!c.length)return null;var e;return e=c.is(".note-editor, .note-air-editor")?c:a("#note-editor-"+h.last(c.attr("id").split("-"))),d(e)},l=function(a){return a=a.toUpperCase(),function(b){return b&&b.nodeName.toUpperCase()===a}},m=function(a){return a&&3===a.nodeType},n=function(a){return a&&/^BR|^IMG|^HR/.test(a.nodeName.toUpperCase())},o=function(a){return b(a)?!1:a&&/^DIV|^P|^LI|^H[1-7]/.test(a.nodeName.toUpperCase())},p=l("LI"),q=function(a){return o(a)&&!p(a)},r=l("TABLE"),s=function(a){return!(w(a)||t(a)||o(a)||r(a)||v(a))},t=function(a){return a&&/^UL|^OL/.test(a.nodeName.toUpperCase())},u=function(a){return a&&/^TD|^TH/.test(a.nodeName.toUpperCase())},v=l("BLOCKQUOTE"),w=function(a){return u(a)||v(a)||b(a)},x=l("A"),y=function(a){return s(a)&&!!H(a,o)},z=function(a){return s(a)&&!H(a,o)},A=l("BODY"),B=function(a,b){return a.nextSibling===b||a.previousSibling===b},C=function(a,b){b=b||g.ok;var c=[];return a.previousSibling&&b(a.previousSibling)&&c.push(a.previousSibling),c.push(a),a.nextSibling&&b(a.nextSibling)&&c.push(a.nextSibling),c},D=f.isMSIE?" ":"<br>",E=function(a){return m(a)?a.nodeValue.length:a.childNodes.length},F=function(a){var b=E(a);return 0===b?!0:m(a)||1!==b||a.innerHTML!==D?h.all(a.childNodes,m)&&""===a.innerHTML?!0:!1:!0},G=function(a){n(a)||E(a)||(a.innerHTML=D)},H=function(a,c){for(;a;){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},I=function(a,c){for(a=a.parentNode;a&&1===E(a);){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},J=function(a,c){c=c||g.fail;var d=[];return H(a,function(a){return b(a)||d.push(a),c(a)}),d},K=function(a,b){var c=J(a);return h.last(c.filter(b))},L=function(b,c){for(var d=J(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},M=function(a,b){b=b||g.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.previousSibling;return c},N=function(a,b){b=b||g.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.nextSibling;return c},O=function(a,b){var c=[];return b=b||g.ok,function d(e){a!==e&&b(e)&&c.push(e);for(var f=0,g=e.childNodes.length;g>f;f++)d(e.childNodes[f])}(a),c},P=function(b,c){var d=b.parentNode,e=a("<"+c+">")[0];return d.insertBefore(e,b),e.appendChild(b),e},Q=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},R=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},S=function(a){return 0===a.offset},T=function(a){return a.offset===E(a.node)},U=function(a){return S(a)||T(a)},V=function(a,b){for(;a&&a!==b;){if(0!==X(a))return!1;a=a.parentNode}return!0},W=function(a,b){for(;a&&a!==b;){if(X(a)!==E(a.parentNode)-1)return!1;a=a.parentNode}return!0},X=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},Y=function(a){return!!(a&&a.childNodes&&a.childNodes.length)},Z=function(a,c){var d,e;if(0===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=X(a.node)}else Y(a.node)?(d=a.node.childNodes[a.offset-1],e=E(d)):(d=a.node,e=c?0:a.offset-1);return{node:d,offset:e}},$=function(a,c){var d,e;if(E(a.node)===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=X(a.node)+1}else Y(a.node)?(d=a.node.childNodes[a.offset],e=0):(d=a.node,e=c?E(a.node):a.offset+1);return{node:d,offset:e}},_=function(a,b){return a.node===b.node&&a.offset===b.offset},aa=function(a){if(m(a.node)||!Y(a.node)||F(a.node))return!0;var b=a.node.childNodes[a.offset-1],c=a.node.childNodes[a.offset];return b&&!n(b)||c&&!n(c)?!1:!0},ba=function(a,b){for(;a;){if(b(a))return a;a=Z(a)}return null},ca=function(a,b){for(;a;){if(b(a))return a;a=$(a)}return null},da=function(a){if(!m(a.node))return!1;var b=a.node.nodeValue.charAt(a.offset-1);return b&&" "!==b&&b!==i},ea=function(a,b,c,d){for(var e=a;e&&(c(e),!_(e,b));){var f=d&&a.node!==e.node&&b.node!==e.node;e=$(e,f)}},fa=function(b,c){var d=J(c,g.eq(b));return a.map(d,X).reverse()},ga=function(a,b){for(var c=a,d=0,e=b.length;e>d;d++)c=c.childNodes.length<=b[d]?c.childNodes[c.childNodes.length-1]:c.childNodes[b[d]];return c},ha=function(a,b){var c=b&&b.isSkipPaddingBlankHTML,d=b&&b.isNotSplitEdgePoint;if(U(a)&&(m(a.node)||d)){if(S(a))return a.node;if(T(a))return a.node.nextSibling}if(m(a.node))return a.node.splitText(a.offset);var e=a.node.childNodes[a.offset],f=Q(a.node.cloneNode(!1),a.node);return R(f,N(e)),c||(G(a.node),G(f)),f},ia=function(a,b,c){var d=J(b.node,g.eq(a));return d.length?1===d.length?ha(b,c):d.reduce(function(a,d){return a===b.node&&(a=ha(b,c)),ha({node:d,offset:a?k.position(a):E(d)},c)}):null},ja=function(a,b){var c,d,e=b?o:w,f=J(a.node,e),g=h.last(f)||a.node;e(g)?(c=f[f.length-2],d=g):(c=g,d=c.parentNode);var i=c&&ia(c,a,{isSkipPaddingBlankHTML:b,isNotSplitEdgePoint:b});return i||d!==a.node||(i=a.node.childNodes[a.offset]),{rightNode:i,container:d}},ka=function(a){return document.createElement(a)},la=function(a){return document.createTextNode(a)},ma=function(a,b){if(a&&a.parentNode){if(a.removeNode)return a.removeNode(b);var c=a.parentNode;if(!b){var d,e,f=[];for(d=0,e=a.childNodes.length;e>d;d++)f.push(a.childNodes[d]);for(d=0,e=f.length;e>d;d++)c.insertBefore(f[d],a)}c.removeChild(a)}},na=function(a,c){for(;a&&!b(a)&&c(a);){var d=a.parentNode;ma(a),a=d}},oa=function(a,b){if(a.nodeName.toUpperCase()===b.toUpperCase())return a;var c=ka(b);return a.style.cssText&&(c.style.cssText=a.style.cssText),R(c,h.from(a.childNodes)),Q(c,a),ma(a),c},pa=l("TEXTAREA"),qa=function(a,b){var c=pa(a[0])?a.val():a.html();return b?c.replace(/[\n\r]/g,""):c},ra=function(b,c){var d=qa(b);if(c){var e=/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;d=d.replace(e,function(a,b,c){c=c.toUpperCase();var d=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(c)&&!!b,e=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(c);return a+(d||e?"\n":"")}),d=a.trim(d)}return d};return{NBSP_CHAR:i,ZERO_WIDTH_NBSP_CHAR:j,blank:D,emptyPara:"<p>"+D+"</p>",makePredByNodeName:l,isEditable:b,isControlSizing:c,buildLayoutInfo:d,makeLayoutInfo:e,isText:m,isVoid:n,isPara:o,isPurePara:q,isInline:s,isBlock:g.not(s),isBodyInline:z,isBody:A,isParaInline:y,isList:t,isTable:r,isCell:u,isBlockquote:v,isBodyContainer:w,isAnchor:x,isDiv:l("DIV"),isLi:p,isBR:l("BR"),isSpan:l("SPAN"),isB:l("B"),isU:l("U"),isS:l("S"),isI:l("I"),isImg:l("IMG"),isTextarea:pa,isEmpty:F,isEmptyAnchor:g.and(x,F),isClosestSibling:B,withClosestSiblings:C,nodeLength:E,isLeftEdgePoint:S,isRightEdgePoint:T,isEdgePoint:U,isLeftEdgeOf:V,isRightEdgeOf:W,prevPoint:Z,nextPoint:$,isSamePoint:_,isVisiblePoint:aa,prevPointUntil:ba,nextPointUntil:ca,isCharPoint:da,walkPoint:ea,ancestor:H,singleChildAncestor:I,listAncestor:J,lastAncestor:K,listNext:N,listPrev:M,listDescendant:O,commonAncestor:L,wrap:P,insertAfter:Q,appendChildNodes:R,position:X,hasChildren:Y,makeOffsetPath:fa,fromOffsetPath:ga,splitTree:ia,splitPoint:ja,create:ka,createText:la,remove:ma,removeWhile:na,replace:oa,html:ra,value:qa}}(),l=function(){var b=function(a,b){var c,d,e=a.parentElement(),f=document.body.createTextRange(),g=h.from(e.childNodes);for(c=0;c<g.length;c++)if(!k.isText(g[c])){if(f.moveToElementText(g[c]),f.compareEndPoints("StartToStart",a)>=0)break;d=g[c]}if(0!==c&&k.isText(g[c-1])){var i=document.body.createTextRange(),j=null;i.moveToElementText(d||e),i.collapse(!d),j=d?d.nextSibling:e.firstChild;var l=a.duplicate();l.setEndPoint("StartToStart",i);for(var m=l.text.replace(/[\r\n]/g,"").length;m>j.nodeValue.length&&j.nextSibling;)m-=j.nodeValue.length,j=j.nextSibling;{j.nodeValue}b&&j.nextSibling&&k.isText(j.nextSibling)&&m===j.nodeValue.length&&(m-=j.nodeValue.length,j=j.nextSibling),e=j,c=m}return{cont:e,offset:c}},c=function(a){var b=function(a,c){var d,e;if(k.isText(a)){var f=k.listPrev(a,g.not(k.isText)),i=h.last(f).previousSibling;d=i||a.parentNode,c+=h.sum(h.tail(f),k.nodeLength),e=!i}else{if(d=a.childNodes[c]||a,k.isText(d))return b(d,0);c=0,e=!1}return{node:d,collapseToStart:e,offset:c}},c=document.body.createTextRange(),d=b(a.node,a.offset);return c.moveToElementText(d.node),c.collapse(d.collapseToStart),c.moveStart("character",d.offset),c},d=function(b,e,i,j){this.sc=b,this.so=e,this.ec=i,this.eo=j;var l=function(){if(f.isW3CRangeSupport){var a=document.createRange();return a.setStart(b,e),a.setEnd(i,j),a}var d=c({node:b,offset:e});return d.setEndPoint("EndToEnd",c({node:i,offset:j})),d};this.getPoints=function(){return{sc:b,so:e,ec:i,eo:j}},this.getStartPoint=function(){return{node:b,offset:e}},this.getEndPoint=function(){return{node:i,offset:j}},this.select=function(){var a=l();if(f.isW3CRangeSupport){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}else a.select();return this},this.normalize=function(){var a=function(a){return k.isVisiblePoint(a)||(a=k.isLeftEdgePoint(a)?k.nextPointUntil(a,k.isVisiblePoint):k.prevPointUntil(a,k.isVisiblePoint)),a},b=a(this.getStartPoint()),c=a(this.getEndPoint());return new d(b.node,b.offset,c.node,c.offset)},this.nodes=function(a,b){a=a||g.ok;var c=b&&b.includeAncestor,d=b&&b.fullyContains,e=this.getStartPoint(),f=this.getEndPoint(),i=[],j=[];return k.walkPoint(e,f,function(b){if(!k.isEditable(b.node)){var e;d?(k.isLeftEdgePoint(b)&&j.push(b.node),k.isRightEdgePoint(b)&&h.contains(j,b.node)&&(e=b.node)):e=c?k.ancestor(b.node,a):b.node,e&&a(e)&&i.push(e)}},!0),h.unique(i)},this.commonAncestor=function(){return k.commonAncestor(b,i)},this.expand=function(a){var c=k.ancestor(b,a),f=k.ancestor(i,a);if(!c&&!f)return new d(b,e,i,j);var g=this.getPoints();return c&&(g.sc=c,g.so=0),f&&(g.ec=f,g.eo=k.nodeLength(f)),new d(g.sc,g.so,g.ec,g.eo)},this.collapse=function(a){return a?new d(b,e,b,e):new d(i,j,i,j)},this.splitText=function(){var a=b===i,c=this.getPoints();return k.isText(i)&&!k.isEdgePoint(this.getEndPoint())&&i.splitText(j),k.isText(b)&&!k.isEdgePoint(this.getStartPoint())&&(c.sc=b.splitText(e),c.so=0,a&&(c.ec=c.sc,c.eo=j-e)),new d(c.sc,c.so,c.ec,c.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var b=this.splitText(),c=b.nodes(null,{fullyContains:!0}),e=k.prevPointUntil(b.getStartPoint(),function(a){return!h.contains(c,a.node)}),f=[];return a.each(c,function(a,b){var c=b.parentNode;e.node!==c&&1===k.nodeLength(c)&&f.push(c),k.remove(b,!1)}),a.each(f,function(a,b){k.remove(b,!1)}),new d(e.node,e.offset,e.node,e.offset).normalize()};var m=function(a){return function(){var c=k.ancestor(b,a);return!!c&&c===k.ancestor(i,a)}};this.isOnEditable=m(k.isEditable),this.isOnList=m(k.isList),this.isOnAnchor=m(k.isAnchor),this.isOnCell=m(k.isCell),this.isLeftEdgeOf=function(a){if(!k.isLeftEdgePoint(this.getStartPoint()))return!1;var b=k.ancestor(this.sc,a);return b&&k.isLeftEdgeOf(this.sc,b)},this.isCollapsed=function(){return b===i&&e===j},this.wrapBodyInlineWithPara=function(){if(k.isBodyContainer(b)&&k.isEmpty(b))return b.innerHTML=k.emptyPara,new d(b.firstChild,0,b.firstChild,0);if(k.isParaInline(b)||k.isPara(b))return this.normalize();var a;if(k.isInline(b)){var c=k.listAncestor(b,g.not(k.isInline));a=h.last(c),k.isInline(a)||(a=c[c.length-2]||b.childNodes[e])}else a=b.childNodes[e>0?e-1:0];var f=k.listPrev(a,k.isParaInline).reverse();if(f=f.concat(k.listNext(a.nextSibling,k.isParaInline)),f.length){var i=k.wrap(h.head(f),"p");k.appendChildNodes(i,h.tail(f))}return this.normalize()},this.insertNode=function(a){var b=this.wrapBodyInlineWithPara().deleteContents(),c=k.splitPoint(b.getStartPoint(),k.isInline(a));return c.rightNode?c.rightNode.parentNode.insertBefore(a,c.rightNode):c.container.appendChild(a),a},this.pasteHTML=function(b){var c=this,d=a("<div></div>").html(b)[0],e=h.from(d.childNodes);return this.wrapBodyInlineWithPara().deleteContents(),a.map(e.reverse(),function(a){return c.insertNode(a)}).reverse()},this.toString=function(){var a=l();return f.isW3CRangeSupport?a.toString():a.text},this.getWordRange=function(a){var b=this.getEndPoint();if(!k.isCharPoint(b))return this;var c=k.prevPointUntil(b,function(a){return!k.isCharPoint(a)});return a&&(b=k.nextPointUntil(b,function(a){return!k.isCharPoint(a)})),new d(c.node,c.offset,b.node,b.offset)},this.bookmark=function(a){return{s:{path:k.makeOffsetPath(a,b),offset:e},e:{path:k.makeOffsetPath(a,i),offset:j}}},this.paraBookmark=function(a){return{s:{path:h.tail(k.makeOffsetPath(h.head(a),b)),offset:e},e:{path:h.tail(k.makeOffsetPath(h.last(a),i)),offset:j}}},this.getClientRects=function(){var a=l();return a.getClientRects()}};return{create:function(a,c,e,g){if(arguments.length)2===arguments.length&&(e=a,g=c);else if(f.isW3CRangeSupport){var h=document.getSelection();if(!h||0===h.rangeCount)return null;if(k.isBody(h.anchorNode))return null;var i=h.getRangeAt(0);a=i.startContainer,c=i.startOffset,e=i.endContainer,g=i.endOffset}else{var j=document.selection.createRange(),l=j.duplicate();l.collapse(!1);var m=j;m.collapse(!0);var n=b(m,!0),o=b(l,!1);k.isText(n.node)&&k.isLeftEdgePoint(n)&&k.isTextNode(o.node)&&k.isRightEdgePoint(o)&&o.node.nextSibling===n.node&&(n=o),a=n.cont,c=n.offset,e=o.cont,g=o.offset}return new d(a,c,e,g)},createFromNode:function(a){var b=a,c=0,d=a,e=k.nodeLength(d);return k.isVoid(b)&&(c=k.listPrev(b).length-1,b=b.parentNode),k.isBR(d)?(e=k.listPrev(d).length-1,d=d.parentNode):k.isVoid(d)&&(e=k.listPrev(d).length,d=d.parentNode),this.create(b,c,d,e)},createFromNodeBefore:function(a){return this.createFromNode(a).collapse(!0)},createFromNodeAfter:function(a){return this.createFromNode(a).collapse()},createFromBookmark:function(a,b){var c=k.fromOffsetPath(a,b.s.path),e=b.s.offset,f=k.fromOffsetPath(a,b.e.path),g=b.e.offset;return new d(c,e,f,g)},createFromParaBookmark:function(a,b){var c=a.s.offset,e=a.e.offset,f=k.fromOffsetPath(h.head(b),a.s.path),g=k.fromOffsetPath(h.last(b),a.e.path);return new d(f,c,g,e)}}}(),m={version:"0.6.7",options:{width:null,height:null,minHeight:null,maxHeight:null,focus:!1,tabsize:4,styleWithSpan:!0,disableLinkTarget:!1,disableDragAndDrop:!1,disableResizeEditor:!1,shortcuts:!0,placeholder:!1,prettifyHtml:!0,iconPrefix:"fa fa-",codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},lang:"en-US",direction:null,toolbar:[["style",["style"]],["font",["bold","italic","underline","clear"]],["fontname",["fontname"]],["fontsize",["fontsize"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture","hr"]],["view",["fullscreen","codeview"]],["help",["help"]]],plugin:{},airMode:!1,airPopover:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]]],styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],defaultFontName:"Helvetica Neue",fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],fontSizes:["8","9","10","11","12","14","18","24","36"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],insertTableMaxSize:{col:10,row:10},maximumImageFileSize:null,oninit:null,onfocus:null,onblur:null,onenter:null,onkeyup:null,onkeydown:null,onImageUpload:null,onImageUploadError:null,onMediaDelete:null,onToolbarClick:null,onsubmit:null,onCreateLink:function(a){return-1!==a.indexOf("@")&&-1===a.indexOf(":")?a="mailto:"+a:-1===a.indexOf("://")&&(a="http://"+a),a},keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"showLinkDialog"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"showLinkDialog"}}},lang:{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize Full",resizeHalf:"Resize Half",resizeQuarter:"Resize Quarter",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Float None",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window"},table:{table:"Table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",normal:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Foreground Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},history:{undo:"Undo",redo:"Redo"}}}},n=function(){var b=function(b){return a.Deferred(function(c){a.extend(new FileReader,{onload:function(a){var b=a.target.result;c.resolve(b)},onerror:function(){c.reject(this)}}).readAsDataURL(b)}).promise()},c=function(b,c){return a.Deferred(function(d){var e=a("<img>");e.one("load",function(){e.off("error abort"),d.resolve(e)}).one("error abort",function(){e.off("load").detach(),d.reject(e)}).css({display:"none"}).appendTo(document.body).attr({src:b,"data-filename":c})}).promise()};return{readFileAsDataURL:b,createImage:c}}(),o=function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221};return{isEdit:function(a){return h.contains([8,9,13,32],a)},isMove:function(a){return h.contains([37,38,39,40],a)},nameFromCode:g.invertObject(a),code:a}}(),p=function(a){var b=[],c=-1,d=a[0],e=function(){var b=l.create(),c={s:{path:[],offset:0},e:{path:[],offset:0}};return{contents:a.html(),bookmark:b?b.bookmark(d):c}},f=function(b){null!==b.contents&&a.html(b.contents),null!==b.bookmark&&l.createFromBookmark(d,b.bookmark).select()};this.undo=function(){c>0&&(c--,f(b[c]))},this.redo=function(){b.length-1>c&&(c++,f(b[c]))},this.recordUndo=function(){c++,b.length>c&&(b=b.slice(0,c)),b.push(e())},this.recordUndo()},q=function(){var b=function(b,c){if(f.jqueryVersion<1.9){var d={};return a.each(c,function(a,c){d[c]=b.css(c)}),d}return b.css.call(b,c)};this.stylePara=function(b,c){a.each(b.nodes(k.isPara,{includeAncestor:!0}),function(b,d){a(d).css(c)})},this.styleNodes=function(b,c){b=b.splitText();var d=c&&c.nodeName||"SPAN",e=!(!c||!c.expandClosestSibling),f=!(!c||!c.onlyPartialContains);if(b.isCollapsed())return[b.insertNode(k.create(d))];var i=k.makePredByNodeName(d),j=a.map(b.nodes(k.isText,{fullyContains:!0}),function(a){return k.singleChildAncestor(a,i)||k.wrap(a,d)});if(e){if(f){var l=b.nodes();i=g.and(i,function(a){return h.contains(l,a)})}return a.map(j,function(b){var c=k.withClosestSiblings(b,i),d=h.head(c),e=h.tail(c);return a.each(e,function(a,b){k.appendChildNodes(d,b.childNodes),k.remove(b)}),h.head(c)})}return j},this.current=function(c,d){var e=a(k.isText(c.sc)?c.sc.parentNode:c.sc),f=["font-family","font-size","text-align","list-style-type","line-height"],g=b(e,f)||{};if(g["font-size"]=parseInt(g["font-size"],10),g["font-bold"]=document.queryCommandState("bold")?"bold":"normal",g["font-italic"]=document.queryCommandState("italic")?"italic":"normal",g["font-underline"]=document.queryCommandState("underline")?"underline":"normal",g["font-strikethrough"]=document.queryCommandState("strikeThrough")?"strikethrough":"normal",g["font-superscript"]=document.queryCommandState("superscript")?"superscript":"normal",g["font-subscript"]=document.queryCommandState("subscript")?"subscript":"normal",c.isOnList()){var h=["circle","disc","disc-leading-zero","square"],i=a.inArray(g["list-style-type"],h)>-1;g["list-style"]=i?"unordered":"ordered"}else g["list-style"]="none";var j=k.ancestor(c.sc,k.isPara);if(j&&j.style["line-height"])g["line-height"]=j.style.lineHeight;else{var l=parseInt(g["line-height"],10)/parseInt(g["font-size"],10);g["line-height"]=l.toFixed(1)}return g.image=k.isImg(d)&&d,g.anchor=c.isOnAnchor()&&k.ancestor(c.sc,k.isAnchor),g.ancestors=k.listAncestor(c.sc,k.isEditable),g.range=c,g}},r=function(){this.insertOrderedList=function(){this.toggleList("OL")},this.insertUnorderedList=function(){this.toggleList("UL")},this.indent=function(){var b=this,c=l.create().wrapBodyInlineWithPara(),d=c.nodes(k.isPara,{includeAncestor:!0}),e=h.clusterBy(d,g.peq2("parentNode"));a.each(e,function(c,d){var e=h.head(d);k.isLi(e)?b.wrapList(d,e.parentNode.nodeName):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return(parseInt(b,10)||0)+25})})}),c.select()},this.outdent=function(){var b=this,c=l.create().wrapBodyInlineWithPara(),d=c.nodes(k.isPara,{includeAncestor:!0}),e=h.clusterBy(d,g.peq2("parentNode"));a.each(e,function(c,d){var e=h.head(d);k.isLi(e)?b.releaseList([d]):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return b=parseInt(b,10)||0,b>25?b-25:""})})}),c.select()},this.toggleList=function(b){var c=this,d=l.create().wrapBodyInlineWithPara(),e=d.nodes(k.isPara,{includeAncestor:!0}),f=d.paraBookmark(e),i=h.clusterBy(e,g.peq2("parentNode"));if(h.find(e,k.isPurePara)){var j=[];a.each(i,function(a,d){j=j.concat(c.wrapList(d,b))}),e=j}else{var m=d.nodes(k.isList,{includeAncestor:!0}).filter(function(c){return!a.nodeName(c,b)});m.length?a.each(m,function(a,c){k.replace(c,b)}):e=this.releaseList(i,!0)}l.createFromParaBookmark(f,e).select()},this.wrapList=function(b,c){var d=h.head(b),e=h.last(b),f=k.isList(d.previousSibling)&&d.previousSibling,g=k.isList(e.nextSibling)&&e.nextSibling,i=f||k.insertAfter(k.create(c||"UL"),e);return b=a.map(b,function(a){return k.isPurePara(a)?k.replace(a,"LI"):a}),k.appendChildNodes(i,b),g&&(k.appendChildNodes(i,h.from(g.childNodes)),k.remove(g)),b},this.releaseList=function(b,c){var d=[];return a.each(b,function(b,e){var f=h.head(e),g=h.last(e),i=c?k.lastAncestor(f,k.isList):f.parentNode,j=i.childNodes.length>1?k.splitTree(i,{node:g.parentNode,offset:k.position(g)+1},{isSkipPaddingBlankHTML:!0}):null,l=k.splitTree(i,{node:f.parentNode,offset:k.position(f)},{isSkipPaddingBlankHTML:!0});e=c?k.listDescendant(l,k.isLi):h.from(l.childNodes).filter(k.isLi),(c||!k.isList(i.parentNode))&&(e=a.map(e,function(a){return k.replace(a,"P")})),a.each(h.from(e).reverse(),function(a,b){k.insertAfter(b,i)});var m=h.compact([i,l,j]);a.each(m,function(b,c){var d=[c].concat(k.listDescendant(c,k.isList));a.each(d.reverse(),function(a,b){k.nodeLength(b)||k.remove(b,!0)})}),d=d.concat(e)}),d}},s=function(){var b=new r;this.insertTab=function(a,b,c){var d=k.createText(new Array(c+1).join(k.NBSP_CHAR));b=b.deleteContents(),b.insertNode(d,!0),b=l.create(d,c),b.select()},this.insertParagraph=function(){var c=l.create();c=c.deleteContents(),c=c.wrapBodyInlineWithPara();var d,e=k.ancestor(c.sc,k.isPara);if(e){if(k.isEmpty(e)&&k.isLi(e))return void b.toggleList(e.parentNode.nodeName);d=k.splitTree(e,c.getStartPoint());var f=k.listDescendant(e,k.isEmptyAnchor);f=f.concat(k.listDescendant(d,k.isEmptyAnchor)),a.each(f,function(a,b){k.remove(b)})}else{var g=c.sc.childNodes[c.so];d=a(k.emptyPara)[0],g?c.sc.insertBefore(d,g):c.sc.appendChild(d)}l.create(d,0).normalize().select()}},t=function(){this.tab=function(a,b){var c=k.ancestor(a.commonAncestor(),k.isCell),d=k.ancestor(c,k.isTable),e=k.listDescendant(d,k.isCell),f=h[b?"prev":"next"](e,c);f&&l.create(f,0).select()},this.createTable=function(b,c){for(var d,e=[],f=0;b>f;f++)e.push("<td>"+k.blank+"</td>");d=e.join("");for(var g,h=[],i=0;c>i;i++)h.push("<tr>"+d+"</tr>");return g=h.join(""),a('<table class="table table-bordered">'+g+"</table>")[0]}},u="bogus",v=function(b){var c=new q,d=new t,e=new s,g=new r;this.createRange=function(a){return this.focus(a),l.create()},this.saveRange=function(a,b){this.focus(a),a.data("range",l.create()),b&&l.create().collapse().select()},this.saveNode=function(a){for(var b=[],c=0,d=a[0].childNodes.length;d>c;c++)b.push(a[0].childNodes[c]);a.data("childNodes",b)},this.restoreRange=function(a){var b=a.data("range");b&&(b.select(),this.focus(a))},this.restoreNode=function(a){a.html("");for(var b=a.data("childNodes"),c=0,d=b.length;d>c;c++)a[0].appendChild(b[c])},this.currentStyle=function(a){var b=l.create();return b?b.isOnEditable()&&c.current(b,a):!1};var i=function(a){var c=k.makeLayoutInfo(a).holder();b.bindCustomEvent(c,a.data("callbacks"),"before.command")(a.html(),a)},j=function(a){var c=k.makeLayoutInfo(a).holder();b.bindCustomEvent(c,a.data("callbacks"),"change")(a.html(),a)};this.undo=function(a){i(a),a.data("NoteHistory").undo(),j(a)},this.redo=function(a){i(a),a.data("NoteHistory").redo(),j(a)};for(var m=this,o=this.beforeCommand=function(a){i(a),m.focus(a)},p=this.afterCommand=function(a,b){a.data("NoteHistory").recordUndo(),b||j(a)},v=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","foreColor","insertHorizontalRule","fontName"],w=0,x=v.length;x>w;w++)this[v[w]]=function(a){return function(b,c){o(b),document.execCommand(a,!1,c),p(b,!0)}}(v[w]);this.tab=function(a,b){var c=this.createRange(a);c.isCollapsed()&&c.isOnCell()?d.tab(c):(o(a),e.insertTab(a,c,b.tabsize),p(a))},this.untab=function(a){var b=this.createRange(a);b.isCollapsed()&&b.isOnCell()&&d.tab(b,!0)},this.insertParagraph=function(a){o(a),e.insertParagraph(a),p(a)},this.insertOrderedList=function(a){o(a),g.insertOrderedList(a),
p(a)},this.insertUnorderedList=function(a){o(a),g.insertUnorderedList(a),p(a)},this.indent=function(a){o(a),g.indent(a),p(a)},this.outdent=function(a){o(a),g.outdent(a),p(a)},this.insertImage=function(a,c,d){n.createImage(c,d).then(function(b){o(a),b.css({display:"",width:Math.min(a.width(),b.width())}),l.create().insertNode(b[0]),l.createFromNodeAfter(b[0]).select(),p(a)}).fail(function(){var c=k.makeLayoutInfo(a).holder();b.bindCustomEvent(c,a.data("callbacks"),"image.upload.error")()})},this.insertNode=function(a,b){o(a),l.create().insertNode(b),l.createFromNodeAfter(b).select(),p(a)},this.insertText=function(a,b){o(a);var c=l.create().insertNode(k.createText(b));l.create(c,k.nodeLength(c)).select(),p(a)},this.pasteHTML=function(a,b){o(a);var c=l.create().pasteHTML(b);l.createFromNodeAfter(h.last(c)).select(),p(a)},this.formatBlock=function(a,b){o(a),b=f.isMSIE?"<"+b+">":b,document.execCommand("FormatBlock",!1,b),p(a)},this.formatPara=function(a){o(a),this.formatBlock(a,"P"),p(a)};for(var w=1;6>=w;w++)this["formatH"+w]=function(a){return function(b){this.formatBlock(b,"H"+a)}}(w);this.fontSize=function(b,d){var e=l.create(),f=e.isCollapsed();if(f){var g=c.styleNodes(e),i=h.head(g);a(g).css({"font-size":d+"px"}),i&&!k.nodeLength(i)&&(i.innerHTML=k.ZERO_WIDTH_NBSP_CHAR,l.createFromNodeAfter(i.firstChild).select(),b.data(u,i))}else o(b),a(c.styleNodes(e)).css({"font-size":d+"px"}),p(b)},this.removeBogus=function(a){var b=a.data(u);if(b){var c=h.find(h.from(b.childNodes),k.isText),d=c.nodeValue.indexOf(k.ZERO_WIDTH_NBSP_CHAR);-1!==d&&c.deleteData(d,1),k.isEmpty(b)&&k.remove(b),a.removeData(u)}},this.lineHeight=function(a,b){o(a),c.stylePara(l.create(),{lineHeight:b}),p(a)},this.unlink=function(a){var b=this.createRange();if(b.isOnAnchor()){var c=k.ancestor(b.sc,k.isAnchor);b=l.createFromNode(c),b.select(),o(a),document.execCommand("unlink"),p(a)}},this.createLink=function(b,d,e){var f=d.url,g=d.text,i=d.newWindow,j=d.range,k=j.toString()!==g;o(b),e.onCreateLink&&(f=e.onCreateLink(f));var m=[];if(k){var n=j.insertNode(a("<A>"+g+"</A>")[0]);m.push(n)}else m=c.styleNodes(j,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});a.each(m,function(b,c){a(c).attr("href",f),i?a(c).attr("target","_blank"):a(c).removeAttr("target")});var q=l.createFromNodeBefore(h.head(m)),r=q.getStartPoint(),s=l.createFromNodeAfter(h.last(m)),t=s.getEndPoint();l.create(r.node,r.offset,t.node,t.offset).select(),p(b)},this.getLinkInfo=function(b){this.focus(b);var c=l.create().expand(k.isAnchor),d=a(h.head(c.nodes(k.isAnchor)));return{range:c,text:c.toString(),isNewWindow:d.length?"_blank"===d.attr("target"):!1,url:d.length?d.attr("href"):""}},this.color=function(a,b){var c=JSON.parse(b),d=c.foreColor,e=c.backColor;o(a),d&&document.execCommand("foreColor",!1,d),e&&document.execCommand("backColor",!1,e),p(a)},this.insertTable=function(a,b){var c=b.split("x");o(a);var e=l.create().deleteContents();e.insertNode(d.createTable(c[0],c[1])),p(a)},this.floatMe=function(a,b,c){o(a),c.css("float",b),p(a)},this.imageShape=function(a,b,c){o(a),c.removeClass("img-rounded img-circle img-thumbnail"),b&&c.addClass(b),p(a)},this.resize=function(a,b,c){o(a),c.css({width:100*b+"%",height:""}),p(a)},this.resizeTo=function(a,b,c){var d;if(c){var e=a.y/a.x,f=b.data("ratio");d={width:f>e?a.x:a.y/f,height:f>e?a.x*f:a.y}}else d={width:a.x,height:a.y};b.css(d)},this.removeMedia=function(c,d,e){o(c),e.detach(),b.bindCustomEvent(a(),c.data("callbacks"),"media.delete")(e,c),p(c)},this.focus=function(a){a.focus(),f.isFF&&!l.create().isOnEditable()&&l.createFromNode(a[0]).normalize().collapse().select()}},w=function(){this.update=function(b,c){var d=function(b,c){b.find(".dropdown-menu li a").each(function(){var b=a(this).data("value")+""==c+"";this.className=b?"checked":""})},e=function(a,c){var d=b.find(a);d.toggleClass("active",c())};if(c.image){var g=a(c.image);e('button[data-event="imageShape"][data-value="img-rounded"]',function(){return g.hasClass("img-rounded")}),e('button[data-event="imageShape"][data-value="img-circle"]',function(){return g.hasClass("img-circle")}),e('button[data-event="imageShape"][data-value="img-thumbnail"]',function(){return g.hasClass("img-thumbnail")}),e('button[data-event="imageShape"]:not([data-value])',function(){return!g.is(".img-rounded, .img-circle, .img-thumbnail")});var h=g.css("float");e('button[data-event="floatMe"][data-value="left"]',function(){return"left"===h}),e('button[data-event="floatMe"][data-value="right"]',function(){return"right"===h}),e('button[data-event="floatMe"][data-value="none"]',function(){return"left"!==h&&"right"!==h});var i=g.attr("style");return e('button[data-event="resize"][data-value="1"]',function(){return!!/(^|\s)(max-)?width\s*:\s*100%/.test(i)}),e('button[data-event="resize"][data-value="0.5"]',function(){return!!/(^|\s)(max-)?width\s*:\s*50%/.test(i)}),void e('button[data-event="resize"][data-value="0.25"]',function(){return!!/(^|\s)(max-)?width\s*:\s*25%/.test(i)})}var j=b.find(".note-fontname");if(j.length){var k=c["font-family"];if(k){for(var l=k.split(","),m=0,n=l.length;n>m&&(k=l[m].replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,""),!f.isFontInstalled(k));m++);j.find(".note-current-fontname").text(k),d(j,k)}}var o=b.find(".note-fontsize");o.find(".note-current-fontsize").text(c["font-size"]),d(o,parseFloat(c["font-size"]));var p=b.find(".note-height");d(p,parseFloat(c["line-height"])),e('button[data-event="bold"]',function(){return"bold"===c["font-bold"]}),e('button[data-event="italic"]',function(){return"italic"===c["font-italic"]}),e('button[data-event="underline"]',function(){return"underline"===c["font-underline"]}),e('button[data-event="strikethrough"]',function(){return"strikethrough"===c["font-strikethrough"]}),e('button[data-event="superscript"]',function(){return"superscript"===c["font-superscript"]}),e('button[data-event="subscript"]',function(){return"subscript"===c["font-subscript"]}),e('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),e('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),e('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),e('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),e('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]}),e('button[data-event="insertOrderedList"]',function(){return"ordered"===c["list-style"]})},this.updateRecentColor=function(b,c,d){var e=a(b).closest(".note-color"),f=e.find(".note-recent-color"),g=JSON.parse(f.attr("data-value"));g[c]=d,f.attr("data-value",JSON.stringify(g));var h="backColor"===c?"background-color":"color";f.find("i").css(h,d)}},x=function(){var a=new w;this.update=function(b,c){a.update(b,c)},this.updateRecentColor=function(b,c,d){a.updateRecentColor(b,c,d)},this.activate=function(a){a.find("button").not('button[data-event="codeview"]').removeClass("disabled")},this.deactivate=function(a){a.find("button").not('button[data-event="codeview"]').addClass("disabled")},this.updateFullscreen=function(a,b){var c=a.find('button[data-event="fullscreen"]');c.toggleClass("active",b)},this.updateCodeview=function(a,b){var c=a.find('button[data-event="codeview"]');c.toggleClass("active",b),b?this.deactivate(a):this.activate(a)},this.get=function(a,b){var c=k.makeLayoutInfo(a).toolbar();return c.find("[data-name="+b+"]")},this.setButtonState=function(a,b,c){c=c===!1?!1:!0;var d=this.get(a,b);d.toggleClass("active",c)}},y=24,z=function(){var b=a(document);this.attach=function(a,b){b.disableResizeEditor||a.statusbar().on("mousedown",c)};var c=function(a){a.preventDefault(),a.stopPropagation();var c=k.makeLayoutInfo(a.target).editable(),d=c.offset().top-b.scrollTop(),e=k.makeLayoutInfo(a.currentTarget||a.target),f=e.editor().data("options");b.on("mousemove",function(a){var b=a.clientY-(d+y);b=f.minHeight>0?Math.max(b,f.minHeight):b,b=f.maxHeight>0?Math.min(b,f.maxHeight):b,c.height(b)}).one("mouseup",function(){b.off("mousemove")})}},A=function(){var b=new w,c=function(b,c){var d=a(b),e=c?d.offset():d.position(),f=d.outerHeight(!0);return{left:e.left,top:e.top+f}},d=function(a,b){a.css({display:"block",left:b.left,top:b.top})},e=20;this.update=function(f,i,j){b.update(f,i);var k=f.find(".note-link-popover");if(i.anchor){var l=k.find("a"),m=a(i.anchor).attr("href"),n=a(i.anchor).attr("target");l.attr("href",m).html(m),n?l.attr("target","_blank"):l.removeAttr("target"),d(k,c(i.anchor,j))}else k.hide();var o=f.find(".note-image-popover");i.image?d(o,c(i.image,j)):o.hide();var p=f.find(".note-air-popover");if(j&&!i.range.isCollapsed()){var q=h.last(i.range.getClientRects());if(q){var r=g.rect2bnd(q);d(p,{left:Math.max(r.left+r.width/2-e,0),top:r.top+r.height})}}else p.hide()},this.updateRecentColor=function(a,b,c){a.updateRecentColor(a,b,c)},this.hide=function(a){a.children().hide()}},B=function(b){var c=a(document),d=function(d){if(k.isControlSizing(d.target)){d.preventDefault(),d.stopPropagation();var e=k.makeLayoutInfo(d.target),f=e.handle(),g=e.popover(),h=e.editable(),i=e.editor(),j=f.find(".note-control-selection").data("target"),l=a(j),m=l.offset(),n=c.scrollTop(),o=i.data("options").airMode;c.on("mousemove",function(a){b.invoke("editor.resizeTo",{x:a.clientX-m.left,y:a.clientY-(m.top-n)},l,!a.shiftKey),b.invoke("handle.update",f,{image:j},o),b.invoke("popover.update",g,{image:j},o)}).one("mouseup",function(){c.off("mousemove"),b.invoke("editor.afterCommand",h)}),l.data("ratio")||l.data("ratio",l.height()/l.width())}};this.attach=function(a){a.handle().on("mousedown",d)},this.update=function(b,c,d){var e=b.find(".note-control-selection");if(c.image){var f=a(c.image),g=d?f.offset():f.position(),h={w:f.outerWidth(!0),h:f.outerHeight(!0)};e.css({display:"block",left:g.left,top:g.top,width:h.w,height:h.h}).data("target",c.image);var i=h.w+"x"+h.h;e.find(".note-control-selection-info").text(i)}else e.hide()},this.hide=function(a){a.children().hide()}},C=function(b){var c=a(window),d=a("html, body");this.toggle=function(a){var e=a.editor(),f=a.toolbar(),g=a.editable(),h=a.codable(),i=function(a){g.css("height",a.h),h.css("height",a.h),h.data("cmeditor")&&h.data("cmeditor").setsize(null,a.h)};e.toggleClass("fullscreen");var j=e.hasClass("fullscreen");j?(g.data("orgheight",g.css("height")),c.on("resize",function(){i({h:c.height()-f.outerHeight()})}).trigger("resize"),d.css("overflow","hidden")):(c.off("resize"),i({h:g.data("orgheight")}),d.css("overflow","visible")),b.invoke("toolbar.updateFullscreen",f,j)}};f.hasCodeMirror&&(f.isSupportAmd?require(["CodeMirror"],function(a){b=a}):b=window.CodeMirror);var D=function(a){this.sync=function(b){var c=a.invoke("codeview.isActivated",b);c&&f.hasCodeMirror&&b.codable().data("cmEditor").save()},this.isActivated=function(a){var b=a.editor();return b.hasClass("codeview")},this.toggle=function(a){this.isActivated(a)?this.deactivate(a):this.activate(a)},this.activate=function(c){var d=c.editor(),e=c.toolbar(),g=c.editable(),h=c.codable(),i=c.popover(),j=c.handle(),l=d.data("options");if(h.val(k.html(g,l.prettifyHtml)),h.height(g.height()),a.invoke("toolbar.updateCodeview",e,!0),a.invoke("popover.hide",i),a.invoke("handle.hide",j),d.addClass("codeview"),h.focus(),f.hasCodeMirror){var m=b.fromTextArea(h[0],l.codemirror);if(l.codemirror.tern){var n=new b.TernServer(l.codemirror.tern);m.ternServer=n,m.on("cursorActivity",function(a){n.updateArgHints(a)})}m.setSize(null,g.outerHeight()),h.data("cmEditor",m)}},this.deactivate=function(b){var c=b.holder(),d=b.editor(),e=b.toolbar(),g=b.editable(),h=b.codable(),i=d.data("options");if(f.hasCodeMirror){var j=h.data("cmEditor");h.val(j.getValue()),j.toTextArea()}var l=k.value(h,i.prettifyHtml)||k.emptyPara,m=g.html()!==l;g.html(l),g.height(i.height?h.height():"auto"),d.removeClass("codeview"),m&&a.bindCustomEvent(c,g.data("callbacks"),"change")(g.html(),g),g.focus(),a.invoke("toolbar.updateCodeview",e,!1)}},E=function(b){var c=a(document);this.attach=function(a,b){b.airMode||b.disableDragAndDrop?c.on("drop",function(a){a.preventDefault()}):this.attachDragAndDropEvent(a,b)},this.attachDragAndDropEvent=function(d,e){var f=a(),g=d.editor(),h=d.dropzone(),i=h.find(".note-dropzone-message");c.on("dragenter",function(a){var c=b.invoke("codeview.isActivated",d),j=g.width()>0&&g.height()>0;c||f.length||!j||(g.addClass("dragover"),h.width(g.width()),h.height(g.height()),i.text(e.langInfo.image.dragImageHere)),f=f.add(a.target)}).on("dragleave",function(a){f=f.not(a.target),f.length||g.removeClass("dragover")}).on("drop",function(){f=a(),g.removeClass("dragover")}),h.on("dragenter",function(){h.addClass("hover"),i.text(e.langInfo.image.dropImage)}).on("dragleave",function(){h.removeClass("hover"),i.text(e.langInfo.image.dragImageHere)}),h.on("drop",function(c){c.preventDefault();var d=c.originalEvent.dataTransfer,e=d.getData("text/html"),f=d.getData("text/plain"),g=k.makeLayoutInfo(c.currentTarget||c.target);d&&d.files&&d.files.length?(g.editable().focus(),b.insertImages(g,d.files)):e?a(e).each(function(){g.editable().focus(),b.invoke("editor.insertNode",g.editable(),this)}):f&&(g.editable().focus(),b.invoke("editor.insertText",g.editable(),f))}).on("dragover",!1)}},F=function(a){this.attach=function(a){a.editable().on("paste",b)};var b=function(b){var c=b.originalEvent.clipboardData,d=k.makeLayoutInfo(b.currentTarget||b.target),e=d.editable();if(!c||!c.items||!c.items.length){var f=e.data("callbacks");if(!f.onImageUpload)return;return a.invoke("editor.saveNode",e),a.invoke("editor.saveRange",e),e.html(""),void setTimeout(function(){var b=e.find("img");if(b.length&&-1!==b[0].src.indexOf("data:")){for(var c=b[0].src,f=atob(c.split(",")[1]),g=new Uint8Array(f.length),h=0;h<f.length;h++)g[h]=f.charCodeAt(h);var i=new Blob([g],{type:"image/png"});i.name="clipboard.png",a.invoke("editor.restoreNode",e),a.invoke("editor.restoreRange",e),a.insertImages(d,[i]),a.invoke("editor.afterCommand",e)}else{var j=e.html();a.invoke("editor.restoreNode",e),a.invoke("editor.restoreRange",e),a.invoke("editor.focus",e);try{a.invoke("editor.pasteHTML",e,j)}catch(k){a.invoke("editor.insertText",e,j)}}},0)}var g=h.head(c.items),i="file"===g.kind&&-1!==g.type.indexOf("image/");i&&a.insertImages(d,[g.getAsFile()]),a.invoke("editor.afterCommand",e)}},G=function(b){var c=function(a,b){a.toggleClass("disabled",!b),a.attr("disabled",!b)},d=function(a,b){a.on("keypress",function(a){a.keyCode===o.code.ENTER&&b.trigger("click")})};this.showLinkDialog=function(b,e,f){return a.Deferred(function(a){var b=e.find(".note-link-dialog"),g=b.find(".note-link-text"),h=b.find(".note-link-url"),i=b.find(".note-link-btn"),j=b.find("input[type=checkbox]");b.one("shown.bs.modal",function(){g.val(f.text),g.on("input",function(){c(i,g.val()&&h.val()),f.text=g.val()}),f.url||(f.url=f.text,c(i,f.text)),h.on("input",function(){c(i,g.val()&&h.val()),f.text||g.val(h.val())}).val(f.url).trigger("focus").trigger("select"),d(h,i),d(g,i),j.prop("checked",f.newWindow),i.one("click",function(c){c.preventDefault(),a.resolve({range:f.range,url:h.val(),text:g.val(),newWindow:j.is(":checked")}),b.modal("hide")})}).one("hidden.bs.modal",function(){g.off("input keypress"),h.off("input keypress"),i.off("click"),"pending"===a.state()&&a.reject()}).modal("show")}).promise()},this.show=function(a){var c=a.editor(),d=a.dialog(),e=a.editable(),f=a.popover(),g=b.invoke("editor.getLinkInfo",e),h=c.data("options");b.invoke("editor.saveRange",e),this.showLinkDialog(e,d,g).then(function(a){b.invoke("editor.restoreRange",e),b.invoke("editor.createLink",e,a,h),b.invoke("popover.hide",f)}).fail(function(){b.invoke("editor.restoreRange",e)})}},H=function(b){var c=function(a,b){a.toggleClass("disabled",!b),a.attr("disabled",!b)},d=function(a,b){a.on("keypress",function(a){a.keyCode===o.code.ENTER&&b.trigger("click")})};this.show=function(a){var c=a.dialog(),d=a.editable();b.invoke("editor.saveRange",d),this.showImageDialog(d,c).then(function(c){b.invoke("editor.restoreRange",d),"string"==typeof c?b.invoke("editor.insertImage",d,c):b.insertImages(a,c)}).fail(function(){b.invoke("editor.restoreRange",d)})},this.showImageDialog=function(b,e){return a.Deferred(function(a){var b=e.find(".note-image-dialog"),f=e.find(".note-image-input"),g=e.find(".note-image-url"),h=e.find(".note-image-btn");b.one("shown.bs.modal",function(){f.replaceWith(f.clone().on("change",function(){a.resolve(this.files||this.value),b.modal("hide")}).val("")),h.click(function(c){c.preventDefault(),a.resolve(g.val()),b.modal("hide")}),g.on("keyup paste",function(a){var b;b="paste"===a.type?a.originalEvent.clipboardData.getData("text"):g.val(),c(h,b)}).val("").trigger("focus"),d(g,h)}).one("hidden.bs.modal",function(){f.off("change"),g.off("keyup paste keypress"),h.off("click"),"pending"===a.state()&&a.reject()}).modal("show")})}},I=function(b){this.showHelpDialog=function(b,c){return a.Deferred(function(a){var b=c.find(".note-help-dialog");b.one("hidden.bs.modal",function(){a.resolve()}).modal("show")}).promise()},this.show=function(a){var c=a.dialog(),d=a.editable();b.invoke("editor.saveRange",d,!0),this.showHelpDialog(d,c).then(function(){b.invoke("editor.restoreRange",d)})}},J=function(){var b=this.modules={editor:new v(this),toolbar:new x(this),statusbar:new z(this),popover:new A(this),handle:new B(this),fullscreen:new C(this),codeview:new D(this),dragAndDrop:new E(this),clipboard:new F(this),linkDialog:new G(this),imageDialog:new H(this),helpDialog:new I(this)};this.invoke=function(){var a=h.head(h.from(arguments)),b=h.tail(h.from(arguments)),c=a.split("."),d=c.length>1,e=d&&h.head(c),f=d?h.last(c):h.head(c),g=this.getModule(e),i=g[f];return i&&i.apply(g,b)},this.getModule=function(a){return this.modules[a]||this.modules.editor};var c=this.bindCustomEvent=function(a,b,c){return function(){var d=b[g.namespaceToCamel(c,"on")];return d&&d.apply(a[0],arguments),a.trigger("summernote."+c,arguments)}};this.insertImages=function(d,e){var f=d.editor(),g=d.editable(),h=d.holder(),i=g.data("callbacks"),j=f.data("options");i.onImageUpload?c(h,i,"image.upload")(e):a.each(e,function(a,d){var e=d.name;j.maximumImageFileSize&&j.maximumImageFileSize<d.size?c(h,i,"image.upload.error")(j.langInfo.image.maximumFileSizeError):n.readFileAsDataURL(d).then(function(a){b.editor.insertImage(g,a,e)}).fail(function(){c(h,i,"image.upload.error")(j.langInfo.image.maximumFileSizeError)})})};var d={showLinkDialog:function(a){b.linkDialog.show(a)},showImageDialog:function(a){b.imageDialog.show(a)},showHelpDialog:function(a){b.helpDialog.show(a)},fullscreen:function(a){b.fullscreen.toggle(a)},codeview:function(a){b.codeview.toggle(a)}},e=function(a){k.isImg(a.target)&&a.preventDefault()},i=function(a){var c=k.makeLayoutInfo(a.currentTarget||a.target);b.editor.removeBogus(c.editable()),j(a)},j=function(a){setTimeout(function(){var c=k.makeLayoutInfo(a.currentTarget||a.target),d=b.editor.currentStyle(a.target);if(d){var e=c.editor().data("options").airMode;e||b.toolbar.update(c.toolbar(),d),b.popover.update(c.popover(),d,e),b.handle.update(c.handle(),d,e)}},0)},l=function(a){var c=k.makeLayoutInfo(a.currentTarget||a.target);b.popover.hide(c.popover()),b.handle.hide(c.handle())},m=function(b){var c=a(b.target).closest("[data-event]");c.length&&b.preventDefault()},q=function(c){var e=a(c.target).closest("[data-event]");if(e.length){var f,g=e.attr("data-event"),i=e.attr("data-value"),l=e.attr("data-hide"),m=k.makeLayoutInfo(c.target);if(-1!==a.inArray(g,["resize","floatMe","removeMedia","imageShape"])){var n=m.handle().find(".note-control-selection");f=a(n.data("target"))}if(l&&e.parents(".popover").hide(),a.isFunction(a.summernote.pluginEvents[g]))a.summernote.pluginEvents[g](c,b.editor,m,i);else if(b.editor[g]){var o=m.editable();o.focus(),b.editor[g](o,i,f),c.preventDefault()}else d[g]&&(d[g].call(this,m),c.preventDefault());if(-1!==a.inArray(g,["backColor","foreColor"])){var p=m.editor().data("options",p),q=p.airMode?b.popover:b.toolbar;q.updateRecentColor(h.head(e),g,i)}j(c)}},r=18,s=function(b,c){var d,e=a(b.target.parentNode),f=e.next(),g=e.find(".note-dimension-picker-mousecatcher"),h=e.find(".note-dimension-picker-highlighted"),i=e.find(".note-dimension-picker-unhighlighted");if(void 0===b.offsetX){var j=a(b.target).offset();d={x:b.pageX-j.left,y:b.pageY-j.top}}else d={x:b.offsetX,y:b.offsetY};var k={c:Math.ceil(d.x/r)||1,r:Math.ceil(d.y/r)||1};h.css({width:k.c+"em",height:k.r+"em"}),g.attr("data-value",k.c+"x"+k.r),3<k.c&&k.c<c.insertTableMaxSize.col&&i.css({width:k.c+1+"em"}),3<k.r&&k.r<c.insertTableMaxSize.row&&i.css({height:k.r+1+"em"}),f.html(k.c+" x "+k.r)};this.bindKeyMap=function(c,e){var f=c.editor(),g=c.editable();g.on("keydown",function(h){var i=[];h.metaKey&&i.push("CMD"),h.ctrlKey&&!h.altKey&&i.push("CTRL"),h.shiftKey&&i.push("SHIFT");var j=o.nameFromCode[h.keyCode];j&&i.push(j);var k,l=i.join("+"),m=e[l];if(m){if(k=a.summernote.pluginEvents[l],a.isFunction(k)&&k(h,b.editor,c))return!1;k=a.summernote.pluginEvents[m],a.isFunction(k)?k(h,b.editor,c):b.editor[m]?(b.editor[m](g,f.data("options")),h.preventDefault()):d[m]&&(d[m].call(this,c),h.preventDefault())}else o.isEdit(h.keyCode)&&b.editor.afterCommand(g)})},this.attach=function(a,c){c.shortcuts&&this.bindKeyMap(a,c.keyMap[f.isMac?"mac":"pc"]),a.editable().on("mousedown",e),a.editable().on("keyup mouseup",i),a.editable().on("scroll blur",l),b.clipboard.attach(a,c),b.handle.attach(a,c),a.popover().on("click",q),a.popover().on("mousedown",m),b.dragAndDrop.attach(a,c),c.airMode||(a.toolbar().on("click",q),a.toolbar().on("mousedown",m),b.statusbar.attach(a,c));var d=c.airMode?a.popover():a.toolbar(),g=d.find(".note-dimension-picker-mousecatcher");g.css({width:c.insertTableMaxSize.col+"em",height:c.insertTableMaxSize.row+"em"}).on("mousemove",function(a){s(a,c)}),a.editor().data("options",c),f.isMSIE||setTimeout(function(){document.execCommand("styleWithCSS",0,c.styleWithSpan)},0);var j=new p(a.editable());a.editable().data("NoteHistory",j),a.editable().data("callbacks",{onInit:c.onInit,onFocus:c.onFocus,onBlur:c.onBlur,onKeydown:c.onKeydown,onKeyup:c.onKeyup,onMousedown:c.onMousedown,onEnter:c.onEnter,onPaste:c.onPaste,onBeforeCommand:c.onBeforeCommand,onChange:c.onChange,onImageUpload:c.onImageUpload,onImageUploadError:c.onImageUploadError,onMediaDelete:c.onMediaDelete}),k.isTextarea(h.head(a.holder()))&&a.holder().closest("form").submit(function(){a.holder().val(a.holder().code())})},this.attachCustomEvent=function(b,d){var e=b.holder(),g=b.editable(),i=g.data("callbacks");g.focus(c(e,i,"focus")),g.blur(c(e,i,"blur")),g.keydown(function(a){a.keyCode===o.code.ENTER&&c(e,i,"enter").call(this,a),c(e,i,"keydown").call(this,a)}),g.keyup(c(e,i,"keyup")),g.on("mousedown",c(e,i,"mousedown")),g.on("mouseup",c(e,i,"mouseup")),g.on("scroll",c(e,i,"scroll")),g.on("paste",c(e,i,"paste"));var j=f.isMSIE?"DOMCharacterDataModified DOMSubtreeModified DOMNodeInserted":"input";g.on(j,function(){c(e,i,"change")(g.html(),g)}),d.airMode||(b.toolbar().click(c(e,i,"toolbar.click")),b.popover().click(c(e,i,"popover.click"))),k.isTextarea(h.head(e))&&e.closest("form").submit(function(a){c(e,i,"submit").call(this,a,e.code())}),c(e,i,"init")(b);for(var l=0,m=a.summernote.plugins.length;m>l;l++)a.isFunction(a.summernote.plugins[l].init)&&a.summernote.plugins[l].init(b)},this.detach=function(a,b){a.holder().off(),a.editable().off(),a.popover().off(),a.handle().off(),a.dialog().off(),b.airMode||(a.dropzone().off(),a.toolbar().off(),a.statusbar().off())}},K=function(){var b=function(a,b){var c=b.event,d=b.value,e=b.title,f=b.className,g=b.dropdown,h=b.hide;return'<button type="button" class="btn btn-default btn-sm btn-small'+(f?" "+f:"")+(g?" dropdown-toggle":"")+'"'+(g?' data-toggle="dropdown"':"")+(e?' title="'+e+'"':"")+(c?' data-event="'+c+'"':"")+(d?" data-value='"+d+"'":"")+(h?" data-hide='"+h+"'":"")+' tabindex="-1">'+a+(g?' <span class="caret"></span>':"")+"</button>"+(g||"")},c=function(a,c){var d='<i class="'+a+'"></i>';return b(d,c)},d=function(b,c){var d=a('<div class="'+b+' popover bottom in" style="display: none;"><div class="arrow"></div><div class="popover-content"></div></div>');return d.find(".popover-content").append(c),d},e=function(a,b,c,d){return'<div class="'+a+' modal" aria-hidden="false"><div class="modal-dialog"><div class="modal-content">'+(b?'<div class="modal-header"><button type="button" class="close" aria-hidden="true" tabindex="-1">×</button><h4 class="modal-title">'+b+"</h4></div>":"")+'<div class="modal-body">'+c+"</div>"+(d?'<div class="modal-footer">'+d+"</div>":"")+"</div></div></div>"},h={picture:function(a,b){return c(b.iconPrefix+"picture-o",{event:"showImageDialog",title:a.image.image,hide:!0})},link:function(a,b){return c(b.iconPrefix+"link",{event:"showLinkDialog",title:a.link.link,hide:!0})},table:function(a,b){var d='<ul class="note-table dropdown-menu"><div class="note-dimension-picker"><div class="note-dimension-picker-mousecatcher" data-event="insertTable" data-value="1x1"></div><div class="note-dimension-picker-highlighted"></div><div class="note-dimension-picker-unhighlighted"></div></div><div class="note-dimension-display"> 1 x 1 </div></ul>';return c(b.iconPrefix+"table",{title:a.table.table,dropdown:d})},style:function(a,b){var d=b.styleTags.reduce(function(b,c){var d=a.style["p"===c?"normal":c];return b+'<li><a data-event="formatBlock" href="#" data-value="'+c+'">'+("p"===c||"pre"===c?d:"<"+c+">"+d+"</"+c+">")+"</a></li>"},"");return c(b.iconPrefix+"magic",{title:a.style.style,dropdown:'<ul class="dropdown-menu">'+d+"</ul>"})},fontname:function(a,c){var d=[],e=c.fontNames.reduce(function(a,b){return f.isFontInstalled(b)||-1!==c.fontNamesIgnoreCheck.indexOf(b)?(d.push(b),a+'<li><a data-event="fontName" href="#" data-value="'+b+'" style="font-family:\''+b+'\'"><i class="'+c.iconPrefix+'check"></i> '+b+"</a></li>"):a},""),g=f.isFontInstalled(c.defaultFontName),h=g?c.defaultFontName:d[0],i='<span class="note-current-fontname">'+h+"</span>";return b(i,{title:a.font.name,dropdown:'<ul class="dropdown-menu note-check">'+e+"</ul>"})},fontsize:function(a,c){var d=c.fontSizes.reduce(function(a,b){return a+'<li><a data-event="fontSize" href="#" data-value="'+b+'"><i class="fa fa-check"></i> '+b+"</a></li>"},""),e='<span class="note-current-fontsize">11</span>';return b(e,{title:a.font.size,dropdown:'<ul class="dropdown-menu note-check">'+d+"</ul>"})},color:function(a,c){var d='<i class="'+c.iconPrefix+'font" style="color:black;background-color:yellow;"></i>',e=b(d,{className:"note-recent-color",title:a.color.recent,event:"color",value:'{"backColor":"yellow"}'}),f='<ul class="dropdown-menu"><li><div class="btn-group"><div class="note-palette-title">'+a.color.background+'</div><div class="note-color-reset" data-event="backColor" data-value="inherit" title="'+a.color.transparent+'">'+a.color.setTransparent+'</div><div class="note-color-palette" data-target-event="backColor"></div></div><div class="btn-group"><div class="note-palette-title">'+a.color.foreground+'</div><div class="note-color-reset" data-event="foreColor" data-value="inherit" title="'+a.color.reset+'">'+a.color.resetToDefault+'</div><div class="note-color-palette" data-target-event="foreColor"></div></div></li></ul>',g=b("",{title:a.color.more,dropdown:f});return e+g},bold:function(a,b){return c(b.iconPrefix+"bold",{event:"bold",title:a.font.bold})},italic:function(a,b){return c(b.iconPrefix+"italic",{event:"italic",title:a.font.italic})},underline:function(a,b){return c(b.iconPrefix+"underline",{event:"underline",title:a.font.underline})},strikethrough:function(a){return c("fa fa-strikethrough",{event:"strikethrough",title:a.font.strikethrough})},superscript:function(a){return c("fa fa-superscript",{event:"superscript",title:a.font.superscript})},subscript:function(a){return c("fa fa-subscript",{event:"subscript",title:a.font.subscript})},clear:function(a,b){return c(b.iconPrefix+"eraser",{event:"removeFormat",title:a.font.clear})},ul:function(a,b){return c(b.iconPrefix+"list-ul",{event:"insertUnorderedList",title:a.lists.unordered})},ol:function(a,b){return c(b.iconPrefix+"list-ol",{event:"insertOrderedList",title:a.lists.ordered})},paragraph:function(a,b){var d=c(b.iconPrefix+"align-left",{title:a.paragraph.left,event:"justifyLeft"}),e=c(b.iconPrefix+"align-center",{title:a.paragraph.center,event:"justifyCenter"}),f=c(b.iconPrefix+"align-right",{title:a.paragraph.right,event:"justifyRight"}),g=c(b.iconPrefix+"align-justify",{title:a.paragraph.justify,event:"justifyFull"}),h=c(b.iconPrefix+"outdent",{title:a.paragraph.outdent,event:"outdent"}),i=c(b.iconPrefix+"indent",{title:a.paragraph.indent,event:"indent"}),j='<div class="dropdown-menu"><div class="note-align btn-group">'+d+e+f+g+'</div><div class="note-list btn-group">'+i+h+"</div></div>";return c(b.iconPrefix+"align-left",{title:a.paragraph.paragraph,dropdown:j})},height:function(a,b){var d=b.lineHeights.reduce(function(a,c){return a+'<li><a data-event="lineHeight" href="#" data-value="'+parseFloat(c)+'"><i class="'+b.iconPrefix+'check"></i> '+c+"</a></li>"},"");return c(b.iconPrefix+"text-height",{title:a.font.height,dropdown:'<ul class="dropdown-menu note-check">'+d+"</ul>"})},help:function(a,b){return c(b.iconPrefix+"question",{event:"showHelpDialog",title:a.options.help,hide:!0})},fullscreen:function(a,b){return c(b.iconPrefix+"arrows-alt",{event:"fullscreen",title:a.options.fullscreen})},codeview:function(a,b){return c(b.iconPrefix+"code",{event:"codeview",title:a.options.codeview})},undo:function(a,b){return c(b.iconPrefix+"undo",{event:"undo",title:a.history.undo})},redo:function(a,b){return c(b.iconPrefix+"repeat",{event:"redo",title:a.history.redo})},hr:function(a,b){return c(b.iconPrefix+"minus",{event:"insertHorizontalRule",title:a.hr.insert})}},i=function(e,f){var g=function(){var a=c(f.iconPrefix+"edit",{title:e.link.edit,event:"showLinkDialog",hide:!0}),b=c(f.iconPrefix+"unlink",{title:e.link.unlink,event:"unlink"}),g='<a href="http://www.google.com" target="_blank">www.google.com</a> <div class="note-insert btn-group">'+a+b+"</div>";return d("note-link-popover",g)},i=function(){var a=b('<span class="note-fontsize-10">100%</span>',{title:e.image.resizeFull,event:"resize",value:"1"}),g=b('<span class="note-fontsize-10">50%</span>',{title:e.image.resizeHalf,event:"resize",value:"0.5"}),h=b('<span class="note-fontsize-10">25%</span>',{title:e.image.resizeQuarter,event:"resize",value:"0.25"}),i=c(f.iconPrefix+"align-left",{title:e.image.floatLeft,event:"floatMe",value:"left"}),j=c(f.iconPrefix+"align-right",{title:e.image.floatRight,event:"floatMe",value:"right"}),k=c(f.iconPrefix+"align-justify",{title:e.image.floatNone,event:"floatMe",value:"none"}),l=c(f.iconPrefix+"square",{title:e.image.shapeRounded,event:"imageShape",value:"img-rounded"}),m=c(f.iconPrefix+"circle-o",{title:e.image.shapeCircle,event:"imageShape",value:"img-circle"}),n=c(f.iconPrefix+"picture-o",{title:e.image.shapeThumbnail,event:"imageShape",value:"img-thumbnail"}),o=c(f.iconPrefix+"times",{title:e.image.shapeNone,event:"imageShape",value:""}),p=c(f.iconPrefix+"trash-o",{title:e.image.remove,event:"removeMedia",value:"none"}),q='<div class="btn-group">'+a+g+h+'</div><div class="btn-group">'+i+j+k+'</div><div class="btn-group">'+l+m+n+o+'</div><div class="btn-group">'+p+"</div>";return d("note-image-popover",q)},j=function(){for(var b=a("<div />"),c=0,g=f.airPopover.length;g>c;c++){for(var i=f.airPopover[c],j=a('<div class="note-'+i[0]+' btn-group">'),k=0,l=i[1].length;l>k;k++){var m=a(h[i[1][k]](e,f));m.attr("data-name",i[1][k]),j.append(m)}b.append(j)}return d("note-air-popover",b.children())},k=a('<div class="note-popover" />');return k.append(g()),k.append(i()),f.airMode&&k.append(j()),k},j=function(){return'<div class="note-handle"><div class="note-control-selection"><div class="note-control-selection-bg"></div><div class="note-control-holder note-control-nw"></div><div class="note-control-holder note-control-ne"></div><div class="note-control-holder note-control-sw"></div><div class="note-control-sizing note-control-se"></div><div class="note-control-selection-info"></div></div></div>';
},l=function(a,b){var c="note-shortcut-col col-xs-6 note-shortcut-",d=[];for(var e in b)b.hasOwnProperty(e)&&d.push('<div class="'+c+'key">'+b[e].kbd+'</div><div class="'+c+'name">'+b[e].text+"</div>");return'<div class="note-shortcut-row row"><div class="'+c+'title col-xs-offset-6">'+a+'</div></div><div class="note-shortcut-row row">'+d.join('</div><div class="note-shortcut-row row">')+"</div>"},m=function(a){var b=[{kbd:"⌘ + B",text:a.font.bold},{kbd:"⌘ + I",text:a.font.italic},{kbd:"⌘ + U",text:a.font.underline},{kbd:"⌘ + \\",text:a.font.clear}];return l(a.shortcut.textFormatting,b)},n=function(a){var b=[{kbd:"⌘ + Z",text:a.history.undo},{kbd:"⌘ + ⇧ + Z",text:a.history.redo},{kbd:"⌘ + ]",text:a.paragraph.indent},{kbd:"⌘ + [",text:a.paragraph.outdent},{kbd:"⌘ + ENTER",text:a.hr.insert}];return l(a.shortcut.action,b)},o=function(a){var b=[{kbd:"⌘ + ⇧ + L",text:a.paragraph.left},{kbd:"⌘ + ⇧ + E",text:a.paragraph.center},{kbd:"⌘ + ⇧ + R",text:a.paragraph.right},{kbd:"⌘ + ⇧ + J",text:a.paragraph.justify},{kbd:"⌘ + ⇧ + NUM7",text:a.lists.ordered},{kbd:"⌘ + ⇧ + NUM8",text:a.lists.unordered}];return l(a.shortcut.paragraphFormatting,b)},p=function(a){var b=[{kbd:"⌘ + NUM0",text:a.style.normal},{kbd:"⌘ + NUM1",text:a.style.h1},{kbd:"⌘ + NUM2",text:a.style.h2},{kbd:"⌘ + NUM3",text:a.style.h3},{kbd:"⌘ + NUM4",text:a.style.h4},{kbd:"⌘ + NUM5",text:a.style.h5},{kbd:"⌘ + NUM6",text:a.style.h6}];return l(a.shortcut.documentStyle,b)},q=function(a,b){var c=b.extraKeys,d=[];for(var e in c)c.hasOwnProperty(e)&&d.push({kbd:e,text:c[e]});return l(a.shortcut.extraKeys,d)},r=function(a,b){var c='class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"',d=["<div "+c+">"+n(a,b)+"</div><div "+c+">"+m(a,b)+"</div>","<div "+c+">"+p(a,b)+"</div><div "+c+">"+o(a,b)+"</div>"];return b.extraKeys&&d.push("<div "+c+">"+q(a,b)+"</div>"),'<div class="note-shortcut-row row">'+d.join('</div><div class="note-shortcut-row row">')+"</div>"},s=function(a){return a.replace(/⌘/g,"Ctrl").replace(/⇧/g,"Shift")},t={image:function(a,b){var c="";if(b.maximumImageFileSize){var d=Math.floor(Math.log(b.maximumImageFileSize)/Math.log(1024)),f=1*(b.maximumImageFileSize/Math.pow(1024,d)).toFixed(2)+" "+" KMGTP"[d]+"B";c="<small>"+a.image.maximumFileSize+" : "+f+"</small>"}var g='<div class="form-group row-fluid note-group-select-from-files"><label>'+a.image.selectFromFiles+'</label><input class="note-image-input" type="file" name="files" accept="image/*" multiple="multiple" />'+c+'</div><div class="form-group row-fluid"><label>'+a.image.url+'</label><input class="note-image-url form-control span12" type="text" /></div>',h='<button href="#" class="btn btn-primary note-image-btn disabled" disabled>'+a.image.insert+"</button>";return e("note-image-dialog",a.image.insert,g,h)},link:function(a,b){var c='<div class="form-group row-fluid"><label>'+a.link.textToDisplay+'</label><input class="note-link-text form-control span12" type="text" /></div><div class="form-group row-fluid"><label>'+a.link.url+'</label><input class="note-link-url form-control span12" type="text" /></div>'+(b.disableLinkTarget?"":'<div class="checkbox"><label><input type="checkbox" checked> '+a.link.openInNewWindow+"</label></div>"),d='<button href="#" class="btn btn-primary note-link-btn disabled" disabled>'+a.link.insert+"</button>";return e("note-link-dialog",a.link.insert,c,d)},help:function(a,b){var c='<a class="modal-close pull-right" aria-hidden="true" tabindex="-1">'+a.shortcut.close+'</a><div class="title">'+a.shortcut.shortcuts+"</div>"+(f.isMac?r(a,b):s(r(a,b)))+'<p class="text-center"><a href="//summernote.org/" target="_blank">Summernote 0.6.7</a> · <a href="//github.com/summernote/summernote" target="_blank">Project</a> · <a href="//github.com/summernote/summernote/issues" target="_blank">Issues</a></p>';return e("note-help-dialog","",c,"")}},u=function(b,c){var d="";return a.each(t,function(a,e){d+=e(b,c)}),'<div class="note-dialog">'+d+"</div>"},v=function(){return'<div class="note-resizebar"><div class="note-icon-bar"></div><div class="note-icon-bar"></div><div class="note-icon-bar"></div></div>'},w=function(a){return f.isMac&&(a=a.replace("CMD","⌘").replace("SHIFT","⇧")),a.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]")},x=function(b,c,d){var e=g.invertObject(c),f=b.find("button");f.each(function(b,c){var d=a(c),f=e[d.data("event")];f&&d.attr("title",function(a,b){return b+" ("+w(f)+")"})}).tooltip({container:"body",trigger:"hover",placement:d||"top"}).on("click",function(){a(this).tooltip("hide")})},y=function(b,c){var d=c.colors;b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),e=[],f=0,g=d.length;g>f;f++){for(var h=d[f],i=[],j=0,k=h.length;k>j;j++){var l=h[j];i.push(['<button type="button" class="note-color-btn" style="background-color:',l,';" data-event="',c,'" data-value="',l,'" title="',l,'" data-toggle="button" tabindex="-1"></button>'].join(""))}e.push('<div class="note-color-row">'+i.join("")+"</div>")}b.html(e.join(""))})};this.createLayoutByAirMode=function(b,c){var d=c.langInfo,e=c.keyMap[f.isMac?"mac":"pc"],h=g.uniqueId();b.addClass("note-air-editor note-editable"),b.attr({id:"note-editor-"+h,contentEditable:!0});var k=document.body,l=a(i(d,c));l.addClass("note-air-layout"),l.attr("id","note-popover-"+h),l.appendTo(k),x(l,e),y(l,c);var m=a(j());m.addClass("note-air-layout"),m.attr("id","note-handle-"+h),m.appendTo(k);var n=a(u(d,c));n.addClass("note-air-layout"),n.attr("id","note-dialog-"+h),n.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),n.appendTo(k)},this.createLayoutByFrame=function(b,c){var d=c.langInfo,e=a('<div class="note-editor"></div>');c.width&&e.width(c.width),c.height>0&&a('<div class="note-statusbar">'+(c.disableResizeEditor?"":v())+"</div>").prependTo(e);var g=!b.is(":disabled"),l=a('<div class="note-editable" contentEditable="'+g+'"></div>').prependTo(e);c.height&&l.height(c.height),c.direction&&l.attr("dir",c.direction);var m=b.attr("placeholder")||c.placeholder;m&&l.attr("data-placeholder",m),l.html(k.html(b)),a('<textarea class="note-codable"></textarea>').prependTo(e);for(var n=a('<div class="note-toolbar btn-toolbar" />'),o=0,p=c.toolbar.length;p>o;o++){for(var q=c.toolbar[o][0],r=c.toolbar[o][1],s=a('<div class="note-'+q+' btn-group" />'),t=0,w=r.length;w>t;t++){var z=h[r[t]];if(a.isFunction(z)){var A=a(z(d,c));A.attr("data-name",r[t]),s.append(A)}}n.append(s)}n.prependTo(e);var B=c.keyMap[f.isMac?"mac":"pc"];y(n,c),x(n,B,"bottom");var C=a(i(d,c)).prependTo(e);y(C,c),x(C,B),a(j()).prependTo(e);var D=a(u(d,c)).prependTo(e);D.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),a('<div class="note-dropzone"><div class="note-dropzone-message"></div></div>').prependTo(e),e.insertAfter(b),b.hide()},this.hasNoteEditor=function(a){return this.noteEditorFromHolder(a).length>0},this.noteEditorFromHolder=function(b){return b.hasClass("note-air-editor")?b:b.next().hasClass("note-editor")?b.next():a()},this.createLayout=function(a,b){b.airMode?this.createLayoutByAirMode(a,b):this.createLayoutByFrame(a,b)},this.layoutInfoFromHolder=function(a){var b=this.noteEditorFromHolder(a);if(b.length)return b.data("holder",a),k.buildLayoutInfo(b)},this.removeLayout=function(a,b,c){c.airMode?(a.removeClass("note-air-editor note-editable").removeAttr("id contentEditable"),b.popover().remove(),b.handle().remove(),b.dialog().remove()):(a.html(b.editable().html()),b.editor().remove(),a.show())},this.getTemplate=function(){return{button:b,iconButton:c,dialog:e}},this.addButtonInfo=function(a,b){h[a]=b},this.addDialogInfo=function(a,b){t[a]=b}};a.summernote=a.summernote||{},a.extend(a.summernote,m);var L=new K,M=new J;a.extend(a.summernote,{renderer:L,eventHandler:M,core:{agent:f,list:h,dom:k,range:l},pluginEvents:{},plugins:[]}),a.summernote.addPlugin=function(b){a.summernote.plugins.push(b),b.buttons&&a.each(b.buttons,function(a,b){L.addButtonInfo(a,b)}),b.dialogs&&a.each(b.dialogs,function(a,b){L.addDialogInfo(a,b)}),b.events&&a.each(b.events,function(b,c){a.summernote.pluginEvents[b]=c}),b.langs&&a.each(b.langs,function(b,c){a.summernote.lang[b]&&a.extend(a.summernote.lang[b],c)}),b.options&&a.extend(a.summernote.options,b.options)},a.fn.extend({summernote:function(){var b=a.type(h.head(arguments)),c="string"===b,d="object"===b,e=d?h.head(arguments):{};if(e=a.extend({},a.summernote.options,e),e.langInfo=a.extend(!0,{},a.summernote.lang["en-US"],a.summernote.lang[e.lang]),!c&&d)for(var f=0,g=a.summernote.plugins.length;g>f;f++){var i=a.summernote.plugins[f];e.plugin[i.name]&&(a.summernote.plugins[f]=a.extend(!0,i,e.plugin[i.name]))}this.each(function(b,c){var d=a(c);if(!L.hasNoteEditor(d)){L.createLayout(d,e);var f=L.layoutInfoFromHolder(d);d.data("layoutInfo",f),M.attach(f,e),M.attachCustomEvent(f,e)}});var j=this.first();if(j.length){var k=L.layoutInfoFromHolder(j);if(c){var l=h.head(h.from(arguments)),m=h.tail(h.from(arguments)),n=[l,k.editable()].concat(m);return M.invoke.apply(M,n)}e.focus&&k.editable().focus()}return this},code:function(b){if(void 0===b){var c=this.first();if(!c.length)return;var d=L.layoutInfoFromHolder(c),e=d&&d.editable();if(e&&e.length){var f=M.invoke("codeview.isActivated",d);return M.invoke("codeview.sync",d),f?d.codable().val():d.editable().html()}return k.value(c)}return this.each(function(c,d){var e=L.layoutInfoFromHolder(a(d)),f=e&&e.editable();f&&f.html(b)}),this},destroy:function(){return this.each(function(b,c){var d=a(c);if(L.hasNoteEditor(d)){var e=L.layoutInfoFromHolder(d),f=e.editor().data("options");M.detach(e,f),L.removeLayout(d,e,f)}}),this}})}); | Emkrypted/premiereimports | Admin/HTML/assets/plugins/editor.summernote/summernote.min.js | JavaScript | mit | 73,980 |
var assert = require('assert')
, Form = require('../').Form
, boundary = '-----------------------------168072824752491622650073'
, mb = 100
, buffer = createMultipartBuffer(boundary, mb * 1024 * 1024)
var callbacks = {
partBegin: -1,
partEnd: -1,
headerField: -1,
headerValue: -1,
partData: -1,
end: -1,
};
var form = new Form({ boundary: boundary });
hijack('onParseHeaderField', function() {
callbacks.headerField++;
});
hijack('onParseHeaderValue', function() {
callbacks.headerValue++;
});
hijack('onParsePartBegin', function() {
callbacks.partBegin++;
});
hijack('onParsePartData', function() {
callbacks.partData++;
});
hijack('onParsePartEnd', function() {
callbacks.partEnd++;
});
form.on('finish', function() {
callbacks.end++;
});
var start = new Date();
form.write(buffer, function(err) {
var duration = new Date() - start;
assert.ifError(err);
var mbPerSec = (mb / (duration / 1000)).toFixed(2);
console.log(mbPerSec+' mb/sec');
});
process.on('exit', function() {
for (var k in callbacks) {
assert.equal(0, callbacks[k], k+' count off by '+callbacks[k]);
}
});
function createMultipartBuffer(boundary, size) {
var head =
'--'+boundary+'\r\n' +
'content-disposition: form-data; name="field1"\r\n' +
'\r\n'
, tail = '\r\n--'+boundary+'--\r\n'
, buffer = new Buffer(size);
buffer.write(head, 'ascii', 0);
buffer.write(tail, 'ascii', buffer.length - tail.length);
return buffer;
}
function hijack(name, fn) {
var oldFn = form[name];
form[name] = function() {
fn();
return oldFn.apply(this, arguments);
};
}
| gideonthomas/brackets | src/extensions/default/StaticServer/node/node_modules/connect/node_modules/multiparty/test/bench-multipart-parser.js | JavaScript | mit | 1,632 |
'use strict';
var test = require('tape');
var utils = require('../lib/utils');
test('merge()', function (t) {
t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });
t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array');
var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } });
t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array');
var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' });
t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array');
var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] });
t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] });
t.end();
});
| stzhongjie/webpack | node_modules/qs/test/utils.js | JavaScript | mit | 1,073 |
/* iCheck plugin Minimal skin, grey
----------------------------------- */
.icheckbox_minimal-grey,
.iradio_minimal-grey {
display: inline-block;
*display: inline;
vertical-align: middle;
margin: 0;
padding: 0;
width: 18px;
height: 18px;
background: url(grey.png) no-repeat;
border: none;
cursor: pointer;
}
.icheckbox_minimal-grey {
background-position: 0 0;
}
.icheckbox_minimal-grey.hover {
background-position: -20px 0;
}
.icheckbox_minimal-grey.checked {
background-position: -40px 0;
}
.icheckbox_minimal-grey.disabled {
background-position: -60px 0;
cursor: default;
}
.icheckbox_minimal-grey.checked.disabled {
background-position: -80px 0;
}
.iradio_minimal-grey {
background-position: -100px 0;
}
.iradio_minimal-grey.hover {
background-position: -120px 0;
}
.iradio_minimal-grey.checked {
background-position: -140px 0;
}
.iradio_minimal-grey.disabled {
background-position: -160px 0;
cursor: default;
}
.iradio_minimal-grey.checked.disabled {
background-position: -180px 0;
}
/* Retina support */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-moz-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
.icheckbox_minimal-grey,
.iradio_minimal-grey {
background-image: url(grey@2x.png);
-webkit-background-size: 200px 20px;
background-size: 200px 20px;
}
} | AhmerSaeed-SkillOrbit/autotek_adminpanel_v1 | plugins/iCheck/minimal/grey.css | CSS | mit | 1,626 |
'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": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMM y",
"medium": "dd MMM y HH:mm:ss",
"mediumDate": "dd MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/yy HH:mm",
"shortDate": "dd/MM/yy",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"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": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "en-be",
"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.js/1.4.0-beta.5/i18n/angular-locale_en-be.js | JavaScript | mit | 2,294 |
'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": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"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": "$",
"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": "en-sg",
"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;}
});
}]);
| mscharl/cdnjs | ajax/libs/angular.js/1.4.0-beta.4/i18n/angular-locale_en-sg.js | JavaScript | mit | 2,277 |
'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": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"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/MM/y h:mm a",
"shortDate": "d/MM/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"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": "en-au",
"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;}
});
}]);
| maxklenk/cdnjs | ajax/libs/angular.js/1.4.0-beta.0/i18n/angular-locale_en-au.js | JavaScript | mit | 2,277 |
'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": [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"MONTH": [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],
"SHORTDAY": [
"Sun",
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat"
],
"SHORTMONTH": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
],
"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/y h:mm a",
"shortDate": "d/M/y",
"shortTime": "h:mm a"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "$",
"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": "en-hk",
"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;}
});
}]);
| kristoferjoseph/cdnjs | ajax/libs/angular.js/1.4.0-beta.4/i18n/angular-locale_en-hk.js | JavaScript | mit | 2,275 |
'use strict'
function formatHostname(hostname) {
// canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
return hostname.replace(/^\.*/, '.').toLowerCase()
}
function parseNoProxyZone(zone) {
zone = zone.trim().toLowerCase()
var zoneParts = zone.split(':', 2)
, zoneHost = formatHostname(zoneParts[0])
, zonePort = zoneParts[1]
, hasPort = zone.indexOf(':') > -1
return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
}
function uriInNoProxy(uri, noProxy) {
var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
, hostname = formatHostname(uri.hostname)
, noProxyList = noProxy.split(',')
// iterate through the noProxyList until it finds a match.
return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) {
var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
, hostnameMatched = (
isMatchedAt > -1 &&
(isMatchedAt === hostname.length - noProxyZone.hostname.length)
)
if (noProxyZone.hasPort) {
return (port === noProxyZone.port) && hostnameMatched
}
return hostnameMatched
})
}
function getProxyFromURI(uri) {
// Decide the proper request proxy to use based on the request URI object and the
// environmental variables (NO_PROXY, HTTP_PROXY, etc.)
// respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)
var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
// if the noProxy is a wildcard then return null
if (noProxy === '*') {
return null
}
// if the noProxy is not empty and the uri is found return null
if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
return null
}
// Check for HTTP or HTTPS Proxy in environment Else default to null
if (uri.protocol === 'http:') {
return process.env.HTTP_PROXY ||
process.env.http_proxy || null
}
if (uri.protocol === 'https:') {
return process.env.HTTPS_PROXY ||
process.env.https_proxy ||
process.env.HTTP_PROXY ||
process.env.http_proxy || null
}
// if none of that works, return null
// (What uri protocol are you using then?)
return null
}
module.exports = getProxyFromURI
| dkim-95112/infosys | node_modules/fsevents/node_modules/request/lib/getProxyFromURI.js | JavaScript | mit | 2,268 |
.yui3-resize,.yui3-resize-wrapper {
z-index: 0;
zoom: 1;
}
.yui3-resize-handle {
position: absolute;
display: block;
z-index: 100;
zoom: 1;
}
.yui3-resize-proxy {
position: absolute;
border: 1px dashed #000;
position: absolute;
z-index: 10000;
}
.yui3-resize-hidden-handles .yui3-resize-handle {
opacity: 0;
filter: alpha(opacity=0);
}
.yui3-resize-handle-t,
.yui3-resize-handle-b {
width: 100%;
left: 0;
height: 6px;
}
.yui3-resize-handle-l,
.yui3-resize-handle-r {
height: 100%;
top: 0;
width: 6px;
}
.yui3-resize-handle-t {
cursor: n-resize;
top: 0;
}
.yui3-resize-handle-b {
cursor: s-resize;
bottom: 0;
}
.yui3-resize-handle-l {
cursor: w-resize;
left: 0;
}
.yui3-resize-handle-r {
cursor: e-resize;
right: 0;
}
.yui3-resize-handle-inner {
position: absolute;
zoom: 1;
}
/* Smartphones (portrait and landscape) -----------
Adding larger hit-area ':after' objects to handles
*/
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
.yui3-resize-handle-inner:after {
content: "";
width: 40px;
height: 40px;
position: absolute;
}
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
overflow: visible !important;
}
.yui3-resize-handle-inner-r:after {
top: -12px;
right: 0;
}
.yui3-resize-handle-inner-l:after {
top: -12px;
left: 0;
}
.yui3-resize-handle-inner-t:after {
top: 0;
left: -12px;
}
.yui3-resize-handle-inner-b:after {
bottom: 0;
left: -12px;
}
.yui3-resize-handle-inner-tr:after {
top: 0;
right: 0;
}
.yui3-resize-handle-inner-br:after {
bottom: 0;
right: 0;
}
.yui3-resize-handle-inner-tl:after {
top: 0;
left: 0;
}
.yui3-resize-handle-inner-bl:after {
bottom: 0;
left: 0;
}
}
/* iPads (portrait and landscape) -----------
Adding larger hit-area ':after' objects to handles
*/
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
.yui3-resize-handle-inner:after {
content: "";
width: 30px;
height: 30px;
position: absolute;
}
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
overflow: visible !important;
}
.yui3-resize-handle-inner-r:after {
top: -6px;
right: 0;
}
.yui3-resize-handle-inner-l:after {
top: -6px;
left: 0;
}
.yui3-resize-handle-inner-t:after {
top: 0;
left: -6px;
}
.yui3-resize-handle-inner-b:after {
bottom: 0;
left: -6px;
}
.yui3-resize-handle-inner-tr:after {
top: 0;
right: 0;
}
.yui3-resize-handle-inner-br:after {
bottom: 0;
right: 0;
}
.yui3-resize-handle-inner-tl:after {
top: 0;
left: 0;
}
.yui3-resize-handle-inner-bl:after {
bottom: 0;
left: 0;
}
}
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b {
margin-left: -8px;
left: 50%;
}
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-r {
margin-top: -8px;
top: 50%;
}
.yui3-resize-handle-inner-t {
top: -4px;
}
.yui3-resize-handle-inner-b {
bottom: -4px;
}
.yui3-resize-handle-inner-l {
left: -4px;
}
.yui3-resize-handle-inner-r {
right: -4px;
}
.yui3-resize-handle-tr,
.yui3-resize-handle-br,
.yui3-resize-handle-tl,
.yui3-resize-handle-bl {
height: 15px;
width: 15px;
z-index: 200;
}
.yui3-resize-handle-tr {
cursor: ne-resize;
top: 0;
right: 0;
}
.yui3-resize-handle-tl {
cursor: nw-resize;
top: 0;
left: 0;
}
.yui3-resize-handle-br {
cursor: se-resize;
bottom: 0;
right: 0;
}
.yui3-resize-handle-bl {
cursor: sw-resize;
bottom: 0;
left: 0;
} | mikesir87/cdnjs | ajax/libs/yui/3.10.2/resize-base/assets/resize-base-core.css | CSS | mit | 4,224 |
.yui3-resize,.yui3-resize-wrapper {
z-index: 0;
zoom: 1;
}
.yui3-resize-handle {
position: absolute;
display: block;
z-index: 100;
zoom: 1;
}
.yui3-resize-proxy {
position: absolute;
border: 1px dashed #000;
position: absolute;
z-index: 10000;
}
.yui3-resize-hidden-handles .yui3-resize-handle {
opacity: 0;
filter: alpha(opacity=0);
}
.yui3-resize-handle-t,
.yui3-resize-handle-b {
width: 100%;
left: 0;
height: 6px;
}
.yui3-resize-handle-l,
.yui3-resize-handle-r {
height: 100%;
top: 0;
width: 6px;
}
.yui3-resize-handle-t {
cursor: n-resize;
top: 0;
}
.yui3-resize-handle-b {
cursor: s-resize;
bottom: 0;
}
.yui3-resize-handle-l {
cursor: w-resize;
left: 0;
}
.yui3-resize-handle-r {
cursor: e-resize;
right: 0;
}
.yui3-resize-handle-inner {
position: absolute;
zoom: 1;
}
/* Smartphones (portrait and landscape) -----------
Adding larger hit-area ':after' objects to handles
*/
@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
/* Styles */
.yui3-resize-handle-inner:after {
content: "";
width: 40px;
height: 40px;
position: absolute;
}
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
overflow: visible !important;
}
.yui3-resize-handle-inner-r:after {
top: -12px;
right: 0;
}
.yui3-resize-handle-inner-l:after {
top: -12px;
left: 0;
}
.yui3-resize-handle-inner-t:after {
top: 0;
left: -12px;
}
.yui3-resize-handle-inner-b:after {
bottom: 0;
left: -12px;
}
.yui3-resize-handle-inner-tr:after {
top: 0;
right: 0;
}
.yui3-resize-handle-inner-br:after {
bottom: 0;
right: 0;
}
.yui3-resize-handle-inner-tl:after {
top: 0;
left: 0;
}
.yui3-resize-handle-inner-bl:after {
bottom: 0;
left: 0;
}
}
/* iPads (portrait and landscape) -----------
Adding larger hit-area ':after' objects to handles
*/
@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
/* Styles */
.yui3-resize-handle-inner:after {
content: "";
width: 30px;
height: 30px;
position: absolute;
}
.yui3-resize-handle-inner-r,
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b,
.yui3-resize-handle-inner-tr,
.yui3-resize-handle-inner-br,
.yui3-resize-handle-inner-tl,
.yui3-resize-handle-inner-bl {
overflow: visible !important;
}
.yui3-resize-handle-inner-r:after {
top: -6px;
right: 0;
}
.yui3-resize-handle-inner-l:after {
top: -6px;
left: 0;
}
.yui3-resize-handle-inner-t:after {
top: 0;
left: -6px;
}
.yui3-resize-handle-inner-b:after {
bottom: 0;
left: -6px;
}
.yui3-resize-handle-inner-tr:after {
top: 0;
right: 0;
}
.yui3-resize-handle-inner-br:after {
bottom: 0;
right: 0;
}
.yui3-resize-handle-inner-tl:after {
top: 0;
left: 0;
}
.yui3-resize-handle-inner-bl:after {
bottom: 0;
left: 0;
}
}
.yui3-resize-handle-inner-t,
.yui3-resize-handle-inner-b {
margin-left: -8px;
left: 50%;
}
.yui3-resize-handle-inner-l,
.yui3-resize-handle-inner-r {
margin-top: -8px;
top: 50%;
}
.yui3-resize-handle-inner-t {
top: -4px;
}
.yui3-resize-handle-inner-b {
bottom: -4px;
}
.yui3-resize-handle-inner-l {
left: -4px;
}
.yui3-resize-handle-inner-r {
right: -4px;
}
.yui3-resize-handle-tr,
.yui3-resize-handle-br,
.yui3-resize-handle-tl,
.yui3-resize-handle-bl {
height: 15px;
width: 15px;
z-index: 200;
}
.yui3-resize-handle-tr {
cursor: ne-resize;
top: 0;
right: 0;
}
.yui3-resize-handle-tl {
cursor: nw-resize;
top: 0;
left: 0;
}
.yui3-resize-handle-br {
cursor: se-resize;
bottom: 0;
right: 0;
}
.yui3-resize-handle-bl {
cursor: sw-resize;
bottom: 0;
left: 0;
} | lmccart/cdnjs | ajax/libs/yui/3.10.3/resize-proxy/assets/resize-base-core.css | CSS | mit | 4,224 |
<?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\Validator;
use Symfony\Component\Validator\Constraints\ExpressionValidator;
/**
* Backwards compatible implementation of the {@link ConstraintValidatorFactoryInterface}.
*
* This class uses legacy constraint validators where possible to ensure
* compatibility with the 2.4 validator API.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @deprecated Deprecated since version 2.5.3, to be removed in 3.0.
*/
class LegacyConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
{
protected $validators = array();
private $propertyAccessor;
public function __construct($propertyAccessor = null)
{
$this->propertyAccessor = $propertyAccessor;
}
/**
* {@inheritdoc}
*/
public function getInstance(Constraint $constraint)
{
switch (get_class($constraint)) {
case __NAMESPACE__.'\\Constraints\\All':
$className = __NAMESPACE__.'\\Constraints\\LegacyAllValidator';
break;
case __NAMESPACE__.'\\Constraints\\Choice':
$className = __NAMESPACE__.'\\Constraints\\LegacyChoiceValidator';
break;
case __NAMESPACE__.'\\Constraints\\Collection':
$className = __NAMESPACE__.'\\Constraints\\LegacyCollectionValidator';
break;
case __NAMESPACE__.'\\Constraints\\Count':
$className = __NAMESPACE__.'\\Constraints\\LegacyCountValidator';
break;
case __NAMESPACE__.'\\Constraints\\Length':
$className = __NAMESPACE__.'\\Constraints\\LegacyLengthValidator';
break;
default:
$className = $constraint->validatedBy();
break;
}
if (!isset($this->validators[$className])) {
$this->validators[$className] = 'validator.expression' === $className
? new ExpressionValidator($this->propertyAccessor)
: new $className();
}
return $this->validators[$className];
}
}
| boekkooi/symfony | src/Symfony/Component/Validator/LegacyConstraintValidatorFactory.php | PHP | mit | 2,338 |
"undefined"==typeof PDFJS&&(("undefined"!=typeof window?window:this).PDFJS={}),PDFJS.version="1.1.260",PDFJS.build="e5b7258",function(){"use strict";function t(t){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos&&console.log("Info: "+t)}function e(t){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+t)}function n(t){throw PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.errors&&(console.log("Error: "+t),console.log(i())),E.notify(R.unknown),new Error(t)}function i(){try{throw new Error}catch(t){return t.stack?t.stack.split("\n").slice(2).join("\n"):""}}function r(t,e){t||n(e)}function a(t,e){if(!e)return t;if(/^[a-z][a-z0-9+\-.]*:/i.test(e))return e;var n;if("/"===e.charAt(0))return n=t.indexOf("://"),"/"===e.charAt(1)?++n:n=t.indexOf("/",n+3),t.substring(0,n)+e;var i=t.length;n=t.lastIndexOf("#"),i=n>=0?n:i,n=t.lastIndexOf("?",i),i=n>=0?n:i;var r=t.lastIndexOf("/",i);return t.substring(0,r+1)+e}function s(t,e){if(!t)return!1;var n=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(t);if(!n)return e;switch(n=n[0].toLowerCase()){case"http":case"https":case"ftp":case"mailto":case"tel":return!0;default:return!1}}function o(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}function l(t){r(null!==t&&"object"==typeof t&&void 0!==t.length,"Invalid argument for bytesToString");var e=t.length,n=8192;if(n>e)return String.fromCharCode.apply(null,t);for(var i=[],a=0;e>a;a+=n){var s=Math.min(a+n,e),o=t.subarray(a,s);i.push(String.fromCharCode.apply(null,o))}return i.join("")}function c(t){r("string"==typeof t,"Invalid argument for stringToBytes");for(var e=t.length,n=new Uint8Array(e),i=0;e>i;++i)n[i]=255&t.charCodeAt(i);return n}function h(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function u(){var t=new Uint8Array(2);t[0]=1;var e=new Uint16Array(t.buffer);return 1===e[0]}function d(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d"),n=e.createImageData(1,1);return"undefined"!=typeof n.data.buffer}function f(t){return"number"==typeof t}function p(t){return t instanceof Array}function A(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength}function g(){var t={};return t.promise=new Promise(function(e,n){t.resolve=e,t.reject=n}),t}function m(t,e){this.name=t,this.comObj=e,this.callbackIndex=1,this.postMessageTransfers=!0;var i=this.callbacksCapabilities={},r=this.actionHandler={};r.console_log=[function(t){console.log.apply(console,t)}],r.console_error=[function(t){console.error.apply(console,t)}],r._unsupported_feature=[function(t){E.notify(t)}],e.onmessage=function(t){var a=t.data;if(a.isReply){var s=a.callbackId;if(a.callbackId in i){var o=i[s];delete i[s],"error"in a?o.reject(a.error):o.resolve(a.data)}else n("Cannot resolve callback "+s)}else if(a.action in r){var l=r[a.action];a.callbackId?Promise.resolve().then(function(){return l[0].call(l[1],a.data)}).then(function(t){e.postMessage({isReply:!0,callbackId:a.callbackId,data:t})},function(t){e.postMessage({isReply:!0,callbackId:a.callbackId,error:t})}):l[0].call(l[1],a.data)}else n("Unknown action from worker: "+a.action)}}function v(t,n,i){var r=new Image;r.onload=function(){i.resolve(t,r)},r.onerror=function(){i.resolve(t,null),e("Error during JPEG image loading")},r.src=n}function b(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,n}function S(t){t.mozCurrentTransform||(t._originalSave=t.save,t._originalRestore=t.restore,t._originalRotate=t.rotate,t._originalScale=t.scale,t._originalTranslate=t.translate,t._originalTransform=t.transform,t._originalSetTransform=t.setTransform,t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0],t._transformStack=[],Object.defineProperty(t,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(t,"mozCurrentTransformInverse",{get:function(){var t=this._transformMatrix,e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],s=t[5],o=e*r-n*i,l=n*i-e*r;return[r/o,n/l,i/l,e/o,(r*a-i*s)/l,(n*a-e*s)/o]}}),t.save=function(){var t=this._transformMatrix;this._transformStack.push(t),this._transformMatrix=t.slice(0,6),this._originalSave()},t.restore=function(){var t=this._transformStack.pop();t&&(this._transformMatrix=t,this._originalRestore())},t.translate=function(t,e){var n=this._transformMatrix;n[4]=n[0]*t+n[2]*e+n[4],n[5]=n[1]*t+n[3]*e+n[5],this._originalTranslate(t,e)},t.scale=function(t,e){var n=this._transformMatrix;n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*e,n[3]=n[3]*e,this._originalScale(t,e)},t.transform=function(e,n,i,r,a,s){var o=this._transformMatrix;this._transformMatrix=[o[0]*e+o[2]*n,o[1]*e+o[3]*n,o[0]*i+o[2]*r,o[1]*i+o[3]*r,o[0]*a+o[2]*s+o[4],o[1]*a+o[3]*s+o[5]],t._originalTransform(e,n,i,r,a,s)},t.setTransform=function(e,n,i,r,a,s){this._transformMatrix=[e,n,i,r,a,s],t._originalSetTransform(e,n,i,r,a,s)},t.rotate=function(t){var e=Math.cos(t),n=Math.sin(t),i=this._transformMatrix;this._transformMatrix=[i[0]*e+i[2]*n,i[1]*e+i[3]*n,i[0]*-n+i[2]*e,i[1]*-n+i[3]*e,i[4],i[5]],this._originalRotate(t)})}function y(t){var e,n,i,r,a=1e3,s=t.width,o=t.height,l=s+1,c=new Uint8Array(l*(o+1)),h=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),u=s+7&-8,d=t.data,f=new Uint8Array(u*o),p=0;for(e=0,r=d.length;r>e;e++)for(var A=128,g=d[e];A>0;)f[p++]=g&A?0:255,A>>=1;var m=0;for(p=0,0!==f[p]&&(c[0]=1,++m),n=1;s>n;n++)f[p]!==f[p+1]&&(c[n]=f[p]?2:1,++m),p++;for(0!==f[p]&&(c[n]=2,++m),e=1;o>e;e++){p=e*u,i=e*l,f[p-u]!==f[p]&&(c[i]=f[p]?1:8,++m);var v=(f[p]?4:0)+(f[p-u]?8:0);for(n=1;s>n;n++)v=(v>>2)+(f[p+1]?4:0)+(f[p-u+1]?8:0),h[v]&&(c[i+n]=h[v],++m),p++;if(f[p-u]!==f[p]&&(c[i+n]=f[p]?2:4,++m),m>a)return null}for(p=u*(o-1),i=e*l,0!==f[p]&&(c[i]=8,++m),n=1;s>n;n++)f[p]!==f[p+1]&&(c[i+n]=f[p]?4:8,++m),p++;if(0!==f[p]&&(c[i+n]=4,++m),m>a)return null;var b=new Int32Array([0,l,-1,0,-l,0,0,0,1]),S=[];for(e=0;m&&o>=e;e++){for(var y=e*l,x=y+s;x>y&&!c[y];)y++;if(y!==x){var k,P=[y%l,e],C=c[y],F=y;do{var D=b[C];do y+=D;while(!c[y]);k=c[y],5!==k&&10!==k?(C=k,c[y]=0):(C=k&51*C>>4,c[y]&=C>>2|C<<2),P.push(y%l),P.push(y/l|0),--m}while(F!==y);S.push(P),--e}}var w=function(t){t.save(),t.scale(1/s,-1/o),t.translate(0,-o),t.beginPath();for(var e=0,n=S.length;n>e;e++){var i=S[e];t.moveTo(i[0],i[1]);for(var r=2,a=i.length;a>r;r+=2)t.lineTo(i[r],i[r+1])}t.fill(),t.beginPath(),t.restore()};return w}function x(t){var e=lt[t[0]];return e||n("Unknown IR type: "+t[0]),e.fromIR(t)}var k="undefined"==typeof window?this:window,P="undefined"==typeof window,C=[.001,0,0,.001,0,0],F={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},D={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},w={WIDGET:1,TEXT:2,LINK:3},T={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};k.PDFJS||(k.PDFJS={}),k.PDFJS.pdfBug=!1,PDFJS.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};var L=PDFJS.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},R=PDFJS.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},E=PDFJS.UnsupportedManager=function(){var t=[];return{listen:function(e){t.push(e)},notify:function(n){e('Unsupported feature "'+n+'"');for(var i=0,r=t.length;r>i;i++)t[i](n)}}}();PDFJS.isValidUrl=s,PDFJS.shadow=o;var I=PDFJS.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},M=function(){function t(t,e){this.name="PasswordException",this.message=t,this.code=e}return t.prototype=new Error,t.constructor=t,t}();PDFJS.PasswordException=M;var _=function(){function t(t,e){this.name="UnknownErrorException",this.message=t,this.details=e}return t.prototype=new Error,t.constructor=t,t}();PDFJS.UnknownErrorException=_;var O=function(){function t(t){this.name="InvalidPDFException",this.message=t}return t.prototype=new Error,t.constructor=t,t}();PDFJS.InvalidPDFException=O;var j=function(){function t(t){this.name="MissingPDFException",this.message=t}return t.prototype=new Error,t.constructor=t,t}();PDFJS.MissingPDFException=j;var N=function(){function t(t,e){this.name="UnexpectedResponseException",this.message=t,this.status=e}return t.prototype=new Error,t.constructor=t,t}();PDFJS.UnexpectedResponseException=N;(function(){function t(t){this.message=t}return t.prototype=new Error,t.prototype.name="NotImplementedException",t.constructor=t,t})(),function(){function t(t,e){this.begin=t,this.end=e,this.message="Missing data ["+t+", "+e+")"}return t.prototype=new Error,t.prototype.name="MissingDataException",t.constructor=t,t}(),function(){function t(t){this.message=t}return t.prototype=new Error,t.prototype.name="XRefParseException",t.constructor=t,t}();Object.defineProperty(PDFJS,"isLittleEndian",{configurable:!0,get:function(){return o(PDFJS,"isLittleEndian",u())}}),Object.defineProperty(PDFJS,"hasCanvasTypedArrays",{configurable:!0,get:function(){return o(PDFJS,"hasCanvasTypedArrays",d())}});var J=function(){function t(t,e){this.buffer=t,this.byteLength=t.length,this.length=void 0===e?this.byteLength>>2:e,n(this.length)}function e(t){return{get:function(){var e=this.buffer,n=t<<2;return(e[n]|e[n+1]<<8|e[n+2]<<16|e[n+3]<<24)>>>0},set:function(e){var n=this.buffer,i=t<<2;n[i]=255&e,n[i+1]=e>>8&255,n[i+2]=e>>16&255,n[i+3]=e>>>24&255}}}function n(n){for(;n>i;)Object.defineProperty(t.prototype,i,e(i)),i++}t.prototype=Object.create(null);var i=0;return t}(),B=[1,0,0,1,0,0],W=PDFJS.Util=function(){function t(){}var e=["rgb(",0,",",0,",",0,")"];return t.makeCssRgb=function(t,n,i){return e[1]=t,e[3]=n,e[5]=i,e.join("")},t.transform=function(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]},t.applyTransform=function(t,e){var n=t[0]*e[0]+t[1]*e[2]+e[4],i=t[0]*e[1]+t[1]*e[3]+e[5];return[n,i]},t.applyInverseTransform=function(t,e){var n=e[0]*e[3]-e[1]*e[2],i=(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/n,r=(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/n;return[i,r]},t.getAxialAlignedBoundingBox=function(e,n){var i=t.applyTransform(e,n),r=t.applyTransform(e.slice(2,4),n),a=t.applyTransform([e[0],e[3]],n),s=t.applyTransform([e[2],e[1]],n);return[Math.min(i[0],r[0],a[0],s[0]),Math.min(i[1],r[1],a[1],s[1]),Math.max(i[0],r[0],a[0],s[0]),Math.max(i[1],r[1],a[1],s[1])]},t.inverseTransform=function(t){var e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]},t.apply3dTransform=function(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]},t.singularValueDecompose2dScale=function(t){var e=[t[0],t[2],t[1],t[3]],n=t[0]*e[0]+t[1]*e[2],i=t[0]*e[1]+t[1]*e[3],r=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],s=(n+a)/2,o=Math.sqrt((n+a)*(n+a)-4*(n*a-r*i))/2,l=s+o||1,c=s-o||1;return[Math.sqrt(l),Math.sqrt(c)]},t.normalizeRect=function(t){var e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e},t.intersect=function(e,n){function i(t,e){return t-e}var r=[e[0],e[2],n[0],n[2]].sort(i),a=[e[1],e[3],n[1],n[3]].sort(i),s=[];return e=t.normalizeRect(e),n=t.normalizeRect(n),r[0]===e[0]&&r[1]===n[0]||r[0]===n[0]&&r[1]===e[0]?(s[0]=r[1],s[2]=r[2],a[0]===e[1]&&a[1]===n[1]||a[0]===n[1]&&a[1]===e[1]?(s[1]=a[1],s[3]=a[2],s):!1):!1},t.sign=function(t){return 0>t?-1:1},t.appendToArray=function(t,e){Array.prototype.push.apply(t,e)},t.prependToArray=function(t,e){Array.prototype.unshift.apply(t,e)},t.extendObj=function(t,e){for(var n in e)t[n]=e[n]},t.getInheritableProperty=function(t,e){for(;t&&!t.has(e);)t=t.get("Parent");return t?t.get(e):null},t.inherit=function(t,e,n){t.prototype=Object.create(e.prototype),t.prototype.constructor=t;for(var i in n)t.prototype[i]=n[i]},t.loadScript=function(t,e){var n=document.createElement("script"),i=!1;n.setAttribute("src",t),e&&(n.onload=function(){i||e(),i=!0}),document.getElementsByTagName("head")[0].appendChild(n)},t}();PDFJS.PageViewport=function(){function t(t,e,n,i,r,a){this.viewBox=t,this.scale=e,this.rotation=n,this.offsetX=i,this.offsetY=r;var s,o,l,c,h=(t[2]+t[0])/2,u=(t[3]+t[1])/2;switch(n%=360,n=0>n?n+360:n){case 180:s=-1,o=0,l=0,c=1;break;case 90:s=0,o=1,l=1,c=0;break;case 270:s=0,o=-1,l=-1,c=0;break;default:s=1,o=0,l=0,c=-1}a&&(l=-l,c=-c);var d,f,p,A;0===s?(d=Math.abs(u-t[1])*e+i,f=Math.abs(h-t[0])*e+r,p=Math.abs(t[3]-t[1])*e,A=Math.abs(t[2]-t[0])*e):(d=Math.abs(h-t[0])*e+i,f=Math.abs(u-t[1])*e+r,p=Math.abs(t[2]-t[0])*e,A=Math.abs(t[3]-t[1])*e),this.transform=[s*e,o*e,l*e,c*e,d-s*e*h-l*e*u,f-o*e*h-c*e*u],this.width=p,this.height=A,this.fontScale=e}return t.prototype={clone:function(e){e=e||{};var n="scale"in e?e.scale:this.scale,i="rotation"in e?e.rotation:this.rotation;return new t(this.viewBox.slice(),n,i,this.offsetX,this.offsetY,e.dontFlip)},convertToViewportPoint:function(t,e){return W.applyTransform([t,e],this.transform)},convertToViewportRectangle:function(t){var e=W.applyTransform([t[0],t[1]],this.transform),n=W.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],n[0],n[1]]},convertToPdfPoint:function(t,e){return W.applyInverseTransform([t,e],this.transform)}},t}();PDFJS.createPromiseCapability=g,function(){function t(t){this._status=n,this._handlers=[];try{t.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}}if(k.Promise)return"function"!=typeof k.Promise.all&&(k.Promise.all=function(t){var e,n,i=0,r=[],a=new k.Promise(function(t,i){e=t,n=i});return t.forEach(function(t,a){i++,t.then(function(t){r[a]=t,i--,0===i&&e(r)},n)}),0===i&&e(r),a}),"function"!=typeof k.Promise.resolve&&(k.Promise.resolve=function(t){return new k.Promise(function(e){e(t)})}),"function"!=typeof k.Promise.reject&&(k.Promise.reject=function(t){return new k.Promise(function(e,n){n(t)})}),void("function"!=typeof k.Promise.prototype["catch"]&&(k.Promise.prototype["catch"]=function(t){return k.Promise.prototype.then(void 0,t)}));var n=0,i=1,r=2,a=500,s={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(t){t._status!==n&&(this.handlers=this.handlers.concat(t._handlers),t._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var t=1,e=Date.now()+t;this.handlers.length>0;){var n=this.handlers.shift(),a=n.thisPromise._status,s=n.thisPromise._value;try{a===i?"function"==typeof n.onResolve&&(s=n.onResolve(s)):"function"==typeof n.onReject&&(s=n.onReject(s),a=i,n.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(n.thisPromise))}catch(o){a=r,s=o}if(n.nextPromise._updateStatus(a,s),Date.now()>=e)break}return this.handlers.length>0?void setTimeout(this.runHandlers.bind(this),0):void(this.running=!1)},addUnhandledRejection:function(t){this.unhandledRejections.push({promise:t,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(t){t._unhandledRejection=!1;for(var e=0;e<this.unhandledRejections.length;e++)this.unhandledRejections[e].promise===t&&(this.unhandledRejections.splice(e),e--)},scheduleRejectionCheck:function(){this.pendingRejectionCheck||(this.pendingRejectionCheck=!0,setTimeout(function(){this.pendingRejectionCheck=!1;for(var t=Date.now(),n=0;n<this.unhandledRejections.length;n++)if(t-this.unhandledRejections[n].time>a){var i=this.unhandledRejections[n].promise._value,r="Unhandled rejection: "+i;i.stack&&(r+="\n"+i.stack),e(r),this.unhandledRejections.splice(n),n--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),a))}};t.all=function(e){function n(t){s._status!==r&&(l=[],a(t))}var i,a,s=new t(function(t,e){i=t,a=e}),o=e.length,l=[];if(0===o)return i(l),s;for(var c=0,h=e.length;h>c;++c){var u=e[c],d=function(t){return function(e){s._status!==r&&(l[t]=e,o--,0===o&&i(l))}}(c);t.isPromise(u)?u.then(d,n):d(u)}return s},t.isPromise=function(t){return t&&"function"==typeof t.then},t.resolve=function(e){return new t(function(t){t(e)})},t.reject=function(e){return new t(function(t,n){n(e)})},t.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(e,n){if(this._status!==i&&this._status!==r){if(e===i&&t.isPromise(n))return void n.then(this._updateStatus.bind(this,i),this._updateStatus.bind(this,r));this._status=e,this._value=n,e===r&&0===this._handlers.length&&(this._unhandledRejection=!0,s.addUnhandledRejection(this)),s.scheduleHandlers(this)}},_resolve:function(t){this._updateStatus(i,t)},_reject:function(t){this._updateStatus(r,t)},then:function(e,n){var i=new t(function(t,e){this.resolve=t,this.reject=e});return this._handlers.push({thisPromise:this,onResolve:e,onReject:n,nextPromise:i}),s.scheduleHandlers(this),i},"catch":function(t){return this.then(void 0,t)}},k.Promise=t}();var U=function(){function t(t,e,n){for(;t.length<n;)t+=e;return t}function n(){this.started={},this.times=[],this.enabled=!0}return n.prototype={time:function(t){this.enabled&&(t in this.started&&e("Timer is already running for "+t),this.started[t]=Date.now())},timeEnd:function(t){this.enabled&&(t in this.started||e("Timer has not been started for "+t),this.times.push({name:t,start:this.started[t],end:Date.now()}),delete this.started[t])},toString:function(){var e,n,i=this.times,r="",a=0;for(e=0,n=i.length;n>e;++e){var s=i[e].name;s.length>a&&(a=s.length)}for(e=0,n=i.length;n>e;++e){var o=i[e],l=o.end-o.start;r+=t(o.name," ",a)+" "+l+"ms\n"}return r}},n}();PDFJS.createBlob=function(t,e){if("undefined"!=typeof Blob)return new Blob([t],{type:e});var n=new MozBlobBuilder;return n.append(t),n.getBlob(e)},PDFJS.createObjectURL=function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(e,n){if(!PDFJS.disableCreateObjectURL&&"undefined"!=typeof URL&&URL.createObjectURL){var i=PDFJS.createBlob(e,n);return URL.createObjectURL(i)}for(var r="data:"+n+";base64,",a=0,s=e.length;s>a;a+=3){var o=255&e[a],l=255&e[a+1],c=255&e[a+2],h=o>>2,u=(3&o)<<4|l>>4,d=s>a+1?(15&l)<<2|c>>6:64,f=s>a+2?63&c:64;r+=t[h]+t[u]+t[d]+t[f]}return r}}(),m.prototype={on:function(t,e,i){var r=this.actionHandler;r[t]&&n('There is already an actionName called "'+t+'"'),r[t]=[e,i]},send:function(t,e,n){var i={action:t,data:e};this.postMessage(i,n)},sendWithPromise:function(t,e,n){var i=this.callbackIndex++,r={action:t,data:e,callbackId:i},a=g();this.callbacksCapabilities[i]=a;try{this.postMessage(r,n)}catch(s){a.reject(s)}return a.promise},postMessage:function(t,e){e&&this.postMessageTransfers?this.comObj.postMessage(t,e):this.comObj.postMessage(t)}},PDFJS.maxImageSize=void 0===PDFJS.maxImageSize?-1:PDFJS.maxImageSize,PDFJS.cMapUrl=void 0===PDFJS.cMapUrl?null:PDFJS.cMapUrl,PDFJS.cMapPacked=void 0===PDFJS.cMapPacked?!1:PDFJS.cMapPacked,PDFJS.disableFontFace=void 0===PDFJS.disableFontFace?!1:PDFJS.disableFontFace,PDFJS.imageResourcesPath=void 0===PDFJS.imageResourcesPath?"":PDFJS.imageResourcesPath,PDFJS.disableWorker=void 0===PDFJS.disableWorker?!1:PDFJS.disableWorker,PDFJS.workerSrc=void 0===PDFJS.workerSrc?null:PDFJS.workerSrc,PDFJS.disableRange=void 0===PDFJS.disableRange?!1:PDFJS.disableRange,PDFJS.disableStream=void 0===PDFJS.disableStream?!1:PDFJS.disableStream,PDFJS.disableAutoFetch=void 0===PDFJS.disableAutoFetch?!1:PDFJS.disableAutoFetch,PDFJS.pdfBug=void 0===PDFJS.pdfBug?!1:PDFJS.pdfBug,PDFJS.postMessageTransfers=void 0===PDFJS.postMessageTransfers?!0:PDFJS.postMessageTransfers,PDFJS.disableCreateObjectURL=void 0===PDFJS.disableCreateObjectURL?!1:PDFJS.disableCreateObjectURL,PDFJS.disableWebGL=void 0===PDFJS.disableWebGL?!0:PDFJS.disableWebGL,PDFJS.disableFullscreen=void 0===PDFJS.disableFullscreen?!1:PDFJS.disableFullscreen,PDFJS.useOnlyCssZoom=void 0===PDFJS.useOnlyCssZoom?!1:PDFJS.useOnlyCssZoom,PDFJS.verbosity=void 0===PDFJS.verbosity?PDFJS.VERBOSITY_LEVELS.warnings:PDFJS.verbosity,PDFJS.maxCanvasPixels=void 0===PDFJS.maxCanvasPixels?16777216:PDFJS.maxCanvasPixels,PDFJS.openExternalLinksInNewWindow=void 0===PDFJS.openExternalLinksInNewWindow?!1:PDFJS.openExternalLinksInNewWindow,PDFJS.getDocument=function(t,e,i,r){var s=new G;e&&(e instanceof X||(e=Object.create(e),e.length=t.length,e.initialData=t.initialData),t=Object.create(t),t.range=e),s.onPassword=i||null,s.onProgress=r||null;var o,l,h;"string"==typeof t?h={url:t}:A(t)?h={data:t}:t instanceof X?h={range:t}:("object"!=typeof t&&n("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object"),t.url||t.data||t.range||n("Invalid parameter object: need either .data, .range or .url"),h=t);var u={};for(var d in h)if("url"!==d||"undefined"==typeof window){if("range"!==d)if("data"!==d||h[d]instanceof Uint8Array)u[d]=h[d];else{var f=h[d];"string"==typeof f?u[d]=c(f):"object"!=typeof f||null===f||isNaN(f.length)?n("Invalid PDF binary data: either typed array, string or array-like object is expected in the data property."):u[d]=new Uint8Array(f)}}else u[d]=a(window.location.href,h[d]);return o=g(),l=new H(o,h.range),o.promise.then(function(){l.fetchDocument(s,u)}),s};var G=function(){function t(){this._capability=g(),this.onPassword=null,this.onProgress=null}return t.prototype={get promise(){return this._capability.promise},then:function(t,e){return this.promise.then.apply(this.promise,arguments)}},t}(),X=function(){function t(t,e){this.length=t,this.initialData=e,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._readyCapability=g()}return t.prototype={addRangeListener:function(t){this._rangeListeners.push(t)},addProgressListener:function(t){this._progressListeners.push(t)},addProgressiveReadListener:function(t){this._progressiveReadListeners.push(t)},onDataRange:function(t,e){for(var n=this._rangeListeners,i=0,r=n.length;r>i;++i)n[i](t,e)},onDataProgress:function(t){this._readyCapability.promise.then(function(){for(var e=this._progressListeners,n=0,i=e.length;i>n;++n)e[n](t)}.bind(this))},onDataProgressiveRead:function(t){this._readyCapability.promise.then(function(){for(var e=this._progressiveReadListeners,n=0,i=e.length;i>n;++n)e[n](t)}.bind(this))},transportReady:function(){this._readyCapability.resolve()},requestDataRange:function(t,e){throw new Error("Abstract method PDFDataRangeTransport.requestDataRange")}},t}();PDFJS.PDFDataRangeTransport=X;var z=function(){function t(t,e){this.pdfInfo=t,this.transport=e}return t.prototype={get numPages(){return this.pdfInfo.numPages},get fingerprint(){return this.pdfInfo.fingerprint},getPage:function(t){return this.transport.getPage(t)},getPageIndex:function(t){return this.transport.getPageIndex(t)},getDestinations:function(){return this.transport.getDestinations()},getDestination:function(t){return this.transport.getDestination(t)},getAttachments:function(){return this.transport.getAttachments()},getJavaScript:function(){return this.transport.getJavaScript()},getOutline:function(){return this.transport.getOutline()},getMetadata:function(){return this.transport.getMetadata()},getData:function(){return this.transport.getData()},getDownloadInfo:function(){return this.transport.downloadInfoCapability.promise},getStats:function(){return this.transport.getStats()},cleanup:function(){this.transport.startCleanup()},destroy:function(){this.transport.destroy()}},t}(),Y=function(){function t(t,e,n){this.pageIndex=t,this.pageInfo=e,this.transport=n,this.stats=new U,this.stats.enabled=!!k.PDFJS.enableStats,this.commonObjs=n.commonObjs,this.objs=new Q,this.cleanupAfterRender=!1,this.pendingDestroy=!1,this.intentStates={}}return t.prototype={get pageNumber(){return this.pageIndex+1},get rotate(){return this.pageInfo.rotate},get ref(){return this.pageInfo.ref},get view(){return this.pageInfo.view},getViewport:function(t,e){return arguments.length<2&&(e=this.rotate),new PDFJS.PageViewport(this.view,t,e,0,0)},getAnnotations:function(){if(this.annotationsPromise)return this.annotationsPromise;var t=this.transport.getAnnotations(this.pageIndex);return this.annotationsPromise=t,t},render:function(t){function e(t){var e=r.renderTasks.indexOf(a);e>=0&&r.renderTasks.splice(e,1),o.cleanupAfterRender&&(o.pendingDestroy=!0),o._tryDestroy(),t?a.capability.reject(t):a.capability.resolve(),n.timeEnd("Rendering"),n.timeEnd("Overall")}var n=this.stats;n.time("Overall"),this.pendingDestroy=!1;var i="print"===t.intent?"print":"display";this.intentStates[i]||(this.intentStates[i]={});var r=this.intentStates[i];r.displayReadyCapability||(r.receivingOperatorList=!0,r.displayReadyCapability=g(),r.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.stats.time("Page Request"),this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageNumber-1,intent:i}));var a=new q(e,t,this.objs,this.commonObjs,r.operatorList,this.pageNumber);a.useRequestAnimationFrame="print"!==i,r.renderTasks||(r.renderTasks=[]),r.renderTasks.push(a);var s=a.task;t.continueCallback&&(s.onContinue=t.continueCallback);var o=this;return r.displayReadyCapability.promise.then(function(t){return o.pendingDestroy?void e():(n.time("Rendering"),a.initalizeGraphics(t),void a.operatorListChanged())},function(t){e(t)}),s},getOperatorList:function(){function t(){n.operatorList.lastChunk&&n.opListReadCapability.resolve(n.operatorList)}var e="oplist";this.intentStates[e]||(this.intentStates[e]={});var n=this.intentStates[e];if(!n.opListReadCapability){var i={};i.operatorListChanged=t,n.receivingOperatorList=!0,n.opListReadCapability=g(),n.renderTasks=[],n.renderTasks.push(i),n.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:e})}return n.opListReadCapability.promise},getTextContent:function(){return this.transport.messageHandler.sendWithPromise("GetTextContent",{pageIndex:this.pageNumber-1})},destroy:function(){this.pendingDestroy=!0,this._tryDestroy()},_tryDestroy:function(){this.pendingDestroy&&!Object.keys(this.intentStates).some(function(t){var e=this.intentStates[t];return 0!==e.renderTasks.length||e.receivingOperatorList},this)&&(Object.keys(this.intentStates).forEach(function(t){delete this.intentStates[t]},this),this.objs.clear(),this.annotationsPromise=null,this.pendingDestroy=!1)},_startRenderPage:function(t,e){var n=this.intentStates[e];n.displayReadyCapability&&n.displayReadyCapability.resolve(t)},_renderPageChunk:function(t,e){var n,i,r=this.intentStates[e];for(n=0,i=t.length;i>n;n++)r.operatorList.fnArray.push(t.fnArray[n]),r.operatorList.argsArray.push(t.argsArray[n]);for(r.operatorList.lastChunk=t.lastChunk,n=0;n<r.renderTasks.length;n++)r.renderTasks[n].operatorListChanged();t.lastChunk&&(r.receivingOperatorList=!1,this._tryDestroy())}},t}(),H=function(){function i(e,i){if(this.pdfDataRangeTransport=i,this.workerInitializedCapability=e,this.commonObjs=new Q,this.loadingTask=null,this.pageCache=[],this.pagePromises=[],this.downloadInfoCapability=g(),!k.PDFJS.disableWorker&&"undefined"!=typeof Worker){var r=PDFJS.workerSrc;r||n("No PDFJS.workerSrc specified");try{var a=new Worker(r),s=new m("main",a);this.messageHandler=s,s.on("test",function(t){var n=t&&t.supportTypedArray;n?(this.worker=a,t.supportTransfers||(PDFJS.postMessageTransfers=!1),this.setupMessageHandler(s),e.resolve()):this.setupFakeWorker()}.bind(this));var o=new Uint8Array([PDFJS.postMessageTransfers?255:0]);try{s.send("test",o,[o.buffer])}catch(l){t("Cannot use postMessage transfers"),o[0]=0,s.send("test",o)}return}catch(c){t("The worker has been disabled.")}}this.setupFakeWorker()}return i.prototype={destroy:function(){this.pageCache=[],this.pagePromises=[];var t=this;this.messageHandler.sendWithPromise("Terminate",null).then(function(){ut.clear(),t.worker&&t.worker.terminate()})},setupFakeWorker:function(){k.PDFJS.disableWorker=!0,PDFJS.fakeWorkerFilesLoadedCapability||(PDFJS.fakeWorkerFilesLoadedCapability=g(),W.loadScript(PDFJS.workerSrc,function(){PDFJS.fakeWorkerFilesLoadedCapability.resolve()})),PDFJS.fakeWorkerFilesLoadedCapability.promise.then(function(){e("Setting up fake worker.");var t={postMessage:function(e){t.onmessage({data:e})},terminate:function(){}},n=new m("main",t);this.setupMessageHandler(n),PDFJS.WorkerMessageHandler.setup(n),this.workerInitializedCapability.resolve()}.bind(this))},setupMessageHandler:function(t){function i(e){t.send("UpdatePassword",e)}this.messageHandler=t;var r=this.pdfDataRangeTransport;r&&(r.addRangeListener(function(e,n){t.send("OnDataRange",{begin:e,chunk:n})}),r.addProgressListener(function(e){t.send("OnDataProgress",{loaded:e})}),r.addProgressiveReadListener(function(e){t.send("OnDataRange",{chunk:e})}),t.on("RequestDataRange",function(t){r.requestDataRange(t.begin,t.end)},this)),t.on("GetDoc",function(t){var e=t.pdfInfo;this.numPages=t.pdfInfo.numPages;var n=new z(e,this);this.pdfDocument=n,this.loadingTask._capability.resolve(n)},this),t.on("NeedPassword",function(t){var e=this.loadingTask;return e.onPassword?e.onPassword(i,I.NEED_PASSWORD):void e._capability.reject(new M(t.message,t.code))},this),t.on("IncorrectPassword",function(t){var e=this.loadingTask;return e.onPassword?e.onPassword(i,I.INCORRECT_PASSWORD):void e._capability.reject(new M(t.message,t.code))},this),t.on("InvalidPDF",function(t){this.loadingTask._capability.reject(new O(t.message))},this),t.on("MissingPDF",function(t){this.loadingTask._capability.reject(new j(t.message))},this),t.on("UnexpectedResponse",function(t){this.loadingTask._capability.reject(new N(t.message,t.status))},this),t.on("UnknownError",function(t){this.loadingTask._capability.reject(new _(t.message,t.details))},this),t.on("DataLoaded",function(t){this.downloadInfoCapability.resolve(t)},this),t.on("PDFManagerReady",function(t){this.pdfDataRangeTransport&&this.pdfDataRangeTransport.transportReady()},this),t.on("StartRenderPage",function(t){var e=this.pageCache[t.pageIndex];e.stats.timeEnd("Page Request"),e._startRenderPage(t.transparency,t.intent)},this),t.on("RenderPageChunk",function(t){var e=this.pageCache[t.pageIndex];e._renderPageChunk(t.operatorList,t.intent)},this),t.on("commonobj",function(t){var n=t[0],i=t[1];if(!this.commonObjs.hasData(n))switch(i){case"Font":var r,a=t[2];if("error"in a){var s=a.error;e("Error during font loading: "+s),this.commonObjs.resolve(n,s);break}r=new dt(a),ut.bind([r],function(t){this.commonObjs.resolve(n,r)}.bind(this));break;case"FontPath":this.commonObjs.resolve(n,t[2]);break;default:s("Got unknown common object type "+i)}},this),t.on("obj",function(t){var e,i=t[0],r=t[1],a=t[2],s=this.pageCache[r];if(!s.objs.hasData(i))switch(a){case"JpegStream":e=t[3],v(i,e,s.objs);break;case"Image":e=t[3],s.objs.resolve(i,e);var o=8e6;e&&"data"in e&&e.data.length>o&&(s.cleanupAfterRender=!0);
break;default:n("Got unknown object type "+a)}},this),t.on("DocProgress",function(t){var e=this.loadingTask;e.onProgress&&e.onProgress({loaded:t.loaded,total:t.total})},this),t.on("PageError",function(t){var e=this.pageCache[t.pageNum-1],i=e.intentStates[t.intent];i.displayReadyCapability?i.displayReadyCapability.reject(t.error):n(t.error)},this),t.on("JpegDecode",function(t){var e=t[0],n=t[1];return 3!==n&&1!==n?Promise.reject(new Error("Only 3 components or 1 component can be returned")):new Promise(function(t,i){var r=new Image;r.onload=function(){var e=r.width,i=r.height,a=e*i,s=4*a,o=new Uint8Array(a*n),l=b(e,i),c=l.getContext("2d");c.drawImage(r,0,0);var h,u,d=c.getImageData(0,0,e,i).data;if(3===n)for(h=0,u=0;s>h;h+=4,u+=3)o[u]=d[h],o[u+1]=d[h+1],o[u+2]=d[h+2];else if(1===n)for(h=0,u=0;s>h;h+=4,u++)o[u]=d[h];t({data:o,width:e,height:i})},r.onerror=function(){i(new Error("JpegDecode failed to load image"))},r.src=e})})},fetchDocument:function(t,e){this.loadingTask=t,e.disableAutoFetch=PDFJS.disableAutoFetch,e.disableStream=PDFJS.disableStream,e.chunkedViewerLoading=!!this.pdfDataRangeTransport,this.pdfDataRangeTransport&&(e.length=this.pdfDataRangeTransport.length,e.initialData=this.pdfDataRangeTransport.initialData),this.messageHandler.send("GetDocRequest",{source:e,disableRange:PDFJS.disableRange,maxImageSize:PDFJS.maxImageSize,cMapUrl:PDFJS.cMapUrl,cMapPacked:PDFJS.cMapPacked,disableFontFace:PDFJS.disableFontFace,disableCreateObjectURL:PDFJS.disableCreateObjectURL,verbosity:PDFJS.verbosity})},getData:function(){return this.messageHandler.sendWithPromise("GetData",null)},getPage:function(t,e){if(0>=t||t>this.numPages||(0|t)!==t)return Promise.reject(new Error("Invalid page request"));var n=t-1;if(n in this.pagePromises)return this.pagePromises[n];var i=this.messageHandler.sendWithPromise("GetPage",{pageIndex:n}).then(function(t){var e=new Y(n,t,this);return this.pageCache[n]=e,e}.bind(this));return this.pagePromises[n]=i,i},getPageIndex:function(t){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:t})},getAnnotations:function(t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t})},getDestinations:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getDestination:function(t){return this.messageHandler.sendWithPromise("GetDestination",{id:t})},getAttachments:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(t){return{info:t[0],metadata:t[1]?new PDFJS.Metadata(t[1]):null}})},getStats:function(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function(){this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var t=0,e=this.pageCache.length;e>t;t++){var n=this.pageCache[t];n&&n.destroy()}this.commonObjs.clear(),ut.clear()}.bind(this))}},i}(),Q=function(){function t(){this.objs={}}return t.prototype={ensureObj:function(t){if(this.objs[t])return this.objs[t];var e={capability:g(),data:null,resolved:!1};return this.objs[t]=e,e},get:function(t,e){if(e)return this.ensureObj(t).capability.promise.then(e),null;var i=this.objs[t];return i&&i.resolved||n("Requesting object that isn't resolved yet "+t),i.data},resolve:function(t,e){var n=this.ensureObj(t);n.resolved=!0,n.data=e,n.capability.resolve(e)},isResolved:function(t){var e=this.objs;return e[t]?e[t].resolved:!1},hasData:function(t){return this.isResolved(t)},getData:function(t){var e=this.objs;return e[t]&&e[t].resolved?e[t].data:null},clear:function(){this.objs={}}},t}(),V=function(){function t(t){this._internalRenderTask=t,this.onContinue=null}return t.prototype={get promise(){return this._internalRenderTask.capability.promise},cancel:function(){this._internalRenderTask.cancel()},then:function(t,e){return this.promise.then.apply(this.promise,arguments)}},t}(),q=function(){function t(t,e,n,i,r,a){this.callback=t,this.params=e,this.objs=n,this.commonObjs=i,this.operatorListIdx=null,this.operatorList=r,this.pageNumber=a,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this.useRequestAnimationFrame=!1,this.cancelled=!1,this.capability=g(),this.task=new V(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this)}return t.prototype={initalizeGraphics:function(t){if(!this.cancelled){PDFJS.pdfBug&&"StepperManager"in k&&k.StepperManager.enabled&&(this.stepper=k.StepperManager.create(this.pageNumber-1),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var e=this.params;this.gfx=new st(e.canvasContext,this.commonObjs,this.objs,e.imageLayer),this.gfx.beginDrawing(e.viewport,t),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}},cancel:function(){this.running=!1,this.cancelled=!0,this.callback("cancelled")},operatorListChanged:function(){return this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),void(this.running||this._continue())):void(this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound))},_continue:function(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue.call(this.task,this._scheduleNextBound):this._scheduleNext())},_scheduleNext:function(){this.useRequestAnimationFrame?window.requestAnimationFrame(this._nextBound):Promise.resolve(void 0).then(this._nextBound)},_next:function(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this.callback())))}},t}(),K=(PDFJS.Metadata=function(){function t(t){return t.replace(/>\\376\\377([^<]+)/g,function(t,e){for(var n=e.replace(/\\([0-3])([0-7])([0-7])/g,function(t,e,n,i){return String.fromCharCode(64*e+8*n+1*i)}),i="",r=0;r<n.length;r+=2){var a=256*n.charCodeAt(r)+n.charCodeAt(r+1);i+="&#x"+(65536+a).toString(16).substring(1)+";"}return">"+i})}function e(e){if("string"==typeof e){e=t(e);var i=new DOMParser;e=i.parseFromString(e,"application/xml")}else e instanceof Document||n("Metadata: Invalid metadata object");this.metaDocument=e,this.metadata={},this.parse()}return e.prototype={parse:function(){var t=this.metaDocument,e=t.documentElement;if("rdf:rdf"!==e.nodeName.toLowerCase())for(e=e.firstChild;e&&"rdf:rdf"!==e.nodeName.toLowerCase();)e=e.nextSibling;var n=e?e.nodeName.toLowerCase():null;if(e&&"rdf:rdf"===n&&e.hasChildNodes()){var i,r,a,s,o,l,c,h=e.childNodes;for(s=0,l=h.length;l>s;s++)if(i=h[s],"rdf:description"===i.nodeName.toLowerCase())for(o=0,c=i.childNodes.length;c>o;o++)"#text"!==i.childNodes[o].nodeName.toLowerCase()&&(r=i.childNodes[o],a=r.nodeName.toLowerCase(),this.metadata[a]=r.textContent.trim())}},get:function(t){return this.metadata[t]||null},has:function(t){return"undefined"!=typeof this.metadata[t]}},e}(),16),Z=100,$=4096,tt=.65,et=!0,nt=1e3,it=16,rt=function(){var t={};return{getCanvas:function(e,n,i,r){var a;if(void 0!==t[e])a=t[e],a.canvas.width=n,a.canvas.height=i,a.context.setTransform(1,0,0,1,0,0);else{var s=b(n,i),o=s.getContext("2d");r&&S(o),t[e]=a={canvas:s,context:o}}return a},clear:function(){for(var e in t){var n=t[e];n.canvas.width=0,n.canvas.height=0,delete t[e]}}}}(),at=function(){function t(t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=B,this.textMatrixScale=1,this.fontMatrix=C,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=F.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.old=t}return t.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(t,e){this.x=t,this.y=e}},t}(),st=function(){function i(t,e,n,i){this.ctx=t,this.current=new at,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=n,this.imageLayer=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,t&&S(t),this.cachedGetSinglePixelWidth=null}function a(t,e){if("undefined"!=typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);var i,r,a,s,o,l=e.height,c=e.width,h=l%it,u=(l-h)/it,d=0===h?u:u+1,f=t.createImageData(c,it),p=0,A=e.data,g=f.data;if(e.kind===D.GRAYSCALE_1BPP){var m=A.byteLength,v=PDFJS.hasCanvasTypedArrays?new Uint32Array(g.buffer):new J(g),b=v.length,S=c+7>>3,y=4294967295,x=PDFJS.isLittleEndian||!PDFJS.hasCanvasTypedArrays?4278190080:255;for(r=0;d>r;r++){for(s=u>r?it:h,i=0,a=0;s>a;a++){for(var k=m-p,P=0,C=k>S?c:8*k-7,F=-8&C,w=0,T=0;F>P;P+=8)T=A[p++],v[i++]=128&T?y:x,v[i++]=64&T?y:x,v[i++]=32&T?y:x,v[i++]=16&T?y:x,v[i++]=8&T?y:x,v[i++]=4&T?y:x,v[i++]=2&T?y:x,v[i++]=1&T?y:x;for(;C>P;P++)0===w&&(T=A[p++],w=128),v[i++]=T&w?y:x,w>>=1}for(;b>i;)v[i++]=0;t.putImageData(f,0,r*it)}}else if(e.kind===D.RGBA_32BPP){for(a=0,o=c*it*4,r=0;u>r;r++)g.set(A.subarray(p,p+o)),p+=o,t.putImageData(f,0,a),a+=it;d>r&&(o=c*h*4,g.set(A.subarray(p,p+o)),t.putImageData(f,0,a))}else if(e.kind===D.RGB_24BPP)for(s=it,o=c*s,r=0;d>r;r++){for(r>=u&&(s=h,o=c*s),i=0,a=o;a--;)g[i++]=A[p++],g[i++]=A[p++],g[i++]=A[p++],g[i++]=255;t.putImageData(f,0,r*it)}else n("bad image kind: "+e.kind)}function s(t,e){for(var n=e.height,i=e.width,r=n%it,a=(n-r)/it,s=0===r?a:a+1,o=t.createImageData(i,it),l=0,c=e.data,h=o.data,u=0;s>u;u++){for(var d=a>u?it:r,f=3,p=0;d>p;p++)for(var A=0,g=0;i>g;g++){if(!A){var m=c[l++];A=128}h[f]=m&A?0:255,f+=4,A>>=1}t.putImageData(o,0,u*it)}}function l(t,e){for(var n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],i=0,r=n.length;r>i;i++){var a=n[i];void 0!==t[a]&&(e[a]=t[a])}void 0!==t.setLineDash?(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset):void 0!==t.mozDashOffset&&(e.mozDash=t.mozDash,e.mozDashOffset=t.mozDashOffset)}function c(t,e,n,i){for(var r=t.length,a=3;r>a;a+=4){var s=t[a];if(0===s)t[a-3]=e,t[a-2]=n,t[a-1]=i;else if(255>s){var o=255-s;t[a-3]=t[a-3]*s+e*o>>8,t[a-2]=t[a-2]*s+n*o>>8,t[a-1]=t[a-1]*s+i*o>>8}}}function h(t,e){for(var n=t.length,i=1/255,r=3;n>r;r+=4){var a=t[r];e[r]=e[r]*a*i|0}}function u(t,e){for(var n=t.length,i=3;n>i;i+=4){var r=77*t[i-3]+152*t[i-2]+28*t[i-1];e[i]=e[i]*r>>16}}function d(t,e,n,i,r,a){var s,o=!!a,l=o?a[0]:0,d=o?a[1]:0,f=o?a[2]:0;s="Luminosity"===r?u:h;for(var p=1048576,A=Math.min(i,Math.ceil(p/n)),g=0;i>g;g+=A){var m=Math.min(A,i-g),v=t.getImageData(0,g,n,m),b=e.getImageData(0,g,n,m);o&&c(v.data,l,d,f),s(v.data,b.data),t.putImageData(b,0,g)}}function A(t,e,n){var i=e.canvas,r=e.context;t.setTransform(e.scaleX,0,0,e.scaleY,e.offsetX,e.offsetY);var a=e.backdrop||null;if(ot.isEnabled){var s=ot.composeSMask(n.canvas,i,{subtype:e.subtype,backdrop:a});return t.setTransform(1,0,0,1,0,0),void t.drawImage(s,e.offsetX,e.offsetY)}d(r,n,i.width,i.height,e.subtype,a),t.drawImage(i,0,0)}var g=15,m=10,v=["butt","round","square"],b=["miter","round","bevel"],k={},P={};i.prototype={beginDrawing:function(t,e){var n=this.ctx.canvas.width,i=this.ctx.canvas.height;e?this.ctx.clearRect(0,0,n,i):(this.ctx.mozOpaque=!0,this.ctx.save(),this.ctx.fillStyle="rgb(255, 255, 255)",this.ctx.fillRect(0,0,n,i),this.ctx.restore());var r=t.transform;this.ctx.save(),this.ctx.transform.apply(this.ctx,r),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function(t,e,n,i){var r=t.argsArray,a=t.fnArray,s=e||0,o=r.length;if(o===s)return s;for(var l,c=o-s>m&&"function"==typeof n,h=c?Date.now()+g:0,u=0,d=this.commonObjs,f=this.objs;;){if(void 0!==i&&s===i.nextBreakPoint)return i.breakIt(s,n),s;if(l=a[s],l!==L.dependency)this[l].apply(this,r[s]);else for(var p=r[s],A=0,v=p.length;v>A;A++){var b=p[A],S="g"===b[0]&&"_"===b[1],y=S?d:f;if(!y.isResolved(b))return y.get(b,n),s}if(s++,s===o)return s;if(c&&++u>m){if(Date.now()>h)return n(),s;u=0}}},endDrawing:function(){this.ctx.restore(),rt.clear(),ot.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(t){this.current.lineWidth=t,this.ctx.lineWidth=t},setLineCap:function(t){this.ctx.lineCap=v[t]},setLineJoin:function(t){this.ctx.lineJoin=b[t]},setMiterLimit:function(t){this.ctx.miterLimit=t},setDash:function(t,e){var n=this.ctx;void 0!==n.setLineDash?(n.setLineDash(t),n.lineDashOffset=e):(n.mozDash=t,n.mozDashOffset=e)},setRenderingIntent:function(t){},setFlatness:function(t){},setGState:function(t){for(var n=0,i=t.length;i>n;n++){var r=t[n],a=r[0],s=r[1];switch(a){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=r[1];break;case"ca":this.current.fillAlpha=r[1],this.ctx.globalAlpha=r[1];break;case"BM":if(s&&s.name&&"Normal"!==s.name){var o=s.name.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()}).substring(1);this.ctx.globalCompositeOperation=o,this.ctx.globalCompositeOperation!==o&&e('globalCompositeOperation "'+o+'" is not supported')}else this.ctx.globalCompositeOperation="source-over";break;case"SMask":this.current.activeSMask&&this.endSMaskGroup(),this.current.activeSMask=s?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var t=this.current.activeSMask,e=t.canvas.width,n=t.canvas.height,i="smaskGroupAt"+this.groupLevel,r=rt.getCanvas(i,e,n,!0),a=this.ctx,s=a.mozCurrentTransform;this.ctx.save();var o=r.context;o.scale(1/t.scaleX,1/t.scaleY),o.translate(-t.offsetX,-t.offsetY),o.transform.apply(o,s),l(a,o),this.ctx=o,this.setGState([["BM","Normal"],["ca",1],["CA",1]]),this.groupStack.push(a),this.groupLevel++},endSMaskGroup:function(){var t=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),A(this.ctx,this.current.activeSMask,t),this.ctx.restore()},save:function(){this.ctx.save();var t=this.current;this.stateStack.push(t),this.current=t.clone(),this.current.activeSMask=null},restore:function(){0!==this.stateStack.length&&(null!==this.current.activeSMask&&this.endSMaskGroup(),this.current=this.stateStack.pop(),this.ctx.restore(),this.cachedGetSinglePixelWidth=null)},transform:function(t,e,n,i,r,a){this.ctx.transform(t,e,n,i,r,a),this.cachedGetSinglePixelWidth=null},constructPath:function(t,e){for(var n=this.ctx,i=this.current,r=i.x,a=i.y,s=0,o=0,l=t.length;l>s;s++)switch(0|t[s]){case L.rectangle:r=e[o++],a=e[o++];var c=e[o++],h=e[o++];0===c&&(c=this.getSinglePixelWidth()),0===h&&(h=this.getSinglePixelWidth());var u=r+c,d=a+h;this.ctx.moveTo(r,a),this.ctx.lineTo(u,a),this.ctx.lineTo(u,d),this.ctx.lineTo(r,d),this.ctx.lineTo(r,a),this.ctx.closePath();break;case L.moveTo:r=e[o++],a=e[o++],n.moveTo(r,a);break;case L.lineTo:r=e[o++],a=e[o++],n.lineTo(r,a);break;case L.curveTo:r=e[o+4],a=e[o+5],n.bezierCurveTo(e[o],e[o+1],e[o+2],e[o+3],r,a),o+=6;break;case L.curveTo2:n.bezierCurveTo(r,a,e[o],e[o+1],e[o+2],e[o+3]),r=e[o+2],a=e[o+3],o+=4;break;case L.curveTo3:r=e[o+2],a=e[o+3],n.bezierCurveTo(e[o],e[o+1],r,a,r,a),o+=4;break;case L.closePath:n.closePath()}i.setCurrentPoint(r,a)},closePath:function(){this.ctx.closePath()},stroke:function(t){t="undefined"!=typeof t?t:!0;var e=this.ctx,n=this.current.strokeColor;e.lineWidth=Math.max(this.getSinglePixelWidth()*tt,this.current.lineWidth),e.globalAlpha=this.current.strokeAlpha,n&&n.hasOwnProperty("type")&&"Pattern"===n.type?(e.save(),e.strokeStyle=n.getPattern(e,this),e.stroke(),e.restore()):e.stroke(),t&&this.consumePath(),e.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath(),this.stroke()},fill:function(t){t="undefined"!=typeof t?t:!0;var e=this.ctx,n=this.current.fillColor,i=this.current.patternFill,r=!1;if(i&&(e.save(),e.fillStyle=n.getPattern(e,this),r=!0),this.pendingEOFill){if(void 0!==e.mozFillRule)e.mozFillRule="evenodd",e.fill(),e.mozFillRule="nonzero";else try{e.fill("evenodd")}catch(a){e.fill()}this.pendingEOFill=!1}else e.fill();r&&e.restore(),t&&this.consumePath()},eoFill:function(){this.pendingEOFill=!0,this.fill()},fillStroke:function(){this.fill(!1),this.stroke(!1),this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0,this.fillStroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=k},eoClip:function(){this.pendingClip=P},beginText:function(){this.current.textMatrix=B,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},endText:function(){var t=this.pendingTextPaths,e=this.ctx;if(void 0===t)return void e.beginPath();e.save(),e.beginPath();for(var n=0;n<t.length;n++){var i=t[n];e.setTransform.apply(e,i.transform),e.translate(i.x,i.y),i.addToPath(e,i.fontSize)}e.restore(),e.clip(),e.beginPath(),delete this.pendingTextPaths},setCharSpacing:function(t){this.current.charSpacing=t},setWordSpacing:function(t){this.current.wordSpacing=t},setHScale:function(t){this.current.textHScale=t/100},setLeading:function(t){this.current.leading=-t},setFont:function(t,i){var r=this.commonObjs.get(t),a=this.current;if(r||n("Can't find font for "+t),a.fontMatrix=r.fontMatrix?r.fontMatrix:C,0!==a.fontMatrix[0]&&0!==a.fontMatrix[3]||e("Invalid font matrix for font "+t),0>i?(i=-i,a.fontDirection=-1):a.fontDirection=1,this.current.font=r,this.current.fontSize=i,!r.isType3Font){var s=r.loadedName||"sans-serif",o=r.black?r.bold?"900":"bold":r.bold?"bold":"normal",l=r.italic?"italic":"normal",c='"'+s+'", '+r.fallbackName,h=K>i?K:i>Z?Z:i;this.current.fontSizeScale=i/h;var u=l+" "+o+" "+h+"px "+c;this.ctx.font=u}},setTextRenderingMode:function(t){this.current.textRenderingMode=t},setTextRise:function(t){this.current.textRise=t},moveText:function(t,e){this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e},setLeadingMoveText:function(t,e){this.setLeading(-e),this.moveText(t,e)},setTextMatrix:function(t,e,n,i,r,a){this.current.textMatrix=[t,e,n,i,r,a],this.current.textMatrixScale=Math.sqrt(t*t+e*e),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar:function(t,e,n){var i,r=this.ctx,a=this.current,s=a.font,o=a.textRenderingMode,l=a.fontSize/a.fontSizeScale,c=o&F.FILL_STROKE_MASK,h=!!(o&F.ADD_TO_PATH_FLAG);if((s.disableFontFace||h)&&(i=s.getPathGenerator(this.commonObjs,t)),s.disableFontFace?(r.save(),r.translate(e,n),r.beginPath(),i(r,l),c!==F.FILL&&c!==F.FILL_STROKE||r.fill(),c!==F.STROKE&&c!==F.FILL_STROKE||r.stroke(),r.restore()):(c!==F.FILL&&c!==F.FILL_STROKE||r.fillText(t,e,n),c!==F.STROKE&&c!==F.FILL_STROKE||r.strokeText(t,e,n)),h){var u=this.pendingTextPaths||(this.pendingTextPaths=[]);u.push({transform:r.mozCurrentTransform,x:e,y:n,fontSize:l,addToPath:i})}},get isFontSubpixelAAEnabled(){var t=document.createElement("canvas").getContext("2d");t.scale(1.5,1),t.fillText("I",0,10);for(var e=t.getImageData(0,0,10,10).data,n=!1,i=3;i<e.length;i+=4)if(e[i]>0&&e[i]<255){n=!0;break}return o(this,"isFontSubpixelAAEnabled",n)},showText:function(t){var e=this.current,n=e.font;if(n.isType3Font)return this.showType3Text(t);var i=e.fontSize;if(0!==i){var r=this.ctx,a=e.fontSizeScale,s=e.charSpacing,o=e.wordSpacing,l=e.fontDirection,c=e.textHScale*l,h=t.length,u=n.vertical,d=n.defaultVMetrics,p=i*e.fontMatrix[0],A=e.textRenderingMode===F.FILL&&!n.disableFontFace;r.save(),r.transform.apply(r,e.textMatrix),r.translate(e.x,e.y+e.textRise),l>0?r.scale(c,-1):r.scale(c,1);var g=e.lineWidth,m=e.textMatrixScale;if(0===m||0===g){var v=e.textRenderingMode&F.FILL_STROKE_MASK;v!==F.STROKE&&v!==F.FILL_STROKE||(this.cachedGetSinglePixelWidth=null,g=this.getSinglePixelWidth()*tt)}else g/=m;1!==a&&(r.scale(a,a),g/=a),r.lineWidth=g;var b,S=0;for(b=0;h>b;++b){var y=t[b];if(null!==y)if(f(y))S+=-y*i*.001;else{var x,k,P,C,D=!1,w=y.fontChar,T=y.accent,L=y.width;if(u){var R,E,I;R=y.vmetric||d,E=y.vmetric?R[1]:.5*L,E=-E*p,I=R[2]*p,L=R?-R[0]:L,x=E/a,k=(S+I)/a}else x=S/a,k=0;if(n.remeasure&&L>0&&this.isFontSubpixelAAEnabled){var M=1e3*r.measureText(w).width/i*a,_=L/M;D=!0,r.save(),r.scale(_,1),x/=_}A&&!T?r.fillText(w,x,k):(this.paintChar(w,x,k),T&&(P=x+T.offset.x/a,C=k-T.offset.y/a,this.paintChar(T.fontChar,P,C)));var O=L*p+s*l;S+=O,D&&r.restore()}else S+=l*o}u?e.y-=S*c:e.x+=S*c,r.restore()}},showType3Text:function(t){var n,i,r,a=this.ctx,s=this.current,o=s.font,l=s.fontSize,c=s.fontDirection,h=s.charSpacing,u=s.wordSpacing,d=s.textHScale*c,p=s.fontMatrix||C,A=t.length,g=s.textRenderingMode===F.INVISIBLE;if(!g&&0!==l){for(this.cachedGetSinglePixelWidth=null,a.save(),a.transform.apply(a,s.textMatrix),a.translate(s.x,s.y),a.scale(d,c),n=0;A>n;++n)if(i=t[n],null!==i)if(f(i)){var m=.001*-i*l;this.ctx.translate(m,0),s.x+=m*d}else{var v=o.charProcOperatorList[i.operatorListId];if(v){this.processingType3=i,this.save(),a.scale(l,l),a.transform.apply(a,p),this.executeOperatorList(v),this.restore();var b=W.applyTransform([i.width,0],p);r=b[0]*l+h,a.translate(r,0),s.x+=r*d}else e('Type3 character "'+i.operatorListId+'" is not available')}else this.ctx.translate(u,0),s.x+=u*d;a.restore(),this.processingType3=null}},setCharWidth:function(t,e){},setCharWidthAndBounds:function(t,e,n,i,r,a){this.ctx.rect(n,i,r-n,a-i),this.clip(),this.endPath()},getColorN_Pattern:function(t){var e;if("TilingPattern"===t[0]){var n=t[1];e=new ht(t,n,this.ctx,this.objs,this.commonObjs,this.baseTransform)}else e=x(t);return e},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0},setStrokeRGBColor:function(t,e,n){var i=W.makeCssRgb(t,e,n);this.ctx.strokeStyle=i,this.current.strokeColor=i},setFillRGBColor:function(t,e,n){var i=W.makeCssRgb(t,e,n);this.ctx.fillStyle=i,this.current.fillColor=i,this.current.patternFill=!1},shadingFill:function(t){var e=this.ctx;this.save();var n=x(t);e.fillStyle=n.getPattern(e,this,!0);var i=e.mozCurrentTransformInverse;if(i){var r=e.canvas,a=r.width,s=r.height,o=W.applyTransform([0,0],i),l=W.applyTransform([0,s],i),c=W.applyTransform([a,0],i),h=W.applyTransform([a,s],i),u=Math.min(o[0],l[0],c[0],h[0]),d=Math.min(o[1],l[1],c[1],h[1]),f=Math.max(o[0],l[0],c[0],h[0]),p=Math.max(o[1],l[1],c[1],h[1]);this.ctx.fillRect(u,d,f-u,p-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){n("Should not call beginInlineImage")},beginImageData:function(){n("Should not call beginImageData")},paintFormXObjectBegin:function(t,e){if(this.save(),this.baseTransformStack.push(this.baseTransform),p(t)&&6===t.length&&this.transform.apply(this,t),this.baseTransform=this.ctx.mozCurrentTransform,p(e)&&4===e.length){var n=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],n,i),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function(n){this.save();var i=this.ctx;n.isolated||t("TODO: Support non-isolated groups."),n.knockout&&e("Knockout groups not supported.");var a=i.mozCurrentTransform;n.matrix&&i.transform.apply(i,n.matrix),r(n.bbox,"Bounding box is required.");var s=W.getAxialAlignedBoundingBox(n.bbox,i.mozCurrentTransform),o=[0,0,i.canvas.width,i.canvas.height];s=W.intersect(s,o)||[0,0,0,0];var c=Math.floor(s[0]),h=Math.floor(s[1]),u=Math.max(Math.ceil(s[2])-c,1),d=Math.max(Math.ceil(s[3])-h,1),f=1,p=1;u>$&&(f=u/$,u=$),d>$&&(p=d/$,d=$);var A="groupAt"+this.groupLevel;n.smask&&(A+="_smask_"+this.smaskCounter++%2);var g=rt.getCanvas(A,u,d,!0),m=g.context;m.scale(1/f,1/p),m.translate(-c,-h),m.transform.apply(m,a),n.smask?this.smaskStack.push({canvas:g.canvas,context:m,offsetX:c,offsetY:h,scaleX:f,scaleY:p,subtype:n.smask.subtype,backdrop:n.smask.backdrop}):(i.setTransform(1,0,0,1,0,0),i.translate(c,h),i.scale(f,p)),l(i,m),this.ctx=m,this.setGState([["BM","Normal"],["ca",1],["CA",1]]),this.groupStack.push(i),this.groupLevel++},endGroup:function(t){this.groupLevel--;var e=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,t.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(e.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.current=new at},endAnnotations:function(){this.restore()},beginAnnotation:function(t,e,n){if(this.save(),p(t)&&4===t.length){var i=t[2]-t[0],r=t[3]-t[1];this.ctx.rect(t[0],t[1],i,r),this.clip(),this.endPath()}this.transform.apply(this,e),this.transform.apply(this,n)},endAnnotation:function(){this.restore()},paintJpegXObject:function(t,n,i){var r=this.objs.get(t);if(!r)return void e("Dependent image isn't ready yet");this.save();var a=this.ctx;if(a.scale(1/n,-1/i),a.drawImage(r,0,0,r.width,r.height,0,-i,n,i),this.imageLayer){var s=a.mozCurrentTransformInverse,o=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:t,left:o[0],top:o[1],width:n/s[0],height:i/s[3]})}this.restore()},paintImageMaskXObject:function(t){var e=this.ctx,n=t.width,i=t.height,r=this.current.fillColor,a=this.current.patternFill,o=this.processingType3;if(et&&o&&void 0===o.compiled&&(nt>=n&&nt>=i?o.compiled=y({data:t.data,width:n,height:i}):o.compiled=null),o&&o.compiled)return void o.compiled(e);var l=rt.getCanvas("maskCanvas",n,i),c=l.context;c.save(),s(c,t),c.globalCompositeOperation="source-in",c.fillStyle=a?r.getPattern(c,this):r,c.fillRect(0,0,n,i),c.restore(),this.paintInlineImageXObject(l.canvas)},paintImageMaskXObjectRepeat:function(t,e,n,i){var r=t.width,a=t.height,o=this.current.fillColor,l=this.current.patternFill,c=rt.getCanvas("maskCanvas",r,a),h=c.context;h.save(),s(h,t),h.globalCompositeOperation="source-in",h.fillStyle=l?o.getPattern(h,this):o,h.fillRect(0,0,r,a),h.restore();for(var u=this.ctx,d=0,f=i.length;f>d;d+=2)u.save(),u.transform(e,0,0,n,i[d],i[d+1]),u.scale(1,-1),u.drawImage(c.canvas,0,0,r,a,0,-1,1,1),u.restore()},paintImageMaskXObjectGroup:function(t){for(var e=this.ctx,n=this.current.fillColor,i=this.current.patternFill,r=0,a=t.length;a>r;r++){var o=t[r],l=o.width,c=o.height,h=rt.getCanvas("maskCanvas",l,c),u=h.context;u.save(),s(u,o),u.globalCompositeOperation="source-in",u.fillStyle=i?n.getPattern(u,this):n,u.fillRect(0,0,l,c),u.restore(),e.save(),e.transform.apply(e,o.transform),e.scale(1,-1),e.drawImage(h.canvas,0,0,l,c,0,-1,1,1),e.restore()}},paintImageXObject:function(t){var n=this.objs.get(t);return n?void this.paintInlineImageXObject(n):void e("Dependent image isn't ready yet")},paintImageXObjectRepeat:function(t,n,i,r){var a=this.objs.get(t);if(!a)return void e("Dependent image isn't ready yet");for(var s=a.width,o=a.height,l=[],c=0,h=r.length;h>c;c+=2)l.push({transform:[n,0,0,i,r[c],r[c+1]],x:0,y:0,w:s,h:o});this.paintInlineImageXObjectGroup(a,l)},paintInlineImageXObject:function(t){var e=t.width,n=t.height,i=this.ctx;this.save(),i.scale(1/e,-1/n);var r,s,o=i.mozCurrentTransformInverse,l=o[0],c=o[1],h=Math.max(Math.sqrt(l*l+c*c),1),u=o[2],d=o[3],f=Math.max(Math.sqrt(u*u+d*d),1);if(t instanceof HTMLElement||!t.data)r=t;else{s=rt.getCanvas("inlineImage",e,n);var p=s.context;a(p,t),r=s.canvas}for(var A=e,g=n,m="prescale1";h>2&&A>1||f>2&&g>1;){var v=A,b=g;h>2&&A>1&&(v=Math.ceil(A/2),h/=A/v),f>2&&g>1&&(b=Math.ceil(g/2),f/=g/b),s=rt.getCanvas(m,v,b),p=s.context,p.clearRect(0,0,v,b),p.drawImage(r,0,0,A,g,0,0,v,b),r=s.canvas,A=v,g=b,m="prescale1"===m?"prescale2":"prescale1"}if(i.drawImage(r,0,0,A,g,0,-n,e,n),this.imageLayer){var S=this.getCanvasPosition(0,-n);this.imageLayer.appendImage({imgData:t,left:S[0],top:S[1],width:e/o[0],height:n/o[3]})}this.restore()},paintInlineImageXObjectGroup:function(t,e){var n=this.ctx,i=t.width,r=t.height,s=rt.getCanvas("inlineImage",i,r),o=s.context;a(o,t);for(var l=0,c=e.length;c>l;l++){var h=e[l];if(n.save(),n.transform.apply(n,h.transform),n.scale(1,-1),n.drawImage(s.canvas,h.x,h.y,h.w,h.h,0,-1,1,1),this.imageLayer){var u=this.getCanvasPosition(h.x,h.y);this.imageLayer.appendImage({imgData:t,left:u[0],top:u[1],width:i,height:r})}n.restore()}},paintSolidColorImageMask:function(){this.ctx.fillRect(0,0,1,1)},markPoint:function(t){},markPointProps:function(t,e){},beginMarkedContent:function(t){},beginMarkedContentProps:function(t,e){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){var t=this.ctx;if(this.pendingClip){if(this.pendingClip===P)if(void 0!==t.mozFillRule)t.mozFillRule="evenodd",t.clip(),t.mozFillRule="nonzero";else try{t.clip("evenodd")}catch(e){t.clip()}else t.clip();this.pendingClip=null}t.beginPath()},getSinglePixelWidth:function(t){if(null===this.cachedGetSinglePixelWidth){var e=this.ctx.mozCurrentTransformInverse;this.cachedGetSinglePixelWidth=Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1],e[2]*e[2]+e[3]*e[3]))}return this.cachedGetSinglePixelWidth},getCanvasPosition:function(t,e){var n=this.ctx.mozCurrentTransform;return[n[0]*t+n[2]*e+n[4],n[1]*t+n[3]*e+n[5]]}};for(var w in L)i.prototype[L[w]]=i.prototype[w];return i}(),ot=function(){function t(t,e,n){var i=t.createShader(n);t.shaderSource(i,e),t.compileShader(i);var r=t.getShaderParameter(i,t.COMPILE_STATUS);if(!r){var a=t.getShaderInfoLog(i);throw new Error("Error during shader compilation: "+a)}return i}function e(e,n){return t(e,n,e.VERTEX_SHADER)}function n(e,n){return t(e,n,e.FRAGMENT_SHADER)}function i(t,e){for(var n=t.createProgram(),i=0,r=e.length;r>i;++i)t.attachShader(n,e[i]);t.linkProgram(n);var a=t.getProgramParameter(n,t.LINK_STATUS);if(!a){var s=t.getProgramInfoLog(n);throw new Error("Error during program linking: "+s)}return n}function r(t,e,n){t.activeTexture(n);var i=t.createTexture();return t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),i}function a(){d||(f=document.createElement("canvas"),d=f.getContext("webgl",{premultipliedalpha:!1}))}function s(){var t,r;a(),t=f,f=null,r=d,d=null;var s=e(r,p),o=n(r,A),l=i(r,[s,o]);r.useProgram(l);var c={};c.gl=r,c.canvas=t,c.resolutionLocation=r.getUniformLocation(l,"u_resolution"),c.positionLocation=r.getAttribLocation(l,"a_position"),c.backdropLocation=r.getUniformLocation(l,"u_backdrop"),c.subtypeLocation=r.getUniformLocation(l,"u_subtype");var h=r.getAttribLocation(l,"a_texCoord"),u=r.getUniformLocation(l,"u_image"),m=r.getUniformLocation(l,"u_mask"),v=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,v),r.bufferData(r.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),r.STATIC_DRAW),r.enableVertexAttribArray(h),r.vertexAttribPointer(h,2,r.FLOAT,!1,0,0),r.uniform1i(u,0),r.uniform1i(m,1),g=c}function l(t,e,n){var i=t.width,a=t.height;g||s();var o=g,l=o.canvas,c=o.gl;l.width=i,l.height=a,c.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),c.uniform2f(o.resolutionLocation,i,a),n.backdrop?c.uniform4f(o.resolutionLocation,n.backdrop[0],n.backdrop[1],n.backdrop[2],1):c.uniform4f(o.resolutionLocation,0,0,0,0),c.uniform1i(o.subtypeLocation,"Luminosity"===n.subtype?1:0);var h=r(c,t,c.TEXTURE0),u=r(c,e,c.TEXTURE1),d=c.createBuffer();
return c.bindBuffer(c.ARRAY_BUFFER,d),c.bufferData(c.ARRAY_BUFFER,new Float32Array([0,0,i,0,0,a,0,a,i,0,i,a]),c.STATIC_DRAW),c.enableVertexAttribArray(o.positionLocation),c.vertexAttribPointer(o.positionLocation,2,c.FLOAT,!1,0,0),c.clearColor(0,0,0,0),c.enable(c.BLEND),c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA),c.clear(c.COLOR_BUFFER_BIT),c.drawArrays(c.TRIANGLES,0,6),c.flush(),c.deleteTexture(h),c.deleteTexture(u),c.deleteBuffer(d),l}function c(){var t,r;a(),t=f,f=null,r=d,d=null;var s=e(r,m),o=n(r,v),l=i(r,[s,o]);r.useProgram(l);var c={};c.gl=r,c.canvas=t,c.resolutionLocation=r.getUniformLocation(l,"u_resolution"),c.scaleLocation=r.getUniformLocation(l,"u_scale"),c.offsetLocation=r.getUniformLocation(l,"u_offset"),c.positionLocation=r.getAttribLocation(l,"a_position"),c.colorLocation=r.getAttribLocation(l,"a_color"),b=c}function h(t,e,n,i,r){b||c();var a=b,s=a.canvas,o=a.gl;s.width=t,s.height=e,o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.uniform2f(a.resolutionLocation,t,e);var l,h,u,d=0;for(l=0,h=i.length;h>l;l++)switch(i[l].type){case"lattice":u=i[l].coords.length/i[l].verticesPerRow|0,d+=(u-1)*(i[l].verticesPerRow-1)*6;break;case"triangles":d+=i[l].coords.length}var f=new Float32Array(2*d),p=new Uint8Array(3*d),A=r.coords,g=r.colors,m=0,v=0;for(l=0,h=i.length;h>l;l++){var S=i[l],y=S.coords,x=S.colors;switch(S.type){case"lattice":var k=S.verticesPerRow;u=y.length/k|0;for(var P=1;u>P;P++)for(var C=P*k+1,F=1;k>F;F++,C++)f[m]=A[y[C-k-1]],f[m+1]=A[y[C-k-1]+1],f[m+2]=A[y[C-k]],f[m+3]=A[y[C-k]+1],f[m+4]=A[y[C-1]],f[m+5]=A[y[C-1]+1],p[v]=g[x[C-k-1]],p[v+1]=g[x[C-k-1]+1],p[v+2]=g[x[C-k-1]+2],p[v+3]=g[x[C-k]],p[v+4]=g[x[C-k]+1],p[v+5]=g[x[C-k]+2],p[v+6]=g[x[C-1]],p[v+7]=g[x[C-1]+1],p[v+8]=g[x[C-1]+2],f[m+6]=f[m+2],f[m+7]=f[m+3],f[m+8]=f[m+4],f[m+9]=f[m+5],f[m+10]=A[y[C]],f[m+11]=A[y[C]+1],p[v+9]=p[v+3],p[v+10]=p[v+4],p[v+11]=p[v+5],p[v+12]=p[v+6],p[v+13]=p[v+7],p[v+14]=p[v+8],p[v+15]=g[x[C]],p[v+16]=g[x[C]+1],p[v+17]=g[x[C]+2],m+=12,v+=18;break;case"triangles":for(var D=0,w=y.length;w>D;D++)f[m]=A[y[D]],f[m+1]=A[y[D]+1],p[v]=g[x[l]],p[v+1]=g[x[D]+1],p[v+2]=g[x[D]+2],m+=2,v+=3}}n?o.clearColor(n[0]/255,n[1]/255,n[2]/255,1):o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT);var T=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,T),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(a.positionLocation),o.vertexAttribPointer(a.positionLocation,2,o.FLOAT,!1,0,0);var L=o.createBuffer();return o.bindBuffer(o.ARRAY_BUFFER,L),o.bufferData(o.ARRAY_BUFFER,p,o.STATIC_DRAW),o.enableVertexAttribArray(a.colorLocation),o.vertexAttribPointer(a.colorLocation,3,o.UNSIGNED_BYTE,!1,0,0),o.uniform2f(a.scaleLocation,r.scaleX,r.scaleY),o.uniform2f(a.offsetLocation,r.offsetX,r.offsetY),o.drawArrays(o.TRIANGLES,0,d),o.flush(),o.deleteBuffer(T),o.deleteBuffer(L),s}function u(){g&&g.canvas&&(g.canvas.width=0,g.canvas.height=0),b&&b.canvas&&(b.canvas.width=0,b.canvas.height=0),g=null,b=null}var d,f,p=" attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } ",A=" precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",g=null,m=" attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",v=" precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",b=null;return{get isEnabled(){if(PDFJS.disableWebGL)return!1;var t=!1;try{a(),t=!!d}catch(e){}return o(this,"isEnabled",t)},composeSMask:l,drawFigures:h,clear:u}}(),lt={};lt.RadialAxial={fromIR:function(t){var e=t[1],n=t[2],i=t[3],r=t[4],a=t[5],s=t[6];return{type:"Pattern",getPattern:function(t){var o;"axial"===e?o=t.createLinearGradient(i[0],i[1],r[0],r[1]):"radial"===e&&(o=t.createRadialGradient(i[0],i[1],a,r[0],r[1],s));for(var l=0,c=n.length;c>l;++l){var h=n[l];o.addColorStop(h[0],h[1])}return o}}}};var ct=function(){function t(t,e,n,i,r,a,s,o){var l,c=e.coords,h=e.colors,u=t.data,d=4*t.width;c[n+1]>c[i+1]&&(l=n,n=i,i=l,l=a,a=s,s=l),c[i+1]>c[r+1]&&(l=i,i=r,r=l,l=s,s=o,o=l),c[n+1]>c[i+1]&&(l=n,n=i,i=l,l=a,a=s,s=l);var f=(c[n]+e.offsetX)*e.scaleX,p=(c[n+1]+e.offsetY)*e.scaleY,A=(c[i]+e.offsetX)*e.scaleX,g=(c[i+1]+e.offsetY)*e.scaleY,m=(c[r]+e.offsetX)*e.scaleX,v=(c[r+1]+e.offsetY)*e.scaleY;if(!(p>=v))for(var b,S,y,x,k,P,C,F,D,w=h[a],T=h[a+1],L=h[a+2],R=h[s],E=h[s+1],I=h[s+2],M=h[o],_=h[o+1],O=h[o+2],j=Math.round(p),N=Math.round(v),J=j;N>=J;J++){g>J?(D=p>J?0:p===g?1:(p-J)/(p-g),b=f-(f-A)*D,S=w-(w-R)*D,y=T-(T-E)*D,x=L-(L-I)*D):(D=J>v?1:g===v?0:(g-J)/(g-v),b=A-(A-m)*D,S=R-(R-M)*D,y=E-(E-_)*D,x=I-(I-O)*D),D=p>J?0:J>v?1:(p-J)/(p-v),k=f-(f-m)*D,P=w-(w-M)*D,C=T-(T-_)*D,F=L-(L-O)*D;for(var B=Math.round(Math.min(b,k)),W=Math.round(Math.max(b,k)),U=d*J+4*B,G=B;W>=G;G++)D=(b-G)/(b-k),D=0>D?0:D>1?1:D,u[U++]=S-(S-P)*D|0,u[U++]=y-(y-C)*D|0,u[U++]=x-(x-F)*D|0,u[U++]=255}}function e(e,i,r){var a,s,o=i.coords,l=i.colors;switch(i.type){case"lattice":var c=i.verticesPerRow,h=Math.floor(o.length/c)-1,u=c-1;for(a=0;h>a;a++)for(var d=a*c,f=0;u>f;f++,d++)t(e,r,o[d],o[d+1],o[d+c],l[d],l[d+1],l[d+c]),t(e,r,o[d+c+1],o[d+1],o[d+c],l[d+c+1],l[d+1],l[d+c]);break;case"triangles":for(a=0,s=o.length;s>a;a+=3)t(e,r,o[a],o[a+1],o[a+2],l[a],l[a+1],l[a+2]);break;default:n("illigal figure")}}function i(t,n,i,r,a,s){var o,l,c,h,u=1.1,d=3e3,f=Math.floor(t[0]),p=Math.floor(t[1]),A=Math.ceil(t[2])-f,g=Math.ceil(t[3])-p,m=Math.min(Math.ceil(Math.abs(A*n[0]*u)),d),v=Math.min(Math.ceil(Math.abs(g*n[1]*u)),d),b=A/m,S=g/v,y={coords:i,colors:r,offsetX:-f,offsetY:-p,scaleX:1/b,scaleY:1/S};if(ot.isEnabled)o=ot.drawFigures(m,v,s,a,y),l=rt.getCanvas("mesh",m,v,!1),l.context.drawImage(o,0,0),o=l.canvas;else{l=rt.getCanvas("mesh",m,v,!1);var x=l.context,k=x.createImageData(m,v);if(s){var P=k.data;for(c=0,h=P.length;h>c;c+=4)P[c]=s[0],P[c+1]=s[1],P[c+2]=s[2],P[c+3]=255}for(c=0;c<a.length;c++)e(k,a[c],y);x.putImageData(k,0,0),o=l.canvas}return{canvas:o,offsetX:f,offsetY:p,scaleX:b,scaleY:S}}return i}();lt.Mesh={fromIR:function(t){var e=t[2],n=t[3],i=t[4],r=t[5],a=t[6],s=t[8];return{type:"Pattern",getPattern:function(t,o,l){var c;if(l)c=W.singularValueDecompose2dScale(t.mozCurrentTransform);else if(c=W.singularValueDecompose2dScale(o.baseTransform),a){var h=W.singularValueDecompose2dScale(a);c=[c[0]*h[0],c[1]*h[1]]}var u=ct(r,c,e,n,i,l?null:s);return l||(t.setTransform.apply(t,o.baseTransform),a&&t.transform.apply(t,a)),t.translate(u.offsetX,u.offsetY),t.scale(u.scaleX,u.scaleY),t.createPattern(u.canvas,"no-repeat")}}}},lt.Dummy={fromIR:function(){return{type:"Pattern",getPattern:function(){return"hotpink"}}}};var ht=function(){function e(t,e,n,i,r,a){this.operatorList=t[2],this.matrix=t[3]||[1,0,0,1,0,0],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=e,this.objs=i,this.commonObjs=r,this.baseTransform=a,this.type="Pattern",this.ctx=n}var i={COLORED:1,UNCOLORED:2},r=3e3;return e.prototype={createPatternCanvas:function(e){var n=this.operatorList,i=this.bbox,a=this.xstep,s=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,h=this.objs,u=this.commonObjs;t("TilingType: "+l);var d=i[0],f=i[1],p=i[2],A=i[3],g=[d,f],m=[d+a,f+s],v=m[0]-g[0],b=m[1]-g[1],S=W.singularValueDecompose2dScale(this.matrix),y=W.singularValueDecompose2dScale(this.baseTransform),x=[S[0]*y[0],S[1]*y[1]];v=Math.min(Math.ceil(Math.abs(v*x[0])),r),b=Math.min(Math.ceil(Math.abs(b*x[1])),r);var k=rt.getCanvas("pattern",v,b,!0),P=k.context,C=new st(P,u,h);C.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(P,o,c),this.setScale(v,b,a,s),this.transformToScale(C);var F=[1,0,0,1,-g[0],-g[1]];return C.transform.apply(C,F),this.clipBbox(C,i,d,f,p,A),C.executeOperatorList(n),k.canvas},setScale:function(t,e,n,i){this.scale=[t/n,e/i]},transformToScale:function(t){var e=this.scale,n=[e[0],0,0,e[1],0,0];t.transform.apply(t,n)},scaleToContext:function(){var t=this.scale;this.ctx.scale(1/t[0],1/t[1])},clipBbox:function(t,e,n,i,r,a){if(e&&p(e)&&4===e.length){var s=r-n,o=a-i;t.ctx.rect(n,i,s,o),t.clip(),t.endPath()}},setFillAndStrokeStyleToContext:function(t,e,r){switch(e){case i.COLORED:var a=this.ctx;t.fillStyle=a.fillStyle,t.strokeStyle=a.strokeStyle;break;case i.UNCOLORED:var s=W.makeCssRgb(r[0],r[1],r[2]);t.fillStyle=s,t.strokeStyle=s;break;default:n("Unsupported paint type: "+e)}},getPattern:function(t,e){var n=this.createPatternCanvas(e);return t=this.ctx,t.setTransform.apply(t,this.baseTransform),t.transform.apply(t,this.matrix),this.scaleToContext(),t.createPattern(n,"repeat")}},e}();PDFJS.disableFontFace=!1;var ut={insertRule:function(t){var e=document.getElementById("PDFJS_FONT_STYLE_TAG");e||(e=document.createElement("style"),e.id="PDFJS_FONT_STYLE_TAG",document.documentElement.getElementsByTagName("head")[0].appendChild(e));var n=e.sheet;n.insertRule(t,n.cssRules.length)},clear:function(){var t=document.getElementById("PDFJS_FONT_STYLE_TAG");t&&t.parentNode.removeChild(t),this.nativeFontFaces.forEach(function(t){document.fonts["delete"](t)}),this.nativeFontFaces.length=0},get loadTestFont(){return o(this,"loadTestFont",atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="))},loadTestFontId:0,loadingContext:{requests:[],nextRequestId:0},isSyncFontLoadingSupported:function(){if(P)return!1;var t=window.navigator.userAgent,e=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(t);return e&&e[1]>=14?!0:"node"===t}(),nativeFontFaces:[],isFontLoadingAPISupported:!P&&"undefined"!=typeof document&&!!document.fonts,addNativeFontFace:function(t){this.nativeFontFaces.push(t),document.fonts.add(t)},bind:function(t,e){r(!P,"bind() shall be called from main thread");for(var n=[],i=[],a=[],s=0,o=t.length;o>s;s++){var l=t[s];if(!l.attached&&l.loading!==!1)if(l.attached=!0,this.isFontLoadingAPISupported){var c=l.createNativeFontFace();c&&a.push(c.loaded)}else{var h=l.bindDOM();h&&(n.push(h),i.push(l))}}var u=ut.queueLoadingCallback(e);this.isFontLoadingAPISupported?Promise.all(i).then(function(){u.complete()}):n.length>0&&!this.isSyncFontLoadingSupported?ut.prepareFontLoadEvent(n,i,u):u.complete()},queueLoadingCallback:function(t){function e(){for(r(!a.end,"completeRequest() cannot be called twice"),a.end=Date.now();n.requests.length>0&&n.requests[0].end;){var t=n.requests.shift();setTimeout(t.callback,0)}}var n=ut.loadingContext,i="pdfjs-font-loading-"+n.nextRequestId++,a={id:i,complete:e,callback:t,started:Date.now()};return n.requests.push(a),a},prepareFontLoadEvent:function(t,n,i){function r(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function a(t,e,n,i){var r=t.substr(0,e),a=t.substr(e+n);return r+i+a}function s(t,n){if(d++,d>30)return e("Load test font never loaded."),void n();u.font="30px "+t,u.fillText(".",0,20);var i=u.getImageData(0,0,1,1);return i.data[3]>0?void n():void setTimeout(s.bind(null,t,n))}var o,l,c=document.createElement("canvas");c.width=1,c.height=1;var u=c.getContext("2d"),d=0,f="lt"+Date.now()+this.loadTestFontId++,p=this.loadTestFont,A=976;p=a(p,A,f.length,f);var g=16,m=1482184792,v=r(p,g);for(o=0,l=f.length-3;l>o;o+=4)v=v-m+r(f,o)|0;o<f.length&&(v=v-m+r(f+"XXX",o)|0),p=a(p,g,4,h(v));var b="url(data:font/opentype;base64,"+btoa(p)+");",S='@font-face { font-family:"'+f+'";src:'+b+"}";ut.insertRule(S);var y=[];for(o=0,l=n.length;l>o;o++)y.push(n[o].loadedName);y.push(f);var x=document.createElement("div");for(x.setAttribute("style","visibility: hidden;width: 10px; height: 10px;position: absolute; top: 0px; left: 0px;"),o=0,l=y.length;l>o;++o){var k=document.createElement("span");k.textContent="Hi",k.style.fontFamily=y[o],x.appendChild(k)}document.body.appendChild(x),s(f,function(){document.body.removeChild(x),i.complete()})}},dt=function(){function t(t,e,n){if(this.compiledGlyphs={},1!==arguments.length);else{var i=arguments[0];for(var r in i)this[r]=i[r]}}return t.prototype={createNativeFontFace:function(){if(!this.data)return null;if(PDFJS.disableFontFace)return this.disableFontFace=!0,null;var t=new FontFace(this.loadedName,this.data,{});return ut.addNativeFontFace(t),PDFJS.pdfBug&&"FontInspector"in k&&k.FontInspector.enabled&&k.FontInspector.fontAdded(this),t},bindDOM:function(){if(!this.data)return null;if(PDFJS.disableFontFace)return this.disableFontFace=!0,null;var t=l(new Uint8Array(this.data)),e=this.loadedName,n="url(data:"+this.mimetype+";base64,"+window.btoa(t)+");",i='@font-face { font-family:"'+e+'";src:'+n+"}";return ut.insertRule(i),PDFJS.pdfBug&&"FontInspector"in k&&k.FontInspector.enabled&&k.FontInspector.fontAdded(this,n),i},getPathGenerator:function(t,e){if(!(e in this.compiledGlyphs)){var n=t.get(this.loadedName+"_path_"+e);this.compiledGlyphs[e]=new Function("c","size",n)}return this.compiledGlyphs[e]}},t}(),ft=10,pt=function(){function t(t,e,n){var i=t.style;if(i.fontSize=e.fontSize+"px",i.direction=e.fontDirection<0?"rtl":"ltr",n){i.fontWeight=n.black?n.bold?"bolder":"bold":n.bold?"bold":"normal",i.fontStyle=n.italic?"italic":"normal";var r=n.loadedName,a=r?'"'+r+'", ':"",s=n.fallbackName||"Helvetica, sans-serif";i.fontFamily=a+s}}function n(t,n){var i=document.createElement("section"),r=i.style,a=t.rect[2]-t.rect[0],s=t.rect[3]-t.rect[1];if(t.borderStyle.width>0){i.style.borderWidth=t.borderStyle.width+"px",t.borderStyle.style!==T.UNDERLINE&&(a-=2*t.borderStyle.width,s-=2*t.borderStyle.width);var o=t.borderStyle.horizontalCornerRadius,l=t.borderStyle.verticalCornerRadius;if(o>0||l>0){var c=o+"px / "+l+"px";CustomStyle.setProp("borderRadius",i,c)}switch(t.borderStyle.style){case T.SOLID:i.style.borderStyle="solid";break;case T.DASHED:i.style.borderStyle="dashed";break;case T.BEVELED:e("Unimplemented border style: beveled");break;case T.INSET:e("Unimplemented border style: inset");break;case T.UNDERLINE:i.style.borderBottomStyle="solid"}t.color?i.style.borderColor=W.makeCssRgb(Math.round(255*t.color[0]),Math.round(255*t.color[1]),Math.round(255*t.color[2])):i.style.borderColor="rgb(0,0,0)"}return r.width=a+"px",r.height=s+"px",i}function i(e,n){var i=document.createElement("div"),r=e.rect[2]-e.rect[0],a=e.rect[3]-e.rect[1];i.style.width=r+"px",i.style.height=a+"px",i.style.display="table";var s=document.createElement("div");s.textContent=e.fieldValue;var o=e.textAlignment;s.style.textAlign=["left","center","right"][o],s.style.verticalAlign="middle",s.style.display="table-cell";var l=e.fontRefName?n.getData(e.fontRefName):null;return t(s,e,l),i.appendChild(s),i}function r(t){var e=t.rect;e[3]-e[1]<ft&&(e[3]=e[1]+ft),e[2]-e[0]<ft&&(e[2]=e[0]+(e[3]-e[1]));var i=n(t,!1);i.className="annotText";var r=document.createElement("img");r.style.height=i.style.height,r.style.width=i.style.width;var a=t.name;r.src=PDFJS.imageResourcesPath+"annotation-"+a.toLowerCase()+".svg",r.alt="[{{type}} Annotation]",r.dataset.l10nId="text_annotation_type",r.dataset.l10nArgs=JSON.stringify({type:a});var s=document.createElement("div");s.className="annotTextContentWrapper",s.style.left=Math.floor(e[2]-e[0]+5)+"px",s.style.top="-10px";var o=document.createElement("div");o.className="annotTextContent",o.setAttribute("hidden",!0);var l,c;if(t.hasBgColor){var h=t.color,u=.7,d=u*(1-h[0])+h[0],f=u*(1-h[1])+h[1],p=u*(1-h[2])+h[2];o.style.backgroundColor=W.makeCssRgb(255*d|0,255*f|0,255*p|0)}var A=document.createElement("h1"),g=document.createElement("p");if(A.textContent=t.title,t.content||t.title){var m=document.createElement("span"),v=t.content.split(/(?:\r\n?|\n)/);for(l=0,c=v.length;c>l;++l){var b=v[l];m.appendChild(document.createTextNode(b)),c-1>l&&m.appendChild(document.createElement("br"))}g.appendChild(m);var S=!1,y=function(t){t&&(S=!0),o.hasAttribute("hidden")&&(i.style.zIndex+=1,o.removeAttribute("hidden"))},x=function(t){t&&(S=!1),o.hasAttribute("hidden")||S||(i.style.zIndex-=1,o.setAttribute("hidden",!0))},k=function(){S?x(!0):y(!0)};r.addEventListener("click",function(){k()},!1),r.addEventListener("mouseover",function(){y()},!1),r.addEventListener("mouseout",function(){x()},!1),o.addEventListener("click",function(){x(!0)},!1)}else o.setAttribute("hidden",!0);return o.appendChild(A),o.appendChild(g),s.appendChild(o),i.appendChild(r),i.appendChild(s),i}function a(t){var e=n(t,!0);e.className="annotLink";var i=document.createElement("a");return i.href=i.title=t.url||"",t.url&&PDFJS.openExternalLinksInNewWindow&&(i.target="_blank"),e.appendChild(i),e}function s(t,e){switch(t.annotationType){case w.WIDGET:return i(t,e);case w.TEXT:return r(t);case w.LINK:return a(t);default:throw new Error("Unsupported annotationType: "+t.annotationType)}}return{getHtmlElement:s}}();PDFJS.AnnotationUtils=pt;var At={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},gt=function(){function t(t,e,n){for(var i=-1,r=e;n>r;r++){var a=255&(i^t[r]),o=s[a];i=i>>>8^o}return-1^i}function e(e,n,i,r){var a=r,s=n.length;i[a]=s>>24&255,i[a+1]=s>>16&255,i[a+2]=s>>8&255,i[a+3]=255&s,a+=4,i[a]=255&e.charCodeAt(0),i[a+1]=255&e.charCodeAt(1),i[a+2]=255&e.charCodeAt(2),i[a+3]=255&e.charCodeAt(3),a+=4,i.set(n,a),a+=n.length;var o=t(i,r+4,a);i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o}function n(t,e,n){for(var i=1,r=0,a=e;n>a;++a)i=(i+(255&t[a]))%65521,r=(r+i)%65521;return r<<16|i}function i(t,i){var s,o,l,c=t.width,h=t.height,u=t.data;switch(i){case D.GRAYSCALE_1BPP:o=0,s=1,l=c+7>>3;break;case D.RGB_24BPP:o=2,s=8,l=3*c;break;case D.RGBA_32BPP:o=6,s=8,l=4*c;break;default:throw new Error("invalid format")}var d,f,p=new Uint8Array((1+l)*h),A=0,g=0;for(d=0;h>d;++d)p[A++]=0,p.set(u.subarray(g,g+l),A),g+=l,A+=l;if(i===D.GRAYSCALE_1BPP)for(A=0,d=0;h>d;d++)for(A++,f=0;l>f;f++)p[A++]^=255;var m=new Uint8Array([c>>24&255,c>>16&255,c>>8&255,255&c,h>>24&255,h>>16&255,h>>8&255,255&h,s,o,0,0,0]),v=p.length,b=65535,S=Math.ceil(v/b),y=new Uint8Array(2+v+5*S+4),x=0;y[x++]=120,y[x++]=156;for(var k=0;v>b;)y[x++]=0,y[x++]=255,y[x++]=255,y[x++]=0,y[x++]=0,y.set(p.subarray(k,k+b),x),x+=b,k+=b,v-=b;y[x++]=1,y[x++]=255&v,y[x++]=v>>8&255,y[x++]=65535&~v&255,y[x++]=(65535&~v)>>8&255,y.set(p.subarray(k),x),x+=p.length-k;var P=n(p,0,p.length);y[x++]=P>>24&255,y[x++]=P>>16&255,y[x++]=P>>8&255,y[x++]=255&P;var C=r.length+3*a+m.length+y.length,F=new Uint8Array(C),w=0;return F.set(r,w),w+=r.length,e("IHDR",m,F,w),w+=a+m.length,e("IDATA",y,F,w),w+=a+y.length,e("IEND",new Uint8Array(0),F,w),PDFJS.createObjectURL(F,"image/png")}for(var r=new Uint8Array([137,80,78,71,13,10,26,10]),a=12,s=new Int32Array(256),o=0;256>o;o++){for(var l=o,c=0;8>c;c++)l=1&l?3988292384^l>>1&2147483647:l>>1&2147483647;s[o]=l}return function(t){var e=void 0===t.kind?D.GRAYSCALE_1BPP:t.kind;return i(t,e)}}(),mt=function(){function t(){this.fontSizeScale=1,this.fontWeight=At.fontWeight,this.fontSize=0,this.textMatrix=B,this.fontMatrix=C,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=At.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.clipId="",this.pendingClip=!1,this.maskId=""}return t.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(t,e){this.x=t,this.y=e}},t}(),vt=function(){function t(t,e){var n="http://www.w3.org/2000/svg",i=document.createElementNS(n,"svg:svg");return i.setAttributeNS(null,"version","1.1"),i.setAttributeNS(null,"width",t+"px"),i.setAttributeNS(null,"height",e+"px"),i.setAttributeNS(null,"viewBox","0 0 "+t+" "+e),i}function n(t){for(var e=[],n=[],i=t.length,r=0;i>r;r++)"save"!==t[r].fn?"restore"===t[r].fn?e=n.pop():e.push(t[r]):(e.push({fnId:92,fn:"group",items:[]}),n.push(e),e=e[e.length-1].items);return e}function i(t){if(t===(0|t))return t.toString();var e=t.toFixed(10),n=e.length-1;if("0"!==e[n])return e;do n--;while("0"===e[n]);return e.substr(0,"."===e[n]?n:n+1)}function r(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":"scale("+i(t[0])+" "+i(t[3])+")";if(t[0]===t[3]&&t[1]===-t[2]){var e=180*Math.acos(t[0])/Math.PI;return"rotate("+i(e)+")"}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate("+i(t[4])+" "+i(t[5])+")";return"matrix("+i(t[0])+" "+i(t[1])+" "+i(t[2])+" "+i(t[3])+" "+i(t[4])+" "+i(t[5])+")"}function a(t,e){this.current=new mt,this.transformMatrix=B,this.transformStack=[],this.extraStack=[],this.commonObjs=t,this.objs=e,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts={},this.cssStyle=null}var s="http://www.w3.org/2000/svg",o="http://www.w3.org/XML/1998/namespace",l="http://www.w3.org/1999/xlink",c=["butt","round","square"],h=["miter","round","bevel"],u=0,d=0;return a.prototype={save:function(){this.transformStack.push(this.transformMatrix);var t=this.current;this.extraStack.push(t),this.current=t.clone()},restore:function(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.tgrp=document.createElementNS(s,"svg:g"),this.tgrp.setAttributeNS(null,"transform",r(this.transformMatrix)),this.pgrp.appendChild(this.tgrp)},group:function(t){this.save(),this.executeOpTree(t),this.restore()},loadDependencies:function(t){for(var e=t.fnArray,n=e.length,i=t.argsArray,r=this,a=0;n>a;a++)if(L.dependency===e[a])for(var s=i[a],o=0,l=s.length;l>o;o++){var c,h=s[o],u="g_"===h.substring(0,2);c=u?new Promise(function(t){r.commonObjs.get(h,t)}):new Promise(function(t){r.objs.get(h,t)}),this.current.dependencies.push(c)}return Promise.all(this.current.dependencies)},transform:function(t,e,n,i,a,o){var l=[t,e,n,i,a,o];this.transformMatrix=PDFJS.Util.transform(this.transformMatrix,l),this.tgrp=document.createElementNS(s,"svg:g"),this.tgrp.setAttributeNS(null,"transform",r(this.transformMatrix))},getSVG:function(e,n){return this.svg=t(n.width,n.height),this.viewport=n,this.loadDependencies(e).then(function(){this.transformMatrix=B,this.pgrp=document.createElementNS(s,"svg:g"),this.pgrp.setAttributeNS(null,"transform",r(n.transform)),this.tgrp=document.createElementNS(s,"svg:g"),this.tgrp.setAttributeNS(null,"transform",r(this.transformMatrix)),this.defs=document.createElementNS(s,"svg:defs"),this.pgrp.appendChild(this.defs),this.pgrp.appendChild(this.tgrp),this.svg.appendChild(this.pgrp);var t=this.convertOpList(e);return this.executeOpTree(t),this.svg}.bind(this))},convertOpList:function(t){var e=t.argsArray,i=t.fnArray,r=i.length,a=[],s=[];for(var o in L)a[L[o]]=o;for(var l=0;r>l;l++){var c=i[l];s.push({fnId:c,fn:a[c],args:e[l]})}return n(s)},executeOpTree:function(t){for(var n=t.length,i=0;n>i;i++){var r=t[i].fn,a=t[i].fnId,s=t[i].args;switch(0|a){case L.beginText:this.beginText();break;case L.setLeading:this.setLeading(s);break;case L.setLeadingMoveText:this.setLeadingMoveText(s[0],s[1]);break;case L.setFont:this.setFont(s);break;case L.showText:this.showText(s[0]);break;case L.showSpacedText:this.showText(s[0]);break;case L.endText:this.endText();break;case L.moveText:this.moveText(s[0],s[1]);break;case L.setCharSpacing:this.setCharSpacing(s[0]);break;case L.setWordSpacing:this.setWordSpacing(s[0]);break;case L.setHScale:this.setHScale(s[0]);break;case L.setTextMatrix:this.setTextMatrix(s[0],s[1],s[2],s[3],s[4],s[5]);break;case L.setLineWidth:this.setLineWidth(s[0]);break;case L.setLineJoin:this.setLineJoin(s[0]);break;case L.setLineCap:this.setLineCap(s[0]);break;case L.setMiterLimit:this.setMiterLimit(s[0]);break;case L.setFillRGBColor:this.setFillRGBColor(s[0],s[1],s[2]);break;case L.setStrokeRGBColor:this.setStrokeRGBColor(s[0],s[1],s[2]);break;case L.setDash:this.setDash(s[0],s[1]);break;case L.setGState:this.setGState(s[0]);break;case L.fill:this.fill();break;case L.eoFill:this.eoFill();break;case L.stroke:this.stroke();break;case L.fillStroke:this.fillStroke();break;case L.eoFillStroke:this.eoFillStroke();break;case L.clip:this.clip("nonzero");break;case L.eoClip:this.clip("evenodd");break;case L.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case L.paintJpegXObject:this.paintJpegXObject(s[0],s[1],s[2]);break;case L.paintImageXObject:this.paintImageXObject(s[0]);break;case L.paintInlineImageXObject:this.paintInlineImageXObject(s[0]);break;case L.paintImageMaskXObject:this.paintImageMaskXObject(s[0]);break;case L.paintFormXObjectBegin:this.paintFormXObjectBegin(s[0],s[1]);break;case L.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case L.closePath:this.closePath();break;case L.closeStroke:this.closeStroke();break;case L.closeFillStroke:this.closeFillStroke();break;case L.nextLine:this.nextLine();break;case L.transform:this.transform(s[0],s[1],s[2],s[3],s[4],s[5]);break;case L.constructPath:this.constructPath(s[0],s[1]);break;case L.endPath:this.endPath();break;case 92:this.group(t[i].items);break;default:e("Unimplemented method "+r)}}},setWordSpacing:function(t){this.current.wordSpacing=t},setCharSpacing:function(t){this.current.charSpacing=t},nextLine:function(){this.moveText(0,this.current.leading)},setTextMatrix:function(t,e,n,r,a,o){var l=this.current;this.current.textMatrix=this.current.lineMatrix=[t,e,n,r,a,o],this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,l.xcoords=[],l.tspan=document.createElementNS(s,"svg:tspan"),l.tspan.setAttributeNS(null,"font-family",l.fontFamily),l.tspan.setAttributeNS(null,"font-size",i(l.fontSize)+"px"),l.tspan.setAttributeNS(null,"y",i(-l.y)),l.txtElement=document.createElementNS(s,"svg:text"),l.txtElement.appendChild(l.tspan)},beginText:function(){this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.current.textMatrix=B,this.current.lineMatrix=B,this.current.tspan=document.createElementNS(s,"svg:tspan"),this.current.txtElement=document.createElementNS(s,"svg:text"),this.current.txtgrp=document.createElementNS(s,"svg:g"),this.current.xcoords=[]},moveText:function(t,e){var n=this.current;this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=e,n.xcoords=[],n.tspan=document.createElementNS(s,"svg:tspan"),n.tspan.setAttributeNS(null,"font-family",n.fontFamily),n.tspan.setAttributeNS(null,"font-size",i(n.fontSize)+"px"),n.tspan.setAttributeNS(null,"y",i(-n.y))},showText:function(t){var e=this.current,n=e.font,a=e.fontSize;if(0!==a){var s,l=e.charSpacing,c=e.wordSpacing,h=e.fontDirection,u=e.textHScale*h,d=t.length,p=n.vertical,A=a*e.fontMatrix[0],g=0;for(s=0;d>s;++s){var m=t[s];if(null!==m)if(f(m))g+=-m*a*.001;else{e.xcoords.push(e.x+g*u);var v=m.width,b=m.fontChar,S=v*A+l*h;g+=S,e.tspan.textContent+=b}else g+=h*c}p?e.y-=g*u:e.x+=g*u,e.tspan.setAttributeNS(null,"x",e.xcoords.map(i).join(" ")),e.tspan.setAttributeNS(null,"y",i(-e.y)),e.tspan.setAttributeNS(null,"font-family",e.fontFamily),e.tspan.setAttributeNS(null,"font-size",i(e.fontSize)+"px"),e.fontStyle!==At.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle),e.fontWeight!==At.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight),e.fillColor!==At.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor),e.txtElement.setAttributeNS(null,"transform",r(e.textMatrix)+" scale(1, -1)"),
e.txtElement.setAttributeNS(o,"xml:space","preserve"),e.txtElement.appendChild(e.tspan),e.txtgrp.appendChild(e.txtElement),this.tgrp.appendChild(e.txtElement)}},setLeadingMoveText:function(t,e){this.setLeading(-e),this.moveText(t,e)},addFontStyle:function(t){this.cssStyle||(this.cssStyle=document.createElementNS(s,"svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle));var e=PDFJS.createObjectURL(t.data,t.mimetype);this.cssStyle.textContent+='@font-face { font-family: "'+t.loadedName+'"; src: url('+e+"); }\n"},setFont:function(t){var e=this.current,n=this.commonObjs.get(t[0]),r=t[1];this.current.font=n,this.embedFonts&&n.data&&!this.embeddedFonts[n.loadedName]&&(this.addFontStyle(n),this.embeddedFonts[n.loadedName]=n),e.fontMatrix=n.fontMatrix?n.fontMatrix:C;var a=n.black?n.bold?"bolder":"bold":n.bold?"bold":"normal",o=n.italic?"italic":"normal";0>r?(r=-r,e.fontDirection=-1):e.fontDirection=1,e.fontSize=r,e.fontFamily=n.loadedName,e.fontWeight=a,e.fontStyle=o,e.tspan=document.createElementNS(s,"svg:tspan"),e.tspan.setAttributeNS(null,"y",i(-e.y)),e.xcoords=[]},endText:function(){this.current.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp),this.tgrp=document.createElementNS(s,"svg:g"),this.tgrp.setAttributeNS(null,"transform",r(this.transformMatrix))},setLineWidth:function(t){this.current.lineWidth=t},setLineCap:function(t){this.current.lineCap=c[t]},setLineJoin:function(t){this.current.lineJoin=h[t]},setMiterLimit:function(t){this.current.miterLimit=t},setStrokeRGBColor:function(t,e,n){var i=W.makeCssRgb(t,e,n);this.current.strokeColor=i},setFillRGBColor:function(t,e,n){var i=W.makeCssRgb(t,e,n);this.current.fillColor=i,this.current.tspan=document.createElementNS(s,"svg:tspan"),this.current.xcoords=[]},setDash:function(t,e){this.current.dashArray=t,this.current.dashPhase=e},constructPath:function(t,e){var n=this.current,r=n.x,a=n.y;n.path=document.createElementNS(s,"svg:path");for(var o=[],l=t.length,c=0,h=0;l>c;c++)switch(0|t[c]){case L.rectangle:r=e[h++],a=e[h++];var u=e[h++],d=e[h++],f=r+u,p=a+d;o.push("M",i(r),i(a),"L",i(f),i(a),"L",i(f),i(p),"L",i(r),i(p),"Z");break;case L.moveTo:r=e[h++],a=e[h++],o.push("M",i(r),i(a));break;case L.lineTo:r=e[h++],a=e[h++],o.push("L",i(r),i(a));break;case L.curveTo:r=e[h+4],a=e[h+5],o.push("C",i(e[h]),i(e[h+1]),i(e[h+2]),i(e[h+3]),i(r),i(a)),h+=6;break;case L.curveTo2:r=e[h+2],a=e[h+3],o.push("C",i(r),i(a),i(e[h]),i(e[h+1]),i(e[h+2]),i(e[h+3])),h+=4;break;case L.curveTo3:r=e[h+2],a=e[h+3],o.push("C",i(e[h]),i(e[h+1]),i(r),i(a),i(r),i(a)),h+=4;break;case L.closePath:o.push("Z")}n.path.setAttributeNS(null,"d",o.join(" ")),n.path.setAttributeNS(null,"stroke-miterlimit",i(n.miterLimit)),n.path.setAttributeNS(null,"stroke-linecap",n.lineCap),n.path.setAttributeNS(null,"stroke-linejoin",n.lineJoin),n.path.setAttributeNS(null,"stroke-width",i(n.lineWidth)+"px"),n.path.setAttributeNS(null,"stroke-dasharray",n.dashArray.map(i).join(" ")),n.path.setAttributeNS(null,"stroke-dashoffset",i(n.dashPhase)+"px"),n.path.setAttributeNS(null,"fill","none"),this.tgrp.appendChild(n.path),n.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp),n.element=n.path,n.setCurrentPoint(r,a)},endPath:function(){var t=this.current;t.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp),this.tgrp=document.createElementNS(s,"svg:g"),this.tgrp.setAttributeNS(null,"transform",r(this.transformMatrix))},clip:function(t){var e=this.current;e.clipId="clippath"+u,u++,this.clippath=document.createElementNS(s,"svg:clipPath"),this.clippath.setAttributeNS(null,"id",e.clipId);var n=e.element.cloneNode();"evenodd"===t?n.setAttributeNS(null,"clip-rule","evenodd"):n.setAttributeNS(null,"clip-rule","nonzero"),this.clippath.setAttributeNS(null,"transform",r(this.transformMatrix)),this.clippath.appendChild(n),this.defs.appendChild(this.clippath),e.pendingClip=!0,this.cgrp=document.createElementNS(s,"svg:g"),this.cgrp.setAttributeNS(null,"clip-path","url(#"+e.clipId+")"),this.pgrp.appendChild(this.cgrp)},closePath:function(){var t=this.current,e=t.path.getAttributeNS(null,"d");e+="Z",t.path.setAttributeNS(null,"d",e)},setLeading:function(t){this.current.leading=-t},setTextRise:function(t){this.current.textRise=t},setHScale:function(t){this.current.textHScale=t/100},setGState:function(t){for(var e=0,n=t.length;n>e;e++){var i=t[e],r=i[0],a=i[1];switch(r){case"LW":this.setLineWidth(a);break;case"LC":this.setLineCap(a);break;case"LJ":this.setLineJoin(a);break;case"ML":this.setMiterLimit(a);break;case"D":this.setDash(a[0],a[1]);break;case"RI":break;case"FL":break;case"Font":this.setFont(a);break;case"CA":break;case"ca":break;case"BM":break;case"SMask":}}},fill:function(){var t=this.current;t.element.setAttributeNS(null,"fill",t.fillColor)},stroke:function(){var t=this.current;t.element.setAttributeNS(null,"stroke",t.strokeColor),t.element.setAttributeNS(null,"fill","none")},eoFill:function(){var t=this.current;t.element.setAttributeNS(null,"fill",t.fillColor),t.element.setAttributeNS(null,"fill-rule","evenodd")},fillStroke:function(){this.stroke(),this.fill()},eoFillStroke:function(){this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()},closeStroke:function(){this.closePath(),this.stroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},paintSolidColorImageMask:function(){var t=this.current,e=document.createElementNS(s,"svg:rect");e.setAttributeNS(null,"x","0"),e.setAttributeNS(null,"y","0"),e.setAttributeNS(null,"width","1px"),e.setAttributeNS(null,"height","1px"),e.setAttributeNS(null,"fill",t.fillColor),this.tgrp.appendChild(e)},paintJpegXObject:function(t,e,n){var r=this.current,a=this.objs.get(t),o=document.createElementNS(s,"svg:image");o.setAttributeNS(l,"xlink:href",a.src),o.setAttributeNS(null,"width",a.width+"px"),o.setAttributeNS(null,"height",a.height+"px"),o.setAttributeNS(null,"x","0"),o.setAttributeNS(null,"y",i(-n)),o.setAttributeNS(null,"transform","scale("+i(1/e)+" "+i(-1/n)+")"),this.tgrp.appendChild(o),r.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp)},paintImageXObject:function(t){var n=this.objs.get(t);return n?void this.paintInlineImageXObject(n):void e("Dependent image isn't ready yet")},paintInlineImageXObject:function(t,e){var n=this.current,r=t.width,a=t.height,o=gt(t),c=document.createElementNS(s,"svg:rect");c.setAttributeNS(null,"x","0"),c.setAttributeNS(null,"y","0"),c.setAttributeNS(null,"width",i(r)),c.setAttributeNS(null,"height",i(a)),n.element=c,this.clip("nonzero");var h=document.createElementNS(s,"svg:image");h.setAttributeNS(l,"xlink:href",o),h.setAttributeNS(null,"x","0"),h.setAttributeNS(null,"y",i(-a)),h.setAttributeNS(null,"width",i(r)+"px"),h.setAttributeNS(null,"height",i(a)+"px"),h.setAttributeNS(null,"transform","scale("+i(1/r)+" "+i(-1/a)+")"),e?e.appendChild(h):this.tgrp.appendChild(h),n.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp)},paintImageMaskXObject:function(t){var e=this.current,n=t.width,r=t.height,a=e.fillColor;e.maskId="mask"+d++;var o=document.createElementNS(s,"svg:mask");o.setAttributeNS(null,"id",e.maskId);var l=document.createElementNS(s,"svg:rect");l.setAttributeNS(null,"x","0"),l.setAttributeNS(null,"y","0"),l.setAttributeNS(null,"width",i(n)),l.setAttributeNS(null,"height",i(r)),l.setAttributeNS(null,"fill",a),l.setAttributeNS(null,"mask","url(#"+e.maskId+")"),this.defs.appendChild(o),this.tgrp.appendChild(l),this.paintInlineImageXObject(t,o)},paintFormXObjectBegin:function(t,e){if(this.save(),p(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]),p(e)&&4===e.length){var n=e[2]-e[0],r=e[3]-e[1],a=document.createElementNS(s,"svg:rect");a.setAttributeNS(null,"x",e[0]),a.setAttributeNS(null,"y",e[1]),a.setAttributeNS(null,"width",i(n)),a.setAttributeNS(null,"height",i(r)),this.current.element=a,this.clip("nonzero"),this.endPath()}},paintFormXObjectEnd:function(){this.restore()}},a}();PDFJS.SVGGraphics=vt}.call("undefined"==typeof window?this:window),PDFJS.workerSrc||"undefined"==typeof document||(PDFJS.workerSrc=function(){"use strict";var t=document.body||document.getElementsByTagName("head")[0],e=t.lastChild.src;return e&&e.replace(/\.js$/i,".worker.js")}());
//# sourceMappingURL=pdf.min.js.map | humbletim/cdnjs | ajax/libs/pdf.js/1.1.260/pdf.min.js | JavaScript | mit | 104,551 |
require 'spec_helper_acceptance'
case fact('osfamily')
when 'Debian'
service_name = 'apache2'
majrelease = fact('operatingsystemmajrelease')
if ['6', '7', '10.04', '12.04'].include?(majrelease)
variant = :itk_only
else
variant = :prefork
end
when 'RedHat'
unless fact('operatingsystemmajrelease') == '5'
service_name = 'httpd'
majrelease = fact('operatingsystemmajrelease')
if ['6'].include?(majrelease)
variant = :itk_only
else
variant = :prefork
end
end
when 'FreeBSD'
service_name = 'apache24'
majrelease = fact('operatingsystemmajrelease')
variant = :prefork
end
describe 'apache::mod::itk class', :if => service_name do
describe 'running puppet code' do
# Using puppet_apply as a helper
let(:pp) do
case variant
when :prefork
<<-EOS
class { 'apache':
mpm_module => 'prefork',
}
class { 'apache::mod::itk': }
EOS
when :itk_only
<<-EOS
class { 'apache':
mpm_module => 'itk',
}
EOS
end
end
# Run it twice and test for idempotency
it_behaves_like "a idempotent resource"
end
describe service(service_name) do
it { is_expected.to be_running }
if (fact('operatingsystem') == 'Debian' && fact('operatingsystemmajrelease') == '8')
pending 'Should be enabled - Bug 760616 on Debian 8'
else
it { should be_enabled }
end
end
end
| rmatil/angular-cms | puphpet/puppet/modules/apache/spec/acceptance/itk_spec.rb | Ruby | mit | 1,500 |
/*!
* inferno v0.7.7
* (c) 2016 Dominic Gannaway
* Released under the MPL-2.0 License.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Inferno = factory());
}(this, function () { 'use strict';
var babelHelpers = {};
babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
return typeof obj;
} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
};
babelHelpers.classCallCheck = function (instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
babelHelpers.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;
};
}();
babelHelpers.extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
babelHelpers;
function isNullOrUndefined(obj) {
return obj === void 0 || obj === null;
}
function isAttrAnEvent(attr) {
return attr[0] === 'o' && attr[1] === 'n' && attr.length > 3;
}
function VNode(blueprint) {
this.bp = blueprint;
this.dom = null;
this.instance = null;
this.tag = null;
this.children = null;
this.style = null;
this.className = null;
this.attrs = null;
this.events = null;
this.hooks = null;
this.key = null;
this.clipData = null;
}
VNode.prototype = {
setAttrs: function setAttrs(attrs) {
this.attrs = attrs;
return this;
},
setTag: function setTag(tag) {
this.tag = tag;
return this;
},
setStyle: function setStyle(style) {
this.style = style;
return this;
},
setClassName: function setClassName(className) {
this.className = className;
return this;
},
setChildren: function setChildren(children) {
this.children = children;
return this;
},
setHooks: function setHooks(hooks) {
this.hooks = hooks;
return this;
},
setEvents: function setEvents(events) {
this.events = events;
return this;
},
setKey: function setKey(key) {
this.key = key;
return this;
}
};
function createVNode(bp) {
return new VNode(bp);
}
function createBlueprint(shape, childrenType) {
var tag = shape.tag || null;
var tagIsDynamic = tag && tag.arg !== void 0 ? true : false;
var children = isNullOrUndefined(shape.children) ? null : shape.children;
var childrenIsDynamic = children && children.arg !== void 0 ? true : false;
var attrs = shape.attrs || null;
var attrsIsDynamic = attrs && attrs.arg !== void 0 ? true : false;
var hooks = shape.hooks || null;
var hooksIsDynamic = hooks && hooks.arg !== void 0 ? true : false;
var events = shape.events || null;
var eventsIsDynamic = events && events.arg !== void 0 ? true : false;
var key = shape.key === void 0 ? null : shape.key;
var keyIsDynamic = !isNullOrUndefined(key) && !isNullOrUndefined(key.arg);
var style = shape.style || null;
var styleIsDynamic = style && style.arg !== void 0 ? true : false;
var className = shape.className === void 0 ? null : shape.className;
var classNameIsDynamic = className && className.arg !== void 0 ? true : false;
var blueprint = {
lazy: shape.lazy || false,
dom: null,
pools: {
keyed: {},
nonKeyed: []
},
tag: tagIsDynamic ? null : tag,
className: className !== '' && className ? className : null,
style: style !== '' && style ? style : null,
isComponent: tagIsDynamic,
hasAttrs: attrsIsDynamic || (attrs ? true : false),
hasHooks: hooksIsDynamic,
hasEvents: eventsIsDynamic,
hasStyle: styleIsDynamic || (style !== '' && style ? true : false),
hasClassName: classNameIsDynamic || (className !== '' && className ? true : false),
childrenType: childrenType === void 0 ? children ? 5 : 0 : childrenType,
attrKeys: null,
eventKeys: null,
isSVG: shape.isSVG || false
};
return function () {
var vNode = new VNode(blueprint);
if (tagIsDynamic === true) {
vNode.tag = arguments[tag.arg];
}
if (childrenIsDynamic === true) {
vNode.children = arguments[children.arg];
}
if (attrsIsDynamic === true) {
vNode.attrs = arguments[attrs.arg];
} else {
vNode.attrs = attrs;
}
if (hooksIsDynamic === true) {
vNode.hooks = arguments[hooks.arg];
}
if (eventsIsDynamic === true) {
vNode.events = arguments[events.arg];
}
if (keyIsDynamic === true) {
vNode.key = arguments[key.arg];
}
if (styleIsDynamic === true) {
vNode.style = arguments[style.arg];
} else {
vNode.style = blueprint.style;
}
if (classNameIsDynamic === true) {
vNode.className = arguments[className.arg];
} else {
vNode.className = blueprint.className;
}
return vNode;
};
}
// Runs only once in applications lifetime
var isBrowser = typeof window !== 'undefined' && window.document;
// Copy of the util from dom/util, otherwise it makes massive bundles
function documentCreateElement(tag, isSVG) {
var dom = void 0;
if (isSVG === true) {
dom = document.createElementNS('http://www.w3.org/2000/svg', tag);
} else {
dom = document.createElement(tag);
}
return dom;
}
function createUniversalElement(tag, attrs, isSVG) {
if (isBrowser) {
var dom = documentCreateElement(tag, isSVG);
if (attrs) {
createStaticAttributes(attrs, dom);
}
return dom;
}
return null;
}
function createStaticAttributes(attrs, dom) {
var attrKeys = Object.keys(attrs);
for (var i = 0; i < attrKeys.length; i++) {
var attr = attrKeys[i];
var value = attrs[attr];
if (attr === 'className') {
dom.className = value;
} else {
if (value === true) {
dom.setAttribute(attr, attr);
} else if (!isNullOrUndefined(value) && value !== false && !isAttrAnEvent(attr)) {
dom.setAttribute(attr, value);
}
}
}
}
var index = {
createBlueprint: createBlueprint,
createVNode: createVNode,
universal: {
createElement: createUniversalElement
}
};
return index;
})); | BenjaminVanRyseghem/cdnjs | ajax/libs/inferno/0.7.7/inferno.js | JavaScript | mit | 6,894 |
// src/js/aui/jquery.js
(typeof window === 'undefined' ? global : window).__05a5728e39505874845991c7dfe96596 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = window.jQuery || window.Zepto;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/create-element.js
(typeof window === 'undefined' ? global : window).__e3011d5cc5ea8e104654a5f8ae95cfba = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function createElement() {
var res = null;
if (arguments.length && typeof arguments[0] === 'string') {
res = (0, _jquery2.default)(document.createElement(arguments[0]));
if (arguments.length === 2) {
res.html(arguments[1]);
}
}
//We can't use the deprecate module or we will introduce a circular dependency
if (typeof console !== 'undefined' && console.warn) {
console.warn('AJS\'s create element functionality has been deprecated since 5.9.0.\nNo alternative will be provided.\nUse document.createElement() or jQuery.parseHTML(), or preferably use a templating library.');
}
return res;
}
exports.default = createElement;
module.exports = exports['default'];
return module.exports;
}).call(this);
// node_modules/object-assign/index.js
(typeof window === 'undefined' ? global : window).__a53a04123ae47179f2b27aa3a1cc5fce = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/* eslint-disable no-unused-vars */
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
module.exports = Object.assign || function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (Object.getOwnPropertySymbols) {
symbols = Object.getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
return module.exports;
}).call(this);
// src/js/aui/internal/globalize.js
(typeof window === 'undefined' ? global : window).__225e03d549503945a1ebea587fd0f68b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (name, value) {
window[NAMESPACE] = (0, _objectAssign2.default)(_createElement2.default, window[NAMESPACE]);
return window[NAMESPACE][name] = value;
};
var _createElement = __e3011d5cc5ea8e104654a5f8ae95cfba;
var _createElement2 = _interopRequireDefault(_createElement);
var _objectAssign = __a53a04123ae47179f2b27aa3a1cc5fce;
var _objectAssign2 = _interopRequireDefault(_objectAssign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var NAMESPACE = 'AJS';
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/deprecation.js
(typeof window === 'undefined' ? global : window).__40faa40b431fb997cae9bc11acbad9ee = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getMessageLogger = exports.propertyDeprecationSupported = exports.obj = exports.prop = exports.css = exports.construct = exports.fn = undefined;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var has = Object.prototype.hasOwnProperty;
var deprecationCalls = [];
var deprecatedSelectorMap = [];
function toSentenceCase(str) {
str += '';
if (!str) {
return '';
}
return str.charAt(0).toUpperCase() + str.substring(1);
}
function getDeprecatedLocation(printFrameOffset) {
var err = new Error();
var stack = err.stack || err.stacktrace;
var stackMessage = stack && stack.replace(/^Error\n/, '') || '';
if (stackMessage) {
stackMessage = stackMessage.split('\n');
return stackMessage[printFrameOffset + 2];
}
return stackMessage;
}
function logger() {
if (typeof console !== 'undefined' && console.warn) {
Function.prototype.apply.call(console.warn, console, arguments);
}
}
/**
* Return a function that logs a deprecation warning to the console the first time it is called from a certain location.
* It will also print the stack frame of the calling function.
*
* @param {string} displayName the name of the thing being deprecated
* @param {object} options
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
* @param {string} options.extraObject an extra object that will be printed at the end
* @param {string} options.deprecationType type of the deprecation to append to the start of the deprecation message. e.g. JS or CSS
* @return {Function} that logs the warning and stack frame of the calling function. Takes in an optional parameter for the offset of
* the stack frame to print, the default is 0. For example, 0 will log it for the line of the calling function,
* -1 will print the location the logger was called from
*/
function getShowDeprecationMessage(displayName, options) {
// This can be used internally to pas in a showmessage fn
if (typeof displayName === 'function') {
return displayName;
}
var called = false;
options = options || {};
return function (printFrameOffset) {
var deprecatedLocation = getDeprecatedLocation(printFrameOffset ? printFrameOffset : 1) || '';
// Only log once if the stack frame doesn't exist to avoid spamming the console/test output
if (!called || deprecationCalls.indexOf(deprecatedLocation) === -1) {
deprecationCalls.push(deprecatedLocation);
called = true;
var deprecationType = options.deprecationType + ' ' || '';
var message = 'DEPRECATED ' + deprecationType + '- ' + toSentenceCase(displayName) + ' has been deprecated' + (options.sinceVersion ? ' since ' + options.sinceVersion : '') + ' and will be removed in ' + (options.removeInVersion || 'a future release') + '.';
if (options.alternativeName) {
message += ' Use ' + options.alternativeName + ' instead. ';
}
if (options.extraInfo) {
message += ' ' + options.extraInfo;
}
if (deprecatedLocation === '') {
deprecatedLocation = ' \n ' + 'No stack trace of the deprecated usage is available in your current browser.';
} else {
deprecatedLocation = ' \n ' + deprecatedLocation;
}
if (options.extraObject) {
message += '\n';
logger(message, options.extraObject, deprecatedLocation);
} else {
logger(message, deprecatedLocation);
}
}
};
}
function logCssDeprecation(selectorMap, newNode) {
var displayName = selectorMap.options.displayName;
displayName = displayName ? ' (' + displayName + ')' : '';
var options = _jquery2.default.extend({
deprecationType: 'CSS',
extraObject: newNode
}, selectorMap.options);
getShowDeprecationMessage('\'' + selectorMap.selector + '\' pattern' + displayName, options)();
}
/**
* Returns a wrapped version of the function that logs a deprecation warning when the function is used.
* @param {Function} fn the fn to wrap
* @param {string} displayName the name of the fn to be displayed in the message
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
* @return {Function} wrapping the original function
*/
function deprecateFunctionExpression(fn, displayName, options) {
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var showDeprecationMessage = getShowDeprecationMessage(displayName || fn.name || 'this function', options);
return function () {
showDeprecationMessage();
return fn.apply(this, arguments);
};
}
/**
* Returns a wrapped version of the constructor that logs a deprecation warning when the constructor is instantiated.
* @param {Function} constructorFn the constructor function to wrap
* @param {string} displayName the name of the fn to be displayed in the message
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
* @return {Function} wrapping the original function
*/
function deprecateConstructor(constructorFn, displayName, options) {
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var deprecatedConstructor = deprecateFunctionExpression(constructorFn, displayName, options);
deprecatedConstructor.prototype = constructorFn.prototype;
_jquery2.default.extend(deprecatedConstructor, constructorFn); //copy static methods across;
return deprecatedConstructor;
}
var supportsProperties = false;
try {
if (Object.defineProperty) {
Object.defineProperty({}, 'blam', { get: function get() {}, set: function set() {} });
exports.propertyDeprecationSupported = supportsProperties = true;
}
} catch (e) {}
/* IE8 doesn't support on non-DOM elements */
/**
* Wraps a "value" object property in a deprecation warning in browsers supporting Object.defineProperty
* @param {Object} obj the object containing the property
* @param {string} prop the name of the property to deprecate
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.displayName the display name of the property to deprecate (optional, will fall back to the property name)
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateValueProperty(obj, prop, options) {
if (supportsProperties) {
var oldVal = obj[prop];
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var displayNameOrShowMessageFn = options.displayName || prop;
var showDeprecationMessage = getShowDeprecationMessage(displayNameOrShowMessageFn, options);
Object.defineProperty(obj, prop, {
get: function get() {
showDeprecationMessage();
return oldVal;
},
set: function set(val) {
oldVal = val;
showDeprecationMessage();
return val;
}
});
}
}
/**
* Wraps an object property in a deprecation warning, if possible. functions will always log warnings, but other
* types of properties will only log in browsers supporting Object.defineProperty
* @param {Object} obj the object containing the property
* @param {string} prop the name of the property to deprecate
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.displayName the display name of the property to deprecate (optional, will fall back to the property name)
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateObjectProperty(obj, prop, options) {
if (typeof obj[prop] === 'function') {
options = options || {};
options.deprecationType = options.deprecationType || 'JS';
var displayNameOrShowMessageFn = options.displayName || prop;
obj[prop] = deprecateFunctionExpression(obj[prop], displayNameOrShowMessageFn, options);
} else {
deprecateValueProperty(obj, prop, options);
}
}
/**
* Wraps all an objects properties in a deprecation warning, if possible. functions will always log warnings, but other
* types of properties will only log in browsers supporting Object.defineProperty
* @param {Object} obj the object to be wrapped
* @param {string} objDisplayPrefix the object's prefix to be used in logs
* @param {string} options.removeInVersion the version this will be removed in
* @param {string} options.alternativeNamePrefix the name of another object to prefix the deprecated objects properties with
* @param {string} options.sinceVersion the version this has been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateAllProperties(obj, objDisplayPrefix, options) {
options = options || {};
for (var attr in obj) {
if (has.call(obj, attr)) {
options.deprecationType = options.deprecationType || 'JS';
options.displayName = objDisplayPrefix + attr;
options.alternativeName = options.alternativeNamePrefix && options.alternativeNamePrefix + attr;
deprecateObjectProperty(obj, attr, _jquery2.default.extend({}, options));
}
}
}
function matchesSelector(el, selector) {
return (el.matches || el.msMatchesSelector || el.webkitMatchesSelector || el.mozMatchesSelector || el.oMatchesSelector).call(el, selector);
}
function handleAddingSelector(options) {
return function (selector) {
var selectorMap = {
selector: selector,
options: options || {}
};
deprecatedSelectorMap.push(selectorMap);
// Search if matches have already been added
var matches = document.querySelectorAll(selector);
for (var i = 0; i < matches.length; i++) {
logCssDeprecation(selectorMap, matches[i]);
}
};
}
/**
* Return a function that logs a deprecation warning to the console the first time it is called from a certain location.
* It will also print the stack frame of the calling function.
*
* @param {string|Array} selectors a selector or list of selectors that match deprecated markup
* @param {object} options
* @param {string} options.displayName a name describing these selectors
* @param {string} options.alternativeName the name of an alternative to use
* @param {string} options.removeInVersion the version these will be removed in
* @param {string} options.sinceVersion the version these have been deprecated since
* @param {string} options.extraInfo extra information to be printed at the end of the deprecation log
*/
function deprecateCSS(selectors, options) {
if (!window.MutationObserver) {
logger('CSS could not be deprecated as Mutation Observer was not found.');
return;
}
if (typeof selectors === 'string') {
selectors = [selectors];
}
selectors.forEach(handleAddingSelector(options));
}
function testAndHandleDeprecation(newNode) {
return function (selectorMap) {
if (matchesSelector(newNode, selectorMap.selector)) {
logCssDeprecation(selectorMap, newNode);
}
};
}
if (window.MutationObserver) {
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
// TODO - should this also look at class changes, if possible?
var addedNodes = mutation.addedNodes;
for (var i = 0; i < addedNodes.length; i++) {
var newNode = addedNodes[i];
if (newNode.nodeType === 1) {
deprecatedSelectorMap.forEach(testAndHandleDeprecation(newNode));
}
}
});
});
var config = {
childList: true,
subtree: true
};
observer.observe(document, config);
}
var deprecate = {
fn: deprecateFunctionExpression,
construct: deprecateConstructor,
css: deprecateCSS,
prop: deprecateObjectProperty,
obj: deprecateAllProperties,
propertyDeprecationSupported: supportsProperties,
getMessageLogger: getShowDeprecationMessage
};
(0, _globalize2.default)('deprecate', deprecate);
exports.fn = deprecateFunctionExpression;
exports.construct = deprecateConstructor;
exports.css = deprecateCSS;
exports.prop = deprecateObjectProperty;
exports.obj = deprecateAllProperties;
exports.propertyDeprecationSupported = supportsProperties;
exports.getMessageLogger = getShowDeprecationMessage;
return module.exports;
}).call(this);
// src/js/aui/internal/amdify.js
(typeof window === 'undefined' ? global : window).__0e0294c65ea7575cfc4601f4797774b3 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (name, fn) {
if (window.define) {
var alias = window.define;
alias(name, [], function () {
return fn;
});
}
return fn;
};
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/log.js
(typeof window === 'undefined' ? global : window).__b6ff3972810865402a96bc835d1ba86a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.error = exports.warn = exports.log = undefined;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function polyfillConsole(prop) {
return function () {
if (typeof console !== 'undefined' && console[prop]) {
Function.prototype.apply.call(console[prop], console, arguments);
}
};
}
var log = polyfillConsole('log');
var warn = polyfillConsole('warn');
var error = polyfillConsole('error');
(0, _globalize2.default)('error', error);
(0, _globalize2.default)('log', log);
(0, _globalize2.default)('warn', warn);
exports.log = log;
exports.warn = warn;
exports.error = error;
return module.exports;
}).call(this);
// src/js/aui/inline-dialog.js
(typeof window === 'undefined' ? global : window).__136e62b092d9d3533c7f37b88c5f8085 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/*global Raphael: true */
/*jshint quotmark:false, eqeqeq:false, strict:false */
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a new inline dialog.
*
* @param items jQuery object - the items that trigger the display of this popup when the user mouses over.
* @param identifier A unique identifier for this popup. This should be unique across all popups on the page and a valid CSS class.
* @param url The URL to retrieve popup contents.
* @param options Custom options to change default behaviour. See InlineDialog.opts for default values and valid options.
*/
function InlineDialog(items, identifier, url, options) {
options = options || [];
if (options.hasOwnProperty('getArrowAttributes')) {
getArrowAttributesDeprecationLogger();
}
if (options.hasOwnProperty('getArrowPath')) {
getArrowPathDeprecationLogger();
if (options.hasOwnProperty('gravity')) {
getArrowPathWithGravityDeprecationLogger();
}
}
if (options.hasOwnProperty('onTop')) {
onTopDeprecationLogger();
if (options.onTop && options.gravity === undefined) {
options.gravity = 's';
}
}
// attempt to generate a random identifier if it doesn't exist
if (typeof identifier === 'undefined') {
identifier = String(Math.random()).replace('.', '');
// if the generated supplied identifier already exists when combined with the prefixes we'll be using, then bail
if ((0, _jquery2.default)('#inline-dialog-' + identifier + ', #arrow-' + identifier + ', #inline-dialog-shim-' + identifier).length) {
throw 'GENERATED_IDENTIFIER_NOT_UNIQUE';
}
}
var opts = _jquery2.default.extend(false, InlineDialog.opts, options);
if (opts.gravity === 'w') {
// TODO Once support for gravity: 'e' is added, it should also
// transpose the defaults for offsetX and offsetY.
opts.offsetX = options.offsetX === undefined ? 10 : options.offsetX;
opts.offsetY = options.offsetY === undefined ? 0 : options.offsetY;
}
var renderAsSVG = function renderAsSVG() {
return window.Raphael && options && (options.getArrowPath || options.getArrowAttributes);
};
var hash;
var hideDelayTimer;
var showTimer;
var beingShown = false;
var shouldShow = false;
var contentLoaded = false;
var mousePosition;
var targetPosition;
var popup = (0, _jquery2.default)('<div id="inline-dialog-' + identifier + '" class="aui-inline-dialog"><div class="aui-inline-dialog-contents contents"></div><div id="arrow-' + identifier + '" class="aui-inline-dialog-arrow arrow"></div></div>');
var arrow = (0, _jquery2.default)('#arrow-' + identifier, popup);
var contents = popup.find('.contents');
if (!renderAsSVG()) {
popup.find('.aui-inline-dialog-arrow').addClass('aui-css-arrow');
}
if (!opts.displayShadow) {
contents.addClass('aui-inline-dialog-no-shadow');
}
if (opts.autoWidth) {
contents.addClass('aui-inline-dialog-auto-width');
} else {
contents.width(opts.width);
}
contents.on({
mouseenter: function mouseenter() {
clearTimeout(hideDelayTimer);
popup.unbind('mouseenter');
},
mouseleave: function mouseleave() {
hidePopup();
}
});
var getHash = function getHash() {
if (!hash) {
hash = {
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
},
persistent: opts.persistent ? true : false,
reset: function reset() {
function drawPopup(popup, positions) {
//Position the popup using the left and right parameters
popup.css(positions.popupCss);
if (renderAsSVG()) {
//special adjustment for downards raphael arrow
if (positions.gravity === 's') {
positions.arrowCss.top -= _jquery2.default.browser.msie ? 10 : 9;
}
if (!popup.arrowCanvas) {
popup.arrowCanvas = Raphael('arrow-' + identifier, 16, 16); //create canvas using arrow element
}
var getArrowPath = opts.getArrowPath;
var arrowPath = _jquery2.default.isFunction(getArrowPath) ? getArrowPath(positions) : getArrowPath;
//draw the arrow
popup.arrowCanvas.path(arrowPath).attr(opts.getArrowAttributes());
} else {
arrow.removeClass('aui-bottom-arrow aui-left-arrow aui-right-arrow');
if (positions.gravity === 's' && !arrow.hasClass('aui-bottom-arrow')) {
arrow.addClass('aui-bottom-arrow');
} else if (positions.gravity === 'w') {
arrow.addClass('aui-left-arrow');
} else if (positions.gravity === 'e') {
arrow.addClass('aui-right-arrow');
}
// Default styles are for 'n' gravity.
}
arrow.css(positions.arrowCss);
}
//DRAW POPUP
var viewportHeight = (0, _jquery2.default)(window).height();
var popupMaxHeight = Math.round(viewportHeight * 0.75);
popup.children('.aui-inline-dialog-contents').css('max-height', popupMaxHeight);
var positions = opts.calculatePositions(popup, targetPosition, mousePosition, opts);
if (positions.hasOwnProperty('displayAbove')) {
displayAboveDeprecationLogger();
positions.gravity = positions.displayAbove ? 's' : 'n';
}
drawPopup(popup, positions);
// reset position of popup box
popup.fadeIn(opts.fadeTime, function () {
// once the animation is complete, set the tracker variables
// beingShown = false; // is this necessary? Maybe only the shouldShow will have to be reset?
});
if (_jquery2.default.browser.msie && ~ ~_jquery2.default.browser.version < 10) {
// iframeShim, prepend if it doesnt exist
var jQueryCache = (0, _jquery2.default)('#inline-dialog-shim-' + identifier);
if (!jQueryCache.length) {
(0, _jquery2.default)(popup).prepend((0, _jquery2.default)('<iframe class = "inline-dialog-shim" id="inline-dialog-shim-' + identifier + '" frameBorder="0" src="javascript:false;"></iframe>'));
}
// adjust height and width of shim according to the popup
jQueryCache.css({
width: contents.outerWidth(),
height: contents.outerHeight()
});
}
}
};
}
return hash;
};
var showPopup = function showPopup() {
if (popup.is(':visible')) {
return;
}
showTimer = setTimeout(function () {
if (!contentLoaded || !shouldShow) {
return;
}
opts.addActiveClass && (0, _jquery2.default)(items).addClass('active');
beingShown = true;
if (!opts.persistent) {
bindHideEvents();
}
InlineDialog.current = getHash();
(0, _jquery2.default)(document).trigger('showLayer', ['inlineDialog', getHash()]);
// retrieve the position of the click target. The offsets might be different for different types of targets and therefore
// either have to be customisable or we will have to be smarter about calculating the padding and elements around it
getHash().reset();
}, opts.showDelay);
};
var hidePopup = function hidePopup(delay) {
// do not auto hide the popup if persistent is set as true
if (typeof delay === 'undefined' && opts.persistent) {
return;
}
if (typeof popup.get(0)._datePickerPopup !== 'undefined') {
// AUI-2696 - This inline dialog is host to a date picker... so we shouldn't close it.
return;
}
shouldShow = false;
// only exectute the below if the popup is currently being shown
// and the arbitrator callback gives us the green light
if (beingShown && opts.preHideCallback.call(popup[0].popup)) {
delay = delay == null ? opts.hideDelay : delay;
clearTimeout(hideDelayTimer);
clearTimeout(showTimer);
// store the timer so that it can be cleared in the mouseenter if required
//disable auto-hide if user passes null for hideDelay
if (delay != null) {
hideDelayTimer = setTimeout(function () {
unbindHideEvents();
opts.addActiveClass && (0, _jquery2.default)(items).removeClass('active');
popup.fadeOut(opts.fadeTime, function () {
opts.hideCallback.call(popup[0].popup);
});
//If there's a raphael arrow remove it properly
if (popup.arrowCanvas) {
popup.arrowCanvas.remove();
popup.arrowCanvas = null;
}
beingShown = false;
shouldShow = false;
(0, _jquery2.default)(document).trigger('hideLayer', ['inlineDialog', getHash()]);
InlineDialog.current = null;
if (!opts.cacheContent) {
//if not caching the content, then reset the
//flags to false so as to reload the content
//on next mouse hover.
contentLoaded = false;
contentLoading = false;
}
}, delay);
}
}
};
// the trigger is the jquery element that is triggering the popup (i.e., the element that the mousemove event is bound to)
var initPopup = function initPopup(e, trigger) {
var $trigger = (0, _jquery2.default)(trigger);
opts.upfrontCallback.call({
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
}
});
popup.each(function () {
if (typeof this.popup !== 'undefined') {
this.popup.hide();
}
});
//Close all other popups if neccessary
if (opts.closeOthers) {
(0, _jquery2.default)('.aui-inline-dialog').each(function () {
!this.popup.persistent && this.popup.hide();
});
}
//handle programmatic showing where there is no event
targetPosition = { target: $trigger };
if (!e) {
mousePosition = { x: $trigger.offset().left, y: $trigger.offset().top };
} else {
mousePosition = { x: e.pageX, y: e.pageY };
}
if (!beingShown) {
clearTimeout(showTimer);
}
shouldShow = true;
var doShowPopup = function doShowPopup() {
contentLoading = false;
contentLoaded = true;
opts.initCallback.call({
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
}
});
showPopup();
};
// lazy load popup contents
if (!contentLoading) {
contentLoading = true;
if (_jquery2.default.isFunction(url)) {
// If the passed in URL is a function, execute it. Otherwise simply load the content.
url(contents, trigger, doShowPopup);
} else {
//Retrive response from server
_jquery2.default.get(url, function (data, status, xhr) {
//Load HTML contents into the popup
contents.html(opts.responseHandler(data, status, xhr));
//Show the popup
contentLoaded = true;
opts.initCallback.call({
popup: popup,
hide: function hide() {
hidePopup(0);
},
id: identifier,
show: function show() {
showPopup();
}
});
showPopup();
});
}
}
// stops the hide event if we move from the trigger to the popup element
clearTimeout(hideDelayTimer);
// don't trigger the animation again if we're being shown
if (!beingShown) {
showPopup();
}
return false;
};
popup[0].popup = getHash();
var contentLoading = false;
var added = false;
var appendPopup = function appendPopup() {
if (!added) {
(0, _jquery2.default)(opts.container).append(popup);
added = true;
}
};
var $items = (0, _jquery2.default)(items);
if (opts.onHover) {
if (opts.useLiveEvents) {
// We're using .on() to emulate the behaviour of .live() here. on() requires the jQuery object to have
// a selector - this is actually how .live() is implemented in jQuery 1.7+.
// Note that .selector is deleted in jQuery 1.9+.
// This means that jQuery objects created by selection eg $(".my-class-selector") will work, but
// object created by DOM parsing eg $("<div class='.my-class'></div>") will not work.
// Ideally we should throw an error if the $items has no selector but that is backwards incompatible,
// so we warn and do a no-op - this emulates the behaviour of live() but has the added warning.
if ($items.selector) {
(0, _jquery2.default)(document).on('mouseenter', $items.selector, function (e) {
appendPopup();
initPopup(e, this);
}).on('mouseleave', $items.selector, function () {
hidePopup();
});
} else {
logger.log('Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.');
}
} else {
$items.on({
mouseenter: function mouseenter(e) {
appendPopup();
initPopup(e, this);
},
mouseleave: function mouseleave() {
hidePopup();
}
});
}
} else {
if (!opts.noBind) {
//Check if the noBind option is turned on
if (opts.useLiveEvents) {
// See above for why we filter by .selector
if ($items.selector) {
(0, _jquery2.default)(document).on('click', $items.selector, function (e) {
appendPopup();
if (shouldCloseOnTriggerClick()) {
popup.hide();
} else {
initPopup(e, this);
}
return false;
}).on('mouseleave', $items.selector, function () {
hidePopup();
});
} else {
logger.log('Warning: inline dialog trigger elements must have a jQuery selector when the useLiveEvents option is enabled.');
}
} else {
$items.on('click', function (e) {
appendPopup();
if (shouldCloseOnTriggerClick()) {
popup.hide();
} else {
initPopup(e, this);
}
return false;
}).on('mouseleave', function () {
hidePopup();
});
}
}
}
var shouldCloseOnTriggerClick = function shouldCloseOnTriggerClick() {
return beingShown && opts.closeOnTriggerClick;
};
var bindHideEvents = function bindHideEvents() {
bindHideOnExternalClick();
bindHideOnEscPressed();
};
var unbindHideEvents = function unbindHideEvents() {
unbindHideOnExternalClick();
unbindHideOnEscPressed();
};
// Be defensive and make sure that we haven't already bound the event
var hasBoundOnExternalClick = false;
var externalClickNamespace = identifier + '.inline-dialog-check';
/**
* Catch click events on the body to see if the click target occurs outside of this popup
* If it does, the popup will be hidden
*/
var bindHideOnExternalClick = function bindHideOnExternalClick() {
if (!hasBoundOnExternalClick) {
(0, _jquery2.default)('body').bind('click.' + externalClickNamespace, function (e) {
var $target = (0, _jquery2.default)(e.target);
// hide the popup if the target of the event is not in the dialog
if ($target.closest('#inline-dialog-' + identifier + ' .contents').length === 0) {
hidePopup(0);
}
});
hasBoundOnExternalClick = true;
}
};
var unbindHideOnExternalClick = function unbindHideOnExternalClick() {
if (hasBoundOnExternalClick) {
(0, _jquery2.default)('body').unbind('click.' + externalClickNamespace);
}
hasBoundOnExternalClick = false;
};
var onKeydown = function onKeydown(e) {
if (e.keyCode === 27) {
hidePopup(0);
}
};
var bindHideOnEscPressed = function bindHideOnEscPressed() {
(0, _jquery2.default)(document).on('keydown', onKeydown);
};
var unbindHideOnEscPressed = function unbindHideOnEscPressed() {
(0, _jquery2.default)(document).off('keydown', onKeydown);
};
/**
* Show the inline dialog.
* @method show
*/
popup.show = function (e, trigger) {
if (e) {
e.stopPropagation();
}
appendPopup();
if (opts.noBind && !(items && items.length)) {
initPopup(e, trigger === undefined ? e.target : trigger);
} else {
initPopup(e, items);
}
};
/**
* Hide the inline dialog.
* @method hide
*/
popup.hide = function () {
hidePopup(0);
};
/**
* Repositions the inline dialog if being shown.
* @method refresh
*/
popup.refresh = function () {
if (beingShown) {
getHash().reset();
}
};
popup.getOptions = function () {
return opts;
};
return popup;
}
function dimensionsOf(el) {
var $el = (0, _jquery2.default)(el);
var offset = _jquery2.default.extend({ left: 0, top: 0 }, $el.offset());
return {
left: offset.left,
top: offset.top,
width: $el.outerWidth(),
height: $el.outerHeight()
};
}
function getDimensions(popup, targetPosition, mousePosition, opts) {
var offsetX = _jquery2.default.isFunction(opts.offsetX) ? opts.offsetX(popup, targetPosition, mousePosition, opts) : opts.offsetX;
var offsetY = _jquery2.default.isFunction(opts.offsetY) ? opts.offsetY(popup, targetPosition, mousePosition, opts) : opts.offsetY;
var arrowOffsetX = _jquery2.default.isFunction(opts.arrowOffsetX) ? opts.arrowOffsetX(popup, targetPosition, mousePosition, opts) : opts.arrowOffsetX;
var arrowOffsetY = _jquery2.default.isFunction(opts.arrowOffsetY) ? opts.arrowOffsetY(popup, targetPosition, mousePosition, opts) : opts.arrowOffsetY;
// Support positioning inside a scroll container other than <body>
var isConstrainedScroll = opts.container.toLowerCase() !== 'body';
var $scrollContainer = (0, _jquery2.default)(opts.container);
var $scrollWindow = isConstrainedScroll ? (0, _jquery2.default)(opts.container).parent() : (0, _jquery2.default)(window);
var scrollContainerOffset = isConstrainedScroll ? $scrollContainer.offset() : { left: 0, top: 0 };
var scrollWindowOffset = isConstrainedScroll ? $scrollWindow.offset() : { left: 0, top: 0 };
var trigger = targetPosition.target;
var triggerOffset = trigger.offset();
// Support SVG elements as triggers
// TODO Should calculateNorthSouthPositions also try getBBox()?
var triggerBBox = trigger[0].getBBox && trigger[0].getBBox();
return {
// determines how close to the edge the dialog needs to be before it is considered offscreen
screenPadding: 10,
// Min distance arrow needs to be from the edge of the dialog
arrowMargin: 5,
window: {
top: scrollWindowOffset.top,
left: scrollWindowOffset.left,
scrollTop: $scrollWindow.scrollTop(),
scrollLeft: $scrollWindow.scrollLeft(),
width: $scrollWindow.width(),
height: $scrollWindow.height()
},
scrollContainer: {
width: $scrollContainer.width(),
height: $scrollContainer.height()
},
// Position of the trigger is relative to the scroll container
trigger: {
top: triggerOffset.top - scrollContainerOffset.top,
left: triggerOffset.left - scrollContainerOffset.left,
width: triggerBBox ? triggerBBox.width : trigger.outerWidth(),
height: triggerBBox ? triggerBBox.height : trigger.outerHeight()
},
dialog: {
width: popup.width(),
height: popup.height(),
offset: {
top: offsetY,
left: offsetX
}
},
arrow: {
height: popup.find('.arrow').outerHeight(),
offset: {
top: arrowOffsetY,
left: arrowOffsetX
}
}
};
}
function calculateWestPositions(popup, targetPosition, mousePosition, opts) {
var dimensions = getDimensions(popup, targetPosition, mousePosition, opts);
var screenPadding = dimensions.screenPadding;
var win = dimensions.window;
var trigger = dimensions.trigger;
var dialog = dimensions.dialog;
var arrow = dimensions.arrow;
var scrollContainer = dimensions.scrollContainer;
var triggerScrollOffset = {
top: trigger.top - win.scrollTop,
left: trigger.left - win.scrollLeft
};
// Halves - because the browser doesn't do sub-pixel positioning, we need to consistently floor
// all decimal values or you can get 1px jumps in arrow positioning when the dialog's height changes.
var halfTriggerHeight = Math.floor(trigger.height / 2);
var halfPopupHeight = Math.floor(dialog.height / 2);
var halfArrowHeight = Math.floor(arrow.height / 2);
// Figure out where to position the dialog, preferring the right (gravity: 'w').
var spaceOnLeft = triggerScrollOffset.left - dialog.offset.left - screenPadding;
// This implementation may not be suitable for horizontally scrolling containers
var spaceOnRight = scrollContainer.width - triggerScrollOffset.left - trigger.width - dialog.offset.left - screenPadding;
var enoughSpaceOnLeft = spaceOnLeft >= dialog.width;
var enoughSpaceOnRight = spaceOnRight >= dialog.width;
var gravity = !enoughSpaceOnRight && enoughSpaceOnLeft ? 'e' : 'w';
// Screen padding needs to be adjusted if the arrow would extend into it
var arrowScreenTop = triggerScrollOffset.top + halfTriggerHeight - halfArrowHeight;
var arrowScreenBottom = win.height - arrowScreenTop - arrow.height;
screenPadding = Math.min(screenPadding, arrowScreenTop - dimensions.arrowMargin);
screenPadding = Math.min(screenPadding, arrowScreenBottom - dimensions.arrowMargin);
// Figure out if the dialog needs to be adjusted up or down to fit on the screen
var middleOfTrigger = triggerScrollOffset.top + halfTriggerHeight;
var spaceAboveMiddleOfTrigger = Math.max(middleOfTrigger - screenPadding, 0);
var spaceBelowMiddleOfTrigger = Math.max(win.height - middleOfTrigger - screenPadding, 0);
var isOverflowingAbove = halfPopupHeight - dialog.offset.top > spaceAboveMiddleOfTrigger;
var isOverflowingBelow = halfPopupHeight + dialog.offset.top > spaceBelowMiddleOfTrigger;
var popupCss;
var arrowCss;
if (isOverflowingAbove) {
popupCss = {
top: win.scrollTop + screenPadding,
left: gravity === 'w' ? trigger.left + trigger.width + dialog.offset.left : trigger.left - dialog.width - dialog.offset.left
};
arrowCss = {
top: trigger.top + halfTriggerHeight - (popupCss.top + halfArrowHeight)
};
} else if (isOverflowingBelow) {
popupCss = {
top: win.scrollTop + win.height - dialog.height - screenPadding,
left: gravity === 'w' ? trigger.left + trigger.width + dialog.offset.left : trigger.left - dialog.width - dialog.offset.left
};
arrowCss = {
top: trigger.top + halfTriggerHeight - (popupCss.top + halfArrowHeight)
};
} else {
popupCss = {
top: trigger.top + halfTriggerHeight - halfPopupHeight + dialog.offset.top,
left: gravity === 'w' ? trigger.left + trigger.width + dialog.offset.left : trigger.left - dialog.width - dialog.offset.left
};
arrowCss = {
top: halfPopupHeight - halfArrowHeight + arrow.offset.top
};
}
return {
gravity: gravity,
popupCss: popupCss,
arrowCss: arrowCss
};
}
function calculateNorthSouthPositions(popup, targetPosition, mousePosition, opts) {
var offsetX = _jquery2.default.isFunction(opts.offsetX) ? opts.offsetX(popup, targetPosition, mousePosition, opts) : opts.offsetX;
var offsetY = _jquery2.default.isFunction(opts.offsetY) ? opts.offsetY(popup, targetPosition, mousePosition, opts) : opts.offsetY;
var arrowOffsetX = _jquery2.default.isFunction(opts.arrowOffsetX) ? opts.arrowOffsetX(popup, targetPosition, mousePosition, opts) : opts.arrowOffsetX;
var viewportDimensions = dimensionsOf(window);
var targetDimensions = dimensionsOf(targetPosition.target);
var popupDimensions = dimensionsOf(popup);
var arrowDimensions = dimensionsOf(popup.find('.aui-inline-dialog-arrow'));
var middleOfTrigger = targetDimensions.left + targetDimensions.width / 2; //The absolute x position of the middle of the Trigger
var bottomOfViewablePage = (window.pageYOffset || document.documentElement.scrollTop) + viewportDimensions.height;
var SCREEN_PADDING = 10; //determines how close to the edge the dialog needs to be before it is considered offscreen
// Set popup's position (within the viewport)
popupDimensions.top = targetDimensions.top + targetDimensions.height + ~ ~offsetY;
popupDimensions.left = targetDimensions.left + ~ ~offsetX;
// Calculate if the popup would render off the side of the viewport
var diff = viewportDimensions.width - (popupDimensions.left + popupDimensions.width + SCREEN_PADDING);
// Set arrow's position (within the popup)
arrowDimensions.left = middleOfTrigger - popupDimensions.left + ~ ~arrowOffsetX;
// TODO arrowDimensions.top should also use arrowOffsetY.
arrowDimensions.top = -(arrowDimensions.height / 2);
// Check whether the popup should display above or below the trigger
var enoughRoomAbove = targetDimensions.top > popupDimensions.height;
var enoughRoomBelow = popupDimensions.top + popupDimensions.height < bottomOfViewablePage;
var displayAbove = !enoughRoomBelow && enoughRoomAbove || enoughRoomAbove && opts.gravity === 's';
if (displayAbove) {
popupDimensions.top = targetDimensions.top - popupDimensions.height - arrowDimensions.height / 2;
arrowDimensions.top = popupDimensions.height;
}
// Check if the popup should show up relative to the mouse
if (opts.isRelativeToMouse) {
if (diff < 0) {
popupDimensions.right = SCREEN_PADDING;
popupDimensions.left = 'auto';
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = mousePosition.x - (viewportDimensions.width - popupDimensions.width);
} else {
popupDimensions.left = mousePosition.x - 20;
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = mousePosition.x - popupDimensions.left;
}
} else {
if (diff < 0) {
popupDimensions.right = SCREEN_PADDING;
popupDimensions.left = 'auto';
var popupRightEdge = viewportDimensions.width - popupDimensions.right;
var popupLeftEdge = popupRightEdge - popupDimensions.width;
//arrow's position must be relative to the popup's position and not of the screen.
arrowDimensions.right = 'auto';
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = middleOfTrigger - popupLeftEdge - arrowDimensions.width / 2;
} else if (popupDimensions.width <= targetDimensions.width / 2) {
// TODO Why doesn't arrowDimentions.left here use arrowOffsetX?
arrowDimensions.left = popupDimensions.width / 2;
popupDimensions.left = middleOfTrigger - popupDimensions.width / 2;
}
}
return {
gravity: displayAbove ? 's' : 'n',
displayAbove: displayAbove, // Replaced with gravity but remains for backward compatibility.
popupCss: {
left: popupDimensions.left,
top: popupDimensions.top,
right: popupDimensions.right
},
arrowCss: {
left: arrowDimensions.left,
top: arrowDimensions.top,
right: arrowDimensions.right
}
};
}
InlineDialog.opts = {
onTop: false,
responseHandler: function responseHandler(data) {
//assume data is html
return data;
},
closeOthers: true,
isRelativeToMouse: false,
addActiveClass: true, // if false, signifies that the triggers should not have the "active" class applied
onHover: false,
useLiveEvents: false,
noBind: false,
fadeTime: 100,
persistent: false,
hideDelay: 10000,
showDelay: 0,
width: 300,
offsetX: 0,
offsetY: 10,
arrowOffsetX: 0,
arrowOffsetY: 0,
container: 'body',
cacheContent: true,
displayShadow: true,
autoWidth: false,
gravity: 'n',
closeOnTriggerClick: false,
preHideCallback: function preHideCallback() {
return true;
},
hideCallback: function hideCallback() {}, // if defined, this method will be exected after the popup has been faded out.
initCallback: function initCallback() {}, // A function called after the popup contents are loaded. `this` will be the popup jQuery object, and the first argument is the popup identifier.
upfrontCallback: function upfrontCallback() {}, // A function called before the popup contents are loaded. `this` will be the popup jQuery object, and the first argument is the popup identifier.
/**
* Returns an object with the following attributes:
* popupCss css attributes to apply on the popup element
* arrowCss css attributes to apply on the arrow element
*
* @param popup
* @param targetPosition position of the target element
* @param mousePosition current mouse position
* @param opts options
*/
calculatePositions: function calculatePositions(popup, targetPosition, mousePosition, opts) {
opts = opts || {};
var algorithm = opts.gravity === 'w' ? calculateWestPositions : calculateNorthSouthPositions;
return algorithm(popup, targetPosition, mousePosition, opts);
},
getArrowPath: function getArrowPath(positions) {
if (positions.gravity === 's') {
return 'M0,8L8,16,16,8';
} else {
return 'M0,8L8,0,16,8';
}
},
getArrowAttributes: function getArrowAttributes() {
return {
fill: '#fff',
stroke: '#ccc'
};
}
};
// Deprecations
// ------------
InlineDialog = deprecate.construct(InlineDialog, 'Inline dialog constructor', {
alternativeName: 'inline dialog 2'
});
var displayAboveDeprecationLogger = deprecate.getMessageLogger('displayAbove', '[remove version]', {
alternativeName: 'gravity',
extraInfo: 'See https://ecosystem.atlassian.net/browse/AUI-2197.'
});
var onTopDeprecationLogger = deprecate.getMessageLogger('onTop', '[remove version]', {
alternativeName: 'gravity',
extraInfo: 'See https://ecosystem.atlassian.net/browse/AUI-2197.'
});
var getArrowAttributesDeprecationLogger = deprecate.getMessageLogger('getArrowAttributes', '[remove version]', {
extraInfo: 'See https://ecosystem.atlassian.net/browse/AUI-1362.'
});
var getArrowPathDeprecationLogger = deprecate.getMessageLogger('getArrowPath', '[remove version]', {
extraInfo: 'See https://ecosystem.atlassian.net/browse/AUI-1362.'
});
var getArrowPathWithGravityDeprecationLogger = deprecate.getMessageLogger('getArrowPath does not support gravity', '[remove version]', {
extraInfo: 'See https://ecosystem.atlassian.net/browse/AUI-2197.'
});
// Exporting
// ---------
(0, _globalize2.default)('InlineDialog', InlineDialog);
exports.default = InlineDialog;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/key-code.js
(typeof window === 'undefined' ? global : window).__441232d78236eb4e37336c273cdfa555 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var keyCode = {
ALT: 18,
BACKSPACE: 8,
CAPS_LOCK: 20,
COMMA: 188,
COMMAND: 91,
// cmd
COMMAND_LEFT: 91,
COMMAND_RIGHT: 93,
LEFT_SQUARE_BRACKET: 91, //This is 91 for keypress and 219 for keydown/keyup
CONTROL: 17,
DELETE: 46,
DOWN: 40,
END: 35,
ENTER: 13,
ESCAPE: 27,
HOME: 36,
INSERT: 45,
LEFT: 37,
// right cmd
MENU: 93,
NUMPAD_ADD: 107,
NUMPAD_DECIMAL: 110,
NUMPAD_DIVIDE: 111,
NUMPAD_ENTER: 108,
NUMPAD_MULTIPLY: 106,
NUMPAD_SUBTRACT: 109,
PAGE_DOWN: 34,
PAGE_UP: 33,
PERIOD: 190,
RIGHT: 39,
SHIFT: 16,
SPACE: 32,
TAB: 9,
UP: 38,
// cmd
WINDOWS: 91
};
(0, _globalize2.default)('keyCode', keyCode);
exports.default = keyCode;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/format.js
(typeof window === 'undefined' ? global : window).__ec1a503e134b6e0c3b4852e662b97de3 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Replaces tokens in a string with arguments, similar to Java's MessageFormat.
* Tokens are in the form {0}, {1}, {2}, etc.
*
* This version also provides support for simple choice formats (excluding floating point numbers) of the form
* {0,choice,0#0 issues|1#1 issue|1<{0,number} issues}
*
* Number format is currently not implemented, tokens of the form {0,number} will simply be printed as {0}
*
* @method format
* @param message the message to replace tokens in
* @param arg (optional) replacement value for token {0}, with subsequent arguments being {1}, etc.
* @return {String} the message with the tokens replaced
* @usage formatString("This is a {0} test", "simple");
*/
function formatString(message) {
var apos = /'(?!')/g,
// founds "'", but not "''"
simpleFormat = /^\d+$/,
numberFormat = /^(\d+),number$/,
// TODO: incomplete, as doesn't support floating point numbers
choiceFormat = /^(\d+)\,choice\,(.+)/,
choicePart = /^(\d+)([#<])(.+)/; // TODO: does not work for floating point numbers!
// we are caching RegExps, so will not spend time on recreating them on each call
// formats a value, currently choice and simple replacement are implemented, proper
var getParamValue = function getParamValue(format, args) {
// simple substitute
/*jshint boss:true */
var res = '',
match;
if (match = format.match(simpleFormat)) {
// TODO: heavy guns for checking whether format is a simple number...
res = args.length > ++format ? args[format] : ''; // use the argument as is, or use '' if not found
}
// number format
else if (match = format.match(numberFormat)) {
// TODO: doesn't actually format the number...
res = args.length > ++match[1] ? args[match[1]] : '';
}
// choice format
else if (match = format.match(choiceFormat)) {
// format: "0,choice,0#0 issues|1#1 issue|1<{0,number} issues"
// match[0]: "0,choice,0#0 issues|1#1 issue|1<{0,number} issues"
// match[1]: "0"
// match[2]: "0#0 issues|1#1 issue|1<{0,number} issues"
// get the argument value we base the choice on
var value = args.length > ++match[1] ? args[match[1]] : null;
if (value !== null) {
// go through all options, checking against the number, according to following formula,
// if X < the first entry then the first entry is returned, if X > last entry, the last entry is returned
//
// X matches j if and only if limit[j] <= X < limit[j+1]
//
var options = match[2].split('|');
var prevOptionValue = null; // holds last passed option
for (var i = 0; i < options.length; i++) {
// option: "0#0 issues"
// part[0]: "0#0 issues"
// part[1]: "0"
// part[2]: "#"
// part[3]" "0 issues";
var parts = options[i].match(choicePart);
// if value is smaller, we take the previous value, or the current if no previous exists
var argValue = parseInt(parts[1], 10);
if (value < argValue) {
if (prevOptionValue) {
res = prevOptionValue;
break;
} else {
res = parts[3];
break;
}
}
// if value is equal the condition, and the match is equality match we accept it
if (value == argValue && parts[2] == '#') {
res = parts[3];
break;
} else {}
// value is greater the condition, fall through to next iteration
// check whether we are the last option, in which case accept it even if the option does not match
if (i == options.length - 1) {
res = parts[3];
}
// retain current option
prevOptionValue = parts[3];
}
// run result through format, as the parts might contain substitutes themselves
var formatArgs = [res].concat(Array.prototype.slice.call(args, 1));
res = formatString.apply(null, formatArgs);
}
}
return res;
};
// drop in replacement for the token regex
// splits the message to return the next accurance of a i18n placeholder.
// Does not use regexps as we need to support nested placeholders
// text between single ticks ' are ignored
var _performTokenRegex = function _performTokenRegex(message) {
var tick = false,
openIndex = -1,
openCount = 0;
for (var i = 0; i < message.length; i++) {
// handle ticks
var c = message.charAt(i);
if (c == "'") {
// toggle
tick = !tick;
}
// skip if we are between ticks
if (tick) {
continue;
}
// check open brackets
if (c === '{') {
if (openCount === 0) {
openIndex = i;
}
openCount++;
} else if (c === '}') {
if (openCount > 0) {
openCount--;
if (openCount === 0) {
// we found a bracket match - generate the result array (
var match = [];
match.push(message.substring(0, i + 1)); // from begin to match
match.push(message.substring(0, openIndex)); // everything until match start
match.push(message.substring(openIndex + 1, i)); // matched content
return match;
}
}
}
}
return null;
};
var _formatString = function _formatString(message) {
var args = arguments;
var res = '';
if (!message) {
return res;
}
var match = _performTokenRegex(message);
while (match) {
// reduce message to string after match
message = message.substring(match[0].length);
// add value before match to result
res += match[1].replace(apos, '');
// add formatted parameter
res += getParamValue(match[2], args);
// check for next match
match = _performTokenRegex(message); //message.match(token);
}
// add remaining message to result
res += message.replace(apos, '');
return res;
};
return _formatString.apply(null, arguments);
}
(0, _globalize2.default)('format', formatString);
exports.default = formatString;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/i18n/aui.js
(typeof window === 'undefined' ? global : window).__af4c221bed03a9ab57518da2f8bb8497 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
'aui.dropdown.async.error': 'Error loading dropdown',
'aui.dropdown.async.loading': 'Loading dropdown',
'aui.words.add': 'Add',
'aui.words.update': 'Update',
'aui.words.delete': 'Delete',
'aui.words.remove': 'Remove',
'aui.words.cancel': 'Cancel',
'aui.words.loading': 'Loading',
'aui.words.close': 'Close',
'aui.enter.value': 'Enter value',
'aui.words.more': 'More',
'aui.words.moreitem': 'More…',
'aui.keyboard.shortcut.type.x': "Type ''{0}''",
'aui.keyboard.shortcut.then.x': "then ''{0}''",
'aui.keyboard.shortcut.or.x': "OR ''{0}''",
'aui.sidebar.expand.tooltip': 'Expand sidebar ( [ )',
'aui.sidebar.collapse.tooltip': 'Collapse sidebar ( [ )',
'aui.validation.message.maxlength': 'Must be fewer than or equal to {0} characters',
'aui.validation.message.minlength': 'Must be greater than or equal to {0} characters',
'aui.validation.message.exactlength': 'Must be exactly {0} characters',
'aui.validation.message.matchingfield': '{0} and {1} do not match.',
'aui.validation.message.matchingfield-novalue': 'These fields do not match.',
'aui.validation.message.doesnotcontain': 'Do not include the phrase {0} in this field',
'aui.validation.message.pattern': 'This field does not match the required format',
'aui.validation.message.required': 'This is a required field',
'aui.validation.message.validnumber': 'Please enter a valid number',
'aui.validation.message.min': 'Enter a value greater than {0}',
'aui.validation.message.max': 'Enter a value less than {0}',
'aui.validation.message.dateformat': 'Enter a valid date',
'aui.validation.message.minchecked': 'Tick at least {0,choice,0#0 checkboxes|1#1 checkbox|1<{0,number} checkboxes}.',
'aui.validation.message.maxchecked': 'Tick at most {0,choice,0#0 checkboxes|1#1 checkbox|1<{0,number} checkboxes}.',
'aui.checkboxmultiselect.clear.selected': 'Clear selected items',
'aui.select.no.suggestions': 'No suggestions',
'aui.select.new.suggestions': 'New suggestions added. Please use the up and down arrows to select.',
'aui.select.new.value': 'new value',
'aui.toggle.on': 'On',
'aui.toggle.off': 'Off',
'ajs.datepicker.localisations.day-names.sunday': 'Sunday',
'ajs.datepicker.localisations.day-names.monday': 'Monday',
'ajs.datepicker.localisations.day-names.tuesday': 'Tuesday',
'ajs.datepicker.localisations.day-names.wednesday': 'Wednesday',
'ajs.datepicker.localisations.day-names.thursday': 'Thursday',
'ajs.datepicker.localisations.day-names.friday': 'Friday',
'ajs.datepicker.localisations.day-names.saturday': 'Saturday',
'ajs.datepicker.localisations.day-names-min.sunday': 'Sun',
'ajs.datepicker.localisations.day-names-min.monday': 'Mon',
'ajs.datepicker.localisations.day-names-min.tuesday': 'Tue',
'ajs.datepicker.localisations.day-names-min.wednesday': 'Wed',
'ajs.datepicker.localisations.day-names-min.thursday': 'Thu',
'ajs.datepicker.localisations.day-names-min.friday': 'Fri',
'ajs.datepicker.localisations.day-names-min.saturday': 'Sat',
'ajs.datepicker.localisations.first-day': 0,
'ajs.datepicker.localisations.is-RTL': false,
'ajs.datepicker.localisations.month-names.january': 'January',
'ajs.datepicker.localisations.month-names.february': 'February',
'ajs.datepicker.localisations.month-names.march': 'March',
'ajs.datepicker.localisations.month-names.april': 'April',
'ajs.datepicker.localisations.month-names.may': 'May',
'ajs.datepicker.localisations.month-names.june': 'June',
'ajs.datepicker.localisations.month-names.july': 'July',
'ajs.datepicker.localisations.month-names.august': 'August',
'ajs.datepicker.localisations.month-names.september': 'September',
'ajs.datepicker.localisations.month-names.october': 'October',
'ajs.datepicker.localisations.month-names.november': 'November',
'ajs.datepicker.localisations.month-names.december': 'December',
'ajs.datepicker.localisations.show-month-after-year': false,
'ajs.datepicker.localisations.year-suffix': null
};
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/i18n.js
(typeof window === 'undefined' ? global : window).__8d80b2996ccf75cdbe997a5c7cbb4b40 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _format = __ec1a503e134b6e0c3b4852e662b97de3;
var _format2 = _interopRequireDefault(_format);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _aui = __af4c221bed03a9ab57518da2f8bb8497;
var _aui2 = _interopRequireDefault(_aui);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Returns the value defined in AJS.I18n.keys for the given key. If AJS.I18n.keys does not exist, or if the given key does not exist,
* the key is returned - this could occur in plugin mode if the I18n transform is not performed;
* or in flatpack mode if the i18n JS file is not loaded.
*/
var i18n = {
keys: _aui2.default,
getText: function getText(key) {
var params = Array.prototype.slice.call(arguments, 1);
if (Object.prototype.hasOwnProperty.call(this.keys, key)) {
return _format2.default.apply(null, [this.keys[key]].concat(params));
}
return key;
}
};
(0, _globalize2.default)('I18n', i18n);
exports.default = i18n;
module.exports = exports['default'];
return module.exports;
}).call(this);
// node_modules/skatejs/lib/constants.js
(typeof window === 'undefined' ? global : window).__6b9879a02da8be3c05e35c60e8a645ab = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__6b9879a02da8be3c05e35c60e8a645ab");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(function (exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var ATTR_IGNORE = "data-skate-ignore";
exports.ATTR_IGNORE = ATTR_IGNORE;
var TYPE_ATTRIBUTE = "a";
exports.TYPE_ATTRIBUTE = TYPE_ATTRIBUTE;
var TYPE_CLASSNAME = "c";
exports.TYPE_CLASSNAME = TYPE_CLASSNAME;
var TYPE_ELEMENT = "t";
exports.TYPE_ELEMENT = TYPE_ELEMENT;
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/globals.js
(typeof window === 'undefined' ? global : window).__7b4640c228135ab2adcbde5a06412f18 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__7b4640c228135ab2adcbde5a06412f18");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module);
}
})(function (exports, module) {
if (!window.__skate) {
window.__skate = {
observer: undefined,
registry: {}
};
}
module.exports = window.__skate;
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/data.js
(typeof window === 'undefined' ? global : window).__1d50ca421cb8df953fc4063be155d6de = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__1d50ca421cb8df953fc4063be155d6de");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module);
}
})(function (exports, module) {
module.exports = function (element) {
var namespace = arguments[1] === undefined ? "" : arguments[1];
var data = element.__SKATE_DATA || (element.__SKATE_DATA = {});
return namespace && (data[namespace] || (data[namespace] = {})) || data;
};
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/mutation-observer.js
(typeof window === 'undefined' ? global : window).__a59f13890c9a74b6fb0fe38002898f01 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__a59f13890c9a74b6fb0fe38002898f01");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(function (exports) {
(function (self) {
// Atlassian: added IIFE
/**
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
// @version 0.7.15
if (typeof WeakMap === "undefined") {
(function () {
var defineProperty = Object.defineProperty;
var counter = Date.now() % 1000000000;
var WeakMap = function WeakMap() {
this.name = "__st" + (Math.random() * 1000000000 >>> 0) + (counter++ + "__");
};
WeakMap.prototype = {
set: function set(key, value) {
var entry = key[this.name];
if (entry && entry[0] === key) entry[1] = value;else defineProperty(key, this.name, {
value: [key, value],
writable: true
});
return this;
},
get: function get(key) {
var entry;
return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined;
},
"delete": function _delete(key) {
var entry = key[this.name];
if (!entry || entry[0] !== key) {
return false;
}entry[0] = entry[1] = undefined;
return true;
},
has: function has(key) {
var entry = key[this.name];
if (!entry) {
return false;
}return entry[0] === key;
}
};
window.WeakMap = WeakMap;
})();
}
(function (global) {
if (global.JsMutationObserver) {
return;
}
var registrationsTable = new WeakMap();
var setImmediate;
if (/Trident|Edge/.test(navigator.userAgent)) {
setImmediate = setTimeout;
} else if (window.setImmediate) {
setImmediate = window.setImmediate;
} else {
var setImmediateQueue = [];
var sentinel = String(Math.random());
window.addEventListener("message", function (e) {
if (e.data === sentinel) {
var queue = setImmediateQueue;
setImmediateQueue = [];
queue.forEach(function (func) {
func();
});
}
});
setImmediate = function (func) {
setImmediateQueue.push(func);
window.postMessage(sentinel, "*");
};
}
var isScheduled = false;
var scheduledObservers = [];
function scheduleCallback(observer) {
scheduledObservers.push(observer);
if (!isScheduled) {
isScheduled = true;
setImmediate(dispatchCallbacks);
}
}
function wrapIfNeeded(node) {
return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node;
}
function dispatchCallbacks() {
isScheduled = false;
var observers = scheduledObservers;
scheduledObservers = [];
observers.sort(function (o1, o2) {
return o1.uid_ - o2.uid_;
});
var anyNonEmpty = false;
observers.forEach(function (observer) {
var queue = observer.takeRecords();
removeTransientObserversFor(observer);
if (queue.length) {
observer.callback_(queue, observer);
anyNonEmpty = true;
}
});
if (anyNonEmpty) dispatchCallbacks();
}
function removeTransientObserversFor(observer) {
observer.nodes_.forEach(function (node) {
var registrations = registrationsTable.get(node);
if (!registrations) return;
registrations.forEach(function (registration) {
if (registration.observer === observer) registration.removeTransientObservers();
});
});
}
function forEachAncestorAndObserverEnqueueRecord(target, callback) {
for (var node = target; node; node = node.parentNode) {
var registrations = registrationsTable.get(node);
if (registrations) {
for (var j = 0; j < registrations.length; j++) {
var registration = registrations[j];
var options = registration.options;
if (node !== target && !options.subtree) continue;
var record = callback(options);
if (record) registration.enqueue(record);
}
}
}
}
var uidCounter = 0;
function JsMutationObserver(callback) {
this.callback_ = callback;
this.nodes_ = [];
this.records_ = [];
this.uid_ = ++uidCounter;
}
JsMutationObserver.prototype = {
observe: function observe(target, options) {
target = wrapIfNeeded(target);
if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) {
throw new SyntaxError();
}
var registrations = registrationsTable.get(target);
if (!registrations) registrationsTable.set(target, registrations = []);
var registration;
for (var i = 0; i < registrations.length; i++) {
if (registrations[i].observer === this) {
registration = registrations[i];
registration.removeListeners();
registration.options = options;
break;
}
}
if (!registration) {
registration = new Registration(this, target, options);
registrations.push(registration);
this.nodes_.push(target);
}
registration.addListeners();
},
disconnect: function disconnect() {
this.nodes_.forEach(function (node) {
var registrations = registrationsTable.get(node);
for (var i = 0; i < registrations.length; i++) {
var registration = registrations[i];
if (registration.observer === this) {
registration.removeListeners();
registrations.splice(i, 1);
break;
}
}
}, this);
this.records_ = [];
},
takeRecords: function takeRecords() {
var copyOfRecords = this.records_;
this.records_ = [];
return copyOfRecords;
}
};
function MutationRecord(type, target) {
this.type = type;
this.target = target;
this.addedNodes = [];
this.removedNodes = [];
this.previousSibling = null;
this.nextSibling = null;
this.attributeName = null;
this.attributeNamespace = null;
this.oldValue = null;
}
function copyMutationRecord(original) {
var record = new MutationRecord(original.type, original.target);
record.addedNodes = original.addedNodes.slice();
record.removedNodes = original.removedNodes.slice();
record.previousSibling = original.previousSibling;
record.nextSibling = original.nextSibling;
record.attributeName = original.attributeName;
record.attributeNamespace = original.attributeNamespace;
record.oldValue = original.oldValue;
return record;
}
var currentRecord, recordWithOldValue;
function getRecord(type, target) {
return currentRecord = new MutationRecord(type, target);
}
function getRecordWithOldValue(oldValue) {
if (recordWithOldValue) {
return recordWithOldValue;
}recordWithOldValue = copyMutationRecord(currentRecord);
recordWithOldValue.oldValue = oldValue;
return recordWithOldValue;
}
function clearRecords() {
currentRecord = recordWithOldValue = undefined;
}
function recordRepresentsCurrentMutation(record) {
return record === recordWithOldValue || record === currentRecord;
}
function selectRecord(lastRecord, newRecord) {
if (lastRecord === newRecord) {
return lastRecord;
}if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) {
return recordWithOldValue;
}return null;
}
function Registration(observer, target, options) {
this.observer = observer;
this.target = target;
this.options = options;
this.transientObservedNodes = [];
}
Registration.prototype = {
enqueue: function enqueue(record) {
var records = this.observer.records_;
var length = records.length;
if (records.length > 0) {
var lastRecord = records[length - 1];
var recordToReplaceLast = selectRecord(lastRecord, record);
if (recordToReplaceLast) {
records[length - 1] = recordToReplaceLast;
return;
}
} else {
scheduleCallback(this.observer);
}
records[length] = record;
},
addListeners: function addListeners() {
this.addListeners_(this.target);
},
addListeners_: function addListeners_(node) {
var options = this.options;
if (options.attributes) node.addEventListener("DOMAttrModified", this, true);
if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true);
if (options.childList) node.addEventListener("DOMNodeInserted", this, true);
if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true);
},
removeListeners: function removeListeners() {
this.removeListeners_(this.target);
},
removeListeners_: function removeListeners_(node) {
var options = this.options;
if (options.attributes) node.removeEventListener("DOMAttrModified", this, true);
if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true);
if (options.childList) node.removeEventListener("DOMNodeInserted", this, true);
if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true);
},
addTransientObserver: function addTransientObserver(node) {
if (node === this.target) {
return;
}this.addListeners_(node);
this.transientObservedNodes.push(node);
var registrations = registrationsTable.get(node);
if (!registrations) registrationsTable.set(node, registrations = []);
registrations.push(this);
},
removeTransientObservers: function removeTransientObservers() {
var transientObservedNodes = this.transientObservedNodes;
this.transientObservedNodes = [];
transientObservedNodes.forEach(function (node) {
this.removeListeners_(node);
var registrations = registrationsTable.get(node);
for (var i = 0; i < registrations.length; i++) {
if (registrations[i] === this) {
registrations.splice(i, 1);
break;
}
}
}, this);
},
handleEvent: function handleEvent(e) {
e.stopImmediatePropagation();
switch (e.type) {
case "DOMAttrModified":
var name = e.attrName;
var namespace = e.relatedNode.namespaceURI;
var target = e.target;
var record = new getRecord("attributes", target);
record.attributeName = name;
record.attributeNamespace = namespace;
var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue;
forEachAncestorAndObserverEnqueueRecord(target, function (options) {
if (!options.attributes) return;
if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) {
return;
}
if (options.attributeOldValue) return getRecordWithOldValue(oldValue);
return record;
});
break;
case "DOMCharacterDataModified":
var target = e.target;
var record = getRecord("characterData", target);
var oldValue = e.prevValue;
forEachAncestorAndObserverEnqueueRecord(target, function (options) {
if (!options.characterData) return;
if (options.characterDataOldValue) return getRecordWithOldValue(oldValue);
return record;
});
break;
case "DOMNodeRemoved":
this.addTransientObserver(e.target);
case "DOMNodeInserted":
var changedNode = e.target;
var addedNodes, removedNodes;
if (e.type === "DOMNodeInserted") {
addedNodes = [changedNode];
removedNodes = [];
} else {
addedNodes = [];
removedNodes = [changedNode];
}
var previousSibling = changedNode.previousSibling;
var nextSibling = changedNode.nextSibling;
var record = getRecord("childList", e.target.parentNode);
record.addedNodes = addedNodes;
record.removedNodes = removedNodes;
record.previousSibling = previousSibling;
record.nextSibling = nextSibling;
forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function (options) {
if (!options.childList) return;
return record;
});
}
clearRecords();
}
};
global.JsMutationObserver = JsMutationObserver;
if (!global.MutationObserver) {
global.MutationObserver = JsMutationObserver;
JsMutationObserver._isPolyfilled = true;
}
})(self);
})(window); // Atlassian: added IIFE
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/utils.js
(typeof window === 'undefined' ? global : window).__7f347f6f27cac2a3885c2c080932f1fa = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__7f347f6f27cac2a3885c2c080932f1fa");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./constants"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, __6b9879a02da8be3c05e35c60e8a645ab);
}
})(function (exports, _constants) {
/**
* Checks {}.hasOwnProperty in a safe way.
*
* @param {Object} obj The object the property is on.
* @param {String} key The object key to check.
*
* @returns {Boolean}
*/
exports.hasOwn = hasOwn;
/**
* Camel-cases the specified string.
*
* @param {String} str The string to camel-case.
*
* @returns {String}
*/
exports.camelCase = camelCase;
/**
* Returns whether or not the source element contains the target element.
* This is for browsers that don't support Element.prototype.contains on an
* HTMLUnknownElement.
*
* @param {HTMLElement} source The source element.
* @param {HTMLElement} target The target element.
*
* @returns {Boolean}
*/
exports.elementContains = elementContains;
/**
* Returns a function that will prevent more than one call in a single clock
* tick.
*
* @param {Function} fn The function to call.
*
* @returns {Function}
*/
exports.debounce = debounce;
/**
* Returns whether or not the specified element has been selectively ignored.
*
* @param {Element} element The element to check and traverse up from.
*
* @returns {Boolean}
*/
exports.getClosestIgnoredElement = getClosestIgnoredElement;
/**
* Merges the second argument into the first.
*
* @param {Object} child The object to merge into.
* @param {Object} parent The object to merge from.
* @param {Boolean} overwrite Whether or not to overwrite properties on the child.
*
* @returns {Object} Returns the child object.
*/
exports.inherit = inherit;
/**
* Traverses an object checking hasOwnProperty.
*
* @param {Object} obj The object to traverse.
* @param {Function} fn The function to call for each item in the object.
*
* @returns {undefined}
*/
exports.objEach = objEach;
exports.supportsNativeCustomElements = supportsNativeCustomElements;
exports.isValidNativeCustomElementName = isValidNativeCustomElementName;
Object.defineProperty(exports, "__esModule", {
value: true
});
var ATTR_IGNORE = _constants.ATTR_IGNORE;
var elementPrototype = window.HTMLElement.prototype;
exports.elementPrototype = elementPrototype;
var elementPrototypeContains = elementPrototype.contains;
function hasOwn(obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key);
}
function camelCase(str) {
return str.split(/-/g).map(function (str, index) {
return index === 0 ? str : str[0].toUpperCase() + str.substring(1);
}).join("");
}
function elementContains(source, target) {
// The document element does not have the contains method in IE.
if (source === document && !source.contains) {
return document.head.contains(target) || document.body.contains(target);
}
return source.contains ? source.contains(target) : elementPrototypeContains.call(source, target);
}
function debounce(fn) {
var called = false;
return function () {
if (!called) {
called = true;
setTimeout(function () {
called = false;
fn();
}, 1);
}
};
}
function getClosestIgnoredElement(element) {
var parent = element;
// e.g. document doesn't have a function hasAttribute; no need to go further up
while (parent instanceof Element) {
if (parent.hasAttribute(ATTR_IGNORE)) {
return parent;
}
parent = parent.parentNode;
}
}
function inherit(child, parent, overwrite) {
var names = Object.getOwnPropertyNames(parent);
var namesLen = names.length;
for (var a = 0; a < namesLen; a++) {
var name = names[a];
if (overwrite || child[name] === undefined) {
var desc = Object.getOwnPropertyDescriptor(parent, name);
var shouldDefineProps = desc.get || desc.set || !desc.writable || !desc.enumerable || !desc.configurable;
if (shouldDefineProps) {
Object.defineProperty(child, name, desc);
} else {
child[name] = parent[name];
}
}
}
return child;
}
function objEach(obj, fn) {
for (var a in obj) {
if (hasOwn(obj, a)) {
fn(obj[a], a);
}
}
}
function supportsNativeCustomElements() {
return typeof document.registerElement === "function";
}
function isValidNativeCustomElementName(name) {
return name.indexOf("-") > 0;
}
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/registry.js
(typeof window === 'undefined' ? global : window).__bf3b6f9c958741a1b07e53d43064c350 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab,
"./globals": __7b4640c228135ab2adcbde5a06412f18,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab,
"./globals": __7b4640c228135ab2adcbde5a06412f18,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__bf3b6f9c958741a1b07e53d43064c350");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module", "./constants", "./globals", "./utils"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, __6b9879a02da8be3c05e35c60e8a645ab, __7b4640c228135ab2adcbde5a06412f18, __7f347f6f27cac2a3885c2c080932f1fa);
}
})(function (exports, module, _constants, _globals, _utils) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var TYPE_ATTRIBUTE = _constants.TYPE_ATTRIBUTE;
var TYPE_CLASSNAME = _constants.TYPE_CLASSNAME;
var TYPE_ELEMENT = _constants.TYPE_ELEMENT;
var globals = _interopRequire(_globals);
var hasOwn = _utils.hasOwn;
var isValidNativeCustomElementName = _utils.isValidNativeCustomElementName;
var supportsNativeCustomElements = _utils.supportsNativeCustomElements;
/**
* Returns the class list for the specified element.
*
* @param {Element} element The element to get the class list for.
*
* @returns {ClassList | Array}
*/
function getClassList(element) {
var classList = element.classList;
if (classList) {
return classList;
}
var attrs = element.attributes;
return attrs["class"] && attrs["class"].nodeValue.split(/\s+/) || [];
}
module.exports = {
clear: function clear() {
globals.registry = {};
return this;
},
get: function get(id) {
return hasOwn(globals.registry, id) && globals.registry[id];
},
getForElement: function getForElement(element) {
var attrs = element.attributes;
var attrsLen = attrs.length;
var definitions = [];
var isAttr = attrs.is;
var isAttrValue = isAttr && (isAttr.value || isAttr.nodeValue);
// Using localName as fallback for edge cases when processing <object> tag that is used
// as inteface to NPAPI plugin.
var tag = (element.tagName || element.localName).toLowerCase();
var isAttrOrTag = isAttrValue || tag;
var definition;
var tagToExtend;
if (this.isType(isAttrOrTag, TYPE_ELEMENT)) {
definition = globals.registry[isAttrOrTag];
tagToExtend = definition["extends"];
if (isAttrValue) {
if (tag === tagToExtend) {
definitions.push(definition);
}
} else if (!tagToExtend) {
definitions.push(definition);
}
}
for (var a = 0; a < attrsLen; a++) {
var attr = attrs[a].nodeName;
if (this.isType(attr, TYPE_ATTRIBUTE)) {
definition = globals.registry[attr];
tagToExtend = definition["extends"];
if (!tagToExtend || tag === tagToExtend) {
definitions.push(definition);
}
}
}
var classList = getClassList(element);
var classListLen = classList.length;
for (var b = 0; b < classListLen; b++) {
var className = classList[b];
if (this.isType(className, TYPE_CLASSNAME)) {
definition = globals.registry[className];
tagToExtend = definition["extends"];
if (!tagToExtend || tag === tagToExtend) {
definitions.push(definition);
}
}
}
return definitions;
},
isType: function isType(id, type) {
var def = this.get(id);
return def && def.type === type;
},
isNativeCustomElement: function isNativeCustomElement(id) {
return supportsNativeCustomElements() && this.isType(id, TYPE_ELEMENT) && isValidNativeCustomElementName(id);
},
set: function set(id, definition) {
if (hasOwn(globals.registry, id)) {
throw new Error("A component definition of type \"" + definition.type + "\" with the ID of \"" + id + "\" already exists.");
}
globals.registry[id] = definition;
return this;
}
};
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/lifecycle.js
(typeof window === 'undefined' ? global : window).__9295a2c4e161bb3414dde49af59ef97e = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab,
"./data": __1d50ca421cb8df953fc4063be155d6de,
"./mutation-observer": __a59f13890c9a74b6fb0fe38002898f01,
"./registry": __bf3b6f9c958741a1b07e53d43064c350,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab,
"./data": __1d50ca421cb8df953fc4063be155d6de,
"./mutation-observer": __a59f13890c9a74b6fb0fe38002898f01,
"./registry": __bf3b6f9c958741a1b07e53d43064c350,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__9295a2c4e161bb3414dde49af59ef97e");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "./constants", "./data", "./mutation-observer", "./registry", "./utils"], factory);
} else if (typeof exports !== "undefined") {
factory(exports, __6b9879a02da8be3c05e35c60e8a645ab, __1d50ca421cb8df953fc4063be155d6de, __a59f13890c9a74b6fb0fe38002898f01, __bf3b6f9c958741a1b07e53d43064c350, __7f347f6f27cac2a3885c2c080932f1fa);
}
})(function (exports, _constants, _data, _mutationObserver, _registry, _utils) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
Object.defineProperty(exports, "__esModule", {
value: true
});
var ATTR_IGNORE = _constants.ATTR_IGNORE;
var data = _interopRequire(_data);
var registry = _interopRequire(_registry);
var camelCase = _utils.camelCase;
var elementContains = _utils.elementContains;
var hasOwn = _utils.hasOwn;
var inherit = _utils.inherit;
var objEach = _utils.objEach;
var Node = window.Node;
//jshint ignore:line
var elProto = window.HTMLElement.prototype;
var nativeMatchesSelector = elProto.matches || elProto.msMatchesSelector || elProto.webkitMatchesSelector || elProto.mozMatchesSelector || elProto.oMatchesSelector;
// Only IE9 has this msMatchesSelector bug, but best to detect it.
var hasNativeMatchesSelectorDetattachedBug = !nativeMatchesSelector.call(document.createElement("div"), "div");
var matchesSelector = function matchesSelector(element, selector) {
if (hasNativeMatchesSelectorDetattachedBug) {
var clone = element.cloneNode();
document.createElement("div").appendChild(clone);
return nativeMatchesSelector.call(clone, selector);
}
return nativeMatchesSelector.call(element, selector);
};
/**
* Parses an event definition and returns information about it.
*
* @param {String} e The event to parse.
*
* @returns {Object]}
*/
function parseEvent(e) {
var parts = e.split(" ");
return {
name: parts.shift(),
delegate: parts.join(" ")
};
}
/**
* Sets the defined attributes to their default values, if specified.
*
* @param {Element} target The web component element.
* @param {Object} component The web component definition.
*
* @returns {undefined}
*/
function initAttributes(target, component) {
var componentAttributes = component.attributes;
if (typeof componentAttributes !== "object") {
return;
}
for (var attribute in componentAttributes) {
if (hasOwn(componentAttributes, attribute) && hasOwn(componentAttributes[attribute], "value") && !target.hasAttribute(attribute)) {
var value = componentAttributes[attribute].value;
value = typeof value === "function" ? value(target) : value;
target.setAttribute(attribute, value);
}
}
}
/**
* Defines a property that proxies the specified attribute.
*
* @param {Element} target The web component element.
* @param {String} attribute The attribute name to proxy.
*
* @returns {undefined}
*/
function defineAttributeProperty(target, attribute, property) {
Object.defineProperty(target, property, {
get: function get() {
return this.getAttribute(attribute);
},
set: function set(value) {
if (value === undefined) {
this.removeAttribute(attribute);
} else {
this.setAttribute(attribute, value);
}
}
});
}
/**
* Adds links from attributes to properties.
*
* @param {Element} target The web component element.
* @param {Object} component The web component definition.
*
* @returns {undefined}
*/
function addAttributeToPropertyLinks(target, component) {
var componentAttributes = component.attributes;
if (typeof componentAttributes !== "object") {
return;
}
for (var attribute in componentAttributes) {
var property = camelCase(attribute);
if (hasOwn(componentAttributes, attribute) && !hasOwn(target, property)) {
defineAttributeProperty(target, attribute, property);
}
}
}
function triggerAttributeChanged(target, component, data) {
var callback;
var type;
var name = data.name;
var newValue = data.newValue;
var oldValue = data.oldValue;
var newValueIsString = typeof newValue === "string";
var oldValueIsString = typeof oldValue === "string";
var attrs = component.attributes;
var specific = attrs && attrs[name];
if (!oldValueIsString && newValueIsString) {
type = "created";
} else if (oldValueIsString && newValueIsString) {
type = "updated";
} else if (oldValueIsString && !newValueIsString) {
type = "removed";
}
if (specific && typeof specific[type] === "function") {
callback = specific[type];
} else if (specific && typeof specific.fallback === "function") {
callback = specific.fallback;
} else if (typeof specific === "function") {
callback = specific;
} else if (typeof attrs === "function") {
callback = attrs;
}
// Ensure values are null if undefined.
newValue = newValue === undefined ? null : newValue;
oldValue = oldValue === undefined ? null : oldValue;
// There may still not be a callback.
if (callback) {
callback(target, {
type: type,
name: name,
newValue: newValue,
oldValue: oldValue
});
}
}
function triggerAttributesCreated(target, component) {
var a;
var attrs = target.attributes;
var attrsCopy = [];
var attrsLen = attrs.length;
for (a = 0; a < attrsLen; a++) {
attrsCopy.push(attrs[a]);
}
// In default web components, attribute changes aren't triggered for
// attributes that already exist on an element when it is bound. This sucks
// when you want to reuse and separate code for attributes away from your
// lifecycle callbacks. Skate will initialise each attribute by calling the
// created callback for the attributes that already exist on the element.
for (a = 0; a < attrsLen; a++) {
var attr = attrsCopy[a];
triggerAttributeChanged(target, component, {
name: attr.nodeName,
newValue: attr.value || attr.nodeValue
});
}
}
function addAttributeListeners(target, component) {
var attrs = target.attributes;
if (!component.attributes || registry.isNativeCustomElement(component.id)) {
return;
}
var observer = new window.MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
var name = mutation.attributeName;
var attr = attrs[name];
triggerAttributeChanged(target, component, {
name: name,
newValue: attr && (attr.value || attr.nodeValue),
oldValue: mutation.oldValue
});
});
});
observer.observe(target, {
attributes: true,
attributeOldValue: true
});
}
/**
* Binds event listeners for the specified event handlers.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function addEventListeners(target, component) {
if (typeof component.events !== "object") {
return;
}
function makeHandler(handler, delegate) {
return function (e) {
// If we're not delegating, trigger directly on the component element.
if (!delegate) {
return handler(target, e, target);
}
// If we're delegating, but the target doesn't match, then we've have
// to go up the tree until we find a matching ancestor or stop at the
// component element, or document. If a matching ancestor is found, the
// handler is triggered on it.
var current = e.target;
while (current && current !== document && current !== target.parentNode) {
if (matchesSelector(current, delegate)) {
return handler(target, e, current);
}
current = current.parentNode;
}
};
}
objEach(component.events, function (handler, name) {
var evt = parseEvent(name);
var useCapture = !!evt.delegate && (evt.name === "blur" || evt.name === "focus");
target.addEventListener(evt.name, makeHandler(handler, evt.delegate), useCapture);
});
}
/**
* Triggers the created lifecycle callback.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerCreated(target, component) {
var targetData = data(target, component.id);
if (targetData.created) {
return;
}
targetData.created = true;
// TODO: This doesn't need to happen if using native.
inherit(target, component.prototype, true);
// We use the unresolved / resolved attributes to flag whether or not the
// element has been templated or not.
if (component.template && !target.hasAttribute(component.resolvedAttribute)) {
component.template(target);
}
target.removeAttribute(component.unresolvedAttribute);
target.setAttribute(component.resolvedAttribute, "");
addEventListeners(target, component);
addAttributeListeners(target, component);
addAttributeToPropertyLinks(target, component);
initAttributes(target, component);
triggerAttributesCreated(target, component);
if (component.created) {
component.created(target);
}
}
/**
* Triggers the attached lifecycle callback.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerAttached(target, component) {
var targetData = data(target, component.id);
if (targetData.attached) {
return;
}
if (!elementContains(document, target)) {
return;
}
targetData.attached = true;
if (component.attached) {
component.attached(target);
}
targetData.detached = false;
}
/**
* Triggers the detached lifecycle callback.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerDetached(target, component) {
var targetData = data(target, component.id);
if (targetData.detached) {
return;
}
targetData.detached = true;
if (component.detached) {
component.detached(target);
}
targetData.attached = false;
}
/**
* Triggers the entire element lifecycle if it's not being ignored.
*
* @param {Element} target The component element.
* @param {Object} component The component data.
*
* @returns {undefined}
*/
function triggerLifecycle(target, component) {
triggerCreated(target, component);
triggerAttached(target, component);
}
/**
* Initialises a set of elements.
*
* @param {DOMNodeList | Array} elements A traversable set of elements.
*
* @returns {undefined}
*/
function initElements(elements) {
// [CATION] Don't cache elements length! Components initialization could append nodes
// as siblings (see label's element behaviour for example) and this could lead to problems with
// components placed at the end of processing childNodes because they will change they index
// position and get out of cached value range.
for (var a = 0; a < elements.length; a++) {
var element = elements[a];
if (element.nodeType !== Node.ELEMENT_NODE || element.attributes[ATTR_IGNORE]) {
continue;
}
var currentNodeDefinitions = registry.getForElement(element);
var currentNodeDefinitionsLength = currentNodeDefinitions.length;
for (var b = 0; b < currentNodeDefinitionsLength; b++) {
triggerLifecycle(element, currentNodeDefinitions[b]);
}
// When <object> tag is used to expose NPAPI api to js may have different behaviour then other
// tags. One of those differences is that it's childNodes can be undefined.
var elementChildNodes = element.childNodes || [];
var elementChildNodesLen = elementChildNodes.length;
if (elementChildNodesLen) {
initElements(elementChildNodes);
}
}
}
/**
* Triggers the remove lifecycle callback on all of the elements.
*
* @param {DOMNodeList} elements The elements to trigger the remove lifecycle
* callback on.
*
* @returns {undefined}
*/
function removeElements(elements) {
// Don't cache `childNodes` length. For more info see description in `initElements` function.
for (var a = 0; a < elements.length; a++) {
var element = elements[a];
if (element.nodeType !== Node.ELEMENT_NODE) {
continue;
}
removeElements(element.childNodes);
var definitions = registry.getForElement(element);
var definitionsLen = definitions.length;
for (var b = 0; b < definitionsLen; b++) {
triggerDetached(element, definitions[b]);
}
}
}
exports.initElements = initElements;
exports.removeElements = removeElements;
exports.triggerAttached = triggerAttached;
exports.triggerAttributeChanged = triggerAttributeChanged;
exports.triggerCreated = triggerCreated;
exports.triggerDetached = triggerDetached;
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/fix-ie-innerhtml.js
(typeof window === 'undefined' ? global : window).__dd184e4e062a5fc2581d521bbfe4a01a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__dd184e4e062a5fc2581d521bbfe4a01a");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports"], factory);
} else if (typeof exports !== "undefined") {
factory(exports);
}
})(function (exports) {
var isIeUntil10 = /MSIE/.test(navigator.userAgent);
var isIe11 = /Trident/.test(navigator.userAgent);
var isIe = isIeUntil10 || isIe11;
var elementPrototype = window.HTMLElement.prototype;
// ! This walkTree method differs from the implementation in ../../utils/walk-tree
// It invokes the callback only for the children, not the passed node and the second parameter to the callback is the parent node
function walkTree(node, cb) {
var childNodes = node.childNodes;
if (!childNodes) {
return;
}
var childNodesLen = childNodes.length;
for (var a = 0; a < childNodesLen; a++) {
var childNode = childNodes[a];
cb(childNode, node);
walkTree(childNode, cb);
}
}
function fixInnerHTML() {
var originalInnerHTML = Object.getOwnPropertyDescriptor(elementPrototype, "innerHTML");
var get = function get() {
return originalInnerHTML.get.call(this);
};
get._hasBeenEnhanced = true;
// This redefines the innerHTML property so that we can ensure that events
// are properly triggered.
Object.defineProperty(elementPrototype, "innerHTML", {
get: get,
set: function set(html) {
walkTree(this, function (node, parentNode) {
var mutationEvent = document.createEvent("MutationEvent");
mutationEvent.initMutationEvent("DOMNodeRemoved", true, false, parentNode, null, null, null, null);
node.dispatchEvent(mutationEvent);
});
originalInnerHTML.set.call(this, html);
}
});
}
if (isIe) {
// IE 9-11
var propertyDescriptor = Object.getOwnPropertyDescriptor(elementPrototype, "innerHTML");
var hasBeenEnhanced = !!propertyDescriptor && propertyDescriptor.get._hasBeenEnhanced;
if (!hasBeenEnhanced) {
if (isIe11) {
// IE11's native MutationObserver needs some help as well :()
window.MutationObserver = window.JsMutationObserver || window.MutationObserver;
}
fixInnerHTML();
}
}
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/document-observer.js
(typeof window === 'undefined' ? global : window).__420360d4859bf7cd4e1a944e3f6c2fa9 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./globals": __7b4640c228135ab2adcbde5a06412f18,
"./lifecycle": __9295a2c4e161bb3414dde49af59ef97e,
"./mutation-observer": __a59f13890c9a74b6fb0fe38002898f01,
"./fix-ie-innerhtml": __dd184e4e062a5fc2581d521bbfe4a01a,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa,
"./globals": __7b4640c228135ab2adcbde5a06412f18,
"./lifecycle": __9295a2c4e161bb3414dde49af59ef97e,
"./mutation-observer": __a59f13890c9a74b6fb0fe38002898f01,
"./fix-ie-innerhtml": __dd184e4e062a5fc2581d521bbfe4a01a,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__420360d4859bf7cd4e1a944e3f6c2fa9");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module", "./globals", "./lifecycle", "./mutation-observer", "./fix-ie-innerhtml", "./utils"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, __7b4640c228135ab2adcbde5a06412f18, __9295a2c4e161bb3414dde49af59ef97e, __a59f13890c9a74b6fb0fe38002898f01, __dd184e4e062a5fc2581d521bbfe4a01a, __7f347f6f27cac2a3885c2c080932f1fa);
}
})(function (exports, module, _globals, _lifecycle, _mutationObserver, _fixIeInnerhtml, _utils) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var globals = _interopRequire(_globals);
var initElements = _lifecycle.initElements;
var removeElements = _lifecycle.removeElements;
var getClosestIgnoredElement = _utils.getClosestIgnoredElement;
/**
* The document observer handler.
*
* @param {Array} mutations The mutations to handle.
*
* @returns {undefined}
*/
function documentObserverHandler(mutations) {
var mutationsLen = mutations.length;
for (var a = 0; a < mutationsLen; a++) {
var mutation = mutations[a];
var addedNodes = mutation.addedNodes;
var removedNodes = mutation.removedNodes;
// Since siblings are batched together, we check the first node's parent
// node to see if it is ignored. If it is then we don't process any added
// nodes. This prevents having to check every node.
if (addedNodes && addedNodes.length && !getClosestIgnoredElement(addedNodes[0].parentNode)) {
initElements(addedNodes);
}
// We can't check batched nodes here because they won't have a parent node.
if (removedNodes && removedNodes.length) {
removeElements(removedNodes);
}
}
}
/**
* Creates a new mutation observer for listening to Skate definitions for the
* document.
*
* @param {Element} root The element to observe.
*
* @returns {MutationObserver}
*/
function createDocumentObserver() {
var observer = new window.MutationObserver(documentObserverHandler);
// Observe after the DOM content has loaded.
observer.observe(document, {
childList: true,
subtree: true
});
return observer;
}
module.exports = {
register: function register(fixIe) {
// IE has issues with reporting removedNodes correctly. See the polyfill for
// details. If we fix IE, we must also re-define the document observer.
if (fixIe) {
this.unregister();
}
if (!globals.observer) {
globals.observer = createDocumentObserver();
}
return this;
},
unregister: function unregister() {
if (globals.observer) {
globals.observer.disconnect();
globals.observer = undefined;
}
return this;
}
};
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/version.js
(typeof window === 'undefined' ? global : window).__3f90008e644b3179f2c6d176c4adf766 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__3f90008e644b3179f2c6d176c4adf766");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module);
}
})(function (exports, module) {
module.exports = "0.13.15";
});
return module.exports;
}).call(this);
// node_modules/skatejs/lib/skate.js
(typeof window === 'undefined' ? global : window).__318f2d4d77bb29239bfe0075c29cd04b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab,
"./document-observer": __420360d4859bf7cd4e1a944e3f6c2fa9,
"./lifecycle": __9295a2c4e161bb3414dde49af59ef97e,
"./registry": __bf3b6f9c958741a1b07e53d43064c350,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa,
"./version": __3f90008e644b3179f2c6d176c4adf766,
"./constants": __6b9879a02da8be3c05e35c60e8a645ab,
"./document-observer": __420360d4859bf7cd4e1a944e3f6c2fa9,
"./lifecycle": __9295a2c4e161bb3414dde49af59ef97e,
"./registry": __bf3b6f9c958741a1b07e53d43064c350,
"./utils": __7f347f6f27cac2a3885c2c080932f1fa,
"./version": __3f90008e644b3179f2c6d176c4adf766
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__318f2d4d77bb29239bfe0075c29cd04b");
define.amd = true;
(function (factory) {
if (typeof define === "function" && define.amd) {
define(["exports", "module", "./constants", "./document-observer", "./lifecycle", "./registry", "./utils", "./version"], factory);
} else if (typeof exports !== "undefined" && typeof module !== "undefined") {
factory(exports, module, __6b9879a02da8be3c05e35c60e8a645ab, __420360d4859bf7cd4e1a944e3f6c2fa9, __9295a2c4e161bb3414dde49af59ef97e, __bf3b6f9c958741a1b07e53d43064c350, __7f347f6f27cac2a3885c2c080932f1fa, __3f90008e644b3179f2c6d176c4adf766);
}
})(function (exports, module, _constants, _documentObserver, _lifecycle, _registry, _utils, _version) {
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
var TYPE_ATTRIBUTE = _constants.TYPE_ATTRIBUTE;
var TYPE_CLASSNAME = _constants.TYPE_CLASSNAME;
var TYPE_ELEMENT = _constants.TYPE_ELEMENT;
var documentObserver = _interopRequire(_documentObserver);
var triggerCreated = _lifecycle.triggerCreated;
var triggerAttached = _lifecycle.triggerAttached;
var triggerDetached = _lifecycle.triggerDetached;
var triggerAttributeChanged = _lifecycle.triggerAttributeChanged;
var initElements = _lifecycle.initElements;
var registry = _interopRequire(_registry);
var debounce = _utils.debounce;
var inherit = _utils.inherit;
var version = _interopRequire(_version);
var HTMLElement = window.HTMLElement; //jshint ignore:line
// IE <= 10 can fire "interactive" too early (#243).
var isOldIE = !!document.attachEvent; // attachEvent was removed in IE11.
function isReady() {
if (isOldIE) {
return document.readyState === "complete";
} else {
return document.readyState === "interactive" || document.readyState === "complete";
}
}
/**
* Initialises all valid elements in the document. Ensures that it does not
* happen more than once in the same execution, and that it happens after the DOM is ready.
*
* @returns {undefined}
*/
var initDocument = debounce(function () {
var initialiseSkateElementsOnDomLoad = function initialiseSkateElementsOnDomLoad() {
initElements(document.documentElement.childNodes);
};
if (isReady()) {
initialiseSkateElementsOnDomLoad();
} else {
if (isOldIE) {
window.addEventListener("load", initialiseSkateElementsOnDomLoad);
} else {
document.addEventListener("DOMContentLoaded", initialiseSkateElementsOnDomLoad);
}
}
});
/**
* Creates a constructor for the specified definition.
*
* @param {Object} definition The definition information to use for generating the constructor.
*
* @returns {Function} The element constructor.
*/
function makeElementConstructor(definition) {
function CustomElement() {
var element;
var tagToExtend = definition["extends"];
var definitionId = definition.id;
if (tagToExtend) {
element = document.createElement(tagToExtend);
element.setAttribute("is", definitionId);
} else {
element = document.createElement(definitionId);
}
// Ensure the definition prototype is up to date with the element's
// prototype. This ensures that overwriting the element prototype still
// works.
definition.prototype = CustomElement.prototype;
// If they use the constructor we don't have to wait until it's attached.
triggerCreated(element, definition);
return element;
}
// This allows modifications to the element prototype propagate to the
// definition prototype.
CustomElement.prototype = definition.prototype;
return CustomElement;
}
// Public API
// ----------
/**
* Creates a listener for the specified definition.
*
* @param {String} id The ID of the definition.
* @param {Object | Function} definition The definition definition.
*
* @returns {Function} Constructor that returns a custom element.
*/
function skate(id, definition) {
// Just in case the definition is shared, we duplicate it so that internal
// modifications to the original aren't shared.
definition = inherit({}, definition);
definition = inherit(definition, skate.defaults);
definition.id = id;
registry.set(id, definition);
if (registry.isNativeCustomElement(id)) {
var elementPrototype = definition["extends"] ? document.createElement(definition["extends"]).constructor.prototype : HTMLElement.prototype;
if (!elementPrototype.isPrototypeOf(definition.prototype)) {
definition.prototype = inherit(Object.create(elementPrototype), definition.prototype, true);
}
var options = {
prototype: inherit(definition.prototype, {
createdCallback: function createdCallback() {
triggerCreated(this, definition);
},
attachedCallback: function attachedCallback() {
triggerAttached(this, definition);
},
detachedCallback: function detachedCallback() {
triggerDetached(this, definition);
},
attributeChangedCallback: function attributeChangedCallback(name, oldValue, newValue) {
triggerAttributeChanged(this, definition, {
name: name,
oldValue: oldValue,
newValue: newValue
});
}
})
};
if (definition["extends"]) {
options["extends"] = definition["extends"];
}
return document.registerElement(id, options);
}
initDocument();
documentObserver.register(!!definition.detached);
if (registry.isType(id, TYPE_ELEMENT)) {
return makeElementConstructor(definition);
}
}
/**
* Synchronously initialises the specified element or elements and descendants.
*
* @param {Mixed} nodes The node, or nodes to initialise. Can be anything:
* jQuery, DOMNodeList, DOMNode, selector etc.
*
* @returns {skate}
*/
skate.init = function (nodes) {
var nodesToUse = nodes;
if (!nodes) {
return nodes;
}
if (typeof nodes === "string") {
nodesToUse = nodes = document.querySelectorAll(nodes);
} else if (nodes instanceof HTMLElement) {
nodesToUse = [nodes];
}
initElements(nodesToUse);
return nodes;
};
// Restriction type constants.
skate.type = {
ATTRIBUTE: TYPE_ATTRIBUTE,
CLASSNAME: TYPE_CLASSNAME,
ELEMENT: TYPE_ELEMENT
};
// Makes checking the version easy when debugging.
skate.version = version;
/**
* The default options for a definition.
*
* @var {Object}
*/
skate.defaults = {
// Attribute lifecycle callback or callbacks.
attributes: undefined,
// The events to manage the binding and unbinding of during the definition's
// lifecycle.
events: undefined,
// Restricts a particular definition to binding explicitly to an element with
// a tag name that matches the specified value.
"extends": undefined,
// The ID of the definition. This is automatically set in the `skate()`
// function.
id: "",
// Properties and methods to add to each element.
prototype: {},
// The attribute name to add after calling the created() callback.
resolvedAttribute: "resolved",
// The template to replace the content of the element with.
template: undefined,
// The type of bindings to allow.
type: TYPE_ELEMENT,
// The attribute name to remove after calling the created() callback.
unresolvedAttribute: "unresolved"
};
// Exporting
// ---------
var previousSkate = window.skate;
skate.noConflict = function () {
window.skate = previousSkate;
return skate;
};
// Global
window.skate = skate;
// ES6
module.exports = skate;
});
return module.exports;
}).call(this);
// src/js/aui/internal/skate.js
(typeof window === 'undefined' ? global : window).__49ca30b6a02e1b6245e9234f1d2b19e4 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _skatejs = __318f2d4d77bb29239bfe0075c29cd04b;
var _skatejs2 = _interopRequireDefault(_skatejs);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var auiSkate = _skatejs2.default.noConflict();
exports.default = auiSkate;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/animation.js
(typeof window === 'undefined' ? global : window).__807874eed859505f99b772f26b5c11af = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
/**
* Force a re-compute of the style of an element.
*
* This is useful for CSS transitions and animations that need computed style changes to occur.
* CSS transitions will fire when the computed value of the property they are transitioning changes.
* This may not occur if the style changes get batched into one style change event by the browser.
* We can force the browser to recognise the two different computed values by calling this function when we want it
* to recompute the styles.
*
* For example, consider a transition on the opacity property.
*
* With recomputeStyle:
* $parent.append($el); //opacity=0
* recomputeStyle($el);
* $el.addClass('visible'); //opacity=1
* //Browser calculates value of opacity=0, and then transitions it to opacity=1
*
* Without recomputeStyle:
* $parent.append($el); //opacity=0
* $el.addClass('visible'); //opacity=1
* //Browser calculates value of opacity=1 but no transition
*
* @param el The DOM or jQuery element for which style should be recomputed
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
function recomputeStyle(el) {
el = el.length ? el[0] : el;
window.getComputedStyle(el, null).getPropertyValue('left');
}
exports.recomputeStyle = recomputeStyle;
return module.exports;
}).call(this);
// src/js/aui/escape-html.js
(typeof window === 'undefined' ? global : window).__2ea6ac671d29eba35499f28fb99d3e5b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function escapeHtml(str) {
return str.replace(/[&"'<>`]/g, function (str) {
var special = {
'<': '<',
'>': '>',
'&': '&',
'\'': ''',
'`': '`'
};
if (typeof special[str] === 'string') {
return special[str];
}
return '"';
});
}
(0, _globalize2.default)('escapeHtml', escapeHtml);
exports.default = escapeHtml;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/template.js
(typeof window === 'undefined' ? global : window).__728ac06ea1d5ca4ecbb34a7c4f64b723 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _escapeHtml = __2ea6ac671d29eba35499f28fb99d3e5b;
var _escapeHtml2 = _interopRequireDefault(_escapeHtml);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates an object with methods for template support.
*
* See <a href="http://confluence.atlassian.com/display/AUI/AJS.template">CAC Documentation</a>.
*
* @constructor
* @class template
* @namespace AJS
*/
var template = function ($) {
var tokenRegex = /\{([^\}]+)\}/g; // matches "{xxxxx}"
var objNotationRegex = /(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g; // matches ".xxxxx" or "["xxxxx"]" to run over object properties
// internal function
// parses "{xxxxx}" and returns actual value from the given object that matches the expression
var replacer = function replacer(all, key, obj, isHTML) {
var res = obj;
key.replace(objNotationRegex, function (all, name, quote, quotedName, isFunc) {
name = name || quotedName;
if (res) {
if (name + ':html' in res) {
res = res[name + ':html'];
isHTML = true;
} else if (name in res) {
res = res[name];
}
if (isFunc && typeof res === 'function') {
res = res();
}
}
});
// if not found restore original value
if (res == null || res === obj) {
res = all;
}
res = String(res);
if (!isHTML) {
res = T.escape(res);
}
return res;
};
/**
* Replaces tokens in the template with corresponding values without HTML escaping
* @method fillHtml
* @param obj {Object} to populate the template with
* @return {Object} the template object
*/
var fillHtml = function fillHtml(obj) {
this.template = this.template.replace(tokenRegex, function (all, key) {
return replacer(all, key, obj, true);
});
return this;
};
/**
* Replaces tokens in the template with corresponding values with HTML escaping
* @method fill
* @param obj {Object} to populate the template with
* @return {Object} the template object
*/
var fill = function fill(obj) {
this.template = this.template.replace(tokenRegex, function (all, key) {
return replacer(all, key, obj);
});
return this;
};
/**
* Returns the current templated string.
* @method toString
* @return {String} the current template
*/
var toString = function toString() {
return this.template;
};
// internal function
var T = function T(s) {
function res() {
return res.template;
}
/**
* The current templated string
* @property template
*/
res.template = String(s);
res.toString = res.valueOf = toString;
res.fill = fill;
res.fillHtml = fillHtml;
return res;
};
var cache = {};
var count = [];
var findScripts = function findScripts(title) {
return $('script').filter(function () {
return this.getAttribute('title') === title;
});
};
// returns template taken form the script tag with given title. Type agnostic, but better put type="text/x-template"
T.load = function (title) {
title = String(title);
if (!cache.hasOwnProperty(title)) {
if (count.length >= 1e3) {
delete cache[count.shift()]; // enforce maximum cache size
}
count.push(title);
cache[title] = findScripts(title)[0].text;
}
return this(cache[title]);
};
// escape HTML dangerous characters
T.escape = _escapeHtml2.default;
return T;
}(_jquery2.default);
(0, _globalize2.default)('template', template);
exports.default = template;
module.exports = exports['default'];
return module.exports;
}).call(this);
// node_modules/skatejs-template-html/dist/template-html.js
(typeof window === 'undefined' ? global : window).__10cd74f6112c3c1d2c570837676652d5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__10cd74f6112c3c1d2c570837676652d5");
define.amd = true;
(function () {
var DocumentFragment = window.DocumentFragment;
var elProto = window.HTMLElement.prototype;
var matchesSelector = (
elProto.matches ||
elProto.msMatchesSelector ||
elProto.webkitMatchesSelector ||
elProto.mozMatchesSelector ||
elProto.oMatchesSelector
);
function getData (element, name) {
if (element.__SKATE_TEMPLATE_HTML_DATA) {
return element.__SKATE_TEMPLATE_HTML_DATA[name];
}
}
function setData (element, name, value) {
if (!element.__SKATE_TEMPLATE_HTML_DATA) {
element.__SKATE_TEMPLATE_HTML_DATA = {};
}
element.__SKATE_TEMPLATE_HTML_DATA[name] = value;
return element;
}
function createFragmentFromString (domString) {
var specialMap = {
caption: 'table',
dd: 'dl',
dt: 'dl',
li: 'ul',
tbody: 'table',
td: 'tr',
thead: 'table',
tr: 'tbody'
};
var tag = domString.match(/\s*<([^\s>]+)/);
var div = document.createElement(tag && specialMap[tag[1]] || 'div');
div.innerHTML = domString;
return createFragmentFromNodeList(div.childNodes);
}
function createFragmentFromNodeList (nodeList) {
var frag = document.createDocumentFragment();
while (nodeList && nodeList.length) {
frag.appendChild(nodeList[0]);
}
return frag;
}
function getNodesBetween (startNode, endNode) {
var nodes = [];
var nextNode = startNode.nextSibling;
while (nextNode !== endNode) {
nodes.push(nextNode);
nextNode = nextNode.nextSibling;
}
return nodes;
}
function findChildrenMatchingSelector (sourceNode, selector) {
if (selector) {
var found = sourceNode.querySelectorAll(selector);
var foundLength = found.length;
var filtered = [];
for (var a = 0; a < foundLength; a++) {
var node = found[a];
if (node.parentNode === sourceNode) {
filtered.push(node);
}
}
return filtered;
}
return [].slice.call(sourceNode.childNodes) || [];
}
function htmlTemplateParentWrapper (element) {
var contentNodes = getData(element, 'content');
var contentNodesLen = contentNodes.length;
return {
childNodes: {
get: function () {
var nodes = [];
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (contentNode.isDefault) {
continue;
}
nodes = nodes.concat(getNodesBetween(contentNode.startNode, contentNode.endNode));
}
return nodes;
}
},
firstChild: {
get: function () {
var childNodes = this.childNodes;
return childNodes.length && childNodes[0] || null;
}
},
innerHTML: {
get: function () {
var html = '';
var childNodes = this.childNodes;
var childNodesLen = childNodes.length;
for (var a = 0; a < childNodesLen; a++) {
var childNode = childNodes[a];
html += childNode.outerHTML || childNode.textContent;
}
return html;
},
set: function (html) {
var targetFragment = createFragmentFromString(html);
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
var childNodes = getNodesBetween(contentNode.startNode, contentNode.endNode);
// Remove all nodes (including default content).
for (var b = 0; b < childNodes.length; b++) {
var childNode = childNodes[b];
childNode.parentNode.removeChild(childNode);
}
var foundNodes = findChildrenMatchingSelector(targetFragment, contentNode.selector);
// Add any matched nodes from the given HTML.
for (var c = 0; c < foundNodes.length; c++) {
contentNode.container.insertBefore(foundNodes[c], contentNode.endNode);
}
// If no nodes were found, set the default content.
if (foundNodes.length) {
removeDefaultContent(contentNode);
} else {
addDefaultContent(contentNode);
}
}
}
},
lastChild: {
get: function () {
for (var a = contentNodesLen - 1; a > -1; a--) {
var contentNode = contentNodes[a];
if (contentNode.isDefault) {
continue;
}
var childNodes = this.childNodes;
var childNodesLen = childNodes.length;
return childNodes[childNodesLen - 1];
}
return null;
}
},
outerHTML: {
get: function () {
var name = this.tagName.toLowerCase();
var html = '<' + name;
var attrs = this.attributes;
if (attrs) {
var attrsLength = attrs.length;
for (var a = 0; a < attrsLength; a++) {
var attr = attrs[a];
html += ' ' + attr.nodeName + '="' + attr.nodeValue + '"';
}
}
html += '>';
html += this.innerHTML;
html += '</' + name + '>';
return html;
}
},
textContent: {
get: function () {
var textContent = '';
var childNodes = this.childNodes;
var childNodesLength = this.childNodes.length;
for (var a = 0; a < childNodesLength; a++) {
textContent += childNodes[a].textContent;
}
return textContent;
},
set: function (textContent) {
var acceptsTextContent;
// Removes all nodes (including default content).
this.innerHTML = '';
// Find the first content node without a selector.
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (!contentNode.selector) {
acceptsTextContent = contentNode;
break;
}
}
// There may be no content nodes that accept text content.
if (acceptsTextContent) {
if (textContent) {
removeDefaultContent(acceptsTextContent);
acceptsTextContent.container.insertBefore(document.createTextNode(textContent), acceptsTextContent.endNode);
} else {
addDefaultContent(acceptsTextContent);
}
}
}
},
appendChild: {
value: function (node) {
if (node instanceof DocumentFragment) {
var fragChildNodes = node.childNodes;
[].slice.call(fragChildNodes).forEach(function (node) {
this.appendChild(node);
}.bind(this));
return this;
}
for (var b = 0; b < contentNodesLen; b++) {
var contentNode = contentNodes[b];
var contentSelector = contentNode.selector;
if (!contentSelector || node instanceof window.HTMLElement && matchesSelector.call(node, contentSelector)) {
removeDefaultContent(contentNode);
contentNode.endNode.parentNode.insertBefore(node, contentNode.endNode);
break;
}
}
return this;
}
},
insertAdjacentHTML: {
value: function (where, html) {
if (where === 'afterbegin') {
this.insertBefore(createFragmentFromString(html), this.childNodes[0]);
} else if (where === 'beforeend') {
this.appendChild(createFragmentFromString(html));
} else {
element.insertAdjacentHTML(where, html);
}
return this;
}
},
insertBefore: {
value: function (node, referenceNode) {
// If no reference node is supplied, we append. This also means that we
// don't need to add / remove any default content because either there
// aren't any nodes or appendChild will handle it.
if (!referenceNode) {
return this.appendChild(node);
}
// Handle document fragments.
if (node instanceof DocumentFragment) {
var fragChildNodes = node.childNodes;
if (fragChildNodes) {
var fragChildNodesLength = fragChildNodes.length;
for (var a = 0; a < fragChildNodesLength; a++) {
this.insertBefore(fragChildNodes[a], referenceNode);
}
}
return this;
}
var hasFoundReferenceNode = false;
// There's no reason to handle default content add / remove because:
// 1. If no reference node is supplied, appendChild handles it.
// 2. If a reference node is supplied, there already is content.
// 3. If a reference node is invalid, an exception is thrown, but also
// it's state would not change even if it wasn't.
mainLoop:
for (var b = 0; b < contentNodesLen; b++) {
var contentNode = contentNodes[b];
var betweenNodes = getNodesBetween(contentNode.startNode, contentNode.endNode);
var betweenNodesLen = betweenNodes.length;
for (var c = 0; c < betweenNodesLen; c++) {
var betweenNode = betweenNodes[c];
if (betweenNode === referenceNode) {
hasFoundReferenceNode = true;
}
if (hasFoundReferenceNode) {
var selector = contentNode.selector;
if (!selector || matchesSelector.call(node, selector)) {
betweenNode.parentNode.insertBefore(node, betweenNode);
break mainLoop;
}
}
}
}
// If no reference node was found as a child node of the element we must
// throw an error. This works for both no child nodes, or if the
// reference wasn't found to be a child node.
if (!hasFoundReferenceNode) {
throw new Error('DOMException 8: The node before which the new node is to be inserted is not a child of this node.');
}
return node;
}
},
removeChild: {
value: function (childNode) {
var removed = false;
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (contentNode.container === childNode.parentNode) {
contentNode.container.removeChild(childNode);
removed = true;
break;
}
if (contentNode.startNode.nextSibling === contentNode.endNode) {
addDefaultContent(contentNode);
}
}
if (!removed) {
throw new Error('DOMException 8: The node in which you are trying to remove is not a child of this node.');
}
return childNode;
}
},
replaceChild: {
value: function (newChild, oldChild) {
for (var a = 0; a < contentNodesLen; a++) {
var contentNode = contentNodes[a];
if (contentNode.container === oldChild.parentNode) {
contentNode.container.replaceChild(newChild, oldChild);
break;
}
}
return this;
}
}
};
}
function addDefaultContent (content) {
var nodes = content.defaultNodes;
var nodesLen = nodes.length;
for (var a = 0; a < nodesLen; a++) {
content.container.insertBefore(nodes[a], content.endNode);
}
content.isDefault = true;
}
function removeDefaultContent (content) {
var nodes = content.defaultNodes;
var nodesLen = nodes.length;
for (var a = 0; a < nodesLen; a++) {
var node = nodes[a];
node.parentNode.removeChild(node);
}
content.isDefault = false;
}
function createProxyProperty (node, name) {
return {
get: function () {
var value = node[name];
if (typeof value === 'function') {
return value.bind(node);
}
return value;
},
set: function (value) {
node[name] = value;
}
};
}
function wrapNodeWith (node, wrapper) {
var wrapped = {};
for (var name in node) {
var inWrapper = name in wrapper;
if (inWrapper) {
Object.defineProperty(wrapped, name, wrapper[name]);
} else {
Object.defineProperty(wrapped, name, createProxyProperty(node, name));
}
}
return wrapped;
}
function cacheContentData (node) {
var contentNodes = node.getElementsByTagName('content');
var contentNodesLen = contentNodes && contentNodes.length;
if (contentNodesLen) {
var contentData = [];
while (contentNodes.length) {
var contentNode = contentNodes[0];
var parentNode = contentNode.parentNode;
var selector = contentNode.getAttribute('select');
var startNode = document.createComment(' content ');
var endNode = document.createComment(' /content ');
contentData.push({
container: parentNode,
contentNode: contentNode,
defaultNodes: [].slice.call(contentNode.childNodes),
endNode: endNode,
isDefault: true,
selector: selector,
startNode: startNode
});
parentNode.replaceChild(endNode, contentNode);
parentNode.insertBefore(startNode, endNode);
// Cache data in the comment that can be read if no content information
// is cached. This allows seamless server-side rendering.
startNode.textContent += JSON.stringify({
defaultContent: contentNode.innerHTML,
selector: selector
}) + ' ';
}
setData(node, 'content', contentData);
}
}
// Content Parser
// --------------
function parseCommentNode (node) {
var data;
var matches = node.textContent.match(/^ (\/?)content (.*)/i);
if (matches) {
if (matches[2]) {
try {
data = JSON.parse(matches[2]);
} catch (e) {
throw new Error('Unable to parse content comment data: "' + e + '" in "<!--' + node.textContent + '-->".');
}
}
return {
data: data || {
defaultContent: undefined,
isDefault: undefined,
selector: undefined
},
type: matches[1] ? 'close' : 'open'
};
}
}
function parseNodeForContent (node) {
var a;
var childNodes = node.childNodes;
var childNodesLen = childNodes.length;
var contentDatas = [];
var lastContentNode;
for (a = 0; a < childNodesLen; a++) {
var childNode = childNodes[a];
if (childNode.nodeType === 8) {
var contentInfo = parseCommentNode(childNode);
if (contentInfo) {
if (contentInfo.type === 'open') {
if (lastContentNode) {
throw new Error('Cannot have an opening content placeholder after another content placeholder at the same level in the DOM tree: "' + childNode.textContent + '" in "' + childNode.parentNode.innerHTML + '".');
}
lastContentNode = {
container: childNode.parentNode,
contentNode: childNode,
defaultNodes: contentInfo.data.defaultContent && createFragmentFromString(contentInfo.data.defaultContent).childNodes || [],
isDefault: contentInfo.data.isDefault,
selector: contentInfo.data.selector,
startNode: childNode
};
} else if (contentInfo.type === 'close') {
if (!lastContentNode) {
throw new Error('Unmatched closing content placeholder: "' + childNode.textContent + '" in "' + childNode.parentNode.innerHTML + '".');
}
lastContentNode.endNode = childNode;
contentDatas.push(lastContentNode);
lastContentNode = undefined;
}
}
} else {
contentDatas = contentDatas.concat(parseNodeForContent(childNode));
}
}
return contentDatas;
}
// Public API
// ----------
function skateTemplateHtml () {
var template = [].slice.call(arguments).join('');
return function (target) {
var frag = createFragmentFromNodeList(target.childNodes);
target.innerHTML = template;
cacheContentData(target);
if (frag.childNodes.length) {
skateTemplateHtml.wrap(target).appendChild(frag);
}
};
}
skateTemplateHtml.wrap = function (node) {
if (!getData(node, 'content')) {
setData(node, 'content', parseNodeForContent(node));
}
return wrapNodeWith(node, htmlTemplateParentWrapper(node));
};
// Exporting
// ---------
// Global.
window.skateTemplateHtml = skateTemplateHtml;
// AMD.
if (typeof define === 'function') {
define(function () {
return skateTemplateHtml;
});
}
// CommonJS.
if (typeof module === 'object') {
module.exports = skateTemplateHtml;
}
})();
return module.exports;
}).call(this);
// src/js/aui/debounce.js
(typeof window === 'undefined' ? global : window).__cbf395035bbc83bf2d130a559590a472 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = debounce;
exports.debounceImmediate = debounceImmediate;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function debounce(func, wait) {
var timeout;
var result;
return function () {
var args = arguments;
var context = this;
var later = function later() {
result = func.apply(context, args);
context = args = null;
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
return result;
};
}
(0, _globalize2.default)('debounce', debounce);
function debounceImmediate(func, wait) {
var timeout = null;
var result;
return function () {
var context = this;
var args = arguments;
var later = function later() {
timeout = context = args = null;
};
if (timeout === null) {
result = func.apply(context, args);
}
clearTimeout(timeout);
timeout = setTimeout(later, wait);
return result;
};
}
(0, _globalize2.default)('debounceImmediate', debounceImmediate);
return module.exports;
}).call(this);
// src/js/aui/internal/browser.js
(typeof window === 'undefined' ? global : window).__3eaf0cc9c7cf905b4f8bdef7a1985811 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.supportsCalc = supportsCalc;
exports.supportsRequestAnimationFrame = supportsRequestAnimationFrame;
exports.supportsVoiceOver = supportsVoiceOver;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var supportsCalc = null;
var isMacOSX = /Mac OS X/.test(navigator.userAgent);
function supportsCalc() {
if (supportsCalc === null) {
var $d = (0, _jquery2.default)('<div style="height: 10px; height: -webkit-calc(20px + 0); height: calc(20px);"></div>');
exports.supportsCalc = supportsCalc = 20 === $d.appendTo(document.documentElement).height();
$d.remove();
}
return supportsCalc;
}
function supportsRequestAnimationFrame() {
return !!window.requestAnimationFrame;
}
function supportsVoiceOver() {
return isMacOSX;
}
return module.exports;
}).call(this);
// node_modules/tether/tether.js
(typeof window === 'undefined' ? global : window).__0d21b368e7f0f2a3c26323bad4b7f3c9 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
var defineDependencies = {
"module": module,
"exports": exports
};
var define = function defineReplacementWrapper(generatedModuleName) {
return function defineReplacement(name, deps, func) {
var root = (typeof window === 'undefined' ? global : window);
var defineGlobal = root.define;
var rval;
var type;
func = [func, deps, name].filter(function (cur) {
return typeof cur === 'function';
})[0];
deps = [deps, name, []].filter(Array.isArray)[0];
rval = func.apply(null, deps.map(function (value) {
return defineDependencies[value];
}));
type = typeof rval;
// Support existing AMD libs.
if (typeof defineGlobal === 'function') {
// Almond always expects a name so resolve one (#29).
defineGlobal(typeof name === 'string' ? name : generatedModuleName, deps, func);
}
// Some processors like Babel don't check to make sure that the module value
// is not a primitive before calling Object.defineProperty() on it. We ensure
// it is an instance so that it can.
if (type === 'string') {
rval = String(rval);
} else if (type === 'number') {
rval = Number(rval);
} else if (type === 'boolean') {
rval = Boolean(rval);
}
// Reset the exports to the defined module. This is how we convert AMD to
// CommonJS and ensures both can either co-exist, or be used separately. We
// only set it if it is not defined because there is no object representation
// of undefined, thus calling Object.defineProperty() on it would fail.
if (rval !== undefined) {
exports = module.exports = rval;
}
};
}("__0d21b368e7f0f2a3c26323bad4b7f3c9");
define.amd = true;
/*! tether 0.6.5 */
(function(root) {
(function() {
var Evented, addClass, defer, deferred, extend, flush, getBounds, getOffsetParent, getOrigin, getScrollBarSize, getScrollParent, hasClass, node, removeClass, uniqueId, updateClasses, zeroPosCache,
__hasProp = {}.hasOwnProperty,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
__slice = [].slice;
if (this.Tether == null) {
this.Tether = {
modules: []
};
}
getScrollParent = function(el) {
var parent, position, scrollParent, style, _ref;
position = getComputedStyle(el).position;
if (position === 'fixed') {
return el;
}
scrollParent = void 0;
parent = el;
while (parent = parent.parentNode) {
try {
style = getComputedStyle(parent);
} catch (_error) {}
if (style == null) {
return parent;
}
if (/(auto|scroll)/.test(style['overflow'] + style['overflow-y'] + style['overflow-x'])) {
if (position !== 'absolute' || ((_ref = style['position']) === 'relative' || _ref === 'absolute' || _ref === 'fixed')) {
return parent;
}
}
}
return document.body;
};
uniqueId = (function() {
var id;
id = 0;
return function() {
return id++;
};
})();
zeroPosCache = {};
getOrigin = function(doc) {
var id, k, node, v, _ref;
node = doc._tetherZeroElement;
if (node == null) {
node = doc.createElement('div');
node.setAttribute('data-tether-id', uniqueId());
extend(node.style, {
top: 0,
left: 0,
position: 'absolute'
});
doc.body.appendChild(node);
doc._tetherZeroElement = node;
}
id = node.getAttribute('data-tether-id');
if (zeroPosCache[id] == null) {
zeroPosCache[id] = {};
_ref = node.getBoundingClientRect();
for (k in _ref) {
v = _ref[k];
zeroPosCache[id][k] = v;
}
defer(function() {
return zeroPosCache[id] = void 0;
});
}
return zeroPosCache[id];
};
node = null;
getBounds = function(el) {
var box, doc, docEl, k, origin, v, _ref;
if (el === document) {
doc = document;
el = document.documentElement;
} else {
doc = el.ownerDocument;
}
docEl = doc.documentElement;
box = {};
_ref = el.getBoundingClientRect();
for (k in _ref) {
v = _ref[k];
box[k] = v;
}
origin = getOrigin(doc);
box.top -= origin.top;
box.left -= origin.left;
if (box.width == null) {
box.width = document.body.scrollWidth - box.left - box.right;
}
if (box.height == null) {
box.height = document.body.scrollHeight - box.top - box.bottom;
}
box.top = box.top - docEl.clientTop;
box.left = box.left - docEl.clientLeft;
box.right = doc.body.clientWidth - box.width - box.left;
box.bottom = doc.body.clientHeight - box.height - box.top;
return box;
};
getOffsetParent = function(el) {
return el.offsetParent || document.documentElement;
};
getScrollBarSize = function() {
var inner, outer, width, widthContained, widthScroll;
inner = document.createElement('div');
inner.style.width = '100%';
inner.style.height = '200px';
outer = document.createElement('div');
extend(outer.style, {
position: 'absolute',
top: 0,
left: 0,
pointerEvents: 'none',
visibility: 'hidden',
width: '200px',
height: '150px',
overflow: 'hidden'
});
outer.appendChild(inner);
document.body.appendChild(outer);
widthContained = inner.offsetWidth;
outer.style.overflow = 'scroll';
widthScroll = inner.offsetWidth;
if (widthContained === widthScroll) {
widthScroll = outer.clientWidth;
}
document.body.removeChild(outer);
width = widthContained - widthScroll;
return {
width: width,
height: width
};
};
extend = function(out) {
var args, key, obj, val, _i, _len, _ref;
if (out == null) {
out = {};
}
args = [];
Array.prototype.push.apply(args, arguments);
_ref = args.slice(1);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
obj = _ref[_i];
if (obj) {
for (key in obj) {
if (!__hasProp.call(obj, key)) continue;
val = obj[key];
out[key] = val;
}
}
}
return out;
};
removeClass = function(el, name) {
var cls, _i, _len, _ref, _results;
if (el.classList != null) {
_ref = name.split(' ');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cls = _ref[_i];
if (cls.trim()) {
_results.push(el.classList.remove(cls));
}
}
return _results;
} else {
return el.className = el.className.replace(new RegExp("(^| )" + (name.split(' ').join('|')) + "( |$)", 'gi'), ' ');
}
};
addClass = function(el, name) {
var cls, _i, _len, _ref, _results;
if (el.classList != null) {
_ref = name.split(' ');
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
cls = _ref[_i];
if (cls.trim()) {
_results.push(el.classList.add(cls));
}
}
return _results;
} else {
removeClass(el, name);
return el.className += " " + name;
}
};
hasClass = function(el, name) {
if (el.classList != null) {
return el.classList.contains(name);
} else {
return new RegExp("(^| )" + name + "( |$)", 'gi').test(el.className);
}
};
updateClasses = function(el, add, all) {
var cls, _i, _j, _len, _len1, _results;
for (_i = 0, _len = all.length; _i < _len; _i++) {
cls = all[_i];
if (__indexOf.call(add, cls) < 0) {
if (hasClass(el, cls)) {
removeClass(el, cls);
}
}
}
_results = [];
for (_j = 0, _len1 = add.length; _j < _len1; _j++) {
cls = add[_j];
if (!hasClass(el, cls)) {
_results.push(addClass(el, cls));
} else {
_results.push(void 0);
}
}
return _results;
};
deferred = [];
defer = function(fn) {
return deferred.push(fn);
};
flush = function() {
var fn, _results;
_results = [];
while (fn = deferred.pop()) {
_results.push(fn());
}
return _results;
};
Evented = (function() {
function Evented() {}
Evented.prototype.on = function(event, handler, ctx, once) {
var _base;
if (once == null) {
once = false;
}
if (this.bindings == null) {
this.bindings = {};
}
if ((_base = this.bindings)[event] == null) {
_base[event] = [];
}
return this.bindings[event].push({
handler: handler,
ctx: ctx,
once: once
});
};
Evented.prototype.once = function(event, handler, ctx) {
return this.on(event, handler, ctx, true);
};
Evented.prototype.off = function(event, handler) {
var i, _ref, _results;
if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {
return;
}
if (handler == null) {
return delete this.bindings[event];
} else {
i = 0;
_results = [];
while (i < this.bindings[event].length) {
if (this.bindings[event][i].handler === handler) {
_results.push(this.bindings[event].splice(i, 1));
} else {
_results.push(i++);
}
}
return _results;
}
};
Evented.prototype.trigger = function() {
var args, ctx, event, handler, i, once, _ref, _ref1, _results;
event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
if ((_ref = this.bindings) != null ? _ref[event] : void 0) {
i = 0;
_results = [];
while (i < this.bindings[event].length) {
_ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;
handler.apply(ctx != null ? ctx : this, args);
if (once) {
_results.push(this.bindings[event].splice(i, 1));
} else {
_results.push(i++);
}
}
return _results;
}
};
return Evented;
})();
this.Tether.Utils = {
getScrollParent: getScrollParent,
getBounds: getBounds,
getOffsetParent: getOffsetParent,
extend: extend,
addClass: addClass,
removeClass: removeClass,
hasClass: hasClass,
updateClasses: updateClasses,
defer: defer,
flush: flush,
uniqueId: uniqueId,
Evented: Evented,
getScrollBarSize: getScrollBarSize
};
}).call(this);
(function() {
var MIRROR_LR, MIRROR_TB, OFFSET_MAP, Tether, addClass, addOffset, attachmentToOffset, autoToFixedAttachment, defer, extend, flush, getBounds, getOffsetParent, getOuterSize, getScrollBarSize, getScrollParent, getSize, now, offsetToPx, parseAttachment, parseOffset, position, removeClass, tethers, transformKey, updateClasses, within, _Tether, _ref,
__slice = [].slice,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
if (this.Tether == null) {
throw new Error("You must include the utils.js file before tether.js");
}
Tether = this.Tether;
_ref = Tether.Utils, getScrollParent = _ref.getScrollParent, getSize = _ref.getSize, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getOffsetParent = _ref.getOffsetParent, extend = _ref.extend, addClass = _ref.addClass, removeClass = _ref.removeClass, updateClasses = _ref.updateClasses, defer = _ref.defer, flush = _ref.flush, getScrollBarSize = _ref.getScrollBarSize;
within = function(a, b, diff) {
if (diff == null) {
diff = 1;
}
return (a + diff >= b && b >= a - diff);
};
transformKey = (function() {
var el, key, _i, _len, _ref1;
el = document.createElement('div');
_ref1 = ['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform'];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
key = _ref1[_i];
if (el.style[key] !== void 0) {
return key;
}
}
})();
tethers = [];
position = function() {
var tether, _i, _len;
for (_i = 0, _len = tethers.length; _i < _len; _i++) {
tether = tethers[_i];
tether.position(false);
}
return flush();
};
now = function() {
var _ref1;
return (_ref1 = typeof performance !== "undefined" && performance !== null ? typeof performance.now === "function" ? performance.now() : void 0 : void 0) != null ? _ref1 : +(new Date);
};
(function() {
var event, lastCall, lastDuration, pendingTimeout, tick, _i, _len, _ref1, _results;
lastCall = null;
lastDuration = null;
pendingTimeout = null;
tick = function() {
if ((lastDuration != null) && lastDuration > 16) {
lastDuration = Math.min(lastDuration - 16, 250);
pendingTimeout = setTimeout(tick, 250);
return;
}
if ((lastCall != null) && (now() - lastCall) < 10) {
return;
}
if (pendingTimeout != null) {
clearTimeout(pendingTimeout);
pendingTimeout = null;
}
lastCall = now();
position();
return lastDuration = now() - lastCall;
};
_ref1 = ['resize', 'scroll', 'touchmove'];
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
event = _ref1[_i];
_results.push(window.addEventListener(event, tick));
}
return _results;
})();
MIRROR_LR = {
center: 'center',
left: 'right',
right: 'left'
};
MIRROR_TB = {
middle: 'middle',
top: 'bottom',
bottom: 'top'
};
OFFSET_MAP = {
top: 0,
left: 0,
middle: '50%',
center: '50%',
bottom: '100%',
right: '100%'
};
autoToFixedAttachment = function(attachment, relativeToAttachment) {
var left, top;
left = attachment.left, top = attachment.top;
if (left === 'auto') {
left = MIRROR_LR[relativeToAttachment.left];
}
if (top === 'auto') {
top = MIRROR_TB[relativeToAttachment.top];
}
return {
left: left,
top: top
};
};
attachmentToOffset = function(attachment) {
var _ref1, _ref2;
return {
left: (_ref1 = OFFSET_MAP[attachment.left]) != null ? _ref1 : attachment.left,
top: (_ref2 = OFFSET_MAP[attachment.top]) != null ? _ref2 : attachment.top
};
};
addOffset = function() {
var left, offsets, out, top, _i, _len, _ref1;
offsets = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
out = {
top: 0,
left: 0
};
for (_i = 0, _len = offsets.length; _i < _len; _i++) {
_ref1 = offsets[_i], top = _ref1.top, left = _ref1.left;
if (typeof top === 'string') {
top = parseFloat(top, 10);
}
if (typeof left === 'string') {
left = parseFloat(left, 10);
}
out.top += top;
out.left += left;
}
return out;
};
offsetToPx = function(offset, size) {
if (typeof offset.left === 'string' && offset.left.indexOf('%') !== -1) {
offset.left = parseFloat(offset.left, 10) / 100 * size.width;
}
if (typeof offset.top === 'string' && offset.top.indexOf('%') !== -1) {
offset.top = parseFloat(offset.top, 10) / 100 * size.height;
}
return offset;
};
parseAttachment = parseOffset = function(value) {
var left, top, _ref1;
_ref1 = value.split(' '), top = _ref1[0], left = _ref1[1];
return {
top: top,
left: left
};
};
_Tether = (function() {
_Tether.modules = [];
function _Tether(options) {
this.position = __bind(this.position, this);
var module, _i, _len, _ref1, _ref2;
tethers.push(this);
this.history = [];
this.setOptions(options, false);
_ref1 = Tether.modules;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
module = _ref1[_i];
if ((_ref2 = module.initialize) != null) {
_ref2.call(this);
}
}
this.position();
}
_Tether.prototype.getClass = function(key) {
var _ref1, _ref2;
if ((_ref1 = this.options.classes) != null ? _ref1[key] : void 0) {
return this.options.classes[key];
} else if (((_ref2 = this.options.classes) != null ? _ref2[key] : void 0) !== false) {
if (this.options.classPrefix) {
return "" + this.options.classPrefix + "-" + key;
} else {
return key;
}
} else {
return '';
}
};
_Tether.prototype.setOptions = function(options, position) {
var defaults, key, _i, _len, _ref1, _ref2;
this.options = options;
if (position == null) {
position = true;
}
defaults = {
offset: '0 0',
targetOffset: '0 0',
targetAttachment: 'auto auto',
classPrefix: 'tether'
};
this.options = extend(defaults, this.options);
_ref1 = this.options, this.element = _ref1.element, this.target = _ref1.target, this.targetModifier = _ref1.targetModifier;
if (this.target === 'viewport') {
this.target = document.body;
this.targetModifier = 'visible';
} else if (this.target === 'scroll-handle') {
this.target = document.body;
this.targetModifier = 'scroll-handle';
}
_ref2 = ['element', 'target'];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
key = _ref2[_i];
if (this[key] == null) {
throw new Error("Tether Error: Both element and target must be defined");
}
if (this[key].jquery != null) {
this[key] = this[key][0];
} else if (typeof this[key] === 'string') {
this[key] = document.querySelector(this[key]);
}
}
addClass(this.element, this.getClass('element'));
addClass(this.target, this.getClass('target'));
if (!this.options.attachment) {
throw new Error("Tether Error: You must provide an attachment");
}
this.targetAttachment = parseAttachment(this.options.targetAttachment);
this.attachment = parseAttachment(this.options.attachment);
this.offset = parseOffset(this.options.offset);
this.targetOffset = parseOffset(this.options.targetOffset);
if (this.scrollParent != null) {
this.disable();
}
if (this.targetModifier === 'scroll-handle') {
this.scrollParent = this.target;
} else {
this.scrollParent = getScrollParent(this.target);
}
if (this.options.enabled !== false) {
return this.enable(position);
}
};
_Tether.prototype.getTargetBounds = function() {
var bounds, fitAdj, hasBottomScroll, height, out, scrollBottom, scrollPercentage, style, target;
if (this.targetModifier != null) {
switch (this.targetModifier) {
case 'visible':
if (this.target === document.body) {
return {
top: pageYOffset,
left: pageXOffset,
height: innerHeight,
width: innerWidth
};
} else {
bounds = getBounds(this.target);
out = {
height: bounds.height,
width: bounds.width,
top: bounds.top,
left: bounds.left
};
out.height = Math.min(out.height, bounds.height - (pageYOffset - bounds.top));
out.height = Math.min(out.height, bounds.height - ((bounds.top + bounds.height) - (pageYOffset + innerHeight)));
out.height = Math.min(innerHeight, out.height);
out.height -= 2;
out.width = Math.min(out.width, bounds.width - (pageXOffset - bounds.left));
out.width = Math.min(out.width, bounds.width - ((bounds.left + bounds.width) - (pageXOffset + innerWidth)));
out.width = Math.min(innerWidth, out.width);
out.width -= 2;
if (out.top < pageYOffset) {
out.top = pageYOffset;
}
if (out.left < pageXOffset) {
out.left = pageXOffset;
}
return out;
}
break;
case 'scroll-handle':
target = this.target;
if (target === document.body) {
target = document.documentElement;
bounds = {
left: pageXOffset,
top: pageYOffset,
height: innerHeight,
width: innerWidth
};
} else {
bounds = getBounds(target);
}
style = getComputedStyle(target);
hasBottomScroll = target.scrollWidth > target.clientWidth || 'scroll' === [style.overflow, style.overflowX] || this.target !== document.body;
scrollBottom = 0;
if (hasBottomScroll) {
scrollBottom = 15;
}
height = bounds.height - parseFloat(style.borderTopWidth) - parseFloat(style.borderBottomWidth) - scrollBottom;
out = {
width: 15,
height: height * 0.975 * (height / target.scrollHeight),
left: bounds.left + bounds.width - parseFloat(style.borderLeftWidth) - 15
};
fitAdj = 0;
if (height < 408 && this.target === document.body) {
fitAdj = -0.00011 * Math.pow(height, 2) - 0.00727 * height + 22.58;
}
if (this.target !== document.body) {
out.height = Math.max(out.height, 24);
}
scrollPercentage = this.target.scrollTop / (target.scrollHeight - height);
out.top = scrollPercentage * (height - out.height - fitAdj) + bounds.top + parseFloat(style.borderTopWidth);
if (this.target === document.body) {
out.height = Math.max(out.height, 24);
}
return out;
}
} else {
return getBounds(this.target);
}
};
_Tether.prototype.clearCache = function() {
return this._cache = {};
};
_Tether.prototype.cache = function(k, getter) {
if (this._cache == null) {
this._cache = {};
}
if (this._cache[k] == null) {
this._cache[k] = getter.call(this);
}
return this._cache[k];
};
_Tether.prototype.enable = function(position) {
if (position == null) {
position = true;
}
addClass(this.target, this.getClass('enabled'));
addClass(this.element, this.getClass('enabled'));
this.enabled = true;
if (this.scrollParent !== document) {
this.scrollParent.addEventListener('scroll', this.position);
}
if (position) {
return this.position();
}
};
_Tether.prototype.disable = function() {
removeClass(this.target, this.getClass('enabled'));
removeClass(this.element, this.getClass('enabled'));
this.enabled = false;
if (this.scrollParent != null) {
return this.scrollParent.removeEventListener('scroll', this.position);
}
};
_Tether.prototype.destroy = function() {
var i, tether, _i, _len, _results;
this.disable();
_results = [];
for (i = _i = 0, _len = tethers.length; _i < _len; i = ++_i) {
tether = tethers[i];
if (tether === this) {
tethers.splice(i, 1);
break;
} else {
_results.push(void 0);
}
}
return _results;
};
_Tether.prototype.updateAttachClasses = function(elementAttach, targetAttach) {
var add, all, side, sides, _i, _j, _len, _len1, _ref1,
_this = this;
if (elementAttach == null) {
elementAttach = this.attachment;
}
if (targetAttach == null) {
targetAttach = this.targetAttachment;
}
sides = ['left', 'top', 'bottom', 'right', 'middle', 'center'];
if ((_ref1 = this._addAttachClasses) != null ? _ref1.length : void 0) {
this._addAttachClasses.splice(0, this._addAttachClasses.length);
}
add = this._addAttachClasses != null ? this._addAttachClasses : this._addAttachClasses = [];
if (elementAttach.top) {
add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.top);
}
if (elementAttach.left) {
add.push("" + (this.getClass('element-attached')) + "-" + elementAttach.left);
}
if (targetAttach.top) {
add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.top);
}
if (targetAttach.left) {
add.push("" + (this.getClass('target-attached')) + "-" + targetAttach.left);
}
all = [];
for (_i = 0, _len = sides.length; _i < _len; _i++) {
side = sides[_i];
all.push("" + (this.getClass('element-attached')) + "-" + side);
}
for (_j = 0, _len1 = sides.length; _j < _len1; _j++) {
side = sides[_j];
all.push("" + (this.getClass('target-attached')) + "-" + side);
}
return defer(function() {
if (_this._addAttachClasses == null) {
return;
}
updateClasses(_this.element, _this._addAttachClasses, all);
updateClasses(_this.target, _this._addAttachClasses, all);
return _this._addAttachClasses = void 0;
});
};
_Tether.prototype.position = function(flushChanges) {
var elementPos, elementStyle, height, left, manualOffset, manualTargetOffset, module, next, offset, offsetBorder, offsetParent, offsetParentSize, offsetParentStyle, offsetPosition, ret, scrollLeft, scrollTop, scrollbarSize, side, targetAttachment, targetOffset, targetPos, targetSize, top, width, _i, _j, _len, _len1, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6,
_this = this;
if (flushChanges == null) {
flushChanges = true;
}
if (!this.enabled) {
return;
}
this.clearCache();
targetAttachment = autoToFixedAttachment(this.targetAttachment, this.attachment);
this.updateAttachClasses(this.attachment, targetAttachment);
elementPos = this.cache('element-bounds', function() {
return getBounds(_this.element);
});
width = elementPos.width, height = elementPos.height;
if (width === 0 && height === 0 && (this.lastSize != null)) {
_ref1 = this.lastSize, width = _ref1.width, height = _ref1.height;
} else {
this.lastSize = {
width: width,
height: height
};
}
targetSize = targetPos = this.cache('target-bounds', function() {
return _this.getTargetBounds();
});
offset = offsetToPx(attachmentToOffset(this.attachment), {
width: width,
height: height
});
targetOffset = offsetToPx(attachmentToOffset(targetAttachment), targetSize);
manualOffset = offsetToPx(this.offset, {
width: width,
height: height
});
manualTargetOffset = offsetToPx(this.targetOffset, targetSize);
offset = addOffset(offset, manualOffset);
targetOffset = addOffset(targetOffset, manualTargetOffset);
left = targetPos.left + targetOffset.left - offset.left;
top = targetPos.top + targetOffset.top - offset.top;
_ref2 = Tether.modules;
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
module = _ref2[_i];
ret = module.position.call(this, {
left: left,
top: top,
targetAttachment: targetAttachment,
targetPos: targetPos,
attachment: this.attachment,
elementPos: elementPos,
offset: offset,
targetOffset: targetOffset,
manualOffset: manualOffset,
manualTargetOffset: manualTargetOffset,
scrollbarSize: scrollbarSize
});
if ((ret == null) || typeof ret !== 'object') {
continue;
} else if (ret === false) {
return false;
} else {
top = ret.top, left = ret.left;
}
}
next = {
page: {
top: top,
left: left
},
viewport: {
top: top - pageYOffset,
bottom: pageYOffset - top - height + innerHeight,
left: left - pageXOffset,
right: pageXOffset - left - width + innerWidth
}
};
if (document.body.scrollWidth > window.innerWidth) {
scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
next.viewport.bottom -= scrollbarSize.height;
}
if (document.body.scrollHeight > window.innerHeight) {
scrollbarSize = this.cache('scrollbar-size', getScrollBarSize);
next.viewport.right -= scrollbarSize.width;
}
if (((_ref3 = document.body.style.position) !== '' && _ref3 !== 'static') || ((_ref4 = document.body.parentElement.style.position) !== '' && _ref4 !== 'static')) {
next.page.bottom = document.body.scrollHeight - top - height;
next.page.right = document.body.scrollWidth - left - width;
}
if (((_ref5 = this.options.optimizations) != null ? _ref5.moveElement : void 0) !== false && (this.targetModifier == null)) {
offsetParent = this.cache('target-offsetparent', function() {
return getOffsetParent(_this.target);
});
offsetPosition = this.cache('target-offsetparent-bounds', function() {
return getBounds(offsetParent);
});
offsetParentStyle = getComputedStyle(offsetParent);
elementStyle = getComputedStyle(this.element);
offsetParentSize = offsetPosition;
offsetBorder = {};
_ref6 = ['Top', 'Left', 'Bottom', 'Right'];
for (_j = 0, _len1 = _ref6.length; _j < _len1; _j++) {
side = _ref6[_j];
offsetBorder[side.toLowerCase()] = parseFloat(offsetParentStyle["border" + side + "Width"]);
}
offsetPosition.right = document.body.scrollWidth - offsetPosition.left - offsetParentSize.width + offsetBorder.right;
offsetPosition.bottom = document.body.scrollHeight - offsetPosition.top - offsetParentSize.height + offsetBorder.bottom;
if (next.page.top >= (offsetPosition.top + offsetBorder.top) && next.page.bottom >= offsetPosition.bottom) {
if (next.page.left >= (offsetPosition.left + offsetBorder.left) && next.page.right >= offsetPosition.right) {
scrollTop = offsetParent.scrollTop;
scrollLeft = offsetParent.scrollLeft;
next.offset = {
top: next.page.top - offsetPosition.top + scrollTop - offsetBorder.top,
left: next.page.left - offsetPosition.left + scrollLeft - offsetBorder.left
};
}
}
}
this.move(next);
this.history.unshift(next);
if (this.history.length > 3) {
this.history.pop();
}
if (flushChanges) {
flush();
}
return true;
};
_Tether.prototype.move = function(position) {
var css, elVal, found, key, moved, offsetParent, point, same, transcribe, type, val, write, writeCSS, _i, _len, _ref1, _ref2,
_this = this;
if (this.element.parentNode == null) {
return;
}
same = {};
for (type in position) {
same[type] = {};
for (key in position[type]) {
found = false;
_ref1 = this.history;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
point = _ref1[_i];
if (!within((_ref2 = point[type]) != null ? _ref2[key] : void 0, position[type][key])) {
found = true;
break;
}
}
if (!found) {
same[type][key] = true;
}
}
}
css = {
top: '',
left: '',
right: '',
bottom: ''
};
transcribe = function(same, pos) {
var xPos, yPos, _ref3;
if (((_ref3 = _this.options.optimizations) != null ? _ref3.gpu : void 0) !== false) {
if (same.top) {
css.top = 0;
yPos = pos.top;
} else {
css.bottom = 0;
yPos = -pos.bottom;
}
if (same.left) {
css.left = 0;
xPos = pos.left;
} else {
css.right = 0;
xPos = -pos.right;
}
css[transformKey] = "translateX(" + (Math.round(xPos)) + "px) translateY(" + (Math.round(yPos)) + "px)";
if (transformKey !== 'msTransform') {
return css[transformKey] += " translateZ(0)";
}
} else {
if (same.top) {
css.top = "" + pos.top + "px";
} else {
css.bottom = "" + pos.bottom + "px";
}
if (same.left) {
return css.left = "" + pos.left + "px";
} else {
return css.right = "" + pos.right + "px";
}
}
};
moved = false;
if ((same.page.top || same.page.bottom) && (same.page.left || same.page.right)) {
css.position = 'absolute';
transcribe(same.page, position.page);
} else if ((same.viewport.top || same.viewport.bottom) && (same.viewport.left || same.viewport.right)) {
css.position = 'fixed';
transcribe(same.viewport, position.viewport);
} else if ((same.offset != null) && same.offset.top && same.offset.left) {
css.position = 'absolute';
offsetParent = this.cache('target-offsetparent', function() {
return getOffsetParent(_this.target);
});
if (getOffsetParent(this.element) !== offsetParent) {
defer(function() {
_this.element.parentNode.removeChild(_this.element);
return offsetParent.appendChild(_this.element);
});
}
transcribe(same.offset, position.offset);
moved = true;
} else {
css.position = 'absolute';
transcribe({
top: true,
left: true
}, position.page);
}
if (!moved && this.element.parentNode.tagName !== 'BODY') {
this.element.parentNode.removeChild(this.element);
document.body.appendChild(this.element);
}
writeCSS = {};
write = false;
for (key in css) {
val = css[key];
elVal = this.element.style[key];
if (elVal !== '' && val !== '' && (key === 'top' || key === 'left' || key === 'bottom' || key === 'right')) {
elVal = parseFloat(elVal);
val = parseFloat(val);
}
if (elVal !== val) {
write = true;
writeCSS[key] = css[key];
}
}
if (write) {
return defer(function() {
return extend(_this.element.style, writeCSS);
});
}
};
return _Tether;
})();
Tether.position = position;
this.Tether = extend(_Tether, Tether);
}).call(this);
(function() {
var BOUNDS_FORMAT, MIRROR_ATTACH, defer, extend, getBoundingRect, getBounds, getOuterSize, getSize, updateClasses, _ref,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
_ref = this.Tether.Utils, getOuterSize = _ref.getOuterSize, getBounds = _ref.getBounds, getSize = _ref.getSize, extend = _ref.extend, updateClasses = _ref.updateClasses, defer = _ref.defer;
MIRROR_ATTACH = {
left: 'right',
right: 'left',
top: 'bottom',
bottom: 'top',
middle: 'middle'
};
BOUNDS_FORMAT = ['left', 'top', 'right', 'bottom'];
getBoundingRect = function(tether, to) {
var i, pos, side, size, style, _i, _len;
if (to === 'scrollParent') {
to = tether.scrollParent;
} else if (to === 'window') {
to = [pageXOffset, pageYOffset, innerWidth + pageXOffset, innerHeight + pageYOffset];
}
if (to === document) {
to = to.documentElement;
}
if (to.nodeType != null) {
pos = size = getBounds(to);
style = getComputedStyle(to);
to = [pos.left, pos.top, size.width + pos.left, size.height + pos.top];
for (i = _i = 0, _len = BOUNDS_FORMAT.length; _i < _len; i = ++_i) {
side = BOUNDS_FORMAT[i];
side = side[0].toUpperCase() + side.substr(1);
if (side === 'Top' || side === 'Left') {
to[i] += parseFloat(style["border" + side + "Width"]);
} else {
to[i] -= parseFloat(style["border" + side + "Width"]);
}
}
}
return to;
};
this.Tether.modules.push({
position: function(_arg) {
var addClasses, allClasses, attachment, bounds, changeAttachX, changeAttachY, cls, constraint, eAttachment, height, left, oob, oobClass, p, pin, pinned, pinnedClass, removeClass, side, tAttachment, targetAttachment, targetHeight, targetSize, targetWidth, to, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8,
_this = this;
top = _arg.top, left = _arg.left, targetAttachment = _arg.targetAttachment;
if (!this.options.constraints) {
return true;
}
removeClass = function(prefix) {
var side, _i, _len, _results;
_this.removeClass(prefix);
_results = [];
for (_i = 0, _len = BOUNDS_FORMAT.length; _i < _len; _i++) {
side = BOUNDS_FORMAT[_i];
_results.push(_this.removeClass("" + prefix + "-" + side));
}
return _results;
};
_ref1 = this.cache('element-bounds', function() {
return getBounds(_this.element);
}), height = _ref1.height, width = _ref1.width;
if (width === 0 && height === 0 && (this.lastSize != null)) {
_ref2 = this.lastSize, width = _ref2.width, height = _ref2.height;
}
targetSize = this.cache('target-bounds', function() {
return _this.getTargetBounds();
});
targetHeight = targetSize.height;
targetWidth = targetSize.width;
tAttachment = {};
eAttachment = {};
allClasses = [this.getClass('pinned'), this.getClass('out-of-bounds')];
_ref3 = this.options.constraints;
for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
constraint = _ref3[_i];
if (constraint.outOfBoundsClass) {
allClasses.push(constraint.outOfBoundsClass);
}
if (constraint.pinnedClass) {
allClasses.push(constraint.pinnedClass);
}
}
for (_j = 0, _len1 = allClasses.length; _j < _len1; _j++) {
cls = allClasses[_j];
_ref4 = ['left', 'top', 'right', 'bottom'];
for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {
side = _ref4[_k];
allClasses.push("" + cls + "-" + side);
}
}
addClasses = [];
tAttachment = extend({}, targetAttachment);
eAttachment = extend({}, this.attachment);
_ref5 = this.options.constraints;
for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) {
constraint = _ref5[_l];
to = constraint.to, attachment = constraint.attachment, pin = constraint.pin;
if (attachment == null) {
attachment = '';
}
if (__indexOf.call(attachment, ' ') >= 0) {
_ref6 = attachment.split(' '), changeAttachY = _ref6[0], changeAttachX = _ref6[1];
} else {
changeAttachX = changeAttachY = attachment;
}
bounds = getBoundingRect(this, to);
if (changeAttachY === 'target' || changeAttachY === 'both') {
if (top < bounds[1] && tAttachment.top === 'top') {
top += targetHeight;
tAttachment.top = 'bottom';
}
if (top + height > bounds[3] && tAttachment.top === 'bottom') {
top -= targetHeight;
tAttachment.top = 'top';
}
}
if (changeAttachY === 'together') {
if (top < bounds[1] && tAttachment.top === 'top') {
if (eAttachment.top === 'bottom') {
top += targetHeight;
tAttachment.top = 'bottom';
top += height;
eAttachment.top = 'top';
} else if (eAttachment.top === 'top') {
top += targetHeight;
tAttachment.top = 'bottom';
top -= height;
eAttachment.top = 'bottom';
}
}
if (top + height > bounds[3] && tAttachment.top === 'bottom') {
if (eAttachment.top === 'top') {
top -= targetHeight;
tAttachment.top = 'top';
top -= height;
eAttachment.top = 'bottom';
} else if (eAttachment.top === 'bottom') {
top -= targetHeight;
tAttachment.top = 'top';
top += height;
eAttachment.top = 'top';
}
}
if (tAttachment.top === 'middle') {
if (top + height > bounds[3] && eAttachment.top === 'top') {
top -= height;
eAttachment.top = 'bottom';
} else if (top < bounds[1] && eAttachment.top === 'bottom') {
top += height;
eAttachment.top = 'top';
}
}
}
if (changeAttachX === 'target' || changeAttachX === 'both') {
if (left < bounds[0] && tAttachment.left === 'left') {
left += targetWidth;
tAttachment.left = 'right';
}
if (left + width > bounds[2] && tAttachment.left === 'right') {
left -= targetWidth;
tAttachment.left = 'left';
}
}
if (changeAttachX === 'together') {
if (left < bounds[0] && tAttachment.left === 'left') {
if (eAttachment.left === 'right') {
left += targetWidth;
tAttachment.left = 'right';
left += width;
eAttachment.left = 'left';
} else if (eAttachment.left === 'left') {
left += targetWidth;
tAttachment.left = 'right';
left -= width;
eAttachment.left = 'right';
}
} else if (left + width > bounds[2] && tAttachment.left === 'right') {
if (eAttachment.left === 'left') {
left -= targetWidth;
tAttachment.left = 'left';
left -= width;
eAttachment.left = 'right';
} else if (eAttachment.left === 'right') {
left -= targetWidth;
tAttachment.left = 'left';
left += width;
eAttachment.left = 'left';
}
} else if (tAttachment.left === 'center') {
if (left + width > bounds[2] && eAttachment.left === 'left') {
left -= width;
eAttachment.left = 'right';
} else if (left < bounds[0] && eAttachment.left === 'right') {
left += width;
eAttachment.left = 'left';
}
}
}
if (changeAttachY === 'element' || changeAttachY === 'both') {
if (top < bounds[1] && eAttachment.top === 'bottom') {
top += height;
eAttachment.top = 'top';
}
if (top + height > bounds[3] && eAttachment.top === 'top') {
top -= height;
eAttachment.top = 'bottom';
}
}
if (changeAttachX === 'element' || changeAttachX === 'both') {
if (left < bounds[0] && eAttachment.left === 'right') {
left += width;
eAttachment.left = 'left';
}
if (left + width > bounds[2] && eAttachment.left === 'left') {
left -= width;
eAttachment.left = 'right';
}
}
if (typeof pin === 'string') {
pin = (function() {
var _len4, _m, _ref7, _results;
_ref7 = pin.split(',');
_results = [];
for (_m = 0, _len4 = _ref7.length; _m < _len4; _m++) {
p = _ref7[_m];
_results.push(p.trim());
}
return _results;
})();
} else if (pin === true) {
pin = ['top', 'left', 'right', 'bottom'];
}
pin || (pin = []);
pinned = [];
oob = [];
if (top < bounds[1]) {
if (__indexOf.call(pin, 'top') >= 0) {
top = bounds[1];
pinned.push('top');
} else {
oob.push('top');
}
}
if (top + height > bounds[3]) {
if (__indexOf.call(pin, 'bottom') >= 0) {
top = bounds[3] - height;
pinned.push('bottom');
} else {
oob.push('bottom');
}
}
if (left < bounds[0]) {
if (__indexOf.call(pin, 'left') >= 0) {
left = bounds[0];
pinned.push('left');
} else {
oob.push('left');
}
}
if (left + width > bounds[2]) {
if (__indexOf.call(pin, 'right') >= 0) {
left = bounds[2] - width;
pinned.push('right');
} else {
oob.push('right');
}
}
if (pinned.length) {
pinnedClass = (_ref7 = this.options.pinnedClass) != null ? _ref7 : this.getClass('pinned');
addClasses.push(pinnedClass);
for (_m = 0, _len4 = pinned.length; _m < _len4; _m++) {
side = pinned[_m];
addClasses.push("" + pinnedClass + "-" + side);
}
}
if (oob.length) {
oobClass = (_ref8 = this.options.outOfBoundsClass) != null ? _ref8 : this.getClass('out-of-bounds');
addClasses.push(oobClass);
for (_n = 0, _len5 = oob.length; _n < _len5; _n++) {
side = oob[_n];
addClasses.push("" + oobClass + "-" + side);
}
}
if (__indexOf.call(pinned, 'left') >= 0 || __indexOf.call(pinned, 'right') >= 0) {
eAttachment.left = tAttachment.left = false;
}
if (__indexOf.call(pinned, 'top') >= 0 || __indexOf.call(pinned, 'bottom') >= 0) {
eAttachment.top = tAttachment.top = false;
}
if (tAttachment.top !== targetAttachment.top || tAttachment.left !== targetAttachment.left || eAttachment.top !== this.attachment.top || eAttachment.left !== this.attachment.left) {
this.updateAttachClasses(eAttachment, tAttachment);
}
}
defer(function() {
updateClasses(_this.target, addClasses, allClasses);
return updateClasses(_this.element, addClasses, allClasses);
});
return {
top: top,
left: left
};
}
});
}).call(this);
(function() {
var defer, getBounds, updateClasses, _ref;
_ref = this.Tether.Utils, getBounds = _ref.getBounds, updateClasses = _ref.updateClasses, defer = _ref.defer;
this.Tether.modules.push({
position: function(_arg) {
var abutted, addClasses, allClasses, bottom, height, left, right, side, sides, targetPos, top, width, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref1, _ref2, _ref3, _ref4, _ref5,
_this = this;
top = _arg.top, left = _arg.left;
_ref1 = this.cache('element-bounds', function() {
return getBounds(_this.element);
}), height = _ref1.height, width = _ref1.width;
targetPos = this.getTargetBounds();
bottom = top + height;
right = left + width;
abutted = [];
if (top <= targetPos.bottom && bottom >= targetPos.top) {
_ref2 = ['left', 'right'];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
side = _ref2[_i];
if ((_ref3 = targetPos[side]) === left || _ref3 === right) {
abutted.push(side);
}
}
}
if (left <= targetPos.right && right >= targetPos.left) {
_ref4 = ['top', 'bottom'];
for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
side = _ref4[_j];
if ((_ref5 = targetPos[side]) === top || _ref5 === bottom) {
abutted.push(side);
}
}
}
allClasses = [];
addClasses = [];
sides = ['left', 'top', 'right', 'bottom'];
allClasses.push(this.getClass('abutted'));
for (_k = 0, _len2 = sides.length; _k < _len2; _k++) {
side = sides[_k];
allClasses.push("" + (this.getClass('abutted')) + "-" + side);
}
if (abutted.length) {
addClasses.push(this.getClass('abutted'));
}
for (_l = 0, _len3 = abutted.length; _l < _len3; _l++) {
side = abutted[_l];
addClasses.push("" + (this.getClass('abutted')) + "-" + side);
}
defer(function() {
updateClasses(_this.target, addClasses, allClasses);
return updateClasses(_this.element, addClasses, allClasses);
});
return true;
}
});
}).call(this);
(function() {
this.Tether.modules.push({
position: function(_arg) {
var left, result, shift, shiftLeft, shiftTop, top, _ref;
top = _arg.top, left = _arg.left;
if (!this.options.shift) {
return;
}
result = function(val) {
if (typeof val === 'function') {
return val.call(this, {
top: top,
left: left
});
} else {
return val;
}
};
shift = result(this.options.shift);
if (typeof shift === 'string') {
shift = shift.split(' ');
shift[1] || (shift[1] = shift[0]);
shiftTop = shift[0], shiftLeft = shift[1];
shiftTop = parseFloat(shiftTop, 10);
shiftLeft = parseFloat(shiftLeft, 10);
} else {
_ref = [shift.top, shift.left], shiftTop = _ref[0], shiftLeft = _ref[1];
}
top += shiftTop;
left += shiftLeft;
return {
top: top,
left: left
};
}
});
}).call(this);
root.Tether = this.Tether;
if (typeof define === 'function') {
define([],function() {
return root.Tether;
});
} else if (typeof exports === 'object') {
module.exports = root.Tether;
}
}(this));
return module.exports;
}).call(this);
// src/js/aui/internal/alignment.js
(typeof window === 'undefined' ? global : window).__7f7f043e79eda40786b37c019e773a73 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
var _tether = __0d21b368e7f0f2a3c26323bad4b7f3c9;
var _tether2 = _interopRequireDefault(_tether);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var ATTR_ALIGNMENT = 'alignment';
var ATTR_ALIGNMENT_STATIC = 'alignment-static';
var ATTR_CONTAINER = 'alignment-container';
var CLASS_PREFIX_ALIGNMENT = 'aui-alignment';
var CLASS_PREFIX_SIDE = 'aui-alignment-side-';
var CLASS_PREFIX_SNAP = 'aui-alignment-snap-';
var DEFAULT_ATTACHMENT = 'right middle';
var attachmentMap = {
'top left': { el: 'bottom left', target: 'top left' },
'top center': { el: 'bottom center', target: 'top center' },
'top right': { el: 'bottom right', target: 'top right' },
'right top': { el: 'top left', target: 'top right' },
'right middle': { el: 'middle left', target: 'middle right' },
'right bottom': { el: 'bottom left', target: 'bottom right' },
'bottom left': { el: 'top left', target: 'bottom left' },
'bottom center': { el: 'top center', target: 'bottom center' },
'bottom right': { el: 'top right', target: 'bottom right' },
'left top': { el: 'top right', target: 'top left' },
'left middle': { el: 'middle right', target: 'middle left' },
'left bottom': { el: 'bottom right', target: 'bottom left' },
'submenu left': { el: 'top left', target: 'top right' },
'submenu right': { el: 'top right', target: 'top left' }
};
function addAlignmentClasses(element, side, snap) {
var sideClass = CLASS_PREFIX_SIDE + side;
var snapClass = CLASS_PREFIX_SNAP + snap;
element.className += ' ' + sideClass + ' ' + snapClass;
}
function getAttribute(element, name) {
return element.getAttribute(name) || element.getAttribute('data-aui-' + name);
}
function hasAttribute(element, name) {
return element.hasAttribute(name) || element.hasAttribute('data-aui-' + name);
}
function getAlignment(element) {
var _split = (getAttribute(element, ATTR_ALIGNMENT) || DEFAULT_ATTACHMENT).split(' ');
var _split2 = _slicedToArray(_split, 2);
var side = _split2[0];
var snap = _split2[1];
return {
side: side,
snap: snap
};
}
function getContainer(element) {
var container = getAttribute(element, ATTR_CONTAINER) || window;
if (typeof container === 'string') {
container = document.querySelector(container);
}
return container;
}
function calculateBestAlignmentSnap(target, container) {
var snap = 'left';
if (!container || container === window || container === document) {
container = document.documentElement;
}
if (container && container.nodeType && container.nodeType === Node.ELEMENT_NODE) {
var containerBounds = container.getBoundingClientRect();
var targetBounds = target.getBoundingClientRect();
if (targetBounds.left > containerBounds.right / 2) {
snap = 'right';
}
}
return snap;
}
function getAttachment(side, snap) {
return attachmentMap[side + ' ' + snap] || attachmentMap[DEFAULT_ATTACHMENT];
}
function Alignment(element, target) {
var container = getContainer(element);
var alignment = getAlignment(element);
if (!alignment.snap || alignment.snap === 'auto') {
alignment.snap = calculateBestAlignmentSnap(target, container);
}
var attachment = getAttachment(alignment.side, alignment.snap);
var isStaticallyAligned = hasAttribute(element, ATTR_ALIGNMENT_STATIC);
var tether = new _tether2.default({
enabled: false,
element: element,
target: target,
attachment: attachment.el,
targetAttachment: attachment.target,
classPrefix: CLASS_PREFIX_ALIGNMENT,
constraints: [{
// Try and keep the element on page
to: container === window ? 'window' : container,
attachment: isStaticallyAligned === true ? 'none' : 'together'
}]
});
addAlignmentClasses(element, alignment.side, alignment.snap);
this._auiTether = tether;
}
Alignment.prototype = {
/**
* Stops aligning and cleans up.
*
* @returns {Alignment}
*/
destroy: function destroy() {
this._auiTether.destroy();
return this;
},
/**
* Disables alignment.
*
* @returns {Alignment}
*/
disable: function disable() {
this._auiTether.disable();
return this;
},
/**
* Enables alignment.
*
* @returns {Alignment}
*/
enable: function enable() {
this._auiTether.enable();
return this;
}
};
exports.default = Alignment;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/polyfills/custom-event.js
(typeof window === 'undefined' ? global : window).__4fd313fd13ed5545ff46e399b0c39c9c = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var CustomEvent = undefined;
(function () {
if (window.CustomEvent) {
// Some browsers don't support constructable custom events yet.
try {
var ce = new window.CustomEvent('name', {
bubbles: false,
cancelable: true,
detail: {
x: 'y'
}
});
ce.preventDefault();
if (ce.defaultPrevented !== true) {
throw new Error('Could not prevent default');
}
if (ce.type !== 'name') {
throw new Error('Could not set custom name');
}
if (ce.detail.x !== 'y') {
throw new Error('Could not set detail');
}
CustomEvent = window.CustomEvent;
return;
} catch (e) {
// polyfill it
}
}
/**
* @type CustomEvent
* @param {String} event - the name of the event.
* @param {Object} [params] - optional configuration of the custom event.
* @param {Boolean} [params.cancelable=false] - A boolean indicating whether the event is cancelable (i.e., can call preventDefault and set the defaultPrevented property).
* @param {Boolean} [params.bubbles=false] - A boolean indicating whether the event bubbles up through the DOM or not.
* @param {Boolean} [params.detail] - The data passed when initializing the event.
* @extends Event
* @returns {Event}
* @constructor
*/
CustomEvent = function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, !!params.bubbles, !!params.cancelable, params.detail);
var origPrevent = evt.preventDefault;
evt.preventDefault = function () {
origPrevent.call(this);
try {
Object.defineProperty(this, 'defaultPrevented', {
get: function get() {
return true;
}
});
} catch (e) {
this.defaultPrevented = true;
}
};
return evt;
};
CustomEvent.prototype = window.Event.prototype;
})();
exports.default = CustomEvent;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/blanket.js
(typeof window === 'undefined' ? global : window).__95ebb2a3f0f35fb58e804b4a93a4e8a4 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.undim = exports.dim = undefined;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _animation = __807874eed859505f99b772f26b5c11af;
var _createElement = __e3011d5cc5ea8e104654a5f8ae95cfba;
var _createElement2 = _interopRequireDefault(_createElement);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var $overflowEl;
var _hiddenByAui = [];
/**
* Dims the screen using a blanket div
* @param useShim deprecated, it is calculated by dim() now
*/
function dim(useShim, zIndex) {
//if we're blanketing the page it means we want to hide the whatever is under the blanket from the screen readers as well
function hasAriaHidden(element) {
return element.getAttribute('aria-hidden') ? true : false;
}
function isAuiLayer(element) {
return element.className.match(/\baui-layer\b/) ? true : false;
}
_hiddenByAui = [];
Array.prototype.forEach.call(document.body.children, function (element) {
if (!hasAriaHidden(element) && !isAuiLayer(element)) {
element.setAttribute('aria-hidden', 'true');
_hiddenByAui.push(element);
}
});
if (!$overflowEl) {
$overflowEl = (0, _jquery2.default)(document.body);
}
if (useShim === true) {
useShimDeprecationLogger();
}
var isBlanketShowing = !!dim.$dim && dim.$dim.attr('aria-hidden') === 'false';
if (!!dim.$dim) {
dim.$dim.remove();
dim.$dim = null;
}
dim.$dim = (0, _createElement2.default)('div').addClass('aui-blanket');
dim.$dim.attr('tabindex', '0'); //required, or the last element's focusout event will go to the browser
dim.$dim.appendTo(document.body);
if (!isBlanketShowing) {
//recompute after insertion and before setting aria-hidden=false to ensure we calculate a difference in
//computed styles
(0, _animation.recomputeStyle)(dim.$dim);
dim.cachedOverflow = $overflowEl.css('overflow');
$overflowEl.css('overflow', 'hidden');
}
dim.$dim.attr('aria-hidden', 'false');
if (zIndex) {
dim.$dim.css({ zIndex: zIndex });
}
return dim.$dim;
}
/**
* Removes semitransparent DIV
* @see dim
*/
function undim() {
_hiddenByAui.forEach(function (element) {
element.removeAttribute('aria-hidden');
});
if (dim.$dim) {
dim.$dim.attr('aria-hidden', 'true');
$overflowEl && $overflowEl.css('overflow', dim.cachedOverflow);
}
}
var useShimDeprecationLogger = (0, _deprecation.getMessageLogger)('useShim', {
extraInfo: 'useShim has no alternative as it is now calculated by dim().'
});
(0, _globalize2.default)('dim', dim);
(0, _globalize2.default)('undim', undim);
exports.dim = dim;
exports.undim = undim;
return module.exports;
}).call(this);
// src/js/aui/focus-manager.js
(typeof window === 'undefined' ? global : window).__759181f5486f2a331b3f4fb52b7b6e5a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(function initSelectors() {
/*
:tabbable and :focusable functions from jQuery UI v 1.10.4
renamed to :aui-tabbable and :aui-focusable to not clash with jquery-ui if it's included.
Code modified slightly to be compatible with jQuery < 1.8
.addBack() replaced with .andSelf()
$.curCSS() replaced with $.css()
*/
function visible(element) {
return _jquery2.default.css(element, 'visibility') === 'visible';
}
function focusable(element, isTabIndexNotNaN) {
var nodeName = element.nodeName.toLowerCase();
if (nodeName === 'aui-select') {
return true;
}
if (nodeName === 'area') {
var map = element.parentNode;
var mapName = map.name;
var imageMap = (0, _jquery2.default)('img[usemap=#' + mapName + ']').get();
if (!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') {
return false;
}
return imageMap && visible(imageMap);
}
var isFormElement = /input|select|textarea|button|object/.test(nodeName);
var isAnchor = nodeName === 'a';
var isAnchorTabbable = element.href || isTabIndexNotNaN;
return (isFormElement ? !element.disabled : isAnchor ? isAnchorTabbable : isTabIndexNotNaN) && visible(element);
}
function tabbable(element) {
var tabIndex = _jquery2.default.attr(element, 'tabindex'),
isTabIndexNaN = isNaN(tabIndex);
var hasTabIndex = isTabIndexNaN || tabIndex >= 0;
return hasTabIndex && focusable(element, !isTabIndexNaN);
}
_jquery2.default.extend(_jquery2.default.expr[':'], {
'aui-focusable': function auiFocusable(element) {
return focusable(element, !isNaN(_jquery2.default.attr(element, 'tabindex')));
},
'aui-tabbable': tabbable
});
})();
var RESTORE_FOCUS_DATA_KEY = '_aui-focus-restore';
function FocusManager() {
this._focusTrapStack = [];
(0, _jquery2.default)(document).on('focusout', { focusTrapStack: this._focusTrapStack }, focusTrapHandler);
}
FocusManager.defaultFocusSelector = ':aui-tabbable';
FocusManager.prototype.enter = function ($el) {
// remember focus on old element
$el.data(RESTORE_FOCUS_DATA_KEY, (0, _jquery2.default)(document.activeElement));
// focus on new selector
if ($el.attr('data-aui-focus') !== 'false') {
var focusSelector = $el.attr('data-aui-focus-selector') || FocusManager.defaultFocusSelector;
var $focusEl = $el.is(focusSelector) ? $el : $el.find(focusSelector);
$focusEl.first().focus();
}
if (elementTrapsFocus($el)) {
trapFocus($el, this._focusTrapStack);
}
};
function trapFocus($el, focusTrapStack) {
focusTrapStack.push($el);
}
function untrapFocus(focusTrapStack) {
focusTrapStack.pop();
}
function elementTrapsFocus($el) {
return $el.is('.aui-dialog2');
}
FocusManager.prototype.exit = function ($el) {
if (elementTrapsFocus($el)) {
untrapFocus(this._focusTrapStack);
}
// AUI-1059: remove focus from the active element when dialog is hidden
var activeElement = document.activeElement;
if ($el[0] === activeElement || $el.has(activeElement).length) {
(0, _jquery2.default)(activeElement).blur();
}
var $restoreFocus = $el.data(RESTORE_FOCUS_DATA_KEY);
if ($restoreFocus && $restoreFocus.length) {
$el.removeData(RESTORE_FOCUS_DATA_KEY);
$restoreFocus.focus();
}
};
function focusTrapHandler(event) {
var focusTrapStack = event.data.focusTrapStack;
if (!event.relatedTarget) {
//Does not work in firefox, see https://bugzilla.mozilla.org/show_bug.cgi?id=687787
return;
}
if (focusTrapStack.length === 0) {
return;
}
var $focusTrapElement = focusTrapStack[focusTrapStack.length - 1];
var focusOrigin = event.target;
var focusTo = event.relatedTarget;
var $tabbableElements = $focusTrapElement.find(':aui-tabbable');
var $firstTabbableElement = (0, _jquery2.default)($tabbableElements.first());
var $lastTabbableElement = (0, _jquery2.default)($tabbableElements.last());
var elementContainsOrigin = $focusTrapElement.has(focusTo).length === 0;
var focusLeavingElement = elementContainsOrigin && focusTo;
if (focusLeavingElement) {
if ($firstTabbableElement.is(focusOrigin)) {
$lastTabbableElement.focus();
} else if ($lastTabbableElement.is(focusOrigin)) {
$firstTabbableElement.focus();
}
}
}
FocusManager.global = new FocusManager();
(0, _globalize2.default)('FocusManager', FocusManager);
exports.default = FocusManager;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/widget.js
(typeof window === 'undefined' ? global : window).__752544d9d409a7f0b49e4d93aaa96cc5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (name, Ctor) {
var dataAttr = '_aui-widget-' + name;
return function (selectorOrOptions, maybeOptions) {
var selector;
var options;
if (_jquery2.default.isPlainObject(selectorOrOptions)) {
options = selectorOrOptions;
} else {
selector = selectorOrOptions;
options = maybeOptions;
}
var $el = selector && (0, _jquery2.default)(selector);
var widget;
if (!$el || !$el.data(dataAttr)) {
widget = new Ctor($el, options || {});
$el = widget.$el;
$el.data(dataAttr, widget);
} else {
widget = $el.data(dataAttr);
// options are discarded if $el has already been constructed
}
return widget;
};
};
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
module.exports = exports['default'];
/**
* @param {string} name The name of the widget to use in any messaging.
* @param {function(new:{ $el: jQuery }, ?jQuery, ?Object)} Ctor
* A constructor which will only ever be called with "new". It must take a JQuery object as the first
* parameter, or generate one if not provided. The second parameter will be a configuration object.
* The returned object must have an $el property and a setOptions function.
* @constructor
*/
return module.exports;
}).call(this);
// src/js/aui/layer.js
(typeof window === 'undefined' ? global : window).__03a7b88a7168f9cd8454c54888461782 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _blanket = __95ebb2a3f0f35fb58e804b4a93a4e8a4;
var _focusManager = __759181f5486f2a331b3f4fb52b7b6e5a;
var _focusManager2 = _interopRequireDefault(_focusManager);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _keyCode = __441232d78236eb4e37336c273cdfa555;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _widget = __752544d9d409a7f0b49e4d93aaa96cc5;
var _widget2 = _interopRequireDefault(_widget);
var _customEvent = __4fd313fd13ed5545ff46e399b0c39c9c;
var _customEvent2 = _interopRequireDefault(_customEvent);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var EVENT_PREFIX = '_aui-internal-layer-';
var GLOBAL_EVENT_PREFIX = '_aui-internal-layer-global-';
var LAYER_EVENT_PREFIX = 'aui-layer-';
var AUI_EVENT_PREFIX = 'aui-';
var $doc = (0, _jquery2.default)(document);
// AUI-3708 - Abstracted to reflect code implemented upstream.
function isTransitioning(el, prop) {
var transition = window.getComputedStyle(el).transitionProperty;
return transition ? transition.indexOf(prop) > -1 : false;
}
function onTransitionEnd(el, prop, func, once) {
function handler(e) {
if (prop !== e.propertyName) {
return;
}
func.call(el);
if (once) {
el.removeEventListener('transitionend', handler);
}
}
if (isTransitioning(el, prop)) {
el.addEventListener('transitionend', handler);
} else {
func.call(el);
}
}
function oneTransitionEnd(el, prop, func) {
onTransitionEnd(el, prop, func, true);
}
// end AUI-3708
function ariaHide($el) {
$el.attr('aria-hidden', 'true');
}
function ariaShow($el) {
$el.attr('aria-hidden', 'false');
}
/**
* @return {bool} Returns false if at least one of the event handlers called .preventDefault(). Returns true otherwise.
*/
function triggerEvent($el, deprecatedName, newNativeName) {
var e1 = _jquery2.default.Event(EVENT_PREFIX + deprecatedName);
var e2 = _jquery2.default.Event(GLOBAL_EVENT_PREFIX + deprecatedName);
// TODO: Remove this 'aui-layer-' prefixed event once it is no longer used by inline dialog and dialog2.
var nativeEvent = new _customEvent2.default(LAYER_EVENT_PREFIX + newNativeName, {
bubbles: true,
cancelable: true
});
var nativeEvent2 = new _customEvent2.default(AUI_EVENT_PREFIX + newNativeName, {
bubbles: true,
cancelable: true
});
$el.trigger(e1);
$el.trigger(e2, [$el]);
$el[0].dispatchEvent(nativeEvent);
$el[0].dispatchEvent(nativeEvent2);
return !e1.isDefaultPrevented() && !e2.isDefaultPrevented() && !nativeEvent.defaultPrevented && !nativeEvent2.defaultPrevented;
}
function Layer(selector) {
this.$el = (0, _jquery2.default)(selector || '<div class="aui-layer" aria-hidden="true"></div>');
this.$el.addClass('aui-layer');
}
Layer.prototype = {
/**
* Returns the layer below the current layer if it exists.
*
* @returns {jQuery | undefined}
*/
below: function below() {
return LayerManager.global.item(LayerManager.global.indexOf(this.$el) - 1);
},
/**
* Returns the layer above the current layer if it exists.
*
* @returns {jQuery | undefined}
*/
above: function above() {
return LayerManager.global.item(LayerManager.global.indexOf(this.$el) + 1);
},
/**
* Sets the width and height of the layer.
*
* @param {Integer} width The width to set.
* @param {Integer} height The height to set.
*
* @returns {Layer}
*/
changeSize: function changeSize(width, height) {
this.$el.css('width', width);
this.$el.css('height', height === 'content' ? '' : height);
return this;
},
/**
* Binds a layer event.
*
* @param {String} event The event name to listen to.
* @param {Function} fn The event handler.
*
* @returns {Layer}
*/
on: function on(event, fn) {
this.$el.on(EVENT_PREFIX + event, fn);
return this;
},
/**
* Unbinds a layer event.
*
* @param {String} event The event name to unbind=.
* @param {Function} fn Optional. The event handler.
*
* @returns {Layer}
*/
off: function off(event, fn) {
this.$el.off(EVENT_PREFIX + event, fn);
return this;
},
/**
* Shows the layer.
*
* @returns {Layer}
*/
show: function show() {
if (this.isVisible()) {
ariaShow(this.$el);
return this;
}
if (!triggerEvent(this.$el, 'beforeShow', 'show')) {
return this;
}
// AUI-3708
// Ensures that the display property is removed if it's been added
// during hiding.
if (this.$el.css('display') === 'none') {
this.$el.css('display', '');
}
LayerManager.global.push(this.$el);
return this;
},
/**
* Hides the layer.
*
* @returns {Layer}
*/
hide: function hide() {
if (!this.isVisible()) {
ariaHide(this.$el);
return this;
}
if (!triggerEvent(this.$el, 'beforeHide', 'hide')) {
return this;
}
// AUI-3708
oneTransitionEnd(this.$el.get(0), 'opacity', function () {
this.style.display = 'none';
});
LayerManager.global.popUntil(this.$el);
return this;
},
/**
* Checks to see if the layer is visible.
*
* @returns {Boolean}
*/
isVisible: function isVisible() {
return this.$el.attr('aria-hidden') === 'false';
},
/**
* Removes the layer and cleans up internal state.
*
* @returns {undefined}
*/
remove: function remove() {
this.hide();
this.$el.remove();
this.$el = null;
},
/**
* Returns whether or not the layer is blanketed.
*
* @returns {Boolean}
*/
isBlanketed: function isBlanketed() {
return this.$el.attr('data-aui-blanketed') === 'true';
},
/**
* Returns whether or not the layer is persistent.
*
* @returns {Boolean}
*/
isPersistent: function isPersistent() {
var modal = this.$el.attr('modal') || this.$el.attr('data-aui-modal');
var isPersistent = this.$el[0].hasAttribute('persistent');
return modal === 'true' || isPersistent;
},
_hideLayer: function _hideLayer(triggerBeforeEvents) {
if (this.isPersistent() || this.isBlanketed()) {
_focusManager2.default.global.exit(this.$el);
}
if (triggerBeforeEvents) {
triggerEvent(this.$el, 'beforeHide', 'hide');
}
this.$el.attr('aria-hidden', 'true');
this.$el.css('z-index', this.$el.data('_aui-layer-cached-z-index') || '');
this.$el.data('_aui-layer-cached-z-index', '');
this.$el.trigger(EVENT_PREFIX + 'hide');
this.$el.trigger(GLOBAL_EVENT_PREFIX + 'hide', [this.$el]);
},
_showLayer: function _showLayer(zIndex) {
if (!this.$el.parent().is('body')) {
this.$el.appendTo(document.body);
}
this.$el.data('_aui-layer-cached-z-index', this.$el.css('z-index'));
this.$el.css('z-index', zIndex);
this.$el.attr('aria-hidden', 'false');
if (this.isPersistent() || this.isBlanketed()) {
_focusManager2.default.global.enter(this.$el);
}
this.$el.trigger(EVENT_PREFIX + 'show');
this.$el.trigger(GLOBAL_EVENT_PREFIX + 'show', [this.$el]);
}
};
var createLayer = (0, _widget2.default)('layer', Layer);
createLayer.on = function (eventName, selector, fn) {
$doc.on(GLOBAL_EVENT_PREFIX + eventName, selector, fn);
return this;
};
createLayer.off = function (eventName, selector, fn) {
$doc.off(GLOBAL_EVENT_PREFIX + eventName, selector, fn);
return this;
};
// Layer Manager
// -------------
/**
* Manages layers.
*
* There is a single global layer manager.
* Additional instances can be created however this should generally only be used in tests.
*
* Layers are added by the push($el) method. Layers are removed by the
* popUntil($el) method.
*
* popUntil's contract is that it pops all layers above & including the given
* layer. This is used to support popping multiple layers.
* Say we were showing a dropdown inside an inline dialog inside a dialog - we
* have a stack of dialog layer, inline dialog layer, then dropdown layer. Calling
* popUntil(dialog.$el) would hide all layers above & including the dialog.
*/
function getTrigger($layer) {
return (0, _jquery2.default)('[aria-controls="' + $layer.attr('id') + '"]');
}
function hasTrigger($layer) {
return getTrigger($layer).length > 0;
}
function topIndexWhere(layerArr, fn) {
var i = layerArr.length;
while (i--) {
if (fn(layerArr[i])) {
return i;
}
}
return -1;
}
function layerIndex(layerArr, $el) {
return topIndexWhere(layerArr, function ($layer) {
return $layer[0] === $el[0];
});
}
function topBlanketedIndex(layerArr) {
return topIndexWhere(layerArr, function ($layer) {
return createLayer($layer).isBlanketed();
});
}
function nextZIndex(layerArr) {
var _nextZIndex;
if (layerArr.length) {
var $topEl = layerArr[layerArr.length - 1];
var zIndex = parseInt($topEl.css('z-index'), 10);
_nextZIndex = (isNaN(zIndex) ? 0 : zIndex) + 100;
} else {
_nextZIndex = 0;
}
return Math.max(3000, _nextZIndex);
}
function updateBlanket(stack, oldBlanketIndex) {
var newTopBlanketedIndex = topBlanketedIndex(stack);
if (oldBlanketIndex !== newTopBlanketedIndex) {
if (newTopBlanketedIndex > -1) {
(0, _blanket.dim)(false, stack[newTopBlanketedIndex].css('z-index') - 20);
} else {
(0, _blanket.undim)();
}
}
}
function popLayers(stack, stopIndex, forceClosePersistent) {
if (stopIndex < 0) {
return;
}
for (var a = stack.length - 1; a >= stopIndex; a--) {
var $layer = stack[a];
var layer = createLayer($layer);
if (forceClosePersistent || !layer.isPersistent()) {
layer._hideLayer(true);
stack.splice(a, 1);
}
}
}
function getParentLayer($childLayer) {
var $layerTrigger = getTrigger($childLayer);
if ($layerTrigger.length > 0) {
return $layerTrigger.closest('.aui-layer');
}
}
function LayerManager() {
this._stack = [];
}
LayerManager.prototype = {
/**
* Pushes a layer onto the stack. The same element cannot be opened as a layer multiple times - if the given
* element is already an open layer, this method throws an exception.
*
* @param {HTMLElement | String | jQuery} element The element to push onto the stack.
*
* @returns {LayerManager}
*/
push: function push(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
if (layerIndex(this._stack, $el) >= 0) {
throw new Error('The given element is already an active layer.');
}
this.popLayersBeside($el);
var layer = createLayer($el);
var zIndex = nextZIndex(this._stack);
layer._showLayer(zIndex);
if (layer.isBlanketed()) {
(0, _blanket.dim)(false, zIndex - 20);
}
this._stack.push($el);
return this;
},
popLayersBeside: function popLayersBeside(element) {
var $layer = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
if (!hasTrigger($layer)) {
// We can't find this layer's trigger, we will pop all non-persistent until a blanket or the document
var blanketedIndex = topBlanketedIndex(this._stack);
popLayers(this._stack, ++blanketedIndex, false);
return;
}
var $parentLayer = getParentLayer($layer);
if ($parentLayer) {
var parentIndex = this.indexOf($parentLayer);
popLayers(this._stack, ++parentIndex, false);
} else {
popLayers(this._stack, 0, false);
}
},
/**
* Returns the index of the specified layer in the layer stack.
*
* @param {HTMLElement | String | jQuery} element The element to find in the stack.
*
* @returns {Number} the (zero-based) index of the element, or -1 if not in the stack.
*/
indexOf: function indexOf(element) {
return layerIndex(this._stack, (0, _jquery2.default)(element));
},
/**
* Returns the item at the particular index or false.
*
* @param {Number} index The index of the element to get.
*
* @returns {jQuery | Boolean}
*/
item: function item(index) {
return this._stack[index];
},
/**
* Hides all layers in the stack.
*
* @returns {LayerManager}
*/
hideAll: function hideAll() {
this._stack.reverse().forEach(function (element) {
var layer = createLayer(element);
if (layer.isBlanketed() || layer.isPersistent()) {
return;
}
layer.hide();
});
return this;
},
/**
* Gets the previous layer below the given layer, which is non modal and non persistent. If it finds a blanketed layer on the way
* it returns it regardless if it is modal or not
*
* @param {HTMLElement | String | jQuery} element layer to start the search from.
*
* @returns {jQuery | null} the next matching layer or null if none found.
*/
getNextLowerNonPersistentOrBlanketedLayer: function getNextLowerNonPersistentOrBlanketedLayer(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
var index = layerIndex(this._stack, $el);
if (index < 0) {
return null;
}
var $nextEl;
index--;
while (index >= 0) {
$nextEl = this._stack[index];
var layer = createLayer($nextEl);
if (!layer.isPersistent() || layer.isBlanketed()) {
return $nextEl;
}
index--;
}
return null;
},
/**
* Gets the next layer which is neither modal or blanketed, from the given layer.
*
* @param {HTMLElement | String | jQuery} element layer to start the search from.
*
* @returns {jQuery | null} the next non modal non blanketed layer or null if none found.
*/
getNextHigherNonPeristentAndNonBlanketedLayer: function getNextHigherNonPeristentAndNonBlanketedLayer(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
var index = layerIndex(this._stack, $el);
if (index < 0) {
return null;
}
var $nextEl;
index++;
while (index < this._stack.length) {
$nextEl = this._stack[index];
var layer = createLayer($nextEl);
if (!(layer.isPersistent() || layer.isBlanketed())) {
return $nextEl;
}
index++;
}
return null;
},
/**
* Removes all non-modal layers above & including the given element. If the given element is not an active layer, this method
* is a no-op. The given element will be removed regardless of whether or not it is modal.
*
* @param {HTMLElement | String | jQuery} element layer to pop.
*
* @returns {jQuery} The last layer that was popped, or null if no layer matching the given $el was found.
*/
popUntil: function popUntil(element) {
var $el = element instanceof _jquery2.default ? element : (0, _jquery2.default)(element);
var index = layerIndex(this._stack, $el);
if (index === -1) {
return null;
}
var oldTopBlanketedIndex = topBlanketedIndex(this._stack);
// Removes all layers above the current one.
popLayers(this._stack, index + 1, createLayer($el).isBlanketed());
// Removes the current layer.
createLayer($el)._hideLayer();
this._stack.splice(index, 1);
updateBlanket(this._stack, oldTopBlanketedIndex);
return $el;
},
/**
* Gets the top layer, if it exists.
*
* @returns The layer on top of the stack, if it exists, otherwise null.
*/
getTopLayer: function getTopLayer() {
if (!this._stack.length) {
return null;
}
var $topLayer = this._stack[this._stack.length - 1];
return $topLayer;
},
/**
* Pops the top layer, if it exists and it is non modal and non persistent.
*
* @returns The layer that was popped, if it was popped.
*/
popTopIfNonPersistent: function popTopIfNonPersistent() {
var $topLayer = this.getTopLayer();
var layer = createLayer($topLayer);
if (!$topLayer || layer.isPersistent()) {
return null;
}
return this.popUntil($topLayer);
},
/**
* Pops all layers above and including the top blanketed layer. If layers exist but none are blanketed, this method
* does nothing.
*
* @returns The blanketed layer that was popped, if it exists, otherwise null.
*/
popUntilTopBlanketed: function popUntilTopBlanketed() {
var i = topBlanketedIndex(this._stack);
if (i < 0) {
return null;
}
var $topBlanketedLayer = this._stack[i];
var layer = createLayer($topBlanketedLayer);
if (layer.isPersistent()) {
// We can't pop the blanketed layer, only the things ontop
var $next = this.getNextHigherNonPeristentAndNonBlanketedLayer($topBlanketedLayer);
if ($next) {
var stopIndex = layerIndex(this._stack, $next);
popLayers(this._stack, stopIndex, true);
return $next;
}
return null;
}
popLayers(this._stack, i, true);
updateBlanket(this._stack, i);
return $topBlanketedLayer;
},
/**
* Pops all layers above and including the top persistent layer. If layers exist but none are persistent, this method
* does nothing.
*/
popUntilTopPersistent: function popUntilTopPersistent() {
var $toPop = LayerManager.global.getTopLayer();
if (!$toPop) {
return;
}
var stopIndex;
var oldTopBlanketedIndex = topBlanketedIndex(this._stack);
var toPop = createLayer($toPop);
if (toPop.isPersistent()) {
if (toPop.isBlanketed()) {
return;
} else {
// Get the closest non modal layer below, stop at the first blanketed layer though, we don't want to pop below that
$toPop = LayerManager.global.getNextLowerNonPersistentOrBlanketedLayer($toPop);
toPop = createLayer($toPop);
if ($toPop && !toPop.isPersistent()) {
stopIndex = layerIndex(this._stack, $toPop);
popLayers(this._stack, stopIndex, true);
updateBlanket(this._stack, oldTopBlanketedIndex);
} else {
// Here we have a blanketed persistent layer
return;
}
}
} else {
stopIndex = layerIndex(this._stack, $toPop);
popLayers(this._stack, stopIndex, true);
updateBlanket(this._stack, oldTopBlanketedIndex);
}
}
};
// LayerManager.global
// -------------------
function initCloseLayerOnEscPress() {
$doc.on('keydown', function (e) {
if (e.keyCode === _keyCode2.default.ESCAPE) {
LayerManager.global.popUntilTopPersistent();
e.preventDefault();
}
});
}
function initCloseLayerOnBlanketClick() {
$doc.on('click', '.aui-blanket', function (e) {
if (LayerManager.global.popUntilTopBlanketed()) {
e.preventDefault();
}
});
}
function hasLayer($trigger) {
if (!$trigger.length) {
return false;
}
var layer = document.getElementById($trigger.attr('aria-controls'));
return LayerManager.global.indexOf(layer) > -1;
}
// If it's a click on a trigger, do nothing.
// If it's a click on a layer, close all layers above.
// Otherwise, close all layers.
function initCloseLayerOnOuterClick() {
$doc.on('click', function (e) {
var $target = (0, _jquery2.default)(e.target);
if ($target.closest('.aui-blanket').length) {
return;
}
var $trigger = $target.closest('[aria-controls]');
var $layer = $target.closest('.aui-layer');
if (!$layer.length && !hasLayer($trigger)) {
LayerManager.global.hideAll();
return;
}
// Triggers take precedence over layers
if (hasLayer($trigger)) {
return;
}
if ($layer.length) {
// We dont want to explicitly call close on a modal dialog if it happens to be next.
// All blanketed layers should be below us, as otherwise the blanket should have caught the click.
// We make sure we dont close a blanketed one explicitly as a hack, this is to fix the problem arising
// from dialog2 triggers inside dialog2's having no aria controls, where the dialog2 that was just
// opened would be closed instantly
var $next = LayerManager.global.getNextHigherNonPeristentAndNonBlanketedLayer($layer);
if ($next) {
createLayer($next).hide();
}
}
});
}
initCloseLayerOnEscPress();
initCloseLayerOnBlanketClick();
initCloseLayerOnOuterClick();
LayerManager.global = new LayerManager();
createLayer.Manager = LayerManager;
(0, _globalize2.default)('layer', createLayer);
exports.default = createLayer;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/state.js
(typeof window === 'undefined' ? global : window).__239fd6e6c2ce37e6d305d5cbd575f16e = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function state(element) {
return {
/**
* sets an internal state on a component element
* @param element the element to which the state will be added
* @param stateName the name of the state
* @param stateValue the value that the state will be changed to
*/
set: function set(stateName, stateValue) {
if (element._state === undefined) {
element._state = {};
}
element._state[stateName] = stateValue;
},
/**
* gets an internal state on a component element
* @param element the element to which the state will be added
* @param stateName the name of the state
*/
get: function get(stateName) {
if (element._state) {
return element._state[stateName];
}
}
};
}
exports.default = state;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/dropdown2.js
(typeof window === 'undefined' ? global : window).__7e63119dfd3f3739f4398a6e423ef6dd = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
__8d80b2996ccf75cdbe997a5c7cbb4b40;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _skatejsTemplateHtml = __10cd74f6112c3c1d2c570837676652d5;
var _skatejsTemplateHtml2 = _interopRequireDefault(_skatejsTemplateHtml);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _debounce = __cbf395035bbc83bf2d130a559590a472;
var _browser = __3eaf0cc9c7cf905b4f8bdef7a1985811;
var _alignment = __7f7f043e79eda40786b37c019e773a73;
var _alignment2 = _interopRequireDefault(_alignment);
var _customEvent = __4fd313fd13ed5545ff46e399b0c39c9c;
var _customEvent2 = _interopRequireDefault(_customEvent);
var _keyCode = __441232d78236eb4e37336c273cdfa555;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _layer = __03a7b88a7168f9cd8454c54888461782;
var _layer2 = _interopRequireDefault(_layer);
var _state = __239fd6e6c2ce37e6d305d5cbd575f16e;
var _state2 = _interopRequireDefault(_state);
var _skate = __49ca30b6a02e1b6245e9234f1d2b19e4;
var _skate2 = _interopRequireDefault(_skate);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function isChecked(el) {
return (0, _jquery2.default)(el).is('.checked, .aui-dropdown2-checked, [aria-checked="true"]');
}
function getTrigger(control) {
return (0, _jquery2.default)('[aria-controls="' + control.id + '"]')[0];
}
function doIfTrigger(triggerable, callback) {
var trigger = getTrigger(triggerable);
if (trigger) {
callback(trigger);
}
}
function setDropdownTriggerActiveState(trigger, isActive) {
var $trigger = (0, _jquery2.default)(trigger);
if (isActive) {
$trigger.attr('aria-expanded', 'true');
$trigger.addClass('active aui-dropdown2-active');
} else {
$trigger.attr('aria-expanded', 'false');
$trigger.removeClass('active aui-dropdown2-active');
}
}
// LOADING STATES
var UNLOADED = 'unloaded';
var LOADING = 'loading';
var ERROR = 'error';
var SUCCESS = 'success';
// ASYNC DROPDOWN FUNCTIONS
function makeAsyncDropdownContents(json) {
var dropdownContents = json.map(function makeSection(sectionData) {
var sectionItemsHtml = sectionData.items.map(function makeSectionItem(itemData) {
function makeBooleanAttribute(attr) {
return itemData[attr] ? attr + ' ="true"' : '';
}
function makeAttribute(attr) {
return itemData[attr] ? attr + '="' + itemData[attr] + '"' : '';
}
var tagName = 'aui-item-' + itemData.type;
var itemHtml = '\n <' + tagName + ' ' + makeAttribute('for') + ' ' + makeAttribute('href') + ' ' + makeBooleanAttribute('interactive') + '\n ' + makeBooleanAttribute('checked') + ' ' + makeBooleanAttribute('disabled') + ' ' + makeBooleanAttribute('hidden') + '>\n ' + itemData.content + '\n </' + tagName + '>';
return itemHtml;
}).join('');
var sectionAttributes = sectionData.label ? 'label="' + sectionData.label + '"' : '';
var sectionHtml = '\n <aui-section ' + sectionAttributes + '>\n ' + sectionItemsHtml + '\n </aui-section>';
return sectionHtml;
}).join('\n');
return dropdownContents;
}
function setDropdownContents(dropdown, json) {
(0, _state2.default)(dropdown).set('loading-state', SUCCESS);
_skatejsTemplateHtml2.default.wrap(dropdown).innerHTML = makeAsyncDropdownContents(json);
_skate2.default.init(dropdown);
}
function setDropdownErrorState(dropdown) {
(0, _state2.default)(dropdown).set('loading-state', ERROR);
(0, _state2.default)(dropdown).set('hasErrorBeenShown', dropdown.isVisible());
_skatejsTemplateHtml2.default.wrap(dropdown).innerHTML = '\n <div class="aui-message aui-message-error aui-dropdown-error">\n <p>' + AJS.I18n.getText('aui.dropdown.async.error') + '</p>\n </div>\n ';
}
function setDropdownLoadingState(dropdown) {
(0, _state2.default)(dropdown).set('loading-state', LOADING);
(0, _state2.default)(dropdown).set('hasErrorBeenShown', false);
doIfTrigger(dropdown, function (trigger) {
trigger.setAttribute('aria-busy', 'true');
});
_skatejsTemplateHtml2.default.wrap(dropdown).innerHTML = '\n <div class="aui-dropdown-loading">\n <span class="spinner"></span> ' + AJS.I18n.getText('aui.dropdown.async.loading') + '\n </div>\n ';
(0, _jquery2.default)(dropdown).find('.spinner').spin();
}
function setDropdownLoaded(dropdown) {
doIfTrigger(dropdown, function (trigger) {
trigger.setAttribute('aria-busy', 'false');
});
}
function loadContentsIfAsync(dropdown) {
if (!dropdown.src || (0, _state2.default)(dropdown).get('loading-state') === LOADING) {
return;
}
setDropdownLoadingState(dropdown);
_jquery2.default.ajax(dropdown.src).done(function (json, status, xhr) {
var isValidStatus = xhr.status === 200;
if (isValidStatus) {
setDropdownContents(dropdown, json);
} else {
setDropdownErrorState(dropdown);
}
}).fail(function () {
setDropdownErrorState(dropdown);
}).always(function () {
setDropdownLoaded(dropdown);
});
}
function loadContentWhenMouseEnterTrigger(dropdown) {
var isDropdownUnloaded = (0, _state2.default)(dropdown).get('loading-state') === UNLOADED;
var hasCurrentErrorBeenShown = (0, _state2.default)(dropdown).get('hasErrorBeenShown');
if (isDropdownUnloaded || hasCurrentErrorBeenShown && !dropdown.isVisible()) {
loadContentsIfAsync(dropdown);
}
}
function loadContentWhenMenuShown(dropdown) {
var isDropdownUnloaded = (0, _state2.default)(dropdown).get('loading-state') === UNLOADED;
var hasCurrentErrorBeenShown = (0, _state2.default)(dropdown).get('hasErrorBeenShown');
if (isDropdownUnloaded || hasCurrentErrorBeenShown) {
loadContentsIfAsync(dropdown);
}
if ((0, _state2.default)(dropdown).get('loading-state') === ERROR) {
(0, _state2.default)(dropdown).set('hasErrorBeenShown', true);
}
}
// The dropdown's trigger
// ----------------------
function triggerCreated(trigger) {
var dropdownID = trigger.getAttribute('aria-controls');
if (!dropdownID) {
dropdownID = trigger.getAttribute('aria-owns');
if (!dropdownID) {
logger.error('Dropdown triggers need either a "aria-owns" or "aria-controls" attribute');
} else {
trigger.removeAttribute('aria-owns');
trigger.setAttribute('aria-controls', dropdownID);
}
}
trigger.setAttribute('aria-haspopup', true);
trigger.setAttribute('aria-expanded', false);
trigger.setAttribute('href', '#');
function handleIt(e) {
e.preventDefault();
if (!trigger.isEnabled()) {
return;
}
var dropdown = document.getElementById(dropdownID);
dropdown.toggle();
dropdown.isSubmenu = trigger.hasSubmenu();
return dropdown;
}
function handleMouseEnter(e) {
e.preventDefault();
if (!trigger.isEnabled()) {
return;
}
var dropdown = document.getElementById(dropdownID);
loadContentWhenMouseEnterTrigger(dropdown);
if (trigger.hasSubmenu()) {
dropdown.show();
dropdown.isSubmenu = trigger.hasSubmenu();
}
return dropdown;
}
function handleKeydown(e) {
var normalInvoke = e.keyCode === _keyCode2.default.ENTER || e.keyCode === _keyCode2.default.SPACE;
var submenuInvoke = e.keyCode === _keyCode2.default.RIGHT && trigger.hasSubmenu();
var rootMenuInvoke = (e.keyCode === _keyCode2.default.UP || e.keyCode === _keyCode2.default.DOWN) && !trigger.hasSubmenu();
if (normalInvoke || submenuInvoke || rootMenuInvoke) {
var dropdown = handleIt(e);
if (dropdown) {
dropdown.focusItem(0);
}
}
}
(0, _jquery2.default)(trigger).on('aui-button-invoke', handleIt).on('click', handleIt).on('keydown', handleKeydown).on('mouseenter', handleMouseEnter);
}
var triggerPrototype = {
disable: function disable() {
this.setAttribute('aria-disabled', 'true');
},
enable: function enable() {
this.setAttribute('aria-disabled', 'false');
},
isEnabled: function isEnabled() {
return this.getAttribute('aria-disabled') !== 'true';
},
hasSubmenu: function hasSubmenu() {
var triggerClasses = (this.className || '').split(/\s+/);
return triggerClasses.indexOf('aui-dropdown2-sub-trigger') !== -1;
}
};
(0, _skate2.default)('aui-dropdown2-trigger', {
type: _skate2.default.type.CLASSNAME,
created: triggerCreated,
prototype: triggerPrototype
});
//To remove at a later date. Some dropdown triggers initialise lazily, so we need to listen for mousedown
//and synchronously init before the click event is fired.
//TODO: delete in AUI 6.0.0, see AUI-2868
function bindLazyTriggerInitialisation() {
(0, _jquery2.default)(document).on('mousedown', '.aui-dropdown2-trigger', function () {
var isElementSkated = this.hasAttribute('resolved');
if (!isElementSkated) {
_skate2.default.init(this);
var lazyDeprecate = deprecate.getMessageLogger('Dropdown2 lazy initialisation', {
removeInVersion: '6.0.0',
alternativeName: 'initialisation on DOM insertion',
sinceVersion: '5.8.0',
extraInfo: 'Dropdown2 triggers should have all necessary attributes on DOM insertion',
deprecationType: 'JS'
});
lazyDeprecate();
}
});
}
bindLazyTriggerInitialisation();
(0, _skate2.default)('aui-dropdown2-sub-trigger', {
type: _skate2.default.type.CLASSNAME,
created: function created(trigger) {
trigger.className += ' aui-dropdown2-trigger';
_skate2.default.init(trigger);
}
});
// Dropdown trigger groups
// -----------------------
(0, _jquery2.default)(document).on('mouseenter', '.aui-dropdown2-trigger-group a, .aui-dropdown2-trigger-group button', function (e) {
var $item = (0, _jquery2.default)(e.currentTarget);
if ($item.is('.aui-dropdown2-active')) {
return; // No point doing anything if we're hovering over the already-active item trigger.
}
if ($item.closest('.aui-dropdown2').size()) {
return; // We don't want to deal with dropdown items, just the potential triggers in the group.
}
var $triggerGroup = $item.closest('.aui-dropdown2-trigger-group');
var $groupActiveTrigger = $triggerGroup.find('.aui-dropdown2-active');
if ($groupActiveTrigger.size() && $item.is('.aui-dropdown2-trigger')) {
$groupActiveTrigger.blur(); // Remove focus from the previously opened menu.
$item.trigger('aui-button-invoke'); // Open this trigger's menu.
e.preventDefault();
}
var $groupFocusedTrigger = $triggerGroup.find(':focus');
if ($groupFocusedTrigger.size() && $item.is('.aui-dropdown2-trigger')) {
$groupFocusedTrigger.blur();
}
});
// Dropdown items
// --------------
function getDropdownItems(dropdown, filter) {
return (0, _jquery2.default)(dropdown).find([
// Legacy markup.
'> ul > li', '> .aui-dropdown2-section > ul > li',
// Accessible markup.
'> div[role] > .aui-dropdown2-section > div[role="group"] > ul[role] > li[role]',
// Web component.
'aui-item-link', 'aui-item-checkbox', 'aui-item-radio'].join(', ')).filter(filter).children('a, button, [role="checkbox"], [role="menuitemcheckbox"], [role="radio"], [role="menuitemradio"]');
}
function getAllDropdownItems(dropdown) {
return getDropdownItems(dropdown, function () {
return true;
});
}
function getVisibleDropdownItems(dropdown) {
return getDropdownItems(dropdown, function () {
return this.className.indexOf('hidden') === -1 && !this.hasAttribute('hidden');
});
}
function amendDropdownItem(item) {
var $item = (0, _jquery2.default)(item);
$item.attr('tabindex', '-1');
/**
* Honouring the documentation.
* @link https://docs.atlassian.com/aui/latest/docs/dropdown2.html
*/
if ($item.hasClass('aui-dropdown2-disabled') || $item.parent().hasClass('aui-dropdown2-hidden')) {
$item.attr('aria-disabled', true);
}
}
function amendDropdownContent(dropdown) {
// Add assistive semantics to each dropdown item
getAllDropdownItems(dropdown).each(function () {
amendDropdownItem(this);
});
}
/**
* Honours behaviour for code written using only the legacy class names.
* To maintain old behaviour (i.e., remove the 'hidden' class and the item will become un-hidden)
* whilst allowing our code to only depend on the new classes, we need to
* keep the state of the DOM in sync with legacy classes.
*
* Calling this function will add the new namespaced classes to elements with legacy names.
* @returns {Function} a function to remove the new namespaced classes, only from the elements they were added to.
*/
function migrateAndSyncLegacyClassNames(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
// Migrate away from legacy class names
var $hiddens = $dropdown.find('.hidden').addClass('aui-dropdown2-hidden');
var $disableds = $dropdown.find('.disabled').addClass('aui-dropdown2-disabled');
var $interactives = $dropdown.find('.interactive').addClass('aui-dropdown2-interactive');
return function revertToOriginalMarkup() {
$hiddens.removeClass('aui-dropdown2-hidden');
$disableds.removeClass('aui-dropdown2-disabled');
$interactives.removeClass('aui-dropdown2-interactive');
};
}
// The Dropdown itself
// -------------------
function setLayerAlignment(dropdown, trigger) {
var hasSubmenu = trigger && trigger.hasSubmenu && trigger.hasSubmenu();
var hasSubmenuAlignment = dropdown.getAttribute('data-aui-alignment') === 'submenu auto';
if (!hasSubmenu && hasSubmenuAlignment) {
restorePreviousAlignment(dropdown);
}
var hasAnyAlignment = dropdown.hasAttribute('data-aui-alignment');
if (hasSubmenu && !hasSubmenuAlignment) {
saveCurrentAlignment(dropdown);
dropdown.setAttribute('data-aui-alignment', 'submenu auto');
dropdown.setAttribute('data-aui-alignment-static', true);
} else if (!hasAnyAlignment) {
dropdown.setAttribute('data-aui-alignment', 'bottom auto');
dropdown.setAttribute('data-aui-alignment-static', true);
}
if (dropdown._auiAlignment) {
dropdown._auiAlignment.destroy();
}
dropdown._auiAlignment = new _alignment2.default(dropdown, trigger);
dropdown._auiAlignment.enable();
}
function saveCurrentAlignment(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
if (dropdown.hasAttribute('data-aui-alignment')) {
$dropdown.data('previous-data-aui-alignment', dropdown.getAttribute('data-aui-alignment'));
}
$dropdown.data('had-data-aui-alignment-static', dropdown.hasAttribute('data-aui-alignment-static'));
}
function restorePreviousAlignment(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
var previousAlignment = $dropdown.data('previous-data-aui-alignment');
if (previousAlignment) {
dropdown.setAttribute('data-aui-alignment', previousAlignment);
} else {
dropdown.removeAttribute('data-aui-alignment');
}
$dropdown.removeData('previous-data-aui-alignment');
if (!$dropdown.data('had-data-aui-alignment-static')) {
dropdown.removeAttribute('data-aui-alignment-static');
}
$dropdown.removeData('had-data-aui-alignment-static');
}
function getDropdownHideLocation(dropdown, trigger) {
var possibleHome = trigger.getAttribute('data-dropdown2-hide-location');
return document.getElementById(possibleHome) || dropdown.parentNode;
}
var keyboardClose = false;
function keyboardCloseDetected() {
keyboardClose = true;
}
function wasProbablyClosedViaKeyboard() {
var result = keyboardClose === true;
keyboardClose = false;
return result;
}
function bindDropdownBehaviourToLayer(dropdown) {
(0, _layer2.default)(dropdown);
dropdown.addEventListener('aui-layer-show', function () {
(0, _jquery2.default)(dropdown).trigger('aui-dropdown2-show');
dropdown._syncClasses = migrateAndSyncLegacyClassNames(dropdown);
amendDropdownContent(this);
doIfTrigger(dropdown, function (trigger) {
setDropdownTriggerActiveState(trigger, true);
dropdown._returnTo = getDropdownHideLocation(dropdown, trigger);
});
});
dropdown.addEventListener('aui-layer-hide', function () {
(0, _jquery2.default)(dropdown).trigger('aui-dropdown2-hide');
if (dropdown._syncClasses) {
dropdown._syncClasses();
delete dropdown._syncClasses;
}
if (dropdown._auiAlignment) {
dropdown._auiAlignment.disable();
dropdown._auiAlignment.destroy();
}
if (dropdown._returnTo) {
if (dropdown.parentNode && dropdown.parentNode !== dropdown._returnTo) {
dropdown.parentNode.removeChild(dropdown);
}
dropdown._returnTo.appendChild(dropdown);
}
getVisibleDropdownItems(dropdown).removeClass('active aui-dropdown2-active');
doIfTrigger(dropdown, function (trigger) {
if (wasProbablyClosedViaKeyboard()) {
trigger.focus();
setDropdownTriggerActiveState(trigger, trigger.hasSubmenu && trigger.hasSubmenu());
} else {
setDropdownTriggerActiveState(trigger, false);
}
});
// Gets set by submenu trigger invocation. Bad coupling point?
delete dropdown.isSubmenu;
});
}
function bindItemInteractionBehaviourToDropdown(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
$dropdown.on('keydown', function (e) {
if (e.keyCode === _keyCode2.default.DOWN) {
dropdown.focusNext();
e.preventDefault();
} else if (e.keyCode === _keyCode2.default.UP) {
dropdown.focusPrevious();
e.preventDefault();
} else if (e.keyCode === _keyCode2.default.LEFT) {
if (dropdown.isSubmenu) {
keyboardCloseDetected();
dropdown.hide();
e.preventDefault();
}
} else if (e.keyCode === _keyCode2.default.ESCAPE) {
// The closing will be handled by the LayerManager!
keyboardCloseDetected();
} else if (e.keyCode === _keyCode2.default.TAB) {
keyboardCloseDetected();
dropdown.hide();
}
});
// close the menu when clicking on elements which aren't "interactive"
$dropdown.on('click', 'a, button, [role="menuitem"], [role="menuitemcheckbox"], [role="checkbox"], [role="menuitemradio"], [role="radio"]', function (e) {
var $item = (0, _jquery2.default)(e.currentTarget);
if ($item.attr('aria-disabled') === 'true') {
e.preventDefault();
}
if (!e.isDefaultPrevented() && !$item.is('.aui-dropdown2-interactive')) {
var theMenu = dropdown;
do {
var dd = (0, _layer2.default)(theMenu);
theMenu = (0, _layer2.default)(theMenu).below();
if (dd.$el.is('.aui-dropdown2')) {
dd.hide();
}
} while (theMenu);
}
});
// close a submenus when the mouse moves over items other than its trigger
$dropdown.on('mouseenter', 'a, button, [role="menuitem"], [role="menuitemcheckbox"], [role="checkbox"], [role="menuitemradio"], [role="radio"]', function (e) {
var item = e.currentTarget;
var hasSubmenu = item.hasSubmenu && item.hasSubmenu();
if (!e.isDefaultPrevented() && !hasSubmenu) {
var maybeALayer = (0, _layer2.default)(dropdown).above();
if (maybeALayer) {
(0, _layer2.default)(maybeALayer).hide();
}
}
});
}
(0, _jquery2.default)(window).on('resize', (0, _debounce.debounceImmediate)(function () {
(0, _jquery2.default)('.aui-dropdown2').each(function (index, dropdown) {
if (dropdown.isVisible()) {
dropdown.hide();
}
});
}, 1000));
// Dropdowns
// ---------
function dropdownCreated(dropdown) {
var $dropdown = (0, _jquery2.default)(dropdown);
$dropdown.addClass('aui-dropdown2');
// swap the inner div to presentation as application is only needed for Windows
if ((0, _browser.supportsVoiceOver)()) {
$dropdown.find('> div[role="application"]').attr('role', 'presentation');
}
if (dropdown.hasAttribute('data-container')) {
$dropdown.attr('data-aui-alignment-container', $dropdown.attr('data-container'));
$dropdown.removeAttr('data-container');
}
bindDropdownBehaviourToLayer(dropdown);
bindItemInteractionBehaviourToDropdown(dropdown);
dropdown.hide();
(0, _jquery2.default)(dropdown).delegate('.aui-dropdown2-checkbox:not(.disabled):not(.aui-dropdown2-disabled)', 'click keydown', function (e) {
if (e.type === 'click' || e.keyCode === _keyCode2.default.ENTER || e.keyCode === _keyCode2.default.SPACE) {
var checkbox = this;
if (e.isDefaultPrevented()) {
return;
}
if (checkbox.isInteractive()) {
e.preventDefault();
}
if (checkbox.isEnabled()) {
// toggle the checked state
if (checkbox.isChecked()) {
checkbox.uncheck();
} else {
checkbox.check();
}
}
}
});
(0, _jquery2.default)(dropdown).delegate('.aui-dropdown2-radio:not(.checked):not(.aui-dropdown2-checked):not(.disabled):not(.aui-dropdown2-disabled)', 'click keydown', function (e) {
if (e.type === 'click' || e.keyCode === _keyCode2.default.ENTER || e.keyCode === _keyCode2.default.SPACE) {
var radio = this;
if (e.isDefaultPrevented()) {
return;
}
if (radio.isInteractive()) {
e.preventDefault();
}
var $radio = (0, _jquery2.default)(this);
if (this.isEnabled() && this.isChecked() === false) {
// toggle the checked state
$radio.closest('ul,[role=group]').find('.aui-dropdown2-checked').not(this).each(function () {
this.uncheck();
});
radio.check();
}
}
});
}
var dropdownPrototype = {
/**
* Toggles the visibility of the dropdown menu
*/
toggle: function toggle() {
if (this.isVisible()) {
this.hide();
} else {
this.show();
}
},
/**
* Explicitly shows the menu
*
* @returns {HTMLElement}
*/
show: function show() {
(0, _layer2.default)(this).show();
var dropdown = this;
doIfTrigger(dropdown, function (trigger) {
setLayerAlignment(dropdown, trigger);
});
return this;
},
/**
* Explicitly hides the menu
*
* @returns {HTMLElement}
*/
hide: function hide() {
(0, _layer2.default)(this).hide();
return this;
},
/**
* Shifts explicit focus to the next available item in the menu
*
* @returns {undefined}
*/
focusNext: function focusNext() {
var $items = getVisibleDropdownItems(this);
var selected = document.activeElement;
var idx;
if ($items.last()[0] !== selected) {
idx = $items.toArray().indexOf(selected);
this.focusItem($items.get(idx + 1));
}
},
/**
* Shifts explicit focus to the previous available item in the menu
*
* @returns {undefined}
*/
focusPrevious: function focusPrevious() {
var $items = getVisibleDropdownItems(this);
var selected = document.activeElement;
var idx;
if ($items.first()[0] !== selected) {
idx = $items.toArray().indexOf(selected);
this.focusItem($items.get(idx - 1));
}
},
/**
* Shifts explicit focus to the menu item matching the index param
*/
focusItem: function focusItem(item) {
var $items = getVisibleDropdownItems(this);
var $item;
if (typeof item === 'number') {
item = $items.get(item);
}
$item = (0, _jquery2.default)(item);
$item.focus();
$items.removeClass('active aui-dropdown2-active');
$item.addClass('active aui-dropdown2-active');
},
/**
* Checks whether or not the menu is currently displayed
*
* @returns {Boolean}
*/
isVisible: function isVisible() {
return (0, _layer2.default)(this).isVisible();
}
};
// Web component API for dropdowns
// -------------------------------
var disabledAttributeHandler = {
created: function created(element) {
var a = element.children[0];
a.setAttribute('aria-disabled', 'true');
a.className += ' aui-dropdown2-disabled';
},
removed: function removed(element) {
var a = element.children[0];
a.setAttribute('aria-disabled', 'false');
(0, _jquery2.default)(a).removeClass('aui-dropdown2-disabled');
}
};
var interactiveAttributeHandler = {
created: function created(element) {
var a = element.children[0];
a.className += ' aui-dropdown2-interactive';
},
removed: function removed(element) {
var a = element.children[0];
(0, _jquery2.default)(a).removeClass('aui-dropdown2-interactive');
}
};
var checkedAttributeHandler = {
created: function created(element) {
var a = element.children[0];
(0, _jquery2.default)(a).addClass('checked aui-dropdown2-checked');
a.setAttribute('aria-checked', true);
element.dispatchEvent(new _customEvent2.default('change', { bubbles: true }));
},
removed: function removed(element) {
var a = element.children[0];
(0, _jquery2.default)(a).removeClass('checked aui-dropdown2-checked');
a.setAttribute('aria-checked', false);
element.dispatchEvent(new _customEvent2.default('change', { bubbles: true }));
}
};
var hiddenAttributeHandler = {
created: function created(element) {
disabledAttributeHandler.created(element);
},
removed: function removed(element) {
disabledAttributeHandler.removed(element);
}
};
(0, _skate2.default)('aui-item-link', {
template: (0, _skatejsTemplateHtml2.default)('<a role="menuitem" tabindex="-1"><content></content></a>'),
attributes: {
disabled: disabledAttributeHandler,
interactive: interactiveAttributeHandler,
hidden: hiddenAttributeHandler,
href: {
created: function created(element, change) {
var a = element.children[0];
a.setAttribute('href', change.newValue);
},
updated: function updated(element, change) {
var a = element.children[0];
a.setAttribute('href', change.newValue);
},
removed: function removed(element) {
var a = element.children[0];
a.removeAttribute('href');
}
},
for: {
created: function created(element) {
var anchor = element.children[0];
anchor.setAttribute('aria-controls', element.getAttribute('for'));
(0, _jquery2.default)(anchor).addClass('aui-dropdown2-sub-trigger');
},
updated: function updated(element) {
var anchor = element.children[0];
anchor.setAttribute('aria-controls', element.getAttribute('for'));
},
removed: function removed(element) {
var anchor = element.children[0];
anchor.removeAttribute('aria-controls');
(0, _jquery2.default)(anchor).removeClass('aui-dropdown2-sub-trigger');
}
}
}
});
(0, _skate2.default)('aui-item-checkbox', {
template: (0, _skatejsTemplateHtml2.default)('<span role="checkbox" class="aui-dropdown2-checkbox" tabindex="-1"><content></content></span>'),
attributes: {
disabled: disabledAttributeHandler,
interactive: interactiveAttributeHandler,
checked: checkedAttributeHandler,
hidden: hiddenAttributeHandler
}
});
(0, _skate2.default)('aui-item-radio', {
template: (0, _skatejsTemplateHtml2.default)('<span role="radio" class="aui-dropdown2-radio" tabindex="-1"><content></content></span>'),
attributes: {
disabled: disabledAttributeHandler,
interactive: interactiveAttributeHandler,
checked: checkedAttributeHandler,
hidden: hiddenAttributeHandler
}
});
(0, _skate2.default)('aui-section', {
template: (0, _skatejsTemplateHtml2.default)('\n <strong aria-role="presentation" class="aui-dropdown2-heading"></strong>\n <div role="group">\n <content></content>\n </div>\n '),
attributes: {
label: function label(element, data) {
var headingElement = element.children[0];
var groupElement = element.children[1];
headingElement.textContent = data.newValue;
groupElement.setAttribute('aria-label', data.newValue);
}
},
created: function created(element) {
element.className += ' aui-dropdown2-section';
element.setAttribute('role', 'presentation');
}
});
(0, _skate2.default)('aui-dropdown-menu', {
template: (0, _skatejsTemplateHtml2.default)('\n <div role="application">\n <content></content>\n </div>\n '),
created: function created(dropdown) {
dropdown.setAttribute('role', 'menu');
dropdown.className = 'aui-dropdown2 aui-style-default aui-layer';
(0, _state2.default)(dropdown).set('loading-state', UNLOADED);
// Now skate the .aui-dropdown2 behaviour.
_skate2.default.init(dropdown);
},
attributes: {
src: {}
},
prototype: dropdownPrototype,
events: {
'aui-layer-show': loadContentWhenMenuShown
}
});
// Legacy dropdown inits
// ---------------------
(0, _skate2.default)('aui-dropdown2', {
type: _skate2.default.type.CLASSNAME,
created: dropdownCreated,
prototype: dropdownPrototype
});
(0, _skate2.default)('data-aui-dropdown2', {
type: _skate2.default.type.ATTRIBUTE,
created: dropdownCreated,
prototype: dropdownPrototype
});
// Checkboxes and radios
// ---------------------
(0, _skate2.default)('aui-dropdown2-checkbox', {
type: _skate2.default.type.CLASSNAME,
created: function created(checkbox) {
var checked = isChecked(checkbox);
if (checked) {
(0, _jquery2.default)(checkbox).addClass('checked aui-dropdown2-checked');
}
checkbox.setAttribute('aria-checked', checked);
checkbox.setAttribute('tabindex', '0');
// swap from menuitemcheckbox to just plain checkbox for VoiceOver
if ((0, _browser.supportsVoiceOver)()) {
checkbox.setAttribute('role', 'checkbox');
}
},
prototype: {
isEnabled: function isEnabled() {
return !(this.getAttribute('aria-disabled') !== null && this.getAttribute('aria-disabled') === 'true');
},
isChecked: function isChecked() {
return this.getAttribute('aria-checked') !== null && this.getAttribute('aria-checked') === 'true';
},
isInteractive: function isInteractive() {
return (0, _jquery2.default)(this).hasClass('aui-dropdown2-interactive');
},
uncheck: function uncheck() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-checkbox') {
this.parentNode.removeAttribute('checked');
}
this.setAttribute('aria-checked', 'false');
(0, _jquery2.default)(this).removeClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-uncheck');
},
check: function check() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-checkbox') {
this.parentNode.setAttribute('checked', '');
}
this.setAttribute('aria-checked', 'true');
(0, _jquery2.default)(this).addClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-check');
}
}
});
(0, _skate2.default)('aui-dropdown2-radio', {
type: _skate2.default.type.CLASSNAME,
created: function created(radio) {
// add a dash of ARIA
var checked = isChecked(radio);
if (checked) {
(0, _jquery2.default)(radio).addClass('checked aui-dropdown2-checked');
}
radio.setAttribute('aria-checked', checked);
radio.setAttribute('tabindex', '0');
// swap from menuitemradio to just plain radio for VoiceOver
if ((0, _browser.supportsVoiceOver)()) {
radio.setAttribute('role', 'radio');
}
},
prototype: {
isEnabled: function isEnabled() {
return !(this.getAttribute('aria-disabled') !== null && this.getAttribute('aria-disabled') === 'true');
},
isChecked: function isChecked() {
return this.getAttribute('aria-checked') !== null && this.getAttribute('aria-checked') === 'true';
},
isInteractive: function isInteractive() {
return (0, _jquery2.default)(this).hasClass('aui-dropdown2-interactive');
},
uncheck: function uncheck() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-radio') {
this.parentNode.removeAttribute('checked');
}
this.setAttribute('aria-checked', 'false');
(0, _jquery2.default)(this).removeClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-uncheck');
},
check: function check() {
if (this.parentNode.tagName.toLowerCase() === 'aui-item-radio') {
this.parentNode.setAttribute('checked', '');
}
this.setAttribute('aria-checked', 'true');
(0, _jquery2.default)(this).addClass('checked aui-dropdown2-checked');
(0, _jquery2.default)(this).trigger('aui-dropdown2-item-check');
}
}
});
return module.exports;
}).call(this);
// src/js/aui/internal/enforcer.js
(typeof window === 'undefined' ? global : window).__dc583a914c39307e4abaac9c487a9c86 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function enforcer(element) {
function attributeExists(attributeName) {
var errorMessage = attributeName + ' wasn\'t defined';
return satisfiesRules(function () {
return element.hasAttribute(attributeName);
}, errorMessage);
}
function refersTo(attributeName) {
if (!attributeExists(attributeName, element)) {
return false;
}
var desiredId = element.getAttribute(attributeName);
var errorMessage = 'an element with id set to "' + desiredId + '" was not found';
return satisfiesRules(function () {
return document.getElementById(desiredId);
}, errorMessage);
}
function ariaControls() {
return refersTo('aria-controls');
}
function ariaOwns() {
return refersTo('aria-owns');
}
function satisfiesRules(predicate, message) {
if (!predicate()) {
if (element) {
logger.error(message, element);
} else {
logger.error(message);
}
return false;
}
return true;
}
return {
attributeExists: attributeExists,
refersTo: refersTo,
satisfiesRules: satisfiesRules,
ariaControls: ariaControls,
ariaOwns: ariaOwns
};
}
exports.default = enforcer;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/events.js
(typeof window === 'undefined' ? global : window).__3c67105fc710d918a1448cdf0460bbc1 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.triggerEvtForInst = exports.triggerEvt = exports.bindEvt = undefined;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _createElement = __e3011d5cc5ea8e104654a5f8ae95cfba;
var _createElement2 = _interopRequireDefault(_createElement);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Triggers a custom event on the AJS object
*
* @param {String} name - name of event
* @param {Array} args - args for event handler
*/
function triggerEvt(name, args) {
(0, _jquery2.default)(_createElement2.default).trigger(name, args);
}
/**
* Binds handler to the AJS object
*
* @param {String} name
* @param {Function} func
*/
function bindEvt(name, func) {
(0, _jquery2.default)(_createElement2.default).bind(name, func);
}
/**
* Some generic error handling that fires event in multiple contexts
* - on AJS object
* - on Instance
* - on AJS object with prefixed id.
*
* @param evt
* @param inst
* @param args
*/
function triggerEvtForInst(evt, inst, args) {
(0, _jquery2.default)(inst).trigger(evt, args);
triggerEvt(evt, args);
if (inst.id) {
triggerEvt(inst.id + '-' + evt, args);
}
}
exports.bindEvt = bindEvt = deprecate.fn(bindEvt, 'bindEvt', {
sinceVersion: '5.8.0'
});
exports.triggerEvt = triggerEvt = deprecate.fn(triggerEvt, 'triggerEvt', {
sinceVersion: '5.8.0'
});
exports.triggerEvtForInst = triggerEvtForInst = deprecate.fn(triggerEvtForInst, 'triggerEvtForInst', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('bindEvt', bindEvt);
(0, _globalize2.default)('triggerEvt', triggerEvt);
(0, _globalize2.default)('triggerEvtForInst', triggerEvtForInst);
exports.bindEvt = bindEvt;
exports.triggerEvt = triggerEvt;
exports.triggerEvtForInst = triggerEvtForInst;
return module.exports;
}).call(this);
// src/js/aui/event.js
(typeof window === 'undefined' ? global : window).__7b5aa278bb4f76afb55f49b950817c6d = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.trigger = exports.unbind = exports.bind = undefined;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Binds events to the window object. See jQuery bind documentation for more
* details. Exceptions are caught and logged.
*/
function bind(eventType, eventData, handler) {
try {
if (typeof handler === 'function') {
return (0, _jquery2.default)(window).bind(eventType, eventData, handler);
} else {
return (0, _jquery2.default)(window).bind(eventType, eventData);
}
} catch (e) {
logger.log('error while binding: ' + e.message);
}
}
/**
* Unbinds event handlers from the window object. See jQuery unbind
* documentation for more details. Exceptions are caught and logged.
*/
function unbind(eventType, handler) {
try {
return (0, _jquery2.default)(window).unbind(eventType, handler);
} catch (e) {
logger.log('error while unbinding: ' + e.message);
}
}
/**
* Triggers events on the window object. See jQuery trigger documentation for
* more details. Exceptions are caught and logged.
*/
function trigger(eventType, extraParameters) {
try {
return (0, _jquery2.default)(window).trigger(eventType, extraParameters);
} catch (e) {
logger.log('error while triggering: ' + e.message);
}
}
(0, _globalize2.default)('bind', bind);
(0, _globalize2.default)('trigger', trigger);
(0, _globalize2.default)('unbind', unbind);
exports.bind = bind;
exports.unbind = unbind;
exports.trigger = trigger;
return module.exports;
}).call(this);
// src/js/aui/forms.js
(typeof window === 'undefined' ? global : window).__f639fe1f21a511207fc3a7ea8008186c = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.inlineHelp = exports.enable = undefined;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Enables the specified form element.
*
* @param {Element} el The element to enable.
* @param {Boolean} b The flag setting enabled / disabled.
*
* @returns {jQuery}
*/
function enable(el, b) {
var $el = (0, _jquery2.default)(el);
if (typeof b === 'undefined') {
b = true;
}
return $el.each(function () {
this.disabled = !b;
});
}
/**
* Forms: Inline Help - toggles visibility of inline help content.
*
* @method inlineHelp
* @namespace AJS
* @for AJS
*/
function inlineHelp() {
(0, _jquery2.default)('.icon-inline-help').click(function () {
var $t = (0, _jquery2.default)(this).siblings('.field-help');
if ($t.hasClass('hidden')) {
$t.removeClass('hidden');
} else {
$t.addClass('hidden');
}
});
}
(0, _globalize2.default)('enable', enable);
(0, _globalize2.default)('inlineHelp', inlineHelp);
exports.enable = enable;
exports.inlineHelp = inlineHelp;
return module.exports;
}).call(this);
// src/js/aui/dialog.js
(typeof window === 'undefined' ? global : window).__0fee7b7e9a5f01779ec7b61597f813e5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.popup = exports.Dialog = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; // can't "use strict"
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _event = __7b5aa278bb4f76afb55f49b950817c6d;
var _blanket = __95ebb2a3f0f35fb58e804b4a93a4e8a4;
var _forms = __f639fe1f21a511207fc3a7ea8008186c;
var _createElement = __e3011d5cc5ea8e104654a5f8ae95cfba;
var _createElement2 = _interopRequireDefault(_createElement);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Creates a generic popup that will be displayed in the center of the screen with a
* grey blanket in the background.
* Usage:
* <pre>
* createPopup({
* width: 800,
* height: 400,
* id: "my-dialog"
* });
* </pre>
* @param options {object} [optional] Permitted options and defaults are as follows:
* width (800), height (600), keypressListener (closes dialog on ESC).
*/
function createPopup(options) {
var defaults = {
width: 800,
height: 600,
closeOnOutsideClick: false,
keypressListener: function keypressListener(e) {
if (e.keyCode === 27 && popup.is(':visible')) {
res.hide();
}
}
};
// for backwards-compatibility
if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) != 'object') {
options = {
width: arguments[0],
height: arguments[1],
id: arguments[2]
};
options = _jquery2.default.extend({}, options, arguments[3]);
}
options = _jquery2.default.extend({}, defaults, options);
var popup = (0, _createElement2.default)('div').addClass('aui-popup');
if (options.id) {
popup.attr('id', options.id);
}
//find the highest z-index on the page to ensure any new popup that is shown is shown on top
var highestZIndex = 3000;
(0, _jquery2.default)('.aui-dialog').each(function () {
var currentPopup = (0, _jquery2.default)(this);
highestZIndex = currentPopup.css('z-index') > highestZIndex ? currentPopup.css('z-index') : highestZIndex;
});
var applySize = function _applySize(width, height) {
options.width = width = width || options.width;
options.height = height = height || options.height;
popup.css({
marginTop: -Math.round(height / 2) + 'px',
marginLeft: -Math.round(width / 2) + 'px',
width: width,
height: height,
'z-index': parseInt(highestZIndex, 10) + 2 //+ 2 so that the shadow can be shown on +1 (underneath the popup but above everything else)
});
return _applySize;
}(options.width, options.height);
(0, _jquery2.default)('body').append(popup);
popup.hide();
(0, _forms.enable)(popup);
/**
* Popup object
* @class Popup
* @static
*/
//blanket for reference further down
var blanket = (0, _jquery2.default)('.aui-blanket'),
focusItem = function focusItem(selector, element) {
var item = (0, _jquery2.default)(selector, element);
if (item.length) {
item.focus();
return true;
}
return false;
},
// we try and place focus, in the configured element or by looking for the first input
// in page body, then button panel and finally page menu.
focusDialog = function focusDialog(element) {
if ((0, _jquery2.default)('.dialog-page-body', element).find(':focus').length !== 0) {
return;
}
if (options.focusSelector) {
return focusItem(options.focusSelector, element);
}
var defaultFocusSelector = ':input:visible:enabled:first';
if (focusItem(defaultFocusSelector, (0, _jquery2.default)('.dialog-page-body', element))) return;
if (focusItem(defaultFocusSelector, (0, _jquery2.default)('.dialog-button-panel', element))) return;
focusItem(defaultFocusSelector, (0, _jquery2.default)('.dialog-page-menu', element));
};
var res = {
changeSize: function changeSize(w, h) {
if (w && w != options.width || h && h != options.height) {
applySize(w, h);
}
this.show();
},
/**
* Shows the popup
* @method show
*/
show: function show() {
var show = function show() {
(0, _jquery2.default)(document).off('keydown', options.keypressListener).on('keydown', options.keypressListener);
(0, _blanket.dim)();
blanket = (0, _jquery2.default)('.aui-blanket');
if (blanket.size() != 0 && options.closeOnOutsideClick) {
blanket.click(function () {
if (popup.is(':visible')) {
res.hide();
}
});
}
popup.show();
createPopup.current = this;
focusDialog(popup);
(0, _jquery2.default)(document).trigger('showLayer', ['popup', this]);
};
show.call(this);
this.show = show;
},
/**
* Hides the popup.
* @method hide
*/
hide: function hide() {
(0, _jquery2.default)(document).unbind('keydown', options.keypressListener);
blanket.unbind();
this.element.hide();
//only undim if no other dialogs are visible
if ((0, _jquery2.default)('.aui-dialog:visible').size() == 0) {
(0, _blanket.undim)();
}
// AUI-1059: remove focus from the active element when dialog is hidden
var activeElement = document.activeElement;
if (this.element.has(activeElement).length) {
activeElement.blur();
}
(0, _jquery2.default)(document).trigger('hideLayer', ['popup', this]);
createPopup.current = null;
this.enable();
},
/**
* jQuery object, representing popup DOM element
* @property element
*/
element: popup,
/**
* Removes popup elements from the DOM
* @method remove
*/
remove: function remove() {
popup.remove();
this.element = null;
},
/**
* disables the popup
* @method disable
*/
disable: function disable() {
if (!this.disabled) {
this.popupBlanket = (0, _jquery2.default)("<div class='dialog-blanket'> </div>").css({
height: popup.height(),
width: popup.width()
});
popup.append(this.popupBlanket);
this.disabled = true;
}
},
/**
* enables the popup if it is disabled
* @method enable
*/
enable: function enable() {
if (this.disabled) {
this.disabled = false;
this.popupBlanket.remove();
this.popupBlanket = null;
}
}
};
return res;
};
// Scoping function
var Dialog = function () {
/**
* @class Button
* @constructor Button
* @param page {number} page id
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @private
*/
function Button(page, label, onclick, className) {
if (!page.buttonpanel) {
page.addButtonPanel();
}
this.page = page;
this.onclick = onclick;
this._onclick = function (e) {
return onclick.call(this, page.dialog, page, e) === true;
};
this.item = (0, _createElement2.default)('button', label).addClass('button-panel-button');
if (className) {
this.item.addClass(className);
}
if (typeof onclick == 'function') {
this.item.click(this._onclick);
}
page.buttonpanel.append(this.item);
this.id = page.button.length;
page.button[this.id] = this;
}
/**
* @class Link
* @constructor Link
* @param page {number} page id
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @private
*/
function Link(page, label, onclick, className, url) {
if (!page.buttonpanel) {
page.addButtonPanel();
}
//if no url is given use # as default
if (!url) {
url = '#';
}
this.page = page;
this.onclick = onclick;
this._onclick = function (e) {
return onclick.call(this, page.dialog, page, e) === true;
};
this.item = (0, _createElement2.default)('a', label).attr('href', url).addClass('button-panel-link');
if (className) {
this.item.addClass(className);
}
if (typeof onclick == 'function') {
this.item.click(this._onclick);
}
page.buttonpanel.append(this.item);
this.id = page.button.length;
page.button[this.id] = this;
}
function itemMove(leftOrRight, target) {
var dir = leftOrRight == 'left' ? -1 : 1;
return function (step) {
var dtarget = this.page[target];
if (this.id != (dir == 1 ? dtarget.length - 1 : 0)) {
dir *= step || 1;
dtarget[this.id + dir].item[dir < 0 ? 'before' : 'after'](this.item);
dtarget.splice(this.id, 1);
dtarget.splice(this.id + dir, 0, this);
for (var i = 0, ii = dtarget.length; i < ii; i++) {
if (target == 'panel' && this.page.curtab == dtarget[i].id) {
this.page.curtab = i;
}
dtarget[i].id = i;
}
}
return this;
};
}
function itemRemove(target) {
return function () {
this.page[target].splice(this.id, 1);
for (var i = 0, ii = this.page[target].length; i < ii; i++) {
this.page[target][i].id = i;
}
this.item.remove();
};
}
/**
* Moves item left in the hierarchy
* @method moveUp
* @method moveLeft
* @param step {number} how many items to move, default is 1
* @return {object} button
*/
Button.prototype.moveUp = Button.prototype.moveLeft = itemMove('left', 'button');
/**
* Moves item right in the hierarchy
* @method moveDown
* @method moveRight
* @param step {number} how many items to move, default is 1
* @return {object} button
*/
Button.prototype.moveDown = Button.prototype.moveRight = itemMove('right', 'button');
/**
* Removes item
* @method remove
*/
Button.prototype.remove = itemRemove('button');
/**
* Getter and setter for label
* @method label
* @param label {string} [optional] label of the button
* @return {string} label, if nothing is passed in
* @return {object} jQuery button object, if label is passed in
*/
Button.prototype.html = function (label) {
return this.item.html(label);
};
/**
* Getter and setter of onclick event handler
* @method onclick
* @param onclick {function} [optional] new event handler, that is going to replace the old one
* @return {function} existing event handler if new one is undefined
*/
Button.prototype.onclick = function (onclick) {
if (typeof onclick == 'undefined') {
return this.onclick;
} else {
this.item.unbind('click', this._onclick);
this._onclick = function (e) {
return onclick.call(this, page.dialog, page, e) === true;
};
if (typeof onclick == 'function') {
this.item.click(this._onclick);
}
}
};
var DEFAULT_PADDING = 20;
/**
* Class for panels
* @class Panel
* @constructor
* @param page {number} page id
* @param title {string} panel title
* @param reference {string} or {object} jQuery object or selector for the contents of the Panel
* @param className {string} [optional] HTML class name
* @param panelButtonId {string} the unique id that will be put on the button element for this panel.
* @private
*/
var Panel = function Panel(page, title, reference, className, panelButtonId) {
if (!(reference instanceof _jquery2.default)) {
reference = (0, _jquery2.default)(reference);
}
this.dialog = page.dialog;
this.page = page;
this.id = page.panel.length;
this.button = (0, _createElement2.default)('button').html(title).addClass('item-button');
if (panelButtonId) {
this.button[0].id = panelButtonId;
}
this.item = (0, _createElement2.default)('li').append(this.button).addClass('page-menu-item');
this.body = (0, _createElement2.default)('div').append(reference).addClass('dialog-panel-body').css('height', page.dialog.height + 'px');
this.padding = DEFAULT_PADDING;
if (className) {
this.body.addClass(className);
}
var i = page.panel.length,
tab = this;
page.menu.append(this.item);
page.body.append(this.body);
page.panel[i] = this;
var onclick = function onclick() {
var cur;
if (page.curtab + 1) {
cur = page.panel[page.curtab];
cur.body.hide();
cur.item.removeClass('selected');
typeof cur.onblur == 'function' && cur.onblur();
}
page.curtab = tab.id;
tab.body.show();
tab.item.addClass('selected');
typeof tab.onselect == 'function' && tab.onselect();
typeof page.ontabchange == 'function' && page.ontabchange(tab, cur);
};
if (!this.button.click) {
logger.log('atlassian-dialog:Panel:constructor - this.button.click false');
this.button.onclick = onclick;
} else {
this.button.click(onclick);
}
onclick();
if (i == 0) {
page.menu.css('display', 'none'); // don't use jQuery hide()
} else {
page.menu.show();
}
};
/**
* Selects current panel
* @method select
*/
Panel.prototype.select = function () {
this.button.click();
};
/**
* Moves item left in the hierarchy
* @method moveUp
* @method moveLeft
* @param step {number} how many items to move, default is 1
* @return {object} panel
*/
Panel.prototype.moveUp = Panel.prototype.moveLeft = itemMove('left', 'panel');
/**
* Moves item right in the hierarchy
* @method moveDown
* @method moveRight
* @param step {number} how many items to move, default is 1
* @return {object} panel
*/
Panel.prototype.moveDown = Panel.prototype.moveRight = itemMove('right', 'panel');
/**
* Removes item
* @method remove
*/
Panel.prototype.remove = itemRemove('panel');
/**
* Getter and setter of inner HTML of the panel
* @method html
* @param html {string} HTML source to set up
* @return {object} panel
* @return {string} current HTML source
*/
Panel.prototype.html = function (html) {
if (html) {
this.body.html(html);
return this;
} else {
return this.body.html();
}
};
/**
* This method gives you ability to overwrite default padding value. Use it with caution.
* @method setPadding
* @param padding {number} padding in pixels
* @return {object} panel
* @see DEFAULT_PADDING
*/
Panel.prototype.setPadding = function (padding) {
if (!isNaN(+padding)) {
this.body.css('padding', +padding);
this.padding = +padding;
this.page.recalcSize();
}
return this;
};
var HEADER_HEIGHT = 56;
var BUTTONS_HEIGHT = 51;
var MIN_DIALOG_VERTICAL_BUFFER = 50;
/**
* Class for pages
* @class Page
* @constructor
* @param dialog {object} dialog object
* @param className {string} [optional] HTML class name
* @private
*/
var Page = function Page(dialog, className) {
this.dialog = dialog;
this.id = dialog.page.length;
this.element = (0, _createElement2.default)('div').addClass('dialog-components');
this.body = (0, _createElement2.default)('div').addClass('dialog-page-body');
this.menu = (0, _createElement2.default)('ul').addClass('dialog-page-menu').css('height', dialog.height + 'px');
this.body.append(this.menu);
this.curtab;
this.panel = [];
this.button = [];
if (className) {
this.body.addClass(className);
}
dialog.popup.element.append(this.element.append(this.menu).append(this.body));
dialog.page[dialog.page.length] = this;
};
/**
* Size updater for contents of the page. For internal use
* @method recalcSize
*/
Page.prototype.recalcSize = function () {
var headerHeight = this.header ? HEADER_HEIGHT : 0;
var buttonHeight = this.buttonpanel ? BUTTONS_HEIGHT : 0;
for (var i = this.panel.length; i--;) {
var dialogComponentsHeight = this.dialog.height - headerHeight - buttonHeight;
this.panel[i].body.css('height', dialogComponentsHeight);
this.menu.css('height', dialogComponentsHeight);
}
};
/**
* Adds a button panel to the bottom of dialog
* @method addButtonPanel
*/
Page.prototype.addButtonPanel = function () {
this.buttonpanel = (0, _createElement2.default)('div').addClass('dialog-button-panel');
this.element.append(this.buttonpanel);
};
/**
* Method for adding new panel to the page
* @method addPanel
* @param title {string} panel title
* @param reference {string} or {object} jQuery object or selector for the contents of the Panel
* @param className {string} [optional] HTML class name
* @param panelButtonId {string} [optional] The unique id for the panel's button.
* @return {object} the page
*/
Page.prototype.addPanel = function (title, reference, className, panelButtonId) {
new Panel(this, title, reference, className, panelButtonId);
this.recalcSize();
return this;
};
/**
* Method for adding header to the page
* @method addHeader
* @param title {string} panel title
* @param className {string} [optional] CSS class name
* @return {object} the page
*/
Page.prototype.addHeader = function (title, className) {
if (this.header) {
this.header.remove();
}
this.header = (0, _createElement2.default)('h2').text(title || '').addClass('dialog-title');
className && this.header.addClass(className);
this.element.prepend(this.header);
this.recalcSize();
return this;
};
/**
* Method for adding new button to the page
* @method addButton
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the page
*/
Page.prototype.addButton = function (label, onclick, className) {
new Button(this, label, onclick, className);
this.recalcSize();
return this;
};
/**
* Method for adding new link to the page
* @method addLink
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the page
*/
Page.prototype.addLink = function (label, onclick, className, url) {
new Link(this, label, onclick, className, url);
this.recalcSize();
return this;
};
/**
* Selects corresponding panel
* @method gotoPanel
* @param panel {object} panel object
* @param panel {number} id of the panel
*/
Page.prototype.gotoPanel = function (panel) {
this.panel[panel.id || panel].select();
};
/**
* Returns current panel on the page
* @method getCurrentPanel
* @return panel {object} the panel
*/
Page.prototype.getCurrentPanel = function () {
return this.panel[this.curtab];
};
/**
* Hides the page
* @method hide
*/
Page.prototype.hide = function () {
this.element.hide();
};
/**
* Shows the page, if it was hidden
* @method show
*/
Page.prototype.show = function () {
this.element.show();
};
/**
* Removes the page
* @method remove
*/
Page.prototype.remove = function () {
this.element.remove();
};
/**
* Constructor for a Dialog. A Dialog is a popup which consists of Pages, where each Page can consist of Panels,
* Buttons and a Header. The dialog must be constructed in page order as it has a current page state. For example,
* calling addButton() will add a button to the 'current' page.
* <p>
* By default, a new Dialog will have one page. If there are multiple Panels on a Page, a
* menu is displayed on the left side of the dialog.
* </p>
* Usage:
* <pre>
* var dialog = new Dialog(860, 530);
* dialog.addHeader("Insert Macro")
* .addPanel("All", "<p></p>")
* .addPanel("Some", "<p></p>")
* .addButton("Next", function (dialog) {dialog.nextPage();})
* .addButton("Cancel", function (dialog) {dialog.hide();});
*
* dialog.addPage()
* .addButton("Cancel", function (dialog) {dialog.hide();});
*
* somebutton.click(function () {dialog.show();});
* </pre>
* @class Dialog
* @constructor
* @param width {number} dialog width in pixels, or an object containing the Dialog parameters
* @param height {number} dialog height in pixels
* @param id {number} [optional] dialog id
*/
function Dialog(width, height, id) {
var options = {};
if (! +width) {
options = Object(width);
width = options.width;
height = options.height;
id = options.id;
}
this.height = height || 480;
this.width = width || 640;
this.id = id;
options = _jquery2.default.extend({}, options, {
width: this.width,
height: this.height,
id: this.id
});
this.popup = createPopup(options);
this.popup.element.addClass('aui-dialog');
this.page = [];
this.curpage = 0;
new Page(this);
};
/**
* Method for adding header to the current page
* @method addHeader
* @param title {string} panel title
* @param className {string} [optional] HTML class name
* @return {object} the dialog
*/
Dialog.prototype.addHeader = function (title, className) {
this.page[this.curpage].addHeader(title, className);
return this;
};
/**
* Method for adding new button to the current page
* @method addButton
* @param label {string} button label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the dialog
*/
Dialog.prototype.addButton = function (label, onclick, className) {
this.page[this.curpage].addButton(label, onclick, className);
return this;
};
/**
* Method for adding new link to the current page
* @method addButton
* @param label {string} link label
* @param onclick {function} [optional] click event handler
* @param className {string} [optional] class name
* @return {object} the dialog
*/
Dialog.prototype.addLink = function (label, onclick, className, url) {
this.page[this.curpage].addLink(label, onclick, className, url);
return this;
};
/**
* Method for adding a submit button to the current page
* @method addSubmit
* @param label {string} link label
* @param onclick {function} [optional] click event handler
* @return {object} the dialog
*/
Dialog.prototype.addSubmit = function (label, onclick) {
this.page[this.curpage].addButton(label, onclick, 'button-panel-submit-button');
return this;
};
/**
* Method for adding a cancel link to the current page
* @method addCancel
* @param label {string} link label
* @param onclick {function} [optional] click event handler
* @return {object} the dialog
*/
Dialog.prototype.addCancel = function (label, onclick) {
this.page[this.curpage].addLink(label, onclick, 'button-panel-cancel-link');
return this;
};
/**
* Method for adding new button panel to the current page
* @return {object} the dialog
*/
Dialog.prototype.addButtonPanel = function () {
this.page[this.curpage].addButtonPanel();
return this;
};
/**
* Method for adding new panel to the current page.
* @method addPanel
* @param title {string} panel title
* @param reference {string} or {object} jQuery object or selector for the contents of the Panel
* @param className {string} [optional] HTML class name
* @param panelButtonId {String} [optional] The unique id for the panel's button.
* @return {object} the dialog
*/
Dialog.prototype.addPanel = function (title, reference, className, panelButtonId) {
this.page[this.curpage].addPanel(title, reference, className, panelButtonId);
return this;
};
/**
* Adds a new page to the dialog and sets the new page as the current page
* @method addPage
* @param className {string} [optional] HTML class name
* @return {object} the dialog
*/
Dialog.prototype.addPage = function (className) {
new Page(this, className);
this.page[this.curpage].hide();
this.curpage = this.page.length - 1;
return this;
};
/**
* Making next page in hierarchy visible and active
* @method nextPage
* @return {object} the dialog
*/
Dialog.prototype.nextPage = function () {
this.page[this.curpage++].hide();
if (this.curpage >= this.page.length) {
this.curpage = 0;
}
this.page[this.curpage].show();
return this;
};
/**
* Making previous page in hierarchy visible and active
* @method prevPage
* @return {object} the dialog
*/
Dialog.prototype.prevPage = function () {
this.page[this.curpage--].hide();
if (this.curpage < 0) {
this.curpage = this.page.length - 1;
}
this.page[this.curpage].show();
return this;
};
/**
* Making specified page visible and active
* @method gotoPage
* @param num {number} page id
* @return {object} the dialog
*/
Dialog.prototype.gotoPage = function (num) {
this.page[this.curpage].hide();
this.curpage = num;
if (this.curpage < 0) {
this.curpage = this.page.length - 1;
} else if (this.curpage >= this.page.length) {
this.curpage = 0;
}
this.page[this.curpage].show();
return this;
};
/**
* Returns specified panel at the current page
* @method getPanel
* @param pageorpanelId {number} page id or panel id
* @param panelId {number} panel id
* @return {object} the internal Panel object
*/
Dialog.prototype.getPanel = function (pageorpanelId, panelId) {
var pageid = panelId == null ? this.curpage : pageorpanelId;
if (panelId == null) {
panelId = pageorpanelId;
}
return this.page[pageid].panel[panelId];
};
/**
* Returns specified page
* @method getPage
* @param pageid {number} page id
* @return {object} the internal Page Object
*/
Dialog.prototype.getPage = function (pageid) {
return this.page[pageid];
};
/**
* Returns current panel at the current page
* @method getCurrentPanel
* @return {object} the internal Panel object
*/
Dialog.prototype.getCurrentPanel = function () {
return this.page[this.curpage].getCurrentPanel();
};
/**
* Selects corresponding panel
* @method gotoPanel
* @param pageorpanel {object} panel object or page object
* @param panel {object} panel object
* @param panel {number} id of the panel
*/
Dialog.prototype.gotoPanel = function (pageorpanel, panel) {
if (panel != null) {
var pageid = pageorpanel.id || pageorpanel;
this.gotoPage(pageid);
}
this.page[this.curpage].gotoPanel(typeof panel == 'undefined' ? pageorpanel : panel);
};
/**
* Shows the dialog, if it is not visible
* @method show
* @return {object} the dialog
*/
Dialog.prototype.show = function () {
this.popup.show();
(0, _event.trigger)('show.dialog', { dialog: this });
return this;
};
/**
* Hides the dialog, if it was visible
* @method hide
* @return {object} the dialog
*/
Dialog.prototype.hide = function () {
this.popup.hide();
(0, _event.trigger)('hide.dialog', { dialog: this });
return this;
};
/**
* Removes the dialog elements from the DOM
* @method remove
*/
Dialog.prototype.remove = function () {
this.popup.hide();
this.popup.remove();
(0, _event.trigger)('remove.dialog', { dialog: this });
};
/**
* Disables the dialog if enabled
* @method disable
*/
Dialog.prototype.disable = function () {
this.popup.disable();
return this;
};
/**
* Enables the dialog if disabled
* @method disable
*/
Dialog.prototype.enable = function () {
this.popup.enable();
return this;
};
/**
* Gets set of items depending on query
* @method get
* @param query {string} query to search for panels, pages, headers or buttons
* e.g.
* '#Name' will find all dialog components with the given name such as panels and buttons, etc
* 'panel#Name' will find only panels with the given name
* 'panel#"Foo bar"' will find only panels with given name
* 'panel:3' will find the third panel
*/
Dialog.prototype.get = function (query) {
var coll = [],
dialog = this;
var nameExp = '#([^"][^ ]*|"[^"]*")'; // a name is a hash followed by either a bare word or quoted string
var indexExp = ':(\\d+)'; // an index is a colon followed by some digits
var typeExp = 'page|panel|button|header'; // one of the allowed types
var selectorExp = '(?:' + // a selector is either ...
'(' + typeExp + ')(?:' + nameExp + '|' + indexExp + ')?' + // a type optionally followed by either #name or :index
'|' + nameExp + // or just a #name
')';
var queryRE = new RegExp('(?:^|,)' + // a comma or at the start of the line
'\\s*' + selectorExp + // optional space and a selector
'(?:\\s+' + selectorExp + ')?' + // optionally, followed by some space and a second selector
'\\s*(?=,|$)', 'ig'); // followed by, but not including, a comma or the end of the string
(query + '').replace(queryRE, function (all, name, title, id, justtitle, name2, title2, id2, justtitle2) {
name = name && name.toLowerCase();
var pages = [];
if (name == 'page' && dialog.page[id]) {
pages.push(dialog.page[id]);
name = name2;
name = name && name.toLowerCase();
title = title2;
id = id2;
justtitle = justtitle2;
} else {
pages = dialog.page;
}
title = title && (title + '').replace(/"/g, '');
title2 = title2 && (title2 + '').replace(/"/g, '');
justtitle = justtitle && (justtitle + '').replace(/"/g, '');
justtitle2 = justtitle2 && (justtitle2 + '').replace(/"/g, '');
if (name || justtitle) {
for (var i = pages.length; i--;) {
if (justtitle || name == 'panel' && (title || !title && id == null)) {
for (var j = pages[i].panel.length; j--;) {
if (pages[i].panel[j].button.html() == justtitle || pages[i].panel[j].button.html() == title || name == 'panel' && !title && id == null) {
coll.push(pages[i].panel[j]);
}
}
}
if (justtitle || name == 'button' && (title || !title && id == null)) {
for (var j = pages[i].button.length; j--;) {
if (pages[i].button[j].item.html() == justtitle || pages[i].button[j].item.html() == title || name == 'button' && !title && id == null) {
coll.push(pages[i].button[j]);
}
}
}
if (pages[i][name] && pages[i][name][id]) {
coll.push(pages[i][name][id]);
}
if (name == 'header' && pages[i].header) {
coll.push(pages[i].header);
}
}
} else {
coll = coll.concat(pages);
}
});
var res = {
length: coll.length
};
for (var i = coll.length; i--;) {
res[i] = coll[i];
for (var method in coll[i]) {
if (!(method in res)) {
(function (m) {
res[m] = function () {
for (var j = this.length; j--;) {
if (typeof this[j][m] == 'function') {
this[j][m].apply(this[j], arguments);
}
}
};
})(method);
}
}
}
return res;
};
/**
* Updates height of panels, to contain content without the need for scroll bars.
*
* @method updateHeight
*/
Dialog.prototype.updateHeight = function () {
var height = 0;
var maxDialogHeight = (0, _jquery2.default)(window).height() - HEADER_HEIGHT - BUTTONS_HEIGHT - MIN_DIALOG_VERTICAL_BUFFER * 2;
for (var i = 0; this.getPanel(i); i++) {
if (this.getPanel(i).body.css({ height: 'auto', display: 'block' }).outerHeight() > height) {
height = Math.min(maxDialogHeight, this.getPanel(i).body.outerHeight());
}
if (i !== this.page[this.curpage].curtab) {
this.getPanel(i).body.css({ display: 'none' });
}
}
for (i = 0; this.getPanel(i); i++) {
this.getPanel(i).body.css({ height: height || this.height });
}
this.page[0].menu.height(height);
this.height = height + HEADER_HEIGHT + BUTTONS_HEIGHT + 1;
this.popup.changeSize(undefined, this.height);
};
/**
* Returns whether the dialog has been resized to it's maximum height (has been capped by the viewport height and vertical buffer).
*
* @method isMaximised
*/
Dialog.prototype.isMaximised = function () {
return this.popup.element.outerHeight() >= (0, _jquery2.default)(window).height() - MIN_DIALOG_VERTICAL_BUFFER * 2;
};
/**
* Returns the current panel.
* @deprecated Since 3.0.1 Use getCurrentPanel() instead.
*/
Dialog.prototype.getCurPanel = function () {
return this.getPanel(this.page[this.curpage].curtab);
};
/**
* Returns the current button panel.
* @deprecated Since 3.0.1 Use get() instead.
*/
Dialog.prototype.getCurPanelButton = function () {
return this.getCurPanel().button;
};
return Dialog;
}();
exports.Dialog = Dialog = deprecate.construct(Dialog, 'Dialog constructor', {
alternativeName: 'Dialog2'
});
exports.popup = createPopup = deprecate.construct(createPopup, 'Dialog popup constructor', {
alternatveName: 'Dialog2'
});
(0, _globalize2.default)('Dialog', Dialog);
(0, _globalize2.default)('popup', createPopup);
exports.Dialog = Dialog;
exports.popup = createPopup;
return module.exports;
}).call(this);
// src/js/aui/unique-id.js
(typeof window === 'undefined' ? global : window).__c9d4b93e31238752737daf17cd7bfff0 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var uniqueID;
var uniqueIDstring;
var uniqueIDcounter = 0;
/**
* Generate a unique ID string, checking the ID is not present in the DOM before
* returning. Note uniqueID, uniqueIDstring, uniqueIDcounter = 0; set at top of
* file.
*
* @param {String} prefix String to prepend to ID instead of default AUI prefix.
*
* @returns {String}
*/
function generateUniqueId(prefix) {
uniqueID = uniqueIDcounter++ + '';
uniqueIDstring = prefix ? prefix + uniqueID : 'aui-uid-' + uniqueID;
if (!document.getElementById(uniqueIDstring)) {
return uniqueIDstring;
} else {
uniqueIDstring = uniqueIDstring + '-' + new Date().getTime();
if (!document.getElementById(uniqueIDstring)) {
return uniqueIDstring;
} else {
throw new Error('Timestamped fallback ID "' + uniqueIDstring + '" exists.');
}
}
}
(0, _globalize2.default)('id', generateUniqueId);
exports.default = generateUniqueId;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/internal/attributes.js
(typeof window === 'undefined' ? global : window).__bf7a81eee47585d485a1b8800ef3bc47 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.computeBooleanValue = computeBooleanValue;
exports.setBooleanAttribute = setBooleanAttribute;
exports.computeEnumValue = computeEnumValue;
exports.setEnumAttribute = setEnumAttribute;
/**
* Like el.hasAttribute(attr) but designed for use within a skate attribute
* change handler where you only have access to change.oldValue.
*/
function computeBooleanValue(attrValue) {
return attrValue !== null;
}
function setBooleanAttribute(el, attr, newValue) {
if (newValue) {
el.setAttribute(attr, '');
} else {
el.removeAttribute(attr);
}
}
function computeEnumValue(enumOptions, value) {
var matchesEnumValue = function matchesEnumValue(enumValue) {
return enumValue.toLowerCase() === value.toLowerCase();
};
var isMissing = value === null;
var isInvalid = !isMissing && !enumOptions.values.filter(matchesEnumValue).length;
if (isMissing) {
if (enumOptions.hasOwnProperty('missingDefault')) {
return enumOptions.missingDefault;
}
return null;
}
if (isInvalid) {
if (enumOptions.hasOwnProperty('invalidDefault')) {
return enumOptions.invalidDefault;
} else if (enumOptions.hasOwnProperty('missingDefault')) {
return enumOptions.missingDefault;
}
return null;
}
return enumOptions.values.length ? enumOptions.values.filter(matchesEnumValue)[0] : null;
}
function setEnumAttribute(el, enumOptions, newValue) {
el.setAttribute(enumOptions.attribute, newValue);
}
/**
* Helper functions useful for implementing reflected boolean and enumerated
* attributes and properties.
*
* @see https://html.spec.whatwg.org/multipage/infrastructure.html#reflecting-content-attributes-in-idl-attributes
* @see https://html.spec.whatwg.org/multipage/infrastructure.html#boolean-attribute
* @see https://html.spec.whatwg.org/multipage/infrastructure.html#enumerated-attribute
*/
exports.default = {
computeBooleanValue: computeBooleanValue,
setBooleanAttribute: setBooleanAttribute,
computeEnumValue: computeEnumValue,
setEnumAttribute: setEnumAttribute
};
return module.exports;
}).call(this);
// src/js/aui/polyfills/console.js
(typeof window === 'undefined' ? global : window).__e28e983111b2d3d88d7bef79e6c21aeb = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
/**
* AUI-2773
*
* The following shim for console is deprecated and to be removed in AUI 6.
* We shouldn't be creating console.log if it doesn't exist; instead, we should avoid using it directly.
* @start deprecated
*/
if (typeof window.console === 'undefined') {
window.console = {
messages: [],
log: function log(text) {
this.messages.push(text);
},
show: function show() {
alert(this.messages.join('\n'));
this.messages = [];
}
};
} else {
// Firebug console - show not required to do anything.
window.console.show = function () {};
}
return module.exports;
}).call(this);
// src/js/aui/binder.js
(typeof window === 'undefined' ? global : window).__8037b509c36c7516f87a5fe5dd2b8538 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Support for markup based binder components. Binder components must be objects with the following "interface":
*
* <pre>
* {
* selector: "input.foo",
* run: function(element) {
* //do stuff on given element
* }
* }
* </pre>
*/
var Binder = function () {
var binders = {};
return {
/**
* Runs all the binder components for the given scope, or the document body if none specified.
*
* @method runBinders
* @param scope {Element} element scope to run the binders in
*/
runBinders: function runBinders(scope) {
if (_jquery2.default.isEmptyObject(binders)) {
logger.log('No binders to run');
return;
}
scope = scope || document.body;
(0, _jquery2.default)('*:not(link, script)', scope).each(function (i, element) {
var $element = (0, _jquery2.default)(element);
_jquery2.default.each(binders, function (id, binder) {
if (!$element.data(id) && $element.is(binder.selector)) {
logger.log('Running binder component: ' + id + ' on element ' + element);
$element.data(id, true); // so we don't bind to the same element again later
binder.run(element);
}
});
});
},
/**
* Register a binder component with the given id.
* @method register
*/
register: function register(id, binder) {
binders[id] = binder;
},
/**
* Unregister a binder component for the given id.
* @method unregister
*/
unregister: function unregister(id) {
binders[id] = null;
}
};
}();
Binder = deprecate.construct(Binder, 'Binder', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('Binder', Binder);
exports.default = Binder;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/binders/placeholder.js
(typeof window === 'undefined' ? global : window).__32e7714cc3ebee6b5b4e0aea4997111b = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _binder = __8037b509c36c7516f87a5fe5dd2b8538;
var _binder2 = _interopRequireDefault(_binder);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(function () {
// browser supports placeholder, no need to do anything
var temp = document.createElement('input');
if ('placeholder' in temp) {
return;
}
/**
* Displays default text in the input field when its value is empty.
* If the browser supports placeholder input attributes (HTML5), then
* we skip this component.
*
* Usage:
* <pre>
* <input placeholder='Some default text'>
* </pre>
*
* Events thrown: reset.placeholder
*/
_binder2.default.register('placeholder', {
selector: 'input[placeholder]',
run: function run(element) {
var $this = (0, _jquery2.default)(element);
var applyDefaultText = function applyDefaultText() {
if (!_jquery2.default.trim($this.val()).length) {
$this.val($this.attr('placeholder')).addClass('placeholder-shown').trigger('reset.placeholder');
}
};
applyDefaultText();
$this.blur(applyDefaultText).focus(function () {
if ($this.hasClass('placeholder-shown')) {
$this.val('').removeClass('placeholder-shown');
}
});
}
});
})();
return module.exports;
}).call(this);
// src/js/jquery/jquery.os.js
(typeof window === 'undefined' ? global : window).__5b43648f596031491a97baa9d2ec3794 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
jQuery.os = {};
(function () {
var platform = navigator.platform.toLowerCase();
jQuery.os.windows = platform.indexOf('win') != -1;
jQuery.os.mac = platform.indexOf('mac') != -1;
jQuery.os.linux = platform.indexOf('linux') != -1;
})();
return module.exports;
}).call(this);
// src/js/jquery/jquery.moveto.js
(typeof window === 'undefined' ? global : window).__94e0ff9e638caab880e29e51cbdd8999 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
/**
*
* @module Controls
* @requires AJS, jQuery
*/
/**
* If not visible, moves the scroll position of the screen to the element
*
* <pre>
* <strong>Usage:</strong>
* jQuery("li.item").moveTo();
* </pre>
*
* This plugin also supports options as an argument. The options
* that can be defined are:
* <ul>
* <li>transition - if set to true will cause a smooth scrolling transition (false by default)</li>
* <li>scrollOffset - defines an offset to scroll past the element to view in pixels such that
* all of it can be viewed (35 pixels by default)</li>
* </ul>
*
* @class moveTo
* @constuctor moveTo
* @namespace jQuery.fn
* @param {Object} options
*/
jQuery.fn.moveTo = function (options) {
var defaults = {
transition: false,
scrollOffset: 35
};
var opts = jQuery.extend(defaults, options),
instance = this,
topOffset = instance.offset().top,
scrollTarget;
if ((jQuery(window).scrollTop() + jQuery(window).height() - this.outerHeight() < topOffset || jQuery(window).scrollTop() + opts.scrollOffset > topOffset) && jQuery(window).height() > opts.scrollOffset) {
if (jQuery(window).scrollTop() + opts.scrollOffset > topOffset) {
//move up
scrollTarget = topOffset - (jQuery(window).height() - this.outerHeight()) + opts.scrollOffset;
} else {
//move down
scrollTarget = topOffset - opts.scrollOffset;
}
if (!jQuery.fn.moveTo.animating && opts.transition) {
jQuery(document).trigger('moveToStarted', this);
jQuery.fn.moveTo.animating = true;
jQuery('html,body').animate({
scrollTop: scrollTarget
}, 1000, function () {
jQuery(document).trigger('moveToFinished', instance);
delete jQuery.fn.moveTo.animating;
});
return this;
} else {
var jQueryCache = jQuery('html, body');
if (jQueryCache.is(':animated')) {
jQueryCache.stop();
delete jQuery.fn.moveTo.animating;
}
jQuery(document).trigger('moveToStarted');
jQuery(window).scrollTop(scrollTarget);
//need to put a slight timeout for the moveToFinished event such that recipients of this event
//have time to act on it.
setTimeout(function () {
jQuery(document).trigger('moveToFinished', instance);
}, 100);
return this;
}
}
jQuery(document).trigger('moveToFinished', this);
return this;
};
return module.exports;
}).call(this);
// src/js/aui/cookie.js
(typeof window === 'undefined' ? global : window).__714f29948b44cf5844f18727934b0bbb = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.save = exports.read = exports.erase = undefined;
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var COOKIE_NAME = 'AJS.conglomerate.cookie';
var UNESCAPE_COOKIE_REGEX = /(\\|^"|"$)/g;
var CONSECUTIVE_PIPE_CHARS_REGEX = /\|\|+/g;
var ANY_QUOTE_REGEX = /"/g;
var REGEX_SPECIAL_CHARS = /[.*+?|^$()[\]{\\]/g;
function regexEscape(str) {
return str.replace(REGEX_SPECIAL_CHARS, '\\$&');
}
function getValueFromConglomerate(name, cookieValue) {
// A null cookieValue is just the first time through so create it.
cookieValue = cookieValue || '';
var reg = new RegExp(regexEscape(name) + '=([^|]+)');
var res = cookieValue.match(reg);
return res && res[1];
}
// Either append or replace the value in the cookie string/
function addOrAppendToValue(name, value, cookieValue) {
// A cookie name follows after any amount of white space mixed with any amount of '|' characters.
// A cookie value is preceded by '=', then anything except for '|'.
var reg = new RegExp('(\\s|\\|)*\\b' + regexEscape(name) + '=[^|]*[|]*');
cookieValue = cookieValue || '';
cookieValue = cookieValue.replace(reg, '|');
if (value !== '') {
var pair = name + '=' + value;
if (cookieValue.length + pair.length < 4020) {
cookieValue += '|' + pair;
}
}
return cookieValue.replace(CONSECUTIVE_PIPE_CHARS_REGEX, '|');
}
function unescapeCookieValue(name) {
return name.replace(UNESCAPE_COOKIE_REGEX, '');
}
function getCookieValue(name) {
var reg = new RegExp('\\b' + regexEscape(name) + '=((?:[^\\\\;]+|\\\\.)*)(?:;|$)');
var res = document.cookie.match(reg);
return res && unescapeCookieValue(res[1]);
}
function saveCookie(name, value, days) {
var ex = '';
var d;
var quotedValue = '"' + value.replace(ANY_QUOTE_REGEX, '\\"') + '"';
if (days) {
d = new Date();
d.setTime(+d + days * 24 * 60 * 60 * 1000);
ex = '; expires=' + d.toGMTString();
}
document.cookie = name + '=' + quotedValue + ex + ';path=/';
}
/**
* Save a cookie.
* @param name {String} name of cookie
* @param value {String} value of cookie
* @param expires {Number} number of days before cookie expires
*/
function save(name, value, expires) {
var cookieValue = getCookieValue(COOKIE_NAME);
cookieValue = addOrAppendToValue(name, value, cookieValue);
saveCookie(COOKIE_NAME, cookieValue, expires || 365);
}
/**
* Get the value of a cookie.
* @param name {String} name of cookie to read
* @param defaultValue {String} the default value of the cookie to return if not found
*/
function read(name, defaultValue) {
var cookieValue = getCookieValue(COOKIE_NAME);
var value = getValueFromConglomerate(name, cookieValue);
if (value != null) {
return value;
}
return defaultValue;
}
/**
* Remove the given cookie.
* @param name {String} the name of the cookie to remove
*/
function erase(name) {
save(name, '');
}
var cookie = {
erase: erase,
read: read,
save: save
};
(0, _globalize2.default)('cookie', cookie);
(0, _globalize2.default)('Cookie', cookie);
deprecate.prop(AJS, 'Cookie', {
alternativeName: 'cookie',
sinceVersion: '5.8.0'
});
exports.erase = erase;
exports.read = read;
exports.save = save;
return module.exports;
}).call(this);
// src/js/aui/firebug.js
(typeof window === 'undefined' ? global : window).__cbd9b0fd1e6737c2f65ac30e97ef259e = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.warnAboutFirebug = exports.firebug = undefined;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Does nothing because legacy code.
*
* @returns {undefined}
*/
function warnAboutFirebug() {}
/**
* Includes firebug lite for debugging in IE. Especially in IE.
*
* @returns {undefined}
*/
function firebug() {
var script = (0, _jquery2.default)(document.createElement('script'));
script.attr('src', 'https://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js');
(0, _jquery2.default)('head').append(script);
(function () {
if (window.firebug) {
firebug.init();
} else {
setTimeout(firebug, 0);
}
})();
}
exports.firebug = firebug = deprecate.fn(firebug, 'firebug', {
sinceVersion: '5.1.0'
});
exports.warnAboutFirebug = warnAboutFirebug = deprecate.fn(warnAboutFirebug, 'warnAboutFirebug', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('firebug', firebug);
(0, _globalize2.default)('warnAboutFirebug', warnAboutFirebug);
exports.firebug = firebug;
exports.warnAboutFirebug = warnAboutFirebug;
return module.exports;
}).call(this);
// src/js/aui/internal/add-id.js
(typeof window === 'undefined' ? global : window).__abe5b7da8a93a98ef8626a5c7324ede3 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _uniqueId = __c9d4b93e31238752737daf17cd7bfff0;
var _uniqueId2 = _interopRequireDefault(_uniqueId);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Apply a unique ID to the element. Preserves ID if the element already has one.
*
* @param {Element} el Selector to find target element.
* @param {string} prefix Optional. String to prepend to ID instead of default AUI prefix.
*
* @returns {undefined}
*/
function addId(el, prefix) {
var element = (0, _jquery2.default)(el);
var addprefix = prefix || false;
element.each(function () {
var $el = (0, _jquery2.default)(this);
if (!$el.attr('id')) {
$el.attr('id', (0, _uniqueId2.default)(addprefix));
}
});
}
(0, _globalize2.default)('_addID', addId);
exports.default = addId;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/alphanum.js
(typeof window === 'undefined' ? global : window).__1794ff9e45dfc3330dc35b0dccce5d7a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Compare two strings in alphanumeric way
* @method alphanum
* @param {String} a first string to compare
* @param {String} b second string to compare
* @return {Number(-1|0|1)} -1 if a < b, 0 if a = b, 1 if a > b
*/
function alphanum(a, b) {
a = (a + '').toLowerCase();
b = (b + '').toLowerCase();
var chunks = /(\d+|\D+)/g;
var am = a.match(chunks);
var bm = b.match(chunks);
var len = Math.max(am.length, bm.length);
for (var i = 0; i < len; i++) {
if (i === am.length) {
return -1;
}
if (i === bm.length) {
return 1;
}
var ad = parseInt(am[i], 10) + '';
var bd = parseInt(bm[i], 10) + '';
if (ad === am[i] && bd === bm[i] && ad !== bd) {
return (ad - bd) / Math.abs(ad - bd);
}
if ((ad !== am[i] || bd !== bm[i]) && am[i] !== bm[i]) {
return am[i] < bm[i] ? -1 : 1;
}
}
return 0;
}
(0, _globalize2.default)('alphanum', alphanum);
exports.default = alphanum;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/clone.js
(typeof window === 'undefined' ? global : window).__796eed8c59fc5f7e27526dd0677ddaf3 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Clones the element specified by the selector and removes the id attribute.
*
* @param {String} selector A jQuery selector
*/
function clone(selector) {
return (0, _jquery2.default)(selector).clone().removeAttr('id');
}
(0, _globalize2.default)('clone', clone);
exports.default = clone;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/contain-dropdown.js
(typeof window === 'undefined' ? global : window).__786e222bfa91643023364f6b42e4486c = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function containDropdown(dropdown, containerSelector, dynamic) {
function getDropdownOffset() {
return dropdown.$.offset().top - (0, _jquery2.default)(containerSelector).offset().top;
}
var container;
var ddOffset;
var availableArea;
var shadowOffset = 25;
if (dropdown.$.parents(containerSelector).length !== -1) {
container = (0, _jquery2.default)(containerSelector);
ddOffset = getDropdownOffset();
shadowOffset = 30;
availableArea = container.outerHeight() - ddOffset - shadowOffset;
if (availableArea <= parseInt(dropdown.$.attr('scrollHeight'), 10)) {
containDropdown.containHeight(dropdown, availableArea);
} else if (dynamic) {
containDropdown.releaseContainment(dropdown);
}
dropdown.reset();
}
};
containDropdown.containHeight = function (dropdown, availableArea) {
dropdown.$.css({
height: availableArea
});
if (dropdown.$.css('overflowY') !== 'scroll') {
dropdown.$.css({
width: 15 + dropdown.$.attr('scrollWidth'),
overflowY: 'scroll',
overflowX: 'hidden'
});
}
};
containDropdown.releaseContainment = function (dropdown) {
dropdown.$.css({
height: '',
width: '',
overflowY: '',
overflowX: ''
});
};
(0, _globalize2.default)('containDropdown', containDropdown);
exports.default = containDropdown;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/index-of.js
(typeof window === 'undefined' ? global : window).__ab61aa9c3e1a1a3253e130594f164c74 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Finds the index of an element in the array.
*
* @param {Array} The array being searched.
* @param {Mixed} item Element which will be searched for.
* @param {Integer} fromIndex The index from which the item will be searched. Negative values will search from the end of the array.
*
* @returns {Integer}
*/
function indexOf(array, item, fromIndex) {
var length = array.length;
if (!fromIndex) {
fromIndex = 0;
} else if (fromIndex < 0) {
fromIndex = Math.max(0, length + fromIndex);
}
for (var i = fromIndex; i < length; i++) {
if (array[i] === item) {
return i;
}
}
return -1;
}
(0, _globalize2.default)('indexOf', indexOf);
exports.default = indexOf;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/contains.js
(typeof window === 'undefined' ? global : window).__5d296ab9552bee3722548e48e3c85fa3 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _indexOf = __ab61aa9c3e1a1a3253e130594f164c74;
var _indexOf2 = _interopRequireDefault(_indexOf);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Looks for an element inside the array.
*
* @param {Array} array The array being searched.
* @param {Array} item The current item.
*
* @return {Boolean}
*/
function contains(array, item) {
return (0, _indexOf2.default)(array, item) > -1;
}
(0, _globalize2.default)('contains', contains);
exports.default = contains;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/draw-logo.js
(typeof window === 'undefined' ? global : window).__90fe58c1a5c237be6e18aada0d705916 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function drawLogo(options) {
var scale = options.scaleFactor || 1;
var fill = options.fill || '#fff';
var stroke = options.stroke || '#000';
var width = 400 * scale;
var height = 40 * scale;
var strokeWidth = options.strokeWidth || 1;
var containerID = options.containerID || '.aui-logo';
if (!(0, _jquery2.default)('.aui-logo').length) {
(0, _jquery2.default)('body').append('<div id="aui-logo" class="aui-logo"><div>');
}
var logoCanvas = Raphael(containerID, width + 50 * scale, height + 100 * scale);
var logo = logoCanvas.path('M 0,0 c 3.5433333,-4.7243333 7.0866667,-9.4486667 10.63,-14.173 -14.173,0 -28.346,0 -42.519,0 C -35.432667,-9.4486667 -38.976333,-4.7243333 -42.52,0 -28.346667,0 -14.173333,0 0,0 z m 277.031,28.346 c -14.17367,0 -28.34733,0 -42.521,0 C 245.14,14.173 255.77,0 266.4,-14.173 c -14.17267,0 -28.34533,0 -42.518,0 C 213.25167,0 202.62133,14.173 191.991,28.346 c -14.17333,0 -28.34667,0 -42.52,0 14.17333,-18.8976667 28.34667,-37.7953333 42.52,-56.693 -7.08667,-9.448667 -14.17333,-18.897333 -21.26,-28.346 -14.173,0 -28.346,0 -42.519,0 7.08667,9.448667 14.17333,18.897333 21.26,28.346 -14.17333,18.8976667 -28.34667,37.7953333 -42.52,56.693 -14.173333,0 -28.346667,0 -42.52,0 10.63,-14.173 21.26,-28.346 31.89,-42.519 -14.390333,0 -28.780667,0 -43.171,0 C 42.520733,1.330715e-4 31.889933,14.174867 21.26,28.347 c -42.520624,6.24e-4 -85.039187,-8.13e-4 -127.559,-0.001 11.220667,-14.961 22.441333,-29.922 33.662,-44.883 -6.496,-8.661 -12.992,-17.322 -19.488,-25.983 5.905333,0 11.810667,0 17.716,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 14.173333,0 28.346667,0 42.52,0 10.63,14.173333 21.26,28.346667 31.89,42.52 14.173333,0 28.3466667,0 42.52,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 14.1733333,0 28.3466667,0 42.52,0 10.63,14.173333 21.26,28.346667 31.89,42.52 14.390333,0 28.780667,0 43.171,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 42.51967,0 85.03933,0 127.559,0 10.63033,14.173333 21.26067,28.346667 31.891,42.52 14.17267,0 28.34533,0 42.518,0 -10.63,-14.173333 -21.26,-28.346667 -31.89,-42.52 14.17367,0 28.34733,0 42.521,0 14.17333,18.897667 28.34667,37.795333 42.52,56.693 -14.17333,18.8976667 -28.34667,37.7953333 -42.52,56.693 z');
logo.scale(scale, -scale, 0, 0);
logo.translate(120 * scale, height);
logo.attr('fill', fill);
logo.attr('stroke', stroke);
logo.attr('stroke-width', strokeWidth);
}
drawLogo = (0, _deprecation.fn)(drawLogo, 'drawLogo', {
sinceVersion: '5.1.0'
});
(0, _globalize2.default)('drawLogo', drawLogo);
exports.default = drawLogo;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js-vendor/jquery/plugins/jquery.aop.js
(typeof window === 'undefined' ? global : window).__fa695cc561e842f4a2d5b43fa35abc7f = (function () {
var module = {
exports: {}
};
var exports = module.exports;
/**
* jQuery AOP - jQuery plugin to add features of aspect-oriented programming (AOP) to jQuery.
* http://jquery-aop.googlecode.com/
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/mit-license.php
*
* Version: 1.3
*
* Cross-frame type detection based on Daniel Steigerwald's code (http://daniel.steigerwald.cz)
* http://gist.github.com/204554
*
*/
(function() {
var _after = 1;
var _afterThrow = 2;
var _afterFinally = 3;
var _before = 4;
var _around = 5;
var _intro = 6;
var _regexEnabled = true;
var _arguments = 'arguments';
var _undef = 'undefined';
var getType = (function() {
var toString = Object.prototype.toString,
toStrings = {},
nodeTypes = { 1: 'element', 3: 'textnode', 9: 'document', 11: 'fragment' },
types = 'Arguments Array Boolean Date Document Element Error Fragment Function NodeList Null Number Object RegExp String TextNode Undefined Window'.split(' ');
for (var i = types.length; i--; ) {
var type = types[i], constructor = window[type];
if (constructor) {
try { toStrings[toString.call(new constructor)] = type.toLowerCase(); }
catch (e) { }
}
}
return function(item) {
return item == null && (item === undefined ? _undef : 'null') ||
item.nodeType && nodeTypes[item.nodeType] ||
typeof item.length == 'number' && (
item.callee && _arguments ||
item.alert && 'window' ||
item.item && 'nodelist') ||
toStrings[toString.call(item)];
};
})();
var isFunc = function(obj) { return getType(obj) == 'function'; };
/**
* Private weaving function.
*/
var weaveOne = function(source, method, advice) {
var old = source[method];
// Work-around IE6/7 behavior on some native method that return object instances
if (advice.type != _intro && !isFunc(old)) {
var oldObject = old;
old = function() {
var code = arguments.length > 0 ? _arguments + '[0]' : '';
for (var i=1;i<arguments.length;i++) {
code += ',' + _arguments + '[' + i + ']';
}
return eval('oldObject(' + code + ');');
};
}
var aspect;
if (advice.type == _after || advice.type == _afterThrow || advice.type == _afterFinally)
aspect = function() {
var returnValue, exceptionThrown = null;
try {
returnValue = old.apply(this, arguments);
} catch (e) {
exceptionThrown = e;
}
if (advice.type == _after)
if (exceptionThrown == null)
returnValue = advice.value.apply(this, [returnValue, method]);
else
throw exceptionThrown;
else if (advice.type == _afterThrow && exceptionThrown != null)
returnValue = advice.value.apply(this, [exceptionThrown, method]);
else if (advice.type == _afterFinally)
returnValue = advice.value.apply(this, [returnValue, exceptionThrown, method]);
return returnValue;
};
else if (advice.type == _before)
aspect = function() {
advice.value.apply(this, [arguments, method]);
return old.apply(this, arguments);
};
else if (advice.type == _intro)
aspect = function() {
return advice.value.apply(this, arguments);
};
else if (advice.type == _around) {
aspect = function() {
var invocation = { object: this, args: Array.prototype.slice.call(arguments) };
return advice.value.apply(invocation.object, [{ arguments: invocation.args, method: method, proceed :
function() {
return old.apply(invocation.object, invocation.args);
}
}] );
};
}
aspect.unweave = function() {
source[method] = old;
pointcut = source = aspect = old = null;
};
source[method] = aspect;
return aspect;
};
/**
* Private method search
*/
var search = function(source, pointcut, advice) {
var methods = [];
for (var method in source) {
var item = null;
// Ignore exceptions during method retrival
try {
item = source[method];
}
catch (e) { }
if (item != null && method.match(pointcut.method) && isFunc(item))
methods[methods.length] = { source: source, method: method, advice: advice };
}
return methods;
};
/**
* Private weaver and pointcut parser.
*/
var weave = function(pointcut, advice) {
var source = typeof(pointcut.target.prototype) != _undef ? pointcut.target.prototype : pointcut.target;
var advices = [];
// If it's not an introduction and no method was found, try with regex...
if (advice.type != _intro && typeof(source[pointcut.method]) == _undef) {
// First try directly on target
var methods = search(pointcut.target, pointcut, advice);
// No method found, re-try directly on prototype
if (methods.length == 0)
methods = search(source, pointcut, advice);
for (var i in methods)
advices[advices.length] = weaveOne(methods[i].source, methods[i].method, methods[i].advice);
}
else
{
// Return as an array of one element
advices[0] = weaveOne(source, pointcut.method, advice);
}
return _regexEnabled ? advices : advices[0];
};
jQuery.aop =
{
/**
* Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
* has completed execution successfully, and will receive one parameter with the result of the execution.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.after( {target: window, method: 'MyGlobalMethod'}, function(result) {
* alert('Returned: ' + result);
* return result;
* } );
* @result Array<Function>
*
* @example jQuery.aop.after( {target: String, method: 'indexOf'}, function(index) {
* alert('Result found at: ' + index + ' on:' + this);
* return index;
* } );
* @result Array<Function>
*
* @name after
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
* with the result of the point-cut's execution. The function can choose to return this same value or a different one.
*
* @type Array<Function>
* @cat Plugins/General
*/
after : function(pointcut, advice)
{
return weave( pointcut, { type: _after, value: advice } );
},
/**
* Creates an advice after the defined point-cut only for unhandled exceptions. The advice will be executed
* after the point-cut method only if the execution failed and an exception has been thrown. It will receive one
* parameter with the exception thrown by the point-cut method.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.afterThrow( {target: String, method: 'indexOf'}, function(exception) {
* alert('Unhandled exception: ' + exception);
* return -1;
* } );
* @result Array<Function>
*
* @example jQuery.aop.afterThrow( {target: calculator, method: 'Calculate'}, function(exception) {
* console.log('Unhandled exception: ' + exception);
* throw exception;
* } );
* @result Array<Function>
*
* @name afterThrow
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called after the execution of the point-cut. It receives one parameter
* with the exception thrown by the point-cut method.
*
* @type Array<Function>
* @cat Plugins/General
*/
afterThrow : function(pointcut, advice)
{
return weave( pointcut, { type: _afterThrow, value: advice } );
},
/**
* Creates an advice after the defined point-cut. The advice will be executed after the point-cut method
* regardless of its success or failure, and it will receive two parameters: one with the
* result of a successful execution or null, and another one with the exception thrown or null.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.afterFinally( {target: window, method: 'MyGlobalMethod'}, function(result, exception) {
* if (exception == null)
* return 'Returned: ' + result;
* else
* return 'Unhandled exception: ' + exception;
* } );
* @result Array<Function>
*
* @name afterFinally
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called after the execution of the point-cut regardless of its success or failure.
* It receives two parameters, the first one with the result of a successful execution or null, and the second one with the
* exception or null.
*
* @type Array<Function>
* @cat Plugins/General
*/
afterFinally : function(pointcut, advice)
{
return weave( pointcut, { type: _afterFinally, value: advice } );
},
/**
* Creates an advice before the defined point-cut. The advice will be executed before the point-cut method
* but cannot modify the behavior of the method, or prevent its execution.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.before( {target: window, method: 'MyGlobalMethod'}, function() {
* alert('About to execute MyGlobalMethod');
* } );
* @result Array<Function>
*
* @example jQuery.aop.before( {target: String, method: 'indexOf'}, function(index) {
* alert('About to execute String.indexOf on: ' + this);
* } );
* @result Array<Function>
*
* @name before
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called before the execution of the point-cut.
*
* @type Array<Function>
* @cat Plugins/General
*/
before : function(pointcut, advice)
{
return weave( pointcut, { type: _before, value: advice } );
},
/**
* Creates an advice 'around' the defined point-cut. This type of advice can control the point-cut method execution by calling
* the functions '.proceed()' on the 'invocation' object, and also, can modify the arguments collection before sending them to the function call.
* This function returns an array of weaved aspects (Function).
*
* @example jQuery.aop.around( {target: window, method: 'MyGlobalMethod'}, function(invocation) {
* alert('# of Arguments: ' + invocation.arguments.length);
* return invocation.proceed();
* } );
* @result Array<Function>
*
* @example jQuery.aop.around( {target: String, method: 'indexOf'}, function(invocation) {
* alert('Searching: ' + invocation.arguments[0] + ' on: ' + this);
* return invocation.proceed();
* } );
* @result Array<Function>
*
* @example jQuery.aop.around( {target: window, method: /Get(\d+)/}, function(invocation) {
* alert('Executing ' + invocation.method);
* return invocation.proceed();
* } );
* @desc Matches all global methods starting with 'Get' and followed by a number.
* @result Array<Function>
*
*
* @name around
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved. Regex are supported, but not on built-in objects.
* @param Function advice Function containing the code that will get called around the execution of the point-cut. This advice will be called with one
* argument containing one function '.proceed()', the collection of arguments '.arguments', and the matched method name '.method'.
*
* @type Array<Function>
* @cat Plugins/General
*/
around : function(pointcut, advice)
{
return weave( pointcut, { type: _around, value: advice } );
},
/**
* Creates an introduction on the defined point-cut. This type of advice replaces any existing methods with the same
* name. To restore them, just unweave it.
* This function returns an array with only one weaved aspect (Function).
*
* @example jQuery.aop.introduction( {target: window, method: 'MyGlobalMethod'}, function(result) {
* alert('Returned: ' + result);
* } );
* @result Array<Function>
*
* @example jQuery.aop.introduction( {target: String, method: 'log'}, function() {
* alert('Console: ' + this);
* } );
* @result Array<Function>
*
* @name introduction
* @param Map pointcut Definition of the point-cut to apply the advice. A point-cut is the definition of the object/s and method/s to be weaved.
* @option Object target Target object to be weaved.
* @option String method Name of the function to be weaved.
* @param Function advice Function containing the code that will be executed on the point-cut.
*
* @type Array<Function>
* @cat Plugins/General
*/
introduction : function(pointcut, advice)
{
return weave( pointcut, { type: _intro, value: advice } );
},
/**
* Configures global options.
*
* @name setup
* @param Map settings Configuration options.
* @option Boolean regexMatch Enables/disables regex matching of method names.
*
* @example jQuery.aop.setup( { regexMatch: false } );
* @desc Disable regex matching.
*
* @type Void
* @cat Plugins/General
*/
setup: function(settings)
{
_regexEnabled = settings.regexMatch;
}
};
})();
return module.exports;
}).call(this);
// src/js/aui/drop-down.js
(typeof window === 'undefined' ? global : window).__dbe0d0ff20da8ec5be5af799a9c6bdb5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
__fa695cc561e842f4a2d5b43fa35abc7f;
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _createElement = __e3011d5cc5ea8e104654a5f8ae95cfba;
var _createElement2 = _interopRequireDefault(_createElement);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Displays a drop down, typically used for menus.
*
* @param obj {jQuery Object|String|Array} object to populate the drop down from.
* @param usroptions optional dropdown configuration. Supported properties are:
* <li>alignment - "left" or "right" alignment of the drop down</li>
* <li>escapeHandler - function to handle on escape key presses</li>
* <li>activeClass - class name to be added to drop down items when 'active' ie. hover over</li>
* <li>selectionHandler - function to handle when drop down items are selected on</li>
* <li>hideHandler - function to handle when the drop down is hidden</li>
* When an object of type Array is passed in, you can also configure:
* <li>isHiddenByDefault - set to true if you would like to hide the drop down on initialisation</li>
* <li>displayHandler - function to display text in the drop down</li>
* <li>useDisabled - If set to true, the dropdown will not appear if a class of disabled is added to aui-dd-parent</li>
*
* @returns {Array} an array of jQuery objects, referring to the drop down container elements
*/
function dropDown(obj, usroptions) {
var dd = null;
var result = [];
var moving = false;
var $doc = (0, _jquery2.default)(document);
var options = {
item: 'li:has(a)',
activeClass: 'active',
alignment: 'right',
displayHandler: function displayHandler(obj) {
return obj.name;
},
escapeHandler: function escapeHandler() {
this.hide('escape');
return false;
},
hideHandler: function hideHandler() {},
moveHandler: function moveHandler() {},
useDisabled: false
};
_jquery2.default.extend(options, usroptions);
options.alignment = { left: 'left', right: 'right' }[options.alignment.toLowerCase()] || 'left';
if (obj && obj.jquery) {
// if $
dd = obj;
} else if (typeof obj === 'string') {
// if $ selector
dd = (0, _jquery2.default)(obj);
} else if (obj && obj.constructor === Array) {
// if JSON
dd = (0, _createElement2.default)('div').addClass('aui-dropdown').toggleClass('hidden', !!options.isHiddenByDefault);
for (var i = 0, ii = obj.length; i < ii; i++) {
var ol = (0, _createElement2.default)('ol');
for (var j = 0, jj = obj[i].length; j < jj; j++) {
var li = (0, _createElement2.default)('li');
var properties = obj[i][j];
if (properties.href) {
li.append((0, _createElement2.default)('a').html('<span>' + options.displayHandler(properties) + '</span>').attr({ href: properties.href }).addClass(properties.className));
// deprecated - use the properties on the li, not the span
_jquery2.default.data((0, _jquery2.default)('a > span', li)[0], 'properties', properties);
} else {
li.html(properties.html).addClass(properties.className);
}
if (properties.icon) {
li.prepend((0, _createElement2.default)('img').attr('src', properties.icon));
}
if (properties.insideSpanIcon) {
li.children('a').prepend((0, _createElement2.default)('span').attr('class', 'icon'));
}
if (properties.iconFontClass) {
li.children('a').prepend((0, _createElement2.default)('span').addClass('aui-icon aui-icon-small aui-iconfont-' + properties.iconFontClass));
}
_jquery2.default.data(li[0], 'properties', properties);
ol.append(li);
}
if (i === ii - 1) {
ol.addClass('last');
}
dd.append(ol);
}
(0, _jquery2.default)('body').append(dd);
} else {
throw new Error('dropDown function was called with illegal parameter. Should be $ object, $ selector or array.');
}
var moveDown = function moveDown() {
move(+1);
};
var moveUp = function moveUp() {
move(-1);
};
var move = function move(dir) {
var trigger = !moving;
var cdd = dropDown.current.$[0];
var links = dropDown.current.links;
var oldFocus = cdd.focused;
moving = true;
if (links.length === 0) {
// Nothing to move focus to. Abort.
return;
}
cdd.focused = typeof oldFocus === 'number' ? oldFocus : -1;
if (!dropDown.current) {
logger.log('move - not current, aborting');
return true;
}
cdd.focused += dir;
// Resolve out of bounds values:
if (cdd.focused < 0) {
cdd.focused = links.length - 1;
} else if (cdd.focused >= links.length) {
cdd.focused = 0;
}
options.moveHandler((0, _jquery2.default)(links[cdd.focused]), dir < 0 ? 'up' : 'down');
if (trigger && links.length) {
(0, _jquery2.default)(links[cdd.focused]).addClass(options.activeClass);
moving = false;
} else if (!links.length) {
moving = false;
}
};
var moveFocus = function moveFocus(e) {
if (!dropDown.current) {
return true;
}
var c = e.which,
cdd = dropDown.current.$[0],
links = dropDown.current.links;
dropDown.current.cleanActive();
switch (c) {
case 40:
{
moveDown();
break;
}
case 38:
{
moveUp();
break;
}
case 27:
{
return options.escapeHandler.call(dropDown.current, e);
}
case 13:
{
if (cdd.focused >= 0) {
if (!options.selectionHandler) {
if ((0, _jquery2.default)(links[cdd.focused]).attr('nodeName') != 'a') {
return (0, _jquery2.default)('a', links[cdd.focused]).trigger('focus'); //focus on the "a" within the parent item elements
} else {
return (0, _jquery2.default)(links[cdd.focused]).trigger('focus'); //focus on the "a"
}
} else {
return options.selectionHandler.call(dropDown.current, e, (0, _jquery2.default)(links[cdd.focused])); //call the selection handler
}
}
return true;
}
default:
{
if (links.length) {
(0, _jquery2.default)(links[cdd.focused]).addClass(options.activeClass);
}
return true;
}
}
e.stopPropagation();
e.preventDefault();
return false;
};
var hider = function hider(e) {
if (!(e && e.which && e.which == 3 || e && e.button && e.button == 2 || false)) {
// right click check
if (dropDown.current) {
dropDown.current.hide('click');
}
}
};
var active = function active(i) {
return function () {
if (!dropDown.current) {
return;
}
dropDown.current.cleanFocus();
this.originalClass = this.className;
(0, _jquery2.default)(this).addClass(options.activeClass);
dropDown.current.$[0].focused = i;
};
};
var handleClickSelection = function handleClickSelection(e) {
if (e.button || e.metaKey || e.ctrlKey || e.shiftKey) {
return true;
}
if (dropDown.current && options.selectionHandler) {
options.selectionHandler.call(dropDown.current, e, (0, _jquery2.default)(this));
}
};
var isEventsBound = function isEventsBound(el) {
var bound = false;
if (el.data('events')) {
_jquery2.default.each(el.data('events'), function (i, handler) {
_jquery2.default.each(handler, function (type, handler) {
if (handleClickSelection === handler) {
bound = true;
return false;
}
});
});
}
return bound;
};
dd.each(function () {
var cdd = this,
$cdd = (0, _jquery2.default)(this),
res = {};
var methods = {
reset: function reset() {
res = _jquery2.default.extend(res, {
$: $cdd,
links: (0, _jquery2.default)(options.item || 'li:has(a)', cdd),
cleanActive: function cleanActive() {
if (cdd.focused + 1 && res.links.length) {
(0, _jquery2.default)(res.links[cdd.focused]).removeClass(options.activeClass);
}
},
cleanFocus: function cleanFocus() {
res.cleanActive();
cdd.focused = -1;
},
moveDown: moveDown,
moveUp: moveUp,
moveFocus: moveFocus,
getFocusIndex: function getFocusIndex() {
return typeof cdd.focused == 'number' ? cdd.focused : -1;
}
});
res.links.each(function (i) {
var $this = (0, _jquery2.default)(this);
if (!isEventsBound($this)) {
$this.hover(active(i), res.cleanFocus);
$this.click(handleClickSelection);
}
});
},
appear: function appear(dir) {
if (dir) {
$cdd.removeClass('hidden');
//handle left or right alignment
$cdd.addClass('aui-dropdown-' + options.alignment);
} else {
$cdd.addClass('hidden');
}
},
fade: function fade(dir) {
if (dir) {
$cdd.fadeIn('fast');
} else {
$cdd.fadeOut('fast');
}
},
scroll: function scroll(dir) {
if (dir) {
$cdd.slideDown('fast');
} else {
$cdd.slideUp('fast');
}
}
};
res.reset = methods.reset;
res.reset();
/**
* Uses Aspect Oriented Programming (AOP) to wrap a method around another method
* Allows control of the execution of the wrapped method.
* specified method has returned @see $.aop
* @method addControlProcess
* @param {String} methodName - Name of a public method
* @param {Function} callback - Function to be executed
* @return {Array} weaved aspect
*/
res.addControlProcess = function (method, process) {
_jquery2.default.aop.around({ target: this, method: method }, process);
};
/**
* Uses Aspect Oriented Programming (AOP) to insert callback <em>after</em> the
* specified method has returned @see $.aop
* @method addCallback
* @param {String} methodName - Name of a public method
* @param {Function} callback - Function to be executed
* @return {Array} weaved aspect
*/
res.addCallback = function (method, callback) {
return _jquery2.default.aop.after({ target: this, method: method }, callback);
};
res.show = function (method) {
if (options.useDisabled && this.$.closest('.aui-dd-parent').hasClass('disabled')) {
return;
}
this.alignment = options.alignment;
hider();
dropDown.current = this;
this.method = method || this.method || 'appear';
this.timer = setTimeout(function () {
$doc.click(hider);
}, 0);
$doc.keydown(moveFocus);
if (options.firstSelected && this.links[0]) {
active(0).call(this.links[0]);
}
(0, _jquery2.default)(cdd.offsetParent).css({ zIndex: 2000 });
methods[this.method](true);
(0, _jquery2.default)(document).trigger('showLayer', ['dropdown', dropDown.current]);
};
res.hide = function (causer) {
this.method = this.method || 'appear';
(0, _jquery2.default)($cdd.get(0).offsetParent).css({ zIndex: '' });
this.cleanFocus();
methods[this.method](false);
$doc.unbind('click', hider).unbind('keydown', moveFocus);
(0, _jquery2.default)(document).trigger('hideLayer', ['dropdown', dropDown.current]);
dropDown.current = null;
return causer;
};
res.addCallback('reset', function () {
if (options.firstSelected && this.links[0]) {
active(0).call(this.links[0]);
}
});
if (!dropDown.iframes) {
dropDown.iframes = [];
}
dropDown.createShims = function createShims() {
(0, _jquery2.default)('iframe').each(function (idx) {
var iframe = this;
if (!iframe.shim) {
iframe.shim = (0, _jquery2.default)('<div />').addClass('shim hidden').appendTo('body');
dropDown.iframes.push(iframe);
}
});
return createShims;
}();
res.addCallback('show', function () {
(0, _jquery2.default)(dropDown.iframes).each(function () {
var $this = (0, _jquery2.default)(this);
if ($this.is(':visible')) {
var offset = $this.offset();
offset.height = $this.height();
offset.width = $this.width();
this.shim.css({
left: offset.left + 'px',
top: offset.top + 'px',
height: offset.height + 'px',
width: offset.width + 'px'
}).removeClass('hidden');
}
});
});
res.addCallback('hide', function () {
(0, _jquery2.default)(dropDown.iframes).each(function () {
this.shim.addClass('hidden');
});
options.hideHandler();
});
result.push(res);
});
return result;
};
/**
* For the given item in the drop down get the value of the named additional property. If there is no
* property with the specified name then null will be returned.
*
* @method getAdditionalPropertyValue
* @namespace dropDown
* @param item {Object} jQuery Object of the drop down item. An LI element is expected.
* @param name {String} name of the property to retrieve
*/
dropDown.getAdditionalPropertyValue = function (item, name) {
var el = item[0];
if (!el || typeof el.tagName !== 'string' || el.tagName.toLowerCase() !== 'li') {
// we are moving the location of the properties and want to deprecate the attachment to the span
// but are unsure where and how its being called so for now we just log
logger.log('dropDown.getAdditionalPropertyValue : item passed in should be an LI element wrapped by jQuery');
}
var properties = _jquery2.default.data(el, 'properties');
return properties ? properties[name] : null;
};
/**
* Only here for backwards compatibility
* @method removeAllAdditionalProperties
* @namespace dropDown
* @deprecated Since 3.0
*/
dropDown.removeAllAdditionalProperties = function (item) {};
/**
* Base dropdown control. Enables you to identify triggers that when clicked, display dropdown.
*
* @class Standard
* @constructor
* @namespace dropDown
* @param {Object} usroptions
* @return {Object
*/
dropDown.Standard = function (usroptions) {
var res = [],
dropdownParents,
options = {
selector: '.aui-dd-parent',
dropDown: '.aui-dropdown',
trigger: '.aui-dd-trigger'
};
// extend defaults with user options
_jquery2.default.extend(options, usroptions);
var hookUpDropDown = function hookUpDropDown($trigger, $parent, $dropdown, ddcontrol) {
// extend to control to have any additional properties/methods
_jquery2.default.extend(ddcontrol, { trigger: $trigger });
// flag it to prevent additional dd controls being applied
$parent.addClass('dd-allocated');
//hide dropdown if not already hidden
$dropdown.addClass('hidden');
//show the dropdown if isHiddenByDefault is set to false
if (options.isHiddenByDefault == false) {
ddcontrol.show();
}
ddcontrol.addCallback('show', function () {
$parent.addClass('active');
});
ddcontrol.addCallback('hide', function () {
$parent.removeClass('active');
});
};
var handleEvent = function handleEvent(event, $trigger, $dropdown, ddcontrol) {
if (ddcontrol != dropDown.current) {
$dropdown.css({ top: $trigger.outerHeight() });
ddcontrol.show();
event.stopImmediatePropagation();
}
event.preventDefault();
};
if (options.useLiveEvents) {
// cache arrays so that we don't have to recalculate the dropdowns. Since we can't store objects as keys in a map,
// we have two arrays: keysCache stores keys of dropdown triggers; valuesCache stores a map of internally used objects
var keysCache = [];
var valuesCache = [];
(0, _jquery2.default)(options.trigger).live('click', function (event) {
var $trigger = (0, _jquery2.default)(this);
var $parent, $dropdown, ddcontrol;
// if we're cached, don't recalculate the dropdown and do all that funny shite.
var index;
if ((index = _jquery2.default.inArray(this, keysCache)) >= 0) {
var val = valuesCache[index];
$parent = val['parent'];
$dropdown = val['dropdown'];
ddcontrol = val['ddcontrol'];
} else {
$parent = $trigger.closest(options.selector);
$dropdown = $parent.find(options.dropDown);
// Sanity checking
if ($dropdown.length === 0) {
return;
}
ddcontrol = dropDown($dropdown, options)[0];
// Sanity checking
if (!ddcontrol) {
return;
}
// cache
keysCache.push(this);
val = {
parent: $parent,
dropdown: $dropdown,
ddcontrol: ddcontrol
};
hookUpDropDown($trigger, $parent, $dropdown, ddcontrol);
valuesCache.push(val);
}
handleEvent(event, $trigger, $dropdown, ddcontrol);
});
} else {
// handling for jQuery collections
if (this instanceof _jquery2.default) {
dropdownParents = this;
// handling for selectors
} else {
dropdownParents = (0, _jquery2.default)(options.selector);
}
// a series of checks to ensure we are dealing with valid dropdowns
dropdownParents = dropdownParents.not('.dd-allocated').filter(':has(' + options.dropDown + ')').filter(':has(' + options.trigger + ')');
dropdownParents.each(function () {
var $parent = (0, _jquery2.default)(this),
$dropdown = (0, _jquery2.default)(options.dropDown, this),
$trigger = (0, _jquery2.default)(options.trigger, this),
ddcontrol = dropDown($dropdown, options)[0];
// extend to control to have any additional properties/methods
_jquery2.default.extend(ddcontrol, { trigger: $trigger });
hookUpDropDown($trigger, $parent, $dropdown, ddcontrol);
$trigger.click(function (e) {
handleEvent(e, $trigger, $dropdown, ddcontrol);
});
// add control to the response
res.push(ddcontrol);
});
}
return res;
};
/**
* A NewStandard dropdown, however, with the ability to populate its content's via ajax.
*
* @class Ajax
* @constructor
* @namespace dropDown
* @param {Object} options
* @return {Object} dropDown instance
*/
dropDown.Ajax = function (usroptions) {
var dropdowns,
options = { cache: true };
// extend defaults with user options
_jquery2.default.extend(options, usroptions || {});
// we call with "this" in case we are called in the context of a jQuery collection
dropdowns = dropDown.Standard.call(this, options);
(0, _jquery2.default)(dropdowns).each(function () {
var ddcontrol = this;
_jquery2.default.extend(ddcontrol, {
getAjaxOptions: function getAjaxOptions(opts) {
var success = function success(response) {
if (options.formatResults) {
response = options.formatResults(response);
}
if (options.cache) {
ddcontrol.cache.set(ddcontrol.getAjaxOptions(), response);
}
ddcontrol.refreshSuccess(response);
};
if (options.ajaxOptions) {
if (_jquery2.default.isFunction(options.ajaxOptions)) {
return _jquery2.default.extend(options.ajaxOptions.call(ddcontrol), { success: success });
} else {
return _jquery2.default.extend(options.ajaxOptions, { success: success });
}
}
return _jquery2.default.extend(opts, { success: success });
},
refreshSuccess: function refreshSuccess(response) {
this.$.html(response);
},
cache: function () {
var c = {};
return {
get: function get(ajaxOptions) {
var data = ajaxOptions.data || '';
return c[(ajaxOptions.url + data).replace(/[\?\&]/gi, '')];
},
set: function set(ajaxOptions, responseData) {
var data = ajaxOptions.data || '';
c[(ajaxOptions.url + data).replace(/[\?\&]/gi, '')] = responseData;
},
reset: function reset() {
c = {};
}
};
}(),
show: function (superMethod) {
return function () {
if (options.cache && !!ddcontrol.cache.get(ddcontrol.getAjaxOptions())) {
ddcontrol.refreshSuccess(ddcontrol.cache.get(ddcontrol.getAjaxOptions()));
superMethod.call(ddcontrol);
} else {
(0, _jquery2.default)(_jquery2.default.ajax(ddcontrol.getAjaxOptions())).throbber({ target: ddcontrol.$,
end: function end() {
ddcontrol.reset();
}
});
superMethod.call(ddcontrol);
if (ddcontrol.iframeShim) {
ddcontrol.iframeShim.hide();
}
}
};
}(ddcontrol.show),
resetCache: function resetCache() {
ddcontrol.cache.reset();
}
});
ddcontrol.addCallback('refreshSuccess', function () {
ddcontrol.reset();
});
});
return dropdowns;
};
// OMG. No. Just no.
_jquery2.default.fn.dropDown = function (type, options) {
type = (type || 'Standard').replace(/^([a-z])/, function (match) {
return match.toUpperCase();
});
return dropDown[type].call(this, options);
};
_jquery2.default.fn.dropDown = deprecate.construct(_jquery2.default.fn.dropDown, 'Dropdown constructor', {
alternativeName: 'Dropdown2'
});
(0, _globalize2.default)('dropDown', dropDown);
exports.default = dropDown;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/escape.js
(typeof window === 'undefined' ? global : window).__99251565496475a9b75cce06caffbfa4 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Similar to Javascript's in-built escape() function, but where the built-in escape()
* might encode unicode charaters as %uHHHH, this function will leave them as-is.
*
* NOTE: this function does not do html-escaping, see escapeHtml().
*/
function escape(string) {
return escape(string).replace(/%u\w{4}/gi, function (w) {
return unescape(w);
});
}
(0, _globalize2.default)('escape', escape);
exports.default = escape;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/filter-by-search.js
(typeof window === 'undefined' ? global : window).__cb445a1e3929ac1448d5d67706d8a118 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Filters a list of entries by a passed search term.
*
* Options:
* - `keywordsField` name of entry field containing keywords, default "keywords".
* - `ignoreForCamelCase` ignore search case for camel case, e.g. CB matches Code Block *and* Code block.
* - `matchBoundary` match words only at boundary, e.g. link matches "linking" but not "hyperlinks".
* - `splitRegex` regex to split search words, instead of on whitespace.
*
* @param {Array} entries An array of objects with a "keywords" property.
* @param {String} search One or more words to search on, which may include camel-casing.
* @param {Object} options Specifiy to override default behaviour.
*
* @returns {Array}
*/
function filterBySearch(entries, search, options) {
// search for nothing, get nothing - up to calling code to handle.
if (!search) {
return [];
}
var keywordsField = options && options.keywordsField || 'keywords';
var camelCaseFlags = options && options.ignoreForCamelCase ? 'i' : '';
var boundaryFlag = options && options.matchBoundary ? '\\b' : '';
var splitRegex = options && options.splitRegex || /\s+/;
// each word in the input is considered a distinct filter that has to match a keyword in the record
var filterWords = search.split(splitRegex);
var filters = [];
filterWords.forEach(function (word) {
// anchor on word boundaries
var subfilters = [new RegExp(boundaryFlag + word, 'i')];
// split camel-case into separate words
if (/^([A-Z][a-z]*) {2,}$/.test(this)) {
var camelRegexStr = this.replace(/([A-Z][a-z]*)/g, '\\b$1[^,]*');
subfilters.push(new RegExp(camelRegexStr, camelCaseFlags));
}
filters.push(subfilters);
});
var result = [];
entries.forEach(function (entry) {
for (var i = 0; i < filters.length; i++) {
var somethingMatches = false;
for (var j = 0; j < filters[i].length; j++) {
if (filters[i][j].test(entry[keywordsField])) {
somethingMatches = true;
break;
}
}
if (!somethingMatches) {
return;
}
}
result.push(entry);
});
return result;
}
var filterBySearch = (0, _deprecation.fn)(filterBySearch, 'filterBySearch', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. If products require this function, this should be copied.'
});
(0, _globalize2.default)('filterBySearch', filterBySearch);
exports.default = filterBySearch;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/include.js
(typeof window === 'undefined' ? global : window).__d936583ed2eb96a4ea8a14060f9fc12a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _contains = __5d296ab9552bee3722548e48e3c85fa3;
var _contains2 = _interopRequireDefault(_contains);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var included = [];
function include(url) {
if (!(0, _contains2.default)(included, url)) {
included.push(url);
var s = document.createElement('script');
s.src = url;
(0, _jquery2.default)('body').append(s);
}
}
var include = (0, _deprecation.fn)(include, 'include', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use a proper module loader instead.'
});
(0, _globalize2.default)('include', include);
exports.default = include;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/inline-dialog2.js
(typeof window === 'undefined' ? global : window).__741ea5411c959080c2b42c1585082da1 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _alignment = __7f7f043e79eda40786b37c019e773a73;
var _alignment2 = _interopRequireDefault(_alignment);
var _amdify = __0e0294c65ea7575cfc4601f4797774b3;
var _amdify2 = _interopRequireDefault(_amdify);
var _attributes = __bf7a81eee47585d485a1b8800ef3bc47;
var _attributes2 = _interopRequireDefault(_attributes);
var _enforcer = __dc583a914c39307e4abaac9c487a9c86;
var _enforcer2 = _interopRequireDefault(_enforcer);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _layer = __03a7b88a7168f9cd8454c54888461782;
var _layer2 = _interopRequireDefault(_layer);
var _skate = __49ca30b6a02e1b6245e9234f1d2b19e4;
var _skate2 = _interopRequireDefault(_skate);
var _state = __239fd6e6c2ce37e6d305d5cbd575f16e;
var _state2 = _interopRequireDefault(_state);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DEFAULT_HOVEROUT_DELAY = 1000;
function getTrigger(element) {
return document.querySelector('[aria-controls="' + element.id + '"]');
}
function doIfTrigger(element, callback) {
var trigger = getTrigger(element);
if (trigger) {
callback(trigger);
}
}
function initAlignment(element, trigger) {
if (!element._auiAlignment) {
element._auiAlignment = new _alignment2.default(element, trigger);
}
}
function enableAlignment(element, trigger) {
initAlignment(element, trigger);
element._auiAlignment.enable();
}
function disableAlignment(element, trigger) {
initAlignment(element, trigger);
element._auiAlignment.disable();
}
function handleMessage(element, message) {
var messageTypeMap = {
toggle: ['click'],
hover: ['mouseenter', 'mouseleave', 'focus', 'blur']
};
var messageList = messageTypeMap[element.respondsTo];
if (messageList && messageList.indexOf(message.type) > -1) {
messageHandler[message.type](element, message);
}
}
var messageHandler = {
click: function click(element) {
if (element.open) {
if (!(0, _layer2.default)(element).isPersistent()) {
element.open = false;
}
} else {
element.open = true;
}
},
mouseenter: function mouseenter(element) {
if (!element.open) {
element.open = true;
}
if (element._clearMouseleaveTimeout) {
element._clearMouseleaveTimeout();
}
},
mouseleave: function mouseleave(element) {
if ((0, _layer2.default)(element).isPersistent() || !element.open) {
return;
}
if (element._clearMouseleaveTimeout) {
element._clearMouseleaveTimeout();
}
var timeout = setTimeout(function () {
if (!(0, _state2.default)(element).get('mouse-inside')) {
element.open = false;
}
}, DEFAULT_HOVEROUT_DELAY);
element._clearMouseleaveTimeout = function () {
clearTimeout(timeout);
element._clearMouseleaveTimeout = null;
};
},
focus: function focus(element) {
if (!element.open) {
element.open = true;
}
},
blur: function blur(element) {
if (!(0, _layer2.default)(element).isPersistent() && element.open) {
element.open = false;
}
}
};
function onMouseEnter(e) {
var element = e.target;
(0, _state2.default)(element).set('mouse-inside', true);
element.message({
type: 'mouseenter'
});
}
function onMouseLeave(e) {
var element = e.target;
(0, _state2.default)(element).set('mouse-inside', false);
element.message({
type: 'mouseleave'
});
}
function rebindMouseEvents(el) {
(0, _state2.default)(el).set('mouse-inside', undefined);
el.removeEventListener('mouseenter', onMouseEnter);
el.removeEventListener('mouseleave', onMouseLeave);
if (el.respondsTo === 'hover') {
(0, _state2.default)(el).set('mouse-inside', false);
el.addEventListener('mouseenter', onMouseEnter);
el.addEventListener('mouseleave', onMouseLeave);
}
}
function showInlineDialog(el) {
(0, _layer2.default)(el).show();
if ((0, _layer2.default)(el).isVisible()) {
doIfTrigger(el, function (trigger) {
enableAlignment(el, trigger);
trigger.setAttribute('aria-expanded', 'true');
});
}
}
function hideInlineDialog(el) {
(0, _layer2.default)(el).hide();
if (!(0, _layer2.default)(el).isVisible()) {
doIfTrigger(el, function (trigger) {
disableAlignment(el, trigger);
trigger.setAttribute('aria-expanded', 'false');
});
}
}
function reflectOpenness(el) {
var isInitalizing = !el.hasAttribute('aria-hidden');
var shouldBeOpen = el.hasAttribute('open');
if (isInitalizing || el.open !== shouldBeOpen) {
if (shouldBeOpen) {
(0, _state2.default)(el).set('is-processing-show', true);
showInlineDialog(el);
(0, _state2.default)(el).set('is-processing-show', false);
} else {
hideInlineDialog(el);
}
}
}
var RESPONDS_TO_ATTRIBUTE_ENUM = {
attribute: 'responds-to',
values: ['toggle', 'hover'],
missingDefault: 'toggle',
invalidDefault: 'toggle'
};
var inlineDialog = (0, _skate2.default)('aui-inline-dialog', {
prototype: {
/**
* Returns whether the inline dialog is open.
*/
get open() {
return (0, _layer2.default)(this).isVisible();
},
/**
* Opens or closes the inline dialog, returning whether the dialog is
* open or closed as a result (since event handlers can prevent either
* action).
*
* You should check the value of open after setting this
* value since the before show/hide events may have prevented it.
*/
set open(value) {
// TODO AUI-3726 Revisit double calls to canceled event handlers.
// Explicitly calling reflectOpenness(…) in this setter means
// that in native we'll get two sync calls to reflectOpenness(…)
// and in polyfill one sync (here) and one async (attr change
// handler). The latter of the two calls, for both cases, will
// usually be a noop (except when show/hide events are cancelled).
_attributes2.default.setBooleanAttribute(this, 'open', value);
reflectOpenness(this);
},
get persistent() {
return this.hasAttribute('persistent');
},
set persistent(value) {
_attributes2.default.setBooleanAttribute(this, 'persistent', value);
},
get respondsTo() {
var attr = RESPONDS_TO_ATTRIBUTE_ENUM.attribute;
return _attributes2.default.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, this.getAttribute(attr));
},
set respondsTo(value) {
var oldComputedValue = this.respondsTo;
_attributes2.default.setEnumAttribute(this, RESPONDS_TO_ATTRIBUTE_ENUM, value);
if (oldComputedValue !== this.respondsTo) {
rebindMouseEvents(this);
}
},
/**
* Handles the receiving of a message from another component.
*
* @param {Object} msg The message to act on.
*
* @returns {HTMLElement}
*/
message: function message(msg) {
handleMessage(this, msg);
return this;
}
},
created: function created(element) {
(0, _state2.default)(element).set('is-processing-show', false);
doIfTrigger(element, function (trigger) {
trigger.setAttribute('aria-expanded', element.open);
trigger.setAttribute('aria-haspopup', 'true');
});
},
attributes: {
'aria-hidden': function ariaHidden(element, change) {
// Whenever layer manager hides us, we need to sync the open attribute.
_attributes2.default.setBooleanAttribute(element, 'open', change.newValue === 'false');
},
open: function open(element, change) {
// skate runs the created callback for attributes before the
// element is attached to the DOM, so guard against that.
if (document.body.contains(element)) {
reflectOpenness(element);
}
},
'responds-to': function respondsTo(element, change) {
var oldComputedValue = _attributes2.default.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, change.oldValue);
var newComputedValue = _attributes2.default.computeEnumValue(RESPONDS_TO_ATTRIBUTE_ENUM, change.newValue);
if (oldComputedValue !== newComputedValue) {
rebindMouseEvents(element);
}
}
},
attached: function attached(element) {
(0, _enforcer2.default)(element).attributeExists('id');
if (element.hasAttribute('open')) {
// show() can cause the element to be reattached (to the <body>),
// so guard against a nested show() call that blows up the layer
// manager (since it sees us pushing the same element twice).
if (!(0, _state2.default)(element).get('is-processing-show')) {
reflectOpenness(element);
}
} else {
reflectOpenness(element);
}
rebindMouseEvents(element);
},
detached: function detached(element) {
if (element._auiAlignment) {
element._auiAlignment.destroy();
}
},
template: function template(element) {
(0, _jquery2.default)(element).addClass('aui-layer').html('<div class="aui-inline-dialog-contents">' + element.innerHTML + '</div>');
}
});
(0, _amdify2.default)('aui/inline-dialog2', inlineDialog);
(0, _globalize2.default)('InlineDialog2', inlineDialog);
exports.default = inlineDialog;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/is-clipped.js
(typeof window === 'undefined' ? global : window).__fb3a9f7e634b7c127a8ba80cec461643 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function to see if passed element is truncated/clipped, eg. with
* text-overflow: ellipsis.
*
* @param {String | Element | jQuery} element The element to check.
*
* @returns {Boolean}
*/
function isClipped(el) {
el = (0, _jquery2.default)(el);
return el.prop('scrollWidth') > el.prop('clientWidth');
}
(0, _globalize2.default)('isClipped', isClipped);
exports.default = isClipped;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/is-visible.js
(typeof window === 'undefined' ? global : window).__0ae5665c053233348ebb1bbda037babb = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function to see if passed element is currently visible on screen.
*
* @param {String | Element} element The HTMLElement or an jQuery selector to check.
*
* @returns {Boolean}
*/
function isVisible(element) {
return !(0, _jquery2.default)(element).hasClass('hidden');
}
var isVisible = (0, _deprecation.fn)(isVisible, 'isVisible', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use jQuery.hasClass() instead.'
});
(0, _globalize2.default)('isVisible', isVisible);
exports.default = isVisible;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/layer-manager.js
(typeof window === 'undefined' ? global : window).__d25f4a0d9d0391a5d806a560be72e8c6 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _layer = __03a7b88a7168f9cd8454c54888461782;
var _layer2 = _interopRequireDefault(_layer);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
(0, _globalize2.default)('LayerManager', _layer2.default.Manager);
exports.default = _layer2.default.Manager;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/messages.js
(typeof window === 'undefined' ? global : window).__a2ba592684a74c637f323e20db9376f5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _keyCode = __441232d78236eb4e37336c273cdfa555;
var _keyCode2 = _interopRequireDefault(_keyCode);
var _skate = __49ca30b6a02e1b6245e9234f1d2b19e4;
var _skate2 = _interopRequireDefault(_skate);
var _template = __728ac06ea1d5ca4ecbb34a7c4f64b723;
var _template2 = _interopRequireDefault(_template);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var DEFAULT_FADEOUT_DURATION = 500;
var DEFAULT_FADEOUT_DELAY = 5000;
var FADEOUT_RESTORE_DURATION = 100;
var MESSAGE_TEMPLATE = '<div class="aui-message aui-message-{type} {closeable} {shadowed} {fadeout}">' + '<p class="title">' + '<strong>{title}</strong>' + '</p>' + '{body}<!-- .aui-message -->' + '</div>';
function createMessageConstructor(type) {
/**
*
* @param context
* @param {Object} obj - message configuration
* @param {boolean} [obj.id] - ID to add to the message
* @param {boolean} obj.body - Content of the message
* @param {boolean} [obj.closeable]
* @param {boolean} [obj.shadowed]
* @param {boolean} [obj.fadeout]
* @param {boolean} [obj.duration]
* @param {boolean} [obj.delay]
* @returns {*|HTMLElement}
*/
messages[type] = function (context, obj) {
if (!obj) {
obj = context;
context = '#aui-message-bar';
}
// Set up our template options
obj.closeable = obj.closeable !== null && obj.closeable !== false;
// shadowed no longer does anything but left in so it doesn't break
obj.shadowed = obj.shadowed !== null && obj.shadowed !== false;
var $message = renderMessageElement(this.template, obj, type);
insertMessageIntoContext($message, obj.insert, context);
// Attach the optional extra behaviours
if (obj.closeable) {
makeCloseable($message);
}
if (obj.fadeout) {
makeFadeout($message, obj.delay, obj.duration);
}
return $message;
};
}
function makeCloseable(message) {
(0, _jquery2.default)(message || 'div.aui-message.closeable').each(function () {
var $this = (0, _jquery2.default)(this);
var $closeIcons = $this.find('.aui-icon.icon-close');
var $icon = $closeIcons.length > 0 ? $closeIcons.first() : (0, _jquery2.default)('<span class="aui-icon icon-close" role="button" tabindex="0"></span>');
$this.addClass('closeable');
$this.append($icon);
initCloseMessageBoxOnClickAndKeypress($this);
});
}
function makeFadeout(message, delay, duration) {
delay = typeof delay !== 'undefined' ? delay : DEFAULT_FADEOUT_DELAY;
duration = typeof duration !== 'undefined' ? duration : DEFAULT_FADEOUT_DURATION;
(0, _jquery2.default)(message || 'div.aui-message.fadeout').each(function () {
var $this = (0, _jquery2.default)(this);
//Store the component state to avoid collisions between animations
var hasFocus = false;
var isHover = false;
//Small functions to keep the code easier to read and avoid code duplication
function fadeOut() {
//Algorithm:
//1. Stop all running animations (first arg), including any fade animation and delay
// Do not jump to the end of the animation (second arg). This prevents the message to abruptly
// jump to opacity:0 or opacity:1
//2. Wait <delay> ms before starting the fadeout
//3. Start the fadeout with a duration of <duration> ms
//4. Close the message at the end of the animation
$this.stop(true, false).delay(delay).fadeOut(duration, function () {
$this.closeMessage();
});
}
function resetFadeOut() {
//Algorithm:
//1. Stop all running animations (first arg), including any fade animation and delay
// Do not jump to the end of the animation (second arg). This prevents the message to abruptly
// jump to opacity:0 or opacity:1
//2. Fast animation to opacity:1
$this.stop(true, false).fadeTo(FADEOUT_RESTORE_DURATION, 1);
}
function shouldStartFadeOut() {
return !hasFocus && !isHover;
}
//Attach handlers for user interactions (focus and hover)
$this.focusin(function () {
hasFocus = true;
resetFadeOut();
}).focusout(function () {
hasFocus = false;
if (shouldStartFadeOut()) {
fadeOut();
}
}).hover(function () {
//should be called .hoverin(), but jQuery does not implement that method
isHover = true;
resetFadeOut();
}, function () {
//should be called .hoverout(), but jQuery does not implement that method
isHover = false;
if (shouldStartFadeOut()) {
fadeOut();
}
});
//Initial animation
fadeOut();
});
}
/**
* Utility methods to display different message types to the user.
* Usage:
* <pre>
* messages.info("#container", {
* title: "Info",
* body: "You can choose to have messages without Close functionality.",
* closeable: false,
* shadowed: false
* });
* </pre>
*/
var messages = {
setup: function setup() {
makeCloseable();
makeFadeout();
},
makeCloseable: makeCloseable,
makeFadeout: makeFadeout,
template: MESSAGE_TEMPLATE,
createMessage: createMessageConstructor
};
function initCloseMessageBoxOnClickAndKeypress($message) {
$message.on('click', '.aui-icon.icon-close', function (e) {
(0, _jquery2.default)(e.target).closest('.aui-message').closeMessage();
}).on('keydown', '.aui-icon.icon-close', function (e) {
if (e.which === _keyCode2.default.ENTER || e.which === _keyCode2.default.SPACE) {
(0, _jquery2.default)(e.target).closest('.aui-message').closeMessage();
e.preventDefault(); // this is especially important when handling the space bar, as we don't want to page down
}
});
}
function insertMessageIntoContext($message, insertWhere, context) {
if (insertWhere === 'prepend') {
$message.prependTo(context);
} else {
$message.appendTo(context);
}
}
function renderMessageElement(templateString, options, type) {
// Append the message using template
var $message = (0, _jquery2.default)((0, _template2.default)(templateString).fill({
type: type,
closeable: options.closeable ? 'closeable' : '',
shadowed: options.shadowed ? 'shadowed' : '',
fadeout: options.fadeout ? 'fadeout' : '',
title: options.title || '',
'body:html': options.body || ''
}).toString());
// Add ID if supplied
if (options.id) {
if (/[#\'\"\.\s]/g.test(options.id)) {
// reject IDs that don't comply with style guide (ie. they'll break stuff)
logger.warn('Messages error: ID rejected, must not include spaces, hashes, dots or quotes.');
} else {
$message.attr('id', options.id);
}
}
return $message;
}
_jquery2.default.fn.closeMessage = function () {
var $message = (0, _jquery2.default)(this);
if ($message.hasClass('aui-message') && $message.hasClass('closeable')) {
$message.stop(true); //Stop any running animation
$message.trigger('messageClose', [this]).remove(); //messageClose event Deprecated as of 5.3
(0, _jquery2.default)(document).trigger('aui-message-close', [this]); //must trigger on document since the element has been removed
}
};
createMessageConstructor('generic');
createMessageConstructor('error');
createMessageConstructor('warning');
createMessageConstructor('info');
createMessageConstructor('success');
createMessageConstructor('hint');
(0, _skate2.default)('aui-message', {
created: function created(element) {
var body = element.innerHTML;
var type = element.getAttribute('type') || 'info';
element.innerHTML = '';
messages[type](element, {
body: body,
closeable: element.getAttribute('closeable'),
delay: element.getAttribute('delay'),
duration: element.getAttribute('duration'),
fadeout: element.getAttribute('fadeout'),
title: element.getAttribute('title')
});
}
});
(0, _jquery2.default)(function () {
messages.setup();
});
deprecate.prop(messages, 'makeCloseable', {
extraInfo: 'Use the "closeable" option in the constructor instead. Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
deprecate.prop(messages, 'createMessage', {
extraInfo: 'Use the provided convenience methods instead e.g. messages.generic(). Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
deprecate.prop(messages, 'makeFadeout', {
extraInfo: 'Use the "fadeout" option in the constructor instead. Docs: https://docs.atlassian.com/aui/latest/docs/messages.html'
});
// Exporting
// ---------
(0, _globalize2.default)('messages', messages);
exports.default = messages;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/navigation.js
(typeof window === 'undefined' ? global : window).__566da063c127b10285a7a186bff457e2 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
__8d80b2996ccf75cdbe997a5c7cbb4b40;
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _skate = __49ca30b6a02e1b6245e9234f1d2b19e4;
var _skate2 = _interopRequireDefault(_skate);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _widget = __752544d9d409a7f0b49e4d93aaa96cc5;
var _widget2 = _interopRequireDefault(_widget);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Navigation (".aui-nav" elements).
*
* @param {(string|HtmlElement|jQuery)} selector - An expression
* representing a single .aui-nav element; you may also pass an expression
* for a descendent element, in which case the closest containing
* .aui-nav element is used.
* @constructor
*/
function Navigation(selector) {
this.$el = (0, _jquery2.default)(selector).closest('.aui-nav');
// If there are multiple objects, initialise them separately
if (this.$el.length > 1) {
return this.$el.map(function (idx, elm) {
return new Navigation(elm);
})[0];
}
// If already initialised, return existing object
if (this.$el.data('aui-navigation')) {
return this.$el.data('aui-navigation');
}
this.$el.data('aui-navigation', this);
this.$treeParent = this.$el.parent('li[aria-expanded]');
this.$subtreeToggleIcon = this.$treeParent.children('.aui-nav-subtree-toggle').children('span.aui-icon');
// Hide extra items under a 'More...' link
this.hideMoreItems();
// Add child-selected class to relevant attributes
this.$el.children('li:has(.aui-nav-selected)').addClass('aui-nav-child-selected');
// Auto-expand if child is selected
var $selected = this.$el.children('.aui-nav-selected');
$selected.parents('.aui-nav > [aria-expanded=false]').add($selected.filter('[aria-expanded=false]')).each(function () {
var nav = navigationWidget((0, _jquery2.default)(this).children('.aui-nav'));
nav.expand();
});
// Toggle expand on click
this.$el.find('> li[aria-expanded] > .aui-nav-subtree-toggle').on('click', function () {
var nav = navigationWidget((0, _jquery2.default)(this).siblings('.aui-nav'));
nav.toggle();
});
return this;
}
Navigation.prototype.isNested = function () {
return this.$treeParent.length === 1;
};
Navigation.prototype.isCollapsed = function () {
return this.$treeParent.attr('aria-expanded') === 'false';
};
Navigation.prototype.expand = function () {
this.$treeParent.attr('aria-expanded', 'true');
this.$subtreeToggleIcon.removeClass('aui-iconfont-collapsed').addClass('aui-iconfont-expanded');
this.hideMoreItems();
return this;
};
Navigation.prototype.collapse = function () {
this.$treeParent.attr('aria-expanded', 'false');
this.$subtreeToggleIcon.removeClass('aui-iconfont-expanded').addClass('aui-iconfont-collapsed');
return this;
};
Navigation.prototype.toggle = function () {
if (this.isCollapsed()) {
this.expand();
} else {
this.collapse();
}
return this;
};
Navigation.prototype.hideMoreItems = function () {
if (this.$el.is('.aui-nav:not([aria-expanded=false]) [data-more]')) {
var moreText = this.$el.attr('data-more') || AJS.I18n.getText('aui.words.moreitem');
var limit = Math.abs(parseInt(this.$el.attr('data-more-limit'))) || 5;
var $listElements = this.$el.children('li');
// Only add 'More...' if there is more than one element to hide and there are no selected elements
var lessThanTwoToHide = $listElements.length <= limit + 1;
var selectedElementPresent = $listElements.filter('.aui-nav-selected').length;
var alreadyInitialised = $listElements.filter('.aui-nav-more').length;
if (lessThanTwoToHide || selectedElementPresent || alreadyInitialised) {
return this;
}
(0, _jquery2.default)('<li>', {
'class': 'aui-nav-more',
'aria-hidden': 'true'
}).append((0, _jquery2.default)('<a>', {
'href': '#',
'class': 'aui-nav-item',
'text': moreText,
'click': function click(e) {
e.preventDefault();
(0, _jquery2.default)(this).parent().remove();
}
})).insertAfter($listElements.eq(limit - 1));
}
return this;
};
var navigationWidget = (0, _widget2.default)('navigation', Navigation);
// Initialise nav elements
(0, _skate2.default)('aui-nav', {
type: _skate2.default.type.CLASSNAME,
attached: function attached(element) {
new Navigation(element);
},
detached: function detached(element) {
(0, _jquery2.default)(element).removeData();
}
});
(0, _globalize2.default)('navigation', navigationWidget);
exports.default = navigationWidget;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/on-text-resize.js
(typeof window === 'undefined' ? global : window).__5b22308adeddebe86dc06b7537b4f752 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _createElement = __e3011d5cc5ea8e104654a5f8ae95cfba;
var _createElement2 = _interopRequireDefault(_createElement);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function onTextResize(f) {
if (typeof f === 'function') {
if (onTextResize['on-text-resize']) {
onTextResize['on-text-resize'].push(function (emsize) {
f(emsize);
});
} else {
var em = (0, _createElement2.default)('div');
em.css({
width: '1em',
height: '1em',
position: 'absolute',
top: '-9999em',
left: '-9999em'
});
(0, _jquery2.default)('body').append(em);
em.size = em.width();
setInterval(function () {
if (em.size !== em.width()) {
em.size = em.width();
for (var i = 0, ii = onTextResize['on-text-resize'].length; i < ii; i++) {
onTextResize['on-text-resize'][i](em.size);
}
}
}, 0);
onTextResize.em = em;
onTextResize['on-text-resize'] = [function (emsize) {
f(emsize);
}];
}
}
}
(0, _globalize2.default)('onTextResize', onTextResize);
exports.default = onTextResize;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/params.js
(typeof window === 'undefined' ? global : window).__d8ebfd9c80ef0b7dc7d744b7e214d2ac = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (0, _globalize2.default)('params', {});
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/populate-parameters.js
(typeof window === 'undefined' ? global : window).__f192c0cf80aa95af408046fbe93591a5 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _params = __d8ebfd9c80ef0b7dc7d744b7e214d2ac;
var _params2 = _interopRequireDefault(_params);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function populateParameters(parameters) {
if (!parameters) {
parameters = _params2.default;
}
(0, _jquery2.default)('.parameters input').each(function () {
var value = this.value;
var id = this.title || this.id;
if ((0, _jquery2.default)(this).hasClass('list')) {
if (parameters[id]) {
parameters[id].push(value);
} else {
parameters[id] = [value];
}
} else {
parameters[id] = value.match(/^(tru|fals)e$/i) ? value.toLowerCase() === 'true' : value;
}
});
}
(0, _globalize2.default)('populateParameters', populateParameters);
exports.default = populateParameters;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/prevent-default.js
(typeof window === 'undefined' ? global : window).__1af8ce0ff7c95c22187c7659a50b6a4a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Calls e.preventDefault. This is designed for event handlers that only need to prevent the default browser
* action, eg:
*
* $(".my-class").click(AJS.preventDefault)
*
* @param {jQuery.Event} e jQuery event.
*
* @returns {undefined}
*/
function preventDefault(e) {
e.preventDefault();
}
(0, _globalize2.default)('preventDefault', preventDefault);
exports.default = preventDefault;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/header.js
(typeof window === 'undefined' ? global : window).__4ac97b6899c9d90b02080a23dd4fa9bd = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var deprecate = _interopRequireWildcard(_deprecation);
var _debounce = __cbf395035bbc83bf2d130a559590a472;
var _debounce2 = _interopRequireDefault(_debounce);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _i18n = __8d80b2996ccf75cdbe997a5c7cbb4b40;
var _i18n2 = _interopRequireDefault(_i18n);
var _skate = __49ca30b6a02e1b6245e9234f1d2b19e4;
var _skate2 = _interopRequireDefault(_skate);
var _state = __239fd6e6c2ce37e6d305d5cbd575f16e;
var _state2 = _interopRequireDefault(_state);
var _skatejsTemplateHtml = __10cd74f6112c3c1d2c570837676652d5;
var _skatejsTemplateHtml2 = _interopRequireDefault(_skatejsTemplateHtml);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var $window = (0, _jquery2.default)(window);
function Header(element) {
var that = this;
this.element = element;
this.$element = (0, _jquery2.default)(element);
this.index = (0, _jquery2.default)('aui-header, .aui-header').index(element);
this.$secondaryNav = this.$element.find('.aui-header-secondary .aui-nav').first();
this.menuItems = [];
this.totalWidth = 0;
this.$moreMenu = undefined;
this.rightMostNavItemIndex = undefined;
this.$applicationLogo = this.$element.find('#logo');
this.moreMenuWidth = 0;
this.primaryButtonsWidth = 0;
// to cache the selector and give .find convenience
this.$headerFind = function () {
var $header = (0, _jquery2.default)(that.$element[0].querySelector('.aui-header-primary'));
return function (selector) {
return $header.find(selector);
};
}();
}
Header.prototype = {
init: function init() {
var that = this;
this.element.setAttribute('data-aui-responsive', 'true');
this.$headerFind('.aui-button').parent().each(function () {
that.primaryButtonsWidth += (0, _jquery2.default)(this).outerWidth(true);
});
// remember the widths of all the menu items
this.$headerFind('.aui-nav > li > a:not(.aui-button)').each(function () {
var $this = (0, _jquery2.default)(this).parent();
var outerWidth = $this.outerWidth(true);
that.totalWidth += outerWidth;
that.menuItems.push({
$element: $this,
outerWidth: outerWidth
});
});
/** The zero based index of the right-most visible nav menu item. */
this.rightMostNavItemIndex = this.menuItems.length - 1;
$window.on('resize', this._resizeHandler = (0, _debounce2.default)(function () {
that.constructResponsiveDropdown();
}, 100));
// So that the header logo doesn't mess things up. (size is unknown before the image loads)
var $logoImg = this.$applicationLogo.find('img');
if ($logoImg.length !== 0) {
$logoImg.attr('data-aui-responsive-header-index', this.index);
$logoImg.load(function () {
that.constructResponsiveDropdown();
});
}
this.constructResponsiveDropdown();
// show the aui nav (hidden via css on load)
this.$headerFind('.aui-nav').css('width', 'auto');
},
destroy: function destroy() {
$window.off('resize', this._resizeHandler);
},
// calculate widths based on the current state of the page
calculateAvailableWidth: function calculateAvailableWidth() {
// if there is no secondary nav, use the right of the screen as the boundary instead
var rightMostBoundary = this.$secondaryNav.is(':visible') ? this.$secondaryNav.offset().left : this.$element.outerWidth();
// the right most side of the primary nav, this is assumed to exists if this code is running
var primaryNavRight = this.$applicationLogo.offset().left + this.$applicationLogo.outerWidth(true) + this.primaryButtonsWidth;
return rightMostBoundary - primaryNavRight;
},
showResponsiveDropdown: function showResponsiveDropdown() {
if (this.$moreMenu === undefined) {
this.$moreMenu = this.createResponsiveDropdownTrigger();
}
this.$moreMenu.css('display', '');
},
hideResponsiveDropdown: function hideResponsiveDropdown() {
if (this.$moreMenu !== undefined) {
this.$moreMenu.css('display', 'none');
}
},
constructResponsiveDropdown: function constructResponsiveDropdown() {
if (!this.menuItems.length) {
return;
}
var remainingWidth;
var availableWidth = this.calculateAvailableWidth(this.$element, this.primaryButtonsWidth);
if (availableWidth > this.totalWidth) {
this.showAll();
} else {
this.showResponsiveDropdown();
remainingWidth = availableWidth - this.moreMenuWidth;
// Figure out how many nav menu items fit into the available space.
var newRightMostNavItemIndex = -1;
while (remainingWidth - this.menuItems[newRightMostNavItemIndex + 1].outerWidth >= 0) {
remainingWidth -= this.menuItems[newRightMostNavItemIndex + 1].outerWidth;
newRightMostNavItemIndex++;
}
if (newRightMostNavItemIndex < this.rightMostNavItemIndex) {
this.moveToResponsiveDropdown(this.rightMostNavItemIndex - newRightMostNavItemIndex);
} else if (this.rightMostNavItemIndex < newRightMostNavItemIndex) {
this.moveOutOfResponsiveDropdown(newRightMostNavItemIndex - this.rightMostNavItemIndex);
}
}
},
// creates the trigger and content elements for the show more dropdown
createResponsiveDropdownTrigger: function createResponsiveDropdownTrigger() {
var moreNavItemEl = document.createElement('li');
var dropdownEl = document.createElement('aui-dropdown-menu');
dropdownEl.id = 'aui-responsive-header-dropdown-' + this.index;
_skate2.default.init(dropdownEl);
var dropdownSectionEl = document.createElement('aui-section');
dropdownSectionEl.id = 'aui-responsive-header-dropdown-list-' + this.index;
_skate2.default.init(dropdownSectionEl);
_skatejsTemplateHtml2.default.wrap(dropdownEl).appendChild(dropdownSectionEl);
var triggerEl = createTriggerAndAssociate(dropdownEl);
moreNavItemEl.appendChild(triggerEl);
moreNavItemEl.appendChild(dropdownEl);
// Append the More menu before any primary buttons.
if (this.primaryButtonsWidth === 0) {
this.$headerFind('.aui-nav').append(moreNavItemEl);
} else {
this.$headerFind('.aui-nav > li > .aui-button:first').parent().before(moreNavItemEl);
}
this.moreMenuWidth = (0, _jquery2.default)(moreNavItemEl).outerWidth(true);
return (0, _jquery2.default)(moreNavItemEl);
},
// function that handles moving items out of the show more menu into the app header
moveOutOfResponsiveDropdown: function moveOutOfResponsiveDropdown(numItems) {
if (numItems <= 0) {
return;
}
var $moreDropdown = (0, _jquery2.default)('#aui-responsive-header-dropdown-' + this.index);
// Move items (working top-to-bottom) from the more menu into the nav bar.
var leftMostIndexToMove = this.rightMostNavItemIndex + 1;
var rightMostIndexToMove = this.rightMostNavItemIndex + numItems;
for (var i = leftMostIndexToMove; i <= rightMostIndexToMove; i++) {
var $navItem = this.menuItems[i].$element;
var $navItemTrigger = $navItem.children('a');
var $navItemDropdown = (0, _jquery2.default)('#' + $navItemTrigger.attr('aria-controls'));
if ($navItemTrigger.attr('aria-controls')) {
$navItemDropdown.removeClass('aui-dropdown2-sub-menu');
$navItem.append($navItemDropdown);
}
$moreDropdown.find('aui-item-link:first').remove();
$navItem.insertBefore(this.$moreMenu);
}
this.rightMostNavItemIndex += numItems;
},
// function that handles moving items into the show more menu
moveToResponsiveDropdown: function moveToResponsiveDropdown(numItems) {
if (numItems <= 0) {
return;
}
var moreDropdownSectionEl = _skatejsTemplateHtml2.default.wrap(this.$moreMenu[0].querySelector('aui-section'));
// Move items (working right-to-left) from the nav bar to the more menu.
var rightMostIndexToMove = this.rightMostNavItemIndex;
var leftMostIndexToMove = this.rightMostNavItemIndex - numItems + 1;
for (var i = rightMostIndexToMove; i >= leftMostIndexToMove; i--) {
var $navItem = this.menuItems[i].$element;
var $navItemTrigger = $navItem.children('a');
var $navItemDropdown = (0, _jquery2.default)('#' + $navItemTrigger.attr('aria-controls'));
var moreDropdownItemEl = document.createElement('aui-item-link');
moreDropdownItemEl.setAttribute('href', $navItemTrigger.attr('href'));
if ($navItemTrigger.attr('aria-controls')) {
moreDropdownItemEl.setAttribute('for', $navItemTrigger.attr('aria-controls'));
$navItemDropdown.addClass('aui-dropdown2-sub-menu');
$navItemDropdown.appendTo('body');
}
_skate2.default.init(moreDropdownItemEl);
_skatejsTemplateHtml2.default.wrap(moreDropdownItemEl).textContent = $navItemTrigger.text();
$navItem.detach();
moreDropdownSectionEl.insertBefore(moreDropdownItemEl, moreDropdownSectionEl.firstChild);
}
this.rightMostNavItemIndex -= numItems;
},
// function that handles show everything
showAll: function showAll() {
this.moveOutOfResponsiveDropdown(this.menuItems.length - 1 - this.rightMostNavItemIndex);
this.hideResponsiveDropdown();
}
};
function createTriggerAndAssociate(dropdown) {
var trigger = document.createElement('a');
trigger.setAttribute('class', 'aui-dropdown2-trigger');
trigger.setAttribute('href', '#');
trigger.id = dropdown.id + '-trigger';
trigger.setAttribute('aria-controls', dropdown.id);
trigger.innerHTML = AJS.I18n.getText('aui.words.more');
return trigger;
}
function createHeader(element) {
var header = new Header(element);
header.init();
return header;
}
function findAndCreateHeaders() {
(0, _jquery2.default)('.aui-header').each(function () {
createHeader(this);
});
}
(0, _jquery2.default)(findAndCreateHeaders);
var responsiveheader = {};
responsiveheader.setup = deprecate.fn(findAndCreateHeaders, 'responsiveheader.setup', {
removeInVersion: '6.0.0',
sinceVersion: '5.8.0',
extraInfo: 'No need to manually initialise anymore as this is now a web component.'
});
(0, _skate2.default)('aui-header', {
created: function created(element) {
(0, _jquery2.default)(element).find('.aui-banner').addClass('aui-banner-error');
},
attached: function attached(element) {
(0, _state2.default)(element).set('instance', createHeader(element));
},
detached: function detached(element) {
(0, _state2.default)(element).get('instance').destroy();
},
attributes: {
link: function link(element, data) {
element.querySelector('#logo > a').setAttribute('href', data.newValue);
},
responsive: function responsive(element, data) {
element.querySelector('.aui-header').setAttribute('data-aui-responsive', data.newValue);
}
},
template: (0, _skatejsTemplateHtml2.default)('\n <content select="aui-banner"></content>\n <nav class="aui-header aui-dropdown2-trigger-group" role="navigation">\n <content select=".aui-header-before"></content>\n <div class="aui-header-primary">\n <h1 id="logo" class="aui-header-logo">\n <a href="/">\n <content select=".aui-header-logo, .aui-header-logo-device, .aui-header-logo-text"></content>\n </a>\n </h1>\n <content select=".aui-header-content"></content>\n </div>\n <content select=".aui-header-secondary"></content>\n <content select=".aui-header-after"></content>\n </nav>\n ')
});
(0, _globalize2.default)('responsiveheader', responsiveheader);
exports.default = responsiveheader;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/set-current.js
(typeof window === 'undefined' ? global : window).__251a4f471fb762cefb9b38d031b5d8e7 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function adds or removes 'current' classname to an element based on a passed boolean.
*
* @param {String | Element} element The element or an ID to show or hide.
* @param {boolean} show True to add 'current' class, false to remove.
*
* @returns {undefined}
*/
function setCurrent(element, current) {
if (!(element = (0, _jquery2.default)(element))) {
return;
}
if (current) {
element.addClass('current');
} else {
element.removeClass('current');
}
}
var setCurrent = (0, _deprecation.fn)(setCurrent, 'setCurrent', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use jQuery.addClass() / removeClass() instead.'
});
(0, _globalize2.default)('setCurrent', setCurrent);
exports.default = setCurrent;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/set-visible.js
(typeof window === 'undefined' ? global : window).__3964feac817637b8e9196e57cf900376 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function adds or removes 'hidden' classname to an element based on a passed boolean.
*
* @param {String | Element} element The element or an ID to show or hide.
* @param {boolean} show true to show, false to hide.
*
* @returns {undefined}
*/
function setVisible(element, show) {
if (!(element = (0, _jquery2.default)(element))) {
return;
}
(0, _jquery2.default)(element).each(function () {
var isHidden = (0, _jquery2.default)(this).hasClass('hidden');
if (isHidden && show) {
(0, _jquery2.default)(this).removeClass('hidden');
} else if (!isHidden && !show) {
(0, _jquery2.default)(this).addClass('hidden');
}
});
}
var setVisible = (0, _deprecation.fn)(setVisible, 'setVisible', {
sinceVersion: '5.9.0',
extraInfo: 'No alternative will be provided. Use jQuery.addClass() / removeClass() instead.'
});
(0, _globalize2.default)('setVisible', setVisible);
exports.default = setVisible;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/stop-event.js
(typeof window === 'undefined' ? global : window).__775c62d812944bb2aba8393d6a09b20a = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Prevent further handling of an event. Returns false, which you should use as the return value of your event handler:
* return stopEvent(e);
*
* @param {jQuery.Event} e jQuery event
*
* @returns {Boolean}
*/
function stopEvent(e) {
e.stopPropagation();
return false; // required for JWebUnit pop-up links to work properly
}
var stopEvent = (0, _deprecation.fn)(stopEvent, 'stopEvent', {
alternativeName: 'preventDefault()',
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('stopEvent', stopEvent);
exports.default = stopEvent;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/tabs.js
(typeof window === 'undefined' ? global : window).__12b76add029ed2b0c3d456d781110340 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
__10cd74f6112c3c1d2c570837676652d5;
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _debounce = __cbf395035bbc83bf2d130a559590a472;
var _debounce2 = _interopRequireDefault(_debounce);
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _addId = __abe5b7da8a93a98ef8626a5c7324ede3;
var _addId2 = _interopRequireDefault(_addId);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _isClipped = __fb3a9f7e634b7c127a8ba80cec461643;
var _isClipped2 = _interopRequireDefault(_isClipped);
var _skate = __49ca30b6a02e1b6245e9234f1d2b19e4;
var _skate2 = _interopRequireDefault(_skate);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var template = window.skateTemplateHtml;
var REGEX = /#.*/;
var STORAGE_PREFIX = '_internal-aui-tabs-';
var RESPONSIVE_OPT_IN_SELECTOR = '.aui-tabs.horizontal-tabs[data-aui-responsive]:not([data-aui-responsive="false"]), aui-tabs[responsive]:not([responsive="false"])';
function enhanceTabLink(link) {
var $thisLink = (0, _jquery2.default)(link);
var targetPane = $thisLink.attr('href');
(0, _addId2.default)($thisLink);
$thisLink.attr('role', 'tab');
(0, _jquery2.default)(targetPane).attr('aria-labelledby', $thisLink.attr('id'));
if ($thisLink.parent().hasClass('active-tab')) {
$thisLink.attr('aria-selected', 'true');
} else {
$thisLink.attr('aria-selected', 'false');
}
}
var ResponsiveAdapter = {
totalTabsWidth: function totalTabsWidth($visibleTabs, $dropdown) {
var totalVisibleTabsWidth = this.totalVisibleTabWidth($visibleTabs);
var totalDropdownTabsWidth = 0;
$dropdown.find('li').each(function (index, tab) {
totalDropdownTabsWidth += parseInt(tab.getAttribute('data-aui-tab-width'));
});
return totalVisibleTabsWidth + totalDropdownTabsWidth;
},
totalVisibleTabWidth: function totalVisibleTabWidth($tabs) {
var totalWidth = 0;
$tabs.each(function (index, tab) {
totalWidth += (0, _jquery2.default)(tab).outerWidth();
});
return totalWidth;
},
removeResponsiveDropdown: function removeResponsiveDropdown($dropdown, $dropdownTriggerTab) {
$dropdown.remove();
$dropdownTriggerTab.remove();
},
createResponsiveDropdownTrigger: function createResponsiveDropdownTrigger($tabsMenu, id) {
var triggerMarkup = '<li class="menu-item aui-tabs-responsive-trigger-item">' + '<a class="aui-dropdown2-trigger aui-tabs-responsive-trigger aui-dropdown2-trigger-arrowless" id="aui-tabs-responsive-trigger-' + id + '" aria-haspopup="true" aria-controls="aui-tabs-responsive-dropdown-' + id + '" href="aui-tabs-responsive-dropdown-' + id + '">...</a>' + '</li>';
$tabsMenu.append(triggerMarkup);
var $trigger = $tabsMenu.find('.aui-tabs-responsive-trigger-item');
return $trigger;
},
createResponsiveDropdown: function createResponsiveDropdown($tabsContainer, id) {
var dropdownMarkup = '<div class="aui-dropdown2 aui-style-default aui-tabs-responsive-dropdown" id="aui-tabs-responsive-dropdown-' + id + '">' + '<ul>' + '</ul>' + '</div>';
$tabsContainer.append(dropdownMarkup);
var $dropdown = $tabsContainer.find('#aui-tabs-responsive-dropdown-' + id);
return $dropdown;
},
findNewVisibleTabs: function findNewVisibleTabs(tabs, parentWidth, dropdownTriggerTabWidth) {
function hasMoreSpace(currentTotalTabWidth, dropdownTriggerTabWidth, parentWidth) {
return currentTotalTabWidth + dropdownTriggerTabWidth <= parentWidth;
}
var currentTotalTabWidth = 0;
for (var i = 0; hasMoreSpace(currentTotalTabWidth, dropdownTriggerTabWidth, parentWidth) && i < tabs.length; i++) {
var $tab = (0, _jquery2.default)(tabs[i]);
var tabWidth = $tab.outerWidth(true);
currentTotalTabWidth += tabWidth;
}
// i should now be at the tab index after the last visible tab because of the loop so we minus 1 to get the new visible tabs
return tabs.slice(0, i - 1);
},
moveVisibleTabs: function moveVisibleTabs(oldVisibleTabs, $tabsParent, $dropdownTriggerTab) {
var dropdownId = $dropdownTriggerTab.find('a').attr('aria-controls');
var $dropdown = (0, _jquery2.default)('#' + dropdownId);
var newVisibleTabs = this.findNewVisibleTabs(oldVisibleTabs, $tabsParent.outerWidth(), $dropdownTriggerTab.parent().outerWidth(true));
var lastTabIndex = newVisibleTabs.length - 1;
for (var j = oldVisibleTabs.length - 1; j >= lastTabIndex; j--) {
var $tab = (0, _jquery2.default)(oldVisibleTabs[j]);
this.moveTabToResponsiveDropdown($tab, $dropdown, $dropdownTriggerTab);
}
return (0, _jquery2.default)(newVisibleTabs);
},
moveTabToResponsiveDropdown: function moveTabToResponsiveDropdown($tab, $dropdown, $dropdownTriggerTab) {
var $tabLink = $tab.find('a');
$tab.attr('data-aui-tab-width', $tab.outerWidth(true));
$tabLink.addClass('aui-dropdown2-radio aui-tabs-responsive-item');
if ($tab.hasClass('active-tab')) {
$tabLink.addClass('aui-dropdown2-checked');
$dropdownTriggerTab.addClass('active-tab');
}
$dropdown.find('ul').prepend($tab);
},
moveInvisibleTabs: function moveInvisibleTabs(tabsInDropdown, remainingSpace, $dropdownTriggerTab) {
function hasMoreSpace(remainingSpace) {
return remainingSpace > 0;
}
for (var i = 0; hasMoreSpace(remainingSpace) && i < tabsInDropdown.length; i++) {
var $tab = (0, _jquery2.default)(tabsInDropdown[i]);
var tabInDropdownWidth = parseInt($tab.attr('data-aui-tab-width'), 10);
var shouldMoveTabOut = tabInDropdownWidth < remainingSpace;
if (shouldMoveTabOut) {
this.moveTabOutOfDropdown($tab, $dropdownTriggerTab);
}
remainingSpace -= tabInDropdownWidth;
}
},
moveTabOutOfDropdown: function moveTabOutOfDropdown($tab, $dropdownTriggerTab) {
var isTabInDropdownActive = $tab.find('a').hasClass('aui-dropdown2-checked');
if (isTabInDropdownActive) {
$tab.addClass('active-tab');
$dropdownTriggerTab.removeClass('active-tab');
}
$tab.children('a').removeClass('aui-dropdown2-radio aui-tabs-responsive-item aui-dropdown2-checked');
$dropdownTriggerTab.before($tab);
}
};
// this function is run by jquery .each() where 'this' is the current tabs container
function calculateResponsiveTabs(tabsContainer, index) {
var $tabsContainer = (0, _jquery2.default)(tabsContainer);
var $tabsMenu = $tabsContainer.find('.tabs-menu').first();
var $visibleTabs = $tabsMenu.find('li:not(.aui-tabs-responsive-trigger-item)');
var $dropdownTriggerTab = $tabsMenu.find('.aui-tabs-responsive-trigger').parent();
var $dropdownTrigger = $dropdownTriggerTab.find('a');
var dropdownId = $dropdownTrigger.attr('aria-controls');
var $dropdown = (0, _jquery2.default)(document).find('#' + dropdownId).attr('aria-checked', false);
var isResponsive = $dropdown.length > 0;
var totalTabsWidth = ResponsiveAdapter.totalTabsWidth($visibleTabs, $dropdown);
var needsResponsive = totalTabsWidth > $tabsContainer.outerWidth();
if (!isResponsive && needsResponsive) {
$dropdownTriggerTab = ResponsiveAdapter.createResponsiveDropdownTrigger($tabsMenu, index);
$dropdown = ResponsiveAdapter.createResponsiveDropdown($tabsContainer, index);
}
// reset id's in case tabs have changed DOM order
$dropdownTrigger.attr('aria-controls', 'aui-tabs-responsive-dropdown-' + index);
$dropdownTrigger.attr('id', 'aui-tabs-responsive-trigger-' + index);
$dropdownTrigger.attr('href', 'aui-tabs-responsive-trigger-' + index);
$dropdown.attr('id', 'aui-tabs-responsive-dropdown-' + index);
if (needsResponsive) {
var $newVisibleTabs = ResponsiveAdapter.moveVisibleTabs($visibleTabs.toArray(), $tabsContainer, $dropdownTriggerTab);
var visibleTabWidth = ResponsiveAdapter.totalVisibleTabWidth($newVisibleTabs);
var remainingSpace = $tabsContainer.outerWidth() - visibleTabWidth - $dropdownTriggerTab.outerWidth(true);
var hasSpace = remainingSpace > 0;
if (hasSpace) {
var $tabsInDropdown = $dropdown.find('li');
ResponsiveAdapter.moveInvisibleTabs($tabsInDropdown.toArray(), remainingSpace, $dropdownTriggerTab);
}
$dropdown.on('click', 'a', handleTabClick);
}
if (isResponsive && !needsResponsive) {
$dropdown.find('li').each(function () {
ResponsiveAdapter.moveTabOutOfDropdown((0, _jquery2.default)(this), $dropdownTriggerTab);
});
ResponsiveAdapter.removeResponsiveDropdown($dropdown, $dropdownTriggerTab);
}
}
function switchToTab(tab) {
var $tab = (0, _jquery2.default)(tab);
// This probably isn't needed anymore. Remove once confirmed.
if ($tab.hasClass('aui-tabs-responsive-trigger')) {
return;
}
var $pane = (0, _jquery2.default)($tab.attr('href').match(REGEX)[0]);
$pane.addClass('active-pane').attr('aria-hidden', 'false').siblings('.tabs-pane').removeClass('active-pane').attr('aria-hidden', 'true');
var $dropdownTriggerTab = $tab.parents('.aui-tabs').find('.aui-tabs-responsive-trigger-item a');
var dropdownId = $dropdownTriggerTab.attr('aria-controls');
var $dropdown = (0, _jquery2.default)(document).find('#' + dropdownId);
$dropdown.find('li a').attr('aria-checked', false).removeClass('checked aui-dropdown2-checked');
$dropdown.find('li').removeClass('active-tab');
$tab.parent('li.menu-item').addClass('active-tab').siblings('.menu-item').removeClass('active-tab');
if ($tab.hasClass('aui-tabs-responsive-item')) {
var $visibleTabs = $pane.parent('.aui-tabs').find('li.menu-item:not(.aui-tabs-responsive-trigger-item)');
$visibleTabs.removeClass('active-tab');
$visibleTabs.find('a').removeClass('checked').removeAttr('aria-checked');
}
if ($tab.hasClass('aui-tabs-responsive-item')) {
$pane.parent('.aui-tabs').find('li.menu-item.aui-tabs-responsive-trigger-item').addClass('active-tab');
}
$tab.closest('.tabs-menu').find('a').attr('aria-selected', 'false');
$tab.attr('aria-selected', 'true');
$tab.trigger('tabSelect', {
tab: $tab,
pane: $pane
});
}
function isPersistentTabGroup($tabGroup) {
// Tab group persistent attribute exists and is not false
return $tabGroup.attr('data-aui-persist') !== undefined && $tabGroup.attr('data-aui-persist') !== 'false';
}
function createPersistentKey($tabGroup) {
var tabGroupId = $tabGroup.attr('id');
var value = $tabGroup.attr('data-aui-persist');
return STORAGE_PREFIX + (tabGroupId ? tabGroupId : '') + (value && value !== 'true' ? '-' + value : '');
}
function updateTabsFromLocalStorage($tabGroups) {
for (var i = 0, ii = $tabGroups.length; i < ii; i++) {
var $tabGroup = $tabGroups.eq(i);
var tabs = $tabGroups.get(i);
if (isPersistentTabGroup($tabGroup) && window.localStorage) {
var tabGroupId = $tabGroup.attr('id');
if (tabGroupId) {
var persistentTabId = window.localStorage.getItem(createPersistentKey($tabGroup));
if (persistentTabId) {
var anchor = tabs.querySelector('a[href$="' + persistentTabId + '"]');
if (anchor) {
switchToTab(anchor);
}
}
} else {
logger.warn('A tab group must specify an id attribute if it specifies data-aui-persist.');
}
}
}
}
function updateLocalStorageEntry($tab) {
var $tabGroup = $tab.closest('.aui-tabs');
var tabGroupId = $tabGroup.attr('id');
if (tabGroupId) {
var tabId = $tab.attr('href');
if (tabId) {
window.localStorage.setItem(createPersistentKey($tabGroup), tabId);
}
} else {
logger.warn('A tab group must specify an id attribute if it specifies data-aui-persist.');
}
}
function handleTabClick(e) {
tabs.change((0, _jquery2.default)(e.target).closest('a'));
if (e) {
e.preventDefault();
}
}
function responsiveResizeHandler(tabs) {
tabs.forEach(function (tab, index) {
calculateResponsiveTabs(tab, index);
});
}
// Initialisation
// --------------
function getTabs() {
return (0, _jquery2.default)('.aui-tabs:not(.aui-tabs-disabled)');
}
function getResponsiveTabs() {
return (0, _jquery2.default)(RESPONSIVE_OPT_IN_SELECTOR).toArray();
}
function initWindow() {
var debounced = (0, _debounce2.default)(responsiveResizeHandler, 200);
var responsive = getResponsiveTabs();
responsiveResizeHandler(responsive);
(0, _jquery2.default)(window).resize(function () {
debounced(responsive);
});
}
function initTab(tab) {
var $tab = (0, _jquery2.default)(tab);
tab.setAttribute('role', 'application');
if (!$tab.data('aui-tab-events-bound')) {
var $tabMenu = $tab.children('ul.tabs-menu');
// ARIA setup
$tabMenu.attr('role', 'tablist');
// ignore the LIs so tab count is announced correctly
$tabMenu.children('li').attr('role', 'presentation');
$tabMenu.find('> .menu-item a').each(function () {
enhanceTabLink(this);
});
// Set up click event for tabs
$tabMenu.on('click', 'a', handleTabClick);
$tab.data('aui-tab-events-bound', true);
initPanes(tab);
}
}
function initTabs() {
var tabs = getTabs();
tabs.each(function () {
initTab(this);
});
updateTabsFromLocalStorage(tabs);
}
function initPane(pane) {
pane.setAttribute('role', 'tabpanel');
pane.setAttribute('aria-hidden', (0, _jquery2.default)(pane).hasClass('active-pane') ? 'false' : 'true');
}
function initPanes(tab) {
[].slice.call(tab.querySelectorAll('.tabs-pane')).forEach(initPane);
}
function initVerticalTabs() {
// Vertical tab truncation setup (adds title if clipped)
(0, _jquery2.default)('.aui-tabs.vertical-tabs').find('a').each(function () {
var thisTab = (0, _jquery2.default)(this);
// don't override existing titles
if (!thisTab.attr('title')) {
// if text has been truncated, add title
if ((0, _isClipped2.default)(thisTab)) {
thisTab.attr('title', thisTab.text());
}
}
});
}
var tabs = {
setup: function setup() {
initWindow();
initTabs();
initVerticalTabs();
},
change: function change(a) {
var $a = (0, _jquery2.default)(a);
var $tabGroup = $a.closest('.aui-tabs');
switchToTab($a);
if (isPersistentTabGroup($tabGroup) && window.localStorage) {
updateLocalStorageEntry($a);
}
}
};
(0, _jquery2.default)(tabs.setup);
// Web Components
// --------------
function findComponent(element) {
return (0, _jquery2.default)(element).closest('aui-tabs').get(0);
}
function findPanes(tabs) {
return tabs.querySelectorAll('aui-tabs-pane');
}
function findTabs(tabs) {
return tabs.querySelectorAll('li[is=aui-tabs-tab]');
}
(0, _skate2.default)('aui-tabs', {
created: function created(element) {
(0, _jquery2.default)(element).addClass('aui-tabs horizontal-tabs');
// We must initialise here so that the old code still works since
// the lifecycle of the sub-components setup the markup so that it
// can be processed by the old logic.
_skate2.default.init(element);
// Use the old logic to initialise the tabs.
initTab(element);
},
template: template('<ul class="tabs-menu">', '<content select="li[is=aui-tabs-tab]"></content>', '</ul>', '<content select="aui-tabs-pane"></content>'),
prototype: {
select: function select(element) {
var index = (0, _jquery2.default)(findPanes(this)).index(element);
if (index > -1) {
tabs.change(findTabs(this)[index].children[0]);
}
return this;
}
}
});
var Tab = (0, _skate2.default)('aui-tabs-tab', {
extends: 'li',
created: function created(element) {
(0, _jquery2.default)(element).addClass('menu-item');
},
template: template('<a href="#">', '<strong>', '<content></content>', '</strong>', '</a>')
});
(0, _skate2.default)('aui-tabs-pane', {
attached: function attached(element) {
var $component = (0, _jquery2.default)(findComponent(element));
var $element = (0, _jquery2.default)(element);
var index = $component.find('aui-tabs-pane').index($element);
var tab = new Tab();
var $tab = (0, _jquery2.default)(tab);
$element.addClass('tabs-pane');
tab.firstChild.setAttribute('href', '#' + element.id);
template.wrap(tab).textContent = $element.attr('title');
if (index === 0) {
$element.addClass('active-pane');
}
if ($element.hasClass('active-pane')) {
$tab.addClass('active-tab');
}
$element.siblings('ul').append(tab);
},
template: template('<content></content>')
});
(0, _globalize2.default)('tabs', tabs);
exports.default = tabs;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/toggle-class-name.js
(typeof window === 'undefined' ? global : window).__40a1cf5facf36b081989c304dc0f46ab = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _deprecation = __40faa40b431fb997cae9bc11acbad9ee;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Shortcut function to toggle class name of an element.
*
* @param {String | Element} element The element or an ID to toggle class name on.
* @param {String} className The class name to remove or add.
*
* @returns {undefined}
*/
function toggleClassName(element, className) {
if (!(element = (0, _jquery2.default)(element))) {
return;
}
element.toggleClass(className);
}
var toggleClassName = (0, _deprecation.fn)(toggleClassName, 'toggleClassName', {
sinceVersion: '5.8.0'
});
(0, _globalize2.default)('toggleClassName', toggleClassName);
exports.default = toggleClassName;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/to-init.js
(typeof window === 'undefined' ? global : window).__621264a4a2791b4c61a08cd5e6e72c49 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Adds functions to the list of methods to be run on initialisation. Wraps
* error handling around the provided function so its failure won't prevent
* other init functions running.
*
* @param {Function} func Function to be call on initialisation.
*
* @return {Object}
*/
function toInit(func) {
(0, _jquery2.default)(function () {
try {
func.apply(this, arguments);
} catch (ex) {
logger.log('Failed to run init function: ' + ex + '\n' + func.toString());
}
});
return this;
}
(0, _globalize2.default)('toInit', toInit);
exports.default = toInit;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/unbind-text-resize.js
(typeof window === 'undefined' ? global : window).__ca33ab80da12998be5c7cfcf1245b0ac = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _onTextResize = __5b22308adeddebe86dc06b7537b4f752;
var _onTextResize2 = _interopRequireDefault(_onTextResize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function unbindTextResize(f) {
for (var i = 0, ii = _onTextResize2.default['on-text-resize'].length; i < ii; i++) {
if (_onTextResize2.default['on-text-resize'][i] === f) {
return _onTextResize2.default['on-text-resize'].splice(i, 1);
}
}
}
(0, _globalize2.default)('unbindTextResize', unbindTextResize);
exports.default = unbindTextResize;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/jquery/jquery.hotkeys.js
(typeof window === 'undefined' ? global : window).__18b474fd44c2703e1f56322a323898c8 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
"use strict";
/*
* Modified by Atlassian to allow chaining of keys
*
* jQuery Hotkeys Plugin
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Based upon the plugin by Tzury Bar Yochay:
* http://github.com/tzuryby/hotkeys
*
* Original idea by:
* Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
*/
(function (jQuery) {
jQuery.hotkeys = {
version: "0.8",
specialKeys: {
8: "backspace", 9: "tab", 13: "return", 16: "shift", 17: "ctrl", 18: "alt", 19: "pause",
20: "capslock", 27: "esc", 32: "space", 33: "pageup", 34: "pagedown", 35: "end", 36: "home",
37: "left", 38: "up", 39: "right", 40: "down", 45: "insert", 46: "del",
91: "meta",
96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7",
104: "8", 105: "9", 106: "*", 107: "+", 109: "-", 110: ".", 111: "/",
112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8",
120: "f9", 121: "f10", 122: "f11", 123: "f12", 144: "numlock", 145: "scroll",
188: ",", 190: ".", 191: "/", 224: "meta", 219: '[', 221: ']'
},
// These only work under Mac Gecko when using keypress (see http://unixpapa.com/js/key.html).
keypressKeys: ["<", ">", "?"],
shiftNums: {
"`": "~", "1": "!", "2": "@", "3": "#", "4": "$", "5": "%", "6": "^", "7": "&",
"8": "*", "9": "(", "0": ")", "-": "_", "=": "+", ";": ":", "'": "\"", ",": "<",
".": ">", "/": "?", "\\": "|"
}
};
jQuery.each(jQuery.hotkeys.keypressKeys, function (_, key) {
jQuery.hotkeys.shiftNums[key] = key;
});
function TimedNumber(timer) {
this.num = 0;
this.timer = timer > 0 ? timer : false;
}
TimedNumber.prototype.val = function () {
return this.num;
};
TimedNumber.prototype.inc = function () {
if (this.timer) {
clearTimeout(this.timeout);
this.timeout = setTimeout(jQuery.proxy(TimedNumber.prototype.reset, this), this.timer);
}
this.num++;
};
TimedNumber.prototype.reset = function () {
if (this.timer) {
clearTimeout(this.timeout);
}
this.num = 0;
};
function keyHandler(handleObj) {
// Only care when a possible input has been specified
if (!(jQuery.isPlainObject(handleObj.data) || jQuery.isArray(handleObj.data) || typeof handleObj.data === "string")) {
return;
}
var origHandler = handleObj.handler,
options = {
timer: 700,
combo: []
};
(function (data) {
if (typeof data === 'string') {
options.combo = [data];
} else if (jQuery.isArray(data)) {
options.combo = data;
} else {
jQuery.extend(options, data);
}
options.combo = jQuery.map(options.combo, function (key) {
return key.toLowerCase();
});
})(handleObj.data);
handleObj.index = new TimedNumber(options.timer);
handleObj.handler = function (event) {
// Don't fire in text-accepting inputs that we didn't directly bind to
if (this !== event.target && /textarea|select|input/i.test(event.target.nodeName)) {
return;
}
// Keypress represents characters, not special keys
var special = event.type !== 'keypress' ? jQuery.hotkeys.specialKeys[event.which] : null,
character = String.fromCharCode(event.which).toLowerCase(),
key,
modif = "",
possible = {};
// check combinations (alt|ctrl|shift+anything)
if (event.altKey && special !== "alt") {
modif += "alt+";
}
if (event.ctrlKey && special !== "ctrl") {
modif += "ctrl+";
}
// TODO: Need to make sure this works consistently across platforms
if (event.metaKey && !event.ctrlKey && special !== "meta") {
modif += "meta+";
}
if (event.shiftKey && special !== "shift") {
modif += "shift+";
}
// Under Chrome and Safari, meta's keycode == '['s charcode
// Even if they did type this key combo we could not use it because it is browser back in Chrome/Safari on OS X
if (event.metaKey && character === '[') {
character = null;
}
if (special) {
possible[modif + special] = true;
}
if (character) {
possible[modif + character] = true;
}
// "$" can be specified as "shift+4" or "$"
if (/shift+/.test(modif)) {
possible[modif.replace('shift+', '') + jQuery.hotkeys.shiftNums[special || character]] = true;
}
var index = handleObj.index,
combo = options.combo;
if (pressed(combo[index.val()], possible)) {
if (index.val() === combo.length - 1) {
index.reset();
return origHandler.apply(this, arguments);
} else {
index.inc();
}
} else {
index.reset();
// For mutli-key combinations, we might have restarted the key sequence.
if (pressed(combo[0], possible)) {
index.inc();
}
}
};
}
function pressed(key, possible) {
var keys = key.split(' ');
for (var i = 0, len = keys.length; i < len; i++) {
if (possible[keys[i]]) {
return true;
}
}
return false;
}
jQuery.each(["keydown", "keyup", "keypress"], function () {
jQuery.event.special[this] = { add: keyHandler };
});
})(jQuery);
return module.exports;
}).call(this);
// src/js/aui/when-i-type.js
(typeof window === 'undefined' ? global : window).__b549575b9f63e012306597130f75cb15 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
__18b474fd44c2703e1f56322a323898c8;
__94e0ff9e638caab880e29e51cbdd8999;
var _log = __b6ff3972810865402a96bc835d1ba86a;
var logger = _interopRequireWildcard(_log);
var _dialog = __0fee7b7e9a5f01779ec7b61597f813e5;
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _i18n = __8d80b2996ccf75cdbe997a5c7cbb4b40;
var _i18n2 = _interopRequireDefault(_i18n);
var _keyCode = __441232d78236eb4e37336c273cdfa555;
var _keyCode2 = _interopRequireDefault(_keyCode);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var isMac = navigator.platform.indexOf('Mac') !== -1;
var multiCharRegex = /^(backspace|tab|r(ight|eturn)|s(hift|pace|croll)|c(trl|apslock)|alt|pa(use|ge(up|down))|e(sc|nd)|home|left|up|d(el|own)|insert|f\d\d?|numlock|meta)/i;
/**
* Keyboard commands with syntactic sugar.
*
* <strong>Usage:</strong>
* <pre>
* whenIType("gh").or("gd").goTo("/secure/Dashboard.jspa");
* whenIType("c").click("#create_link");
* </pre>
*
* @param keys - Key combinations, modifier keys are "+" deliminated. e.g "ctrl+b"
*/
function whenIType(keys) {
var boundKeyCombos = [];
var executor = _jquery2.default.Callbacks();
function keypressHandler(e) {
if (!_dialog.popup.current && executor) {
executor.fire(e);
}
}
function defaultPreventionHandler(e) {
e.preventDefault();
}
// Bind an arbitrary set of keys by calling bindKeyCombo on each triggering key combo.
// A string like "abc 123" means (a then b then c) OR (1 then 2 then 3). abc is one key combo, 123 is another.
function bindKeys(keys) {
var keyCombos = keys && keys.split ? _jquery2.default.trim(keys).split(' ') : [keys];
keyCombos.forEach(function (keyCombo) {
bindKeyCombo(keyCombo);
});
}
function hasUnprintables(keysArr) {
// a bit of a heuristic, but works for everything we have. Only the unprintable characters are represented with > 1-character names.
var i = keysArr.length;
while (i--) {
if (keysArr[i].length > 1 && keysArr[i] !== 'space') {
return true;
}
}
return false;
}
// bind a single key combo to this handler
// A string like "abc 123" means (a then b then c) OR (1 then 2 then 3). abc is one key combo, 123 is another.
function bindKeyCombo(keyCombo) {
var keysArr = keyCombo instanceof Array ? keyCombo : keyComboArrayFromString(keyCombo.toString());
var eventType = hasUnprintables(keysArr) ? 'keydown' : 'keypress';
boundKeyCombos.push(keysArr);
(0, _jquery2.default)(document).bind(eventType, keysArr, keypressHandler);
// Override browser/plugins
(0, _jquery2.default)(document).bind(eventType + ' keyup', keysArr, defaultPreventionHandler);
}
// parse out an array of (modifier+key) presses from a single string
// e.g. "12ctrl+3" becomes [ "1", "2", "ctrl+3" ]
function keyComboArrayFromString(keyString) {
var keysArr = [];
var currModifiers = '';
while (keyString.length) {
var modifierMatch = keyString.match(/^(ctrl|meta|shift|alt)\+/i);
var multiCharMatch = keyString.match(multiCharRegex);
if (modifierMatch) {
currModifiers += modifierMatch[0];
keyString = keyString.substring(modifierMatch[0].length);
} else if (multiCharMatch) {
keysArr.push(currModifiers + multiCharMatch[0]);
keyString = keyString.substring(multiCharMatch[0].length);
currModifiers = '';
} else {
keysArr.push(currModifiers + keyString[0]);
keyString = keyString.substring(1);
currModifiers = '';
}
}
return keysArr;
}
function addShortcutsToTitle(selector) {
var elem = (0, _jquery2.default)(selector);
var title = elem.attr('title') || '';
var keyCombos = boundKeyCombos.slice();
var shortcutInstructions = elem.data('kbShortcutAppended') || '';
var isFirst = !shortcutInstructions;
var originalTitle = isFirst ? title : title.substring(0, title.length - shortcutInstructions.length);
while (keyCombos.length) {
shortcutInstructions = appendKeyComboInstructions(keyCombos.shift().slice(), shortcutInstructions, isFirst);
isFirst = false;
}
if (isMac) {
shortcutInstructions = shortcutInstructions.replace(/Meta/ig, '⌘') //Apple cmd key
.replace(/Shift/ig, '⇧'); //Apple Shift symbol
}
elem.attr('title', originalTitle + shortcutInstructions);
elem.data('kbShortcutAppended', shortcutInstructions);
}
function removeShortcutsFromTitle(selector) {
var elem = (0, _jquery2.default)(selector);
var shortcuts = elem.data('kbShortcutAppended');
if (!shortcuts) {
return;
}
var title = elem.attr('title');
elem.attr('title', title.replace(shortcuts, ''));
elem.removeData('kbShortcutAppended');
}
//
function appendKeyComboInstructions(keyCombo, title, isFirst) {
if (isFirst) {
title += ' (' + AJS.I18n.getText('aui.keyboard.shortcut.type.x', keyCombo.shift());
} else {
title = title.replace(/\)$/, '');
title += AJS.I18n.getText('aui.keyboard.shortcut.or.x', keyCombo.shift());
}
keyCombo.forEach(function (key) {
title += ' ' + AJS.I18n.getText('aui.keyboard.shortcut.then.x', key);
});
title += ')';
return title;
}
bindKeys(keys);
return whenIType.makeShortcut({
executor: executor,
bindKeys: bindKeys,
addShortcutsToTitle: addShortcutsToTitle,
removeShortcutsFromTitle: removeShortcutsFromTitle,
keypressHandler: keypressHandler,
defaultPreventionHandler: defaultPreventionHandler
});
}
whenIType.makeShortcut = function (options) {
var executor = options.executor;
var bindKeys = options.bindKeys;
var addShortcutsToTitle = options.addShortcutsToTitle;
var removeShortcutsFromTitle = options.removeShortcutsFromTitle;
var keypressHandler = options.keypressHandler;
var defaultPreventionHandler = options.defaultPreventionHandler;
var selectorsWithTitlesModified = [];
function makeMoveToFunction(getNewFocus) {
return function (selector, options) {
options = options || {};
var focusedClass = options.focusedClass || 'focused';
var wrapAround = options.hasOwnProperty('wrapAround') ? options.wrapAround : true;
var escToCancel = options.hasOwnProperty('escToCancel') ? options.escToCancel : true;
executor.add(function () {
var $items = (0, _jquery2.default)(selector),
$focusedElem = $items.filter('.' + focusedClass),
moveToOptions = $focusedElem.length === 0 ? undefined : { transition: true };
if (escToCancel) {
(0, _jquery2.default)(document).one('keydown', function (e) {
if (e.keyCode === _keyCode2.default.ESCAPE && $focusedElem) {
$focusedElem.removeClass(focusedClass);
}
});
}
if ($focusedElem.length) {
$focusedElem.removeClass(focusedClass);
}
$focusedElem = getNewFocus($focusedElem, $items, wrapAround);
if ($focusedElem && $focusedElem.length > 0) {
$focusedElem.addClass(focusedClass);
$focusedElem.moveTo(moveToOptions);
if ($focusedElem.is('a')) {
$focusedElem.focus();
} else {
$focusedElem.find('a:first').focus();
}
}
});
return this;
};
}
return {
/**
* Scrolls to and adds <em>focused</em> class to the next item in the jQuery collection
*
* @method moveToNextItem
* @param selector
* @param options
* @return {Object}
*/
moveToNextItem: makeMoveToFunction(function ($focusedElem, $items, wrapAround) {
var index;
if (wrapAround && $focusedElem.length === 0) {
return $items.eq(0);
} else {
index = _jquery2.default.inArray($focusedElem.get(0), $items);
if (index < $items.length - 1) {
index = index + 1;
return $items.eq(index);
} else if (wrapAround) {
return $items.eq(0);
}
}
return $focusedElem;
}),
/**
* Scrolls to and adds <em>focused</em> class to the previous item in the jQuery collection
*
* @method moveToPrevItem
* @param selector
* @param focusedClass
* @return {Object}
*/
moveToPrevItem: makeMoveToFunction(function ($focusedElem, $items, wrapAround) {
var index;
if (wrapAround && $focusedElem.length === 0) {
return $items.filter(':last');
} else {
index = _jquery2.default.inArray($focusedElem.get(0), $items);
if (index > 0) {
index = index - 1;
return $items.eq(index);
} else if (wrapAround) {
return $items.filter(':last');
}
}
return $focusedElem;
}),
/**
* Clicks the element specified by the <em>selector</em> argument.
*
* @method click
* @param selector - jQuery selector for element
* @return {Object}
*/
click: function click(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function () {
var elem = (0, _jquery2.default)(selector);
if (elem.length > 0) {
elem.click();
}
});
return this;
},
/**
* Navigates to specified <em>location</em>
*
* @method goTo
* @param {String} location - http location
* @return {Object}
*/
goTo: function goTo(location) {
executor.add(function () {
window.location.href = location;
});
return this;
},
/**
* navigates browser window to link href
*
* @method followLink
* @param selector - jQuery selector for element
* @return {Object}
*/
followLink: function followLink(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function () {
var elem = (0, _jquery2.default)(selector)[0];
if (elem && { 'a': true, 'link': true }[elem.nodeName.toLowerCase()]) {
window.location.href = elem.href;
}
});
return this;
},
/**
* Executes function
*
* @method execute
* @param {function} func
* @return {Object}
*/
execute: function execute(func) {
var self = this;
executor.add(function () {
func.apply(self, arguments);
});
return this;
},
/**
* @deprecated This implementation is uncool. Kept around to satisfy Confluence plugin devs in the short term.
*
* Executes the javascript provided by the shortcut plugin point _immediately_.
*
* @method evaluate
* @param {Function} command - the function provided by the shortcut key plugin point
*/
evaluate: function evaluate(command) {
command.call(this);
},
/**
* Scrolls to element if out of view, then clicks it.
*
* @method moveToAndClick
* @param selector - jQuery selector for element
* @return {Object}
*/
moveToAndClick: function moveToAndClick(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function () {
var elem = (0, _jquery2.default)(selector);
if (elem.length > 0) {
elem.click();
elem.moveTo();
}
});
return this;
},
/**
* Scrolls to element if out of view, then focuses it
*
* @method moveToAndFocus
* @param selector - jQuery selector for element
* @return {Object}
*/
moveToAndFocus: function moveToAndFocus(selector) {
selectorsWithTitlesModified.push(selector);
addShortcutsToTitle(selector);
executor.add(function (e) {
var $elem = (0, _jquery2.default)(selector);
if ($elem.length > 0) {
$elem.focus();
if ($elem.moveTo) {
$elem.moveTo();
}
if ($elem.is(':input')) {
e.preventDefault();
}
}
});
return this;
},
/**
* Binds additional keyboard controls
*
* @method or
* @param {String} keys - keys to bind
* @return {Object}
*/
or: function or(keys) {
bindKeys(keys);
return this;
},
/**
* Unbinds shortcut keys
*
* @method unbind
*/
unbind: function unbind() {
(0, _jquery2.default)(document).unbind('keydown keypress', keypressHandler).unbind('keydown keypress keyup', defaultPreventionHandler);
for (var i = 0, len = selectorsWithTitlesModified.length; i < len; i++) {
removeShortcutsFromTitle(selectorsWithTitlesModified[i]);
}
selectorsWithTitlesModified = [];
}
};
};
/**
* Creates keyboard commands and their actions from json data. Format looks like:
*
* <pre>
* [
* {
* "keys":[["g", "d"]],
* "context":"global",
* "op":"followLink",
* "param":"#home_link"
* },
* {
* "keys":[["g", "i"]],
* "context":"global",
* "op":"followLink",
* "param":"#find_link"
* },
* {
* "keys":[["/"]],
* "context":"global",
* "op":"moveToAndFocus",
* "param":"#quickSearchInput"
* },
* {
* "keys":[["c"]],
* "context":"global",
* "op":"moveToAndClick",
* "param":"#create_link"
* }
* ]
* </pre>
*
* @method fromJSON
* @static
* @param json
*/
whenIType.fromJSON = function (json, switchCtrlToMetaOnMac) {
var shortcuts = [];
if (json) {
_jquery2.default.each(json, function (i, item) {
var operation = item.op,
param = item.param,
params;
if (operation === 'execute' || operation === 'evaluate') {
// need to turn function string into function object
params = [new Function(param)];
} else if (/^\[[^\]\[]*,[^\]\[]*\]$/.test(param)) {
// pass in an array to send multiple params
try {
params = JSON.parse(param);
} catch (e) {
logger.error('When using a parameter array, array must be in strict JSON format: ' + param);
}
if (!_jquery2.default.isArray(params)) {
logger.error('Badly formatted shortcut parameter. String or JSON Array of parameters required: ' + param);
}
} else {
params = [param];
}
_jquery2.default.each(item.keys, function () {
var shortcutList = this;
if (switchCtrlToMetaOnMac && isMac) {
shortcutList = _jquery2.default.map(shortcutList, function (shortcutString) {
return shortcutString.replace(/ctrl/i, 'meta');
});
}
var newShortcut = whenIType(shortcutList);
newShortcut[operation].apply(newShortcut, params);
shortcuts.push(newShortcut);
});
});
}
return shortcuts;
};
// Trigger this event on an iframe if you want its keypress events to be propagated (Events to work in iframes).
(0, _jquery2.default)(document).bind('iframeAppended', function (e, iframe) {
(0, _jquery2.default)(iframe).load(function () {
var target = (0, _jquery2.default)(iframe).contents();
target.bind('keyup keydown keypress', function (e) {
// safari propagates keypress events from iframes
if (_jquery2.default.browser.safari && e.type === 'keypress') {
return;
}
if (!(0, _jquery2.default)(e.target).is(':input')) {
_jquery2.default.event.trigger(e, arguments, // Preserve original event data.
document, // Bubble this event from the iframe's document to its parent document.
true // Use the capturing phase to preserve original event.target.
);
}
});
});
});
(0, _globalize2.default)('whenIType', whenIType);
exports.default = whenIType;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/version.js
(typeof window === 'undefined' ? global : window).__0be49dceb990098acfe9fc229f0dd280 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var version = '5.9.10';
(0, _globalize2.default)('version', version);
exports.default = version;
module.exports = exports['default'];
return module.exports;
}).call(this);
// src/js/aui/setup.js
(typeof window === 'undefined' ? global : window).__6c806f6e99ce13a7cce9ef8bdb2b4a2f = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
var _jquery = __05a5728e39505874845991c7dfe96596;
var _jquery2 = _interopRequireDefault(_jquery);
var _globalize = __225e03d549503945a1ebea587fd0f68b;
var _globalize2 = _interopRequireDefault(_globalize);
var _populateParameters = __f192c0cf80aa95af408046fbe93591a5;
var _populateParameters2 = _interopRequireDefault(_populateParameters);
var _version = __0be49dceb990098acfe9fc229f0dd280;
var _version2 = _interopRequireDefault(_version);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// Set the version.
// Global setup that used to be in the main AJS namespace file.
(0, _jquery2.default)(function () {
var $body = (0, _jquery2.default)('body');
if (!$body.data('auiVersion')) {
$body.attr('data-aui-version', _version2.default);
}
(0, _populateParameters2.default)();
});
// Setting Traditional to handle our default param serialisation.
// See http://api.jquery.com/jQuery.param/ for more information.
_jquery2.default.ajaxSettings.traditional = true;
(0, _globalize2.default)('$', _jquery2.default);
return module.exports;
}).call(this);
// src/js/aui.js
(typeof window === 'undefined' ? global : window).__528f3c8a12d4f6660e9da853f5c444a9 = (function () {
var module = {
exports: {}
};
var exports = module.exports;
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
__e28e983111b2d3d88d7bef79e6c21aeb;
__32e7714cc3ebee6b5b4e0aea4997111b;
__5b43648f596031491a97baa9d2ec3794;
__94e0ff9e638caab880e29e51cbdd8999;
__714f29948b44cf5844f18727934b0bbb;
__0fee7b7e9a5f01779ec7b61597f813e5;
__7b5aa278bb4f76afb55f49b950817c6d;
__3c67105fc710d918a1448cdf0460bbc1;
__f639fe1f21a511207fc3a7ea8008186c;
__b6ff3972810865402a96bc835d1ba86a;
__95ebb2a3f0f35fb58e804b4a93a4e8a4;
__cbd9b0fd1e6737c2f65ac30e97ef259e;
__abe5b7da8a93a98ef8626a5c7324ede3;
__1794ff9e45dfc3330dc35b0dccce5d7a;
__8037b509c36c7516f87a5fe5dd2b8538;
__796eed8c59fc5f7e27526dd0677ddaf3;
__786e222bfa91643023364f6b42e4486c;
__5d296ab9552bee3722548e48e3c85fa3;
__90fe58c1a5c237be6e18aada0d705916;
__dbe0d0ff20da8ec5be5af799a9c6bdb5;
__7e63119dfd3f3739f4398a6e423ef6dd;
__99251565496475a9b75cce06caffbfa4;
__2ea6ac671d29eba35499f28fb99d3e5b;
__cb445a1e3929ac1448d5d67706d8a118;
__759181f5486f2a331b3f4fb52b7b6e5a;
__ec1a503e134b6e0c3b4852e662b97de3;
__8d80b2996ccf75cdbe997a5c7cbb4b40;
__c9d4b93e31238752737daf17cd7bfff0;
__d936583ed2eb96a4ea8a14060f9fc12a;
__ab61aa9c3e1a1a3253e130594f164c74;
__136e62b092d9d3533c7f37b88c5f8085;
__741ea5411c959080c2b42c1585082da1;
__fb3a9f7e634b7c127a8ba80cec461643;
__0ae5665c053233348ebb1bbda037babb;
__441232d78236eb4e37336c273cdfa555;
__03a7b88a7168f9cd8454c54888461782;
__d25f4a0d9d0391a5d806a560be72e8c6;
__a2ba592684a74c637f323e20db9376f5;
__566da063c127b10285a7a186bff457e2;
__5b22308adeddebe86dc06b7537b4f752;
__f192c0cf80aa95af408046fbe93591a5;
__1af8ce0ff7c95c22187c7659a50b6a4a;
__4ac97b6899c9d90b02080a23dd4fa9bd;
__251a4f471fb762cefb9b38d031b5d8e7;
__3964feac817637b8e9196e57cf900376;
__775c62d812944bb2aba8393d6a09b20a;
__12b76add029ed2b0c3d456d781110340;
__728ac06ea1d5ca4ecbb34a7c4f64b723;
__40a1cf5facf36b081989c304dc0f46ab;
__621264a4a2791b4c61a08cd5e6e72c49;
__ca33ab80da12998be5c7cfcf1245b0ac;
__b549575b9f63e012306597130f75cb15;
__6c806f6e99ce13a7cce9ef8bdb2b4a2f;
exports.default = window.AJS;
module.exports = exports['default'];
return module.exports;
}).call(this); | dlueth/cdnjs | ajax/libs/aui/5.9.10/aui/js/aui.js | JavaScript | mit | 564,934 |
(function (root, factory) {
if (typeof module !== 'undefined' && module.exports) {
module.exports = factory(
require('react'),
require('swipe-js-iso'),
require('object-assign')
);
} else {
root.ReactSwipe = factory(
root.React,
root.Swipe,
root.objectAssign
);
}
})(this, function (React, Swipe, objectAssign) {
var styles = {
container: {
overflow: 'hidden',
visibility: 'hidden',
position: 'relative'
},
wrapper: {
overflow: 'hidden',
position: 'relative'
},
child: {
float: 'left',
width: '100%',
position: 'relative',
transitionProperty: 'transform'
}
};
var ReactSwipe = React.createClass({
// https://github.com/thebird/Swipe#config-options
propTypes: {
startSlide : React.PropTypes.number,
slideToIndex : React.PropTypes.number,
shouldUpdate : React.PropTypes.func,
speed : React.PropTypes.number,
auto : React.PropTypes.number,
continuous : React.PropTypes.bool,
disableScroll : React.PropTypes.bool,
stopPropagation : React.PropTypes.bool,
callback : React.PropTypes.func,
transitionEnd : React.PropTypes.func
},
componentDidMount: function () {
if (this.isMounted()) {
this.swipe = Swipe(React.findDOMNode(this), objectAssign({}, this.props));
}
},
componentDidUpdate: function () {
if (this.props.slideToIndex || this.props.slideToIndex === 0) {
this.swipe.slide(this.props.slideToIndex);
}
},
componentWillUnmount: function () {
this.swipe.kill();
delete this.swipe;
},
shouldComponentUpdate: function (nextProps) {
return (
(this.props.slideToIndex !== nextProps.slideToIndex) ||
(typeof this.props.shouldUpdate !== 'undefined') && this.props.shouldUpdate(nextProps)
);
},
render: function() {
return React.createElement('div', React.__spread({}, {style: styles.container}, this.props),
React.createElement('div', {style: styles.wrapper},
React.Children.map(this.props.children, function (child) {
return React.cloneElement(child, {
ref: child.props.ref,
key: child.props.key,
style: child.props.style ? objectAssign(child.props.style, styles.child) : styles.child
});
})
)
);
}
});
return ReactSwipe;
});
| emmy41124/cdnjs | ajax/libs/react-swipe/2.3.1/react-swipe.js | JavaScript | mit | 2,528 |
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.vl = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
},{}],2:[function(require,module,exports){
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define('d3-time', ['exports'], factory) :
factory((global.d3_time = {}));
}(this, function (exports) { 'use strict';
var t0 = new Date;
var t1 = new Date;
function newInterval(floori, offseti, count, field) {
function interval(date) {
return floori(date = new Date(+date)), date;
}
interval.floor = interval;
interval.round = function(date) {
var d0 = new Date(+date),
d1 = new Date(date - 1);
floori(d0), floori(d1), offseti(d1, 1);
return date - d0 < d1 - date ? d0 : d1;
};
interval.ceil = function(date) {
return floori(date = new Date(date - 1)), offseti(date, 1), date;
};
interval.offset = function(date, step) {
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
};
interval.range = function(start, stop, step) {
var range = [];
start = new Date(start - 1);
stop = new Date(+stop);
step = step == null ? 1 : Math.floor(step);
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
offseti(start, 1), floori(start);
if (start < stop) range.push(new Date(+start));
while (offseti(start, step), floori(start), start < stop) range.push(new Date(+start));
return range;
};
interval.filter = function(test) {
return newInterval(function(date) {
while (floori(date), !test(date)) date.setTime(date - 1);
}, function(date, step) {
while (--step >= 0) while (offseti(date, 1), !test(date));
});
};
if (count) {
interval.count = function(start, end) {
t0.setTime(+start), t1.setTime(+end);
floori(t0), floori(t1);
return Math.floor(count(t0, t1));
};
interval.every = function(step) {
step = Math.floor(step);
return !isFinite(step) || !(step > 0) ? null
: !(step > 1) ? interval
: interval.filter(field
? function(d) { return field(d) % step === 0; }
: function(d) { return interval.count(0, d) % step === 0; });
};
}
return interval;
};
var millisecond = newInterval(function() {
// noop
}, function(date, step) {
date.setTime(+date + step);
}, function(start, end) {
return end - start;
});
// An optimized implementation for this simple case.
millisecond.every = function(k) {
k = Math.floor(k);
if (!isFinite(k) || !(k > 0)) return null;
if (!(k > 1)) return millisecond;
return newInterval(function(date) {
date.setTime(Math.floor(date / k) * k);
}, function(date, step) {
date.setTime(+date + step * k);
}, function(start, end) {
return (end - start) / k;
});
};
var second = newInterval(function(date) {
date.setMilliseconds(0);
}, function(date, step) {
date.setTime(+date + step * 1e3);
}, function(start, end) {
return (end - start) / 1e3;
}, function(date) {
return date.getSeconds();
});
var minute = newInterval(function(date) {
date.setSeconds(0, 0);
}, function(date, step) {
date.setTime(+date + step * 6e4);
}, function(start, end) {
return (end - start) / 6e4;
}, function(date) {
return date.getMinutes();
});
var hour = newInterval(function(date) {
date.setMinutes(0, 0, 0);
}, function(date, step) {
date.setTime(+date + step * 36e5);
}, function(start, end) {
return (end - start) / 36e5;
}, function(date) {
return date.getHours();
});
var day = newInterval(function(date) {
date.setHours(0, 0, 0, 0);
}, function(date, step) {
date.setDate(date.getDate() + step);
}, function(start, end) {
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 864e5;
}, function(date) {
return date.getDate() - 1;
});
function weekday(i) {
return newInterval(function(date) {
date.setHours(0, 0, 0, 0);
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
}, function(date, step) {
date.setDate(date.getDate() + step * 7);
}, function(start, end) {
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * 6e4) / 6048e5;
});
}
var sunday = weekday(0);
var monday = weekday(1);
var tuesday = weekday(2);
var wednesday = weekday(3);
var thursday = weekday(4);
var friday = weekday(5);
var saturday = weekday(6);
var month = newInterval(function(date) {
date.setHours(0, 0, 0, 0);
date.setDate(1);
}, function(date, step) {
date.setMonth(date.getMonth() + step);
}, function(start, end) {
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
}, function(date) {
return date.getMonth();
});
var year = newInterval(function(date) {
date.setHours(0, 0, 0, 0);
date.setMonth(0, 1);
}, function(date, step) {
date.setFullYear(date.getFullYear() + step);
}, function(start, end) {
return end.getFullYear() - start.getFullYear();
}, function(date) {
return date.getFullYear();
});
var utcSecond = newInterval(function(date) {
date.setUTCMilliseconds(0);
}, function(date, step) {
date.setTime(+date + step * 1e3);
}, function(start, end) {
return (end - start) / 1e3;
}, function(date) {
return date.getUTCSeconds();
});
var utcMinute = newInterval(function(date) {
date.setUTCSeconds(0, 0);
}, function(date, step) {
date.setTime(+date + step * 6e4);
}, function(start, end) {
return (end - start) / 6e4;
}, function(date) {
return date.getUTCMinutes();
});
var utcHour = newInterval(function(date) {
date.setUTCMinutes(0, 0, 0);
}, function(date, step) {
date.setTime(+date + step * 36e5);
}, function(start, end) {
return (end - start) / 36e5;
}, function(date) {
return date.getUTCHours();
});
var utcDay = newInterval(function(date) {
date.setUTCHours(0, 0, 0, 0);
}, function(date, step) {
date.setUTCDate(date.getUTCDate() + step);
}, function(start, end) {
return (end - start) / 864e5;
}, function(date) {
return date.getUTCDate() - 1;
});
function utcWeekday(i) {
return newInterval(function(date) {
date.setUTCHours(0, 0, 0, 0);
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
}, function(date, step) {
date.setUTCDate(date.getUTCDate() + step * 7);
}, function(start, end) {
return (end - start) / 6048e5;
});
}
var utcSunday = utcWeekday(0);
var utcMonday = utcWeekday(1);
var utcTuesday = utcWeekday(2);
var utcWednesday = utcWeekday(3);
var utcThursday = utcWeekday(4);
var utcFriday = utcWeekday(5);
var utcSaturday = utcWeekday(6);
var utcMonth = newInterval(function(date) {
date.setUTCHours(0, 0, 0, 0);
date.setUTCDate(1);
}, function(date, step) {
date.setUTCMonth(date.getUTCMonth() + step);
}, function(start, end) {
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
}, function(date) {
return date.getUTCMonth();
});
var utcYear = newInterval(function(date) {
date.setUTCHours(0, 0, 0, 0);
date.setUTCMonth(0, 1);
}, function(date, step) {
date.setUTCFullYear(date.getUTCFullYear() + step);
}, function(start, end) {
return end.getUTCFullYear() - start.getUTCFullYear();
}, function(date) {
return date.getUTCFullYear();
});
var milliseconds = millisecond.range;
var seconds = second.range;
var minutes = minute.range;
var hours = hour.range;
var days = day.range;
var sundays = sunday.range;
var mondays = monday.range;
var tuesdays = tuesday.range;
var wednesdays = wednesday.range;
var thursdays = thursday.range;
var fridays = friday.range;
var saturdays = saturday.range;
var weeks = sunday.range;
var months = month.range;
var years = year.range;
var utcMillisecond = millisecond;
var utcMilliseconds = milliseconds;
var utcSeconds = utcSecond.range;
var utcMinutes = utcMinute.range;
var utcHours = utcHour.range;
var utcDays = utcDay.range;
var utcSundays = utcSunday.range;
var utcMondays = utcMonday.range;
var utcTuesdays = utcTuesday.range;
var utcWednesdays = utcWednesday.range;
var utcThursdays = utcThursday.range;
var utcFridays = utcFriday.range;
var utcSaturdays = utcSaturday.range;
var utcWeeks = utcSunday.range;
var utcMonths = utcMonth.range;
var utcYears = utcYear.range;
var version = "0.1.0";
exports.version = version;
exports.milliseconds = milliseconds;
exports.seconds = seconds;
exports.minutes = minutes;
exports.hours = hours;
exports.days = days;
exports.sundays = sundays;
exports.mondays = mondays;
exports.tuesdays = tuesdays;
exports.wednesdays = wednesdays;
exports.thursdays = thursdays;
exports.fridays = fridays;
exports.saturdays = saturdays;
exports.weeks = weeks;
exports.months = months;
exports.years = years;
exports.utcMillisecond = utcMillisecond;
exports.utcMilliseconds = utcMilliseconds;
exports.utcSeconds = utcSeconds;
exports.utcMinutes = utcMinutes;
exports.utcHours = utcHours;
exports.utcDays = utcDays;
exports.utcSundays = utcSundays;
exports.utcMondays = utcMondays;
exports.utcTuesdays = utcTuesdays;
exports.utcWednesdays = utcWednesdays;
exports.utcThursdays = utcThursdays;
exports.utcFridays = utcFridays;
exports.utcSaturdays = utcSaturdays;
exports.utcWeeks = utcWeeks;
exports.utcMonths = utcMonths;
exports.utcYears = utcYears;
exports.millisecond = millisecond;
exports.second = second;
exports.minute = minute;
exports.hour = hour;
exports.day = day;
exports.sunday = sunday;
exports.monday = monday;
exports.tuesday = tuesday;
exports.wednesday = wednesday;
exports.thursday = thursday;
exports.friday = friday;
exports.saturday = saturday;
exports.week = sunday;
exports.month = month;
exports.year = year;
exports.utcSecond = utcSecond;
exports.utcMinute = utcMinute;
exports.utcHour = utcHour;
exports.utcDay = utcDay;
exports.utcSunday = utcSunday;
exports.utcMonday = utcMonday;
exports.utcTuesday = utcTuesday;
exports.utcWednesday = utcWednesday;
exports.utcThursday = utcThursday;
exports.utcFriday = utcFriday;
exports.utcSaturday = utcSaturday;
exports.utcWeek = utcSunday;
exports.utcMonth = utcMonth;
exports.utcYear = utcYear;
exports.interval = newInterval;
}));
},{}],3:[function(require,module,exports){
var util = require('../util'),
time = require('../time'),
EPSILON = 1e-15;
function bins(opt) {
if (!opt) { throw Error("Missing binning options."); }
// determine range
var maxb = opt.maxbins || 15,
base = opt.base || 10,
logb = Math.log(base),
div = opt.div || [5, 2],
min = opt.min,
max = opt.max,
span = max - min,
step, level, minstep, precision, v, i, eps;
if (opt.step) {
// if step size is explicitly given, use that
step = opt.step;
} else if (opt.steps) {
// if provided, limit choice to acceptable step sizes
step = opt.steps[Math.min(
opt.steps.length - 1,
bisect(opt.steps, span/maxb, 0, opt.steps.length)
)];
} else {
// else use span to determine step size
level = Math.ceil(Math.log(maxb) / logb);
minstep = opt.minstep || 0;
step = Math.max(
minstep,
Math.pow(base, Math.round(Math.log(span) / logb) - level)
);
// increase step size if too many bins
while (Math.ceil(span/step) > maxb) { step *= base; }
// decrease step size if allowed
for (i=0; i<div.length; ++i) {
v = step / div[i];
if (v >= minstep && span / v <= maxb) step = v;
}
}
// update precision, min and max
v = Math.log(step);
precision = v >= 0 ? 0 : ~~(-v / logb) + 1;
eps = Math.pow(base, -precision - 1);
min = Math.min(min, Math.floor(min / step + eps) * step);
max = Math.ceil(max / step) * step;
return {
start: min,
stop: max,
step: step,
unit: {precision: precision},
value: value,
index: index
};
}
function bisect(a, x, lo, hi) {
while (lo < hi) {
var mid = lo + hi >>> 1;
if (util.cmp(a[mid], x) < 0) { lo = mid + 1; }
else { hi = mid; }
}
return lo;
}
function value(v) {
return this.step * Math.floor(v / this.step + EPSILON);
}
function index(v) {
return Math.floor((v - this.start) / this.step + EPSILON);
}
function date_value(v) {
return this.unit.date(value.call(this, v));
}
function date_index(v) {
return index.call(this, this.unit.unit(v));
}
bins.date = function(opt) {
if (!opt) { throw Error("Missing date binning options."); }
// find time step, then bin
var units = opt.utc ? time.utc : time,
dmin = opt.min,
dmax = opt.max,
maxb = opt.maxbins || 20,
minb = opt.minbins || 4,
span = (+dmax) - (+dmin),
unit = opt.unit ? units[opt.unit] : units.find(span, minb, maxb),
spec = bins({
min: unit.min != null ? unit.min : unit.unit(dmin),
max: unit.max != null ? unit.max : unit.unit(dmax),
maxbins: maxb,
minstep: unit.minstep,
steps: unit.step
});
spec.unit = unit;
spec.index = date_index;
if (!opt.raw) spec.value = date_value;
return spec;
};
module.exports = bins;
},{"../time":5,"../util":6}],4:[function(require,module,exports){
var util = require('./util'),
gen = module.exports;
gen.repeat = function(val, n) {
var a = Array(n), i;
for (i=0; i<n; ++i) a[i] = val;
return a;
};
gen.zeros = function(n) {
return gen.repeat(0, n);
};
gen.range = function(start, stop, step) {
if (arguments.length < 3) {
step = 1;
if (arguments.length < 2) {
stop = start;
start = 0;
}
}
if ((stop - start) / step == Infinity) throw new Error('Infinite range');
var range = [], i = -1, j;
if (step < 0) while ((j = start + step * ++i) > stop) range.push(j);
else while ((j = start + step * ++i) < stop) range.push(j);
return range;
};
gen.random = {};
gen.random.uniform = function(min, max) {
if (max === undefined) {
max = min === undefined ? 1 : min;
min = 0;
}
var d = max - min;
var f = function() {
return min + d * Math.random();
};
f.samples = function(n) {
return gen.zeros(n).map(f);
};
f.pdf = function(x) {
return (x >= min && x <= max) ? 1/d : 0;
};
f.cdf = function(x) {
return x < min ? 0 : x > max ? 1 : (x - min) / d;
};
f.icdf = function(p) {
return (p >= 0 && p <= 1) ? min + p*d : NaN;
};
return f;
};
gen.random.integer = function(a, b) {
if (b === undefined) {
b = a;
a = 0;
}
var d = b - a;
var f = function() {
return a + Math.floor(d * Math.random());
};
f.samples = function(n) {
return gen.zeros(n).map(f);
};
f.pdf = function(x) {
return (x === Math.floor(x) && x >= a && x < b) ? 1/d : 0;
};
f.cdf = function(x) {
var v = Math.floor(x);
return v < a ? 0 : v >= b ? 1 : (v - a + 1) / d;
};
f.icdf = function(p) {
return (p >= 0 && p <= 1) ? a - 1 + Math.floor(p*d) : NaN;
};
return f;
};
gen.random.normal = function(mean, stdev) {
mean = mean || 0;
stdev = stdev || 1;
var next;
var f = function() {
var x = 0, y = 0, rds, c;
if (next !== undefined) {
x = next;
next = undefined;
return x;
}
do {
x = Math.random()*2-1;
y = Math.random()*2-1;
rds = x*x + y*y;
} while (rds === 0 || rds > 1);
c = Math.sqrt(-2*Math.log(rds)/rds); // Box-Muller transform
next = mean + y*c*stdev;
return mean + x*c*stdev;
};
f.samples = function(n) {
return gen.zeros(n).map(f);
};
f.pdf = function(x) {
var exp = Math.exp(Math.pow(x-mean, 2) / (-2 * Math.pow(stdev, 2)));
return (1 / (stdev * Math.sqrt(2*Math.PI))) * exp;
};
f.cdf = function(x) {
// Approximation from West (2009)
// Better Approximations to Cumulative Normal Functions
var cd,
z = (x - mean) / stdev,
Z = Math.abs(z);
if (Z > 37) {
cd = 0;
} else {
var sum, exp = Math.exp(-Z*Z/2);
if (Z < 7.07106781186547) {
sum = 3.52624965998911e-02 * Z + 0.700383064443688;
sum = sum * Z + 6.37396220353165;
sum = sum * Z + 33.912866078383;
sum = sum * Z + 112.079291497871;
sum = sum * Z + 221.213596169931;
sum = sum * Z + 220.206867912376;
cd = exp * sum;
sum = 8.83883476483184e-02 * Z + 1.75566716318264;
sum = sum * Z + 16.064177579207;
sum = sum * Z + 86.7807322029461;
sum = sum * Z + 296.564248779674;
sum = sum * Z + 637.333633378831;
sum = sum * Z + 793.826512519948;
sum = sum * Z + 440.413735824752;
cd = cd / sum;
} else {
sum = Z + 0.65;
sum = Z + 4 / sum;
sum = Z + 3 / sum;
sum = Z + 2 / sum;
sum = Z + 1 / sum;
cd = exp / sum / 2.506628274631;
}
}
return z > 0 ? 1 - cd : cd;
};
f.icdf = function(p) {
// Approximation of Probit function using inverse error function.
if (p <= 0 || p >= 1) return NaN;
var x = 2*p - 1,
v = (8 * (Math.PI - 3)) / (3 * Math.PI * (4-Math.PI)),
a = (2 / (Math.PI*v)) + (Math.log(1 - Math.pow(x,2)) / 2),
b = Math.log(1 - (x*x)) / v,
s = (x > 0 ? 1 : -1) * Math.sqrt(Math.sqrt((a*a) - b) - a);
return mean + stdev * Math.SQRT2 * s;
};
return f;
};
gen.random.bootstrap = function(domain, smooth) {
// Generates a bootstrap sample from a set of observations.
// Smooth bootstrapping adds random zero-centered noise to the samples.
var val = domain.filter(util.isValid),
len = val.length,
err = smooth ? gen.random.normal(0, smooth) : null;
var f = function() {
return val[~~(Math.random()*len)] + (err ? err() : 0);
};
f.samples = function(n) {
return gen.zeros(n).map(f);
};
return f;
};
},{"./util":6}],5:[function(require,module,exports){
var d3_time = require('d3-time');
var tempDate = new Date(),
baseDate = new Date(0, 0, 1).setFullYear(0), // Jan 1, 0 AD
utcBaseDate = new Date(Date.UTC(0, 0, 1)).setUTCFullYear(0);
function date(d) {
return (tempDate.setTime(+d), tempDate);
}
// create a time unit entry
function entry(type, date, unit, step, min, max) {
var e = {
type: type,
date: date,
unit: unit
};
if (step) {
e.step = step;
} else {
e.minstep = 1;
}
if (min != null) e.min = min;
if (max != null) e.max = max;
return e;
}
function create(type, unit, base, step, min, max) {
return entry(type,
function(d) { return unit.offset(base, d); },
function(d) { return unit.count(base, d); },
step, min, max);
}
var locale = [
create('second', d3_time.second, baseDate),
create('minute', d3_time.minute, baseDate),
create('hour', d3_time.hour, baseDate),
create('day', d3_time.day, baseDate, [1, 7]),
create('month', d3_time.month, baseDate, [1, 3, 6]),
create('year', d3_time.year, baseDate),
// periodic units
entry('seconds',
function(d) { return new Date(1970, 0, 1, 0, 0, d); },
function(d) { return date(d).getSeconds(); },
null, 0, 59
),
entry('minutes',
function(d) { return new Date(1970, 0, 1, 0, d); },
function(d) { return date(d).getMinutes(); },
null, 0, 59
),
entry('hours',
function(d) { return new Date(1970, 0, 1, d); },
function(d) { return date(d).getHours(); },
null, 0, 23
),
entry('weekdays',
function(d) { return new Date(1970, 0, 4+d); },
function(d) { return date(d).getDay(); },
[1], 0, 6
),
entry('dates',
function(d) { return new Date(1970, 0, d); },
function(d) { return date(d).getDate(); },
[1], 1, 31
),
entry('months',
function(d) { return new Date(1970, d % 12, 1); },
function(d) { return date(d).getMonth(); },
[1], 0, 11
)
];
var utc = [
create('second', d3_time.utcSecond, utcBaseDate),
create('minute', d3_time.utcMinute, utcBaseDate),
create('hour', d3_time.utcHour, utcBaseDate),
create('day', d3_time.utcDay, utcBaseDate, [1, 7]),
create('month', d3_time.utcMonth, utcBaseDate, [1, 3, 6]),
create('year', d3_time.utcYear, utcBaseDate),
// periodic units
entry('seconds',
function(d) { return new Date(Date.UTC(1970, 0, 1, 0, 0, d)); },
function(d) { return date(d).getUTCSeconds(); },
null, 0, 59
),
entry('minutes',
function(d) { return new Date(Date.UTC(1970, 0, 1, 0, d)); },
function(d) { return date(d).getUTCMinutes(); },
null, 0, 59
),
entry('hours',
function(d) { return new Date(Date.UTC(1970, 0, 1, d)); },
function(d) { return date(d).getUTCHours(); },
null, 0, 23
),
entry('weekdays',
function(d) { return new Date(Date.UTC(1970, 0, 4+d)); },
function(d) { return date(d).getUTCDay(); },
[1], 0, 6
),
entry('dates',
function(d) { return new Date(Date.UTC(1970, 0, d)); },
function(d) { return date(d).getUTCDate(); },
[1], 1, 31
),
entry('months',
function(d) { return new Date(Date.UTC(1970, d % 12, 1)); },
function(d) { return date(d).getUTCMonth(); },
[1], 0, 11
)
];
var STEPS = [
[31536e6, 5], // 1-year
[7776e6, 4], // 3-month
[2592e6, 4], // 1-month
[12096e5, 3], // 2-week
[6048e5, 3], // 1-week
[1728e5, 3], // 2-day
[864e5, 3], // 1-day
[432e5, 2], // 12-hour
[216e5, 2], // 6-hour
[108e5, 2], // 3-hour
[36e5, 2], // 1-hour
[18e5, 1], // 30-minute
[9e5, 1], // 15-minute
[3e5, 1], // 5-minute
[6e4, 1], // 1-minute
[3e4, 0], // 30-second
[15e3, 0], // 15-second
[5e3, 0], // 5-second
[1e3, 0] // 1-second
];
function find(units, span, minb, maxb) {
var step = STEPS[0], i, n, bins;
for (i=1, n=STEPS.length; i<n; ++i) {
step = STEPS[i];
if (span > step[0]) {
bins = span / step[0];
if (bins > maxb) {
return units[STEPS[i-1][1]];
}
if (bins >= minb) {
return units[step[1]];
}
}
}
return units[STEPS[n-1][1]];
}
function toUnitMap(units) {
var map = {}, i, n;
for (i=0, n=units.length; i<n; ++i) {
map[units[i].type] = units[i];
}
map.find = function(span, minb, maxb) {
return find(units, span, minb, maxb);
};
return map;
}
module.exports = toUnitMap(locale);
module.exports.utc = toUnitMap(utc);
},{"d3-time":2}],6:[function(require,module,exports){
(function (Buffer){
var u = module.exports;
// utility functions
var FNAME = '__name__';
u.namedfunc = function(name, f) { return (f[FNAME] = name, f); };
u.name = function(f) { return f==null ? null : f[FNAME]; };
u.identity = function(x) { return x; };
u.true = u.namedfunc('true', function() { return true; });
u.false = u.namedfunc('false', function() { return false; });
u.duplicate = function(obj) {
return JSON.parse(JSON.stringify(obj));
};
u.equal = function(a, b) {
return JSON.stringify(a) === JSON.stringify(b);
};
u.extend = function(obj) {
for (var x, name, i=1, len=arguments.length; i<len; ++i) {
x = arguments[i];
for (name in x) { obj[name] = x[name]; }
}
return obj;
};
u.length = function(x) {
return x != null && x.length != null ? x.length : null;
};
u.keys = function(x) {
var keys = [], k;
for (k in x) keys.push(k);
return keys;
};
u.vals = function(x) {
var vals = [], k;
for (k in x) vals.push(x[k]);
return vals;
};
u.toMap = function(list, f) {
return (f = u.$(f)) ?
list.reduce(function(obj, x) { return (obj[f(x)] = 1, obj); }, {}) :
list.reduce(function(obj, x) { return (obj[x] = 1, obj); }, {});
};
u.keystr = function(values) {
// use to ensure consistent key generation across modules
var n = values.length;
if (!n) return '';
for (var s=String(values[0]), i=1; i<n; ++i) {
s += '|' + String(values[i]);
}
return s;
};
// type checking functions
var toString = Object.prototype.toString;
u.isObject = function(obj) {
return obj === Object(obj);
};
u.isFunction = function(obj) {
return toString.call(obj) === '[object Function]';
};
u.isString = function(obj) {
return typeof value === 'string' || toString.call(obj) === '[object String]';
};
u.isArray = Array.isArray || function(obj) {
return toString.call(obj) === '[object Array]';
};
u.isNumber = function(obj) {
return typeof obj === 'number' || toString.call(obj) === '[object Number]';
};
u.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
};
u.isDate = function(obj) {
return toString.call(obj) === '[object Date]';
};
u.isValid = function(obj) {
return obj != null && obj === obj;
};
u.isBuffer = (typeof Buffer === 'function' && Buffer.isBuffer) || u.false;
// type coercion functions
u.number = function(s) {
return s == null || s === '' ? null : +s;
};
u.boolean = function(s) {
return s == null || s === '' ? null : s==='false' ? false : !!s;
};
// parse a date with optional d3.time-format format
u.date = function(s, format) {
var d = format ? format : Date;
return s == null || s === '' ? null : d.parse(s);
};
u.array = function(x) {
return x != null ? (u.isArray(x) ? x : [x]) : [];
};
u.str = function(x) {
return u.isArray(x) ? '[' + x.map(u.str) + ']'
: u.isObject(x) ? JSON.stringify(x)
: u.isString(x) ? ('\''+util_escape_str(x)+'\'') : x;
};
var escape_str_re = /(^|[^\\])'/g;
function util_escape_str(x) {
return x.replace(escape_str_re, '$1\\\'');
}
// data access functions
var field_re = /\[(.*?)\]|[^.\[]+/g;
u.field = function(f) {
return String(f).match(field_re).map(function(d) {
return d[0] !== '[' ? d :
d[1] !== "'" && d[1] !== '"' ? d.slice(1, -1) :
d.slice(2, -2).replace(/\\(["'])/g, '$1');
});
};
u.accessor = function(f) {
var s;
return f==null || u.isFunction(f) ? f :
u.namedfunc(f, (s = u.field(f)).length > 1 ?
function(x) { return s.reduce(function(x,f) { return x[f]; }, x); } :
function(x) { return x[f]; }
);
};
// short-cut for accessor
u.$ = u.accessor;
u.mutator = function(f) {
var s;
return u.isString(f) && (s=u.field(f)).length > 1 ?
function(x, v) {
for (var i=0; i<s.length-1; ++i) x = x[s[i]];
x[s[i]] = v;
} :
function(x, v) { x[f] = v; };
};
u.$func = function(name, op) {
return function(f) {
f = u.$(f) || u.identity;
var n = name + (u.name(f) ? '_'+u.name(f) : '');
return u.namedfunc(n, function(d) { return op(f(d)); });
};
};
u.$valid = u.$func('valid', u.isValid);
u.$length = u.$func('length', u.length);
u.$in = function(f, values) {
f = u.$(f);
var map = u.isArray(values) ? u.toMap(values) : values;
return function(d) { return !!map[f(d)]; };
};
// comparison / sorting functions
u.comparator = function(sort) {
var sign = [];
if (sort === undefined) sort = [];
sort = u.array(sort).map(function(f) {
var s = 1;
if (f[0] === '-') { s = -1; f = f.slice(1); }
else if (f[0] === '+') { s = +1; f = f.slice(1); }
sign.push(s);
return u.accessor(f);
});
return function(a,b) {
var i, n, f, x, y;
for (i=0, n=sort.length; i<n; ++i) {
f = sort[i]; x = f(a); y = f(b);
if (x < y) return -1 * sign[i];
if (x > y) return sign[i];
}
return 0;
};
};
u.cmp = function(a, b) {
if (a < b) {
return -1;
} else if (a > b) {
return 1;
} else if (a >= b) {
return 0;
} else if (a === null) {
return -1;
} else if (b === null) {
return 1;
}
return NaN;
};
u.numcmp = function(a, b) { return a - b; };
u.stablesort = function(array, sortBy, keyFn) {
var indices = array.reduce(function(idx, v, i) {
return (idx[keyFn(v)] = i, idx);
}, {});
array.sort(function(a, b) {
var sa = sortBy(a),
sb = sortBy(b);
return sa < sb ? -1 : sa > sb ? 1
: (indices[keyFn(a)] - indices[keyFn(b)]);
});
return array;
};
// string functions
u.pad = function(s, length, pos, padchar) {
padchar = padchar || " ";
var d = length - s.length;
if (d <= 0) return s;
switch (pos) {
case 'left':
return strrep(d, padchar) + s;
case 'middle':
case 'center':
return strrep(Math.floor(d/2), padchar) +
s + strrep(Math.ceil(d/2), padchar);
default:
return s + strrep(d, padchar);
}
};
function strrep(n, str) {
var s = "", i;
for (i=0; i<n; ++i) s += str;
return s;
}
u.truncate = function(s, length, pos, word, ellipsis) {
var len = s.length;
if (len <= length) return s;
ellipsis = ellipsis !== undefined ? String(ellipsis) : '\u2026';
var l = Math.max(0, length - ellipsis.length);
switch (pos) {
case 'left':
return ellipsis + (word ? truncateOnWord(s,l,1) : s.slice(len-l));
case 'middle':
case 'center':
var l1 = Math.ceil(l/2), l2 = Math.floor(l/2);
return (word ? truncateOnWord(s,l1) : s.slice(0,l1)) +
ellipsis + (word ? truncateOnWord(s,l2,1) : s.slice(len-l2));
default:
return (word ? truncateOnWord(s,l) : s.slice(0,l)) + ellipsis;
}
};
function truncateOnWord(s, len, rev) {
var cnt = 0, tok = s.split(truncate_word_re);
if (rev) {
s = (tok = tok.reverse())
.filter(function(w) { cnt += w.length; return cnt <= len; })
.reverse();
} else {
s = tok.filter(function(w) { cnt += w.length; return cnt <= len; });
}
return s.length ? s.join('').trim() : tok[0].slice(0, len);
}
var truncate_word_re = /([\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF])/;
}).call(this,require("buffer").Buffer)
},{"buffer":1}],7:[function(require,module,exports){
exports.AGGREGATE_OPS = [
'values', 'count', 'valid', 'missing', 'distinct',
'sum', 'mean', 'average', 'variance', 'variancep', 'stdev',
'stdevp', 'median', 'q1', 'q3', 'modeskew', 'min', 'max',
'argmin', 'argmax'
];
exports.SHARED_DOMAIN_OPS = [
'mean', 'average', 'stdev', 'stdevp', 'median', 'q1', 'q3', 'min', 'max'
];
},{}],8:[function(require,module,exports){
var channel_1 = require('./channel');
function autoMaxBins(channel) {
switch (channel) {
case channel_1.ROW:
case channel_1.COLUMN:
case channel_1.SIZE:
case channel_1.SHAPE:
return 6;
default:
return 10;
}
}
exports.autoMaxBins = autoMaxBins;
},{"./channel":9}],9:[function(require,module,exports){
(function (Channel) {
Channel[Channel["X"] = 'x'] = "X";
Channel[Channel["Y"] = 'y'] = "Y";
Channel[Channel["ROW"] = 'row'] = "ROW";
Channel[Channel["COLUMN"] = 'column'] = "COLUMN";
Channel[Channel["SHAPE"] = 'shape'] = "SHAPE";
Channel[Channel["SIZE"] = 'size'] = "SIZE";
Channel[Channel["COLOR"] = 'color'] = "COLOR";
Channel[Channel["PATH"] = 'path'] = "PATH";
Channel[Channel["TEXT"] = 'text'] = "TEXT";
Channel[Channel["DETAIL"] = 'detail'] = "DETAIL";
Channel[Channel["LABEL"] = 'label'] = "LABEL";
})(exports.Channel || (exports.Channel = {}));
var Channel = exports.Channel;
exports.X = Channel.X;
exports.Y = Channel.Y;
exports.ROW = Channel.ROW;
exports.COLUMN = Channel.COLUMN;
exports.SHAPE = Channel.SHAPE;
exports.SIZE = Channel.SIZE;
exports.COLOR = Channel.COLOR;
exports.PATH = Channel.PATH;
exports.TEXT = Channel.TEXT;
exports.DETAIL = Channel.DETAIL;
exports.LABEL = Channel.LABEL;
exports.CHANNELS = [exports.X, exports.Y, exports.ROW, exports.COLUMN, exports.SIZE, exports.SHAPE, exports.COLOR, exports.PATH, exports.TEXT, exports.DETAIL, exports.LABEL];
;
function supportMark(channel, mark) {
return !!getSupportedMark(channel)[mark];
}
exports.supportMark = supportMark;
function getSupportedMark(channel) {
switch (channel) {
case exports.X:
case exports.Y:
case exports.COLOR:
case exports.DETAIL:
case exports.ROW:
case exports.COLUMN:
return {
point: true, tick: true, circle: true, square: true,
bar: true, line: true, area: true, text: true
};
case exports.SIZE:
return {
point: true, tick: true, circle: true, square: true,
bar: true, text: true
};
case exports.SHAPE:
return { point: true };
case exports.TEXT:
return { text: true };
case exports.PATH:
return { line: true };
}
return {};
}
exports.getSupportedMark = getSupportedMark;
;
function getSupportedRole(channel) {
switch (channel) {
case exports.X:
case exports.Y:
case exports.COLOR:
case exports.LABEL:
return {
measure: true,
dimension: true
};
case exports.ROW:
case exports.COLUMN:
case exports.SHAPE:
case exports.DETAIL:
return {
measure: false,
dimension: true
};
case exports.SIZE:
case exports.TEXT:
return {
measure: true,
dimension: false
};
case exports.PATH:
return {
measure: false,
dimension: true
};
}
throw new Error('Invalid encoding channel' + channel);
}
exports.getSupportedRole = getSupportedRole;
},{}],10:[function(require,module,exports){
var axis_schema_1 = require('../schema/axis.schema');
var legend_schema_1 = require('../schema/legend.schema');
var schemautil_1 = require('../schema/schemautil');
var schema = require('../schema/schema');
var schemaUtil = require('../schema/schemautil');
var channel_1 = require('../channel');
var data_1 = require('../data');
var vlFieldDef = require('../fielddef');
var vlEncoding = require('../encoding');
var mark_1 = require('../mark');
var type_1 = require('../type');
var util_1 = require('../util');
var config_1 = require('./config');
var layout_1 = require('./layout');
var stack_1 = require('./stack');
var scale_1 = require('./scale');
var Model = (function () {
function Model(spec) {
var defaults = schema.instantiate();
this._spec = schemaUtil.mergeDeep(defaults, spec);
vlEncoding.forEach(this._spec.encoding, function (fieldDef, channel) {
if (!channel_1.supportMark(channel, this._spec.mark)) {
console.warn(channel, 'dropped as it is incompatible with', this._spec.mark);
delete this._spec.encoding[channel].field;
}
if (fieldDef.type) {
fieldDef.type = type_1.getFullName(fieldDef.type);
}
if (fieldDef.axis === true) {
fieldDef.axis = schemautil_1.instantiate(axis_schema_1.axis);
}
if (fieldDef.legend === true) {
fieldDef.legend = schemautil_1.instantiate(legend_schema_1.legend);
}
if (channel === channel_1.ROW && fieldDef.scale.padding === undefined) {
fieldDef.scale.padding = this.has(channel_1.Y) ? 16 : 0;
}
if (channel === channel_1.COLUMN && fieldDef.scale.padding === undefined) {
fieldDef.scale.padding = this.has(channel_1.X) ? 16 : 0;
}
}, this);
this._stack = stack_1.compileStackProperties(this._spec);
this._spec.config.mark = config_1.compileMarkConfig(this._spec, this._stack);
this._layout = layout_1.compileLayout(this);
}
Model.prototype.layout = function () {
return this._layout;
};
Model.prototype.stack = function () {
return this._stack;
};
Model.prototype.toSpec = function (excludeConfig, excludeData) {
var encoding = util_1.duplicate(this._spec.encoding), spec;
spec = {
mark: this._spec.mark,
encoding: encoding
};
if (!excludeConfig) {
spec.config = util_1.duplicate(this._spec.config);
}
if (!excludeData) {
spec.data = util_1.duplicate(this._spec.data);
}
var defaults = schema.instantiate();
return schemaUtil.subtract(spec, defaults);
};
Model.prototype.mark = function () {
return this._spec.mark;
};
Model.prototype.spec = function () {
return this._spec;
};
Model.prototype.is = function (mark) {
return this._spec.mark === mark;
};
Model.prototype.has = function (channel) {
return vlEncoding.has(this._spec.encoding, channel);
};
Model.prototype.fieldDef = function (channel) {
return this._spec.encoding[channel];
};
Model.prototype.field = function (channel, opt) {
if (opt === void 0) { opt = {}; }
var fieldDef = this.fieldDef(channel);
if (fieldDef.bin) {
opt = util_1.extend({
binSuffix: scale_1.type(fieldDef, channel, this.mark()) === 'ordinal' ? '_range' : '_start'
}, opt);
}
return vlFieldDef.field(fieldDef, opt);
};
Model.prototype.fieldTitle = function (channel) {
return vlFieldDef.title(this._spec.encoding[channel]);
};
Model.prototype.channels = function () {
return vlEncoding.channels(this._spec.encoding);
};
Model.prototype.map = function (f, t) {
return vlEncoding.map(this._spec.encoding, f, t);
};
Model.prototype.reduce = function (f, init, t) {
return vlEncoding.reduce(this._spec.encoding, f, init, t);
};
Model.prototype.forEach = function (f, t) {
vlEncoding.forEach(this._spec.encoding, f, t);
};
Model.prototype.isOrdinalScale = function (channel) {
var fieldDef = this.fieldDef(channel);
return fieldDef && (util_1.contains([type_1.NOMINAL, type_1.ORDINAL], fieldDef.type) ||
(fieldDef.type === type_1.TEMPORAL && scale_1.type(fieldDef, channel, this.mark()) === 'ordinal'));
};
Model.prototype.isDimension = function (channel) {
return vlFieldDef.isDimension(this.fieldDef(channel));
};
Model.prototype.isMeasure = function (channel) {
return vlFieldDef.isMeasure(this.fieldDef(channel));
};
Model.prototype.isAggregate = function () {
return vlEncoding.isAggregate(this._spec.encoding);
};
Model.prototype.isFacet = function () {
return this.has(channel_1.ROW) || this.has(channel_1.COLUMN);
};
Model.prototype.dataTable = function () {
return this.isAggregate() ? data_1.SUMMARY : data_1.SOURCE;
};
Model.prototype.data = function () {
return this._spec.data;
};
Model.prototype.transform = function () {
return this._spec.transform;
};
Model.prototype.hasValues = function () {
var vals = this.data().values;
return vals && vals.length;
};
Model.prototype.config = function () {
return this._spec.config;
};
Model.prototype.axis = function (channel) {
var axis = this.fieldDef(channel).axis;
return typeof axis !== 'boolean' ? axis : {};
};
Model.prototype.legend = function (channel) {
var legend = this.fieldDef(channel).legend;
return typeof legend !== 'boolean' ? legend : {};
};
Model.prototype.scaleName = function (channel) {
var name = this.spec().name;
return (name ? name + '-' : '') + channel;
};
Model.prototype.sizeValue = function (channel) {
if (channel === void 0) { channel = channel_1.SIZE; }
var value = this.fieldDef(channel_1.SIZE).value;
if (value !== undefined) {
return value;
}
switch (this.mark()) {
case mark_1.TEXT:
return 10;
case mark_1.BAR:
return !this.has(channel) || this.isOrdinalScale(channel) ?
this.fieldDef(channel).scale.bandWidth - 1 :
2;
case mark_1.TICK:
return this.fieldDef(channel).scale.bandWidth / 1.5;
}
return 30;
};
return Model;
})();
exports.Model = Model;
},{"../channel":9,"../data":29,"../encoding":30,"../fielddef":31,"../mark":32,"../schema/axis.schema":33,"../schema/legend.schema":43,"../schema/schema":46,"../schema/schemautil":47,"../type":53,"../util":54,"./config":13,"./layout":16,"./scale":25,"./stack":26}],11:[function(require,module,exports){
var util_1 = require('../util');
var type_1 = require('../type');
var channel_1 = require('../channel');
var util_2 = require('./util');
function compileAxis(channel, model) {
var isCol = channel === channel_1.COLUMN, isRow = channel === channel_1.ROW, type = isCol ? 'x' : isRow ? 'y' : channel;
var def = {
type: type,
scale: model.scaleName(channel)
};
util_1.extend(def, util_2.formatMixins(model, channel, model.axis(channel).format));
[
'grid', 'layer', 'orient', 'tickSize', 'ticks', 'title',
'offset', 'tickPadding', 'tickSize', 'tickSizeMajor', 'tickSizeMinor', 'tickSizeEnd',
'titleOffset', 'values', 'subdivide'
].forEach(function (property) {
var method;
var value = (method = exports[property]) ?
method(model, channel, def) :
model.fieldDef(channel).axis[property];
if (value !== undefined) {
def[property] = value;
}
});
var props = model.axis(channel).properties || {};
[
'axis', 'labels',
'grid', 'title', 'ticks', 'majorTicks', 'minorTicks'
].forEach(function (group) {
var value = properties[group] ?
properties[group](model, channel, props[group], def) :
props[group];
if (value !== undefined) {
def.properties = def.properties || {};
def.properties[group] = value;
}
});
return def;
}
exports.compileAxis = compileAxis;
function grid(model, channel) {
var fieldDef = model.fieldDef(channel);
if (channel === channel_1.ROW || channel === channel_1.COLUMN) {
return undefined;
}
var grid = model.axis(channel).grid;
if (grid !== undefined) {
return grid;
}
return !model.isOrdinalScale(channel) && !fieldDef.bin;
}
exports.grid = grid;
function layer(model, channel, def) {
var layer = model.axis(channel).layer;
if (layer !== undefined) {
return layer;
}
if (def.grid) {
return 'back';
}
return undefined;
}
exports.layer = layer;
;
function orient(model, channel) {
var orient = model.axis(channel).orient;
if (orient) {
return orient;
}
else if (channel === channel_1.COLUMN) {
return 'top';
}
else if (channel === channel_1.ROW) {
if (model.has(channel_1.Y) && model.axis(channel_1.Y).orient !== 'right') {
return 'right';
}
}
return undefined;
}
exports.orient = orient;
function ticks(model, channel) {
var ticks = model.axis(channel).ticks;
if (ticks !== undefined) {
return ticks;
}
if (channel === channel_1.X && !model.fieldDef(channel).bin) {
return 5;
}
return undefined;
}
exports.ticks = ticks;
function tickSize(model, channel) {
var tickSize = model.axis(channel).tickSize;
if (tickSize !== undefined) {
return tickSize;
}
if (channel === channel_1.ROW || channel === channel_1.COLUMN) {
return 0;
}
return undefined;
}
exports.tickSize = tickSize;
function title(model, channel) {
var axis = model.axis(channel);
if (axis.title !== undefined) {
return axis.title;
}
var fieldTitle = model.fieldTitle(channel);
var layout = model.layout();
var cellWidth = layout.cellWidth;
var cellHeight = layout.cellHeight;
var maxLength;
if (axis.titleMaxLength) {
maxLength = axis.titleMaxLength;
}
else if (channel === channel_1.X && typeof cellWidth === 'number') {
maxLength = cellWidth / model.axis(channel_1.X).characterWidth;
}
else if (channel === channel_1.Y && typeof cellHeight === 'number') {
maxLength = cellHeight / model.axis(channel_1.Y).characterWidth;
}
return maxLength ? util_1.truncate(fieldTitle, maxLength) : fieldTitle;
}
exports.title = title;
var properties;
(function (properties) {
function axis(model, channel, axisPropsSpec) {
if (channel === channel_1.ROW || channel === channel_1.COLUMN) {
return util_1.extend({
opacity: { value: 0 }
}, axisPropsSpec || {});
}
return axisPropsSpec || undefined;
}
properties.axis = axis;
function labels(model, channel, labelsSpec, def) {
var fieldDef = model.fieldDef(channel);
var axis = model.axis(channel);
if (!axis.labels) {
return util_1.extend({
text: ''
}, labelsSpec);
}
if (util_1.contains([type_1.NOMINAL, type_1.ORDINAL], fieldDef.type) && axis.labelMaxLength) {
labelsSpec = util_1.extend({
text: {
template: '{{ datum.data | truncate:' + axis.labelMaxLength + '}}'
}
}, labelsSpec || {});
}
switch (channel) {
case channel_1.X:
if (model.isDimension(channel_1.X) || fieldDef.type === type_1.TEMPORAL) {
labelsSpec = util_1.extend({
angle: { value: 270 },
align: { value: def.orient === 'top' ? 'left' : 'right' },
baseline: { value: 'middle' }
}, labelsSpec || {});
}
break;
case channel_1.ROW:
if (def.orient === 'right') {
labelsSpec = util_1.extend({
angle: { value: 90 },
align: { value: 'center' },
baseline: { value: 'bottom' }
}, labelsSpec || {});
}
}
return labelsSpec || undefined;
}
properties.labels = labels;
})(properties = exports.properties || (exports.properties = {}));
},{"../channel":9,"../type":53,"../util":54,"./util":28}],12:[function(require,module,exports){
var Model_1 = require('./Model');
var axis_1 = require('./axis');
var data_1 = require('./data');
var facet_1 = require('./facet');
var legend_1 = require('./legend');
var mark_1 = require('./mark');
var scale_1 = require('./scale');
var util_1 = require('../util');
var data_2 = require('../data');
var channel_1 = require('../channel');
var Model_2 = require('./Model');
exports.Model = Model_2.Model;
function compile(spec) {
var model = new Model_1.Model(spec);
var layout = model.layout();
var FIT = 1;
var config = model.config();
var output = util_1.extend(spec.name ? { name: spec.name } : {}, {
width: typeof layout.width !== 'number' ? FIT : layout.width,
height: typeof layout.height !== 'number' ? FIT : layout.height,
padding: 'auto'
}, config.viewport ? { viewport: config.viewport } : {}, config.background ? { background: config.background } : {}, util_1.keys(config.scene).length > 0 ? scene(config) : {}, {
data: data_1.compileData(model),
marks: [compileRootGroup(model)]
});
return {
spec: output
};
}
exports.compile = compile;
function scene(config) {
return ['fill', 'fillOpacity', 'stroke', 'strokeWidth',
'strokeOpacity', 'strokeDash', 'strokeDashOffset'].
reduce(function (topLevelConfig, property) {
var value = config.scene[property];
if (value !== undefined) {
topLevelConfig.scene = topLevelConfig.scene || {};
topLevelConfig.scene[property] = { value: value };
}
return topLevelConfig;
}, {});
}
function compileRootGroup(model) {
var spec = model.spec();
var width = model.layout().width;
var height = model.layout().height;
var rootGroup = util_1.extend({
name: spec.name ? spec.name + '-root' : 'root',
type: 'group',
}, spec.description ? { description: spec.description } : {}, {
from: { data: data_2.LAYOUT },
properties: {
update: {
width: typeof width !== 'number' ?
{ field: width.field } :
{ value: width },
height: typeof height !== 'number' ?
{ field: height.field } :
{ value: height }
}
}
});
var marks = mark_1.compileMark(model);
if (model.has(channel_1.ROW) || model.has(channel_1.COLUMN)) {
util_1.extend(rootGroup, facet_1.facetMixins(model, marks));
}
else {
rootGroup.marks = marks;
rootGroup.scales = scale_1.compileScales(model.channels(), model);
var axes = (model.has(channel_1.X) && model.fieldDef(channel_1.X).axis ? [axis_1.compileAxis(channel_1.X, model)] : [])
.concat(model.has(channel_1.Y) && model.fieldDef(channel_1.Y).axis ? [axis_1.compileAxis(channel_1.Y, model)] : []);
if (axes.length > 0) {
rootGroup.axes = axes;
}
}
var legends = legend_1.compileLegends(model);
if (legends.length > 0) {
rootGroup.legends = legends;
}
return rootGroup;
}
exports.compileRootGroup = compileRootGroup;
},{"../channel":9,"../data":29,"../util":54,"./Model":10,"./axis":11,"./data":14,"./facet":15,"./legend":17,"./mark":24,"./scale":25}],13:[function(require,module,exports){
var channel_1 = require('../channel');
var encoding_1 = require('../encoding');
var fielddef_1 = require('../fielddef');
var mark_1 = require('../mark');
var util_1 = require('../util');
function compileMarkConfig(spec, stack) {
return util_1.extend(['filled', 'opacity', 'orient', 'align'].reduce(function (cfg, property) {
var value = spec.config.mark[property];
switch (property) {
case 'filled':
if (value === undefined) {
cfg[property] = spec.mark !== mark_1.POINT;
}
break;
case 'opacity':
if (value === undefined && util_1.contains([mark_1.POINT, mark_1.TICK, mark_1.CIRCLE, mark_1.SQUARE], spec.mark)) {
if (!encoding_1.isAggregate(spec.encoding) || encoding_1.has(spec.encoding, channel_1.DETAIL)) {
cfg[property] = 0.7;
}
}
break;
case 'orient':
if (stack) {
cfg[property] = stack.groupbyChannel === channel_1.Y ? 'horizontal' : undefined;
}
if (value === undefined) {
cfg[property] = fielddef_1.isMeasure(spec.encoding[channel_1.X]) && !fielddef_1.isMeasure(spec.encoding[channel_1.Y]) ?
'horizontal' :
undefined;
}
break;
case 'align':
if (value === undefined) {
cfg[property] = encoding_1.has(spec.encoding, channel_1.X) ? 'center' : 'right';
}
}
return cfg;
}, {}), spec.config.mark);
}
exports.compileMarkConfig = compileMarkConfig;
},{"../channel":9,"../encoding":30,"../fielddef":31,"../mark":32,"../util":54}],14:[function(require,module,exports){
var vlFieldDef = require('../fielddef');
var util_1 = require('../util');
var bin_1 = require('../bin');
var channel_1 = require('../channel');
var data_1 = require('../data');
var fielddef_1 = require('../fielddef');
var type_1 = require('../type');
var scale_1 = require('./scale');
var time_1 = require('./time');
var DEFAULT_NULL_FILTERS = {
nominal: false,
ordinal: false,
quantitative: true,
temporal: true
};
function compileData(model) {
var def = [source.def(model)];
var summaryDef = summary.def(model);
if (summaryDef) {
def.push(summaryDef);
}
filterNonPositiveForLog(def[def.length - 1], model);
var layoutDef = layout.def(model);
if (layoutDef) {
def.push(layoutDef);
}
var stackDef = model.stack();
if (stackDef) {
def.push(stack.def(model, stackDef));
}
return def.concat(dates.defs(model));
}
exports.compileData = compileData;
var source;
(function (source_1) {
function def(model) {
var source = { name: data_1.SOURCE };
if (model.hasValues()) {
source.values = model.data().values;
source.format = { type: 'json' };
}
else {
source.url = model.data().url;
source.format = { type: model.data().formatType };
}
var parse = formatParse(model);
if (parse) {
source.format.parse = parse;
}
source.transform = transform(model);
return source;
}
source_1.def = def;
function formatParse(model) {
var calcFieldMap = (model.transform().calculate || []).reduce(function (fieldMap, formula) {
fieldMap[formula.field] = true;
return fieldMap;
}, {});
var parse;
model.forEach(function (fieldDef) {
if (fieldDef.type === type_1.TEMPORAL) {
parse = parse || {};
parse[fieldDef.field] = 'date';
}
else if (fieldDef.type === type_1.QUANTITATIVE) {
if (vlFieldDef.isCount(fieldDef) || calcFieldMap[fieldDef.field]) {
return;
}
parse = parse || {};
parse[fieldDef.field] = 'number';
}
});
return parse;
}
function transform(model) {
return nullFilterTransform(model).concat(formulaTransform(model), filterTransform(model), binTransform(model), timeTransform(model));
}
source_1.transform = transform;
function timeTransform(model) {
return model.reduce(function (transform, fieldDef, channel) {
var ref = fielddef_1.field(fieldDef, { nofn: true, datum: true });
if (fieldDef.type === type_1.TEMPORAL && fieldDef.timeUnit) {
transform.push({
type: 'formula',
field: fielddef_1.field(fieldDef),
expr: time_1.parseExpression(fieldDef.timeUnit, ref)
});
}
return transform;
}, []);
}
source_1.timeTransform = timeTransform;
function binTransform(model) {
return model.reduce(function (transform, fieldDef, channel) {
var bin = model.fieldDef(channel).bin;
if (bin) {
var binTrans = util_1.extend({
type: 'bin',
field: fieldDef.field,
output: {
start: fielddef_1.field(fieldDef, { binSuffix: '_start' }),
mid: fielddef_1.field(fieldDef, { binSuffix: '_mid' }),
end: fielddef_1.field(fieldDef, { binSuffix: '_end' })
}
}, typeof bin === 'boolean' ? {} : bin);
if (!binTrans.maxbins && !binTrans.step) {
binTrans.maxbins = bin_1.autoMaxBins(channel);
}
transform.push(binTrans);
if (scale_1.type(fieldDef, channel, model.mark()) === 'ordinal') {
transform.push({
type: 'formula',
field: fielddef_1.field(fieldDef, { binSuffix: '_range' }),
expr: fielddef_1.field(fieldDef, { datum: true, binSuffix: '_start' }) +
'+ \'-\' +' +
fielddef_1.field(fieldDef, { datum: true, binSuffix: '_end' })
});
}
}
return transform;
}, []);
}
source_1.binTransform = binTransform;
function nullFilterTransform(model) {
var filterNull = model.transform().filterNull;
var filteredFields = util_1.keys(model.reduce(function (aggregator, fieldDef) {
if (filterNull ||
(filterNull === undefined && fieldDef.field && fieldDef.field !== '*' && DEFAULT_NULL_FILTERS[fieldDef.type])) {
aggregator[fieldDef.field] = true;
}
return aggregator;
}, {}));
return filteredFields.length > 0 ?
[{
type: 'filter',
test: filteredFields.map(function (fieldName) {
return 'datum.' + fieldName + '!==null';
}).join(' && ')
}] : [];
}
source_1.nullFilterTransform = nullFilterTransform;
function filterTransform(model) {
var filter = model.transform().filter;
return filter ? [{
type: 'filter',
test: filter
}] : [];
}
source_1.filterTransform = filterTransform;
function formulaTransform(model) {
return (model.transform().calculate || []).reduce(function (transform, formula) {
transform.push(util_1.extend({ type: 'formula' }, formula));
return transform;
}, []);
}
source_1.formulaTransform = formulaTransform;
})(source = exports.source || (exports.source = {}));
var layout;
(function (layout_1) {
function def(model) {
var summarize = [];
var formulas = [];
if (model.has(channel_1.X) && model.isOrdinalScale(channel_1.X)) {
var xScale = model.fieldDef(channel_1.X).scale;
var xHasDomain = xScale.domain instanceof Array;
if (!xHasDomain) {
summarize.push({
field: model.field(channel_1.X),
ops: ['distinct']
});
}
var xCardinality = xHasDomain ? xScale.domain.length :
model.field(channel_1.X, { datum: true, prefn: 'distinct_' });
formulas.push({
type: 'formula',
field: 'cellWidth',
expr: '(' + xCardinality + ' + ' + xScale.padding + ') * ' + xScale.bandWidth
});
}
if (model.has(channel_1.Y) && model.isOrdinalScale(channel_1.Y)) {
var yScale = model.fieldDef(channel_1.Y).scale;
var yHasDomain = yScale.domain instanceof Array;
if (!yHasDomain) {
summarize.push({
field: model.field(channel_1.Y),
ops: ['distinct']
});
}
var yCardinality = yHasDomain ? yScale.domain.length :
model.field(channel_1.Y, { datum: true, prefn: 'distinct_' });
formulas.push({
type: 'formula',
field: 'cellHeight',
expr: '(' + yCardinality + ' + ' + yScale.padding + ') * ' + yScale.bandWidth
});
}
var layout = model.layout();
if (model.has(channel_1.COLUMN)) {
var layoutCellWidth = layout.cellWidth;
var cellWidth = typeof layoutCellWidth !== 'number' ?
'datum.' + layoutCellWidth.field :
layoutCellWidth;
var colScale = model.fieldDef(channel_1.COLUMN).scale;
var colHasDomain = colScale.domain instanceof Array;
if (!colHasDomain) {
summarize.push({
field: model.field(channel_1.COLUMN),
ops: ['distinct']
});
}
var colCardinality = colHasDomain ? colScale.domain.length :
model.field(channel_1.COLUMN, { datum: true, prefn: 'distinct_' });
formulas.push({
type: 'formula',
field: 'width',
expr: '(' + cellWidth + ' + ' + colScale.padding + ')' + ' * ' + colCardinality
});
}
if (model.has(channel_1.ROW)) {
var layoutCellHeight = layout.cellHeight;
var cellHeight = typeof layoutCellHeight !== 'number' ?
'datum.' + layoutCellHeight.field :
layoutCellHeight;
var rowScale = model.fieldDef(channel_1.ROW).scale;
var rowHasDomain = rowScale.domain instanceof Array;
if (!rowHasDomain) {
summarize.push({
field: model.field(channel_1.ROW),
ops: ['distinct']
});
}
var rowCardinality = rowHasDomain ? rowScale.domain.length :
model.field(channel_1.ROW, { datum: true, prefn: 'distinct_' });
formulas.push({
type: 'formula',
field: 'height',
expr: '(' + cellHeight + '+' + rowScale.padding + ')' + ' * ' + rowCardinality
});
}
if (formulas.length > 0) {
return summarize.length > 0 ? {
name: data_1.LAYOUT,
source: model.dataTable(),
transform: [{
type: 'aggregate',
summarize: summarize
}].concat(formulas)
} : {
name: data_1.LAYOUT,
values: [{}],
transform: formulas
};
}
return null;
}
layout_1.def = def;
})(layout = exports.layout || (exports.layout = {}));
var summary;
(function (summary) {
function def(model) {
var dims = {};
var meas = {};
var hasAggregate = false;
model.forEach(function (fieldDef, channel) {
if (fieldDef.aggregate) {
hasAggregate = true;
if (fieldDef.aggregate === 'count') {
meas['*'] = meas['*'] || {};
meas['*'].count = true;
}
else {
meas[fieldDef.field] = meas[fieldDef.field] || {};
meas[fieldDef.field][fieldDef.aggregate] = true;
}
}
else {
if (fieldDef.bin) {
dims[fielddef_1.field(fieldDef, { binSuffix: '_start' })] = fielddef_1.field(fieldDef, { binSuffix: '_start' });
dims[fielddef_1.field(fieldDef, { binSuffix: '_mid' })] = fielddef_1.field(fieldDef, { binSuffix: '_mid' });
dims[fielddef_1.field(fieldDef, { binSuffix: '_end' })] = fielddef_1.field(fieldDef, { binSuffix: '_end' });
if (scale_1.type(fieldDef, channel, model.mark()) === 'ordinal') {
dims[fielddef_1.field(fieldDef, { binSuffix: '_range' })] = fielddef_1.field(fieldDef, { binSuffix: '_range' });
}
}
else {
dims[fielddef_1.field(fieldDef)] = fielddef_1.field(fieldDef);
}
}
});
var groupby = util_1.vals(dims);
var summarize = util_1.reduce(meas, function (aggregator, fnDictSet, field) {
aggregator[field] = util_1.keys(fnDictSet);
return aggregator;
}, {});
if (hasAggregate) {
return {
name: data_1.SUMMARY,
source: data_1.SOURCE,
transform: [{
type: 'aggregate',
groupby: groupby,
summarize: summarize
}]
};
}
return null;
}
summary.def = def;
;
})(summary = exports.summary || (exports.summary = {}));
var stack;
(function (stack) {
function def(model, stackProps) {
var groupbyChannel = stackProps.groupbyChannel;
var fieldChannel = stackProps.fieldChannel;
var facetFields = (model.has(channel_1.COLUMN) ? [model.field(channel_1.COLUMN)] : [])
.concat((model.has(channel_1.ROW) ? [model.field(channel_1.ROW)] : []));
var stacked = {
name: data_1.STACKED_SCALE,
source: model.dataTable(),
transform: [{
type: 'aggregate',
groupby: [model.field(groupbyChannel)].concat(facetFields),
summarize: [{ ops: ['sum'], field: model.field(fieldChannel) }]
}]
};
return stacked;
}
stack.def = def;
;
})(stack = exports.stack || (exports.stack = {}));
var dates;
(function (dates) {
function defs(model) {
var alreadyAdded = {};
return model.reduce(function (aggregator, fieldDef, channel) {
if (fieldDef.timeUnit) {
var domain = time_1.rawDomain(fieldDef.timeUnit, channel);
if (domain && !alreadyAdded[fieldDef.timeUnit]) {
alreadyAdded[fieldDef.timeUnit] = true;
aggregator.push({
name: fieldDef.timeUnit,
values: domain,
transform: [{
type: 'formula',
field: 'date',
expr: time_1.parseExpression(fieldDef.timeUnit, 'datum.data', true)
}]
});
}
}
return aggregator;
}, []);
}
dates.defs = defs;
})(dates = exports.dates || (exports.dates = {}));
function filterNonPositiveForLog(dataTable, model) {
model.forEach(function (_, channel) {
var scale = model.fieldDef(channel).scale;
if (scale && scale.type === 'log') {
dataTable.transform.push({
type: 'filter',
test: model.field(channel, { datum: true }) + ' > 0'
});
}
});
}
exports.filterNonPositiveForLog = filterNonPositiveForLog;
},{"../bin":8,"../channel":9,"../data":29,"../fielddef":31,"../type":53,"../util":54,"./scale":25,"./time":27}],15:[function(require,module,exports){
var util = require('../util');
var util_1 = require('../util');
var channel_1 = require('../channel');
var axis_1 = require('./axis');
var scale_1 = require('./scale');
function facetMixins(model, marks) {
var layout = model.layout();
var cellConfig = model.config().cell;
var cellWidth = !model.has(channel_1.COLUMN) ?
{ field: { group: 'width' } } :
typeof layout.cellWidth !== 'number' ?
{ scale: model.scaleName(channel_1.COLUMN), band: true } :
{ value: layout.cellWidth };
var cellHeight = !model.has(channel_1.ROW) ?
{ field: { group: 'height' } } :
typeof layout.cellHeight !== 'number' ?
{ scale: model.scaleName(channel_1.ROW), band: true } :
{ value: layout.cellHeight };
var facetGroupProperties = {
width: cellWidth,
height: cellHeight
};
['clip', 'fill', 'fillOpacity', 'stroke', 'strokeWidth',
'strokeOpacity', 'strokeDash', 'strokeDashOffset']
.forEach(function (property) {
var value = cellConfig[property];
if (value !== undefined) {
facetGroupProperties[property] = { value: value };
}
});
var rootMarks = [], rootAxes = [], facetKeys = [], cellAxes = [];
var hasRow = model.has(channel_1.ROW), hasCol = model.has(channel_1.COLUMN);
if (hasRow) {
if (!model.isDimension(channel_1.ROW)) {
util.error('Row encoding should be ordinal.');
}
facetGroupProperties.y = {
scale: model.scaleName(channel_1.ROW),
field: model.field(channel_1.ROW),
offset: model.fieldDef(channel_1.ROW).scale.padding / 2
};
facetKeys.push(model.field(channel_1.ROW));
rootAxes.push(axis_1.compileAxis(channel_1.ROW, model));
if (model.has(channel_1.X)) {
rootMarks.push(getXAxesGroup(model, cellWidth, hasCol));
}
var rowAxis = model.fieldDef(channel_1.ROW).axis;
if (typeof rowAxis === 'boolean' || rowAxis.grid !== false) {
rootMarks.push(getRowGridGroup(model, cellHeight));
}
}
else {
if (model.has(channel_1.X)) {
cellAxes.push(axis_1.compileAxis(channel_1.X, model));
}
}
if (hasCol) {
if (!model.isDimension(channel_1.COLUMN)) {
util.error('Col encoding should be ordinal.');
}
facetGroupProperties.x = {
scale: model.scaleName(channel_1.COLUMN),
field: model.field(channel_1.COLUMN),
offset: model.fieldDef(channel_1.COLUMN).scale.padding / 2
};
facetKeys.push(model.field(channel_1.COLUMN));
rootAxes.push(axis_1.compileAxis(channel_1.COLUMN, model));
if (model.has(channel_1.Y)) {
rootMarks.push(getYAxesGroup(model, cellHeight, hasRow));
}
var colAxis = model.fieldDef(channel_1.COLUMN).axis;
if (typeof colAxis === 'boolean' || colAxis.grid !== false) {
rootMarks.push(getColumnGridGroup(model, cellWidth));
}
}
else {
if (model.has(channel_1.Y)) {
cellAxes.push(axis_1.compileAxis(channel_1.Y, model));
}
}
var name = model.spec().name;
var facetGroup = {
name: (name ? name + '-' : '') + 'cell',
type: 'group',
from: {
data: model.dataTable(),
transform: [{ type: 'facet', groupby: facetKeys }]
},
properties: {
update: facetGroupProperties
},
marks: marks
};
if (cellAxes.length > 0) {
facetGroup.axes = cellAxes;
}
rootMarks.push(facetGroup);
return {
marks: rootMarks,
axes: rootAxes,
scales: scale_1.compileScales(model.channels(), model)
};
}
exports.facetMixins = facetMixins;
function getXAxesGroup(model, cellWidth, hasCol) {
var name = model.spec().name;
return util_1.extend({
name: (name ? name + '-' : '') + 'x-axes',
type: 'group'
}, hasCol ? {
from: {
data: model.dataTable(),
transform: [{
type: 'aggregate',
groupby: [model.field(channel_1.COLUMN)],
summarize: { '*': 'count' }
}]
}
} : {}, {
properties: {
update: {
width: cellWidth,
height: { field: { group: 'height' } },
x: hasCol ? { scale: model.scaleName(channel_1.COLUMN), field: model.field(channel_1.COLUMN) } : { value: 0 }
}
},
axes: [axis_1.compileAxis(channel_1.X, model)]
});
}
function getYAxesGroup(model, cellHeight, hasRow) {
var name = model.spec().name;
return util_1.extend({
name: (name ? name + '-' : '') + 'y-axes',
type: 'group'
}, hasRow ? {
from: {
data: model.dataTable(),
transform: [{
type: 'aggregate',
groupby: [model.field(channel_1.ROW)],
summarize: { '*': 'count' }
}]
}
} : {}, {
properties: {
update: {
width: { field: { group: 'width' } },
height: cellHeight,
y: hasRow ? { scale: model.scaleName(channel_1.ROW), field: model.field(channel_1.ROW) } : { value: 0 }
}
},
axes: [axis_1.compileAxis(channel_1.Y, model)]
});
}
function getRowGridGroup(model, cellHeight) {
var name = model.spec().name;
var cellConfig = model.config().cell;
var rowGrid = {
name: (name ? name + '-' : '') + 'row-grid',
type: 'rule',
from: {
data: model.dataTable(),
transform: [{ type: 'facet', groupby: [model.field(channel_1.ROW)] }]
},
properties: {
update: {
y: {
scale: model.scaleName(channel_1.ROW),
field: model.field(channel_1.ROW)
},
x: { value: 0, offset: -cellConfig.gridOffset },
x2: { field: { group: 'width' }, offset: cellConfig.gridOffset },
stroke: { value: cellConfig.gridColor },
strokeOpacity: { value: cellConfig.gridOpacity }
}
}
};
var rowGridOnTop = !model.has(channel_1.X) || model.axis(channel_1.X).orient !== 'top';
if (rowGridOnTop) {
return rowGrid;
}
return {
name: (name ? name + '-' : '') + 'row-grid-group',
type: 'group',
properties: {
update: {
y: cellHeight.value ? {
value: cellHeight,
offset: model.fieldDef(channel_1.ROW).scale.padding
} : {
field: { parent: 'cellHeight' },
offset: model.fieldDef(channel_1.ROW).scale.padding
},
width: { field: { group: 'width' } }
}
},
marks: [rowGrid]
};
}
function getColumnGridGroup(model, cellWidth) {
var name = model.spec().name;
var cellConfig = model.config().cell;
var columnGrid = {
name: (name ? name + '-' : '') + 'column-grid',
type: 'rule',
from: {
data: model.dataTable(),
transform: [{ type: 'facet', groupby: [model.field(channel_1.COLUMN)] }]
},
properties: {
update: {
x: {
scale: model.scaleName(channel_1.COLUMN),
field: model.field(channel_1.COLUMN)
},
y: { value: 0, offset: -cellConfig.gridOffset },
y2: { field: { group: 'height' }, offset: cellConfig.gridOffset },
stroke: { value: cellConfig.gridColor },
strokeOpacity: { value: cellConfig.gridOpacity }
}
}
};
var columnGridOnLeft = !model.has(channel_1.Y) || model.axis(channel_1.Y).orient === 'right';
if (columnGridOnLeft) {
return columnGrid;
}
return {
name: (name ? name + '-' : '') + 'column-grid-group',
type: 'group',
properties: {
update: {
x: cellWidth.value ? {
value: cellWidth,
offset: model.fieldDef(channel_1.COLUMN).scale.padding
} : {
field: { parent: 'cellWidth' },
offset: model.fieldDef(channel_1.COLUMN).scale.padding
},
height: { field: { group: 'height' } }
}
},
marks: [columnGrid]
};
}
},{"../channel":9,"../util":54,"./axis":11,"./scale":25}],16:[function(require,module,exports){
var channel_1 = require('../channel');
var mark_1 = require('../mark');
var data_1 = require('../data');
function compileLayout(model) {
var cellWidth = getCellWidth(model);
var cellHeight = getCellHeight(model);
return {
cellWidth: cellWidth,
cellHeight: cellHeight,
width: getWidth(model, cellWidth),
height: getHeight(model, cellHeight)
};
}
exports.compileLayout = compileLayout;
function getCellWidth(model) {
if (model.has(channel_1.X)) {
if (model.isOrdinalScale(channel_1.X)) {
return { data: data_1.LAYOUT, field: 'cellWidth' };
}
return model.config().cell.width;
}
if (model.mark() === mark_1.TEXT) {
return model.config().textCellWidth;
}
return model.fieldDef(channel_1.X).scale.bandWidth;
}
function getWidth(model, cellWidth) {
if (model.has(channel_1.COLUMN)) {
return { data: data_1.LAYOUT, field: 'width' };
}
return cellWidth;
}
function getCellHeight(model) {
if (model.has(channel_1.Y)) {
if (model.isOrdinalScale(channel_1.Y)) {
return { data: data_1.LAYOUT, field: 'cellHeight' };
}
else {
return model.config().cell.height;
}
}
return model.fieldDef(channel_1.Y).scale.bandWidth;
}
function getHeight(model, cellHeight) {
if (model.has(channel_1.ROW)) {
return { data: data_1.LAYOUT, field: 'height' };
}
return cellHeight;
}
},{"../channel":9,"../data":29,"../mark":32}],17:[function(require,module,exports){
var channel_1 = require('../channel');
var fielddef_1 = require('../fielddef');
var mark_1 = require('../mark');
var util_1 = require('../util');
var util_2 = require('./util');
function compileLegends(model) {
var defs = [];
if (model.has(channel_1.COLOR) && model.fieldDef(channel_1.COLOR).legend) {
defs.push(compileLegend(model, channel_1.COLOR, {
fill: model.scaleName(channel_1.COLOR)
}));
}
if (model.has(channel_1.SIZE) && model.fieldDef(channel_1.SIZE).legend) {
defs.push(compileLegend(model, channel_1.SIZE, {
size: model.scaleName(channel_1.SIZE)
}));
}
if (model.has(channel_1.SHAPE) && model.fieldDef(channel_1.SHAPE).legend) {
defs.push(compileLegend(model, channel_1.SHAPE, {
shape: model.scaleName(channel_1.SHAPE)
}));
}
return defs;
}
exports.compileLegends = compileLegends;
function compileLegend(model, channel, def) {
var fieldDef = model.fieldDef(channel);
var legend = fieldDef.legend;
def.title = title(fieldDef);
util_1.extend(def, formatMixins(model, channel));
['orient', 'values'].forEach(function (property) {
var value = legend[property];
if (value !== undefined) {
def[property] = value;
}
});
var props = (typeof legend !== 'boolean' && legend.properties) || {};
['title', 'symbols', 'legend'].forEach(function (group) {
var value = properties[group] ?
properties[group](fieldDef, props[group], model, channel) :
props[group];
if (value !== undefined) {
def.properties = def.properties || {};
def.properties[group] = value;
}
});
return def;
}
exports.compileLegend = compileLegend;
function title(fieldDef) {
var legend = fieldDef.legend;
if (typeof legend !== 'boolean' && legend.title) {
return legend.title;
}
return fielddef_1.title(fieldDef);
}
exports.title = title;
function formatMixins(model, channel) {
var fieldDef = model.fieldDef(channel);
if (fieldDef.bin) {
return {};
}
var legend = fieldDef.legend;
return util_2.formatMixins(model, channel, typeof legend !== 'boolean' ? legend.format : undefined);
}
exports.formatMixins = formatMixins;
var properties;
(function (properties) {
function symbols(fieldDef, symbolsSpec, model, channel) {
var symbols = {};
var mark = model.mark();
switch (mark) {
case mark_1.BAR:
case mark_1.TICK:
case mark_1.TEXT:
symbols.shape = { value: 'square' };
symbols.stroke = { value: 'transparent' };
util_2.applyMarkConfig(symbols, model, util_2.FILL_STROKE_CONFIG);
break;
case mark_1.CIRCLE:
case mark_1.SQUARE:
symbols.shape = { value: mark };
case mark_1.POINT:
if (model.config().mark.filled) {
symbols.stroke = { value: 'transparent' };
util_2.applyMarkConfig(symbols, model, util_2.FILL_STROKE_CONFIG);
if (model.has(channel_1.COLOR) && channel === channel_1.COLOR) {
symbols.fill = { scale: model.scaleName(channel_1.COLOR), field: 'data' };
}
else {
symbols.fill = { value: model.fieldDef(channel_1.COLOR).value };
}
}
else {
symbols.fill = { value: 'transparent' };
util_2.applyMarkConfig(symbols, model, util_2.FILL_STROKE_CONFIG);
if (model.has(channel_1.COLOR) && channel === channel_1.COLOR) {
symbols.stroke = { scale: model.scaleName(channel_1.COLOR), field: 'data' };
}
else {
symbols.stroke = { value: model.fieldDef(channel_1.COLOR).value };
}
}
break;
case mark_1.LINE:
case mark_1.AREA:
symbols.stroke = { value: 'transparent' };
util_2.applyMarkConfig(symbols, model, util_2.FILL_STROKE_CONFIG);
break;
}
symbols = util_1.extend(symbols, symbolsSpec || {});
return util_1.keys(symbols).length > 0 ? symbols : undefined;
}
properties.symbols = symbols;
})(properties || (properties = {}));
},{"../channel":9,"../fielddef":31,"../mark":32,"../util":54,"./util":28}],18:[function(require,module,exports){
var channel_1 = require('../channel');
var util_1 = require('./util');
var area;
(function (area) {
function markType() {
return 'area';
}
area.markType = markType;
function properties(model) {
var p = {};
var orient = model.config().mark.orient;
if (orient !== undefined) {
p.orient = { value: orient };
}
var stack = model.stack();
if (stack && channel_1.X === stack.fieldChannel) {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { suffix: '_start' })
};
}
else if (model.isMeasure(channel_1.X)) {
p.x = { scale: model.scaleName(channel_1.X), field: model.field(channel_1.X) };
}
else if (model.isDimension(channel_1.X)) {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_mid' })
};
}
if (orient === 'horizontal') {
if (stack && channel_1.X === stack.fieldChannel) {
p.x2 = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { suffix: '_end' })
};
}
else {
p.x2 = {
scale: model.scaleName(channel_1.X),
value: 0
};
}
}
if (stack && channel_1.Y === stack.fieldChannel) {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { suffix: '_start' })
};
}
else if (model.isMeasure(channel_1.Y)) {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y)
};
}
else if (model.isDimension(channel_1.Y)) {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_mid' })
};
}
if (orient !== 'horizontal') {
if (stack && channel_1.Y === stack.fieldChannel) {
p.y2 = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { suffix: '_end' })
};
}
else {
p.y2 = {
scale: model.scaleName(channel_1.Y),
value: 0
};
}
}
util_1.applyColorAndOpacity(p, model);
util_1.applyMarkConfig(p, model, ['interpolate', 'tension']);
return p;
}
area.properties = properties;
function labels(model) {
return undefined;
}
area.labels = labels;
})(area = exports.area || (exports.area = {}));
},{"../channel":9,"./util":28}],19:[function(require,module,exports){
var channel_1 = require('../channel');
var util_1 = require('./util');
var bar;
(function (bar) {
function markType() {
return 'rect';
}
bar.markType = markType;
function properties(model) {
var p = {};
var orient = model.config().mark.orient;
var stack = model.stack();
if (stack && channel_1.X === stack.fieldChannel) {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { suffix: '_start' })
};
p.x2 = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { suffix: '_end' })
};
}
else if (model.isMeasure(channel_1.X)) {
if (orient === 'horizontal') {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X)
};
p.x2 = {
scale: model.scaleName(channel_1.X),
value: 0
};
}
else {
p.xc = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X)
};
p.width = { value: model.sizeValue(channel_1.X) };
}
}
else if (model.fieldDef(channel_1.X).bin) {
if (model.has(channel_1.SIZE) && orient !== 'horizontal') {
p.xc = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_mid' })
};
p.width = {
scale: model.scaleName(channel_1.SIZE),
field: model.field(channel_1.SIZE)
};
}
else {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_start' }),
offset: 1
};
p.x2 = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_end' })
};
}
}
else {
if (model.has(channel_1.X)) {
p.xc = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X)
};
}
else {
p.x = { value: 0, offset: 2 };
}
p.width = model.has(channel_1.SIZE) && orient !== 'horizontal' ? {
scale: model.scaleName(channel_1.SIZE),
field: model.field(channel_1.SIZE)
} : {
value: model.sizeValue(channel_1.X)
};
}
if (stack && channel_1.Y === stack.fieldChannel) {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { suffix: '_start' })
};
p.y2 = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { suffix: '_end' })
};
}
else if (model.isMeasure(channel_1.Y)) {
if (orient !== 'horizontal') {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y)
};
p.y2 = {
scale: model.scaleName(channel_1.Y),
value: 0
};
}
else {
p.yc = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y)
};
p.height = { value: model.sizeValue(channel_1.Y) };
}
}
else if (model.fieldDef(channel_1.Y).bin) {
if (model.has(channel_1.SIZE) && orient === 'horizontal') {
p.yc = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_mid' })
};
p.height = {
scale: model.scaleName(channel_1.SIZE),
field: model.field(channel_1.SIZE)
};
}
else {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_start' })
};
p.y2 = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_end' }),
offset: 1
};
}
}
else {
if (model.has(channel_1.Y)) {
p.yc = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y)
};
}
else {
p.y2 = {
field: { group: 'height' },
offset: -1
};
}
p.height = model.has(channel_1.SIZE) && orient === 'horizontal' ? {
scale: model.scaleName(channel_1.SIZE),
field: model.field(channel_1.SIZE)
} : {
value: model.sizeValue(channel_1.Y)
};
}
util_1.applyColorAndOpacity(p, model);
return p;
}
bar.properties = properties;
function labels(model) {
return undefined;
}
bar.labels = labels;
})(bar = exports.bar || (exports.bar = {}));
},{"../channel":9,"./util":28}],20:[function(require,module,exports){
var channel_1 = require('../channel');
var util_1 = require('./util');
var line;
(function (line) {
function markType() {
return 'line';
}
line.markType = markType;
function properties(model) {
var p = {};
if (model.has(channel_1.X)) {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_mid' })
};
}
else {
p.x = { value: 0 };
}
if (model.has(channel_1.Y)) {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_mid' })
};
}
else {
p.y = { field: { group: 'height' } };
}
util_1.applyColorAndOpacity(p, model, util_1.ColorMode.ALWAYS_STROKED);
util_1.applyMarkConfig(p, model, ['interpolate', 'tension']);
return p;
}
line.properties = properties;
function labels(model) {
return undefined;
}
line.labels = labels;
})(line = exports.line || (exports.line = {}));
},{"../channel":9,"./util":28}],21:[function(require,module,exports){
var channel_1 = require('../channel');
var util_1 = require('./util');
var point;
(function (point) {
function markType() {
return 'symbol';
}
point.markType = markType;
function properties(model, fixedShape) {
var p = {};
if (model.has(channel_1.X)) {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_mid' })
};
}
else {
p.x = { value: model.fieldDef(channel_1.X).scale.bandWidth / 2 };
}
if (model.has(channel_1.Y)) {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_mid' })
};
}
else {
p.y = { value: model.fieldDef(channel_1.Y).scale.bandWidth / 2 };
}
if (model.has(channel_1.SIZE)) {
p.size = {
scale: model.scaleName(channel_1.SIZE),
field: model.field(channel_1.SIZE)
};
}
else {
p.size = { value: model.sizeValue() };
}
if (fixedShape) {
p.shape = { value: fixedShape };
}
else if (model.has(channel_1.SHAPE)) {
p.shape = {
scale: model.scaleName(channel_1.SHAPE),
field: model.field(channel_1.SHAPE)
};
}
else {
p.shape = { value: model.fieldDef(channel_1.SHAPE).value };
}
util_1.applyColorAndOpacity(p, model, fixedShape ? util_1.ColorMode.FILLED_BY_DEFAULT : util_1.ColorMode.STROKED_BY_DEFAULT);
return p;
}
point.properties = properties;
function labels(model) {
}
point.labels = labels;
})(point = exports.point || (exports.point = {}));
var circle;
(function (circle) {
function markType() {
return 'symbol';
}
circle.markType = markType;
function properties(model) {
return point.properties(model, 'circle');
}
circle.properties = properties;
function labels(model) {
return undefined;
}
circle.labels = labels;
})(circle = exports.circle || (exports.circle = {}));
var square;
(function (square) {
function markType() {
return 'symbol';
}
square.markType = markType;
function properties(model) {
return point.properties(model, 'square');
}
square.properties = properties;
function labels(model) {
return undefined;
}
square.labels = labels;
})(square = exports.square || (exports.square = {}));
},{"../channel":9,"./util":28}],22:[function(require,module,exports){
var channel_1 = require('../channel');
var util_1 = require('./util');
var util_2 = require('../util');
var type_1 = require('../type');
var text;
(function (text) {
function markType() {
return 'text';
}
text.markType = markType;
function background(model) {
return {
x: { value: 0 },
y: { value: 0 },
width: { field: { group: 'width' } },
height: { field: { group: 'height' } },
fill: { scale: model.scaleName(channel_1.COLOR), field: model.field(channel_1.COLOR) }
};
}
text.background = background;
function properties(model) {
var p = {};
var fieldDef = model.fieldDef(channel_1.TEXT);
if (model.has(channel_1.X)) {
p.x = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_mid' })
};
}
else {
if (model.has(channel_1.TEXT) && model.fieldDef(channel_1.TEXT).type === type_1.QUANTITATIVE) {
p.x = { field: { group: 'width' }, offset: -5 };
}
else {
p.x = { value: model.fieldDef(channel_1.X).scale.bandWidth / 2 };
}
}
if (model.has(channel_1.Y)) {
p.y = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_mid' })
};
}
else {
p.y = { value: model.fieldDef(channel_1.Y).scale.bandWidth / 2 };
}
if (model.has(channel_1.SIZE)) {
p.fontSize = {
scale: model.scaleName(channel_1.SIZE),
field: model.field(channel_1.SIZE)
};
}
else {
p.fontSize = { value: model.sizeValue() };
}
if (model.config().mark.applyColorToBackground && !model.has(channel_1.X) && !model.has(channel_1.Y)) {
p.fill = { value: 'black' };
var opacity = model.config().mark.opacity;
if (opacity) {
p.opacity = { value: opacity };
}
;
}
else {
util_1.applyColorAndOpacity(p, model);
}
if (model.has(channel_1.TEXT)) {
if (util_2.contains([type_1.QUANTITATIVE, type_1.TEMPORAL], model.fieldDef(channel_1.TEXT).type)) {
var format = model.config().mark.format;
util_2.extend(p, util_1.formatMixins(model, channel_1.TEXT, format));
}
else {
p.text = { field: model.field(channel_1.TEXT) };
}
}
else {
p.text = { value: fieldDef.value };
}
util_1.applyMarkConfig(p, model, ['angle', 'align', 'baseline', 'dx', 'dy', 'font', 'fontWeight',
'fontStyle', 'radius', 'theta']);
return p;
}
text.properties = properties;
})(text = exports.text || (exports.text = {}));
},{"../channel":9,"../type":53,"../util":54,"./util":28}],23:[function(require,module,exports){
var channel_1 = require('../channel');
var util_1 = require('./util');
var tick;
(function (tick) {
function markType() {
return 'rect';
}
tick.markType = markType;
function properties(model) {
var p = {};
if (model.has(channel_1.X)) {
p.xc = {
scale: model.scaleName(channel_1.X),
field: model.field(channel_1.X, { binSuffix: '_mid' })
};
}
else {
p.xc = { value: model.fieldDef(channel_1.X).scale.bandWidth / 2 };
}
if (model.has(channel_1.Y)) {
p.yc = {
scale: model.scaleName(channel_1.Y),
field: model.field(channel_1.Y, { binSuffix: '_mid' })
};
}
else {
p.yc = { value: model.fieldDef(channel_1.Y).scale.bandWidth / 2 };
}
if (model.config().mark.orient === 'horizontal') {
p.width = { value: model.config().mark.thickness };
p.height = { value: model.sizeValue(channel_1.Y) };
}
else {
p.width = { value: model.sizeValue(channel_1.X) };
p.height = { value: model.config().mark.thickness };
}
util_1.applyColorAndOpacity(p, model, util_1.ColorMode.ALWAYS_FILLED);
return p;
}
tick.properties = properties;
function labels(model) {
return undefined;
}
tick.labels = labels;
})(tick = exports.tick || (exports.tick = {}));
},{"../channel":9,"./util":28}],24:[function(require,module,exports){
var channel_1 = require('../channel');
var mark_1 = require('../mark');
var stack_1 = require('./stack');
var util_1 = require('../util');
var mark_area_1 = require('./mark-area');
var mark_bar_1 = require('./mark-bar');
var mark_line_1 = require('./mark-line');
var mark_point_1 = require('./mark-point');
var mark_text_1 = require('./mark-text');
var mark_tick_1 = require('./mark-tick');
var markCompiler = {
area: mark_area_1.area,
bar: mark_bar_1.bar,
line: mark_line_1.line,
point: mark_point_1.point,
text: mark_text_1.text,
tick: mark_tick_1.tick,
circle: mark_point_1.circle,
square: mark_point_1.square
};
function compileMark(model) {
var mark = model.mark();
var name = model.spec().name;
var isFaceted = model.has(channel_1.ROW) || model.has(channel_1.COLUMN);
var dataFrom = { data: model.dataTable() };
var markConfig = model.config().mark;
var sortBy = markConfig.sortBy;
if (mark === mark_1.LINE || mark === mark_1.AREA) {
var details = detailFields(model);
var pathOrder = getPathOrder(model);
var pathMarks = [util_1.extend(name ? { name: name + '-marks' } : {}, {
type: markCompiler[mark].markType(),
from: util_1.extend(isFaceted || details.length > 0 ? {} : dataFrom, { transform: [{ type: 'sort', by: pathOrder }] }),
properties: { update: markCompiler[mark].properties(model) }
})];
if (details.length > 0) {
var facetTransform = { type: 'facet', groupby: details };
var transform = [].concat((sortBy ? [{ type: 'sort', by: sortBy }] : []), mark === mark_1.AREA && model.stack() ?
[stack_1.imputeTransform(model), stack_1.stackTransform(model), facetTransform] :
[facetTransform]);
return [{
name: (name ? name + '-' : '') + mark + '-facet',
type: 'group',
from: util_1.extend(isFaceted ? {} : dataFrom, { transform: transform }),
properties: {
update: {
width: { field: { group: 'width' } },
height: { field: { group: 'height' } }
}
},
marks: pathMarks
}];
}
else {
return pathMarks;
}
}
else {
var marks = [];
if (mark === mark_1.TEXT &&
model.has(channel_1.COLOR) &&
model.config().mark.applyColorToBackground && !model.has(channel_1.X) && !model.has(channel_1.Y)) {
marks.push(util_1.extend(name ? { name: name + '-background' } : {}, { type: 'rect' }, isFaceted ? {} : { from: dataFrom }, { properties: { update: mark_text_1.text.background(model) } }));
}
marks.push(util_1.extend(name ? { name: name + '-marks' } : {}, { type: markCompiler[mark].markType() }, (!isFaceted || model.stack() || sortBy) ? {
from: util_1.extend(isFaceted ? {} : dataFrom, model.stack() || sortBy ? { transform: [].concat((model.stack() ? [stack_1.stackTransform(model)] : []), sortBy ? [{ type: 'sort', by: sortBy }] : []) } : {})
} : {}, { properties: { update: markCompiler[mark].properties(model) } }));
if (model.has(channel_1.LABEL) && markCompiler[mark].labels) {
var labelProperties = markCompiler[mark].labels(model);
if (labelProperties !== undefined) {
marks.push(util_1.extend(name ? { name: name + '-label' } : {}, { type: 'text' }, isFaceted ? {} : { from: dataFrom }, { properties: { update: labelProperties } }));
}
}
return marks;
}
}
exports.compileMark = compileMark;
function getPathOrder(model) {
if (model.mark() === mark_1.LINE && model.has(channel_1.PATH)) {
if (util_1.isArray(model.spec().encoding[channel_1.PATH])) {
return model.spec().encoding[channel_1.PATH].map(function (fieldDef) {
return (fieldDef.sort === 'descending' ? '-' : '') + fieldDef.field;
});
}
else {
var fieldDef = model.fieldDef(channel_1.PATH);
return (fieldDef.sort === 'descending' ? '-' : '') + fieldDef.field;
}
}
else {
return '-' + model.field(model.config().mark.orient === 'horizontal' ? channel_1.Y : channel_1.X);
}
}
function detailFields(model) {
return [channel_1.COLOR, channel_1.DETAIL, channel_1.SHAPE].reduce(function (details, channel) {
if (model.has(channel) && !model.fieldDef(channel).aggregate) {
details.push(model.field(channel));
}
return details;
}, []);
}
},{"../channel":9,"../mark":32,"../util":54,"./mark-area":18,"./mark-bar":19,"./mark-line":20,"./mark-point":21,"./mark-text":22,"./mark-tick":23,"./stack":26}],25:[function(require,module,exports){
var util_1 = require('../util');
var aggregate_1 = require('../aggregate');
var channel_1 = require('../channel');
var data_1 = require('../data');
var fielddef_1 = require('../fielddef');
var type_1 = require('../type');
var mark_1 = require('../mark');
var time_1 = require('./time');
function compileScales(channels, model) {
return channels.filter(function (channel) {
return channel !== channel_1.DETAIL && channel !== channel_1.PATH;
})
.map(function (channel) {
var fieldDef = model.fieldDef(channel);
var scaleDef = {
name: model.scaleName(channel),
type: type(fieldDef, channel, model.mark()),
};
scaleDef.domain = domain(model, channel, scaleDef.type);
util_1.extend(scaleDef, rangeMixins(model, channel, scaleDef.type));
[
'reverse', 'round',
'clamp', 'nice',
'exponent', 'zero',
'outerPadding', 'padding', 'points'
].forEach(function (property) {
var value = exports[property](model, channel, scaleDef.type);
if (value !== undefined) {
scaleDef[property] = value;
}
});
return scaleDef;
});
}
exports.compileScales = compileScales;
function type(fieldDef, channel, mark) {
if (channel === channel_1.DETAIL || channel === channel_1.PATH) {
return null;
}
switch (fieldDef.type) {
case type_1.NOMINAL:
return 'ordinal';
case type_1.ORDINAL:
return 'ordinal';
case type_1.TEMPORAL:
if (channel === channel_1.COLOR) {
return 'time';
}
if (util_1.contains([channel_1.ROW, channel_1.COLUMN, channel_1.SHAPE], channel)) {
return 'ordinal';
}
if (fieldDef.scale.type !== undefined) {
return fieldDef.scale.type;
}
if (fieldDef.timeUnit) {
switch (fieldDef.timeUnit) {
case 'hours':
case 'day':
case 'month':
return 'ordinal';
case 'date':
case 'year':
case 'second':
case 'minute':
return util_1.contains([mark_1.BAR, mark_1.TICK], mark) &&
fielddef_1.isDimension(fieldDef) ? 'ordinal' : 'time';
default:
return 'ordinal';
}
}
return 'time';
case type_1.QUANTITATIVE:
if (fieldDef.bin) {
return util_1.contains([channel_1.X, channel_1.Y, channel_1.COLOR], channel) ? 'linear' : 'ordinal';
}
if (fieldDef.scale.type !== undefined) {
return fieldDef.scale.type;
}
return 'linear';
}
}
exports.type = type;
function domain(model, channel, scaleType) {
var fieldDef = model.fieldDef(channel);
if (fieldDef.scale.domain) {
return fieldDef.scale.domain;
}
if (fieldDef.type === type_1.TEMPORAL) {
if (time_1.rawDomain(fieldDef.timeUnit, channel)) {
return {
data: fieldDef.timeUnit,
field: 'date'
};
}
return {
data: model.dataTable(),
field: model.field(channel),
sort: {
field: model.field(channel),
op: 'min'
}
};
}
var stack = model.stack();
if (stack && channel === stack.fieldChannel) {
if (stack.config.offset === 'normalize') {
return [0, 1];
}
return {
data: data_1.STACKED_SCALE,
field: model.field(channel, { prefn: 'sum_' })
};
}
var useRawDomain = _useRawDomain(model, channel, scaleType);
var sort = domainSort(model, channel, scaleType);
if (useRawDomain) {
return {
data: data_1.SOURCE,
field: model.field(channel, { noAggregate: true })
};
}
else if (fieldDef.bin) {
return scaleType === 'ordinal' ? {
data: model.dataTable(),
field: model.field(channel, { binSuffix: '_range' }),
sort: {
field: model.field(channel, { binSuffix: '_start' }),
op: 'min'
}
} : channel === channel_1.COLOR ? {
data: model.dataTable(),
field: model.field(channel, { binSuffix: '_start' })
} : {
data: model.dataTable(),
field: [
model.field(channel, { binSuffix: '_start' }),
model.field(channel, { binSuffix: '_end' })
]
};
}
else if (sort) {
return {
data: sort.op ? data_1.SOURCE : model.dataTable(),
field: model.field(channel),
sort: sort
};
}
else {
return {
data: model.dataTable(),
field: model.field(channel)
};
}
}
exports.domain = domain;
function domainSort(model, channel, scaleType) {
var sort = model.fieldDef(channel).sort;
if (sort === 'ascending' || sort === 'descending') {
return true;
}
if (scaleType === 'ordinal' && typeof sort !== 'string') {
return {
op: sort.op,
field: sort.field
};
}
return undefined;
}
exports.domainSort = domainSort;
function reverse(model, channel) {
var sort = model.fieldDef(channel).sort;
return sort && (typeof sort === 'string' ?
sort === 'descending' :
sort.order === 'descending') ? true : undefined;
}
exports.reverse = reverse;
function _useRawDomain(model, channel, scaleType) {
var fieldDef = model.fieldDef(channel);
return fieldDef.scale.useRawDomain &&
fieldDef.aggregate &&
aggregate_1.SHARED_DOMAIN_OPS.indexOf(fieldDef.aggregate) >= 0 &&
((fieldDef.type === type_1.QUANTITATIVE && !fieldDef.bin) ||
(fieldDef.type === type_1.TEMPORAL && scaleType === 'linear'));
}
function bandWidth(model, channel, scaleType) {
if (scaleType === 'ordinal') {
return model.fieldDef(channel).scale.bandWidth;
}
return undefined;
}
exports.bandWidth = bandWidth;
function clamp(model, channel) {
return model.fieldDef(channel).scale.clamp;
}
exports.clamp = clamp;
function exponent(model, channel) {
return model.fieldDef(channel).scale.exponent;
}
exports.exponent = exponent;
function nice(model, channel, scaleType) {
if (model.fieldDef(channel).scale.nice !== undefined) {
return model.fieldDef(channel).scale.nice;
}
switch (channel) {
case channel_1.X:
case channel_1.Y:
if (scaleType === 'time' || scaleType === 'ordinal') {
return undefined;
}
return true;
case channel_1.ROW:
case channel_1.COLUMN:
return true;
}
return undefined;
}
exports.nice = nice;
function outerPadding(model, channel, scaleType) {
if (scaleType === 'ordinal') {
if (model.fieldDef(channel).scale.outerPadding !== undefined) {
return model.fieldDef(channel).scale.outerPadding;
}
}
return undefined;
}
exports.outerPadding = outerPadding;
function padding(model, channel, scaleType) {
if (scaleType === 'ordinal' && channel !== channel_1.ROW && channel !== channel_1.COLUMN) {
return model.fieldDef(channel).scale.padding;
}
return undefined;
}
exports.padding = padding;
function points(model, channel, scaleType) {
if (scaleType === 'ordinal') {
switch (channel) {
case channel_1.X:
case channel_1.Y:
return true;
}
}
return undefined;
}
exports.points = points;
function rangeMixins(model, channel, scaleType) {
var fieldDef = model.fieldDef(channel);
if (scaleType === 'ordinal' && fieldDef.scale.bandWidth) {
return { bandWidth: fieldDef.scale.bandWidth };
}
if (fieldDef.scale.range) {
return { range: fieldDef.scale.range };
}
switch (channel) {
case channel_1.X:
return { rangeMin: 0, rangeMax: model.layout().cellWidth };
case channel_1.Y:
if (scaleType === 'ordinal') {
return { rangeMin: 0, rangeMax: model.layout().cellHeight };
}
return { rangeMin: model.layout().cellHeight, rangeMax: 0 };
case channel_1.SIZE:
if (model.is(mark_1.BAR)) {
var dimension = model.config().mark.orient === 'horizontal' ? channel_1.Y : channel_1.X;
return { range: [2, model.fieldDef(dimension).scale.bandWidth] };
}
else if (model.is(mark_1.TEXT)) {
return { range: [8, 40] };
}
else {
var xIsMeasure = model.isMeasure(channel_1.X);
var yIsMeasure = model.isMeasure(channel_1.Y);
var bandWidth_1 = xIsMeasure !== yIsMeasure ?
model.fieldDef(xIsMeasure ? channel_1.Y : channel_1.X).scale.bandWidth :
Math.min(model.fieldDef(channel_1.X).scale.bandWidth, model.fieldDef(channel_1.Y).scale.bandWidth);
return { range: [10, (bandWidth_1 - 2) * (bandWidth_1 - 2)] };
}
case channel_1.SHAPE:
return { range: 'shapes' };
case channel_1.COLOR:
if (fieldDef.type === type_1.NOMINAL
|| fieldDef.type === type_1.ORDINAL) {
return { range: 'category10' };
}
else {
return { range: ['#AFC6A3', '#09622A'] };
}
case channel_1.ROW:
return { range: 'height' };
case channel_1.COLUMN:
return { range: 'width' };
}
return {};
}
exports.rangeMixins = rangeMixins;
function round(model, channel) {
if (model.fieldDef(channel).scale.round !== undefined) {
return model.fieldDef(channel).scale.round;
}
switch (channel) {
case channel_1.X:
case channel_1.Y:
case channel_1.ROW:
case channel_1.COLUMN:
case channel_1.SIZE:
return true;
}
return undefined;
}
exports.round = round;
function zero(model, channel) {
var fieldDef = model.fieldDef(channel);
var timeUnit = fieldDef.timeUnit;
if (fieldDef.scale.zero !== undefined) {
return fieldDef.scale.zero;
}
if (fieldDef.type === type_1.TEMPORAL) {
if (timeUnit === 'year') {
return false;
}
return undefined;
}
if (fieldDef.bin) {
return false;
}
return channel === channel_1.X || channel === channel_1.Y ?
undefined :
false;
}
exports.zero = zero;
},{"../aggregate":7,"../channel":9,"../data":29,"../fielddef":31,"../mark":32,"../type":53,"../util":54,"./time":27}],26:[function(require,module,exports){
var config_stack_schema_1 = require('../schema/config.stack.schema');
var schemautil_1 = require('../schema/schemautil');
var channel_1 = require('../channel');
var mark_1 = require('../mark');
var fielddef_1 = require('../fielddef');
var encoding_1 = require('../encoding');
var util_1 = require('../util');
var scale_1 = require('./scale');
function compileStackProperties(spec) {
var stackFields = getStackFields(spec);
if (stackFields.length > 0 &&
util_1.contains([mark_1.BAR, mark_1.AREA], spec.mark) &&
spec.config.stack !== false &&
encoding_1.isAggregate(spec.encoding)) {
var isXMeasure = encoding_1.has(spec.encoding, channel_1.X) && fielddef_1.isMeasure(spec.encoding.x);
var isYMeasure = encoding_1.has(spec.encoding, channel_1.Y) && fielddef_1.isMeasure(spec.encoding.y);
if (isXMeasure && !isYMeasure) {
return {
groupbyChannel: channel_1.Y,
fieldChannel: channel_1.X,
stackFields: stackFields,
config: spec.config.stack === true ? schemautil_1.instantiate(config_stack_schema_1.stackConfig) : spec.config.stack
};
}
else if (isYMeasure && !isXMeasure) {
return {
groupbyChannel: channel_1.X,
fieldChannel: channel_1.Y,
stackFields: stackFields,
config: spec.config.stack === true ? schemautil_1.instantiate(config_stack_schema_1.stackConfig) : spec.config.stack
};
}
}
return null;
}
exports.compileStackProperties = compileStackProperties;
function getStackFields(spec) {
return [channel_1.COLOR, channel_1.DETAIL].reduce(function (fields, channel) {
var channelEncoding = spec.encoding[channel];
if (encoding_1.has(spec.encoding, channel)) {
if (util_1.isArray(channelEncoding)) {
channelEncoding.forEach(function (fieldDef) {
fields.push(fielddef_1.field(fieldDef));
});
}
else {
var fieldDef = channelEncoding;
fields.push(fielddef_1.field(fieldDef, {
binSuffix: scale_1.type(fieldDef, channel, spec.mark) === 'ordinal' ? '_range' : '_start'
}));
}
}
return fields;
}, []);
}
function imputeTransform(model) {
var stack = model.stack();
return {
type: 'impute',
field: model.field(stack.fieldChannel),
groupby: stack.stackFields,
orderby: [model.field(stack.groupbyChannel)],
method: 'value',
value: 0
};
}
exports.imputeTransform = imputeTransform;
function stackTransform(model) {
var stack = model.stack();
var sortby = stack.config.sort === 'ascending' ?
stack.stackFields :
util_1.isArray(stack.config.sort) ?
stack.config.sort :
stack.stackFields.map(function (field) {
return '-' + field;
});
var valName = model.field(stack.fieldChannel);
var transform = {
type: 'stack',
groupby: [model.field(stack.groupbyChannel)],
field: model.field(stack.fieldChannel),
sortby: sortby,
output: {
start: valName + '_start',
end: valName + '_end'
}
};
if (stack.config.offset) {
transform.offset = stack.config.offset;
}
return transform;
}
exports.stackTransform = stackTransform;
},{"../channel":9,"../encoding":30,"../fielddef":31,"../mark":32,"../schema/config.stack.schema":39,"../schema/schemautil":47,"../util":54,"./scale":25}],27:[function(require,module,exports){
var util_1 = require('../util');
var channel_1 = require('../channel');
function format(timeUnit, abbreviated) {
if (abbreviated === void 0) { abbreviated = false; }
if (!timeUnit) {
return undefined;
}
var dateComponents = [];
if (timeUnit.indexOf('year') > -1) {
dateComponents.push(abbreviated ? '%y' : '%Y');
}
if (timeUnit.indexOf('month') > -1) {
dateComponents.push(abbreviated ? '%b' : '%B');
}
if (timeUnit.indexOf('day') > -1) {
dateComponents.push(abbreviated ? '%a' : '%A');
}
else if (timeUnit.indexOf('date') > -1) {
dateComponents.push('%d');
}
var timeComponents = [];
if (timeUnit.indexOf('hour') > -1) {
timeComponents.push('%H');
}
if (timeUnit.indexOf('minute') > -1) {
timeComponents.push('%M');
}
if (timeUnit.indexOf('second') > -1) {
timeComponents.push('%S');
}
if (timeUnit.indexOf('milliseconds') > -1) {
timeComponents.push('%L');
}
var out = [];
if (dateComponents.length > 0) {
out.push(dateComponents.join('-'));
}
if (timeComponents.length > 0) {
out.push(timeComponents.join(':'));
}
return out.length > 0 ? out.join(' ') : undefined;
}
exports.format = format;
function parseExpression(timeUnit, fieldRef, onlyRef) {
if (onlyRef === void 0) { onlyRef = false; }
var out = 'datetime(';
function get(fun, addComma) {
if (addComma === void 0) { addComma = true; }
if (onlyRef) {
return fieldRef + (addComma ? ', ' : '');
}
else {
return fun + '(' + fieldRef + ')' + (addComma ? ', ' : '');
}
}
if (timeUnit.indexOf('year') > -1) {
out += get('year');
}
else {
out += '2006, ';
}
if (timeUnit.indexOf('month') > -1) {
out += get('month');
}
else {
out += '0, ';
}
if (timeUnit.indexOf('day') > -1) {
out += get('day', false) + '+1, ';
}
else if (timeUnit.indexOf('date') > -1) {
out += get('date');
}
else {
out += '1, ';
}
if (timeUnit.indexOf('hours') > -1) {
out += get('hours');
}
else {
out += '0, ';
}
if (timeUnit.indexOf('minutes') > -1) {
out += get('minutes');
}
else {
out += '0, ';
}
if (timeUnit.indexOf('seconds') > -1) {
out += get('seconds');
}
else {
out += '0, ';
}
if (timeUnit.indexOf('milliseconds') > -1) {
out += get('milliseconds', false);
}
else {
out += '0';
}
return out + ')';
}
exports.parseExpression = parseExpression;
function rawDomain(timeUnit, channel) {
if (util_1.contains([channel_1.ROW, channel_1.COLUMN, channel_1.SHAPE, channel_1.COLOR], channel)) {
return null;
}
switch (timeUnit) {
case 'seconds':
return util_1.range(0, 60);
case 'minutes':
return util_1.range(0, 60);
case 'hours':
return util_1.range(0, 24);
case 'day':
return util_1.range(0, 7);
case 'date':
return util_1.range(1, 32);
case 'month':
return util_1.range(0, 12);
}
return null;
}
exports.rawDomain = rawDomain;
},{"../channel":9,"../util":54}],28:[function(require,module,exports){
var channel_1 = require('../channel');
var type_1 = require('../type');
var time_1 = require('./time');
var util_1 = require('../util');
(function (ColorMode) {
ColorMode[ColorMode["ALWAYS_FILLED"] = 0] = "ALWAYS_FILLED";
ColorMode[ColorMode["ALWAYS_STROKED"] = 1] = "ALWAYS_STROKED";
ColorMode[ColorMode["FILLED_BY_DEFAULT"] = 2] = "FILLED_BY_DEFAULT";
ColorMode[ColorMode["STROKED_BY_DEFAULT"] = 3] = "STROKED_BY_DEFAULT";
})(exports.ColorMode || (exports.ColorMode = {}));
var ColorMode = exports.ColorMode;
exports.FILL_STROKE_CONFIG = ['fill', 'fillOpacity',
'stroke', 'strokeWidth', 'strokeDash', 'strokeDashOffset', 'strokeOpacity',
'opacity'];
function applyColorAndOpacity(p, model, colorMode) {
if (colorMode === void 0) { colorMode = ColorMode.STROKED_BY_DEFAULT; }
var filled = colorMode === ColorMode.ALWAYS_FILLED ? true :
colorMode === ColorMode.ALWAYS_STROKED ? false :
model.config().mark.filled !== undefined ? model.config().mark.filled :
colorMode === ColorMode.FILLED_BY_DEFAULT ? true :
false;
applyMarkConfig(p, model, exports.FILL_STROKE_CONFIG);
if (filled) {
if (model.has(channel_1.COLOR)) {
p.fill = {
scale: model.scaleName(channel_1.COLOR),
field: model.field(channel_1.COLOR)
};
}
else {
p.fill = { value: model.fieldDef(channel_1.COLOR).value };
}
}
else {
if (model.has(channel_1.COLOR)) {
p.stroke = {
scale: model.scaleName(channel_1.COLOR),
field: model.field(channel_1.COLOR)
};
}
else {
p.stroke = { value: model.fieldDef(channel_1.COLOR).value };
}
}
}
exports.applyColorAndOpacity = applyColorAndOpacity;
function applyMarkConfig(marksProperties, model, propsList) {
propsList.forEach(function (property) {
var value = model.config().mark[property];
if (value !== undefined) {
marksProperties[property] = { value: value };
}
});
}
exports.applyMarkConfig = applyMarkConfig;
function formatMixins(model, channel, format) {
var fieldDef = model.fieldDef(channel);
if (!util_1.contains([type_1.QUANTITATIVE, type_1.TEMPORAL], fieldDef.type)) {
return {};
}
var def = {};
if (fieldDef.type === type_1.TEMPORAL) {
def.formatType = 'time';
}
if (format !== undefined) {
def.format = format;
}
else {
switch (fieldDef.type) {
case type_1.QUANTITATIVE:
def.format = model.config().numberFormat;
break;
case type_1.TEMPORAL:
def.format = timeFormat(model, channel) || model.config().timeFormat;
break;
}
}
if (channel === channel_1.TEXT) {
var filter = (def.formatType || 'number') + (def.format ? ':\'' + def.format + '\'' : '');
return {
text: {
template: '{{' + model.field(channel, { datum: true }) + ' | ' + filter + '}}'
}
};
}
return def;
}
exports.formatMixins = formatMixins;
function isAbbreviated(model, channel, fieldDef) {
switch (channel) {
case channel_1.ROW:
case channel_1.COLUMN:
case channel_1.X:
case channel_1.Y:
return model.axis(channel).shortTimeLabels;
case channel_1.COLOR:
case channel_1.SHAPE:
case channel_1.SIZE:
return model.legend(channel).shortTimeLabels;
case channel_1.TEXT:
return model.config().mark.shortTimeLabels;
case channel_1.LABEL:
}
}
function timeFormat(model, channel) {
var fieldDef = model.fieldDef(channel);
return time_1.format(fieldDef.timeUnit, isAbbreviated(model, channel, fieldDef));
}
exports.timeFormat = timeFormat;
},{"../channel":9,"../type":53,"../util":54,"./time":27}],29:[function(require,module,exports){
var type_1 = require('./type');
exports.SUMMARY = 'summary';
exports.SOURCE = 'source';
exports.STACKED_SCALE = 'stacked_scale';
exports.LAYOUT = 'layout';
exports.types = {
'boolean': type_1.NOMINAL,
'number': type_1.QUANTITATIVE,
'integer': type_1.QUANTITATIVE,
'date': type_1.TEMPORAL,
'string': type_1.NOMINAL
};
},{"./type":53}],30:[function(require,module,exports){
var channel_1 = require('./channel');
var util_1 = require('./util');
function countRetinal(encoding) {
var count = 0;
if (encoding.color) {
count++;
}
if (encoding.size) {
count++;
}
if (encoding.shape) {
count++;
}
return count;
}
exports.countRetinal = countRetinal;
function channels(encoding) {
return channel_1.CHANNELS.filter(function (channel) {
return has(encoding, channel);
});
}
exports.channels = channels;
function has(encoding, channel) {
var channelEncoding = encoding && encoding[channel];
return channelEncoding && (channelEncoding.field !== undefined ||
(util_1.isArray(channelEncoding) && channelEncoding.length > 0));
}
exports.has = has;
function isAggregate(encoding) {
for (var k in encoding) {
if (has(encoding, k) && encoding[k].aggregate) {
return true;
}
}
return false;
}
exports.isAggregate = isAggregate;
function fieldDefs(encoding) {
var arr = [];
channel_1.CHANNELS.forEach(function (channel) {
if (has(encoding, channel)) {
if (util_1.isArray(encoding[channel])) {
encoding[channel].forEach(function (fieldDef) {
arr.push(fieldDef);
});
}
else {
arr.push(encoding[channel]);
}
}
});
return arr;
}
exports.fieldDefs = fieldDefs;
;
function forEach(encoding, f, thisArg) {
var i = 0;
channel_1.CHANNELS.forEach(function (channel) {
if (has(encoding, channel)) {
if (util_1.isArray(encoding[channel])) {
encoding[channel].forEach(function (fieldDef) {
f.call(thisArg, fieldDef, channel, i++);
});
}
else {
f.call(thisArg, encoding[channel], channel, i++);
}
}
});
}
exports.forEach = forEach;
function map(encoding, f, thisArg) {
var arr = [];
channel_1.CHANNELS.forEach(function (channel) {
if (has(encoding, channel)) {
if (util_1.isArray(encoding[channel])) {
encoding[channel].forEach(function (fieldDef) {
arr.push(f.call(thisArg, fieldDef, channel, encoding));
});
}
else {
arr.push(f.call(thisArg, encoding[channel], channel, encoding));
}
}
});
return arr;
}
exports.map = map;
function reduce(encoding, f, init, thisArg) {
var r = init;
channel_1.CHANNELS.forEach(function (channel) {
if (has(encoding, channel)) {
if (util_1.isArray(encoding[channel])) {
encoding[channel].forEach(function (fieldDef) {
r = f.call(thisArg, r, fieldDef, channel, encoding);
});
}
else {
r = f.call(thisArg, r, encoding[channel], channel, encoding);
}
}
});
return r;
}
exports.reduce = reduce;
},{"./channel":9,"./util":54}],31:[function(require,module,exports){
var util_1 = require('./util');
var type_1 = require('./type');
function field(fieldDef, opt) {
if (opt === void 0) { opt = {}; }
var prefix = (opt.datum ? 'datum.' : '') + (opt.prefn || '');
var suffix = opt.suffix || '';
var field = fieldDef.field;
if (isCount(fieldDef)) {
return prefix + 'count' + suffix;
}
else if (opt.fn) {
return prefix + opt.fn + '_' + field + suffix;
}
else if (!opt.nofn && fieldDef.bin) {
return prefix + 'bin_' + field + (opt.binSuffix || suffix || '_start');
}
else if (!opt.nofn && !opt.noAggregate && fieldDef.aggregate) {
return prefix + fieldDef.aggregate + '_' + field + suffix;
}
else if (!opt.nofn && fieldDef.timeUnit) {
return prefix + fieldDef.timeUnit + '_' + field + suffix;
}
else {
return prefix + field;
}
}
exports.field = field;
function _isFieldDimension(fieldDef) {
return util_1.contains([type_1.NOMINAL, type_1.ORDINAL], fieldDef.type) || !!fieldDef.bin ||
(fieldDef.type === type_1.TEMPORAL && !!fieldDef.timeUnit);
}
function isDimension(fieldDef) {
return fieldDef && fieldDef.field && _isFieldDimension(fieldDef);
}
exports.isDimension = isDimension;
function isMeasure(fieldDef) {
return fieldDef && fieldDef.field && !_isFieldDimension(fieldDef);
}
exports.isMeasure = isMeasure;
exports.COUNT_DISPLAYNAME = 'Number of Records';
function count() {
return { field: '*', aggregate: 'count', type: type_1.QUANTITATIVE, displayName: exports.COUNT_DISPLAYNAME };
}
exports.count = count;
function isCount(fieldDef) {
return fieldDef.aggregate === 'count';
}
exports.isCount = isCount;
function cardinality(fieldDef, stats, filterNull) {
if (filterNull === void 0) { filterNull = {}; }
var stat = stats[fieldDef.field];
var type = fieldDef.type;
if (fieldDef.bin) {
var bin = fieldDef.bin;
var maxbins = (typeof bin === 'boolean') ? undefined : bin.maxbins;
if (maxbins === undefined) {
maxbins = 10;
}
var bins = util_1.getbins(stat, maxbins);
return (bins.stop - bins.start) / bins.step;
}
if (fieldDef.type === type_1.TEMPORAL) {
var timeUnit = fieldDef.timeUnit;
switch (timeUnit) {
case 'seconds': return 60;
case 'minutes': return 60;
case 'hours': return 24;
case 'day': return 7;
case 'date': return 31;
case 'month': return 12;
case 'year':
var yearstat = stats['year_' + fieldDef.field];
if (!yearstat) {
return null;
}
return yearstat.distinct -
(stat.missing > 0 && filterNull[type] ? 1 : 0);
}
}
if (fieldDef.aggregate) {
return 1;
}
return stat.distinct -
(stat.missing > 0 && filterNull[type] ? 1 : 0);
}
exports.cardinality = cardinality;
function title(fieldDef) {
if (isCount(fieldDef)) {
return exports.COUNT_DISPLAYNAME;
}
var fn = fieldDef.aggregate || fieldDef.timeUnit || (fieldDef.bin && 'bin');
if (fn) {
return fn.toUpperCase() + '(' + fieldDef.field + ')';
}
else {
return fieldDef.field;
}
}
exports.title = title;
},{"./type":53,"./util":54}],32:[function(require,module,exports){
(function (Mark) {
Mark[Mark["AREA"] = 'area'] = "AREA";
Mark[Mark["BAR"] = 'bar'] = "BAR";
Mark[Mark["LINE"] = 'line'] = "LINE";
Mark[Mark["POINT"] = 'point'] = "POINT";
Mark[Mark["TEXT"] = 'text'] = "TEXT";
Mark[Mark["TICK"] = 'tick'] = "TICK";
Mark[Mark["CIRCLE"] = 'circle'] = "CIRCLE";
Mark[Mark["SQUARE"] = 'square'] = "SQUARE";
})(exports.Mark || (exports.Mark = {}));
var Mark = exports.Mark;
exports.AREA = Mark.AREA;
exports.BAR = Mark.BAR;
exports.LINE = Mark.LINE;
exports.POINT = Mark.POINT;
exports.TEXT = Mark.TEXT;
exports.TICK = Mark.TICK;
exports.CIRCLE = Mark.CIRCLE;
exports.SQUARE = Mark.SQUARE;
},{}],33:[function(require,module,exports){
exports.axis = {
type: 'object',
properties: {
format: {
type: 'string',
default: undefined,
description: 'The formatting pattern for axis labels. If undefined, a good format is automatically determined. Vega-Lite uses D3\'s format pattern and automatically switches to datetime formatters.'
},
grid: {
type: 'boolean',
default: undefined,
description: 'A flag indicate if gridlines should be created in addition to ticks. If `grid` is unspecified, the default value is `true` for ROW and COL. For X and Y, the default value is `true` for quantitative and time fields and `false` otherwise.'
},
layer: {
type: 'string',
default: undefined,
description: 'A string indicating if the axis (and any gridlines) should be placed above or below the data marks.'
},
offset: {
type: 'number',
default: undefined,
description: 'The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.'
},
orient: {
type: 'string',
default: undefined,
enum: ['top', 'right', 'left', 'bottom'],
description: 'The orientation of the axis. One of top, bottom, left or right. The orientation can be used to further specialize the axis type (e.g., a y axis oriented for the right edge of the chart).'
},
subdivide: {
type: 'number',
default: undefined,
description: 'If provided, sets the number of minor ticks between major ticks (the value 9 results in decimal subdivision). Only applicable for axes visualizing quantitative scales.'
},
ticks: {
type: 'integer',
default: undefined,
minimum: 0,
description: 'A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are "nice" (multiples of 2, 5, 10) and lie within the underlying scale\'s range.'
},
tickPadding: {
type: 'integer',
default: undefined,
description: 'The padding, in pixels, between ticks and text labels.'
},
tickSize: {
type: 'integer',
default: undefined,
minimum: 0,
description: 'The size, in pixels, of major, minor and end ticks.'
},
tickSizeMajor: {
type: 'integer',
default: undefined,
minimum: 0,
description: 'The size, in pixels, of major ticks.'
},
tickSizeMinor: {
type: 'integer',
default: undefined,
minimum: 0,
description: 'The size, in pixels, of minor ticks.'
},
tickSizeEnd: {
type: 'integer',
default: undefined,
minimum: 0,
description: 'The size, in pixels, of end ticks.'
},
title: {
type: 'string',
default: undefined,
description: 'A title for the axis. (Shows field name and its function by default.)'
},
titleOffset: {
type: 'integer',
default: undefined,
description: 'A title offset value for the axis.'
},
values: {
type: 'array',
default: undefined
},
properties: {
type: 'object',
description: 'Optional mark property definitions for custom axis styling.'
},
characterWidth: {
type: 'integer',
default: 6,
description: 'Character width for automatically determining title max length.'
},
labelMaxLength: {
type: 'integer',
default: 25,
minimum: 1,
description: 'Truncate labels that are too long.'
},
labels: {
type: 'boolean',
default: true,
description: 'Enable or disable labels.'
},
shortTimeLabels: {
type: 'boolean',
default: false,
description: 'Whether month and day names should be abbreviated.'
},
titleMaxLength: {
type: 'integer',
default: undefined,
minimum: 0,
description: 'Max length for axis title if the title is automatically generated from the field\'s description.' +
'By default, this is automatically based on cell size and characterWidth property.'
}
}
};
},{}],34:[function(require,module,exports){
var type_1 = require('../type');
var util_1 = require('../util');
exports.bin = {
type: ['boolean', 'object'],
default: false,
properties: {
min: {
type: 'number',
default: undefined,
description: 'The minimum bin value to consider. If unspecified, the minimum value of the specified field is used.'
},
max: {
type: 'number',
default: undefined,
description: 'The maximum bin value to consider. If unspecified, the maximum value of the specified field is used.'
},
base: {
type: 'number',
default: undefined,
description: 'The number base to use for automatic bin determination (default is base 10).'
},
step: {
type: 'number',
default: undefined,
description: 'An exact step size to use between bins. If provided, options such as maxbins will be ignored.'
},
steps: {
type: 'array',
default: undefined,
description: 'An array of allowable step sizes to choose from.'
},
minstep: {
type: 'number',
default: undefined,
description: 'A minimum allowable step size (particularly useful for integer values).'
},
div: {
type: 'array',
default: undefined,
description: 'Scale factors indicating allowable subdivisions. The default value is [5, 2], which indicates that for base 10 numbers (the default base), the method may consider dividing bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the given constraints.'
},
maxbins: {
type: 'integer',
default: undefined,
minimum: 2,
description: 'Maximum number of bins.'
}
},
supportedTypes: util_1.toMap([type_1.QUANTITATIVE])
};
},{"../type":53,"../util":54}],35:[function(require,module,exports){
exports.cellConfig = {
type: 'object',
properties: {
width: {
type: 'integer',
default: 200
},
height: {
type: 'integer',
default: 200
},
gridColor: {
type: 'string',
role: 'color',
default: '#000000'
},
gridOpacity: {
type: 'number',
minimum: 0,
maximum: 1,
default: 0.4
},
gridOffset: {
type: 'number',
default: 0
},
clip: {
type: 'boolean',
},
fill: {
type: 'string',
role: 'color',
default: 'rgba(0,0,0,0)'
},
fillOpacity: {
type: 'number',
},
stroke: {
type: 'string',
role: 'color',
},
strokeWidth: {
type: 'integer'
},
strokeOpacity: {
type: 'number'
},
strokeDash: {
type: 'array',
default: undefined
},
strokeDashOffset: {
type: 'integer',
description: 'The offset (in pixels) into which to begin drawing with the stroke dash array.'
}
}
};
},{}],36:[function(require,module,exports){
exports.markConfig = {
type: 'object',
properties: {
filled: {
type: 'boolean',
default: undefined,
description: 'Whether the shape\'s color should be used as fill color instead of stroke color. ' +
'This is only applicable for "bar", "point", and "area". ' +
'All marks except "point" marks are filled by default.'
},
sortBy: {
default: undefined,
oneOf: [
{ type: 'string' },
{ type: 'array', items: { type: 'string' } }
],
description: 'Sort layer of marks by a given field or fields.'
},
fill: {
type: 'string',
role: 'color',
default: undefined
},
fillOpacity: {
type: 'number',
default: undefined,
minimum: 0,
maximum: 1
},
stroke: {
type: 'string',
role: 'color',
default: undefined
},
strokeOpacity: {
type: 'number',
default: undefined,
minimum: 0,
maximum: 1
},
opacity: {
type: 'number',
default: undefined,
minimum: 0,
maximum: 1
},
strokeWidth: {
type: 'number',
default: 2,
minimum: 0
},
strokeDash: {
type: 'array',
default: undefined,
description: 'An array of alternating stroke, space lengths for creating dashed or dotted lines.'
},
strokeDashOffset: {
type: 'array',
default: undefined,
description: 'The offset (in pixels) into which to begin drawing with the stroke dash array.'
},
orient: {
type: 'string',
default: undefined,
description: 'The orientation of a non-stacked bar, area, and line charts.' +
'The value is either horizontal (default) or vertical.' +
'For area, this property determines the orient property of the Vega output.' +
'For line, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified.' +
'For stacked charts, this is always determined by the orientation of the stack; ' +
'therefore explicitly specified value will be ignored.'
},
interpolate: {
type: 'string',
default: undefined,
description: 'The line interpolation method to use. One of linear, step-before, step-after, basis, basis-open, basis-closed, bundle, cardinal, cardinal-open, cardinal-closed, monotone.'
},
tension: {
type: 'number',
default: undefined,
description: 'Depending on the interpolation type, sets the tension parameter.'
},
thickness: {
type: 'number',
default: 1,
description: 'Thickness of the tick mark.'
},
align: {
type: 'string',
default: undefined,
enum: ['left', 'right', 'center'],
description: 'The horizontal alignment of the text. One of left, right, center.'
},
angle: {
type: 'number',
default: undefined,
description: 'The rotation angle of the text, in degrees.'
},
baseline: {
type: 'string',
default: 'middle',
enum: ['top', 'middle', 'bottom'],
description: 'The vertical alignment of the text. One of top, middle, bottom.'
},
dx: {
type: 'number',
default: undefined,
description: 'The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.'
},
dy: {
type: 'number',
default: undefined,
description: 'The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.'
},
font: {
type: 'string',
default: undefined,
role: 'font',
description: 'The typeface to set the text in (e.g., Helvetica Neue).'
},
fontStyle: {
type: 'string',
default: undefined,
enum: ['normal', 'italic'],
description: 'The font style (e.g., italic).'
},
fontWeight: {
type: 'string',
enum: ['normal', 'bold'],
default: undefined,
description: 'The font weight (e.g., bold).'
},
radius: {
type: 'number',
default: undefined,
description: 'Polar coordinate radial offset, in pixels, of the text label from the origin determined by the x and y properties.'
},
theta: {
type: 'number',
default: undefined,
description: 'Polar coordinate angle, in radians, of the text label from the origin determined by the x and y properties. Values for theta follow the same convention of arc mark startAngle and endAngle properties: angles are measured in radians, with 0 indicating "north".'
},
format: {
type: 'string',
default: undefined,
description: 'The formatting pattern for text value. If not defined, this will be determined automatically. '
},
shortTimeLabels: {
type: 'boolean',
default: false,
description: 'Whether month names and weekday names should be abbreviated.'
},
applyColorToBackground: {
type: 'boolean',
default: false,
description: 'Apply color field to background color instead of the text.'
}
}
};
},{}],37:[function(require,module,exports){
exports.sceneConfig = {
type: 'object',
properties: {
fill: {
type: 'string',
role: 'color'
},
fillOpacity: {
type: 'number',
},
stroke: {
type: 'string',
role: 'color',
},
strokeWidth: {
type: 'integer'
},
strokeOpacity: {
type: 'number'
},
strokeDash: {
type: 'array'
},
strokeDashOffset: {
type: 'integer',
description: 'The offset (in pixels) into which to begin drawing with the stroke dash array.'
}
}
};
},{}],38:[function(require,module,exports){
var config_stack_schema_1 = require('./config.stack.schema');
var config_cell_schema_1 = require('./config.cell.schema');
var config_marks_schema_1 = require('./config.marks.schema');
var config_scene_schema_1 = require('./config.scene.schema');
exports.config = {
type: 'object',
properties: {
viewport: {
type: 'array',
items: {
type: 'integer'
},
default: undefined,
description: 'The width and height of the on-screen viewport, in pixels. If necessary, clipping and scrolling will be applied.'
},
background: {
type: 'string',
role: 'color',
default: undefined,
description: 'CSS color property to use as background of visualization. Default is `"transparent"`.'
},
numberFormat: {
type: 'string',
default: 's',
description: 'D3 Number format for axis labels and text tables. For example "s" for SI units.'
},
timeFormat: {
type: 'string',
default: '%Y-%m-%d',
description: 'Default datetime format for axis and legend labels. The format can be set directly on each axis and legend.'
},
textCellWidth: {
type: 'integer',
default: 90,
minimum: 0
},
stack: config_stack_schema_1.stackConfig,
cell: config_cell_schema_1.cellConfig,
mark: config_marks_schema_1.markConfig,
scene: config_scene_schema_1.sceneConfig
}
};
},{"./config.cell.schema":35,"./config.marks.schema":36,"./config.scene.schema":37,"./config.stack.schema":39}],39:[function(require,module,exports){
exports.stackConfig = {
type: ['boolean', 'object'],
default: {},
description: 'Enable stacking (for bar and area marks only).',
properties: {
sort: {
oneOf: [{
type: 'string',
enum: ['ascending', 'descending']
}, {
type: 'array',
items: { type: 'string' },
}],
description: 'Order of the stack. ' +
'This can be either a string (either "descending" or "ascending")' +
'or a list of fields to determine the order of stack layers.' +
'By default, stack uses descending order.'
},
offset: {
type: 'string',
enum: ['zero', 'center', 'normalize']
}
}
};
},{}],40:[function(require,module,exports){
exports.data = {
type: 'object',
properties: {
formatType: {
type: 'string',
enum: ['json', 'csv', 'tsv'],
default: 'json'
},
url: {
type: 'string',
default: undefined
},
values: {
type: 'array',
default: undefined,
description: 'Pass array of objects instead of a url to a file.',
items: {
type: 'object',
additionalProperties: true
}
}
}
};
},{}],41:[function(require,module,exports){
var schemautil_1 = require('./schemautil');
var util_1 = require('../util');
var axis_schema_1 = require('./axis.schema');
var fielddef_schema_1 = require('./fielddef.schema');
var legend_schema_1 = require('./legend.schema');
var sort_schema_1 = require('./sort.schema');
var x = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.typicalField), {
required: ['field', 'type'],
properties: {
scale: {
properties: {
padding: { default: 1 },
bandWidth: { default: 21 }
}
},
axis: axis_schema_1.axis,
sort: sort_schema_1.sort
}
});
var y = util_1.duplicate(x);
var row = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.facetField));
var column = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.facetField));
var size = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.typicalField), {
properties: {
legend: legend_schema_1.legend,
sort: sort_schema_1.sort,
value: {
type: 'integer',
default: undefined,
minimum: 0,
description: 'Size of marks. By default, this is 30 for point, square, and circle, and 10 for text.'
}
}
});
var color = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.typicalField), {
properties: {
legend: legend_schema_1.legend,
sort: sort_schema_1.sort,
value: {
type: 'string',
role: 'color',
default: '#4682b4',
description: 'Color to be used for marks.'
},
scale: {
type: 'object',
properties: {
quantitativeRange: {
type: 'array',
default: ['#AFC6A3', '#09622A'],
description: 'Color range to encode quantitative variables.',
minItems: 2,
maxItems: 2,
items: {
type: 'string',
role: 'color'
}
}
}
}
}
});
var shape = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.onlyOrdinalField), {
properties: {
legend: legend_schema_1.legend,
sort: sort_schema_1.sort,
value: {
type: 'string',
enum: ['circle', 'square', 'cross', 'diamond', 'triangle-up', 'triangle-down'],
default: 'circle',
description: 'Mark to be used.'
}
}
});
var path = {
default: undefined,
oneOf: [util_1.duplicate(fielddef_schema_1.fieldDef), {
type: 'array',
items: util_1.duplicate(fielddef_schema_1.fieldDef)
}]
};
var detail = {
default: undefined,
oneOf: [util_1.duplicate(fielddef_schema_1.fieldDef), {
type: 'array',
items: util_1.duplicate(fielddef_schema_1.fieldDef)
}]
};
var text = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.typicalField), {
properties: {
sort: sort_schema_1.sort,
value: {
type: 'string',
default: 'Abc'
}
}
});
var label = schemautil_1.mergeDeep(util_1.duplicate(fielddef_schema_1.typicalField), {
properies: {
sort: sort_schema_1.sort
}
});
exports.encoding = {
type: 'object',
properties: {
x: x,
y: y,
row: row,
column: column,
size: size,
color: color,
shape: shape,
path: path,
text: text,
detail: detail,
label: label
}
};
},{"../util":54,"./axis.schema":33,"./fielddef.schema":42,"./legend.schema":43,"./schemautil":47,"./sort.schema":48}],42:[function(require,module,exports){
var axis_schema_1 = require('./axis.schema');
var bin_schema_1 = require('./bin.schema');
var scale_schema_1 = require('./scale.schema');
var sort_schema_1 = require('./sort.schema');
var aggregate_1 = require('../aggregate');
var util_1 = require('../util');
var schemautil_1 = require('./schemautil');
var timeunit_1 = require('../timeunit');
var type_1 = require('../type');
exports.fieldDef = {
type: 'object',
properties: {
field: {
type: 'string'
},
type: {
type: 'string',
enum: [type_1.NOMINAL, type_1.ORDINAL, type_1.QUANTITATIVE, type_1.TEMPORAL]
},
timeUnit: {
type: 'string',
enum: timeunit_1.TIMEUNITS,
supportedTypes: util_1.toMap([type_1.TEMPORAL])
},
bin: bin_schema_1.bin,
}
};
exports.aggregate = {
type: 'string',
enum: aggregate_1.AGGREGATE_OPS,
supportedEnums: {
quantitative: aggregate_1.AGGREGATE_OPS,
ordinal: ['median', 'min', 'max'],
nominal: [],
temporal: ['mean', 'median', 'min', 'max'],
'': ['count']
},
supportedTypes: util_1.toMap([type_1.QUANTITATIVE, type_1.NOMINAL, type_1.ORDINAL, type_1.TEMPORAL, ''])
};
exports.typicalField = schemautil_1.mergeDeep(util_1.duplicate(exports.fieldDef), {
properties: {
aggregate: exports.aggregate,
scale: scale_schema_1.typicalScale
}
});
exports.onlyOrdinalField = schemautil_1.mergeDeep(util_1.duplicate(exports.fieldDef), {
properties: {
scale: scale_schema_1.ordinalOnlyScale
}
});
exports.facetField = schemautil_1.mergeDeep(util_1.duplicate(exports.onlyOrdinalField), {
required: ['field', 'type'],
properties: {
axis: axis_schema_1.axis,
sort: sort_schema_1.sort
}
});
},{"../aggregate":7,"../timeunit":52,"../type":53,"../util":54,"./axis.schema":33,"./bin.schema":34,"./scale.schema":45,"./schemautil":47,"./sort.schema":48}],43:[function(require,module,exports){
exports.legend = {
default: true,
description: 'Properties of a legend or boolean flag for determining whether to show it.',
oneOf: [{
type: 'object',
properties: {
orient: {
type: 'string',
default: undefined,
description: 'The orientation of the legend. One of "left" or "right". This determines how the legend is positioned within the scene. The default is "right".'
},
title: {
type: 'string',
default: undefined,
description: 'A title for the legend. (Shows field name and its function by default.)'
},
format: {
type: 'string',
default: undefined,
description: 'An optional formatting pattern for legend labels. Vega uses D3\'s format pattern.'
},
values: {
type: 'array',
default: undefined,
description: 'Explicitly set the visible legend values.'
},
properties: {
type: 'object',
default: undefined,
description: 'Optional mark property definitions for custom legend styling. '
},
shortTimeLabels: {
type: 'boolean',
default: false,
description: 'Whether month names and weekday names should be abbreviated.'
}
},
}, {
type: 'boolean'
}]
};
},{}],44:[function(require,module,exports){
exports.mark = {
type: 'string',
enum: ['point', 'tick', 'bar', 'line', 'area', 'circle', 'square', 'text']
};
},{}],45:[function(require,module,exports){
var util_1 = require('../util');
var schemautil_1 = require('./schemautil');
var type_1 = require('../type');
var scale = {
type: 'object',
properties: {
type: {
type: 'string',
enum: ['linear', 'log', 'pow', 'sqrt', 'quantile', 'ordinal'],
default: undefined,
supportedTypes: util_1.toMap([type_1.QUANTITATIVE])
},
domain: {
default: undefined,
type: ['array', 'object'],
description: 'The domain of the scale, representing the set of data values. For quantitative data, this can take the form of a two-element array with minimum and maximum values. For ordinal/categorical data, this may be an array of valid input values. The domain may also be specified by a reference to a data source.'
},
range: {
default: undefined,
type: ['array', 'object', 'string'],
description: 'The range of the scale, representing the set of visual values. For numeric values, the range can take the form of a two-element array with minimum and maximum values. For ordinal or quantized data, the range may by an array of desired output values, which are mapped to elements in the specified domain. For ordinal scales only, the range can be defined using a DataRef: the range values are then drawn dynamically from a backing data set.'
},
round: {
default: undefined,
type: 'boolean',
description: 'If true, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.'
}
}
};
var ordinalScaleMixin = {
properties: {
bandWidth: {
type: 'integer',
minimum: 0,
default: undefined
},
outerPadding: {
type: 'number',
default: undefined
},
padding: {
type: 'number',
default: undefined,
description: 'Applies spacing among ordinal elements in the scale range. The actual effect depends on how the scale is configured. If the __points__ parameter is `true`, the padding value is interpreted as a multiple of the spacing between points. A reasonable value is 1.0, such that the first and last point will be offset from the minimum and maximum value by half the distance between points. Otherwise, padding is typically in the range [0, 1] and corresponds to the fraction of space in the range interval to allocate to padding. A value of 0.5 means that the range band width will be equal to the padding width. For more, see the [D3 ordinal scale documentation](https://github.com/mbostock/d3/wiki/Ordinal-Scales).'
}
}
};
var typicalScaleMixin = {
properties: {
clamp: {
type: 'boolean',
default: true,
description: 'If true, values that exceed the data domain are clamped to either the minimum or maximum range value'
},
nice: {
default: undefined,
oneOf: [
{
type: 'boolean',
description: 'If true, modifies the scale domain to use a more human-friendly number range (e.g., 7 instead of 6.96).'
}, {
type: 'string',
enum: ['second', 'minute', 'hour', 'day', 'week', 'month', 'year'],
description: 'If specified, modifies the scale domain to use a more human-friendly value range. For time and utc scale types only, the nice value should be a string indicating the desired time interval; legal values are "second", "minute", "hour", "day", "week", "month", or "year".'
}
],
supportedTypes: util_1.toMap([type_1.QUANTITATIVE, type_1.TEMPORAL]),
description: ''
},
exponent: {
type: 'number',
default: undefined,
description: 'Sets the exponent of the scale transformation. For pow scale types only, otherwise ignored.'
},
zero: {
type: 'boolean',
description: 'If true, ensures that a zero baseline value is included in the scale domain. This option is ignored for non-quantitative scales.',
default: undefined,
supportedTypes: util_1.toMap([type_1.QUANTITATIVE, type_1.TEMPORAL])
},
useRawDomain: {
type: 'boolean',
default: false,
description: 'Uses the source data range as scale domain instead of ' +
'aggregated data for aggregate axis. ' +
'This option does not work with sum or count aggregate' +
'as they might have a substantially larger scale range.'
}
}
};
exports.ordinalOnlyScale = schemautil_1.mergeDeep(util_1.duplicate(scale), ordinalScaleMixin);
exports.typicalScale = schemautil_1.mergeDeep(util_1.duplicate(scale), ordinalScaleMixin, typicalScaleMixin);
},{"../type":53,"../util":54,"./schemautil":47}],46:[function(require,module,exports){
var schemaUtil = require('./schemautil');
var mark_schema_1 = require('./mark.schema');
var config_schema_1 = require('./config.schema');
var data_schema_1 = require('./data.schema');
var encoding_schema_1 = require('./encoding.schema');
var transform_schema_1 = require('./transform.schema');
var fielddef_schema_1 = require('./fielddef.schema');
exports.aggregate = fielddef_schema_1.aggregate;
exports.util = schemaUtil;
exports.schema = {
$schema: 'http://json-schema.org/draft-04/schema#',
description: 'Schema for Vega-Lite specification',
type: 'object',
required: ['mark', 'encoding'],
properties: {
name: {
type: 'string',
description: 'A name for the specification. The name is used to annotate marks, scale names, and more.'
},
description: {
type: 'string'
},
data: data_schema_1.data,
transform: transform_schema_1.transform,
mark: mark_schema_1.mark,
encoding: encoding_schema_1.encoding,
config: config_schema_1.config
}
};
function instantiate() {
return schemaUtil.instantiate(exports.schema);
}
exports.instantiate = instantiate;
;
},{"./config.schema":38,"./data.schema":40,"./encoding.schema":41,"./fielddef.schema":42,"./mark.schema":44,"./schemautil":47,"./transform.schema":49}],47:[function(require,module,exports){
var util = require('../util');
function isEmpty(obj) {
return Object.keys(obj).length === 0;
}
;
function extend(instance, schema) {
return mergeDeep(instantiate(schema), instance);
}
exports.extend = extend;
;
function instantiate(schema) {
var val;
if (schema === undefined) {
return undefined;
}
else if ('default' in schema) {
val = schema.default;
return util.isObject(val) ? util.duplicate(val) : val;
}
else if (schema.type === 'object') {
var instance = {};
for (var name in schema.properties) {
if (schema.properties.hasOwnProperty(name)) {
val = instantiate(schema.properties[name]);
if (val !== undefined) {
instance[name] = val;
}
}
}
return instance;
}
else if (schema.type === 'array') {
return undefined;
}
return undefined;
}
exports.instantiate = instantiate;
;
function subtract(instance, defaults) {
var changes = {};
for (var prop in instance) {
if (instance.hasOwnProperty(prop)) {
var def = defaults[prop];
var ins = instance[prop];
if (!defaults || def !== ins) {
if (typeof ins === 'object' && !util.isArray(ins) && def) {
var c = subtract(ins, def);
if (!isEmpty(c)) {
changes[prop] = c;
}
}
else if (util.isArray(ins)) {
if (util.isArray(def)) {
if (ins.length === def.length) {
var equal = true;
for (var i = 0; i < ins.length; i++) {
if (ins[i] !== def[i]) {
equal = false;
break;
}
}
if (equal) {
continue;
}
}
}
changes[prop] = ins;
}
else {
changes[prop] = ins;
}
}
}
}
return changes;
}
exports.subtract = subtract;
;
function mergeDeep(dest) {
var src = [];
for (var _i = 1; _i < arguments.length; _i++) {
src[_i - 1] = arguments[_i];
}
for (var i = 0; i < src.length; i++) {
dest = deepMerge_(dest, src[i]);
}
return dest;
}
exports.mergeDeep = mergeDeep;
;
function deepMerge_(dest, src) {
if (typeof src !== 'object' || src === null) {
return dest;
}
for (var p in src) {
if (!src.hasOwnProperty(p)) {
continue;
}
if (src[p] === undefined) {
continue;
}
if (typeof src[p] !== 'object' || src[p] === null) {
dest[p] = src[p];
}
else if (typeof dest[p] !== 'object' || dest[p] === null) {
dest[p] = mergeDeep(src[p].constructor === Array ? [] : {}, src[p]);
}
else {
mergeDeep(dest[p], src[p]);
}
}
return dest;
}
},{"../util":54}],48:[function(require,module,exports){
var aggregate_1 = require('../aggregate');
var type_1 = require('../type');
var util_1 = require('../util');
exports.sort = {
default: 'ascending',
supportedTypes: util_1.toMap([type_1.QUANTITATIVE, type_1.ORDINAL]),
oneOf: [
{
type: 'string',
enum: ['ascending', 'descending', 'unsorted']
},
{
type: 'object',
required: ['field', 'op'],
properties: {
field: {
type: 'string',
description: 'The field name to aggregate over.'
},
op: {
type: 'string',
enum: aggregate_1.AGGREGATE_OPS,
description: 'The field name to aggregate over.'
},
order: {
type: 'string',
enum: ['ascending', 'descending']
}
}
}
]
};
},{"../aggregate":7,"../type":53,"../util":54}],49:[function(require,module,exports){
exports.transform = {
type: 'object',
properties: {
filterNull: {
type: 'boolean',
default: undefined,
description: 'Filter null values from the data. If set to true, all rows with null values are filtered. If false, no rows are filtered. Set the property to undefined to filter only quantitative and temporal fields.'
},
filter: {
type: 'string',
default: undefined,
description: 'A string containing the filter Vega expression. Use `datum` to refer to the current data object.'
},
calculate: {
type: 'array',
default: undefined,
description: 'Calculate new field(s) using the provided expresssion(s). Calculation are applied before filter.',
items: {
type: 'object',
properties: {
field: {
type: 'string',
description: 'The field in which to store the computed formula value.'
},
expr: {
type: 'string',
description: 'A string containing an expression for the formula. Use the variable `datum` to to refer to the current data object.'
}
}
}
}
}
};
},{}],50:[function(require,module,exports){
var aggregate_1 = require('./aggregate');
var timeunit_1 = require('./timeunit');
var type_1 = require('./type');
var vlEncoding = require('./encoding');
var mark_1 = require('./mark');
exports.DELIM = '|';
exports.ASSIGN = '=';
exports.TYPE = ',';
exports.FUNC = '_';
function shorten(spec) {
return 'mark' + exports.ASSIGN + spec.mark +
exports.DELIM + shortenEncoding(spec.encoding);
}
exports.shorten = shorten;
function parse(shorthand, data, config) {
var split = shorthand.split(exports.DELIM), mark = split.shift().split(exports.ASSIGN)[1].trim(), encoding = parseEncoding(split.join(exports.DELIM));
var spec = {
mark: mark_1.Mark[mark],
encoding: encoding
};
if (data !== undefined) {
spec.data = data;
}
if (config !== undefined) {
spec.config = config;
}
return spec;
}
exports.parse = parse;
function shortenEncoding(encoding) {
return vlEncoding.map(encoding, function (fieldDef, channel) {
return channel + exports.ASSIGN + shortenFieldDef(fieldDef);
}).join(exports.DELIM);
}
exports.shortenEncoding = shortenEncoding;
function parseEncoding(encodingShorthand) {
return encodingShorthand.split(exports.DELIM).reduce(function (m, e) {
var split = e.split(exports.ASSIGN), enctype = split[0].trim(), fieldDefShorthand = split[1];
m[enctype] = parseFieldDef(fieldDefShorthand);
return m;
}, {});
}
exports.parseEncoding = parseEncoding;
function shortenFieldDef(fieldDef) {
return (fieldDef.aggregate ? fieldDef.aggregate + exports.FUNC : '') +
(fieldDef.timeUnit ? fieldDef.timeUnit + exports.FUNC : '') +
(fieldDef.bin ? 'bin' + exports.FUNC : '') +
(fieldDef.field || '') + exports.TYPE + type_1.SHORT_TYPE[fieldDef.type];
}
exports.shortenFieldDef = shortenFieldDef;
function shortenFieldDefs(fieldDefs, delim) {
if (delim === void 0) { delim = exports.DELIM; }
return fieldDefs.map(shortenFieldDef).join(delim);
}
exports.shortenFieldDefs = shortenFieldDefs;
function parseFieldDef(fieldDefShorthand) {
var split = fieldDefShorthand.split(exports.TYPE);
var fieldDef = {
field: split[0].trim(),
type: type_1.TYPE_FROM_SHORT_TYPE[split[1].trim()]
};
for (var i = 0; i < aggregate_1.AGGREGATE_OPS.length; i++) {
var a = aggregate_1.AGGREGATE_OPS[i];
if (fieldDef.field.indexOf(a + '_') === 0) {
fieldDef.field = fieldDef.field.substr(a.length + 1);
if (a === 'count' && fieldDef.field.length === 0) {
fieldDef.field = '*';
}
fieldDef.aggregate = a;
break;
}
}
for (var i = 0; i < timeunit_1.TIMEUNITS.length; i++) {
var tu = timeunit_1.TIMEUNITS[i];
if (fieldDef.field && fieldDef.field.indexOf(tu + '_') === 0) {
fieldDef.field = fieldDef.field.substr(fieldDef.field.length + 1);
fieldDef.timeUnit = tu;
break;
}
}
if (fieldDef.field && fieldDef.field.indexOf('bin_') === 0) {
fieldDef.field = fieldDef.field.substr(4);
fieldDef.bin = true;
}
return fieldDef;
}
exports.parseFieldDef = parseFieldDef;
},{"./aggregate":7,"./encoding":30,"./mark":32,"./timeunit":52,"./type":53}],51:[function(require,module,exports){
var Model_1 = require('./compile/Model');
var channel_1 = require('./channel');
var vlEncoding = require('./encoding');
var mark_1 = require('./mark');
var util_1 = require('./util');
function alwaysNoOcclusion(spec) {
return vlEncoding.isAggregate(spec.encoding);
}
exports.alwaysNoOcclusion = alwaysNoOcclusion;
function fieldDefs(spec) {
return vlEncoding.fieldDefs(spec.encoding);
}
exports.fieldDefs = fieldDefs;
;
function getCleanSpec(spec) {
return new Model_1.Model(spec).toSpec(true);
}
exports.getCleanSpec = getCleanSpec;
function isStack(spec) {
return (vlEncoding.has(spec.encoding, channel_1.COLOR) || vlEncoding.has(spec.encoding, channel_1.SHAPE)) &&
(spec.mark === mark_1.BAR || spec.mark === mark_1.AREA) &&
(!spec.config || !spec.config.stack !== false) &&
vlEncoding.isAggregate(spec.encoding);
}
exports.isStack = isStack;
function transpose(spec) {
var oldenc = spec.encoding, encoding = util_1.duplicate(spec.encoding);
encoding.x = oldenc.y;
encoding.y = oldenc.x;
encoding.row = oldenc.column;
encoding.column = oldenc.row;
spec.encoding = encoding;
return spec;
}
exports.transpose = transpose;
},{"./channel":9,"./compile/Model":10,"./encoding":30,"./mark":32,"./util":54}],52:[function(require,module,exports){
exports.TIMEUNITS = [
'year', 'month', 'day', 'date', 'hours', 'minutes', 'seconds', 'milliseconds',
'yearmonth', 'yearmonthday', 'yearmonthdate', 'yearday', 'yeardate',
'yearmonthdayhours', 'yearmonthdayhoursminutes', 'hoursminutes',
'hoursminutesseconds', 'minutesseconds', 'secondsmilliseconds'
];
},{}],53:[function(require,module,exports){
(function (Type) {
Type[Type["QUANTITATIVE"] = 'quantitative'] = "QUANTITATIVE";
Type[Type["ORDINAL"] = 'ordinal'] = "ORDINAL";
Type[Type["TEMPORAL"] = 'temporal'] = "TEMPORAL";
Type[Type["NOMINAL"] = 'nominal'] = "NOMINAL";
})(exports.Type || (exports.Type = {}));
var Type = exports.Type;
exports.QUANTITATIVE = Type.QUANTITATIVE;
exports.ORDINAL = Type.ORDINAL;
exports.TEMPORAL = Type.TEMPORAL;
exports.NOMINAL = Type.NOMINAL;
exports.SHORT_TYPE = {
quantitative: 'Q',
temporal: 'T',
nominal: 'N',
ordinal: 'O'
};
exports.TYPE_FROM_SHORT_TYPE = {
Q: exports.QUANTITATIVE,
T: exports.TEMPORAL,
O: exports.ORDINAL,
N: exports.NOMINAL
};
function getFullName(type) {
var typeString = type;
return exports.TYPE_FROM_SHORT_TYPE[typeString.toUpperCase()] ||
typeString.toLowerCase();
}
exports.getFullName = getFullName;
},{}],54:[function(require,module,exports){
var util_1 = require('datalib/src/util');
exports.keys = util_1.keys;
exports.extend = util_1.extend;
exports.duplicate = util_1.duplicate;
exports.isArray = util_1.isArray;
exports.vals = util_1.vals;
exports.truncate = util_1.truncate;
exports.toMap = util_1.toMap;
exports.isObject = util_1.isObject;
var generate_1 = require('datalib/src/generate');
exports.range = generate_1.range;
function contains(array, item) {
return array.indexOf(item) > -1;
}
exports.contains = contains;
function forEach(obj, f, thisArg) {
if (obj.forEach) {
obj.forEach.call(thisArg, f);
}
else {
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
f.call(thisArg, obj[k], k, obj);
}
}
}
}
exports.forEach = forEach;
function reduce(obj, f, init, thisArg) {
if (obj.reduce) {
return obj.reduce.call(thisArg, f, init);
}
else {
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
init = f.call(thisArg, init, obj[k], k, obj);
}
}
return init;
}
}
exports.reduce = reduce;
function map(obj, f, thisArg) {
if (obj.map) {
return obj.map.call(thisArg, f);
}
else {
var output = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
output.push(f.call(thisArg, obj[k], k, obj));
}
}
return output;
}
}
exports.map = map;
function any(arr, f) {
var i = 0;
for (var k = 0; k < arr.length; k++) {
if (f(arr[k], k, i++)) {
return true;
}
}
return false;
}
exports.any = any;
function all(arr, f) {
var i = 0;
for (var k = 0; k < arr.length; k++) {
if (!f(arr[k], k, i++)) {
return false;
}
}
return true;
}
exports.all = all;
var dlBin = require('datalib/src/bins/bins');
function getbins(stats, maxbins) {
return dlBin({
min: stats.min,
max: stats.max,
maxbins: maxbins
});
}
exports.getbins = getbins;
function error(message) {
console.error('[VL Error]', message);
}
exports.error = error;
},{"datalib/src/bins/bins":3,"datalib/src/generate":4,"datalib/src/util":6}],55:[function(require,module,exports){
var util_1 = require('./util');
var mark_1 = require('./mark');
exports.DEFAULT_REQUIRED_CHANNEL_MAP = {
text: ['text'],
line: ['x', 'y'],
area: ['x', 'y']
};
exports.DEFAULT_SUPPORTED_CHANNEL_TYPE = {
bar: util_1.toMap(['row', 'column', 'x', 'y', 'size', 'color', 'detail']),
line: util_1.toMap(['row', 'column', 'x', 'y', 'color', 'detail']),
area: util_1.toMap(['row', 'column', 'x', 'y', 'color', 'detail']),
tick: util_1.toMap(['row', 'column', 'x', 'y', 'color', 'detail']),
circle: util_1.toMap(['row', 'column', 'x', 'y', 'color', 'size', 'detail']),
square: util_1.toMap(['row', 'column', 'x', 'y', 'color', 'size', 'detail']),
point: util_1.toMap(['row', 'column', 'x', 'y', 'color', 'size', 'detail', 'shape']),
text: util_1.toMap(['row', 'column', 'size', 'color', 'text'])
};
function getEncodingMappingError(spec, requiredChannelMap, supportedChannelMap) {
if (requiredChannelMap === void 0) { requiredChannelMap = exports.DEFAULT_REQUIRED_CHANNEL_MAP; }
if (supportedChannelMap === void 0) { supportedChannelMap = exports.DEFAULT_SUPPORTED_CHANNEL_TYPE; }
var mark = spec.mark;
var encoding = spec.encoding;
var requiredChannels = requiredChannelMap[mark];
var supportedChannels = supportedChannelMap[mark];
for (var i in requiredChannels) {
if (!(requiredChannels[i] in encoding)) {
return 'Missing encoding channel \"' + requiredChannels[i] +
'\" for mark \"' + mark + '\"';
}
}
for (var channel in encoding) {
if (!supportedChannels[channel]) {
return 'Encoding channel \"' + channel +
'\" is not supported by mark type \"' + mark + '\"';
}
}
if (mark === mark_1.BAR && !encoding.x && !encoding.y) {
return 'Missing both x and y for bar';
}
return null;
}
exports.getEncodingMappingError = getEncodingMappingError;
},{"./mark":32,"./util":54}],56:[function(require,module,exports){
var vlBin = require('./bin');
var vlChannel = require('./channel');
var vlData = require('./data');
var vlEncoding = require('./encoding');
var vlFieldDef = require('./fielddef');
var vlCompile = require('./compile/compile');
var vlSchema = require('./schema/schema');
var vlShorthand = require('./shorthand');
var vlSpec = require('./spec');
var vlTimeUnit = require('./timeunit');
var vlType = require('./type');
var vlValidate = require('./validate');
var vlUtil = require('./util');
exports.bin = vlBin;
exports.channel = vlChannel;
exports.compile = vlCompile.compile;
exports.data = vlData;
exports.encoding = vlEncoding;
exports.fieldDef = vlFieldDef;
exports.schema = vlSchema;
exports.shorthand = vlShorthand;
exports.spec = vlSpec;
exports.timeUnit = vlTimeUnit;
exports.type = vlType;
exports.util = vlUtil;
exports.validate = vlValidate;
exports.version = '0.9.3';
},{"./bin":8,"./channel":9,"./compile/compile":12,"./data":29,"./encoding":30,"./fielddef":31,"./schema/schema":46,"./shorthand":50,"./spec":51,"./timeunit":52,"./type":53,"./util":54,"./validate":55}]},{},[56])(56)
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvYnJvd3Nlci1yZXNvbHZlL2VtcHR5LmpzIiwibm9kZV9tb2R1bGVzL2QzLXRpbWUvYnVpbGQvZDMtdGltZS5qcyIsIm5vZGVfbW9kdWxlcy9kYXRhbGliL3NyYy9iaW5zL2JpbnMuanMiLCJub2RlX21vZHVsZXMvZGF0YWxpYi9zcmMvZ2VuZXJhdGUuanMiLCJub2RlX21vZHVsZXMvZGF0YWxpYi9zcmMvdGltZS5qcyIsIm5vZGVfbW9kdWxlcy9kYXRhbGliL3NyYy91dGlsLmpzIiwic3JjL2FnZ3JlZ2F0ZS50cyIsInNyYy9iaW4udHMiLCJzcmMvY2hhbm5lbC50cyIsInNyYy9jb21waWxlL01vZGVsLnRzIiwic3JjL2NvbXBpbGUvYXhpcy50cyIsInNyYy9jb21waWxlL2NvbXBpbGUudHMiLCJzcmMvY29tcGlsZS9jb25maWcudHMiLCJzcmMvY29tcGlsZS9kYXRhLnRzIiwic3JjL2NvbXBpbGUvZmFjZXQudHMiLCJzcmMvY29tcGlsZS9sYXlvdXQudHMiLCJzcmMvY29tcGlsZS9sZWdlbmQudHMiLCJzcmMvY29tcGlsZS9tYXJrLWFyZWEudHMiLCJzcmMvY29tcGlsZS9tYXJrLWJhci50cyIsInNyYy9jb21waWxlL21hcmstbGluZS50cyIsInNyYy9jb21waWxlL21hcmstcG9pbnQudHMiLCJzcmMvY29tcGlsZS9tYXJrLXRleHQudHMiLCJzcmMvY29tcGlsZS9tYXJrLXRpY2sudHMiLCJzcmMvY29tcGlsZS9tYXJrLnRzIiwic3JjL2NvbXBpbGUvc2NhbGUudHMiLCJzcmMvY29tcGlsZS9zdGFjay50cyIsInNyYy9jb21waWxlL3RpbWUudHMiLCJzcmMvY29tc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b3BlcnR5XSA9IHNwZWMubWFyayAhPT0gUE9JTlQ7XG4gICAgICAgICAgIH1cbiAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICBjYXNlICdvcGFjaXR5JzpcbiAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgY29udGFpbnMoW1BPSU5ULCBUSUNLLCBDSVJDTEUsIFNRVUFSRV0sIHNwZWMubWFyaykpIHtcbiAgICAgICAgICAgICAvLyBwb2ludC1iYXNlZCBtYXJrcyBhbmQgYmFyXG4gICAgICAgICAgICAgaWYgKCFpc0FnZ3JlZ2F0ZShzcGVjLmVuY29kaW5nKSB8fCBoYXMoc3BlYy5lbmNvZGluZywgREVUQUlMKSkge1xuICAgICAgICAgICAgICAgY2ZnW3Byb3BlcnR5XSA9IDAuNztcbiAgICAgICAgICAgICB9XG4gICAgICAgICAgIH1cbiAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICBjYXNlICdvcmllbnQnOlxuICAgICAgICAgICBpZiAoc3RhY2spIHtcbiAgICAgICAgICAgICAvLyBGb3Igc3RhY2tlZCBjaGFydCwgZXhwbGljaXRseSBzcGVjaWZpZWQgb3JpZW50IHByb3BlcnR5IHdpbGwgYmUgaWdub3JlZC5cbiAgICAgICAgICAgICBjZmdbcHJvcGVydHldID0gc3RhY2suZ3JvdXBieUNoYW5uZWwgPT09IFkgPyAnaG9yaXpvbnRhbCcgOiB1bmRlZmluZWQ7XG4gICAgICAgICAgIH1cbiAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICBjZmdbcHJvcGVydHldID0gaXNNZWFzdXJlKHNwZWMuZW5jb2RpbmdbWF0pICYmICAhaXNNZWFzdXJlKHNwZWMuZW5jb2RpbmdbWV0pID9cbiAgICAgICAgICAgICAgIC8vIGhvcml6b250YWwgaWYgWCBpcyBtZWFzdXJlIGFuZCBZIGlzIGRpbWVuc2lvbiBvciB1bnNwZWNpZmllZFxuICAgICA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ICAgaWYgKGJpbikge1xuICAgICAgICBsZXQgYmluVHJhbnMgPSBleHRlbmQoe1xuICAgICAgICAgICAgdHlwZTogJ2JpbicsXG4gICAgICAgICAgICBmaWVsZDogZmllbGREZWYuZmllbGQsXG4gICAgICAgICAgICBvdXRwdXQ6IHtcbiAgICAgICAgICAgICAgc3RhcnQ6IGZpZWxkKGZpZWxkRGVmLCB7YmluU3VmZml4OiAnX3N0YXJ0J30pLFxuICAgICAgICAgICAgICBtaWQ6IGZpZWxkKGZpZWxkRGVmLCB7YmluU3VmZml4OiAnX21pZCd9KSxcbiAgICAgICAgICAgICAgZW5kOiBmaWVsZChmaWVsZERlZiwge2JpblN1ZmZpeDogJ19lbmQnfSlcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIC8vIGlmIGJpbiBpcyBhbiBvYmplY3QsIGxvYWQgcGFyYW1ldGVyIGhlcmUhXG4gICAgICAgICAgdHlwZW9mIGJpbiA9PT0gJ2Jvb2xlYW4nID8ge30gOiBiaW5cbiAgICAgICAgKTtcblxuICAgICAgICBpZiAoIWJpblRyYW5zLm1heGJpbnMgJiYgIWJpblRyYW5zLnN0ZXApIHtcbiAgICAgICAgICAvLyBpZiBib3RoIG1heGJpbnMgYW5kIHN0ZXAgYXJlIHNwZWNpZmllZCwgbmVlZCB0byBhdXRvbWF0aWNhbGx5IGRldGVybWluZSBiaW5cbiAgICAgICAgICBiaW5UcmFucy5tYXhiaW5zID0gYXV0b01heEJpbnMoY2hhbm5lbCk7XG4gICAgICAgIH1cblxuICAgICAgICB0cmFuc2Zvcm0ucHVzaChiaW5UcmFucyk7XG4gICAgICAgIGlmIChzY2FsZVR5cGUoZmllbGREZWYsIGNoYW5uZWwsIG1vZGVsLm1hcmsoKSkgPT09ICdvcmRpbmFsJykge1xuICAgICAgICAgIHRyYW5zZm9ybS5wdXNoKHtcbiAgICAgICAgICAgIHR5cGU6ICdmb3JtdWxhJyxcbiAgICAgICAgICAgIGZpZWxkOi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7XG5cbiAgICAgIGlmICgheUhhc0RvbWFpbikge1xuICAgICAgICBzdW1tYXJpemUucHVzaCh7XG4gICAgICAgICAgZmllbGQ6IG1vZGVsLmZpZWxkKFkpLFxuICAgICAgICAgIG9wczogWydkaXN0aW5jdCddXG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICBjb25zdCB5Q2FyZGluYWxpdHkgPSB5SGFzRG9tYWluID8geVNjYWxlLmRvbWFpbi5sZW5ndGggOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlbC5maWVsZChZLCB7ZGF0dW06IHRydWUsIHByZWZuOiAnZGlzdGluY3RfJ30pO1xuICAgICAgZm9ybXVsYXMucHVzaCh7XG4gICAgICAgIHR5cGU6ICdmb3JtdWxhJyxcbiAgICAgICAgZmllbGQ6ICdjZWxsSGVpZ2h0JyxcbiAgICAgICAgZXhwcjogJygnICsgeUNhcmRpbmFsaXR5ICsgJyArICcgKyB5U2NhbGUucGFkZGluZyArICcpICogJyArIHlTY2FsZS5iYW5kV2lkdGhcbiAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbnN0IGxheW91dCA9IG1vZGVsLmxheW91dCgpO1xuXG4gICAgaWYgKG1vZGVsLmhhcyhDT0xVTU4pKSB7XG4gICAgICBjb25zdCBsYXlvdXRDZWxsV2lkdGggPSBsYXlvdXQuY2VsbFdpZHRoO1xuICAgICAgY29uc3QgY2VsbFdpZHRoID0gdHlwZW9mIGxheW91dENlbGxXaWR0aCAhPT0gJ251bWJlcicgP1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdHVtLicgKyBsYXlvdXRDZWxsV2lkdGguZmllbGQgOlxuICAgICAgICAgICAgICAgICAgICAgICAgbGF5b3V0Q2VsbFdpZHRoO1xuICAgICAgY29uc3QgY29sU2NhbGUgPSBtb2RlbC5maWVsZERlZihDT0xVTU4pLnNjYWxlO1xuICAgICAgY29uc3QgY29sSGFzRG9tYWluID0gY29sU2NhbGUuZG9tYWluIGluc3Rh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N0YW5jZW9mIEFycmF5O1xuICAgICAgaWYgKCFyb3dIYXNEb21haW4pIHtcbiAgICAgICAgc3VtbWFyaXplLnB1c2goe1xuICAgICAgICAgIGZpZWxkOiBtb2RlbC5maWVsZChST1cpLFxuICAgICAgICAgIG9wczogWydkaXN0aW5jdCddXG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICBjb25zdCByb3dDYXJkaW5hbGl0eSA9IHJvd0hhc0RvbWFpbiA/IHJvd1NjYWxlLmRvbWFpbi5sZW5ndGggOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsLmZpZWxkKFJPVywge2RhdHVtOiB0cnVlLCBwcmVmbjogJ2Rpc3RpbmN0Xyd9KTtcbiAgICAgIGZvcm11bGFzLnB1c2goe1xuICAgICAgICB0eXBlOiAnZm9ybXVsYScsXG4gICAgICAgIGZpZWxkOiAnaGVpZ2h0JyxcbiAgICAgICAgZXhwcjogJygnICsgY2VsbEhlaWdodCArICcrJyArIHJvd1NjYWxlLnBhZGRpbmcgKyAnKScgKyAnICogJyArIHJvd0NhcmRpbmFsaXR5XG4gICAgICB9KTtcbiAgICB9XG5cbiAgICBpZiAoZm9ybXVsYXMubGVuZ3RoID4gMCkge1xuICAgICAgcmV0dXJuIHN1bW1hcml6ZS5sZW5ndGggPiAwID8ge1xuICAgICAgICBuYW1lOiBMQVlPVVQsXG4gICAgICAgIHNvdXJjZTogbW9kZWwuZGF0YVRhYmxlKCksXG4gICAgICAgIHRyYW5zZm9ybTogW3tcbiAgICAgICAgICAgIHR5cGU6ICdhZ2dyZWdhdGUnLFxuICAgICAgICAgICAgc3VtbWFyaXplOiBzdW1tYXJpemVcbiAgICAgICAgICB9XS5jb25jYXQoZm9ybXVsYXMpXG4gICAgICB9IDoge1xuICAgICAgICBuYW1lOiBMQVlPVVQsXG4gICAgICAgIHZhbHVlczogW3t9XSxcbiAgICAgICAgdHJhbnNmb3JtOiBmb3JtdWxhc1xuICAgICAgfTtcbiAgICB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wgeyBzdWZmaXg6ICdfZW5kJyB9KVxuICAgICAgfTtcbiAgICB9IGVsc2UgaWYgKG1vZGVsLmlzTWVhc3VyZShZKSkge1xuICAgICAgaWYgKG9yaWVudCAhPT0gJ2hvcml6b250YWwnKSB7IC8vIHZlcnRpY2FsIChleHBsaWNpdCAndmVydGljYWwnIG9yIHVuZGVmaW5lZClcbiAgICAgICAgcC55ID0ge1xuICAgICAgICAgIHNjYWxlOiBtb2RlbC5zY2FsZU5hbWUoWSksXG4gICAgICAgICAgZmllbGQ6IG1vZGVsLmZpZWxkKFkpXG4gICAgICAgIH07XG4gICAgICAgIHAueTIgPSB7XG4gICAgICAgICAgc2NhbGU6IG1vZGVsLnNjYWxlTmFtZShZKSxcbiAgICAgICAgICB2YWx1ZTogMFxuICAgICAgICB9O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcC55YyA9IHtcbiAgICAgICAgICBzY2FsZTogbW9kZWwuc2NhbGVOYW1lKFkpLFxuICAgICAgICAgIGZpZWxkOiBtb2RlbC5maWVsZChZKVxuICAgICAgICB9O1xuICAgICAgICBwLmhlaWdodCA9IHsgdmFsdWU6IG1vZGVsLnNpemVWYWx1ZShZKSB9O1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAobW9kZWwuZmllbGREZWYoWSkuYmluKSB7XG4gICAgICBpZiAobW9kZWwuaGFzKFNJWkUpICYmIG9yaWVudCA9PT0gJ2hvcml6b250YWwnKSB7XG4gICAgICAgIC8vIEZvciBob3Jpem9udGFsIGNoYXJ0IHRoYXQgaGFzIGJpbm5lZCBZIGFuZCBzaXplLFxuICAgICAgICAvLyBjZW50ZXIgYmFyIGFuZCBhcHBseSBzaXplIHRvIGhlaWdodC5cbiAgICAgICAgcC55YyA9IHtcbiAgICAgICAgICBzY2FsZTogbW9kZWwuc2NhbGVOYW1lKFkpLFxuICAgICAgICAgIGZpZWxkOiBtb2RlbC5maWVsZChZLCB7IGJpblN1ZmZpeDogJ19taWQnIH0pXG4gICAgICA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ZXR1cm4gJ29yZGluYWwnO1xuICAgICAgfVxuICAgICAgaWYgKGZpZWxkRGVmLnNjYWxlLnR5cGUgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICByZXR1cm4gZmllbGREZWYuc2NhbGUudHlwZTtcbiAgICAgIH1cblxuICAgICAgaWYgKGZpZWxkRGVmLnRpbWVVbml0KSB7XG4gICAgICAgIHN3aXRjaCAoZmllbGREZWYudGltZVVuaXQpIHtcbiAgICAgICAgICBjYXNlICdob3Vycyc6XG4gICAgICAgICAgY2FzZSAnZGF5JzpcbiAgICAgICAgICBjYXNlICdtb250aCc6XG4gICAgICAgICAgICByZXR1cm4gJ29yZGluYWwnO1xuICAgICAgICAgIGNhc2UgJ2RhdGUnOlxuICAgICAgICAgIGNhc2UgJ3llYXInOlxuICAgICAgICAgIGNhc2UgJ3NlY29uZCc6XG4gICAgICAgICAgY2FzZSAnbWludXRlJzpcbiAgICAgICAgICAgIC8vIFJldHVybnMgb3JkaW5hbCBpZiAoMSkgdGhlIGNoYW5uZWwgaXMgWCBvciBZLCBhbmRcbiAgICAgICAgICAgIC8vICgyKSBpcyB0aGUgZGltZW5zaW9uIG9mIEJBUiBvciBUSUNLIG1hcmsuXG4gICAgICAgICAgICAvLyBPdGhlcndpc2UgcmV0dXJuIGxpbmVhci5cbiAgICAgICAgICAgIHJldHVybiBjb250YWlucyhbQkFSLCBUSUNLXSwgbWFyaykgJiZcbiAgICAgICAgICAgICAgaXNEaW1lbnNpb24oZmllbGREZWYpID8gJ29yZGluYWwnIDogJ3RpbWUnO1xuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAvLyB5ZWFybW9udGgsIG1vbnRoZGF5LCAuLi5cbiAgICAgICAgICAgIHJldHVybiAnb3JkaW5hbCc7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiAndGltZSc7XG5cbiAgICBjYXNlIFFVQU5USVRBVElWRTpcbiAgICAgIGlmIChmaWVsZERlZi5iaW4pIHtcb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ICAgICAgICAgLy8gY2hlY2sgZWFjaCBpdGVtIGluIHRoZSBhcnJheVxuICAgICAgICAgICAgaWYgKGlucy5sZW5ndGggPT09IGRlZi5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgdmFyIGVxdWFsID0gdHJ1ZTtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBpbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoaW5zW2ldICE9PSBkZWZbaV0pIHtcbiAgICAgICAgICAgICAgICAgIGVxdWFsID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKGVxdWFsKSB7XG4gICAgICAgICAgICAgICAgY29udGludWU7IC8vIGNvbnRpbnVlIHdpdGggbmV4dCBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGNoYW5nZXNbcHJvcF0gPSBpbnM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY2hhbmdlc1twcm9wXSA9IGlucztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgfVxuICByZXR1cm4gY2hhbmdlcztcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBtZXJnZURlZXAoZGVzdCwgLi4uc3JjOiBhbnlbXSkge1xuICBmb3IgKHZhciBpID0gMDsgaSA8IHNyYy5sZW5ndGg7IGkrKykge1xuICAgIGRlc3QgPSBkZWVwTWVyZ2VfKGRlc3QsIHNyY1tpXSk7XG4gIH1cbiAgcmV0dXJuIGRlc3Q7XG59O1xuXG4vLyByZWN1cnNpdmVseSBtZXJnZXMgc3JjIGludG8gZGVzdFxuZnVuY3Rpb24gZGVlcE1lcmdlXyhkZXN0LCBzcmMpIHtcbiAgaWYgKHR5cGVvZiBzcmMgIT09ICdvYmplY3QnIHx8IHNyYyA9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5cGU6ICdzdHJpbmcnLFxuICAgICAgZW51bTogWydhc2NlbmRpbmcnLCAnZGVzY2VuZGluZycsICd1bnNvcnRlZCddXG4gICAgfSxcbiAgICB7IC8vIHNvcnQgYnkgYWdncmVnYXRpb24gb2YgYW5vdGhlciBmaWVsZFxuICAgICAgdHlwZTogJ29iamVjdCcsXG4gICAgICByZXF1aXJlZDogWydmaWVsZCcsICdvcCddLFxuICAgICAgcHJvcGVydGllczoge1xuICAgICAgICBmaWVsZDoge1xuICAgICAgICAgIHR5cGU6ICdzdHJpbmcnLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnVGhlIGZpZWxkIG5hbWUgdG8gYWdncmVnYXRlIG92ZXIuJ1xuICAgICAgICB9LFxuICAgICAgICBvcDoge1xuICAgICAgICAgIHR5cGU6ICdzdHJpbmcnLFxuICAgICAgICAgIGVudW06IEFHR1JFR0FURV9PUFMsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdUaGUgZmllbGQgbmFtZSB0byBhZ2dyZWdhdGUgb3Zlci4nXG4gICAgICAgIH0sXG4gICAgICAgIG9yZGVyOiB7XG4gICAgICAgICAgdHlwZTogJ3N0cmluZycsXG4gICAgICAgICAgZW51bTogWydhc2NlbmRpbmcnLCAnZGVzY2VuZGluZyddXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIF1cbn07XG4iLCJleHBvcnQgaW50ZXJmYWNlIFRyYW5zZm9ybSB7XG4gIGZpbHRlcj86IHN0cmluZztcbiAgZmlsdGVyTnVsbD86IGJvb2xlYW47XG4gIGNhbGN1bGF0ZT86IFZnRm9ybXVsYVtdO1xufVxuXG4vLyBUT0RPIG1vdmUgYWxsIFZlZ2EgaW50ZXJmYWNlcyB0byBvbmUgY2VudHJhbCBwb3NpdGlvblxuZXhwb3J0IGludGVyZmFjZSBWZ0Zvcm11bGEge1xuICBmaWVsZDogc3RyaW5nO1xuICBleHByOiBzdHJpbmc7XG59XG5cbmV4cG9ydCBjb25zdCB0cm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fX1ZFUlNJT05fXyc7XG4iXX0=
| keicheng/cdnjs | ajax/libs/vega-lite/0.9.3/vega-lite.js | JavaScript | mit | 626,702 |
// JSTS. See https://github.com/bjornharrtell/jsts
// Licenses:
// https://github.com/bjornharrtell/jsts/blob/master/LICENSE_BHARRTELL_BSD3.txt
// https://github.com/bjornharrtell/jsts/blob/master/LICENSE_EPLv1.txt
// https://github.com/bjornharrtell/jsts/blob/master/LICENSE_MDAVIS_BSD3.txt
// https://github.com/bjornharrtell/jsts/blob/master/LICENSE_VSI_BSD3.txt
"use strict";function extend(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function NumberUtil(){}function IllegalArgumentException(){}function Double(){}function Comparable(){}function Clonable(){}function Comparator(){}function Serializable(){}function RuntimeException(){}function inherits(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function AssertionFailedException(){if(0===arguments.length)RuntimeException.call(this);else if(1===arguments.length){var t=arguments[0];RuntimeException.call(this,t)}}function Assert(){}function Coordinate(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)Coordinate.call(this,0,0);else if(1===arguments.length){var t=arguments[0];Coordinate.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Coordinate.call(this,e,n,Coordinate.NULL_ORDINATE)}else if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];this.x=e,this.y=n,this.z=i}}function DimensionalComparator(){if(this.dimensionsToTest=2,0===arguments.length)DimensionalComparator.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new IllegalArgumentException("only 2 or 3 dimensions may be specified");this.dimensionsToTest=t}}function Envelope(){if(this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof Coordinate){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Envelope){var e=arguments[0];this.init(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this.init(r,o,s,a)}}function Exception(){}function NotRepresentableException(){Exception.call(this,"Projective point not representable on the Cartesian plane.")}function Location(){}function hasInterface(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}function MathUtil(){}function StringBuffer(t){this.str=t}function Integer(t){this.value=t}function Character(){}function DD(){if(this.hi=0,this.lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof DD){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){var n=arguments[0];DD.call(this,DD.parse(n))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}}function CGAlgorithmsDD(){}function CoordinateSequence(){}function System(){}function HCoordinate(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof HCoordinate&&arguments[1]instanceof HCoordinate){var i=arguments[0],r=arguments[1];this.x=i.y*r.w-r.y*i.w,this.y=r.x*i.w-i.x*r.w,this.w=i.x*r.y-r.x*i.y}else if(arguments[0]instanceof Coordinate&&arguments[1]instanceof Coordinate){var i=arguments[0],r=arguments[1];this.x=i.y-r.y,this.y=r.x-i.x,this.w=i.x*r.y-r.x*i.y}}else if(3===arguments.length){var e=arguments[0],n=arguments[1],o=arguments[2];this.x=e,this.y=n,this.w=o}else if(4===arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2],a=arguments[3],l=i.y-r.y,u=r.x-i.x,c=i.x*r.y-r.x*i.y,h=s.y-a.y,d=a.x-s.x,g=s.x*a.y-a.x*s.y;this.x=u*g-d*c,this.y=h*c-l*g,this.w=l*d-h*u}}function CoordinateSequenceFactory(){}function Geometry(){this.envelope=null,this.factory=null,this.SRID=null,this.userData=null;var t=arguments[0];this.factory=t,this.SRID=t.getSRID()}function CoordinateFilter(){}function BoundaryNodeRule(){}function Mod2BoundaryNodeRule(){}function EndPointBoundaryNodeRule(){}function MultiValentEndPointBoundaryNodeRule(){}function MonoValentEndPointBoundaryNodeRule(){}function Iterator(){}function Collection(){}function IndexOutOfBoundsException$1(t){this.message=t||""}function List(){}function NoSuchElementException(t){this.message=t||""}function OperationNotSupported(t){this.message=t||""}function ArrayList(){this.array_=[],arguments[0]instanceof Collection&&this.addAll(arguments[0])}function CoordinateList(){if(ArrayList.apply(this),0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.ensureCapacity(t.length),this.add(t,e)}}function CoordinateArrays(){}function ForwardComparator(){}function BidirectionalComparator(){}function Map$1(){}function SortedMap(){}function Set(){}function HashSet(){this.array_=[],arguments[0]instanceof Collection&&this.addAll(arguments[0])}function colorOf(t){return null==t?BLACK:t.color}function parentOf(t){return null==t?null:t.parent}function setColor(t,e){null!==t&&(t.color=e)}function leftOf(t){return null==t?null:t.left}function rightOf(t){return null==t?null:t.right}function TreeMap(){this.root_=null,this.size_=0}function Lineal(){}function SortedSet(){}function TreeSet(){this.array_=[],arguments[0]instanceof Collection&&this.addAll(arguments[0])}function Arrays(){}function GeometryComponentFilter$1(){}function Dimension(){}function GeometryFilter(){}function CoordinateSequenceFilter(){}function GeometryCollection(){this.geometries=null;var t=arguments[0],e=arguments[1];if(Geometry.call(this,e),null===t&&(t=[]),Geometry.hasNullElements(t))throw new IllegalArgumentException("geometries must not contain null elements");this.geometries=t}function MultiLineString(){var t=arguments[0],e=arguments[1];GeometryCollection.call(this,t,e)}function BoundaryOp(){if(this.geom=null,this.geomFact=null,this.bnRule=null,this.endpointMap=null,1===arguments.length){var t=arguments[0];BoundaryOp.call(this,t,BoundaryNodeRule.MOD2_BOUNDARY_RULE)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.geom=t,this.geomFact=t.getFactory(),this.bnRule=e}}function Counter(){this.count=null}function PrintStream(){}function StringReader(){}function DecimalFormat(){}function ByteArrayOutputStream(){}function IOException(){}function LineNumberReader(){}function StringUtil(){}function CoordinateSequences(){}function LineString(){this.points=null;var t=arguments[0],e=arguments[1];Geometry.call(this,e),this.init(t)}function Puntal(){}function Point(){this.coordinates=null;var t=arguments[0],e=arguments[1];Geometry.call(this,e),this.init(t)}function Polygonal(){}function Polygon(){this.shell=null,this.holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(Geometry.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),Geometry.hasNullElements(e))throw new IllegalArgumentException("holes must not contain null elements");if(t.isEmpty()&&Geometry.hasNonEmptyElements(e))throw new IllegalArgumentException("shell is empty but holes are not");this.shell=t,this.holes=e}function MultiPoint(){var t=arguments[0],e=arguments[1];GeometryCollection.call(this,t,e)}function LinearRing(){if(arguments[0]instanceof Coordinate&&arguments[1]instanceof GeometryFactory){var t=arguments[0],e=arguments[1];LinearRing.call(this,e.getCoordinateSequenceFactory().create(t),e)}else if(hasInterface(arguments[0],CoordinateSequence)&&arguments[1]instanceof GeometryFactory){var t=arguments[0],e=arguments[1];LineString.call(this,t,e),this.validateConstruction()}}function MultiPolygon(){var t=arguments[0],e=arguments[1];GeometryCollection.call(this,t,e)}function GeometryEditor(){if(this.factory=null,this.isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.factory=t}}function GeometryEditorOperation(){}function NoOpGeometryOperation(){}function CoordinateOperation(){}function CoordinateSequenceOperation(){}function CoordinateArraySequence(){if(this.dimension=3,this.coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];CoordinateArraySequence.call(this,t,3)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.coordinates=new Array(e).fill(null);for(var n=0;e>n;n++)this.coordinates[n]=new Coordinate}else if(hasInterface(arguments[0],CoordinateSequence)){var i=arguments[0];if(null===i)return this.coordinates=new Array(0).fill(null),null;this.dimension=i.getDimension(),this.coordinates=new Array(i.size()).fill(null);for(var n=0;n<this.coordinates.length;n++)this.coordinates[n]=i.getCoordinateCopy(n)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var t=arguments[0],r=arguments[1];this.coordinates=t,this.dimension=r,null===t&&(this.coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var e=arguments[0],r=arguments[1];this.coordinates=new Array(e).fill(null),this.dimension=r;for(var n=0;e>n;n++)this.coordinates[n]=new Coordinate}}function CoordinateArraySequenceFactory(){}function HashMap(){this.map_=new Map}function PrecisionModel(){if(this.modelType=null,this.scale=null,0===arguments.length)this.modelType=PrecisionModel.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof Type){var t=arguments[0];this.modelType=t,t===PrecisionModel.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var e=arguments[0];this.modelType=PrecisionModel.FIXED,this.setScale(e)}else if(arguments[0]instanceof PrecisionModel){var n=arguments[0];this.modelType=n.modelType,this.scale=n.scale}}function Type(){this.name=null;var t=arguments[0];this.name=t,Type.nameToTypeMap.put(t,this)}function GeometryFactory(){if(this.precisionModel=null,this.coordinateSequenceFactory=null,this.SRID=null,0===arguments.length)GeometryFactory.call(this,new PrecisionModel,0);else if(1===arguments.length){if(hasInterface(arguments[0],CoordinateSequenceFactory)){var t=arguments[0];GeometryFactory.call(this,new PrecisionModel,0,t)}else if(arguments[0]instanceof PrecisionModel){var e=arguments[0];GeometryFactory.call(this,e,0,GeometryFactory.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){var e=arguments[0],n=arguments[1];GeometryFactory.call(this,e,n,GeometryFactory.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){var e=arguments[0],n=arguments[1],t=arguments[2];this.precisionModel=e,this.coordinateSequenceFactory=t,this.SRID=n}}function WKTParser(t){this.geometryFactory=t||new GeometryFactory}function WKTWriter(t){this.parser=new WKTParser(t)}function LineIntersector(){this.result=null,this.inputLines=Array(2).fill().map(function(){return Array(2)}),this.intPt=new Array(2).fill(null),this.intLineIndex=null,this._isProper=null,this.pa=null,this.pb=null,this.precisionModel=null,this.intPt[0]=new Coordinate,this.intPt[1]=new Coordinate,this.pa=this.intPt[0],this.pb=this.intPt[1],this.result=0}function RobustLineIntersector(){LineIntersector.apply(this)}function RobustDeterminant(){}function RayCrossingCounter(){this.p=null,this.crossingCount=0,this.isPointOnSegment=!1;var t=arguments[0];this.p=t}function CGAlgorithms(){}function LineSegment(){if(this.p0=null,this.p1=null,0===arguments.length)LineSegment.call(this,new Coordinate,new Coordinate);else if(1===arguments.length){var t=arguments[0];LineSegment.call(this,t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0=e,this.p1=n}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3];LineSegment.call(this,new Coordinate(i,r),new Coordinate(o,s))}}function IntersectionMatrix(){if(this.matrix=null,0===arguments.length)this.matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(Dimension.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];IntersectionMatrix.call(this),this.set(t)}else if(arguments[0]instanceof IntersectionMatrix){var e=arguments[0];IntersectionMatrix.call(this),this.matrix[Location.INTERIOR][Location.INTERIOR]=e.matrix[Location.INTERIOR][Location.INTERIOR],this.matrix[Location.INTERIOR][Location.BOUNDARY]=e.matrix[Location.INTERIOR][Location.BOUNDARY],this.matrix[Location.INTERIOR][Location.EXTERIOR]=e.matrix[Location.INTERIOR][Location.EXTERIOR],this.matrix[Location.BOUNDARY][Location.INTERIOR]=e.matrix[Location.BOUNDARY][Location.INTERIOR],this.matrix[Location.BOUNDARY][Location.BOUNDARY]=e.matrix[Location.BOUNDARY][Location.BOUNDARY],this.matrix[Location.BOUNDARY][Location.EXTERIOR]=e.matrix[Location.BOUNDARY][Location.EXTERIOR],this.matrix[Location.EXTERIOR][Location.INTERIOR]=e.matrix[Location.EXTERIOR][Location.INTERIOR],this.matrix[Location.EXTERIOR][Location.BOUNDARY]=e.matrix[Location.EXTERIOR][Location.BOUNDARY],this.matrix[Location.EXTERIOR][Location.EXTERIOR]=e.matrix[Location.EXTERIOR][Location.EXTERIOR]}}function Centroid(){this.areaBasePt=null,this.triangleCent3=new Coordinate,this.areasum2=0,this.cg3=new Coordinate,this.lineCentSum=new Coordinate,this.totalLength=0,this.ptCount=0,this.ptCentSum=new Coordinate;var t=arguments[0];this.areaBasePt=null,this.add(t)}function EmptyStackException(t){this.message=t||""}function Stack(){this.array_=[]}function UniqueCoordinateArrayFilter(){this.treeSet=new TreeSet,this.list=new ArrayList}function ConvexHull(){if(this.geomFactory=null,this.inputPts=null,1===arguments.length){var t=arguments[0];ConvexHull.call(this,ConvexHull.extractCoordinates(t),t.getFactory())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputPts=UniqueCoordinateArrayFilter.filterCoordinates(e),this.geomFactory=n}}function RadialComparator(){this.origin=null;var t=arguments[0];this.origin=t}function InteriorPointArea(){this.factory=null,this.interiorPoint=null,this.maxWidth=0;var t=arguments[0];this.factory=t.getFactory(),this.add(t)}function SafeBisectorFinder(){this.poly=null,this.centreY=null,this.hiY=Double.MAX_VALUE,this.loY=-Double.MAX_VALUE;var t=arguments[0];this.poly=t,this.hiY=t.getEnvelopeInternal().getMaxY(),this.loY=t.getEnvelopeInternal().getMinY(),this.centreY=InteriorPointArea.avg(this.loY,this.hiY)}function InteriorPointLine(){this.centroid=null,this.minDistance=Double.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.addInterior(t),null===this.interiorPoint&&this.addEndpoints(t)}function InteriorPointPoint(){this.centroid=null,this.minDistance=Double.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.add(t)}function Angle$1(){}function Triangle(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}function MinimumBoundingCircle(){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0;var t=arguments[0];this.input=t}function MinimumDiameter(){if(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new LineSegment,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length){var t=arguments[0];MinimumDiameter.call(this,t,!1)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.inputGeom=t,this.isConvex=e}}function GeometryTransformer(){this.inputGeom=null,this.factory=null,this.pruneEmptyGeometry=!0,this.preserveGeometryCollectionType=!0,this.preserveCollections=!1,this.preserveType=!1}function Densifier(){this.inputGeom=null,this.distanceTolerance=null;var t=arguments[0];this.inputGeom=t}function DensifyTransformer(){GeometryTransformer.apply(this),this.distanceTolerance=null;var t=arguments[0];this.distanceTolerance=t}function Quadrant(){}function HalfEdge(){this._orig=null,this._sym=null,this._next=null;var t=arguments[0];this._orig=t}function MarkHalfEdge(){this._isMarked=!1;var t=arguments[0];HalfEdge.call(this,t)}function EdgeGraph(){this.vertexMap=new HashMap}function DissolveHalfEdge(){this._isStart=!1;var t=arguments[0];MarkHalfEdge.call(this,t)}function DissolveEdgeGraph(){EdgeGraph.apply(this)}function LineDissolver(){this.result=null,this.factory=null,this.graph=null,this.lines=new ArrayList,this.nodeEdgeStack=new Stack,this.ringStartEdge=null,this.graph=new DissolveEdgeGraph}function NodeBase(){this.items=new ArrayList,this.subnode=new Array(4).fill(null)}function DoubleBits(){}function Key(){this.pt=new Coordinate,this.level=0,this.env=null;var t=arguments[0];this.computeKey(t)}function Node(){NodeBase.apply(this),this.env=null,this.centrex=null,this.centrey=null,this.level=null;var t=arguments[0],e=arguments[1];this.env=t,this.level=e,this.centrex=(t.getMinX()+t.getMaxX())/2,this.centrey=(t.getMinY()+t.getMaxY())/2}function IntervalSize(){}function Root(){NodeBase.apply(this)}function SpatialIndex(){}function ItemVisitor(){}function ArrayListVisitor(){this.items=new ArrayList}function Quadtree(){this.root=null,this.minExtent=1,this.root=new Root}function Boundable(){}function ItemBoundable(){this.bounds=null,this.item=null;var t=arguments[0],e=arguments[1];this.bounds=t,this.item=e}function PriorityQueue(){this._size=null,this.items=null,this._size=0,this.items=new ArrayList,this.items.add(null)}function AbstractNode(){if(this.childBoundables=new ArrayList,this.bounds=null,this.level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.level=t}}function BoundablePair(){this.boundable1=null,this.boundable2=null,this._distance=null,this.itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.boundable1=t,this.boundable2=e,this.itemDistance=n,this._distance=this.distance()}function AbstractSTRtree(){if(this.root=null,this.built=!1,this.itemBoundables=new ArrayList,this.nodeCapacity=null,0===arguments.length)AbstractSTRtree.call(this,AbstractSTRtree.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];Assert.isTrue(t>1,"Node capacity must be greater than 1"),this.nodeCapacity=t}}function IntersectsOp$1(){}function ItemDistance(){}function STRtree(){if(0===arguments.length)STRtree.call(this,STRtree.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];AbstractSTRtree.call(this,t)}}function STRtreeNode(){var t=arguments[0];AbstractNode.call(this,t)}function GeoJSONParser(t){this.geometryFactory=t||new GeometryFactory}function GeoJSONReader(t){this.geometryFactory=t||new GeometryFactory,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new GeoJSONParser(this.geometryFactory)}function GeoJSONWriter(){this.parser=new GeoJSONParser(this.geometryFactory)}function WKTReader(t){this.geometryFactory=t||new GeometryFactory,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new WKTParser(this.geometryFactory)}function p2c(t){return[t.x,t.y]}function OL3Parser(t){this.geometryFactory=t||new GeometryFactory}function SegmentPointComparator(){}function SegmentNode(){this.segString=null,this.coord=null,this.segmentIndex=null,this.segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.segString=t,this.coord=new Coordinate(e),this.segmentIndex=n,this.segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}function SegmentNodeList(){this.nodeMap=new TreeMap,this.edge=null;var t=arguments[0];this.edge=t}function NodeVertexIterator(){this.nodeList=null,this.edge=null,this.nodeIt=null,this.currNode=null,this.nextNode=null,this.currSegIndex=0;var t=arguments[0];this.nodeList=t,this.edge=t.getEdge(),this.nodeIt=t.iterator(),this.readNextNode()}function Octant(){}function SegmentString(){}function NodableSegmentString(){}function NodedSegmentString(){this.nodeList=new SegmentNodeList(this),this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function MonotoneChainOverlapAction(){this.tempEnv1=new Envelope,this.tempEnv2=new Envelope,this.overlapSeg1=new LineSegment,this.overlapSeg2=new LineSegment}function MonotoneChain(){this.pts=null,this.start=null,this.end=null,this.env=null,this.context=null,this.id=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.pts=t,this.start=e,this.end=n,this.context=i}function MonotoneChainBuilder(){}function Noder(){}function SinglePassNoder(){if(this.segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}function MCIndexNoder(){if(this.monoChains=new ArrayList,this.index=new STRtree,this.idCounter=0,this.nodedSegStrings=null,this.nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];SinglePassNoder.call(this,t)}}function SegmentOverlapAction(){MonotoneChainOverlapAction.apply(this),this.si=null;var t=arguments[0];this.si=t}function ScaledNoder(){if(this.noder=null,this.scaleFactor=null,this.offsetX=null,this.offsetY=null,this.isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];ScaledNoder.call(this,t,e,0,0)}else if(4===arguments.length){var t=arguments[0],e=arguments[1];arguments[2],arguments[3];this.noder=t,this.scaleFactor=e,this.isScaled=!this.isIntegerPrecision()}}function GeometryCollectionIterator(){this.parent=null,this.atStart=null,this.max=null,this.index=null,this.subcollectionIterator=null;var t=arguments[0];this.parent=t,this.atStart=!0,this.index=0,this.max=t.getNumGeometries()}function PointLocator(){if(this.boundaryRule=BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE,this.isIn=null,this.numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new IllegalArgumentException("Rule must be non-null");this.boundaryRule=t}}function Position(){}function MonotoneChain$1(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}function SweepLineEvent(){if(this.label=null,this.xValue=null,this.eventType=null,this.insertEvent=null,this.deleteEventIndex=null,this.obj=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.eventType=SweepLineEvent.DELETE,this.xValue=t,this.insertEvent=e}else if(3===arguments.length){var n=arguments[0],t=arguments[1],i=arguments[2];this.eventType=SweepLineEvent.INSERT,this.label=n,this.xValue=t,this.obj=i}}function EdgeSetIntersector(){}function SegmentIntersector(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.properIntersectionPoint=null,this.li=null,this.includeProper=null,this.recordIsolated=null,this.isSelfIntersection=null,this.numIntersections=0,this.numTests=0,this.bdyNodes=null,this._isDone=!1,this.isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.li=t,this.includeProper=e,this.recordIsolated=n}function SimpleMCSweepLineIntersector(){EdgeSetIntersector.apply(this),this.events=new ArrayList,this.nOverlaps=null}function TopologyLocation(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.init(1),this.location[Position.ON]=e}else if(arguments[0]instanceof TopologyLocation){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var i=0;i<this.location.length;i++)this.location[i]=n.location[i]}}else if(3===arguments.length){var e=arguments[0],r=arguments[1],o=arguments[2];this.init(3),this.location[Position.ON]=e,this.location[Position.LEFT]=r,this.location[Position.RIGHT]=o}}function Label(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new TopologyLocation(t),this.elt[1]=new TopologyLocation(t)}else if(arguments[0]instanceof Label){var e=arguments[0];this.elt[0]=new TopologyLocation(e.elt[0]),this.elt[1]=new TopologyLocation(e.elt[1])}}else if(2===arguments.length){var n=arguments[0],t=arguments[1];this.elt[0]=new TopologyLocation(Location.NONE),this.elt[1]=new TopologyLocation(Location.NONE),this.elt[n].setLocation(t)}else if(3===arguments.length){var t=arguments[0],i=arguments[1],r=arguments[2];this.elt[0]=new TopologyLocation(t,i,r),this.elt[1]=new TopologyLocation(t,i,r)}else if(4===arguments.length){var n=arguments[0],t=arguments[1],i=arguments[2],r=arguments[3];this.elt[0]=new TopologyLocation(Location.NONE,Location.NONE,Location.NONE),this.elt[1]=new TopologyLocation(Location.NONE,Location.NONE,Location.NONE),this.elt[n].setLocations(t,i,r)}}function PointOnGeometryLocator(){}function IntervalRTreeNode$1(){this.min=Double.POSITIVE_INFINITY,this.max=Double.NEGATIVE_INFINITY}function NodeComparator(){}function IntervalRTreeLeafNode(){IntervalRTreeNode$1.apply(this),this.item=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.min=t,this.max=e,this.item=n}function IntervalRTreeBranchNode(){IntervalRTreeNode$1.apply(this),this.node1=null,this.node2=null;var t=arguments[0],e=arguments[1];this.node1=t,this.node2=e,this.buildExtent(this.node1,this.node2)}function SortedPackedIntervalRTree(){this.leaves=new ArrayList,this.root=null,this.level=0}function LinearComponentExtracter(){if(this.lines=null,this.isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this.lines=t}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.lines=t,this.isForcedToLineString=e}}function IndexedPointInAreaLocator(){this.index=null;var t=arguments[0];if(!hasInterface(t,Polygonal))throw new IllegalArgumentException("Argument must be Polygonal");this.index=new IntervalIndexedGeometry(t)}function SegmentVisitor(){this.counter=null;var t=arguments[0];this.counter=t}function IntervalIndexedGeometry(){this.index=new SortedPackedIntervalRTree;var t=arguments[0];this.init(t)}function EdgeIntersection(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new Coordinate(t),this.segmentIndex=e,this.dist=n}function EdgeIntersectionList(){this.nodeMap=new TreeMap,this.edge=null;var t=arguments[0];this.edge=t}function MonotoneChainIndexer(){}function MonotoneChainEdge(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new Envelope,this.env2=new Envelope;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new MonotoneChainIndexer;this.startIndex=e.getChainStartIndices(this.pts)}function Depth(){this.depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;2>t;t++)for(var e=0;3>e;e++)this.depth[t][e]=Depth.NULL_VALUE}function GraphComponent(){if(this.label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.label=t}}function Edge(){if(GraphComponent.apply(this),this.pts=null,this.env=null,this.eiList=new EdgeIntersectionList(this),this.name=null,this.mce=null,this._isIsolated=!0,this.depth=new Depth,this.depthDelta=0,1===arguments.length){var t=arguments[0];Edge.call(this,t,null)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.pts=t,this.label=e}}function Node$1(){GraphComponent.apply(this),this.coord=null,this.edges=null;var t=arguments[0],e=arguments[1];this.coord=t,this.edges=e,this.label=new Label(0,Location.NONE)}function NodeMap(){this.nodeMap=new TreeMap,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}function EdgeEnd(){if(this.edge=null,this.label=null,this.node=null,this.p0=null,this.p1=null,this.dx=null,this.dy=null,this.quadrant=null,1===arguments.length){var t=arguments[0];this.edge=t}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];EdgeEnd.call(this,t,e,n,null)}else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];EdgeEnd.call(this,t),this.init(e,n),this.label=i}}function TopologyException(){if(this.pt=null,1===arguments.length){var t=arguments[0];RuntimeException.call(this,t)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];RuntimeException.call(this,TopologyException.msgWithCoord(t,e)),this.pt=new Coordinate(e)}}function DirectedEdge(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this.sym=null,this.next=null,this.nextMin=null,this.edgeRing=null,this.minEdgeRing=null,this.depth=[0,-999,-999];var t=arguments[0],e=arguments[1];if(EdgeEnd.call(this,t),this._isForward=e,e)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var n=t.getNumPoints()-1;this.init(t.getCoordinate(n),t.getCoordinate(n-1))}this.computeDirectedLabel()}function NodeFactory(){}function PlanarGraph(){if(this.edges=new ArrayList,this.nodes=null,this.edgeEndList=new ArrayList,0===arguments.length)this.nodes=new NodeMap(new NodeFactory);else if(1===arguments.length){var t=arguments[0];this.nodes=new NodeMap(t)}}function GeometryGraph(){if(PlanarGraph.apply(this),this.parentGeom=null,this.lineEdgeMap=new HashMap,this.boundaryNodeRule=null,this.useBoundaryDeterminationRule=!0,this.argIndex=null,this.boundaryNodes=null,this._hasTooFewPoints=!1,this.invalidPoint=null,this.areaPtLocator=null,this.ptLocator=new PointLocator,2===arguments.length){var t=arguments[0],e=arguments[1];GeometryGraph.call(this,t,e,BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];this.argIndex=t,this.parentGeom=e,this.boundaryNodeRule=n,null!==e&&this.add(e)}}function IsSimpleOp(){if(this.inputGeom=null,this.isClosedEndpointsInInterior=!0,this.nonSimpleLocation=null,1===arguments.length){var t=arguments[0];this.inputGeom=t}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.inputGeom=t,this.isClosedEndpointsInInterior=!e.isInBoundary(2)}}function EndpointInfo(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function BufferParameters(){if(this.quadrantSegments=BufferParameters.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=BufferParameters.CAP_ROUND,this.joinStyle=BufferParameters.JOIN_ROUND,this.mitreLimit=BufferParameters.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this.simplifyFactor=BufferParameters.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.setQuadrantSegments(t),this.setEndCapStyle(e)}else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.setQuadrantSegments(t),this.setEndCapStyle(e),this.setJoinStyle(n),this.setMitreLimit(i)}}function RightmostEdgeFinder(){this.minIndex=-1,this.minCoord=null,this.minDe=null,this.orientedDe=null}function LinkedList(){this.array_=[]}function BufferSubgraph(){this.finder=null,this.dirEdgeList=new ArrayList,this.nodes=new ArrayList,this.rightMostCoord=null,this.env=null,this.finder=new RightmostEdgeFinder}function EdgeRing(){this.startDe=null,this.maxNodeDegree=-1,this.edges=new ArrayList,this.pts=new ArrayList,this.label=new Label(Location.NONE),this.ring=null,this._isHole=null,this.shell=null,this.holes=new ArrayList,this.geometryFactory=null;var t=arguments[0],e=arguments[1];this.geometryFactory=e,this.computePoints(t),this.computeRing()}function MinimalEdgeRing(){var t=arguments[0],e=arguments[1];EdgeRing.call(this,t,e)}function MaximalEdgeRing(){var t=arguments[0],e=arguments[1];EdgeRing.call(this,t,e)}function PolygonBuilder(){this.geometryFactory=null,this.shellList=new ArrayList;var t=arguments[0];this.geometryFactory=t}function BufferInputLineSimplifier(){this.inputLine=null,this.distanceTol=null,this.isDeleted=null,this.angleOrientation=CGAlgorithms.COUNTERCLOCKWISE;var t=arguments[0];this.inputLine=t}function OffsetSegmentString(){this.ptList=null,this.precisionModel=null,this.minimimVertexDistance=0,this.ptList=new ArrayList}function OffsetSegmentGenerator(){this.maxCurveSegmentError=0,this.filletAngleQuantum=null,this.closingSegLengthFactor=1,this.segList=null,this.distance=0,this.precisionModel=null,this.bufParams=null,this.li=null,this.s0=null,this.s1=null,this.s2=null,this.seg0=new LineSegment,this.seg1=new LineSegment,this.offset0=new LineSegment,this.offset1=new LineSegment,this.side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.precisionModel=t,
this.bufParams=e,this.li=new RobustLineIntersector,this.filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===BufferParameters.JOIN_ROUND&&(this.closingSegLengthFactor=OffsetSegmentGenerator.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}function OffsetCurveBuilder(){this.distance=0,this.precisionModel=null,this.bufParams=null;var t=arguments[0],e=arguments[1];this.precisionModel=t,this.bufParams=e}function SubgraphDepthLocater(){this.subgraphs=null,this.seg=new LineSegment,this.cga=new CGAlgorithms;var t=arguments[0];this.subgraphs=t}function DepthSegment(){this.upwardSeg=null,this.leftDepth=null;var t=arguments[0],e=arguments[1];this.upwardSeg=new LineSegment(t),this.leftDepth=e}function OffsetCurveSetBuilder(){this.inputGeom=null,this.distance=null,this.curveBuilder=null,this.curveList=new ArrayList;var t=arguments[0],e=arguments[1],n=arguments[2];this.inputGeom=t,this.distance=e,this.curveBuilder=n}function SimplePointInAreaLocator(){this.geom=null;var t=arguments[0];this.geom=t}function EdgeEndStar(){this.edgeMap=new TreeMap,this.edgeList=null,this.ptInAreaLocation=[Location.NONE,Location.NONE]}function DirectedEdgeStar(){EdgeEndStar.apply(this),this.resultAreaEdgeList=null,this.label=null,this.SCANNING_FOR_INCOMING=1,this.LINKING_TO_OUTGOING=2}function OverlayNodeFactory(){NodeFactory.apply(this)}function OrientedCoordinateArray(){this.pts=null,this._orientation=null;var t=arguments[0];this.pts=t,this._orientation=OrientedCoordinateArray.orientation(t)}function EdgeList(){this.edges=new ArrayList,this.ocaMap=new TreeMap}function SegmentIntersector$1(){}function IntersectionAdder(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.hasInterior=!1,this.properIntersectionPoint=null,this.li=null,this.isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this.li=t}function BufferBuilder(){this.bufParams=null,this.workingPrecisionModel=null,this.workingNoder=null,this.geomFact=null,this.graph=null,this.edgeList=new EdgeList;var t=arguments[0];this.bufParams=t}function NodingValidator(){this.li=new RobustLineIntersector,this.segStrings=null;var t=arguments[0];this.segStrings=t}function HotPixel(){this.li=null,this.pt=null,this.originalPt=null,this.ptScaled=null,this.p0Scaled=null,this.p1Scaled=null,this.scaleFactor=null,this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,this.corner=new Array(4).fill(null),this.safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this.originalPt=t,this.pt=t,this.scaleFactor=e,this.li=n,0>=e)throw new IllegalArgumentException("Scale factor must be non-zero");1!==e&&(this.pt=new Coordinate(this.scale(t.x),this.scale(t.y)),this.p0Scaled=new Coordinate,this.p1Scaled=new Coordinate),this.initCorners(this.pt)}function MonotoneChainSelectAction(){this.tempEnv1=new Envelope,this.selectedSegment=new LineSegment}function MCIndexPointSnapper(){this.index=null;var t=arguments[0];this.index=t}function HotPixelSnapAction(){MonotoneChainSelectAction.apply(this),this.hotPixel=null,this.parentEdge=null,this.hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.hotPixel=t,this.parentEdge=e,this.hotPixelVertexIndex=n}function InteriorIntersectionFinderAdder(){this.li=null,this.interiorIntersections=null;var t=arguments[0];this.li=t,this.interiorIntersections=new ArrayList}function MCIndexSnapRounder(){this.pm=null,this.li=null,this.scaleFactor=null,this.noder=null,this.pointSnapper=null,this.nodedSegStrings=null;var t=arguments[0];this.pm=t,this.li=new RobustLineIntersector,this.li.setPrecisionModel(t),this.scaleFactor=t.getScale()}function BufferOp(){if(this.argGeom=null,this.distance=null,this.bufParams=new BufferParameters,this.resultGeometry=null,this.saveException=null,1===arguments.length){var t=arguments[0];this.argGeom=t}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.argGeom=t,this.bufParams=e}}function PolygonExtracter(){this.comps=null;var t=arguments[0];this.comps=t}function GeometryLocation(){if(this.component=null,this.segIndex=null,this.pt=null,2===arguments.length){var t=arguments[0],e=arguments[1];GeometryLocation.call(this,t,GeometryLocation.INSIDE_AREA,e)}else if(3===arguments.length){var t=arguments[0],n=arguments[1],e=arguments[2];this.component=t,this.segIndex=n,this.pt=e}}function PointExtracter(){this.pts=null;var t=arguments[0];this.pts=t}function ConnectedElementLocationFilter(){this.locations=null;var t=arguments[0];this.locations=t}function DistanceOp(){if(this.geom=null,this.terminateDistance=0,this.ptLocator=new PointLocator,this.minDistanceLocation=null,this.minDistance=Double.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];DistanceOp.call(this,t,e,0)}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];this.geom=new Array(2).fill(null),this.geom[0]=t,this.geom[1]=e,this.terminateDistance=n}}function EdgeString(){this.factory=null,this.directedEdges=new ArrayList,this.coordinates=null;var t=arguments[0];this.factory=t}function GraphComponent$1(){this._isMarked=!1,this._isVisited=!1,this.data=null}function DirectedEdge$1(){GraphComponent$1.apply(this),this.parentEdge=null,this.from=null,this.to=null,this.p0=null,this.p1=null,this.sym=null,this.edgeDirection=null,this.quadrant=null,this.angle=null;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.from=t,this.to=e,this.edgeDirection=i,this.p0=t.getCoordinate(),this.p1=n;var r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y;this.quadrant=Quadrant.quadrant(r,o),this.angle=Math.atan2(o,r)}function LineMergeDirectedEdge(){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];DirectedEdge$1.call(this,t,e,n,i)}function Edge$1(){if(GraphComponent$1.apply(this),this.dirEdge=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.setDirectedEdges(t,e)}}function DirectedEdgeStar$1(){this.outEdges=new ArrayList,this.sorted=!1}function Node$2(){if(GraphComponent$1.apply(this),this.pt=null,this.deStar=null,1===arguments.length){var t=arguments[0];Node$2.call(this,t,new DirectedEdgeStar$1)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.pt=t,this.deStar=e}}function LineMergeEdge(){Edge$1.apply(this),this.line=null;var t=arguments[0];this.line=t}function NodeMap$1(){this.nodeMap=new TreeMap}function PlanarGraph$1(){this.edges=new HashSet,this.dirEdges=new HashSet,this.nodeMap=new NodeMap$1}function LineMergeGraph(){PlanarGraph$1.apply(this)}function LineMerger(){this.graph=new LineMergeGraph,this.mergedLineStrings=null,this.factory=null,this.edgeStrings=null}function BasicSegmentString(){this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function InteriorIntersectionFinder(){this.findAllIntersections=!1,this.isCheckEndSegmentsOnly=!1,this.li=null,this.interiorIntersection=null,this.intSegments=null,this.intersections=new ArrayList,this.intersectionCount=0,this.keepIntersections=!0;var t=arguments[0];this.li=t,this.interiorIntersection=null}function FastNodingValidator(){this.li=new RobustLineIntersector,this.segStrings=null,this.findAllIntersections=!1,this.segInt=null,this._isValid=!0;var t=arguments[0];this.segStrings=t}function EdgeNodingValidator(){this.nv=null;var t=arguments[0];this.nv=new FastNodingValidator(EdgeNodingValidator.toSegmentStrings(t))}function LineBuilder(){this.op=null,this.geometryFactory=null,this.ptLocator=null,this.lineEdgesList=new ArrayList,this.resultLineList=new ArrayList;var t=arguments[0],e=arguments[1],n=arguments[2];this.op=t,this.geometryFactory=e,this.ptLocator=n}function PointBuilder(){this.op=null,this.geometryFactory=null,this.resultPointList=new ArrayList;var t=arguments[0],e=arguments[1];arguments[2];this.op=t,this.geometryFactory=e}function GeometryGraphOperation(){if(this.li=new RobustLineIntersector,this.resultPrecisionModel=null,this.arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this.arg=new Array(1).fill(null),this.arg[0]=new GeometryGraph(0,t)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];GeometryGraphOperation.call(this,t,e,BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];t.getPrecisionModel().compareTo(e.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(e.getPrecisionModel()),this.arg=new Array(2).fill(null),this.arg[0]=new GeometryGraph(0,t,n),this.arg[1]=new GeometryGraph(1,e,n)}}function OverlayOp(){this.ptLocator=new PointLocator,this.geomFact=null,this.resultGeom=null,this.graph=null,this.edgeList=new EdgeList,this.resultPolyList=new ArrayList,this.resultLineList=new ArrayList,this.resultPointList=new ArrayList;var t=arguments[0],e=arguments[1];GeometryGraphOperation.call(this,t,e),this.graph=new PlanarGraph(new OverlayNodeFactory),this.geomFact=t.getFactory()}function PolygonizeDirectedEdge(){this.edgeRing=null,this.next=null,this.label=-1;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];DirectedEdge$1.call(this,t,e,n,i)}function PolygonizeEdge(){Edge$1.apply(this),this.line=null;var t=arguments[0];this.line=t}function EdgeRing$1(){this.factory=null,this.deList=new ArrayList,this.lowestEdge=null,this.ring=null,this.ringPts=null,this.holes=null,this.shell=null,this._isHole=null,this._isProcessed=!1,this._isIncludedSet=!1,this._isIncluded=!1;var t=arguments[0];this.factory=t}function EnvelopeComparator(){}function PolygonizeGraph(){PlanarGraph$1.apply(this),this.factory=null;var t=arguments[0];this.factory=t}function Polygonizer(){if(this.lineStringAdder=new LineStringAdder(this),this.graph=null,this.dangles=new ArrayList,this.cutEdges=new ArrayList,this.invalidRingLines=new ArrayList,this.holeList=null,this.shellList=null,this.polyList=null,this.isCheckingRingsValid=!0,this.extractOnlyPolygonal=null,this.geomFactory=null,0===arguments.length)Polygonizer.call(this,!1);else if(1===arguments.length){var t=arguments[0];this.extractOnlyPolygonal=t}}function LineStringAdder(){this.p=null;var t=arguments[0];this.p=t}function EdgeEndBuilder(){}function EdgeEndBundle(){if(this.edgeEnds=new ArrayList,1===arguments.length){var t=arguments[0];EdgeEndBundle.call(this,null,t)}else if(2===arguments.length){var t=(arguments[0],arguments[1]);EdgeEnd.call(this,t.getEdge(),t.getCoordinate(),t.getDirectedCoordinate(),new Label(t.getLabel())),this.insert(t)}}function EdgeEndBundleStar(){EdgeEndStar.apply(this)}function RelateNode(){var t=arguments[0],e=arguments[1];Node$1.call(this,t,e)}function RelateNodeFactory(){NodeFactory.apply(this)}function RelateComputer(){this.li=new RobustLineIntersector,this.ptLocator=new PointLocator,this.arg=null,this.nodes=new NodeMap(new RelateNodeFactory),this.im=null,this.isolatedEdges=new ArrayList,this.invalidPoint=null;var t=arguments[0];this.arg=t}function RelateOp$1(){if(this._relate=null,2===arguments.length){var t=arguments[0],e=arguments[1];GeometryGraphOperation.call(this,t,e),this._relate=new RelateComputer(this.arg)}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];GeometryGraphOperation.call(this,t,e,n),this._relate=new RelateComputer(this.arg)}}function GeometryCombiner(){this.geomFactory=null,this.skipEmpty=!1,this.inputGeoms=null;var t=arguments[0];this.geomFactory=GeometryCombiner.extractFactory(t),this.inputGeoms=t}function CascadedPolygonUnion(){this.inputPolys=null,this.geomFactory=null;var t=arguments[0];this.inputPolys=t,null===this.inputPolys&&(this.inputPolys=new ArrayList)}function PointGeometryUnion(){this.pointGeom=null,this.otherGeom=null,this.geomFact=null;var t=arguments[0],e=arguments[1];this.pointGeom=t,this.otherGeom=e,this.geomFact=e.getFactory()}function LineStringSnapper(){if(this.snapTolerance=0,this.srcPts=null,this.seg=new LineSegment,this.allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof LineString&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];LineStringSnapper.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],e=arguments[1];this.srcPts=n,this._isClosed=LineStringSnapper.isClosed(n),this.snapTolerance=e}}function GeometrySnapper(){this.srcGeom=null;var t=arguments[0];this.srcGeom=t}function SnapTransformer(){if(GeometryTransformer.apply(this),this.snapTolerance=null,this.snapPts=null,this.isSelfSnap=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this.snapTolerance=t,this.snapPts=e}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];this.snapTolerance=t,this.snapPts=e,this.isSelfSnap=n}}function CommonBits(){this.isFirst=!0,this.commonMantissaBitsCount=53,this.commonBits=0,this.commonSignExp=null}function CommonBitsRemover(){this.commonCoord=null,this.ccFilter=new CommonCoordinateFilter}function CommonCoordinateFilter(){this.commonBitsX=new CommonBits,this.commonBitsY=new CommonBits}function Translater(){this.trans=null;var t=arguments[0];this.trans=t}function SnapOverlayOp(){this.geom=new Array(2).fill(null),this.snapTolerance=null,this.cbr=null;var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e,this.computeSnapTolerance()}function SnapIfNeededOverlayOp(){this.geom=new Array(2).fill(null);var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e}function GeometryExtracter(){this.clz=null,this.comps=null;var t=arguments[0],e=arguments[1];this.clz=t,this.comps=e}function UnaryUnionOp(){if(this.polygons=new ArrayList,this.lines=new ArrayList,this.points=new ArrayList,this.geomFact=null,1===arguments.length){if(hasInterface(arguments[0],Collection)){var t=arguments[0];this.extract(t)}else if(arguments[0]instanceof Geometry){var e=arguments[0];this.extract(e)}}else if(2===arguments.length){var t=arguments[0],n=arguments[1];this.geomFact=n,this.extract(t)}}function ConnectedInteriorTester(){this.geometryFactory=new GeometryFactory,this.geomGraph=null,this.disconnectedRingcoord=null;var t=arguments[0];this.geomGraph=t}function NodeBase$1(){this.items=new ArrayList,this.subnode=[null,null]}function Interval(){if(this.min=null,this.max=null,0===arguments.length)this.min=0,this.max=0;else if(1===arguments.length){var t=arguments[0];this.init(t.min,t.max)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.init(e,n)}}function Key$1(){this.pt=0,this.level=0,this.interval=null;var t=arguments[0];this.computeKey(t)}function Node$3(){NodeBase$1.apply(this),this.interval=null,this.centre=null,this.level=null;var t=arguments[0],e=arguments[1];this.interval=t,this.level=e,this.centre=(t.getMin()+t.getMax())/2}function Root$1(){NodeBase$1.apply(this)}function Bintree(){this.root=null,this.minExtent=1,this.root=new Root$1}function PointInRing(){}function MCPointInRing(){this.ring=null,this.tree=null,this.crossings=0,this.interval=new Interval;var t=arguments[0];this.ring=t,this.buildIndex()}function MCSelecter(){MonotoneChainSelectAction.apply(this),this.mcp=null,this.p=null;var t=arguments[0],e=arguments[1];this.mcp=t,this.p=e}function RelateNodeGraph(){this.nodes=new NodeMap(new RelateNodeFactory)}function ConsistentAreaTester(){this.li=new RobustLineIntersector,this.geomGraph=null,this.nodeGraph=new RelateNodeGraph,this.invalidPoint=null;var t=arguments[0];this.geomGraph=t}function IndexedNestedRingTester(){this.graph=null,this.rings=new ArrayList,this.totalEnv=new Envelope,this.index=null,this.nestedPt=null;var t=arguments[0];this.graph=t}function TopologyValidationError(){if(this.errorType=null,this.pt=null,1===arguments.length){var t=arguments[0];TopologyValidationError.call(this,t,null)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.errorType=t,null!==e&&(this.pt=e.copy())}}function IsValidOp(){this.parentGeometry=null,this.isSelfTouchingRingFormingHoleValid=!1,this.validErr=null;var t=arguments[0];this.parentGeometry=t}function PrecisionReducerCoordinateOperation(){GeometryEditor.CoordinateOperation.apply(this),this.targetPM=null,this.removeCollapsed=!0;var t=arguments[0],e=arguments[1];this.targetPM=t,this.removeCollapsed=e}function GeometryPrecisionReducer(){this.targetPM=null,this.removeCollapsed=!0,this.changePrecisionModel=!1,this.isPointwise=!1;var t=arguments[0];this.targetPM=t}function DouglasPeuckerLineSimplifier(){this.pts=null,this.usePt=null,this.distanceTolerance=null,this.seg=new LineSegment;var t=arguments[0];this.pts=t}function DouglasPeuckerSimplifier(){this.inputGeom=null,this.distanceTolerance=null,this.isEnsureValidTopology=!0;var t=arguments[0];this.inputGeom=t}function DPTransformer(){GeometryTransformer.apply(this),this.isEnsureValidTopology=!0,this.distanceTolerance=null;var t=arguments[0],e=arguments[1];this.isEnsureValidTopology=t,this.distanceTolerance=e}function TaggedLineSegment(){if(this.parent=null,this.index=null,2===arguments.length){var t=arguments[0],e=arguments[1];TaggedLineSegment.call(this,t,e,null,-1)}else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];LineSegment.call(this,t,e),this.parent=n,this.index=i}}function TaggedLineString(){if(this.parentLine=null,this.segs=null,this.resultSegs=new ArrayList,this.minimumSize=null,1===arguments.length){var t=arguments[0];TaggedLineString.call(this,t,2)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.parentLine=t,this.minimumSize=e,this.init()}}function LineSegmentIndex(){this.index=new Quadtree}function LineSegmentVisitor(){this.querySeg=null,this.items=new ArrayList;var t=arguments[0];this.querySeg=t}function TaggedLineStringSimplifier(){this.li=new RobustLineIntersector,this.inputIndex=new LineSegmentIndex,this.outputIndex=new LineSegmentIndex,this.line=null,this.linePts=null,this.distanceTolerance=0;var t=arguments[0],e=arguments[1];this.inputIndex=t,this.outputIndex=e}function TaggedLinesSimplifier(){this.inputIndex=new LineSegmentIndex,this.outputIndex=new LineSegmentIndex,this.distanceTolerance=0}function TopologyPreservingSimplifier(){this.inputGeom=null,this.lineSimplifier=new TaggedLinesSimplifier,this.linestringMap=null;var t=arguments[0];this.inputGeom=t}function LineStringTransformer(){GeometryTransformer.apply(this),this.linestringMap=null;var t=arguments[0];this.linestringMap=t}function LineStringMapBuilderFilter(){this.tps=null;var t=arguments[0];this.tps=t}function SplitSegment(){this.seg=null,this.segLen=null,this.splitPt=null,this.minimumLen=0;var t=arguments[0];this.seg=t,this.segLen=t.getLength()}function ConstraintSplitPointFinder(){}function NonEncroachingSplitPointFinder(){}function TrianglePredicate(){}function Vertex(){if(this.p=null,1===arguments.length){var t=arguments[0];this.p=new Coordinate(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p=new Coordinate(e,n)}else if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2];this.p=new Coordinate(e,n,i)}}function ConstraintVertex(){this._isOnConstraint=null,this.constraint=null;var t=arguments[0];Vertex.call(this,t)}function QuadEdge(){this._rot=null,this.vertex=null,this.next=null,this.data=null}function IncrementalDelaunayTriangulator(){this.subdiv=null,this.isUsingTolerance=!1;var t=arguments[0];this.subdiv=t,this.isUsingTolerance=t.getTolerance()>0}function QuadEdgeLocator(){}function LastFoundQuadEdgeLocator(){this.subdiv=null,this.lastEdge=null;var t=arguments[0];this.subdiv=t,this.init()}function LocateFailureException(){if(this.seg=null,1===arguments.length){if("string"==typeof arguments[0]){var t=arguments[0];RuntimeException.call(this,t)}else if(arguments[0]instanceof LineSegment){var e=arguments[0];RuntimeException.call(this,"Locate failed to converge (at edge: "+e+"). Possible causes include invalid Subdivision topology or very close sites"),this.seg=new LineSegment(e)}}else if(2===arguments.length){var t=arguments[0],e=arguments[1];RuntimeException.call(this,LocateFailureException.msgWithSpatial(t,e)),this.seg=new LineSegment(e)}}function TriangleVisitor(){}function QuadEdgeSubdivision(){this.visitedKey=0,this.quadEdges=new ArrayList,this.startingEdge=null,this.tolerance=null,this.edgeCoincidenceTolerance=null,this.frameVertex=new Array(3).fill(null),this.frameEnv=null,this.locator=null,this.seg=new LineSegment,this.triEdges=new Array(3).fill(null);var t=arguments[0],e=arguments[1];this.tolerance=e,this.edgeCoincidenceTolerance=e/QuadEdgeSubdivision.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(t),this.startingEdge=this.initSubdiv(),this.locator=new LastFoundQuadEdgeLocator(this)}function TriangleCircumcentreVisitor(){}function TriangleEdgesListVisitor(){this.triList=new ArrayList}function TriangleVertexListVisitor(){this.triList=new ArrayList}function TriangleCoordinatesVisitor(){this.coordList=new CoordinateList,this.triCoords=new ArrayList}function Segment(){if(this.ls=null,this.data=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.ls=new LineSegment(t,e)}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];this.ls=new LineSegment(t,e),this.data=n}else if(6===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],l=arguments[5];Segment.call(this,new Coordinate(i,r,o),new Coordinate(s,a,l))}else if(7===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],l=arguments[5],n=arguments[6];Segment.call(this,new Coordinate(i,r,o),new Coordinate(s,a,l),n)}}function KdNodeVisitor(){}function KdNode(){if(this.p=null,this.data=null,this.left=null,this.right=null,this.count=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.p=new Coordinate(t),this.left=null,this.right=null,this.count=1,this.data=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],e=arguments[2];this.p=new Coordinate(n,i),this.left=null,this.right=null,this.count=1,this.data=e}}function KdTree(){if(this.root=null,this.numberOfNodes=null,this.tolerance=null,0===arguments.length)KdTree.call(this,0);else if(1===arguments.length){var t=arguments[0];this.tolerance=t}}function BestMatchVisitor(){this.tolerance=null,this.matchNode=null,this.matchDist=0,this.p=null;var t=arguments[0],e=arguments[1];this.p=t,this.tolerance=e}function ConformingDelaunayTriangulator(){this.initialVertices=null,this.segVertices=null,this.segments=new ArrayList,this.subdiv=null,this.incDel=null,this.convexHull=null,this.splitFinder=new NonEncroachingSplitPointFinder,this.kdt=null,this.vertexFactory=null,this.computeAreaEnv=null,this.splitPt=null,this.tolerance=null;var t=arguments[0],e=arguments[1];this.initialVertices=new ArrayList(t),this.tolerance=e,this.kdt=new KdTree(e)}function DelaunayTriangulationBuilder(){this.siteCoords=null,this.tolerance=0,this.subdiv=null}function ConformingDelaunayTriangulationBuilder(){this.siteCoords=null,this.constraintLines=null,this.tolerance=0,this.subdiv=null,this.constraintVertexMap=new TreeMap}function VoronoiDiagramBuilder(){this.siteCoords=null,this.tolerance=0,this.subdiv=null,this.clipEnv=null,this.diagramEnv=null}function GeometryCollectionMapper(){this.mapOp=null;var t=arguments[0];this.mapOp=t}function RectangleContains(){this.rectEnv=null;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal()}function RectangleLineIntersector(){this.li=new RobustLineIntersector,this.rectEnv=null,this.diagUp0=null,this.diagUp1=null,this.diagDown0=null,this.diagDown1=null;var t=arguments[0];this.rectEnv=t,this.diagUp0=new Coordinate(t.getMinX(),t.getMinY()),this.diagUp1=new Coordinate(t.getMaxX(),t.getMaxY()),this.diagDown0=new Coordinate(t.getMinX(),t.getMaxY()),this.diagDown1=new Coordinate(t.getMaxX(),t.getMinY())}function ShortCircuitedGeometryVisitor(){this._isDone=!1}function RectangleIntersects(){this.rectangle=null,this.rectEnv=null;var t=arguments[0];this.rectangle=t,this.rectEnv=t.getEnvelopeInternal()}function EnvelopeIntersectsVisitor(){ShortCircuitedGeometryVisitor.apply(this),this.rectEnv=null,this._intersects=!1;var t=arguments[0];this.rectEnv=t}function GeometryContainsPointVisitor(){ShortCircuitedGeometryVisitor.apply(this),this.rectSeq=null,this.rectEnv=null,this._containsPoint=!1;var t=arguments[0];this.rectSeq=t.getExteriorRing().getCoordinateSequence(),this.rectEnv=t.getEnvelopeInternal()}function RectangleIntersectsSegmentVisitor(){ShortCircuitedGeometryVisitor.apply(this),this.rectEnv=null,this.rectIntersector=null,this.hasIntersection=!1,this.p0=new Coordinate,this.p1=new Coordinate;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal(),this.rectIntersector=new RectangleLineIntersector(this.rectEnv)}function patch(){var t={union:function(){if(0===arguments.length)return UnaryUnionOp.union(this);if(1===arguments.length){var t=arguments[0];if(this.isEmpty()||t.isEmpty()){if(this.isEmpty()&&t.isEmpty())return OverlayOp.createEmptyResult(OverlayOp.UNION,this,t,this.factory);if(this.isEmpty())return t.copy();if(t.isEmpty())return this.copy()}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),SnapIfNeededOverlayOp.overlayOp(this,t,OverlayOp.UNION)}},isValid:function(){return IsValidOp.isValid(this)},intersection:function(t){if(this.isEmpty()||t.isEmpty())return OverlayOp.createEmptyResult(OverlayOp.INTERSECTION,this,t,this.factory);if(this.isGeometryCollection()){var e=t;return GeometryCollectionMapper.map(this,{interfaces_:function(){return[MapOp]},map:function(t){return t.intersection(e)}})}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),SnapIfNeededOverlayOp.overlayOp(this,t,OverlayOp.INTERSECTION)},intersects:function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.isRectangle()?RectangleIntersects.intersects(this,t):t.isRectangle()?RectangleIntersects.intersects(t,this):this.relate(t).isIntersects():!1},buffer:function(){if(1===arguments.length){var t=arguments[0];return BufferOp.bufferOp(this,t)}if(2===arguments.length){var t=arguments[0],e=arguments[1];return BufferOp.bufferOp(this,t,e)}if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return BufferOp.bufferOp(this,t,e,n)}},convexHull:function(){return new ConvexHull(this).getConvexHull()},relate:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(1===e.length){var i=e[0];return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(i),RelateOp$1.relate(this,i)}if(2===e.length){var i=e[0],r=e[1];return this.relate(i).matches(r)}},getCentroid:function(){if(this.isEmpty())return this.factory.createPoint();var t=Centroid.getCentroid(this);return this.createPointFromInternalCoord(t,this)},getInteriorPoint:function(){if(this.isEmpty())return this.factory.createPoint();var t=null,e=this.getDimension();if(0===e){var n=new InteriorPointPoint(this);t=n.getInteriorPoint()}else if(1===e){var n=new InteriorPointLine(this);t=n.getInteriorPoint()}else{var n=new InteriorPointArea(this);t=n.getInteriorPoint()}return this.createPointFromInternalCoord(t,this)},symDifference:function(t){if(this.isEmpty()||t.isEmpty()){if(this.isEmpty()&&t.isEmpty())return OverlayOp.createEmptyResult(OverlayOp.SYMDIFFERENCE,this,t,this.factory);if(this.isEmpty())return t.copy();if(t.isEmpty())return this.copy()}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),SnapIfNeededOverlayOp.overlayOp(this,t,OverlayOp.SYMDIFFERENCE)},createPointFromInternalCoord:function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},disjoint:function(t){return!this.intersects(t)},toText:function(){var t=new WKTWriter;return t.write(this)},contains:function(t){return this.getEnvelopeInternal().contains(t.getEnvelopeInternal())?this.isRectangle()?RectangleContains.contains(this,t):this.relate(t).isContains():!1},difference:function(t){return this.isEmpty()?OverlayOp.createEmptyResult(OverlayOp.DIFFERENCE,this,t,this.factory):t.isEmpty()?this.copy():(this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),SnapIfNeededOverlayOp.overlayOp(this,t,OverlayOp.DIFFERENCE))},isSimple:function(){var t=new IsSimpleOp(this);return t.isSimple()},isWithinDistance:function(t,e){var n=this.getEnvelopeInternal().distance(t.getEnvelopeInternal());return n>e?!1:DistanceOp.isWithinDistance(this,t,e)},distance:function(t){return DistanceOp.distance(this,t)},isEquivalentClass:function(t){return this.getClass()===t.getClass()}};for(var e in t)Geometry.prototype[e]=t[e]}if(require("core-js/shim"),require("babel-regenerator-runtime"),global._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");global._babelPolyfill=!0,extend(NumberUtil.prototype,{interfaces_:function(){return[]},getClass:function(){return NumberUtil}}),NumberUtil.equalsWithTolerance=function(t,e,n){return Math.abs(t-e)<=n},Double.isNaN=function(t){return Number.isNaN(t)},Double.doubleToLongBits=function(t){return t},Double.longBitsToDouble=function(t){return t},Double.isInfinite=function(t){return!Number.isFinite(t)},Double.MAX_VALUE=Number.MAX_VALUE,inherits(AssertionFailedException,RuntimeException),extend(AssertionFailedException.prototype,{interfaces_:function(){return[]},getClass:function(){return AssertionFailedException}}),extend(Assert.prototype,{interfaces_:function(){return[]},getClass:function(){return Assert}}),Assert.shouldNeverReachHere=function(){if(0===arguments.length)Assert.shouldNeverReachHere(null);else if(1===arguments.length){var t=arguments[0];throw new AssertionFailedException("Should never reach here"+(null!==t?": "+t:""))}},Assert.isTrue=function(){if(1===arguments.length){var t=arguments[0];Assert.isTrue(t,null)}else if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!t)throw null===e?new AssertionFailedException:new AssertionFailedException(e)}},Assert.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];Assert.equals(t,e,null)}else if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];if(!e.equals(t))throw new AssertionFailedException("Expected "+t+" but encountered "+e+(null!==n?": "+n:""))}},extend(Coordinate.prototype,{setOrdinate:function(t,e){switch(t){case Coordinate.X:this.x=e;break;case Coordinate.Y:this.y=e;break;case Coordinate.Z:this.z=e;break;default:throw new IllegalArgumentException("Invalid ordinate index: "+t)}},equals2D:function(){if(1===arguments.length){var t=arguments[0];return this.x!==t.x?!1:this.y===t.y}if(2===arguments.length){var e=arguments[0],n=arguments[1];return NumberUtil.equalsWithTolerance(this.x,e.x,n)?!!NumberUtil.equalsWithTolerance(this.y,e.y,n):!1}},getOrdinate:function(t){switch(t){case Coordinate.X:return this.x;case Coordinate.Y:return this.y;case Coordinate.Z:return this.z}throw new IllegalArgumentException("Invalid ordinate index: "+t)},equals3D:function(t){return this.x===t.x&&this.y===t.y&&(this.z===t.z||Double.isNaN(this.z)&&Double.isNaN(t.z))},equals:function(t){return t instanceof Coordinate?this.equals2D(t):!1},equalInZ:function(t,e){return NumberUtil.equalsWithTolerance(this.z,t.z,e)},compareTo:function(t){var e=t;return this.x<e.x?-1:this.x>e.x?1:this.y<e.y?-1:this.y>e.y?1:0},clone:function(){try{var t=null;return t}catch(t){if(t instanceof CloneNotSupportedException)return Assert.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}finally{}},copy:function(){return new Coordinate(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},distance3D:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},distance:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+Coordinate.hashCode(this.x),t=37*t+Coordinate.hashCode(this.y)},setCoordinate:function(t){this.x=t.x,this.y=t.y,this.z=t.z},interfaces_:function(){return[Comparable,Clonable,Serializable]},getClass:function(){return Coordinate}}),Coordinate.hashCode=function(){
if(1===arguments.length){var t=arguments[0],e=Double.doubleToLongBits(t);return Math.trunc(e^e>>>32)}},extend(DimensionalComparator.prototype,{compare:function(t,e){var n=t,i=e,r=DimensionalComparator.compare(n.x,i.x);if(0!==r)return r;var o=DimensionalComparator.compare(n.y,i.y);if(0!==o)return o;if(this.dimensionsToTest<=2)return 0;var s=DimensionalComparator.compare(n.z,i.z);return s},interfaces_:function(){return[Comparator]},getClass:function(){return DimensionalComparator}}),DimensionalComparator.compare=function(t,e){return e>t?-1:t>e?1:Double.isNaN(t)?Double.isNaN(e)?0:-1:Double.isNaN(e)?1:0},Coordinate.DimensionalComparator=DimensionalComparator,Coordinate.serialVersionUID=0x5cbf2c235c7e5800,Coordinate.NULL_ORDINATE=Double.NaN,Coordinate.X=0,Coordinate.Y=1,Coordinate.Z=2,extend(Envelope.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(t){if(!(t instanceof Envelope))return!1;var e=t;return this.isNull()?e.isNull():this.maxx===e.getMaxX()&&this.maxy===e.getMaxY()&&this.minx===e.getMinX()&&this.miny===e.getMinY()},intersection:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new Envelope;var e=this.minx>t.minx?this.minx:t.minx,n=this.miny>t.miny?this.miny:t.miny,i=this.maxx<t.maxx?this.maxx:t.maxx,r=this.maxy<t.maxy?this.maxy:t.maxy;return new Envelope(e,i,n,r)},isNull:function(){return this.maxx<this.minx},getMaxX:function(){return this.maxx},covers:function(){if(1===arguments.length){if(arguments[0]instanceof Coordinate){var t=arguments[0];return this.covers(t.x,t.y)}if(arguments[0]instanceof Envelope){var e=arguments[0];return this.isNull()||e.isNull()?!1:e.getMinX()>=this.minx&&e.getMaxX()<=this.maxx&&e.getMinY()>=this.miny&&e.getMaxY()<=this.maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.isNull()?!1:n>=this.minx&&n<=this.maxx&&i>=this.miny&&i<=this.maxy}},intersects:function(){if(1===arguments.length){if(arguments[0]instanceof Envelope){var t=arguments[0];return this.isNull()||t.isNull()?!1:!(t.minx>this.maxx||t.maxx<this.minx||t.miny>this.maxy||t.maxy<this.miny)}if(arguments[0]instanceof Coordinate){var e=arguments[0];return this.intersects(e.x,e.y)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.isNull()?!1:!(n>this.maxx||n<this.minx||i>this.maxy||i<this.miny)}},getMinY:function(){return this.miny},getMinX:function(){return this.minx},expandToInclude:function(){if(1===arguments.length){if(arguments[0]instanceof Coordinate){var t=arguments[0];this.expandToInclude(t.x,t.y)}else if(arguments[0]instanceof Envelope){var e=arguments[0];if(e.isNull())return null;this.isNull()?(this.minx=e.getMinX(),this.maxx=e.getMaxX(),this.miny=e.getMinY(),this.maxy=e.getMaxY()):(e.minx<this.minx&&(this.minx=e.minx),e.maxx>this.maxx&&(this.maxx=e.maxx),e.miny<this.miny&&(this.miny=e.miny),e.maxy>this.maxy&&(this.maxy=e.maxy))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.isNull()?(this.minx=n,this.maxx=n,this.miny=i,this.maxy=i):(n<this.minx&&(this.minx=n),n>this.maxx&&(this.maxx=n),i<this.miny&&(this.miny=i),i>this.maxy&&(this.maxy=i))}},minExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return e>t?t:e},getWidth:function(){return this.isNull()?0:this.maxx-this.minx},compareTo:function(t){var e=t;return this.isNull()?e.isNull()?0:-1:e.isNull()?1:this.minx<e.minx?-1:this.minx>e.minx?1:this.miny<e.miny?-1:this.miny>e.miny?1:this.maxx<e.maxx?-1:this.maxx>e.maxx?1:this.maxy<e.maxy?-1:this.maxy>e.maxy?1:0},translate:function(t,e){return this.isNull()?null:void this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},toString:function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},setToNull:function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},getHeight:function(){return this.isNull()?0:this.maxy-this.miny},maxExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},expandBy:function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];if(this.isNull())return null;this.minx-=e,this.maxx+=e,this.miny-=n,this.maxy+=n,(this.minx>this.maxx||this.miny>this.maxy)&&this.setToNull()}},contains:function(){if(1===arguments.length){if(arguments[0]instanceof Envelope){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof Coordinate){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},centre:function(){return this.isNull()?null:new Coordinate((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof Coordinate){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Envelope){var e=arguments[0];this.minx=e.minx,this.maxx=e.maxx,this.miny=e.miny,this.maxy=e.maxy}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];o>r?(this.minx=r,this.maxx=o):(this.minx=o,this.maxx=r),a>s?(this.miny=s,this.maxy=a):(this.miny=a,this.maxy=s)}},getMaxY:function(){return this.maxy},distance:function(t){if(this.intersects(t))return 0;var e=0;this.maxx<t.minx?e=t.minx-this.maxx:this.minx>t.maxx&&(e=this.minx-t.maxx);var n=0;return this.maxy<t.miny?n=t.miny-this.maxy:this.miny>t.maxy&&(n=this.miny-t.maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+Coordinate.hashCode(this.minx),t=37*t+Coordinate.hashCode(this.maxx),t=37*t+Coordinate.hashCode(this.miny),t=37*t+Coordinate.hashCode(this.maxy)},interfaces_:function(){return[Comparable,Serializable]},getClass:function(){return Envelope}}),Envelope.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var t=arguments[0],e=arguments[1],i=arguments[2],r=arguments[3],o=Math.min(i.x,r.x),s=Math.max(i.x,r.x),a=Math.min(t.x,e.x),l=Math.max(t.x,e.x);return a>s?!1:o>l?!1:(o=Math.min(i.y,r.y),s=Math.max(i.y,r.y),a=Math.min(t.y,e.y),l=Math.max(t.y,e.y),a>s?!1:!(o>l))}},Envelope.serialVersionUID=0x51845cd552189800,inherits(NotRepresentableException,Exception),extend(NotRepresentableException.prototype,{interfaces_:function(){return[]},getClass:function(){return NotRepresentableException}}),extend(Location.prototype,{interfaces_:function(){return[]},getClass:function(){return Location}}),Location.toLocationSymbol=function(t){switch(t){case Location.EXTERIOR:return"e";case Location.BOUNDARY:return"b";case Location.INTERIOR:return"i";case Location.NONE:return"-"}throw new IllegalArgumentException("Unknown location value: "+t)},Location.INTERIOR=0,Location.BOUNDARY=1,Location.EXTERIOR=2,Location.NONE=-1,extend(MathUtil.prototype,{interfaces_:function(){return[]},getClass:function(){return MathUtil}}),MathUtil.log10=function(t){var e=Math.log(t);return Double.isInfinite(e)?e:Double.isNaN(e)?e:e/MathUtil.LOG_10},MathUtil.min=function(t,e,n,i){var r=t;return r>e&&(r=e),r>n&&(r=n),r>i&&(r=i),r},MathUtil.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return e>t?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var t=arguments[0],e=arguments[1],n=arguments[2];return e>t?e:t>n?n:t}},MathUtil.wrap=function(t,e){return 0>t?e- -t%e:t%e},MathUtil.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3],i=t;return e>i&&(i=e),n>i&&(i=n),r>i&&(i=r),i}},MathUtil.average=function(t,e){return(t+e)/2},MathUtil.LOG_10=Math.log(10),StringBuffer.prototype.append=function(t){this.str+=t},StringBuffer.prototype.setCharAt=function(t,e){return this.str.substr(0,t)+e+this.str.substr(t+1)},StringBuffer.prototype.toString=function(t){return this.str},Integer.prototype.intValue=function(){return this.value},Integer.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},Integer.isNaN=function(t){return Number.isNaN(t)},Character.isWhitespace=function(t){return 32>=t&&t>=0||127==t},Character.toUpperCase=function(t){return t.toUpperCase()},extend(DD.prototype,{le:function(t){return this.hi<t.hi||this.hi===t.hi&&this.lo<=t.lo},extractSignificantDigits:function(t,e){var n=this.abs(),i=DD.magnitude(n.hi),r=DD.TEN.pow(i);n=n.divide(r),n.gt(DD.TEN)?(n=n.divide(DD.TEN),i+=1):n.lt(DD.ONE)&&(n=n.multiply(DD.TEN),i-=1);for(var o=i+1,s=new StringBuffer,a=DD.MAX_PRINT_DIGITS-1,l=0;a>=l;l++){t&&l===o&&s.append(".");var u=Math.trunc(n.hi);if(0>u)break;var c=!1,h=0;u>9?(c=!0,h="9"):h="0"+u,s.append(h),n=n.subtract(DD.valueOf(u)).multiply(DD.TEN),c&&n.selfAdd(DD.TEN);var d=!0,g=DD.magnitude(n.hi);if(0>g&&Math.abs(g)>=a-l&&(d=!1),!d)break}return e[0]=i,s.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this.hi+this.lo},subtract:function(){if(arguments[0]instanceof DD){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var t=arguments[0];return this.add(-t)}},equals:function(){if(1===arguments.length){var t=arguments[0];return this.hi===t.hi&&this.lo===t.lo}},isZero:function(){return 0===this.hi&&0===this.lo},selfSubtract:function(){if(arguments[0]instanceof DD){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t.hi,-t.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(t){return this.le(t)?this:t},selfDivide:function(){if(1===arguments.length){if(arguments[0]instanceof DD){var t=arguments[0];return this.selfDivide(t.hi,t.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=null,r=null,o=null,s=null,a=null,l=null,u=null,c=null;return a=this.hi/e,l=DD.SPLIT*a,i=l-a,c=DD.SPLIT*e,i=l-i,r=a-i,o=c-e,u=a*e,o=c-o,s=e-o,c=i*o-u+i*s+r*o+r*s,l=(this.hi-u-c+this.lo-a*n)/e,c=a+l,this.hi=c,this.lo=a-c+l,this}},dump:function(){return"DD<"+this.hi+", "+this.lo+">"},divide:function(){if(arguments[0]instanceof DD){var t=arguments[0],e=null,n=null,i=null,r=null,o=null,s=null,a=null,l=null;o=this.hi/t.hi,s=DD.SPLIT*o,e=s-o,l=DD.SPLIT*t.hi,e=s-e,n=o-e,i=l-t.hi,a=o*t.hi,i=l-i,r=t.hi-i,l=e*i-a+e*r+n*i+n*r,s=(this.hi-a-l+this.lo-o*t.lo)/t.hi,l=o+s;var u=l,c=o-l+s;return new DD(u,c)}if("number"==typeof arguments[0]){var t=arguments[0];return Double.isNaN(t)?DD.createNaN():DD.copy(this).selfDivide(t,0)}},ge:function(t){return this.hi>t.hi||this.hi===t.hi&&this.lo>=t.lo},pow:function(t){if(0===t)return DD.valueOf(1);var e=new DD(this),n=DD.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2===1&&n.selfMultiply(e),i/=2,i>0&&(e=e.sqr());else n=e;return 0>t?n.reciprocal():n},ceil:function(){if(this.isNaN())return DD.NaN;var t=Math.ceil(this.hi),e=0;return t===this.hi&&(e=Math.ceil(this.lo)),new DD(t,e)},compareTo:function(t){var e=t;return this.hi<e.hi?-1:this.hi>e.hi?1:this.lo<e.lo?-1:this.lo>e.lo?1:0},rint:function(){if(this.isNaN())return this;var t=this.add(.5);return t.floor()},setValue:function(){if(arguments[0]instanceof DD){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var t=arguments[0];return this.init(t),this}},max:function(t){return this.ge(t)?this:t},sqrt:function(){if(this.isZero())return DD.valueOf(0);if(this.isNegative())return DD.NaN;var t=1/Math.sqrt(this.hi),e=this.hi*t,n=DD.valueOf(e),i=this.subtract(n.sqr()),r=i.hi*(.5*t);return n.add(r)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof DD){var t=arguments[0];return this.selfAdd(t.hi,t.lo)}if("number"==typeof arguments[0]){var t=arguments[0],e=null,n=null,i=null,r=null,o=null,s=null;return i=this.hi+t,o=i-this.hi,r=i-o,r=t-o+(this.hi-r),s=r+this.lo,e=i+s,n=s+(i-e),this.hi=e+n,this.lo=n+(e-this.hi),this}}else if(2===arguments.length){var a=arguments[0],l=arguments[1],e=null,n=null,u=null,c=null,i=null,r=null,o=null,s=null;i=this.hi+a,u=this.lo+l,o=i-this.hi,s=u-this.lo,r=i-o,c=u-s,r=a-o+(this.hi-r),c=l-s+(this.lo-c),o=r+u,e=i+o,n=o+(i-e),o=c+n;var h=e+o,d=o+(e-h);return this.hi=h,this.lo=d,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof DD){var t=arguments[0];return this.selfMultiply(t.hi,t.lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=null,r=null,o=null,s=null,a=null,l=null;a=DD.SPLIT*this.hi,i=a-this.hi,l=DD.SPLIT*e,i=a-i,r=this.hi-i,o=l-e,a=this.hi*e,o=l-o,s=e-o,l=i*o-a+i*s+r*o+r*s+(this.hi*n+this.lo*e);var u=a+l;i=a-u;var c=l+i;return this.hi=u,this.lo=c,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return DD.NaN;var t=Math.floor(this.hi),e=0;return t===this.hi&&(e=Math.floor(this.lo)),new DD(t,e)},negate:function(){return this.isNaN()?this:new DD(-this.hi,-this.lo)},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}finally{}},multiply:function(){if(arguments[0]instanceof DD){var t=arguments[0];return t.isNaN()?DD.createNaN():DD.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var t=arguments[0];return Double.isNaN(t)?DD.createNaN():DD.copy(this).selfMultiply(t,0)}},isNaN:function(){return Double.isNaN(this.hi)},intValue:function(){return Math.trunc(this.hi)},toString:function(){var t=DD.magnitude(this.hi);return t>=-3&&20>=t?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(0>i)r="0."+DD.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var o=i-n.length,s=DD.stringOfChar("0",o);r=n+s+".0"}return this.isNegative()?"-"+r:r},reciprocal:function(){var t=null,e=null,n=null,i=null,r=null,o=null,s=null,a=null;r=1/this.hi,o=DD.SPLIT*r,t=o-r,a=DD.SPLIT*this.hi,t=o-t,e=r-t,n=a-this.hi,s=r*this.hi,n=a-n,i=this.hi-n,a=t*n-s+t*i+e*n+e*i,o=(1-s-a-r*this.lo)/this.hi;var l=r+o,u=r-l+o;return new DD(l,u)},toSciNotation:function(){if(this.isZero())return DD.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=DD.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new IllegalStateException("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var o=n.charAt(0)+"."+r;return this.isNegative()?"-"+o+i:o+i},abs:function(){return this.isNaN()?DD.NaN:this.isNegative()?this.negate():new DD(this)},isPositive:function(){return this.hi>0||0===this.hi&&this.lo>0},lt:function(t){return this.hi<t.hi||this.hi===t.hi&&this.lo<t.lo},add:function(){if(arguments[0]instanceof DD){var t=arguments[0];return DD.copy(this).selfAdd(t)}if("number"==typeof arguments[0]){var t=arguments[0];return DD.copy(this).selfAdd(t)}},init:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.hi=t,this.lo=0}else if(arguments[0]instanceof DD){var e=arguments[0];this.hi=e.hi,this.lo=e.lo}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.hi=n,this.lo=i}},gt:function(t){return this.hi>t.hi||this.hi===t.hi&&this.lo>t.lo},isNegative:function(){return this.hi<0||0===this.hi&&this.lo<0},trunc:function(){return this.isNaN()?DD.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return this.hi>0?1:this.hi<0?-1:this.lo>0?1:this.lo<0?-1:0},interfaces_:function(){return[Serializable,Comparable,Clonable]},getClass:function(){return DD}}),DD.sqr=function(t){return DD.valueOf(t).selfMultiply(t)},DD.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return DD.parse(t)}if("number"==typeof arguments[0]){var e=arguments[0];return new DD(e)}},DD.sqrt=function(t){return DD.valueOf(t).sqrt()},DD.parse=function(t){for(var e=0,n=t.length;Character.isWhitespace(t.charAt(e));)e++;var i=!1;if(n>e){var r=t.charAt(e);"-"!==r&&"+"!==r||(e++,"-"===r&&(i=!0))}for(var o=new DD,s=0,a=0,l=0;;){if(e>=n)break;var u=t.charAt(e);if(e++,Character.isDigit(u)){var c=u-"0";o.selfMultiply(DD.TEN),o.selfAdd(c),s++}else{if("."!==u){if("e"===u||"E"===u){var h=t.substring(e);try{l=Integer.parseInt(h)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+h+" in string "+t):e}finally{}break}throw new NumberFormatException("Unexpected character '"+u+"' at position "+e+" in string "+t)}a=s}}var d=o,g=s-a-l;if(0===g)d=o;else if(g>0){var f=DD.TEN.pow(g);d=o.divide(f)}else if(0>g){var f=DD.TEN.pow(-g);d=o.multiply(f)}return i?d.negate():d},DD.createNaN=function(){return new DD(Double.NaN,Double.NaN)},DD.copy=function(t){return new DD(t)},DD.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n)),r=Math.pow(10,i);return e>=10*r&&(i+=1),i},DD.stringOfChar=function(t,e){for(var n=new StringBuffer,i=0;e>i;i++)n.append(t);return n.toString()},DD.PI=new DD(3.141592653589793,1.2246467991473532e-16),DD.TWO_PI=new DD(6.283185307179586,2.4492935982947064e-16),DD.PI_2=new DD(1.5707963267948966,6.123233995736766e-17),DD.E=new DD(2.718281828459045,1.4456468917292502e-16),DD.NaN=new DD(Double.NaN,Double.NaN),DD.EPS=1.23259516440783e-32,DD.SPLIT=134217729,DD.MAX_PRINT_DIGITS=32,DD.TEN=DD.valueOf(10),DD.ONE=DD.valueOf(1),DD.SCI_NOT_EXPONENT_CHAR="E",DD.SCI_NOT_ZERO="0.0E0",extend(CGAlgorithmsDD.prototype,{interfaces_:function(){return[]},getClass:function(){return CGAlgorithmsDD}}),CGAlgorithmsDD.orientationIndex=function(t,e,n){var i=CGAlgorithmsDD.orientationIndexFilter(t,e,n);if(1>=i)return i;var r=DD.valueOf(e.x).selfAdd(-t.x),o=DD.valueOf(e.y).selfAdd(-t.y),s=DD.valueOf(n.x).selfAdd(-e.x),a=DD.valueOf(n.y).selfAdd(-e.y);return r.selfMultiply(a).selfSubtract(o.selfMultiply(s)).signum()},CGAlgorithmsDD.signOfDet2x2=function(t,e,n,i){var r=t.multiply(i).selfSubtract(e.multiply(n));return r.signum()},CGAlgorithmsDD.intersection=function(t,e,n,i){var r=DD.valueOf(i.y).selfSubtract(n.y).selfMultiply(DD.valueOf(e.x).selfSubtract(t.x)),o=DD.valueOf(i.x).selfSubtract(n.x).selfMultiply(DD.valueOf(e.y).selfSubtract(t.y)),s=r.subtract(o),a=DD.valueOf(i.x).selfSubtract(n.x).selfMultiply(DD.valueOf(t.y).selfSubtract(n.y)),l=DD.valueOf(i.y).selfSubtract(n.y).selfMultiply(DD.valueOf(t.x).selfSubtract(n.x)),u=a.subtract(l),c=u.selfDivide(s).doubleValue(),h=DD.valueOf(t.x).selfAdd(DD.valueOf(e.x).selfSubtract(t.x).selfMultiply(c)).doubleValue(),d=DD.valueOf(e.x).selfSubtract(t.x).selfMultiply(DD.valueOf(t.y).selfSubtract(n.y)),g=DD.valueOf(e.y).selfSubtract(t.y).selfMultiply(DD.valueOf(t.x).selfSubtract(n.x)),f=d.subtract(g),p=f.selfDivide(s).doubleValue(),m=DD.valueOf(n.y).selfAdd(DD.valueOf(i.y).selfSubtract(n.y).selfMultiply(p)).doubleValue();return new Coordinate(h,m)},CGAlgorithmsDD.orientationIndexFilter=function(t,e,n){var i=null,r=(t.x-n.x)*(e.y-n.y),o=(t.y-n.y)*(e.x-n.x),s=r-o;if(r>0){if(0>=o)return CGAlgorithmsDD.signum(s);i=r+o}else{if(!(0>r))return CGAlgorithmsDD.signum(s);if(o>=0)return CGAlgorithmsDD.signum(s);i=-r-o}var a=CGAlgorithmsDD.DP_SAFE_EPSILON*i;return s>=a||-s>=a?CGAlgorithmsDD.signum(s):2},CGAlgorithmsDD.signum=function(t){return t>0?1:0>t?-1:0},CGAlgorithmsDD.DP_SAFE_EPSILON=1e-15,extend(CoordinateSequence.prototype,{setOrdinate:function(t,e,n){},size:function(){},getOrdinate:function(t,e){},getCoordinate:function(){if(1===arguments.length){arguments[0]}else if(2===arguments.length){arguments[0],arguments[1]}},getCoordinateCopy:function(t){},getDimension:function(){},getX:function(t){},clone:function(){},expandEnvelope:function(t){},copy:function(){},getY:function(t){},toCoordinateArray:function(){},interfaces_:function(){return[Clonable]},getClass:function(){return CoordinateSequence}}),CoordinateSequence.X=0,CoordinateSequence.Y=1,CoordinateSequence.Z=2,CoordinateSequence.M=3,System.arraycopy=function(t,e,n,i,r){for(var o=0,s=e;e+r>s;s++)n[i+o]=t[s],o++},System.getProperty=function(t){return{"line.separator":"\n"}[t]},extend(HCoordinate.prototype,{getY:function(){var t=this.y/this.w;if(Double.isNaN(t)||Double.isInfinite(t))throw new NotRepresentableException;return t},getX:function(){var t=this.x/this.w;if(Double.isNaN(t)||Double.isInfinite(t))throw new NotRepresentableException;return t},getCoordinate:function(){var t=new Coordinate;return t.x=this.getX(),t.y=this.getY(),t},interfaces_:function(){return[]},getClass:function(){return HCoordinate}}),HCoordinate.intersection=function(t,e,n,i){var r=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,a=n.y-i.y,l=i.x-n.x,u=n.x*i.y-i.x*n.y,c=o*u-l*s,h=a*s-r*u,d=r*l-a*o,g=c/d,f=h/d;if(Double.isNaN(g)||Double.isInfinite(g)||Double.isNaN(f)||Double.isInfinite(f))throw new NotRepresentableException;return new Coordinate(g,f)},extend(CoordinateSequenceFactory.prototype,{create:function(){if(1===arguments.length){if(arguments[0]instanceof Array){arguments[0]}else if(hasInterface(arguments[0],CoordinateSequence)){arguments[0]}}else if(2===arguments.length){arguments[0],arguments[1]}},interfaces_:function(){return[]},getClass:function(){return CoordinateSequenceFactory}}),extend(Geometry.prototype,{isGeometryCollection:function(){return this.getSortIndex()===Geometry.SORTINDEX_GEOMETRYCOLLECTION},getFactory:function(){return this.factory},getGeometryN:function(t){return this},getArea:function(){return 0},isRectangle:function(){return!1},equals:function(){if(1===arguments.length){if(arguments[0]instanceof Geometry){var t=arguments[0];return null===t?!1:this.equalsTopo(t)}if(arguments[0]instanceof Object){var e=arguments[0];if(!(e instanceof Geometry))return!1;var n=e;return this.equalsExact(n)}}},equalsExact:function(t){return this===t||this.equalsExact(t,0)},covers:function(t){return this.getEnvelopeInternal().covers(t.getEnvelopeInternal())?this.isRectangle()?!0:this.relate(t).isCovers():!1},touches:function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.relate(t).isTouches(this.getDimension(),t.getDimension()):!1},geometryChanged:function(){this.apply(Geometry.geometryChangedFilter)},within:function(t){return t.contains(this)},geometryChangedAction:function(){this.envelope=null},equalsNorm:function(t){return null===t?!1:this.norm().equalsExact(t.norm())},getLength:function(){return 0},getNumGeometries:function(){return 1},compareTo:function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t)}if(2===arguments.length){var t=arguments[0],n=arguments[1],e=t;return this.getSortIndex()!==e.getSortIndex()?this.getSortIndex()-e.getSortIndex():this.isEmpty()&&e.isEmpty()?0:this.isEmpty()?-1:e.isEmpty()?1:this.compareToSameClass(t,n)}},equalsTopo:function(t){return this.getEnvelopeInternal().equals(t.getEnvelopeInternal())?this.relate(t).isEquals(this.getDimension(),t.getDimension()):!1},coveredBy:function(t){return t.covers(this)},getUserData:function(){return this.userData},getSRID:function(){return this.SRID},getEnvelope:function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())},checkNotGeometryCollection:function(t){if(this.getSortIndex()===Geometry.SORTINDEX_GEOMETRYCOLLECTION)throw new IllegalArgumentException("This method does not support GeometryCollection arguments")},equal:function(t,e,n){return 0===n?t.equals(e):t.distance(e)<=n},relate:function(){if(1===arguments.length){var t=arguments[0];return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),RelateOp.relate(this,t)}if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.relate(t).matches(e)}},overlaps:function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.relate(t).isOverlaps(this.getDimension(),t.getDimension()):!1},norm:function(){var t=this.copy();return t.normalize(),t},getPrecisionModel:function(){return this.factory.getPrecisionModel()},getEnvelopeInternal:function(){return null===this.envelope&&(this.envelope=this.computeEnvelopeInternal()),new Envelope(this.envelope)},setSRID:function(t){this.SRID=t},setUserData:function(t){this.userData=t},toString:function(){return this.toText()},disjoint:function(t){return!this.intersects(t)},crosses:function(t){return this.getEnvelopeInternal().intersects(t.getEnvelopeInternal())?this.relate(t).isCrosses(this.getDimension(),t.getDimension()):!1},compare:function(t,e){for(var n=t.iterator(),i=e.iterator();n.hasNext()&&i.hasNext();){var r=n.next(),o=i.next(),s=r.compareTo(o);if(0!==s)return s}return n.hasNext()?1:i.hasNext()?-1:0},hashCode:function(){return this.getEnvelopeInternal().hashCode()},isGeometryCollectionOrDerived:function(){return this.getSortIndex()===Geometry.SORTINDEX_GEOMETRYCOLLECTION||this.getSortIndex()===Geometry.SORTINDEX_MULTIPOINT||this.getSortIndex()===Geometry.SORTINDEX_MULTILINESTRING||this.getSortIndex()===Geometry.SORTINDEX_MULTIPOLYGON},interfaces_:function(){return[Clonable,Comparable,Serializable]},getClass:function(){return Geometry}}),Geometry.hasNonEmptyElements=function(t){for(var e=0;e<t.length;e++)if(!t[e].isEmpty())return!0;return!1},Geometry.hasNullElements=function(t){for(var e=0;e<t.length;e++)if(null===t[e])return!0;return!1},Geometry.serialVersionUID=0x799ea46522854c00,Geometry.SORTINDEX_POINT=0,Geometry.SORTINDEX_MULTIPOINT=1,Geometry.SORTINDEX_LINESTRING=2,Geometry.SORTINDEX_LINEARRING=3,Geometry.SORTINDEX_MULTILINESTRING=4,Geometry.SORTINDEX_POLYGON=5,Geometry.SORTINDEX_MULTIPOLYGON=6,Geometry.SORTINDEX_GEOMETRYCOLLECTION=7,Geometry.geometryChangedFilter={interfaces_:function(){return[GeometryComponentFilter]},filter:function(t){t.geometryChangedAction()}},extend(CoordinateFilter.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return CoordinateFilter}}),extend(BoundaryNodeRule.prototype,{isInBoundary:function(t){},interfaces_:function(){return[]},getClass:function(){return BoundaryNodeRule}}),extend(Mod2BoundaryNodeRule.prototype,{isInBoundary:function(t){return t%2===1},interfaces_:function(){return[BoundaryNodeRule]},getClass:function(){return Mod2BoundaryNodeRule}}),extend(EndPointBoundaryNodeRule.prototype,{isInBoundary:function(t){return t>0},interfaces_:function(){return[BoundaryNodeRule]},getClass:function(){return EndPointBoundaryNodeRule}}),extend(MultiValentEndPointBoundaryNodeRule.prototype,{isInBoundary:function(t){return t>1},interfaces_:function(){return[BoundaryNodeRule]},getClass:function(){return MultiValentEndPointBoundaryNodeRule}}),extend(MonoValentEndPointBoundaryNodeRule.prototype,{isInBoundary:function(t){return 1===t},interfaces_:function(){return[BoundaryNodeRule]},getClass:function(){return MonoValentEndPointBoundaryNodeRule}}),BoundaryNodeRule.Mod2BoundaryNodeRule=Mod2BoundaryNodeRule,BoundaryNodeRule.EndPointBoundaryNodeRule=EndPointBoundaryNodeRule,BoundaryNodeRule.MultiValentEndPointBoundaryNodeRule=MultiValentEndPointBoundaryNodeRule,BoundaryNodeRule.MonoValentEndPointBoundaryNodeRule=MonoValentEndPointBoundaryNodeRule,BoundaryNodeRule.MOD2_BOUNDARY_RULE=new Mod2BoundaryNodeRule,BoundaryNodeRule.ENDPOINT_BOUNDARY_RULE=new EndPointBoundaryNodeRule,BoundaryNodeRule.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new MultiValentEndPointBoundaryNodeRule,BoundaryNodeRule.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new MonoValentEndPointBoundaryNodeRule,BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE=BoundaryNodeRule.MOD2_BOUNDARY_RULE,Iterator.prototype.hasNext=function(){},Iterator.prototype.next=function(){},Iterator.prototype.remove=function(){},Collection.prototype.add=function(){},Collection.prototype.addAll=function(){},Collection.prototype.isEmpty=function(){},Collection.prototype.iterator=function(){},Collection.prototype.size=function(){},Collection.prototype.toArray=function(){},Collection.prototype.remove=function(){},IndexOutOfBoundsException$1.prototype=new Error,IndexOutOfBoundsException$1.prototype.name="IndexOutOfBoundsException",List.prototype=Object.create(Collection.prototype),List.prototype.constructor=List,List.prototype.get=function(){},List.prototype.set=function(){},List.prototype.isEmpty=function(){},NoSuchElementException.prototype=new Error,NoSuchElementException.prototype.name="NoSuchElementException",OperationNotSupported.prototype=new Error,OperationNotSupported.prototype.name="OperationNotSupported",ArrayList.prototype=Object.create(List.prototype),ArrayList.prototype.constructor=ArrayList,ArrayList.prototype.ensureCapacity=function(){},ArrayList.prototype.interfaces_=function(){return[List,Collection]},ArrayList.prototype.add=function(t){return this.array_.push(t),!0},ArrayList.prototype.clear=function(){this.array_=[]},ArrayList.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},ArrayList.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},ArrayList.prototype.iterator=function(){return new Iterator_(this)},ArrayList.prototype.get=function(t){if(0>t||t>=this.size())throw new IndexOutOfBoundsException$1;return this.array_[t]},ArrayList.prototype.isEmpty=function(){return 0===this.array_.length},ArrayList.prototype.size=function(){return this.array_.length},ArrayList.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;n>e;e++)t.push(this.array_[e]);return t},ArrayList.prototype.remove=function(t){for(var e=!1,n=0,i=this.array_.length;i>n;n++)if(this.array_[n]===t){this.array_.splice(n,1),e=!0;break}return e};var Iterator_=function(t){this.arrayList_=t,this.position_=0};Iterator_.prototype.next=function(){if(this.position_===this.arrayList_.size())throw new NoSuchElementException;return this.arrayList_.get(this.position_++)},Iterator_.prototype.hasNext=function(){return this.position_<this.arrayList_.size()},Iterator_.prototype.set=function(t){return this.arrayList_.set(this.position_-1,t)},Iterator_.prototype.remove=function(){throw new OperationNotSupported},inherits(CoordinateList,ArrayList),extend(CoordinateList.prototype,{getCoordinate:function(t){return this.get(t)},addAll:function(){if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=!1,i=t.iterator();i.hasNext();)this.add(i.next(),e),n=!0;return n}return ArrayList.prototype.addAll.apply(this,arguments)},clone:function t(){for(var t=ArrayList.prototype.clone.call(this),e=0;e<this.size();e++)t.add(e,this.get(e).copy());return t},toCoordinateArray:function(){return this.toArray(CoordinateList.coordArrayType)},add:function(){if(1===arguments.length){var t=arguments[0];ArrayList.prototype.add.call(this,t)}else if(2===arguments.length){if(arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var t=arguments[0],e=arguments[1];return this.add(t,e,!0),!0}if(arguments[0]instanceof Coordinate&&"boolean"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(!e&&this.size()>=1){var n=this.get(this.size()-1);if(n.equals2D(t))return null}ArrayList.prototype.add.call(this,t)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var i=arguments[0],e=arguments[1];return this.add(i,e),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var t=arguments[0],e=arguments[1],r=arguments[2];if(r)for(var o=0;o<t.length;o++)this.add(t[o],e);else for(var o=t.length-1;o>=0;o--)this.add(t[o],e);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof Coordinate){var s=arguments[0],t=arguments[1],e=arguments[2];
if(!e){var a=this.size();if(a>0){if(s>0){var l=this.get(s-1);if(l.equals2D(t))return null}if(a>s){var u=this.get(s);if(u.equals2D(t))return null}}}ArrayList.prototype.add.call(this,s,t)}}else if(4===arguments.length){var t=arguments[0],e=arguments[1],c=arguments[2],h=arguments[3],d=1;c>h&&(d=-1);for(var o=c;o!==h;o+=d)this.add(t[o],e);return!0}},closeRing:function(){this.size()>0&&this.add(new Coordinate(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return CoordinateList}}),CoordinateList.coordArrayType=new Array(0).fill(null),extend(CoordinateArrays.prototype,{interfaces_:function(){return[]},getClass:function(){return CoordinateArrays}}),CoordinateArrays.isRing=function(t){return t.length<4?!1:!!t[0].equals2D(t[t.length-1])},CoordinateArrays.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(CoordinateArrays.indexOf(i,e)<0)return i}return null},CoordinateArrays.scroll=function(t,e){var n=CoordinateArrays.indexOf(e,t);if(0>n)return null;var i=new Array(t.length).fill(null);System.arraycopy(t,n,i,0,t.length-n),System.arraycopy(t,0,i,t.length-n,n),System.arraycopy(i,0,t,0,t.length)},CoordinateArrays.equals=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0}if(3===arguments.length){var t=arguments[0],e=arguments[1],i=arguments[2];if(t===e)return!0;if(null===t||null===e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(0!==i.compare(t[n],e[n]))return!1;return!0}},CoordinateArrays.intersection=function(t,e){for(var n=new CoordinateList,i=0;i<t.length;i++)e.intersects(t[i])&&n.add(t[i],!0);return n.toCoordinateArray()},CoordinateArrays.hasRepeatedPoints=function(t){for(var e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},CoordinateArrays.removeRepeatedPoints=function(t){if(!CoordinateArrays.hasRepeatedPoints(t))return t;var e=new CoordinateList(t,!1);return e.toCoordinateArray()},CoordinateArrays.reverse=function(t){for(var e=t.length-1,n=Math.trunc(e/2),i=0;n>=i;i++){var r=t[i];t[i]=t[e-i],t[e-i]=r}},CoordinateArrays.removeNull=function(t){for(var e=0,n=0;n<t.length;n++)null!==t[n]&&e++;var i=new Array(e).fill(null);if(0===e)return i;for(var r=0,n=0;n<t.length;n++)null!==t[n]&&(i[r++]=t[n]);return i},CoordinateArrays.copyDeep=function(){if(1===arguments.length){for(var t=arguments[0],e=new Array(t.length).fill(null),n=0;n<t.length;n++)e[n]=new Coordinate(t[n]);return e}if(5===arguments.length)for(var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4],n=0;a>n;n++)o[s+n]=new Coordinate(i[r+n])},CoordinateArrays.isEqualReversed=function(t,e){for(var n=0;n<t.length;n++){var i=t[n],r=e[t.length-n-1];if(0!==i.compareTo(r))return!1}return!0},CoordinateArrays.envelope=function(t){for(var e=new Envelope,n=0;n<t.length;n++)e.expandToInclude(t[n]);return e},CoordinateArrays.toCoordinateArray=function(t){return t.toArray(CoordinateArrays.coordArrayType)},CoordinateArrays.atLeastNCoordinatesOrNothing=function(t,e){return e.length>=t?e:[]},CoordinateArrays.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},CoordinateArrays.increasingDirection=function(t){for(var e=0;e<Math.trunc(t.length/2);e++){var n=t.length-1-e,i=t[e].compareTo(t[n]);if(0!==i)return i}return 1},CoordinateArrays.compare=function(t,e){for(var n=0;n<t.length&&n<e.length;){var i=t[n].compareTo(e[n]);if(0!==i)return i;n++}return n<e.length?-1:n<t.length?1:0},CoordinateArrays.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},CoordinateArrays.extract=function(t,e,n){e=MathUtil.clamp(e,0,t.length),n=MathUtil.clamp(n,-1,t.length);var i=n-e+1;0>n&&(i=0),e>=t.length&&(i=0),e>n&&(i=0);var r=new Array(i).fill(null);if(0===i)return r;for(var o=0,s=e;n>=s;s++)r[o++]=t[s];return r},extend(ForwardComparator.prototype,{compare:function(t,e){var n=t,i=e;return CoordinateArrays.compare(n,i)},interfaces_:function(){return[Comparator]},getClass:function(){return ForwardComparator}}),extend(BidirectionalComparator.prototype,{compare:function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;var r=CoordinateArrays.compare(n,i),o=CoordinateArrays.isEqualReversed(n,i);return o?0:r},OLDcompare:function(t,e){var n=t,i=e;if(n.length<i.length)return-1;if(n.length>i.length)return 1;if(0===n.length)return 0;for(var r=CoordinateArrays.increasingDirection(n),o=CoordinateArrays.increasingDirection(i),s=r>0?0:n.length-1,a=o>0?0:n.length-1,l=0;l<n.length;l++){var u=n[s].compareTo(i[a]);if(0!==u)return u;s+=r,a+=o}return 0},interfaces_:function(){return[Comparator]},getClass:function(){return BidirectionalComparator}}),CoordinateArrays.ForwardComparator=ForwardComparator,CoordinateArrays.BidirectionalComparator=BidirectionalComparator,CoordinateArrays.coordArrayType=new Array(0).fill(null),Map$1.prototype.get=function(){},Map$1.prototype.put=function(){},Map$1.prototype.size=function(){},Map$1.prototype.values=function(){},Map$1.prototype.entrySet=function(){},SortedMap.prototype=new Map$1,Set.prototype=new Collection,Set.prototype.contains=function(){},HashSet.prototype=new Set,HashSet.prototype.contains=function(t){for(var e=0,n=this.array_.length;n>e;e++){var i=this.array_[e];if(i===t)return!0}return!1},HashSet.prototype.add=function(t){return this.contains(t)?!1:(this.array_.push(t),!0)},HashSet.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},HashSet.prototype.remove=function(t){throw new javascript.util.OperationNotSupported},HashSet.prototype.size=function(){return this.array_.length},HashSet.prototype.isEmpty=function(){return 0===this.array_.length},HashSet.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;n>e;e++)t.push(this.array_[e]);return t},HashSet.prototype.iterator=function(){return new Iterator_$1(this)};var Iterator_$1=function(t){this.hashSet_=t,this.position_=0};Iterator_$1.prototype.next=function(){if(this.position_===this.hashSet_.size())throw new NoSuchElementException;return this.hashSet_.array_[this.position_++]},Iterator_$1.prototype.hasNext=function(){return this.position_<this.hashSet_.size()},Iterator_$1.prototype.remove=function(){throw new OperationNotSupported};var BLACK=0,RED=1;TreeMap.prototype=new SortedMap,TreeMap.prototype.get=function(t){for(var e=this.root_;null!==e;){var n=t.compareTo(e.key);if(0>n)e=e.left;else{if(!(n>0))return e.value;e=e.right}}return null},TreeMap.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:BLACK,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do if(n=r,i=t.compareTo(r.key),0>i)r=r.left;else{if(!(i>0)){var o=r.value;return r.value=e,o}r=r.right}while(null!==r);var s={key:t,left:null,right:null,value:e,parent:n,color:BLACK,getValue:function(){return this.value},getKey:function(){return this.key}};return 0>i?n.left=s:n.right=s,this.fixAfterInsertion(s),this.size_++,null},TreeMap.prototype.fixAfterInsertion=function(t){for(t.color=RED;null!=t&&t!=this.root_&&t.parent.color==RED;)if(parentOf(t)==leftOf(parentOf(parentOf(t)))){var e=rightOf(parentOf(parentOf(t)));colorOf(e)==RED?(setColor(parentOf(t),BLACK),setColor(e,BLACK),setColor(parentOf(parentOf(t)),RED),t=parentOf(parentOf(t))):(t==rightOf(parentOf(t))&&(t=parentOf(t),this.rotateLeft(t)),setColor(parentOf(t),BLACK),setColor(parentOf(parentOf(t)),RED),this.rotateRight(parentOf(parentOf(t))))}else{var e=leftOf(parentOf(parentOf(t)));colorOf(e)==RED?(setColor(parentOf(t),BLACK),setColor(e,BLACK),setColor(parentOf(parentOf(t)),RED),t=parentOf(parentOf(t))):(t==leftOf(parentOf(t))&&(t=parentOf(t),this.rotateRight(t)),setColor(parentOf(t),BLACK),setColor(parentOf(parentOf(t)),RED),this.rotateLeft(parentOf(parentOf(t))))}this.root_.color=BLACK},TreeMap.prototype.values=function(){var t=new ArrayList,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=TreeMap.successor(e));)t.add(e.value);return t},TreeMap.prototype.entrySet=function(){var t=new HashSet,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=TreeMap.successor(e));)t.add(e);return t},TreeMap.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left==t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},TreeMap.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right==t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},TreeMap.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},TreeMap.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var e=t.parent,n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e},TreeMap.prototype.size=function(){return this.size_},extend(Lineal.prototype,{interfaces_:function(){return[]},getClass:function(){return Lineal}}),SortedSet.prototype=new Set,TreeSet.prototype=new SortedSet,TreeSet.prototype.contains=function(t){for(var e=0,n=this.array_.length;n>e;e++){var i=this.array_[e];if(0===i.compareTo(t))return!0}return!1},TreeSet.prototype.add=function(t){if(this.contains(t))return!1;for(var e=0,n=this.array_.length;n>e;e++){var i=this.array_[e];if(1===i.compareTo(t))return this.array_.splice(e,0,t),!0}return this.array_.push(t),!0},TreeSet.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},TreeSet.prototype.remove=function(t){throw new OperationNotSupported},TreeSet.prototype.size=function(){return this.array_.length},TreeSet.prototype.isEmpty=function(){return 0===this.array_.length},TreeSet.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;n>e;e++)t.push(this.array_[e]);return t},TreeSet.prototype.iterator=function(){return new Iterator_$2(this)};var Iterator_$2=function(t){this.treeSet_=t,this.position_=0};Iterator_$2.prototype.next=function(){if(this.position_===this.treeSet_.size())throw new NoSuchElementException;return this.treeSet_.array_[this.position_++]},Iterator_$2.prototype.hasNext=function(){return this.position_<this.treeSet_.size()},Iterator_$2.prototype.remove=function(){throw new OperationNotSupported},Arrays.sort=function(){var t,e,n,i,r=arguments[0];if(1===arguments.length)return i=function(t,e){return t.compareTo(e)},void r.sort(i);if(2===arguments.length)n=arguments[1],i=function(t,e){return n.compare(t,e)},r.sort(i);else{if(3===arguments.length){e=r.slice(arguments[1],arguments[2]),e.sort();var o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length));for(r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t]);return}if(4===arguments.length){for(e=r.slice(arguments[1],arguments[2]),n=arguments[3],i=function(t,e){return n.compare(t,e)},e.sort(i),o=r.slice(0,arguments[1]).concat(e,r.slice(arguments[2],r.length)),r.splice(0,r.length),t=0;t<o.length;t++)r.push(o[t]);return}}},Arrays.asList=function(t){for(var e=new ArrayList,n=0,i=t.length;i>n;n++)e.add(t[n]);return e},extend(GeometryComponentFilter$1.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return GeometryComponentFilter$1}}),extend(Dimension.prototype,{interfaces_:function(){return[]},getClass:function(){return Dimension}}),Dimension.toDimensionSymbol=function(t){switch(t){case Dimension.FALSE:return Dimension.SYM_FALSE;case Dimension.TRUE:return Dimension.SYM_TRUE;case Dimension.DONTCARE:return Dimension.SYM_DONTCARE;case Dimension.P:return Dimension.SYM_P;case Dimension.L:return Dimension.SYM_L;case Dimension.A:return Dimension.SYM_A}throw new IllegalArgumentException("Unknown dimension value: "+t)},Dimension.toDimensionValue=function(t){switch(Character.toUpperCase(t)){case Dimension.SYM_FALSE:return Dimension.FALSE;case Dimension.SYM_TRUE:return Dimension.TRUE;case Dimension.SYM_DONTCARE:return Dimension.DONTCARE;case Dimension.SYM_P:return Dimension.P;case Dimension.SYM_L:return Dimension.L;case Dimension.SYM_A:return Dimension.A}throw new IllegalArgumentException("Unknown dimension symbol: "+t)},Dimension.P=0,Dimension.L=1,Dimension.A=2,Dimension.FALSE=-1,Dimension.TRUE=-2,Dimension.DONTCARE=-3,Dimension.SYM_FALSE="F",Dimension.SYM_TRUE="T",Dimension.SYM_DONTCARE="*",Dimension.SYM_P="0",Dimension.SYM_L="1",Dimension.SYM_A="2",extend(GeometryFilter.prototype,{filter:function(t){},interfaces_:function(){return[]},getClass:function(){return GeometryFilter}}),extend(CoordinateSequenceFilter.prototype,{filter:function(t,e){},isDone:function(){},isGeometryChanged:function(){},interfaces_:function(){return[]},getClass:function(){return CoordinateSequenceFilter}}),inherits(GeometryCollection,Geometry),extend(GeometryCollection.prototype,{computeEnvelopeInternal:function(){for(var t=new Envelope,e=0;e<this.geometries.length;e++)t.expandToInclude(this.geometries[e].getEnvelopeInternal());return t},getGeometryN:function(t){return this.geometries[t]},getSortIndex:function(){return Geometry.SORTINDEX_GEOMETRYCOLLECTION},getCoordinates:function(){for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=0;n<this.geometries.length;n++)for(var i=this.geometries[n].getCoordinates(),r=0;r<i.length;r++)e++,t[e]=i[r];return t},getArea:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getArea();return t},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this.geometries.length!==n.geometries.length)return!1;for(var i=0;i<this.geometries.length;i++)if(!this.geometries[i].equalsExact(n.geometries[i],e))return!1;return!0}return Geometry.prototype.equalsExact.apply(this,arguments)},normalize:function(){for(var t=0;t<this.geometries.length;t++)this.geometries[t].normalize();Arrays.sort(this.geometries)},getCoordinate:function(){return this.isEmpty()?null:this.geometries[0].getCoordinate()},getBoundaryDimension:function(){for(var t=Dimension.FALSE,e=0;e<this.geometries.length;e++)t=Math.max(t,this.geometries[e].getBoundaryDimension());return t},getDimension:function(){for(var t=Dimension.FALSE,e=0;e<this.geometries.length;e++)t=Math.max(t,this.geometries[e].getDimension());return t},getLength:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getLength();return t},getNumPoints:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getNumPoints();return t},getNumGeometries:function(){return this.geometries.length},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[n]=this.geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=new TreeSet(Arrays.asList(this.geometries)),n=new TreeSet(Arrays.asList(t.geometries));return this.compare(e,n)}if(2===arguments.length){for(var t=arguments[0],i=arguments[1],r=t,o=this.getNumGeometries(),s=r.getNumGeometries(),a=0;o>a&&s>a;){var l=this.getGeometryN(a),u=r.getGeometryN(a),c=l.compareToSameClass(u,i);if(0!==c)return c;a++}return o>a?1:s>a?-1:0}},apply:function(){if(hasInterface(arguments[0],CoordinateFilter))for(var t=arguments[0],e=0;e<this.geometries.length;e++)this.geometries[e].apply(t);else if(hasInterface(arguments[0],CoordinateSequenceFilter)){var t=arguments[0];if(0===this.geometries.length)return null;for(var e=0;e<this.geometries.length&&(this.geometries[e].apply(t),!t.isDone());e++);t.isGeometryChanged()&&this.geometryChanged()}else if(hasInterface(arguments[0],GeometryFilter)){var t=arguments[0];t.filter(this);for(var e=0;e<this.geometries.length;e++)this.geometries[e].apply(t)}else if(hasInterface(arguments[0],GeometryComponentFilter$1)){var t=arguments[0];t.filter(this);for(var e=0;e<this.geometries.length;e++)this.geometries[e].apply(t)}},getBoundary:function(){return this.checkNotGeometryCollection(this),Assert.shouldNeverReachHere(),null},clone:function(){var t=Geometry.prototype.clone.call(this);t.geometries=new Array(this.geometries.length).fill(null);for(var e=0;e<this.geometries.length;e++)t.geometries[e]=this.geometries[e].clone();return t},getGeometryType:function(){return"GeometryCollection"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new GeometryCollection(t,this.factory)},isEmpty:function(){for(var t=0;t<this.geometries.length;t++)if(!this.geometries[t].isEmpty())return!1;return!0},interfaces_:function(){return[]},getClass:function(){return GeometryCollection}}),GeometryCollection.serialVersionUID=-0x4f07bcb1f857d800,inherits(MultiLineString,GeometryCollection),extend(MultiLineString.prototype,{getSortIndex:function(){return Geometry.SORTINDEX_MULTILINESTRING},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.isEquivalentClass(t)?GeometryCollection.prototype.equalsExact.call(this,t,e):!1}return GeometryCollection.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return this.isClosed()?Dimension.FALSE:0},isClosed:function(){if(this.isEmpty())return!1;for(var t=0;t<this.geometries.length;t++)if(!this.geometries[t].isClosed())return!1;return!0},getDimension:function(){return 1},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[t-1-n]=this.geometries[n].reverse();return this.getFactory().createMultiLineString(e)},getBoundary:function(){return new BoundaryOp(this).getBoundary()},getGeometryType:function(){return"MultiLineString"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new MultiLineString(t,this.factory)},interfaces_:function(){return[Lineal]},getClass:function(){return MultiLineString}}),MultiLineString.serialVersionUID=0x7155d2ab4afa8000,extend(BoundaryOp.prototype,{boundaryMultiLineString:function(t){if(this.geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this.geomFact.createPoint(e[0]):this.geomFact.createMultiPointFromCoords(e)},getBoundary:function(){return this.geom instanceof LineString?this.boundaryLineString(this.geom):this.geom instanceof MultiLineString?this.boundaryMultiLineString(this.geom):this.geom.getBoundary()},boundaryLineString:function(t){if(this.geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){var e=this.bnRule.isInBoundary(2);return e?t.getStartPoint():this.geomFact.createMultiPoint()}return this.geomFact.createMultiPoint([t.getStartPoint(),t.getEndPoint()])},getEmptyMultiPoint:function(){return this.geomFact.createMultiPoint()},computeBoundaryCoordinates:function(t){var e=new ArrayList;this.endpointMap=new TreeMap;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);0!==i.getNumPoints()&&(this.addEndpoint(i.getCoordinateN(0)),this.addEndpoint(i.getCoordinateN(i.getNumPoints()-1)))}for(var r=this.endpointMap.entrySet().iterator();r.hasNext();){var o=r.next(),s=o.getValue(),a=s.count;this.bnRule.isInBoundary(a)&&e.add(o.getKey())}return CoordinateArrays.toCoordinateArray(e)},addEndpoint:function(t){var e=this.endpointMap.get(t);null===e&&(e=new Counter,this.endpointMap.put(t,e)),e.count++},interfaces_:function(){return[]},getClass:function(){return BoundaryOp}}),BoundaryOp.getBoundary=function(){if(1===arguments.length){var t=arguments[0],e=new BoundaryOp(t);return e.getBoundary()}if(2===arguments.length){var t=arguments[0],n=arguments[1],e=new BoundaryOp(t,n);return e.getBoundary()}},extend(Counter.prototype,{interfaces_:function(){return[]},getClass:function(){return Counter}}),extend(StringUtil.prototype,{interfaces_:function(){return[]},getClass:function(){return StringUtil}}),StringUtil.chars=function(t,e){for(var n=new Array(e).fill(null),i=0;e>i;i++)n[i]=t;return new String(n)},StringUtil.getStackTrace=function(){if(1===arguments.length){var t=arguments[0],e=new ByteArrayOutputStream,n=new PrintStream(e);return t.printStackTrace(n),e.toString()}if(2===arguments.length){for(var t=arguments[0],i=arguments[1],r="",o=new StringReader(StringUtil.getStackTrace(t)),s=new LineNumberReader(o),a=0;i>a;a++)try{r+=s.readLine()+StringUtil.NEWLINE}catch(t){if(!(t instanceof IOException))throw t;Assert.shouldNeverReachHere()}finally{}return r}},StringUtil.split=function(t,e){for(var n=e.length,i=new ArrayList,r=""+t,o=r.indexOf(e);o>=0;){var s=r.substring(0,o);i.add(s),r=r.substring(o+n),o=r.indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),l=0;l<a.length;l++)a[l]=i.get(l);return a},StringUtil.toString=function(){if(1===arguments.length){var t=arguments[0];return StringUtil.SIMPLE_ORDINATE_FORMAT.format(t)}},StringUtil.spaces=function(t){return StringUtil.chars(" ",t)},StringUtil.NEWLINE=System.getProperty("line.separator"),StringUtil.SIMPLE_ORDINATE_FORMAT=new DecimalFormat("0.#"),extend(CoordinateSequences.prototype,{interfaces_:function(){return[]},getClass:function(){return CoordinateSequences}}),CoordinateSequences.copyCoord=function(t,e,n,i){for(var r=Math.min(t.getDimension(),n.getDimension()),o=0;r>o;o++)n.setOrdinate(i,o,t.getOrdinate(e,o))},CoordinateSequences.isRing=function(t){var e=t.size();return 0===e?!0:3>=e?!1:t.getOrdinate(0,CoordinateSequence.X)===t.getOrdinate(e-1,CoordinateSequence.X)&&t.getOrdinate(0,CoordinateSequence.Y)===t.getOrdinate(e-1,CoordinateSequence.Y)},CoordinateSequences.isEqual=function(t,e){var n=t.size(),i=e.size();if(n!==i)return!1;for(var r=Math.min(t.getDimension(),e.getDimension()),o=0;n>o;o++)for(var s=0;r>s;s++){var a=t.getOrdinate(o,s),l=e.getOrdinate(o,s);if(!(t.getOrdinate(o,s)===e.getOrdinate(o,s)||Double.isNaN(a)&&Double.isNaN(l)))return!1}return!0},CoordinateSequences.extend=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();if(CoordinateSequences.copy(e,0,i,0,r),r>0)for(var o=r;n>o;o++)CoordinateSequences.copy(e,r-1,i,o,1);return i},CoordinateSequences.reverse=function(t){for(var e=t.size()-1,n=Math.trunc(e/2),i=0;n>=i;i++)CoordinateSequences.swap(t,i,e-i)},CoordinateSequences.swap=function(t,e,n){if(e===n)return null;for(var i=0;i<t.getDimension();i++){var r=t.getOrdinate(e,i);t.setOrdinate(e,i,t.getOrdinate(n,i)),t.setOrdinate(n,i,r)}},CoordinateSequences.copy=function(t,e,n,i,r){for(var o=0;r>o;o++)CoordinateSequences.copyCoord(t,e+o,n,i+o)},CoordinateSequences.toString=function(){if(1===arguments.length){var t=arguments[0],e=t.size();if(0===e)return"()";var n=t.getDimension(),i=new StringBuffer;i.append("(");for(var r=0;e>r;r++){r>0&&i.append(" ");for(var o=0;n>o;o++)o>0&&i.append(","),i.append(StringUtil.toString(t.getOrdinate(r,o)))}return i.append(")"),i.toString()}},CoordinateSequences.ensureValidRing=function(t,e){var n=e.size();if(0===n)return e;if(3>=n)return CoordinateSequences.createClosedRing(t,e,4);var i=e.getOrdinate(0,CoordinateSequence.X)===e.getOrdinate(n-1,CoordinateSequence.X)&&e.getOrdinate(0,CoordinateSequence.Y)===e.getOrdinate(n-1,CoordinateSequence.Y);return i?e:CoordinateSequences.createClosedRing(t,e,n+1)},CoordinateSequences.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();CoordinateSequences.copy(e,0,i,0,r);for(var o=r;n>o;o++)CoordinateSequences.copy(e,0,i,o,1);return i},inherits(LineString,Geometry),extend(LineString.prototype,{computeEnvelopeInternal:function(){return this.isEmpty()?new Envelope:this.points.expandEnvelope(new Envelope)},isRing:function(){return this.isClosed()&&this.isSimple()},getSortIndex:function(){return Geometry.SORTINDEX_LINESTRING},getCoordinates:function(){return this.points.toCoordinateArray()},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t;if(this.points.size()!==n.points.size())return!1;for(var i=0;i<this.points.size();i++)if(!this.equal(this.points.getCoordinate(i),n.points.getCoordinate(i),e))return!1;return!0}return Geometry.prototype.equalsExact.apply(this,arguments)},normalize:function(){for(var t=0;t<Math.trunc(this.points.size()/2);t++){var e=this.points.size()-1-t;if(!this.points.getCoordinate(t).equals(this.points.getCoordinate(e)))return this.points.getCoordinate(t).compareTo(this.points.getCoordinate(e))>0&&CoordinateSequences.reverse(this.points),null}},getCoordinate:function(){return this.isEmpty()?null:this.points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?Dimension.FALSE:0},isClosed:function(){return this.isEmpty()?!1:this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},getEndPoint:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},getDimension:function(){return 1},getLength:function(){return CGAlgorithms.computeLength(this.points)},getNumPoints:function(){return this.points.size()},reverse:function(){var t=this.points.clone();CoordinateSequences.reverse(t);var e=this.getFactory().createLineString(t);return e},compareToSameClass:function(){if(1===arguments.length){for(var t=arguments[0],e=t,n=0,i=0;n<this.points.size()&&i<e.points.size();){var r=this.points.getCoordinate(n).compareTo(e.points.getCoordinate(i));if(0!==r)return r;n++,i++}return n<this.points.size()?1:i<e.points.size()?-1:0}if(2===arguments.length){var t=arguments[0],o=arguments[1],e=t;return o.compare(this.points,e.points)}},apply:function(){if(hasInterface(arguments[0],CoordinateFilter))for(var t=arguments[0],e=0;e<this.points.size();e++)t.filter(this.points.getCoordinate(e));else if(hasInterface(arguments[0],CoordinateSequenceFilter)){var t=arguments[0];if(0===this.points.size())return null;for(var e=0;e<this.points.size()&&(t.filter(this.points,e),!t.isDone());e++);t.isGeometryChanged()&&this.geometryChanged()}else if(hasInterface(arguments[0],GeometryFilter)){var t=arguments[0];t.filter(this)}else if(hasInterface(arguments[0],GeometryComponentFilter$1)){var t=arguments[0];t.filter(this)}},getBoundary:function(){return new BoundaryOp(this).getBoundary()},isEquivalentClass:function(t){return t instanceof LineString},clone:function(){var t=Geometry.prototype.clone.call(this);return t.points=this.points.clone(),t},getCoordinateN:function(t){return this.points.getCoordinate(t)},getGeometryType:function(){return"LineString"},copy:function(){return new LineString(this.points.copy(),this.factory)},getCoordinateSequence:function(){return this.points},isEmpty:function(){return 0===this.points.size()},init:function(t){if(null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),1===t.size())throw new IllegalArgumentException("Invalid number of points in LineString (found "+t.size()+" - must be 0 or >= 2)");this.points=t},isCoordinate:function(t){for(var e=0;e<this.points.size();e++)if(this.points.getCoordinate(e).equals(t))return!0;return!1},getStartPoint:function(){return this.isEmpty()?null:this.getPointN(0)},getPointN:function(t){return this.getFactory().createPoint(this.points.getCoordinate(t))},interfaces_:function(){return[Lineal]},getClass:function(){return LineString}}),LineString.serialVersionUID=0x2b2b51ba435c8e00,extend(Puntal.prototype,{interfaces_:function(){return[]},getClass:function(){return Puntal}}),inherits(Point,Geometry),extend(Point.prototype,{computeEnvelopeInternal:function(){if(this.isEmpty())return new Envelope;var t=new Envelope;return t.expandToInclude(this.coordinates.getX(0),this.coordinates.getY(0)),t},getSortIndex:function(){return Geometry.SORTINDEX_POINT},getCoordinates:function(){return this.isEmpty()?[]:[this.getCoordinate()]},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.isEquivalentClass(t)?this.isEmpty()&&t.isEmpty()?!0:this.isEmpty()!==t.isEmpty()?!1:this.equal(t.getCoordinate(),this.getCoordinate(),e):!1}return Geometry.prototype.equalsExact.apply(this,arguments)},normalize:function(){},getCoordinate:function(){return 0!==this.coordinates.size()?this.coordinates.getCoordinate(0):null},getBoundaryDimension:function(){return Dimension.FALSE},getDimension:function(){return 0},getNumPoints:function(){return this.isEmpty()?0:1},reverse:function(){return this.copy()},getX:function(){if(null===this.getCoordinate())throw new IllegalStateException("getX called on empty Point");return this.getCoordinate().x},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=t;return this.getCoordinate().compareTo(e.getCoordinate())}if(2===arguments.length){var t=arguments[0],n=arguments[1],e=t;return n.compare(this.coordinates,e.coordinates)}},apply:function(){if(hasInterface(arguments[0],CoordinateFilter)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.getCoordinate())}else if(hasInterface(arguments[0],CoordinateSequenceFilter)){var t=arguments[0];if(this.isEmpty())return null;t.filter(this.coordinates,0),t.isGeometryChanged()&&this.geometryChanged()}else if(hasInterface(arguments[0],GeometryFilter)){var t=arguments[0];t.filter(this)}else if(hasInterface(arguments[0],GeometryComponentFilter$1)){var t=arguments[0];t.filter(this)}},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},clone:function(){var t=Geometry.prototype.clone.call(this);return t.coordinates=this.coordinates.clone(),t},getGeometryType:function(){return"Point"},copy:function(){return new Point(this.coordinates.copy(),this.factory)},getCoordinateSequence:function(){return this.coordinates},getY:function(){if(null===this.getCoordinate())throw new IllegalStateException("getY called on empty Point");return this.getCoordinate().y},isEmpty:function(){return 0===this.coordinates.size()},init:function(t){null===t&&(t=this.getFactory().getCoordinateSequenceFactory().create([])),Assert.isTrue(t.size()<=1),this.coordinates=t},isSimple:function(){return!0},interfaces_:function(){return[Puntal]},getClass:function(){return Point}}),Point.serialVersionUID=0x44077bad161cbc00,extend(Polygonal.prototype,{interfaces_:function(){return[]},getClass:function(){return Polygonal}}),inherits(Polygon,Geometry),extend(Polygon.prototype,{computeEnvelopeInternal:function(){return this.shell.getEnvelopeInternal()},getSortIndex:function(){return Geometry.SORTINDEX_POLYGON},getCoordinates:function(){if(this.isEmpty())return[];for(var t=new Array(this.getNumPoints()).fill(null),e=-1,n=this.shell.getCoordinates(),i=0;i<n.length;i++)e++,t[e]=n[i];for(var r=0;r<this.holes.length;r++)for(var o=this.holes[r].getCoordinates(),s=0;s<o.length;s++)e++,t[e]=o[s];return t},getArea:function(){var t=0;t+=Math.abs(CGAlgorithms.signedArea(this.shell.getCoordinateSequence()));for(var e=0;e<this.holes.length;e++)t-=Math.abs(CGAlgorithms.signedArea(this.holes[e].getCoordinateSequence()));return t},isRectangle:function(){if(0!==this.getNumInteriorRing())return!1;if(null===this.shell)return!1;if(5!==this.shell.getNumPoints())return!1;for(var t=this.shell.getCoordinateSequence(),e=this.getEnvelopeInternal(),n=0;5>n;n++){var i=t.getX(n);if(i!==e.getMinX()&&i!==e.getMaxX())return!1;var r=t.getY(n);if(r!==e.getMinY()&&r!==e.getMaxY())return!1}for(var o=t.getX(0),s=t.getY(0),n=1;4>=n;n++){var i=t.getX(n),r=t.getY(n),a=i!==o,l=r!==s;if(a===l)return!1;o=i,s=r}return!0},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(!this.isEquivalentClass(t))return!1;var n=t,i=this.shell,r=n.shell;if(!i.equalsExact(r,e))return!1;if(this.holes.length!==n.holes.length)return!1;for(var o=0;o<this.holes.length;o++)if(!this.holes[o].equalsExact(n.holes[o],e))return!1;return!0}return Geometry.prototype.equalsExact.apply(this,arguments)},normalize:function(){if(0===arguments.length){this.normalize(this.shell,!0);for(var t=0;t<this.holes.length;t++)this.normalize(this.holes[t],!1);Arrays.sort(this.holes)}else if(2===arguments.length){
var e=arguments[0],n=arguments[1];if(e.isEmpty())return null;var i=new Array(e.getCoordinates().length-1).fill(null);System.arraycopy(e.getCoordinates(),0,i,0,i.length);var r=CoordinateArrays.minCoordinate(e.getCoordinates());CoordinateArrays.scroll(i,r),System.arraycopy(i,0,e.getCoordinates(),0,i.length),e.getCoordinates()[i.length]=i[0],CGAlgorithms.isCCW(e.getCoordinates())===n&&CoordinateArrays.reverse(e.getCoordinates())}},getCoordinate:function(){return this.shell.getCoordinate()},getNumInteriorRing:function(){return this.holes.length},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},getLength:function(){var t=0;t+=this.shell.getLength();for(var e=0;e<this.holes.length;e++)t+=this.holes[e].getLength();return t},getNumPoints:function(){for(var t=this.shell.getNumPoints(),e=0;e<this.holes.length;e++)t+=this.holes[e].getNumPoints();return t},reverse:function(){var t=this.copy();t.shell=this.shell.clone().reverse(),t.holes=new Array(this.holes.length).fill(null);for(var e=0;e<this.holes.length;e++)t.holes[e]=this.holes[e].clone().reverse();return t},convexHull:function(){return this.getExteriorRing().convexHull()},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=this.shell,n=t.shell;return e.compareToSameClass(n)}if(2===arguments.length){var t=arguments[0],i=arguments[1],r=t,e=this.shell,n=r.shell,o=e.compareToSameClass(n,i);if(0!==o)return o;for(var s=this.getNumInteriorRing(),a=r.getNumInteriorRing(),l=0;s>l&&a>l;){var u=this.getInteriorRingN(l),c=r.getInteriorRingN(l),h=u.compareToSameClass(c,i);if(0!==h)return h;l++}return s>l?1:a>l?-1:0}},apply:function(){if(hasInterface(arguments[0],CoordinateFilter)){var t=arguments[0];this.shell.apply(t);for(var e=0;e<this.holes.length;e++)this.holes[e].apply(t)}else if(hasInterface(arguments[0],CoordinateSequenceFilter)){var t=arguments[0];if(this.shell.apply(t),!t.isDone())for(var e=0;e<this.holes.length&&(this.holes[e].apply(t),!t.isDone());e++);t.isGeometryChanged()&&this.geometryChanged()}else if(hasInterface(arguments[0],GeometryFilter)){var t=arguments[0];t.filter(this)}else if(hasInterface(arguments[0],GeometryComponentFilter$1)){var t=arguments[0];t.filter(this),this.shell.apply(t);for(var e=0;e<this.holes.length;e++)this.holes[e].apply(t)}},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();var t=new Array(this.holes.length+1).fill(null);t[0]=this.shell;for(var e=0;e<this.holes.length;e++)t[e+1]=this.holes[e];return t.length<=1?this.getFactory().createLinearRing(t[0].getCoordinateSequence()):this.getFactory().createMultiLineString(t)},clone:function(){var t=Geometry.prototype.clone.call(this);t.shell=this.shell.clone(),t.holes=new Array(this.holes.length).fill(null);for(var e=0;e<this.holes.length;e++)t.holes[e]=this.holes[e].clone();return t},getGeometryType:function(){return"Polygon"},copy:function(){for(var t=this.shell.copy(),e=new Array(this.holes.length).fill(null),n=0;n<e.length;n++)e[n]=this.holes[n].copy();return new Polygon(t,e,this.factory)},getExteriorRing:function(){return this.shell},isEmpty:function(){return this.shell.isEmpty()},getInteriorRingN:function(t){return this.holes[t]},interfaces_:function(){return[Polygonal]},getClass:function(){return Polygon}}),Polygon.serialVersionUID=-0x307ffefd8dc97200,inherits(MultiPoint,GeometryCollection),extend(MultiPoint.prototype,{getSortIndex:function(){return Geometry.SORTINDEX_MULTIPOINT},isValid:function(){return!0},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.isEquivalentClass(t)?GeometryCollection.prototype.equalsExact.call(this,t,e):!1}return GeometryCollection.prototype.equalsExact.apply(this,arguments)},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this.geometries[t].getCoordinate()}return GeometryCollection.prototype.getCoordinate.apply(this,arguments)},getBoundaryDimension:function(){return Dimension.FALSE},getDimension:function(){return 0},getBoundary:function(){return this.getFactory().createGeometryCollection(null)},getGeometryType:function(){return"MultiPoint"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new MultiPoint(t,this.factory)},interfaces_:function(){return[Puntal]},getClass:function(){return MultiPoint}}),MultiPoint.serialVersionUID=-0x6fb1ed4162e0fc00,inherits(LinearRing,LineString),extend(LinearRing.prototype,{getSortIndex:function(){return Geometry.SORTINDEX_LINEARRING},getBoundaryDimension:function(){return Dimension.FALSE},isClosed:function(){return this.isEmpty()?!0:LineString.prototype.isClosed.call(this)},reverse:function(){var t=this.points.clone();CoordinateSequences.reverse(t);var e=this.getFactory().createLinearRing(t);return e},validateConstruction:function(){if(!this.isEmpty()&&!LineString.prototype.isClosed.call(this))throw new IllegalArgumentException("Points of LinearRing do not form a closed linestring");if(this.getCoordinateSequence().size()>=1&&this.getCoordinateSequence().size()<LinearRing.MINIMUM_VALID_SIZE)throw new IllegalArgumentException("Invalid number of points in LinearRing (found "+this.getCoordinateSequence().size()+" - must be 0 or >= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new LinearRing(this.points.copy(),this.factory)},interfaces_:function(){return[]},getClass:function(){return LinearRing}}),LinearRing.MINIMUM_VALID_SIZE=4,LinearRing.serialVersionUID=-0x3b229e262367a600,inherits(MultiPolygon,GeometryCollection),extend(MultiPolygon.prototype,{getSortIndex:function(){return Geometry.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.isEquivalentClass(t)?GeometryCollection.prototype.equalsExact.call(this,t,e):!1}return GeometryCollection.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[n]=this.geometries[n].reverse();return this.getFactory().createMultiPolygon(e)},getBoundary:function(){if(this.isEmpty())return this.getFactory().createMultiLineString();for(var t=new ArrayList,e=0;e<this.geometries.length;e++)for(var n=this.geometries[e],i=n.getBoundary(),r=0;r<i.getNumGeometries();r++)t.add(i.getGeometryN(r));var o=new Array(t.size()).fill(null);return this.getFactory().createMultiLineString(t.toArray(o))},getGeometryType:function(){return"MultiPolygon"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new MultiPolygon(t,this.factory)},interfaces_:function(){return[Polygonal]},getClass:function(){return MultiPolygon}}),MultiPolygon.serialVersionUID=-0x7a5aa1369171980,extend(GeometryEditor.prototype,{setCopyUserData:function(t){this.isUserDataCopied=t},edit:function(t,e){if(null===t)return null;var n=this.editInternal(t,e);return this.isUserDataCopied&&n.setUserData(t.getUserData()),n},editInternal:function(t,e){return null===this.factory&&(this.factory=t.getFactory()),t instanceof GeometryCollection?this.editGeometryCollection(t,e):t instanceof Polygon?this.editPolygon(t,e):t instanceof Point?e.edit(t,this.factory):t instanceof LineString?e.edit(t,this.factory):(Assert.shouldNeverReachHere("Unsupported Geometry class: "+t.getClass().getName()),null)},editGeometryCollection:function(t,e){for(var n=e.edit(t,this.factory),i=new ArrayList,r=0;r<n.getNumGeometries();r++){var o=this.edit(n.getGeometryN(r),e);null===o||o.isEmpty()||i.add(o)}return n.getClass()===MultiPoint?this.factory.createMultiPoint(i.toArray([])):n.getClass()===MultiLineString?this.factory.createMultiLineString(i.toArray([])):n.getClass()===MultiPolygon?this.factory.createMultiPolygon(i.toArray([])):this.factory.createGeometryCollection(i.toArray([]))},editPolygon:function(t,e){var n=e.edit(t,this.factory);if(null===n&&(n=this.factory.createPolygon(null)),n.isEmpty())return n;var i=this.edit(n.getExteriorRing(),e);if(null===i||i.isEmpty())return this.factory.createPolygon();for(var r=new ArrayList,o=0;o<n.getNumInteriorRing();o++){var s=this.edit(n.getInteriorRingN(o),e);null===s||s.isEmpty()||r.add(s)}return this.factory.createPolygon(i,r.toArray([]))},interfaces_:function(){return[]},getClass:function(){return GeometryEditor}}),GeometryEditor.GeometryEditorOperation=GeometryEditorOperation,extend(NoOpGeometryOperation.prototype,{edit:function(t,e){return t},interfaces_:function(){return[GeometryEditorOperation]},getClass:function(){return NoOpGeometryOperation}}),extend(CoordinateOperation.prototype,{edit:function(t,e){if(t instanceof LinearRing)return e.createLinearRing(this.editCoordinates(t.getCoordinates(),t));if(t instanceof LineString)return e.createLineString(this.editCoordinates(t.getCoordinates(),t));if(t instanceof Point){var n=this.editCoordinates(t.getCoordinates(),t);return n.length>0?e.createPoint(n[0]):e.createPoint()}return t},interfaces_:function(){return[GeometryEditorOperation]},getClass:function(){return CoordinateOperation}}),extend(CoordinateSequenceOperation.prototype,{edit:function(t,e){return t instanceof LinearRing?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof LineString?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Point?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},interfaces_:function(){return[GeometryEditorOperation]},getClass:function(){return CoordinateSequenceOperation}}),GeometryEditor.NoOpGeometryOperation=NoOpGeometryOperation,GeometryEditor.CoordinateOperation=CoordinateOperation,GeometryEditor.CoordinateSequenceOperation=CoordinateSequenceOperation,extend(CoordinateArraySequence.prototype,{setOrdinate:function(t,e,n){switch(e){case CoordinateSequence.X:this.coordinates[t].x=n;break;case CoordinateSequence.Y:this.coordinates[t].y=n;break;case CoordinateSequence.Z:this.coordinates[t].z=n;break;default:throw new IllegalArgumentException("invalid ordinateIndex")}},size:function(){return this.coordinates.length},getOrdinate:function(t,e){switch(e){case CoordinateSequence.X:return this.coordinates[t].x;case CoordinateSequence.Y:return this.coordinates[t].y;case CoordinateSequence.Z:return this.coordinates[t].z}return Double.NaN},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this.coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this.coordinates[e].x,n.y=this.coordinates[e].y,n.z=this.coordinates[e].z}},getCoordinateCopy:function(t){return new Coordinate(this.coordinates[t])},getDimension:function(){return this.dimension},getX:function(t){return this.coordinates[t].x},clone:function(){for(var t=new Array(this.size()).fill(null),e=0;e<this.coordinates.length;e++)t[e]=this.coordinates[e].clone();return new CoordinateArraySequence(t,this.dimension)},expandEnvelope:function(t){for(var e=0;e<this.coordinates.length;e++)t.expandToInclude(this.coordinates[e]);return t},copy:function(){for(var t=new Array(this.size()).fill(null),e=0;e<this.coordinates.length;e++)t[e]=this.coordinates[e].copy();return new CoordinateArraySequence(t,this.dimension)},toString:function(){if(this.coordinates.length>0){var t=new StringBuffer(17*this.coordinates.length);t.append("("),t.append(this.coordinates[0]);for(var e=1;e<this.coordinates.length;e++)t.append(", "),t.append(this.coordinates[e]);return t.append(")"),t.toString()}return"()"},getY:function(t){return this.coordinates[t].y},toCoordinateArray:function(){return this.coordinates},interfaces_:function(){return[CoordinateSequence,Serializable]},getClass:function(){return CoordinateArraySequence}}),CoordinateArraySequence.serialVersionUID=-0xcb44a778db18e00,extend(CoordinateArraySequenceFactory.prototype,{readResolve:function(){return CoordinateArraySequenceFactory.instance()},create:function(){if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new CoordinateArraySequence(t)}if(hasInterface(arguments[0],CoordinateSequence)){var e=arguments[0];return new CoordinateArraySequence(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return i>3&&(i=3),2>i?new CoordinateArraySequence(n):new CoordinateArraySequence(n,i)}},interfaces_:function(){return[CoordinateSequenceFactory,Serializable]},getClass:function(){return CoordinateArraySequenceFactory}}),CoordinateArraySequenceFactory.instance=function(){return CoordinateArraySequenceFactory.instanceObject},CoordinateArraySequenceFactory.serialVersionUID=-0x38e49fa6cf6f2e00,CoordinateArraySequenceFactory.instanceObject=new CoordinateArraySequenceFactory,HashMap.prototype=new Map$1,HashMap.prototype.get=function(t){return this.map_.get(t)||null},HashMap.prototype.put=function(t,e){return this.map_.set(t,e),e},HashMap.prototype.values=function(){var t=new ArrayList;return Array.from(this.map_.values()).forEach(function(e){return t.add(e)}),t},HashMap.prototype.entrySet=function(){var t=new HashSet;return this.map_.entries().forEach(function(e){return t.add(e)}),t},HashMap.prototype.size=function(){return this.map_.size()},extend(PrecisionModel.prototype,{equals:function(t){if(!(t instanceof PrecisionModel))return!1;var e=t;return this.modelType===e.modelType&&this.scale===e.scale},compareTo:function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new Integer(n).compareTo(new Integer(i))},getScale:function(){return this.scale},isFloating:function(){return this.modelType===PrecisionModel.FLOATING||this.modelType===PrecisionModel.FLOATING_SINGLE},getType:function(){return this.modelType},toString:function(){var t="UNKNOWN";return this.modelType===PrecisionModel.FLOATING?t="Floating":this.modelType===PrecisionModel.FLOATING_SINGLE?t="Floating-Single":this.modelType===PrecisionModel.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},makePrecise:function(){if("number"==typeof arguments[0]){var t=arguments[0];if(Double.isNaN(t))return t;if(this.modelType===PrecisionModel.FLOATING_SINGLE){var e=t;return e}return this.modelType===PrecisionModel.FIXED?Math.round(t*this.scale)/this.scale:t}if(arguments[0]instanceof Coordinate){var n=arguments[0];if(this.modelType===PrecisionModel.FLOATING)return null;n.x=this.makePrecise(n.x),n.y=this.makePrecise(n.y)}},getMaximumSignificantDigits:function(){var t=16;return this.modelType===PrecisionModel.FLOATING?t=16:this.modelType===PrecisionModel.FLOATING_SINGLE?t=6:this.modelType===PrecisionModel.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},setScale:function(t){this.scale=Math.abs(t)},interfaces_:function(){return[Serializable,Comparable]},getClass:function(){return PrecisionModel}}),PrecisionModel.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},extend(Type.prototype,{readResolve:function(){return Type.nameToTypeMap.get(this.name)},toString:function(){return this.name},interfaces_:function(){return[Serializable]},getClass:function(){return Type}}),Type.serialVersionUID=-552860263173159e4,Type.nameToTypeMap=new HashMap,PrecisionModel.Type=Type,PrecisionModel.serialVersionUID=0x6bee6404e9a25c00,PrecisionModel.FIXED=new Type("FIXED"),PrecisionModel.FLOATING=new Type("FLOATING"),PrecisionModel.FLOATING_SINGLE=new Type("FLOATING SINGLE"),PrecisionModel.maximumPreciseValue=9007199254740992,extend(GeometryFactory.prototype,{toGeometry:function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new Coordinate(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new Coordinate(t.getMinX(),t.getMinY()),new Coordinate(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new Coordinate(t.getMinX(),t.getMinY()),new Coordinate(t.getMinX(),t.getMaxY()),new Coordinate(t.getMaxX(),t.getMaxY()),new Coordinate(t.getMaxX(),t.getMinY()),new Coordinate(t.getMinX(),t.getMinY())]),null)},createLineString:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(hasInterface(arguments[0],CoordinateSequence)){var t=arguments[0];return new LineString(t,this)}}},createMultiLineString:function(){if(0===arguments.length)return new MultiLineString(null,this);if(1===arguments.length){var t=arguments[0];return new MultiLineString(t,this)}},buildGeometry:function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var o=r.next(),s=o.getClass();null===e&&(e=s),s!==e&&(n=!0),o.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection(GeometryFactory.toGeometryArray(t));var a=t.iterator().next(),l=t.size()>1;if(l){if(a instanceof Polygon)return this.createMultiPolygon(GeometryFactory.toPolygonArray(t));if(a instanceof LineString)return this.createMultiLineString(GeometryFactory.toLineStringArray(t));if(a instanceof Point)return this.createMultiPoint(GeometryFactory.toPointArray(t));Assert.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},createMultiPointFromCoords:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},createPoint:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Coordinate){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(hasInterface(arguments[0],CoordinateSequence)){var e=arguments[0];return new Point(e,this)}}},getCoordinateSequenceFactory:function(){return this.coordinateSequenceFactory},createPolygon:function(){if(0===arguments.length)return new Polygon(null,null,this);if(1===arguments.length){if(hasInterface(arguments[0],CoordinateSequence)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof LinearRing){var e=arguments[0];return this.createPolygon(e,null)}}else if(2===arguments.length){var e=arguments[0],n=arguments[1];return new Polygon(e,n,this)}},getSRID:function(){return this.SRID},createGeometryCollection:function(){if(0===arguments.length)return new GeometryCollection(null,this);if(1===arguments.length){var t=arguments[0];return new GeometryCollection(t,this)}},createGeometry:function(t){var e=new GeometryEditor(this);return e.edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];arguments[1];return this.coordinateSequenceFactory.create(t)}}})},getPrecisionModel:function(){return this.precisionModel},createLinearRing:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(hasInterface(arguments[0],CoordinateSequence)){var t=arguments[0];return new LinearRing(t,this)}}},createMultiPolygon:function(){if(0===arguments.length)return new MultiPolygon(null,this);if(1===arguments.length){var t=arguments[0];return new MultiPolygon(t,this)}},createMultiPoint:function(){if(0===arguments.length)return new MultiPoint(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return new MultiPoint(t,this)}if(arguments[0]instanceof Array){var e=arguments[0];return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(hasInterface(arguments[0],CoordinateSequence)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),i=0;i<e.size();i++){var r=this.getCoordinateSequenceFactory().create(1,e.getDimension());CoordinateSequences.copy(e,i,r,0,1),n[i]=this.createPoint(r)}return this.createMultiPoint(n)}}},interfaces_:function(){return[Serializable]},getClass:function(){return GeometryFactory}}),GeometryFactory.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.getDefaultCoordinateSequenceFactory=function(){return CoordinateArraySequenceFactory.instance()},GeometryFactory.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},GeometryFactory.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},GeometryFactory.serialVersionUID=-0x5ea75f2051eeb400;var regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};extend(WKTParser.prototype,{read:function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var r=regExes.typeStr.exec(t);if(-1!==t.search("EMPTY")&&(r=regExes.emptyTypeStr.exec(t),r[2]=void 0),r&&(n=r[1].toLowerCase(),i=r[2],parse[n]&&(e=parse[n].apply(this,[i]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},write:function(t){return this.extractGeometry(t)},extractGeometry:function(t){var e=t.getGeometryType().toLowerCase();if(!extract[e])return null;var n,i=e.toUpperCase();return n=t.isEmpty()?i+" EMPTY":i+"("+extract[e].apply(this,[t])+")"}});var extract={coordinate:function(t){return t.x+" "+t.y},point:function(t){return extract.coordinate.call(this,t.coordinates.coordinates[0])},multipoint:function(t){for(var e=[],n=0,i=t.geometries.length;i>n;++n)e.push("("+extract.point.apply(this,[t.geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,i=t.points.coordinates.length;i>n;++n)e.push(extract.coordinate.apply(this,[t.points.coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,i=t.points.coordinates.length;i>n;++n)e.push(extract.coordinate.apply(this,[t.points.coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,i=t.geometries.length;i>n;++n)e.push("("+extract.linestring.apply(this,[t.geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+extract.linestring.apply(this,[t.shell])+")");for(var n=0,i=t.holes.length;i>n;++n)e.push("("+extract.linestring.apply(this,[t.holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,i=t.geometries.length;i>n;++n)e.push("("+extract.polygon.apply(this,[t.geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,i=t.geometries.length;i>n;++n)e.push(this.extractGeometry(t.geometries[n]));return e.join(",")}},parse={point:function(t){if(void 0===t)return this.geometryFactory.createPoint();var e=t.trim().split(regExes.spaces);return this.geometryFactory.createPoint(new Coordinate(Number.parseFloat(e[0]),Number.parseFloat(e[1])))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;o>r;++r)e=n[r].replace(regExes.trimParens,"$1"),i.push(parse.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(i)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;o>r;++r)e=n[r].trim().split(regExes.spaces),i.push(new Coordinate(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLineString(i)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing();for(var e,n=t.trim().split(","),i=[],r=0,o=n.length;o>r;++r)e=n[r].trim().split(regExes.spaces),i.push(new Coordinate(Number.parseFloat(e[0]),Number.parseFloat(e[1])));return this.geometryFactory.createLinearRing(i)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString();for(var e,n=t.trim().split(regExes.parenComma),i=[],r=0,o=n.length;o>r;++r)e=n[r].replace(regExes.trimParens,"$1"),i.push(parse.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(i)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon();for(var e,n,i,r,o=t.trim().split(regExes.parenComma),s=[],a=0,l=o.length;l>a;++a)e=o[a].replace(regExes.trimParens,"$1"),n=parse.linestring.apply(this,[e]),i=this.geometryFactory.createLinearRing(n.points),0===a?r=i:s.push(i);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon();for(var e,n=t.trim().split(regExes.doubleParenComma),i=[],r=0,o=n.length;o>r;++r)e=n[r].replace(regExes.trimParens,"$1"),i.push(parse.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(i)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection();t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var e=t.trim().split("|"),n=[],i=0,r=e.length;r>i;++i)n.push(this.read(e[i]));return this.geometryFactory.createGeometryCollection(n)}};extend(WKTWriter.prototype,{write:function(t){return this.parser.write(t)},toLineString:function(t,e){if(2!==arguments.length)throw new Error("Not implemented");return"LINESTRING ( "+t.x+" "+t.y+", "+e.x+" "+e.y+" )"}}),extend(LineIntersector.prototype,{getIndexAlongSegment:function(t,e){return this.computeIntLineIndex(),this.intLineIndex[t][e]},getTopologySummary:function(){var t=new StringBuffer;return this.isEndPoint()&&t.append(" endpoint"),this._isProper&&t.append(" proper"),this.isCollinear()&&t.append(" collinear"),t.toString()},computeIntersection:function(t,e,n,i){this.inputLines[0][0]=t,this.inputLines[0][1]=e,this.inputLines[1][0]=n,this.inputLines[1][1]=i,this.result=this.computeIntersect(t,e,n,i)},getIntersectionNum:function(){return this.result},computeIntLineIndex:function(){if(0===arguments.length)null===this.intLineIndex&&(this.intLineIndex=Array(2).fill().map(function(){return Array(2)}),this.computeIntLineIndex(0),this.computeIntLineIndex(1));else if(1===arguments.length){var t=arguments[0],e=this.getEdgeDistance(t,0),n=this.getEdgeDistance(t,1);e>n?(this.intLineIndex[t][0]=0,this.intLineIndex[t][1]=1):(this.intLineIndex[t][0]=1,this.intLineIndex[t][1]=0)}},isProper:function(){return this.hasIntersection()&&this._isProper},setPrecisionModel:function(t){this.precisionModel=t},isInteriorIntersection:function(){if(0===arguments.length)return this.isInteriorIntersection(0)?!0:!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;e<this.result;e++)if(!this.intPt[e].equals2D(this.inputLines[t][0])&&!this.intPt[e].equals2D(this.inputLines[t][1]))return!0;return!1}},getIntersection:function(t){return this.intPt[t]},isEndPoint:function(){return this.hasIntersection()&&!this._isProper},hasIntersection:function(){return this.result!==LineIntersector.NO_INTERSECTION},getEdgeDistance:function(t,e){var n=LineIntersector.computeEdgeDistance(this.intPt[e],this.inputLines[t][0],this.inputLines[t][1]);return n},isCollinear:function(){return this.result===LineIntersector.COLLINEAR_INTERSECTION},toString:function(){return WKTWriter.toLineString(this.inputLines[0][0],this.inputLines[0][1])+" - "+WKTWriter.toLineString(this.inputLines[1][0],this.inputLines[1][1])+this.getTopologySummary()},getEndpoint:function(t,e){return this.inputLines[t][e]},isIntersection:function(t){for(var e=0;e<this.result;e++)if(this.intPt[e].equals2D(t))return!0;return!1},getIntersectionAlongSegment:function(t,e){return this.computeIntLineIndex(),this.intPt[this.intLineIndex[t][e]]},interfaces_:function(){return[]},getClass:function(){return LineIntersector}}),LineIntersector.computeEdgeDistance=function(t,e,n){var i=Math.abs(n.x-e.x),r=Math.abs(n.y-e.y),o=-1;if(t.equals(e))o=0;else if(t.equals(n))o=i>r?i:r;else{var s=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);o=i>r?s:a,0!==o||t.equals(e)||(o=Math.max(s,a))}return Assert.isTrue(!(0===o&&!t.equals(e)),"Bad distance calculation"),o},LineIntersector.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=Math.sqrt(i*i+r*r);return Assert.isTrue(!(0===o&&!t.equals(e)),"Invalid distance calculation"),o},LineIntersector.DONT_INTERSECT=0,LineIntersector.DO_INTERSECT=1,LineIntersector.COLLINEAR=2,LineIntersector.NO_INTERSECTION=0,LineIntersector.POINT_INTERSECTION=1,LineIntersector.COLLINEAR_INTERSECTION=2,inherits(RobustLineIntersector,LineIntersector),extend(RobustLineIntersector.prototype,{isInSegmentEnvelopes:function(t){var e=new Envelope(this.inputLines[0][0],this.inputLines[0][1]),n=new Envelope(this.inputLines[1][0],this.inputLines[1][1]);return e.contains(t)&&n.contains(t)},computeIntersection:function(){if(3!==arguments.length)return LineIntersector.prototype.computeIntersection.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];return this._isProper=!1,Envelope.intersects(e,n,t)&&0===CGAlgorithms.orientationIndex(e,n,t)&&0===CGAlgorithms.orientationIndex(n,e,t)?(this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this.result=LineIntersector.POINT_INTERSECTION,null):void(this.result=LineIntersector.NO_INTERSECTION)},normalizeToMinimum:function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},safeHCoordinateIntersection:function(t,e,n,i){var r=null;try{r=HCoordinate.intersection(t,e,n,i)}catch(o){if(!(o instanceof NotRepresentableException))throw o;r=RobustLineIntersector.nearestEndpoint(t,e,n,i)}finally{}return r},intersection:function(t,e,n,i){var r=this.intersectionWithNormalization(t,e,n,i);return this.isInSegmentEnvelopes(r)||(r=new Coordinate(RobustLineIntersector.nearestEndpoint(t,e,n,i))),null!==this.precisionModel&&this.precisionModel.makePrecise(r),r},smallestInAbsValue:function(t,e,n,i){var r=t,o=Math.abs(r);return Math.abs(e)<o&&(r=e,o=Math.abs(e)),Math.abs(n)<o&&(r=n,o=Math.abs(n)),Math.abs(i)<o&&(r=i),r},checkDD:function(t,e,n,i,r){var o=CGAlgorithmsDD.intersection(t,e,n,i),s=this.isInSegmentEnvelopes(o);System.out.println("DD in env = "+s+" --------------------- "+o),r.distance(o)>1e-4&&System.out.println("Distance = "+r.distance(o))},intersectionWithNormalization:function(t,e,n,i){var r=new Coordinate(t),o=new Coordinate(e),s=new Coordinate(n),a=new Coordinate(i),l=new Coordinate;this.normalizeToEnvCentre(r,o,s,a,l);var u=this.safeHCoordinateIntersection(r,o,s,a);return u.x+=l.x,u.y+=l.y,u},computeCollinearIntersection:function(t,e,n,i){var r=Envelope.intersects(t,e,n),o=Envelope.intersects(t,e,i),s=Envelope.intersects(n,i,t),a=Envelope.intersects(n,i,e);return r&&o?(this.intPt[0]=n,this.intPt[1]=i,LineIntersector.COLLINEAR_INTERSECTION):s&&a?(this.intPt[0]=t,this.intPt[1]=e,LineIntersector.COLLINEAR_INTERSECTION):r&&s?(this.intPt[0]=n,this.intPt[1]=t,!n.equals(t)||o||a?LineIntersector.COLLINEAR_INTERSECTION:LineIntersector.POINT_INTERSECTION):r&&a?(this.intPt[0]=n,this.intPt[1]=e,!n.equals(e)||o||s?LineIntersector.COLLINEAR_INTERSECTION:LineIntersector.POINT_INTERSECTION):o&&s?(this.intPt[0]=i,this.intPt[1]=t,!i.equals(t)||r||a?LineIntersector.COLLINEAR_INTERSECTION:LineIntersector.POINT_INTERSECTION):o&&a?(this.intPt[0]=i,this.intPt[1]=e,!i.equals(e)||r||s?LineIntersector.COLLINEAR_INTERSECTION:LineIntersector.POINT_INTERSECTION):LineIntersector.NO_INTERSECTION;
},normalizeToEnvCentre:function(t,e,n,i,r){var o=t.x<e.x?t.x:e.x,s=t.y<e.y?t.y:e.y,a=t.x>e.x?t.x:e.x,l=t.y>e.y?t.y:e.y,u=n.x<i.x?n.x:i.x,c=n.y<i.y?n.y:i.y,h=n.x>i.x?n.x:i.x,d=n.y>i.y?n.y:i.y,g=o>u?o:u,f=h>a?a:h,p=s>c?s:c,m=d>l?l:d,y=(g+f)/2,v=(p+m)/2;r.x=y,r.y=v,t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},computeIntersect:function(t,e,n,i){if(this._isProper=!1,!Envelope.intersects(t,e,n,i))return LineIntersector.NO_INTERSECTION;var r=CGAlgorithms.orientationIndex(t,e,n),o=CGAlgorithms.orientationIndex(t,e,i);if(r>0&&o>0||0>r&&0>o)return LineIntersector.NO_INTERSECTION;var s=CGAlgorithms.orientationIndex(n,i,t),a=CGAlgorithms.orientationIndex(n,i,e);if(s>0&&a>0||0>s&&0>a)return LineIntersector.NO_INTERSECTION;var l=0===r&&0===o&&0===s&&0===a;return l?this.computeCollinearIntersection(t,e,n,i):(0===r||0===o||0===s||0===a?(this._isProper=!1,t.equals2D(n)||t.equals2D(i)?this.intPt[0]=t:e.equals2D(n)||e.equals2D(i)?this.intPt[0]=e:0===r?this.intPt[0]=new Coordinate(n):0===o?this.intPt[0]=new Coordinate(i):0===s?this.intPt[0]=new Coordinate(t):0===a&&(this.intPt[0]=new Coordinate(e))):(this._isProper=!0,this.intPt[0]=this.intersection(t,e,n,i)),LineIntersector.POINT_INTERSECTION)},interfaces_:function(){return[]},getClass:function(){return RobustLineIntersector}}),RobustLineIntersector.nearestEndpoint=function(t,e,n,i){var r=t,o=CGAlgorithms.distancePointLine(t,n,i),s=CGAlgorithms.distancePointLine(e,n,i);return o>s&&(o=s,r=e),s=CGAlgorithms.distancePointLine(n,t,e),o>s&&(o=s,r=n),s=CGAlgorithms.distancePointLine(i,t,e),o>s&&(o=s,r=i),r},extend(RobustDeterminant.prototype,{interfaces_:function(){return[]},getClass:function(){return RobustDeterminant}}),RobustDeterminant.orientationIndex=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-e.x,s=n.y-e.y;return RobustDeterminant.signOfDet2x2(i,r,o,s)},RobustDeterminant.signOfDet2x2=function(t,e,n,i){var r=null,o=null,s=null,a=0;if(r=1,0===t||0===i)return 0===e||0===n?0:e>0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(e>0?i>0?i>=e||(r=-r,o=t,t=n,n=o,o=e,e=i,i=o):-i>=e?(r=-r,n=-n,i=-i):(o=t,t=-n,n=o,o=e,e=-i,i=o):i>0?i>=-e?(r=-r,t=-t,e=-e):(o=-t,t=n,n=o,o=-e,e=i,i=o):e>=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,o=-t,t=-n,n=o,o=-e,e=-i,i=o),t>0){if(!(n>0))return r;if(!(n>=t))return r}else{if(n>0)return-r;if(!(t>=n))return-r;r=-r,t=-t,n=-n}for(;;){if(a+=1,s=Math.floor(n/t),n-=s*t,i-=s*e,0>i)return-r;if(i>e)return r;if(t>n+n){if(i+i>e)return r}else{if(e>i+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n)return r;if(s=Math.floor(t/n),t-=s*n,e-=s*i,0>e)return r;if(e>i)return-r;if(n>t+t){if(e+e>i)return-r}else{if(i>e+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},extend(RayCrossingCounter.prototype,{countSegment:function(t,e){if(t.x<this.p.x&&e.x<this.p.x)return null;if(this.p.x===e.x&&this.p.y===e.y)return this.isPointOnSegment=!0,null;if(t.y===this.p.y&&e.y===this.p.y){var n=t.x,i=e.x;return n>i&&(n=e.x,i=t.x),this.p.x>=n&&this.p.x<=i&&(this.isPointOnSegment=!0),null}if(t.y>this.p.y&&e.y<=this.p.y||e.y>this.p.y&&t.y<=this.p.y){var r=t.x-this.p.x,o=t.y-this.p.y,s=e.x-this.p.x,a=e.y-this.p.y,l=RobustDeterminant.signOfDet2x2(r,o,s,a);if(0===l)return this.isPointOnSegment=!0,null;o>a&&(l=-l),l>0&&this.crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==Location.EXTERIOR},getLocation:function(){return this.isPointOnSegment?Location.BOUNDARY:this.crossingCount%2===1?Location.INTERIOR:Location.EXTERIOR},isOnSegment:function(){return this.isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return RayCrossingCounter}}),RayCrossingCounter.locatePointInRing=function(){if(arguments[0]instanceof Coordinate&&hasInterface(arguments[1],CoordinateSequence)){for(var t=arguments[0],e=arguments[1],n=new RayCrossingCounter(t),i=new Coordinate,r=new Coordinate,o=1;o<e.size();o++)if(e.getCoordinate(o,i),e.getCoordinate(o-1,r),n.countSegment(i,r),n.isOnSegment())return n.getLocation();return n.getLocation()}if(arguments[0]instanceof Coordinate&&arguments[1]instanceof Array){for(var t=arguments[0],e=arguments[1],n=new RayCrossingCounter(t),o=1;o<e.length;o++){var i=e[o],r=e[o-1];if(n.countSegment(i,r),n.isOnSegment())return n.getLocation()}return n.getLocation()}},extend(CGAlgorithms.prototype,{interfaces_:function(){return[]},getClass:function(){return CGAlgorithms}}),CGAlgorithms.orientationIndex=function(t,e,n){return CGAlgorithmsDD.orientationIndex(t,e,n)},CGAlgorithms.signedArea=function(){if(arguments[0]instanceof Array){var t=arguments[0];if(t.length<3)return 0;for(var e=0,n=t[0].x,i=1;i<t.length-1;i++){var r=t[i].x-n,o=t[i+1].y,s=t[i-1].y;e+=r*(s-o)}return e/2}if(hasInterface(arguments[0],CoordinateSequence)){var t=arguments[0],a=t.size();if(3>a)return 0;var l=new Coordinate,u=new Coordinate,c=new Coordinate;t.getCoordinate(0,u),t.getCoordinate(1,c);var n=u.x;c.x-=n;for(var e=0,i=1;a-1>i;i++)l.y=u.y,u.x=c.x,u.y=c.y,t.getCoordinate(i+1,c),c.x-=n,e+=u.x*(l.y-c.y);return e/2}},CGAlgorithms.distanceLineLine=function(t,e,n,i){if(t.equals(e))return CGAlgorithms.distancePointLine(t,n,i);if(n.equals(i))return CGAlgorithms.distancePointLine(i,t,e);var r=!1;if(Envelope.intersects(t,e,n,i)){var o=(e.x-t.x)*(i.y-n.y)-(e.y-t.y)*(i.x-n.x);if(0===o)r=!0;else{var s=(t.y-n.y)*(i.x-n.x)-(t.x-n.x)*(i.y-n.y),a=(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y),l=a/o,u=s/o;(0>u||u>1||0>l||l>1)&&(r=!0)}}else r=!0;return r?MathUtil.min(CGAlgorithms.distancePointLine(t,n,i),CGAlgorithms.distancePointLine(e,n,i),CGAlgorithms.distancePointLine(n,t,e),CGAlgorithms.distancePointLine(i,t,e)):0},CGAlgorithms.isPointInRing=function(t,e){return CGAlgorithms.locatePointInRing(t,e)!==Location.EXTERIOR},CGAlgorithms.computeLength=function(t){var e=t.size();if(1>=e)return 0;var n=0,i=new Coordinate;t.getCoordinate(0,i);for(var r=i.x,o=i.y,s=1;e>s;s++){t.getCoordinate(s,i);var a=i.x,l=i.y,u=a-r,c=l-o;n+=Math.sqrt(u*u+c*c),r=a,o=l}return n},CGAlgorithms.isCCW=function(t){var e=t.length-1;if(3>e)throw new IllegalArgumentException("Ring has fewer than 4 points, so orientation cannot be determined");for(var n=t[0],i=0,r=1;e>=r;r++){var o=t[r];o.y>n.y&&(n=o,i=r)}var s=i;do s-=1,0>s&&(s=e);while(t[s].equals2D(n)&&s!==i);var a=i;do a=(a+1)%e;while(t[a].equals2D(n)&&a!==i);var l=t[s],u=t[a];if(l.equals2D(n)||u.equals2D(n)||l.equals2D(u))return!1;var c=CGAlgorithms.computeOrientation(l,n,u),h=!1;return h=0===c?l.x>u.x:c>0},CGAlgorithms.locatePointInRing=function(t,e){return RayCrossingCounter.locatePointInRing(t,e)},CGAlgorithms.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(r)*Math.sqrt(i)},CGAlgorithms.computeOrientation=function(t,e,n){return CGAlgorithms.orientationIndex(t,e,n)},CGAlgorithms.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new IllegalArgumentException("Line array must contain at least one vertex");for(var n=t.distance(e[0]),i=0;i<e.length-1;i++){var r=CGAlgorithms.distancePointLine(t,e[i],e[i+1]);n>r&&(n=r)}return n}if(3===arguments.length){var t=arguments[0],o=arguments[1],s=arguments[2];if(o.x===s.x&&o.y===s.y)return t.distance(o);var a=(s.x-o.x)*(s.x-o.x)+(s.y-o.y)*(s.y-o.y),l=((t.x-o.x)*(s.x-o.x)+(t.y-o.y)*(s.y-o.y))/a;if(0>=l)return t.distance(o);if(l>=1)return t.distance(s);var u=((o.y-t.y)*(s.x-o.x)-(o.x-t.x)*(s.y-o.y))/a;return Math.abs(u)*Math.sqrt(a)}},CGAlgorithms.isOnLine=function(t,e){for(var n=new RobustLineIntersector,i=1;i<e.length;i++){var r=e[i-1],o=e[i];if(n.computeIntersection(t,r,o),n.hasIntersection())return!0}return!1},CGAlgorithms.CLOCKWISE=-1,CGAlgorithms.RIGHT=CGAlgorithms.CLOCKWISE,CGAlgorithms.COUNTERCLOCKWISE=1,CGAlgorithms.LEFT=CGAlgorithms.COUNTERCLOCKWISE,CGAlgorithms.COLLINEAR=0,CGAlgorithms.STRAIGHT=CGAlgorithms.COLLINEAR,extend(LineSegment.prototype,{minX:function(){return Math.min(this.p0.x,this.p1.x)},orientationIndex:function(){if(arguments[0]instanceof LineSegment){var t=arguments[0],e=CGAlgorithms.orientationIndex(this.p0,this.p1,t.p0),n=CGAlgorithms.orientationIndex(this.p0,this.p1,t.p1);return e>=0&&n>=0?Math.max(e,n):0>=e&&0>=n?Math.max(e,n):0}if(arguments[0]instanceof Coordinate){var i=arguments[0];return CGAlgorithms.orientationIndex(this.p0,this.p1,i)}},toGeometry:function(t){return t.createLineString([this.p0,this.p1])},isVertical:function(){return this.p0.x===this.p1.x},equals:function(t){if(!(t instanceof LineSegment))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},intersection:function(t){var e=new RobustLineIntersector;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},project:function(){if(arguments[0]instanceof Coordinate){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new Coordinate(t);var e=this.projectionFactor(t),n=new Coordinate;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof LineSegment){var i=arguments[0],r=this.projectionFactor(i.p0),o=this.projectionFactor(i.p1);if(r>=1&&o>=1)return null;if(0>=r&&0>=o)return null;var s=this.project(i.p0);0>r&&(s=this.p0),r>1&&(s=this.p1);var a=this.project(i.p1);return 0>o&&(a=this.p0),o>1&&(a=this.p1),new LineSegment(s,a)}},normalize:function(){this.p1.compareTo(this.p0)<0&&this.reverse()},angle:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},getCoordinate:function(t){return 0===t?this.p0:this.p1},distancePerpendicular:function(t){return CGAlgorithms.distancePointLinePerpendicular(t,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return LineSegment.midPoint(this.p0,this.p1)},projectionFactor:function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,i=e*e+n*n;if(0>=i)return Double.NaN;var r=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/i;return r},closestPoints:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),i=Double.MAX_VALUE,r=null,o=this.closestPoint(t.p0);i=o.distance(t.p0),n[0]=o,n[1]=t.p0;var s=this.closestPoint(t.p1);r=s.distance(t.p1),i>r&&(i=r,n[0]=s,n[1]=t.p1);var a=t.closestPoint(this.p0);r=a.distance(this.p0),i>r&&(i=r,n[0]=this.p0,n[1]=a);var l=t.closestPoint(this.p1);return r=l.distance(this.p1),i>r&&(i=r,n[0]=this.p1,n[1]=l),n},closestPoint:function(t){var e=this.projectionFactor(t);if(e>0&&1>e)return this.project(t);var n=this.p0.distance(t),i=this.p1.distance(t);return i>n?this.p0:this.p1},maxX:function(){return Math.max(this.p0.x,this.p1.x)},getLength:function(){return this.p0.distance(this.p1)},compareTo:function(t){var e=t,n=this.p0.compareTo(e.p0);return 0!==n?n:this.p1.compareTo(e.p1)},reverse:function(){var t=this.p0;this.p0=this.p1,this.p1=t},equalsTopo:function(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)},lineIntersection:function(t){try{var e=HCoordinate.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(t){if(!(t instanceof NotRepresentableException))throw t}finally{}return null},maxY:function(){return Math.max(this.p0.y,this.p1.y)},pointAlongOffset:function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),i=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,o=this.p1.y-this.p0.y,s=Math.sqrt(r*r+o*o),a=0,l=0;if(0!==e){if(0>=s)throw new IllegalStateException("Cannot compute offset from zero-length line segment");a=e*r/s,l=e*o/s}var u=n-l,c=i+a,h=new Coordinate(u,c);return h},setCoordinates:function(){if(1===arguments.length){var t=arguments[0];this.setCoordinates(t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0.x=e.x,this.p0.y=e.y,this.p1.x=n.x,this.p1.y=n.y}},segmentFraction:function(t){var e=this.projectionFactor(t);return 0>e?e=0:(e>1||Double.isNaN(e))&&(e=1),e},toString:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},isHorizontal:function(){return this.p0.y===this.p1.y},distance:function(){if(arguments[0]instanceof LineSegment){var t=arguments[0];return CGAlgorithms.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof Coordinate){var e=arguments[0];return CGAlgorithms.distancePointLine(e,this.p0,this.p1)}},pointAlong:function(t){var e=new Coordinate;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},hashCode:function(){var t=java.lang.Double.doubleToLongBits(this.p0.x);t^=31*java.lang.Double.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=java.lang.Double.doubleToLongBits(this.p1.x);n^=31*java.lang.Double.doubleToLongBits(this.p1.y);var i=Math.trunc(n)^Math.trunc(n>>32);return e^i},interfaces_:function(){return[Comparable,Serializable]},getClass:function(){return LineSegment}}),LineSegment.midPoint=function(t,e){return new Coordinate((t.x+e.x)/2,(t.y+e.y)/2)},LineSegment.serialVersionUID=0x2d2172135f411c00,extend(IntersectionMatrix.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){var t=IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])||IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.BOUNDARY])||IntersectionMatrix.isTrue(this.matrix[Location.BOUNDARY][Location.INTERIOR])||IntersectionMatrix.isTrue(this.matrix[Location.BOUNDARY][Location.BOUNDARY]);return t&&this.matrix[Location.EXTERIOR][Location.INTERIOR]===Dimension.FALSE&&this.matrix[Location.EXTERIOR][Location.BOUNDARY]===Dimension.FALSE},isCoveredBy:function(){var t=IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])||IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.BOUNDARY])||IntersectionMatrix.isTrue(this.matrix[Location.BOUNDARY][Location.INTERIOR])||IntersectionMatrix.isTrue(this.matrix[Location.BOUNDARY][Location.BOUNDARY]);return t&&this.matrix[Location.INTERIOR][Location.EXTERIOR]===Dimension.FALSE&&this.matrix[Location.BOUNDARY][Location.EXTERIOR]===Dimension.FALSE},set:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),i=e%3;this.matrix[n][i]=Dimension.toDimensionValue(t.charAt(e))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.matrix[r][o]=s}},isContains:function(){return IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])&&this.matrix[Location.EXTERIOR][Location.INTERIOR]===Dimension.FALSE&&this.matrix[Location.EXTERIOR][Location.BOUNDARY]===Dimension.FALSE},setAtLeast:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<t.length;e++){var n=Math.trunc(e/3),i=e%3;this.setAtLeast(n,i,Dimension.toDimensionValue(t.charAt(e)))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];this.matrix[r][o]<s&&(this.matrix[r][o]=s)}},setAtLeastIfValid:function(t,e,n){t>=0&&e>=0&&this.setAtLeast(t,e,n)},isWithin:function(){return IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])&&this.matrix[Location.INTERIOR][Location.EXTERIOR]===Dimension.FALSE&&this.matrix[Location.BOUNDARY][Location.EXTERIOR]===Dimension.FALSE},isTouches:function(t,e){return t>e?this.isTouches(e,t):t===Dimension.A&&e===Dimension.A||t===Dimension.L&&e===Dimension.L||t===Dimension.L&&e===Dimension.A||t===Dimension.P&&e===Dimension.A||t===Dimension.P&&e===Dimension.L?this.matrix[Location.INTERIOR][Location.INTERIOR]===Dimension.FALSE&&(IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.BOUNDARY])||IntersectionMatrix.isTrue(this.matrix[Location.BOUNDARY][Location.INTERIOR])||IntersectionMatrix.isTrue(this.matrix[Location.BOUNDARY][Location.BOUNDARY])):!1},isOverlaps:function(t,e){return t===Dimension.P&&e===Dimension.P||t===Dimension.A&&e===Dimension.A?IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])&&IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.EXTERIOR])&&IntersectionMatrix.isTrue(this.matrix[Location.EXTERIOR][Location.INTERIOR]):t===Dimension.L&&e===Dimension.L?1===this.matrix[Location.INTERIOR][Location.INTERIOR]&&IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.EXTERIOR])&&IntersectionMatrix.isTrue(this.matrix[Location.EXTERIOR][Location.INTERIOR]):!1},isEquals:function(t,e){return t!==e?!1:IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])&&this.matrix[Location.INTERIOR][Location.EXTERIOR]===Dimension.FALSE&&this.matrix[Location.BOUNDARY][Location.EXTERIOR]===Dimension.FALSE&&this.matrix[Location.EXTERIOR][Location.INTERIOR]===Dimension.FALSE&&this.matrix[Location.EXTERIOR][Location.BOUNDARY]===Dimension.FALSE},toString:function(){for(var t=new StringBuffer("123456789"),e=0;3>e;e++)for(var n=0;3>n;n++)t.setCharAt(3*e+n,Dimension.toDimensionSymbol(this.matrix[e][n]));return t.toString()},setAll:function(t){for(var e=0;3>e;e++)for(var n=0;3>n;n++)this.matrix[e][n]=t},get:function(t,e){return this.matrix[t][e]},transpose:function(){var t=this.matrix[1][0];return this.matrix[1][0]=this.matrix[0][1],this.matrix[0][1]=t,t=this.matrix[2][0],this.matrix[2][0]=this.matrix[0][2],this.matrix[0][2]=t,t=this.matrix[2][1],this.matrix[2][1]=this.matrix[1][2],this.matrix[1][2]=t,this},matches:function(t){if(9!==t.length)throw new IllegalArgumentException("Should be length 9: "+t);for(var e=0;3>e;e++)for(var n=0;3>n;n++)if(!IntersectionMatrix.matches(this.matrix[e][n],t.charAt(3*e+n)))return!1;return!0},add:function(t){for(var e=0;3>e;e++)for(var n=0;3>n;n++)this.setAtLeast(e,n,t.get(e,n))},isDisjoint:function(){return this.matrix[Location.INTERIOR][Location.INTERIOR]===Dimension.FALSE&&this.matrix[Location.INTERIOR][Location.BOUNDARY]===Dimension.FALSE&&this.matrix[Location.BOUNDARY][Location.INTERIOR]===Dimension.FALSE&&this.matrix[Location.BOUNDARY][Location.BOUNDARY]===Dimension.FALSE},isCrosses:function(t,e){return t===Dimension.P&&e===Dimension.L||t===Dimension.P&&e===Dimension.A||t===Dimension.L&&e===Dimension.A?IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])&&IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.EXTERIOR]):t===Dimension.L&&e===Dimension.P||t===Dimension.A&&e===Dimension.P||t===Dimension.A&&e===Dimension.L?IntersectionMatrix.isTrue(this.matrix[Location.INTERIOR][Location.INTERIOR])&&IntersectionMatrix.isTrue(this.matrix[Location.EXTERIOR][Location.INTERIOR]):t===Dimension.L&&e===Dimension.L?0===this.matrix[Location.INTERIOR][Location.INTERIOR]:!1},interfaces_:function(){return[Clonable]},getClass:function(){return IntersectionMatrix}}),IntersectionMatrix.matches=function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],e=arguments[1];return e===Dimension.SYM_DONTCARE?!0:e===Dimension.SYM_TRUE&&(t>=0||t===Dimension.TRUE)?!0:e===Dimension.SYM_FALSE&&t===Dimension.FALSE?!0:e===Dimension.SYM_P&&t===Dimension.P?!0:e===Dimension.SYM_L&&t===Dimension.L?!0:e===Dimension.SYM_A&&t===Dimension.A}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var n=arguments[0],i=arguments[1],r=new IntersectionMatrix(n);return r.matches(i)}},IntersectionMatrix.isTrue=function(t){return t>=0||t===Dimension.TRUE},extend(Centroid.prototype,{addPoint:function(t){this.ptCount+=1,this.ptCentSum.x+=t.x,this.ptCentSum.y+=t.y},setBasePoint:function(t){null===this.areaBasePt&&(this.areaBasePt=t)},addLineSegments:function(t){for(var e=0,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);if(0!==i){e+=i;var r=(t[n].x+t[n+1].x)/2;this.lineCentSum.x+=i*r;var o=(t[n].y+t[n+1].y)/2;this.lineCentSum.y+=i*o}}this.totalLength+=e,0===e&&t.length>0&&this.addPoint(t[0])},addHole:function(t){for(var e=CGAlgorithms.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this.areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},getCentroid:function(){var t=new Coordinate;if(Math.abs(this.areasum2)>0)t.x=this.cg3.x/3/this.areasum2,t.y=this.cg3.y/3/this.areasum2;else if(this.totalLength>0)t.x=this.lineCentSum.x/this.totalLength,t.y=this.lineCentSum.y/this.totalLength;else{if(!(this.ptCount>0))return null;t.x=this.ptCentSum.x/this.ptCount,t.y=this.ptCentSum.y/this.ptCount}return t},addShell:function(t){t.length>0&&this.setBasePoint(t[0]);for(var e=!CGAlgorithms.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this.areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},addTriangle:function(t,e,n,i){var r=i?1:-1;Centroid.centroid3(t,e,n,this.triangleCent3);var o=Centroid.area2(t,e,n);this.cg3.x+=r*o*this.triangleCent3.x,this.cg3.y+=r*o*this.triangleCent3.y,this.areasum2+=r*o},add:function(){if(arguments[0]instanceof Polygon){var t=arguments[0];this.addShell(t.getExteriorRing().getCoordinates());for(var e=0;e<t.getNumInteriorRing();e++)this.addHole(t.getInteriorRingN(e).getCoordinates())}else if(arguments[0]instanceof Geometry){var n=arguments[0];if(n.isEmpty())return null;if(n instanceof Point)this.addPoint(n.getCoordinate());else if(n instanceof LineString)this.addLineSegments(n.getCoordinates());else if(n instanceof Polygon){var i=n;this.add(i)}else if(n instanceof GeometryCollection)for(var r=n,e=0;e<r.getNumGeometries();e++)this.add(r.getGeometryN(e))}},interfaces_:function(){return[]},getClass:function(){return Centroid}}),Centroid.area2=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(n.x-t.x)*(e.y-t.y)},Centroid.centroid3=function(t,e,n,i){return i.x=t.x+e.x+n.x,i.y=t.y+e.y+n.y,null},Centroid.getCentroid=function(t){var e=new Centroid(t);return e.getCentroid()},EmptyStackException.prototype=new Error,EmptyStackException.prototype.name="EmptyStackException",Stack.prototype=new List,Stack.prototype.add=function(t){return this.array_.push(t),!0},Stack.prototype.get=function(t){if(0>t||t>=this.size())throw new IndexOutOfBoundsException;return this.array_[t]},Stack.prototype.push=function(t){return this.array_.push(t),t},Stack.prototype.pop=function(t){if(0===this.array_.length)throw new EmptyStackException;return this.array_.pop()},Stack.prototype.peek=function(){if(0===this.array_.length)throw new EmptyStackException;return this.array_[this.array_.length-1]},Stack.prototype.empty=function(){return 0===this.array_.length},Stack.prototype.isEmpty=function(){return this.empty()},Stack.prototype.search=function(t){return this.array_.indexOf(t)},Stack.prototype.size=function(){return this.array_.length},Stack.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;n>e;e++)t.push(this.array_[e]);return t},extend(UniqueCoordinateArrayFilter.prototype,{filter:function(t){this.treeSet.contains(t)||(this.list.add(t),this.treeSet.add(t))},getCoordinates:function(){var t=new Array(this.list.size()).fill(null);return this.list.toArray(t)},interfaces_:function(){return[CoordinateFilter]},getClass:function(){return UniqueCoordinateArrayFilter}}),UniqueCoordinateArrayFilter.filterCoordinates=function(t){for(var e=new UniqueCoordinateArrayFilter,n=0;n<t.length;n++)e.filter(t[n]);return e.getCoordinates()},extend(ConvexHull.prototype,{preSort:function(t){for(var e=null,n=1;n<t.length;n++)(t[n].y<t[0].y||t[n].y===t[0].y&&t[n].x<t[0].x)&&(e=t[0],t[0]=t[n],t[n]=e);return Arrays.sort(t,1,t.length,new RadialComparator(t[0])),t},computeOctRing:function(t){var e=this.computeOctPts(t),n=new CoordinateList;return n.add(e,!1),n.size()<3?null:(n.closeRing(),n.toCoordinateArray())},lineOrPolygon:function(t){if(t=this.cleanRing(t),3===t.length)return this.geomFactory.createLineString([t[0],t[1]]);var e=this.geomFactory.createLinearRing(t);return this.geomFactory.createPolygon(e,null)},cleanRing:function(t){Assert.equals(t[0],t[t.length-1]);for(var e=new ArrayList,n=null,i=0;i<=t.length-2;i++){var r=t[i],o=t[i+1];r.equals(o)||null!==n&&this.isBetween(n,r,o)||(e.add(r),n=r)}e.add(t[t.length-1]);var s=new Array(e.size()).fill(null);return e.toArray(s)},isBetween:function(t,e,n){if(0!==CGAlgorithms.computeOrientation(t,e,n))return!1;if(t.x!==n.x){if(t.x<=e.x&&e.x<=n.x)return!0;if(n.x<=e.x&&e.x<=t.x)return!0}if(t.y!==n.y){if(t.y<=e.y&&e.y<=n.y)return!0;if(n.y<=e.y&&e.y<=t.y)return!0}return!1},reduce:function(t){var e=this.computeOctRing(t);if(null===e)return t;for(var n=new TreeSet,i=0;i<e.length;i++)n.add(e[i]);for(var i=0;i<t.length;i++)CGAlgorithms.isPointInRing(t[i],e)||n.add(t[i]);var r=CoordinateArrays.toCoordinateArray(n);return r.length<3?this.padArray3(r):r},getConvexHull:function(){if(0===this.inputPts.length)return this.geomFactory.createGeometryCollection(null);if(1===this.inputPts.length)return this.geomFactory.createPoint(this.inputPts[0]);if(2===this.inputPts.length)return this.geomFactory.createLineString(this.inputPts);var t=this.inputPts;this.inputPts.length>50&&(t=this.reduce(this.inputPts));var e=this.preSort(t),n=this.grahamScan(e),i=this.toCoordinateArray(n);return this.lineOrPolygon(i)},padArray3:function(t){for(var e=new Array(3).fill(null),n=0;n<e.length;n++)n<t.length?e[n]=t[n]:e[n]=t[0];return e},computeOctPts:function(t){for(var e=new Array(8).fill(null),n=0;n<e.length;n++)e[n]=t[0];for(var i=1;i<t.length;i++)t[i].x<e[0].x&&(e[0]=t[i]),t[i].x-t[i].y<e[1].x-e[1].y&&(e[1]=t[i]),t[i].y>e[2].y&&(e[2]=t[i]),t[i].x+t[i].y>e[3].x+e[3].y&&(e[3]=t[i]),t[i].x>e[4].x&&(e[4]=t[i]),t[i].x-t[i].y>e[5].x-e[5].y&&(e[5]=t[i]),t[i].y<e[6].y&&(e[6]=t[i]),t[i].x+t[i].y<e[7].x+e[7].y&&(e[7]=t[i]);return e},toCoordinateArray:function(t){for(var e=new Array(t.size()).fill(null),n=0;n<t.size();n++){var i=t.get(n);e[n]=i}return e},grahamScan:function(t){var e=null,n=new Stack;e=n.push(t[0]),e=n.push(t[1]),e=n.push(t[2]);for(var i=3;i<t.length;i++){for(e=n.pop();!n.empty()&&CGAlgorithms.computeOrientation(n.peek(),e,t[i])>0;)e=n.pop();e=n.push(e),e=n.push(t[i])}return e=n.push(t[0]),n},interfaces_:function(){return[]},getClass:function(){return ConvexHull}}),ConvexHull.extractCoordinates=function(t){var e=new UniqueCoordinateArrayFilter;return t.apply(e),e.getCoordinates()},extend(RadialComparator.prototype,{compare:function(t,e){var n=t,i=e;return RadialComparator.polarCompare(this.origin,n,i)},interfaces_:function(){return[Comparator]},getClass:function(){return RadialComparator}}),RadialComparator.polarCompare=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-t.x,s=n.y-t.y,a=CGAlgorithms.computeOrientation(t,e,n);if(a===CGAlgorithms.COUNTERCLOCKWISE)return 1;if(a===CGAlgorithms.CLOCKWISE)return-1;var l=i*i+r*r,u=o*o+s*s;return u>l?-1:l>u?1:0},ConvexHull.RadialComparator=RadialComparator,extend(InteriorPointArea.prototype,{addPolygon:function(t){if(t.isEmpty())return null;var e=null,n=0,i=this.horizontalBisector(t);if(0===i.getLength())n=0,e=i.getCoordinate();else{var r=i.intersection(t),o=this.widestGeometry(r);n=o.getEnvelopeInternal().getWidth(),e=InteriorPointArea.centre(o.getEnvelopeInternal())}(null===this.interiorPoint||n>this.maxWidth)&&(this.interiorPoint=e,this.maxWidth=n)},getInteriorPoint:function(){return this.interiorPoint},widestGeometry:function t(){if(arguments[0]instanceof GeometryCollection){var e=arguments[0];if(e.isEmpty())return e;for(var t=e.getGeometryN(0),n=1;n<e.getNumGeometries();n++)e.getGeometryN(n).getEnvelopeInternal().getWidth()>t.getEnvelopeInternal().getWidth()&&(t=e.getGeometryN(n));return t}if(arguments[0]instanceof Geometry){var i=arguments[0];return i instanceof GeometryCollection?this.widestGeometry(i):i}},horizontalBisector:function(t){var e=t.getEnvelopeInternal(),n=SafeBisectorFinder.getBisectorY(t);return this.factory.createLineString([new Coordinate(e.getMinX(),n),new Coordinate(e.getMaxX(),n)])},add:function(t){if(t instanceof Polygon)this.addPolygon(t);else if(t instanceof GeometryCollection)for(var e=t,n=0;n<e.getNumGeometries();n++)this.add(e.getGeometryN(n))},interfaces_:function(){return[]},getClass:function(){return InteriorPointArea}}),InteriorPointArea.centre=function(t){return new Coordinate(InteriorPointArea.avg(t.getMinX(),t.getMaxX()),InteriorPointArea.avg(t.getMinY(),t.getMaxY()))},InteriorPointArea.avg=function(t,e){return(t+e)/2},extend(SafeBisectorFinder.prototype,{updateInterval:function(t){t<=this.centreY?t>this.loY&&(this.loY=t):t>this.centreY&&t<this.hiY&&(this.hiY=t)},getBisectorY:function(){this.process(this.poly.getExteriorRing());for(var t=0;t<this.poly.getNumInteriorRing();t++)this.process(this.poly.getInteriorRingN(t));var e=InteriorPointArea.avg(this.hiY,this.loY);return e},process:function(t){for(var e=t.getCoordinateSequence(),n=0;n<e.size();n++){var i=e.getY(n);this.updateInterval(i)}},interfaces_:function(){return[]},getClass:function(){return SafeBisectorFinder}}),SafeBisectorFinder.getBisectorY=function(t){var e=new SafeBisectorFinder(t);return e.getBisectorY()},InteriorPointArea.SafeBisectorFinder=SafeBisectorFinder,extend(InteriorPointLine.prototype,{addEndpoints:function(){if(arguments[0]instanceof Geometry){var t=arguments[0];if(t instanceof LineString)this.addEndpoints(t.getCoordinates());else if(t instanceof GeometryCollection)for(var e=t,n=0;n<e.getNumGeometries();n++)this.addEndpoints(e.getGeometryN(n))}else if(arguments[0]instanceof Array){var i=arguments[0];this.add(i[0]),this.add(i[i.length-1])}},getInteriorPoint:function(){return this.interiorPoint},addInterior:function(){if(arguments[0]instanceof Geometry){var t=arguments[0];if(t instanceof LineString)this.addInterior(t.getCoordinates());else if(t instanceof GeometryCollection)for(var e=t,n=0;n<e.getNumGeometries();n++)this.addInterior(e.getGeometryN(n))}else if(arguments[0]instanceof Array)for(var i=arguments[0],n=1;n<i.length-1;n++)this.add(i[n])},add:function(t){var e=t.distance(this.centroid);e<this.minDistance&&(this.interiorPoint=new Coordinate(t),this.minDistance=e)},interfaces_:function(){return[]},getClass:function(){return InteriorPointLine}}),extend(InteriorPointPoint.prototype,{getInteriorPoint:function(){return this.interiorPoint},add:function(){if(arguments[0]instanceof Geometry){var t=arguments[0];if(t instanceof Point)this.add(t.getCoordinate());else if(t instanceof GeometryCollection)for(var e=t,n=0;n<e.getNumGeometries();n++)this.add(e.getGeometryN(n))}else if(arguments[0]instanceof Coordinate){var i=arguments[0],r=i.distance(this.centroid);r<this.minDistance&&(this.interiorPoint=new Coordinate(i),this.minDistance=r)}},interfaces_:function(){return[]},getClass:function(){return InteriorPointPoint}}),extend(Angle$1.prototype,{interfaces_:function(){return[]},getClass:function(){return Angle$1}}),Angle$1.toDegrees=function(t){return 180*t/Math.PI},Angle$1.normalize=function(t){for(;t>Math.PI;)t-=Angle$1.PI_TIMES_2;for(;t<=-Math.PI;)t+=Angle$1.PI_TIMES_2;return t},Angle$1.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=n.x-e.x,r=n.y-e.y;return Math.atan2(r,i)}},Angle$1.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=n.x-e.x,s=n.y-e.y,a=i*o+r*s;return a>0},Angle$1.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=n.x-e.x,s=n.y-e.y,a=i*o+r*s;return 0>a},Angle$1.interiorAngle=function(t,e,n){var i=Angle$1.angle(e,t),r=Angle$1.angle(e,n);return Math.abs(r-i)},Angle$1.normalizePositive=function(t){if(0>t){for(;0>t;)t+=Angle$1.PI_TIMES_2;t>=Angle$1.PI_TIMES_2&&(t=0)}else{for(;t>=Angle$1.PI_TIMES_2;)t-=Angle$1.PI_TIMES_2;0>t&&(t=0)}return t},Angle$1.angleBetween=function(t,e,n){var i=Angle$1.angle(e,t),r=Angle$1.angle(e,n);return Angle$1.diff(i,r)},Angle$1.diff=function(t,e){var n=null;return n=e>t?e-t:t-e,n>Math.PI&&(n=2*Math.PI-n),n},Angle$1.toRadians=function(t){return t*Math.PI/180},Angle$1.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?Angle$1.COUNTERCLOCKWISE:0>n?Angle$1.CLOCKWISE:Angle$1.NONE},Angle$1.angleBetweenOriented=function(t,e,n){var i=Angle$1.angle(e,t),r=Angle$1.angle(e,n),o=r-i;return o<=-Math.PI?o+Angle$1.PI_TIMES_2:o>Math.PI?o-Angle$1.PI_TIMES_2:o},Angle$1.PI_TIMES_2=2*Math.PI,Angle$1.PI_OVER_2=Math.PI/2,Angle$1.PI_OVER_4=Math.PI/4,Angle$1.COUNTERCLOCKWISE=CGAlgorithms.COUNTERCLOCKWISE,Angle$1.CLOCKWISE=CGAlgorithms.CLOCKWISE,Angle$1.NONE=CGAlgorithms.COLLINEAR,extend(Triangle.prototype,{area:function(){return Triangle.area(this.p0,this.p1,this.p2)},signedArea:function(){return Triangle.signedArea(this.p0,this.p1,this.p2);
},interpolateZ:function(t){if(null===t)throw new IllegalArgumentException("Supplied point is null.");return Triangle.interpolateZ(t,this.p0,this.p1,this.p2)},longestSideLength:function(){return Triangle.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return Triangle.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return Triangle.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return Triangle.area3D(this.p0,this.p1,this.p2)},centroid:function(){return Triangle.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return Triangle.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return Triangle}}),Triangle.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Triangle.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Triangle.det=function(t,e,n,i){return t*i-e*n},Triangle.interpolateZ=function(t,e,n,i){var r=e.x,o=e.y,s=n.x-r,a=i.x-r,l=n.y-o,u=i.y-o,c=s*u-a*l,h=t.x-r,d=t.y-o,g=(u*h-a*d)/c,f=(-l*h+s*d)/c,p=e.z+g*(n.z-e.z)+f*(i.z-e.z);return p},Triangle.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),o=n.distance(t),s=i;return r>s&&(s=r),o>s&&(s=o),s},Triangle.isAcute=function(t,e,n){return Angle.isAcute(t,e,n)&&Angle.isAcute(e,n,t)?!!Angle.isAcute(n,t,e):!1},Triangle.circumcentre=function(t,e,n){var i=n.x,r=n.y,o=t.x-i,s=t.y-r,a=e.x-i,l=e.y-r,u=2*Triangle.det(o,s,a,l),c=Triangle.det(s,o*o+s*s,l,a*a+l*l),h=Triangle.det(o,o*o+s*s,a,a*a+l*l),d=i-c/u,g=r+h/u;return new Coordinate(d,g)},Triangle.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y,r=new HCoordinate(t.x+n/2,t.y+i/2,1),o=new HCoordinate(t.x-i+n/2,t.y+n+i/2,1);return new HCoordinate(r,o)},Triangle.angleBisector=function(t,e,n){var i=e.distance(t),r=e.distance(n),o=i/(i+r),s=n.x-t.x,a=n.y-t.y,l=new Coordinate(t.x+o*s,t.y+o*a);return l},Triangle.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=e.z-t.z,s=n.x-t.x,a=n.y-t.y,l=n.z-t.z,u=r*l-o*a,c=o*s-i*l,h=i*a-r*s,d=u*u+c*c+h*h,g=Math.sqrt(d)/2;return g},Triangle.centroid=function(t,e,n){var i=(t.x+e.x+n.x)/3,r=(t.y+e.y+n.y)/3;return new Coordinate(i,r)},Triangle.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),o=t.distance(e),s=i+r+o,a=(i*t.x+r*e.x+o*n.x)/s,l=(i*t.y+r*e.y+o*n.y)/s;return new Coordinate(a,l)},extend(MinimumBoundingCircle.prototype,{getRadius:function(){return this.compute(),this.radius},getDiameter:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var t=this.extremalPts[0],e=this.extremalPts[1];return this.input.getFactory().createLineString([t,e])},getExtremalPoints:function(){return this.compute(),this.extremalPts},computeCirclePoints:function(){if(this.input.isEmpty())return this.extremalPts=new Array(0).fill(null),null;if(1===this.input.getNumPoints()){var t=this.input.getCoordinates();return this.extremalPts=[new Coordinate(t[0])],null}var e=this.input.convexHull(),n=e.getCoordinates(),t=n;if(n[0].equals2D(n[n.length-1])&&(t=new Array(n.length-1).fill(null),CoordinateArrays.copyDeep(n,0,t,0,n.length-1)),t.length<=2)return this.extremalPts=CoordinateArrays.copyDeep(t),null;for(var i=MinimumBoundingCircle.lowestPoint(t),r=MinimumBoundingCircle.pointWitMinAngleWithX(t,i),o=0;o<t.length;o++){var s=MinimumBoundingCircle.pointWithMinAngleWithSegment(t,i,r);if(Angle.isObtuse(i,s,r))return this.extremalPts=[new Coordinate(i),new Coordinate(r)],null;if(Angle.isObtuse(s,i,r))i=s;else{if(!Angle.isObtuse(s,r,i))return this.extremalPts=[new Coordinate(i),new Coordinate(r),new Coordinate(s)],null;r=s}}Assert.shouldNeverReachHere("Logic failure in Minimum Bounding Circle algorithm!")},compute:function(){return null!==this.extremalPts?null:(this.computeCirclePoints(),this.computeCentre(),void(null!==this.centre&&(this.radius=this.centre.distance(this.extremalPts[0]))))},getFarthestPoints:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var t=this.extremalPts[0],e=this.extremalPts[this.extremalPts.length-1];return this.input.getFactory().createLineString([t,e])},getCircle:function(){if(this.compute(),null===this.centre)return this.input.getFactory().createPolygon();var t=this.input.getFactory().createPoint(this.centre);return 0===this.radius?t:t.buffer(this.radius)},getCentre:function(){return this.compute(),this.centre},computeCentre:function(){switch(this.extremalPts.length){case 0:this.centre=null;break;case 1:this.centre=this.extremalPts[0];break;case 2:this.centre=new Coordinate((this.extremalPts[0].x+this.extremalPts[1].x)/2,(this.extremalPts[0].y+this.extremalPts[1].y)/2);break;case 3:this.centre=Triangle.circumcentre(this.extremalPts[0],this.extremalPts[1],this.extremalPts[2])}},interfaces_:function(){return[]},getClass:function(){return MinimumBoundingCircle}}),MinimumBoundingCircle.pointWitMinAngleWithX=function(t,e){for(var n=Double.MAX_VALUE,i=null,r=0;r<t.length;r++){var o=t[r];if(o!==e){var s=o.x-e.x,a=o.y-e.y;0>a&&(a=-a);var l=Math.sqrt(s*s+a*a),u=a/l;n>u&&(n=u,i=o)}}return i},MinimumBoundingCircle.lowestPoint=function(t){for(var e=t[0],n=1;n<t.length;n++)t[n].y<e.y&&(e=t[n]);return e},MinimumBoundingCircle.pointWithMinAngleWithSegment=function(t,e,n){for(var i=Double.MAX_VALUE,r=null,o=0;o<t.length;o++){var s=t[o];if(s!==e&&s!==n){var a=Angle.angleBetween(e,s,n);i>a&&(i=a,r=s)}}return r},extend(MinimumDiameter.prototype,{getWidthCoordinate:function(){return this.computeMinimumDiameter(),this.minWidthPt},getSupportingSegment:function(){return this.computeMinimumDiameter(),this.inputGeom.getFactory().createLineString([this.minBaseSeg.p0,this.minBaseSeg.p1])},getDiameter:function(){if(this.computeMinimumDiameter(),null===this.minWidthPt)return this.inputGeom.getFactory().createLineString(null);var t=this.minBaseSeg.project(this.minWidthPt);return this.inputGeom.getFactory().createLineString([t,this.minWidthPt])},computeWidthConvex:function(t){t instanceof Polygon?this.convexHullPts=t.getExteriorRing().getCoordinates():this.convexHullPts=t.getCoordinates(),0===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=null,this.minBaseSeg=null):1===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[0]):2===this.convexHullPts.length||3===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[1]):this.computeConvexRingMinDiameter(this.convexHullPts)},computeConvexRingMinDiameter:function(t){this.minWidth=Double.MAX_VALUE;for(var e=1,n=new LineSegment,i=0;i<t.length-1;i++)n.p0=t[i],n.p1=t[i+1],e=this.findMaxPerpDistance(t,n,e)},computeMinimumDiameter:function(){if(null!==this.minWidthPt)return null;if(this.isConvex)this.computeWidthConvex(this.inputGeom);else{var t=new ConvexHull(this.inputGeom).getConvexHull();this.computeWidthConvex(t)}},getLength:function(){return this.computeMinimumDiameter(),this.minWidth},findMaxPerpDistance:function(t,e,n){for(var i=e.distancePerpendicular(t[n]),r=i,o=n,s=o;r>=i;)i=r,o=s,s=MinimumDiameter.nextIndex(t,o),r=e.distancePerpendicular(t[s]);return i<this.minWidth&&(this.minPtIndex=o,this.minWidth=i,this.minWidthPt=t[this.minPtIndex],this.minBaseSeg=new LineSegment(e)),o},getMinimumRectangle:function(){if(this.computeMinimumDiameter(),0===this.minWidth)return this.minBaseSeg.p0.equals2D(this.minBaseSeg.p1)?this.inputGeom.getFactory().createPoint(this.minBaseSeg.p0):this.minBaseSeg.toGeometry(this.inputGeom.getFactory());for(var t=this.minBaseSeg.p1.x-this.minBaseSeg.p0.x,e=this.minBaseSeg.p1.y-this.minBaseSeg.p0.y,n=Double.MAX_VALUE,i=-Double.MAX_VALUE,r=Double.MAX_VALUE,o=-Double.MAX_VALUE,s=0;s<this.convexHullPts.length;s++){var a=MinimumDiameter.computeC(t,e,this.convexHullPts[s]);a>i&&(i=a),n>a&&(n=a);var l=MinimumDiameter.computeC(-e,t,this.convexHullPts[s]);l>o&&(o=l),r>l&&(r=l)}var u=MinimumDiameter.computeSegmentForLine(-t,-e,o),c=MinimumDiameter.computeSegmentForLine(-t,-e,r),h=MinimumDiameter.computeSegmentForLine(-e,t,i),d=MinimumDiameter.computeSegmentForLine(-e,t,n),g=h.lineIntersection(u),f=d.lineIntersection(u),p=d.lineIntersection(c),m=h.lineIntersection(c),y=this.inputGeom.getFactory().createLinearRing([g,f,p,m,g]);return this.inputGeom.getFactory().createPolygon(y,null)},interfaces_:function(){return[]},getClass:function(){return MinimumDiameter}}),MinimumDiameter.nextIndex=function(t,e){return e++,e>=t.length&&(e=0),e},MinimumDiameter.computeC=function(t,e,n){return t*n.y-e*n.x},MinimumDiameter.getMinimumDiameter=function(t){return new MinimumDiameter(t).getDiameter()},MinimumDiameter.getMinimumRectangle=function(t){return new MinimumDiameter(t).getMinimumRectangle()},MinimumDiameter.computeSegmentForLine=function(t,e,n){var i=null,r=null;return Math.abs(e)>Math.abs(t)?(i=new Coordinate(0,n/e),r=new Coordinate(1,n/e-t/e)):(i=new Coordinate(n/t,0),r=new Coordinate(n/t-e/t,1)),new LineSegment(i,r)},extend(GeometryTransformer.prototype,{transformPoint:function(t,e){return this.factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},transformPolygon:function(t,e){var n=!0,i=this.transformLinearRing(t.getExteriorRing(),t);null!==i&&i instanceof LinearRing&&!i.isEmpty()||(n=!1);for(var r=new ArrayList,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof LinearRing||(n=!1),r.add(s))}if(n)return this.factory.createPolygon(i,r.toArray([]));var a=new ArrayList;return null!==i&&a.add(i),a.addAll(r),this.factory.buildGeometry(a)},createCoordinateSequence:function(t){return this.factory.getCoordinateSequenceFactory().create(t)},getInputGeometry:function(){return this.inputGeom},transformMultiLineString:function(t,e){for(var n=new ArrayList,i=0;i<t.getNumGeometries();i++){var r=this.transformLineString(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this.factory.buildGeometry(n)},transformCoordinates:function(t,e){return this.copy(t)},transformLineString:function(t,e){return this.factory.createLineString(this.transformCoordinates(t.getCoordinateSequence(),t))},transformMultiPoint:function(t,e){for(var n=new ArrayList,i=0;i<t.getNumGeometries();i++){var r=this.transformPoint(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this.factory.buildGeometry(n)},transformMultiPolygon:function(t,e){for(var n=new ArrayList,i=0;i<t.getNumGeometries();i++){var r=this.transformPolygon(t.getGeometryN(i),t);null!==r&&(r.isEmpty()||n.add(r))}return this.factory.buildGeometry(n)},copy:function(t){return t.clone()},transformGeometryCollection:function(t,e){for(var n=new ArrayList,i=0;i<t.getNumGeometries();i++){var r=this.transform(t.getGeometryN(i));null!==r&&(this.pruneEmptyGeometry&&r.isEmpty()||n.add(r))}return this.preserveGeometryCollectionType?this.factory.createGeometryCollection(GeometryFactory.toGeometryArray(n)):this.factory.buildGeometry(n)},transform:function(t){if(this.inputGeom=t,this.factory=t.getFactory(),t instanceof Point)return this.transformPoint(t,null);if(t instanceof MultiPoint)return this.transformMultiPoint(t,null);if(t instanceof LinearRing)return this.transformLinearRing(t,null);if(t instanceof LineString)return this.transformLineString(t,null);if(t instanceof MultiLineString)return this.transformMultiLineString(t,null);if(t instanceof Polygon)return this.transformPolygon(t,null);if(t instanceof MultiPolygon)return this.transformMultiPolygon(t,null);if(t instanceof GeometryCollection)return this.transformGeometryCollection(t,null);throw new IllegalArgumentException("Unknown Geometry subtype: "+t.getClass().getName())},transformLinearRing:function(t,e){var n=this.transformCoordinates(t.getCoordinateSequence(),t);if(null===n)return this.factory.createLinearRing(null);var i=n.size();return i>0&&4>i&&!this.preserveType?this.factory.createLineString(n):this.factory.createLinearRing(n)},interfaces_:function(){return[]},getClass:function(){return GeometryTransformer}}),extend(Densifier.prototype,{getResultGeometry:function(){return new DensifyTransformer(this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(t){if(0>=t)throw new IllegalArgumentException("Tolerance must be positive");this.distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return Densifier}}),Densifier.densifyPoints=function(t,e,n){for(var i=new LineSegment,r=new CoordinateList,o=0;o<t.length-1;o++){i.p0=t[o],i.p1=t[o+1],r.add(i.p0,!1);var s=i.getLength(),a=Math.trunc(s/e)+1;if(a>1)for(var l=s/a,u=1;a>u;u++){var c=u*l/s,h=i.pointAlong(c);n.makePrecise(h),r.add(h,!1)}}return r.add(t[t.length-1],!1),r.toCoordinateArray()},Densifier.densify=function(t,e){var n=new Densifier(t);return n.setDistanceTolerance(e),n.getResultGeometry()},inherits(DensifyTransformer,GeometryTransformer),extend(DensifyTransformer.prototype,{transformMultiPolygon:function(t,e){var n=GeometryTransformer.prototype.transformMultiPolygon.call(this,t,e);return this.createValidArea(n)},transformPolygon:function(t,e){var n=GeometryTransformer.prototype.transformPolygon.call(this,t,e);return e instanceof MultiPolygon?n:this.createValidArea(n)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=Densifier.densifyPoints(n,this.distanceTolerance,e.getPrecisionModel());return e instanceof LineString&&1===i.length&&(i=new Array(0).fill(null)),this.factory.getCoordinateSequenceFactory().create(i)},createValidArea:function(t){return t.buffer(0)},interfaces_:function(){return[]},getClass:function(){return DensifyTransformer}}),Densifier.DensifyTransformer=DensifyTransformer,extend(Quadrant.prototype,{interfaces_:function(){return[]},getClass:function(){return Quadrant}}),Quadrant.isNorthern=function(t){return t===Quadrant.NE||t===Quadrant.NW},Quadrant.isOpposite=function(t,e){if(t===e)return!1;var n=(t-e+4)%4;return 2===n},Quadrant.commonHalfPlane=function(t,e){if(t===e)return t;var n=(t-e+4)%4;if(2===n)return-1;var i=e>t?t:e,r=t>e?t:e;return 0===i&&3===r?3:i},Quadrant.isInHalfPlane=function(t,e){return e===Quadrant.SE?t===Quadrant.SE||t===Quadrant.SW:t===e||t===e+1},Quadrant.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new IllegalArgumentException("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?Quadrant.NE:Quadrant.SE:e>=0?Quadrant.NW:Quadrant.SW}if(arguments[0]instanceof Coordinate&&arguments[1]instanceof Coordinate){var n=arguments[0],i=arguments[1];if(i.x===n.x&&i.y===n.y)throw new IllegalArgumentException("Cannot compute the quadrant for two identical points "+n);return i.x>=n.x?i.y>=n.y?Quadrant.NE:Quadrant.SE:i.y>=n.y?Quadrant.NW:Quadrant.SW}},Quadrant.NE=0,Quadrant.NW=1,Quadrant.SW=2,Quadrant.SE=3,extend(HalfEdge.prototype,{find:function(t){var e=this;do{if(null===e)return null;if(e.dest().equals2D(t))return e;e=e.oNext()}while(e!==this);return null},dest:function(){return this._sym._orig},oNext:function(){return this._sym._next},insert:function(t){if(this.oNext()===this)return this.insertAfter(t),null;var e=this.compareTo(t),n=this;do{var i=n.oNext(),r=i.compareTo(t);if(r!==e||i===this)return n.insertAfter(t),null;n=i}while(n!==this);Assert.shouldNeverReachHere()},insertAfter:function(t){Assert.equals(this._orig,t.orig());var e=this.oNext();this._sym.setNext(t),t.sym().setNext(e)},degree:function t(){var t=0,e=this;do t++,e=e.oNext();while(e!==this);return t},equals:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this._orig.equals2D(t)&&this._sym._orig.equals(e)}},deltaY:function(){return this._sym._orig.y-this._orig.y},sym:function(){return this._sym},prev:function(){return this._sym.next()._sym},compareAngularDirection:function(t){var e=this.deltaX(),n=this.deltaY(),i=t.deltaX(),r=t.deltaY();if(e===i&&n===r)return 0;var o=Quadrant.quadrant(e,n),s=Quadrant.quadrant(i,r);return o>s?1:s>o?-1:CGAlgorithms.computeOrientation(t._orig,t.dest(),this.dest())},prevNode:function(){for(var t=this;2===t.degree();)if(t=t.prev(),t===this)return null;return t},compareTo:function(t){var e=t,n=this.compareAngularDirection(e);return n},next:function(){return this._next},setSym:function(t){this._sym=t},orig:function(){return this._orig},toString:function(){return"HE("+this._orig.x+" "+this._orig.y+", "+this._sym._orig.x+" "+this._sym._orig.y+")"},setNext:function(t){this._next=t},init:function(t){this.setSym(t),t.setSym(this),this.setNext(t),t.setNext(this)},deltaX:function(){return this._sym._orig.x-this._orig.x},interfaces_:function(){return[]},getClass:function(){return HalfEdge}}),HalfEdge.init=function(t,e){if(null!==t._sym||null!==e._sym||null!==t._next||null!==e._next)throw new IllegalStateException("Edges are already initialized");return t.init(e),t},HalfEdge.create=function(t,e){var n=new HalfEdge(t),i=new HalfEdge(e);return n.init(i),n},inherits(MarkHalfEdge,HalfEdge),extend(MarkHalfEdge.prototype,{mark:function(){this._isMarked=!0},setMark:function(t){this._isMarked=t},isMarked:function(){return this._isMarked},interfaces_:function(){return[]},getClass:function(){return MarkHalfEdge}}),MarkHalfEdge.setMarkBoth=function(t,e){t.setMark(e),t.sym().setMark(e)},MarkHalfEdge.isMarked=function(t){return t.isMarked()},MarkHalfEdge.setMark=function(t,e){t.setMark(e)},MarkHalfEdge.markBoth=function(t){t.mark(),t.sym().mark()},MarkHalfEdge.mark=function(t){t.mark()},extend(EdgeGraph.prototype,{insert:function(t,e,n){var i=this.create(t,e);null!==n?n.insert(i):this.vertexMap.put(t,i);var r=this.vertexMap.get(e);return null!==r?r.insert(i.sym()):this.vertexMap.put(e,i.sym()),i},create:function(t,e){var n=this.createEdge(t),i=this.createEdge(e);return HalfEdge.init(n,i),n},createEdge:function(t){return new HalfEdge(t)},addEdge:function(t,e){if(!EdgeGraph.isValidEdge(t,e))return null;var n=this.vertexMap.get(t),i=null;if(null!==n&&(i=n.find(e)),null!==i)return i;var r=this.insert(t,e,n);return r},getVertexEdges:function(){return this.vertexMap.values()},findEdge:function(t,e){var n=this.vertexMap.get(t);return null===n?null:n.find(e)},interfaces_:function(){return[]},getClass:function(){return EdgeGraph}}),EdgeGraph.isValidEdge=function(t,e){var n=e.compareTo(t);return 0!==n},inherits(DissolveHalfEdge,MarkHalfEdge),extend(DissolveHalfEdge.prototype,{setStart:function(){this._isStart=!0},isStart:function(){return this._isStart},interfaces_:function(){return[]},getClass:function(){return DissolveHalfEdge}}),inherits(DissolveEdgeGraph,EdgeGraph),extend(DissolveEdgeGraph.prototype,{createEdge:function(t){return new DissolveHalfEdge(t)},interfaces_:function(){return[]},getClass:function(){return DissolveEdgeGraph}}),extend(LineDissolver.prototype,{addLine:function(t){this.lines.add(this.factory.createLineString(t.toCoordinateArray()))},updateRingStartEdge:function(t){return t.isStart()||(t=t.sym(),t.isStart())?null===this.ringStartEdge?(this.ringStartEdge=t,null):void(t.orig().compareTo(this.ringStartEdge.orig())<0&&(this.ringStartEdge=t)):null},getResult:function(){return null===this.result&&this.computeResult(),this.result},process:function(t){var e=t.prevNode();null===e&&(e=t),this.stackEdges(e),this.buildLines()},buildRing:function(t){var e=new CoordinateList,n=t;for(e.add(n.orig().copy(),!1);2===n.sym().degree();){var i=n.next();if(i===t)break;e.add(i.orig().copy(),!1),n=i}e.add(n.dest().copy(),!1),this.addLine(e)},buildLine:function(t){var e=new CoordinateList,n=t;for(this.ringStartEdge=null,MarkHalfEdge.markBoth(n),e.add(n.orig().copy(),!1);2===n.sym().degree();){this.updateRingStartEdge(n);var i=n.next();if(i===t)return this.buildRing(this.ringStartEdge),null;e.add(i.orig().copy(),!1),n=i,MarkHalfEdge.markBoth(n)}e.add(n.dest().copy(),!1),this.stackEdges(n.sym()),this.addLine(e)},stackEdges:function(t){var e=t;do MarkHalfEdge.isMarked(e)||this.nodeEdgeStack.add(e),e=e.oNext();while(e!==t)},computeResult:function(){for(var t=this.graph.getVertexEdges(),e=t.iterator();e.hasNext();){var n=e.next();MarkHalfEdge.isMarked(n)||this.process(n)}this.result=this.factory.buildGeometry(this.lines)},buildLines:function(){for(;!this.nodeEdgeStack.empty();){var t=this.nodeEdgeStack.pop();MarkHalfEdge.isMarked(t)||this.buildLine(t)}},add:function(){if(arguments[0]instanceof Geometry){var t=arguments[0];t.apply({interfaces_:function(){return[GeometryComponentFilter$1]},filter:function(t){t instanceof LineString&&this.add(t)}})}else if(hasInterface(arguments[0],Collection))for(var e=arguments[0],n=e.iterator();n.hasNext();){var i=n.next();this.add(i)}else if(arguments[0]instanceof LineString){var r=arguments[0];null===this.factory&&(this.factory=r.getFactory());for(var o=r.getCoordinateSequence(),s=!1,n=1;n<o.size();n++){var a=this.graph.addEdge(o.getCoordinate(n-1),o.getCoordinate(n));null!==a&&(s||(a.setStart(),s=!0))}}},interfaces_:function(){return[]},getClass:function(){return LineDissolver}}),LineDissolver.dissolve=function(t){var e=new LineDissolver;return e.add(t),e.getResult()},extend(NodeBase.prototype,{hasChildren:function(){for(var t=0;4>t;t++)if(null!==this.subnode[t])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(t){t.addAll(this.items);for(var e=0;4>e;e++)null!==this.subnode[e]&&this.subnode[e].addAllItems(t);return t},getNodeCount:function(){for(var t=0,e=0;4>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+1},size:function(){for(var t=0,e=0;4>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+this.items.size()},addAllItemsFromOverlapping:function(t,e){if(!this.isSearchMatch(t))return null;e.addAll(this.items);for(var n=0;4>n;n++)null!==this.subnode[n]&&this.subnode[n].addAllItemsFromOverlapping(t,e)},visitItems:function(t,e){for(var n=this.items.iterator();n.hasNext();)e.visitItem(n.next())},hasItems:function(){return!this.items.isEmpty()},remove:function(t,e){if(!this.isSearchMatch(t))return!1;for(var n=!1,i=0;4>i;i++)if(null!==this.subnode[i]&&(n=this.subnode[i].remove(t,e))){this.subnode[i].isPrunable()&&(this.subnode[i]=null);break}return n?n:n=this.items.remove(e)},visit:function(t,e){if(!this.isSearchMatch(t))return null;this.visitItems(t,e);for(var n=0;4>n;n++)null!==this.subnode[n]&&this.subnode[n].visit(t,e)},getItems:function(){return this.items},depth:function(){for(var t=0,e=0;4>e;e++)if(null!==this.subnode[e]){var n=this.subnode[e].depth();n>t&&(t=n)}return t+1},isEmpty:function t(){var t=!0;this.items.isEmpty()||(t=!1);for(var e=0;4>e;e++)null!==this.subnode[e]&&(this.subnode[e].isEmpty()||(t=!1));return t},add:function(t){this.items.add(t)},interfaces_:function(){return[Serializable]},getClass:function(){return NodeBase}}),NodeBase.getSubnodeIndex=function(t,e,n){var i=-1;return t.getMinX()>=e&&(t.getMinY()>=n&&(i=3),t.getMaxY()<=n&&(i=1)),t.getMaxX()<=e&&(t.getMinY()>=n&&(i=2),t.getMaxY()<=n&&(i=0)),i};var exponent=require("math-float64-exponent");DoubleBits.exponent=function(t){return exponent(t)},DoubleBits.powerOf2=function(t){return Math.pow(2,t)},extend(Key.prototype,{getLevel:function(){return this.level},computeKey:function(){if(1===arguments.length){var t=arguments[0];for(this.level=Key.computeQuadLevel(t),this.env=new Envelope,this.computeKey(this.level,t);!this.env.contains(t);)this.level+=1,this.computeKey(this.level,t)}else if(2===arguments.length){var e=arguments[0],t=arguments[1],n=DoubleBits.powerOf2(e);this.pt.x=Math.floor(t.getMinX()/n)*n,this.pt.y=Math.floor(t.getMinY()/n)*n,this.env.init(this.pt.x,this.pt.x+n,this.pt.y,this.pt.y+n)}},getEnvelope:function(){return this.env},getCentre:function(){return new Coordinate((this.env.getMinX()+this.env.getMaxX())/2,(this.env.getMinY()+this.env.getMaxY())/2)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Key}}),Key.computeQuadLevel=function(t){var e=t.getWidth(),n=t.getHeight(),i=e>n?e:n,r=DoubleBits.exponent(i)+1;return r},inherits(Node,NodeBase),extend(Node.prototype,{find:function(t){var e=NodeBase.getSubnodeIndex(t,this.centrex,this.centrey);if(-1===e)return this;if(null!==this.subnode[e]){var n=this.subnode[e];return n.find(t)}return this},isSearchMatch:function(t){return this.env.intersects(t)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getEnvelope:function(){return this.env},getNode:function(t){var e=NodeBase.getSubnodeIndex(t,this.centrex,this.centrey);if(-1!==e){var n=this.getSubnode(e);return n.getNode(t)}return this},createSubnode:function(t){var e=0,n=0,i=0,r=0;switch(t){case 0:e=this.env.getMinX(),n=this.centrex,i=this.env.getMinY(),r=this.centrey;break;case 1:e=this.centrex,n=this.env.getMaxX(),i=this.env.getMinY(),r=this.centrey;break;case 2:e=this.env.getMinX(),n=this.centrex,i=this.centrey,r=this.env.getMaxY();break;case 3:e=this.centrex,n=this.env.getMaxX(),i=this.centrey,r=this.env.getMaxY()}var o=new Envelope(e,n,i,r),s=new Node(o,this.level-1);return s},insertNode:function(t){Assert.isTrue(null===this.env||this.env.contains(t.env));var e=NodeBase.getSubnodeIndex(t.env,this.centrex,this.centrey);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insertNode(t),this.subnode[e]=n}},interfaces_:function(){return[]},getClass:function(){return Node}}),Node.createNode=function(t){var e=new Key(t),n=new Node(e.getEnvelope(),e.getLevel());return n},Node.createExpanded=function(t,e){var n=new Envelope(e);null!==t&&n.expandToInclude(t.env);var i=Node.createNode(n);return null!==t&&i.insertNode(t),i},extend(IntervalSize.prototype,{interfaces_:function(){return[]},getClass:function(){return IntervalSize}}),IntervalSize.isZeroWidth=function(t,e){var n=e-t;if(0===n)return!0;var i=Math.max(Math.abs(t),Math.abs(e)),r=n/i,o=DoubleBits.exponent(r);return o<=IntervalSize.MIN_BINARY_EXPONENT},IntervalSize.MIN_BINARY_EXPONENT=-50,inherits(Root,NodeBase),extend(Root.prototype,{insert:function(t,e){var n=NodeBase.getSubnodeIndex(t,Root.origin.x,Root.origin.y);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getEnvelope().contains(t)){var r=Node.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){Assert.isTrue(t.getEnvelope().contains(e));var i=IntervalSize.isZeroWidth(e.getMinX(),e.getMaxX()),r=IntervalSize.isZeroWidth(e.getMinY(),e.getMaxY()),o=null;o=i||r?t.find(e):t.getNode(e),o.add(n)},interfaces_:function(){return[]},getClass:function(){return Root}}),Root.origin=new Coordinate(0,0),extend(SpatialIndex.prototype,{insert:function(t,e){},remove:function(t,e){},query:function(){if(1===arguments.length){arguments[0]}else if(2===arguments.length){arguments[0],arguments[1]}},interfaces_:function(){return[]},getClass:function(){return SpatialIndex}}),extend(ItemVisitor.prototype,{visitItem:function(t){},interfaces_:function(){return[]},getClass:function(){return ItemVisitor}}),extend(ArrayListVisitor.prototype,{visitItem:function(t){this.items.add(t)},getItems:function(){return this.items},interfaces_:function(){return[ItemVisitor]},getClass:function(){return ArrayListVisitor}}),extend(Quadtree.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=Quadtree.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){var t=arguments[0],e=new ArrayListVisitor;return this.query(t,e),e.getItems()}if(2===arguments.length){var t=arguments[0],n=arguments[1];this.root.visit(t,n)}},queryAll:function(){var t=new ArrayList;return this.root.addAllItems(t),t},remove:function(t,e){var n=Quadtree.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e<this.minExtent&&e>0&&(this.minExtent=e);var n=t.getHeight();n<this.minExtent&&n>0&&(this.minExtent=n)},depth:function(){return null!==this.root?this.root.depth():0},isEmpty:function(){return null===this.root},interfaces_:function(){return[SpatialIndex,Serializable]},getClass:function(){return Quadtree}}),Quadtree.ensureExtent=function(t,e){var n=t.getMinX(),i=t.getMaxX(),r=t.getMinY(),o=t.getMaxY();return n!==i&&r!==o?t:(n===i&&(n-=e/2,i=n+e/2),r===o&&(r-=e/2,o=r+e/2),new Envelope(n,i,r,o))},Quadtree.serialVersionUID=-0x678b60c967a25400,extend(Boundable.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return Boundable}}),extend(ItemBoundable.prototype,{getItem:function(){return this.item},getBounds:function(){return this.bounds},interfaces_:function(){return[Boundable,Serializable]},getClass:function(){return ItemBoundable}}),extend(PriorityQueue.prototype,{poll:function(){if(this.isEmpty())return null;var t=this.items.get(1);return this.items.set(1,this.items.get(this._size)),this._size-=1,this.reorder(1),t},size:function(){return this._size},reorder:function(t){for(var e=null,n=this.items.get(t);2*t<=this._size&&(e=2*t,e!==this._size&&this.items.get(e+1).compareTo(this.items.get(e))<0&&e++,this.items.get(e).compareTo(n)<0);t=e)this.items.set(t,this.items.get(e));this.items.set(t,n)},clear:function(){this._size=0,this.items.clear()},isEmpty:function(){return 0===this._size},add:function(t){this.items.add(null),this._size+=1;var e=this._size;for(this.items.set(0,t);t.compareTo(this.items.get(Math.trunc(e/2)))<0;e/=2)this.items.set(e,this.items.get(Math.trunc(e/2)));this.items.set(e,t)},interfaces_:function(){return[]},getClass:function(){return PriorityQueue}}),extend(AbstractNode.prototype,{getLevel:function(){return this.level},size:function(){return this.childBoundables.size()},getChildBoundables:function(){return this.childBoundables},addChildBoundable:function(t){Assert.isTrue(null===this.bounds),this.childBoundables.add(t)},isEmpty:function(){return this.childBoundables.isEmpty()},getBounds:function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},interfaces_:function(){return[Boundable,Serializable]},getClass:function(){return AbstractNode}}),AbstractNode.serialVersionUID=0x5a1e55ec41369800;var Collections={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return Collections.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?Arrays.sort(n,e):Arrays.sort(n);for(var i=t.iterator(),r=0,o=n.length;o>r;r++)i.next(),i.set(n[r])},singletonList:function(t){var e=new ArrayList;return e.add(t),e}};extend(BoundablePair.prototype,{expandToQueue:function(t,e){var n=BoundablePair.isComposite(this.boundable1),i=BoundablePair.isComposite(this.boundable2);if(n&&i)return BoundablePair.area(this.boundable1)>BoundablePair.area(this.boundable2)?(this.expand(this.boundable1,this.boundable2,t,e),null):(this.expand(this.boundable2,this.boundable1,t,e),null);if(n)return this.expand(this.boundable1,this.boundable2,t,e),null;if(i)return this.expand(this.boundable2,this.boundable1,t,e),null;throw new IllegalArgumentException("neither boundable is composite")},isLeaves:function(){return!(BoundablePair.isComposite(this.boundable1)||BoundablePair.isComposite(this.boundable2))},compareTo:function(t){var e=t;return this._distance<e._distance?-1:this._distance>e._distance?1:0},expand:function(t,e,n,i){for(var r=t.getChildBoundables(),o=r.iterator();o.hasNext();){var s=o.next(),a=new BoundablePair(s,e,this.itemDistance);a.getDistance()<i&&n.add(a)}},getBoundable:function(t){return 0===t?this.boundable1:this.boundable2},getDistance:function(){return this._distance},distance:function(){return this.isLeaves()?this.itemDistance.distance(this.boundable1,this.boundable2):this.boundable1.getBounds().distance(this.boundable2.getBounds())},interfaces_:function(){return[Comparable]},getClass:function(){return BoundablePair}}),BoundablePair.area=function(t){return t.getBounds().getArea();
},BoundablePair.isComposite=function(t){return t instanceof AbstractNode},extend(AbstractSTRtree.prototype,{getNodeCapacity:function(){return this.nodeCapacity},lastNode:function(t){return t.get(t.size()-1)},size:function t(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this.root));if(1===arguments.length){for(var e=arguments[0],t=0,n=e.getChildBoundables().iterator();n.hasNext();){var i=n.next();i instanceof AbstractNode?t+=this.size(i):i instanceof ItemBoundable&&(t+=1)}return t}},removeItem:function(t,e){for(var n=null,i=t.getChildBoundables().iterator();i.hasNext();){var r=i.next();r instanceof ItemBoundable&&r.getItem()===e&&(n=r)}return null!==n?(t.getChildBoundables().remove(n),!0):!1},itemsTree:function(){if(0===arguments.length){this.build();var t=this.itemsTree(this.root);return null===t?new ArrayList:t}if(1===arguments.length){for(var e=arguments[0],n=new ArrayList,i=e.getChildBoundables().iterator();i.hasNext();){var r=i.next();if(r instanceof AbstractNode){var o=this.itemsTree(r);null!==o&&n.add(o)}else r instanceof ItemBoundable?n.add(r.getItem()):Assert.shouldNeverReachHere()}return n.size()<=0?null:n}},insert:function(t,e){Assert.isTrue(!this.built,"Cannot insert items into an STR packed R-tree after it has been built."),this.itemBoundables.add(new ItemBoundable(t,e))},boundablesAtLevel:function(){if(1===arguments.length){var t=arguments[0],e=new ArrayList;return this.boundablesAtLevel(t,this.root,e),e}if(3===arguments.length){var t=arguments[0],n=arguments[1],i=arguments[2];if(Assert.isTrue(t>-2),n.getLevel()===t)return i.add(n),null;for(var r=n.getChildBoundables().iterator();r.hasNext();){var o=r.next();o instanceof AbstractNode?this.boundablesAtLevel(t,o,i):(Assert.isTrue(o instanceof ItemBoundable),-1===t&&i.add(o))}return null}},query:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new ArrayList;return this.isEmpty()?e:(this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.query(t,this.root,e),e)}if(2===arguments.length){var t=arguments[0],n=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.query(t,this.root,n)}else if(3===arguments.length)if(hasInterface(arguments[2],ItemVisitor)&&arguments[0]instanceof Object&&arguments[1]instanceof AbstractNode)for(var t=arguments[0],i=arguments[1],n=arguments[2],r=i.getChildBoundables(),o=0;o<r.size();o++){var s=r.get(o);this.getIntersectsOp().intersects(s.getBounds(),t)&&(s instanceof AbstractNode?this.query(t,s,n):s instanceof ItemBoundable?n.visitItem(s.getItem()):Assert.shouldNeverReachHere())}else if(hasInterface(arguments[2],List)&&arguments[0]instanceof Object&&arguments[1]instanceof AbstractNode)for(var t=arguments[0],i=arguments[1],a=arguments[2],r=i.getChildBoundables(),o=0;o<r.size();o++){var s=r.get(o);this.getIntersectsOp().intersects(s.getBounds(),t)&&(s instanceof AbstractNode?this.query(t,s,a):s instanceof ItemBoundable?a.add(s.getItem()):Assert.shouldNeverReachHere())}},build:function(){return this.built?null:(this.root=this.itemBoundables.isEmpty()?this.createNode(0):this.createHigherLevels(this.itemBoundables,-1),this.itemBoundables=null,void(this.built=!0))},getRoot:function(){return this.build(),this.root},remove:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.build(),this.getIntersectsOp().intersects(this.root.getBounds(),t)?this.remove(t,this.root,e):!1}if(3===arguments.length){var t=arguments[0],n=arguments[1],e=arguments[2],i=this.removeItem(n,e);if(i)return!0;for(var r=null,o=n.getChildBoundables().iterator();o.hasNext();){var s=o.next();if(this.getIntersectsOp().intersects(s.getBounds(),t)&&s instanceof AbstractNode&&(i=this.remove(t,s,e))){r=s;break}}return null!==r&&r.getChildBoundables().isEmpty()&&n.getChildBoundables().remove(r),i}},createHigherLevels:function(t,e){Assert.isTrue(!t.isEmpty());var n=this.createParentBoundables(t,e+1);return 1===n.size()?n.get(0):this.createHigherLevels(n,e+1)},depth:function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.depth(this.root));if(1===arguments.length){for(var t=arguments[0],e=0,n=t.getChildBoundables().iterator();n.hasNext();){var i=n.next();if(i instanceof AbstractNode){var r=this.depth(i);r>e&&(e=r)}}return e+1}},createParentBoundables:function(t,e){Assert.isTrue(!t.isEmpty());var n=new ArrayList;n.add(this.createNode(e));var i=new ArrayList(t);Collections.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var o=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(o)}return n},isEmpty:function(){return this.built?this.root.isEmpty():this.itemBoundables.isEmpty()},interfaces_:function(){return[Serializable]},getClass:function(){return AbstractSTRtree}}),AbstractSTRtree.compareDoubles=function(t,e){return t>e?1:e>t?-1:0},AbstractSTRtree.IntersectsOp=IntersectsOp$1,AbstractSTRtree.serialVersionUID=-0x35ef64c82d4c5400,AbstractSTRtree.DEFAULT_NODE_CAPACITY=10,extend(ItemDistance.prototype,{distance:function(t,e){},interfaces_:function(){return[]},getClass:function(){return ItemDistance}}),inherits(STRtree,AbstractSTRtree),extend(STRtree.prototype,{createParentBoundablesFromVerticalSlices:function(t,e){Assert.isTrue(t.length>0);for(var n=new ArrayList,i=0;i<t.length;i++)n.addAll(this.createParentBoundablesFromVerticalSlice(t[i],e));return n},createNode:function(t){return new STRtreeNode(t)},size:function(){return 0===arguments.length?AbstractSTRtree.prototype.size.call(this):AbstractSTRtree.prototype.size.apply(this,arguments)},insert:function(){if(2!==arguments.length)return AbstractSTRtree.prototype.insert.apply(this,arguments);var t=arguments[0],e=arguments[1];return t.isNull()?null:void AbstractSTRtree.prototype.insert.call(this,t,e)},getIntersectsOp:function(){return STRtree.intersectsOp},verticalSlices:function(t,e){for(var n=Math.trunc(Math.ceil(t.size()/e)),i=new Array(e).fill(null),r=t.iterator(),o=0;e>o;o++){i[o]=new ArrayList;for(var s=0;r.hasNext()&&n>s;){var a=r.next();i[o].add(a),s++}}return i},query:function(){if(1===arguments.length){var t=arguments[0];return AbstractSTRtree.prototype.query.call(this,t)}if(2===arguments.length){var t=arguments[0],e=arguments[1];AbstractSTRtree.prototype.query.call(this,t,e)}else if(3===arguments.length)if(hasInterface(arguments[2],ItemVisitor)&&arguments[0]instanceof Object&&arguments[1]instanceof AbstractNode){var n=arguments[0],i=arguments[1],e=arguments[2];AbstractSTRtree.prototype.query.call(this,n,i,e)}else if(hasInterface(arguments[2],List)&&arguments[0]instanceof Object&&arguments[1]instanceof AbstractNode){var n=arguments[0],i=arguments[1],r=arguments[2];AbstractSTRtree.prototype.query.call(this,n,i,r)}},getComparator:function(){return STRtree.yComparator},createParentBoundablesFromVerticalSlice:function(t,e){return AbstractSTRtree.prototype.createParentBoundables.call(this,t,e)},remove:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return AbstractSTRtree.prototype.remove.call(this,t,e)}return AbstractSTRtree.prototype.remove.apply(this,arguments)},depth:function(){return 0===arguments.length?AbstractSTRtree.prototype.depth.call(this):AbstractSTRtree.prototype.depth.apply(this,arguments)},createParentBoundables:function(t,e){Assert.isTrue(!t.isEmpty());var n=Math.trunc(Math.ceil(t.size()/this.getNodeCapacity())),i=new ArrayList(t);Collections.sort(i,STRtree.xComparator);var r=this.verticalSlices(i,Math.trunc(Math.ceil(Math.sqrt(n))));return this.createParentBoundablesFromVerticalSlices(r,e)},nearestNeighbour:function(){if(1===arguments.length){if(hasInterface(arguments[0],ItemDistance)){var t=arguments[0],e=new BoundablePair(this.getRoot(),this.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof BoundablePair){var n=arguments[0];return this.nearestNeighbour(n,Double.POSITIVE_INFINITY)}}else if(2===arguments.length){if(arguments[0]instanceof STRtree&&hasInterface(arguments[1],ItemDistance)){var i=arguments[0],t=arguments[1],e=new BoundablePair(this.getRoot(),i.getRoot(),t);return this.nearestNeighbour(e)}if(arguments[0]instanceof BoundablePair&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],o=r,s=null,a=new PriorityQueue;for(a.add(n);!a.isEmpty()&&o>0;){var l=a.poll(),u=l.getDistance();if(u>=o)break;l.isLeaves()?(o=u,s=l):l.expandToQueue(a,o)}return[s.getBoundable(0).getItem(),s.getBoundable(1).getItem()]}}else if(3===arguments.length){var c=arguments[0],h=arguments[1],t=arguments[2],d=new ItemBoundable(c,h),e=new BoundablePair(this.getRoot(),d,t);return this.nearestNeighbour(e)[0]}},interfaces_:function(){return[SpatialIndex,Serializable]},getClass:function(){return STRtree}}),STRtree.centreX=function(t){return STRtree.avg(t.getMinX(),t.getMaxX())},STRtree.avg=function(t,e){return(t+e)/2},STRtree.centreY=function(t){return STRtree.avg(t.getMinY(),t.getMaxY())},inherits(STRtreeNode,AbstractNode),extend(STRtreeNode.prototype,{computeBounds:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new Envelope(n.getBounds()):t.expandToInclude(n.getBounds())}return t},interfaces_:function(){return[]},getClass:function(){return STRtreeNode}}),STRtree.STRtreeNode=STRtreeNode,STRtree.serialVersionUID=0x39920f7d5f261e0,STRtree.xComparator={interfaces_:function(){return[Comparator]},compare:function(t,e){return AbstractSTRtree.compareDoubles(STRtree.centreX(t.getBounds()),STRtree.centreX(e.getBounds()))}},STRtree.yComparator={interfaces_:function(){return[Comparator]},compare:function(t,e){return AbstractSTRtree.compareDoubles(STRtree.centreY(t.getBounds()),STRtree.centreY(e.getBounds()))}},STRtree.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(t,e){return t.intersects(e)}},STRtree.DEFAULT_NODE_CAPACITY=10;var geometryTypes=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];extend(GeoJSONParser.prototype,{read:function(t){var e=void 0;e="string"==typeof t?JSON.parse(t):t;var n=e.type;if(!parse$1[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==geometryTypes.indexOf(n)?parse$1[n].apply(this,[e.coordinates]):"GeometryCollection"===n?parse$1[n].apply(this,[e.geometries]):this.parse[n].apply(this,[e])},write:function(t){var e=t.getGeometryType();if(!extract$1[e])throw new Error("Geometry is not supported");return extract$1[e].apply(this,[t])}});var parse$1={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var i=t.geometry.type;if(!this.parse[i])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n<t.features.length;++n)e.features.push(this.read(t.features[n]))}return t.bbox&&(e.bbox=this.parse.bbox.apply(this,[t.bbox])),e},coordinates:function t(e){for(var t=[],n=0;n<e.length;++n){var i=e[n];t.push(new Coordinate(i[0],i[1]))}return t},bbox:function(t){return this.geometryFactory.createLinearRing([new Coordinate(t[0],t[1]),new Coordinate(t[2],t[1]),new Coordinate(t[2],t[3]),new Coordinate(t[0],t[3]),new Coordinate(t[0],t[1])])},Point:function(t){var e=new Coordinate(t[0],t[1]);return this.geometryFactory.createPoint(e)},MultiPoint:function(t){for(var e=[],n=0;n<t.length;++n)e.push(parse$1.Point.apply(this,[t[n]]));return this.geometryFactory.createMultiPoint(e)},LineString:function(t){var e=parse$1.coordinates.apply(this,[t]);return this.geometryFactory.createLineString(e)},MultiLineString:function(t){for(var e=[],n=0;n<t.length;++n)e.push(parse$1.LineString.apply(this,[t[n]]));return this.geometryFactory.createMultiLineString(e)},Polygon:function(t){for(var e=parse$1.coordinates.apply(this,[t[0]]),n=this.geometryFactory.createLinearRing(e),i=[],r=1;r<t.length;++r){var o=t[r],s=parse$1.coordinates.apply(this,[o]),a=this.geometryFactory.createLinearRing(s);i.push(a)}return this.geometryFactory.createPolygon(n,i)},MultiPolygon:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(parse$1.Polygon.apply(this,[i]))}return this.geometryFactory.createMultiPolygon(e)},GeometryCollection:function(t){for(var e=[],n=0;n<t.length;++n){var i=t[n];e.push(this.read(i))}return this.geometryFactory.createGeometryCollection(e)}},extract$1={coordinate:function(t){return[t.x,t.y]},Point:function(t){var e=extract$1.coordinate.apply(this,[t.getCoordinate()]);return{type:"Point",coordinates:e}},MultiPoint:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=extract$1.Point.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPoint",coordinates:e}},LineString:function(t){for(var e=[],n=t.getCoordinates(),i=0;i<n.length;++i){var r=n[i];e.push(extract$1.coordinate.apply(this,[r]))}return{type:"LineString",coordinates:e}},MultiLineString:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=extract$1.LineString.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiLineString",coordinates:e}},Polygon:function(t){var e=[],n=extract$1.LineString.apply(this,[t.shell]);e.push(n.coordinates);for(var i=0;i<t.holes.length;++i){var r=t.holes[i],o=extract$1.LineString.apply(this,[r]);e.push(o.coordinates)}return{type:"Polygon",coordinates:e}},MultiPolygon:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=extract$1.Polygon.apply(this,[i]);e.push(r.coordinates)}return{type:"MultiPolygon",coordinates:e}},GeometryCollection:function(t){for(var e=[],n=0;n<t.geometries.length;++n){var i=t.geometries[n],r=i.getGeometryType().slice(10);e.push(extract$1[r].apply(this,[i]))}return{type:"GeometryCollection",geometries:e}}};extend(GeoJSONReader.prototype,{read:function(t){var e=this.parser.read(t);return this.precisionModel.getType()===PrecisionModel.FIXED&&this.reducePrecision(e),e},reducePrecision:function(t){var e,n;if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(e=0,n=t.points.length;n>e;e++)this.precisionModel.makePrecise(t.points[e]);else if(t.geometries)for(e=0,n=t.geometries.length;n>e;e++)this.reducePrecision(t.geometries[e])}}),extend(GeoJSONWriter.prototype,{write:function(t){return this.parser.write(t)}}),extend(WKTReader.prototype,{read:function(t){var e=this.parser.read(t);return this.precisionModel.getType()===PrecisionModel.FIXED&&this.reducePrecision(e),e},reducePrecision:function(t){if(t.coordinate)this.precisionModel.makePrecise(t.coordinate);else if(t.points)for(var e=0,n=t.points.coordinates.length;n>e;e++)this.precisionModel.makePrecise(t.points.coordinates[e]);else if(t.geometries)for(var e=0,n=t.geometries.length;n>e;e++)this.reducePrecision(t.geometries[e])}}),extend(OL3Parser.prototype,{read:function(t){return t instanceof ol.geom.Point?this.convertFromPoint(t):t instanceof ol.geom.LineString?this.convertFromLineString(t):t instanceof ol.geom.LinearRing?this.convertFromLinearRing(t):t instanceof ol.geom.Polygon?this.convertFromPolygon(t):t instanceof ol.geom.MultiPoint?this.convertFromMultiPoint(t):t instanceof ol.geom.MultiLineString?this.convertFromMultiLineString(t):t instanceof ol.geom.MultiPolygon?this.convertFromMultiPolygon(t):t instanceof ol.geom.GeometryCollection?this.convertFromCollection(t):void 0},convertFromPoint:function(t){var e=t.getCoordinates();return this.geometryFactory.createPoint(new Coordinate(e[0],e[1]))},convertFromLineString:function(t){return this.geometryFactory.createLineString(t.getCoordinates().map(function(t){return new Coordinate(t[0],t[1])}))},convertFromLinearRing:function(t){return this.geometryFactory.createLinearRing(t.getCoordinates().map(function(t){return new Coordinate(t[0],t[1])}))},convertFromPolygon:function(t){for(var e=t.getLinearRings(),n=null,i=[],r=0;r<e.length;r++){var o=this.convertFromLinearRing(e[r]);0===r?n=o:i.push(o)}return this.geometryFactory.createPolygon(n,i)},convertFromMultiPoint:function(t){var e=t.getPoints().map(function(t){return this.convertFromPoint(t)},this);return this.geometryFactory.createMultiPoint(e)},convertFromMultiLineString:function(t){var e=t.getLineStrings().map(function(t){return this.convertFromLineString(t)},this);return this.geometryFactory.createMultiLineString(e)},convertFromMultiPolygon:function(t){var e=t.getPolygons().map(function(t){return this.convertFromPolygon(t)},this);return this.geometryFactory.createMultiPolygon(e)},convertFromCollection:function(t){var e=t.getGeometries().map(function(t){return this.read(t)},this);return this.geometryFactory.createGeometryCollection(e)},write:function(t){return"Point"===t.getGeometryType()?this.convertToPoint(t.getCoordinate()):"LineString"===t.getGeometryType()?this.convertToLineString(t):"LinearRing"===t.getGeometryType()?this.convertToLinearRing(t):"Polygon"===t.getGeometryType()?this.convertToPolygon(t):"MultiPoint"===t.getGeometryType()?this.convertToMultiPoint(t):"MultiLineString"===t.getGeometryType()?this.convertToMultiLineString(t):"MultiPolygon"===t.getGeometryType()?this.convertToMultiPolygon(t):"GeometryCollection"===t.getGeometryType()?this.convertToCollection(t):void 0},convertToPoint:function(t){return new ol.geom.Point([t.x,t.y])},convertToLineString:function(t){var e=t.points.coordinates.map(p2c);return new ol.geom.LineString(e)},convertToLinearRing:function(t){var e=t.points.coordinates.map(p2c);return new ol.geom.LinearRing(e)},convertToPolygon:function(t){for(var e=[t.shell.points.coordinates.map(p2c)],n=0;n<t.holes.length;n++)e.push(t.holes[n].points.coordinates.map(p2c));return new ol.geom.Polygon(e)},convertToMultiPoint:function(t){return new ol.geom.MultiPoint(t.getCoordinates().map(p2c))},convertToMultiLineString:function(t){for(var e=[],n=0;n<t.geometries.length;n++)e.push(this.convertToLineString(t.geometries[n]).getCoordinates());return new ol.geom.MultiLineString(e)},convertToMultiPolygon:function(t){for(var e=[],n=0;n<t.geometries.length;n++)e.push(this.convertToPolygon(t.geometries[n]).getCoordinates());return new ol.geom.MultiPolygon(e)},convertToCollection:function(t){for(var e=[],n=0;n<t.geometries.length;n++){var i=t.geometries[n];e.push(this.write(i))}return new ol.geom.GeometryCollection(e)}});var io={GeoJSONReader:GeoJSONReader,GeoJSONWriter:GeoJSONWriter,OL3Parser:OL3Parser,WKTReader:WKTReader,WKTWriter:WKTWriter};extend(SegmentPointComparator.prototype,{interfaces_:function(){return[]},getClass:function(){return SegmentPointComparator}}),SegmentPointComparator.relativeSign=function(t,e){return e>t?-1:t>e?1:0},SegmentPointComparator.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=SegmentPointComparator.relativeSign(e.x,n.x),r=SegmentPointComparator.relativeSign(e.y,n.y);switch(t){case 0:return SegmentPointComparator.compareValue(i,r);case 1:return SegmentPointComparator.compareValue(r,i);case 2:return SegmentPointComparator.compareValue(r,-i);case 3:return SegmentPointComparator.compareValue(-i,r);case 4:return SegmentPointComparator.compareValue(-i,-r);case 5:return SegmentPointComparator.compareValue(-r,-i);case 6:return SegmentPointComparator.compareValue(-r,i);case 7:return SegmentPointComparator.compareValue(i,-r)}return Assert.shouldNeverReachHere("invalid octant value"),0},SegmentPointComparator.compareValue=function(t,e){return 0>t?-1:t>0?1:0>e?-1:e>0?1:0},extend(SegmentNode.prototype,{getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},compareTo:function(t){var e=t;return this.segmentIndex<e.segmentIndex?-1:this.segmentIndex>e.segmentIndex?1:this.coord.equals2D(e.coord)?0:SegmentPointComparator.compare(this.segmentOctant,this.coord,e.coord)},isEndPoint:function(t){return 0!==this.segmentIndex||this._isInterior?this.segmentIndex===t:!0},isInterior:function(){return this._isInterior},interfaces_:function(){return[Comparable]},getClass:function(){return SegmentNode}}),extend(SegmentNodeList.prototype,{getSplitCoordinates:function(){var t=new CoordinateList;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},addCollapsedNodes:function(){var t=new ArrayList;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this.edge.getCoordinate(n),n)}},print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},findCollapsesFromExistingVertices:function(t){for(var e=0;e<this.edge.size()-2;e++){var n=this.edge.getCoordinate(e),i=(this.edge.getCoordinate(e+1),this.edge.getCoordinate(e+2));n.equals2D(i)&&t.add(new Integer(e+1))}},addEdgeCoordinates:function(t,e,n){var i=e.segmentIndex-t.segmentIndex+2,r=this.edge.getCoordinate(e.segmentIndex),o=e.isInterior()||!e.coord.equals2D(r);o||i--;n.add(new Coordinate(t.coord),!1);for(var s=t.segmentIndex+1;s<=e.segmentIndex;s++)n.add(this.edge.getCoordinate(s));o&&n.add(new Coordinate(e.coord))},iterator:function(){return this.nodeMap.values().iterator()},addSplitEdges:function(t){this.addEndpoints(),this.addCollapsedNodes();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},findCollapseIndex:function(t,e,n){if(!t.coord.equals2D(e.coord))return!1;var i=e.segmentIndex-t.segmentIndex;return e.isInterior()||i--,1===i?(n[0]=t.segmentIndex+1,!0):!1},findCollapsesFromInsertedNodes:function(t){for(var e=new Array(1).fill(null),n=this.iterator(),i=n.next();n.hasNext();){var r=n.next(),o=this.findCollapseIndex(i,r,e);o&&t.add(new Integer(e[0])),i=r}},getEdge:function(){return this.edge},addEndpoints:function(){var t=this.edge.size()-1;this.add(this.edge.getCoordinate(0),0),this.add(this.edge.getCoordinate(t),t)},createSplitEdge:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.getCoordinate(e.segmentIndex),r=e.isInterior()||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new Coordinate(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.getCoordinate(a);return r&&(o[s]=new Coordinate(e.coord)),new NodedSegmentString(o,this.edge.getData())},add:function(t,e){var n=new SegmentNode(this.edge,t,e,this.edge.getSegmentOctant(e)),i=this.nodeMap.get(n);return null!==i?(Assert.isTrue(i.coord.equals2D(t),"Found equal nodes with different coordinates"),i):(this.nodeMap.put(n,n),n)},checkSplitEdgesCorrectness:function(t){var e=this.edge.getCoordinates(),n=t.get(0),i=n.getCoordinate(0);if(!i.equals2D(e[0]))throw new RuntimeException("bad split edge start point at "+i);var r=t.get(t.size()-1),o=r.getCoordinates(),s=o[o.length-1];if(!s.equals2D(e[e.length-1]))throw new RuntimeException("bad split edge end point at "+s)},interfaces_:function(){return[]},getClass:function(){return SegmentNodeList}}),extend(NodeVertexIterator.prototype,{next:function(){return null===this.currNode?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):null===this.nextNode?null:this.nextNode.segmentIndex===this.currNode.segmentIndex?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):(this.nextNode.segmentIndex>this.currNode.segmentIndex,null)},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){return null!==this.nextNode},readNextNode:function(){this.nodeIt.hasNext()?this.nextNode=this.nodeIt.next():this.nextNode=null},interfaces_:function(){return[Iterator]},getClass:function(){return NodeVertexIterator}}),extend(Octant.prototype,{interfaces_:function(){return[]},getClass:function(){return Octant}}),Octant.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new IllegalArgumentException("Cannot compute the octant for point ( "+t+", "+e+" )");var n=Math.abs(t),i=Math.abs(e);return t>=0?e>=0?n>=i?0:1:n>=i?7:6:e>=0?n>=i?3:2:n>=i?4:5}if(arguments[0]instanceof Coordinate&&arguments[1]instanceof Coordinate){var r=arguments[0],o=arguments[1],s=o.x-r.x,a=o.y-r.y;if(0===s&&0===a)throw new IllegalArgumentException("Cannot compute the octant for two identical points "+r);return Octant.octant(s,a)}},extend(SegmentString.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(t){},isClosed:function(){},setData:function(t){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return SegmentString}}),extend(NodableSegmentString.prototype,{addIntersection:function(t,e){},interfaces_:function(){return[SegmentString]},getClass:function(){return NodableSegmentString}}),extend(NodedSegmentString.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(t){return this.pts[t]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(t){return t===this.pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this.data=t},safeOctant:function(t,e){return t.equals2D(e)?0:Octant.octant(t,e)},getData:function(){return this.data},addIntersection:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],e=arguments[1],i=(arguments[2],arguments[3]),r=new Coordinate(n.getIntersection(i));this.addIntersection(r,e)}},toString:function(){return WKTWriter.toLineString(new CoordinateArraySequence(this.pts))},getNodeList:function(){return this.nodeList},addIntersectionNode:function(t,e){var n=e,i=n+1;if(i<this.pts.length){var r=this.pts[i];t.equals2D(r)&&(n=i)}var o=this.nodeList.add(t,n);return o},addIntersections:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},interfaces_:function(){return[NodableSegmentString]},getClass:function(){return NodedSegmentString}}),NodedSegmentString.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new ArrayList;return NodedSegmentString.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var t=arguments[0],n=arguments[1],i=t.iterator();i.hasNext();){var r=i.next();r.getNodeList().addSplitEdges(n)}},extend(MonotoneChainOverlapAction.prototype,{overlap:function(){if(2===arguments.length){arguments[0],arguments[1]}else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this.overlapSeg1),n.getLineSegment(i,this.overlapSeg2),this.overlap(this.overlapSeg1,this.overlapSeg2)}},interfaces_:function(){return[]},getClass:function(){return MonotoneChainOverlapAction}}),extend(MonotoneChain.prototype,{getLineSegment:function(t,e){e.p0=this.pts[t],e.p1=this.pts[t+1]},computeSelect:function(t,e,n,i){var r=this.pts[e],o=this.pts[n];if(i.tempEnv1.init(r,o),n-e===1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var s=Math.trunc((e+n)/2);s>e&&this.computeSelect(t,e,s,i),n>s&&this.computeSelect(t,s,n,i)},getCoordinates:function(){for(var t=new Array(this.end-this.start+1).fill(null),e=0,n=this.start;n<=this.end;n++)t[e++]=this.pts[n];return t},computeOverlaps:function(t,e){this.computeOverlapsInternal(this.start,this.end,t,t.start,t.end,e)},setId:function(t){this.id=t},select:function(t,e){this.computeSelect(t,this.start,this.end,e)},getEnvelope:function(){if(null===this.env){var t=this.pts[this.start],e=this.pts[this.end];this.env=new Envelope(t,e)}return this.env},getEndIndex:function(){return this.end},getStartIndex:function(){return this.start},getContext:function(){return this.context},getId:function(){return this.id},computeOverlapsInternal:function(t,e,n,i,r,o){var s=this.pts[t],a=this.pts[e],l=n.pts[i],u=n.pts[r];if(e-t===1&&r-i===1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(l,u),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((i+r)/2);c>t&&(h>i&&this.computeOverlapsInternal(t,c,n,i,h,o),r>h&&this.computeOverlapsInternal(t,c,n,h,r,o)),e>c&&(h>i&&this.computeOverlapsInternal(c,e,n,i,h,o),r>h&&this.computeOverlapsInternal(c,e,n,h,r,o))},interfaces_:function(){return[]},getClass:function(){return MonotoneChain}}),extend(MonotoneChainBuilder.prototype,{interfaces_:function(){return[]},getClass:function(){return MonotoneChainBuilder}}),MonotoneChainBuilder.getChainStartIndices=function(t){var e=0,n=new ArrayList;n.add(new Integer(e));do{var i=MonotoneChainBuilder.findChainEnd(t,e);n.add(new Integer(i)),e=i}while(e<t.length-1);var r=MonotoneChainBuilder.toIntArray(n);return r},MonotoneChainBuilder.findChainEnd=function(t,e){for(var n=e;n<t.length-1&&t[n].equals2D(t[n+1]);)n++;if(n>=t.length-1)return t.length-1;for(var i=Quadrant.quadrant(t[n],t[n+1]),r=e+1;r<t.length;){if(!t[r-1].equals2D(t[r])){var o=Quadrant.quadrant(t[r-1],t[r]);if(o!==i)break}r++}return r-1},MonotoneChainBuilder.getChains=function(){if(1===arguments.length){var t=arguments[0];return MonotoneChainBuilder.getChains(t,null)}if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=new ArrayList,i=MonotoneChainBuilder.getChainStartIndices(t),r=0;r<i.length-1;r++){var o=new MonotoneChain(t,i[r],i[r+1],e);n.add(o)}return n}},MonotoneChainBuilder.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},extend(Noder.prototype,{computeNodes:function(t){},getNodedSubstrings:function(){},interfaces_:function(){return[]},getClass:function(){return Noder}}),extend(SinglePassNoder.prototype,{setSegmentIntersector:function(t){this.segInt=t},interfaces_:function(){return[Noder]},getClass:function(){return SinglePassNoder}}),inherits(MCIndexNoder,SinglePassNoder),extend(MCIndexNoder.prototype,{getMonotoneChains:function(){return this.monoChains},getNodedSubstrings:function(){return NodedSegmentString.getNodedSubstrings(this.nodedSegStrings)},getIndex:function(){return this.index},add:function(t){for(var e=MonotoneChainBuilder.getChains(t.getCoordinates(),t),n=e.iterator();n.hasNext();){var i=n.next();i.setId(this.idCounter++),this.index.insert(i.getEnvelope(),i),this.monoChains.add(i)}},computeNodes:function(t){this.nodedSegStrings=t;for(var e=t.iterator();e.hasNext();)this.add(e.next());this.intersectChains()},intersectChains:function(){for(var t=new SegmentOverlapAction(this.segInt),e=this.monoChains.iterator();e.hasNext();)for(var n=e.next(),i=this.index.query(n.getEnvelope()),r=i.iterator();r.hasNext();){var o=r.next();if(o.getId()>n.getId()&&(n.computeOverlaps(o,t),this.nOverlaps++),this.segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return MCIndexNoder}}),inherits(SegmentOverlapAction,MonotoneChainOverlapAction),extend(SegmentOverlapAction.prototype,{overlap:function(){if(4!==arguments.length)return MonotoneChainOverlapAction.prototype.overlap.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3],r=t.getContext(),o=n.getContext();this.si.processIntersections(r,e,o,i)},interfaces_:function(){return[]},getClass:function(){return SegmentOverlapAction}}),MCIndexNoder.SegmentOverlapAction=SegmentOverlapAction,extend(ScaledNoder.prototype,{rescale:function(){if(hasInterface(arguments[0],Collection))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.rescale(n.getCoordinates())}else if(arguments[0]instanceof Array){var i=arguments[0],r=null,o=null;2===i.length&&(r=new Coordinate(i[0]),o=new Coordinate(i[1]));for(var e=0;e<i.length;e++)i[e].x=i[e].x/this.scaleFactor+this.offsetX,i[e].y=i[e].y/this.scaleFactor+this.offsetY;2===i.length&&i[0].equals2D(i[1])&&System.out.println(i)}},scale:function(){if(hasInterface(arguments[0],Collection)){for(var t=arguments[0],e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next();e.add(new NodedSegmentString(this.scale(i.getCoordinates()),i.getData()))}return e}if(arguments[0]instanceof Array){
for(var r=arguments[0],o=new Array(r.length).fill(null),n=0;n<r.length;n++)o[n]=new Coordinate(Math.round((r[n].x-this.offsetX)*this.scaleFactor),Math.round((r[n].y-this.offsetY)*this.scaleFactor),r[n].z);var s=CoordinateArrays.removeRepeatedPoints(o);return s}},isIntegerPrecision:function(){return 1===this.scaleFactor},getNodedSubstrings:function(){var t=this.noder.getNodedSubstrings();return this.isScaled&&this.rescale(t),t},computeNodes:function(t){var e=t;this.isScaled&&(e=this.scale(t)),this.noder.computeNodes(e)},interfaces_:function(){return[Noder]},getClass:function(){return ScaledNoder}}),extend(GeometryCollectionIterator.prototype,{next:function(){if(this.atStart)return this.atStart=!1,GeometryCollectionIterator.isAtomic(this.parent)&&this.index++,this.parent;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return this.subcollectionIterator.next();this.subcollectionIterator=null}if(this.index>=this.max)throw new NoSuchElementException;var t=this.parent.getGeometryN(this.index++);return t instanceof GeometryCollection?(this.subcollectionIterator=new GeometryCollectionIterator(t),this.subcollectionIterator.next()):t},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){if(this.atStart)return!0;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return!0;this.subcollectionIterator=null}return!(this.index>=this.max)},interfaces_:function(){return[Iterator]},getClass:function(){return GeometryCollectionIterator}}),GeometryCollectionIterator.isAtomic=function(t){return!(t instanceof GeometryCollection)},extend(PointLocator.prototype,{locateInPolygonRing:function(t,e){return e.getEnvelopeInternal().intersects(t)?CGAlgorithms.locatePointInRing(t,e.getCoordinates()):Location.EXTERIOR},intersects:function(t,e){return this.locate(t,e)!==Location.EXTERIOR},updateLocationInfo:function(t){t===Location.INTERIOR&&(this.isIn=!0),t===Location.BOUNDARY&&this.numBoundaries++},computeLocation:function(t,e){if(e instanceof Point&&this.updateLocationInfo(this.locate(t,e)),e instanceof LineString)this.updateLocationInfo(this.locate(t,e));else if(e instanceof Polygon)this.updateLocationInfo(this.locate(t,e));else if(e instanceof MultiLineString)for(var n=e,i=0;i<n.getNumGeometries();i++){var r=n.getGeometryN(i);this.updateLocationInfo(this.locate(t,r))}else if(e instanceof MultiPolygon)for(var o=e,i=0;i<o.getNumGeometries();i++){var s=o.getGeometryN(i);this.updateLocationInfo(this.locate(t,s))}else if(e instanceof GeometryCollection)for(var a=new GeometryCollectionIterator(e);a.hasNext();){var l=a.next();l!==e&&this.computeLocation(t,l)}},locate:function(){if(arguments[0]instanceof Coordinate&&arguments[1]instanceof Polygon){var t=arguments[0],e=arguments[1];if(e.isEmpty())return Location.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===Location.EXTERIOR)return Location.EXTERIOR;if(i===Location.BOUNDARY)return Location.BOUNDARY;for(var r=0;r<e.getNumInteriorRing();r++){var o=e.getInteriorRingN(r),s=this.locateInPolygonRing(t,o);if(s===Location.INTERIOR)return Location.EXTERIOR;if(s===Location.BOUNDARY)return Location.BOUNDARY}return Location.INTERIOR}if(arguments[0]instanceof Coordinate&&arguments[1]instanceof LineString){var t=arguments[0],a=arguments[1];if(!a.getEnvelopeInternal().intersects(t))return Location.EXTERIOR;var l=a.getCoordinates();return a.isClosed()||!t.equals(l[0])&&!t.equals(l[l.length-1])?CGAlgorithms.isOnLine(t,l)?Location.INTERIOR:Location.EXTERIOR:Location.BOUNDARY}if(arguments[0]instanceof Coordinate&&arguments[1]instanceof Point){var t=arguments[0],u=arguments[1],c=u.getCoordinate();return c.equals2D(t)?Location.INTERIOR:Location.EXTERIOR}if(arguments[0]instanceof Coordinate&&arguments[1]instanceof Geometry){var t=arguments[0],h=arguments[1];return h.isEmpty()?Location.EXTERIOR:h instanceof LineString?this.locate(t,h):h instanceof Polygon?this.locate(t,h):(this.isIn=!1,this.numBoundaries=0,this.computeLocation(t,h),this.boundaryRule.isInBoundary(this.numBoundaries)?Location.BOUNDARY:this.numBoundaries>0||this.isIn?Location.INTERIOR:Location.EXTERIOR)}},interfaces_:function(){return[]},getClass:function(){return PointLocator}}),extend(Position.prototype,{interfaces_:function(){return[]},getClass:function(){return Position}}),Position.opposite=function(t){return t===Position.LEFT?Position.RIGHT:t===Position.RIGHT?Position.LEFT:t},Position.ON=0,Position.LEFT=1,Position.RIGHT=2,extend(MonotoneChain$1.prototype,{computeIntersections:function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},interfaces_:function(){return[]},getClass:function(){return MonotoneChain$1}}),extend(SweepLineEvent.prototype,{isDelete:function(){return this.eventType===SweepLineEvent.DELETE},setDeleteEventIndex:function(t){this.deleteEventIndex=t},getObject:function(){return this.obj},compareTo:function(t){var e=t;return this.xValue<e.xValue?-1:this.xValue>e.xValue?1:this.eventType<e.eventType?-1:this.eventType>e.eventType?1:0},getInsertEvent:function(){return this.insertEvent},isInsert:function(){return this.eventType===SweepLineEvent.INSERT},isSameLabel:function(t){return null===this.label?!1:this.label===t.label},getDeleteEventIndex:function(){return this.deleteEventIndex},interfaces_:function(){return[Comparable]},getClass:function(){return SweepLineEvent}}),SweepLineEvent.INSERT=1,SweepLineEvent.DELETE=2,extend(EdgeSetIntersector.prototype,{interfaces_:function(){return[]},getClass:function(){return EdgeSetIntersector}}),extend(SegmentIntersector.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this.li.getIntersectionNum()){if(SegmentIntersector.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},setIsDoneIfProperInt:function(t){this.isDoneWhenProperInt=t},hasProperInteriorIntersection:function(){return this.hasProperInterior},isBoundaryPointInternal:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),r=i.getCoordinate();if(t.isIntersection(r))return!0}return!1},hasProperIntersection:function(){return this.hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(t,e){return null===e?!1:this.isBoundaryPointInternal(t,e[0])?!0:!!this.isBoundaryPointInternal(t,e[1])},setBoundaryNodes:function(t,e){this.bdyNodes=new Array(2).fill(null),this.bdyNodes[0]=t,this.bdyNodes[1]=e},addIntersections:function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&(this.recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this.includeProper&&this.li.isProper()||(t.addIntersections(this.li,e,0),n.addIntersections(this.li,i,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).copy(),this.hasProper=!0,this.isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))},interfaces_:function(){return[]},getClass:function(){return SegmentIntersector}}),SegmentIntersector.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},inherits(SimpleMCSweepLineIntersector,EdgeSetIntersector),extend(SimpleMCSweepLineIntersector.prototype,{prepareEvents:function(){Collections.sort(this.events);for(var t=0;t<this.events.size();t++){var e=this.events.get(t);e.isDelete()&&e.getInsertEvent().setDeleteEventIndex(t)}},computeIntersections:function(){if(1===arguments.length){var t=arguments[0];this.nOverlaps=0,this.prepareEvents();for(var e=0;e<this.events.size();e++){var n=this.events.get(e);if(n.isInsert()&&this.processOverlaps(e,n.getDeleteEventIndex(),n,t),t.isDone())break}}else if(3===arguments.length)if(arguments[2]instanceof SegmentIntersector&&hasInterface(arguments[0],List)&&hasInterface(arguments[1],List)){var i=arguments[0],r=arguments[1],t=arguments[2];this.addEdges(i,i),this.addEdges(r,r),this.computeIntersections(t)}else if("boolean"==typeof arguments[2]&&hasInterface(arguments[0],List)&&arguments[1]instanceof SegmentIntersector){var o=arguments[0],t=arguments[1],s=arguments[2];s?this.addEdges(o,null):this.addEdges(o),this.computeIntersections(t)}},addEdge:function(t,e){for(var n=t.getMonotoneChainEdge(),i=n.getStartIndexes(),r=0;r<i.length-1;r++){var o=new MonotoneChain$1(n,r),s=new SweepLineEvent(e,n.getMinX(r),o);this.events.add(s),this.events.add(new SweepLineEvent(n.getMaxX(r),s))}},processOverlaps:function(t,e,n,i){for(var r=n.getObject(),o=t;e>o;o++){var s=this.events.get(o);if(s.isInsert()){var a=s.getObject();n.isSameLabel(s)||(r.computeIntersections(a,i),this.nOverlaps++)}}},addEdges:function(){if(1===arguments.length)for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.addEdge(n,n)}else if(2===arguments.length)for(var t=arguments[0],i=arguments[1],e=t.iterator();e.hasNext();){var n=e.next();this.addEdge(n,i)}},interfaces_:function(){return[]},getClass:function(){return SimpleMCSweepLineIntersector}}),extend(TopologyLocation.prototype,{setAllLocations:function(t){for(var e=0;e<this.location.length;e++)this.location[e]=t},isNull:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]!==Location.NONE)return!1;return!0},setAllLocationsIfNull:function(t){for(var e=0;e<this.location.length;e++)this.location[e]===Location.NONE&&(this.location[e]=t)},isLine:function(){return 1===this.location.length},merge:function(t){if(t.location.length>this.location.length){var e=new Array(3).fill(null);e[Position.ON]=this.location[Position.ON],e[Position.LEFT]=Location.NONE,e[Position.RIGHT]=Location.NONE,this.location=e}for(var n=0;n<this.location.length;n++)this.location[n]===Location.NONE&&n<t.location.length&&(this.location[n]=t.location[n])},getLocations:function(){return this.location},flip:function(){if(this.location.length<=1)return null;var t=this.location[Position.LEFT];this.location[Position.LEFT]=this.location[Position.RIGHT],this.location[Position.RIGHT]=t},toString:function(){var t=new StringBuffer;return this.location.length>1&&t.append(Location.toLocationSymbol(this.location[Position.LEFT])),t.append(Location.toLocationSymbol(this.location[Position.ON])),this.location.length>1&&t.append(Location.toLocationSymbol(this.location[Position.RIGHT])),t.toString()},setLocations:function(t,e,n){this.location[Position.ON]=t,this.location[Position.LEFT]=e,this.location[Position.RIGHT]=n},get:function(t){return t<this.location.length?this.location[t]:Location.NONE},isArea:function(){return this.location.length>1},isAnyNull:function(){for(var t=0;t<this.location.length;t++)if(this.location[t]===Location.NONE)return!0;return!1},setLocation:function(){if(1===arguments.length){var t=arguments[0];this.setLocation(Position.ON,t)}else if(2===arguments.length){var e=arguments[0],t=arguments[1];this.location[e]=t}},init:function(t){this.location=new Array(t).fill(null),this.setAllLocations(Location.NONE)},isEqualOnSide:function(t,e){return this.location[e]===t.location[e]},allPositionsEqual:function(t){for(var e=0;e<this.location.length;e++)if(this.location[e]!==t)return!1;return!0},interfaces_:function(){return[]},getClass:function(){return TopologyLocation}}),extend(Label.prototype,{getGeometryCount:function(){var t=0;return this.elt[0].isNull()||t++,this.elt[1].isNull()||t++,t},setAllLocations:function(t,e){this.elt[t].setAllLocations(e)},isNull:function(t){return this.elt[t].isNull()},setAllLocationsIfNull:function(){if(1===arguments.length){var t=arguments[0];this.setAllLocationsIfNull(0,t),this.setAllLocationsIfNull(1,t)}else if(2===arguments.length){var e=arguments[0],t=arguments[1];this.elt[e].setAllLocationsIfNull(t)}},isLine:function(t){return this.elt[t].isLine()},merge:function(t){for(var e=0;2>e;e++)null===this.elt[e]&&null!==t.elt[e]?this.elt[e]=new TopologyLocation(t.elt[e]):this.elt[e].merge(t.elt[e])},flip:function(){this.elt[0].flip(),this.elt[1].flip()},getLocation:function(){if(1===arguments.length){var t=arguments[0];return this.elt[t].get(Position.ON)}if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.elt[t].get(e)}},toString:function(){var t=new StringBuffer;return null!==this.elt[0]&&(t.append("A:"),t.append(this.elt[0].toString())),null!==this.elt[1]&&(t.append(" B:"),t.append(this.elt[1].toString())),t.toString()},isArea:function(){if(0===arguments.length)return this.elt[0].isArea()||this.elt[1].isArea();if(1===arguments.length){var t=arguments[0];return this.elt[t].isArea()}},isAnyNull:function(t){return this.elt[t].isAnyNull()},setLocation:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.elt[t].setLocation(Position.ON,e)}else if(3===arguments.length){var t=arguments[0],n=arguments[1],e=arguments[2];this.elt[t].setLocation(n,e)}},isEqualOnSide:function(t,e){return this.elt[0].isEqualOnSide(t.elt[0],e)&&this.elt[1].isEqualOnSide(t.elt[1],e)},allPositionsEqual:function(t,e){return this.elt[t].allPositionsEqual(e)},toLine:function(t){this.elt[t].isArea()&&(this.elt[t]=new TopologyLocation(this.elt[t].location[0]))},interfaces_:function(){return[]},getClass:function(){return Label}}),Label.toLineLabel=function(t){for(var e=new Label(Location.NONE),n=0;2>n;n++)e.setLocation(n,t.getLocation(n));return e},extend(PointOnGeometryLocator.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return PointOnGeometryLocator}}),extend(IntervalRTreeNode$1.prototype,{getMin:function(){return this.min},intersects:function(t,e){return!(this.min>e||this.max<t)},getMax:function(){return this.max},toString:function(){return WKTWriter.toLineString(new Coordinate(this.min,0),new Coordinate(this.max,0))},interfaces_:function(){return[]},getClass:function(){return IntervalRTreeNode$1}}),extend(NodeComparator.prototype,{compare:function(t,e){var n=t,i=e,r=(n.min+n.max)/2,o=(i.min+i.max)/2;return o>r?-1:r>o?1:0},interfaces_:function(){return[Comparator]},getClass:function(){return NodeComparator}}),IntervalRTreeNode$1.NodeComparator=NodeComparator,inherits(IntervalRTreeLeafNode,IntervalRTreeNode$1),extend(IntervalRTreeLeafNode.prototype,{query:function(t,e,n){return this.intersects(t,e)?void n.visitItem(this.item):null},interfaces_:function(){return[]},getClass:function(){return IntervalRTreeLeafNode}}),inherits(IntervalRTreeBranchNode,IntervalRTreeNode$1),extend(IntervalRTreeBranchNode.prototype,{buildExtent:function(t,e){this.min=Math.min(t.min,e.min),this.max=Math.max(t.max,e.max)},query:function(t,e,n){return this.intersects(t,e)?(null!==this.node1&&this.node1.query(t,e,n),void(null!==this.node2&&this.node2.query(t,e,n))):null},interfaces_:function(){return[]},getClass:function(){return IntervalRTreeBranchNode}}),extend(SortedPackedIntervalRTree.prototype,{buildTree:function(){Collections.sort(this.leaves,new IntervalRTreeNode.NodeComparator);for(var t=this.leaves,e=null,n=new ArrayList;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},insert:function(t,e,n){if(null!==this.root)throw new IllegalStateException("Index cannot be added to once it has been queried");this.leaves.add(new IntervalRTreeLeafNode(t,e,n))},query:function(t,e,n){this.init(),this.root.query(t,e,n)},buildRoot:function(){return null!==this.root?null:void(this.root=this.buildTree())},printNode:function(t){System.out.println(WKTWriter.toLineString(new Coordinate(t.min,this.level),new Coordinate(t.max,this.level)))},init:function(){return null!==this.root?null:void this.buildRoot()},buildLevel:function(t,e){this.level++,e.clear();for(var n=0;n<t.size();n+=2){var i=t.get(n),r=n+1<t.size()?t.get(n):null;if(null===r)e.add(i);else{var o=new IntervalRTreeBranchNode(t.get(n),t.get(n+1));e.add(o)}}},interfaces_:function(){return[]},getClass:function(){return SortedPackedIntervalRTree}}),extend(LinearComponentExtracter.prototype,{filter:function(t){if(this.isForcedToLineString&&t instanceof LinearRing){var e=t.getFactory().createLineString(t.getCoordinateSequence());return this.lines.add(e),null}t instanceof LineString&&this.lines.add(t)},setForceToLineString:function(t){this.isForcedToLineString=t},interfaces_:function(){return[GeometryComponentFilter$1]},getClass:function(){return LinearComponentExtracter}}),LinearComponentExtracter.getGeometry=function(){if(1===arguments.length){var t=arguments[0];return t.getFactory().buildGeometry(LinearComponentExtracter.getLines(t))}if(2===arguments.length){var t=arguments[0],e=arguments[1];return t.getFactory().buildGeometry(LinearComponentExtracter.getLines(t,e))}},LinearComponentExtracter.getLines=function(){if(1===arguments.length){var t=arguments[0];return LinearComponentExtracter.getLines(t,!1)}if(2===arguments.length){if(hasInterface(arguments[0],Collection)&&hasInterface(arguments[1],Collection)){for(var e=arguments[0],n=arguments[1],i=e.iterator();i.hasNext();){var r=i.next();LinearComponentExtracter.getLines(r,n)}return n}if(arguments[0]instanceof Geometry&&"boolean"==typeof arguments[1]){var t=arguments[0],o=arguments[1],s=new ArrayList;return t.apply(new LinearComponentExtracter(s,o)),s}if(arguments[0]instanceof Geometry&&hasInterface(arguments[1],Collection)){var t=arguments[0],a=arguments[1];return t instanceof LineString?a.add(t):t.apply(new LinearComponentExtracter(a)),a}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&hasInterface(arguments[0],Collection)&&hasInterface(arguments[1],Collection)){for(var e=arguments[0],l=arguments[1],o=arguments[2],i=e.iterator();i.hasNext();){var r=i.next();LinearComponentExtracter.getLines(r,l,o)}return l}if("boolean"==typeof arguments[2]&&arguments[0]instanceof Geometry&&hasInterface(arguments[1],Collection)){var t=arguments[0],u=arguments[1],o=arguments[2];return t.apply(new LinearComponentExtracter(u,o)),u}}},extend(IndexedPointInAreaLocator.prototype,{locate:function(t){var e=new RayCrossingCounter(t),n=new SegmentVisitor(e);return this.index.query(t.y,t.y,n),e.getLocation()},interfaces_:function(){return[PointOnGeometryLocator]},getClass:function(){return IndexedPointInAreaLocator}}),extend(SegmentVisitor.prototype,{visitItem:function(t){var e=t;this.counter.countSegment(e.getCoordinate(0),e.getCoordinate(1))},interfaces_:function(){return[ItemVisitor]},getClass:function(){return SegmentVisitor}}),extend(IntervalIndexedGeometry.prototype,{init:function(t){for(var e=LinearComponentExtracter.getLines(t),n=e.iterator();n.hasNext();){var i=n.next(),r=i.getCoordinates();this.addLine(r)}},addLine:function(t){for(var e=1;e<t.length;e++){var n=new LineSegment(t[e-1],t[e]),i=Math.min(n.p0.y,n.p1.y),r=Math.max(n.p0.y,n.p1.y);this.index.insert(i,r,n)}},query:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new ArrayListVisitor;return this.index.query(t,e,n),n.getItems()}if(3===arguments.length){var t=arguments[0],e=arguments[1],i=arguments[2];this.index.query(t,e,i)}},interfaces_:function(){return[]},getClass:function(){return IntervalIndexedGeometry}}),IndexedPointInAreaLocator.SegmentVisitor=SegmentVisitor,IndexedPointInAreaLocator.IntervalIndexedGeometry=IntervalIndexedGeometry,extend(EdgeIntersection.prototype,{getSegmentIndex:function(){return this.segmentIndex},getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex),t.println(" dist = "+this.dist)},compareTo:function(t){var e=t;return this.compare(e.segmentIndex,e.dist)},isEndPoint:function(t){return 0===this.segmentIndex&&0===this.dist?!0:this.segmentIndex===t},toString:function(){return this.coord+" seg # = "+this.segmentIndex+" dist = "+this.dist},getDistance:function(){return this.dist},compare:function(t,e){return this.segmentIndex<t?-1:this.segmentIndex>t?1:this.dist<e?-1:this.dist>e?1:0},interfaces_:function(){return[Comparable]},getClass:function(){return EdgeIntersection}}),extend(EdgeIntersectionList.prototype,{print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},iterator:function(){return this.nodeMap.values().iterator()},addSplitEdges:function(t){this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next(),r=this.createSplitEdge(n,i);t.add(r),n=i}},addEndpoints:function(){var t=this.edge.pts.length-1;this.add(this.edge.pts[0],0,0),this.add(this.edge.pts[t],t,0)},createSplitEdge:function(t,e){var n=e.segmentIndex-t.segmentIndex+2,i=this.edge.pts[e.segmentIndex],r=e.dist>0||!e.coord.equals2D(i);r||n--;var o=new Array(n).fill(null),s=0;o[s++]=new Coordinate(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)o[s++]=this.edge.pts[a];return r&&(o[s]=e.coord),new Edge(o,new Label(this.edge.label))},add:function(t,e,n){var i=new EdgeIntersection(t,e,n),r=this.nodeMap.get(i);return null!==r?r:(this.nodeMap.put(i,i),i)},isIntersection:function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();if(n.coord.equals(t))return!0}return!1},interfaces_:function(){return[]},getClass:function(){return EdgeIntersectionList}}),extend(MonotoneChainIndexer.prototype,{getChainStartIndices:function(t){var e=0,n=new ArrayList;n.add(new Integer(e));do{var i=this.findChainEnd(t,e);n.add(new Integer(i)),e=i}while(e<t.length-1);var r=MonotoneChainIndexer.toIntArray(n);return r},findChainEnd:function(t,e){for(var n=Quadrant.quadrant(t[e],t[e+1]),i=e+1;i<t.length;){var r=Quadrant.quadrant(t[i-1],t[i]);if(r!==n)break;i++}return i-1},interfaces_:function(){return[]},getClass:function(){return MonotoneChainIndexer}}),MonotoneChainIndexer.toIntArray=function(t){for(var e=new Array(t.size()).fill(null),n=0;n<e.length;n++)e[n]=t.get(n).intValue();return e},extend(MonotoneChainEdge.prototype,{getCoordinates:function(){return this.pts},getMaxX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return e>n?e:n},getMinX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return n>e?e:n},computeIntersectsForChain:function(){if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];this.computeIntersectsForChain(this.startIndex[t],this.startIndex[t+1],e,e.startIndex[n],e.startIndex[n+1],i)}else if(6===arguments.length){var r=arguments[0],o=arguments[1],e=arguments[2],s=arguments[3],a=arguments[4],l=arguments[5],u=this.pts[r],c=this.pts[o],h=e.pts[s],d=e.pts[a];if(o-r===1&&a-s===1)return l.addIntersections(this.e,r,e.e,s),null;if(this.env1.init(u,c),this.env2.init(h,d),!this.env1.intersects(this.env2))return null;var g=Math.trunc((r+o)/2),f=Math.trunc((s+a)/2);g>r&&(f>s&&this.computeIntersectsForChain(r,g,e,s,f,l),a>f&&this.computeIntersectsForChain(r,g,e,f,a,l)),o>g&&(f>s&&this.computeIntersectsForChain(g,o,e,s,f,l),a>f&&this.computeIntersectsForChain(g,o,e,f,a,l))}},getStartIndexes:function(){return this.startIndex},computeIntersects:function(t,e){for(var n=0;n<this.startIndex.length-1;n++)for(var i=0;i<t.startIndex.length-1;i++)this.computeIntersectsForChain(n,t,i,e)},interfaces_:function(){return[]},getClass:function(){return MonotoneChainEdge}}),extend(Depth.prototype,{getDepth:function(t,e){return this.depth[t][e]},setDepth:function(t,e,n){this.depth[t][e]=n},isNull:function(){if(0===arguments.length){for(var t=0;2>t;t++)for(var e=0;3>e;e++)if(this.depth[t][e]!==Depth.NULL_VALUE)return!1;return!0}if(1===arguments.length){var n=arguments[0];return this.depth[n][1]===Depth.NULL_VALUE}if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.depth[n][i]===Depth.NULL_VALUE}},normalize:function(){for(var t=0;2>t;t++)if(!this.isNull(t)){var e=this.depth[t][1];this.depth[t][2]<e&&(e=this.depth[t][2]),0>e&&(e=0);for(var n=1;3>n;n++){var i=0;this.depth[t][n]>e&&(i=1),this.depth[t][n]=i}}},getDelta:function(t){return this.depth[t][Position.RIGHT]-this.depth[t][Position.LEFT]},getLocation:function(t,e){return this.depth[t][e]<=0?Location.EXTERIOR:Location.INTERIOR},toString:function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]},add:function(){if(1===arguments.length)for(var t=arguments[0],e=0;2>e;e++)for(var n=1;3>n;n++){var i=t.getLocation(e,n);i!==Location.EXTERIOR&&i!==Location.INTERIOR||(this.isNull(e,n)?this.depth[e][n]=Depth.depthAtLocation(i):this.depth[e][n]+=Depth.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];s===Location.INTERIOR&&this.depth[r][o]++}},interfaces_:function(){return[]},getClass:function(){return Depth}}),Depth.depthAtLocation=function(t){return t===Location.EXTERIOR?0:t===Location.INTERIOR?1:Depth.NULL_VALUE},Depth.NULL_VALUE=-1,extend(GraphComponent.prototype,{setVisited:function(t){this._isVisited=t},setInResult:function(t){this._isInResult=t},isCovered:function(){return this._isCovered},isCoveredSet:function(){return this._isCoveredSet},setLabel:function(t){this.label=t},getLabel:function(){return this.label},setCovered:function(t){this._isCovered=t,this._isCoveredSet=!0},updateIM:function(t){Assert.isTrue(this.label.getGeometryCount()>=2,"found partial label"),this.computeIM(t)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return GraphComponent}}),inherits(Edge,GraphComponent),extend(Edge.prototype,{getDepth:function(){return this.depth},getCollapsedEdge:function(){var t=new Array(2).fill(null);t[0]=this.pts[0],t[1]=this.pts[1];var e=new Edge(t,Label.toLineLabel(this.label));return e},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(t){this._isIsolated=t},setName:function(t){this.name=t},equals:function(t){if(!(t instanceof Edge))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,i=!0,r=this.pts.length,o=0;o<this.pts.length;o++)if(this.pts[o].equals2D(e.pts[o])||(n=!1),this.pts[o].equals2D(e.pts[--r])||(i=!1),!n&&!i)return!1;return!0},getCoordinate:function(){if(0===arguments.length)return this.pts.length>0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},print:function(t){t.print("edge "+this.name+": "),t.print("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this.label+" "+this.depthDelta)},computeIM:function(t){Edge.updateIM(this.label,t)},isCollapsed:function(){return this.label.isArea()?3!==this.pts.length?!1:!!this.pts[0].equals(this.pts[2]):!1},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getMaximumSegmentIndex:function(){return this.pts.length-1},getDepthDelta:function(){return this.depthDelta},getNumPoints:function(){return this.pts.length},printReverse:function(t){t.print("edge "+this.name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},getMonotoneChainEdge:function(){return null===this.mce&&(this.mce=new MonotoneChainEdge(this)),this.mce},getEnvelope:function(){if(null===this.env){this.env=new Envelope;for(var t=0;t<this.pts.length;t++)this.env.expandToInclude(this.pts[t])}return this.env},addIntersection:function(t,e,n,i){var r=new Coordinate(t.getIntersection(i)),o=e,s=t.getEdgeDistance(n,i),a=o+1;if(a<this.pts.length){var l=this.pts[a];r.equals2D(l)&&(o=a,s=0)}this.eiList.add(r,o,s)},toString:function(){var t=new StringBuffer;t.append("edge "+this.name+": "),t.append("LINESTRING (");for(var e=0;e<this.pts.length;e++)e>0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this.label+" "+this.depthDelta),t.toString()},isPointwiseEqual:function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e<this.pts.length;e++)if(!this.pts[e].equals2D(t.pts[e]))return!1;return!0},setDepthDelta:function(t){this.depthDelta=t},getEdgeIntersectionList:function(){return this.eiList},addIntersections:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},interfaces_:function(){return[]},getClass:function(){return Edge}}),Edge.updateIM=function(){if(2!==arguments.length)return GraphComponent.prototype.updateIM.apply(this,arguments);var t=arguments[0],e=arguments[1];e.setAtLeastIfValid(t.getLocation(0,Position.ON),t.getLocation(1,Position.ON),1),t.isArea()&&(e.setAtLeastIfValid(t.getLocation(0,Position.LEFT),t.getLocation(1,Position.LEFT),2),e.setAtLeastIfValid(t.getLocation(0,Position.RIGHT),t.getLocation(1,Position.RIGHT),2))},inherits(Node$1,GraphComponent),extend(Node$1.prototype,{isIncidentEdgeInResult:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){var e=t.next();if(e.getEdge().isInResult())return!0}return!1},isIsolated:function(){return 1===this.label.getGeometryCount()},getCoordinate:function(){return this.coord},print:function(t){t.println("node "+this.coord+" lbl: "+this.label)},computeIM:function(t){},computeMergedLocation:function(t,e){var n=Location.NONE;if(n=this.label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==Location.BOUNDARY&&(n=i)}return n},setLabel:function(){if(2!==arguments.length)return GraphComponent.prototype.setLabel.apply(this,arguments);var t=arguments[0],e=arguments[1];null===this.label?this.label=new Label(t,e):this.label.setLocation(t,e)},getEdges:function(){return this.edges},mergeLabel:function(){if(arguments[0]instanceof Node$1){var t=arguments[0];this.mergeLabel(t.label)}else if(arguments[0]instanceof Label)for(var e=arguments[0],n=0;2>n;n++){var i=this.computeMergedLocation(e,n),r=this.label.getLocation(n);r===Location.NONE&&this.label.setLocation(n,i)}},add:function(t){this.edges.insert(t),t.setNode(this)},setLabelBoundary:function(t){if(null===this.label)return null;var e=Location.NONE;null!==this.label&&(e=this.label.getLocation(t));var n=null;switch(e){case Location.BOUNDARY:n=Location.INTERIOR;break;case Location.INTERIOR:n=Location.BOUNDARY;break;default:n=Location.BOUNDARY}this.label.setLocation(t,n)},interfaces_:function(){return[]},getClass:function(){return Node$1}}),extend(NodeMap.prototype,{find:function(t){return this.nodeMap.get(t)},addNode:function(){if(arguments[0]instanceof Coordinate){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof Node$1){var n=arguments[0],e=this.nodeMap.get(n.getCoordinate());return null===e?(this.nodeMap.put(n.getCoordinate(),n),n):(e.mergeLabel(n),e)}},print:function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},iterator:function(){return this.nodeMap.values().iterator()},values:function(){return this.nodeMap.values()},getBoundaryNodes:function(t){for(var e=new ArrayList,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===Location.BOUNDARY&&e.add(i)}return e},add:function(t){var e=t.getCoordinate(),n=this.addNode(e);n.add(t)},interfaces_:function(){return[]},getClass:function(){return NodeMap}}),extend(EdgeEnd.prototype,{compareDirection:function(t){return this.dx===t.dx&&this.dy===t.dy?0:this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:CGAlgorithms.computeOrientation(t.p0,t.p1,this.p1)},getDy:function(){return this.dy},getCoordinate:function(){return this.p0},setNode:function(t){this.node=t},print:function(t){var e=Math.atan2(this.dy,this.dx),n=this.getClass().getName(),i=n.lastIndexOf("."),r=n.substring(i+1);t.print(" "+r+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+e+" "+this.label)},compareTo:function(t){var e=t;return this.compareDirection(e)},getDirectedCoordinate:function(){return this.p1},getDx:function(){return this.dx},getLabel:function(){return this.label},getEdge:function(){return this.edge},getQuadrant:function(){return this.quadrant},getNode:function(){return this.node},toString:function(){var t=Math.atan2(this.dy,this.dx),e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);
return" "+i+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+t+" "+this.label},computeLabel:function(t){},init:function(t,e){this.p0=t,this.p1=e,this.dx=e.x-t.x,this.dy=e.y-t.y,this.quadrant=Quadrant.quadrant(this.dx,this.dy),Assert.isTrue(!(0===this.dx&&0===this.dy),"EdgeEnd with identical endpoints found")},interfaces_:function(){return[Comparable]},getClass:function(){return EdgeEnd}}),inherits(TopologyException,RuntimeException),extend(TopologyException.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return TopologyException}}),TopologyException.msgWithCoord=function(t,e){return null!==e?t+" [ "+e+" ]":t},inherits(DirectedEdge,EdgeEnd),extend(DirectedEdge.prototype,{getNextMin:function(){return this.nextMin},getDepth:function(t){return this.depth[t]},setVisited:function(t){this._isVisited=t},computeDirectedLabel:function(){this.label=new Label(this.edge.getLabel()),this._isForward||this.label.flip()},getNext:function(){return this.next},setDepth:function(t,e){if(-999!==this.depth[t]&&this.depth[t]!==e)throw new TopologyException("assigned depths do not match",this.getCoordinate());this.depth[t]=e},isInteriorAreaEdge:function t(){for(var t=!0,e=0;2>e;e++)this.label.isArea(e)&&this.label.getLocation(e,Position.LEFT)===Location.INTERIOR&&this.label.getLocation(e,Position.RIGHT)===Location.INTERIOR||(t=!1);return t},setNextMin:function(t){this.nextMin=t},print:function(t){EdgeEnd.prototype.print.call(this,t),t.print(" "+this.depth[Position.LEFT]+"/"+this.depth[Position.RIGHT]),t.print(" ("+this.getDepthDelta()+")"),this._isInResult&&t.print(" inResult")},setMinEdgeRing:function(t){this.minEdgeRing=t},isLineEdge:function(){var t=this.label.isLine(0)||this.label.isLine(1),e=!this.label.isArea(0)||this.label.allPositionsEqual(0,Location.EXTERIOR),n=!this.label.isArea(1)||this.label.allPositionsEqual(1,Location.EXTERIOR);return t&&e&&n},setEdgeRing:function(t){this.edgeRing=t},getMinEdgeRing:function(){return this.minEdgeRing},getDepthDelta:function(){var t=this.edge.getDepthDelta();return this._isForward||(t=-t),t},setInResult:function(t){this._isInResult=t},getSym:function(){return this.sym},isForward:function(){return this._isForward},getEdge:function(){return this.edge},printEdge:function(t){this.print(t),t.print(" "),this._isForward?this.edge.print(t):this.edge.printReverse(t)},setSym:function(t){this.sym=t},setVisitedEdge:function(t){this.setVisited(t),this.sym.setVisited(t)},setEdgeDepths:function(t,e){var n=this.getEdge().getDepthDelta();this._isForward||(n=-n);var i=1;t===Position.LEFT&&(i=-1);var r=Position.opposite(t),o=n*i,s=e+o;this.setDepth(t,e),this.setDepth(r,s)},getEdgeRing:function(){return this.edgeRing},isInResult:function(){return this._isInResult},setNext:function(t){this.next=t},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return DirectedEdge}}),DirectedEdge.depthFactor=function(t,e){return t===Location.EXTERIOR&&e===Location.INTERIOR?1:t===Location.INTERIOR&&e===Location.EXTERIOR?-1:0},extend(NodeFactory.prototype,{createNode:function(t){return new Node$1(t,null)},interfaces_:function(){return[]},getClass:function(){return NodeFactory}}),extend(PlanarGraph.prototype,{printEdges:function(t){t.println("Edges:");for(var e=0;e<this.edges.size();e++){t.println("edge "+e+":");var n=this.edges.get(e);n.print(t),n.eiList.print(t)}},find:function(t){return this.nodes.find(t)},addNode:function(){if(arguments[0]instanceof Node$1){var t=arguments[0];return this.nodes.addNode(t)}if(arguments[0]instanceof Coordinate){var e=arguments[0];return this.nodes.addNode(e)}},getNodeIterator:function(){return this.nodes.iterator()},linkResultDirectedEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},debugPrintln:function(t){System.out.println(t)},isBoundaryNode:function(t,e){var n=this.nodes.find(e);if(null===n)return!1;var i=n.getLabel();return null!==i&&i.getLocation(t)===Location.BOUNDARY},linkAllDirectedEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkAllDirectedEdges()}},matchInSameDirection:function(t,e,n,i){return t.equals(n)?CGAlgorithms.computeOrientation(t,e,i)===CGAlgorithms.COLLINEAR&&Quadrant.quadrant(t,e)===Quadrant.quadrant(n,i):!1},getEdgeEnds:function(){return this.edgeEndList},debugPrint:function(t){System.out.print(t)},getEdgeIterator:function(){return this.edges.iterator()},findEdgeInSameDirection:function(t,e){for(var n=0;n<this.edges.size();n++){var i=this.edges.get(n),r=i.getCoordinates();if(this.matchInSameDirection(t,e,r[0],r[1]))return i;if(this.matchInSameDirection(t,e,r[r.length-1],r[r.length-2]))return i}return null},insertEdge:function(t){this.edges.add(t)},findEdgeEnd:function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null},addEdges:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.edges.add(n);var i=new DirectedEdge(n,!0),r=new DirectedEdge(n,!1);i.setSym(r),r.setSym(i),this.add(i),this.add(r)}},add:function(t){this.nodes.add(t),this.edgeEndList.add(t)},getNodes:function(){return this.nodes.values()},findEdge:function(t,e){for(var n=0;n<this.edges.size();n++){var i=this.edges.get(n),r=i.getCoordinates();if(t.equals(r[0])&&e.equals(r[1]))return i}return null},interfaces_:function(){return[]},getClass:function(){return PlanarGraph}}),PlanarGraph.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}},inherits(GeometryGraph,PlanarGraph),extend(GeometryGraph.prototype,{insertBoundaryPoint:function(t,e){var n=this.nodes.addNode(e),i=n.getLabel(),r=1,o=Location.NONE;o=i.getLocation(t,Position.ON),o===Location.BOUNDARY&&r++;var s=GeometryGraph.determineBoundary(this.boundaryNodeRule,r);i.setLocation(t,s)},computeSelfNodes:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.computeSelfNodes(t,e,!1)}if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=new SegmentIntersector(t,!0,!1);i.setIsDoneIfProperInt(n);var r=this.createEdgeSetIntersector(),o=this.parentGeom instanceof LinearRing||this.parentGeom instanceof Polygon||this.parentGeom instanceof MultiPolygon,s=e||!o;return r.computeIntersections(this.edges,i,s),this.addSelfIntersectionNodes(this.argIndex),i}},computeSplitEdges:function(t){for(var e=this.edges.iterator();e.hasNext();){var n=e.next();n.eiList.addSplitEdges(t)}},computeEdgeIntersections:function(t,e,n){var i=new SegmentIntersector(e,n,!0);i.setBoundaryNodes(this.getBoundaryNodes(),t.getBoundaryNodes());var r=this.createEdgeSetIntersector();return r.computeIntersections(this.edges,t.edges,i),i},getGeometry:function(){return this.parentGeom},getBoundaryNodeRule:function(){return this.boundaryNodeRule},hasTooFewPoints:function(){return this._hasTooFewPoints},addPoint:function(){if(arguments[0]instanceof Point){var t=arguments[0],e=t.getCoordinate();this.insertPoint(this.argIndex,e,Location.INTERIOR)}else if(arguments[0]instanceof Coordinate){var n=arguments[0];this.insertPoint(this.argIndex,n,Location.INTERIOR)}},addPolygon:function(t){this.addPolygonRing(t.getExteriorRing(),Location.EXTERIOR,Location.INTERIOR);for(var e=0;e<t.getNumInteriorRing();e++){var n=t.getInteriorRingN(e);this.addPolygonRing(n,Location.INTERIOR,Location.EXTERIOR)}},addEdge:function(t){this.insertEdge(t);var e=t.getCoordinates();this.insertPoint(this.argIndex,e[0],Location.BOUNDARY),this.insertPoint(this.argIndex,e[e.length-1],Location.BOUNDARY)},addLineString:function(t){var e=CoordinateArrays.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return this._hasTooFewPoints=!0,this.invalidPoint=e[0],null;var n=new Edge(e,new Label(this.argIndex,Location.INTERIOR));this.lineEdgeMap.put(t,n),this.insertEdge(n),Assert.isTrue(e.length>=2,"found LineString with single point"),this.insertBoundaryPoint(this.argIndex,e[0]),this.insertBoundaryPoint(this.argIndex,e[e.length-1])},getInvalidPoint:function(){return this.invalidPoint},getBoundaryPoints:function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},getBoundaryNodes:function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},addSelfIntersectionNode:function(t,e,n){return this.isBoundaryNode(t,e)?null:void(n===Location.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n))},addPolygonRing:function(t,e,n){if(t.isEmpty())return null;var i=CoordinateArrays.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this.invalidPoint=i[0],null;var r=e,o=n;CGAlgorithms.isCCW(i)&&(r=n,o=e);var s=new Edge(i,new Label(this.argIndex,Location.BOUNDARY,r,o));this.lineEdgeMap.put(t,s),this.insertEdge(s),this.insertPoint(this.argIndex,i[0],Location.BOUNDARY)},insertPoint:function(t,e,n){var i=this.nodes.addNode(e),r=i.getLabel();null===r?i.label=new Label(t,n):r.setLocation(t,n)},createEdgeSetIntersector:function(){return new SimpleMCSweepLineIntersector},addSelfIntersectionNodes:function(t){for(var e=this.edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var o=r.next();this.addSelfIntersectionNode(t,o.coord,i)}},add:function(){if(1!==arguments.length)return PlanarGraph.prototype.add.apply(this,arguments);var t=arguments[0];if(t.isEmpty())return null;if(t instanceof MultiPolygon&&(this.useBoundaryDeterminationRule=!1),t instanceof Polygon)this.addPolygon(t);else if(t instanceof LineString)this.addLineString(t);else if(t instanceof Point)this.addPoint(t);else if(t instanceof MultiPoint)this.addCollection(t);else if(t instanceof MultiLineString)this.addCollection(t);else if(t instanceof MultiPolygon)this.addCollection(t);else{if(!(t instanceof GeometryCollection))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},addCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},locate:function(t){return hasInterface(this.parentGeom,Polygonal)&&this.parentGeom.getNumGeometries()>50?(null===this.areaPtLocator&&(this.areaPtLocator=new IndexedPointInAreaLocator(this.parentGeom)),this.areaPtLocator.locate(t)):this.ptLocator.locate(t,this.parentGeom)},findEdge:function(){if(1===arguments.length){var t=arguments[0];return this.lineEdgeMap.get(t)}return PlanarGraph.prototype.findEdge.apply(this,arguments)},interfaces_:function(){return[]},getClass:function(){return GeometryGraph}}),GeometryGraph.determineBoundary=function(t,e){return t.isInBoundary(e)?Location.BOUNDARY:Location.INTERIOR},extend(IsSimpleOp.prototype,{isSimpleMultiPoint:function(t){if(t.isEmpty())return!0;for(var e=new TreeSet,n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n),r=i.getCoordinate();if(e.contains(r))return this.nonSimpleLocation=r,!1;e.add(r)}return!0},isSimplePolygonal:function(t){for(var e=LinearComponentExtracter.getLines(t),n=e.iterator();n.hasNext();){var i=n.next();if(!this.isSimpleLinearGeometry(i))return!1}return!0},hasClosedEndpointIntersection:function(t){for(var e=new TreeMap,n=t.getEdgeIterator();n.hasNext();){var i=n.next(),r=(i.getMaximumSegmentIndex(),i.isClosed()),o=i.getCoordinate(0);this.addEndpoint(e,o,r);var s=i.getCoordinate(i.getNumPoints()-1);this.addEndpoint(e,s,r)}for(var n=e.values().iterator();n.hasNext();){var a=n.next();if(a.isClosed&&2!==a.degree)return this.nonSimpleLocation=a.getCoordinate(),!0}return!1},getNonSimpleLocation:function(){return this.nonSimpleLocation},isSimpleLinearGeometry:function(t){if(t.isEmpty())return!0;var e=new GeometryGraph(0,t),n=new RobustLineIntersector,i=e.computeSelfNodes(n,!0);return i.hasIntersection()?i.hasProperIntersection()?(this.nonSimpleLocation=i.getProperIntersectionPoint(),!1):this.hasNonEndpointIntersection(e)?!1:!this.isClosedEndpointsInInterior||!this.hasClosedEndpointIntersection(e):!0},hasNonEndpointIntersection:function(t){for(var e=t.getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getMaximumSegmentIndex(),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next();if(!o.isEndPoint(i))return this.nonSimpleLocation=o.getCoordinate(),!0}return!1},addEndpoint:function(t,e,n){var i=t.get(e);null===i&&(i=new EndpointInfo(e),t.put(e,i)),i.addEndpoint(n)},computeSimple:function(t){return this.nonSimpleLocation=null,t.isEmpty()?!0:t instanceof LineString?this.isSimpleLinearGeometry(t):t instanceof MultiLineString?this.isSimpleLinearGeometry(t):t instanceof MultiPoint?this.isSimpleMultiPoint(t):hasInterface(t,Polygonal)?this.isSimplePolygonal(t):t instanceof GeometryCollection?this.isSimpleGeometryCollection(t):!0},isSimple:function(){return this.nonSimpleLocation=null,this.computeSimple(this.inputGeom)},isSimpleGeometryCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);if(!this.computeSimple(n))return!1}return!0},interfaces_:function(){return[]},getClass:function(){return IsSimpleOp}}),extend(EndpointInfo.prototype,{addEndpoint:function(t){this.degree++,this.isClosed|=t},getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return EndpointInfo}}),IsSimpleOp.EndpointInfo=EndpointInfo,extend(BufferParameters.prototype,{getEndCapStyle:function(){return this.endCapStyle},isSingleSided:function(){return this._isSingleSided},setQuadrantSegments:function(t){this.quadrantSegments=t,0===this.quadrantSegments&&(this.joinStyle=BufferParameters.JOIN_BEVEL),this.quadrantSegments<0&&(this.joinStyle=BufferParameters.JOIN_MITRE,this.mitreLimit=Math.abs(this.quadrantSegments)),0>=t&&(this.quadrantSegments=1),this.joinStyle!==BufferParameters.JOIN_ROUND&&(this.quadrantSegments=BufferParameters.DEFAULT_QUADRANT_SEGMENTS)},getJoinStyle:function(){return this.joinStyle},setJoinStyle:function(t){this.joinStyle=t},setSimplifyFactor:function(t){this.simplifyFactor=0>t?0:t},getSimplifyFactor:function(){return this.simplifyFactor},getQuadrantSegments:function(){return this.quadrantSegments},setEndCapStyle:function(t){this.endCapStyle=t},getMitreLimit:function(){return this.mitreLimit},setMitreLimit:function(t){this.mitreLimit=t},setSingleSided:function(t){this._isSingleSided=t},interfaces_:function(){return[]},getClass:function(){return BufferParameters}}),BufferParameters.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},BufferParameters.CAP_ROUND=1,BufferParameters.CAP_FLAT=2,BufferParameters.CAP_SQUARE=3,BufferParameters.JOIN_ROUND=1,BufferParameters.JOIN_MITRE=2,BufferParameters.JOIN_BEVEL=3,BufferParameters.DEFAULT_QUADRANT_SEGMENTS=8,BufferParameters.DEFAULT_MITRE_LIMIT=5,BufferParameters.DEFAULT_SIMPLIFY_FACTOR=.01,extend(RightmostEdgeFinder.prototype,{getCoordinate:function(){return this.minCoord},getRightmostSide:function(t,e){var n=this.getRightmostSideOfSegment(t,e);return 0>n&&(n=this.getRightmostSideOfSegment(t,e-1)),0>n&&(this.minCoord=null,this.checkForRightmostCoordinate(t)),n},findRightmostEdgeAtVertex:function(){var t=this.minDe.getEdge().getCoordinates();Assert.isTrue(this.minIndex>0&&this.minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this.minIndex-1],n=t[this.minIndex+1],i=CGAlgorithms.computeOrientation(this.minCoord,n,e),r=!1;e.y<this.minCoord.y&&n.y<this.minCoord.y&&i===CGAlgorithms.COUNTERCLOCKWISE?r=!0:e.y>this.minCoord.y&&n.y>this.minCoord.y&&i===CGAlgorithms.CLOCKWISE&&(r=!0),r&&(this.minIndex=this.minIndex-1)},getRightmostSideOfSegment:function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(0>e||e+1>=i.length)return-1;if(i[e].y===i[e+1].y)return-1;var r=Position.LEFT;return i[e].y<i[e+1].y&&(r=Position.RIGHT),r},getEdge:function(){return this.orientedDe},checkForRightmostCoordinate:function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this.minCoord||e[n].x>this.minCoord.x)&&(this.minDe=t,this.minIndex=n,this.minCoord=e[n])},findRightmostEdgeAtNode:function(){var t=this.minDe.getNode(),e=t.getEdges();this.minDe=e.getRightmostEdge(),this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},findEdge:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}Assert.isTrue(0!==this.minIndex||this.minCoord.equals(this.minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this.minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this.orientedDe=this.minDe;var i=this.getRightmostSide(this.minDe,this.minIndex);i===Position.LEFT&&(this.orientedDe=this.minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return RightmostEdgeFinder}}),LinkedList.prototype.addLast=function(t){this.array_.push(t)},LinkedList.prototype.removeFirst=function(){return this.array_.shift()},LinkedList.prototype.isEmpty=function(){return 0===this.array_.length},extend(BufferSubgraph.prototype,{clearVisitedEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){var e=t.next();e.setVisited(!1)}},getRightmostCoordinate:function(){return this.rightMostCoord},computeNodeDepth:function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){e=i;break}}if(null===e)throw new TopologyException("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();i.setVisited(!0),this.copySymDepths(i)}},computeDepth:function(t){this.clearVisitedEdges();var e=this.finder.getEdge();e.getNode(),e.getLabel();e.setEdgeDepths(Position.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},create:function(t){this.addReachable(t),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},findResultEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(Position.RIGHT)>=1&&e.getDepth(Position.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},computeDepths:function(t){var e=new HashSet,n=new LinkedList,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var o=r.getEdges().iterator();o.hasNext();){var s=o.next(),a=s.getSym();if(!a.isVisited()){var l=a.getNode();e.contains(l)||(n.addLast(l),e.add(l))}}}},compareTo:function(t){var e=t;return this.rightMostCoord.x<e.rightMostCoord.x?-1:this.rightMostCoord.x>e.rightMostCoord.x?1:0},getEnvelope:function(){if(null===this.env){for(var t=new Envelope,e=this.dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),r=0;r<i.length-1;r++)t.expandToInclude(i[r]);this.env=t}return this.env},addReachable:function(t){var e=new Stack;for(e.add(t);!e.empty();){var n=e.pop();this.add(n,e)}},copySymDepths:function(t){var e=t.getSym();e.setDepth(Position.LEFT,t.getDepth(Position.RIGHT)),e.setDepth(Position.RIGHT,t.getDepth(Position.LEFT))},add:function(t,e){t.setVisited(!0),this.nodes.add(t);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();this.dirEdgeList.add(i);var r=i.getSym(),o=r.getNode();o.isVisited()||e.push(o)}},getNodes:function(){return this.nodes},getDirectedEdges:function(){return this.dirEdgeList},interfaces_:function(){return[Comparable]},getClass:function(){return BufferSubgraph}}),extend(EdgeRing.prototype,{computeRing:function(){if(null!==this.ring)return null;for(var t=new Array(this.pts.size()).fill(null),e=0;e<this.pts.size();e++)t[e]=this.pts.get(e);this.ring=this.geometryFactory.createLinearRing(t),this._isHole=CGAlgorithms.isCCW(this.ring.getCoordinates())},isIsolated:function(){return 1===this.label.getGeometryCount()},computePoints:function(t){this.startDe=t;var e=t,n=!0;do{if(null===e)throw new TopologyException("Found null DirectedEdge");if(e.getEdgeRing()===this)throw new TopologyException("Directed Edge visited twice during ring-building at "+e.getCoordinate());this.edges.add(e);var i=e.getLabel();Assert.isTrue(i.isArea()),this.mergeLabel(i),this.addPoints(e.getEdge(),e.isForward(),n),n=!1,this.setEdgeRing(e,this),e=this.getNext(e)}while(e!==this.startDe)},getLinearRing:function(){return this.ring},getCoordinate:function(t){return this.pts.get(t)},computeMaxNodeDegree:function(){this.maxNodeDegree=0;var t=this.startDe;do{var e=t.getNode(),n=e.getEdges().getOutgoingDegree(this);n>this.maxNodeDegree&&(this.maxNodeDegree=n),t=this.getNext(t)}while(t!==this.startDe);this.maxNodeDegree*=2},addPoints:function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var o=r;o<i.length;o++)this.pts.add(i[o])}else{var r=i.length-2;n&&(r=i.length-1);for(var o=r;o>=0;o--)this.pts.add(i[o])}},isHole:function(){return this._isHole},setInResult:function(){var t=this.startDe;do t.getEdge().setInResult(!0),t=t.getNext();while(t!==this.startDe)},containsPoint:function(t){var e=this.getLinearRing(),n=e.getEnvelopeInternal();if(!n.contains(t))return!1;if(!CGAlgorithms.isPointInRing(t,e.getCoordinates()))return!1;for(var i=this.holes.iterator();i.hasNext();){var r=i.next();if(r.containsPoint(t))return!1}return!0},addHole:function(t){this.holes.add(t)},isShell:function(){return null===this.shell},getLabel:function(){return this.label},getEdges:function(){return this.edges},getMaxNodeDegree:function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},getShell:function(){return this.shell},mergeLabel:function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(e,Position.RIGHT);if(n===Location.NONE)return null;if(this.label.getLocation(e)===Location.NONE)return this.label.setLocation(e,n),null}},setShell:function(t){this.shell=t,null!==t&&t.addHole(this)},toPolygon:function(t){for(var e=new Array(this.holes.size()).fill(null),n=0;n<this.holes.size();n++)e[n]=this.holes.get(n).getLinearRing();var i=t.createPolygon(this.getLinearRing(),e);return i},interfaces_:function(){return[]},getClass:function(){return EdgeRing}}),inherits(MinimalEdgeRing,EdgeRing),extend(MinimalEdgeRing.prototype,{setEdgeRing:function(t,e){t.setMinEdgeRing(e)},getNext:function(t){return t.getNextMin()},interfaces_:function(){return[]},getClass:function(){return MinimalEdgeRing}}),inherits(MaximalEdgeRing,EdgeRing),extend(MaximalEdgeRing.prototype,{buildMinimalRings:function(){var t=new ArrayList,e=this.startDe;do{if(null===e.getMinEdgeRing()){var n=new MinimalEdgeRing(e,this.geometryFactory);t.add(n)}e=e.getNext()}while(e!==this.startDe);return t},setEdgeRing:function(t,e){t.setEdgeRing(e)},linkDirectedEdgesForMinimalEdgeRings:function(){var t=this.startDe;do{var e=t.getNode();e.getEdges().linkMinimalDirectedEdges(this),t=t.getNext()}while(t!==this.startDe)},getNext:function(t){return t.getNext()},interfaces_:function(){return[]},getClass:function(){return MaximalEdgeRing}}),extend(PolygonBuilder.prototype,{sortShellsAndHoles:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isHole()?n.add(r):e.add(r)}},computePolygons:function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next(),r=i.toPolygon(this.geometryFactory);e.add(r)}return e},placeFreeHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(null===i.getShell()){var r=this.findEdgeRingContaining(i,t);if(null===r)throw new TopologyException("unable to assign hole to a shell",i.getCoordinate(0));i.setShell(r)}}},buildMinimalEdgeRings:function(t,e,n){for(var i=new ArrayList,r=t.iterator();r.hasNext();){var o=r.next();if(o.getMaxNodeDegree()>2){o.linkDirectedEdgesForMinimalEdgeRings();var s=o.buildMinimalRings(),a=this.findShell(s);null!==a?(this.placePolygonHoles(a,s),e.add(a)):n.addAll(s)}else i.add(o)}return i},containsPoint:function(t){for(var e=this.shellList.iterator();e.hasNext();){var n=e.next();if(n.containsPoint(t))return!0}return!1},buildMaximalEdgeRings:function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new MaximalEdgeRing(i,this.geometryFactory);e.add(r),r.setInResult()}}return e},placePolygonHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},getPolygons:function(){var t=this.computePolygons(this.shellList);return t},findEdgeRingContaining:function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var l=a.next(),u=l.getLinearRing(),c=u.getEnvelopeInternal();null!==o&&(s=o.getLinearRing().getEnvelopeInternal());var h=!1;c.contains(i)&&CGAlgorithms.isPointInRing(r,u.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=l)}return o},findShell:function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return Assert.isTrue(1>=e,"found two shells in MinimalEdgeRing list"),n},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];PlanarGraph.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new ArrayList,o=this.buildMinimalEdgeRings(i,this.shellList,r);this.sortShellsAndHoles(o,this.shellList,r),this.placeFreeHoles(this.shellList,r)}},interfaces_:function(){return[]},getClass:function(){return PolygonBuilder}}),extend(BufferInputLineSimplifier.prototype,{isDeletable:function(t,e,n,i){var r=this.inputLine[t],o=this.inputLine[e],s=this.inputLine[n];return this.isConcave(r,o,s)&&this.isShallow(r,o,s,i)?this.isShallowSampled(r,o,t,n,i):!1},deleteShallowConcavities:function(){for(var t=1,e=(this.inputLine.length-1,this.findNextNonDeletedIndex(t)),n=this.findNextNonDeletedIndex(e),i=!1;n<this.inputLine.length;){var r=!1;this.isDeletable(t,e,n,this.distanceTol)&&(this.isDeleted[e]=BufferInputLineSimplifier.DELETE,r=!0,i=!0),t=r?n:e,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e)}return i},isShallowConcavity:function(t,e,n,i){var r=CGAlgorithms.computeOrientation(t,e,n),o=r===this.angleOrientation;if(!o)return!1;var s=CGAlgorithms.distancePointLine(e,t,n);return i>s},isShallowSampled:function(t,e,n,i,r){var o=Math.trunc((i-n)/BufferInputLineSimplifier.NUM_PTS_TO_CHECK);0>=o&&(o=1);for(var s=n;i>s;s+=o)if(!this.isShallow(t,e,this.inputLine[s],r))return!1;return!0},isConcave:function t(e,n,i){var r=CGAlgorithms.computeOrientation(e,n,i),t=r===this.angleOrientation;return t},simplify:function(t){this.distanceTol=Math.abs(t),0>t&&(this.angleOrientation=CGAlgorithms.CLOCKWISE),this.isDeleted=new Array(this.inputLine.length).fill(null);var e=!1;do e=this.deleteShallowConcavities();while(e);return this.collapseLine()},findNextNonDeletedIndex:function(t){for(var e=t+1;e<this.inputLine.length&&this.isDeleted[e]===BufferInputLineSimplifier.DELETE;)e++;return e},isShallow:function(t,e,n,i){var r=CGAlgorithms.distancePointLine(e,t,n);return i>r},collapseLine:function(){for(var t=new CoordinateList,e=0;e<this.inputLine.length;e++)this.isDeleted[e]!==BufferInputLineSimplifier.DELETE&&t.add(this.inputLine[e]);return t.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return BufferInputLineSimplifier}}),BufferInputLineSimplifier.simplify=function(t,e){var n=new BufferInputLineSimplifier(t);return n.simplify(e)},BufferInputLineSimplifier.INIT=0,BufferInputLineSimplifier.DELETE=1,BufferInputLineSimplifier.KEEP=1,BufferInputLineSimplifier.NUM_PTS_TO_CHECK=10,extend(OffsetSegmentString.prototype,{getCoordinates:function(){var t=this.ptList.toArray(OffsetSegmentString.COORDINATE_ARRAY_TYPE);return t},setPrecisionModel:function(t){this.precisionModel=t},addPt:function(t){var e=new Coordinate(t);return this.precisionModel.makePrecise(e),this.isRedundant(e)?null:void this.ptList.add(e)},reverse:function(){},addPts:function(t,e){if(e)for(var n=0;n<t.length;n++)this.addPt(t[n]);else for(var n=t.length-1;n>=0;n--)this.addPt(t[n])},isRedundant:function(t){if(this.ptList.size()<1)return!1;var e=this.ptList.get(this.ptList.size()-1),n=t.distance(e);return n<this.minimimVertexDistance},toString:function(){var t=new GeometryFactory,e=t.createLineString(this.getCoordinates());return e.toString()},closeRing:function(){if(this.ptList.size()<1)return null;var t=new Coordinate(this.ptList.get(0)),e=this.ptList.get(this.ptList.size()-1),n=null;return this.ptList.size()>=2&&(n=this.ptList.get(this.ptList.size()-2)),t.equals(e)?null:void this.ptList.add(t)},setMinimumVertexDistance:function(t){this.minimimVertexDistance=t},interfaces_:function(){return[]},getClass:function(){return OffsetSegmentString}}),OffsetSegmentString.COORDINATE_ARRAY_TYPE=new Array(0).fill(null),extend(OffsetSegmentGenerator.prototype,{addNextSegment:function(t,e){if(this.s0=this.s1,this.s1=this.s2,this.s2=t,this.seg0.setCoordinates(this.s0,this.s1),this.computeOffsetSegment(this.seg0,this.side,this.distance,this.offset0),this.seg1.setCoordinates(this.s1,this.s2),this.computeOffsetSegment(this.seg1,this.side,this.distance,this.offset1),this.s1.equals(this.s2))return null;var n=CGAlgorithms.computeOrientation(this.s0,this.s1,this.s2),i=n===CGAlgorithms.CLOCKWISE&&this.side===Position.LEFT||n===CGAlgorithms.COUNTERCLOCKWISE&&this.side===Position.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},addLineEndCap:function(t,e){var n=new LineSegment(t,e),i=new LineSegment;this.computeOffsetSegment(n,Position.LEFT,this.distance,i);var r=new LineSegment;this.computeOffsetSegment(n,Position.RIGHT,this.distance,r);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this.bufParams.getEndCapStyle()){case BufferParameters.CAP_ROUND:this.segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,CGAlgorithms.CLOCKWISE,this.distance),this.segList.addPt(r.p1);break;case BufferParameters.CAP_FLAT:this.segList.addPt(i.p1),this.segList.addPt(r.p1);break;case BufferParameters.CAP_SQUARE:var l=new Coordinate;l.x=Math.abs(this.distance)*Math.cos(a),l.y=Math.abs(this.distance)*Math.sin(a);var u=new Coordinate(i.p1.x+l.x,i.p1.y+l.y),c=new Coordinate(r.p1.x+l.x,r.p1.y+l.y);this.segList.addPt(u),this.segList.addPt(c)}},getCoordinates:function(){var t=this.segList.getCoordinates();return t},addMitreJoin:function(t,e,n,i){var r=!0,o=null;try{o=HCoordinate.intersection(e.p0,e.p1,n.p0,n.p1);var s=0>=i?1:o.distance(t)/Math.abs(i);s>this.bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof NotRepresentableException))throw t;o=new Coordinate(0,0),r=!1}finally{}r?this.segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this.bufParams.getMitreLimit())},addFilletCorner:function(t,e,n,i,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),l=n.x-t.x,u=n.y-t.y,c=Math.atan2(u,l);i===CGAlgorithms.CLOCKWISE?c>=a&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this.segList.addPt(e),this.addFilletArc(t,a,c,i,r),this.segList.addPt(n)},addOutsideTurn:function(t,e){return this.offset0.p1.distance(this.offset1.p0)<this.distance*OffsetSegmentGenerator.OFFSET_SEGMENT_SEPARATION_FACTOR?(this.segList.addPt(this.offset0.p1),null):void(this.bufParams.getJoinStyle()===BufferParameters.JOIN_MITRE?this.addMitreJoin(this.s1,this.offset0,this.offset1,this.distance):this.bufParams.getJoinStyle()===BufferParameters.JOIN_BEVEL?this.addBevelJoin(this.offset0,this.offset1):(e&&this.segList.addPt(this.offset0.p1),this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,t,this.distance),this.segList.addPt(this.offset1.p0)))},createSquare:function(t){this.segList.addPt(new Coordinate(t.x+this.distance,t.y+this.distance)),this.segList.addPt(new Coordinate(t.x+this.distance,t.y-this.distance)),this.segList.addPt(new Coordinate(t.x-this.distance,t.y-this.distance)),this.segList.addPt(new Coordinate(t.x-this.distance,t.y+this.distance)),this.segList.closeRing()},addSegments:function(t,e){
this.segList.addPts(t,e)},addFirstSegment:function(){this.segList.addPt(this.offset1.p0)},addLastSegment:function(){this.segList.addPt(this.offset1.p1)},initSideSegments:function(t,e,n){this.s1=t,this.s2=e,this.side=n,this.seg1.setCoordinates(t,e),this.computeOffsetSegment(this.seg1,n,this.distance,this.offset1)},addLimitedMitreJoin:function(t,e,n,i){var r=this.seg0.p1,o=Angle.angle(r,this.seg0.p0),s=(Angle.angle(r,this.seg1.p1),Angle.angleBetweenOriented(this.seg0.p0,r,this.seg1.p1)),a=s/2,l=Angle.normalize(o+a),u=Angle.normalize(l+Math.PI),c=i*n,h=c*Math.abs(Math.sin(a)),d=n-h,g=r.x+c*Math.cos(u),f=r.y+c*Math.sin(u),p=new Coordinate(g,f),m=new LineSegment(r,p),y=m.pointAlongOffset(1,d),v=m.pointAlongOffset(1,-d);this.side===Position.LEFT?(this.segList.addPt(y),this.segList.addPt(v)):(this.segList.addPt(v),this.segList.addPt(y))},computeOffsetSegment:function(t,e,n,i){var r=e===Position.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),l=r*n*o/a,u=r*n*s/a;i.p0.x=t.p0.x-u,i.p0.y=t.p0.y+l,i.p1.x=t.p1.x-u,i.p1.y=t.p1.y+l},addFilletArc:function(t,e,n,i,r){var o=i===CGAlgorithms.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this.filletAngleQuantum+.5);if(1>a)return null;var l=null,u=null;l=0,u=s/a;for(var c=l,h=new Coordinate;s>c;){var d=e+o*c;h.x=t.x+r*Math.cos(d),h.y=t.y+r*Math.sin(d),this.segList.addPt(h),c+=u}},addInsideTurn:function(t,e){if(this.li.computeIntersection(this.offset0.p0,this.offset0.p1,this.offset1.p0,this.offset1.p1),this.li.hasIntersection())this.segList.addPt(this.li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this.offset0.p1.distance(this.offset1.p0)<this.distance*OffsetSegmentGenerator.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this.segList.addPt(this.offset0.p1);else{if(this.segList.addPt(this.offset0.p1),this.closingSegLengthFactor>0){var n=new Coordinate((this.closingSegLengthFactor*this.offset0.p1.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset0.p1.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(n);var i=new Coordinate((this.closingSegLengthFactor*this.offset1.p0.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset1.p0.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(i)}else this.segList.addPt(this.s1);this.segList.addPt(this.offset1.p0)}},createCircle:function(t){var e=new Coordinate(t.x+this.distance,t.y);this.segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this.distance),this.segList.closeRing()},addBevelJoin:function(t,e){this.segList.addPt(t.p1),this.segList.addPt(e.p0)},init:function(t){this.distance=t,this.maxCurveSegmentError=t*(1-Math.cos(this.filletAngleQuantum/2)),this.segList=new OffsetSegmentString,this.segList.setPrecisionModel(this.precisionModel),this.segList.setMinimumVertexDistance(t*OffsetSegmentGenerator.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},addCollinear:function(t){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2);var e=this.li.getIntersectionNum();e>=2&&(this.bufParams.getJoinStyle()===BufferParameters.JOIN_BEVEL||this.bufParams.getJoinStyle()===BufferParameters.JOIN_MITRE?(t&&this.segList.addPt(this.offset0.p1),this.segList.addPt(this.offset1.p0)):this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,CGAlgorithms.CLOCKWISE,this.distance))},closeRing:function(){this.segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return OffsetSegmentGenerator}}),OffsetSegmentGenerator.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,OffsetSegmentGenerator.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,OffsetSegmentGenerator.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,OffsetSegmentGenerator.MAX_CLOSING_SEG_LEN_FACTOR=80,extend(OffsetCurveBuilder.prototype,{getOffsetCurve:function(t,e){if(this.distance=e,0===e)return null;var n=0>e,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var o=r.getCoordinates();return n&&CoordinateArrays.reverse(o),o},computeSingleSidedBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){n.addSegments(t,!0);var r=BufferInputLineSimplifier.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Position.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{n.addSegments(t,!1);var a=BufferInputLineSimplifier.simplify(t,i),l=a.length-1;n.initSideSegments(a[0],a[1],Position.LEFT),n.addFirstSegment();for(var s=2;l>=s;s++)n.addNextSegment(a[s],!0)}n.addLastSegment(),n.closeRing()},computeRingBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);e===Position.RIGHT&&(i=-i);var r=BufferInputLineSimplifier.simplify(t,i),o=r.length-1;n.initSideSegments(r[o-1],r[0],e);for(var s=1;o>=s;s++){var a=1!==s;n.addNextSegment(r[s],a)}n.closeRing()},computeLineBufferCurve:function(t,e){var n=this.simplifyTolerance(this.distance),i=BufferInputLineSimplifier.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],Position.LEFT);for(var o=2;r>=o;o++)e.addNextSegment(i[o],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var s=BufferInputLineSimplifier.simplify(t,-n),a=s.length-1;e.initSideSegments(s[a],s[a-1],Position.LEFT);for(var o=a-2;o>=0;o--)e.addNextSegment(s[o],!0);e.addLastSegment(),e.addLineEndCap(s[1],s[0]),e.closeRing()},computePointCurve:function(t,e){switch(this.bufParams.getEndCapStyle()){case BufferParameters.CAP_ROUND:e.createCircle(t);break;case BufferParameters.CAP_SQUARE:e.createSquare(t)}},getLineCurve:function(t,e){if(this.distance=e,0>e&&!this.bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this.bufParams.isSingleSided()){var r=0>e;this.computeSingleSidedBufferCurve(t,r,i)}else this.computeLineBufferCurve(t,i);var o=i.getCoordinates();return o},getBufferParameters:function(){return this.bufParams},simplifyTolerance:function(t){return t*this.bufParams.getSimplifyFactor()},getRingCurve:function(t,e,n){if(this.distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return OffsetCurveBuilder.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},computeOffsetCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){var r=BufferInputLineSimplifier.simplify(t,-i),o=r.length-1;n.initSideSegments(r[o],r[o-1],Position.LEFT),n.addFirstSegment();for(var s=o-2;s>=0;s--)n.addNextSegment(r[s],!0)}else{var a=BufferInputLineSimplifier.simplify(t,i),l=a.length-1;n.initSideSegments(a[0],a[1],Position.LEFT),n.addFirstSegment();for(var s=2;l>=s;s++)n.addNextSegment(a[s],!0)}n.addLastSegment()},getSegGen:function(t){return new OffsetSegmentGenerator(this.precisionModel,this.bufParams,t)},interfaces_:function(){return[]},getClass:function(){return OffsetCurveBuilder}}),OffsetCurveBuilder.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;n<e.length;n++)e[n]=new Coordinate(t[n]);return e},extend(SubgraphDepthLocater.prototype,{findStabbedSegments:function(){if(1===arguments.length){for(var t=arguments[0],e=new ArrayList,n=this.subgraphs.iterator();n.hasNext();){var i=n.next(),r=i.getEnvelope();t.y<r.getMinY()||t.y>r.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if(hasInterface(arguments[2],List)&&arguments[0]instanceof Coordinate&&arguments[1]instanceof DirectedEdge)for(var t=arguments[0],o=arguments[1],s=arguments[2],a=o.getEdge().getCoordinates(),n=0;n<a.length-1;n++){this.seg.p0=a[n],this.seg.p1=a[n+1],this.seg.p0.y>this.seg.p1.y&&this.seg.reverse();var l=Math.max(this.seg.p0.x,this.seg.p1.x);if(!(l<t.x||this.seg.isHorizontal()||t.y<this.seg.p0.y||t.y>this.seg.p1.y||CGAlgorithms.computeOrientation(this.seg.p0,this.seg.p1,t)===CGAlgorithms.RIGHT)){var u=o.getDepth(Position.LEFT);this.seg.p0.equals(a[n])||(u=o.getDepth(Position.RIGHT));var c=new DepthSegment(this.seg,u);s.add(c)}}else if(hasInterface(arguments[2],List)&&arguments[0]instanceof Coordinate&&hasInterface(arguments[1],List))for(var t=arguments[0],h=arguments[1],d=arguments[2],n=h.iterator();n.hasNext();){var g=n.next();g.isForward()&&this.findStabbedSegments(t,g,d)}},getDepth:function(t){var e=this.findStabbedSegments(t);if(0===e.size())return 0;var n=Collections.min(e);return n.leftDepth},interfaces_:function(){return[]},getClass:function(){return SubgraphDepthLocater}}),extend(DepthSegment.prototype,{compareTo:function(t){var e=t;if(this.upwardSeg.minX()>=e.upwardSeg.maxX())return 1;if(this.upwardSeg.maxX()<=e.upwardSeg.minX())return-1;var n=this.upwardSeg.orientationIndex(e.upwardSeg);return 0!==n?n:(n=-1*e.upwardSeg.orientationIndex(this.upwardSeg),0!==n?n:this.upwardSeg.compareTo(e.upwardSeg))},compareX:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},toString:function(){return this.upwardSeg.toString()},interfaces_:function(){return[Comparable]},getClass:function(){return DepthSegment}}),SubgraphDepthLocater.DepthSegment=DepthSegment,extend(OffsetCurveSetBuilder.prototype,{addPoint:function(t){if(this.distance<=0)return null;var e=t.getCoordinates(),n=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(n,Location.EXTERIOR,Location.INTERIOR)},addPolygon:function(t){var e=this.distance,n=Position.LEFT;this.distance<0&&(e=-this.distance,n=Position.RIGHT);var i=t.getExteriorRing(),r=CoordinateArrays.removeRepeatedPoints(i.getCoordinates());if(this.distance<0&&this.isErodedCompletely(i,this.distance))return null;if(this.distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,Location.EXTERIOR,Location.INTERIOR);for(var o=0;o<t.getNumInteriorRing();o++){var s=t.getInteriorRingN(o),a=CoordinateArrays.removeRepeatedPoints(s.getCoordinates());this.distance>0&&this.isErodedCompletely(s,-this.distance)||this.addPolygonRing(a,e,Position.opposite(n),Location.INTERIOR,Location.EXTERIOR)}},isTriangleErodedCompletely:function(t,e){var n=new Triangle(t[0],t[1],t[2]),i=n.inCentre(),r=CGAlgorithms.distancePointLine(i,n.p0,n.p1);return r<Math.abs(e)},addLineString:function(t){if(this.distance<=0&&!this.curveBuilder.getBufferParameters().isSingleSided())return null;var e=CoordinateArrays.removeRepeatedPoints(t.getCoordinates()),n=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(n,Location.EXTERIOR,Location.INTERIOR)},addCurve:function(t,e,n){if(null===t||t.length<2)return null;var i=new NodedSegmentString(t,new Label(0,Location.BOUNDARY,e,n));this.curveList.add(i)},getCurves:function(){return this.add(this.inputGeom),this.curveList},addPolygonRing:function(t,e,n,i,r){if(0===e&&t.length<LinearRing.MINIMUM_VALID_SIZE)return null;var o=i,s=r;t.length>=LinearRing.MINIMUM_VALID_SIZE&&CGAlgorithms.isCCW(t)&&(o=r,s=i,n=Position.opposite(n));var a=this.curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},add:function(t){if(t.isEmpty())return null;if(t instanceof Polygon)this.addPolygon(t);else if(t instanceof LineString)this.addLineString(t);else if(t instanceof Point)this.addPoint(t);else if(t instanceof MultiPoint)this.addCollection(t);else if(t instanceof MultiLineString)this.addCollection(t);else if(t instanceof MultiPolygon)this.addCollection(t);else{if(!(t instanceof GeometryCollection))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},isErodedCompletely:function(t,e){var n=t.getCoordinates();if(n.length<4)return 0>e;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return 0>e&&2*Math.abs(e)>r},addCollection:function(t){for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);this.add(n)}},interfaces_:function(){return[]},getClass:function(){return OffsetCurveSetBuilder}}),extend(SimplePointInAreaLocator.prototype,{locate:function(t){return SimplePointInAreaLocator.locate(t,this.geom)},interfaces_:function(){return[PointOnGeometryLocator]},getClass:function(){return SimplePointInAreaLocator}}),SimplePointInAreaLocator.isPointInRing=function(t,e){return e.getEnvelopeInternal().intersects(t)?CGAlgorithms.isPointInRing(t,e.getCoordinates()):!1},SimplePointInAreaLocator.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!SimplePointInAreaLocator.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var r=e.getInteriorRingN(i);if(SimplePointInAreaLocator.isPointInRing(t,r))return!1}return!0},SimplePointInAreaLocator.containsPoint=function(t,e){if(e instanceof Polygon)return SimplePointInAreaLocator.containsPointInPolygon(t,e);if(e instanceof GeometryCollection)for(var n=new GeometryCollectionIterator(e);n.hasNext();){var i=n.next();if(i!==e&&SimplePointInAreaLocator.containsPoint(t,i))return!0}return!1},SimplePointInAreaLocator.locate=function(t,e){return e.isEmpty()?Location.EXTERIOR:SimplePointInAreaLocator.containsPoint(t,e)?Location.INTERIOR:Location.EXTERIOR},extend(EdgeEndStar.prototype,{getNextCW:function(t){this.getEdges();var e=this.edgeList.indexOf(t),n=e-1;return 0===e&&(n=this.edgeList.size()-1),this.edgeList.get(n)},propagateSideLabels:function(t){for(var e=Location.NONE,n=this.iterator();n.hasNext();){var i=n.next(),r=i.getLabel();r.isArea(t)&&r.getLocation(t,Position.LEFT)!==Location.NONE&&(e=r.getLocation(t,Position.LEFT))}if(e===Location.NONE)return null;for(var o=e,n=this.iterator();n.hasNext();){var i=n.next(),r=i.getLabel();if(r.getLocation(t,Position.ON)===Location.NONE&&r.setLocation(t,Position.ON,o),r.isArea(t)){var s=r.getLocation(t,Position.LEFT),a=r.getLocation(t,Position.RIGHT);if(a!==Location.NONE){if(a!==o)throw new TopologyException("side location conflict",i.getCoordinate());s===Location.NONE&&Assert.shouldNeverReachHere("found single null side (at "+i.getCoordinate()+")"),o=s}else Assert.isTrue(r.getLocation(t,Position.LEFT)===Location.NONE,"found single null side"),r.setLocation(t,Position.RIGHT,o),r.setLocation(t,Position.LEFT,o)}}},getCoordinate:function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},print:function(t){System.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t)}},isAreaLabelsConsistent:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},checkAreaLabelsConsistent:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),r=i.getLocation(t,Position.LEFT);Assert.isTrue(r!==Location.NONE,"Found unlabelled area edge");for(var o=r,s=this.iterator();s.hasNext();){var a=s.next(),l=a.getLabel();Assert.isTrue(l.isArea(t),"Found non-area edge");var u=l.getLocation(t,Position.LEFT),c=l.getLocation(t,Position.RIGHT);if(u===c)return!1;if(c!==o)return!1;o=u}return!0},findIndex:function(t){this.iterator();for(var e=0;e<this.edgeList.size();e++){var n=this.edgeList.get(e);if(n===t)return e}return-1},iterator:function(){return this.getEdges().iterator()},getEdges:function(){return null===this.edgeList&&(this.edgeList=new ArrayList(this.edgeMap.values())),this.edgeList},getLocation:function(t,e,n){return this.ptInAreaLocation[t]===Location.NONE&&(this.ptInAreaLocation[t]=SimplePointInAreaLocator.locate(e,n[t].getGeometry())),this.ptInAreaLocation[t]},toString:function(){var t=new StringBuffer;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},computeEdgeEndLabels:function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.computeLabel(t)}},computeLabelling:function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var i=n.next(),r=i.getLabel(),o=0;2>o;o++)r.isLine(o)&&r.getLocation(o)===Location.BOUNDARY&&(e[o]=!0);for(var n=this.iterator();n.hasNext();)for(var i=n.next(),r=i.getLabel(),o=0;2>o;o++)if(r.isAnyNull(o)){var s=Location.NONE;if(e[o])s=Location.EXTERIOR;else{var a=i.getCoordinate();s=this.getLocation(o,a,t)}r.setAllLocationsIfNull(o,s)}},getDegree:function(){return this.edgeMap.size()},insertEdgeEnd:function(t,e){this.edgeMap.put(t,e),this.edgeList=null},interfaces_:function(){return[]},getClass:function(){return EdgeEndStar}}),inherits(DirectedEdgeStar,EdgeEndStar),extend(DirectedEdgeStar.prototype,{linkResultDirectedEdges:function(){this.getResultAreaEdges();for(var t=null,e=null,n=this.SCANNING_FOR_INCOMING,i=0;i<this.resultAreaEdgeList.size();i++){var r=this.resultAreaEdgeList.get(i),o=r.getSym();if(r.getLabel().isArea())switch(null===t&&r.isInResult()&&(t=r),n){case this.SCANNING_FOR_INCOMING:if(!o.isInResult())continue;e=o,n=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(!r.isInResult())continue;e.setNext(r),n=this.SCANNING_FOR_INCOMING}}if(n===this.LINKING_TO_OUTGOING){if(null===t)throw new TopologyException("no outgoing dirEdge found",this.getCoordinate());Assert.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},insert:function(t){var e=t;this.insertEdgeEnd(e,e)},getRightmostEdge:function(){var t=this.getEdges(),e=t.size();if(1>e)return null;var n=t.get(0);if(1===e)return n;var i=t.get(e-1),r=n.getQuadrant(),o=i.getQuadrant();if(Quadrant.isNorthern(r)&&Quadrant.isNorthern(o))return n;if(!Quadrant.isNorthern(r)&&!Quadrant.isNorthern(o))return i;return 0!==n.getDy()?n:0!==i.getDy()?i:(Assert.shouldNeverReachHere("found two horizontal edges incident on node"),null)},print:function(t){System.out.println("DirectedEdgeStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){var n=e.next();t.print("out "),n.print(t),t.println(),t.print("in "),n.getSym().print(t),t.println()}},getResultAreaEdges:function(){if(null!==this.resultAreaEdgeList)return this.resultAreaEdgeList;this.resultAreaEdgeList=new ArrayList;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this.resultAreaEdgeList.add(e)}return this.resultAreaEdgeList},updateLabelling:function(t){for(var e=this.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();i.setAllLocationsIfNull(0,t.getLocation(0)),i.setAllLocationsIfNull(1,t.getLocation(1))}},linkAllDirectedEdges:function(){this.getEdges();for(var t=null,e=null,n=this.edgeList.size()-1;n>=0;n--){var i=this.edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},computeDepths:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=(t.getLabel(),t.getDepth(Position.LEFT)),i=t.getDepth(Position.RIGHT),r=this.computeDepths(e+1,this.edgeList.size(),n),o=this.computeDepths(0,e,r);if(o!==i)throw new TopologyException("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var s=arguments[0],a=arguments[1],l=arguments[2],u=l,c=s;a>c;c++){var h=this.edgeList.get(c);h.getLabel();h.setEdgeDepths(Position.RIGHT,u),u=h.getDepth(Position.LEFT)}return u}},mergeSymLabels:function(){for(var t=this.iterator();t.hasNext();){var e=t.next(),n=e.getLabel();n.merge(e.getSym().getLabel())}},linkMinimalDirectedEdges:function(t){for(var e=null,n=null,i=this.SCANNING_FOR_INCOMING,r=this.resultAreaEdgeList.size()-1;r>=0;r--){var o=this.resultAreaEdgeList.get(r),s=o.getSym();switch(null===e&&o.getEdgeRing()===t&&(e=o),i){case this.SCANNING_FOR_INCOMING:if(s.getEdgeRing()!==t)continue;n=s,i=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(o.getEdgeRing()!==t)continue;n.setNextMin(o),i=this.SCANNING_FOR_INCOMING}}i===this.LINKING_TO_OUTGOING&&(Assert.isTrue(null!==e,"found null for first outgoing dirEdge"),Assert.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},getOutgoingDegree:function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){var n=e.next();n.isInResult()&&t++}return t}if(1===arguments.length){for(var i=arguments[0],t=0,e=this.iterator();e.hasNext();){var n=e.next();n.getEdgeRing()===i&&t++}return t}},getLabel:function(){return this.label},findCoveredLineEdges:function(){for(var t=Location.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=Location.INTERIOR;break}if(i.isInResult()){t=Location.EXTERIOR;break}}}if(t===Location.NONE)return null;for(var r=t,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();n.isLineEdge()?n.getEdge().setCovered(r===Location.INTERIOR):(n.isInResult()&&(r=Location.EXTERIOR),i.isInResult()&&(r=Location.INTERIOR))}},computeLabelling:function(t){EdgeEndStar.prototype.computeLabelling.call(this,t),this.label=new Label(Location.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge(),r=i.getLabel(),o=0;2>o;o++){var s=r.getLocation(o);s!==Location.INTERIOR&&s!==Location.BOUNDARY||this.label.setLocation(o,Location.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return DirectedEdgeStar}}),inherits(OverlayNodeFactory,NodeFactory),extend(OverlayNodeFactory.prototype,{createNode:function(t){return new Node$1(t,new DirectedEdgeStar)},interfaces_:function(){return[]},getClass:function(){return OverlayNodeFactory}}),extend(OrientedCoordinateArray.prototype,{compareTo:function(t){var e=t,n=OrientedCoordinateArray.compareOriented(this.pts,this._orientation,e.pts,e._orientation);return n},interfaces_:function(){return[Comparable]},getClass:function(){return OrientedCoordinateArray}}),OrientedCoordinateArray.orientation=function(t){return 1===CoordinateArrays.increasingDirection(t)},OrientedCoordinateArray.compareOriented=function(t,e,n,i){for(var r=e?1:-1,o=i?1:-1,s=e?t.length:-1,a=i?n.length:-1,l=e?0:t.length-1,u=i?0:n.length-1;;){var c=t[l].compareTo(n[u]);if(0!==c)return c;l+=r,u+=o;var h=l===s,d=u===a;if(h&&!d)return-1;if(!h&&d)return 1;if(h&&d)return 0}},extend(EdgeList.prototype,{print:function(t){t.print("MULTILINESTRING ( ");for(var e=0;e<this.edges.size();e++){var n=this.edges.get(e);e>0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r<i.length;r++)r>0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(") ")},addAll:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},findEdgeIndex:function(t){for(var e=0;e<this.edges.size();e++)if(this.edges.get(e).equals(t))return e;return-1},iterator:function(){return this.edges.iterator()},getEdges:function(){return this.edges},get:function(t){return this.edges.get(t)},findEqualEdge:function(t){var e=new OrientedCoordinateArray(t.getCoordinates()),n=this.ocaMap.get(e);return n},add:function(t){this.edges.add(t);var e=new OrientedCoordinateArray(t.getCoordinates());this.ocaMap.put(e,t)},interfaces_:function(){return[]},getClass:function(){return EdgeList}}),extend(SegmentIntersector$1.prototype,{processIntersections:function(t,e,n,i){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return SegmentIntersector$1}}),extend(IntersectionAdder.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this.li.getIntersectionNum()){if(IntersectionAdder.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.size()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},hasProperInteriorIntersection:function(){return this.hasProperInterior},getLineIntersector:function(){return this.li},hasProperIntersection:function(){return this.hasProper},processIntersections:function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&(this.numIntersections++,this.li.isInteriorIntersection()&&(this.numInteriorIntersections++,this.hasInterior=!0),this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,t.addIntersections(this.li,e,0),n.addIntersections(this.li,i,1),this.li.isProper()&&(this.numProperIntersections++,this.hasProper=!0,this.hasProperInterior=!0)))},hasIntersection:function(){return this._hasIntersection},isDone:function(){return!1},hasInteriorIntersection:function(){return this.hasInterior},interfaces_:function(){return[SegmentIntersector$1]},getClass:function(){return IntersectionAdder}}),IntersectionAdder.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},extend(BufferBuilder.prototype,{setWorkingPrecisionModel:function(t){this.workingPrecisionModel=t},insertUniqueEdge:function(t){var e=this.edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Label(t.getLabel()),i.flip()),n.merge(i);var r=BufferBuilder.depthDelta(i),o=e.getDepthDelta(),s=o+r;e.setDepthDelta(s)}else this.edgeList.add(t),t.setDepthDelta(BufferBuilder.depthDelta(t.getLabel()))},buildSubgraphs:function(t,e){for(var n=new ArrayList,i=t.iterator();i.hasNext();){var r=i.next(),o=r.getRightmostCoordinate(),s=new SubgraphDepthLocater(n),a=s.getDepth(o);r.computeDepth(a),r.findResultEdges(),n.add(r),e.add(r.getDirectedEdges(),r.getNodes())}},createSubgraphs:function(t){for(var e=new ArrayList,n=t.getNodes().iterator();n.hasNext();){var i=n.next();if(!i.isVisited()){var r=new BufferSubgraph;r.create(i),e.add(r)}}return Collections.sort(e,Collections.reverseOrder()),e},createEmptyResultGeometry:function(){var t=this.geomFact.createPolygon();return t},getNoder:function(t){if(null!==this.workingNoder)return this.workingNoder;var e=new MCIndexNoder,n=new RobustLineIntersector;return n.setPrecisionModel(t),e.setSegmentIntersector(new IntersectionAdder(n)),e},buffer:function(t,e){var n=this.workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this.geomFact=t.getFactory();var i=new OffsetCurveBuilder(n,this.bufParams),r=new OffsetCurveSetBuilder(t,e,i),o=r.getCurves();if(o.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(o,n),this.graph=new PlanarGraph(new OverlayNodeFactory),this.graph.addEdges(this.edgeList.getEdges());var s=this.createSubgraphs(this.graph),a=new PolygonBuilder(this.geomFact);this.buildSubgraphs(s,a);var l=a.getPolygons();if(l.size()<=0)return this.createEmptyResultGeometry();var u=this.geomFact.buildGeometry(l);return u},computeNodedEdges:function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var i=n.getNodedSubstrings(),r=i.iterator();r.hasNext();){var o=r.next(),s=o.getCoordinates();if(2!==s.length||!s[0].equals2D(s[1])){var a=o.getData(),l=new Edge(o.getCoordinates(),new Label(a));this.insertUniqueEdge(l)}}},setNoder:function(t){this.workingNoder=t},interfaces_:function(){return[]},getClass:function(){return BufferBuilder}}),BufferBuilder.depthDelta=function(t){var e=t.getLocation(0,Position.LEFT),n=t.getLocation(0,Position.RIGHT);return e===Location.INTERIOR&&n===Location.EXTERIOR?1:e===Location.EXTERIOR&&n===Location.INTERIOR?-1:0},BufferBuilder.convertSegStrings=function(t){for(var e=new GeometryFactory,n=new ArrayList;t.hasNext();){var i=t.next(),r=e.createLineString(i.getCoordinates());n.add(r)}return e.buildGeometry(n)},extend(NodingValidator.prototype,{checkEndPtVertexIntersections:function(){if(0===arguments.length)for(var t=this.segStrings.iterator();t.hasNext();){var e=t.next(),n=e.getCoordinates();this.checkEndPtVertexIntersections(n[0],this.segStrings),this.checkEndPtVertexIntersections(n[n.length-1],this.segStrings)}else if(2===arguments.length)for(var i=arguments[0],r=arguments[1],t=r.iterator();t.hasNext();)for(var e=t.next(),n=e.getCoordinates(),o=1;o<n.length-1;o++)if(n[o].equals(i))throw new RuntimeException("found endpt/interior pt intersection at index "+o+" :pt "+i)},checkInteriorIntersections:function(){if(0===arguments.length)for(var t=this.segStrings.iterator();t.hasNext();)for(var e=t.next(),n=this.segStrings.iterator();n.hasNext();){var i=n.next();this.checkInteriorIntersections(e,i)}else if(2===arguments.length)for(var r=arguments[0],o=arguments[1],s=r.getCoordinates(),a=o.getCoordinates(),l=0;l<s.length-1;l++)for(var u=0;u<a.length-1;u++)this.checkInteriorIntersections(r,l,o,u);else if(4===arguments.length){var c=arguments[0],h=arguments[1],d=arguments[2],g=arguments[3];if(c===d&&h===g)return null;var f=c.getCoordinates()[h],p=c.getCoordinates()[h+1],m=d.getCoordinates()[g],y=d.getCoordinates()[g+1];if(this.li.computeIntersection(f,p,m,y),this.li.hasIntersection()&&(this.li.isProper()||this.hasInteriorIntersection(this.li,f,p)||this.hasInteriorIntersection(this.li,m,y)))throw new RuntimeException("found non-noded intersection at "+f+"-"+p+" and "+m+"-"+y)}},checkValid:function(){this.checkEndPtVertexIntersections(),this.checkInteriorIntersections(),this.checkCollapses()},checkCollapses:function(){if(0===arguments.length)for(var t=this.segStrings.iterator();t.hasNext();){var e=t.next();this.checkCollapses(e)}else if(1===arguments.length)for(var n=arguments[0],i=n.getCoordinates(),t=0;t<i.length-2;t++)this.checkCollapse(i[t],i[t+1],i[t+2])},hasInteriorIntersection:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++){var r=t.getIntersection(i);if(!r.equals(e)&&!r.equals(n))return!0}return!1},checkCollapse:function(t,e,n){if(t.equals(n))throw new RuntimeException("found non-noded collapse at "+NodingValidator.fact.createLineString([t,e,n]))},interfaces_:function(){return[]},getClass:function(){return NodingValidator}}),NodingValidator.fact=new GeometryFactory,extend(HotPixel.prototype,{intersectsScaled:function(t,e){var n=Math.min(t.x,e.x),i=Math.max(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.y,e.y),s=this.maxx<n||this.minx>i||this.maxy<r||this.miny>o;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return Assert.isTrue(!(s&&a),"Found bad envelope test"),a},initCorners:function(t){var e=.5;this.minx=t.x-e,this.maxx=t.x+e,this.miny=t.y-e,this.maxy=t.y+e,this.corner[0]=new Coordinate(this.maxx,this.maxy),this.corner[1]=new Coordinate(this.minx,this.maxy),this.corner[2]=new Coordinate(this.minx,this.miny),this.corner[3]=new Coordinate(this.maxx,this.miny)},intersects:function(t,e){return 1===this.scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this.p0Scaled),this.copyScaled(e,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},scale:function(t){return Math.round(t*this.scaleFactor)},getCoordinate:function(){return this.originalPt},copyScaled:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},getSafeEnvelope:function(){if(null===this.safeEnv){var t=HotPixel.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new Envelope(this.originalPt.x-t,this.originalPt.x+t,this.originalPt.y-t,this.originalPt.y+t)}return this.safeEnv},intersectsPixelClosure:function(t,e){return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),this.li.hasIntersection()?!0:(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.hasIntersection()?!0:(this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.hasIntersection()?!0:(this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),!!this.li.hasIntersection())))},intersectsToleranceSquare:function(t,e){var n=!1,i=!1;return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),this.li.isProper()?!0:(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),this.li.isProper()?!0:(this.li.hasIntersection()&&(n=!0),this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),this.li.isProper()?!0:(this.li.hasIntersection()&&(i=!0),this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),this.li.isProper()?!0:n&&i?!0:t.equals(this.pt)?!0:!!e.equals(this.pt))))},addSnappedNode:function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return this.intersects(n,i)?(t.addIntersection(this.getCoordinate(),e),!0):!1},interfaces_:function(){return[]},getClass:function(){return HotPixel}}),HotPixel.SAFE_ENV_EXPANSION_FACTOR=.75,extend(MonotoneChainSelectAction.prototype,{select:function(){if(1===arguments.length){arguments[0]}else if(2===arguments.length){var t=arguments[0],e=arguments[1];t.getLineSegment(e,this.selectedSegment),this.select(this.selectedSegment)}},interfaces_:function(){return[]},getClass:function(){
return MonotoneChainSelectAction}}),extend(MCIndexPointSnapper.prototype,{snap:function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=t.getSafeEnvelope(),r=new HotPixelSnapAction(t,e,n);return this.index.query(i,{interfaces_:function(){return[ItemVisitor]},visitItem:function(t){var e=t;e.select(i,r)}}),r.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return MCIndexPointSnapper}}),inherits(HotPixelSnapAction,MonotoneChainSelectAction),extend(HotPixelSnapAction.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return MonotoneChainSelectAction.prototype.select.apply(this,arguments);var t=arguments[0],e=arguments[1],n=t.getContext();return null!==this.parentEdge&&n===this.parentEdge&&e===this.hotPixelVertexIndex?null:void(this._isNodeAdded=this.hotPixel.addSnappedNode(n,e))},interfaces_:function(){return[]},getClass:function(){return HotPixelSnapAction}}),MCIndexPointSnapper.HotPixelSnapAction=HotPixelSnapAction,extend(InteriorIntersectionFinderAdder.prototype,{processIntersections:function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this.li.computeIntersection(r,o,s,a),this.li.hasIntersection()&&this.li.isInteriorIntersection()){for(var l=0;l<this.li.getIntersectionNum();l++)this.interiorIntersections.add(this.li.getIntersection(l));t.addIntersections(this.li,e,0),n.addIntersections(this.li,i,1)}},isDone:function(){return!1},getInteriorIntersections:function(){return this.interiorIntersections},interfaces_:function(){return[SegmentIntersector$1]},getClass:function(){return InteriorIntersectionFinderAdder}}),extend(MCIndexSnapRounder.prototype,{checkCorrectness:function(t){var e=NodedSegmentString.getNodedSubstrings(t),n=new NodingValidator(e);try{n.checkValid()}catch(t){if(!(t instanceof Exception))throw t;t.printStackTrace()}finally{}},getNodedSubstrings:function(){return NodedSegmentString.getNodedSubstrings(this.nodedSegStrings)},snapRound:function(t,e){var n=this.findInteriorIntersections(t,e);this.computeIntersectionSnaps(n),this.computeVertexSnaps(t)},findInteriorIntersections:function(t,e){var n=new InteriorIntersectionFinderAdder(e);return this.noder.setSegmentIntersector(n),this.noder.computeNodes(t),n.getInteriorIntersections()},computeVertexSnaps:function(){if(hasInterface(arguments[0],Collection))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.computeVertexSnaps(n)}else if(arguments[0]instanceof NodedSegmentString)for(var i=arguments[0],r=i.getCoordinates(),o=0;o<r.length;o++){var s=new HotPixel(r[o],this.scaleFactor,this.li),a=this.pointSnapper.snap(s,i,o);a&&i.addIntersection(r[o],o)}},computeNodes:function(t){this.nodedSegStrings=t,this.noder=new MCIndexNoder,this.pointSnapper=new MCIndexPointSnapper(this.noder.getIndex()),this.snapRound(t,this.li)},computeIntersectionSnaps:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=new HotPixel(n,this.scaleFactor,this.li);this.pointSnapper.snap(i)}},interfaces_:function(){return[Noder]},getClass:function(){return MCIndexSnapRounder}}),extend(BufferOp.prototype,{bufferFixedPrecision:function(t){var e=new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1)),t.getScale()),n=new BufferBuilder(this.bufParams);n.setWorkingPrecisionModel(t),n.setNoder(e),this.resultGeometry=n.buffer(this.argGeom,this.distance)},bufferReducedPrecision:function(){if(0===arguments.length){for(var t=BufferOp.MAX_PRECISION_DIGITS;t>=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof TopologyException))throw t;this.saveException=t}finally{}if(null!==this.resultGeometry)return null}throw this.saveException}if(1===arguments.length){var e=arguments[0],n=BufferOp.precisionScaleFactor(this.argGeom,this.distance,e),i=new PrecisionModel(n);this.bufferFixedPrecision(i)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this.resultGeometry)return null;var t=this.argGeom.getFactory().getPrecisionModel();t.getType()===PrecisionModel.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},setQuadrantSegments:function(t){this.bufParams.setQuadrantSegments(t)},bufferOriginalPrecision:function(){try{var t=new BufferBuilder(this.bufParams);this.resultGeometry=t.buffer(this.argGeom,this.distance)}catch(t){if(!(t instanceof RuntimeException))throw t;this.saveException=t}finally{}},getResultGeometry:function(t){return this.distance=t,this.computeGeometry(),this.resultGeometry},setEndCapStyle:function(t){this.bufParams.setEndCapStyle(t)},interfaces_:function(){return[]},getClass:function(){return BufferOp}}),BufferOp.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new BufferOp(t),i=n.getResultGeometry(e);return i}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Geometry&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],r=arguments[2],o=new BufferOp(t);o.setQuadrantSegments(r);var i=o.getResultGeometry(e);return i}if(arguments[2]instanceof BufferParameters&&arguments[0]instanceof Geometry&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],s=arguments[2],o=new BufferOp(t,s),i=o.getResultGeometry(e);return i}}else if(4===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2],a=arguments[3],o=new BufferOp(t);o.setQuadrantSegments(r),o.setEndCapStyle(a);var i=o.getResultGeometry(e);return i}},BufferOp.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=MathUtil.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),o=e>0?e:0,s=r+2*o,a=Math.trunc(Math.log(s)/Math.log(10)+1),l=n-a,u=Math.pow(10,l);return u},BufferOp.CAP_ROUND=BufferParameters.CAP_ROUND,BufferOp.CAP_BUTT=BufferParameters.CAP_FLAT,BufferOp.CAP_FLAT=BufferParameters.CAP_FLAT,BufferOp.CAP_SQUARE=BufferParameters.CAP_SQUARE,BufferOp.MAX_PRECISION_DIGITS=12,extend(PolygonExtracter.prototype,{filter:function(t){t instanceof Polygon&&this.comps.add(t)},interfaces_:function(){return[GeometryFilter]},getClass:function(){return PolygonExtracter}}),PolygonExtracter.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return PolygonExtracter.getPolygons(t,new ArrayList)}if(2===arguments.length){var t=arguments[0],e=arguments[1];return t instanceof Polygon?e.add(t):t instanceof GeometryCollection&&t.apply(new PolygonExtracter(e)),e}},extend(GeometryLocation.prototype,{isInsideArea:function(){return this.segIndex===GeometryLocation.INSIDE_AREA},getCoordinate:function(){return this.pt},getGeometryComponent:function(){return this.component},getSegmentIndex:function(){return this.segIndex},interfaces_:function(){return[]},getClass:function(){return GeometryLocation}}),GeometryLocation.INSIDE_AREA=-1,extend(PointExtracter.prototype,{filter:function(t){t instanceof Point&&this.pts.add(t)},interfaces_:function(){return[GeometryFilter]},getClass:function(){return PointExtracter}}),PointExtracter.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Point?Collections.singletonList(t):PointExtracter.getPoints(t,new ArrayList)}if(2===arguments.length){var t=arguments[0],e=arguments[1];return t instanceof Point?e.add(t):t instanceof GeometryCollection&&t.apply(new PointExtracter(e)),e}},extend(ConnectedElementLocationFilter.prototype,{filter:function(t){(t instanceof Point||t instanceof LineString||t instanceof Polygon)&&this.locations.add(new GeometryLocation(t,0,t.getCoordinate()))},interfaces_:function(){return[GeometryFilter]},getClass:function(){return ConnectedElementLocationFilter}}),ConnectedElementLocationFilter.getLocations=function(t){var e=new ArrayList;return t.apply(new ConnectedElementLocationFilter(e)),e},extend(DistanceOp.prototype,{computeContainmentDistance:function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this.minDistance<=this.terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=1-e,r=PolygonExtracter.getPolygons(this.geom[e]);if(r.size()>0){var o=ConnectedElementLocationFilter.getLocations(this.geom[i]);if(this.computeContainmentDistance(o,r,n),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[i]=n[0],this.minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&hasInterface(arguments[0],List)&&hasInterface(arguments[1],List)){for(var s=arguments[0],a=arguments[1],l=arguments[2],u=0;u<s.size();u++)for(var c=s.get(u),h=0;h<a.size();h++)if(this.computeContainmentDistance(c,a.get(h),l),this.minDistance<=this.terminateDistance)return null}else if(arguments[2]instanceof Array&&arguments[0]instanceof GeometryLocation&&arguments[1]instanceof Polygon){var d=arguments[0],g=arguments[1],f=arguments[2],p=d.getCoordinate();if(Location.EXTERIOR!==this.ptLocator.locate(p,g))return this.minDistance=0,f[0]=d,f[1]=new GeometryLocation(g,p),null}},computeMinDistanceLinesPoints:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this.minDistance<=this.terminateDistance)return null}},computeFacetDistance:function(){var t=new Array(2).fill(null),e=LinearComponentExtracter.getLines(this.geom[0]),n=LinearComponentExtracter.getLines(this.geom[1]),i=PointExtracter.getPoints(this.geom[0]),r=PointExtracter.getPoints(this.geom[1]);return this.computeMinDistanceLines(e,n,t),this.updateMinDistance(t,!1),this.minDistance<=this.terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(e,r,t),this.updateMinDistance(t,!1),this.minDistance<=this.terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistanceLinesPoints(n,i,t),this.updateMinDistance(t,!0),this.minDistance<=this.terminateDistance?null:(t[0]=null,t[1]=null,this.computeMinDistancePoints(i,r,t),void this.updateMinDistance(t,!1))))},nearestLocations:function(){return this.computeMinDistance(),this.minDistanceLocation},updateMinDistance:function(t,e){return null===t[0]?null:void(e?(this.minDistanceLocation[0]=t[1],this.minDistanceLocation[1]=t[0]):(this.minDistanceLocation[0]=t[0],this.minDistanceLocation[1]=t[1]))},nearestPoints:function(){this.computeMinDistance();var t=[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()];return t},computeMinDistance:function(){if(0===arguments.length){if(null!==this.minDistanceLocation)return null;if(this.minDistanceLocation=new Array(2).fill(null),this.computeContainmentDistance(),this.minDistance<=this.terminateDistance)return null;this.computeFacetDistance()}else if(3===arguments.length)if(arguments[2]instanceof Array&&arguments[0]instanceof LineString&&arguments[1]instanceof Point){var t=arguments[0],e=arguments[1],n=arguments[2];if(t.getEnvelopeInternal().distance(e.getEnvelopeInternal())>this.minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),o=0;o<i.length-1;o++){var s=CGAlgorithms.distancePointLine(r,i[o],i[o+1]);if(s<this.minDistance){this.minDistance=s;var a=new LineSegment(i[o],i[o+1]),l=a.closestPoint(r);n[0]=new GeometryLocation(t,o,l),n[1]=new GeometryLocation(e,0,r)}if(this.minDistance<=this.terminateDistance)return null}}else if(arguments[2]instanceof Array&&arguments[0]instanceof LineString&&arguments[1]instanceof LineString){var u=arguments[0],c=arguments[1],n=arguments[2];if(u.getEnvelopeInternal().distance(c.getEnvelopeInternal())>this.minDistance)return null;for(var i=u.getCoordinates(),h=c.getCoordinates(),o=0;o<i.length-1;o++)for(var d=0;d<h.length-1;d++){var s=CGAlgorithms.distanceLineLine(i[o],i[o+1],h[d],h[d+1]);if(s<this.minDistance){this.minDistance=s;var g=new LineSegment(i[o],i[o+1]),f=new LineSegment(h[d],h[d+1]),p=g.closestPoints(f);n[0]=new GeometryLocation(u,o,p[0]),n[1]=new GeometryLocation(c,d,p[1])}if(this.minDistance<=this.terminateDistance)return null}}},computeMinDistancePoints:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o),a=r.getCoordinate().distance(s.getCoordinate());if(a<this.minDistance&&(this.minDistance=a,n[0]=new GeometryLocation(r,0,r.getCoordinate()),n[1]=new GeometryLocation(s,0,s.getCoordinate())),this.minDistance<=this.terminateDistance)return null}},distance:function(){if(null===this.geom[0]||null===this.geom[1])throw new IllegalArgumentException("null geometries are not supported");return this.geom[0].isEmpty()||this.geom[1].isEmpty()?0:(this.computeMinDistance(),this.minDistance)},computeMinDistanceLines:function(t,e,n){for(var i=0;i<t.size();i++)for(var r=t.get(i),o=0;o<e.size();o++){var s=e.get(o);if(this.computeMinDistance(r,s,n),this.minDistance<=this.terminateDistance)return null}},interfaces_:function(){return[]},getClass:function(){return DistanceOp}}),DistanceOp.distance=function(t,e){var n=new DistanceOp(t,e);return n.distance()},DistanceOp.isWithinDistance=function(t,e,n){var i=new DistanceOp(t,e,n);return i.distance()<=n},DistanceOp.nearestPoints=function(t,e){var n=new DistanceOp(t,e);return n.nearestPoints()},extend(EdgeString.prototype,{getCoordinates:function(){if(null===this.coordinates){for(var t=0,e=0,n=new CoordinateList,i=this.directedEdges.iterator();i.hasNext();){var r=i.next();r.getEdgeDirection()?t++:e++,n.add(r.getEdge().getLine().getCoordinates(),!1,r.getEdgeDirection())}this.coordinates=n.toCoordinateArray(),e>t&&CoordinateArrays.reverse(this.coordinates)}return this.coordinates},toLineString:function(){return this.factory.createLineString(this.getCoordinates())},add:function(t){this.directedEdges.add(t)},interfaces_:function(){return[]},getClass:function(){return EdgeString}}),extend(GraphComponent$1.prototype,{setVisited:function(t){this._isVisited=t},isMarked:function(){return this._isMarked},setData:function(t){this.data=t},getData:function(){return this.data},setMarked:function(t){this._isMarked=t},getContext:function(){return this.data},isVisited:function(){return this._isVisited},setContext:function(t){this.data=t},interfaces_:function(){return[]},getClass:function(){return GraphComponent$1}}),GraphComponent$1.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if(n.isVisited()===e)return n}return null},GraphComponent$1.setVisited=function(t,e){for(;t.hasNext();){var n=t.next();n.setVisited(e)}},GraphComponent$1.setMarked=function(t,e){for(;t.hasNext();){var n=t.next();n.setMarked(e)}},inherits(DirectedEdge$1,GraphComponent$1),extend(DirectedEdge$1.prototype,{isRemoved:function(){return null===this.parentEdge},compareDirection:function(t){return this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:CGAlgorithms.computeOrientation(t.p0,t.p1,this.p1)},getCoordinate:function(){return this.from.getCoordinate()},print:function(t){var e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);t.print(" "+i+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+this.angle)},getDirectionPt:function(){return this.p1},getAngle:function(){return this.angle},compareTo:function(t){var e=t;return this.compareDirection(e)},getFromNode:function(){return this.from},getSym:function(){return this.sym},setEdge:function(t){this.parentEdge=t},remove:function(){this.sym=null,this.parentEdge=null},getEdge:function(){return this.parentEdge},getQuadrant:function(){return this.quadrant},setSym:function(t){this.sym=t},getToNode:function(){return this.to},getEdgeDirection:function(){return this.edgeDirection},interfaces_:function(){return[Comparable]},getClass:function(){return DirectedEdge$1}}),DirectedEdge$1.toEdges=function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();)e.add(n.next().parentEdge);return e},inherits(LineMergeDirectedEdge,DirectedEdge$1),extend(LineMergeDirectedEdge.prototype,{getNext:function(){return 2!==this.getToNode().getDegree()?null:this.getToNode().getOutEdges().getEdges().get(0)===this.getSym()?this.getToNode().getOutEdges().getEdges().get(1):(Assert.isTrue(this.getToNode().getOutEdges().getEdges().get(1)===this.getSym()),this.getToNode().getOutEdges().getEdges().get(0))},interfaces_:function(){return[]},getClass:function(){return LineMergeDirectedEdge}}),inherits(Edge$1,GraphComponent$1),extend(Edge$1.prototype,{isRemoved:function(){return null===this.dirEdge},setDirectedEdges:function(t,e){this.dirEdge=[t,e],t.setEdge(this),e.setEdge(this),t.setSym(e),e.setSym(t),t.getFromNode().addOutEdge(t),e.getFromNode().addOutEdge(e)},getDirEdge:function(){if(Number.isInteger(arguments[0])){var t=arguments[0];return this.dirEdge[t]}if(arguments[0]instanceof Node$2){var e=arguments[0];return this.dirEdge[0].getFromNode()===e?this.dirEdge[0]:this.dirEdge[1].getFromNode()===e?this.dirEdge[1]:null}},remove:function(){this.dirEdge=null},getOppositeNode:function(t){return this.dirEdge[0].getFromNode()===t?this.dirEdge[0].getToNode():this.dirEdge[1].getFromNode()===t?this.dirEdge[1].getToNode():null},interfaces_:function(){return[]},getClass:function(){return Edge$1}}),extend(DirectedEdgeStar$1.prototype,{getNextEdge:function(t){var e=this.getIndex(t);return this.outEdges.get(this.getIndex(e+1))},getCoordinate:function(){var t=this.iterator();if(!t.hasNext())return null;var e=t.next();return e.getCoordinate()},iterator:function(){return this.sortEdges(),this.outEdges.iterator()},sortEdges:function(){this.sorted||(Collections.sort(this.outEdges),this.sorted=!0)},remove:function(t){this.outEdges.remove(t)},getEdges:function(){return this.sortEdges(),this.outEdges},getNextCWEdge:function(t){var e=this.getIndex(t);return this.outEdges.get(this.getIndex(e-1))},getIndex:function(){if(arguments[0]instanceof Edge$1){var t=arguments[0];this.sortEdges();for(var e=0;e<this.outEdges.size();e++){var n=this.outEdges.get(e);if(n.getEdge()===t)return e}return-1}if(arguments[0]instanceof DirectedEdge$1){var i=arguments[0];this.sortEdges();for(var e=0;e<this.outEdges.size();e++){var n=this.outEdges.get(e);if(n===i)return e}return-1}if(Number.isInteger(arguments[0])){var r=arguments[0],o=r%this.outEdges.size();return 0>o&&(o+=this.outEdges.size()),o}},add:function(t){this.outEdges.add(t),this.sorted=!1},getDegree:function(){return this.outEdges.size()},interfaces_:function(){return[]},getClass:function(){return DirectedEdgeStar$1}}),inherits(Node$2,GraphComponent$1),extend(Node$2.prototype,{isRemoved:function(){return null===this.pt},addOutEdge:function(t){this.deStar.add(t)},getCoordinate:function(){return this.pt},getOutEdges:function(){return this.deStar},remove:function(){if(0===arguments.length)this.pt=null;else if(1===arguments.length){var t=arguments[0];this.deStar.remove(t)}},getIndex:function(t){return this.deStar.getIndex(t)},getDegree:function(){return this.deStar.getDegree()},interfaces_:function(){return[]},getClass:function(){return Node$2}}),Node$2.getEdgesBetween=function(t,e){var n=DirectedEdge$1.toEdges(t.getOutEdges().getEdges()),i=new HashSet(n),r=DirectedEdge$1.toEdges(e.getOutEdges().getEdges());return i.retainAll(r),i},inherits(LineMergeEdge,Edge$1),extend(LineMergeEdge.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return LineMergeEdge}}),extend(NodeMap$1.prototype,{find:function(t){return this.nodeMap.get(t)},iterator:function(){return this.nodeMap.values().iterator()},remove:function(t){return this.nodeMap.remove(t)},values:function(){return this.nodeMap.values()},add:function(t){return this.nodeMap.put(t.getCoordinate(),t),t},interfaces_:function(){return[]},getClass:function(){return NodeMap$1}}),extend(PlanarGraph$1.prototype,{findNodesOfDegree:function(t){for(var e=new ArrayList,n=this.nodeIterator();n.hasNext();){var i=n.next();i.getDegree()===t&&e.add(i)}return e},dirEdgeIterator:function(){return this.dirEdges.iterator()},edgeIterator:function(){return this.edges.iterator()},remove:function(){if(arguments[0]instanceof Edge$1){var t=arguments[0];this.remove(t.getDirEdge(0)),this.remove(t.getDirEdge(1)),this.edges.remove(t),t.remove()}else if(arguments[0]instanceof DirectedEdge$1){var e=arguments[0],n=e.getSym();null!==n&&n.setSym(null),e.getFromNode().remove(e),e.remove(),this.dirEdges.remove(e)}else if(arguments[0]instanceof Node$2){for(var i=arguments[0],r=i.getOutEdges().getEdges(),o=r.iterator();o.hasNext();){var s=o.next(),n=s.getSym();null!==n&&this.remove(n),this.dirEdges.remove(s);var a=s.getEdge();null!==a&&this.edges.remove(a)}this.nodeMap.remove(i.getCoordinate()),i.remove()}},findNode:function(t){return this.nodeMap.find(t)},getEdges:function(){return this.edges},nodeIterator:function(){return this.nodeMap.iterator()},contains:function(){if(arguments[0]instanceof Edge$1){var t=arguments[0];return this.edges.contains(t)}if(arguments[0]instanceof DirectedEdge$1){var e=arguments[0];return this.dirEdges.contains(e)}},add:function(){if(arguments[0]instanceof Node$2){var t=arguments[0];this.nodeMap.add(t)}else if(arguments[0]instanceof Edge$1){var e=arguments[0];this.edges.add(e),this.add(e.getDirEdge(0)),this.add(e.getDirEdge(1))}else if(arguments[0]instanceof DirectedEdge$1){var n=arguments[0];this.dirEdges.add(n)}},getNodes:function(){return this.nodeMap.values()},interfaces_:function(){return[]},getClass:function(){return PlanarGraph$1}}),inherits(LineMergeGraph,PlanarGraph$1),extend(LineMergeGraph.prototype,{addEdge:function(t){if(t.isEmpty())return null;var e=CoordinateArrays.removeRepeatedPoints(t.getCoordinates());if(e.length<=1)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),o=this.getNode(i),s=new LineMergeDirectedEdge(r,o,e[1],!0),a=new LineMergeDirectedEdge(o,r,e[e.length-2],!1),l=new LineMergeEdge(t);l.setDirectedEdges(s,a),this.add(l)},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new Node$2(t),this.add(e)),e},interfaces_:function(){return[]},getClass:function(){return LineMergeGraph}}),extend(LineMerger.prototype,{buildEdgeStringsForUnprocessedNodes:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();e.isMarked()||(Assert.isTrue(2===e.getDegree()),this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}},buildEdgeStringsForNonDegree2Nodes:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();2!==e.getDegree()&&(this.buildEdgeStringsStartingAt(e),e.setMarked(!0))}},buildEdgeStringsForObviousStartNodes:function(){this.buildEdgeStringsForNonDegree2Nodes()},getMergedLineStrings:function(){return this.merge(),this.mergedLineStrings},buildEdgeStringsStartingAt:function(t){for(var e=t.getOutEdges().iterator();e.hasNext();){var n=e.next();n.getEdge().isMarked()||this.edgeStrings.add(this.buildEdgeStringStartingWith(n))}},merge:function(){if(null!==this.mergedLineStrings)return null;GraphComponent$1.setMarked(this.graph.nodeIterator(),!1),GraphComponent$1.setMarked(this.graph.edgeIterator(),!1),this.edgeStrings=new ArrayList,this.buildEdgeStringsForObviousStartNodes(),this.buildEdgeStringsForIsolatedLoops(),this.mergedLineStrings=new ArrayList;for(var t=this.edgeStrings.iterator();t.hasNext();){var e=t.next();this.mergedLineStrings.add(e.toLineString())}},buildEdgeStringStartingWith:function(t){var e=new EdgeString(this.factory),n=t;do e.add(n),n.getEdge().setMarked(!0),n=n.getNext();while(null!==n&&n!==t);return e},add:function(){if(arguments[0]instanceof Geometry){var t=arguments[0];t.apply({interfaces_:function(){return[GeometryComponentFilter$1]},filter:function(t){t instanceof LineString&&this.add(t)}})}else if(hasInterface(arguments[0],Collection)){var e=arguments[0];this.mergedLineStrings=null;for(var n=e.iterator();n.hasNext();){var i=n.next();this.add(i)}}else if(arguments[0]instanceof LineString){var r=arguments[0];null===this.factory&&(this.factory=r.getFactory()),this.graph.addEdge(r)}},buildEdgeStringsForIsolatedLoops:function(){this.buildEdgeStringsForUnprocessedNodes()},interfaces_:function(){return[]},getClass:function(){return LineMerger}}),extend(BasicSegmentString.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(t){return this.pts[t]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(t){return t===this.pts.length-1?-1:Octant.octant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this.data=t},getData:function(){return this.data},toString:function(){return WKTWriter.toLineString(new CoordinateArraySequence(this.pts))},interfaces_:function(){return[SegmentString]},getClass:function(){return BasicSegmentString}}),extend(InteriorIntersectionFinder.prototype,{getInteriorIntersection:function(){return this.interiorIntersection},setCheckEndSegmentsOnly:function(t){this.isCheckEndSegmentsOnly=t},getIntersectionSegments:function(){return this.intSegments},count:function(){return this.intersectionCount},getIntersections:function(){return this.intersections},setFindAllIntersections:function(t){this.findAllIntersections=t},setKeepIntersections:function(t){this.keepIntersections=t},processIntersections:function(t,e,n,i){if(!this.findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===i)return null;if(this.isCheckEndSegmentsOnly){var r=this.isEndSegment(t,e)||this.isEndSegment(n,i);if(!r)return null}var o=t.getCoordinates()[e],s=t.getCoordinates()[e+1],a=n.getCoordinates()[i],l=n.getCoordinates()[i+1];this.li.computeIntersection(o,s,a,l),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=new Array(4).fill(null),this.intSegments[0]=o,this.intSegments[1]=s,this.intSegments[2]=a,this.intSegments[3]=l,this.interiorIntersection=this.li.getIntersection(0),this.keepIntersections&&this.intersections.add(this.interiorIntersection),this.intersectionCount++)},isEndSegment:function(t,e){return 0===e?!0:e>=t.size()-2},hasIntersection:function(){return null!==this.interiorIntersection},isDone:function(){return this.findAllIntersections?!1:null!==this.interiorIntersection},interfaces_:function(){return[SegmentIntersector$1]},getClass:function(){return InteriorIntersectionFinder}}),InteriorIntersectionFinder.createAllIntersectionsFinder=function(t){var e=new InteriorIntersectionFinder(t);return e.setFindAllIntersections(!0),e},InteriorIntersectionFinder.createAnyIntersectionFinder=function(t){return new InteriorIntersectionFinder(t)},InteriorIntersectionFinder.createIntersectionCounter=function(t){var e=new InteriorIntersectionFinder(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},extend(FastNodingValidator.prototype,{execute:function(){return null!==this.segInt?null:void this.checkInteriorIntersections()},getIntersections:function(){return this.segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(t){this.findAllIntersections=t},checkInteriorIntersections:function(){this._isValid=!0,this.segInt=new InteriorIntersectionFinder(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var t=new MCIndexNoder;return t.setSegmentIntersector(this.segInt),t.computeNodes(this.segStrings),this.segInt.hasIntersection()?(this._isValid=!1,null):void 0},checkValid:function(){if(this.execute(),!this._isValid)throw new TopologyException(this.getErrorMessage(),this.segInt.getInteriorIntersection())},getErrorMessage:function(){if(this._isValid)return"no intersections found";var t=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+WKTWriter.toLineString(t[0],t[1])+" and "+WKTWriter.toLineString(t[2],t[3])},interfaces_:function(){return[]},getClass:function(){return FastNodingValidator}}),FastNodingValidator.computeIntersections=function(t){var e=new FastNodingValidator(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},extend(EdgeNodingValidator.prototype,{checkValid:function(){this.nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return EdgeNodingValidator}}),EdgeNodingValidator.toSegmentStrings=function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next();e.add(new BasicSegmentString(i.getCoordinates(),i))}return e},EdgeNodingValidator.checkValid=function(t){var e=new EdgeNodingValidator(t);e.checkValid()},extend(LineBuilder.prototype,{collectLines:function(t){for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this.lineEdgesList),this.collectBoundaryTouchEdge(n,t,this.lineEdgesList)}},labelIsolatedLine:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.op.getArgGeometry(e));t.getLabel().setLocation(e,n)},build:function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this.resultLineList},collectLineEdge:function(t,e,n){var i=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!OverlayOp.isResultOfOp(i,e)||r.isCovered()||(n.add(r),t.setVisitedEdge(!0)))},findCoveredLineEdges:function(){for(var t=this.op.getGraph().getNodes().iterator();t.hasNext();){var e=t.next();e.getEdges().findCoveredLineEdges()}for(var n=this.op.getGraph().getEdgeEnds().iterator();n.hasNext();){var i=n.next(),r=i.getEdge();if(i.isLineEdge()&&!r.isCoveredSet()){var o=this.op.isCoveredByA(i.getCoordinate());r.setCovered(o)}}},labelIsolatedLines:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},buildLines:function(t){for(var e=this.lineEdgesList.iterator();e.hasNext();){var n=e.next(),i=(n.getLabel(),this.geometryFactory.createLineString(n.getCoordinates()));this.resultLineList.add(i),n.setInResult(!0)}},collectBoundaryTouchEdge:function(t,e,n){var i=t.getLabel();return t.isLineEdge()?null:t.isVisited()?null:t.isInteriorAreaEdge()?null:t.getEdge().isInResult()?null:(Assert.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void(OverlayOp.isResultOfOp(i,e)&&e===OverlayOp.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return LineBuilder}}),extend(PointBuilder.prototype,{filterCoveredNodeToPoint:function(t){var e=t.getCoordinate();if(!this.op.isCoveredByLA(e)){var n=this.geometryFactory.createPoint(e);this.resultPointList.add(n)}},extractNonCoveredResultNodes:function(t){for(var e=this.op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==OverlayOp.INTERSECTION)){var i=n.getLabel();OverlayOp.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},build:function(t){return this.extractNonCoveredResultNodes(t),this.resultPointList},interfaces_:function(){return[]},getClass:function(){return PointBuilder}}),extend(GeometryGraphOperation.prototype,{getArgGeometry:function(t){return this.arg[t].getGeometry()},setComputationPrecision:function(t){this.resultPrecisionModel=t,this.li.setPrecisionModel(this.resultPrecisionModel)},interfaces_:function(){return[]},getClass:function(){return GeometryGraphOperation}}),inherits(OverlayOp,GeometryGraphOperation),extend(OverlayOp.prototype,{insertUniqueEdge:function(t){var e=this.edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new Label(t.getLabel()),i.flip());var r=e.getDepth();r.isNull()&&r.add(n),r.add(i),n.merge(i)}else this.edgeList.add(t)},getGraph:function(){return this.graph},cancelDuplicateResultEdges:function(){for(var t=this.graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},isCoveredByLA:function(t){return this.isCovered(t,this.resultLineList)?!0:!!this.isCovered(t,this.resultPolyList)},computeGeometry:function(t,e,n,i){var r=new ArrayList;return r.addAll(t),r.addAll(e),r.addAll(n),r.isEmpty()?OverlayOp.createEmptyResult(i,this.arg[0].getGeometry(),this.arg[1].getGeometry(),this.geomFact):this.geomFact.buildGeometry(r)},mergeSymLabels:function(){
for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();e.getEdges().mergeSymLabels()}},isCovered:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),r=this.ptLocator.locate(t,i);if(r!==Location.EXTERIOR)return!0}return!1},replaceCollapsedEdges:function(){for(var t=new ArrayList,e=this.edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this.edgeList.addAll(t)},updateNodeLabelling:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},getResultGeometry:function(t){return this.computeOverlay(t),this.resultGeom},insertUniqueEdges:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},computeOverlay:function(t){this.copyPoints(0),this.copyPoints(1),this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1),this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!0);var e=new ArrayList;this.arg[0].computeSplitEdges(e),this.arg[1].computeSplitEdges(e);this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),EdgeNodingValidator.checkValid(this.edgeList.getEdges()),this.graph.addEdges(this.edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new PolygonBuilder(this.geomFact);n.add(this.graph),this.resultPolyList=n.getPolygons();var i=new LineBuilder(this,this.geomFact,this.ptLocator);this.resultLineList=i.build(t);var r=new PointBuilder(this,this.geomFact,this.ptLocator);this.resultPointList=r.build(t),this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,t)},labelIncompleteNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setLocation(e,n)},copyPoints:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next(),i=this.graph.addNode(n.getCoordinate());i.setLabel(t,n.getLabel().getLocation(t))}},findResultAreaEdges:function(t){for(var e=this.graph.getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getLabel();i.isArea()&&!n.isInteriorAreaEdge()&&OverlayOp.isResultOfOp(i.getLocation(0,Position.RIGHT),i.getLocation(1,Position.RIGHT),t)&&n.setInResult(!0)}},computeLabelsFromDepths:function(){for(var t=this.edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),i=e.getDepth();if(!i.isNull()){i.normalize();for(var r=0;2>r;r++)n.isNull(r)||!n.isArea()||i.isNull(r)||(0===i.getDelta(r)?n.toLine(r):(Assert.isTrue(!i.isNull(r,Position.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(r,Position.LEFT,i.getLocation(r,Position.LEFT)),Assert.isTrue(!i.isNull(r,Position.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(r,Position.RIGHT,i.getLocation(r,Position.RIGHT))))}}},computeLabelling:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next();e.getEdges().computeLabelling(this.arg)}this.mergeSymLabels(),this.updateNodeLabelling()},labelIncompleteNodes:function(){for(var t=0,e=this.graph.getNodes().iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(t++,i.isNull(0)?this.labelIncompleteNode(n,0):this.labelIncompleteNode(n,1)),n.getEdges().updateLabelling(i)}},isCoveredByA:function(t){return!!this.isCovered(t,this.resultPolyList)},interfaces_:function(){return[]},getClass:function(){return OverlayOp}}),OverlayOp.overlayOp=function(t,e,n){var i=new OverlayOp(t,e),r=i.getResultGeometry(n);return r},OverlayOp.isResultOfOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.getLocation(0),i=t.getLocation(1);return OverlayOp.isResultOfOp(n,i,e)}if(3===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2];switch(r===Location.BOUNDARY&&(r=Location.INTERIOR),o===Location.BOUNDARY&&(o=Location.INTERIOR),s){case OverlayOp.INTERSECTION:return r===Location.INTERIOR&&o===Location.INTERIOR;case OverlayOp.UNION:return r===Location.INTERIOR||o===Location.INTERIOR;case OverlayOp.DIFFERENCE:return r===Location.INTERIOR&&o!==Location.INTERIOR;case OverlayOp.SYMDIFFERENCE:return r===Location.INTERIOR&&o!==Location.INTERIOR||r!==Location.INTERIOR&&o===Location.INTERIOR}return!1}},OverlayOp.createEmptyResult=function(t,e,n,i){var r=null;switch(OverlayOp.resultDimension(t,e,n)){case-1:r=i.createGeometryCollection(new Array(0).fill(null));break;case 0:r=i.createPoint();break;case 1:r=i.createLineString();break;case 2:r=i.createPolygon()}return r},OverlayOp.resultDimension=function(t,e,n){var i=e.getDimension(),r=n.getDimension(),o=-1;switch(t){case OverlayOp.INTERSECTION:o=Math.min(i,r);break;case OverlayOp.UNION:o=Math.max(i,r);break;case OverlayOp.DIFFERENCE:o=i;break;case OverlayOp.SYMDIFFERENCE:o=Math.max(i,r)}return o},OverlayOp.INTERSECTION=1,OverlayOp.UNION=2,OverlayOp.DIFFERENCE=3,OverlayOp.SYMDIFFERENCE=4,inherits(PolygonizeDirectedEdge,DirectedEdge$1),extend(PolygonizeDirectedEdge.prototype,{getNext:function(){return this.next},isInRing:function(){return null!==this.edgeRing},setRing:function(t){this.edgeRing=t},setLabel:function(t){this.label=t},getLabel:function(){return this.label},setNext:function(t){this.next=t},getRing:function(){return this.edgeRing},interfaces_:function(){return[]},getClass:function(){return PolygonizeDirectedEdge}}),inherits(PolygonizeEdge,Edge$1),extend(PolygonizeEdge.prototype,{getLine:function(){return this.line},interfaces_:function(){return[]},getClass:function(){return PolygonizeEdge}}),extend(EdgeRing$1.prototype,{isIncluded:function(){return this._isIncluded},getCoordinates:function(){if(null===this.ringPts){for(var t=new CoordinateList,e=this.deList.iterator();e.hasNext();){var n=e.next(),i=n.getEdge();EdgeRing$1.addEdge(i.getLine().getCoordinates(),n.getEdgeDirection(),t)}this.ringPts=t.toCoordinateArray()}return this.ringPts},isIncludedSet:function(){return this._isIncludedSet},isValid:function(){return this.getCoordinates(),this.ringPts.length<=3?!1:(this.getRing(),this.ring.isValid())},build:function(t){var e=t;do this.add(e),e.setRing(this),e=e.getNext(),Assert.isTrue(null!==e,"found null DE in ring"),Assert.isTrue(e===t||!e.isInRing(),"found DE already in ring");while(e!==t)},isOuterHole:function(){return this._isHole?!this.hasShell():!1},getPolygon:function(){var t=null;if(null!==this.holes){t=new Array(this.holes.size()).fill(null);for(var e=0;e<this.holes.size();e++)t[e]=this.holes.get(e)}var n=this.factory.createPolygon(this.ring,t);return n},isHole:function(){return this._isHole},isProcessed:function(){return this._isProcessed},addHole:function(){if(arguments[0]instanceof LinearRing){var t=arguments[0];null===this.holes&&(this.holes=new ArrayList),this.holes.add(t)}else if(arguments[0]instanceof EdgeRing$1){var e=arguments[0];e.setShell(this);var n=e.getRing();null===this.holes&&(this.holes=new ArrayList),this.holes.add(n)}},setIncluded:function(t){this._isIncluded=t,this._isIncludedSet=!0},getOuterHole:function(){if(this.isHole())return null;for(var t=0;t<this.deList.size();t++){var e=this.deList.get(t),n=e.getSym().getRing();if(n.isOuterHole())return n}return null},computeHole:function(){var t=this.getRing();this._isHole=CGAlgorithms.isCCW(t.getCoordinates())},hasShell:function(){return null!==this.shell},isOuterShell:function(){return null!==this.getOuterHole()},getLineString:function(){return this.getCoordinates(),this.factory.createLineString(this.ringPts)},toString:function(){return WKTWriter.toLineString(new CoordinateArraySequence(this.getCoordinates()))},getShell:function(){return this.isHole()?this.shell:this},add:function(t){this.deList.add(t)},getRing:function(){if(null!==this.ring)return this.ring;this.getCoordinates(),this.ringPts.length<3&&System.out.println(this.ringPts);try{this.ring=this.factory.createLinearRing(this.ringPts)}catch(t){if(!(t instanceof Exception))throw t;System.out.println(this.ringPts)}finally{}return this.ring},updateIncluded:function(){if(this.isHole())return null;for(var t=0;t<this.deList.size();t++){var e=this.deList.get(t),n=e.getSym().getRing().getShell();if(null!==n&&n.isIncludedSet())return this.setIncluded(!n.isIncluded()),null}},setShell:function(t){this.shell=t},setProcessed:function(t){this._isProcessed=t},interfaces_:function(){return[]},getClass:function(){return EdgeRing$1}}),EdgeRing$1.findDirEdgesInRing=function(t){var e=t,n=new ArrayList;do n.add(e),e=e.getNext(),Assert.isTrue(null!==e,"found null DE in ring"),Assert.isTrue(e===t||!e.isInRing(),"found DE already in ring");while(e!==t);return n},EdgeRing$1.addEdge=function(t,e,n){if(e)for(var i=0;i<t.length;i++)n.add(t[i],!1);else for(var i=t.length-1;i>=0;i--)n.add(t[i],!1)},EdgeRing$1.findEdgeRingContaining=function(t,e){for(var n=t.getRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),o=null,s=null,a=e.iterator();a.hasNext();){var l=a.next(),u=l.getRing(),c=u.getEnvelopeInternal();if(!c.equals(i)&&c.contains(i)){r=CoordinateArrays.ptNotInList(n.getCoordinates(),u.getCoordinates());var h=!1;CGAlgorithms.isPointInRing(r,u.getCoordinates())&&(h=!0),h&&(null===o||s.contains(c))&&(o=l,s=o.getRing().getEnvelopeInternal())}}return o},extend(EnvelopeComparator.prototype,{compare:function(t,e){var n=t,i=e;return n.getRing().getEnvelope().compareTo(i.getRing().getEnvelope())},interfaces_:function(){return[Comparator]},getClass:function(){return EnvelopeComparator}}),EdgeRing$1.EnvelopeComparator=EnvelopeComparator,inherits(PolygonizeGraph,PlanarGraph$1),extend(PolygonizeGraph.prototype,{findEdgeRing:function(t){var e=new EdgeRing$1(this.factory);return e.build(t),e},computeDepthParity:function(){if(0===arguments.length)for(;;){var t=null;if(null===t)return null;this.computeDepthParity(t)}else if(1===arguments.length){arguments[0]}},computeNextCWEdges:function(){for(var t=this.nodeIterator();t.hasNext();){var e=t.next();PolygonizeGraph.computeNextCWEdges(e)}},addEdge:function(t){if(t.isEmpty())return null;var e=CoordinateArrays.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),o=this.getNode(i),s=new PolygonizeDirectedEdge(r,o,e[1],!0),a=new PolygonizeDirectedEdge(o,r,e[e.length-2],!1),l=new PolygonizeEdge(t);l.setDirectedEdges(s,a),this.add(l)},deleteCutEdges:function(){this.computeNextCWEdges(),PolygonizeGraph.findLabeledEdgeRings(this.dirEdges);for(var t=new ArrayList,e=this.dirEdges.iterator();e.hasNext();){var n=e.next();if(!n.isMarked()){var i=n.getSym();if(n.getLabel()===i.getLabel()){n.setMarked(!0),i.setMarked(!0);var r=n.getEdge();t.add(r.getLine())}}}return t},getEdgeRings:function(){this.computeNextCWEdges(),PolygonizeGraph.label(this.dirEdges,-1);var t=PolygonizeGraph.findLabeledEdgeRings(this.dirEdges);this.convertMaximalToMinimalEdgeRings(t);for(var e=new ArrayList,n=this.dirEdges.iterator();n.hasNext();){var i=n.next();if(!i.isMarked()&&!i.isInRing()){var r=this.findEdgeRing(i);e.add(r)}}return e},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new Node$2(t),this.add(e)),e},convertMaximalToMinimalEdgeRings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel(),r=PolygonizeGraph.findIntersectionNodes(n,i);if(null!==r)for(var o=r.iterator();o.hasNext();){var s=o.next();PolygonizeGraph.computeNextCCWEdges(s,i)}}},deleteDangles:function(){for(var t=this.findNodesOfDegree(1),e=new HashSet,n=new Stack,i=t.iterator();i.hasNext();)n.push(i.next());for(;!n.isEmpty();){var r=n.pop();PolygonizeGraph.deleteAllEdges(r);for(var o=r.getOutEdges().getEdges(),i=o.iterator();i.hasNext();){var s=i.next();s.setMarked(!0);var a=s.getSym();null!==a&&a.setMarked(!0);var l=s.getEdge();e.add(l.getLine());var u=s.getToNode();1===PolygonizeGraph.getDegreeNonDeleted(u)&&n.push(u)}}return e},interfaces_:function(){return[]},getClass:function(){return PolygonizeGraph}}),PolygonizeGraph.findLabeledEdgeRings=function(t){for(var e=new ArrayList,n=1,i=t.iterator();i.hasNext();){var r=i.next();if(!(r.isMarked()||r.getLabel()>=0)){e.add(r);var o=EdgeRing$1.findDirEdgesInRing(r);PolygonizeGraph.label(o,n),n++}}return e},PolygonizeGraph.getDegreeNonDeleted=function(t){for(var e=t.getOutEdges().getEdges(),n=0,i=e.iterator();i.hasNext();){var r=i.next();r.isMarked()||n++}return n},PolygonizeGraph.deleteAllEdges=function(t){for(var e=t.getOutEdges().getEdges(),n=e.iterator();n.hasNext();){var i=n.next();i.setMarked(!0);var r=i.getSym();null!==r&&r.setMarked(!0)}},PolygonizeGraph.label=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();i.setLabel(e)}},PolygonizeGraph.computeNextCWEdges=function(t){for(var e=t.getOutEdges(),n=null,i=null,r=e.getEdges().iterator();r.hasNext();){var o=r.next();if(!o.isMarked()){if(null===n&&(n=o),null!==i){var s=i.getSym();s.setNext(o)}i=o}}if(null!==i){var s=i.getSym();s.setNext(n)}},PolygonizeGraph.computeNextCCWEdges=function(t,e){for(var n=t.getOutEdges(),i=null,r=null,o=n.getEdges(),s=o.size()-1;s>=0;s--){var a=o.get(s),l=a.getSym(),u=null;a.getLabel()===e&&(u=a);var c=null;l.getLabel()===e&&(c=l),null===u&&null===c||(null!==c&&(r=c),null!==u&&(null!==r&&(r.setNext(u),r=null),null===i&&(i=u)))}null!==r&&(Assert.isTrue(null!==i),r.setNext(i))},PolygonizeGraph.getDegree=function(t,e){for(var n=t.getOutEdges().getEdges(),i=0,r=n.iterator();r.hasNext();){var o=r.next();o.getLabel()===e&&i++}return i},PolygonizeGraph.findIntersectionNodes=function(t,e){var n=t,i=null;do{var r=n.getFromNode();PolygonizeGraph.getDegree(r,e)>1&&(null===i&&(i=new ArrayList),i.add(r)),n=n.getNext(),Assert.isTrue(null!==n,"found null DE in ring"),Assert.isTrue(n===t||!n.isInRing(),"found DE already in ring")}while(n!==t);return i},extend(Polygonizer.prototype,{getGeometry:function(){return null===this.geomFactory&&(this.geomFactory=new GeometryFactory),this.polygonize(),this.extractOnlyPolygonal?this.geomFactory.buildGeometry(this.polyList):this.geomFactory.createGeometryCollection(GeometryFactory.toGeometryArray(this.polyList))},getInvalidRingLines:function(){return this.polygonize(),this.invalidRingLines},findValidRings:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isValid()?e.add(r):n.add(r.getLineString())}},polygonize:function(){if(null!==this.polyList)return null;if(this.polyList=new ArrayList,null===this.graph)return null;this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var t=this.graph.getEdgeRings(),e=new ArrayList;this.invalidRingLines=new ArrayList,this.isCheckingRingsValid?this.findValidRings(t,e,this.invalidRingLines):e=t,this.findShellsAndHoles(e),Polygonizer.assignHolesToShells(this.holeList,this.shellList),Collections.sort(this.shellList,new EdgeRing$1.EnvelopeComparator);var n=!0;this.extractOnlyPolygonal&&(Polygonizer.findDisjointShells(this.shellList),n=!1),this.polyList=Polygonizer.extractPolygons(this.shellList,n)},getDangles:function(){return this.polygonize(),this.dangles},getCutEdges:function(){return this.polygonize(),this.cutEdges},getPolygons:function(){return this.polygonize(),this.polyList},add:function(){if(hasInterface(arguments[0],Collection))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}else if(arguments[0]instanceof LineString){var i=arguments[0];this.geomFactory=i.getFactory(),null===this.graph&&(this.graph=new PolygonizeGraph(this.geomFactory)),this.graph.addEdge(i)}else if(arguments[0]instanceof Geometry){var r=arguments[0];r.apply(this.lineStringAdder)}},setCheckRingsValid:function(t){this.isCheckingRingsValid=t},findShellsAndHoles:function(t){this.holeList=new ArrayList,this.shellList=new ArrayList;for(var e=t.iterator();e.hasNext();){var n=e.next();n.computeHole(),n.isHole()?this.holeList.add(n):this.shellList.add(n)}},interfaces_:function(){return[]},getClass:function(){return Polygonizer}}),Polygonizer.findOuterShells=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getOuterHole();null===i||i.isProcessed()||(n.setIncluded(!0),i.setProcessed(!0))}},Polygonizer.extractPolygons=function(t,e){for(var n=new ArrayList,i=t.iterator();i.hasNext();){var r=i.next();(e||r.isIncluded())&&n.add(r.getPolygon())}return n},Polygonizer.assignHolesToShells=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();Polygonizer.assignHoleToShell(i,e)}},Polygonizer.assignHoleToShell=function(t,e){var n=EdgeRing$1.findEdgeRingContaining(t,e);null!==n&&n.addHole(t)},Polygonizer.findDisjointShells=function(t){Polygonizer.findOuterShells(t);var e=null;do{e=!1;for(var n=t.iterator();n.hasNext();){var i=n.next();i.isIncludedSet()||(i.updateIncluded(),i.isIncludedSet()||(e=!0))}}while(e)},extend(LineStringAdder.prototype,{filter:function(t){t instanceof LineString&&this.p.add(t)},interfaces_:function(){return[GeometryComponentFilter$1]},getClass:function(){return LineStringAdder}}),Polygonizer.LineStringAdder=LineStringAdder,extend(EdgeEndBuilder.prototype,{createEdgeEndForNext:function(t,e,n,i){var r=n.segmentIndex+1;if(r>=t.getNumPoints()&&null===i)return null;var o=t.getCoordinate(r);null!==i&&i.segmentIndex===n.segmentIndex&&(o=i.coord);var s=new EdgeEnd(t,n.coord,o,new Label(t.getLabel()));e.add(s)},createEdgeEndForPrev:function(t,e,n,i){var r=n.segmentIndex;if(0===n.dist){if(0===r)return null;r--}var o=t.getCoordinate(r);null!==i&&i.segmentIndex>=r&&(o=i.coord);var s=new Label(t.getLabel());s.flip();var a=new EdgeEnd(t,n.coord,o,s);e.add(a)},computeEdgeEnds:function(){if(1===arguments.length){for(var t=arguments[0],e=new ArrayList,n=t;n.hasNext();){var i=n.next();this.computeEdgeEnds(i,e)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1],s=r.getEdgeIntersectionList();s.addEndpoints();var a=s.iterator(),l=null,u=null;if(!a.hasNext())return null;var c=a.next();do l=u,u=c,c=null,a.hasNext()&&(c=a.next()),null!==u&&(this.createEdgeEndForPrev(r,o,u,l),this.createEdgeEndForNext(r,o,u,c));while(null!==u)}},interfaces_:function(){return[]},getClass:function(){return EdgeEndBuilder}}),inherits(EdgeEndBundle,EdgeEnd),extend(EdgeEndBundle.prototype,{insert:function(t){this.edgeEnds.add(t)},print:function(t){t.println("EdgeEndBundle--> Label: "+this.label);for(var e=this.iterator();e.hasNext();){var n=e.next();n.print(t),t.println()}},iterator:function(){return this.edgeEnds.iterator()},getEdgeEnds:function(){return this.edgeEnds},computeLabelOn:function(t,e){for(var n=0,i=!1,r=this.iterator();r.hasNext();){var o=r.next(),s=o.getLabel().getLocation(t);s===Location.BOUNDARY&&n++,s===Location.INTERIOR&&(i=!0)}var s=Location.NONE;i&&(s=Location.INTERIOR),n>0&&(s=GeometryGraph.determineBoundary(e,n)),this.label.setLocation(t,s)},computeLabelSide:function(t,e){for(var n=this.iterator();n.hasNext();){var i=n.next();if(i.getLabel().isArea()){var r=i.getLabel().getLocation(t,e);if(r===Location.INTERIOR)return this.label.setLocation(t,e,Location.INTERIOR),null;r===Location.EXTERIOR&&this.label.setLocation(t,e,Location.EXTERIOR)}}},getLabel:function(){return this.label},computeLabelSides:function(t){this.computeLabelSide(t,Position.LEFT),this.computeLabelSide(t,Position.RIGHT)},updateIM:function(t){Edge.updateIM(this.label,t)},computeLabel:function(t){for(var e=!1,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().isArea()&&(e=!0)}e?this.label=new Label(Location.NONE,Location.NONE,Location.NONE):this.label=new Label(Location.NONE);for(var r=0;2>r;r++)this.computeLabelOn(r,t),e&&this.computeLabelSides(r)},interfaces_:function(){return[]},getClass:function(){return EdgeEndBundle}}),inherits(EdgeEndBundleStar,EdgeEndStar),extend(EdgeEndBundleStar.prototype,{updateIM:function(t){for(var e=this.iterator();e.hasNext();){var n=e.next();n.updateIM(t)}},insert:function(t){var e=this.edgeMap.get(t);null===e?(e=new EdgeEndBundle(t),this.insertEdgeEnd(t,e)):e.insert(t)},interfaces_:function(){return[]},getClass:function(){return EdgeEndBundleStar}}),inherits(RelateNode,Node$1),extend(RelateNode.prototype,{updateIMFromEdges:function(t){this.edges.updateIM(t)},computeIM:function(t){t.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},interfaces_:function(){return[]},getClass:function(){return RelateNode}}),inherits(RelateNodeFactory,NodeFactory),extend(RelateNodeFactory.prototype,{createNode:function(t){return new RelateNode(t,new EdgeEndBundleStar)},interfaces_:function(){return[]},getClass:function(){return RelateNodeFactory}}),extend(RelateComputer.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},computeProperIntersectionIM:function(t,e){var n=this.arg[0].getGeometry().getDimension(),i=this.arg[1].getGeometry().getDimension(),r=t.hasProperIntersection(),o=t.hasProperInteriorIntersection();2===n&&2===i?r&&e.setAtLeast("212101212"):2===n&&1===i?(r&&e.setAtLeast("FFF0FFFF2"),o&&e.setAtLeast("1FFFFF1FF")):1===n&&2===i?(r&&e.setAtLeast("F0FFFFFF2"),o&&e.setAtLeast("1F1FFFFFF")):1===n&&1===i&&o&&e.setAtLeast("0FFFFFFFF")},labelIsolatedEdges:function(t,e){for(var n=this.arg[t].getEdgeIterator();n.hasNext();){var i=n.next();i.isIsolated()&&(this.labelIsolatedEdge(i,e,this.arg[e].getGeometry()),this.isolatedEdges.add(i))}},labelIsolatedEdge:function(t,e,n){if(n.getDimension()>0){var i=this.ptLocator.locate(t.getCoordinate(),n);t.getLabel().setAllLocations(e,i)}else t.getLabel().setAllLocations(e,Location.EXTERIOR)},computeIM:function(){var t=new IntersectionMatrix;if(t.set(Location.EXTERIOR,Location.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(t),t;this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1);var e=this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!1);this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(e,t);var n=new EdgeEndBuilder,i=n.computeEdgeEnds(this.arg[0].getEdgeIterator());this.insertEdgeEnds(i);var r=n.computeEdgeEnds(this.arg[1].getEdgeIterator());return this.insertEdgeEnds(r),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(t),t},labelNodeEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().computeLabelling(this.arg)}},copyNodesAndLabels:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next(),i=this.nodes.addNode(n.getCoordinate());i.setLabel(t,n.getLabel().getLocation(t))}},labelIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this.nodes.find(o.coord);s.getLabel().isNull(t)&&(i===Location.BOUNDARY?s.setLabelBoundary(t):s.setLabel(t,Location.INTERIOR))}},labelIsolatedNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setAllLocations(e,n)},computeIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var o=r.next(),s=this.nodes.addNode(o.coord);i===Location.BOUNDARY?s.setLabelBoundary(t):s.getLabel().isNull(t)&&s.setLabel(t,Location.INTERIOR)}},labelIsolatedNodes:function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next(),n=e.getLabel();Assert.isTrue(n.getGeometryCount()>0,"node with empty label found"),e.isIsolated()&&(n.isNull(0)?this.labelIsolatedNode(e,0):this.labelIsolatedNode(e,1))}},updateIM:function(t){for(var e=this.isolatedEdges.iterator();e.hasNext();){var n=e.next();n.updateIM(t)}for(var i=this.nodes.iterator();i.hasNext();){var r=i.next();r.updateIM(t),r.updateIMFromEdges(t)}},computeDisjointIM:function(t){var e=this.arg[0].getGeometry();e.isEmpty()||(t.set(Location.INTERIOR,Location.EXTERIOR,e.getDimension()),t.set(Location.BOUNDARY,Location.EXTERIOR,e.getBoundaryDimension()));var n=this.arg[1].getGeometry();n.isEmpty()||(t.set(Location.EXTERIOR,Location.INTERIOR,n.getDimension()),t.set(Location.EXTERIOR,Location.BOUNDARY,n.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return RelateComputer}}),inherits(RelateOp$1,GeometryGraphOperation),extend(RelateOp$1.prototype,{getIntersectionMatrix:function(){return this._relate.computeIM()},interfaces_:function(){return[]},getClass:function(){return RelateOp$1}}),RelateOp$1.relate=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new RelateOp$1(t,e),i=n.getIntersectionMatrix();return i}if(3===arguments.length){var t=arguments[0],e=arguments[1],r=arguments[2],n=new RelateOp$1(t,e,r),i=n.getIntersectionMatrix();return i}},extend(GeometryCombiner.prototype,{extractElements:function(t,e){if(null===t)return null;for(var n=0;n<t.getNumGeometries();n++){var i=t.getGeometryN(n);this.skipEmpty&&i.isEmpty()||e.add(i)}},combine:function(){for(var t=new ArrayList,e=this.inputGeoms.iterator();e.hasNext();){var n=e.next();this.extractElements(n,t)}return 0===t.size()?null!==this.geomFactory?this.geomFactory.createGeometryCollection(null):null:this.geomFactory.buildGeometry(t)},interfaces_:function(){return[]},getClass:function(){return GeometryCombiner}}),GeometryCombiner.combine=function(){if(1===arguments.length){var t=arguments[0],e=new GeometryCombiner(t);return e.combine()}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=new GeometryCombiner(GeometryCombiner.createList(n,i));return e.combine()}if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],e=new GeometryCombiner(GeometryCombiner.createList(n,i,r));return e.combine()}},GeometryCombiner.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},GeometryCombiner.createList=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new ArrayList;return n.add(t),n.add(e),n}if(3===arguments.length){var t=arguments[0],e=arguments[1],i=arguments[2],n=new ArrayList;return n.add(t),n.add(e),n.add(i),n}},extend(CascadedPolygonUnion.prototype,{reduceToGeometries:function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next(),r=null;hasInterface(i,List)?r=this.unionTree(i):i instanceof Geometry&&(r=i),e.add(r)}return e},extractByEnvelope:function(t,e,n){for(var i=new ArrayList,r=0;r<e.getNumGeometries();r++){var o=e.getGeometryN(r);o.getEnvelopeInternal().intersects(t)?i.add(o):n.add(o)}return this.geomFactory.buildGeometry(i)},unionOptimized:function(t,e){var n=t.getEnvelopeInternal(),i=e.getEnvelopeInternal();if(!n.intersects(i)){var r=GeometryCombiner.combine(t,e);return r}if(t.getNumGeometries()<=1&&e.getNumGeometries()<=1)return this.unionActual(t,e);var o=n.intersection(i);return this.unionUsingEnvelopeIntersection(t,e,o)},union:function(){if(null===this.inputPolys)throw new IllegalStateException("union() method cannot be called twice");if(this.inputPolys.isEmpty())return null;this.geomFactory=this.inputPolys.iterator().next().getFactory();for(var t=new STRtree(CascadedPolygonUnion.STRTREE_NODE_CAPACITY),e=this.inputPolys.iterator();e.hasNext();){var n=e.next();t.insert(n.getEnvelopeInternal(),n)}this.inputPolys=null;var i=t.itemsTree(),r=this.unionTree(i);return r},binaryUnion:function(){if(1===arguments.length){var t=arguments[0];return this.binaryUnion(t,0,t.size())}if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];if(1>=n-e){var i=CascadedPolygonUnion.getGeometry(t,e);return this.unionSafe(i,null)}if(n-e===2)return this.unionSafe(CascadedPolygonUnion.getGeometry(t,e),CascadedPolygonUnion.getGeometry(t,e+1));var r=Math.trunc((n+e)/2),i=this.binaryUnion(t,e,r),o=this.binaryUnion(t,r,n);return this.unionSafe(i,o)}},repeatedUnion:function(t){for(var e=null,n=t.iterator();n.hasNext();){var i=n.next();e=null===e?i.copy():e.union(i)}return e},unionSafe:function(t,e){return null===t&&null===e?null:null===t?e.copy():null===e?t.copy():this.unionOptimized(t,e)},unionActual:function(t,e){return CascadedPolygonUnion.restrictToPolygons(t.union(e))},unionTree:function(t){var e=this.reduceToGeometries(t),n=this.binaryUnion(e);return n},unionUsingEnvelopeIntersection:function(t,e,n){var i=new ArrayList,r=this.extractByEnvelope(n,t,i),o=this.extractByEnvelope(n,e,i),s=this.unionActual(r,o);i.add(s);var a=GeometryCombiner.combine(i);return a},bufferUnion:function(){if(1===arguments.length){var t=arguments[0],e=t.get(0).getFactory(),n=e.buildGeometry(t),i=n.buffer(0);return i}if(2===arguments.length){var r=arguments[0],o=arguments[1],e=r.getFactory(),n=e.createGeometryCollection([r,o]),i=n.buffer(0);return i}},interfaces_:function(){return[]},getClass:function(){return CascadedPolygonUnion}}),CascadedPolygonUnion.restrictToPolygons=function(t){if(hasInterface(t,Polygonal))return t;var e=PolygonExtracter.getPolygons(t);return 1===e.size()?e.get(0):t.getFactory().createMultiPolygon(GeometryFactory.toPolygonArray(e))},CascadedPolygonUnion.getGeometry=function(t,e){return e>=t.size()?null:t.get(e)},CascadedPolygonUnion.union=function(t){var e=new CascadedPolygonUnion(t);return e.union()},CascadedPolygonUnion.STRTREE_NODE_CAPACITY=4,extend(PointGeometryUnion.prototype,{union:function(){for(var t=new PointLocator,e=new TreeSet,n=0;n<this.pointGeom.getNumGeometries();n++){var i=this.pointGeom.getGeometryN(n),r=i.getCoordinate(),o=t.locate(r,this.otherGeom);o===Location.EXTERIOR&&e.add(r)}if(0===e.size())return this.otherGeom;var s=null,a=CoordinateArrays.toCoordinateArray(e);return s=1===a.length?this.geomFact.createPoint(a[0]):this.geomFact.createMultiPointFromCoords(a),GeometryCombiner.combine(s,this.otherGeom)},interfaces_:function(){return[]},getClass:function(){return PointGeometryUnion}}),PointGeometryUnion.union=function(t,e){var n=new PointGeometryUnion(t,e);return n.union()},extend(LineStringSnapper.prototype,{snapVertices:function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;n>i;i++){var r=t.get(i),o=this.findSnapForVertex(r,e);null!==o&&(t.set(i,new Coordinate(o)),0===i&&this._isClosed&&t.set(t.size()-1,new Coordinate(o)))}},findSnapForVertex:function(t,e){for(var n=0;n<e.length;n++){if(t.equals2D(e[n]))return null;if(t.distance(e[n])<this.snapTolerance)return e[n]}return null},snapTo:function(t){var e=new CoordinateList(this.srcPts);this.snapVertices(e,t),this.snapSegments(e,t);var n=e.toCoordinateArray();return n},snapSegments:function(t,e){if(0===e.length)return null;var n=e.length;e[0].equals2D(e[e.length-1])&&(n=e.length-1);for(var i=0;n>i;i++){var r=e[i],o=this.findSegmentIndexToSnap(r,t);o>=0&&t.add(o+1,new Coordinate(r),!1)}},findSegmentIndexToSnap:function(t,e){for(var n=Double.MAX_VALUE,i=-1,r=0;r<e.size()-1;r++){if(this.seg.p0=e.get(r),this.seg.p1=e.get(r+1),this.seg.p0.equals2D(t)||this.seg.p1.equals2D(t)){if(this.allowSnappingToSourceVertices)continue;return-1}var o=this.seg.distance(t);o<this.snapTolerance&&n>o&&(n=o,i=r)}return i},setAllowSnappingToSourceVertices:function(t){this.allowSnappingToSourceVertices=t},interfaces_:function(){return[]},getClass:function(){return LineStringSnapper}}),LineStringSnapper.isClosed=function(t){return t.length<=1?!1:t[0].equals2D(t[t.length-1])},extend(GeometrySnapper.prototype,{snapTo:function(t,e){var n=this.extractTargetCoordinates(t),i=new SnapTransformer(e,n);return i.transform(this.srcGeom)},snapToSelf:function(t,e){var n=this.extractTargetCoordinates(this.srcGeom),i=new SnapTransformer(t,n,!0),r=i.transform(this.srcGeom),o=r;return e&&hasInterface(o,Polygonal)&&(o=r.buffer(0)),o},computeSnapTolerance:function(t){var e=this.computeMinimumSegmentLength(t),n=e/10;return n},extractTargetCoordinates:function(t){for(var e=new TreeSet,n=t.getCoordinates(),i=0;i<n.length;i++)e.add(n[i]);return e.toArray(new Array(0).fill(null))},computeMinimumSegmentLength:function(t){for(var e=Double.MAX_VALUE,n=0;n<t.length-1;n++){var i=t[n].distance(t[n+1]);e>i&&(e=i)}return e},interfaces_:function(){return[]},getClass:function(){return GeometrySnapper}}),GeometrySnapper.snap=function(t,e,n){
var i=new Array(2).fill(null),r=new GeometrySnapper(t);i[0]=r.snapTo(e,n);var o=new GeometrySnapper(e);return i[1]=o.snapTo(i[0],n),i},GeometrySnapper.computeOverlaySnapTolerance=function(){if(1===arguments.length){var t=arguments[0],e=GeometrySnapper.computeSizeBasedSnapTolerance(t),n=t.getPrecisionModel();if(n.getType()===PrecisionModel.FIXED){var i=1/n.getScale()*2/1.415;i>e&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],o=arguments[1];return Math.min(GeometrySnapper.computeOverlaySnapTolerance(r),GeometrySnapper.computeOverlaySnapTolerance(o))}},GeometrySnapper.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal(),n=Math.min(e.getHeight(),e.getWidth()),i=n*GeometrySnapper.SNAP_PRECISION_FACTOR;return i},GeometrySnapper.snapToSelf=function(t,e,n){var i=new GeometrySnapper(t);return i.snapToSelf(e,n)},GeometrySnapper.SNAP_PRECISION_FACTOR=1e-9,inherits(SnapTransformer,GeometryTransformer),extend(SnapTransformer.prototype,{snapLine:function(t,e){var n=new LineStringSnapper(t,this.snapTolerance);return n.setAllowSnappingToSourceVertices(this.isSelfSnap),n.snapTo(e)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this.snapPts);return this.factory.getCoordinateSequenceFactory().create(i)},interfaces_:function(){return[]},getClass:function(){return SnapTransformer}}),extend(CommonBits.prototype,{getCommon:function(){return Double.longBitsToDouble(this.commonBits)},add:function(t){var e=Double.doubleToLongBits(t);if(this.isFirst)return this.commonBits=e,this.commonSignExp=CommonBits.signExpBits(this.commonBits),this.isFirst=!1,null;var n=CommonBits.signExpBits(e);return n!==this.commonSignExp?(this.commonBits=0,null):(this.commonMantissaBitsCount=CommonBits.numCommonMostSigMantissaBits(this.commonBits,e),void(this.commonBits=CommonBits.zeroLowerBits(this.commonBits,64-(12+this.commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var t=arguments[0],e=Double.longBitsToDouble(t),n=Long.toBinaryString(t),i="0000000000000000000000000000000000000000000000000000000000000000"+n,r=i.substring(i.length-64),o=r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+e+" ]";return o}},interfaces_:function(){return[]},getClass:function(){return CommonBits}}),CommonBits.getBit=function(t,e){var n=1<<e;return 0!==(t&n)?1:0},CommonBits.signExpBits=function(t){return t>>52},CommonBits.zeroLowerBits=function(t,e){var n=(1<<e)-1,i=~n,r=t&i;return r},CommonBits.numCommonMostSigMantissaBits=function(t,e){for(var n=0,i=52;i>=0;i--){if(CommonBits.getBit(t,i)!==CommonBits.getBit(e,i))return n;n++}return 52},extend(CommonBitsRemover.prototype,{addCommonBits:function(t){var e=new Translater(this.commonCoord);t.apply(e),t.geometryChanged()},removeCommonBits:function(t){if(0===this.commonCoord.x&&0===this.commonCoord.y)return t;var e=new Coordinate(this.commonCoord);e.x=-e.x,e.y=-e.y;var n=new Translater(e);return t.apply(n),t.geometryChanged(),t},getCommonCoordinate:function(){return this.commonCoord},add:function(t){t.apply(this.ccFilter),this.commonCoord=this.ccFilter.getCommonCoordinate()},interfaces_:function(){return[]},getClass:function(){return CommonBitsRemover}}),extend(CommonCoordinateFilter.prototype,{filter:function(t){this.commonBitsX.add(t.x),this.commonBitsY.add(t.y)},getCommonCoordinate:function(){return new Coordinate(this.commonBitsX.getCommon(),this.commonBitsY.getCommon())},interfaces_:function(){return[CoordinateFilter]},getClass:function(){return CommonCoordinateFilter}}),extend(Translater.prototype,{filter:function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},isDone:function(){return!1},isGeometryChanged:function(){return!0},interfaces_:function(){return[CoordinateSequenceFilter]},getClass:function(){return Translater}}),CommonBitsRemover.CommonCoordinateFilter=CommonCoordinateFilter,CommonBitsRemover.Translater=Translater,extend(SnapOverlayOp.prototype,{selfSnap:function(t){var e=new GeometrySnapper(t),n=e.snapTo(t,this.snapTolerance);return n},removeCommonBits:function(t){this.cbr=new CommonBitsRemover,this.cbr.add(t[0]),this.cbr.add(t[1]);var e=new Array(2).fill(null);return e[0]=this.cbr.removeCommonBits(t[0].copy()),e[1]=this.cbr.removeCommonBits(t[1].copy()),e},prepareResult:function(t){return this.cbr.addCommonBits(t),t},getResultGeometry:function(t){var e=this.snap(this.geom),n=OverlayOp.overlayOp(e[0],e[1],t);return this.prepareResult(n)},checkValid:function(t){t.isValid()||System.out.println("Snapped geometry is invalid")},computeSnapTolerance:function(){this.snapTolerance=GeometrySnapper.computeOverlaySnapTolerance(this.geom[0],this.geom[1])},snap:function(t){var e=this.removeCommonBits(t),n=GeometrySnapper.snap(e[0],e[1],this.snapTolerance);return n},interfaces_:function(){return[]},getClass:function(){return SnapOverlayOp}}),SnapOverlayOp.overlayOp=function(t,e,n){var i=new SnapOverlayOp(t,e);return i.getResultGeometry(n)},SnapOverlayOp.union=function(t,e){return SnapOverlayOp.overlayOp(t,e,OverlayOp.UNION)},SnapOverlayOp.intersection=function(t,e){return SnapOverlayOp.overlayOp(t,e,OverlayOp.INTERSECTION)},SnapOverlayOp.symDifference=function(t,e){return SnapOverlayOp.overlayOp(t,e,OverlayOp.SYMDIFFERENCE)},SnapOverlayOp.difference=function(t,e){return SnapOverlayOp.overlayOp(t,e,OverlayOp.DIFFERENCE)},extend(SnapIfNeededOverlayOp.prototype,{getResultGeometry:function(t){var e=null,n=!1,i=null;try{e=OverlayOp.overlayOp(this.geom[0],this.geom[1],t);var r=!0;r&&(n=!0)}catch(t){if(!(t instanceof RuntimeException))throw t;i=t}finally{}if(!n)try{e=SnapOverlayOp.overlayOp(this.geom[0],this.geom[1],t)}catch(t){throw t instanceof RuntimeException?i:t}finally{}return e},interfaces_:function(){return[]},getClass:function(){return SnapIfNeededOverlayOp}}),SnapIfNeededOverlayOp.overlayOp=function(t,e,n){var i=new SnapIfNeededOverlayOp(t,e);return i.getResultGeometry(n)},SnapIfNeededOverlayOp.union=function(t,e){return SnapIfNeededOverlayOp.overlayOp(t,e,OverlayOp.UNION)},SnapIfNeededOverlayOp.intersection=function(t,e){return SnapIfNeededOverlayOp.overlayOp(t,e,OverlayOp.INTERSECTION)},SnapIfNeededOverlayOp.symDifference=function(t,e){return SnapIfNeededOverlayOp.overlayOp(t,e,OverlayOp.SYMDIFFERENCE)},SnapIfNeededOverlayOp.difference=function(t,e){return SnapIfNeededOverlayOp.overlayOp(t,e,OverlayOp.DIFFERENCE)},extend(GeometryExtracter.prototype,{filter:function(t){(null===this.clz||GeometryExtracter.isOfClass(t,this.clz))&&this.comps.add(t)},interfaces_:function(){return[GeometryFilter]},getClass:function(){return GeometryExtracter}}),GeometryExtracter.isOfClass=function(t,e){return e.isAssignableFrom(t.getClass())},GeometryExtracter.extract=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return GeometryExtracter.extract(t,e,new ArrayList)}if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return GeometryExtracter.isOfClass(t,e)?n.add(t):t instanceof GeometryCollection&&t.apply(new GeometryExtracter(e,n)),n}},extend(UnaryUnionOp.prototype,{unionNoOpt:function(t){var e=this.geomFact.createPoint();return SnapIfNeededOverlayOp.overlayOp(t,e,OverlayOp.UNION)},unionWithNull:function(t,e){return null===t&&null===e?null:null===e?t:null===t?e:t.union(e)},extract:function(){if(hasInterface(arguments[0],Collection))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.extract(n)}else if(arguments[0]instanceof Geometry){var i=arguments[0];null===this.geomFact&&(this.geomFact=i.getFactory()),GeometryExtracter.extract(i,Polygon,this.polygons),GeometryExtracter.extract(i,LineString,this.lines),GeometryExtracter.extract(i,Point,this.points)}},union:function t(){if(null===this.geomFact)return null;var e=null;if(this.points.size()>0){var n=this.geomFact.buildGeometry(this.points);e=this.unionNoOpt(n)}var i=null;if(this.lines.size()>0){var r=this.geomFact.buildGeometry(this.lines);i=this.unionNoOpt(r)}var o=null;this.polygons.size()>0&&(o=CascadedPolygonUnion.union(this.polygons));var s=this.unionWithNull(i,o),t=null;return t=null===e?s:null===s?e:PointGeometryUnion.union(e,s),null===t?this.geomFact.createGeometryCollection(null):t},interfaces_:function(){return[]},getClass:function(){return UnaryUnionOp}}),UnaryUnionOp.union=function(){if(1===arguments.length){if(hasInterface(arguments[0],Collection)){var t=arguments[0],e=new UnaryUnionOp(t);return e.union()}if(arguments[0]instanceof Geometry){var n=arguments[0],e=new UnaryUnionOp(n);return e.union()}}else if(2===arguments.length){var t=arguments[0],i=arguments[1],e=new UnaryUnionOp(t,i);return e.union()}},extend(ConnectedInteriorTester.prototype,{visitInteriorRing:function(t,e){var n=t.getCoordinates(),i=n[0],r=ConnectedInteriorTester.findDifferentPoint(n,i),o=e.findEdgeInSameDirection(i,r),s=e.findEdgeEnd(o),a=null;s.getLabel().getLocation(0,Position.RIGHT)===Location.INTERIOR?a=s:s.getSym().getLabel().getLocation(0,Position.RIGHT)===Location.INTERIOR&&(a=s.getSym()),Assert.isTrue(null!==a,"unable to find dirEdge with Interior on RHS"),this.visitLinkedDirectedEdges(a)},visitShellInteriors:function(t,e){if(t instanceof Polygon){var n=t;this.visitInteriorRing(n.getExteriorRing(),e)}if(t instanceof MultiPolygon)for(var i=t,r=0;r<i.getNumGeometries();r++){var n=i.getGeometryN(r);this.visitInteriorRing(n.getExteriorRing(),e)}},getCoordinate:function(){return this.disconnectedRingcoord},setInteriorEdgesInResult:function(t){for(var e=t.getEdgeEnds().iterator();e.hasNext();){var n=e.next();n.getLabel().getLocation(0,Position.RIGHT)===Location.INTERIOR&&n.setInResult(!0)}},visitLinkedDirectedEdges:function(t){var e=t,n=t;do Assert.isTrue(null!==n,"found null Directed Edge"),n.setVisited(!0),n=n.getNext();while(n!==e)},buildEdgeRings:function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&null===i.getEdgeRing()){var r=new MaximalEdgeRing(i,this.geometryFactory);r.linkDirectedEdgesForMinimalEdgeRings();var o=r.buildMinimalRings();e.addAll(o)}}return e},hasUnvisitedShellEdge:function(t){for(var e=0;e<t.size();e++){var n=t.get(e);if(!n.isHole()){var i=n.getEdges(),r=i.get(0);if(r.getLabel().getLocation(0,Position.RIGHT)===Location.INTERIOR)for(var o=0;o<i.size();o++)if(r=i.get(o),!r.isVisited())return this.disconnectedRingcoord=r.getCoordinate(),!0}}return!1},isInteriorsConnected:function(){var t=new ArrayList;this.geomGraph.computeSplitEdges(t);var e=new PlanarGraph(new OverlayNodeFactory);e.addEdges(t),this.setInteriorEdgesInResult(e),e.linkResultDirectedEdges();var n=this.buildEdgeRings(e.getEdgeEnds());return this.visitShellInteriors(this.geomGraph.getGeometry(),e),!this.hasUnvisitedShellEdge(n)},interfaces_:function(){return[]},getClass:function(){return ConnectedInteriorTester}}),ConnectedInteriorTester.findDifferentPoint=function(t,e){for(var n=0;n<t.length;n++)if(!t[n].equals(e))return t[n];return null},extend(NodeBase$1.prototype,{hasChildren:function(){for(var t=0;2>t;t++)if(null!==this.subnode[t])return!0;return!1},isPrunable:function(){return!(this.hasChildren()||this.hasItems())},addAllItems:function(t){t.addAll(this.items);for(var e=0;2>e;e++)null!==this.subnode[e]&&this.subnode[e].addAllItems(t);return t},size:function(){for(var t=0,e=0;2>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].size());return t+this.items.size()},addAllItemsFromOverlapping:function(t,e){return null===t||this.isSearchMatch(t)?(e.addAll(this.items),null!==this.subnode[0]&&this.subnode[0].addAllItemsFromOverlapping(t,e),void(null!==this.subnode[1]&&this.subnode[1].addAllItemsFromOverlapping(t,e))):null},hasItems:function(){return!this.items.isEmpty()},remove:function(t,e){if(!this.isSearchMatch(t))return!1;for(var n=!1,i=0;2>i;i++)if(null!==this.subnode[i]&&(n=this.subnode[i].remove(t,e))){this.subnode[i].isPrunable()&&(this.subnode[i]=null);break}return n?n:n=this.items.remove(e)},getItems:function(){return this.items},depth:function(){for(var t=0,e=0;2>e;e++)if(null!==this.subnode[e]){var n=this.subnode[e].depth();n>t&&(t=n)}return t+1},nodeSize:function(){for(var t=0,e=0;2>e;e++)null!==this.subnode[e]&&(t+=this.subnode[e].nodeSize());return t+1},add:function(t){this.items.add(t)},interfaces_:function(){return[]},getClass:function(){return NodeBase$1}}),NodeBase$1.getSubnodeIndex=function(t,e){var n=-1;return t.min>=e&&(n=1),t.max<=e&&(n=0),n},extend(Interval.prototype,{expandToInclude:function(t){t.max>this.max&&(this.max=t.max),t.min<this.min&&(this.min=t.min)},getWidth:function(){return this.max-this.min},overlaps:function(){if(1===arguments.length){var t=arguments[0];return this.overlaps(t.min,t.max)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return!(this.min>n||this.max<e)}},getMin:function(){return this.min},toString:function(){return"["+this.min+", "+this.max+"]"},contains:function(){if(1===arguments.length){if(arguments[0]instanceof Interval){var t=arguments[0];return this.contains(t.min,t.max)}if("number"==typeof arguments[0]){var e=arguments[0];return e>=this.min&&e<=this.max}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return n>=this.min&&i<=this.max}},init:function(t,e){this.min=t,this.max=e,t>e&&(this.min=e,this.max=t)},getMax:function(){return this.max},interfaces_:function(){return[]},getClass:function(){return Interval}}),extend(Key$1.prototype,{getInterval:function(){return this.interval},getLevel:function(){return this.level},computeKey:function(t){for(this.level=Key$1.computeLevel(t),this.interval=new Interval,this.computeInterval(this.level,t);!this.interval.contains(t);)this.level+=1,this.computeInterval(this.level,t)},computeInterval:function(t,e){var n=DoubleBits.powerOf2(t);this.pt=Math.floor(e.getMin()/n)*n,this.interval.init(this.pt,this.pt+n)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return Key$1}}),Key$1.computeLevel=function(t){var e=t.getWidth(),n=DoubleBits.exponent(e)+1;return n},inherits(Node$3,NodeBase$1),extend(Node$3.prototype,{getInterval:function(){return this.interval},find:function(t){var e=NodeBase$1.getSubnodeIndex(t,this.centre);if(-1===e)return this;if(null!==this.subnode[e]){var n=this.subnode[e];return n.find(t)}return this},insert:function(t){Assert.isTrue(null===this.interval||this.interval.contains(t.interval));var e=NodeBase$1.getSubnodeIndex(t.interval,this.centre);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insert(t),this.subnode[e]=n}},isSearchMatch:function(t){return t.overlaps(this.interval)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getNode:function(t){var e=NodeBase$1.getSubnodeIndex(t,this.centre);if(-1!==e){var n=this.getSubnode(e);return n.getNode(t)}return this},createSubnode:function(t){var e=0,n=0;switch(t){case 0:e=this.interval.getMin(),n=this.centre;break;case 1:e=this.centre,n=this.interval.getMax()}var i=new Interval(e,n),r=new Node$3(i,this.level-1);return r},interfaces_:function(){return[]},getClass:function(){return Node$3}}),Node$3.createNode=function(t){var e=new Key$1(t),n=new Node$3(e.getInterval(),e.getLevel());return n},Node$3.createExpanded=function(t,e){var n=new Interval(e);null!==t&&n.expandToInclude(t.interval);var i=Node$3.createNode(n);return null!==t&&i.insert(t),i},inherits(Root$1,NodeBase$1),extend(Root$1.prototype,{insert:function(t,e){var n=NodeBase$1.getSubnodeIndex(t,Root$1.origin);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getInterval().contains(t)){var r=Node$3.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){Assert.isTrue(t.getInterval().contains(e));var i=IntervalSize.isZeroWidth(e.getMin(),e.getMax()),r=null;r=i?t.find(e):t.getNode(e),r.add(n)},interfaces_:function(){return[]},getClass:function(){return Root$1}}),Root$1.origin=0,extend(Bintree.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=Bintree.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];return this.query(new Interval(t,t))}if(arguments[0]instanceof Interval){var e=arguments[0],n=new ArrayList;return this.query(e,n),n}}else if(2===arguments.length){var e=arguments[0],i=arguments[1];this.root.addAllItemsFromOverlapping(e,i)}},iterator:function(){var t=new ArrayList;return this.root.addAllItems(t),t.iterator()},remove:function(t,e){var n=Bintree.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e<this.minExtent&&e>0&&(this.minExtent=e)},depth:function(){return null!==this.root?this.root.depth():0},nodeSize:function(){return null!==this.root?this.root.nodeSize():0},interfaces_:function(){return[]},getClass:function(){return Bintree}}),Bintree.ensureExtent=function(t,e){var n=t.getMin(),i=t.getMax();return n!==i?t:(n===i&&(n-=e/2,i=n+e/2),new Interval(n,i))},extend(PointInRing.prototype,{isInside:function(t){},interfaces_:function(){return[]},getClass:function(){return PointInRing}}),extend(MCPointInRing.prototype,{testLineSegment:function(t,e){var n=null,i=null,r=null,o=null,s=null,a=e.p0,l=e.p1;i=a.x-t.x,r=a.y-t.y,o=l.x-t.x,s=l.y-t.y,(r>0&&0>=s||s>0&&0>=r)&&(n=RobustDeterminant.signOfDet2x2(i,r,o,s)/(s-r),n>0&&this.crossings++)},buildIndex:function(){this.tree=new Bintree;for(var t=CoordinateArrays.removeRepeatedPoints(this.ring.getCoordinates()),e=MonotoneChainBuilder.getChains(t),n=0;n<e.size();n++){var i=e.get(n),r=i.getEnvelope();this.interval.min=r.getMinY(),this.interval.max=r.getMaxY(),this.tree.insert(this.interval,i)}},testMonotoneChain:function(t,e,n){n.select(t,e)},isInside:function(t){this.crossings=0;var e=new Envelope(Double.NEGATIVE_INFINITY,Double.POSITIVE_INFINITY,t.y,t.y);this.interval.min=t.y,this.interval.max=t.y;for(var n=this.tree.query(this.interval),i=new MCSelecter(this,t),r=n.iterator();r.hasNext();){var o=r.next();this.testMonotoneChain(e,i,o)}return this.crossings%2===1},interfaces_:function(){return[PointInRing]},getClass:function(){return MCPointInRing}}),inherits(MCSelecter,MonotoneChainSelectAction),extend(MCSelecter.prototype,{select:function(){if(1!==arguments.length)return MonotoneChainSelectAction.prototype.select.apply(this,arguments);var t=arguments[0];this.mcp.testLineSegment(this.p,t)},interfaces_:function(){return[]},getClass:function(){return MCSelecter}}),MCPointInRing.MCSelecter=MCSelecter,extend(RelateNodeGraph.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},getNodeIterator:function(){return this.nodes.iterator()},copyNodesAndLabels:function(t,e){for(var n=t.getNodeIterator();n.hasNext();){var i=n.next(),r=this.nodes.addNode(i.getCoordinate());r.setLabel(e,i.getLabel().getLocation(e))}},build:function(t){this.computeIntersectionNodes(t,0),this.copyNodesAndLabels(t,0);var e=new EdgeEndBuilder,n=e.computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(n)},computeIntersectionNodes:function(t,e){for(var n=t.getEdgeIterator();n.hasNext();)for(var i=n.next(),r=i.getLabel().getLocation(e),o=i.getEdgeIntersectionList().iterator();o.hasNext();){var s=o.next(),a=this.nodes.addNode(s.coord);r===Location.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,Location.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return RelateNodeGraph}}),extend(ConsistentAreaTester.prototype,{isNodeEdgeAreaLabelsConsistent:function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();){var e=t.next();if(!e.getEdges().isAreaLabelsConsistent(this.geomGraph))return this.invalidPoint=e.getCoordinate().copy(),!1}return!0},getInvalidPoint:function(){return this.invalidPoint},hasDuplicateRings:function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();)for(var e=t.next(),n=e.getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdgeEnds().size()>1)return this.invalidPoint=i.getEdge().getCoordinate(0),!0}return!1},isNodeConsistentArea:function(){var t=this.geomGraph.computeSelfNodes(this.li,!0,!0);return t.hasProperIntersection()?(this.invalidPoint=t.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},interfaces_:function(){return[]},getClass:function(){return ConsistentAreaTester}}),extend(IndexedNestedRingTester.prototype,{buildIndex:function(){this.index=new STRtree;for(var t=0;t<this.rings.size();t++){var e=this.rings.get(t),n=e.getEnvelopeInternal();this.index.insert(n,e)}},getNestedPoint:function(){return this.nestedPt},isNonNested:function(){this.buildIndex();for(var t=0;t<this.rings.size();t++)for(var e=this.rings.get(t),n=e.getCoordinates(),i=this.index.query(e.getEnvelopeInternal()),r=0;r<i.size();r++){var o=i.get(r),s=o.getCoordinates();if(e!==o&&e.getEnvelopeInternal().intersects(o.getEnvelopeInternal())){var a=IsValidOp.findPtNotNode(n,o,this.graph);if(null!==a){var l=CGAlgorithms.isPointInRing(a,s);if(l)return this.nestedPt=a,!1}}}return!0},add:function(t){this.rings.add(t),this.totalEnv.expandToInclude(t.getEnvelopeInternal())},interfaces_:function(){return[]},getClass:function(){return IndexedNestedRingTester}}),extend(TopologyValidationError.prototype,{getErrorType:function(){return this.errorType},getMessage:function(){return TopologyValidationError.errMsg[this.errorType]},getCoordinate:function(){return this.pt},toString:function(){var t="";return null!==this.pt&&(t=" at or near point "+this.pt),this.getMessage()+t},interfaces_:function(){return[]},getClass:function(){return TopologyValidationError}}),TopologyValidationError.ERROR=0,TopologyValidationError.REPEATED_POINT=1,TopologyValidationError.HOLE_OUTSIDE_SHELL=2,TopologyValidationError.NESTED_HOLES=3,TopologyValidationError.DISCONNECTED_INTERIOR=4,TopologyValidationError.SELF_INTERSECTION=5,TopologyValidationError.RING_SELF_INTERSECTION=6,TopologyValidationError.NESTED_SHELLS=7,TopologyValidationError.DUPLICATE_RINGS=8,TopologyValidationError.TOO_FEW_POINTS=9,TopologyValidationError.INVALID_COORDINATE=10,TopologyValidationError.RING_NOT_CLOSED=11,TopologyValidationError.errMsg=["Topology Validation Error","Repeated Point","Hole lies outside shell","Holes are nested","Interior is disconnected","Self-intersection","Ring Self-intersection","Nested shells","Duplicate Rings","Too few distinct points in geometry component","Invalid Coordinate","Ring is not closed"],extend(IsValidOp.prototype,{checkInvalidCoordinates:function(){if(arguments[0]instanceof Array){for(var t=arguments[0],e=0;e<t.length;e++)if(!IsValidOp.isValid(t[e]))return this.validErr=new TopologyValidationError(TopologyValidationError.INVALID_COORDINATE,t[e]),null}else if(arguments[0]instanceof Polygon){var n=arguments[0];if(this.checkInvalidCoordinates(n.getExteriorRing().getCoordinates()),null!==this.validErr)return null;for(var e=0;e<n.getNumInteriorRing();e++)if(this.checkInvalidCoordinates(n.getInteriorRingN(e).getCoordinates()),null!==this.validErr)return null}},checkHolesNotNested:function(t,e){for(var n=new IndexedNestedRingTester(e),i=0;i<t.getNumInteriorRing();i++){var r=t.getInteriorRingN(i);n.add(r)}var o=n.isNonNested();o||(this.validErr=new TopologyValidationError(TopologyValidationError.NESTED_HOLES,n.getNestedPoint()))},checkConsistentArea:function(t){var e=new ConsistentAreaTester(t),n=e.isNodeConsistentArea();return n?void(e.hasDuplicateRings()&&(this.validErr=new TopologyValidationError(TopologyValidationError.DUPLICATE_RINGS,e.getInvalidPoint()))):(this.validErr=new TopologyValidationError(TopologyValidationError.SELF_INTERSECTION,e.getInvalidPoint()),null)},isValid:function(){return this.checkValid(this.parentGeometry),null===this.validErr},checkShellInsideHole:function(t,e,n){var i=t.getCoordinates(),r=e.getCoordinates(),o=IsValidOp.findPtNotNode(i,e,n);if(null!==o){var s=CGAlgorithms.isPointInRing(o,r);if(!s)return o}var a=IsValidOp.findPtNotNode(r,t,n);if(null!==a){var l=CGAlgorithms.isPointInRing(a,i);return l?a:null}return Assert.shouldNeverReachHere("points in shell and hole appear to be equal"),null},checkNoSelfIntersectingRings:function(t){for(var e=t.getEdgeIterator();e.hasNext();){var n=e.next();if(this.checkNoSelfIntersectingRing(n.getEdgeIntersectionList()),null!==this.validErr)return null}},checkConnectedInteriors:function(t){var e=new ConnectedInteriorTester(t);e.isInteriorsConnected()||(this.validErr=new TopologyValidationError(TopologyValidationError.DISCONNECTED_INTERIOR,e.getCoordinate()))},checkNoSelfIntersectingRing:function(t){for(var e=new TreeSet,n=!0,i=t.iterator();i.hasNext();){var r=i.next();if(n)n=!1;else{if(e.contains(r.coord))return this.validErr=new TopologyValidationError(TopologyValidationError.RING_SELF_INTERSECTION,r.coord),null;e.add(r.coord)}}},checkHolesInShell:function(t,e){for(var n=t.getExteriorRing(),i=new MCPointInRing(n),r=0;r<t.getNumInteriorRing();r++){var o=t.getInteriorRingN(r),s=IsValidOp.findPtNotNode(o.getCoordinates(),n,e);if(null===s)return null;var a=!i.isInside(s);if(a)return this.validErr=new TopologyValidationError(TopologyValidationError.HOLE_OUTSIDE_SHELL,s),null}},checkTooFewPoints:function(t){return t.hasTooFewPoints()?(this.validErr=new TopologyValidationError(TopologyValidationError.TOO_FEW_POINTS,t.getInvalidPoint()),null):void 0},getValidationError:function(){return this.checkValid(this.parentGeometry),this.validErr},checkValid:function(){if(arguments[0]instanceof Point){var t=arguments[0];this.checkInvalidCoordinates(t.getCoordinates())}else if(arguments[0]instanceof MultiPoint){var e=arguments[0];this.checkInvalidCoordinates(e.getCoordinates())}else if(arguments[0]instanceof LinearRing){var n=arguments[0];if(this.checkInvalidCoordinates(n.getCoordinates()),null!==this.validErr)return null;if(this.checkClosedRing(n),null!==this.validErr)return null;var i=new GeometryGraph(0,n);if(this.checkTooFewPoints(i),null!==this.validErr)return null;var r=new RobustLineIntersector;i.computeSelfNodes(r,!0,!0),this.checkNoSelfIntersectingRings(i)}else if(arguments[0]instanceof LineString){var o=arguments[0];if(this.checkInvalidCoordinates(o.getCoordinates()),null!==this.validErr)return null;var i=new GeometryGraph(0,o);this.checkTooFewPoints(i)}else if(arguments[0]instanceof Polygon){var s=arguments[0];if(this.checkInvalidCoordinates(s),null!==this.validErr)return null;if(this.checkClosedRings(s),null!==this.validErr)return null;var i=new GeometryGraph(0,s);if(this.checkTooFewPoints(i),null!==this.validErr)return null;if(this.checkConsistentArea(i),null!==this.validErr)return null;if(!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(i),null!==this.validErr))return null;if(this.checkHolesInShell(s,i),null!==this.validErr)return null;if(this.checkHolesNotNested(s,i),null!==this.validErr)return null;this.checkConnectedInteriors(i)}else if(arguments[0]instanceof MultiPolygon){for(var a=arguments[0],l=0;l<a.getNumGeometries();l++){var u=a.getGeometryN(l);if(this.checkInvalidCoordinates(u),null!==this.validErr)return null;if(this.checkClosedRings(u),null!==this.validErr)return null}var i=new GeometryGraph(0,a);if(this.checkTooFewPoints(i),null!==this.validErr)return null;if(this.checkConsistentArea(i),null!==this.validErr)return null;if(!this.isSelfTouchingRingFormingHoleValid&&(this.checkNoSelfIntersectingRings(i),null!==this.validErr))return null;for(var l=0;l<a.getNumGeometries();l++){var u=a.getGeometryN(l);if(this.checkHolesInShell(u,i),null!==this.validErr)return null}for(var l=0;l<a.getNumGeometries();l++){var u=a.getGeometryN(l);if(this.checkHolesNotNested(u,i),null!==this.validErr)return null}if(this.checkShellsNotNested(a,i),null!==this.validErr)return null;this.checkConnectedInteriors(i)}else if(arguments[0]instanceof GeometryCollection)for(var c=arguments[0],l=0;l<c.getNumGeometries();l++){var h=c.getGeometryN(l);if(this.checkValid(h),null!==this.validErr)return null}else if(arguments[0]instanceof Geometry){var d=arguments[0];if(this.validErr=null,d.isEmpty())return null;if(d instanceof Point)this.checkValid(d);else if(d instanceof MultiPoint)this.checkValid(d);else if(d instanceof LinearRing)this.checkValid(d);else if(d instanceof LineString)this.checkValid(d);else if(d instanceof Polygon)this.checkValid(d);else if(d instanceof MultiPolygon)this.checkValid(d);else{if(!(d instanceof GeometryCollection))throw new UnsupportedOperationException(d.getClass().getName());this.checkValid(d)}}},setSelfTouchingRingFormingHoleValid:function(t){this.isSelfTouchingRingFormingHoleValid=t},checkShellNotNested:function(t,e,n){var i=t.getCoordinates(),r=e.getExteriorRing(),o=r.getCoordinates(),s=IsValidOp.findPtNotNode(i,r,n);if(null===s)return null;var a=CGAlgorithms.isPointInRing(s,o);if(!a)return null;if(e.getNumInteriorRing()<=0)return this.validErr=new TopologyValidationError(TopologyValidationError.NESTED_SHELLS,s),null;for(var l=null,u=0;u<e.getNumInteriorRing();u++){var c=e.getInteriorRingN(u);if(l=this.checkShellInsideHole(t,c,n),null===l)return null}this.validErr=new TopologyValidationError(TopologyValidationError.NESTED_SHELLS,l)},checkClosedRings:function(t){if(this.checkClosedRing(t.getExteriorRing()),null!==this.validErr)return null;for(var e=0;e<t.getNumInteriorRing();e++)if(this.checkClosedRing(t.getInteriorRingN(e)),null!==this.validErr)return null},checkClosedRing:function(t){if(!t.isClosed()){var e=null;t.getNumPoints()>=1&&(e=t.getCoordinateN(0)),this.validErr=new TopologyValidationError(TopologyValidationError.RING_NOT_CLOSED,e)}},checkShellsNotNested:function(t,e){for(var n=0;n<t.getNumGeometries();n++)for(var i=t.getGeometryN(n),r=i.getExteriorRing(),o=0;o<t.getNumGeometries();o++)if(n!==o){var s=t.getGeometryN(o);if(this.checkShellNotNested(r,s,e),null!==this.validErr)return null}},interfaces_:function(){return[]},getClass:function(){return IsValidOp}}),IsValidOp.findPtNotNode=function(t,e,n){for(var i=n.findEdge(e),r=i.getEdgeIntersectionList(),o=0;o<t.length;o++){var s=t[o];if(!r.isIntersection(s))return s}return null},IsValidOp.isValid=function(){if(arguments[0]instanceof Geometry){var t=arguments[0],e=new IsValidOp(t);return e.isValid()}if(arguments[0]instanceof Coordinate){var n=arguments[0];return Double.isNaN(n.x)?!1:Double.isInfinite(n.x)?!1:Double.isNaN(n.y)?!1:!Double.isInfinite(n.y)}},inherits(PrecisionReducerCoordinateOperation,GeometryEditor.CoordinateOperation),extend(PrecisionReducerCoordinateOperation.prototype,{editCoordinates:function(t,e){if(0===t.length)return null;for(var n=new Array(t.length).fill(null),i=0;i<t.length;i++){var r=new Coordinate(t[i]);this.targetPM.makePrecise(r),n[i]=r}var o=new CoordinateList(n,!1),s=o.toCoordinateArray(),a=0;e instanceof LineString&&(a=2),e instanceof LinearRing&&(a=4);var l=n;return this.removeCollapsed&&(l=null),s.length<a?l:s},interfaces_:function(){return[]},getClass:function(){return PrecisionReducerCoordinateOperation}}),extend(GeometryPrecisionReducer.prototype,{fixPolygonalTopology:function(t){var e=t;this.changePrecisionModel||(e=this.changePM(t,this.targetPM));var n=e.buffer(0),i=n;return this.changePrecisionModel||(i=t.getFactory().createGeometry(n)),i},reducePointwise:function(t){var e=null;if(this.changePrecisionModel){var n=this.createFactory(t.getFactory(),this.targetPM);e=new GeometryEditor(n)}else e=new GeometryEditor;var i=this.removeCollapsed;t.getDimension()>=2&&(i=!0);var r=e.edit(t,new PrecisionReducerCoordinateOperation(this.targetPM,i));return r},changePM:function(t,e){var n=this.createEditor(t.getFactory(),e);return n.edit(t,new GeometryEditor.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(t){this.removeCollapsed=t},createFactory:function(t,e){var n=new GeometryFactory(e,t.getSRID(),t.getCoordinateSequenceFactory());return n},setChangePrecisionModel:function(t){this.changePrecisionModel=t},reduce:function(t){var e=this.reducePointwise(t);return this.isPointwise?e:hasInterface(e,Polygonal)?e.isValid()?e:this.fixPolygonalTopology(e):e;
},setPointwise:function(t){this.isPointwise=t},createEditor:function(t,e){if(t.getPrecisionModel()===e)return new GeometryEditor;var n=this.createFactory(t,e),i=new GeometryEditor(n);return i},interfaces_:function(){return[]},getClass:function(){return GeometryPrecisionReducer}}),GeometryPrecisionReducer.reduce=function(t,e){var n=new GeometryPrecisionReducer(e);return n.reduce(t)},GeometryPrecisionReducer.reducePointwise=function(t,e){var n=new GeometryPrecisionReducer(e);return n.setPointwise(!0),n.reduce(t)},extend(DouglasPeuckerLineSimplifier.prototype,{simplifySection:function(t,e){if(t+1===e)return null;this.seg.p0=this.pts[t],this.seg.p1=this.pts[e];for(var n=-1,i=t,r=t+1;e>r;r++){var o=this.seg.distance(this.pts[r]);o>n&&(n=o,i=r)}if(n<=this.distanceTolerance)for(var r=t+1;e>r;r++)this.usePt[r]=!1;else this.simplifySection(t,i),this.simplifySection(i,e)},setDistanceTolerance:function(t){this.distanceTolerance=t},simplify:function(){this.usePt=new Array(this.pts.length).fill(null);for(var t=0;t<this.pts.length;t++)this.usePt[t]=!0;this.simplifySection(0,this.pts.length-1);for(var e=new CoordinateList,t=0;t<this.pts.length;t++)this.usePt[t]&&e.add(new Coordinate(this.pts[t]));return e.toCoordinateArray()},interfaces_:function(){return[]},getClass:function(){return DouglasPeuckerLineSimplifier}}),DouglasPeuckerLineSimplifier.simplify=function(t,e){var n=new DouglasPeuckerLineSimplifier(t);return n.setDistanceTolerance(e),n.simplify()},extend(DouglasPeuckerSimplifier.prototype,{setEnsureValid:function(t){this.isEnsureValidTopology=t},getResultGeometry:function(){return this.inputGeom.isEmpty()?this.inputGeom.copy():new DPTransformer(this.isEnsureValidTopology,this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(t){if(0>t)throw new IllegalArgumentException("Tolerance must be non-negative");this.distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return DouglasPeuckerSimplifier}}),DouglasPeuckerSimplifier.simplify=function(t,e){var n=new DouglasPeuckerSimplifier(t);return n.setDistanceTolerance(e),n.getResultGeometry()},inherits(DPTransformer,GeometryTransformer),extend(DPTransformer.prototype,{transformPolygon:function(t,e){if(t.isEmpty())return null;var n=GeometryTransformer.prototype.transformPolygon.call(this,t,e);return e instanceof MultiPolygon?n:this.createValidArea(n)},createValidArea:function(t){return this.isEnsureValidTopology?t.buffer(0):t},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=null;return i=0===n.length?new Array(0).fill(null):DouglasPeuckerLineSimplifier.simplify(n,this.distanceTolerance),this.factory.getCoordinateSequenceFactory().create(i)},transformMultiPolygon:function(t,e){var n=GeometryTransformer.prototype.transformMultiPolygon.call(this,t,e);return this.createValidArea(n)},transformLinearRing:function(t,e){var n=e instanceof Polygon,i=GeometryTransformer.prototype.transformLinearRing.call(this,t,e);return!n||i instanceof LinearRing?i:null},interfaces_:function(){return[]},getClass:function(){return DPTransformer}}),DouglasPeuckerSimplifier.DPTransformer=DPTransformer,inherits(TaggedLineSegment,LineSegment),extend(TaggedLineSegment.prototype,{getIndex:function(){return this.index},getParent:function(){return this.parent},interfaces_:function(){return[]},getClass:function(){return TaggedLineSegment}}),extend(TaggedLineString.prototype,{addToResult:function(t){this.resultSegs.add(t)},asLineString:function(){return this.parentLine.getFactory().createLineString(TaggedLineString.extractCoordinates(this.resultSegs))},getResultSize:function(){var t=this.resultSegs.size();return 0===t?0:t+1},getParent:function(){return this.parentLine},getSegment:function(t){return this.segs[t]},getParentCoordinates:function(){return this.parentLine.getCoordinates()},getMinimumSize:function(){return this.minimumSize},asLinearRing:function(){return this.parentLine.getFactory().createLinearRing(TaggedLineString.extractCoordinates(this.resultSegs))},getSegments:function(){return this.segs},init:function(){var t=this.parentLine.getCoordinates();this.segs=new Array(t.length-1).fill(null);for(var e=0;e<t.length-1;e++){var n=new TaggedLineSegment(t[e],t[e+1],this.parentLine,e);this.segs[e]=n}},getResultCoordinates:function(){return TaggedLineString.extractCoordinates(this.resultSegs)},interfaces_:function(){return[]},getClass:function(){return TaggedLineString}}),TaggedLineString.extractCoordinates=function(t){for(var e=new Array(t.size()+1).fill(null),n=null,i=0;i<t.size();i++)n=t.get(i),e[i]=n.p0;return e[e.length-1]=n.p1,e},extend(LineSegmentIndex.prototype,{remove:function(t){this.index.remove(new Envelope(t.p0,t.p1),t)},add:function(){if(arguments[0]instanceof TaggedLineString)for(var t=arguments[0],e=t.getSegments(),n=0;n<e.length;n++){var i=e[n];this.add(i)}else if(arguments[0]instanceof LineSegment){var r=arguments[0];this.index.insert(new Envelope(r.p0,r.p1),r)}},query:function(t){var e=new Envelope(t.p0,t.p1),n=new LineSegmentVisitor(t);this.index.query(e,n);var i=n.getItems();return i},interfaces_:function(){return[]},getClass:function(){return LineSegmentIndex}}),extend(LineSegmentVisitor.prototype,{visitItem:function(t){var e=t;Envelope.intersects(e.p0,e.p1,this.querySeg.p0,this.querySeg.p1)&&this.items.add(t)},getItems:function(){return this.items},interfaces_:function(){return[ItemVisitor]},getClass:function(){return LineSegmentVisitor}}),extend(TaggedLineStringSimplifier.prototype,{flatten:function(t,e){var n=this.linePts[t],i=this.linePts[e],r=new LineSegment(n,i);return this.remove(this.line,t,e),this.outputIndex.add(r),r},hasBadIntersection:function(t,e,n){return this.hasBadOutputIntersection(n)?!0:!!this.hasBadInputIntersection(t,e,n)},setDistanceTolerance:function(t){this.distanceTolerance=t},simplifySection:function(t,e,n){n+=1;var i=new Array(2).fill(null);if(t+1===e){var r=this.line.getSegment(t);return this.line.addToResult(r),null}var o=!0;if(this.line.getResultSize()<this.line.getMinimumSize()){var s=n+1;s<this.line.getMinimumSize()&&(o=!1)}var a=new Array(1).fill(null),l=this.findFurthestPoint(this.linePts,t,e,a);a[0]>this.distanceTolerance&&(o=!1);var u=new LineSegment;if(u.p0=this.linePts[t],u.p1=this.linePts[e],i[0]=t,i[1]=e,this.hasBadIntersection(this.line,i,u)&&(o=!1),o){var r=this.flatten(t,e);return this.line.addToResult(r),null}this.simplifySection(t,l,n),this.simplifySection(l,e,n)},hasBadOutputIntersection:function(t){for(var e=this.outputIndex.query(t),n=e.iterator();n.hasNext();){var i=n.next();if(this.hasInteriorIntersection(i,t))return!0}return!1},findFurthestPoint:function(t,e,n,i){var r=new LineSegment;r.p0=t[e],r.p1=t[n];for(var o=-1,s=e,a=e+1;n>a;a++){var l=t[a],u=r.distance(l);u>o&&(o=u,s=a)}return i[0]=o,s},simplify:function(t){this.line=t,this.linePts=t.getParentCoordinates(),this.simplifySection(0,this.linePts.length-1,0)},remove:function(t,e,n){for(var i=e;n>i;i++){var r=t.getSegment(i);this.inputIndex.remove(r)}},hasInteriorIntersection:function(t,e){return this.li.computeIntersection(t.p0,t.p1,e.p0,e.p1),this.li.isInteriorIntersection()},hasBadInputIntersection:function(t,e,n){for(var i=this.inputIndex.query(n),r=i.iterator();r.hasNext();){var o=r.next();if(this.hasInteriorIntersection(o,n)){if(TaggedLineStringSimplifier.isInLineSection(t,e,o))continue;return!0}}return!1},interfaces_:function(){return[]},getClass:function(){return TaggedLineStringSimplifier}}),TaggedLineStringSimplifier.isInLineSection=function(t,e,n){if(n.getParent()!==t.getParent())return!1;var i=n.getIndex();return i>=e[0]&&i<e[1]},extend(TaggedLinesSimplifier.prototype,{setDistanceTolerance:function(t){this.distanceTolerance=t},simplify:function(t){for(var e=t.iterator();e.hasNext();)this.inputIndex.add(e.next());for(var e=t.iterator();e.hasNext();){var n=new TaggedLineStringSimplifier(this.inputIndex,this.outputIndex);n.setDistanceTolerance(this.distanceTolerance),n.simplify(e.next())}},interfaces_:function(){return[]},getClass:function(){return TaggedLinesSimplifier}}),extend(TopologyPreservingSimplifier.prototype,{getResultGeometry:function(){if(this.inputGeom.isEmpty())return this.inputGeom.copy();this.linestringMap=new HashMap,this.inputGeom.apply(new LineStringMapBuilderFilter(this)),this.lineSimplifier.simplify(this.linestringMap.values());var t=new LineStringTransformer(this.linestringMap).transform(this.inputGeom);return t},setDistanceTolerance:function(t){if(0>t)throw new IllegalArgumentException("Tolerance must be non-negative");this.lineSimplifier.setDistanceTolerance(t)},interfaces_:function(){return[]},getClass:function(){return TopologyPreservingSimplifier}}),TopologyPreservingSimplifier.simplify=function(t,e){var n=new TopologyPreservingSimplifier(t);return n.setDistanceTolerance(e),n.getResultGeometry()},inherits(LineStringTransformer,GeometryTransformer),extend(LineStringTransformer.prototype,{transformCoordinates:function(t,e){if(0===t.size())return null;if(e instanceof LineString){var n=this.linestringMap.get(e);return this.createCoordinateSequence(n.getResultCoordinates())}return GeometryTransformer.prototype.transformCoordinates.call(this,t,e)},interfaces_:function(){return[]},getClass:function(){return LineStringTransformer}}),extend(LineStringMapBuilderFilter.prototype,{filter:function(t){if(t instanceof LineString){var e=t;if(e.isEmpty())return null;var n=e.isClosed()?4:2,i=new TaggedLineString(e,n);this.tps.linestringMap.put(e,i)}},interfaces_:function(){return[GeometryComponentFilter$1]},getClass:function(){return LineStringMapBuilderFilter}}),TopologyPreservingSimplifier.LineStringTransformer=LineStringTransformer,TopologyPreservingSimplifier.LineStringMapBuilderFilter=LineStringMapBuilderFilter,extend(SplitSegment.prototype,{splitAt:function(){if(1===arguments.length){var t=arguments[0],e=this.minimumLen/this.segLen;if(t.distance(this.seg.p0)<this.minimumLen)return this.splitPt=this.seg.pointAlong(e),null;if(t.distance(this.seg.p1)<this.minimumLen)return this.splitPt=SplitSegment.pointAlongReverse(this.seg,e),null;this.splitPt=t}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this.getConstrainedLength(n),o=r/this.segLen;i.equals2D(this.seg.p0)?this.splitPt=this.seg.pointAlong(o):this.splitPt=SplitSegment.pointAlongReverse(this.seg,o)}},setMinimumLength:function(t){this.minimumLen=t},getConstrainedLength:function(t){return t<this.minimumLen?this.minimumLen:t},getSplitPoint:function(){return this.splitPt},interfaces_:function(){return[]},getClass:function(){return SplitSegment}}),SplitSegment.pointAlongReverse=function(t,e){var n=new Coordinate;return n.x=t.p1.x-e*(t.p1.x-t.p0.x),n.y=t.p1.y-e*(t.p1.y-t.p0.y),n},extend(ConstraintSplitPointFinder.prototype,{findSplitPoint:function(t,e){},interfaces_:function(){return[]},getClass:function(){return ConstraintSplitPointFinder}}),extend(NonEncroachingSplitPointFinder.prototype,{findSplitPoint:function(t,e){var n=t.getLineSegment(),i=n.getLength(),r=i/2,o=new SplitSegment(n),s=NonEncroachingSplitPointFinder.projectedSplitPoint(t,e),a=2*s.distance(e)*.8,l=a;return l>r&&(l=r),o.setMinimumLength(l),o.splitAt(s),o.getSplitPoint()},interfaces_:function(){return[ConstraintSplitPointFinder]},getClass:function(){return NonEncroachingSplitPointFinder}}),NonEncroachingSplitPointFinder.projectedSplitPoint=function(t,e){var n=t.getLineSegment(),i=n.project(e);return i},extend(TrianglePredicate.prototype,{interfaces_:function(){return[]},getClass:function(){return TrianglePredicate}}),TrianglePredicate.triArea=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)},TrianglePredicate.isInCircleDDNormalized=function(t,e,n,i){var r=DD.valueOf(t.x).selfSubtract(i.x),o=DD.valueOf(t.y).selfSubtract(i.y),s=DD.valueOf(e.x).selfSubtract(i.x),a=DD.valueOf(e.y).selfSubtract(i.y),l=DD.valueOf(n.x).selfSubtract(i.x),u=DD.valueOf(n.y).selfSubtract(i.y),c=r.multiply(a).selfSubtract(s.multiply(o)),h=s.multiply(u).selfSubtract(l.multiply(a)),d=l.multiply(o).selfSubtract(r.multiply(u)),g=r.multiply(r).selfAdd(o.multiply(o)),f=s.multiply(s).selfAdd(a.multiply(a)),p=l.multiply(l).selfAdd(u.multiply(u)),m=g.selfMultiply(h).selfAdd(f.selfMultiply(d)).selfAdd(p.selfMultiply(c)),y=m.doubleValue()>0;return y},TrianglePredicate.checkRobustInCircle=function(t,e,n,i){var r=TrianglePredicate.isInCircleNonRobust(t,e,n,i),o=TrianglePredicate.isInCircleDDSlow(t,e,n,i),s=TrianglePredicate.isInCircleCC(t,e,n,i),a=Triangle.circumcentre(t,e,n);System.out.println("p radius diff a = "+Math.abs(i.distance(a)-t.distance(a))/t.distance(a)),r===o&&r===s||(System.out.println("inCircle robustness failure (double result = "+r+", DD result = "+o+", CC result = "+s+")"),System.out.println(WKTWriter.toLineString(new CoordinateArraySequence([t,e,n,i]))),System.out.println("Circumcentre = "+WKTWriter.toPoint(a)+" radius = "+t.distance(a)),System.out.println("p radius diff a = "+Math.abs(i.distance(a)/t.distance(a)-1)),System.out.println("p radius diff b = "+Math.abs(i.distance(a)/e.distance(a)-1)),System.out.println("p radius diff c = "+Math.abs(i.distance(a)/n.distance(a)-1)),System.out.println())},TrianglePredicate.isInCircleDDFast=function(t,e,n,i){var r=DD.sqr(t.x).selfAdd(DD.sqr(t.y)).selfMultiply(TrianglePredicate.triAreaDDFast(e,n,i)),o=DD.sqr(e.x).selfAdd(DD.sqr(e.y)).selfMultiply(TrianglePredicate.triAreaDDFast(t,n,i)),s=DD.sqr(n.x).selfAdd(DD.sqr(n.y)).selfMultiply(TrianglePredicate.triAreaDDFast(t,e,i)),a=DD.sqr(i.x).selfAdd(DD.sqr(i.y)).selfMultiply(TrianglePredicate.triAreaDDFast(t,e,n)),l=r.selfSubtract(o).selfAdd(s).selfSubtract(a),u=l.doubleValue()>0;return u},TrianglePredicate.isInCircleCC=function(t,e,n,i){var r=Triangle.circumcentre(t,e,n),o=t.distance(r),s=i.distance(r)-o;return 0>=s},TrianglePredicate.isInCircleNormalized=function(t,e,n,i){var r=t.x-i.x,o=t.y-i.y,s=e.x-i.x,a=e.y-i.y,l=n.x-i.x,u=n.y-i.y,c=r*a-s*o,h=s*u-l*a,d=l*o-r*u,g=r*r+o*o,f=s*s+a*a,p=l*l+u*u,m=g*h+f*d+p*c;return m>0},TrianglePredicate.isInCircleDDSlow=function(t,e,n,i){var r=DD.valueOf(i.x),o=DD.valueOf(i.y),s=DD.valueOf(t.x),a=DD.valueOf(t.y),l=DD.valueOf(e.x),u=DD.valueOf(e.y),c=DD.valueOf(n.x),h=DD.valueOf(n.y),d=s.multiply(s).add(a.multiply(a)).multiply(TrianglePredicate.triAreaDDSlow(l,u,c,h,r,o)),g=l.multiply(l).add(u.multiply(u)).multiply(TrianglePredicate.triAreaDDSlow(s,a,c,h,r,o)),f=c.multiply(c).add(h.multiply(h)).multiply(TrianglePredicate.triAreaDDSlow(s,a,l,u,r,o)),p=r.multiply(r).add(o.multiply(o)).multiply(TrianglePredicate.triAreaDDSlow(s,a,l,u,c,h)),m=d.subtract(g).add(f).subtract(p),y=m.doubleValue()>0;return y},TrianglePredicate.isInCircleNonRobust=function(t,e,n,i){var r=(t.x*t.x+t.y*t.y)*TrianglePredicate.triArea(e,n,i)-(e.x*e.x+e.y*e.y)*TrianglePredicate.triArea(t,n,i)+(n.x*n.x+n.y*n.y)*TrianglePredicate.triArea(t,e,i)-(i.x*i.x+i.y*i.y)*TrianglePredicate.triArea(t,e,n)>0;return r},TrianglePredicate.isInCircleRobust=function(t,e,n,i){return TrianglePredicate.isInCircleNormalized(t,e,n,i)},TrianglePredicate.triAreaDDSlow=function(t,e,n,i,r,o){return n.subtract(t).multiply(o.subtract(e)).subtract(i.subtract(e).multiply(r.subtract(t)))},TrianglePredicate.triAreaDDFast=function(t,e,n){var i=DD.valueOf(e.x).selfSubtract(t.x).selfMultiply(DD.valueOf(n.y).selfSubtract(t.y)),r=DD.valueOf(e.y).selfSubtract(t.y).selfMultiply(DD.valueOf(n.x).selfSubtract(t.x));return i.selfSubtract(r)},extend(Vertex.prototype,{circleCenter:function(t,e){var n=new Vertex(this.getX(),this.getY()),i=this.bisector(n,t),r=this.bisector(t,e),o=new HCoordinate(i,r),s=null;try{s=new Vertex(o.getX(),o.getY())}catch(i){if(!(i instanceof NotRepresentableException))throw i;System.err.println("a: "+n+" b: "+t+" c: "+e),System.err.println(i)}finally{}return s},dot:function(t){return this.p.x*t.getX()+this.p.y*t.getY()},magn:function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},getZ:function(){return this.p.z},bisector:function(t,e){var n=e.getX()-t.getX(),i=e.getY()-t.getY(),r=new HCoordinate(t.getX()+n/2,t.getY()+i/2,1),o=new HCoordinate(t.getX()-i+n/2,t.getY()+n+i/2,1);return new HCoordinate(r,o)},equals:function(){if(1===arguments.length){var t=arguments[0];return this.p.x===t.getX()&&this.p.y===t.getY()}if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.p.distance(t.getCoordinate())<e}},getCoordinate:function(){return this.p},isInCircle:function(t,e,n){return TrianglePredicate.isInCircleRobust(t.p,e.p,n.p,this.p)},interpolateZValue:function(t,e,n){var i=t.getX(),r=t.getY(),o=e.getX()-i,s=n.getX()-i,a=e.getY()-r,l=n.getY()-r,u=o*l-s*a,c=this.getX()-i,h=this.getY()-r,d=(l*c-s*h)/u,g=(-a*c+o*h)/u,f=t.getZ()+d*(e.getZ()-t.getZ())+g*(n.getZ()-t.getZ());return f},midPoint:function(t){var e=(this.p.x+t.getX())/2,n=(this.p.y+t.getY())/2,i=(this.p.z+t.getZ())/2;return new Vertex(e,n,i)},rightOf:function(t){return this.isCCW(t.dest(),t.orig())},isCCW:function(t,e){return(t.p.x-this.p.x)*(e.p.y-this.p.y)-(t.p.y-this.p.y)*(e.p.x-this.p.x)>0},getX:function(){return this.p.x},crossProduct:function(t){return this.p.x*t.getY()-this.p.y*t.getX()},setZ:function(t){this.p.z=t},times:function(t){return new Vertex(t*this.p.x,t*this.p.y)},cross:function(){return new Vertex(this.p.y,-this.p.x)},leftOf:function(t){return this.isCCW(t.orig(),t.dest())},toString:function(){return"POINT ("+this.p.x+" "+this.p.y+")"},sub:function(t){return new Vertex(this.p.x-t.getX(),this.p.y-t.getY())},getY:function(){return this.p.y},classify:function(t,e){var n=this,i=e.sub(t),r=n.sub(t),o=i.crossProduct(r);return o>0?Vertex.LEFT:0>o?Vertex.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?Vertex.BEHIND:i.magn()<r.magn()?Vertex.BEYOND:t.equals(n)?Vertex.ORIGIN:e.equals(n)?Vertex.DESTINATION:Vertex.BETWEEN},sum:function(t){return new Vertex(this.p.x+t.getX(),this.p.y+t.getY())},distance:function(t,e){return Math.sqrt(Math.pow(e.getX()-t.getX(),2)+Math.pow(e.getY()-t.getY(),2))},circumRadiusRatio:function(t,e){var n=this.circleCenter(t,e),i=this.distance(n,t),r=this.distance(this,t),o=this.distance(t,e);return r>o&&(r=o),o=this.distance(e,this),r>o&&(r=o),i/r},interfaces_:function(){return[]},getClass:function(){return Vertex}}),Vertex.interpolateZ=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=e.distance(n),r=t.distance(e),o=n.z-e.z,s=e.z+o*(r/i);return s}if(4===arguments.length){var t=arguments[0],a=arguments[1],l=arguments[2],u=arguments[3],c=a.x,h=a.y,d=l.x-c,g=u.x-c,f=l.y-h,p=u.y-h,m=d*p-g*f,y=t.x-c,v=t.y-h,x=(p*y-g*v)/m,C=(-f*y+d*v)/m,E=a.z+x*(l.z-a.z)+C*(u.z-a.z);return E}},Vertex.LEFT=0,Vertex.RIGHT=1,Vertex.BEYOND=2,Vertex.BEHIND=3,Vertex.BETWEEN=4,Vertex.ORIGIN=5,Vertex.DESTINATION=6,inherits(ConstraintVertex,Vertex),extend(ConstraintVertex.prototype,{getConstraint:function(){return this.constraint},setOnConstraint:function(t){this._isOnConstraint=t},merge:function(t){t._isOnConstraint&&(this._isOnConstraint=!0,this.constraint=t.constraint)},isOnConstraint:function(){return this._isOnConstraint},setConstraint:function(t){this._isOnConstraint=!0,this.constraint=t},interfaces_:function(){return[]},getClass:function(){return ConstraintVertex}}),extend(QuadEdge.prototype,{equalsNonOriented:function(t){return this.equalsOriented(t)?!0:!!this.equalsOriented(t.sym())},toLineSegment:function(){return new LineSegment(this.vertex.getCoordinate(),this.dest().getCoordinate())},dest:function(){return this.sym().orig()},oNext:function(){return this.next},equalsOriented:function(t){return!(!this.orig().getCoordinate().equals2D(t.orig().getCoordinate())||!this.dest().getCoordinate().equals2D(t.dest().getCoordinate()))},dNext:function(){return this.sym().oNext().sym()},lPrev:function(){return this.next.sym()},rPrev:function(){return this.sym().oNext()},rot:function(){return this._rot},oPrev:function(){return this._rot.next._rot},sym:function(){return this._rot._rot},setOrig:function(t){this.vertex=t},lNext:function(){return this.invRot().oNext().rot()},getLength:function(){return this.orig().getCoordinate().distance(this.dest().getCoordinate())},invRot:function(){return this._rot.sym()},setDest:function(t){this.sym().setOrig(t)},setData:function(t){this.data=t},getData:function(){return this.data},delete:function(){this._rot=null},orig:function(){return this.vertex},rNext:function(){return this._rot.next.invRot()},toString:function(){var t=this.vertex.getCoordinate(),e=this.dest().getCoordinate();return WKTWriter.toLineString(t,e)},isLive:function(){return null!==this._rot},getPrimary:function(){return this.orig().getCoordinate().compareTo(this.dest().getCoordinate())<=0?this:this.sym()},dPrev:function(){return this.invRot().oNext().invRot()},setNext:function(t){this.next=t},interfaces_:function(){return[]},getClass:function(){return QuadEdge}}),QuadEdge.makeEdge=function(t,e){var n=new QuadEdge,i=new QuadEdge,r=new QuadEdge,o=new QuadEdge;n._rot=i,i._rot=r,r._rot=o,o._rot=n,n.setNext(n),i.setNext(o),r.setNext(r),o.setNext(i);var s=n;return s.setOrig(t),s.setDest(e),s},QuadEdge.swap=function(t){var e=t.oPrev(),n=t.sym().oPrev();QuadEdge.splice(t,e),QuadEdge.splice(t.sym(),n),QuadEdge.splice(t,e.lNext()),QuadEdge.splice(t.sym(),n.lNext()),t.setOrig(e.dest()),t.setDest(n.dest())},QuadEdge.splice=function(t,e){var n=t.oNext().rot(),i=e.oNext().rot(),r=e.oNext(),o=t.oNext(),s=i.oNext(),a=n.oNext();t.setNext(r),e.setNext(o),n.setNext(s),i.setNext(a)},QuadEdge.connect=function(t,e){var n=QuadEdge.makeEdge(t.dest(),e.orig());return QuadEdge.splice(n,t.lNext()),QuadEdge.splice(n.sym(),e),n},extend(IncrementalDelaunayTriangulator.prototype,{insertSite:function(t){var e=this.subdiv.locate(t);if(this.subdiv.isVertexOfEdge(e,t))return e;this.subdiv.isOnEdge(e,t.getCoordinate())&&(e=e.oPrev(),this.subdiv.delete(e.oNext()));var n=this.subdiv.makeEdge(e.orig(),t);QuadEdge.splice(n,e);var i=n;do n=this.subdiv.connect(e,n.sym()),e=n.oPrev();while(e.lNext()!==i);for(;;){var r=e.oPrev();if(r.dest().rightOf(e)&&t.isInCircle(e.orig(),r.dest(),e.dest()))QuadEdge.swap(e),e=e.oPrev();else{if(e.oNext()===i)return n;e=e.oNext().lPrev()}}},insertSites:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertSite(n)}},interfaces_:function(){return[]},getClass:function(){return IncrementalDelaunayTriangulator}}),extend(QuadEdgeLocator.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return QuadEdgeLocator}}),extend(LastFoundQuadEdgeLocator.prototype,{init:function(){this.lastEdge=this.findEdge()},locate:function(t){this.lastEdge.isLive()||this.init();var e=this.subdiv.locateFromEdge(t,this.lastEdge);return this.lastEdge=e,e},findEdge:function(){var t=this.subdiv.getEdges();return t.iterator().next()},interfaces_:function(){return[QuadEdgeLocator]},getClass:function(){return LastFoundQuadEdgeLocator}}),inherits(LocateFailureException,RuntimeException),extend(LocateFailureException.prototype,{getSegment:function(){return this.seg},interfaces_:function(){return[]},getClass:function(){return LocateFailureException}}),LocateFailureException.msgWithSpatial=function(t,e){return null!==e?t+" [ "+e+" ]":t},extend(TriangleVisitor.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return TriangleVisitor}}),extend(QuadEdgeSubdivision.prototype,{getTriangleVertices:function(t){var e=new TriangleVertexListVisitor;return this.visitTriangles(e,t),e.getTriangleVertices()},isFrameVertex:function(t){return t.equals(this.frameVertex[0])?!0:t.equals(this.frameVertex[1])?!0:!!t.equals(this.frameVertex[2])},isVertexOfEdge:function(t,e){return!(!e.equals(t.orig(),this.tolerance)&&!e.equals(t.dest(),this.tolerance))},connect:function(t,e){var n=QuadEdge.connect(t,e);return this.quadEdges.add(n),n},getVoronoiCellPolygon:function(t,e){var n=new ArrayList,i=t;do{var r=t.rot().orig().getCoordinate();n.add(r),t=t.oPrev()}while(t!==i);var o=new CoordinateList;o.addAll(n,!1),o.closeRing(),o.size()<4&&(System.out.println(o),o.add(o.get(o.size()-1),!0));var s=o.toCoordinateArray(),a=e.createPolygon(e.createLinearRing(s),null),l=i.orig();return a.setUserData(l.getCoordinate()),a},setLocator:function(t){this.locator=t},initSubdiv:function(){var t=this.makeEdge(this.frameVertex[0],this.frameVertex[1]),e=this.makeEdge(this.frameVertex[1],this.frameVertex[2]);QuadEdge.splice(t.sym(),e);var n=this.makeEdge(this.frameVertex[2],this.frameVertex[0]);return QuadEdge.splice(e.sym(),n),QuadEdge.splice(n.sym(),t),t},isFrameBorderEdge:function(t){var e=new Array(3).fill(null);QuadEdgeSubdivision.getTriangleEdges(t,e);var n=new Array(3).fill(null);QuadEdgeSubdivision.getTriangleEdges(t.sym(),n);var i=t.lNext().dest();if(this.isFrameVertex(i))return!0;var r=t.sym().lNext().dest();return!!this.isFrameVertex(r)},makeEdge:function(t,e){var n=QuadEdge.makeEdge(t,e);return this.quadEdges.add(n),n},visitTriangles:function(t,e){this.visitedKey++;var n=new Stack;n.push(this.startingEdge);for(var i=new HashSet;!n.empty();){var r=n.pop();if(!i.contains(r)){var o=this.fetchTriangleToVisit(r,n,e,i);null!==o&&t.visit(o)}}},isFrameEdge:function(t){return!(!this.isFrameVertex(t.orig())&&!this.isFrameVertex(t.dest()))},isOnEdge:function(t,e){this.seg.setCoordinates(t.orig().getCoordinate(),t.dest().getCoordinate());var n=this.seg.distance(e);return n<this.edgeCoincidenceTolerance},getEnvelope:function(){return new Envelope(this.frameEnv)},createFrame:function(t){var e=t.getWidth(),n=t.getHeight(),i=0;i=e>n?10*e:10*n,this.frameVertex[0]=new Vertex((t.getMaxX()+t.getMinX())/2,t.getMaxY()+i),this.frameVertex[1]=new Vertex(t.getMinX()-i,t.getMinY()-i),this.frameVertex[2]=new Vertex(t.getMaxX()+i,t.getMinY()-i),this.frameEnv=new Envelope(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate()),this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},getTriangleCoordinates:function(t){var e=new TriangleCoordinatesVisitor;return this.visitTriangles(e,t),e.getTriangles()},getVertices:function(t){for(var e=new HashSet,n=this.quadEdges.iterator();n.hasNext();){var i=n.next(),r=i.orig();!t&&this.isFrameVertex(r)||e.add(r);var o=i.dest();!t&&this.isFrameVertex(o)||e.add(o)}return e},fetchTriangleToVisit:function(t,e,n,i){var r=t,o=0,s=!1;do{this.triEdges[o]=r,this.isFrameEdge(r)&&(s=!0);var a=r.sym();i.contains(a)||e.push(a),i.add(r),o++,r=r.lNext()}while(r!==t);return s&&!n?null:this.triEdges},getEdges:function(){if(0===arguments.length)return this.quadEdges;if(1===arguments.length){for(var t=arguments[0],e=this.getPrimaryEdges(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createLineString([o.orig().getCoordinate(),o.dest().getCoordinate()])}return t.createMultiLineString(n)}},getVertexUniqueEdges:function(t){for(var e=new ArrayList,n=new HashSet,i=this.quadEdges.iterator();i.hasNext();){var r=i.next(),o=r.orig();n.contains(o)||(n.add(o),!t&&this.isFrameVertex(o)||e.add(r));var s=r.sym(),a=s.orig();n.contains(a)||(n.add(a),!t&&this.isFrameVertex(a)||e.add(s))}return e},getTriangleEdges:function(t){var e=new TriangleEdgesListVisitor;return this.visitTriangles(e,t),e.getTriangleEdges()},getPrimaryEdges:function(t){this.visitedKey++;var e=new ArrayList,n=new Stack;n.push(this.startingEdge);for(var i=new HashSet;!n.empty();){var r=n.pop();if(!i.contains(r)){var o=r.getPrimary();!t&&this.isFrameEdge(o)||e.add(o),n.push(r.oNext()),n.push(r.sym().oNext()),i.add(r),i.add(r.sym())}}return e},delete:function(t){QuadEdge.splice(t,t.oPrev()),QuadEdge.splice(t.sym(),t.sym().oPrev());var e=t.sym(),n=t.rot(),i=t.rot().sym();this.quadEdges.remove(t),this.quadEdges.remove(e),this.quadEdges.remove(n),this.quadEdges.remove(i),t.delete(),e.delete(),n.delete(),i.delete()},locateFromEdge:function(t,e){for(var n=0,i=this.quadEdges.size(),r=e;;){if(n++,n>i)throw new LocateFailureException(r.toLineSegment());if(t.equals(r.orig())||t.equals(r.dest()))break;if(t.rightOf(r))r=r.sym();else if(t.rightOf(r.oNext())){if(t.rightOf(r.dPrev()))break;r=r.dPrev()}else r=r.oNext()}return r},getTolerance:function(){return this.tolerance},getVoronoiCellPolygons:function(t){this.visitTriangles(new TriangleCircumcentreVisitor,!0);for(var e=new ArrayList,n=this.getVertexUniqueEdges(!1),i=n.iterator();i.hasNext();){var r=i.next();e.add(this.getVoronoiCellPolygon(r,t))}return e},getVoronoiDiagram:function(t){var e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection(GeometryFactory.toGeometryArray(e))},getTriangles:function(t){for(var e=this.getTriangleCoordinates(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var o=r.next();n[i++]=t.createPolygon(t.createLinearRing(o),null)}return t.createGeometryCollection(n)},insertSite:function(t){var e=this.locate(t);if(t.equals(e.orig(),this.tolerance)||t.equals(e.dest(),this.tolerance))return e;var n=this.makeEdge(e.orig(),t);QuadEdge.splice(n,e);var i=n;do n=this.connect(e,n.sym()),e=n.oPrev();while(e.lNext()!==i);return i},locate:function(){if(1===arguments.length){if(arguments[0]instanceof Vertex){var t=arguments[0];return this.locator.locate(t)}if(arguments[0]instanceof Coordinate){var e=arguments[0];return this.locator.locate(new Vertex(e))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this.locator.locate(new Vertex(n));if(null===r)return null;var o=r;r.dest().getCoordinate().equals2D(n)&&(o=r.sym());var s=o;do{if(s.dest().getCoordinate().equals2D(i))return s;s=s.oNext()}while(s!==o);return null}},interfaces_:function(){return[]},getClass:function(){return QuadEdgeSubdivision}}),QuadEdgeSubdivision.getTriangleEdges=function(t,e){if(e[0]=t,e[1]=e[0].lNext(),e[2]=e[1].lNext(),e[2].lNext()!==e[0])throw new IllegalArgumentException("Edges do not form a triangle")},extend(TriangleCircumcentreVisitor.prototype,{visit:function(t){for(var e=t[0].orig().getCoordinate(),n=t[1].orig().getCoordinate(),i=t[2].orig().getCoordinate(),r=Triangle.circumcentre(e,n,i),o=new Vertex(r),s=0;3>s;s++)t[s].rot().setOrig(o)},interfaces_:function(){return[TriangleVisitor]},getClass:function(){return TriangleCircumcentreVisitor}}),extend(TriangleEdgesListVisitor.prototype,{getTriangleEdges:function(){return this.triList},visit:function(t){this.triList.add(t.clone())},interfaces_:function(){return[TriangleVisitor]},getClass:function(){return TriangleEdgesListVisitor}}),extend(TriangleVertexListVisitor.prototype,{visit:function(t){this.triList.add([t[0].orig(),t[1].orig(),t[2].orig()])},getTriangleVertices:function(){return this.triList},interfaces_:function(){return[TriangleVisitor]},getClass:function(){return TriangleVertexListVisitor}}),extend(TriangleCoordinatesVisitor.prototype,{checkTriangleSize:function(t){var e="";t.length>=2?e=WKTWriter.toLineString(t[0],t[1]):t.length>=1&&(e=WKTWriter.toPoint(t[0]))},visit:function(t){this.coordList.clear();for(var e=0;3>e;e++){var n=t[e].orig();this.coordList.add(n.getCoordinate())}if(this.coordList.size()>0){this.coordList.closeRing();var i=this.coordList.toCoordinateArray();if(4!==i.length)return null;this.triCoords.add(i)}},getTriangles:function(){return this.triCoords},interfaces_:function(){return[TriangleVisitor]},getClass:function(){return TriangleCoordinatesVisitor}}),QuadEdgeSubdivision.TriangleCircumcentreVisitor=TriangleCircumcentreVisitor,QuadEdgeSubdivision.TriangleEdgesListVisitor=TriangleEdgesListVisitor,QuadEdgeSubdivision.TriangleVertexListVisitor=TriangleVertexListVisitor,QuadEdgeSubdivision.TriangleCoordinatesVisitor=TriangleCoordinatesVisitor,QuadEdgeSubdivision.EDGE_COINCIDENCE_TOL_FACTOR=1e3,extend(Segment.prototype,{getLineSegment:function(){return this.ls},getEndZ:function(){var t=this.ls.getCoordinate(1);return t.z},getStartZ:function(){var t=this.ls.getCoordinate(0);return t.z},intersection:function(t){return this.ls.intersection(t.getLineSegment())},getStart:function(){return this.ls.getCoordinate(0)},getEnd:function(){return this.ls.getCoordinate(1)},getEndY:function(){var t=this.ls.getCoordinate(1);return t.y},getStartX:function(){var t=this.ls.getCoordinate(0);return t.x},equalsTopo:function(t){return this.ls.equalsTopo(t.getLineSegment())},getStartY:function(){var t=this.ls.getCoordinate(0);return t.y},setData:function(t){
this.data=t},getData:function(){return this.data},getEndX:function(){var t=this.ls.getCoordinate(1);return t.x},toString:function(){return this.ls.toString()},interfaces_:function(){return[]},getClass:function(){return Segment}}),extend(KdNodeVisitor.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return KdNodeVisitor}}),extend(KdNode.prototype,{isRepeated:function(){return this.count>1},getRight:function(){return this.right},getCoordinate:function(){return this.p},setLeft:function(t){this.left=t},getX:function(){return this.p.x},getData:function(){return this.data},getCount:function(){return this.count},getLeft:function(){return this.left},getY:function(){return this.p.y},increment:function(){this.count=this.count+1},setRight:function(t){this.right=t},interfaces_:function(){return[]},getClass:function(){return KdNode}}),extend(KdTree.prototype,{insert:function(){if(1===arguments.length){var t=arguments[0];return this.insert(t,null)}if(2===arguments.length){var t=arguments[0],e=arguments[1];if(null===this.root)return this.root=new KdNode(t,e),this.root;if(this.tolerance>0){var n=this.findBestMatchNode(t);if(null!==n)return n.increment(),n}return this.insertExact(t,e)}},query:function(){var t=arguments,e=this;if(1===arguments.length){var n=arguments[0],i=new ArrayList;return this.query(n,i),i}if(2===arguments.length)if(arguments[0]instanceof Envelope&&hasInterface(arguments[1],List))!function(){var n=t[0],i=t[1];e.queryNode(e.root,n,!0,{interfaces_:function(){return[KdNodeVisitor]},visit:function(t){i.add(t)}})}();else if(arguments[0]instanceof Envelope&&hasInterface(arguments[1],KdNodeVisitor)){var n=arguments[0],r=arguments[1];this.queryNode(this.root,n,!0,r)}},queryNode:function(t,e,n,i){if(null===t)return null;var r=null,o=null,s=null;n?(r=e.getMinX(),o=e.getMaxX(),s=t.getX()):(r=e.getMinY(),o=e.getMaxY(),s=t.getY());var a=s>r,l=o>=s;a&&this.queryNode(t.getLeft(),e,!n,i),e.contains(t.getCoordinate())&&i.visit(t),l&&this.queryNode(t.getRight(),e,!n,i)},findBestMatchNode:function(t){var e=new BestMatchVisitor(t,this.tolerance);return this.query(e.queryEnvelope(),e),e.getNode()},isEmpty:function(){return null===this.root},insertExact:function(t,e){for(var n=this.root,i=this.root,r=!0,o=!0;null!==n;){if(null!==n){var s=t.distance(n.getCoordinate())<=this.tolerance;if(s)return n.increment(),n}o=r?t.x<n.getX():t.y<n.getY(),i=n,n=o?n.getLeft():n.getRight(),r=!r}this.numberOfNodes=this.numberOfNodes+1;var a=new KdNode(t,e);return o?i.setLeft(a):i.setRight(a),a},interfaces_:function(){return[]},getClass:function(){return KdTree}}),KdTree.toCoordinates=function(){if(1===arguments.length){var t=arguments[0];return KdTree.toCoordinates(t,!1)}if(2===arguments.length){for(var t=arguments[0],e=arguments[1],n=new CoordinateList,i=t.iterator();i.hasNext();)for(var r=i.next(),o=e?r.getCount():1,s=0;o>s;s++)n.add(r.getCoordinate(),!0);return n.toCoordinateArray()}},extend(BestMatchVisitor.prototype,{visit:function(t){var e=this.p.distance(t.getCoordinate()),n=e<=this.tolerance;if(!n)return null;var i=!1;(null===this.matchNode||e<this.matchDist||null!==this.matchNode&&e===this.matchDist&&t.getCoordinate().compareTo(this.matchNode.getCoordinate())<1)&&(i=!0),i&&(this.matchNode=t,this.matchDist=e)},queryEnvelope:function(){var t=new Envelope(this.p);return t.expandBy(this.tolerance),t},getNode:function(){return this.matchNode},interfaces_:function(){return[KdNodeVisitor]},getClass:function(){return BestMatchVisitor}}),KdTree.BestMatchVisitor=BestMatchVisitor,extend(ConformingDelaunayTriangulator.prototype,{getInitialVertices:function(){return this.initialVertices},getKDT:function(){return this.kdt},enforceConstraints:function(){this.addConstraintVertices();var t=0,e=0;do e=this.enforceGabriel(this.segments),t++;while(e>0&&t<ConformingDelaunayTriangulator.MAX_SPLIT_ITER)},insertSites:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertSite(n)}},getVertexFactory:function(){return this.vertexFactory},getPointArray:function(){for(var t=new Array(this.initialVertices.size()+this.segVertices.size()).fill(null),e=0,n=this.initialVertices.iterator();n.hasNext();){var i=n.next();t[e++]=i.getCoordinate()}for(var r=this.segVertices.iterator();r.hasNext();){var i=r.next();t[e++]=i.getCoordinate()}return t},setConstraints:function(t,e){this.segments=t,this.segVertices=e},computeConvexHull:function(){var t=new GeometryFactory,e=this.getPointArray(),n=new ConvexHull(e,t);this.convexHull=n.getConvexHull()},addConstraintVertices:function(){this.computeConvexHull(),this.insertSites(this.segVertices)},findNonGabrielPoint:function(t){var e=t.getStart(),n=t.getEnd(),i=new Coordinate((e.x+n.x)/2,(e.y+n.y)/2),r=e.distance(i),o=new Envelope(i);o.expandBy(r);for(var s=this.kdt.query(o),a=null,l=Double.MAX_VALUE,u=s.iterator();u.hasNext();){var c=u.next(),h=c.getCoordinate();if(!h.equals2D(e)&&!h.equals2D(n)){var d=i.distance(h);if(r>d){var g=d;(null===a||l>g)&&(a=h,l=g)}}}return a},getConstraintSegments:function(){return this.segments},setSplitPointFinder:function(t){this.splitFinder=t},getConvexHull:function(){return this.convexHull},getTolerance:function(){return this.tolerance},enforceGabriel:function(t){for(var e=new ArrayList,n=0,i=new ArrayList,r=t.iterator();r.hasNext();){var o=r.next(),s=this.findNonGabrielPoint(o);if(null!==s){this.splitPt=this.splitFinder.findSplitPoint(o,s);var a=this.createVertex(this.splitPt,o),l=(this.insertSite(a),new Segment(o.getStartX(),o.getStartY(),o.getStartZ(),a.getX(),a.getY(),a.getZ(),o.getData())),u=new Segment(a.getX(),a.getY(),a.getZ(),o.getEndX(),o.getEndY(),o.getEndZ(),o.getData());e.add(l),e.add(u),i.add(o),n+=1}}return t.removeAll(i),t.addAll(e),n},createVertex:function(){if(1===arguments.length){var t=arguments[0],e=null;return e=null!==this.vertexFactory?this.vertexFactory.createVertex(t,null):new ConstraintVertex(t)}if(2===arguments.length){var t=arguments[0],n=arguments[1],e=null;return e=null!==this.vertexFactory?this.vertexFactory.createVertex(t,n):new ConstraintVertex(t),e.setOnConstraint(!0),e}},getSubdivision:function(){return this.subdiv},computeBoundingBox:function(){var t=ConformingDelaunayTriangulator.computeVertexEnvelope(this.initialVertices),e=ConformingDelaunayTriangulator.computeVertexEnvelope(this.segVertices),n=new Envelope(t);n.expandToInclude(e);var i=.2*n.getWidth(),r=.2*n.getHeight(),o=Math.max(i,r);this.computeAreaEnv=new Envelope(n),this.computeAreaEnv.expandBy(o)},setVertexFactory:function(t){this.vertexFactory=t},formInitialDelaunay:function(){this.computeBoundingBox(),this.subdiv=new QuadEdgeSubdivision(this.computeAreaEnv,this.tolerance),this.subdiv.setLocator(new LastFoundQuadEdgeLocator(this.subdiv)),this.incDel=new IncrementalDelaunayTriangulator(this.subdiv),this.insertSites(this.initialVertices)},insertSite:function(){if(arguments[0]instanceof ConstraintVertex){var t=arguments[0],e=this.kdt.insert(t.getCoordinate(),t);if(e.isRepeated()){var n=e.getData();return n.merge(t),n}return this.incDel.insertSite(t),t}if(arguments[0]instanceof Coordinate){var i=arguments[0];this.insertSite(this.createVertex(i))}},interfaces_:function(){return[]},getClass:function(){return ConformingDelaunayTriangulator}}),ConformingDelaunayTriangulator.computeVertexEnvelope=function(t){for(var e=new Envelope,n=t.iterator();n.hasNext();){var i=n.next();e.expandToInclude(i.getCoordinate())}return e},ConformingDelaunayTriangulator.MAX_SPLIT_ITER=99,extend(DelaunayTriangulationBuilder.prototype,{create:function(){if(null!==this.subdiv)return null;var t=DelaunayTriangulationBuilder.envelope(this.siteCoords),e=DelaunayTriangulationBuilder.toVertices(this.siteCoords);this.subdiv=new QuadEdgeSubdivision(t,this.tolerance);var n=new IncrementalDelaunayTriangulator(this.subdiv);n.insertSites(e)},setTolerance:function(t){this.tolerance=t},setSites:function(){if(arguments[0]instanceof Geometry){var t=arguments[0];this.siteCoords=DelaunayTriangulationBuilder.extractUniqueCoordinates(t)}else if(hasInterface(arguments[0],Collection)){var e=arguments[0];this.siteCoords=DelaunayTriangulationBuilder.unique(CoordinateArrays.toCoordinateArray(e))}},getEdges:function(t){return this.create(),this.subdiv.getEdges(t)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(t){return this.create(),this.subdiv.getTriangles(t)},interfaces_:function(){return[]},getClass:function(){return DelaunayTriangulationBuilder}}),DelaunayTriangulationBuilder.extractUniqueCoordinates=function(t){if(null===t)return new CoordinateList;var e=t.getCoordinates();return DelaunayTriangulationBuilder.unique(e)},DelaunayTriangulationBuilder.envelope=function(t){for(var e=new Envelope,n=t.iterator();n.hasNext();){var i=n.next();e.expandToInclude(i)}return e},DelaunayTriangulationBuilder.unique=function(t){var e=CoordinateArrays.copyDeep(t);Arrays.sort(e);var n=new CoordinateList(e,!1);return n},DelaunayTriangulationBuilder.toVertices=function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Vertex(i))}return e},extend(ConformingDelaunayTriangulationBuilder.prototype,{createSiteVertices:function(t){for(var e=new ArrayList,n=t.iterator();n.hasNext();){var i=n.next();this.constraintVertexMap.containsKey(i)||e.add(new ConstraintVertex(i))}return e},create:function(){if(null!==this.subdiv)return null;var t=DelaunayTriangulationBuilder.envelope(this.siteCoords),e=new ArrayList;null!==this.constraintLines&&(t.expandToInclude(this.constraintLines.getEnvelopeInternal()),this.createVertices(this.constraintLines),e=ConformingDelaunayTriangulationBuilder.createConstraintSegments(this.constraintLines));var n=this.createSiteVertices(this.siteCoords),i=new ConformingDelaunayTriangulator(n,this.tolerance);i.setConstraints(e,new ArrayList(this.constraintVertexMap.values())),i.formInitialDelaunay(),i.enforceConstraints(),this.subdiv=i.getSubdivision()},setTolerance:function(t){this.tolerance=t},setConstraints:function(t){this.constraintLines=t},setSites:function(t){this.siteCoords=DelaunayTriangulationBuilder.extractUniqueCoordinates(t)},getEdges:function(t){return this.create(),this.subdiv.getEdges(t)},getSubdivision:function(){return this.create(),this.subdiv},getTriangles:function(t){return this.create(),this.subdiv.getTriangles(t)},createVertices:function(t){for(var e=t.getCoordinates(),n=0;n<e.length;n++){var i=new ConstraintVertex(e[n]);this.constraintVertexMap.put(e[n],i)}},interfaces_:function(){return[]},getClass:function(){return ConformingDelaunayTriangulationBuilder}}),ConformingDelaunayTriangulationBuilder.createConstraintSegments=function(){if(1===arguments.length){for(var t=arguments[0],e=LinearComponentExtracter.getLines(t),n=new ArrayList,i=e.iterator();i.hasNext();){var r=i.next();ConformingDelaunayTriangulationBuilder.createConstraintSegments(r,n)}return n}if(2===arguments.length)for(var o=arguments[0],s=arguments[1],a=o.getCoordinates(),i=1;i<a.length;i++)s.add(new Segment(a[i-1],a[i]))},extend(VoronoiDiagramBuilder.prototype,{create:function(){if(null!==this.subdiv)return null;var t=DelaunayTriangulationBuilder.envelope(this.siteCoords);this.diagramEnv=t;var e=Math.max(this.diagramEnv.getWidth(),this.diagramEnv.getHeight());this.diagramEnv.expandBy(e),null!==this.clipEnv&&this.diagramEnv.expandToInclude(this.clipEnv);var n=DelaunayTriangulationBuilder.toVertices(this.siteCoords);this.subdiv=new QuadEdgeSubdivision(t,this.tolerance);var i=new IncrementalDelaunayTriangulator(this.subdiv);i.insertSites(n)},getDiagram:function(t){this.create();var e=this.subdiv.getVoronoiDiagram(t);return VoronoiDiagramBuilder.clipGeometryCollection(e,this.diagramEnv)},setTolerance:function(t){this.tolerance=t},setSites:function(){if(arguments[0]instanceof Geometry){var t=arguments[0];this.siteCoords=DelaunayTriangulationBuilder.extractUniqueCoordinates(t)}else if(hasInterface(arguments[0],Collection)){var e=arguments[0];this.siteCoords=DelaunayTriangulationBuilder.unique(CoordinateArrays.toCoordinateArray(e))}},setClipEnvelope:function(t){this.clipEnv=t},getSubdivision:function(){return this.create(),this.subdiv},interfaces_:function(){return[]},getClass:function(){return VoronoiDiagramBuilder}}),VoronoiDiagramBuilder.clipGeometryCollection=function(t,e){for(var n=t.getFactory().toGeometry(e),i=new ArrayList,r=0;r<t.getNumGeometries();r++){var o=t.getGeometryN(r),s=null;e.contains(o.getEnvelopeInternal())?s=o:e.intersects(o.getEnvelopeInternal())&&(s=n.intersection(o),s.setUserData(o.getUserData())),null===s||s.isEmpty()||i.add(s)}return t.getFactory().createGeometryCollection(GeometryFactory.toGeometryArray(i))},extend(GeometryCollectionMapper.prototype,{map:function(t){for(var e=new ArrayList,n=0;n<t.getNumGeometries();n++){var i=this.mapOp.map(t.getGeometryN(n));i.isEmpty()||e.add(i)}return t.getFactory().createGeometryCollection(GeometryFactory.toGeometryArray(e))},interfaces_:function(){return[]},getClass:function(){return GeometryCollectionMapper}}),GeometryCollectionMapper.map=function(t,e){var n=new GeometryCollectionMapper(e);return n.map(t)},extend(RectangleContains.prototype,{isContainedInBoundary:function(t){if(t instanceof Polygon)return!1;if(t instanceof Point)return this.isPointContainedInBoundary(t);if(t instanceof LineString)return this.isLineStringContainedInBoundary(t);for(var e=0;e<t.getNumGeometries();e++){var n=t.getGeometryN(e);if(!this.isContainedInBoundary(n))return!1}return!0},isLineSegmentContainedInBoundary:function(t,e){if(t.equals(e))return this.isPointContainedInBoundary(t);if(t.x===e.x){if(t.x===this.rectEnv.getMinX()||t.x===this.rectEnv.getMaxX())return!0}else if(t.y===e.y&&(t.y===this.rectEnv.getMinY()||t.y===this.rectEnv.getMaxY()))return!0;return!1},isLineStringContainedInBoundary:function(t){for(var e=t.getCoordinateSequence(),n=new Coordinate,i=new Coordinate,r=0;r<e.size()-1;r++)if(e.getCoordinate(r,n),e.getCoordinate(r+1,i),!this.isLineSegmentContainedInBoundary(n,i))return!1;return!0},isPointContainedInBoundary:function(){if(arguments[0]instanceof Point){var t=arguments[0];return this.isPointContainedInBoundary(t.getCoordinate())}if(arguments[0]instanceof Coordinate){var e=arguments[0];return e.x===this.rectEnv.getMinX()||e.x===this.rectEnv.getMaxX()||e.y===this.rectEnv.getMinY()||e.y===this.rectEnv.getMaxY()}},contains:function(t){return this.rectEnv.contains(t.getEnvelopeInternal())?!this.isContainedInBoundary(t):!1},interfaces_:function(){return[]},getClass:function(){return RectangleContains}}),RectangleContains.contains=function(t,e){var n=new RectangleContains(t);return n.contains(e)},extend(RectangleLineIntersector.prototype,{intersects:function(t,e){var n=new Envelope(t,e);if(!this.rectEnv.intersects(n))return!1;if(this.rectEnv.intersects(t))return!0;if(this.rectEnv.intersects(e))return!0;if(t.compareTo(e)>0){var i=t;t=e,e=i}var r=!1;return e.y>t.y&&(r=!0),r?this.li.computeIntersection(t,e,this.diagDown0,this.diagDown1):this.li.computeIntersection(t,e,this.diagUp0,this.diagUp1),!!this.li.hasIntersection()},interfaces_:function(){return[]},getClass:function(){return RectangleLineIntersector}}),extend(ShortCircuitedGeometryVisitor.prototype,{applyTo:function(t){for(var e=0;e<t.getNumGeometries()&&!this._isDone;e++){var n=t.getGeometryN(e);if(n instanceof GeometryCollection)this.applyTo(n);else if(this.visit(n),this.isDone())return this._isDone=!0,null}},interfaces_:function(){return[]},getClass:function(){return ShortCircuitedGeometryVisitor}}),extend(RectangleIntersects.prototype,{intersects:function(t){if(!this.rectEnv.intersects(t.getEnvelopeInternal()))return!1;var e=new EnvelopeIntersectsVisitor(this.rectEnv);if(e.applyTo(t),e.intersects())return!0;var n=new GeometryContainsPointVisitor(this.rectangle);if(n.applyTo(t),n.containsPoint())return!0;var i=new RectangleIntersectsSegmentVisitor(this.rectangle);return i.applyTo(t),!!i.intersects()},interfaces_:function(){return[]},getClass:function(){return RectangleIntersects}}),RectangleIntersects.intersects=function(t,e){var n=new RectangleIntersects(t);return n.intersects(e)},inherits(EnvelopeIntersectsVisitor,ShortCircuitedGeometryVisitor),extend(EnvelopeIntersectsVisitor.prototype,{isDone:function(){return this._intersects===!0},visit:function(t){var e=t.getEnvelopeInternal();return this.rectEnv.intersects(e)?this.rectEnv.contains(e)?(this._intersects=!0,null):e.getMinX()>=this.rectEnv.getMinX()&&e.getMaxX()<=this.rectEnv.getMaxX()?(this._intersects=!0,null):e.getMinY()>=this.rectEnv.getMinY()&&e.getMaxY()<=this.rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return EnvelopeIntersectsVisitor}}),inherits(GeometryContainsPointVisitor,ShortCircuitedGeometryVisitor),extend(GeometryContainsPointVisitor.prototype,{isDone:function(){return this._containsPoint===!0},visit:function(t){if(!(t instanceof Polygon))return null;var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;for(var n=new Coordinate,i=0;4>i;i++)if(this.rectSeq.getCoordinate(i,n),e.contains(n)&&SimplePointInAreaLocator.containsPointInPolygon(n,t))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return GeometryContainsPointVisitor}}),inherits(RectangleIntersectsSegmentVisitor,ShortCircuitedGeometryVisitor),extend(RectangleIntersectsSegmentVisitor.prototype,{intersects:function(){return this.hasIntersection},isDone:function(){return this.hasIntersection===!0},visit:function(t){var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;var n=LinearComponentExtracter.getLines(t);this.checkIntersectionWithLineStrings(n)},checkIntersectionWithLineStrings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();if(this.checkIntersectionWithSegments(n),this.hasIntersection)return null}},checkIntersectionWithSegments:function(t){for(var e=t.getCoordinateSequence(),n=1;n<e.size();n++)if(e.getCoordinate(n-1,this.p0),e.getCoordinate(n,this.p1),this.rectIntersector.intersects(this.p0,this.p1))return this.hasIntersection=!0,null},interfaces_:function(){return[]},getClass:function(){return RectangleIntersectsSegmentVisitor}}),function(){patch()}();var jsts={version:"1.0.0-rc8 (59ac951)",algorithm:{Centroid:Centroid,CGAlgorithms:CGAlgorithms,ConvexHull:ConvexHull,InteriorPointArea:InteriorPointArea,InteriorPointLine:InteriorPointLine,InteriorPointPoint:InteriorPointPoint,RobustLineIntersector:RobustLineIntersector,MinimumBoundingCircle:MinimumBoundingCircle,MinimumDiameter:MinimumDiameter},densify:{Densifier:Densifier},dissolve:{LineDissolver:LineDissolver},geom:{Coordinate:Coordinate,Envelope:Envelope,LineSegment:LineSegment,GeometryFactory:GeometryFactory,Geometry:Geometry,Point:Point,LineString:LineString,LinearRing:LinearRing,Polygon:MultiPolygon,GeometryCollection:GeometryCollection,MultiPoint:MultiPoint,MultiLineString:MultiLineString,MultiPolygon:MultiPolygon,Dimension:Dimension,IntersectionMatrix:IntersectionMatrix},index:{quadtree:{Quadtree:Quadtree},strtree:{STRtree:STRtree}},io:io,noding:{MCIndexNoder:MCIndexNoder,ScaledNoder:ScaledNoder,SegmentString:SegmentString},operation:{BoundaryOp:BoundaryOp,IsSimpleOp:IsSimpleOp,buffer:{BufferOp:BufferOp},distance:{DistanceOp:DistanceOp},linemerge:{LineMerger:LineMerger},overlay:{OverlayOp:OverlayOp},polygonize:{Polygonizer:Polygonizer},relate:{RelateOp:RelateOp$1},union:{CascadedPolygonUnion:CascadedPolygonUnion,UnaryUnionOp:UnaryUnionOp},valid:{IsValidOp:IsValidOp}},precision:{GeometryPrecisionReducer:GeometryPrecisionReducer},simplify:{DouglasPeuckerSimplifier:DouglasPeuckerSimplifier,TopologyPreservingSimplifier:TopologyPreservingSimplifier},triangulate:{ConformingDelaunayTriangulationBuilder:ConformingDelaunayTriangulationBuilder,DelaunayTriangulationBuilder:DelaunayTriangulationBuilder,VoronoiDiagramBuilder:VoronoiDiagramBuilder}};module.exports=jsts;
| boneskull/cdnjs | ajax/libs/jsts/1.0.0-rc8/jsts.min.js | JavaScript | mit | 500,649 |
"undefined"==typeof PDFJS&&(("undefined"!=typeof window?window:this).PDFJS={}),PDFJS.version="1.0.982",PDFJS.build="f5df30f",function(){"use strict";function e(e){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos&&console.log("Info: "+e)}function t(e){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+e)}function a(e){if(arguments.length>1){var t=["Error:"];t.push.apply(t,arguments),console.log.apply(console,t),e=[].join.call(arguments," ")}else console.log("Error: "+e);throw console.log(r()),Y.notify(K.unknown),new Error(e)}function r(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function i(e,t){e||a(t)}function n(e,t){if(!e)return!1;var a=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(e);if(!a)return t;switch(a=a[0].toLowerCase()){case"http":case"https":case"ftp":case"mailto":return!0;default:return!1}}function o(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!1}),a}function s(e){var t=e.length,a=8192;if(a>t)return String.fromCharCode.apply(null,e);for(var r=[],i=0;t>i;i+=a){var n=Math.min(i+a,t),o=e.subarray(i,n);r.push(String.fromCharCode.apply(null,o))}return r.join("")}function c(e){for(var t=e.length,a=new Uint8Array(t),r=0;t>r;++r)a[r]=255&e.charCodeAt(r);return a}function l(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)}function h(e){for(var t=1,a=0;e>t;)t<<=1,a++;return a}function u(e,t){return e[t]<<24>>24}function f(e,t){return e[t]<<8|e[t+1]}function d(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function g(){var e=new Uint8Array(2);e[0]=1;var t=new Uint16Array(e.buffer);return 1===t[0]}function m(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d"),a=t.createImageData(1,1);return"undefined"!=typeof a.data.buffer}function p(e){var t,a=e.length,r=[];if("þ"===e[0]&&"ÿ"===e[1])for(t=2;a>t;t+=2)r.push(String.fromCharCode(e.charCodeAt(t)<<8|e.charCodeAt(t+1)));else for(t=0;a>t;++t){var i=le[e.charCodeAt(t)];r.push(i?String.fromCharCode(i):e.charAt(t))}return r.join("")}function b(e){return decodeURIComponent(escape(e))}function v(e){for(var t in e)return!1;return!0}function y(e){return"boolean"==typeof e}function k(e){return"number"==typeof e&&(0|e)===e}function w(e){return"number"==typeof e}function x(e){return"string"==typeof e}function C(e){return e instanceof ye}function S(e,t){return e instanceof ke&&(void 0===t||e.cmd===t)}function A(e,t){if(!(e instanceof we))return!1;if(!t)return!0;var a=e.get("Type");return C(a)&&a.name===t}function B(e){return e instanceof Array}function I(e){return"object"==typeof e&&null!==e&&void 0!==e.getBytes}function T(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength}function O(e){return e instanceof xe}function L(){var e={};return e.promise=new Promise(function(t,a){e.resolve=t,e.reject=a}),e}function R(e,t){this.name=e,this.comObj=t,this.callbackIndex=1,this.postMessageTransfers=!0;var r=this.callbacksCapabilities={},i=this.actionHandler={};i.console_log=[function(e){console.log.apply(console,e)}],i.console_error=[function(e){console.error.apply(console,e)}],i._unsupported_feature=[function(e){Y.notify(e)}],t.onmessage=function(e){var n=e.data;if(n.isReply){var o=n.callbackId;if(n.callbackId in r){var s=r[o];delete r[o],"error"in n?s.reject(n.error):s.resolve(n.data)}else a("Cannot resolve callback "+o)}else if(n.action in i){var c=i[n.action];n.callbackId?Promise.resolve().then(function(){return c[0].call(c[1],n.data)}).then(function(e){t.postMessage({isReply:!0,callbackId:n.callbackId,data:e})},function(e){t.postMessage({isReply:!0,callbackId:n.callbackId,error:e})}):c[0].call(c[1],n.data)}else a("Unknown action from worker: "+n.action)}}function P(e,t,a){var r=t.get("Matrix"),i=t.get("BBox"),n=t.get("XStep"),o=t.get("YStep"),s=t.get("PaintType"),c=t.get("TilingType");return["TilingPattern",a,e,r,i,n,o,s,c]}function M(e){return e>=65520&&65535>=e?0:e>=62976&&63743>=e?Gt[e]||e:e}function D(e){for(var t=0,a=Xt.length;a>t;t++){var r=Xt[t];if(e>=r.begin&&e<r.end)return t}return-1}function E(e){var t=Xt[13];return e>=t.begin&&e<t.end?!0:(t=Xt[11],e>=t.begin&&e<t.end)}function q(e){var t=e.length;if(1>=t||!E(e.charCodeAt(0)))return e;for(var a="",r=t-1;r>=0;r--)a+=e[r];return a}function U(e){if(e.fontMatrix[0]!==H[0]){var t=.001/e.fontMatrix[0],a=e.widths;for(var r in a)a[r]*=t;e.defaultWidth*=t}}function F(e,t){switch(e){case"Type1":return"Type1C"===t?V.TYPE1C:V.TYPE1;case"CIDFontType0":return"CIDFontType0C"===t?V.CIDFONTTYPE0C:V.CIDFONTTYPE0;case"OpenType":return V.OPENTYPE;case"TrueType":return V.TRUETYPE;case"CIDFontType2":return V.CIDFONTTYPE2;case"MMType1":return V.MMTYPE1;case"Type0":return V.TYPE0;default:return V.UNKNOWN}}function N(e,t,a){var r,i,n,o=Object.create(null);if(e.baseEncodingName)for(n=Ut[e.baseEncodingName],i=0;i<n.length;i++)r=a.indexOf(n[i]),r>=0&&(o[i]=r);else if(e.flags&qt.Symbolic)for(i in t)o[i]=t[i];else for(n=Ut.StandardEncoding,i=0;i<n.length;i++)r=a.indexOf(n[i]),r>=0&&(o[i]=r);var s=e.differences;if(s)for(i in s){var c=s[i];r=a.indexOf(c),r>=0&&(o[i]=r)}return o}function j(e){return e===Ca}var z="undefined"==typeof window?this:window,H=("undefined"==typeof window,[.001,0,0,.001,0,0]),G={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},X={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},_={WIDGET:1,TEXT:2,LINK:3},J={UNKNOWN:0,FLATE:1,LZW:2,DCT:3,JPX:4,JBIG:5,A85:6,AHX:7,CCF:8,RL:9},V={UNKNOWN:0,TYPE1:1,TYPE1C:2,CIDFONTTYPE0:3,CIDFONTTYPE0C:4,TRUETYPE:5,CIDFONTTYPE2:6,TYPE3:7,OPENTYPE:8,TYPE0:9,MMTYPE1:10};z.PDFJS||(z.PDFJS={}),z.PDFJS.pdfBug=!1,PDFJS.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};var W=PDFJS.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},K=PDFJS.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},Y=PDFJS.UnsupportedManager=function(){var e=[];return{listen:function(t){e.push(t)},notify:function(a){t('Unsupported feature "'+a+'"');for(var r=0,i=e.length;i>r;r++)e[r](a)}}}();PDFJS.isValidUrl=n;var Z=PDFJS.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},Q=function(){function e(e,t){this.name="PasswordException",this.message=e,this.code=t}return e.prototype=new Error,e.constructor=e,e}();PDFJS.PasswordException=Q;var $=function(){function e(e,t){this.name="UnknownErrorException",this.message=e,this.details=t}return e.prototype=new Error,e.constructor=e,e}();PDFJS.UnknownErrorException=$;var ee=function(){function e(e){this.name="InvalidPDFException",this.message=e}return e.prototype=new Error,e.constructor=e,e}();PDFJS.InvalidPDFException=ee;var te=function(){function e(e){this.name="MissingPDFException",this.message=e}return e.prototype=new Error,e.constructor=e,e}();PDFJS.MissingPDFException=te;var ae=function(){function e(e,t){this.name="UnexpectedResponseException",this.message=e,this.status=t}return e.prototype=new Error,e.constructor=e,e}();PDFJS.UnexpectedResponseException=ae;var re=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="NotImplementedException",e.constructor=e,e}(),ie=function(){function e(e,t){this.begin=e,this.end=t,this.message="Missing data ["+e+", "+t+")"}return e.prototype=new Error,e.prototype.name="MissingDataException",e.constructor=e,e}(),ne=function(){function e(e){this.message=e}return e.prototype=new Error,e.prototype.name="XRefParseException",e.constructor=e,e}();Object.defineProperty(PDFJS,"isLittleEndian",{configurable:!0,get:function(){return o(PDFJS,"isLittleEndian",g())}}),Object.defineProperty(PDFJS,"hasCanvasTypedArrays",{configurable:!0,get:function(){return o(PDFJS,"hasCanvasTypedArrays",m())}});var oe=function(){function e(e,t){this.buffer=e,this.byteLength=e.length,this.length=void 0===t?this.byteLength>>2:t,a(this.length)}function t(e){return{get:function(){var t=this.buffer,a=e<<2;return(t[a]|t[a+1]<<8|t[a+2]<<16|t[a+3]<<24)>>>0},set:function(t){var a=this.buffer,r=e<<2;a[r]=255&t,a[r+1]=t>>8&255,a[r+2]=t>>16&255,a[r+3]=t>>>24&255}}}function a(a){for(;a>r;)Object.defineProperty(e.prototype,r,t(r)),r++}e.prototype=Object.create(null);var r=0;return e}(),se=[1,0,0,1,0,0],ce=PDFJS.Util=function(){function e(){}var t=["rgb(",0,",",0,",",0,")"];return e.makeCssRgb=function(e,a,r){return t[1]=e,t[3]=a,t[5]=r,t.join("")},e.transform=function(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]},e.applyTransform=function(e,t){var a=e[0]*t[0]+e[1]*t[2]+t[4],r=e[0]*t[1]+e[1]*t[3]+t[5];return[a,r]},e.applyInverseTransform=function(e,t){var a=t[0]*t[3]-t[1]*t[2],r=(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/a,i=(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/a;return[r,i]},e.getAxialAlignedBoundingBox=function(t,a){var r=e.applyTransform(t,a),i=e.applyTransform(t.slice(2,4),a),n=e.applyTransform([t[0],t[3]],a),o=e.applyTransform([t[2],t[1]],a);return[Math.min(r[0],i[0],n[0],o[0]),Math.min(r[1],i[1],n[1],o[1]),Math.max(r[0],i[0],n[0],o[0]),Math.max(r[1],i[1],n[1],o[1])]},e.inverseTransform=function(e){var t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]},e.apply3dTransform=function(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]},e.singularValueDecompose2dScale=function(e){var t=[e[0],e[2],e[1],e[3]],a=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],i=e[2]*t[0]+e[3]*t[2],n=e[2]*t[1]+e[3]*t[3],o=(a+n)/2,s=Math.sqrt((a+n)*(a+n)-4*(a*n-i*r))/2,c=o+s||1,l=o-s||1;return[Math.sqrt(c),Math.sqrt(l)]},e.normalizeRect=function(e){var t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t},e.intersect=function(t,a){function r(e,t){return e-t}var i=[t[0],t[2],a[0],a[2]].sort(r),n=[t[1],t[3],a[1],a[3]].sort(r),o=[];return t=e.normalizeRect(t),a=e.normalizeRect(a),i[0]===t[0]&&i[1]===a[0]||i[0]===a[0]&&i[1]===t[0]?(o[0]=i[1],o[2]=i[2],n[0]===t[1]&&n[1]===a[1]||n[0]===a[1]&&n[1]===t[1]?(o[1]=n[1],o[3]=n[2],o):!1):!1},e.sign=function(e){return 0>e?-1:1},e.appendToArray=function(e,t){Array.prototype.push.apply(e,t)},e.prependToArray=function(e,t){Array.prototype.unshift.apply(e,t)},e.extendObj=function(e,t){for(var a in t)e[a]=t[a]},e.getInheritableProperty=function(e,t){for(;e&&!e.has(t);)e=e.get("Parent");return e?e.get(t):null},e.inherit=function(e,t,a){e.prototype=Object.create(t.prototype),e.prototype.constructor=e;for(var r in a)e.prototype[r]=a[r]},e.loadScript=function(e,t){var a=document.createElement("script"),r=!1;a.setAttribute("src",e),t&&(a.onload=function(){r||t(),r=!0}),document.getElementsByTagName("head")[0].appendChild(a)},e}(),le=(PDFJS.PageViewport=function(){function e(e,t,a,r,i,n){this.viewBox=e,this.scale=t,this.rotation=a,this.offsetX=r,this.offsetY=i;var o,s,c,l,h=(e[2]+e[0])/2,u=(e[3]+e[1])/2;switch(a%=360,a=0>a?a+360:a){case 180:o=-1,s=0,c=0,l=1;break;case 90:o=0,s=1,c=1,l=0;break;case 270:o=0,s=-1,c=-1,l=0;break;default:o=1,s=0,c=0,l=-1}n&&(c=-c,l=-l);var f,d,g,m;0===o?(f=Math.abs(u-e[1])*t+r,d=Math.abs(h-e[0])*t+i,g=Math.abs(e[3]-e[1])*t,m=Math.abs(e[2]-e[0])*t):(f=Math.abs(h-e[0])*t+r,d=Math.abs(u-e[1])*t+i,g=Math.abs(e[2]-e[0])*t,m=Math.abs(e[3]-e[1])*t),this.transform=[o*t,s*t,c*t,l*t,f-o*t*h-c*t*u,d-s*t*h-l*t*u],this.width=g,this.height=m,this.fontScale=t}return e.prototype={clone:function(t){t=t||{};var a="scale"in t?t.scale:this.scale,r="rotation"in t?t.rotation:this.rotation;return new e(this.viewBox.slice(),a,r,this.offsetX,this.offsetY,t.dontFlip)},convertToViewportPoint:function(e,t){return ce.applyTransform([e,t],this.transform)},convertToViewportRectangle:function(e){var t=ce.applyTransform([e[0],e[1]],this.transform),a=ce.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],a[0],a[1]]},convertToPdfPoint:function(e,t){return ce.applyInverseTransform([e,t],this.transform)}},e}(),[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364]);PDFJS.createPromiseCapability=L,function(){function e(e){this._status=a,this._handlers=[];try{e.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(t){this._reject(t)}}if(z.Promise)return"function"!=typeof z.Promise.all&&(z.Promise.all=function(e){var t,a,r=0,i=[],n=new z.Promise(function(e,r){t=e,a=r});return e.forEach(function(e,n){r++,e.then(function(e){i[n]=e,r--,0===r&&t(i)},a)}),0===r&&t(i),n}),"function"!=typeof z.Promise.resolve&&(z.Promise.resolve=function(e){return new z.Promise(function(t){t(e)})}),"function"!=typeof z.Promise.reject&&(z.Promise.reject=function(e){return new z.Promise(function(t,a){a(e)})}),void("function"!=typeof z.Promise.prototype["catch"]&&(z.Promise.prototype["catch"]=function(e){return z.Promise.prototype.then(void 0,e)}));var a=0,r=1,i=2,n=500,o={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(e){e._status!==a&&(this.handlers=this.handlers.concat(e._handlers),e._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var e=1,t=Date.now()+e;this.handlers.length>0;){var a=this.handlers.shift(),n=a.thisPromise._status,o=a.thisPromise._value;try{n===r?"function"==typeof a.onResolve&&(o=a.onResolve(o)):"function"==typeof a.onReject&&(o=a.onReject(o),n=r,a.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(a.thisPromise))}catch(s){n=i,o=s}if(a.nextPromise._updateStatus(n,o),Date.now()>=t)break}return this.handlers.length>0?void setTimeout(this.runHandlers.bind(this),0):void(this.running=!1)},addUnhandledRejection:function(e){this.unhandledRejections.push({promise:e,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(e){e._unhandledRejection=!1;for(var t=0;t<this.unhandledRejections.length;t++)this.unhandledRejections[t].promise===e&&(this.unhandledRejections.splice(t),t--)},scheduleRejectionCheck:function(){this.pendingRejectionCheck||(this.pendingRejectionCheck=!0,setTimeout(function(){this.pendingRejectionCheck=!1;for(var e=Date.now(),a=0;a<this.unhandledRejections.length;a++)if(e-this.unhandledRejections[a].time>n){var r=this.unhandledRejections[a].promise._value,i="Unhandled rejection: "+r;r.stack&&(i+="\n"+r.stack),t(i),this.unhandledRejections.splice(a),a--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),n))}};e.all=function(t){function a(e){o._status!==i&&(c=[],n(e))}var r,n,o=new e(function(e,t){r=e,n=t}),s=t.length,c=[];if(0===s)return r(c),o;for(var l=0,h=t.length;h>l;++l){var u=t[l],f=function(e){return function(t){o._status!==i&&(c[e]=t,s--,0===s&&r(c))}}(l);e.isPromise(u)?u.then(f,a):f(u)}return o},e.isPromise=function(e){return e&&"function"==typeof e.then},e.resolve=function(t){return new e(function(e){e(t)})},e.reject=function(t){return new e(function(e,a){a(t)})},e.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(t,a){if(this._status!==r&&this._status!==i){if(t===r&&e.isPromise(a))return void a.then(this._updateStatus.bind(this,r),this._updateStatus.bind(this,i));this._status=t,this._value=a,t===i&&0===this._handlers.length&&(this._unhandledRejection=!0,o.addUnhandledRejection(this)),o.scheduleHandlers(this)}},_resolve:function(e){this._updateStatus(r,e)},_reject:function(e){this._updateStatus(i,e)},then:function(t,a){var r=new e(function(e,t){this.resolve=e,this.reject=t});return this._handlers.push({thisPromise:this,onResolve:t,onReject:a,nextPromise:r}),o.scheduleHandlers(this),r},"catch":function(e){return this.then(void 0,e)}},z.Promise=e}();(function(){function e(e,t,a){for(;e.length<a;)e+=t;return e}function a(){this.started={},this.times=[],this.enabled=!0}return a.prototype={time:function(e){this.enabled&&(e in this.started&&t("Timer is already running for "+e),this.started[e]=Date.now())},timeEnd:function(e){this.enabled&&(e in this.started||t("Timer has not been started for "+e),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e])},toString:function(){var t,a,r=this.times,i="",n=0;for(t=0,a=r.length;a>t;++t){var o=r[t].name;o.length>n&&(n=o.length)}for(t=0,a=r.length;a>t;++t){var s=r[t],c=s.end-s.start;i+=e(s.name," ",n)+" "+c+"ms\n"}return i}},a})();PDFJS.createBlob=function(e,t){if("undefined"!=typeof Blob)return new Blob([e],{type:t});var a=new MozBlobBuilder;return a.append(e),a.getBlob(t)},PDFJS.createObjectURL=function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(t,a){if(!PDFJS.disableCreateObjectURL&&"undefined"!=typeof URL&&URL.createObjectURL){var r=PDFJS.createBlob(t,a);return URL.createObjectURL(r)}for(var i="data:"+a+";base64,",n=0,o=t.length;o>n;n+=3){var s=255&t[n],c=255&t[n+1],l=255&t[n+2],h=s>>2,u=(3&s)<<4|c>>4,f=o>n+1?(15&c)<<2|l>>6:64,d=o>n+2?63&l:64;i+=e[h]+e[u]+e[f]+e[d]}return i}}(),R.prototype={on:function(e,t,r){var i=this.actionHandler;i[e]&&a('There is already an actionName called "'+e+'"'),i[e]=[t,r]},send:function(e,t,a){var r={action:e,data:t};this.postMessage(r,a)},sendWithPromise:function(e,t,a){var r=this.callbackIndex++,i={action:e,data:t,callbackId:r},n=L();this.callbacksCapabilities[r]=n;try{this.postMessage(i,a)}catch(o){n.reject(o)}return n.promise},postMessage:function(e,t){t&&this.postMessageTransfers?this.comObj.postMessage(e,t):this.comObj.postMessage(e)}};var he=function(){function e(e,t){this.url=e,t=t||{},this.isHttp=/^https?:/i.test(e),this.httpHeaders=this.isHttp&&t.httpHeaders||{},this.withCredentials=t.withCredentials||!1,this.getXhr=t.getXhr||function(){return new XMLHttpRequest},this.currXhrId=0,this.pendingRequests={},this.loadedRequests={}}function t(e){var t=e.response;if("string"!=typeof t)return t;for(var a=t.length,r=new Uint8Array(a),i=0;a>i;i++)r[i]=255&t.charCodeAt(i);return r.buffer}var a=200,r=206;return e.prototype={requestRange:function(e,t,a){var r={begin:e,end:t};for(var i in a)r[i]=a[i];return this.request(r)},requestFull:function(e){return this.request(e)},request:function(e){var t=this.getXhr(),a=this.currXhrId++,r=this.pendingRequests[a]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(var i in this.httpHeaders){var n=this.httpHeaders[i];"undefined"!=typeof n&&t.setRequestHeader(i,n)}if(this.isHttp&&"begin"in e&&"end"in e){var o=e.begin+"-"+(e.end-1);t.setRequestHeader("Range","bytes="+o),r.expectedStatus=206}else r.expectedStatus=200;if(e.onProgressiveData){try{t.responseType="moz-chunked-arraybuffer"}catch(s){}"moz-chunked-arraybuffer"===t.responseType?(r.onProgressiveData=e.onProgressiveData,r.mozChunked=!0):t.responseType="arraybuffer"}else t.responseType="arraybuffer";return e.onError&&(t.onerror=function(a){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,a),t.onprogress=this.onProgress.bind(this,a),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),a},onProgress:function(e,a){var r=this.pendingRequests[e];if(r){if(r.mozChunked){var i=t(r.xhr);r.onProgressiveData(i)}var n=r.onProgress;n&&n(a)}},onStateChange:function(e,i){var n=this.pendingRequests[e];if(n){var o=n.xhr;if(o.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),4===o.readyState&&e in this.pendingRequests){if(delete this.pendingRequests[e],0===o.status&&this.isHttp)return void(n.onError&&n.onError(o.status));var s=o.status||a,c=s===a&&n.expectedStatus===r;if(!c&&s!==n.expectedStatus)return void(n.onError&&n.onError(o.status));this.loadedRequests[e]=!0;var l=t(o);if(s===r){var h=o.getResponseHeader("Content-Range"),u=/bytes (\d+)-(\d+)\/(\d+)/.exec(h),f=parseInt(u[1],10);n.onDone({begin:f,chunk:l})}else n.onProgressiveData?n.onDone(null):n.onDone({begin:0,chunk:l})}}},hasPendingRequests:function(){for(var e in this.pendingRequests)return!0;return!1},getRequestXhr:function(e){return this.pendingRequests[e].xhr},isStreamingRequest:function(e){return!!this.pendingRequests[e].onProgressiveData},isPendingRequest:function(e){return e in this.pendingRequests},isLoadedRequest:function(e){return e in this.loadedRequests},abortAllRequests:function(){for(var e in this.pendingRequests)this.abortRequest(0|e)},abortRequest:function(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},e}(),ue=function(){function e(e,t,a){this.bytes=new Uint8Array(e),this.start=0,this.pos=0,this.end=e,this.chunkSize=t,this.loadedChunks=[],this.numChunksLoaded=0,this.numChunks=Math.ceil(e/t),this.manager=a,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}return e.prototype={getMissingChunks:function(){for(var e=[],t=0,a=this.numChunks;a>t;++t)this.loadedChunks[t]||e.push(t);return e},getBaseStreams:function(){return[this]},allChunksLoaded:function(){return this.numChunksLoaded===this.numChunks},onReceiveData:function(e,t){var a=e+t.byteLength;i(e%this.chunkSize===0,"Bad begin offset: "+e);var r=this.bytes.length;i(a%this.chunkSize===0||a===r,"Bad end offset: "+a),this.bytes.set(new Uint8Array(t),e);var n,o=this.chunkSize,s=Math.floor(e/o),c=Math.floor((a-1)/o)+1;for(n=s;c>n;++n)this.loadedChunks[n]||(this.loadedChunks[n]=!0,++this.numChunksLoaded)},onReceiveProgressiveData:function(e){var t=this.progressiveDataLength,a=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t),t+=e.byteLength,this.progressiveDataLength=t;var r,i=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(r=a;i>r;++r)this.loadedChunks[r]||(this.loadedChunks[r]=!0,++this.numChunksLoaded)},ensureByte:function(e){var t=Math.floor(e/this.chunkSize);if(t!==this.lastSuccessfulEnsureByteChunk){if(!this.loadedChunks[t])throw new ie(e,e+1);this.lastSuccessfulEnsureByteChunk=t}},ensureRange:function(e,t){if(!(e>=t||t<=this.progressiveDataLength))for(var a=this.chunkSize,r=Math.floor(e/a),i=Math.floor((t-1)/a)+1,n=r;i>n;++n)if(!this.loadedChunks[n])throw new ie(e,t)},nextEmptyChunk:function(e){var t,a;for(t=e,a=this.numChunks;a>t;++t)if(!this.loadedChunks[t])return t;for(t=0;e>t;++t)if(!this.loadedChunks[t])return t;return null},hasChunk:function(e){return!!this.loadedChunks[e]},get length(){return this.end-this.start},get isEmpty(){return 0===this.length},getByte:function(){var e=this.pos;return e>=this.end?-1:(this.ensureByte(e),this.bytes[this.pos++])},getUint16:function(){var e=this.getByte(),t=this.getByte();return(e<<8)+t},getInt32:function(){var e=this.getByte(),t=this.getByte(),a=this.getByte(),r=this.getByte();return(e<<24)+(t<<16)+(a<<8)+r},getBytes:function(e){var t=this.bytes,a=this.pos,r=this.end;if(!e)return this.ensureRange(a,r),t.subarray(a,r);var i=a+e;return i>r&&(i=r),this.ensureRange(a,i),this.pos=i,t.subarray(a,i)},peekByte:function(){var e=this.getByte();return this.pos--,e},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},getByteRange:function(e,t){return this.ensureRange(e,t),this.bytes.subarray(e,t)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(e,t,a){function r(){}this.ensureRange(e,e+t),r.prototype=Object.create(this),r.prototype.getMissingChunks=function(){for(var e=this.chunkSize,t=Math.floor(this.start/e),a=Math.floor((this.end-1)/e)+1,r=[],i=t;a>i;++i)this.loadedChunks[i]||r.push(i);return r};var i=new r;return i.pos=i.start=e,i.end=e+t||this.end,i.dict=a,i},isStream:!0},e}(),fe=function(){function e(e,t,a,r){this.stream=new ue(e,t,this),this.length=e,this.chunkSize=t,this.url=a,this.disableAutoFetch=r.disableAutoFetch;var i=this.msgHandler=r.msgHandler;if(r.chunkedViewerLoading)i.on("OnDataRange",this.onReceiveData.bind(this)),i.on("OnDataProgress",this.onProgress.bind(this)),this.sendRequest=function(e,t){i.send("RequestDataRange",{begin:e,end:t})};else{var n=function(){return new XMLHttpRequest};this.networkManager=new he(this.url,{getXhr:n,httpHeaders:r.httpHeaders,withCredentials:r.withCredentials}),this.sendRequest=function(e,t){this.networkManager.requestRange(e,t,{onDone:this.onReceiveData.bind(this),onProgress:this.onProgress.bind(this)})}}this.currRequestId=0,this.chunksNeededByRequest={},this.requestsByChunk={},this.callbacksByRequest={},this.progressiveDataLength=0,this._loadedStreamCapability=L(),r.initialData&&this.onReceiveData({chunk:r.initialData})}return e.prototype={onLoadedStream:function(){return this._loadedStreamCapability.promise},requestAllChunks:function(){var e=this.stream.getMissingChunks();return this.requestChunks(e),this._loadedStreamCapability.promise},requestChunks:function(e,t){var a,r,i,n=this.currRequestId++;for(this.chunksNeededByRequest[n]=a={},r=0,i=e.length;i>r;r++)this.stream.hasChunk(e[r])||(a[e[r]]=!0);if(v(a))return void(t&&t());this.callbacksByRequest[n]=t;var o=[];for(var s in a)s=0|s,s in this.requestsByChunk||(this.requestsByChunk[s]=[],o.push(s)),this.requestsByChunk[s].push(n);if(o.length){var c=this.groupChunks(o);for(r=0;r<c.length;++r){var l=c[r],h=l.beginChunk*this.chunkSize,u=Math.min(l.endChunk*this.chunkSize,this.length);this.sendRequest(h,u)}}},getStream:function(){return this.stream},requestRange:function(e,t,a){t=Math.min(t,this.length);for(var r=this.getBeginChunk(e),i=this.getEndChunk(t),n=[],o=r;i>o;++o)n.push(o);this.requestChunks(n,a)},requestRanges:function(e,t){e=e||[];for(var a=[],r=0;r<e.length;r++)for(var i=this.getBeginChunk(e[r].begin),n=this.getEndChunk(e[r].end),o=i;n>o;++o)a.indexOf(o)<0&&a.push(o);a.sort(function(e,t){return e-t}),this.requestChunks(a,t)},groupChunks:function(e){for(var t=[],a=-1,r=-1,i=0;i<e.length;++i){var n=e[i];0>a&&(a=n),r>=0&&r+1!==n&&(t.push({beginChunk:a,endChunk:r+1}),a=n),i+1===e.length&&t.push({beginChunk:a,endChunk:n+1}),r=n}return t},onProgress:function(e){var t=this.stream.numChunksLoaded*this.chunkSize+e.loaded;this.msgHandler.send("DocProgress",{loaded:t,total:this.length})},onReceiveData:function(e){var t=e.chunk,a=void 0===e.begin,r=a?this.progressiveDataLength:e.begin,i=r+t.byteLength,n=Math.floor(r/this.chunkSize),o=i<this.length?Math.floor(i/this.chunkSize):Math.ceil(i/this.chunkSize);a?(this.stream.onReceiveProgressiveData(t),this.progressiveDataLength=i):this.stream.onReceiveData(r,t),this.stream.allChunksLoaded()&&this._loadedStreamCapability.resolve(this.stream);var s,c,l=[];for(t=n;o>t;++t){var h=this.requestsByChunk[t]||[];for(delete this.requestsByChunk[t],s=0;s<h.length;++s){c=h[s];var u=this.chunksNeededByRequest[c];t in u&&delete u[t],v(u)&&l.push(c)}}if(!this.disableAutoFetch&&v(this.requestsByChunk)){var f;if(1===this.stream.numChunksLoaded){var d=this.stream.numChunks-1;this.stream.hasChunk(d)||(f=d)}else f=this.stream.nextEmptyChunk(o);k(f)&&this.requestChunks([f])}for(s=0;s<l.length;++s){c=l[s];var g=this.callbacksByRequest[c];delete this.callbacksByRequest[c],g&&g()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})},onError:function(e){this._loadedStreamCapability.reject(e)},getBeginChunk:function(e){var t=Math.floor(e/this.chunkSize);return t},getEndChunk:function(e){if(e%this.chunkSize===0)return e/this.chunkSize;var t=Math.floor((e-1)/this.chunkSize)+1;return t}},e}(),de=65536,ge=function(){function e(){throw new Error("Cannot initialize BaseManagerManager")}return e.prototype={onLoadedStream:function(){throw new re},ensureDoc:function(e,t){return this.ensure(this.pdfDocument,e,t)},ensureXRef:function(e,t){return this.ensure(this.pdfDocument.xref,e,t)},ensureCatalog:function(e,t){return this.ensure(this.pdfDocument.catalog,e,t)},getPage:function(e){return this.pdfDocument.getPage(e)},cleanup:function(){return this.pdfDocument.cleanup()},ensure:function(e,t,a){return new re},requestRange:function(e,t){return new re},requestLoadedStream:function(){return new re},sendProgressiveData:function(e){return new re},updatePassword:function(e){this.pdfDocument.xref.password=this.password=e,this._passwordChangedCapability&&this._passwordChangedCapability.resolve()},passwordChanged:function(){return this._passwordChangedCapability=L(),this._passwordChangedCapability.promise},terminate:function(){return new re}},e}(),me=function(){function e(e,t){var a=new Pa(e);this.pdfDocument=new ve(this,a,t),this._loadedStreamCapability=L(),this._loadedStreamCapability.resolve(a)}return e.prototype=Object.create(ge.prototype),e.prototype.constructor=e,e.prototype.ensure=function(e,t,a){return new Promise(function(r,i){try{var n,o=e[t];n="function"==typeof o?o.apply(e,a):o,r(n)}catch(s){i(s)}})},e.prototype.requestRange=function(e,t){return Promise.resolve()},e.prototype.requestLoadedStream=function(){},e.prototype.onLoadedStream=function(){return this._loadedStreamCapability.promise},e.prototype.terminate=function(){},e}(),pe=function(){function e(e,t){this.msgHandler=t;var a={msgHandler:t,httpHeaders:e.httpHeaders,withCredentials:e.withCredentials,chunkedViewerLoading:e.chunkedViewerLoading,disableAutoFetch:e.disableAutoFetch,initialData:e.initialData};this.streamManager=new fe(e.length,de,e.url,a),this.pdfDocument=new ve(this,this.streamManager.getStream(),e.password)}return e.prototype=Object.create(ge.prototype),e.prototype.constructor=e,e.prototype.ensure=function(e,t,a){var r=this;return new Promise(function(i,n){function o(){try{var s,c=e[t];s="function"==typeof c?c.apply(e,a):c,i(s)}catch(l){if(!(l instanceof ie))return void n(l);r.streamManager.requestRange(l.begin,l.end,o)}}o()})},e.prototype.requestRange=function(e,t){return new Promise(function(a){this.streamManager.requestRange(e,t,function(){a()})}.bind(this))},e.prototype.requestLoadedStream=function(){this.streamManager.requestAllChunks()},e.prototype.sendProgressiveData=function(e){this.streamManager.onReceiveData({chunk:e})},e.prototype.onLoadedStream=function(){return this.streamManager.onLoadedStream()},e.prototype.terminate=function(){this.streamManager.networkManager.abortAllRequests()},e}(),be=function(){function e(e,t,a,r,i,n){this.pdfManager=e,this.pageIndex=a,this.pageDict=r,this.xref=t,this.ref=i,this.fontCache=n,this.idCounters={obj:0},this.resourcesPromise=null}var t=[0,0,612,792];return e.prototype={getPageProp:function(e){
return this.pageDict.get(e)},getInheritedPageProp:function(e){for(var t=this.pageDict,a=t.get(e);void 0===a&&(t=t.get("Parent"));)a=t.get(e);return a},get content(){return this.getPageProp("Contents")},get resources(){var e=this.getInheritedPageProp("Resources");return void 0===e&&(e=we.empty),o(this,"resources",e)},get mediaBox(){var e=this.getInheritedPageProp("MediaBox");return B(e)&&4===e.length||(e=t),o(this,"mediaBox",e)},get view(){var e=this.mediaBox,t=this.getInheritedPageProp("CropBox");return B(t)&&4===t.length?(t=ce.intersect(t,e),t?o(this,"view",t):o(this,"view",e)):o(this,"view",e)},get annotationRefs(){return o(this,"annotationRefs",this.getInheritedPageProp("Annots"))},get rotate(){var e=this.getInheritedPageProp("Rotate")||0;return e%90!==0?e=0:e>=360?e%=360:0>e&&(e=(e%360+360)%360),o(this,"rotate",e)},getContentStream:function(){var e,t=this.content;if(B(t)){var a,r=this.xref,i=t.length,n=[];for(a=0;i>a;++a)n.push(r.fetchIfRef(t[a]));e=new Ea(n)}else e=I(t)?t:new Va;return e},loadResources:function(e){return this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources")),this.resourcesPromise.then(function(){var t=new Oe(this.resources.map,e,this.xref);return t.load()}.bind(this))},getOperatorList:function(e,t){var a=this,r=this.pdfManager,i=r.ensure(this,"getContentStream",[]),n=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),o=new bt(r,this.xref,e,this.pageIndex,"p"+this.pageIndex+"_",this.idCounters,this.fontCache),s=Promise.all([i,n]),c=s.then(function(r){var i=r[0],n=new yt(t,e,a.pageIndex);return e.send("StartRenderPage",{transparency:o.hasBlendModes(a.resources),pageIndex:a.pageIndex,intent:t}),o.getOperatorList(i,a.resources,n).then(function(){return n})}),l=r.ensure(this,"annotations");return Promise.all([c,l]).then(function(e){var a=e[0],i=e[1];if(0===i.length)return a.flush(!0),a;var n=Ee.appendToOperatorList(i,a,r,o,t);return n.then(function(){return a.flush(!0),a})})},extractTextContent:function(){var e={on:function(){},send:function(){}},t=this,a=this.pdfManager,r=a.ensure(this,"getContentStream",[]),i=this.loadResources(["ExtGState","XObject","Font"]),n=Promise.all([r,i]);return n.then(function(r){var i=r[0],n=new bt(a,t.xref,e,t.pageIndex,"p"+t.pageIndex+"_",t.idCounters,t.fontCache);return n.getTextContent(i,t.resources)})},getAnnotationsData:function(){for(var e=this.annotations,t=[],a=0,r=e.length;r>a;++a)t.push(e[a].getData());return t},get annotations(){for(var e=[],t=this.annotationRefs||[],a=0,r=t.length;r>a;++a){var i=t[a],n=Ee.fromRef(this.xref,i);n&&e.push(n)}return o(this,"annotations",e)}},e}(),ve=function(){function t(e,t,i){I(t)?r.call(this,e,t,i):T(t)?r.call(this,e,new Pa(t),i):a("PDFDocument: Unknown argument type")}function r(e,t,a){i(t.length>0,"stream must have data"),this.pdfManager=e,this.stream=t;var r=new Be(this.stream,a,e);this.xref=r}function n(e,t,a,r){var i=e.pos,n=e.end,o=[];i+a>n&&(a=n-i);for(var s=0;a>s;++s)o.push(String.fromCharCode(e.getByte()));var c=o.join("");e.pos=i;var l=r?c.lastIndexOf(t):c.indexOf(t);return-1===l?!1:(e.pos+=l,!0)}var s={get entries(){return o(this,"entries",{Title:x,Author:x,Subject:x,Keywords:x,Creator:x,Producer:x,CreationDate:x,ModDate:x,Trapped:C})}};return t.prototype={parse:function(t){this.setup(t);try{if(this.acroForm=this.catalog.catDict.get("AcroForm"),this.acroForm){this.xfa=this.acroForm.get("XFA");var a=this.acroForm.get("Fields");a&&B(a)&&0!==a.length||this.xfa||(this.acroForm=null)}}catch(r){e("Something wrong with AcroForm entry"),this.acroForm=null}},get linearization(){var t=null;if(this.stream.length)try{t=Ia.create(this.stream)}catch(a){if(a instanceof ie)throw a;e(a)}return o(this,"linearization",t)},get startXRef(){var e=this.stream,t=0,a=this.linearization;if(a)e.reset(),n(e,"endobj",1024)&&(t=e.pos+6);else{for(var r=1024,i=!1,s=e.end;!i&&s>0;)s-=r-"startxref".length,0>s&&(s=0),e.pos=s,i=n(e,"startxref",r,!0);if(i){e.skip(9);var c;do c=e.getByte();while(Ba.isSpace(c));for(var l="";c>=32&&57>=c;)l+=String.fromCharCode(c),c=e.getByte();t=parseInt(l,10),isNaN(t)&&(t=0)}}return o(this,"startXRef",t)},get mainXRefEntriesOffset(){var e=0,t=this.linearization;return t&&(e=t.mainXRefEntriesOffset),o(this,"mainXRefEntriesOffset",e)},checkHeader:function(){var e=this.stream;if(e.reset(),n(e,"%PDF-",1024)){e.moveStart();for(var t,a=12,r="";(t=e.getByte())>32&&!(r.length>=a);)r+=String.fromCharCode(t);return void(this.pdfFormatVersion=r.substring(5))}},parseStartXRef:function(){var e=this.startXRef;this.xref.setStartXRef(e)},setup:function(e){this.xref.parse(e),this.catalog=new Ae(this.pdfManager,this.xref)},get numPages(){var e=this.linearization,t=e?e.numPages:this.catalog.numPages;return o(this,"numPages",t)},get documentInfo(){var t,a={PDFFormatVersion:this.pdfFormatVersion,IsAcroFormPresent:!!this.acroForm,IsXFAPresent:!!this.xfa};try{t=this.xref.trailer.get("Info")}catch(r){e("The document information dictionary is invalid.")}if(t){var i=s.entries;for(var n in i)if(t.has(n)){var c=t.get(n);i[n](c)?a[n]="string"!=typeof c?c:p(c):e('Bad value in document info for "'+n+'"')}}return o(this,"documentInfo",a)},get fingerprint(){var e,t=this.xref,a="";e=t.trailer.has("ID")?c(t.trailer.get("ID")[0]):at(this.stream.bytes.subarray(0,100),0,100);for(var r=0,i=e.length;i>r;r++)a+=e[r].toString(16);return o(this,"fingerprint",a)},getPage:function(e){return this.catalog.getPage(e)},cleanup:function(){return this.catalog.cleanup()}},t}(),ye=function(){function e(e){this.name=e}e.prototype={};var t={};return e.get=function(a){var r=t[a];return r?r:t[a]=new e(a)},e}(),ke=function(){function e(e){this.cmd=e}e.prototype={};var t={};return e.get=function(a){var r=t[a];return r?r:t[a]=new e(a)},e}(),we=function(){function e(e){if(!C(e.Type))return!0;var t=e.Type.name;return r[t]===!0}function t(e){this.map=Object.create(null),this.xref=e,this.objId=null,this.__nonSerializable__=a}var a=function(){return a},r={Background:!0,ExtGState:!0,Halftone:!0,Layout:!0,Mask:!0,Pagination:!0,Printing:!0};return t.prototype={assignXref:function(e){this.xref=e},get:function(e,t,a){var r,i=this.xref;return"undefined"!=typeof(r=this.map[e])||e in this.map||"undefined"==typeof t?i?i.fetchIfRef(r):r:"undefined"!=typeof(r=this.map[t])||t in this.map||"undefined"==typeof a?i?i.fetchIfRef(r):r:(r=this.map[a]||null,i?i.fetchIfRef(r):r)},getAsync:function(e,t,a){var r,i=this.xref;return"undefined"!=typeof(r=this.map[e])||e in this.map||"undefined"==typeof t?i?i.fetchIfRefAsync(r):Promise.resolve(r):"undefined"!=typeof(r=this.map[t])||t in this.map||"undefined"==typeof a?i?i.fetchIfRefAsync(r):Promise.resolve(r):(r=this.map[a]||null,i?i.fetchIfRefAsync(r):Promise.resolve(r))},getRaw:function(e){return this.map[e]},getAll:function(){var a,r,i=Object.create(null),n=null;for(a in this.map)r=this.get(a),r instanceof t?e(r)?(n||(n=[])).push({target:i,key:a,obj:r}):i[a]=this.getRaw(a):i[a]=r;if(!n)return i;for(var o=Object.create(null);n.length>0;){var s=n.shift(),c=s.obj,l=c.objId;if(l&&l in o)s.target[s.key]=o[l];else{var h=Object.create(null);for(a in c.map)r=c.get(a),r instanceof t?e(r)?n.push({target:h,key:a,obj:r}):h[a]=c.getRaw(a):h[a]=r;l&&(o[l]=h),s.target[s.key]=h}}return i},set:function(e,t){this.map[e]=t},has:function(e){return e in this.map},forEach:function(e){for(var t in this.map)e(t,this.get(t))}},t.empty=new t(null),t}(),xe=function(){function e(e,t){this.num=e,this.gen=t}return e.prototype={toString:function(){var e=this.num+"R";return 0!==this.gen&&(e+=this.gen),e}},e}(),Ce=function(){function e(){this.dict={}}return e.prototype={has:function(e){return e.toString()in this.dict},put:function(e){this.dict[e.toString()]=!0},remove:function(e){delete this.dict[e.toString()]}},e}(),Se=function(){function e(){this.dict=Object.create(null)}return e.prototype={get:function(e){return this.dict[e.toString()]},has:function(e){return e.toString()in this.dict},put:function(e,t){this.dict[e.toString()]=t},putAlias:function(e,t){this.dict[e.toString()]=this.get(t)},forEach:function(e,t){for(var a in this.dict)e.call(t,this.dict[a])},clear:function(){this.dict=Object.create(null)}},e}(),Ae=function(){function r(e,t){this.pdfManager=e,this.xref=t,this.catDict=t.getCatalogObj(),this.fontCache=new Se,i(A(this.catDict),"catalog object is not a dictionary"),this.pagePromises=[]}return r.prototype={get metadata(){var t=this.catDict.getRaw("Metadata");if(!O(t))return o(this,"metadata",null);var a,r=this.xref.encrypt?this.xref.encrypt.encryptMetadata:!1,i=this.xref.fetch(t,!r);if(i&&A(i.dict)){var n=i.dict.get("Type"),c=i.dict.get("Subtype");if(C(n)&&C(c)&&"Metadata"===n.name&&"XML"===c.name)try{a=b(s(i.getBytes()))}catch(l){e("Skipping invalid metadata.")}}return o(this,"metadata",a)},get toplevelPagesDict(){var e=this.catDict.get("Pages");return i(A(e),"invalid top-level pages dictionary"),o(this,"toplevelPagesDict",e)},get documentOutline(){var e=null;try{e=this.readDocumentOutline()}catch(a){if(a instanceof ie)throw a;t("Unable to read document outline")}return o(this,"documentOutline",e)},readDocumentOutline:function(){var e=this.xref,t=this.catDict.get("Outlines"),r={items:[]};if(A(t)){t=t.getRaw("First");var i=new Ce;if(O(t)){var n=[{obj:t,parent:r}];for(i.put(t);n.length>0;){var o=n.shift(),s=e.fetchIfRef(o.obj);if(null!==s){s.has("Title")||a("Invalid outline item");var c=s.get("A");c?c=c.get("D"):s.has("Dest")&&(c=s.getRaw("Dest"),C(c)&&(c=c.name));var l=s.get("Title"),h={dest:c,title:p(l),color:s.get("C")||[0,0,0],count:s.get("Count"),bold:!!(2&s.get("F")),italic:!!(1&s.get("F")),items:[]};o.parent.items.push(h),t=s.getRaw("First"),O(t)&&!i.has(t)&&(n.push({obj:t,parent:h}),i.put(t)),t=s.getRaw("Next"),O(t)&&!i.has(t)&&(n.push({obj:t,parent:o.parent}),i.put(t))}}}}return r.items.length>0?r.items:null},get numPages(){var e=this.toplevelPagesDict.get("Count");return i(k(e),"page count in top level pages object is not an integer"),o(this,"num",e)},get destinations(){function e(e){return A(e)?e.get("D"):e}var t,a,r=this.xref,i={},n=this.catDict.get("Names");if(n&&n.has("Dests")?t=n.getRaw("Dests"):this.catDict.has("Dests")&&(a=this.catDict.get("Dests")),a&&(n=a,n.forEach(function(t,a){a&&(i[t]=e(a))})),t){var s=new Ie(t,r),c=s.getAll();for(var l in c)c.hasOwnProperty(l)&&(i[l]=e(c[l]))}return o(this,"destinations",i)},getDestination:function(e){function t(e){return A(e)?e.get("D"):e}var a,r,i,n=this.xref,o=this.catDict.get("Names");if(o&&o.has("Dests")?r=o.getRaw("Dests"):this.catDict.has("Dests")&&(i=this.catDict.get("Dests")),i&&(o=i,o.forEach(function(r,i){i&&r===e&&(a=t(i))})),r){var s=new Ie(r,n);a=t(s.get(e))}return a},get attachments(){var e,t=this.xref,a=null,r=this.catDict.get("Names");if(r&&(e=r.getRaw("EmbeddedFiles")),e){var i=new Ie(e,t),n=i.getAll();for(var s in n)if(n.hasOwnProperty(s)){var c=new Te(n[s],t);a||(a={}),a[p(s)]=c.serializable}}return o(this,"attachments",a)},get javaScript(){var e=this.xref,t=this.catDict.get("Names"),a=[];if(t&&t.has("JavaScript")){var r=new Ie(t.getRaw("JavaScript"),e),i=r.getAll();for(var n in i)if(i.hasOwnProperty(n)){var c=i[n];if(A(c)){var l=c.get("S");if(C(l)&&"JavaScript"===l.name){var h=c.get("JS");(x(h)||I(h))&&(I(h)&&(h=s(h.getBytes())),a.push(p(h)))}}}}var u=this.catDict.get("OpenAction");if(A(u)){var f=u.get("Type"),d=u.get("S"),g=u.get("N"),m=C(f)&&"Action"===f.name&&C(d)&&"Named"===d.name&&C(g)&&"Print"===g.name;m&&a.push("print(true);")}return o(this,"javaScript",a)},cleanup:function(){var e=[];return this.fontCache.forEach(function(t){e.push(t)}),Promise.all(e).then(function(e){for(var t=0,a=e.length;a>t;t++){var r=e[t].dict;delete r.translated}this.fontCache.clear()}.bind(this))},getPage:function(e){return e in this.pagePromises||(this.pagePromises[e]=this.getPageDict(e).then(function(t){var a=t[0],r=t[1];return new be(this.pdfManager,this.xref,e,a,r,this.fontCache)}.bind(this))),this.pagePromises[e]},getPageDict:function(e){function t(){for(;r.length;){var s=r.pop();if(O(s))return void o.fetchAsync(s).then(function(i){return A(i,"Page")||A(i)&&!i.has("Kids")?void(e===n?a.resolve([i,s]):(n++,t())):(r.push(i),void t())},a.reject);i(A(s),"page dictionary kid reference points to wrong type of object");var c=s.get("Count");if(e>=n+c)n+=c;else{var l=s.get("Kids");if(i(B(l),"page dictionary kids object is not an array"),c!==l.length)for(var h=l.length-1;h>=0;h--)r.push(l[h]);else r=[l[e-n]],n=e}}a.reject("Page index "+e+" not found.")}var a=L(),r=[this.catDict.getRaw("Pages")],n=0,o=this.xref;return t(),a.promise},getPageIndex:function(e){function t(e){var t,r=0;return n.fetchAsync(e).then(function(e){return e?(t=e.getRaw("Parent"),e.getAsync("Parent")):null}).then(function(e){return e?e.getAsync("Kids"):null}).then(function(o){if(!o)return null;for(var s=[],c=!1,l=0;l<o.length;l++){var h=o[l];if(i(O(h),"kids must be a ref"),h.num===e.num){c=!0;break}s.push(n.fetchAsync(h).then(function(e){if(e.has("Count")){var t=e.get("Count");r+=t}else r++}))}return c||a("kid ref not found in parents kids"),Promise.all(s).then(function(){return[r,t]})})}function r(e){return t(e).then(function(e){if(!e)return o;var t=e[0],a=e[1];return o+=t,r(a)})}var n=this.xref,o=0;return r(e)}},r}(),Be=function(){function r(e,t){this.stream=e,this.entries=[],this.xrefstms={},this.cache=[],this.password=t,this.stats={streamTypes:[],fontTypes:[]}}return r.prototype={setStartXRef:function(e){this.startXRefQueue=[e]},parse:function(e){var r;e?(t("Indexing all PDF objects"),r=this.indexObjects()):r=this.readXRef(),r.assignXref(this),this.trailer=r;var i=r.get("Encrypt");if(i){var n=r.get("ID"),o=n&&n.length?n[0]:"";this.encrypt=new dt(i,o,this.password)}(this.root=r.get("Root"))||a("Invalid root reference")},processXRefTable:function(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});var t=this.readXRefTable(e);S(t,"trailer")||a("Invalid XRef table: could not find trailer dictionary");var r=e.getObj();return!A(r)&&r.dict&&(r=r.dict),A(r)||a("Invalid XRef table: could not parse trailer dictionary"),delete this.tableState,r},readXRefTable:function(e){var t=e.lexer.stream,r=this.tableState;t.pos=r.streamPos,e.buf1=r.parserBuf1,e.buf2=r.parserBuf2;for(var i;;){if(!("firstEntryNum"in r&&"entryCount"in r)){if(S(i=e.getObj(),"trailer"))break;r.firstEntryNum=i,r.entryCount=e.getObj()}var n=r.firstEntryNum,o=r.entryCount;k(n)&&k(o)||a("Invalid XRef table: wrong types in subsection header");for(var s=r.entryNum;o>s;s++){r.streamPos=t.pos,r.entryNum=s,r.parserBuf1=e.buf1,r.parserBuf2=e.buf2;var c={};c.offset=e.getObj(),c.gen=e.getObj();var l=e.getObj();S(l,"f")?c.free=!0:S(l,"n")&&(c.uncompressed=!0),k(c.offset)&&k(c.gen)&&(c.free||c.uncompressed)||a("Invalid entry in XRef subsection: "+n+", "+o),this.entries[s+n]||(this.entries[s+n]=c)}r.entryNum=0,r.streamPos=t.pos,r.parserBuf1=e.buf1,r.parserBuf2=e.buf2,delete r.firstEntryNum,delete r.entryCount}return 1===n&&this.entries[1]&&this.entries[1].free&&this.entries.shift(),this.entries[0]&&!this.entries[0].free&&a("Invalid XRef table: unexpected first object"),i},processXRefStream:function(e){if(!("streamState"in this)){var t=e.dict,a=t.get("W"),r=t.get("Index");r||(r=[0,t.get("Size")]),this.streamState={entryRanges:r,byteWidths:a,entryNum:0,streamPos:e.pos}}return this.readXRefStream(e),delete this.streamState,e.dict},readXRefStream:function(e){var t,r,i=this.streamState;e.pos=i.streamPos;for(var n=i.byteWidths,o=n[0],s=n[1],c=n[2],l=i.entryRanges;l.length>0;){var h=l[0],u=l[1];for(k(h)&&k(u)||a("Invalid XRef range fields: "+h+", "+u),k(o)&&k(s)&&k(c)||a("Invalid XRef entry fields length: "+h+", "+u),t=i.entryNum;u>t;++t){i.entryNum=t,i.streamPos=e.pos;var f=0,d=0,g=0;for(r=0;o>r;++r)f=f<<8|e.getByte();for(0===o&&(f=1),r=0;s>r;++r)d=d<<8|e.getByte();for(r=0;c>r;++r)g=g<<8|e.getByte();var m={};switch(m.offset=d,m.gen=g,f){case 0:m.free=!0;break;case 1:m.uncompressed=!0;break;case 2:break;default:a("Invalid XRef entry type: "+f)}this.entries[h+t]||(this.entries[h+t]=m)}i.entryNum=0,i.streamPos=e.pos,l.splice(0,2)}},indexObjects:function(){function e(e,t){for(var a="",r=e[t];13!==r&&10!==r&&!(++t>=e.length);)a+=String.fromCharCode(r),r=e[t];return a}function t(e,t,a){for(var r=a.length,i=e.length,n=0;i>t;){for(var o=0;r>o&&e[t+o]===a[o];)++o;if(o>=r)break;t++,n++}return n}var a=new Uint8Array([116,114,97,105,108,101,114]),r=new Uint8Array([115,116,97,114,116,120,114,101,102]),i=new Uint8Array([101,110,100,111,98,106]),n=new Uint8Array([47,88,82,101,102]),o=this.stream;o.pos=0;for(var s=o.getBytes(),c=o.start,l=s.length,h=[],u=[];l>c;){var f=s[c];if(32!==f&&9!==f&&13!==f&&10!==f)if(37!==f){var d,g=e(s,c);if("xref"===g)c+=t(s,c,a),h.push(c),c+=t(s,c,r);else if(d=/^(\d+)\s+(\d+)\s+obj\b/.exec(g)){this.entries[d[1]]={offset:c,gen:0|d[2],uncompressed:!0};var m=t(s,c,i)+7,p=s.subarray(c,c+m),b=t(p,0,n);m>b&&p[b+5]<64&&(u.push(c),this.xrefstms[c]=1),c+=m}else c+=g.length+1}else do{if(++c,c>=l)break;f=s[c]}while(13!==f&&10!==f);else++c}var v,y;for(v=0,y=u.length;y>v;++v)this.startXRefQueue.push(u[v]),this.readXRef(!0);var k;for(v=0,y=h.length;y>v;++v){o.pos=h[v];var w=new Aa(new Ba(o),!0,this),x=w.getObj();if(S(x,"trailer")&&A(k=w.getObj())&&k.has("ID"))return k}if(k)return k;throw new ee("Invalid PDF structure")},readXRef:function(t){var r=this.stream;try{for(;this.startXRefQueue.length;){var i=this.startXRefQueue[0];r.pos=i+r.start;var n,o=new Aa(new Ba(r),!0,this),s=o.getObj();if(S(s,"xref")){if(n=this.processXRefTable(o),this.topDict||(this.topDict=n),s=n.get("XRefStm"),k(s)){var c=s;c in this.xrefstms||(this.xrefstms[c]=1,this.startXRefQueue.push(c))}}else k(s)?(k(o.getObj())&&S(o.getObj(),"obj")&&I(s=o.getObj())||a("Invalid XRef stream"),n=this.processXRefStream(s),this.topDict||(this.topDict=n),n||a("Failed to read XRef stream")):a("Invalid XRef stream header");s=n.get("Prev"),k(s)?this.startXRefQueue.push(s):O(s)&&this.startXRefQueue.push(s.num),this.startXRefQueue.shift()}return this.topDict}catch(l){if(l instanceof ie)throw l;e("(while reading XRef): "+l)}if(!t)throw new ne},getEntry:function(e){var t=this.entries[e];return t&&!t.free&&t.offset?t:null},fetchIfRef:function(e){return O(e)?this.fetch(e):e},fetch:function(e,t){i(O(e),"ref object is not a reference");var a=e.num;if(a in this.cache){var r=this.cache[a];return r}var n=this.getEntry(a);return null===n?this.cache[a]=null:(n=n.uncompressed?this.fetchUncompressed(e,n,t):this.fetchCompressed(n,t),A(n)?n.objId=e.toString():I(n)&&(n.dict.objId=e.toString()),n)},fetchUncompressed:function(e,t,r){var i=e.gen,n=e.num;t.gen!==i&&a("inconsistent generation in XRef");var o=this.stream.makeSubStream(t.offset+this.stream.start),s=new Aa(new Ba(o),!0,this),c=s.getObj(),l=s.getObj(),h=s.getObj();if(k(c)&&parseInt(c,10)===n&&k(l)&&parseInt(l,10)===i&&S(h)||a("bad XRef entry"),!S(h,"obj")){if(0===h.cmd.indexOf("obj")&&(n=parseInt(h.cmd.substring(3),10),!isNaN(n)))return n;a("bad XRef entry")}return t=this.encrypt&&!r?s.getObj(this.encrypt.createCipherTransform(n,i)):s.getObj(),I(t)||(this.cache[n]=t),t},fetchCompressed:function(e,t){var r=e.offset,i=this.fetch(new xe(r,0));I(i)||a("bad ObjStm stream");var n=i.dict.get("First"),o=i.dict.get("N");k(n)&&k(o)||a("invalid first and n parameters for ObjStm stream");var s=new Aa(new Ba(i),!1,this);s.allowStreams=!0;var c,l,h=[],u=[];for(c=0;o>c;++c){l=s.getObj(),k(l)||a("invalid object number in the ObjStm stream: "+l),u.push(l);var f=s.getObj();k(f)||a("invalid object offset in the ObjStm stream: "+f)}for(c=0;o>c;++c){h.push(s.getObj()),l=u[c];var d=this.entries[l];d&&d.offset===r&&d.gen===c&&(this.cache[l]=h[c])}return e=h[e.gen],void 0===e&&a("bad XRef entry for compressed object"),e},fetchIfRefAsync:function(e){return O(e)?this.fetchAsync(e):Promise.resolve(e)},fetchAsync:function(e,t){var a=this.stream.manager,r=this;return new Promise(function i(n,o){try{n(r.fetch(e,t))}catch(s){if(s instanceof ie)return void a.requestRange(s.begin,s.end,function(){i(n,o)});o(s)}})},getCatalogObj:function(){return this.root}},r}(),Ie=function(){function e(e,t){this.root=e,this.xref=t}return e.prototype={getAll:function(){var e={};if(!this.root)return e;var t=this.xref,r=new Ce;r.put(this.root);for(var i=[this.root];i.length>0;){var n,o,s=t.fetchIfRef(i.shift());if(A(s))if(s.has("Kids")){var c=s.get("Kids");for(n=0,o=c.length;o>n;n++){var l=c[n];r.has(l)&&a("invalid destinations"),i.push(l),r.put(l)}}else{var h=s.get("Names");if(h)for(n=0,o=h.length;o>n;n+=2)e[h[n]]=t.fetchIfRef(h[n+1])}}return e},get:function(e){if(!this.root)return null;for(var a,r,i,n=this.xref,o=n.fetchIfRef(this.root),s=0,c=10;o.has("Kids");){if(s++,s>c)return t("Search depth limit for named destionations has been reached."),null;var l=o.get("Kids");if(!B(l))return null;for(a=0,r=l.length-1;r>=a;){i=a+r>>1;var h=n.fetchIfRef(l[i]),u=h.get("Limits");if(e<u[0])r=i-1;else{if(!(e>u[1])){o=n.fetchIfRef(l[i]);break}a=i+1}}if(a>r)return null}var f=o.get("Names");if(B(f))for(a=0,r=f.length-2;r>=a;)if(i=a+r&-2,e<f[i])r=i-2;else{if(!(e>f[i]))return n.fetchIfRef(f[i+1]);a=i+2}return null}},e}(),Te=function(){function e(e,a){e&&A(e)&&(this.xref=a,this.root=e,e.has("FS")&&(this.fs=e.get("FS")),this.description=e.has("Desc")?p(e.get("Desc")):"",e.has("RF")&&t("Related file specifications are not supported"),this.contentAvailable=!0,e.has("EF")||(this.contentAvailable=!1,t("Non-embedded file specifications are not supported")))}function a(e){return e.has("UF")?e.get("UF"):e.has("F")?e.get("F"):e.has("Unix")?e.get("Unix"):e.has("Mac")?e.get("Mac"):e.has("DOS")?e.get("DOS"):null}return e.prototype={get filename(){if(!this._filename&&this.root){var e=a(this.root)||"unnamed";this._filename=p(e).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,"/")}return this._filename},get content(){if(!this.contentAvailable)return null;!this.contentRef&&this.root&&(this.contentRef=a(this.root.get("EF")));var e=null;if(this.contentRef){var r=this.xref,i=r.fetchIfRef(this.contentRef);i&&I(i)?e=i.getBytes():t("Embedded file specification points to non-existing/invalid content")}else t("Embedded file specification does not have a content");return e},get serializable(){return{filename:this.filename,content:this.content}}},e}(),Oe=function(){function e(e){return O(e)||A(e)||B(e)||I(e)}function t(t,a){var r;if(A(t)||I(t)){var i;i=A(t)?t.map:t.dict.map;for(var n in i)r=i[n],e(r)&&a.push(r)}else if(B(t))for(var o=0,s=t.length;s>o;o++)r=t[o],e(r)&&a.push(r)}function a(e,t,a){this.obj=e,this.keys=t,this.xref=a,this.refSet=null}return a.prototype={load:function(){var e=this.keys;if(this.capability=L(),!(this.xref.stream instanceof ue)||0===this.xref.stream.getMissingChunks().length)return this.capability.resolve(),this.capability.promise;this.refSet=new Ce;for(var t=[],a=0;a<e.length;a++)t.push(this.obj[e[a]]);return this.walk(t),this.capability.promise},walk:function(e){for(var a=[],r=[];e.length;){var i=e.pop();if(O(i)){if(this.refSet.has(i))continue;try{var n=i;this.refSet.put(n),i=this.xref.fetch(i)}catch(o){if(!(o instanceof ie))throw o;a.push(i),r.push({begin:o.begin,end:o.end})}}if(i&&i.getBaseStreams){for(var s=i.getBaseStreams(),c=!1,l=0;l<s.length;l++){var h=s[l];h.getMissingChunks&&h.getMissingChunks().length&&(c=!0,r.push({begin:h.start,end:h.end}))}c&&a.push(i)}t(i,e)}return r.length?void this.xref.stream.manager.requestRanges(r,function(){e=a;for(var t=0;t<a.length;t++){var r=a[t];O(r)&&this.refSet.remove(r)}this.walk(e)}.bind(this)):(this.refSet=null,void this.capability.resolve())}},a}(),Le=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"],Re=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Pe=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"],Me=22,De=["Link","Text","Widget"],Ee=function(){function e(e,t,a){var r=ce.getAxialAlignedBoundingBox(t,a),i=r[0],n=r[1],o=r[2],s=r[3];if(i===o||n===s)return[1,0,0,1,e[0],e[1]];var c=(e[2]-e[0])/(o-i),l=(e[3]-e[1])/(s-n);return[c,0,0,l,e[0]-i*c,e[1]-n*l]}function a(e){var t=e.get("AP");if(A(t)){var a,r=t.get("N");if(A(r)){var i=e.get("AS");i&&r.has(i.name)&&(a=r.get(i.name))}else a=r;return a}}function r(e){var t=e.dict,r=this.data={};r.subtype=t.get("Subtype").name;var i=t.get("Rect")||[0,0,0,0];r.rect=ce.normalizeRect(i),r.annotationFlags=t.get("F");var n=t.get("C");if(B(n)&&3===n.length?r.color=n:r.color=[0,0,0],t.has("BS")){var o=t.get("BS");r.borderWidth=o.has("W")?o.get("W"):1}else{var s=t.get("Border")||[0,0,1];r.borderWidth=s[2]||0;var c=s[3];if(r.borderWidth>0&&c)if(B(c)){var l=c.length;if(l>0){for(var h=!1,u=0,f=0;l>f;f++){var d=+c[f]>=0;if(!d){h=!0;break}c[f]>0&&u++}(h||0===u)&&(r.borderWidth=0)}}else r.borderWidth=0}this.appearance=a(t),r.hasAppearance=!!this.appearance,r.id=e.ref.num}return r.prototype={getData:function(){return this.data},isInvisible:function(){var e=this.data;return e&&-1!==De.indexOf(e.subtype)?!1:!!(e&&e.annotationFlags&&1&e.annotationFlags)},isViewable:function(){var e=this.data;return!(this.isInvisible()||!e||e.annotationFlags&&34&e.annotationFlags||!e.rect)},isPrintable:function(){var e=this.data;return!(!(!this.isInvisible()&&e&&e.annotationFlags&&4&e.annotationFlags)||2&e.annotationFlags||!e.rect)},loadResources:function(e){return new Promise(function(t,a){this.appearance.dict.getAsync("Resources").then(function(r){if(!r)return void t();var i=new Oe(r.map,e,r.xref);i.load().then(function(){t(r)},a)},a)}.bind(this))},getOperatorList:function(t){if(!this.appearance)return Promise.resolve(new yt);var a=this.data,r=this.appearance.dict,i=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"]),n=r.get("BBox")||[0,0,1,1],o=r.get("Matrix")||[1,0,0,1,0,0],s=e(a.rect,n,o),c=this;return i.then(function(e){var r=new yt;return r.addOp(W.beginAnnotation,[a.rect,s,o]),t.getOperatorList(c.appearance,e,r).then(function(){return r.addOp(W.endAnnotation,[]),c.appearance.reset(),r})})}},r.getConstructor=function(e,t){if(e){if("Link"===e)return je;if("Text"===e)return Ne;if("Widget"===e){if(!t)return;return"Tx"===t?Ue:qe}return r}},r.fromRef=function(e,a){var i=e.fetchIfRef(a);if(A(i)){var n=i.get("Subtype");if(n=C(n)?n.name:""){var o=ce.getInheritableProperty(i,"FT");o=C(o)?o.name:"";var s=r.getConstructor(n,o);if(s){var c={dict:i,ref:a},l=new s(c);return l.isViewable()||l.isPrintable()?l:void(-1===De.indexOf(n)&&t("unimplemented annotation type: "+n))}}}},r.appendToOperatorList=function(e,t,a,r,i){function n(e){o.reject(e)}for(var o=L(),s=[],c=0,l=e.length;l>c;++c)("display"===i&&e[c].isViewable()||"print"===i&&e[c].isPrintable())&&s.push(e[c].getOperatorList(r));return Promise.all(s).then(function(e){t.addOp(W.beginAnnotations,[]);for(var a=0,r=e.length;r>a;++a){var i=e[a];t.addOpList(i)}t.addOp(W.endAnnotations,[]),
o.resolve()},n),o.promise},r}(),qe=function(){function e(e){Ee.call(this,e);var t=e.dict,a=this.data;a.fieldValue=p(ce.getInheritableProperty(t,"V")||""),a.alternativeText=p(t.get("TU")||""),a.defaultAppearance=ce.getInheritableProperty(t,"DA")||"";var r=ce.getInheritableProperty(t,"FT");a.fieldType=C(r)?r.name:"",a.fieldFlags=ce.getInheritableProperty(t,"Ff")||0,this.fieldResources=ce.getInheritableProperty(t,"DR")||we.empty;for(var i=[],n=t,o=e.ref;n;){var s=n.get("Parent"),c=n.getRaw("Parent"),l=n.get("T");if(l)i.unshift(p(l));else if(s&&o){var h,u,f=s.get("Kids");for(h=0,u=f.length;u>h;h++){var d=f[h];if(d.num===o.num&&d.gen===o.gen)break}i.unshift("`"+h)}n=s,o=c}a.fullName=i.join(".")}var a=Ee.prototype;return ce.inherit(e,Ee,{isViewable:function(){return"Sig"===this.data.fieldType?(t("unimplemented annotation type: Widget signature"),!1):a.isViewable.call(this)}}),e}(),Ue=function(){function e(e){qe.call(this,e),this.data.textAlignment=ce.getInheritableProperty(e.dict,"Q"),this.data.annotationType=_.WIDGET,this.data.hasHtml=!this.data.hasAppearance&&!!this.data.fieldValue}return ce.inherit(e,qe,{getOperatorList:function(e){if(this.appearance)return Ee.prototype.getOperatorList.call(this,e);var t=new yt,a=this.data;if(!a.defaultAppearance)return Promise.resolve(t);var r=new Pa(c(a.defaultAppearance));return e.getOperatorList(r,this.fieldResources,t).then(function(){return t})}}),e}(),Fe=function(){function e(e){Ee.call(this,e),this.data.hasHtml=!0}return ce.inherit(e,Ee,{}),e}(),Ne=function(){function e(e){Fe.call(this,e);var t=e.dict,a=this.data,r=t.get("Contents"),i=t.get("T");a.annotationType=_.TEXT,a.content=p(r||""),a.title=p(i||""),a.hasAppearance?a.name="NoIcon":(a.rect[1]=a.rect[3]-Me,a.rect[2]=a.rect[0]+Me,a.name=t.has("Name")?t.get("Name").name:"Note"),t.has("C")&&(a.hasBgColor=!0)}return ce.inherit(e,Fe,{}),e}(),je=function(){function e(e){Fe.call(this,e);var r=e.dict,i=this.data;i.annotationType=_.LINK;var o=r.get("A");if(o){var s=o.get("S").name;if("URI"===s){var c=o.get("URI");C(c)?c="/"+c.name:c&&(c=a(c)),n(c,!1)||(c=""),i.url=c}else if("GoTo"===s)i.dest=o.get("D");else if("GoToR"===s){var l=o.get("F");A(l)&&(c=l.get("F")||""),n(c,!1)||(c=""),i.url=c,i.dest=o.get("D")}else"Named"===s?i.action=o.get("N").name:t("unrecognized link type: "+s)}else if(r.has("Dest")){var h=r.get("Dest");i.dest=C(h)?h.name:h}}function a(e){return e&&0===e.indexOf("www.")?"http://"+e:e}return ce.inherit(e,Fe,{hasOperatorList:function(){return!1}}),e}(),ze=function(){var t=0,r=2,i=3,n=4;return{getSampleArray:function(e,t,a,r){var i,n,o=1;for(i=0,n=e.length;n>i;i++)o*=e[i];o*=t;var s=new Array(o),c=0,l=0,h=1/(Math.pow(2,a)-1),u=r.getBytes((o*a+7)/8),f=0;for(i=0;o>i;i++){for(;a>c;)l<<=8,l|=u[f++],c+=8;c-=a,s[i]=(l>>c)*h,l&=(1<<c)-1}return s},getIR:function(e,t){var r=t.dict;r||(r=t);var i=[this.constructSampled,null,this.constructInterpolated,this.constructStiched,this.constructPostScript],n=r.get("FunctionType"),o=i[n];return o||a("Unknown type of function"),o.call(this,t,r,e)},fromIR:function(e){var a=e[0];switch(a){case t:return this.constructSampledFromIR(e);case r:return this.constructInterpolatedFromIR(e);case i:return this.constructStichedFromIR(e);default:return this.constructPostScriptFromIR(e)}},parse:function(e,t){var a=this.getIR(e,t);return this.fromIR(a)},parseArray:function(e,t){if(!B(t))return this.parse(e,t);for(var a=[],r=0,i=t.length;i>r;r++){var n=e.fetchIfRef(t[r]);a.push(ze.parse(e,n))}return function(e,t,r,i){for(var n=0,o=a.length;o>n;n++)a[n](e,t,r,i+n)}},constructSampled:function(r,i){function n(e){for(var t=e.length,a=[],r=0,i=0;t>i;i+=2)a[r]=[e[i],e[i+1]],++r;return a}var o=i.get("Domain"),s=i.get("Range");o&&s||a("No domain or range");var c=o.length/2,l=s.length/2;o=n(o),s=n(s);var h=i.get("Size"),u=i.get("BitsPerSample"),f=i.get("Order")||1;1!==f&&e("No support for cubic spline interpolation: "+f);var d=i.get("Encode");if(!d){d=[];for(var g=0;c>g;++g)d.push(0),d.push(h[g]-1)}d=n(d);var m=i.get("Decode");m=m?n(m):s;var p=this.getSampleArray(h,l,u,r);return[t,c,o,d,m,p,h,l,Math.pow(2,u)-1,s]},constructSampledFromIR:function(e){function t(e,t,a,r,i){return r+(e-t)*((i-r)/(a-t))}return function(a,r,i,n){var o,s,c=e[1],l=e[2],h=e[3],u=e[4],f=e[5],d=e[6],g=e[7],m=e[9],p=1<<c,b=new Float64Array(p),v=new Uint32Array(p);for(s=0;p>s;s++)b[s]=1;var y=g,k=1;for(o=0;c>o;++o){var w=l[o][0],x=l[o][1],C=Math.min(Math.max(a[r+o],w),x),S=t(C,w,x,h[o][0],h[o][1]),A=d[o];S=Math.min(Math.max(S,0),A-1);var B=A-1>S?Math.floor(S):S-1,I=B+1-S,T=S-B,O=B*y,L=O+y;for(s=0;p>s;s++)s&k?(b[s]*=T,v[s]+=L):(b[s]*=I,v[s]+=O);y*=A,k<<=1}for(s=0;g>s;++s){var R=0;for(o=0;p>o;o++)R+=f[v[o]+s]*b[o];R=t(R,0,1,u[s][0],u[s][1]),i[n+s]=Math.min(Math.max(R,m[s][0]),m[s][1])}}},constructInterpolated:function(e,t){var i=t.get("C0")||[0],n=t.get("C1")||[1],o=t.get("N");B(i)&&B(n)||a("Illegal dictionary for interpolated function");for(var s=i.length,c=[],l=0;s>l;++l)c.push(n[l]-i[l]);return[r,i,c,o]},constructInterpolatedFromIR:function(e){var t=e[1],a=e[2],r=e[3],i=a.length;return function(e,n,o,s){for(var c=1===r?e[n]:Math.pow(e[n],r),l=0;i>l;++l)o[s+l]=t[l]+c*a[l]}},constructStiched:function(e,t,r){var n=t.get("Domain");n||a("No domain");var o=n.length/2;1!==o&&a("Bad domain for stiched function");for(var s=t.get("Functions"),c=[],l=0,h=s.length;h>l;++l)c.push(ze.getIR(r,r.fetchIfRef(s[l])));var u=t.get("Bounds"),f=t.get("Encode");return[i,n,u,f,c]},constructStichedFromIR:function(e){for(var t=e[1],a=e[2],r=e[3],i=e[4],n=[],o=new Float32Array(1),s=0,c=i.length;c>s;s++)n.push(ze.fromIR(i[s]));return function(e,i,s,c){for(var l=function(e,t,a){return e>a?e=a:t>e&&(e=t),e},h=l(e[i],t[0],t[1]),u=0,f=a.length;f>u&&!(h<a[u]);++u);var d=t[0];u>0&&(d=a[u-1]);var g=t[1];u<a.length&&(g=a[u]);var m=r[2*u],p=r[2*u+1];o[0]=m+(h-d)*(p-m)/(g-d),n[u](o,0,s,c)}},constructPostScript:function(e,t,r){var i=t.get("Domain"),o=t.get("Range");i||a("No domain."),o||a("No range.");var s=new Ra(e),c=new Ta(s),l=c.parse();return[n,i,o,l]},constructPostScriptFromIR:function(t){var a=t[1],r=t[2],i=t[3],n=(new Xe).compile(i,a,r);if(n)return new Function("src","srcOffset","dest","destOffset",n);e("Unable to compile PS function");var o=r.length>>1,s=a.length>>1,c=new Ge(i),l={},h=8192,u=h,f=new Float32Array(s);return function(e,t,a,i){var n,h,d="",g=f;for(n=0;s>n;n++)h=e[t+n],g[n]=h,d+=h+"_";var m=l[d];if(void 0!==m)return void a.set(m,i);var p=new Float32Array(o),b=c.execute(g),v=b.length-o;for(n=0;o>n;n++){h=b[v+n];var y=r[2*n];y>h?h=y:(y=r[2*n+1],h>y&&(h=y)),p[n]=h}u>0&&(u--,l[d]=p),a.set(p,i)}}}}(),He=function(){function e(e){this.stack=e?Array.prototype.slice.call(e,0):[]}var t=100;return e.prototype={push:function(e){this.stack.length>=t&&a("PostScript function stack overflow."),this.stack.push(e)},pop:function(){return this.stack.length<=0&&a("PostScript function stack underflow."),this.stack.pop()},copy:function(e){this.stack.length+e>=t&&a("PostScript function stack overflow.");for(var r=this.stack,i=r.length-e,n=e-1;n>=0;n--,i++)r.push(r[i])},index:function(e){this.push(this.stack[this.stack.length-e-1])},roll:function(e,t){var a,r,i,n=this.stack,o=n.length-e,s=n.length-1,c=o+(t-Math.floor(t/e)*e);for(a=o,r=s;r>a;a++,r--)i=n[a],n[a]=n[r],n[r]=i;for(a=o,r=c-1;r>a;a++,r--)i=n[a],n[a]=n[r],n[r]=i;for(a=c,r=s;r>a;a++,r--)i=n[a],n[a]=n[r],n[r]=i}},e}(),Ge=function(){function e(e){this.operators=e}return e.prototype={execute:function(e){for(var t,r,i,n=new He(e),o=0,s=this.operators,c=s.length;c>o;)if(t=s[o++],"number"!=typeof t)switch(t){case"jz":i=n.pop(),r=n.pop(),r||(o=i);break;case"j":r=n.pop(),o=r;break;case"abs":r=n.pop(),n.push(Math.abs(r));break;case"add":i=n.pop(),r=n.pop(),n.push(r+i);break;case"and":i=n.pop(),r=n.pop(),y(r)&&y(i)?n.push(r&&i):n.push(r&i);break;case"atan":r=n.pop(),n.push(Math.atan(r));break;case"bitshift":i=n.pop(),r=n.pop(),r>0?n.push(r<<i):n.push(r>>i);break;case"ceiling":r=n.pop(),n.push(Math.ceil(r));break;case"copy":r=n.pop(),n.copy(r);break;case"cos":r=n.pop(),n.push(Math.cos(r));break;case"cvi":r=0|n.pop(),n.push(r);break;case"cvr":break;case"div":i=n.pop(),r=n.pop(),n.push(r/i);break;case"dup":n.copy(1);break;case"eq":i=n.pop(),r=n.pop(),n.push(r===i);break;case"exch":n.roll(2,1);break;case"exp":i=n.pop(),r=n.pop(),n.push(Math.pow(r,i));break;case"false":n.push(!1);break;case"floor":r=n.pop(),n.push(Math.floor(r));break;case"ge":i=n.pop(),r=n.pop(),n.push(r>=i);break;case"gt":i=n.pop(),r=n.pop(),n.push(r>i);break;case"idiv":i=n.pop(),r=n.pop(),n.push(r/i|0);break;case"index":r=n.pop(),n.index(r);break;case"le":i=n.pop(),r=n.pop(),n.push(i>=r);break;case"ln":r=n.pop(),n.push(Math.log(r));break;case"log":r=n.pop(),n.push(Math.log(r)/Math.LN10);break;case"lt":i=n.pop(),r=n.pop(),n.push(i>r);break;case"mod":i=n.pop(),r=n.pop(),n.push(r%i);break;case"mul":i=n.pop(),r=n.pop(),n.push(r*i);break;case"ne":i=n.pop(),r=n.pop(),n.push(r!==i);break;case"neg":r=n.pop(),n.push(-r);break;case"not":r=n.pop(),y(r)?n.push(!r):n.push(~r);break;case"or":i=n.pop(),r=n.pop(),y(r)&&y(i)?n.push(r||i):n.push(r|i);break;case"pop":n.pop();break;case"roll":i=n.pop(),r=n.pop(),n.roll(r,i);break;case"round":r=n.pop(),n.push(Math.round(r));break;case"sin":r=n.pop(),n.push(Math.sin(r));break;case"sqrt":r=n.pop(),n.push(Math.sqrt(r));break;case"sub":i=n.pop(),r=n.pop(),n.push(r-i);break;case"true":n.push(!0);break;case"truncate":r=n.pop(),r=0>r?Math.ceil(r):Math.floor(r),n.push(r);break;case"xor":i=n.pop(),r=n.pop(),y(r)&&y(i)?n.push(r!==i):n.push(r^i);break;default:a("Unknown operator "+t)}else n.push(t);return n.stack}},e}(),Xe=function(){function e(e){this.type=e}function t(t,a,r){e.call(this,"args"),this.index=t,this.min=a,this.max=r}function a(t){e.call(this,"literal"),this.number=t,this.min=t,this.max=t}function r(t,a,r,i,n){e.call(this,"binary"),this.op=t,this.arg1=a,this.arg2=r,this.min=i,this.max=n}function i(t,a){e.call(this,"max"),this.arg=t,this.min=t.min,this.max=a}function n(t,a,r){e.call(this,"var"),this.index=t,this.min=a,this.max=r}function o(t,a){e.call(this,"definition"),this.variable=t,this.arg=a}function s(){this.parts=[]}function c(e,t){return"literal"===t.type&&0===t.number?e:"literal"===e.type&&0===e.number?t:"literal"===t.type&&"literal"===e.type?new a(e.number+t.number):new r("+",e,t,e.min+t.min,e.max+t.max)}function l(e,t){if("literal"===t.type){if(0===t.number)return new a(0);if(1===t.number)return e;if("literal"===e.type)return new a(e.number*t.number)}if("literal"===e.type){if(0===e.number)return new a(0);if(1===e.number)return t}var i=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),n=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new r("*",e,t,i,n)}function h(e,t){if("literal"===t.type){if(0===t.number)return e;if("literal"===e.type)return new a(e.number-t.number)}return"binary"===t.type&&"-"===t.op&&"literal"===e.type&&1===e.number&&"literal"===t.arg1.type&&1===t.arg1.number?t.arg2:new r("-",e,t,e.min-t.max,e.max-t.min)}function u(e,t){return e.min>=t?new a(t):e.max<=t?e:new i(e,t)}function f(){}return e.prototype.visit=function(e){throw new Error("abstract method")},t.prototype=Object.create(e.prototype),t.prototype.visit=function(e){e.visitArgument(this)},a.prototype=Object.create(e.prototype),a.prototype.visit=function(e){e.visitLiteral(this)},r.prototype=Object.create(e.prototype),r.prototype.visit=function(e){e.visitBinaryOperation(this)},i.prototype=Object.create(e.prototype),i.prototype.visit=function(e){e.visitMin(this)},n.prototype=Object.create(e.prototype),n.prototype.visit=function(e){e.visitVariable(this)},o.prototype=Object.create(e.prototype),o.prototype.visit=function(e){e.visitVariableDefinition(this)},s.prototype={visitArgument:function(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")},visitVariable:function(e){this.parts.push("v",e.index)},visitLiteral:function(e){this.parts.push(e.number)},visitBinaryOperation:function(e){this.parts.push("("),e.arg1.visit(this),this.parts.push(" ",e.op," "),e.arg2.visit(this),this.parts.push(")")},visitVariableDefinition:function(e){this.parts.push("var "),e.variable.visit(this),this.parts.push(" = "),e.arg.visit(this),this.parts.push(";")},visitMin:function(e){this.parts.push("Math.min("),e.arg.visit(this),this.parts.push(", ",e.max,")")},toString:function(){return this.parts.join("")}},f.prototype={compile:function(e,r,i){var f,d,g,m,p,b,v,y,k,w,x=[],C=[],S=r.length>>1,A=i.length>>1,B=0;for(f=0;S>f;f++)x.push(new t(f,r[2*f],r[2*f+1]));for(f=0,d=e.length;d>f;f++)if(w=e[f],"number"!=typeof w)switch(w){case"add":if(x.length<2)return null;b=x.pop(),p=x.pop(),x.push(c(p,b));break;case"cvr":if(x.length<1)return null;break;case"mul":if(x.length<2)return null;b=x.pop(),p=x.pop(),x.push(l(p,b));break;case"sub":if(x.length<2)return null;b=x.pop(),p=x.pop(),x.push(h(p,b));break;case"exch":if(x.length<2)return null;v=x.pop(),y=x.pop(),x.push(v,y);break;case"pop":if(x.length<1)return null;x.pop();break;case"index":if(x.length<1)return null;if(p=x.pop(),"literal"!==p.type)return null;if(g=p.number,0>g||(0|g)!==g||x.length<g)return null;if(v=x[x.length-g-1],"literal"===v.type||"var"===v.type){x.push(v);break}k=new n(B++,v.min,v.max),x[x.length-g-1]=k,x.push(k),C.push(new o(k,v));break;case"dup":if(x.length<1)return null;if("number"==typeof e[f+1]&&"gt"===e[f+2]&&e[f+3]===f+7&&"jz"===e[f+4]&&"pop"===e[f+5]&&e[f+6]===e[f+1]){p=x.pop(),x.push(u(p,e[f+1])),f+=6;break}if(v=x[x.length-1],"literal"===v.type||"var"===v.type){x.push(v);break}k=new n(B++,v.min,v.max),x[x.length-1]=k,x.push(k),C.push(new o(k,v));break;case"roll":if(x.length<2)return null;if(b=x.pop(),p=x.pop(),"literal"!==b.type||"literal"!==p.type)return null;if(m=b.number,g=p.number,0>=g||(0|g)!==g||(0|m)!==m||x.length<g)return null;if(m=(m%g+g)%g,0===m)break;Array.prototype.push.apply(x,x.splice(x.length-g,g-m));break;default:return null}else x.push(new a(w));if(x.length!==A)return null;var I=[];return C.forEach(function(e){var t=new s;e.visit(t),I.push(t.toString())}),x.forEach(function(e,t){var a=new s;e.visit(a);var r=i[2*t],n=i[2*t+1],o=[a.toString()];r>e.min&&(o.unshift("Math.max(",r,", "),o.push(")")),n<e.max&&(o.unshift("Math.min(",n,", "),o.push(")")),o.unshift("dest[destOffset + ",t,"] = "),o.push(";"),I.push(o.join(""))}),I.join("\n")}},f}(),_e=function(){function e(){a("should not call ColorSpace constructor")}return e.prototype={getRgb:function(e,t){var a=new Uint8Array(3);return this.getRgbItem(e,t,a,0),a},getRgbItem:function(e,t,r,i){a("Should not call ColorSpace.getRgbItem")},getRgbBuffer:function(e,t,r,i,n,o,s){a("Should not call ColorSpace.getRgbBuffer")},getOutputLength:function(e,t){a("Should not call ColorSpace.getOutputLength")},isPassthrough:function(e){return!1},fillRgb:function(e,t,a,r,i,n,o,s,c){var l,h,u=t*a,f=null,d=1<<o,g=a!==i||t!==r;if(this.isPassthrough(o))f=s;else if(1===this.numComps&&u>d&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){var m,p=8>=o?new Uint8Array(d):new Uint16Array(d);for(l=0;d>l;l++)p[l]=l;var b=new Uint8Array(3*d);this.getRgbBuffer(p,0,d,b,0,o,0);var v,y;if(g)for(f=new Uint8Array(3*u),y=0,l=0;u>l;++l)m=3*s[l],f[y++]=b[m],f[y++]=b[m+1],f[y++]=b[m+2];else for(v=0,l=0;u>l;++l)m=3*s[l],e[v++]=b[m],e[v++]=b[m+1],e[v++]=b[m+2],v+=c}else g?(f=new Uint8Array(3*u),this.getRgbBuffer(s,0,u,f,0,o,0)):this.getRgbBuffer(s,0,r*n,e,0,o,c);if(f)if(g)wa.resize(f,o,3,t,a,r,i,e,c);else for(y=0,v=0,l=0,h=r*n;h>l;l++)e[v++]=f[y++],e[v++]=f[y++],e[v++]=f[y++],v+=c},usesZeroToOneRange:!0},e.parse=function(t,a,r){var i=e.parseToIR(t,a,r);return i instanceof Je?i:e.fromIR(i)},e.fromIR=function(t){var r,i,n,o=B(t)?t[0]:t;switch(o){case"DeviceGrayCS":return this.singletons.gray;case"DeviceRgbCS":return this.singletons.rgb;case"DeviceCmykCS":return this.singletons.cmyk;case"CalGrayCS":return r=t[1].WhitePoint,i=t[1].BlackPoint,n=t[1].Gamma,new Qe(r,i,n);case"CalRGBCS":r=t[1].WhitePoint,i=t[1].BlackPoint,n=t[1].Gamma;var s=t[1].Matrix;return new $e(r,i,n,s);case"PatternCS":var c=t[1];return c&&(c=e.fromIR(c)),new Ve(c);case"IndexedCS":var l=t[1],h=t[2],u=t[3];return new We(e.fromIR(l),h,u);case"AlternateCS":var f=t[1],d=t[2],g=t[3];return new Je(f,e.fromIR(d),ze.fromIR(g));case"LabCS":r=t[1].WhitePoint,i=t[1].BlackPoint;var m=t[1].Range;return new et(r,i,m);default:a("Unknown name "+o)}return null},e.parseToIR=function(t,r,i){if(C(t)){var n=i.get("ColorSpace");if(A(n)){var o=n.get(t.name);o&&(t=o)}}t=r.fetchIfRef(t);var s;if(C(t))switch(s=t.name,this.mode=s,s){case"DeviceGray":case"G":return"DeviceGrayCS";case"DeviceRGB":case"RGB":return"DeviceRgbCS";case"DeviceCMYK":case"CMYK":return"DeviceCmykCS";case"Pattern":return["PatternCS",null];default:a("unrecognized colorspace "+s)}else if(B(t)){s=t[0].name,this.mode=s;var c,l;switch(s){case"DeviceGray":case"G":return"DeviceGrayCS";case"DeviceRGB":case"RGB":return"DeviceRgbCS";case"DeviceCMYK":case"CMYK":return"DeviceCmykCS";case"CalGray":return l=t[1].getAll(),["CalGrayCS",l];case"CalRGB":return l=t[1].getAll(),["CalRGBCS",l];case"ICCBased":var h=r.fetchIfRef(t[1]),u=h.dict;if(c=u.get("N"),1===c)return"DeviceGrayCS";if(3===c)return"DeviceRgbCS";if(4===c)return"DeviceCmykCS";break;case"Pattern":var f=t[1];return f&&(f=e.parseToIR(f,r,i)),["PatternCS",f];case"Indexed":case"I":var d=e.parseToIR(t[1],r,i),g=t[2]+1,m=r.fetchIfRef(t[3]);return I(m)&&(m=m.getBytes()),["IndexedCS",d,g,m];case"Separation":case"DeviceN":var p=t[1];c=1,C(p)?c=1:B(p)&&(c=p.length);var b=e.parseToIR(t[2],r,i),v=ze.getIR(r,r.fetchIfRef(t[3]));return["AlternateCS",c,b,v];case"Lab":return l=t[1].getAll(),["LabCS",l];default:a('unimplemented color space object "'+s+'"')}}else a('unrecognized color space object: "'+t+'"');return null},e.isDefaultDecode=function(e,a){if(!e)return!0;if(2*a!==e.length)return t("The decode map is not the correct length"),!0;for(var r=0,i=e.length;i>r;r+=2)if(0!==e[r]||1!==e[r+1])return!1;return!0},e.singletons={get gray(){return o(this,"gray",new Ke)},get rgb(){return o(this,"rgb",new Ye)},get cmyk(){return o(this,"cmyk",new Ze)}},e}(),Je=function(){function e(e,t,a){this.name="Alternate",this.numComps=e,this.defaultColor=new Float32Array(e);for(var r=0;e>r;++r)this.defaultColor[r]=1;this.base=t,this.tintFn=a,this.tmpBuf=new Float32Array(t.numComps)}return e.prototype={getRgb:_e.prototype.getRgb,getRgbItem:function(e,t,a,r){var i=this.tmpBuf;this.tintFn(e,t,i,0),this.base.getRgbItem(i,0,a,r)},getRgbBuffer:function(e,t,a,r,i,n,o){var s,c,l=this.tintFn,h=this.base,u=1/((1<<n)-1),f=h.numComps,d=h.usesZeroToOneRange,g=(h.isPassthrough(8)||!d)&&0===o,m=g?i:0,p=g?r:new Uint8Array(f*a),b=this.numComps,v=new Float32Array(b),y=new Float32Array(f);if(d)for(s=0;a>s;s++){for(c=0;b>c;c++)v[c]=e[t++]*u;for(l(v,0,y,0),c=0;f>c;c++)p[m++]=255*y[c]}else for(s=0;a>s;s++){for(c=0;b>c;c++)v[c]=e[t++]*u;l(v,0,y,0),h.getRgbItem(y,0,p,m),m+=f}g||h.getRgbBuffer(p,0,a,r,i,8,o)},getOutputLength:function(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)},isPassthrough:_e.prototype.isPassthrough,fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return _e.isDefaultDecode(e,this.numComps)},usesZeroToOneRange:!0},e}(),Ve=function(){function e(e){this.name="Pattern",this.base=e}return e.prototype={},e}(),We=function(){function e(e,t,r){this.name="Indexed",this.numComps=1,this.defaultColor=new Uint8Array([0]),this.base=e,this.highVal=t;var i,n=e.numComps,o=n*t;if(I(r)){i=new Uint8Array(o);var s=r.getBytes(o);i.set(s)}else if(x(r)){i=new Uint8Array(o);for(var c=0;o>c;++c)i[c]=r.charCodeAt(c)}else r instanceof Uint8Array||r instanceof Array?i=r:a("Unrecognized lookup table: "+r);this.lookup=i}return e.prototype={getRgb:_e.prototype.getRgb,getRgbItem:function(e,t,a,r){var i=this.base.numComps,n=e[t]*i;this.base.getRgbItem(this.lookup,n,a,r)},getRgbBuffer:function(e,t,a,r,i,n,o){for(var s=this.base,c=s.numComps,l=s.getOutputLength(c,o),h=this.lookup,u=0;a>u;++u){var f=e[t++]*c;s.getRgbBuffer(h,f,1,r,i,8,o),i+=l}},getOutputLength:function(e,t){return this.base.getOutputLength(e*this.base.numComps,t)},isPassthrough:_e.prototype.isPassthrough,fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return!0},usesZeroToOneRange:!0},e}(),Ke=function(){function e(){this.name="DeviceGray",this.numComps=1,this.defaultColor=new Float32Array([0])}return e.prototype={getRgb:_e.prototype.getRgb,getRgbItem:function(e,t,a,r){var i=255*e[t]|0;i=0>i?0:i>255?255:i,a[r]=a[r+1]=a[r+2]=i},getRgbBuffer:function(e,t,a,r,i,n,o){for(var s=255/((1<<n)-1),c=t,l=i,h=0;a>h;++h){var u=s*e[c++]|0;r[l++]=u,r[l++]=u,r[l++]=u,l+=o}},getOutputLength:function(e,t){return e*(3+t)},isPassthrough:_e.prototype.isPassthrough,fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return _e.isDefaultDecode(e,this.numComps)},usesZeroToOneRange:!0},e}(),Ye=function(){function e(){this.name="DeviceRGB",this.numComps=3,this.defaultColor=new Float32Array([0,0,0])}return e.prototype={getRgb:_e.prototype.getRgb,getRgbItem:function(e,t,a,r){var i=255*e[t]|0,n=255*e[t+1]|0,o=255*e[t+2]|0;a[r]=0>i?0:i>255?255:i,a[r+1]=0>n?0:n>255?255:n,a[r+2]=0>o?0:o>255?255:o},getRgbBuffer:function(e,t,a,r,i,n,o){if(8===n&&0===o)return void r.set(e.subarray(t,t+3*a),i);for(var s=255/((1<<n)-1),c=t,l=i,h=0;a>h;++h)r[l++]=s*e[c++]|0,r[l++]=s*e[c++]|0,r[l++]=s*e[c++]|0,l+=o},getOutputLength:function(e,t){return e*(3+t)/3|0},isPassthrough:function(e){return 8===e},fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return _e.isDefaultDecode(e,this.numComps)},usesZeroToOneRange:!0},e}(),Ze=function(){function e(e,t,a,r,i){var n=e[t+0]*a,o=e[t+1]*a,s=e[t+2]*a,c=e[t+3]*a,l=n*(-4.387332384609988*n+54.48615194189176*o+18.82290502165302*s+212.25662451639585*c+-285.2331026137004)+o*(1.7149763477362134*o-5.6096736904047315*s+-17.873870861415444*c-5.497006427196366)+s*(-2.5217340131683033*s-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747)+255|0,h=n*(8.841041422036149*n+60.118027045597366*o+6.871425592049007*s+31.159100130055922*c+-79.2970844816548)+o*(-15.310361306967817*o+17.575251261109482*s+131.35250912493976*c-190.9453302588951)+s*(4.444339102852739*s+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578)+255|0,u=n*(.8842522430003296*n+8.078677503112928*o+30.89978309703729*s-.23883238689178934*c+-14.183576799673286)+o*(10.49593273432072*o+63.02378494754052*s+50.606957656360734*c-112.23884253719248)+s*(.03296041114873217*s+115.60384449646641*c+-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)+255|0;r[i]=l>255?255:0>l?0:l,r[i+1]=h>255?255:0>h?0:h,r[i+2]=u>255?255:0>u?0:u}function t(){this.name="DeviceCMYK",this.numComps=4,this.defaultColor=new Float32Array([0,0,0,1])}return t.prototype={getRgb:_e.prototype.getRgb,getRgbItem:function(t,a,r,i){e(t,a,1,r,i)},getRgbBuffer:function(t,a,r,i,n,o,s){for(var c=1/((1<<o)-1),l=0;r>l;l++)e(t,a,c,i,n),a+=4,n+=3+s},getOutputLength:function(e,t){return e/4*(3+t)|0},isPassthrough:_e.prototype.isPassthrough,fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return _e.isDefaultDecode(e,this.numComps)},usesZeroToOneRange:!0},t}(),Qe=function(){function r(r,i,n){this.name="CalGray",this.numComps=1,this.defaultColor=new Float32Array([0]),r||a("WhitePoint missing - required for color space CalGray"),i=i||[0,0,0],n=n||1,this.XW=r[0],this.YW=r[1],this.ZW=r[2],this.XB=i[0],this.YB=i[1],this.ZB=i[2],this.G=n,(this.XW<0||this.ZW<0||1!==this.YW)&&a("Invalid WhitePoint components for "+this.name+", no fallback available"),(this.XB<0||this.YB<0||this.ZB<0)&&(e("Invalid BlackPoint for "+this.name+", falling back to default"),this.XB=this.YB=this.ZB=0),0===this.XB&&0===this.YB&&0===this.ZB||t(this.name+", BlackPoint: XB: "+this.XB+", YB: "+this.YB+", ZB: "+this.ZB+", only default values are supported."),this.G<1&&(e("Invalid Gamma: "+this.G+" for "+this.name+", falling back to default"),this.G=1)}function i(e,t,a,r,i,n){var o=t[a]*n,s=Math.pow(o,e.G),c=e.YW*s,l=0|Math.max(295.8*Math.pow(c,.3333333333333333)-40.8,0);r[i]=l,r[i+1]=l,r[i+2]=l}return r.prototype={getRgb:_e.prototype.getRgb,getRgbItem:function(e,t,a,r){i(this,e,t,a,r,1)},getRgbBuffer:function(e,t,a,r,n,o,s){for(var c=1/((1<<o)-1),l=0;a>l;++l)i(this,e,t,r,n,c),t+=1,n+=3+s},getOutputLength:function(e,t){return e*(3+t)},isPassthrough:_e.prototype.isPassthrough,fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return _e.isDefaultDecode(e,this.numComps)},usesZeroToOneRange:!0},r}(),$e=function(){function t(t,r,i,n){this.name="CalRGB",this.numComps=3,this.defaultColor=new Float32Array(3),t||a("WhitePoint missing - required for color space CalRGB"),r=r||new Float32Array(3),i=i||new Float32Array([1,1,1]),n=n||new Float32Array([1,0,0,0,1,0,0,0,1]);var o=t[0],s=t[1],c=t[2];this.whitePoint=t;var l=r[0],h=r[1],u=r[2];this.blackPoint=r,this.GR=i[0],this.GG=i[1],this.GB=i[2],this.MXA=n[0],this.MYA=n[1],this.MZA=n[2],this.MXB=n[3],this.MYB=n[4],this.MZB=n[5],this.MXC=n[6],this.MYC=n[7],this.MZC=n[8],(0>o||0>c||1!==s)&&a("Invalid WhitePoint components for "+this.name+", no fallback available"),(0>l||0>h||0>u)&&(e("Invalid BlackPoint for "+this.name+" ["+l+", "+h+", "+u+"], falling back to default"),this.blackPoint=new Float32Array(3)),(this.GR<0||this.GG<0||this.GB<0)&&(e("Invalid Gamma ["+this.GR+", "+this.GG+", "+this.GB+"] for "+this.name+", falling back to default"),this.GR=this.GG=this.GB=1),(this.MXA<0||this.MYA<0||this.MZA<0||this.MXB<0||this.MYB<0||this.MZB<0||this.MXC<0||this.MYC<0||this.MZC<0)&&(e("Invalid Matrix for "+this.name+" ["+this.MXA+", "+this.MYA+", "+this.MZA+this.MXB+", "+this.MYB+", "+this.MZB+this.MXC+", "+this.MYC+", "+this.MZC+"], falling back to default"),this.MXA=this.MYB=this.MZC=1,this.MXB=this.MYA=this.MZA=this.MXC=this.MYC=this.MZB=0)}function r(e,t,a){a[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2],a[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2],a[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}function i(e,t,a){a[0]=1*t[0]/e[0],a[1]=1*t[1]/e[1],a[2]=1*t[2]/e[2]}function n(e,t,a){var r=.95047,i=1,n=1.08883;a[0]=t[0]*r/e[0],a[1]=t[1]*i/e[1],a[2]=t[2]*n/e[2]}function o(e){return.0031308>=e?s(0,1,12.92*e):s(0,1,1.055*Math.pow(e,1/2.4)-.055)}function s(e,t,a){return Math.max(e,Math.min(t,a))}function c(e){return 0>e?-c(-e):e>8?Math.pow((e+16)/116,3):e*k}function l(e,t,a){if(0===e[0]&&0===e[1]&&0===e[2])return a[0]=t[0],a[1]=t[1],void(a[2]=t[2]);var r=c(0),i=r,n=c(e[0]),o=r,s=c(e[1]),l=r,h=c(e[2]),u=(1-i)/(1-n),f=1-u,d=(1-o)/(1-s),g=1-d,m=(1-l)/(1-h),p=1-m;a[0]=t[0]*u+f,a[1]=t[1]*d+g,a[2]=t[2]*m+p}function h(e,t,a){if(1===e[0]&&1===e[2])return a[0]=t[0],a[1]=t[1],void(a[2]=t[2]);var n=a;r(d,t,n);var o=b;i(e,n,o),r(g,o,a)}function u(e,t,a){var i=a;r(d,t,i);var o=b;n(e,i,o),r(g,o,a)}function f(e,t,a,i,n,c){var f=s(0,1,t[a]*c),d=s(0,1,t[a+1]*c),g=s(0,1,t[a+2]*c),b=Math.pow(f,e.GR),k=Math.pow(d,e.GG),w=Math.pow(g,e.GB),x=e.MXA*b+e.MXB*k+e.MXC*w,C=e.MYA*b+e.MYB*k+e.MYC*w,S=e.MZA*b+e.MZB*k+e.MZC*w,A=v;A[0]=x,A[1]=C,A[2]=S;var B=y;h(e.whitePoint,A,B);var I=v;l(e.blackPoint,B,I);var T=y;u(p,I,T);var O=v;r(m,T,O);var L=o(O[0]),R=o(O[1]),P=o(O[2]);i[n]=Math.round(255*L),i[n+1]=Math.round(255*R),i[n+2]=Math.round(255*P)}var d=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]),g=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]),m=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]),p=new Float32Array([1,1,1]),b=new Float32Array(3),v=new Float32Array(3),y=new Float32Array(3),k=Math.pow(24/116,3)/8;return t.prototype={getRgb:function(e,t){var a=new Uint8Array(3);return this.getRgbItem(e,t,a,0),a},getRgbItem:function(e,t,a,r){f(this,e,t,a,r,1)},getRgbBuffer:function(e,t,a,r,i,n,o){for(var s=1/((1<<n)-1),c=0;a>c;++c)f(this,e,t,r,i,s),t+=3,i+=3+o},getOutputLength:function(e,t){return e*(3+t)/3|0},isPassthrough:_e.prototype.isPassthrough,fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return _e.isDefaultDecode(e,this.numComps)},usesZeroToOneRange:!0},t}(),et=function(){function t(t,r,i){this.name="Lab",this.numComps=3,this.defaultColor=new Float32Array([0,0,0]),t||a("WhitePoint missing - required for color space Lab"),r=r||[0,0,0],i=i||[-100,100,-100,100],this.XW=t[0],this.YW=t[1],this.ZW=t[2],this.amin=i[0],this.amax=i[1],this.bmin=i[2],this.bmax=i[3],this.XB=r[0],this.YB=r[1],this.ZB=r[2],(this.XW<0||this.ZW<0||1!==this.YW)&&a("Invalid WhitePoint components, no fallback available"),(this.XB<0||this.YB<0||this.ZB<0)&&(e("Invalid BlackPoint, falling back to default"),this.XB=this.YB=this.ZB=0),(this.amin>this.amax||this.bmin>this.bmax)&&(e("Invalid Range, falling back to defaults"),this.amin=-100,this.amax=100,this.bmin=-100,this.bmax=100)}function r(e){return e>=6/29?e*e*e:108/841*(e-4/29)}function i(e,t,a,r){return a+e*(r-a)/t}function n(e,t,a,n,o,s){var c=t[a],l=t[a+1],h=t[a+2];n!==!1&&(c=i(c,n,0,100),l=i(l,n,e.amin,e.amax),h=i(h,n,e.bmin,e.bmax)),l=l>e.amax?e.amax:l<e.amin?e.amin:l,h=h>e.bmax?e.bmax:h<e.bmin?e.bmin:h;var u,f,d,g=(c+16)/116,m=g+l/500,p=g-h/200,b=e.XW*r(m),v=e.YW*r(g),y=e.ZW*r(p);e.ZW<1?(u=3.1339*b+-1.617*v+y*-.4906,f=b*-.9785+1.916*v+.0333*y,d=.072*b+v*-.229+1.4057*y):(u=3.2406*b+-1.5372*v+y*-.4986,f=b*-.9689+1.8758*v+.0415*y,d=.0557*b+v*-.204+1.057*y),o[s]=0>=u?0:u>=1?255:255*Math.sqrt(u)|0,o[s+1]=0>=f?0:f>=1?255:255*Math.sqrt(f)|0,o[s+2]=0>=d?0:d>=1?255:255*Math.sqrt(d)|0}return t.prototype={getRgb:_e.prototype.getRgb,getRgbItem:function(e,t,a,r){n(this,e,t,!1,a,r)},getRgbBuffer:function(e,t,a,r,i,o,s){for(var c=(1<<o)-1,l=0;a>l;l++)n(this,e,t,c,r,i),t+=3,i+=3+s},getOutputLength:function(e,t){return e*(3+t)/3|0},isPassthrough:_e.prototype.isPassthrough,fillRgb:_e.prototype.fillRgb,isDefaultDecode:function(e){return!0},usesZeroToOneRange:!1},t}(),tt=function(){function e(e){this.a=0,this.b=0;var t,a,r=new Uint8Array(256),i=0,n=e.length;for(t=0;256>t;++t)r[t]=t;for(t=0;256>t;++t)a=r[t],i=i+a+e[t%n]&255,r[t]=r[i],r[i]=a;this.s=r}return e.prototype={encryptBlock:function(e){var t,a,r,i=e.length,n=this.a,o=this.b,s=this.s,c=new Uint8Array(i);for(t=0;i>t;++t)n=n+1&255,a=s[n],o=o+a&255,r=s[o],s[n]=r,s[o]=a,c[t]=e[t]^s[a+r&255];return this.a=n,this.b=o,c}},e.prototype.decryptBlock=e.prototype.encryptBlock,e}(),at=function(){function e(e,r,i){var n,o,s,c=1732584193,l=-271733879,h=-1732584194,u=271733878,f=i+72&-64,d=new Uint8Array(f);for(n=0;i>n;++n)d[n]=e[r++];for(d[n++]=128,s=f-8;s>n;)d[n++]=0;d[n++]=i<<3&255,d[n++]=i>>5&255,d[n++]=i>>13&255,d[n++]=i>>21&255,d[n++]=i>>>29&255,d[n++]=0,d[n++]=0,d[n++]=0;var g=new Int32Array(16);for(n=0;f>n;){for(o=0;16>o;++o,n+=4)g[o]=d[n]|d[n+1]<<8|d[n+2]<<16|d[n+3]<<24;var m,p,b=c,v=l,y=h,k=u;for(o=0;64>o;++o){16>o?(m=v&y|~v&k,p=o):32>o?(m=k&v|~k&y,p=5*o+1&15):48>o?(m=v^y^k,p=3*o+5&15):(m=y^(v|~k),p=7*o&15);var w=k,x=b+m+a[o]+g[p]|0,C=t[o];k=y,y=v,v=v+(x<<C|x>>>32-C)|0,b=w}c=c+b|0,l=l+v|0,h=h+y|0,u=u+k|0}return new Uint8Array([255&c,c>>8&255,c>>16&255,c>>>24&255,255&l,l>>8&255,l>>16&255,l>>>24&255,255&h,h>>8&255,h>>16&255,h>>>24&255,255&u,u>>8&255,u>>16&255,u>>>24&255])}var t=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),a=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return e}(),rt=function(){function e(e,t){this.high=0|e,this.low=0|t}return e.prototype={and:function(e){this.high&=e.high,this.low&=e.low},xor:function(e){this.high^=e.high,
this.low^=e.low},or:function(e){this.high|=e.high,this.low|=e.low},shiftRight:function(e){e>=32?(this.low=this.high>>>e-32|0,this.high=0):(this.low=this.low>>>e|this.high<<32-e,this.high=this.high>>>e|0)},shiftLeft:function(e){e>=32?(this.high=this.low<<e-32,this.low=0):(this.high=this.high<<e|this.low>>>32-e,this.low=this.low<<e)},rotateRight:function(e){var t,a;32&e?(a=this.low,t=this.high):(t=this.low,a=this.high),e&=31,this.low=t>>>e|a<<32-e,this.high=a>>>e|t<<32-e},not:function(){this.high=~this.high,this.low=~this.low},add:function(e){var t=(this.low>>>0)+(e.low>>>0),a=(this.high>>>0)+(e.high>>>0);t>4294967295&&(a+=1),this.low=0|t,this.high=0|a},copyTo:function(e,t){e[t]=this.high>>>24&255,e[t+1]=this.high>>16&255,e[t+2]=this.high>>8&255,e[t+3]=255&this.high,e[t+4]=this.low>>>24&255,e[t+5]=this.low>>16&255,e[t+6]=this.low>>8&255,e[t+7]=255&this.low},assign:function(e){this.high=e.high,this.low=e.low}},e}(),it=function(){function e(e,t){return e>>>t|e<<32-t}function t(e,t,a){return e&t^~e&a}function a(e,t,a){return e&t^e&a^t&a}function r(t){return e(t,2)^e(t,13)^e(t,22)}function i(t){return e(t,6)^e(t,11)^e(t,25)}function n(t){return e(t,7)^e(t,18)^t>>>3}function o(t){return e(t,17)^e(t,19)^t>>>10}function s(e,s,l){var h,u,f,d=1779033703,g=3144134277,m=1013904242,p=2773480762,b=1359893119,v=2600822924,y=528734635,k=1541459225,w=64*Math.ceil((l+9)/64),x=new Uint8Array(w);for(h=0;l>h;++h)x[h]=e[s++];for(x[h++]=128,f=w-8;f>h;)x[h++]=0;x[h++]=0,x[h++]=0,x[h++]=0,x[h++]=l>>>29&255,x[h++]=l>>21&255,x[h++]=l>>13&255,x[h++]=l>>5&255,x[h++]=l<<3&255;var C=new Uint32Array(64);for(h=0;w>h;){for(u=0;16>u;++u)C[u]=x[h]<<24|x[h+1]<<16|x[h+2]<<8|x[h+3],h+=4;for(u=16;64>u;++u)C[u]=o(C[u-2])+C[u-7]+n(C[u-15])+C[u-16]|0;var S,A,B=d,I=g,T=m,O=p,L=b,R=v,P=y,M=k;for(u=0;64>u;++u)S=M+i(L)+t(L,R,P)+c[u]+C[u],A=r(B)+a(B,I,T),M=P,P=R,R=L,L=O+S|0,O=T,T=I,I=B,B=S+A|0;d=d+B|0,g=g+I|0,m=m+T|0,p=p+O|0,b=b+L|0,v=v+R|0,y=y+P|0,k=k+M|0}return new Uint8Array([d>>24&255,d>>16&255,d>>8&255,255&d,g>>24&255,g>>16&255,g>>8&255,255&g,m>>24&255,m>>16&255,m>>8&255,255&m,p>>24&255,p>>16&255,p>>8&255,255&p,b>>24&255,b>>16&255,b>>8&255,255&b,v>>24&255,v>>16&255,v>>8&255,255&v,y>>24&255,y>>16&255,y>>8&255,255&y,k>>24&255,k>>16&255,k>>8&255,255&k])}var c=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return s}(),nt=function(){function e(e,t,a,r,i){e.assign(t),e.and(a),i.assign(t),i.not(),i.and(r),e.xor(i)}function t(e,t,a,r,i){e.assign(t),e.and(a),i.assign(t),i.and(r),e.xor(i),i.assign(a),i.and(r),e.xor(i)}function a(e,t,a){e.assign(t),e.rotateRight(28),a.assign(t),a.rotateRight(34),e.xor(a),a.assign(t),a.rotateRight(39),e.xor(a)}function r(e,t,a){e.assign(t),e.rotateRight(14),a.assign(t),a.rotateRight(18),e.xor(a),a.assign(t),a.rotateRight(41),e.xor(a)}function i(e,t,a){e.assign(t),e.rotateRight(1),a.assign(t),a.rotateRight(8),e.xor(a),a.assign(t),a.shiftRight(7),e.xor(a)}function n(e,t,a){e.assign(t),e.rotateRight(19),a.assign(t),a.rotateRight(61),e.xor(a),a.assign(t),a.shiftRight(6),e.xor(a)}function o(o,c,l,h){h=!!h;var u,f,d,g,m,p,b,v;h?(u=new rt(3418070365,3238371032),f=new rt(1654270250,914150663),d=new rt(2438529370,812702999),g=new rt(355462360,4144912697),m=new rt(1731405415,4290775857),p=new rt(2394180231,1750603025),b=new rt(3675008525,1694076839),v=new rt(1203062813,3204075428)):(u=new rt(1779033703,4089235720),f=new rt(3144134277,2227873595),d=new rt(1013904242,4271175723),g=new rt(2773480762,1595750129),m=new rt(1359893119,2917565137),p=new rt(2600822924,725511199),b=new rt(528734635,4215389547),v=new rt(1541459225,327033209));var y,k,w,x=128*Math.ceil((l+17)/128),C=new Uint8Array(x);for(y=0;l>y;++y)C[y]=o[c++];for(C[y++]=128,w=x-16;w>y;)C[y++]=0;C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=0,C[y++]=l>>>29&255,C[y++]=l>>21&255,C[y++]=l>>13&255,C[y++]=l>>5&255,C[y++]=l<<3&255;var S=new Array(80);for(y=0;80>y;y++)S[y]=new rt(0,0);var A,B=new rt(0,0),I=new rt(0,0),T=new rt(0,0),O=new rt(0,0),L=new rt(0,0),R=new rt(0,0),P=new rt(0,0),M=new rt(0,0),D=new rt(0,0),E=new rt(0,0),q=new rt(0,0),U=new rt(0,0);for(y=0;x>y;){for(k=0;16>k;++k)S[k].high=C[y]<<24|C[y+1]<<16|C[y+2]<<8|C[y+3],S[k].low=C[y+4]<<24|C[y+5]<<16|C[y+6]<<8|C[y+7],y+=8;for(k=16;80>k;++k)A=S[k],n(A,S[k-2],U),A.add(S[k-7]),i(q,S[k-15],U),A.add(q),A.add(S[k-16]);for(B.assign(u),I.assign(f),T.assign(d),O.assign(g),L.assign(m),R.assign(p),P.assign(b),M.assign(v),k=0;80>k;++k)D.assign(M),r(q,L,U),D.add(q),e(q,L,R,P,U),D.add(q),D.add(s[k]),D.add(S[k]),a(E,B,U),t(q,B,I,T,U),E.add(q),A=M,M=P,P=R,R=L,O.add(D),L=O,O=T,T=I,I=B,A.assign(D),A.add(E),B=A;u.add(B),f.add(I),d.add(T),g.add(O),m.add(L),p.add(R),b.add(P),v.add(M)}var F;return h?(F=new Uint8Array(48),u.copyTo(F,0),f.copyTo(F,8),d.copyTo(F,16),g.copyTo(F,24),m.copyTo(F,32),p.copyTo(F,40)):(F=new Uint8Array(64),u.copyTo(F,0),f.copyTo(F,8),d.copyTo(F,16),g.copyTo(F,24),m.copyTo(F,32),p.copyTo(F,40),b.copyTo(F,48),v.copyTo(F,56)),F}var s=[new rt(1116352408,3609767458),new rt(1899447441,602891725),new rt(3049323471,3964484399),new rt(3921009573,2173295548),new rt(961987163,4081628472),new rt(1508970993,3053834265),new rt(2453635748,2937671579),new rt(2870763221,3664609560),new rt(3624381080,2734883394),new rt(310598401,1164996542),new rt(607225278,1323610764),new rt(1426881987,3590304994),new rt(1925078388,4068182383),new rt(2162078206,991336113),new rt(2614888103,633803317),new rt(3248222580,3479774868),new rt(3835390401,2666613458),new rt(4022224774,944711139),new rt(264347078,2341262773),new rt(604807628,2007800933),new rt(770255983,1495990901),new rt(1249150122,1856431235),new rt(1555081692,3175218132),new rt(1996064986,2198950837),new rt(2554220882,3999719339),new rt(2821834349,766784016),new rt(2952996808,2566594879),new rt(3210313671,3203337956),new rt(3336571891,1034457026),new rt(3584528711,2466948901),new rt(113926993,3758326383),new rt(338241895,168717936),new rt(666307205,1188179964),new rt(773529912,1546045734),new rt(1294757372,1522805485),new rt(1396182291,2643833823),new rt(1695183700,2343527390),new rt(1986661051,1014477480),new rt(2177026350,1206759142),new rt(2456956037,344077627),new rt(2730485921,1290863460),new rt(2820302411,3158454273),new rt(3259730800,3505952657),new rt(3345764771,106217008),new rt(3516065817,3606008344),new rt(3600352804,1432725776),new rt(4094571909,1467031594),new rt(275423344,851169720),new rt(430227734,3100823752),new rt(506948616,1363258195),new rt(659060556,3750685593),new rt(883997877,3785050280),new rt(958139571,3318307427),new rt(1322822218,3812723403),new rt(1537002063,2003034995),new rt(1747873779,3602036899),new rt(1955562222,1575990012),new rt(2024104815,1125592928),new rt(2227730452,2716904306),new rt(2361852424,442776044),new rt(2428436474,593698344),new rt(2756734187,3733110249),new rt(3204031479,2999351573),new rt(3329325298,3815920427),new rt(3391569614,3928383900),new rt(3515267271,566280711),new rt(3940187606,3454069534),new rt(4118630271,4000239992),new rt(116418474,1914138554),new rt(174292421,2731055270),new rt(289380356,3203993006),new rt(460393269,320620315),new rt(685471733,587496836),new rt(852142971,1086792851),new rt(1017036298,365543100),new rt(1126000580,2618297676),new rt(1288033470,3409855158),new rt(1501505948,4234509866),new rt(1607167915,987167468),new rt(1816402316,1246189591)];return o}(),ot=function(){function e(e,t,a){return nt(e,t,a,!0)}return e}(),st=function(){function e(){}return e.prototype={decryptBlock:function(e){return e}},e}(),ct=function(){function e(e){var t=176,a=new Uint8Array(t);a.set(e);for(var r=16,i=1;t>r;++i){var s=a[r-3],c=a[r-2],l=a[r-1],h=a[r-4];s=o[s],c=o[c],l=o[l],h=o[h],s^=n[i];for(var u=0;4>u;++u)a[r]=s^=a[r-16],r++,a[r]=c^=a[r-16],r++,a[r]=l^=a[r-16],r++,a[r]=h^=a[r-16],r++}return a}function t(e,t){var a=new Uint8Array(16);a.set(e);var r,i,n,o,c,l;for(i=0,n=160;16>i;++i,++n)a[i]^=t[n];for(r=9;r>=1;--r){for(o=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=o,o=a[14],c=a[10],a[14]=a[6],a[10]=a[2],a[6]=o,a[2]=c,o=a[15],c=a[11],l=a[7],a[15]=a[3],a[11]=o,a[7]=c,a[3]=l,i=0;16>i;++i)a[i]=s[a[i]];for(i=0,n=16*r;16>i;++i,++n)a[i]^=t[n];for(i=0;16>i;i+=4){var u=h[a[i]],f=h[a[i+1]],d=h[a[i+2]],g=h[a[i+3]];o=u^f>>>8^f<<24^d>>>16^d<<16^g>>>24^g<<8,a[i]=o>>>24&255,a[i+1]=o>>16&255,a[i+2]=o>>8&255,a[i+3]=255&o}}for(o=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=o,o=a[14],c=a[10],a[14]=a[6],a[10]=a[2],a[6]=o,a[2]=c,o=a[15],c=a[11],l=a[7],a[15]=a[3],a[11]=o,a[7]=c,a[3]=l,i=0;16>i;++i)a[i]=s[a[i]],a[i]^=t[i];return a}function a(e,t){var a,r,i,n,s=new Uint8Array(16);for(s.set(e),h=0;16>h;++h)s[h]^=t[h];for(l=1;10>l;l++){for(h=0;16>h;++h)s[h]=o[s[h]];i=s[1],s[1]=s[5],s[5]=s[9],s[9]=s[13],s[13]=i,i=s[2],r=s[6],s[2]=s[10],s[6]=s[14],s[10]=i,s[14]=r,i=s[3],r=s[7],a=s[11],s[3]=s[15],s[7]=i,s[11]=r,s[15]=a;for(var h=0;16>h;h+=4){var u=s[h+0],f=s[h+1],d=s[h+2],g=s[h+3];a=u^f^d^g,s[h+0]^=a^c[u^f],s[h+1]^=a^c[f^d],s[h+2]^=a^c[d^g],s[h+3]^=a^c[g^u]}for(h=0,n=16*l;16>h;++h,++n)s[h]^=t[n]}for(h=0;16>h;++h)s[h]=o[s[h]];for(i=s[1],s[1]=s[5],s[5]=s[9],s[9]=s[13],s[13]=i,i=s[2],r=s[6],s[2]=s[10],s[6]=s[14],s[10]=i,s[14]=r,i=s[3],r=s[7],a=s[11],s[3]=s[15],s[7]=i,s[11]=r,s[15]=a,h=0,n=160;16>h;++h,++n)s[h]^=t[n];return s}function r(t){this.key=e(t),this.buffer=new Uint8Array(16),this.bufferPosition=0}function i(e,a){var r,i,n,o=e.length,s=this.buffer,c=this.bufferPosition,l=[],h=this.iv;for(r=0;o>r;++r)if(s[c]=e[r],++c,!(16>c)){var u=t(s,this.key);for(i=0;16>i;++i)u[i]^=h[i];h=s,l.push(u),s=new Uint8Array(16),c=0}if(this.buffer=s,this.bufferLength=c,this.iv=h,0===l.length)return new Uint8Array([]);var f=16*l.length;if(a){var d=l[l.length-1],g=d[15];if(16>=g){for(r=15,n=16-g;r>=n;--r)if(d[r]!==g){g=0;break}f-=g,l[l.length-1]=d.subarray(0,16-g)}}var m=new Uint8Array(f);for(r=0,i=0,n=l.length;n>r;++r,i+=16)m.set(l[r],i);return m}for(var n=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]),o=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]),c=new Uint8Array(256),l=0;256>l;l++)128>l?c[l]=l<<1:c[l]=l<<1^27;var h=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);return r.prototype={decryptBlock:function(e,t){var a,r=e.length,n=this.buffer,o=this.bufferPosition;for(a=0;16>o&&r>a;++a,++o)n[o]=e[a];return 16>o?(this.bufferLength=o,new Uint8Array([])):(this.iv=n,this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=i,this.decryptBlock(e.subarray(16),t))},encrypt:function(e,t){var r,i,n,o=e.length,s=this.buffer,c=this.bufferPosition,l=[];for(t||(t=new Uint8Array(16)),r=0;o>r;++r)if(s[c]=e[r],++c,!(16>c)){for(i=0;16>i;++i)s[i]^=t[i];var h=a(s,this.key);t=h,l.push(h),s=new Uint8Array(16),c=0}if(this.buffer=s,this.bufferLength=c,this.iv=t,0===l.length)return new Uint8Array([]);var u=16*l.length,f=new Uint8Array(u);for(r=0,i=0,n=l.length;n>r;++r,i+=16)f.set(l[r],i);return f}},r}(),lt=function(){function e(e){var t=240,a=new Uint8Array(t),r=1;a.set(e);for(var i=32,o=1;t>i;++o){if(i%32===16)s=n[s],c=n[c],l=n[l],h=n[h];else if(i%32===0){var s=a[i-3],c=a[i-2],l=a[i-1],h=a[i-4];s=n[s],c=n[c],l=n[l],h=n[h],s^=r,(r<<=1)>=256&&(r=255&(27^r))}for(var u=0;4>u;++u)a[i]=s^=a[i-32],i++,a[i]=c^=a[i-32],i++,a[i]=l^=a[i-32],i++,a[i]=h^=a[i-32],i++}return a}function t(e,t){var a=new Uint8Array(16);a.set(e);var r,i,n,s,c,h;for(i=0,n=224;16>i;++i,++n)a[i]^=t[n];for(r=13;r>=1;--r){for(s=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=s,s=a[14],c=a[10],a[14]=a[6],a[10]=a[2],a[6]=s,a[2]=c,s=a[15],c=a[11],h=a[7],a[15]=a[3],a[11]=s,a[7]=c,a[3]=h,i=0;16>i;++i)a[i]=o[a[i]];for(i=0,n=16*r;16>i;++i,++n)a[i]^=t[n];for(i=0;16>i;i+=4){var u=l[a[i]],f=l[a[i+1]],d=l[a[i+2]],g=l[a[i+3]];s=u^f>>>8^f<<24^d>>>16^d<<16^g>>>24^g<<8,a[i]=s>>>24&255,a[i+1]=s>>16&255,a[i+2]=s>>8&255,a[i+3]=255&s}}for(s=a[13],a[13]=a[9],a[9]=a[5],a[5]=a[1],a[1]=s,s=a[14],c=a[10],a[14]=a[6],a[10]=a[2],a[6]=s,a[2]=c,s=a[15],c=a[11],h=a[7],a[15]=a[3],a[11]=s,a[7]=c,a[3]=h,i=0;16>i;++i)a[i]=o[a[i]],a[i]^=t[i];return a}function a(e,t){var a,r,i,o,l=new Uint8Array(16);for(l.set(e),h=0;16>h;++h)l[h]^=t[h];for(c=1;14>c;c++){for(h=0;16>h;++h)l[h]=n[l[h]];i=l[1],l[1]=l[5],l[5]=l[9],l[9]=l[13],l[13]=i,i=l[2],r=l[6],l[2]=l[10],l[6]=l[14],l[10]=i,l[14]=r,i=l[3],r=l[7],a=l[11],l[3]=l[15],l[7]=i,l[11]=r,l[15]=a;for(var h=0;16>h;h+=4){var u=l[h+0],f=l[h+1],d=l[h+2],g=l[h+3];a=u^f^d^g,l[h+0]^=a^s[u^f],l[h+1]^=a^s[f^d],l[h+2]^=a^s[d^g],l[h+3]^=a^s[g^u]}for(h=0,o=16*c;16>h;++h,++o)l[h]^=t[o]}for(h=0;16>h;++h)l[h]=n[l[h]];for(i=l[1],l[1]=l[5],l[5]=l[9],l[9]=l[13],l[13]=i,i=l[2],r=l[6],l[2]=l[10],l[6]=l[14],l[10]=i,l[14]=r,i=l[3],r=l[7],a=l[11],l[3]=l[15],l[7]=i,l[11]=r,l[15]=a,h=0,o=224;16>h;++h,++o)l[h]^=t[o];return l}function r(t){this.key=e(t),this.buffer=new Uint8Array(16),this.bufferPosition=0}function i(e,a){var r,i,n,o=e.length,s=this.buffer,c=this.bufferPosition,l=[],h=this.iv;for(r=0;o>r;++r)if(s[c]=e[r],++c,!(16>c)){var u=t(s,this.key);for(i=0;16>i;++i)u[i]^=h[i];h=s,l.push(u),s=new Uint8Array(16),c=0}if(this.buffer=s,this.bufferLength=c,this.iv=h,0===l.length)return new Uint8Array([]);var f=16*l.length;if(a){var d=l[l.length-1],g=d[15];if(16>=g){for(r=15,n=16-g;r>=n;--r)if(d[r]!==g){g=0;break}f-=g,l[l.length-1]=d.subarray(0,16-g)}}var m=new Uint8Array(f);for(r=0,i=0,n=l.length;n>r;++r,i+=16)m.set(l[r],i);return m}for(var n=(new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]),new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22])),o=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]),s=new Uint8Array(256),c=0;256>c;c++)128>c?s[c]=c<<1:s[c]=c<<1^27;var l=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);return r.prototype={decryptBlock:function(e,t,a){var r,n=e.length,o=this.buffer,s=this.bufferPosition;if(a)this.iv=a;else{for(r=0;16>s&&n>r;++r,++s)o[s]=e[r];if(16>s)return this.bufferLength=s,new Uint8Array([]);this.iv=o,e=e.subarray(16)}return this.buffer=new Uint8Array(16),this.bufferLength=0,this.decryptBlock=i,this.decryptBlock(e,t)},encrypt:function(e,t){var r,i,n,o=e.length,s=this.buffer,c=this.bufferPosition,l=[];for(t||(t=new Uint8Array(16)),r=0;o>r;++r)if(s[c]=e[r],++c,!(16>c)){for(i=0;16>i;++i)s[i]^=t[i];var h=a(s,this.key);this.iv=h,l.push(h),s=new Uint8Array(16),c=0}if(this.buffer=s,this.bufferLength=c,this.iv=t,0===l.length)return new Uint8Array([]);var u=16*l.length,f=new Uint8Array(u);for(r=0,i=0,n=l.length;n>r;++r,i+=16)f.set(l[r],i);return f}},r}(),ht=function(){function e(e,t){if(e.length!==t.length)return!1;for(var a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}function t(){}return t.prototype={checkOwnerPassword:function(t,a,r,i){var n=new Uint8Array(t.length+56);n.set(t,0),n.set(a,t.length),n.set(r,t.length+a.length);var o=it(n,0,n.length);return e(o,i)},checkUserPassword:function(t,a,r){var i=new Uint8Array(t.length+8);i.set(t,0),i.set(a,t.length);var n=it(i,0,i.length);return e(n,r)},getOwnerKey:function(e,t,a,r){var i=new Uint8Array(e.length+56);i.set(e,0),i.set(t,e.length),i.set(a,e.length+t.length);var n=it(i,0,i.length),o=new lt(n);return o.decryptBlock(r,!1,new Uint8Array(16))},getUserKey:function(e,t,a){var r=new Uint8Array(e.length+8);r.set(e,0),r.set(t,e.length);var i=it(r,0,r.length),n=new lt(i);return n.decryptBlock(a,!1,new Uint8Array(16))}},t}(),ut=function(){function e(e,t){var a=new Uint8Array(e.length+t.length);return a.set(e,0),a.set(t,e.length),a}function t(t,a,r){for(var i=it(a,0,a.length).subarray(0,32),n=[0],o=0;64>o||n[n.length-1]>o-32;){var s=t.length+i.length+r.length,c=new Uint8Array(64*s),l=e(t,i);l=e(l,r);for(var h=0,u=0;64>h;h++,u+=s)c.set(l,u);var f=new ct(i.subarray(0,16));n=f.encrypt(c,i.subarray(16,32));for(var d=0,g=0;16>g;g++)d*=1,d%=3,d+=(n[g]>>>0)%3,d%=3;0===d?i=it(n,0,n.length):1===d?i=ot(n,0,n.length):2===d&&(i=nt(n,0,n.length)),o++}return i.subarray(0,32)}function a(){}function r(e,t){if(e.length!==t.length)return!1;for(var a=0;a<e.length;a++)if(e[a]!==t[a])return!1;return!0}return a.prototype={hash:function(e,a,r){return t(e,a,r)},checkOwnerPassword:function(e,a,i,n){var o=new Uint8Array(e.length+56);o.set(e,0),o.set(a,e.length),o.set(i,e.length+a.length);var s=t(e,o,i);return r(s,n)},checkUserPassword:function(e,a,i){var n=new Uint8Array(e.length+8);n.set(e,0),n.set(a,e.length);var o=t(e,n,[]);return r(o,i)},getOwnerKey:function(e,a,r,i){var n=new Uint8Array(e.length+56);n.set(e,0),n.set(a,e.length),n.set(r,e.length+a.length);var o=t(e,n,r),s=new lt(o);return s.decryptBlock(i,!1,new Uint8Array(16))},getUserKey:function(e,a,r){var i=new Uint8Array(e.length+8);i.set(e,0),i.set(a,e.length);var n=t(e,i,[]),o=new lt(n);return o.decryptBlock(r,!1,new Uint8Array(16))}},a}(),ft=function(){function e(e,t){this.stringCipherConstructor=e,this.streamCipherConstructor=t}return e.prototype={createStream:function(e,t){var a=new this.streamCipherConstructor;return new za(e,t,function(e,t){return a.decryptBlock(e,t)})},decryptString:function(e){var t=new this.stringCipherConstructor,a=c(e);return a=t.decryptBlock(a,!0),s(a)}},e}(),dt=function(){function e(e,t,a,r,i,n,o,s,c,l,h,u){if(t){var f=Math.min(127,t.length);t=t.subarray(0,f)}else t=[];var d;if(d=6===e?new ut:new ht){if(d.checkUserPassword(t,s,o))return d.getUserKey(t,c,h);if(d.checkOwnerPassword(t,r,n,a))return d.getOwnerKey(t,i,n,l)}return null}function t(e,t,a,r,i,n,o,c){var l,h,u=40+a.length+e.length,f=new Uint8Array(u),d=0;if(t)for(h=Math.min(32,t.length);h>d;++d)f[d]=t[d];for(l=0;32>d;)f[d++]=s[l++];for(l=0,h=a.length;h>l;++l)f[d++]=a[l];for(f[d++]=255&i,f[d++]=i>>8&255,f[d++]=i>>16&255,f[d++]=i>>>24&255,l=0,h=e.length;h>l;++l)f[d++]=e[l];n>=4&&!c&&(f[d++]=255,f[d++]=255,f[d++]=255,f[d++]=255);var g=at(f,0,d),m=o>>3;if(n>=3)for(l=0;50>l;++l)g=at(g,0,m);var p,b,v=g.subarray(0,m);if(n>=3){for(d=0;32>d;++d)f[d]=s[d];for(l=0,h=e.length;h>l;++l)f[d++]=e[l];p=new tt(v),b=p.encryptBlock(at(f,0,d)),h=v.length;var y,k=new Uint8Array(h);for(l=1;19>=l;++l){for(y=0;h>y;++y)k[y]=v[y]^l;p=new tt(k),b=p.encryptBlock(b)}for(l=0,h=b.length;h>l;++l)if(r[l]!==b[l])return null}else for(p=new tt(v),b=p.encryptBlock(s),l=0,h=b.length;h>l;++l)if(r[l]!==b[l])return null;return v}function r(e,t,a,r){var i,n,o=new Uint8Array(32),c=0;for(n=Math.min(32,e.length);n>c;++c)o[c]=e[c];for(i=0;32>c;)o[c++]=s[i++];var l=at(o,0,c),h=r>>3;if(a>=3)for(i=0;50>i;++i)l=at(l,0,l.length);var u,f;if(a>=3){f=t;var d,g=new Uint8Array(h);for(i=19;i>=0;i--){for(d=0;h>d;++d)g[d]=l[d]^i;u=new tt(g),f=u.encryptBlock(f)}}else u=new tt(l.subarray(0,h)),f=u.encryptBlock(t);return f}function i(i,n,o){var s=i.get("Filter");C(s)&&"Standard"===s.name||a("unknown encryption method"),this.dict=i;var h=i.get("V");(!k(h)||1!==h&&2!==h&&4!==h&&5!==h)&&a("unsupported encryption algorithm"),this.algorithm=h;var u=i.get("Length")||40;(!k(u)||40>u||u%8!==0)&&a("invalid key length");var f=c(i.get("O")).subarray(0,32),d=c(i.get("U")).subarray(0,32),g=i.get("P"),m=i.get("R"),p=(4===h||5===h)&&i.get("EncryptMetadata")!==!1;this.encryptMetadata=p;var b,v=c(n);o&&(b=c(o));var y;if(5!==h)y=t(v,b,f,d,g,m,u,p);else{var w=c(i.get("O")).subarray(32,40),x=c(i.get("O")).subarray(40,48),S=c(i.get("U")).subarray(0,48),A=c(i.get("U")).subarray(32,40),B=c(i.get("U")).subarray(40,48),I=c(i.get("OE")),T=c(i.get("UE")),O=c(i.get("Perms"));y=e(m,b,f,w,x,S,d,A,B,I,T,O)}if(!y&&!o)throw new Q("No password given",Z.NEED_PASSWORD);if(!y&&o){var L=r(b,f,m,u);y=t(v,L,f,d,g,m,u,p)}if(!y)throw new Q("Incorrect Password",Z.INCORRECT_PASSWORD);this.encryptionKey=y,h>=4&&(this.cf=i.get("CF"),this.stmf=i.get("StmF")||l,this.strf=i.get("StrF")||l,this.eff=i.get("EFF")||this.strf)}function n(e,t,a,r){var i,n,o=new Uint8Array(a.length+9);for(i=0,n=a.length;n>i;++i)o[i]=a[i];o[i++]=255&e,o[i++]=e>>8&255,o[i++]=e>>16&255,o[i++]=255&t,o[i++]=t>>8&255,r&&(o[i++]=115,o[i++]=65,o[i++]=108,o[i++]=84);var s=at(o,0,i);return s.subarray(0,Math.min(a.length+5,16))}function o(e,t,r,i,o){var s,c=e.get(t.name);return null!==c&&void 0!==c&&(s=c.get("CFM")),s&&"None"!==s.name?"V2"===s.name?function(){return new tt(n(r,i,o,!1))}:"AESV2"===s.name?function(){return new ct(n(r,i,o,!0))}:"AESV3"===s.name?function(){return new lt(o)}:void a("Unknown crypto method"):function(){return new st}}var s=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]),l=ye.get("Identity");return i.prototype={createCipherTransform:function(e,t){if(4===this.algorithm||5===this.algorithm)return new ft(o(this.cf,this.stmf,e,t,this.encryptionKey),o(this.cf,this.strf,e,t,this.encryptionKey));var a=n(e,t,this.encryptionKey,!1),r=function(){return new tt(a)};return new ft(r,r)}},i}(),gt={FUNCTION_BASED:1,AXIAL:2,RADIAL:3,FREE_FORM_MESH:4,LATTICE_FORM_MESH:5,COONS_PATCH_MESH:6,TENSOR_PATCH_MESH:7},mt=function(){function e(){a("should not call Pattern constructor")}return e.prototype={getPattern:function(e){
a("Should not call Pattern.getStyle: "+e)}},e.parseShading=function(e,a,r,i){var n=I(e)?e.dict:e,o=n.get("ShadingType");try{switch(o){case gt.AXIAL:case gt.RADIAL:return new pt.RadialAxial(n,a,r,i);case gt.FREE_FORM_MESH:case gt.LATTICE_FORM_MESH:case gt.COONS_PATCH_MESH:case gt.TENSOR_PATCH_MESH:return new pt.Mesh(e,a,r,i);default:throw new Error("Unknown PatternType: "+o)}}catch(s){if(s instanceof ie)throw s;return Y.notify(K.shadingPattern),t(s),new pt.Dummy}},e}(),pt={};pt.SMALL_NUMBER=.01,pt.RadialAxial=function(){function r(a,r,i,n){this.matrix=r,this.coordsArr=a.get("Coords"),this.shadingType=a.get("ShadingType"),this.type="Pattern";var o=a.get("ColorSpace","CS");o=_e.parse(o,i,n),this.cs=o;var s=0,c=1;if(a.has("Domain")){var l=a.get("Domain");s=l[0],c=l[1]}var h=!1,u=!1;if(a.has("Extend")){var f=a.get("Extend");h=f[0],u=f[1]}if(!(this.shadingType!==gt.RADIAL||h&&u)){var d=this.coordsArr[0],g=this.coordsArr[1],m=this.coordsArr[2],p=this.coordsArr[3],b=this.coordsArr[4],v=this.coordsArr[5],y=Math.sqrt((d-p)*(d-p)+(g-b)*(g-b));v+y>=m&&m+y>=v&&t("Unsupported radial gradient.")}this.extendStart=h,this.extendEnd=u;var k=a.get("Function"),w=ze.parseArray(i,k),x=c-s,C=x/10,S=this.colorStops=[];if(s>=c||0>=C)return void e("Bad shading domain.");for(var A,B=new Float32Array(o.numComps),I=new Float32Array(1),T=s;c>=T;T+=C){I[0]=T,w(I,0,B,0),A=o.getRgb(B,0);var O=ce.makeCssRgb(A[0],A[1],A[2]);S.push([(T-s)/x,O])}var L="transparent";a.has("Background")&&(A=o.getRgb(a.get("Background"),0),L=ce.makeCssRgb(A[0],A[1],A[2])),h||(S.unshift([0,L]),S[1][0]+=pt.SMALL_NUMBER),u||(S[S.length-1][0]-=pt.SMALL_NUMBER,S.push([1,L])),this.colorStops=S}return r.prototype={getIR:function(){var e,t,r,i,n,o=this.coordsArr,s=this.shadingType;s===gt.AXIAL?(t=[o[0],o[1]],r=[o[2],o[3]],i=null,n=null,e="axial"):s===gt.RADIAL?(t=[o[0],o[1]],r=[o[3],o[4]],i=o[2],n=o[5],e="radial"):a("getPattern type unknown: "+s);var c=this.matrix;return c&&(t=ce.applyTransform(t,c),r=ce.applyTransform(r,c)),["RadialAxial",e,this.colorStops,t,r,i,n]}},r}(),pt.Mesh=function(){function e(e,t){this.stream=e,this.context=t,this.buffer=0,this.bufferLength=0;var a=t.numComps;this.tmpCompsBuf=new Float32Array(a);var r=t.colorSpace;this.tmpCsCompsBuf=t.colorFn?new Float32Array(r):this.tmpCompsBuf}function t(e,t){for(var a=e.coords,r=e.colors,n=[],o=[],s=0;t.hasData;){var c=t.readFlag(),l=t.readCoordinate(),h=t.readComponents();if(0===s){switch(i(c>=0&&2>=c,"Unknown type4 flag"),c){case 0:s=3;break;case 1:o.push(o[o.length-2],o[o.length-1]),s=1;break;case 2:o.push(o[o.length-3],o[o.length-1]),s=1}n.push(c)}o.push(a.length),a.push(l),r.push(h),s--,t.align()}var u=new Int32Array(o);e.figures.push({type:"triangles",coords:u,colors:u})}function r(e,t,a){for(var r=e.coords,i=e.colors,n=[];t.hasData;){var o=t.readCoordinate(),s=t.readComponents();n.push(r.length),r.push(o),i.push(s)}var c=new Int32Array(n);e.figures.push({type:"lattice",coords:c,colors:c,verticesPerRow:a})}function n(e,t){var a=e.figures[t];i("patch"===a.type,"Unexpected patch mesh figure");var r=e.coords,n=e.colors,o=a.coords,s=a.colors,c=Math.min(r[o[0]][0],r[o[3]][0],r[o[12]][0],r[o[15]][0]),l=Math.min(r[o[0]][1],r[o[3]][1],r[o[12]][1],r[o[15]][1]),h=Math.max(r[o[0]][0],r[o[3]][0],r[o[12]][0],r[o[15]][0]),m=Math.max(r[o[0]][1],r[o[3]][1],r[o[12]][1],r[o[15]][1]),p=Math.ceil((h-c)*d/(e.bounds[2]-e.bounds[0]));p=Math.max(u,Math.min(f,p));var b=Math.ceil((m-l)*d/(e.bounds[3]-e.bounds[1]));b=Math.max(u,Math.min(f,b));for(var v=p+1,y=new Int32Array((b+1)*v),k=new Int32Array((b+1)*v),w=0,x=new Uint8Array(3),C=new Uint8Array(3),S=n[s[0]],A=n[s[1]],B=n[s[2]],I=n[s[3]],T=g(b),O=g(p),L=0;b>=L;L++){x[0]=(S[0]*(b-L)+B[0]*L)/b|0,x[1]=(S[1]*(b-L)+B[1]*L)/b|0,x[2]=(S[2]*(b-L)+B[2]*L)/b|0,C[0]=(A[0]*(b-L)+I[0]*L)/b|0,C[1]=(A[1]*(b-L)+I[1]*L)/b|0,C[2]=(A[2]*(b-L)+I[2]*L)/b|0;for(var R=0;p>=R;R++,w++)if(0!==L&&L!==b||0!==R&&R!==p){for(var P=0,M=0,D=0,E=0;3>=E;E++)for(var q=0;3>=q;q++,D++){var U=T[L][E]*O[R][q];P+=r[o[D]][0]*U,M+=r[o[D]][1]*U}y[w]=r.length,r.push([P,M]),k[w]=n.length;var F=new Uint8Array(3);F[0]=(x[0]*(p-R)+C[0]*R)/p|0,F[1]=(x[1]*(p-R)+C[1]*R)/p|0,F[2]=(x[2]*(p-R)+C[2]*R)/p|0,n.push(F)}}y[0]=o[0],k[0]=s[0],y[p]=o[3],k[p]=s[1],y[v*b]=o[12],k[v*b]=s[2],y[v*b+p]=o[15],k[v*b+p]=s[3],e.figures[t]={type:"lattice",coords:y,colors:k,verticesPerRow:v}}function o(e,t){for(var a=e.coords,r=e.colors,n=new Int32Array(16),o=new Int32Array(4);t.hasData;){var s=t.readFlag();i(s>=0&&3>=s,"Unknown type6 flag");var c,l,h=a.length;for(c=0,l=0!==s?8:12;l>c;c++)a.push(t.readCoordinate());var u=r.length;for(c=0,l=0!==s?2:4;l>c;c++)r.push(t.readComponents());var f,d,g,m;switch(s){case 0:n[12]=h+3,n[13]=h+4,n[14]=h+5,n[15]=h+6,n[8]=h+2,n[11]=h+7,n[4]=h+1,n[7]=h+8,n[0]=h,n[1]=h+11,n[2]=h+10,n[3]=h+9,o[2]=u+1,o[3]=u+2,o[0]=u,o[1]=u+3;break;case 1:f=n[12],d=n[13],g=n[14],m=n[15],n[12]=h+5,n[13]=h+4,n[14]=h+3,n[15]=h+2,n[8]=h+6,n[11]=h+1,n[4]=h+7,n[7]=h,n[0]=f,n[1]=d,n[2]=g,n[3]=m,f=o[2],d=o[3],o[2]=u+1,o[3]=u,o[0]=f,o[1]=d;break;case 2:n[12]=n[15],n[13]=h+7,n[14]=h+6,n[15]=h+5,n[8]=n[11],n[11]=h+4,n[4]=n[7],n[7]=h+3,n[0]=n[3],n[1]=h,n[2]=h+1,n[3]=h+2,o[2]=o[3],o[3]=u+1,o[0]=o[1],o[1]=u;break;case 3:n[12]=n[0],n[13]=n[1],n[14]=n[2],n[15]=n[3],n[8]=h,n[11]=h+7,n[4]=h+1,n[7]=h+6,n[0]=h+2,n[1]=h+3,n[2]=h+4,n[3]=h+5,o[2]=o[0],o[3]=o[1],o[0]=u,o[1]=u+1}n[5]=a.length,a.push([(-4*a[n[0]][0]-a[n[15]][0]+6*(a[n[4]][0]+a[n[1]][0])-2*(a[n[12]][0]+a[n[3]][0])+3*(a[n[13]][0]+a[n[7]][0]))/9,(-4*a[n[0]][1]-a[n[15]][1]+6*(a[n[4]][1]+a[n[1]][1])-2*(a[n[12]][1]+a[n[3]][1])+3*(a[n[13]][1]+a[n[7]][1]))/9]),n[6]=a.length,a.push([(-4*a[n[3]][0]-a[n[12]][0]+6*(a[n[2]][0]+a[n[7]][0])-2*(a[n[0]][0]+a[n[15]][0])+3*(a[n[4]][0]+a[n[14]][0]))/9,(-4*a[n[3]][1]-a[n[12]][1]+6*(a[n[2]][1]+a[n[7]][1])-2*(a[n[0]][1]+a[n[15]][1])+3*(a[n[4]][1]+a[n[14]][1]))/9]),n[9]=a.length,a.push([(-4*a[n[12]][0]-a[n[3]][0]+6*(a[n[8]][0]+a[n[13]][0])-2*(a[n[0]][0]+a[n[15]][0])+3*(a[n[11]][0]+a[n[1]][0]))/9,(-4*a[n[12]][1]-a[n[3]][1]+6*(a[n[8]][1]+a[n[13]][1])-2*(a[n[0]][1]+a[n[15]][1])+3*(a[n[11]][1]+a[n[1]][1]))/9]),n[10]=a.length,a.push([(-4*a[n[15]][0]-a[n[0]][0]+6*(a[n[11]][0]+a[n[14]][0])-2*(a[n[12]][0]+a[n[3]][0])+3*(a[n[2]][0]+a[n[8]][0]))/9,(-4*a[n[15]][1]-a[n[0]][1]+6*(a[n[11]][1]+a[n[14]][1])-2*(a[n[12]][1]+a[n[3]][1])+3*(a[n[2]][1]+a[n[8]][1]))/9]),e.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(o)})}}function s(e,t){for(var a=e.coords,r=e.colors,n=new Int32Array(16),o=new Int32Array(4);t.hasData;){var s=t.readFlag();i(s>=0&&3>=s,"Unknown type7 flag");var c,l,h=a.length;for(c=0,l=0!==s?12:16;l>c;c++)a.push(t.readCoordinate());var u=r.length;for(c=0,l=0!==s?2:4;l>c;c++)r.push(t.readComponents());var f,d,g,m;switch(s){case 0:n[12]=h+3,n[13]=h+4,n[14]=h+5,n[15]=h+6,n[8]=h+2,n[9]=h+13,n[10]=h+14,n[11]=h+7,n[4]=h+1,n[5]=h+12,n[6]=h+15,n[7]=h+8,n[0]=h,n[1]=h+11,n[2]=h+10,n[3]=h+9,o[2]=u+1,o[3]=u+2,o[0]=u,o[1]=u+3;break;case 1:f=n[12],d=n[13],g=n[14],m=n[15],n[12]=h+5,n[13]=h+4,n[14]=h+3,n[15]=h+2,n[8]=h+6,n[9]=h+11,n[10]=h+10,n[11]=h+1,n[4]=h+7,n[5]=h+8,n[6]=h+9,n[7]=h,n[0]=f,n[1]=d,n[2]=g,n[3]=m,f=o[2],d=o[3],o[2]=u+1,o[3]=u,o[0]=f,o[1]=d;break;case 2:n[12]=n[15],n[13]=h+7,n[14]=h+6,n[15]=h+5,n[8]=n[11],n[9]=h+8,n[10]=h+11,n[11]=h+4,n[4]=n[7],n[5]=h+9,n[6]=h+10,n[7]=h+3,n[0]=n[3],n[1]=h,n[2]=h+1,n[3]=h+2,o[2]=o[3],o[3]=u+1,o[0]=o[1],o[1]=u;break;case 3:n[12]=n[0],n[13]=n[1],n[14]=n[2],n[15]=n[3],n[8]=h,n[9]=h+9,n[10]=h+8,n[11]=h+7,n[4]=h+1,n[5]=h+10,n[6]=h+11,n[7]=h+6,n[0]=h+2,n[1]=h+3,n[2]=h+4,n[3]=h+5,o[2]=o[0],o[3]=o[1],o[0]=u,o[1]=u+1}e.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(o)})}}function c(e){for(var t=e.coords[0][0],a=e.coords[0][1],r=t,i=a,n=1,o=e.coords.length;o>n;n++){var s=e.coords[n][0],c=e.coords[n][1];t=t>s?s:t,a=a>c?c:a,r=s>r?s:r,i=c>i?c:i}e.bounds=[t,a,r,i]}function l(e){var t,a,r,i,n=e.coords,o=new Float32Array(2*n.length);for(t=0,r=0,a=n.length;a>t;t++){var s=n[t];o[r++]=s[0],o[r++]=s[1]}e.coords=o;var c=e.colors,l=new Uint8Array(3*c.length);for(t=0,r=0,a=c.length;a>t;t++){var h=c[t];l[r++]=h[0],l[r++]=h[1],l[r++]=h[2]}e.colors=l;var u=e.figures;for(t=0,a=u.length;a>t;t++){var f=u[t],d=f.coords,g=f.colors;for(r=0,i=d.length;i>r;r++)d[r]*=2,g[r]*=3}}function h(h,u,f,d){i(I(h),"Mesh data is not a stream");var g=h.dict;this.matrix=u,this.shadingType=g.get("ShadingType"),this.type="Pattern",this.bbox=g.get("BBox");var m=g.get("ColorSpace","CS");m=_e.parse(m,f,d),this.cs=m,this.background=g.has("Background")?m.getRgb(g.get("Background"),0):null;var p=g.get("Function"),b=p?ze.parseArray(f,p):null;this.coords=[],this.colors=[],this.figures=[];var v={bitsPerCoordinate:g.get("BitsPerCoordinate"),bitsPerComponent:g.get("BitsPerComponent"),bitsPerFlag:g.get("BitsPerFlag"),decode:g.get("Decode"),colorFn:b,colorSpace:m,numComps:b?1:m.numComps},y=new e(h,v),k=!1;switch(this.shadingType){case gt.FREE_FORM_MESH:t(this,y);break;case gt.LATTICE_FORM_MESH:var w=0|g.get("VerticesPerRow");i(w>=2,"Invalid VerticesPerRow"),r(this,y,w);break;case gt.COONS_PATCH_MESH:o(this,y),k=!0;break;case gt.TENSOR_PATCH_MESH:s(this,y),k=!0;break;default:a("Unsupported mesh type.")}if(k){c(this);for(var x=0,C=this.figures.length;C>x;x++)n(this,x)}c(this),l(this)}e.prototype={get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;var e=this.stream.getByte();return 0>e?!1:(this.buffer=e,this.bufferLength=8,!0)},readBits:function(e){var t=this.buffer,a=this.bufferLength;if(32===e){if(0===a)return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0;t=t<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();var r=this.stream.getByte();return this.buffer=r&(1<<a)-1,(t<<8-a|(255&r)>>a)>>>0}if(8===e&&0===a)return this.stream.getByte();for(;e>a;)t=t<<8|this.stream.getByte(),a+=8;return a-=e,this.bufferLength=a,this.buffer=t&(1<<a)-1,t>>a},align:function(){this.buffer=0,this.bufferLength=0},readFlag:function(){return this.readBits(this.context.bitsPerFlag)},readCoordinate:function(){var e=this.context.bitsPerCoordinate,t=this.readBits(e),a=this.readBits(e),r=this.context.decode,i=32>e?1/((1<<e)-1):2.3283064365386963e-10;return[t*i*(r[1]-r[0])+r[0],a*i*(r[3]-r[2])+r[2]]},readComponents:function(){for(var e=this.context.numComps,t=this.context.bitsPerComponent,a=32>t?1/((1<<t)-1):2.3283064365386963e-10,r=this.context.decode,i=this.tmpCompsBuf,n=0,o=4;e>n;n++,o+=2){var s=this.readBits(t);i[n]=s*a*(r[o+1]-r[o])+r[o]}var c=this.tmpCsCompsBuf;return this.context.colorFn&&this.context.colorFn(i,0,c,0),this.context.colorSpace.getRgb(c,0)}};var u=3,f=20,d=20,g=function(){function e(e){for(var t=[],a=0;e>=a;a++){var r=a/e,i=1-r;t.push(new Float32Array([i*i*i,3*r*i*i,3*r*r*i,r*r*r]))}return t}var t=[];return function(a){return t[a]||(t[a]=e(a)),t[a]}}();return h.prototype={getIR:function(){return["Mesh",this.shadingType,this.coords,this.colors,this.figures,this.bounds,this.matrix,this.bbox,this.background]}},h}(),pt.Dummy=function(){function e(){this.type="Pattern"}return e.prototype={getIR:function(){return["Dummy"]}},e}();var bt=function(){function r(e,t,a,r,i,n,o){this.pdfManager=e,this.xref=t,this.handler=a,this.pageIndex=r,this.uniquePrefix=i,this.idCounters=n,this.fontCache=o}function n(){this.reset()}var o=20,s=100;n.prototype={check:function(){return++this.checked<s?!1:(this.checked=0,this.endTime<=Date.now())},reset:function(){this.endTime=Date.now()+o,this.checked=0}};var c=Promise.resolve(),l=1,h=2;return r.prototype={hasBlendModes:function(e){if(!A(e))return!1;var t=Object.create(null);e.objId&&(t[e.objId]=!0);for(var a=[e];a.length;){var r,i=a.shift(),n=i.get("ExtGState");if(A(n)){n=n.getAll();for(r in n){var o=n[r],s=o.BM;if(C(s)&&"Normal"!==s.name)return!0}}var c=i.get("XObject");if(A(c)){c=c.getAll();for(r in c){var l=c[r];if(I(l)){if(l.dict.objId){if(t[l.dict.objId])continue;t[l.dict.objId]=!0}var h=l.dict.get("Resources");!A(h)||h.objId&&t[h.objId]||(a.push(h),h.objId&&(t[h.objId]=!0))}}}}return!1},buildFormXObject:function(e,t,a,r,i){var n=t.dict.get("Matrix"),o=t.dict.get("BBox"),s=t.dict.get("Group");if(s){var c,l={matrix:n,bbox:o,smask:a,isolated:!1,knockout:!1},h=s.get("S");C(h)&&"Transparency"===h.name&&(l.isolated=s.get("I")||!1,l.knockout=s.get("K")||!1,c=s.has("CS")?_e.parse(s.get("CS"),this.xref,e):null),a&&a.backdrop&&(c=c||_e.singletons.rgb,a.backdrop=c.getRgb(a.backdrop,0)),r.addOp(W.beginGroup,[l])}return r.addOp(W.paintFormXObjectBegin,[n,o]),this.getOperatorList(t,t.dict.get("Resources")||e,r,i).then(function(){r.addOp(W.paintFormXObjectEnd,[]),s&&r.addOp(W.endGroup,[l])})},buildPaintImageXObject:function(e,a,r,i,n,o){var s=this,c=a.dict,l=c.get("Width","W"),h=c.get("Height","H");if(!(l&&w(l)&&h&&w(h)))return void t("Image dimensions are missing, or not numbers.");if(-1!==PDFJS.maxImageSize&&l*h>PDFJS.maxImageSize)return void t("Image exceeded maximum allowed size and was removed.");var u,f,d=c.get("ImageMask","IM")||!1;if(d){var g=c.get("Width","W"),m=c.get("Height","H"),p=g+7>>3,b=a.getBytes(p*m),v=c.get("Decode","D"),y=!!v&&v[0]>0;return u=wa.createMask(b,g,m,a instanceof Da,y),u.cached=!0,f=[u],i.addOp(W.paintImageMaskXObject,f),void(n&&(o[n]={fn:W.paintImageMaskXObject,args:f}))}var k=c.get("SMask","SM")||!1,x=c.get("Mask")||!1,C=200;if(r&&!k&&!x&&!(a instanceof Fa)&&C>l+h){var S=new wa(this.xref,e,a,r,null,null);return u=S.createImageData(!0),void i.addOp(W.paintInlineImageXObject,[u])}var A=this.uniquePrefix||"",B="img_"+A+ ++this.idCounters.obj;return i.addDependency(B),f=[B,l,h],!k&&!x&&a instanceof Fa&&a.isNativelySupported(this.xref,e)?(i.addOp(W.paintJpegXObject,f),void this.handler.send("obj",[B,this.pageIndex,"JpegStream",a.getIR()])):(wa.buildImage(s.handler,s.xref,e,a,r).then(function(e){var t=e.createImageData(!1);s.handler.send("obj",[B,s.pageIndex,"Image",t],[t.data.buffer])}).then(void 0,function(e){t("Unable to decode image: "+e),s.handler.send("obj",[B,s.pageIndex,"Image",null])}),i.addOp(W.paintImageXObject,f),void(n&&(o[n]={fn:W.paintImageXObject,args:f})))},handleSMask:function(e,t,a,r){var i=e.get("G"),n={subtype:e.get("S").name,backdrop:e.get("BC")};return this.buildFormXObject(t,i,n,a,r.state.clone())},handleTilingType:function(e,t,a,r,i,n){var o=new yt;return this.getOperatorList(r,i.get("Resources")||a,o).then(function(){n.addDependencies(o.dependencies),n.addOp(e,P({fnArray:o.fnArray,argsArray:o.argsArray},i,t))})},handleSetFont:function(e,t,a,r,i){var n;t&&(t=t.slice(),n=t[0].name);var o=this;return this.loadFont(n,a,this.xref,e).then(function(t){return t.font.isType3Font?t.loadType3Data(o,e,r).then(function(){return t}):t}).then(function(e){return i.font=e.font,e.send(o.handler),e.loadedName})},handleText:function(e,t){var a=t.font,r=a.charsToGlyphs(e),i=!!(t.textRenderingMode&G.ADD_TO_PATH_FLAG);if(a.data&&(i||PDFJS.disableFontFace))for(var n=function(e){if(!a.renderer.hasBuiltPath(e)){var t=a.renderer.getPathJs(e);this.handler.send("commonobj",[a.loadedName+"_path_"+e,"FontPath",t])}}.bind(this),o=0,s=r.length;s>o;o++){var c=r[o];if(null!==c){n(c.fontChar);var l=c.accent;l&&l.fontChar&&n(l.fontChar)}}return r},setGState:function(a,r,i,n,o){var s=[],c=r.map,l=this,h=Promise.resolve();for(var u in c){var f=c[u];switch(u){case"Type":break;case"LW":case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":s.push([u,f]);break;case"Font":h=h.then(function(){return l.handleSetFont(a,null,f[0],i,o.state).then(function(e){i.addDependency(e),s.push([u,[e,f[1]]])})});break;case"BM":s.push([u,f]);break;case"SMask":if(C(f)&&"None"===f.name){s.push([u,!1]);break}var d=n.fetchIfRef(f);A(d)?(h=h.then(function(){return l.handleSMask(d,a,i,o)}),s.push([u,!0])):t("Unsupported SMask type");break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":e("graphic state operator "+u);break;default:e("Unknown graphic state operator "+u)}}return h.then(function(){s.length>=0&&i.addOp(W.setGState,[s])})},loadFont:function(e,a,r,n){function o(){return Promise.resolve(new vt("g_font_error",new Qt("Font "+e+" is not available"),a))}var s;if(a)i(O(a)),s=a;else{var c=n.get("Font");if(!c)return t("fontRes not available"),o();s=c.getRaw(e)}if(!s)return t("fontRef not available"),o();if(this.fontCache.has(s))return this.fontCache.get(s);if(a=r.fetchIfRef(s),!A(a))return o();if(a.translated)return a.translated;var l=L(),h=this.preEvaluateFont(a,r),u=h.descriptor,f=s.num+"_"+s.gen;if(A(u)){u.fontAliases||(u.fontAliases=Object.create(null));var d=u.fontAliases,g=h.hash;if(d[g]){var m=d[g].aliasRef;if(m&&this.fontCache.has(m))return this.fontCache.putAlias(s,m),this.fontCache.get(s)}d[g]||(d[g]={fontID:Zt.getFontID()}),d[g].aliasRef=s,f=d[g].fontID}var p=A(s);p||this.fontCache.put(s,l.promise),a.loadedName="g_font_"+(p?e.replace(/\W/g,""):f),a.translated=l.promise;var b;try{b=Promise.resolve(this.translateFont(h,r))}catch(v){b=Promise.reject(v)}return b.then(function(e){if(void 0!==e.fontType){var t=r.stats.fontTypes;t[e.fontType]=!0}l.resolve(new vt(a.loadedName,e,a))},function(e){Y.notify(K.font);try{var t=h.descriptor,i=t&&t.get("FontFile3"),n=i&&i.get("Subtype"),o=F(h.type,n&&n.name),s=r.stats.fontTypes;s[o]=!0}catch(c){}l.resolve(new vt(a.loadedName,new Qt(e instanceof Error?e.message:e),a))}),l.promise},buildPath:function(e,t,a){var r=e.length-1;if(a||(a=[]),0>r||e.fnArray[r]!==W.constructPath)e.addOp(W.constructPath,[[t],a]);else{var i=e.argsArray[r];i[0].push(t),Array.prototype.push.apply(i[1],a)}},handleColorN:function(e,t,a,r,i,n,o){var s,c=a[a.length-1];if(C(c)&&(s=i.get(c.name))){var u=I(s)?s.dict:s,f=u.get("PatternType");if(f===l){var d=r.base?r.base.getRgb(a,0):null;return this.handleTilingType(t,d,n,s,u,e)}if(f===h){var g=u.get("Shading"),m=u.get("Matrix");return s=mt.parseShading(g,m,o,n),e.addOp(t,s.getIR()),Promise.resolve()}return Promise.reject("Unknown PatternType: "+f)}return e.addOp(t,a),Promise.resolve()},getOperatorList:function(t,r,o,s){var l=this,h=this.xref,u={};i(o),r=r||we.empty;var f=r.get("XObject")||we.empty,d=r.get("Pattern")||we.empty,g=new kt(s||new xt),m=new Ct(t,h,g),p=new n;return new Promise(function b(t,n){p.reset();for(var s,v,y,k,S={};!(s=p.check())&&(S.args=null,m.read(S));){var B=S.args,T=S.fn;switch(0|T){case W.paintXObject:if(B[0].code)break;var O=B[0].name;if(void 0!==u[O]){o.addOp(u[O].fn,u[O].args),B=null;continue}var L=f.get(O);if(L){i(I(L),"XObject should be a stream");var R=L.dict.get("Subtype");if(i(C(R),"XObject should have a Name subtype"),"Form"===R.name)return g.save(),l.buildFormXObject(r,L,null,o,g.state.clone()).then(function(){g.restore(),b(t,n)},n);if("Image"===R.name){l.buildPaintImageXObject(r,L,!1,o,O,u),B=null;continue}if("PS"===R.name){e("Ignored XObject subtype PS");continue}a("Unhandled XObject subtype "+R.name)}break;case W.setFont:var P=B[1];return l.handleSetFont(r,B,null,o,g.state).then(function(e){o.addDependency(e),o.addOp(W.setFont,[e,P]),b(t,n)},n);case W.endInlineImage:var M=B[0].cacheKey;if(M){var D=u[M];if(void 0!==D){o.addOp(D.fn,D.args),B=null;continue}}l.buildPaintImageXObject(r,B[0],!0,o,M,u),B=null;continue;case W.showText:B[0]=l.handleText(B[0],g.state);break;case W.showSpacedText:var E=B[0],q=[],U=E.length;for(v=0;U>v;++v){var F=E[v];x(F)?Array.prototype.push.apply(q,l.handleText(F,g.state)):w(F)&&q.push(F)}B[0]=q,T=W.showText;break;case W.nextLineShowText:o.addOp(W.nextLine),B[0]=l.handleText(B[0],g.state),T=W.showText;break;case W.nextLineSetSpacingShowText:o.addOp(W.nextLine),o.addOp(W.setWordSpacing,[B.shift()]),o.addOp(W.setCharSpacing,[B.shift()]),B[0]=l.handleText(B[0],g.state),T=W.showText;break;case W.setTextRenderingMode:g.state.textRenderingMode=B[0];break;case W.setFillColorSpace:g.state.fillColorSpace=_e.parse(B[0],h,r);continue;case W.setStrokeColorSpace:g.state.strokeColorSpace=_e.parse(B[0],h,r);continue;case W.setFillColor:k=g.state.fillColorSpace,B=k.getRgb(B,0),T=W.setFillRGBColor;break;case W.setStrokeColor:k=g.state.strokeColorSpace,B=k.getRgb(B,0),T=W.setStrokeRGBColor;break;case W.setFillGray:g.state.fillColorSpace=_e.singletons.gray,B=_e.singletons.gray.getRgb(B,0),T=W.setFillRGBColor;break;case W.setStrokeGray:g.state.strokeColorSpace=_e.singletons.gray,B=_e.singletons.gray.getRgb(B,0),T=W.setStrokeRGBColor;break;case W.setFillCMYKColor:g.state.fillColorSpace=_e.singletons.cmyk,B=_e.singletons.cmyk.getRgb(B,0),T=W.setFillRGBColor;break;case W.setStrokeCMYKColor:g.state.strokeColorSpace=_e.singletons.cmyk,B=_e.singletons.cmyk.getRgb(B,0),T=W.setStrokeRGBColor;break;case W.setFillRGBColor:g.state.fillColorSpace=_e.singletons.rgb,B=_e.singletons.rgb.getRgb(B,0);break;case W.setStrokeRGBColor:g.state.strokeColorSpace=_e.singletons.rgb,B=_e.singletons.rgb.getRgb(B,0);break;case W.setFillColorN:if(k=g.state.fillColorSpace,"Pattern"===k.name)return l.handleColorN(o,W.setFillColorN,B,k,d,r,h).then(function(){b(t,n)},n);B=k.getRgb(B,0),T=W.setFillRGBColor;break;case W.setStrokeColorN:if(k=g.state.strokeColorSpace,"Pattern"===k.name)return l.handleColorN(o,W.setStrokeColorN,B,k,d,r,h).then(function(){b(t,n)},n);B=k.getRgb(B,0),T=W.setStrokeRGBColor;break;case W.shadingFill:var N=r.get("Shading");N||a("No shading resource found");var j=N.get(B[0].name);j||a("No shading object found");var z=mt.parseShading(j,null,h,r),H=z.getIR();B=[H],T=W.shadingFill;break;case W.setGState:var G=B[0],X=r.get("ExtGState");if(!A(X)||!X.has(G.name))break;var _=X.get(G.name);return l.setGState(r,_,o,h,g).then(function(){b(t,n)},n);case W.moveTo:case W.lineTo:case W.curveTo:case W.curveTo2:case W.curveTo3:case W.closePath:l.buildPath(o,T,B);continue;case W.rectangle:l.buildPath(o,T,B);continue}o.addOp(T,B)}if(s)return void c.then(function(){b(t,n)});for(v=0,y=m.savedStatesDepth;y>v;v++)o.addOp(W.restore,[]);t()})},getTextContent:function(e,t,a){function r(){var e=p.font;return e.loadedName in h.styles||(h.styles[e.loadedName]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical}),{str:[],dir:null,width:0,height:0,transform:null,fontName:e.loadedName}}function o(e){var t=e.str.join(""),a=PDFJS.bidi(t,-1,p.font.vertical);return e.str=a.str,e.dir=a.dir,e}function s(e,a){return g.loadFont(e,a,m,t).then(function(e){p.font=e.font,p.fontMatrix=e.font.fontMatrix||H})}function l(e,t){var a=p.font;if(t=t||r(),!t.transform){var i=[p.fontSize*p.textHScale,0,0,p.fontSize,0,p.textRise],n=t.transform=ce.transform(p.ctm,ce.transform(p.textMatrix,i));a.vertical?t.width=Math.sqrt(n[0]*n[0]+n[1]*n[1]):t.height=Math.sqrt(n[2]*n[2]+n[3]*n[3])}for(var o=0,s=0,c=a.charsToGlyphs(e),l=a.defaultVMetrics,h=0;h<c.length;h++){var u=c[h];if(u){var f=null,d=null,g=null;a.vertical?u.vmetric?(g=u.vmetric[0],f=u.vmetric[1],d=u.vmetric[2]):(g=u.width,f=.5*u.width,d=l[2]):g=u.width;var m=u.unicode;void 0!==Jt[m]&&(m=Jt[m]),m=q(m);var b=0,v=0;if(a.vertical){var y=g*p.fontMatrix[0];v=y*p.fontSize+p.charSpacing,s+=v}else{var k=g*p.fontMatrix[0];b=(k*p.fontSize+p.charSpacing)*p.textHScale,o+=b}p.translateTextMatrix(b,v),t.str.push(m)}else o+=p.wordSpacing*p.textHScale}var w=p.textLineMatrix[0],x=p.textLineMatrix[1],C=Math.sqrt(w*w+x*x);w=p.ctm[0],x=p.ctm[1];var S=Math.sqrt(w*w+x*x);return a.vertical?t.height+=Math.abs(s*S*C):t.width+=o*S*C,t}a=a||new kt(new wt);var h={items:[],styles:Object.create(null)},u=h.items,f=.35,d=1.5,g=this,m=this.xref;t=m.fetchIfRef(t)||we.empty;var p,b=null,v={},y=new Ct(e,m,a),k=new n;return new Promise(function w(e,n){k.reset();for(var m,x={},S=[];!(m=k.check())&&(S.length=0,x.args=S,y.read(x));){p=a.state;var T=x.fn;switch(S=x.args,0|T){case W.setFont:return p.fontSize=S[1],s(S[0].name).then(function(){w(e,n)},n);case W.setTextRise:p.textRise=S[0];break;case W.setHScale:p.textHScale=S[0]/100;break;case W.setLeading:p.leading=S[0];break;case W.moveText:p.translateTextLineMatrix(S[0],S[1]),p.textMatrix=p.textLineMatrix.slice();break;case W.setLeadingMoveText:p.leading=-S[1],p.translateTextLineMatrix(S[0],S[1]),p.textMatrix=p.textLineMatrix.slice();break;case W.nextLine:p.carriageReturn();break;case W.setTextMatrix:p.setTextMatrix(S[0],S[1],S[2],S[3],S[4],S[5]),p.setTextLineMatrix(S[0],S[1],S[2],S[3],S[4],S[5]);break;case W.setCharSpacing:p.charSpacing=S[0];break;case W.setWordSpacing:p.wordSpacing=S[0];break;case W.beginText:p.textMatrix=se.slice(),p.textLineMatrix=se.slice();break;case W.showSpacedText:for(var O,L=S[0],R=r(),P=0,M=L.length;M>P;P++)if("string"==typeof L[P])l(L[P],R);else{var D=L[P]/1e3;if(p.font.vertical?(O=-D*p.fontSize*p.textMatrix[3],p.translateTextMatrix(0,O),R.height+=O):(O=-D*p.fontSize*p.textHScale*p.textMatrix[0],p.translateTextMatrix(O,0),R.width+=O),L[P]<0&&p.font.spaceWidth>0){var E=-L[P]/p.font.spaceWidth;if(E>d)for(E=Math.round(E);E--;)R.str.push(" ");else E>f&&R.str.push(" ")}}u.push(o(R));break;case W.showText:u.push(o(l(S[0])));break;case W.nextLineShowText:p.carriageReturn(),u.push(o(l(S[0])));break;case W.nextLineSetSpacingShowText:p.wordSpacing=S[0],p.charSpacing=S[1],p.carriageReturn(),u.push(o(l(S[2])));break;case W.paintXObject:if(S[0].code)break;b||(b=t.get("XObject")||we.empty);var q=S[0].name;if(v.key===q){v.texts&&(ce.appendToArray(u,v.texts.items),ce.extendObj(h.styles,v.texts.styles));break}var U=b.get(q);if(!U)break;i(I(U),"XObject should be a stream");var F=U.dict.get("Subtype");if(i(C(F),"XObject should have a Name subtype"),"Form"!==F.name){v.key=q,v.texts=null;break}a.save();var N=U.dict.get("Matrix");return B(N)&&6===N.length&&a.transform(N),g.getTextContent(U,U.dict.get("Resources")||t,a).then(function(t){ce.appendToArray(u,t.items),ce.extendObj(h.styles,t.styles),a.restore(),v.key=q,v.texts=t,w(e,n)},n);case W.setGState:var j=S[0],z=t.get("ExtGState");if(!A(z)||!z.has(j.name))break;var H=z.get(j.name),G=null;for(var X in H)"Font"===X&&(i(!G),G=H[X]);if(G)return p.fontSize=G[1],s(G[0]).then(function(){w(e,n)},n)}}return m?void c.then(function(){w(e,n)}):void e(h)})},extractDataStructures:function(e,t,r,i){var n=e.get("ToUnicode")||t.get("ToUnicode");if(n&&(i.toUnicode=this.readToUnicode(n)),i.composite){var o=e.get("CIDSystemInfo");A(o)&&(i.cidSystemInfo={registry:o.get("Registry"),ordering:o.get("Ordering"),supplement:o.get("Supplement")});var s=e.get("CIDToGIDMap");I(s)&&(i.cidToGidMap=this.readCidToGidMap(s))}var c,l=[],h=null;if(e.has("Encoding")){if(c=e.get("Encoding"),A(c)){if(h=c.get("BaseEncoding"),h=C(h)?h.name:null,c.has("Differences"))for(var u=c.get("Differences"),f=0,d=0,g=u.length;g>d;d++){var m=u[d];w(m)?f=m:l[f++]=m.name}}else C(c)?h=c.name:a("Encoding is not a Name nor a Dict");"MacRomanEncoding"!==h&&"MacExpertEncoding"!==h&&"WinAnsiEncoding"!==h&&(h=null)}h?i.defaultEncoding=Ut[h].slice():(c="TrueType"===i.type?Ut.WinAnsiEncoding:Ut.StandardEncoding,i.flags&qt.Symbolic&&(c=Ut.MacRomanEncoding,i.file||(/Symbol/i.test(i.name)?c=Ut.SymbolSetEncoding:/Dingbats/i.test(i.name)&&(c=Ut.ZapfDingbatsEncoding))),i.defaultEncoding=c),i.differences=l,i.baseEncodingName=h,i.dict=e},readToUnicode:function(e){var t,a=e;return C(a)?(t=Ot.create(a,{url:PDFJS.cMapUrl,packed:PDFJS.cMapPacked},null).getMap(),new Wt(t)):I(a)?(t=Ot.create(a,{url:PDFJS.cMapUrl,packed:PDFJS.cMapPacked},null).getMap(),t.forEach(function(e,a){for(var r=[],i=0;i<e.length;i+=2){var n=e.charCodeAt(i)<<8|e.charCodeAt(i+1);if(55296===(63488&n)){i+=2;var o=e.charCodeAt(i)<<8|e.charCodeAt(i+1);r.push(((1023&n)<<10)+(1023&o)+65536)}else r.push(n)}t[a]=String.fromCharCode.apply(String,r)}),new Wt(t)):null},readCidToGidMap:function(e){for(var t=e.getBytes(),a=[],r=0,i=t.length;i>r;r++){var n=t[r++]<<8|t[r];if(0!==n){var o=r>>1;a[o]=n}}return a},extractWidths:function(e,t,a,r){var i,n,o,s,c,l,h,u,f=[],d=0,g=[];if(r.composite){if(d=e.get("DW")||1e3,u=e.get("W"))for(n=0,o=u.length;o>n;n++)if(l=u[n++],h=t.fetchIfRef(u[n]),B(h))for(s=0,c=h.length;c>s;s++)f[l++]=h[s];else{var m=u[++n];for(s=l;h>=s;s++)f[s]=m}if(r.vertical){var p=e.get("DW2")||[880,-1e3];if(i=[p[1],.5*d,p[0]],p=e.get("W2"))for(n=0,o=p.length;o>n;n++)if(l=p[n++],h=t.fetchIfRef(p[n]),B(h))for(s=0,c=h.length;c>s;s++)g[l++]=[h[s++],h[s++],h[s]];else{var b=[p[++n],p[++n],p[++n]];for(s=l;h>=s;s++)g[s]=b}}}else{var v=r.firstChar;if(u=e.get("Widths")){for(s=v,n=0,o=u.length;o>n;n++)f[s++]=u[n];d=parseFloat(a.get("MissingWidth"))||0}else{var y=e.get("BaseFont");if(C(y)){var k=this.getBaseFontMetrics(y.name);f=this.buildCharCodeToWidth(k.widths,r),d=k.defaultWidth}}}var w=!0,x=d;for(var S in f){var A=f[S];if(A)if(x){if(x!==A){w=!1;break}}else x=A}w&&(r.flags|=qt.FixedPitch),r.defaultWidth=d,r.widths=f,r.defaultVMetrics=i,r.vmetrics=g},isSerifFont:function(e){var t=e.split("-")[0];return t in jt||-1!==t.search(/serif/gi)},getBaseFontMetrics:function(e){var t=0,a=[],r=!1,i=Ft[e]||e;i in xa||(i=this.isSerifFont(e)?"Times-Roman":"Helvetica");var n=xa[i];return w(n)?(t=n,r=!0):a=n,{defaultWidth:t,monospace:r,widths:a}},buildCharCodeToWidth:function(e,t){for(var a=Object.create(null),r=t.differences,i=t.defaultEncoding,n=0;256>n;n++)n in r&&e[r[n]]?a[n]=e[r[n]]:n in i&&e[i[n]]&&(a[n]=e[i[n]]);return a},preEvaluateFont:function(e,t){var r=e,n=e.get("Subtype");i(C(n),"invalid font Subtype");var o,s=!1;if("Type0"===n.name){var c=e.get("DescendantFonts");c||a("Descendant fonts are not specified"),e=B(c)?t.fetchIfRef(c[0]):c,n=e.get("Subtype"),i(C(n),"invalid font Subtype"),s=!0}var l=e.get("FontDescriptor");if(l){var h=new ar,u=r.getRaw("Encoding");C(u)?h.update(u.name):O(u)&&h.update(u.num+"_"+u.gen);var f=e.get("ToUnicode")||r.get("ToUnicode");if(I(f)){var d=f.str||f;o=d.buffer?new Uint8Array(d.buffer.buffer,0,d.bufferLength):new Uint8Array(d.bytes.buffer,d.start,d.end-d.start),h.update(o)}else C(f)&&h.update(f.name);var g=e.get("Widths")||r.get("Widths");g&&(o=new Uint8Array(new Uint32Array(g).buffer),h.update(o))}return{descriptor:l,dict:e,baseDict:r,composite:s,type:n.name,hash:h?h.hexdigest():""}},translateFont:function(t,r){var n,o=t.baseDict,s=t.dict,c=t.composite,l=t.descriptor,h=t.type,u=c?65535:255;if(!l){if("Type3"!==h){var f=s.get("BaseFont");C(f)||a("Base font is not specified"),f=f.name.replace(/[,_]/g,"-");var d=this.getBaseFontMetrics(f),g=f.split("-")[0],m=(this.isSerifFont(g)?qt.Serif:0)|(d.monospace?qt.FixedPitch:0)|(zt[g]?qt.Symbolic:qt.Nonsymbolic);return n={type:h,name:f,widths:d.widths,defaultWidth:d.defaultWidth,flags:m,firstChar:0,lastChar:u},this.extractDataStructures(s,s,r,n),n.widths=this.buildCharCodeToWidth(d.widths,n),new Zt(f,null,n)}l=new we(null),l.set("FontName",ye.get(h))}var p=s.get("FirstChar")||0,b=s.get("LastChar")||u,v=l.get("FontName"),y=s.get("BaseFont");if(x(v)&&(v=ye.get(v)),x(y)&&(y=ye.get(y)),"Type3"!==h){var k=v&&v.name,w=y&&y.name;k!==w&&(e("The FontDescriptor's FontName is \""+k+'" but should be the same as the Font\'s BaseFont "'+w+'"'),k&&w&&0===w.indexOf(k)&&(v=y))}v=v||y,i(C(v),"invalid font name");var S=l.get("FontFile","FontFile2","FontFile3");if(S&&S.dict){var A=S.dict.get("Subtype");A&&(A=A.name);var B=S.dict.get("Length1"),I=S.dict.get("Length2")}if(n={type:h,name:v.name,subtype:A,file:S,length1:B,length2:I,loadedName:o.loadedName,composite:c,wideChars:c,fixedPitch:!1,fontMatrix:s.get("FontMatrix")||H,firstChar:p||0,lastChar:b||u,bbox:l.get("FontBBox"),ascent:l.get("Ascent"),descent:l.get("Descent"),xHeight:l.get("XHeight"),capHeight:l.get("CapHeight"),flags:l.get("Flags"),italicAngle:l.get("ItalicAngle"),coded:!1},c){var T=o.get("Encoding");C(T)&&(n.cidEncoding=T.name),n.cMap=Ot.create(T,{url:PDFJS.cMapUrl,packed:PDFJS.cMapPacked},null),n.vertical=n.cMap.vertical}return this.extractDataStructures(s,o,r,n),this.extractWidths(s,r,l,n),"Type3"===h&&(n.isType3Font=!0),new Zt(v.name,S,n)}},r}(),vt=function(){function e(e,t,a){this.loadedName=e,this.font=t,this.dict=a,this.type3Loaded=null,this.sent=!1}return e.prototype={send:function(e){if(!this.sent){var t=this.font.exportData();e.send("commonobj",[this.loadedName,"Font",t]),this.sent=!0}},loadType3Data:function(e,a,r){if(i(this.font.isType3Font),this.type3Loaded)return this.type3Loaded;for(var n=this.font,o=Promise.resolve(),s=this.dict.get("CharProcs").getAll(),c=this.dict.get("Resources")||a,l=Object.keys(s),h={},u=0,f=l.length;f>u;++u)o=o.then(function(a){
var i=s[a],n=new yt;return e.getOperatorList(i,c,n).then(function(){h[a]=n.getIR(),r.addDependencies(n.dependencies)},function(e){t('Type3 font resource "'+a+'" is not available');var r=new yt;h[a]=r.getIR()})}.bind(this,l[u]));return this.type3Loaded=o.then(function(){n.charProcOperatorList=h}),this.type3Loaded}},e}(),yt=function(){function e(e){for(var t=[],a=e.fnArray,r=e.argsArray,i=0,n=e.length;n>i;i++)switch(a[i]){case W.paintInlineImageXObject:case W.paintInlineImageXObjectGroup:case W.paintImageMaskXObject:var o=r[i][0];o.cached||t.push(o.data.buffer)}return t}function t(e,t,a){this.messageHandler=t,this.fnArray=[],this.argsArray=[],this.dependencies={},this.pageIndex=a,this.intent=e}var a=1e3,r=a-5;return t.prototype={get length(){return this.argsArray.length},addOp:function(e,t){this.fnArray.push(e),this.argsArray.push(t),this.messageHandler&&(this.fnArray.length>=a?this.flush():this.fnArray.length>=r&&(e===W.restore||e===W.endText)&&this.flush())},addDependency:function(e){e in this.dependencies||(this.dependencies[e]=!0,this.addOp(W.dependency,[e]))},addDependencies:function(e){for(var t in e)this.addDependency(t)},addOpList:function(e){ce.extendObj(this.dependencies,e.dependencies);for(var t=0,a=e.length;a>t;t++)this.addOp(e.fnArray[t],e.argsArray[t])},getIR:function(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}},flush:function(t){"oplist"!==this.intent&&(new St).optimize(this);var a=e(this);this.messageHandler.send("RenderPageChunk",{operatorList:{fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:t,length:this.length},pageIndex:this.pageIndex,intent:this.intent},a),this.dependencies={},this.fnArray.length=0,this.argsArray.length=0}},t}(),kt=function(){function e(e){this.state=e,this.stateStack=[]}return e.prototype={save:function(){var e=this.state;this.stateStack.push(this.state),this.state=e.clone()},restore:function(){var e=this.stateStack.pop();e&&(this.state=e)},transform:function(e){this.state.ctm=ce.transform(this.state.ctm,e)}},e}(),wt=function(){function e(){this.ctm=new Float32Array(se),this.fontSize=0,this.font=null,this.fontMatrix=H,this.textMatrix=se.slice(),this.textLineMatrix=se.slice(),this.charSpacing=0,this.wordSpacing=0,this.leading=0,this.textHScale=1,this.textRise=0}return e.prototype={setTextMatrix:function(e,t,a,r,i,n){var o=this.textMatrix;o[0]=e,o[1]=t,o[2]=a,o[3]=r,o[4]=i,o[5]=n},setTextLineMatrix:function(e,t,a,r,i,n){var o=this.textLineMatrix;o[0]=e,o[1]=t,o[2]=a,o[3]=r,o[4]=i,o[5]=n},translateTextMatrix:function(e,t){var a=this.textMatrix;a[4]=a[0]*e+a[2]*t+a[4],a[5]=a[1]*e+a[3]*t+a[5]},translateTextLineMatrix:function(e,t){var a=this.textLineMatrix;a[4]=a[0]*e+a[2]*t+a[4],a[5]=a[1]*e+a[3]*t+a[5]},calcRenderMatrix:function(e){var t=[this.fontSize*this.textHScale,0,0,this.fontSize,0,this.textRise];return ce.transform(e,ce.transform(this.textMatrix,t))},carriageReturn:function(){this.translateTextLineMatrix(0,-this.leading),this.textMatrix=this.textLineMatrix.slice()},clone:function(){var e=Object.create(this);return e.textMatrix=this.textMatrix.slice(),e.textLineMatrix=this.textLineMatrix.slice(),e.fontMatrix=this.fontMatrix.slice(),e}},e}(),xt=function(){function e(){this.ctm=new Float32Array(se),this.font=null,this.textRenderingMode=G.FILL,this.fillColorSpace=_e.singletons.gray,this.strokeColorSpace=_e.singletons.gray}return e.prototype={clone:function(){return Object.create(this)}},e}(),Ct=function(){function a(e,t,a){this.parser=new Aa(new Ba(e,r),!1,t),this.stateManager=a,this.nonProcessedArgs=[]}var r={w:{id:W.setLineWidth,numArgs:1,variableArgs:!1},J:{id:W.setLineCap,numArgs:1,variableArgs:!1},j:{id:W.setLineJoin,numArgs:1,variableArgs:!1},M:{id:W.setMiterLimit,numArgs:1,variableArgs:!1},d:{id:W.setDash,numArgs:2,variableArgs:!1},ri:{id:W.setRenderingIntent,numArgs:1,variableArgs:!1},i:{id:W.setFlatness,numArgs:1,variableArgs:!1},gs:{id:W.setGState,numArgs:1,variableArgs:!1},q:{id:W.save,numArgs:0,variableArgs:!1},Q:{id:W.restore,numArgs:0,variableArgs:!1},cm:{id:W.transform,numArgs:6,variableArgs:!1},m:{id:W.moveTo,numArgs:2,variableArgs:!1},l:{id:W.lineTo,numArgs:2,variableArgs:!1},c:{id:W.curveTo,numArgs:6,variableArgs:!1},v:{id:W.curveTo2,numArgs:4,variableArgs:!1},y:{id:W.curveTo3,numArgs:4,variableArgs:!1},h:{id:W.closePath,numArgs:0,variableArgs:!1},re:{id:W.rectangle,numArgs:4,variableArgs:!1},S:{id:W.stroke,numArgs:0,variableArgs:!1},s:{id:W.closeStroke,numArgs:0,variableArgs:!1},f:{id:W.fill,numArgs:0,variableArgs:!1},F:{id:W.fill,numArgs:0,variableArgs:!1},"f*":{id:W.eoFill,numArgs:0,variableArgs:!1},B:{id:W.fillStroke,numArgs:0,variableArgs:!1},"B*":{id:W.eoFillStroke,numArgs:0,variableArgs:!1},b:{id:W.closeFillStroke,numArgs:0,variableArgs:!1},"b*":{id:W.closeEOFillStroke,numArgs:0,variableArgs:!1},n:{id:W.endPath,numArgs:0,variableArgs:!1},W:{id:W.clip,numArgs:0,variableArgs:!1},"W*":{id:W.eoClip,numArgs:0,variableArgs:!1},BT:{id:W.beginText,numArgs:0,variableArgs:!1},ET:{id:W.endText,numArgs:0,variableArgs:!1},Tc:{id:W.setCharSpacing,numArgs:1,variableArgs:!1},Tw:{id:W.setWordSpacing,numArgs:1,variableArgs:!1},Tz:{id:W.setHScale,numArgs:1,variableArgs:!1},TL:{id:W.setLeading,numArgs:1,variableArgs:!1},Tf:{id:W.setFont,numArgs:2,variableArgs:!1},Tr:{id:W.setTextRenderingMode,numArgs:1,variableArgs:!1},Ts:{id:W.setTextRise,numArgs:1,variableArgs:!1},Td:{id:W.moveText,numArgs:2,variableArgs:!1},TD:{id:W.setLeadingMoveText,numArgs:2,variableArgs:!1},Tm:{id:W.setTextMatrix,numArgs:6,variableArgs:!1},"T*":{id:W.nextLine,numArgs:0,variableArgs:!1},Tj:{id:W.showText,numArgs:1,variableArgs:!1},TJ:{id:W.showSpacedText,numArgs:1,variableArgs:!1},"'":{id:W.nextLineShowText,numArgs:1,variableArgs:!1},'"':{id:W.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1},d0:{id:W.setCharWidth,numArgs:2,variableArgs:!1},d1:{id:W.setCharWidthAndBounds,numArgs:6,variableArgs:!1},CS:{id:W.setStrokeColorSpace,numArgs:1,variableArgs:!1},cs:{id:W.setFillColorSpace,numArgs:1,variableArgs:!1},SC:{id:W.setStrokeColor,numArgs:4,variableArgs:!0},SCN:{id:W.setStrokeColorN,numArgs:33,variableArgs:!0},sc:{id:W.setFillColor,numArgs:4,variableArgs:!0},scn:{id:W.setFillColorN,numArgs:33,variableArgs:!0},G:{id:W.setStrokeGray,numArgs:1,variableArgs:!1},g:{id:W.setFillGray,numArgs:1,variableArgs:!1},RG:{id:W.setStrokeRGBColor,numArgs:3,variableArgs:!1},rg:{id:W.setFillRGBColor,numArgs:3,variableArgs:!1},K:{id:W.setStrokeCMYKColor,numArgs:4,variableArgs:!1},k:{id:W.setFillCMYKColor,numArgs:4,variableArgs:!1},sh:{id:W.shadingFill,numArgs:1,variableArgs:!1},BI:{id:W.beginInlineImage,numArgs:0,variableArgs:!1},ID:{id:W.beginImageData,numArgs:0,variableArgs:!1},EI:{id:W.endInlineImage,numArgs:1,variableArgs:!1},Do:{id:W.paintXObject,numArgs:1,variableArgs:!1},MP:{id:W.markPoint,numArgs:1,variableArgs:!1},DP:{id:W.markPointProps,numArgs:2,variableArgs:!1},BMC:{id:W.beginMarkedContent,numArgs:1,variableArgs:!1},BDC:{id:W.beginMarkedContentProps,numArgs:2,variableArgs:!1},EMC:{id:W.endMarkedContent,numArgs:0,variableArgs:!1},BX:{id:W.beginCompat,numArgs:0,variableArgs:!1},EX:{id:W.endCompat,numArgs:0,variableArgs:!1},BM:null,BD:null,"true":null,fa:null,fal:null,fals:null,"false":null,nu:null,nul:null,"null":null};return a.prototype={get savedStatesDepth(){return this.stateManager.stateStack.length},read:function(a){for(var n=a.args;;){var o=this.parser.getObj();if(S(o)){var s=o.cmd,c=r[s];if(!c){t('Unknown command "'+s+'"');continue}var l=c.id,h=c.numArgs,u=null!==n?n.length:0;if(c.variableArgs)u>h&&e("Command "+l+": expected [0,"+h+"] args, but received "+u+" args");else{if(u!==h){for(var f=this.nonProcessedArgs;u>h;)f.push(n.shift()),u--;for(;h>u&&0!==f.length;)n||(n=[]),n.unshift(f.pop()),u++}if(h>u){e("Command "+l+": because expected "+h+" args, but received "+u+" args; skipping"),n=null;continue}}return this.preprocessCommand(l,n),a.fn=l,a.args=n,!0}if(j(o))return!1;null!==o&&(n||(n=[]),n.push(o instanceof we?o.getAll():o),i(n.length<=33,"Too many arguments"))}},preprocessCommand:function(e,t){switch(0|e){case W.save:this.stateManager.save();break;case W.restore:this.stateManager.restore();break;case W.transform:this.stateManager.transform(t)}}},a}(),St=function(){function e(e,t,a){for(var r=e,i=0,n=t.length-1;n>i;i++){var o=t[i];r=r[o]||(r[o]=[])}r[t[t.length-1]]=a}function t(e,t,a,r){for(var i=e+2,n=0;t>n;n++){var o=r[i+4*n],s=1===o.length&&o[0];if(!s||1!==s.width||1!==s.height||s.data.length&&(1!==s.data.length||0!==s.data[0]))break;a[i+4*n]=W.paintSolidColorImageMask}return t-n}function a(){}var r=[];return e(r,[W.save,W.transform,W.paintInlineImageXObject,W.restore],function(e){for(var t=10,a=200,r=1e3,i=1,n=e.fnArray,o=e.argsArray,s=e.iCurr,c=s-3,l=s-2,h=s-1,u=c+4,f=n.length;f>u+3&&n[u]===W.save&&n[u+1]===W.transform&&n[u+2]===W.paintInlineImageXObject&&n[u+3]===W.restore;)u+=4;var d=Math.min((u-c)/4,a);if(t>d)return u;var g,m=0,p=[],b=0,v=i,y=i;for(g=0;d>g;g++){var k=o[l+(g<<2)],w=o[h+(g<<2)][0];v+w.width>r&&(m=Math.max(m,v),y+=b+2*i,v=0,b=0),p.push({transform:k,x:v,y:y,w:w.width,h:w.height}),v+=w.width+2*i,b=Math.max(b,w.height)}var x=Math.max(m,v)+i,C=y+b+i,S=new Uint8Array(x*C*4),A=x<<2;for(g=0;d>g;g++){var B=o[h+(g<<2)][0].data,I=p[g].w<<2,T=0,O=p[g].x+p[g].y*x<<2;S.set(B.subarray(0,I),O-A);for(var L=0,R=p[g].h;R>L;L++)S.set(B.subarray(T,T+I),O),T+=I,O+=A;for(S.set(B.subarray(T-I,T),O);O>=0;)B[O-4]=B[O],B[O-3]=B[O+1],B[O-2]=B[O+2],B[O-1]=B[O+3],B[O+I]=B[O+I-4],B[O+I+1]=B[O+I-3],B[O+I+2]=B[O+I-2],B[O+I+3]=B[O+I-1],O-=A}return n.splice(c,4*d,W.paintInlineImageXObjectGroup),o.splice(c,4*d,[{width:x,height:C,kind:X.RGBA_32BPP,data:S},p]),c+1}),e(r,[W.save,W.transform,W.paintImageMaskXObject,W.restore],function(e){for(var a=10,r=100,i=1e3,n=e.fnArray,o=e.argsArray,s=e.iCurr,c=s-3,l=s-2,h=s-1,u=c+4,f=n.length;f>u+3&&n[u]===W.save&&n[u+1]===W.transform&&n[u+2]===W.paintImageMaskXObject&&n[u+3]===W.restore;)u+=4;var d=(u-c)/4;if(d=t(c,d,n,o),a>d)return u;var g,m,p,b=!1,v=o[h][0];if(0===o[l][1]&&0===o[l][2]){b=!0;var y=o[l][0],k=o[l][3];m=l+4;var w=h+4;for(g=1;d>g;g++,m+=4,w+=4)if(p=o[m],o[w][0]!==v||p[0]!==y||0!==p[1]||0!==p[2]||p[3]!==k){a>g?b=!1:d=g;break}}if(b){d=Math.min(d,i);var x=new Float32Array(2*d);for(m=l,g=0;d>g;g++,m+=4)p=o[m],x[g<<1]=p[4],x[(g<<1)+1]=p[5];n.splice(c,4*d,W.paintImageMaskXObjectRepeat),o.splice(c,4*d,[v,y,k,x])}else{d=Math.min(d,r);var C=[];for(g=0;d>g;g++){p=o[l+(g<<2)];var S=o[h+(g<<2)][0];C.push({data:S.data,width:S.width,height:S.height,transform:p})}n.splice(c,4*d,W.paintImageMaskXObjectGroup),o.splice(c,4*d,[C])}return c+1}),e(r,[W.save,W.transform,W.paintImageXObject,W.restore],function(e){var t=3,a=1e3,r=e.fnArray,i=e.argsArray,n=e.iCurr,o=n-3,s=n-2,c=n-1,l=n;if(0!==i[s][1]||0!==i[s][2])return l+1;for(var h=i[c][0],u=i[s][0],f=i[s][3],d=o+4,g=r.length;g>d+3&&r[d]===W.save&&r[d+1]===W.transform&&r[d+2]===W.paintImageXObject&&r[d+3]===W.restore&&i[d+1][0]===u&&0===i[d+1][1]&&0===i[d+1][2]&&i[d+1][3]===f&&i[d+2][0]===h;)d+=4;var m=Math.min((d-o)/4,a);if(t>m)return d;for(var p=new Float32Array(2*m),b=s,v=0;m>v;v++,b+=4){var y=i[b];p[v<<1]=y[4],p[(v<<1)+1]=y[5]}var k=[h,u,f,p];return r.splice(o,4*m,W.paintImageXObjectRepeat),i.splice(o,4*m,k),o+1}),e(r,[W.beginText,W.setFont,W.setTextMatrix,W.showText,W.endText],function(e){for(var t=3,a=1e3,r=e.fnArray,i=e.argsArray,n=e.iCurr,o=n-4,s=n-3,c=n-2,l=n-1,h=n,u=i[s][0],f=i[s][1],d=o+5,g=r.length;g>d+4&&r[d]===W.beginText&&r[d+1]===W.setFont&&r[d+2]===W.setTextMatrix&&r[d+3]===W.showText&&r[d+4]===W.endText&&i[d+1][0]===u&&i[d+1][1]===f;)d+=5;var m=Math.min((d-o)/5,a);if(t>m)return d;var p=o;o>=4&&r[o-4]===r[s]&&r[o-3]===r[c]&&r[o-2]===r[l]&&r[o-1]===r[h]&&i[o-4][0]===u&&i[o-4][1]===f&&(m++,p-=5);for(var b=p+4,v=1;m>v;v++)r.splice(b,3),i.splice(b,3),b+=2;return b+1}),a.prototype={optimize:function(e){for(var t,a=e.fnArray,i=e.argsArray,n={iCurr:0,fnArray:a,argsArray:i},o=0,s=a.length;s>o;)t=(t||r)[a[o]],"function"==typeof t?(n.iCurr=o,o=t(n),t=void 0,s=n.fnArray.length):o++}},a}(),At=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],Bt=function(){function e(e){this.codespaceRanges=[[],[],[],[]],this.numCodespaceRanges=0,this._map=[],this.vertical=!1,this.useCMap=null,this.builtInCMap=e}return e.prototype={addCodespaceRange:function(e,t,a){this.codespaceRanges[e-1].push(t,a),this.numCodespaceRanges++},mapCidRange:function(e,t,a){for(;t>=e;)this._map[e++]=a++},mapBfRange:function(e,t,a){for(var r=a.length-1;t>=e;)this._map[e++]=a,a=a.substr(0,r)+String.fromCharCode(a.charCodeAt(r)+1)},mapBfRangeToArray:function(e,t,a){for(var r=0,i=a.length;t>=e&&i>r;)this._map[e]=a[r++],++e},mapOne:function(e,t){this._map[e]=t},lookup:function(e){return this._map[e]},contains:function(e){return void 0!==this._map[e]},forEach:function(e){var t,a=this._map,r=a.length;if(65536>=r)for(t=0;r>t;t++)void 0!==a[t]&&e(t,a[t]);else for(t in this._map)e(t,a[t])},charCodeOf:function(e){return this._map.indexOf(e)},getMap:function(){return this._map},readCharCode:function(e,t,a){for(var r=0,i=this.codespaceRanges,n=this.codespaceRanges.length,o=0;n>o;o++){r=(r<<8|e.charCodeAt(t+o))>>>0;for(var s=i[o],c=0,l=s.length;l>c;){var h=s[c++],u=s[c++];if(r>=h&&u>=r)return a.charcode=r,void(a.length=o+1)}}a.charcode=0,a.length=1}},e}(),It=function(){function e(e,t){Bt.call(this),this.vertical=e,this.addCodespaceRange(t,0,65535)}return ce.inherit(e,Bt,{}),e.prototype={addCodespaceRange:Bt.prototype.addCodespaceRange,mapCidRange:function(e,t,r){a("should not call mapCidRange")},mapBfRange:function(e,t,r){a("should not call mapBfRange")},mapBfRangeToArray:function(e,t,r){a("should not call mapBfRangeToArray")},mapOne:function(e,t){a("should not call mapCidOne")},lookup:function(e){return k(e)&&65535>=e?e:void 0},contains:function(e){return k(e)&&65535>=e},forEach:function(e){for(var t=0;65535>=t;t++)e(t,t)},charCodeOf:function(e){return k(e)&&65535>=e?e:-1},getMap:function(){for(var e=new Array(65536),t=0;65535>=t;t++)e[t]=t;return e},readCharCode:Bt.prototype.readCharCode},e}(),Tt=function(){function e(e){var t=PDFJS.disableWorker,r=new XMLHttpRequest;if(r.open("GET",e,!1),!t)try{r.responseType="arraybuffer",t="arraybuffer"!==r.responseType}catch(i){t=!0}if(t&&r.overrideMimeType&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.send(null),(t?r.responseText:r.response)||a("Unable to get binary cMap at: "+e),t){var n=Array.prototype.map.call(r.responseText,function(e){return 255&e.charCodeAt(0)});return new Uint8Array(n)}return new Uint8Array(r.response)}function t(e,t){for(var a=0,r=0;t>=r;r++)a=a<<8|e[r];return a>>>0}function r(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode.apply(null,e.subarray(0,t+1))}function n(e,t,a){for(var r=0,i=a;i>=0;i--)r+=e[i]+t[i],e[i]=255&r,r>>=8}function o(e,t){for(var a=1,r=t;r>=0&&a>0;r--)a+=e[r],e[r]=255&a,a>>=8}function s(e){this.buffer=e,this.pos=0,this.end=e.length,this.tmpBuf=new Uint8Array(u)}function c(c,l,u){var f=e(c),d=new s(f),g=d.readByte();l.vertical=!!(1&g);for(var m,p,b=null,v=new Uint8Array(h),y=new Uint8Array(h),k=new Uint8Array(h),w=new Uint8Array(h),x=new Uint8Array(h);(p=d.readByte())>=0;){var C=p>>5;if(7!==C){var S=!!(16&p),A=15&p;i(h>=A+1);var B,I=1,T=d.readNumber();switch(C){case 0:for(d.readHex(v,A),d.readHexNumber(y,A),n(y,v,A),l.addCodespaceRange(A+1,t(v,A),t(y,A)),B=1;T>B;B++)o(y,A),d.readHexNumber(v,A),n(v,y,A),d.readHexNumber(y,A),n(y,v,A),l.addCodespaceRange(A+1,t(v,A),t(y,A));break;case 1:for(d.readHex(v,A),d.readHexNumber(y,A),n(y,v,A),m=d.readNumber(),B=1;T>B;B++)o(y,A),d.readHexNumber(v,A),n(v,y,A),d.readHexNumber(y,A),n(y,v,A),m=d.readNumber();break;case 2:for(d.readHex(k,A),m=d.readNumber(),l.mapOne(t(k,A),m),B=1;T>B;B++)o(k,A),S||(d.readHexNumber(x,A),n(k,x,A)),m=d.readSigned()+(m+1),l.mapOne(t(k,A),m);break;case 3:for(d.readHex(v,A),d.readHexNumber(y,A),n(y,v,A),m=d.readNumber(),l.mapCidRange(t(v,A),t(y,A),m),B=1;T>B;B++)o(y,A),S?v.set(y):(d.readHexNumber(v,A),n(v,y,A)),d.readHexNumber(y,A),n(y,v,A),m=d.readNumber(),l.mapCidRange(t(v,A),t(y,A),m);break;case 4:for(d.readHex(k,I),d.readHex(w,A),l.mapOne(t(k,I),r(w,A)),B=1;T>B;B++)o(k,I),S||(d.readHexNumber(x,I),n(k,x,I)),o(w,A),d.readHexSigned(x,A),n(w,x,A),l.mapOne(t(k,I),r(w,A));break;case 5:for(d.readHex(v,I),d.readHexNumber(y,I),n(y,v,I),d.readHex(w,A),l.mapBfRange(t(v,I),t(y,I),r(w,A)),B=1;T>B;B++)o(y,I),S?v.set(y):(d.readHexNumber(v,I),n(v,y,I)),d.readHexNumber(y,I),n(y,v,I),d.readHex(w,A),l.mapBfRange(t(v,I),t(y,I),r(w,A));break;default:a("Unknown type: "+C)}}else switch(31&p){case 0:d.readString();break;case 1:b=d.readString()}}return b&&u(b),l}function l(){}var h=16,u=19;return s.prototype={readByte:function(){return this.pos>=this.end?-1:this.buffer[this.pos++]},readNumber:function(){var e,t=0;do{var r=this.readByte();0>r&&a("unexpected EOF in bcmap"),e=!(128&r),t=t<<7|127&r}while(!e);return t},readSigned:function(){var e=this.readNumber();return 1&e?~(e>>>1):e>>>1},readHex:function(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1)),this.pos+=t+1},readHexNumber:function(e,t){var r,i=this.tmpBuf,n=0;do{var o=this.readByte();0>o&&a("unexpected EOF in bcmap"),r=!(128&o),i[n++]=127&o}while(!r);for(var s=t,c=0,l=0;s>=0;){for(;8>l&&i.length>0;)c=i[--n]<<l|c,l+=7;e[s]=255&c,s--,c>>=8,l-=8}},readHexSigned:function(e,t){this.readHexNumber(e,t);for(var a=1&e[t]?255:0,r=0,i=0;t>=i;i++)r=(1&r)<<8|e[i],e[i]=r>>1^a},readString:function(){for(var e=this.readNumber(),t="",a=0;e>a;a++)t+=String.fromCharCode(this.readNumber());return t}},l.prototype={read:c},l}(),Ot=function(){function e(e){for(var t=0,a=0;a<e.length;a++)t=t<<8|e.charCodeAt(a);return t>>>0}function r(e){x(e)||a("Malformed CMap: expected string.")}function n(e){k(e)||a("Malformed CMap: expected int.")}function o(t,a){for(;;){var i=a.getObj();if(j(i))break;if(S(i,"endbfchar"))return;r(i);var n=e(i);i=a.getObj(),r(i);var o=i;t.mapOne(n,o)}}function s(t,i){for(;;){var n=i.getObj();if(j(n))break;if(S(n,"endbfrange"))return;r(n);var o=e(n);n=i.getObj(),r(n);var s=e(n);if(n=i.getObj(),k(n)||x(n)){var c=k(n)?String.fromCharCode(n):n;t.mapBfRange(o,s,c)}else{if(!S(n,"["))break;n=i.getObj();for(var l=[];!S(n,"]")&&!j(n);)l.push(n),n=i.getObj();t.mapBfRangeToArray(o,s,l)}}a("Invalid bf range.")}function c(t,a){for(;;){var i=a.getObj();if(j(i))break;if(S(i,"endcidchar"))return;r(i);var o=e(i);i=a.getObj(),n(i);var s=i;t.mapOne(o,s)}}function l(t,a){for(;;){var i=a.getObj();if(j(i))break;if(S(i,"endcidrange"))return;r(i);var o=e(i);i=a.getObj(),r(i);var s=e(i);i=a.getObj(),n(i);var c=i;t.mapCidRange(o,s,c)}}function h(t,r){for(;;){var i=r.getObj();if(j(i))break;if(S(i,"endcodespacerange"))return;if(!x(i))break;var n=e(i);if(i=r.getObj(),!x(i))break;var o=e(i);t.addCodespaceRange(i.length,n,o)}a("Invalid codespace range.")}function u(e,t){var a=t.getObj();k(a)&&(e.vertical=!!a)}function f(e,t,a,r){var i,n;e:for(;;){var f=t.getObj();if(j(f))break;if(C(f))"WMode"===f.name&&u(e,t),i=f;else if(S(f))switch(f.cmd){case"endcmap":break e;case"usecmap":C(i)&&(n=i.name);break;case"begincodespacerange":h(e,t);break;case"beginbfchar":o(e,t);break;case"begincidchar":c(e,t);break;case"beginbfrange":s(e,t);break;case"begincidrange":l(e,t)}}!r&&n&&(r=n),r&&d(e,a,r)}function d(e,t,a){if(e.useCMap=m(a,t),0===e.numCodespaceRanges){for(var r=e.useCMap.codespaceRanges,i=0;i<r.length;i++)e.codespaceRanges[i]=r[i].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}e.useCMap.forEach(function(t,a){e.contains(t)||e.mapOne(t,e.useCMap.lookup(t))})}function g(e,t){var a=t.url+e+".bcmap",r=new Bt(!0);return(new Tt).read(a,r,function(e){d(r,t,e)}),r}function m(e,t){if("Identity-H"===e)return new It(!1,2);if("Identity-V"===e)return new It(!0,2);if(-1===At.indexOf(e)&&a("Unknown cMap name: "+e),i(t,"built-in cMap parameters are not provided"),t.packed)return g(e,t);var r=new XMLHttpRequest,n=t.url+e;r.open("GET",n,!1),r.send(null),r.responseText||a("Unable to get cMap at: "+n);var o=new Bt(!0),s=new Ba(new Ma(r.responseText));return f(o,s,t,null),o}return{create:function(e,r,i){if(C(e))return m(e.name,r);if(I(e)){var n=new Bt,o=new Ba(e);try{f(n,o,r,i)}catch(s){t("Invalid CMap data. "+s)}return n}a("Encoding required.")}}}(),Lt=57344,Rt=63743,Pt=!1,Mt=1e3,Dt=!1,Et=!1,qt={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144},Ut={ExpertEncoding:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],MacExpertEncoding:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall"],MacRomanEncoding:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"],StandardEncoding:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],WinAnsiEncoding:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"],
SymbolSetEncoding:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt"],ZapfDingbatsEncoding:["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191"]},Ft={ArialNarrow:"Helvetica","ArialNarrow-Bold":"Helvetica-Bold","ArialNarrow-BoldItalic":"Helvetica-BoldOblique","ArialNarrow-Italic":"Helvetica-Oblique",ArialBlack:"Helvetica","ArialBlack-Bold":"Helvetica-Bold","ArialBlack-BoldItalic":"Helvetica-BoldOblique","ArialBlack-Italic":"Helvetica-Oblique",Arial:"Helvetica","Arial-Bold":"Helvetica-Bold","Arial-BoldItalic":"Helvetica-BoldOblique","Arial-Italic":"Helvetica-Oblique","Arial-BoldItalicMT":"Helvetica-BoldOblique","Arial-BoldMT":"Helvetica-Bold","Arial-ItalicMT":"Helvetica-Oblique",ArialMT:"Helvetica","Courier-Bold":"Courier-Bold","Courier-BoldItalic":"Courier-BoldOblique","Courier-Italic":"Courier-Oblique",CourierNew:"Courier","CourierNew-Bold":"Courier-Bold","CourierNew-BoldItalic":"Courier-BoldOblique","CourierNew-Italic":"Courier-Oblique","CourierNewPS-BoldItalicMT":"Courier-BoldOblique","CourierNewPS-BoldMT":"Courier-Bold","CourierNewPS-ItalicMT":"Courier-Oblique",CourierNewPSMT:"Courier","Helvetica-Bold":"Helvetica-Bold","Helvetica-BoldItalic":"Helvetica-BoldOblique","Helvetica-Italic":"Helvetica-Oblique","Symbol-Bold":"Symbol","Symbol-BoldItalic":"Symbol","Symbol-Italic":"Symbol",TimesNewRoman:"Times-Roman","TimesNewRoman-Bold":"Times-Bold","TimesNewRoman-BoldItalic":"Times-BoldItalic","TimesNewRoman-Italic":"Times-Italic",TimesNewRomanPS:"Times-Roman","TimesNewRomanPS-Bold":"Times-Bold","TimesNewRomanPS-BoldItalic":"Times-BoldItalic","TimesNewRomanPS-BoldItalicMT":"Times-BoldItalic","TimesNewRomanPS-BoldMT":"Times-Bold","TimesNewRomanPS-Italic":"Times-Italic","TimesNewRomanPS-ItalicMT":"Times-Italic",TimesNewRomanPSMT:"Times-Roman","TimesNewRomanPSMT-Bold":"Times-Bold","TimesNewRomanPSMT-BoldItalic":"Times-BoldItalic","TimesNewRomanPSMT-Italic":"Times-Italic"},Nt={ComicSansMS:"Comic Sans MS","ComicSansMS-Bold":"Comic Sans MS-Bold","ComicSansMS-BoldItalic":"Comic Sans MS-BoldItalic","ComicSansMS-Italic":"Comic Sans MS-Italic",LucidaConsole:"Courier","LucidaConsole-Bold":"Courier-Bold","LucidaConsole-BoldItalic":"Courier-BoldOblique","LucidaConsole-Italic":"Courier-Oblique","MS-Gothic":"MS Gothic","MS-Gothic-Bold":"MS Gothic-Bold","MS-Gothic-BoldItalic":"MS Gothic-BoldItalic","MS-Gothic-Italic":"MS Gothic-Italic","MS-Mincho":"MS Mincho","MS-Mincho-Bold":"MS Mincho-Bold","MS-Mincho-BoldItalic":"MS Mincho-BoldItalic","MS-Mincho-Italic":"MS Mincho-Italic","MS-PGothic":"MS PGothic","MS-PGothic-Bold":"MS PGothic-Bold","MS-PGothic-BoldItalic":"MS PGothic-BoldItalic","MS-PGothic-Italic":"MS PGothic-Italic","MS-PMincho":"MS PMincho","MS-PMincho-Bold":"MS PMincho-Bold","MS-PMincho-BoldItalic":"MS PMincho-BoldItalic","MS-PMincho-Italic":"MS PMincho-Italic"},jt={"Adobe Jenson":!0,"Adobe Text":!0,Albertus:!0,Aldus:!0,Alexandria:!0,Algerian:!0,"American Typewriter":!0,Antiqua:!0,Apex:!0,Arno:!0,Aster:!0,Aurora:!0,Baskerville:!0,Bell:!0,Bembo:!0,"Bembo Schoolbook":!0,Benguiat:!0,"Berkeley Old Style":!0,"Bernhard Modern":!0,"Berthold City":!0,Bodoni:!0,"Bauer Bodoni":!0,"Book Antiqua":!0,Bookman:!0,"Bordeaux Roman":!0,"Californian FB":!0,Calisto:!0,Calvert:!0,Capitals:!0,Cambria:!0,Cartier:!0,Caslon:!0,Catull:!0,Centaur:!0,"Century Old Style":!0,"Century Schoolbook":!0,Chaparral:!0,"Charis SIL":!0,Cheltenham:!0,"Cholla Slab":!0,Clarendon:!0,Clearface:!0,Cochin:!0,Colonna:!0,"Computer Modern":!0,"Concrete Roman":!0,Constantia:!0,"Cooper Black":!0,Corona:!0,Ecotype:!0,Egyptienne:!0,Elephant:!0,Excelsior:!0,Fairfield:!0,"FF Scala":!0,Folkard:!0,Footlight:!0,FreeSerif:!0,"Friz Quadrata":!0,Garamond:!0,Gentium:!0,Georgia:!0,Gloucester:!0,"Goudy Old Style":!0,"Goudy Schoolbook":!0,"Goudy Pro Font":!0,Granjon:!0,"Guardian Egyptian":!0,Heather:!0,Hercules:!0,"High Tower Text":!0,Hiroshige:!0,"Hoefler Text":!0,"Humana Serif":!0,Imprint:!0,"Ionic No. 5":!0,Janson:!0,Joanna:!0,Korinna:!0,Lexicon:!0,"Liberation Serif":!0,"Linux Libertine":!0,Literaturnaya:!0,Lucida:!0,"Lucida Bright":!0,Melior:!0,Memphis:!0,Miller:!0,Minion:!0,Modern:!0,"Mona Lisa":!0,"Mrs Eaves":!0,"MS Serif":!0,"Museo Slab":!0,"New York":!0,"Nimbus Roman":!0,"NPS Rawlinson Roadway":!0,Palatino:!0,Perpetua:!0,Plantin:!0,"Plantin Schoolbook":!0,Playbill:!0,"Poor Richard":!0,"Rawlinson Roadway":!0,Renault:!0,Requiem:!0,Rockwell:!0,Roman:!0,"Rotis Serif":!0,Sabon:!0,Scala:!0,Seagull:!0,Sistina:!0,Souvenir:!0,STIX:!0,"Stone Informal":!0,"Stone Serif":!0,Sylfaen:!0,Times:!0,Trajan:!0,"Trinité":!0,"Trump Mediaeval":!0,Utopia:!0,"Vale Type":!0,"Bitstream Vera":!0,"Vera Serif":!0,Versailles:!0,Wanted:!0,Weiss:!0,"Wide Latin":!0,Windsor:!0,XITS:!0},zt={Dingbats:!0,Symbol:!0,ZapfDingbats:!0},Ht={2:10,3:32,4:33,5:34,6:35,7:36,8:37,9:38,10:39,11:40,12:41,13:42,14:43,15:44,16:45,17:46,18:47,19:48,20:49,21:50,22:51,23:52,24:53,25:54,26:55,27:56,28:57,29:58,30:894,31:60,32:61,33:62,34:63,35:64,36:65,37:66,38:67,39:68,40:69,41:70,42:71,43:72,44:73,45:74,46:75,47:76,48:77,49:78,50:79,51:80,52:81,53:82,54:83,55:84,56:85,57:86,58:87,59:88,60:89,61:90,62:91,63:92,64:93,65:94,66:95,67:96,68:97,69:98,70:99,71:100,72:101,73:102,74:103,75:104,76:105,77:106,78:107,79:108,80:109,81:110,82:111,83:112,84:113,85:114,86:115,87:116,88:117,89:118,90:119,91:120,92:121,93:122,94:123,95:124,96:125,97:126,98:196,99:197,100:199,101:201,102:209,103:214,104:220,105:225,106:224,107:226,108:228,109:227,110:229,111:231,112:233,113:232,114:234,115:235,116:237,117:236,118:238,119:239,120:241,121:243,122:242,123:244,124:246,125:245,126:250,127:249,128:251,129:252,130:8224,131:176,132:162,133:163,134:167,135:8226,136:182,137:223,138:174,139:169,140:8482,141:180,142:168,143:8800,144:198,145:216,146:8734,147:177,148:8804,149:8805,150:165,151:181,152:8706,153:8721,154:8719,156:8747,157:170,158:186,159:8486,160:230,161:248,162:191,163:161,164:172,165:8730,166:402,167:8776,168:8710,169:171,170:187,171:8230,210:218,223:711,224:321,225:322,227:353,229:382,234:253,252:263,253:268,254:269,258:258,260:260,261:261,265:280,266:281,268:283,269:313,275:323,276:324,278:328,284:345,285:346,286:347,292:367,295:377,296:378,298:380,305:963,306:964,307:966,308:8215,309:8252,310:8319,311:8359,312:8592,313:8593,337:9552,493:1039,494:1040,705:1524,706:8362,710:64288,711:64298,759:1617,761:1776,763:1778,775:1652,777:1764,778:1780,779:1781,780:1782,782:771,783:64726,786:8363,788:8532,790:768,791:769,792:768,795:803,797:64336,798:64337,799:64342,800:64343,801:64344,802:64345,803:64362,804:64363,805:64364,2424:7821,2425:7822,2426:7823,2427:7824,2428:7825,2429:7826,2430:7827,2433:7682,2678:8045,2679:8046,2830:1552,2838:686,2840:751,2842:753,2843:754,2844:755,2846:757,2856:767,2857:848,2858:849,2862:853,2863:854,2864:855,2865:861,2866:862,2906:7460,2908:7462,2909:7463,2910:7464,2912:7466,2913:7467,2914:7468,2916:7470,2917:7471,2918:7472,2920:7474,2921:7475,2922:7476,2924:7478,2925:7479,2926:7480,2928:7482,2929:7483,2930:7484,2932:7486,2933:7487,2934:7488,2936:7490,2937:7491,2938:7492,2940:7494,2941:7495,2942:7496,2944:7498,2946:7500,2948:7502,2950:7504,2951:7505,2952:7506,2954:7508,2955:7509,2956:7510,2958:7512,2959:7513,2960:7514,2962:7516,2963:7517,2964:7518,2966:7520,2967:7521,2968:7522,2970:7524,2971:7525,2972:7526,2974:7528,2975:7529,2976:7530,2978:1537,2979:1538,2980:1539,2982:1549,2983:1551,2984:1552,2986:1554,2987:1555,2988:1556,2990:1623,2991:1624,2995:1775,2999:1791,3002:64290,3003:64291,3004:64292,3006:64294,3007:64295,3008:64296,3011:1900,3014:8223,3015:8244,3017:7532,3018:7533,3019:7534,3075:7590,3076:7591,3079:7594,3080:7595,3083:7598,3084:7599,3087:7602,3088:7603,3091:7606,3092:7607,3095:7610,3096:7611,3099:7614,3100:7615,3103:7618,3104:7619,3107:8337,3108:8338,3116:1884,3119:1885,3120:1885,3123:1886,3124:1886,3127:1887,3128:1887,3131:1888,3132:1888,3135:1889,3136:1889,3139:1890,3140:1890,3143:1891,3144:1891,3147:1892,3148:1892,3153:580,3154:581,3157:584,3158:585,3161:588,3162:589,3165:891,3166:892,3169:1274,3170:1275,3173:1278,3174:1279,3181:7622,3182:7623,3282:11799,3316:578,3379:42785,3393:1159,3416:8377},Gt={63721:169,63193:169,63720:174,63194:174,63722:8482,63195:8482,63729:9127,63730:9128,63731:9129,63740:9131,63741:9132,63742:9133,63726:9121,63727:9122,63728:9123,63737:9124,63738:9125,63739:9126,63723:9115,63724:9116,63725:9117,63734:9118,63735:9119,63736:9120},Xt=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],_t=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"],Jt={"¨":" ̈","¯":" ̄","´":" ́","µ":"μ","¸":" ̧","IJ":"IJ","ij":"ij","Ŀ":"L·","ŀ":"l·","ʼn":"ʼn","ſ":"s","DŽ":"DŽ","Dž":"Dž","dž":"dž","LJ":"LJ","Lj":"Lj","lj":"lj","NJ":"NJ","Nj":"Nj","nj":"nj","DZ":"DZ","Dz":"Dz","dz":"dz","˘":" ̆","˙":" ̇","˚":" ̊","˛":" ̨","˜":" ̃","˝":" ̋","ͺ":" ͅ","΄":" ́","ϐ":"β","ϑ":"θ","ϒ":"Υ","ϕ":"φ","ϖ":"π","ϰ":"κ","ϱ":"ρ","ϲ":"ς","ϴ":"Θ","ϵ":"ε","Ϲ":"Σ","և":"եւ","ٵ":"اٴ","ٶ":"وٴ","ٷ":"ۇٴ","ٸ":"يٴ","ำ":"ํา","ຳ":"ໍາ","ໜ":"ຫນ","ໝ":"ຫມ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","ẚ":"aʾ","᾽":" ̓","᾿":" ̓","῀":" ͂","῾":" ̔"," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","‗":" ̳","․":".","‥":"..","…":"...","″":"′′","‴":"′′′","‶":"‵‵","‷":"‵‵‵","‼":"!!","‾":" ̅","⁇":"??","⁈":"?!","⁉":"!?","⁗":"′′′′"," ":" ","₨":"Rs","℀":"a/c","℁":"a/s","℃":"°C","℅":"c/o","℆":"c/u","ℇ":"Ɛ","℉":"°F","№":"No","℡":"TEL","ℵ":"א","ℶ":"ב","ℷ":"ג","ℸ":"ד","℻":"FAX","Ⅰ":"I","Ⅱ":"II","Ⅲ":"III","Ⅳ":"IV","Ⅴ":"V","Ⅵ":"VI","Ⅶ":"VII","Ⅷ":"VIII","Ⅸ":"IX","Ⅹ":"X","Ⅺ":"XI","Ⅻ":"XII","Ⅼ":"L","Ⅽ":"C","Ⅾ":"D","Ⅿ":"M","ⅰ":"i","ⅱ":"ii","ⅲ":"iii","ⅳ":"iv","ⅴ":"v","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","ⅸ":"ix","ⅹ":"x","ⅺ":"xi","ⅻ":"xii","ⅼ":"l","ⅽ":"c","ⅾ":"d","ⅿ":"m","∬":"∫∫","∭":"∫∫∫","∯":"∮∮","∰":"∮∮∮","⑴":"(1)","⑵":"(2)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⑽":"(10)","⑾":"(11)","⑿":"(12)","⒀":"(13)","⒁":"(14)","⒂":"(15)","⒃":"(16)","⒄":"(17)","⒅":"(18)","⒆":"(19)","⒇":"(20)","⒈":"1.","⒉":"2.","⒊":"3.","⒋":"4.","⒌":"5.","⒍":"6.","⒎":"7.","⒏":"8.","⒐":"9.","⒑":"10.","⒒":"11.","⒓":"12.","⒔":"13.","⒕":"14.","⒖":"15.","⒗":"16.","⒘":"17.","⒙":"18.","⒚":"19.","⒛":"20.","⒜":"(a)","⒝":"(b)","⒞":"(c)","⒟":"(d)","⒠":"(e)","⒡":"(f)","⒢":"(g)","⒣":"(h)","⒤":"(i)","⒥":"(j)","⒦":"(k)","⒧":"(l)","⒨":"(m)","⒩":"(n)","⒪":"(o)","⒫":"(p)","⒬":"(q)","⒭":"(r)","⒮":"(s)","⒯":"(t)","⒰":"(u)","⒱":"(v)","⒲":"(w)","⒳":"(x)","⒴":"(y)","⒵":"(z)","⨌":"∫∫∫∫","⩴":"::=","⩵":"==","⩶":"===","⺟":"母","⻳":"龟","⼀":"一","⼁":"丨","⼂":"丶","⼃":"丿","⼄":"乙","⼅":"亅","⼆":"二","⼇":"亠","⼈":"人","⼉":"儿","⼊":"入","⼋":"八","⼌":"冂","⼍":"冖","⼎":"冫","⼏":"几","⼐":"凵","⼑":"刀","⼒":"力","⼓":"勹","⼔":"匕","⼕":"匚","⼖":"匸","⼗":"十","⼘":"卜","⼙":"卩","⼚":"厂","⼛":"厶","⼜":"又","⼝":"口","⼞":"囗","⼟":"土","⼠":"士","⼡":"夂","⼢":"夊","⼣":"夕","⼤":"大","⼥":"女","⼦":"子","⼧":"宀","⼨":"寸","⼩":"小","⼪":"尢","⼫":"尸","⼬":"屮","⼭":"山","⼮":"巛","⼯":"工","⼰":"己","⼱":"巾","⼲":"干","⼳":"幺","⼴":"广","⼵":"廴","⼶":"廾","⼷":"弋","⼸":"弓","⼹":"彐","⼺":"彡","⼻":"彳","⼼":"心","⼽":"戈","⼾":"戶","⼿":"手","⽀":"支","⽁":"攴","⽂":"文","⽃":"斗","⽄":"斤","⽅":"方","⽆":"无","⽇":"日","⽈":"曰","⽉":"月","⽊":"木","⽋":"欠","⽌":"止","⽍":"歹","⽎":"殳","⽏":"毋","⽐":"比","⽑":"毛","⽒":"氏","⽓":"气","⽔":"水","⽕":"火","⽖":"爪","⽗":"父","⽘":"爻","⽙":"爿","⽚":"片","⽛":"牙","⽜":"牛","⽝":"犬","⽞":"玄","⽟":"玉","⽠":"瓜","⽡":"瓦","⽢":"甘","⽣":"生","⽤":"用","⽥":"田","⽦":"疋","⽧":"疒","⽨":"癶","⽩":"白","⽪":"皮","⽫":"皿","⽬":"目","⽭":"矛","⽮":"矢","⽯":"石","⽰":"示","⽱":"禸","⽲":"禾","⽳":"穴","⽴":"立","⽵":"竹","⽶":"米","⽷":"糸","⽸":"缶","⽹":"网","⽺":"羊","⽻":"羽","⽼":"老","⽽":"而","⽾":"耒","⽿":"耳","⾀":"聿","⾁":"肉","⾂":"臣","⾃":"自","⾄":"至","⾅":"臼","⾆":"舌","⾇":"舛","⾈":"舟","⾉":"艮","⾊":"色","⾋":"艸","⾌":"虍","⾍":"虫","⾎":"血","⾏":"行","⾐":"衣","⾑":"襾","⾒":"見","⾓":"角","⾔":"言","⾕":"谷","⾖":"豆","⾗":"豕","⾘":"豸","⾙":"貝","⾚":"赤","⾛":"走","⾜":"足","⾝":"身","⾞":"車","⾟":"辛","⾠":"辰","⾡":"辵","⾢":"邑","⾣":"酉","⾤":"釆","⾥":"里","⾦":"金","⾧":"長","⾨":"門","⾩":"阜","⾪":"隶","⾫":"隹","⾬":"雨","⾭":"靑","⾮":"非","⾯":"面","⾰":"革","⾱":"韋","⾲":"韭","⾳":"音","⾴":"頁","⾵":"風","⾶":"飛","⾷":"食","⾸":"首","⾹":"香","⾺":"馬","⾻":"骨","⾼":"高","⾽":"髟","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⿂":"魚","⿃":"鳥","⿄":"鹵","⿅":"鹿","⿆":"麥","⿇":"麻","⿈":"黃","⿉":"黍","⿊":"黑","⿋":"黹","⿌":"黽","⿍":"鼎","⿎":"鼓","⿏":"鼠","⿐":"鼻","⿑":"齊","⿒":"齒","⿓":"龍","⿔":"龜","⿕":"龠","〶":"〒","〸":"十","〹":"卄","〺":"卅","゛":" ゙","゜":" ゚","ㄱ":"ᄀ","ㄲ":"ᄁ","ㄳ":"ᆪ","ㄴ":"ᄂ","ㄵ":"ᆬ","ㄶ":"ᆭ","ㄷ":"ᄃ","ㄸ":"ᄄ","ㄹ":"ᄅ","ㄺ":"ᆰ","ㄻ":"ᆱ","ㄼ":"ᆲ","ㄽ":"ᆳ","ㄾ":"ᆴ","ㄿ":"ᆵ","ㅀ":"ᄚ","ㅁ":"ᄆ","ㅂ":"ᄇ","ㅃ":"ᄈ","ㅄ":"ᄡ","ㅅ":"ᄉ","ㅆ":"ᄊ","ㅇ":"ᄋ","ㅈ":"ᄌ","ㅉ":"ᄍ","ㅊ":"ᄎ","ㅋ":"ᄏ","ㅌ":"ᄐ","ㅍ":"ᄑ","ㅎ":"ᄒ","ㅏ":"ᅡ","ㅐ":"ᅢ","ㅑ":"ᅣ","ㅒ":"ᅤ","ㅓ":"ᅥ","ㅔ":"ᅦ","ㅕ":"ᅧ","ㅖ":"ᅨ","ㅗ":"ᅩ","ㅘ":"ᅪ","ㅙ":"ᅫ","ㅚ":"ᅬ","ㅛ":"ᅭ","ㅜ":"ᅮ","ㅝ":"ᅯ","ㅞ":"ᅰ","ㅟ":"ᅱ","ㅠ":"ᅲ","ㅡ":"ᅳ","ㅢ":"ᅴ","ㅣ":"ᅵ","ㅤ":"ᅠ","ㅥ":"ᄔ","ㅦ":"ᄕ","ㅧ":"ᇇ","ㅨ":"ᇈ","ㅩ":"ᇌ","ㅪ":"ᇎ","ㅫ":"ᇓ","ㅬ":"ᇗ","ㅭ":"ᇙ","ㅮ":"ᄜ","ㅯ":"ᇝ","ㅰ":"ᇟ","ㅱ":"ᄝ","ㅲ":"ᄞ","ㅳ":"ᄠ","ㅴ":"ᄢ","ㅵ":"ᄣ","ㅶ":"ᄧ","ㅷ":"ᄩ","ㅸ":"ᄫ","ㅹ":"ᄬ","ㅺ":"ᄭ","ㅻ":"ᄮ","ㅼ":"ᄯ","ㅽ":"ᄲ","ㅾ":"ᄶ","ㅿ":"ᅀ","ㆀ":"ᅇ","ㆁ":"ᅌ","ㆂ":"ᇱ","ㆃ":"ᇲ","ㆄ":"ᅗ","ㆅ":"ᅘ","ㆆ":"ᅙ","ㆇ":"ᆄ","ㆈ":"ᆅ","ㆉ":"ᆈ","ㆊ":"ᆑ","ㆋ":"ᆒ","ㆌ":"ᆔ","ㆍ":"ᆞ","ㆎ":"ᆡ","㈀":"(ᄀ)","㈁":"(ᄂ)","㈂":"(ᄃ)","㈃":"(ᄅ)","㈄":"(ᄆ)","㈅":"(ᄇ)","㈆":"(ᄉ)","㈇":"(ᄋ)","㈈":"(ᄌ)","㈉":"(ᄎ)","㈊":"(ᄏ)","㈋":"(ᄐ)","㈌":"(ᄑ)","㈍":"(ᄒ)","㈎":"(가)","㈏":"(나)","㈐":"(다)","㈑":"(라)","㈒":"(마)","㈓":"(바)","㈔":"(사)","㈕":"(아)","㈖":"(자)","㈗":"(차)","㈘":"(카)","㈙":"(타)","㈚":"(파)","㈛":"(하)","㈜":"(주)","㈝":"(오전)","㈞":"(오후)","㈠":"(一)","㈡":"(二)","㈢":"(三)","㈣":"(四)","㈤":"(五)","㈥":"(六)","㈦":"(七)","㈧":"(八)","㈨":"(九)","㈩":"(十)","㈪":"(月)","㈫":"(火)","㈬":"(水)","㈭":"(木)","㈮":"(金)","㈯":"(土)","㈰":"(日)","㈱":"(株)","㈲":"(有)","㈳":"(社)","㈴":"(名)","㈵":"(特)","㈶":"(財)","㈷":"(祝)","㈸":"(労)","㈹":"(代)","㈺":"(呼)","㈻":"(学)","㈼":"(監)","㈽":"(企)","㈾":"(資)","㈿":"(協)","㉀":"(祭)","㉁":"(休)","㉂":"(自)","㉃":"(至)","㋀":"1月","㋁":"2月","㋂":"3月","㋃":"4月","㋄":"5月","㋅":"6月","㋆":"7月","㋇":"8月","㋈":"9月","㋉":"10月","㋊":"11月","㋋":"12月","㍘":"0点","㍙":"1点","㍚":"2点","㍛":"3点","㍜":"4点","㍝":"5点","㍞":"6点","㍟":"7点","㍠":"8点","㍡":"9点","㍢":"10点","㍣":"11点","㍤":"12点","㍥":"13点","㍦":"14点","㍧":"15点","㍨":"16点","㍩":"17点","㍪":"18点","㍫":"19点","㍬":"20点","㍭":"21点","㍮":"22点","㍯":"23点","㍰":"24点","㏠":"1日","㏡":"2日","㏢":"3日","㏣":"4日","㏤":"5日","㏥":"6日","㏦":"7日","㏧":"8日","㏨":"9日","㏩":"10日","㏪":"11日","㏫":"12日","㏬":"13日","㏭":"14日","㏮":"15日","㏯":"16日","㏰":"17日","㏱":"18日","㏲":"19日","㏳":"20日","㏴":"21日","㏵":"22日","㏶":"23日","㏷":"24日","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏽":"30日","㏾":"31日","ff":"ff","fi":"fi","fl":"fl","ffi":"ffi","ffl":"ffl","ſt":"ſt","st":"st","ﬓ":"մն","ﬔ":"մե","ﬕ":"մի","ﬖ":"վն","ﬗ":"մխ","ﭏ":"אל","ﭐ":"ٱ","ﭑ":"ٱ","ﭒ":"ٻ","ﭓ":"ٻ","ﭔ":"ٻ","ﭕ":"ٻ","ﭖ":"پ","ﭗ":"پ","ﭘ":"پ","ﭙ":"پ","ﭚ":"ڀ","ﭛ":"ڀ","ﭜ":"ڀ","ﭝ":"ڀ","ﭞ":"ٺ","ﭟ":"ٺ","ﭠ":"ٺ","ﭡ":"ٺ","ﭢ":"ٿ","ﭣ":"ٿ","ﭤ":"ٿ","ﭥ":"ٿ","ﭦ":"ٹ","ﭧ":"ٹ","ﭨ":"ٹ","ﭩ":"ٹ","ﭪ":"ڤ","ﭫ":"ڤ","ﭬ":"ڤ","ﭭ":"ڤ","ﭮ":"ڦ","ﭯ":"ڦ","ﭰ":"ڦ","ﭱ":"ڦ","ﭲ":"ڄ","ﭳ":"ڄ","ﭴ":"ڄ","ﭵ":"ڄ","ﭶ":"ڃ","ﭷ":"ڃ","ﭸ":"ڃ","ﭹ":"ڃ","ﭺ":"چ","ﭻ":"چ","ﭼ":"چ","ﭽ":"چ","ﭾ":"ڇ","ﭿ":"ڇ","ﮀ":"ڇ","ﮁ":"ڇ","ﮂ":"ڍ","ﮃ":"ڍ","ﮄ":"ڌ","ﮅ":"ڌ","ﮆ":"ڎ","ﮇ":"ڎ","ﮈ":"ڈ","ﮉ":"ڈ","ﮊ":"ژ","ﮋ":"ژ","ﮌ":"ڑ","ﮍ":"ڑ","ﮎ":"ک","ﮏ":"ک","ﮐ":"ک","ﮑ":"ک","ﮒ":"گ","ﮓ":"گ","ﮔ":"گ","ﮕ":"گ","ﮖ":"ڳ","ﮗ":"ڳ","ﮘ":"ڳ","ﮙ":"ڳ","ﮚ":"ڱ","ﮛ":"ڱ","ﮜ":"ڱ","ﮝ":"ڱ","ﮞ":"ں","ﮟ":"ں","ﮠ":"ڻ","ﮡ":"ڻ","ﮢ":"ڻ","ﮣ":"ڻ","ﮤ":"ۀ","ﮥ":"ۀ","ﮦ":"ہ","ﮧ":"ہ","ﮨ":"ہ","ﮩ":"ہ","ﮪ":"ھ","ﮫ":"ھ","ﮬ":"ھ","ﮭ":"ھ","ﮮ":"ے","ﮯ":"ے","ﮰ":"ۓ","ﮱ":"ۓ","ﯓ":"ڭ","ﯔ":"ڭ","ﯕ":"ڭ","ﯖ":"ڭ","ﯗ":"ۇ","ﯘ":"ۇ","ﯙ":"ۆ","ﯚ":"ۆ","ﯛ":"ۈ","ﯜ":"ۈ","ﯝ":"ٷ","ﯞ":"ۋ","ﯟ":"ۋ","ﯠ":"ۅ","ﯡ":"ۅ","ﯢ":"ۉ","ﯣ":"ۉ","ﯤ":"ې","ﯥ":"ې","ﯦ":"ې","ﯧ":"ې","ﯨ":"ى","ﯩ":"ى","ﯪ":"ئا","ﯫ":"ئا","ﯬ":"ئە","ﯭ":"ئە","ﯮ":"ئو","ﯯ":"ئو","ﯰ":"ئۇ","ﯱ":"ئۇ","ﯲ":"ئۆ","ﯳ":"ئۆ","ﯴ":"ئۈ","ﯵ":"ئۈ","ﯶ":"ئې","ﯷ":"ئې","ﯸ":"ئې","ﯹ":"ئى","ﯺ":"ئى","ﯻ":"ئى","ﯼ":"ی","ﯽ":"ی","ﯾ":"ی","ﯿ":"ی","ﰀ":"ئج","ﰁ":"ئح","ﰂ":"ئم","ﰃ":"ئى","ﰄ":"ئي","ﰅ":"بج","ﰆ":"بح","ﰇ":"بخ","ﰈ":"بم","ﰉ":"بى","ﰊ":"بي","ﰋ":"تج","ﰌ":"تح","ﰍ":"تخ","ﰎ":"تم","ﰏ":"تى","ﰐ":"تي","ﰑ":"ثج","ﰒ":"ثم","ﰓ":"ثى","ﰔ":"ثي","ﰕ":"جح","ﰖ":"جم","ﰗ":"حج","ﰘ":"حم","ﰙ":"خج","ﰚ":"خح","ﰛ":"خم","ﰜ":"سج","ﰝ":"سح","ﰞ":"سخ","ﰟ":"سم","ﰠ":"صح","ﰡ":"صم","ﰢ":"ضج","ﰣ":"ضح","ﰤ":"ضخ","ﰥ":"ضم","ﰦ":"طح","ﰧ":"طم","ﰨ":"ظم","ﰩ":"عج","ﰪ":"عم","ﰫ":"غج","ﰬ":"غم","ﰭ":"فج","ﰮ":"فح","ﰯ":"فخ","ﰰ":"فم","ﰱ":"فى","ﰲ":"في","ﰳ":"قح","ﰴ":"قم","ﰵ":"قى","ﰶ":"قي","ﰷ":"كا","ﰸ":"كج","ﰹ":"كح","ﰺ":"كخ","ﰻ":"كل","ﰼ":"كم","ﰽ":"كى","ﰾ":"كي","ﰿ":"لج","ﱀ":"لح","ﱁ":"لخ","ﱂ":"لم","ﱃ":"لى","ﱄ":"لي","ﱅ":"مج","ﱆ":"مح","ﱇ":"مخ","ﱈ":"مم","ﱉ":"مى","ﱊ":"مي","ﱋ":"نج","ﱌ":"نح","ﱍ":"نخ","ﱎ":"نم","ﱏ":"نى","ﱐ":"ني","ﱑ":"هج","ﱒ":"هم","ﱓ":"هى","ﱔ":"هي","ﱕ":"يج","ﱖ":"يح","ﱗ":"يخ","ﱘ":"يم","ﱙ":"يى","ﱚ":"يي","ﱛ":"ذٰ","ﱜ":"رٰ","ﱝ":"ىٰ","ﱞ":" ٌّ","ﱟ":" ٍّ","ﱠ":" َّ","ﱡ":" ُّ","ﱢ":" ِّ","ﱣ":" ّٰ","ﱤ":"ئر","ﱥ":"ئز","ﱦ":"ئم","ﱧ":"ئن","ﱨ":"ئى","ﱩ":"ئي","ﱪ":"بر","ﱫ":"بز","ﱬ":"بم","ﱭ":"بن","ﱮ":"بى","ﱯ":"بي","ﱰ":"تر","ﱱ":"تز","ﱲ":"تم","ﱳ":"تن","ﱴ":"تى","ﱵ":"تي","ﱶ":"ثر","ﱷ":"ثز","ﱸ":"ثم","ﱹ":"ثن","ﱺ":"ثى","ﱻ":"ثي","ﱼ":"فى","ﱽ":"في","ﱾ":"قى","ﱿ":"قي","ﲀ":"كا","ﲁ":"كل","ﲂ":"كم","ﲃ":"كى","ﲄ":"كي","ﲅ":"لم","ﲆ":"لى","ﲇ":"لي","ﲈ":"ما","ﲉ":"مم","ﲊ":"نر","ﲋ":"نز","ﲌ":"نم","ﲍ":"نن","ﲎ":"نى","ﲏ":"ني","ﲐ":"ىٰ","ﲑ":"ير","ﲒ":"يز","ﲓ":"يم","ﲔ":"ين","ﲕ":"يى","ﲖ":"يي","ﲗ":"ئج","ﲘ":"ئح","ﲙ":"ئخ","ﲚ":"ئم","ﲛ":"ئه","ﲜ":"بج","ﲝ":"بح","ﲞ":"بخ","ﲟ":"بم","ﲠ":"به","ﲡ":"تج","ﲢ":"تح","ﲣ":"تخ","ﲤ":"تم","ﲥ":"ته","ﲦ":"ثم","ﲧ":"جح","ﲨ":"جم","ﲩ":"حج","ﲪ":"حم","ﲫ":"خج","ﲬ":"خم","ﲭ":"سج","ﲮ":"سح","ﲯ":"سخ","ﲰ":"سم","ﲱ":"صح","ﲲ":"صخ","ﲳ":"صم","ﲴ":"ضج","ﲵ":"ضح","ﲶ":"ضخ","ﲷ":"ضم","ﲸ":"طح","ﲹ":"ظم","ﲺ":"عج","ﲻ":"عم","ﲼ":"غج","ﲽ":"غم","ﲾ":"فج","ﲿ":"فح","ﳀ":"فخ","ﳁ":"فم","ﳂ":"قح","ﳃ":"قم","ﳄ":"كج","ﳅ":"كح","ﳆ":"كخ","ﳇ":"كل","ﳈ":"كم","ﳉ":"لج","ﳊ":"لح","ﳋ":"لخ","ﳌ":"لم","ﳍ":"له","ﳎ":"مج","ﳏ":"مح","ﳐ":"مخ","ﳑ":"مم","ﳒ":"نج","ﳓ":"نح","ﳔ":"نخ","ﳕ":"نم","ﳖ":"نه","ﳗ":"هج","ﳘ":"هم","ﳙ":"هٰ","ﳚ":"يج","ﳛ":"يح","ﳜ":"يخ","ﳝ":"يم","ﳞ":"يه","ﳟ":"ئم","ﳠ":"ئه","ﳡ":"بم","ﳢ":"به","ﳣ":"تم","ﳤ":"ته","ﳥ":"ثم","ﳦ":"ثه","ﳧ":"سم","ﳨ":"سه","ﳩ":"شم","ﳪ":"شه","ﳫ":"كل","ﳬ":"كم","ﳭ":"لم","ﳮ":"نم","ﳯ":"نه","ﳰ":"يم","ﳱ":"يه","ﳲ":"ـَّ","ﳳ":"ـُّ","ﳴ":"ـِّ","ﳵ":"طى","ﳶ":"طي","ﳷ":"عى","ﳸ":"عي","ﳹ":"غى","ﳺ":"غي","ﳻ":"سى","ﳼ":"سي","ﳽ":"شى","ﳾ":"شي","ﳿ":"حى","ﴀ":"حي","ﴁ":"جى","ﴂ":"جي","ﴃ":"خى","ﴄ":"خي","ﴅ":"صى","ﴆ":"صي","ﴇ":"ضى","ﴈ":"ضي","ﴉ":"شج","ﴊ":"شح","ﴋ":"شخ","ﴌ":"شم","ﴍ":"شر","ﴎ":"سر","ﴏ":"صر","ﴐ":"ضر","ﴑ":"طى","ﴒ":"طي","ﴓ":"عى","ﴔ":"عي","ﴕ":"غى","ﴖ":"غي","ﴗ":"سى","ﴘ":"سي","ﴙ":"شى","ﴚ":"شي","ﴛ":"حى","ﴜ":"حي","ﴝ":"جى","ﴞ":"جي","ﴟ":"خى","ﴠ":"خي","ﴡ":"صى","ﴢ":"صي","ﴣ":"ضى","ﴤ":"ضي","ﴥ":"شج","ﴦ":"شح","ﴧ":"شخ","ﴨ":"شم","ﴩ":"شر","ﴪ":"سر","ﴫ":"صر","ﴬ":"ضر","ﴭ":"شج","ﴮ":"شح","ﴯ":"شخ","ﴰ":"شم","ﴱ":"سه","ﴲ":"شه","ﴳ":"طم","ﴴ":"سج","ﴵ":"سح","ﴶ":"سخ","ﴷ":"شج","ﴸ":"شح","ﴹ":"شخ","ﴺ":"طم","ﴻ":"ظم","ﴼ":"اً","ﴽ":"اً","ﵐ":"تجم","ﵑ":"تحج","ﵒ":"تحج","ﵓ":"تحم","ﵔ":"تخم","ﵕ":"تمج","ﵖ":"تمح","ﵗ":"تمخ","ﵘ":"جمح","ﵙ":"جمح","ﵚ":"حمي","ﵛ":"حمى","ﵜ":"سحج","ﵝ":"سجح","ﵞ":"سجى","ﵟ":"سمح","ﵠ":"سمح","ﵡ":"سمج","ﵢ":"سمم","ﵣ":"سمم","ﵤ":"صحح","ﵥ":"صحح","ﵦ":"صمم","ﵧ":"شحم","ﵨ":"شحم","ﵩ":"شجي","ﵪ":"شمخ","ﵫ":"شمخ","ﵬ":"شمم","ﵭ":"شمم","ﵮ":"ضحى","ﵯ":"ضخم","ﵰ":"ضخم","ﵱ":"طمح","ﵲ":"طمح","ﵳ":"طمم","ﵴ":"طمي","ﵵ":"عجم","ﵶ":"عمم","ﵷ":"عمم","ﵸ":"عمى","ﵹ":"غمم","ﵺ":"غمي","ﵻ":"غمى","ﵼ":"فخم","ﵽ":"فخم","ﵾ":"قمح","ﵿ":"قمم","ﶀ":"لحم","ﶁ":"لحي","ﶂ":"لحى","ﶃ":"لجج","ﶄ":"لجج","ﶅ":"لخم","ﶆ":"لخم","ﶇ":"لمح","ﶈ":"لمح","ﶉ":"محج","ﶊ":"محم","ﶋ":"محي","ﶌ":"مجح","ﶍ":"مجم","ﶎ":"مخج","ﶏ":"مخم","ﶒ":"مجخ","ﶓ":"همج","ﶔ":"همم","ﶕ":"نحم","ﶖ":"نحى","ﶗ":"نجم","ﶘ":"نجم","ﶙ":"نجى","ﶚ":"نمي","ﶛ":"نمى","ﶜ":"يمم","ﶝ":"يمم","ﶞ":"بخي","ﶟ":"تجي","ﶠ":"تجى","ﶡ":"تخي","ﶢ":"تخى","ﶣ":"تمي","ﶤ":"تمى","ﶥ":"جمي","ﶦ":"جحى","ﶧ":"جمى","ﶨ":"سخى","ﶩ":"صحي","ﶪ":"شحي","ﶫ":"ضحي","ﶬ":"لجي","ﶭ":"لمي","ﶮ":"يحي","ﶯ":"يجي","ﶰ":"يمي","ﶱ":"ممي","ﶲ":"قمي","ﶳ":"نحي","ﶴ":"قمح","ﶵ":"لحم","ﶶ":"عمي","ﶷ":"كمي","ﶸ":"نجح","ﶹ":"مخي","ﶺ":"لجم","ﶻ":"كمم","ﶼ":"لجم","ﶽ":"نجح","ﶾ":"جحي","ﶿ":"حجي","ﷀ":"مجي","ﷁ":"فمي","ﷂ":"بحي","ﷃ":"كمم","ﷄ":"عجم","ﷅ":"صمم","ﷆ":"سخي","ﷇ":"نجي","﹉":"‾","﹊":"‾","﹋":"‾","﹌":"‾","﹍":"_","﹎":"_","﹏":"_","ﺀ":"ء","ﺁ":"آ","ﺂ":"آ","ﺃ":"أ","ﺄ":"أ","ﺅ":"ؤ","ﺆ":"ؤ","ﺇ":"إ","ﺈ":"إ","ﺉ":"ئ","ﺊ":"ئ","ﺋ":"ئ","ﺌ":"ئ","ﺍ":"ا","ﺎ":"ا","ﺏ":"ب","ﺐ":"ب","ﺑ":"ب","ﺒ":"ب","ﺓ":"ة","ﺔ":"ة","ﺕ":"ت","ﺖ":"ت","ﺗ":"ت","ﺘ":"ت","ﺙ":"ث","ﺚ":"ث","ﺛ":"ث","ﺜ":"ث","ﺝ":"ج","ﺞ":"ج","ﺟ":"ج","ﺠ":"ج","ﺡ":"ح","ﺢ":"ح","ﺣ":"ح","ﺤ":"ح","ﺥ":"خ","ﺦ":"خ","ﺧ":"خ","ﺨ":"خ","ﺩ":"د","ﺪ":"د","ﺫ":"ذ","ﺬ":"ذ","ﺭ":"ر","ﺮ":"ر","ﺯ":"ز","ﺰ":"ز","ﺱ":"س","ﺲ":"س","ﺳ":"س","ﺴ":"س","ﺵ":"ش","ﺶ":"ش","ﺷ":"ش","ﺸ":"ش","ﺹ":"ص","ﺺ":"ص","ﺻ":"ص","ﺼ":"ص","ﺽ":"ض","ﺾ":"ض","ﺿ":"ض","ﻀ":"ض","ﻁ":"ط","ﻂ":"ط","ﻃ":"ط","ﻄ":"ط","ﻅ":"ظ","ﻆ":"ظ","ﻇ":"ظ","ﻈ":"ظ","ﻉ":"ع","ﻊ":"ع","ﻋ":"ع","ﻌ":"ع","ﻍ":"غ","ﻎ":"غ","ﻏ":"غ","ﻐ":"غ","ﻑ":"ف","ﻒ":"ف","ﻓ":"ف","ﻔ":"ف","ﻕ":"ق","ﻖ":"ق","ﻗ":"ق","ﻘ":"ق","ﻙ":"ك","ﻚ":"ك","ﻛ":"ك","ﻜ":"ك","ﻝ":"ل","ﻞ":"ل","ﻟ":"ل","ﻠ":"ل","ﻡ":"م","ﻢ":"م","ﻣ":"م","ﻤ":"م","ﻥ":"ن","ﻦ":"ن","ﻧ":"ن","ﻨ":"ن","ﻩ":"ه","ﻪ":"ه","ﻫ":"ه","ﻬ":"ه","ﻭ":"و","ﻮ":"و","ﻯ":"ى","ﻰ":"ى","ﻱ":"ي","ﻲ":"ي","ﻳ":"ي","ﻴ":"ي","ﻵ":"لآ","ﻶ":"لآ","ﻷ":"لأ","ﻸ":"لأ","ﻹ":"لإ","ﻺ":"لإ","ﻻ":"لا","ﻼ":"لا"},Vt=function(){function e(e,t,a,r,i,n){this.fontChar=e,this.unicode=t,this.accent=a,this.width=r,this.vmetric=i,this.operatorListId=n}return e.prototype.matchesForCache=function(e,t,a,r,i,n){return this.fontChar===e&&this.unicode===t&&this.accent===a&&this.width===r&&this.vmetric===i&&this.operatorListId===n},e}(),Wt=function(){function e(e){this._map=e}return e.prototype={get length(){return this._map.length},forEach:function(e){for(var t in this._map)e(t,this._map[t].charCodeAt(0))},get:function(e){return this._map[e]},charCodeOf:function(e){return this._map.indexOf(e)}},e}(),Kt=function(){function e(e,t){this.firstChar=e,this.lastChar=t}return e.prototype={get length(){a("should not access .length")},forEach:function(e){for(var t=this.firstChar,a=this.lastChar;a>=t;t++)e(t,t)},get:function(e){return this.firstChar<=e&&e<=this.lastChar?String.fromCharCode(e):void 0},charCodeOf:function(e){a("should not call .charCodeOf")}},e}(),Yt=function(){function e(e,t,a){e[t]=a>>8&255,e[t+1]=255&a}function t(e,t,a){e[t]=a>>24&255,e[t+1]=a>>16&255,e[t+2]=a>>8&255,e[t+3]=255&a}function a(e,t,a){var r,i;if(a instanceof Uint8Array)e.set(a,t);else if("string"==typeof a)for(r=0,i=a.length;i>r;r++)e[t++]=255&a.charCodeAt(r);else for(r=0,i=a.length;i>r;r++)e[t++]=255&a[r]}function r(e){this.sfnt=e,this.tables=Object.create(null)}r.getSearchParams=function(e,t){for(var a=1,r=0;(a^e)>a;)a<<=1,r++;var i=a*t;return{range:i,entry:r,rangeShift:t*e-i}};var i=12,n=16;return r.prototype={toArray:function(){var o=this.sfnt,s=this.tables,c=Object.keys(s);c.sort();var h,u,f,d,g,m=c.length,p=i+m*n,b=[p];for(h=0;m>h;h++){d=s[c[h]];var v=(d.length+3&-4)>>>0;p+=v,b.push(p)}var y=new Uint8Array(p);for(h=0;m>h;h++)d=s[c[h]],a(y,b[h],d);"true"===o&&(o=l(65536)),y[0]=255&o.charCodeAt(0),y[1]=255&o.charCodeAt(1),y[2]=255&o.charCodeAt(2),y[3]=255&o.charCodeAt(3),e(y,4,m);var k=r.getSearchParams(m,16);for(e(y,6,k.range),e(y,8,k.entry),e(y,10,k.rangeShift),p=i,h=0;m>h;h++){g=c[h],y[p]=255&g.charCodeAt(0),y[p+1]=255&g.charCodeAt(1),y[p+2]=255&g.charCodeAt(2),y[p+3]=255&g.charCodeAt(3);var w=0;for(u=b[h],f=b[h+1];f>u;u+=4){var x=(y[u]<<24)+(y[u+1]<<16)+(y[u+2]<<8)+y[u+3];w=w+x|0}t(y,p+4,w),t(y,p+8,b[h]),t(y,p+12,s[g].length),p+=n}return y},addTable:function(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}},r}(),Zt=function(){function r(r,i,n){var o,s,c;this.name=r,this.loadedName=n.loadedName,this.isType3Font=n.isType3Font,this.sizes=[],this.glyphCache={};var l=r.split("+");l=l.length>1?l[1]:l[0],l=l.split(/[-,_]/g)[0],this.isSerifFont=!!(n.flags&qt.Serif),this.isSymbolicFont=!!(n.flags&qt.Symbolic),this.isMonospace=!!(n.flags&qt.FixedPitch);var h=n.type,u=n.subtype;if(this.type=h,this.fallbackName=this.isMonospace?"monospace":this.isSerifFont?"serif":"sans-serif",
this.differences=n.differences,this.widths=n.widths,this.defaultWidth=n.defaultWidth,this.composite=n.composite,this.wideChars=n.wideChars,this.cMap=n.cMap,this.ascent=n.ascent/Mt,this.descent=n.descent/Mt,this.fontMatrix=n.fontMatrix,this.toUnicode=n.toUnicode=this.buildToUnicode(n),this.toFontChar=[],"Type3"===n.type){for(o=0;256>o;o++)this.toFontChar[o]=this.differences[o]||n.defaultEncoding[o];return void(this.fontType=V.TYPE3)}if(this.cidEncoding=n.cidEncoding,this.vertical=n.vertical,this.vertical&&(this.vmetrics=n.vmetrics,this.defaultVMetrics=n.defaultVMetrics),!i||i.isEmpty){i&&t('Font file is empty in "'+r+'" ('+this.loadedName+")"),this.missingFile=!0;var d=r.replace(/[,_]/g,"-"),g=d in Ft;if(d=Ft[d]||Nt[d]||d,this.bold=-1!==d.search(/bold/gi),this.italic=-1!==d.search(/oblique/gi)||-1!==d.search(/italic/gi),this.black=-1!==r.search(/Black/g),this.remeasure=Object.keys(this.widths).length>0,g&&"CIDFontType2"===h&&0===n.cidEncoding.indexOf("Identity-")){var m=[];for(var p in Ht)m[+p]=Ht[p];var b=this.toUnicode instanceof Kt;b||this.toUnicode.forEach(function(e,t){m[+e]=t}),this.toFontChar=m,this.toUnicode=new Wt(m)}else if(/Symbol/i.test(d)){var v=Ut.SymbolSetEncoding;for(o in v)c=ya[v[o]],c&&(this.toFontChar[o]=c);for(o in n.differences)c=ya[n.differences[o]],c&&(this.toFontChar[o]=c)}else if(/Dingbats/i.test(d)){var y=Ut.ZapfDingbatsEncoding;for(o in y)c=ka[y[o]],c&&(this.toFontChar[o]=c);for(o in n.differences)c=ka[n.differences[o]],c&&(this.toFontChar[o]=c)}else if(g){this.toFontChar=[];for(o in n.defaultEncoding)s=n.differences[o]||n.defaultEncoding[o],this.toFontChar[o]=ya[s]}else{var k=-1===h.indexOf("CIDFontType");this.toUnicode.forEach(function(e,t){k&&(s=n.differences[e]||n.defaultEncoding[e],t=ya[s]||t),this.toFontChar[e]=t}.bind(this))}return this.loadedName=d.split("-")[0],this.loading=!1,void(this.fontType=F(h,u))}"Type1C"===u&&"Type1"!==h&&"MMType1"!==h&&(f(i)?u="TrueType":h="Type1"),"CIDFontType0C"===u&&"CIDFontType0"!==h&&(h="CIDFontType0"),"OpenType"===u&&(h="OpenType");var w;switch(h){case"MMType1":e("MMType1 font ("+r+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var x="Type1C"===u||"CIDFontType0C"===u?new ra(i,n):new aa(r,i,n);U(n),w=this.convert(r,x,n);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype",w=this.checkAndRepair(r,i,n),this.isOpenType&&(h="OpenType");break;default:a("Font "+h+" is not supported")}this.data=w,this.fontType=F(h,u),this.fontMatrix=n.fontMatrix,this.widths=n.widths,this.defaultWidth=n.defaultWidth,this.encoding=n.baseEncoding,this.seacMap=n.seacMap,this.loading=!0}function n(e,t){return(e<<8)+t}function c(e,t,a,r){return(e<<24)+(t<<16)+(a<<8)+r}function h(e){return String.fromCharCode(e>>8&255,255&e)}function u(e){return e=e>32767?32767:-32768>e?-32768:e,String.fromCharCode(e>>8&255,255&e)}function f(e){var t=e.peekBytes(4);return 65536===d(t,0)}function g(e,t){var a=t.toUnicode,r=!!(t.flags&qt.Symbolic),i=t.toUnicode instanceof Kt,n="CIDFontType2"===t.type,o=Object.create(null),s=[],c=[],l=Lt;for(var h in e){h|=0;var u=e[h],f=h;if(!i)if(void 0!==a.get(h)){var d=a.get(f);1===d.length&&(f=d.charCodeAt(0))}else n&&(f=l);if((void 0!==c[f]||31>=f||127===f||173===f||f>=128&&159>=f||f>=65520&&65535>=f||r&&i)&&Rt>=l)do f=l++,Pt&&61440===f&&(f=61472,l=f+1);while(void 0!==c[f]&&Rt>=l);o[f]=u,s[h]=f,c[f]=!0}return{toFontChar:s,charCodeToGlyphId:o,nextAvailableFontCharCode:l}}function m(e){var t=[];for(var a in e)t.push({fontCharCode:0|a,glyphId:e[a]});t.sort(function(e,t){return e.fontCharCode-t.fontCharCode});for(var r=[],i=t.length,n=0;i>n;){var o=t[n].fontCharCode,s=[t[n].glyphId];++n;for(var c=o;i>n&&c+1===t[n].fontCharCode&&(s.push(t[n].glyphId),++c,++n,65535!==c););r.push([o,c,s])}return r}function p(e){var t,a,r,i,n=m(e),o=n[n.length-1][1]>65535?2:1,s="\x00\x00"+h(o)+"\x00\x00"+l(4+8*o);for(t=n.length-1;t>=0&&!(n[t][0]<=65535);--t);var c=t+1;n[t][0]<65535&&65535===n[t][1]&&(n[t][1]=65534);var u,f,d,g,p=n[t][1]<65535?1:0,b=c+p,v=Yt.getSearchParams(b,2),y="",k="",w="",x="",C="",S=0;for(t=0,a=c;a>t;t++){u=n[t],f=u[0],d=u[1],y+=h(f),k+=h(d),g=u[2];var A=!0;for(r=1,i=g.length;i>r;++r)if(g[r]!==g[r-1]+1){A=!1;break}if(A){var B=g[0];w+=h(B-f&65535),x+=h(0)}else{var I=2*(b-t)+2*S;for(S+=d-f+1,w+=h(0),x+=h(I),r=0,i=g.length;i>r;++r)C+=h(g[r])}}p>0&&(k+="ÿÿ",y+="ÿÿ",w+="\x00",x+="\x00\x00");var T="\x00\x00"+h(2*b)+h(v.range)+h(v.entry)+h(v.rangeShift)+k+"\x00\x00"+y+w+x+C,O="",L="";if(o>1){for(s+="\x00\x00\n"+l(4+8*o+4+T.length),O="",t=0,a=n.length;a>t;t++){u=n[t],f=u[0],g=u[2];var R=g[0];for(r=1,i=g.length;i>r;++r)g[r]!==g[r-1]+1&&(d=u[0]+r-1,O+=l(f)+l(d)+l(R),f=d+1,R=g[r]);O+=l(f)+l(u[1])+l(R)}L="\x00\f\x00\x00"+l(O.length+16)+"\x00\x00\x00\x00"+l(O.length/12)}return s+"\x00"+h(T.length+4)+T+L+O}function b(e){var t=new Pa(e.data),a=t.getUint16();t.getBytes(60);var r=t.getUint16();if(4>a&&768&r)return!1;var i=t.getUint16(),n=t.getUint16();if(i>n)return!1;t.getBytes(6);var o=t.getUint16();return 0===o?!1:(e.data[8]=e.data[9]=0,!0)}function v(e,t,r){r=r||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var i=0,n=0,o=0,s=0,c=null,u=0;if(t)for(var f in t){f|=0,(c>f||!c)&&(c=f),f>u&&(u=f);var d=D(f);32>d?i|=1<<d:64>d?n|=1<<d-32:96>d?o|=1<<d-64:123>d?s|=1<<d-96:a("Unicode ranges Bits > 123 are reserved for internal usage")}else c=0,u=255;var g=e.bbox||[0,0,0,0],m=r.unitsPerEm||1/(e.fontMatrix||H)[0],p=e.ascentScaled?1:m/Mt,b=r.ascent||Math.round(p*(e.ascent||g[3])),v=r.descent||Math.round(p*(e.descent||g[1]));v>0&&e.descent>0&&g[1]<0&&(v=-v);var y=r.yMax||b,k=-r.yMin||-v;return"\x00$ô\x00\x00\x00»\x00\x00\x00»\x00\x00ß\x001\x00\x00\x00\x00"+String.fromCharCode(e.fixedPitch?9:0)+"\x00\x00\x00\x00\x00\x00"+l(i)+l(n)+l(o)+l(s)+"*21*"+h(e.italicAngle?1:0)+h(c||e.firstChar)+h(u||e.lastChar)+h(b)+h(v)+"\x00d"+h(y)+h(k)+"\x00\x00\x00\x00\x00\x00\x00\x00"+h(e.xHeight)+h(e.capHeight)+h(0)+h(c||e.firstChar)+"\x00"}function y(e){var t=Math.floor(e.italicAngle*Math.pow(2,16));return"\x00\x00\x00"+l(t)+"\x00\x00\x00\x00"+l(e.fixedPitch)+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}function k(e,t){t||(t=[[],[]]);var a,r,i,n,o,s=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||"",t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],c=[];for(a=0,r=s.length;r>a;a++){o=t[1][a]||s[a];var l=[];for(i=0,n=o.length;n>i;i++)l.push(h(o.charCodeAt(i)));c.push(l.join(""))}var u=[s,c],f=["\x00","\x00"],d=["\x00\x00","\x00"],g=["\x00\x00"," "],m=s.length*f.length,p="\x00\x00"+h(m)+h(12*m+6),b=0;for(a=0,r=f.length;r>a;a++){var v=u[a];for(i=0,n=v.length;n>i;i++){o=v[i];var y=f[a]+d[a]+g[a]+h(i)+h(o.length)+h(b);p+=y,b+=o.length}}return p+=s.join("")+c.join("")}return r.getFontID=function(){var e=1;return function(){return String(e++)}}(),r.prototype={name:null,font:null,mimetype:null,encoding:null,get renderer(){var e=va.create(this);return o(this,"renderer",e)},exportData:function(){var e={};for(var t in this)this.hasOwnProperty(t)&&(e[t]=this[t]);return e},checkAndRepair:function(r,o,l){function h(e){var t=s(e.getBytes(4)),a=e.getInt32(),r=e.getInt32()>>>0,i=e.getInt32()>>>0,n=e.pos;e.pos=e.start?e.start:0,e.skip(r);var o=e.getBytes(i);return e.pos=n,"head"===t&&(o[8]=o[9]=o[10]=o[11]=0,o[17]|=32),{tag:t,checksum:a,length:i,offset:r,data:o}}function u(e){return{version:s(e.getBytes(4)),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function f(e,r,i){var n,o=(r.start?r.start:0)+e.offset;r.pos=o;for(var s,c=(r.getUint16(),r.getUint16()),l=!1,h=0;c>h;h++){var u=r.getUint16(),f=r.getUint16(),d=r.getInt32()>>>0,g=!1;if(1===u&&0===f?g=!0:i||3!==u||1!==f?i&&3===u&&0===f&&(g=!0,l=!0):(g=!0,l=!0),g&&(s={platformId:u,encodingId:f,offset:d}),l)break}if(!s)return t("Could not find a preferred cmap table."),{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1};r.pos=o+s.offset;var m,p,b=r.getUint16(),v=(r.getUint16(),r.getUint16(),!1),y=[];if(0===b){for(m=0;256>m;m++){var k=r.getByte();k&&y.push({charCode:m,glyphId:k})}v=!0}else if(4===b){var w=r.getUint16()>>1;r.getBytes(6);var x,C=[];for(x=0;w>x;x++)C.push({end:r.getUint16()});for(r.getUint16(),x=0;w>x;x++)C[x].start=r.getUint16();for(x=0;w>x;x++)C[x].delta=r.getUint16();var S=0;for(x=0;w>x;x++){n=C[x];var A=r.getUint16();if(A){var B=(A>>1)-(w-x);n.offsetIndex=B,S=Math.max(S,B+n.end-n.start+1)}else n.offsetIndex=-1}var I=[];for(m=0;S>m;m++)I.push(r.getUint16());for(x=0;w>x;x++){n=C[x],o=n.start;var T=n.end,O=n.delta;for(B=n.offsetIndex,m=o;T>=m;m++)65535!==m&&(p=0>B?m:I[B+m-o],p=p+O&65535,0!==p&&y.push({charCode:m,glyphId:p}))}}else if(6===b){var L=r.getUint16(),R=r.getUint16();for(m=0;R>m;m++){p=r.getUint16();var P=L+m;y.push({charCode:P,glyphId:p})}}else a("cmap table has unsupported format: "+b);for(y.sort(function(e,t){return e.charCode-t.charCode}),h=1;h<y.length;h++)y[h-1].charCode===y[h].charCode&&(y.splice(h,1),h--);return{platformId:s.platformId,encodingId:s.encodingId,mappings:y,hasShortCmap:v}}function d(t,a,r,i){if(!a)return void(r&&(r.data=null));t.pos=(t.start?t.start:0)+a.offset,t.pos+=a.length-2;var n=t.getUint16();n>i&&(e("The numOfMetrics ("+n+") should not be greater than the numGlyphs ("+i+")"),n=i,a.data[34]=(65280&n)>>8,a.data[35]=255&n);var o=i-n,s=o-(r.length-4*n>>1);if(s>0){var c=new Uint8Array(r.length+2*s);c.set(r.data),r.data=c}}function m(e,t,a,r,i,n){if(12>=a-t)return 0;var o=e.subarray(t,a),s=o[0]<<8|o[1];if(32768&s)return r.set(o,i),o.length;var c,l=10,h=0;for(c=0;s>c;c++){var u=o[l]<<8|o[l+1];h=u+1,l+=2}var f=l,d=o[l]<<8|o[l+1];l+=2+d;var g=l,m=0;for(c=0;h>c;c++){var p=o[l++];192&p&&(o[l-1]=63&p);var b=(2&p?1:16&p?0:2)+(4&p?1:32&p?0:2);if(m+=b,8&p){var v=o[l++];c+=v,m+=v*b}}if(0===m)return 0;var y=l+m;return y>o.length?0:!n&&d>0?(r.set(o.subarray(0,f),i),r.set([0,0],i+f),r.set(o.subarray(g,y),i+f+2),y-=d,o.length-y>3&&(y=y+3&-4),y):o.length-y>3?(y=y+3&-4,r.set(o.subarray(0,y),i),y):(r.set(o,i),o.length)}function w(a,r,i){var o=a.data,s=c(o[0],o[1],o[2],o[3]);s>>16!==1&&(e("Attempting to fix invalid version in head table: "+s),o[0]=0,o[1]=1,o[2]=0,o[3]=0);var l=n(o[50],o[51]);if(0>l||l>1){e("Attempting to fix invalid indexToLocFormat in head table: "+l);var h=r+1;i===h<<1?(o[50]=0,o[51]=0):i===h<<2?(o[50]=0,o[51]=1):t("Could not fix indexToLocFormat: "+l)}}function x(e,t,a,r,i,n){var o,s,c;r?(o=4,s=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]},c=function(e,t,a){e[t]=a>>>24&255,e[t+1]=a>>16&255,e[t+2]=a>>8&255,e[t+3]=255&a}):(o=2,s=function(e,t){return e[t]<<9|e[t+1]<<1},c=function(e,t,a){e[t]=a>>9&255,e[t+1]=a>>1&255});var l=e.data,h=o*(1+a);l.length!==h&&(l=new Uint8Array(h),l.set(e.data.subarray(0,h)),e.data=l);var u=t.data,f=u.length,d=new Uint8Array(f),g=s(l,0),p=0;c(l,0,p);var b,v;for(b=0,v=o;a>b;b++,v+=o){var y=s(l,v);if(y>f&&(f+3&-4)===y&&(y=f),y>f)c(l,v,p),g=y;else{var k=m(u,g,y,d,p,i);p+=k,c(l,v,p),g=y}}if(0===p){var w=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(b=0,v=o;a>b;b++,v+=o)c(l,v,w.length);return void(t.data=w)}if(n){var x=s(l,o);d.length>x+p?t.data=d.subarray(0,x+p):(t.data=new Uint8Array(x+p),t.data.set(d.subarray(0,p))),t.data.set(d.subarray(0,x),p),c(e.data,l.length-o,p+x)}else t.data=d.subarray(0,p)}function C(e,a,r){var i=(o.start?o.start:0)+e.offset;o.pos=i;var n=e.length,s=i+n,c=o.getInt32();o.getBytes(28);var l,h,u=!0;switch(c){case 65536:l=_t;break;case 131072:var f=o.getUint16();if(f!==r){u=!1;break}var d=[];for(h=0;f>h;++h){var g=o.getUint16();if(g>=32768){u=!1;break}d.push(g)}if(!u)break;for(var m=[],p=[];o.pos<s;){var b=o.getByte();for(p.length=b,h=0;b>h;++h)p[h]=String.fromCharCode(o.getByte());m.push(p.join(""))}for(l=[],h=0;f>h;++h){var v=d[h];258>v?l.push(_t[v]):l.push(m[v-258])}break;case 196608:break;default:t("Unknown/unsupported post table version "+c),u=!1}return a.glyphNames=l,u}function S(e){var t=(o.start?o.start:0)+e.offset;o.pos=t;var a=[[],[]],r=e.length,i=t+r,n=o.getUint16(),c=6;if(0!==n||c>r)return a;var l,h,u=o.getUint16(),f=o.getUint16(),d=[],g=12;for(l=0;u>l&&o.pos+g<=i;l++){var m={platform:o.getUint16(),encoding:o.getUint16(),language:o.getUint16(),name:o.getUint16(),length:o.getUint16(),offset:o.getUint16()};(1===m.platform&&0===m.encoding&&0===m.language||3===m.platform&&1===m.encoding&&1033===m.language)&&d.push(m)}for(l=0,h=d.length;h>l;l++){var p=d[l],b=t+f+p.offset;if(!(b+p.length>i)){o.pos=b;var v=p.name;if(p.encoding){for(var y="",k=0,w=p.length;w>k;k+=2)y+=String.fromCharCode(o.getUint16());a[1][v]=y}else a[0][v]=s(o.getBytes(p.length))}}return a}function A(e,a){for(var r,i,n,o,s,c=e.data,l=0,h=0,u=0,f=[],d=[],g=[],m=a.tooComplexToFollowFunctions,p=!1,b=0,v=0,y=c.length;y>l;){var k=c[l++];if(64===k)if(i=c[l++],p||v)l+=i;else for(r=0;i>r;r++)f.push(c[l++]);else if(65===k)if(i=c[l++],p||v)l+=2*i;else for(r=0;i>r;r++)n=c[l++],f.push(n<<8|c[l++]);else if(176===(248&k))if(i=k-176+1,p||v)l+=i;else for(r=0;i>r;r++)f.push(c[l++]);else if(184===(248&k))if(i=k-184+1,p||v)l+=2*i;else for(r=0;i>r;r++)n=c[l++],f.push(n<<8|c[l++]);else if(43!==k||m)if(44!==k||m){if(45===k)if(p)p=!1,h=l;else{if(s=d.pop(),!s)return t("TT: ENDF bad stack"),void(a.hintsValid=!1);o=g.pop(),c=s.data,l=s.i,a.functionsStackDeltas[o]=f.length-s.stackTop}else if(137===k)(p||v)&&(t("TT: nested IDEFs not allowed"),m=!0),p=!0,u=l;else if(88===k)++b;else if(27===k)v=b;else if(89===k)v===b&&(v=0),--b;else if(28===k&&!p&&!v){var w=f[f.length-1];w>0&&(l+=w-1)}}else(p||v)&&(t("TT: nested FDEFs not allowed"),m=!0),p=!0,u=l,o=f.pop(),a.functionsDefined[o]={data:c,i:l};else if(!p&&!v)if(o=f[f.length-1],a.functionsUsed[o]=!0,o in a.functionsStackDeltas)f.length+=a.functionsStackDeltas[o];else if(o in a.functionsDefined&&g.indexOf(o)<0){if(d.push({data:c,i:l,stackTop:f.length-1}),g.push(o),s=a.functionsDefined[o],!s)return t("TT: CALL non-existent function"),void(a.hintsValid=!1);c=s.data,l=s.i}if(!p&&!v){var x=142>=k?O[k]:k>=192&&223>=k?-1:k>=224?-2:0;for(k>=113&&117>=k&&(i=f.pop(),i===i&&(x=2*-i));0>x&&f.length>0;)f.pop(),x++;for(;x>0;)f.push(NaN),x--}}a.tooComplexToFollowFunctions=m;var C=[c];l>c.length&&C.push(new Uint8Array(l-c.length)),u>h&&(t("TT: complementing a missing function tail"),C.push(new Uint8Array([34,45]))),I(e,C)}function B(e,a){if(!e.tooComplexToFollowFunctions){if(e.functionsDefined.length>a)return t("TT: more functions defined than expected"),void(e.hintsValid=!1);for(var r=0,i=e.functionsUsed.length;i>r;r++){if(r>a)return t("TT: invalid function id: "+r),void(e.hintsValid=!1);if(e.functionsUsed[r]&&!e.functionsDefined[r])return t("TT: undefined function: "+r),void(e.hintsValid=!1)}}}function I(e,t){if(t.length>1){var a,r,i=0;for(a=0,r=t.length;r>a;a++)i+=t[a].length;i=i+3&-4;var n=new Uint8Array(i),o=0;for(a=0,r=t.length;r>a;a++)n.set(t[a],o),o+=t[a].length;e.data=n,e.length=i}}function T(e,t,a){var r={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};if(e&&A(e,r),t&&A(t,r),e&&B(r,z),a&&1&a.length){var i=new Uint8Array(a.length+1);i.set(a.data),a.data=i}return r.hintsValid}var O=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];o=new Pa(new Uint8Array(o.getBytes()));for(var L,R,P,M=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "],D=u(o),E=D.numTables,q={"OS/2":null,cmap:null,head:null,hhea:null,hmtx:null,maxp:null,name:null,post:null},U=0;E>U;U++)P=h(o),M.indexOf(P.tag)<0||0!==P.length&&(q[P.tag]=P);var F=!q["CFF "];if(F)q.glyf&&q.loca||a('Required "glyf" or "loca" tables are not found'),this.isOpenType=!1;else{if(!(q.head&&q.hhea&&q.maxp&&q.post))return R=new Pa(q["CFF "].data),L=new ra(R,l),this.convert(r,L,l);delete q.glyf,delete q.loca,delete q.fpgm,delete q.prep,delete q["cvt "],this.isOpenType=!0}q.maxp||a('Required "maxp" table is not found'),o.pos=(o.start||0)+q.maxp.offset;var N=o.getInt32(),j=o.getUint16(),z=0;if(N>=65536&&q.maxp.length>=22){o.pos+=8;var H=o.getUint16();H>2&&(q.maxp.data[14]=0,q.maxp.data[15]=2),o.pos+=4,z=o.getUint16()}var G=!1;"CIDFontType2"===l.type&&l.toUnicode&&l.toUnicode.get(0)>"\x00"&&(G=!0,j++,q.maxp.data[4]=j>>8,q.maxp.data[5]=255&j);var X=T(q.fpgm,q.prep,q["cvt "],z);if(X||(delete q.fpgm,delete q.prep,delete q["cvt "]),d(o,q.hhea,q.hmtx,j),q.head||a('Required "head" table is not found'),w(q.head,j,F?q.loca.length:0),F){var _=n(q.head.data[50],q.head.data[51]);x(q.loca,q.glyf,j,_,X,G)}if(q.hhea||a('Required "hhea" table is not found'),0===q.hhea.data[10]&&0===q.hhea.data[11]&&(q.hhea.data[10]=255,q.hhea.data[11]=255),q.post){var J=C(q.post,l,j);J||(q.post=null)}var V,W=[];if("CIDFontType2"===l.type){var K=l.cidToGidMap||[],Y=K.length;l.cMap.forEach(function(e,t){i(65535>=t,"Max size of CID is 65,535");var a=-1;0===Y?a=e:void 0!==K[t]&&(a=K[t]),a>=0&&j>a&&(W[e]=a)}),G&&(W[0]=j-1)}else{var Z=f(q.cmap,o,this.isSymbolicFont),Q=Z.platformId,$=Z.encodingId,ee=Z.mappings,te=ee.length,ae=l.differences.length||!!l.baseEncodingName;if(ae&&(3===Q&&1===$||1===Q&&0===$)||-1===Q&&-1===$&&Ut[l.baseEncodingName]){var re=[];for("MacRomanEncoding"!==l.baseEncodingName&&"WinAnsiEncoding"!==l.baseEncodingName||(re=Ut[l.baseEncodingName]),V=0;256>V;V++){var ie;if(ie=this.differences&&V in this.differences?this.differences[V]:V in re&&""!==re[V]?re[V]:Ut.StandardEncoding[V]){var ne;3===Q&&1===$?ne=ya[ie]:1===Q&&0===$&&(ne=Ut.MacRomanEncoding.indexOf(ie));var oe=!1;for(U=0;te>U;++U)if(ee[U].charCode===ne){W[V]=ee[U].glyphId,oe=!0;break}if(!oe&&l.glyphNames){var se=l.glyphNames.indexOf(ie);se>0&&(W[V]=se)}}}}else for(U=0;te>U;++U)V=255&ee[U].charCode,W[V]=ee[U].glyphId}0===W.length&&(W[0]=0);var ce=g(W,l);if(this.toFontChar=ce.toFontChar,q.cmap={tag:"cmap",data:p(ce.charCodeToGlyphId)},!q["OS/2"]||!b(q["OS/2"])){var le={unitsPerEm:n(q.head.data[18],q.head.data[19]),yMax:n(q.head.data[42],q.head.data[43]),yMin:n(q.head.data[38],q.head.data[39])-65536,ascent:n(q.hhea.data[4],q.hhea.data[5]),descent:n(q.hhea.data[6],q.hhea.data[7])-65536};q["OS/2"]={tag:"OS/2",data:v(l,ce.charCodeToGlyphId,le)}}if(q.post||(q.post={tag:"post",data:y(l)}),!F)try{R=new Pa(q["CFF "].data);var he=new ia(R,l);L=he.parse();var ue=new ba(L);q["CFF "].data=ue.compile()}catch(fe){t("Failed to compile font "+l.loadedName)}if(q.name){var de=S(q.name);q.name.data=k(r,de)}else q.name={tag:"name",data:k(this.name)};var ge=new Yt(D.version);for(var me in q)ge.addTable(me,q[me].data);return ge.toArray()},convert:function(e,t,a){function r(e,t){var a=null;for(var r in e)t===e[r]&&(a||(a=[]),a.push(0|r));return a}function i(e,t){for(var a in e)if(t===e[a])return 0|a;return o.charCodeToGlyphId[o.nextAvailableFontCharCode]=t,o.nextAvailableFontCharCode++}a.fixedPitch=!1;var n=t.getGlyphMapping(a),o=g(n,a);this.toFontChar=o.toFontChar;var s=t.numGlyphs,c=t.seacs;if(Et&&c&&c.length){var l=a.fontMatrix||H,f=t.getCharset(),d=Object.create(null);for(var m in c){m|=0;var b=c[m],w=Ut.StandardEncoding[b[2]],x=Ut.StandardEncoding[b[3]],C=f.indexOf(w),S=f.indexOf(x);if(!(0>C||0>S)){var A={x:b[0]*l[0]+b[1]*l[2]+l[4],y:b[0]*l[1]+b[1]*l[3]+l[5]},B=r(n,m);if(B)for(var I=0,T=B.length;T>I;I++){var O=B[I],L=o.charCodeToGlyphId,R=i(L,C),P=i(L,S);d[O]={baseFontCharCode:R,accentFontCharCode:P,accentOffset:A}}}}a.seacMap=d}var M=1/(a.fontMatrix||H)[0],D=new Yt("OTTO");return D.addTable("CFF ",t.data),D.addTable("OS/2",v(a,o.charCodeToGlyphId)),D.addTable("cmap",p(o.charCodeToGlyphId)),D.addTable("head","\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00_<õ\x00\x00"+u(M)+"\x00\x00\x00\x00\x0B~'\x00\x00\x00\x00\x0B~'\x00\x00"+u(a.descent)+"ÿ"+u(a.ascent)+h(a.italicAngle?2:0)+"\x00\x00\x00\x00\x00\x00\x00"),D.addTable("hhea","\x00\x00\x00"+u(a.ascent)+u(a.descent)+"\x00\x00ÿÿ\x00\x00\x00\x00\x00\x00"+u(a.capHeight)+u(Math.tan(a.italicAngle)*a.xHeight)+"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"+h(s)),D.addTable("hmtx",function(){for(var e=t.charstrings,a=t.cff?t.cff.widths:null,r="\x00\x00\x00\x00",i=1,n=s;n>i;i++){var o=0;if(e){var c=e[i-1];o="width"in c?c.width:0}else a&&(o=Math.ceil(a[i]||0));r+=h(o)+h(0)}return r}()),D.addTable("maxp","\x00\x00P\x00"+h(s)),D.addTable("name",k(e)),D.addTable("post",y(a)),D.toArray()},buildToUnicode:function(e){if(e.toUnicode&&0!==e.toUnicode.length)return e.toUnicode;var t,a;if(!e.composite){t=[];var r=e.defaultEncoding.slice(),n=e.baseEncodingName,o=e.differences;for(a in o)r[a]=o[a];for(a in r){var s=r[a];if(""!==s)if(void 0!==ya[s])t[a]=String.fromCharCode(ya[s]);else{var c=0;switch(s[0]){case"G":3===s.length&&(c=parseInt(s.substr(1),16));break;case"g":5===s.length&&(c=parseInt(s.substr(1),16));break;case"C":case"c":s.length>=3&&(c=+s.substr(1))}if(c){if(n&&c===+a){var l=Ut[n];if(l&&(s=l[a])){t[a]=String.fromCharCode(ya[s]);continue}}t[a]=String.fromCharCode(c)}}}return new Wt(t)}if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof It)||"Adobe"===e.cidSystemInfo.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){var h=e.cidSystemInfo.registry,u=e.cidSystemInfo.ordering,f=new ye(h+"-"+u+"-UCS2"),d=Ot.create(f,{url:PDFJS.cMapUrl,packed:PDFJS.cMapPacked},null),g=e.cMap;return t=[],g.forEach(function(e,a){i(65535>=a,"Max size of CID is 65,535");var r=d.lookup(a);r&&(t[e]=String.fromCharCode((r.charCodeAt(0)<<8)+r.charCodeAt(1)))}),new Wt(t)}return new Kt(e.firstChar,e.lastChar)},get spaceWidth(){if("_shadowWidth"in this)return this._shadowWidth;for(var e,t=["space","minus","one","i"],a=0,r=t.length;r>a;a++){var i=t[a];if(i in this.widths){e=this.widths[i];break}var n=ya[i],o=0;if(this.composite&&this.cMap.contains(n)&&(o=this.cMap.lookup(n)),!o&&"toUnicode"in this&&(o=this.toUnicode.charCodeOf(n)),0>=o&&(o=n),e=this.widths[o])break}return e=e||this.defaultWidth,this._shadowWidth=e,e},charToGlyph:function(e){var t,a,r,i=e;this.cMap&&this.cMap.contains(e)&&(i=this.cMap.lookup(e)),a=this.widths[i],a=w(a)?a:this.defaultWidth;var n=this.vmetrics&&this.vmetrics[i],o=this.toUnicode.get(e)||e;"number"==typeof o&&(o=String.fromCharCode(o)),t=this.toFontChar[e]||e,this.missingFile&&(t=M(t)),this.isType3Font&&(r=t);var s=null;if(this.seacMap&&this.seacMap[e]){var c=this.seacMap[e];t=c.baseFontCharCode,s={fontChar:String.fromCharCode(c.accentFontCharCode),offset:c.accentOffset}}var l=String.fromCharCode(t),h=this.glyphCache[e];return h&&h.matchesForCache(l,o,s,a,n,r)||(h=new Vt(l,o,s,a,n,r),this.glyphCache[e]=h),h},charsToGlyphs:function(e){var t,a,r,i=this.charsCache;if(i&&(t=i[e]))return t;i||(i=this.charsCache=Object.create(null)),t=[];var n,o=e,s=0;if(this.cMap)for(var c={};s<e.length;){this.cMap.readCharCode(e,s,c),r=c.charcode;var l=c.length;s+=l,a=this.charToGlyph(r),t.push(a),1===l&&32===e.charCodeAt(s-1)&&t.push(null)}else for(s=0,n=e.length;n>s;++s)r=e.charCodeAt(s),a=this.charToGlyph(r),t.push(a),32===r&&t.push(null);return i[o]=t}},r}(),Qt=function(){function e(e){this.error=e,this.loadedName="g_font_error",this.loading=!1}return e.prototype={charsToGlyphs:function(){return[]},exportData:function(){return{error:this.error}}},e}(),$t=function(){function e(){this.width=0,this.lsb=0,this.flexing=!1,this.output=[],this.stack=[]}var a={hstem:[1],vstem:[3],vmoveto:[4],rlineto:[5],hlineto:[6],vlineto:[7],rrcurveto:[8],callsubr:[10],flex:[12,35],drop:[12,18],endchar:[14],rmoveto:[21],hmoveto:[22],vhcurveto:[30],hvcurveto:[31]};return e.prototype={convert:function(e,r){for(var i,n,o,s=e.length,c=!1,l=0;s>l;l++){var h=e[l];if(32>h){switch(12===h&&(h=(h<<8)+e[++l]),h){case 1:if(!Dt){this.stack=[];break}c=this.executeCommand(2,a.hstem);break;case 3:if(!Dt){this.stack=[];break}c=this.executeCommand(2,a.vstem);break;case 4:if(this.flexing){if(this.stack.length<1){c=!0;break}var u=this.stack.pop();this.stack.push(0,u);break}c=this.executeCommand(1,a.vmoveto);break;case 5:c=this.executeCommand(2,a.rlineto);break;case 6:c=this.executeCommand(1,a.hlineto);break;case 7:c=this.executeCommand(1,a.vlineto);break;case 8:c=this.executeCommand(6,a.rrcurveto);break;case 9:this.stack=[];break;case 10:if(this.stack.length<1){c=!0;break}o=this.stack.pop(),c=this.convert(r[o],r);break;case 11:return c;case 13:if(this.stack.length<2){c=!0;break}i=this.stack.pop(),n=this.stack.pop(),this.lsb=n,this.width=i,this.stack.push(i,n),c=this.executeCommand(2,a.hmoveto);break;case 14:this.output.push(a.endchar[0]);break;case 21:if(this.flexing)break;c=this.executeCommand(2,a.rmoveto);break;case 22:if(this.flexing){this.stack.push(0);break}c=this.executeCommand(1,a.hmoveto);break;case 30:c=this.executeCommand(4,a.vhcurveto);break;case 31:c=this.executeCommand(4,a.hvcurveto);break;case 3072:this.stack=[];break;case 3073:if(!Dt){this.stack=[];break}c=this.executeCommand(2,a.vstem);break;case 3074:if(!Dt){this.stack=[];break}c=this.executeCommand(2,a.hstem);break;case 3078:Et?(this.seac=this.stack.splice(-4,4),c=this.executeCommand(0,a.endchar)):c=this.executeCommand(4,a.endchar);break;case 3079:if(this.stack.length<4){c=!0;break}this.stack.pop();i=this.stack.pop();var f=this.stack.pop();n=this.stack.pop(),this.lsb=n,this.width=i,this.stack.push(i,n,f),c=this.executeCommand(3,a.rmoveto);break;case 3084:if(this.stack.length<2){c=!0;break}var d=this.stack.pop(),g=this.stack.pop();this.stack.push(g/d);break;case 3088:if(this.stack.length<2){c=!0;break}o=this.stack.pop();var m=this.stack.pop();if(0===o&&3===m){var p=this.stack.splice(this.stack.length-17,17);this.stack.push(p[2]+p[0],p[3]+p[1],p[4],p[5],p[6],p[7],p[8],p[9],p[10],p[11],p[12],p[13],p[14]),c=this.executeCommand(13,a.flex,!0),this.flexing=!1,this.stack.push(p[15],p[16])}else 1===o&&0===m&&(this.flexing=!0);break;case 3089:break;case 3105:this.stack=[];break;default:t('Unknown type 1 charstring command of "'+h+'"')}if(c)break}else 246>=h?h-=139:h=250>=h?256*(h-247)+e[++l]+108:254>=h?-(256*(h-251))-e[++l]-108:(255&e[++l])<<24|(255&e[++l])<<16|(255&e[++l])<<8|(255&e[++l])<<0,this.stack.push(h)}return c},executeCommand:function(e,t,a){var r=this.stack.length;if(e>r)return!0;for(var i=r-e,n=i;r>n;n++){var o=this.stack[n];o===(0|o)?this.output.push(28,o>>8&255,255&o):(o=65536*o|0,this.output.push(255,o>>24&255,o>>16&255,o>>8&255,255&o))}return this.output.push.apply(this.output,t),a?this.stack.splice(i,e):this.stack.length=0,!1}},e}(),ea=function(){function e(e){return e>=48&&57>=e||e>=65&&70>=e||e>=97&&102>=e}function t(e,t,a){for(var r=0|t,i=52845,n=22719,o=e.length,s=new Uint8Array(o),c=0;o>c;c++){var l=e[c];s[c]=l^r>>8,r=(l+r)*i+n&65535}return Array.prototype.slice.call(s,a)}function a(t,a,r){var i,n,o=0|a,s=52845,c=22719,l=t.length,h=l>>>1,u=new Uint8Array(h);for(i=0,n=0;l>i;i++){var f=t[i];if(e(f)){i++;for(var d;l>i&&!e(d=t[i]);)i++;if(l>i){var g=parseInt(String.fromCharCode(f,d),16);u[n++]=g^o>>8,o=(g+o)*s+c&65535}}}return Array.prototype.slice.call(u,r,n)}function r(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}function i(r,i){if(i){var o=r.getBytes(),s=!(e(o[0])&&e(o[1])&&e(o[2])&&e(o[3]));r=new Pa(s?t(o,n,4):a(o,n,4))}this.stream=r,this.nextChar()}var n=55665,o=4330;return i.prototype={readNumberArray:function(){this.getToken();for(var e=[];;){var t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e},readNumber:function(){var e=this.getToken();return parseFloat(e||0)},readInt:function(){var e=this.getToken();return 0|parseInt(e||0,10)},readBoolean:function(){var e=this.getToken();return"true"===e?1:0},nextChar:function(){return this.currentChar=this.stream.getByte()},getToken:function(){for(var e=!1,t=this.currentChar;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!Ba.isSpace(t))break;t=this.nextChar()}if(r(t))return this.nextChar(),String.fromCharCode(t);var a="";do a+=String.fromCharCode(t),t=this.nextChar();while(t>=0&&!Ba.isSpace(t)&&!r(t));return a},extractFontProgram:function(){for(var e,a,r,i,n,s=this.stream,c=[],l=[],h={subrs:[],charstrings:[],properties:{privateData:{lenIV:4}}};null!==(e=this.getToken());)if("/"===e)switch(e=this.getToken()){case"CharStrings":for(this.getToken(),this.getToken(),this.getToken(),this.getToken();;){if(e=this.getToken(),null===e||"end"===e)break;if("/"===e){var u=this.getToken();a=this.readInt(),this.getToken(),r=s.makeSubStream(s.pos,a),i=h.properties.privateData.lenIV,n=t(r.getBytes(),o,i),s.skip(a),this.nextChar(),e=this.getToken(),"noaccess"===e&&this.getToken(),l.push({glyph:u,encoded:n})}}break;case"Subrs":this.readInt();for(this.getToken();"dup"===(e=this.getToken());){var f=this.readInt();a=this.readInt(),this.getToken(),r=s.makeSubStream(s.pos,a),i=h.properties.privateData.lenIV,n=t(r.getBytes(),o,i),s.skip(a),this.nextChar(),e=this.getToken(),"noaccess"===e&&this.getToken(),c[f]=n}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var d=this.readNumberArray();d.length>0&&d.length%2===0&&Dt&&(h.properties.privateData[e]=d);break;case"StemSnapH":case"StemSnapV":h.properties.privateData[e]=this.readNumberArray();break;case"StdHW":case"StdVW":h.properties.privateData[e]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":h.properties.privateData[e]=this.readNumber();break;case"ForceBold":h.properties.privateData[e]=this.readBoolean()}for(var g=0;g<l.length;g++){u=l[g].glyph,n=l[g].encoded;var m=new $t,p=m.convert(n,c),b=m.output;p&&(b=[14]),h.charstrings.push({glyphName:u,charstring:b,width:m.width,lsb:m.lsb,seac:m.seac})}return h},extractFontHeader:function(e){for(var t;null!==(t=this.getToken());)if("/"===t)switch(t=this.getToken()){case"FontMatrix":var a=this.readNumberArray();e.fontMatrix=a;break;case"Encoding":var r,i=this.getToken();if(/^\d+$/.test(i)){r=[];var n=0|parseInt(i,10);this.getToken();for(var o=0;n>o;o++){for(t=this.getToken();"dup"!==t&&"def"!==t;)if(t=this.getToken(),null===t)return;if("def"===t)break;var s=this.readInt();this.getToken();var c=this.getToken();r[s]=c,this.getToken()}}else r=Ut[i];e.builtInEncoding=r;break;case"FontBBox":var l=this.readNumberArray();e.ascent=l[3],e.descent=l[1],e.ascentScaled=!0}}},i}(),ta=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],aa=function(e,t,a){
var r=6,i=a.length1,n=a.length2,o=t.peekBytes(r),s=128===o[0]&&1===o[1];s&&(t.skip(r),i=o[5]<<24|o[4]<<16|o[3]<<8|o[2]);var c=new Pa(t.getBytes(i)),l=new ea(c);l.extractFontHeader(a),s&&(o=t.getBytes(r),n=o[5]<<24|o[4]<<16|o[3]<<8|o[2]);var h=new Pa(t.getBytes(n)),u=new ea(h,!0),f=u.extractFontProgram();for(var d in f.properties)a[d]=f.properties[d];var g=f.charstrings,m=this.getType2Charstrings(g),p=this.getType2Subrs(f.subrs);this.charstrings=g,this.data=this.wrap(e,m,this.charstrings,p,a),this.seacs=this.getSeacs(f.charstrings)};aa.prototype={get numGlyphs(){return this.charstrings.length+1},getCharset:function(){for(var e=[".notdef"],t=this.charstrings,a=0;a<t.length;a++)e.push(t[a].glyphName);return e},getGlyphMapping:function(e){var t,a=this.charstrings,r=[".notdef"];for(t=0;t<a.length;t++)r.push(a[t].glyphName);var i=e.builtInEncoding;if(i){var n={};for(var o in i)t=r.indexOf(i[o]),t>=0&&(n[o]=t)}return N(e,n,r)},getSeacs:function(e){var t,a,r=[];for(t=0,a=e.length;a>t;t++){var i=e[t];i.seac&&(r[t+1]=i.seac)}return r},getType2Charstrings:function(e){for(var t=[],a=0,r=e.length;r>a;a++)t.push(e[a].charstring);return t},getType2Subrs:function(e){var t=0,a=e.length;t=1133>a?107:33769>a?1131:32768;var r,i=[];for(r=0;t>r;r++)i.push([11]);for(r=0;a>r;r++)i.push(e[r]);return i},wrap:function(e,t,a,r,i){var n=new na;n.header=new oa(1,0,4,4),n.names=[e];var o=new ha;o.setByName("version",391),o.setByName("Notice",392),o.setByName("FullName",393),o.setByName("FamilyName",394),o.setByName("Weight",395),o.setByName("Encoding",null),o.setByName("FontMatrix",i.fontMatrix),o.setByName("FontBBox",i.bbox),o.setByName("charset",null),o.setByName("CharStrings",null),o.setByName("Private",null),n.topDict=o;var s=new sa;s.add("Version 0.11"),s.add("See original notice"),s.add(e),s.add(e),s.add("Medium"),n.strings=s,n.globalSubrIndex=new ca;var c,l,h=t.length,u=[0];for(c=0;h>c;c++){var f=ta.indexOf(a[c].glyphName);-1===f&&(f=0),u.push(f>>8&255,255&f)}n.charset=new da(!1,0,[],u);var d=new ca;for(d.add([139,14]),c=0;h>c;c++)d.add(t[c]);n.charStrings=d;var g=new ua;g.setByName("Subrs",null);var m=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(c=0,l=m.length;l>c;c++){var p=m[c];if(i.privateData.hasOwnProperty(p)){var b=i.privateData[p];if(B(b))for(var v=b.length-1;v>0;v--)b[v]-=b[v-1];g.setByName(p,b)}}n.topDict.privateDict=g;var y=new ca;for(c=0,l=r.length;l>c;c++)y.add(r[c]);g.subrsIndex=y;var k=new ba(n);return k.compile()}};var ra=function(){function e(e,a){this.properties=a;var r=new ia(e,a);this.cff=r.parse();var i=new ba(this.cff);this.seacs=this.cff.seacs;try{this.data=i.compile()}catch(n){t("Failed to compile font "+a.loadedName),this.data=e}}return e.prototype={get numGlyphs(){return this.cff.charStrings.count},getCharset:function(){return this.cff.charset.charset},getGlyphMapping:function(){var e,t,a=this.cff,r=this.properties,i=a.charset.charset;if(r.composite){if(e=Object.create(null),a.isCIDFont)for(t=0;t<i.length;t++){var n=i[t],o=r.cMap.charCodeOf(n);e[o]=t}else for(t=0;t<a.charStrings.count;t++)e[t]=t;return e}var s=a.encoding?a.encoding.encoding:null;return e=N(r,s,i)}},e}(),ia=function(){function r(e,t){this.bytes=e.getBytes(),this.properties=t}var i=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],n=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn:function(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn:function(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];return r.prototype={parse:function(){var e=this.properties,t=new na;this.cff=t;var a=this.parseHeader(),r=this.parseIndex(a.endPos),i=this.parseIndex(r.endPos),n=this.parseIndex(i.endPos),o=this.parseIndex(n.endPos),s=this.parseDict(i.obj.get(0)),c=this.createDict(ha,s,t.strings);t.header=a.obj,t.names=this.parseNameIndex(r.obj),t.strings=this.parseStringIndex(n.obj),t.topDict=c,t.globalSubrIndex=o.obj,this.parsePrivateDict(t.topDict),t.isCIDFont=c.hasName("ROS");var l=c.getByName("CharStrings"),h=this.parseCharStrings(l);t.charStrings=h.charStrings,t.seacs=h.seacs,t.widths=h.widths;var u=c.getByName("FontMatrix");u&&(e.fontMatrix=u);var f=c.getByName("FontBBox");f&&(e.ascent=f[3],e.descent=f[1],e.ascentScaled=!0);var d,g;if(t.isCIDFont){for(var m=this.parseIndex(c.getByName("FDArray")).obj,p=0,b=m.count;b>p;++p){var v=m.get(p),y=this.createDict(ha,this.parseDict(v),t.strings);this.parsePrivateDict(y),t.fdArray.push(y)}g=null,d=this.parseCharsets(c.getByName("charset"),t.charStrings.count,t.strings,!0),t.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),t.charStrings.count)}else d=this.parseCharsets(c.getByName("charset"),t.charStrings.count,t.strings,!1),g=this.parseEncoding(c.getByName("Encoding"),e,t.strings,d.charset);return t.charset=d,t.encoding=g,t},parseHeader:function(){for(var t=this.bytes,r=t.length,i=0;r>i&&1!==t[i];)++i;i>=r?a("Invalid CFF header"):0!==i&&(e("cff data is shifted"),t=t.subarray(i),this.bytes=t);var n=t[0],o=t[1],s=t[2],c=t[3],l=new oa(n,o,s,c);return{obj:l,endPos:s}},parseDict:function(e){function t(){var t=e[i++];return 30===t?r(i):28===t?(t=e[i++],t=(t<<24|e[i++]<<16)>>16):29===t?(t=e[i++],t=t<<8|e[i++],t=t<<8|e[i++],t=t<<8|e[i++]):t>=32&&246>=t?t-139:t>=247&&250>=t?256*(t-247)+e[i++]+108:t>=251&&254>=t?-(256*(t-251))-e[i++]-108:(a("255 is not a valid DICT command"),-1)}function r(){for(var t="",a=15,r=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],n=e.length;n>i;){var o=e[i++],s=o>>4,c=15&o;if(s===a)break;if(t+=r[s],c===a)break;t+=r[c]}return parseFloat(t)}var i=0,n=[],o=[];i=0;for(var s=e.length;s>i;){var c=e[i];21>=c?(12===c&&(c=c<<8|e[++i]),o.push([c,n]),n=[],++i):n.push(t())}return o},parseIndex:function(e){var t,a,r=new ca,i=this.bytes,n=i[e++]<<8|i[e++],o=[],s=e;if(0!==n){var c=i[e++],l=e+(n+1)*c-1;for(t=0,a=n+1;a>t;++t){for(var h=0,u=0;c>u;++u)h<<=8,h+=i[e++];o.push(l+h)}s=o[n]}for(t=0,a=o.length-1;a>t;++t){var f=o[t],d=o[t+1];r.add(i.subarray(f,d))}return{obj:r,endPos:s}},parseNameIndex:function(e){for(var t=[],a=0,r=e.count;r>a;++a){for(var i=e.get(a),n=Math.min(i.length,127),o=[],c=0;n>c;++c){var l=i[c];(0!==c||0!==l)&&(33>l||l>126||91===l||93===l||40===l||41===l||123===l||125===l||60===l||62===l||47===l||37===l||35===l)?o[c]=95:o[c]=l}t.push(s(o))}return t},parseStringIndex:function(e){for(var t=new sa,a=0,r=e.count;r>a;++a){var i=e.get(a);t.add(s(i))}return t},createDict:function(e,t,a){for(var r=new e(a),i=0,n=t.length;n>i;++i){var o=t[i],s=o[0],c=o[1];r.setByKey(s,c)}return r},parseCharStrings:function(e){for(var a=this.parseIndex(e).obj,r=[],o=[],s=a.count,c=0;s>c;c++){for(var l=a.get(c),h=0,u=[],f=!0,d=0,g=!0,m=l,p=m.length,b=!0,v=0;p>v;){var y=m[v++],k=null;if(12===y){var w=m[v++];0===w?(m[v-2]=139,m[v-1]=22,h=0):k=n[w]}else 28===y?(u[h]=(m[v]<<24|m[v+1]<<16)>>16,v+=2,h++):14===y?(h>=4&&(h-=4,Et&&(r[c]=u.slice(h,h+4),g=!1)),k=i[y]):y>=32&&246>=y?(u[h]=y-139,h++):y>=247&&254>=y?(u[h]=251>y?(y-247<<8)+m[v]+108:-(y-251<<8)-m[v]-108,v++,h++):255===y?(u[h]=(m[v]<<24|m[v+1]<<16|m[v+2]<<8|m[v+3])/65536,v+=4,h++):19===y||20===y?(d+=h>>1,v+=d+7>>3,h%=2,k=i[y]):k=i[y];if(k){if(k.stem&&(d+=h>>1),"min"in k&&!f&&h<k.min){t("Not enough parameters for "+k.id+"; actual: "+h+", expected: "+k.min),g=!1;break}b&&k.stackClearing&&(b=!1,h-=k.min,h>=2&&k.stem?h%=2:h>1&&t("Found too many parameters for stack-clearing command"),h>0&&u[h-1]>=0&&(o[c]=u[h-1])),"stackDelta"in k?("stackFn"in k&&k.stackFn(u,h),h+=k.stackDelta):k.stackClearing?h=0:k.resetStack?(h=0,f=!1):k.undefStack&&(h=0,f=!0,b=!1)}}g||a.set(c,new Uint8Array([14]))}return{charStrings:a,seacs:r,widths:o}},emptyPrivateDictionary:function(e){var t=this.createDict(ua,[],e.strings);e.setByKey(18,[0,0]),e.privateDict=t},parsePrivateDict:function(e){if(!e.hasName("Private"))return void this.emptyPrivateDictionary(e);var t=e.getByName("Private");if(!B(t)||2!==t.length)return void e.removeByName("Private");var a=t[0],r=t[1];if(0===a||r>=this.bytes.length)return void this.emptyPrivateDictionary(e);var i=r+a,n=this.bytes.subarray(r,i),o=this.parseDict(n),s=this.createDict(ua,o,e.strings);if(e.privateDict=s,s.getByName("Subrs")){var c=s.getByName("Subrs"),l=r+c;if(0===c||l>=this.bytes.length)return void this.emptyPrivateDictionary(e);var h=this.parseIndex(l);s.subrsIndex=h.obj}},parseCharsets:function(e,t,r,i){if(0===e)return new da(!0,fa.ISO_ADOBE,Le);if(1===e)return new da(!0,fa.EXPERT,Re);if(2===e)return new da(!0,fa.EXPERT_SUBSET,Pe);var n,o,s,c=this.bytes,l=e,h=c[e++],u=[".notdef"];switch(t-=1,h){case 0:for(s=0;t>s;s++)n=c[e++]<<8|c[e++],u.push(i?n:r.get(n));break;case 1:for(;u.length<=t;)for(n=c[e++]<<8|c[e++],o=c[e++],s=0;o>=s;s++)u.push(i?n++:r.get(n++));break;case 2:for(;u.length<=t;)for(n=c[e++]<<8|c[e++],o=c[e++]<<8|c[e++],s=0;o>=s;s++)u.push(i?n++:r.get(n++));break;default:a("Unknown charset format")}var f=e,d=c.subarray(l,f);return new da(!1,h,u,d)},parseEncoding:function(e,t,r,i){function n(){var t=h[e++];for(s=0;t>s;s++){var a=h[e++],n=(h[e++]<<8)+(255&h[e++]);l[a]=i.indexOf(r.get(n))}}var o,s,c,l={},h=this.bytes,u=!1,f=!1,d=null;if(0===e||1===e){u=!0,o=e;var g=e?Ut.ExpertEncoding:Ut.StandardEncoding;for(s=0,c=i.length;c>s;s++){var m=g.indexOf(i[s]);-1!==m&&(l[m]=s)}}else{var p=e;switch(o=h[e++],127&o){case 0:var b=h[e++];for(s=1;b>=s;s++)l[h[e++]]=s;break;case 1:var v=h[e++],y=1;for(s=0;v>s;s++)for(var k=h[e++],w=h[e++],x=k;k+w>=x;x++)l[x]=y++;break;default:a("Unknow encoding format: "+o+" in CFF")}var C=e;128&o&&(h[p]&=127,n(),f=!0),d=h.subarray(p,C)}return o=127&o,new ga(u,o,l,d)},parseFDSelect:function(e,t){var r,i=e,n=this.bytes,o=n[e++],s=[];switch(o){case 0:for(r=0;t>r;++r){var c=n[e++];s.push(c)}break;case 3:var l=n[e++]<<8|n[e++];for(r=0;l>r;++r)for(var h=n[e++]<<8|n[e++],u=n[e++],f=n[e]<<8|n[e+1],d=h;f>d;++d)s.push(u);e+=2;break;default:a("Unknown fdselect format "+o)}var g=e;return new ma(s,n.subarray(i,g))}},r}(),na=function(){function e(){this.header=null,this.names=[],this.topDict=null,this.strings=new sa,this.globalSubrIndex=null,this.encoding=null,this.charset=null,this.charStrings=null,this.fdArray=[],this.fdSelect=null,this.isCIDFont=!1}return e}(),oa=function(){function e(e,t,a,r){this.major=e,this.minor=t,this.hdrSize=a,this.offSize=r}return e}(),sa=function(){function e(){this.strings=[]}return e.prototype={get:function(e){return e>=0&&390>=e?ta[e]:e-391<=this.strings.length?this.strings[e-391]:ta[0]},add:function(e){this.strings.push(e)},get count(){return this.strings.length}},e}(),ca=function(){function e(){this.objects=[],this.length=0}return e.prototype={add:function(e){this.length+=e.length,this.objects.push(e)},set:function(e,t){this.length+=t.length-this.objects[e].length,this.objects[e]=t},get:function(e){return this.objects[e]},get count(){return this.objects.length}},e}(),la=function(){function e(e,t){this.keyToNameMap=e.keyToNameMap,this.nameToKeyMap=e.nameToKeyMap,this.defaults=e.defaults,this.types=e.types,this.opcodes=e.opcodes,this.order=e.order,this.strings=t,this.values={}}return e.prototype={setByKey:function(e,t){if(!(e in this.keyToNameMap))return!1;if(0===t.length)return!0;var a=this.types[e];return"num"!==a&&"sid"!==a&&"offset"!==a||(t=t[0]),this.values[e]=t,!0},setByName:function(e,t){e in this.nameToKeyMap||a('Invalid dictionary name "'+e+'"'),this.values[this.nameToKeyMap[e]]=t},hasName:function(e){return this.nameToKeyMap[e]in this.values},getByName:function(e){e in this.nameToKeyMap||a('Invalid dictionary name "'+e+'"');var t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]},removeByName:function(e){delete this.values[this.nameToKeyMap[e]]}},e.createTables=function(e){for(var t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]},a=0,r=e.length;r>a;++a){var i=e[a],n=B(i[0])?(i[0][0]<<8)+i[0][1]:i[0];t.keyToNameMap[n]=i[1],t.nameToKeyMap[i[1]]=n,t.types[n]=i[2],t.defaults[n]=i[3],t.opcodes[n]=B(i[0])?i[0]:[i[0]],t.order.push(n)}return t},e}(),ha=function(){function e(e){null===a&&(a=la.createTables(t)),la.call(this,a,e),this.privateDict=null}var t=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]],a=null;return e.prototype=Object.create(la.prototype),e}(),ua=function(){function e(e){null===a&&(a=la.createTables(t)),la.call(this,a,e),this.subrsIndex=null}var t=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]],a=null;return e.prototype=Object.create(la.prototype),e}(),fa={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2},da=function(){function e(e,t,a,r){this.predefined=e,this.format=t,this.charset=a,this.raw=r}return e}(),ga=function(){function e(e,t,a,r){this.predefined=e,this.format=t,this.encoding=a,this.raw=r}return e}(),ma=function(){function e(e,t){this.fdSelect=e,this.raw=t}return e}(),pa=function(){function e(){this.offsets={}}return e.prototype={isTracking:function(e){return e in this.offsets},track:function(e,t){e in this.offsets&&a("Already tracking location of "+e),this.offsets[e]=t},offset:function(e){for(var t in this.offsets)this.offsets[t]+=e},setEntryLocation:function(e,t,r){e in this.offsets||a("Not tracking location of "+e);for(var i=r.data,n=this.offsets[e],o=5,s=0,c=t.length;c>s;++s){var l=s*o+n,h=l+1,u=l+2,f=l+3,d=l+4;29===i[l]&&0===i[h]&&0===i[u]&&0===i[f]&&0===i[d]||a("writing to an offset that is not empty");var g=t[s];i[l]=29,i[h]=g>>24&255,i[u]=g>>16&255,i[f]=g>>8&255,i[d]=255&g}}},e}(),ba=function(){function e(e){this.cff=e}return e.prototype={compile:function(){var e=this.cff,t={data:[],length:0,add:function(e){this.data=this.data.concat(e),this.length=this.data.length}},a=this.compileHeader(e.header);t.add(a);var r=this.compileNameIndex(e.names);if(t.add(r),e.isCIDFont&&e.topDict.hasName("FontMatrix")){var i=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(var n=0,o=e.fdArray.length;o>n;n++){var s=e.fdArray[n],c=i.slice(0);s.hasName("FontMatrix")&&(c=ce.transform(c,s.getByName("FontMatrix"))),s.setByName("FontMatrix",c)}}var l=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(l.output);var h=l.trackers[0],u=this.compileStringIndex(e.strings.strings);t.add(u);var f=this.compileIndex(e.globalSubrIndex);if(t.add(f),e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)h.setEntryLocation("Encoding",[e.encoding.format],t);else{var d=this.compileEncoding(e.encoding);h.setEntryLocation("Encoding",[t.length],t),t.add(d)}if(e.charset&&e.topDict.hasName("charset"))if(e.charset.predefined)h.setEntryLocation("charset",[e.charset.format],t);else{var g=this.compileCharset(e.charset);h.setEntryLocation("charset",[t.length],t),t.add(g)}var m=this.compileCharStrings(e.charStrings);if(h.setEntryLocation("CharStrings",[t.length],t),t.add(m),e.isCIDFont){h.setEntryLocation("FDSelect",[t.length],t);var p=this.compileFDSelect(e.fdSelect.raw);t.add(p),l=this.compileTopDicts(e.fdArray,t.length,!0),h.setEntryLocation("FDArray",[t.length],t),t.add(l.output);var b=l.trackers;this.compilePrivateDicts(e.fdArray,b,t)}return this.compilePrivateDicts([e.topDict],[h],t),t.add([0]),t.data},encodeNumber:function(e){return parseFloat(e)!==parseInt(e,10)||isNaN(e)?this.encodeFloat(e):this.encodeInteger(e)},encodeFloat:function(e){var t=e.toString(),a=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);if(a){var r=parseFloat("1e"+((a[2]?+a[2]:0)+a[1].length));t=(Math.round(e*r)/r).toString()}var i,n,o="";for(i=0,n=t.length;n>i;++i){var s=t[i];o+="e"===s?"-"===t[++i]?"c":"b":"."===s?"a":"-"===s?"e":s}o+=1&o.length?"f":"ff";var c=[30];for(i=0,n=o.length;n>i;i+=2)c.push(parseInt(o.substr(i,2),16));return c},encodeInteger:function(e){var t;return e>=-107&&107>=e?t=[e+139]:e>=108&&1131>=e?(e=[e-108],t=[(e>>8)+247,255&e]):e>=-1131&&-108>=e?(e=-e-108,t=[(e>>8)+251,255&e]):t=e>=-32768&&32767>=e?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e],t},compileHeader:function(e){return[e.major,e.minor,e.hdrSize,e.offSize]},compileNameIndex:function(e){for(var t=new ca,a=0,r=e.length;r>a;++a)t.add(c(e[a]));return this.compileIndex(t)},compileTopDicts:function(e,t,a){for(var r=[],i=new ca,n=0,o=e.length;o>n;++n){var s=e[n];a&&(s.removeByName("CIDFontVersion"),s.removeByName("CIDFontRevision"),s.removeByName("CIDFontType"),s.removeByName("CIDCount"),s.removeByName("UIDBase"));var c=new pa,l=this.compileDict(s,c);r.push(c),i.add(l),c.offset(t)}return i=this.compileIndex(i,r),{trackers:r,output:i}},compilePrivateDicts:function(e,t,a){for(var r=0,n=e.length;n>r;++r){var o=e[r];i(o.privateDict&&o.hasName("Private"),"There must be an private dictionary.");var s=o.privateDict,c=new pa,l=this.compileDict(s,c),h=a.length;if(c.offset(h),l.length||(h=0),t[r].setEntryLocation("Private",[l.length,h],a),a.add(l),s.subrsIndex&&s.hasName("Subrs")){var u=this.compileIndex(s.subrsIndex);c.setEntryLocation("Subrs",[l.length],a),a.add(u)}}},compileDict:function(e,t){for(var r=[],i=e.order,n=0;n<i.length;++n){var o=i[n];if(o in e.values){var s=e.values[o],c=e.types[o];if(B(c)||(c=[c]),B(s)||(s=[s]),0!==s.length){for(var l=0,h=c.length;h>l;++l){var u=c[l],f=s[l];switch(u){case"num":case"sid":r=r.concat(this.encodeNumber(f));break;case"offset":var d=e.keyToNameMap[o];t.isTracking(d)||t.track(d,r.length),r=r.concat([29,0,0,0,0]);break;case"array":case"delta":r=r.concat(this.encodeNumber(f));for(var g=1,m=s.length;m>g;++g)r=r.concat(this.encodeNumber(s[g]));break;default:a("Unknown data type of "+u)}}r=r.concat(e.opcodes[o])}}}return r},compileStringIndex:function(e){for(var t=new ca,a=0,r=e.length;r>a;++a)t.add(c(e[a]));return this.compileIndex(t)},compileGlobalSubrIndex:function(){var e=this.cff.globalSubrIndex;this.out.writeByteArray(this.compileIndex(e))},compileCharStrings:function(e){return this.compileIndex(e)},compileCharset:function(e){return this.compileTypedArray(e.raw)},compileEncoding:function(e){return this.compileTypedArray(e.raw)},compileFDSelect:function(e){return this.compileTypedArray(e)},compileTypedArray:function(e){for(var t=[],a=0,r=e.length;r>a;++a)t[a]=e[a];return t},compileIndex:function(e,t){t=t||[];var a=e.objects,r=a.length;if(0===r)return[0,0,0];var i,n=[r>>8&255,255&r],o=1;for(i=0;r>i;++i)o+=a[i].length;var s;s=256>o?1:65536>o?2:16777216>o?3:4,n.push(s);var c=1;for(i=0;r+1>i;i++)1===s?n.push(255&c):2===s?n.push(c>>8&255,255&c):3===s?n.push(c>>16&255,c>>8&255,255&c):n.push(c>>>24&255,c>>16&255,c>>8&255,255&c),a[i]&&(c+=a[i].length);for(i=0;r>i;i++){t[i]&&t[i].offset(n.length);for(var l=0,h=a[i].length;h>l;l++)n.push(a[i][l])}return n}},e}();!function(){/Windows/.test(navigator.userAgent)&&(Et=!0)}(),function(){/Windows.*Chrome/.test(navigator.userAgent)&&(Pt=!0)}();var va=function(){function e(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function t(e,t){return e[t]<<8|e[t+1]}function r(r,i,n){var o,s,c,l,h=1===t(r,i+2)?e(r,i+8):e(r,i+16),u=t(r,i+h);if(4===u){o=t(r,i+h+2);var f=t(r,i+h+6)>>1;for(c=i+h+14,s=[],l=0;f>l;l++,c+=2)s[l]={end:t(r,c)};for(c+=2,l=0;f>l;l++,c+=2)s[l].start=t(r,c);for(l=0;f>l;l++,c+=2)s[l].idDelta=t(r,c);for(l=0;f>l;l++,c+=2){var d=t(r,c);if(0!==d){s[l].ids=[];for(var g=0,m=s[l].end-s[l].start+1;m>g;g++)s[l].ids[g]=t(r,c+d),d+=2}}return s}if(12===u){o=e(r,i+h+4);var p=e(r,i+h+12);for(c=i+h+16,s=[],l=0;p>l;l++)s.push({start:e(r,c),end:e(r,c+4),idDelta:e(r,c+8)-e(r,c)}),c+=12;return s}a("not supported cmap: "+u)}function i(e,t,a){var r={},i=new ia(new Pa(e,t,a-t),r),n=i.parse();return{glyphs:n.charStrings.objects,subrs:n.topDict.privateDict&&n.topDict.privateDict.subrsIndex&&n.topDict.privateDict.subrsIndex.objects,gsubrs:n.globalSubrIndex&&n.globalSubrIndex.objects}}function n(e,t,a){var r,i;a?(r=4,i=function(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}):(r=2,i=function(e,t){return e[t]<<9|e[t+1]<<1});for(var n=[],o=i(t,0),s=r;s<t.length;s+=r){var c=i(t,s);n.push(e.subarray(o,c)),o=c}return n}function o(e,t){for(var a=t.charCodeAt(0),r=0,i=e.length-1;i>r;){var n=r+i+1>>1;a<e[n].start?i=n-1:r=n}return e[r].start<=a&&a<=e[r].end?e[r].idDelta+(e[r].ids?e[r].ids[a-e[r].start]:a)&65535:0}function c(e,t,a){function r(e,a){t.push("c.moveTo("+e+","+a+");")}function i(e,a){t.push("c.lineTo("+e+","+a+");")}function n(e,a,r,i){t.push("c.quadraticCurveTo("+e+","+a+","+r+","+i+");")}var o,s=0,l=(e[s]<<24|e[s+1]<<16)>>16,h=0,u=0;if(s+=10,0>l){do{o=e[s]<<8|e[s+1];var f=e[s+2]<<8|e[s+3];s+=4;var d,g;1&o?(d=(e[s]<<24|e[s+1]<<16)>>16,g=(e[s+2]<<24|e[s+3]<<16)>>16,s+=4):(d=e[s++],g=e[s++]),2&o?(h=d,u=g):(h=0,u=0);var m=1,p=1,b=0,v=0;8&o?(m=p=(e[s]<<24|e[s+1]<<16)/1073741824,s+=2):64&o?(m=(e[s]<<24|e[s+1]<<16)/1073741824,p=(e[s+2]<<24|e[s+3]<<16)/1073741824,s+=4):128&o&&(m=(e[s]<<24|e[s+1]<<16)/1073741824,b=(e[s+2]<<24|e[s+3]<<16)/1073741824,v=(e[s+4]<<24|e[s+5]<<16)/1073741824,p=(e[s+6]<<24|e[s+7]<<16)/1073741824,s+=8);var y=a.glyphs[f];y&&(t.push("c.save();"),t.push("c.transform("+m+","+b+","+v+","+p+","+h+","+u+");"),c(y,t,a),t.push("c.restore();"))}while(32&o)}else{var k,w,x=[];for(k=0;l>k;k++)x.push(e[s]<<8|e[s+1]),s+=2;var C=e[s]<<8|e[s+1];s+=2+C;for(var S=x[x.length-1]+1,A=[];A.length<S;){o=e[s++];var B=1;for(8&o&&(B+=e[s++]);B-- >0;)A.push({flags:o})}for(k=0;S>k;k++){switch(18&A[k].flags){case 0:h+=(e[s]<<24|e[s+1]<<16)>>16,s+=2;break;case 2:h-=e[s++];break;case 18:h+=e[s++]}A[k].x=h}for(k=0;S>k;k++){switch(36&A[k].flags){case 0:u+=(e[s]<<24|e[s+1]<<16)>>16,s+=2;break;case 4:u-=e[s++];break;case 36:u+=e[s++]}A[k].y=u}var I=0;for(s=0;l>s;s++){var T=x[s],O=A.slice(I,T+1);if(1&O[0].flags)O.push(O[0]);else if(1&O[O.length-1].flags)O.unshift(O[O.length-1]);else{var L={flags:1,x:(O[0].x+O[O.length-1].x)/2,y:(O[0].y+O[O.length-1].y)/2};O.unshift(L),O.push(L)}for(r(O[0].x,O[0].y),k=1,w=O.length;w>k;k++)1&O[k].flags?i(O[k].x,O[k].y):1&O[k+1].flags?(n(O[k].x,O[k].y,O[k+1].x,O[k+1].y),k++):n(O[k].x,O[k].y,(O[k].x+O[k+1].x)/2,(O[k].y+O[k+1].y)/2);I=T+1}}}function l(e,t,r){function i(e,a){t.push("c.moveTo("+e+","+a+");")}function n(e,a){t.push("c.lineTo("+e+","+a+");")}function s(e,a,r,i,n,o){t.push("c.bezierCurveTo("+e+","+a+","+r+","+i+","+n+","+o+");")}function c(e){for(var g=0;g<e.length;){var m,p,b,v,y,k,w,x,C,S=!1,A=e[g++];switch(A){case 1:d+=h.length>>1,S=!0;break;case 3:d+=h.length>>1,S=!0;break;case 4:f+=h.pop(),i(u,f),S=!0;break;case 5:for(;h.length>0;)u+=h.shift(),f+=h.shift(),n(u,f);break;case 6:for(;h.length>0&&(u+=h.shift(),n(u,f),0!==h.length);)f+=h.shift(),n(u,f);break;case 7:for(;h.length>0&&(f+=h.shift(),n(u,f),0!==h.length);)u+=h.shift(),n(u,f);break;case 8:for(;h.length>0;)m=u+h.shift(),b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+h.shift(),s(m,b,p,v,u,f);break;case 10:x=h.pop()+r.subrsBias,C=r.subrs[x],C&&c(C);break;case 11:return;case 12:switch(A=e[g++]){case 34:m=u+h.shift(),p=m+h.shift(),y=f+h.shift(),u=p+h.shift(),s(m,f,p,y,u,y),m=u+h.shift(),p=m+h.shift(),u=p+h.shift(),s(m,y,p,f,u,f);break;case 35:m=u+h.shift(),b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+h.shift(),s(m,b,p,v,u,f),m=u+h.shift(),b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+h.shift(),s(m,b,p,v,u,f),h.pop();break;case 36:m=u+h.shift(),y=f+h.shift(),p=m+h.shift(),k=y+h.shift(),u=p+h.shift(),s(m,y,p,k,u,k),m=u+h.shift(),p=m+h.shift(),w=k+h.shift(),u=p+h.shift(),s(m,k,p,w,u,f);break;case 37:var B=u,I=f;m=u+h.shift(),b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+h.shift(),s(m,b,p,v,u,f),m=u+h.shift(),b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p,f=v,Math.abs(u-B)>Math.abs(f-I)?u+=h.shift():f+=h.shift(),s(m,b,p,v,u,f);break;default:a("unknown operator: 12 "+A)}break;case 14:if(h.length>=4){var T=h.pop(),O=h.pop();f=h.pop(),u=h.pop(),t.push("c.save();"),t.push("c.translate("+u+","+f+");");var L=o(r.cmap,String.fromCharCode(r.glyphNameMap[Ut.StandardEncoding[T]]));l(r.glyphs[L],t,r),t.push("c.restore();"),L=o(r.cmap,String.fromCharCode(r.glyphNameMap[Ut.StandardEncoding[O]])),l(r.glyphs[L],t,r)}return;case 18:d+=h.length>>1,S=!0;break;case 19:d+=h.length>>1,g+=d+7>>3,S=!0;break;case 20:d+=h.length>>1,g+=d+7>>3,S=!0;break;case 21:f+=h.pop(),u+=h.pop(),i(u,f),S=!0;break;case 22:u+=h.pop(),i(u,f),S=!0;break;case 23:d+=h.length>>1,S=!0;break;case 24:for(;h.length>2;)m=u+h.shift(),b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+h.shift(),s(m,b,p,v,u,f);u+=h.shift(),f+=h.shift(),n(u,f);break;case 25:for(;h.length>6;)u+=h.shift(),f+=h.shift(),n(u,f);m=u+h.shift(),b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+h.shift(),s(m,b,p,v,u,f);break;case 26:for(h.length%2&&(u+=h.shift());h.length>0;)m=u,b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p,f=v+h.shift(),s(m,b,p,v,u,f);break;case 27:for(h.length%2&&(f+=h.shift());h.length>0;)m=u+h.shift(),b=f,p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v,s(m,b,p,v,u,f);break;case 28:h.push((e[g]<<24|e[g+1]<<16)>>16),g+=2;break;case 29:x=h.pop()+r.gsubrsBias,C=r.gsubrs[x],C&&c(C);break;case 30:for(;h.length>0&&(m=u,b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+(1===h.length?h.shift():0),s(m,b,p,v,u,f),0!==h.length);)m=u+h.shift(),b=f,p=m+h.shift(),v=b+h.shift(),f=v+h.shift(),u=p+(1===h.length?h.shift():0),s(m,b,p,v,u,f);break;case 31:for(;h.length>0&&(m=u+h.shift(),b=f,p=m+h.shift(),v=b+h.shift(),f=v+h.shift(),u=p+(1===h.length?h.shift():0),s(m,b,p,v,u,f),0!==h.length);)m=u,b=f+h.shift(),p=m+h.shift(),v=b+h.shift(),u=p+h.shift(),f=v+(1===h.length?h.shift():0),s(m,b,p,v,u,f);break;default:32>A&&a("unknown operator: "+A),247>A?h.push(A-139):251>A?h.push(256*(A-247)+e[g++]+108):255>A?h.push(256*-(A-251)-e[g++]-108):(h.push((e[g]<<24|e[g+1]<<16|e[g+2]<<8|e[g+3])/65536),g+=4)}S&&(h.length=0)}}var h=[],u=0,f=0,d=0;c(e)}function h(e){this.compiledGlyphs={},this.fontMatrix=e}function u(e,t,a){a=a||[488e-6,0,0,488e-6,0,0],h.call(this,a),this.glyphs=e,this.cmap=t,this.compiledGlyphs=[]}function f(e,t,a,r){a=a||[.001,0,0,.001,0,0],h.call(this,a),this.glyphs=e.glyphs,this.gsubrs=e.gsubrs||[],this.subrs=e.subrs||[],this.cmap=t,this.glyphNameMap=r||ya,this.compiledGlyphs=[],this.gsubrsBias=this.gsubrs.length<1240?107:this.gsubrs.length<33900?1131:32768,this.subrsBias=this.subrs.length<1240?107:this.subrs.length<33900?1131:32768}var d="";return h.prototype={getPathJs:function(e){var t=o(this.cmap,e),a=this.compiledGlyphs[t];return a||(this.compiledGlyphs[t]=a=this.compileGlyph(this.glyphs[t])),a},compileGlyph:function(e){if(!e||0===e.length||14===e[0])return d;var t=[];return t.push("c.save();"),t.push("c.transform("+this.fontMatrix.join(",")+");"),t.push("c.scale(size, -size);"),this.compileGlyphImpl(e,t),t.push("c.restore();"),t.join("\n")},compileGlyphImpl:function(){a("Children classes should implement this.")},hasBuiltPath:function(e){var t=o(this.cmap,e);return t in this.compiledGlyphs}},ce.inherit(u,h,{compileGlyphImpl:function(e,t){c(e,t,this)}}),ce.inherit(f,h,{compileGlyphImpl:function(e,t){l(e,t,this)}}),{create:function(a){for(var o,c,l,h,d,g,m=new Uint8Array(a.data),p=t(m,4),b=0,v=12;p>b;b++,v+=16){var y=s(m.subarray(v,v+4)),k=e(m,v+8),w=e(m,v+12);switch(y){case"cmap":o=r(m,k,k+w);break;case"glyf":c=m.subarray(k,k+w);break;case"loca":l=m.subarray(k,k+w);break;case"head":g=t(m,k+18),d=t(m,k+50);break;case"CFF ":h=i(m,k,k+w)}}if(c){var x=g?[1/g,0,0,1/g,0,0]:a.fontMatrix;return new u(n(c,l,d),o,x)}return new f(h,o,a.fontMatrix,a.glyphNameMap)}}}(),ya={A:65,AE:198,AEacute:508,AEmacron:482,AEsmall:63462,Aacute:193,Aacutesmall:63457,Abreve:258,Abreveacute:7854,Abrevecyrillic:1232,Abrevedotbelow:7862,Abrevegrave:7856,Abrevehookabove:7858,Abrevetilde:7860,Acaron:461,Acircle:9398,Acircumflex:194,Acircumflexacute:7844,Acircumflexdotbelow:7852,Acircumflexgrave:7846,Acircumflexhookabove:7848,Acircumflexsmall:63458,Acircumflextilde:7850,Acute:63177,Acutesmall:63412,Acyrillic:1040,Adblgrave:512,Adieresis:196,Adieresiscyrillic:1234,Adieresismacron:478,Adieresissmall:63460,Adotbelow:7840,Adotmacron:480,Agrave:192,Agravesmall:63456,Ahookabove:7842,Aiecyrillic:1236,Ainvertedbreve:514,Alpha:913,Alphatonos:902,Amacron:256,Amonospace:65313,Aogonek:260,Aring:197,Aringacute:506,Aringbelow:7680,Aringsmall:63461,Asmall:63329,Atilde:195,Atildesmall:63459,Aybarmenian:1329,B:66,Bcircle:9399,Bdotaccent:7682,Bdotbelow:7684,Becyrillic:1041,Benarmenian:1330,Beta:914,Bhook:385,Blinebelow:7686,Bmonospace:65314,Brevesmall:63220,Bsmall:63330,Btopbar:386,C:67,Caarmenian:1342,Cacute:262,Caron:63178,Caronsmall:63221,Ccaron:268,Ccedilla:199,Ccedillaacute:7688,Ccedillasmall:63463,Ccircle:9400,Ccircumflex:264,Cdot:266,Cdotaccent:266,Cedillasmall:63416,Chaarmenian:1353,Cheabkhasiancyrillic:1212,Checyrillic:1063,Chedescenderabkhasiancyrillic:1214,Chedescendercyrillic:1206,Chedieresiscyrillic:1268,Cheharmenian:1347,Chekhakassiancyrillic:1227,Cheverticalstrokecyrillic:1208,Chi:935,Chook:391,Circumflexsmall:63222,Cmonospace:65315,Coarmenian:1361,Csmall:63331,D:68,DZ:497,DZcaron:452,
Daarmenian:1332,Dafrican:393,Dcaron:270,Dcedilla:7696,Dcircle:9401,Dcircumflexbelow:7698,Dcroat:272,Ddotaccent:7690,Ddotbelow:7692,Decyrillic:1044,Deicoptic:1006,Delta:8710,Deltagreek:916,Dhook:394,Dieresis:63179,DieresisAcute:63180,DieresisGrave:63181,Dieresissmall:63400,Digammagreek:988,Djecyrillic:1026,Dlinebelow:7694,Dmonospace:65316,Dotaccentsmall:63223,Dslash:272,Dsmall:63332,Dtopbar:395,Dz:498,Dzcaron:453,Dzeabkhasiancyrillic:1248,Dzecyrillic:1029,Dzhecyrillic:1039,E:69,Eacute:201,Eacutesmall:63465,Ebreve:276,Ecaron:282,Ecedillabreve:7708,Echarmenian:1333,Ecircle:9402,Ecircumflex:202,Ecircumflexacute:7870,Ecircumflexbelow:7704,Ecircumflexdotbelow:7878,Ecircumflexgrave:7872,Ecircumflexhookabove:7874,Ecircumflexsmall:63466,Ecircumflextilde:7876,Ecyrillic:1028,Edblgrave:516,Edieresis:203,Edieresissmall:63467,Edot:278,Edotaccent:278,Edotbelow:7864,Efcyrillic:1060,Egrave:200,Egravesmall:63464,Eharmenian:1335,Ehookabove:7866,Eightroman:8551,Einvertedbreve:518,Eiotifiedcyrillic:1124,Elcyrillic:1051,Elevenroman:8554,Emacron:274,Emacronacute:7702,Emacrongrave:7700,Emcyrillic:1052,Emonospace:65317,Encyrillic:1053,Endescendercyrillic:1186,Eng:330,Enghecyrillic:1188,Enhookcyrillic:1223,Eogonek:280,Eopen:400,Epsilon:917,Epsilontonos:904,Ercyrillic:1056,Ereversed:398,Ereversedcyrillic:1069,Escyrillic:1057,Esdescendercyrillic:1194,Esh:425,Esmall:63333,Eta:919,Etarmenian:1336,Etatonos:905,Eth:208,Ethsmall:63472,Etilde:7868,Etildebelow:7706,Euro:8364,Ezh:439,Ezhcaron:494,Ezhreversed:440,F:70,Fcircle:9403,Fdotaccent:7710,Feharmenian:1366,Feicoptic:996,Fhook:401,Fitacyrillic:1138,Fiveroman:8548,Fmonospace:65318,Fourroman:8547,Fsmall:63334,G:71,GBsquare:13191,Gacute:500,Gamma:915,Gammaafrican:404,Gangiacoptic:1002,Gbreve:286,Gcaron:486,Gcedilla:290,Gcircle:9404,Gcircumflex:284,Gcommaaccent:290,Gdot:288,Gdotaccent:288,Gecyrillic:1043,Ghadarmenian:1346,Ghemiddlehookcyrillic:1172,Ghestrokecyrillic:1170,Gheupturncyrillic:1168,Ghook:403,Gimarmenian:1331,Gjecyrillic:1027,Gmacron:7712,Gmonospace:65319,Grave:63182,Gravesmall:63328,Gsmall:63335,Gsmallhook:667,Gstroke:484,H:72,H18533:9679,H18543:9642,H18551:9643,H22073:9633,HPsquare:13259,Haabkhasiancyrillic:1192,Hadescendercyrillic:1202,Hardsigncyrillic:1066,Hbar:294,Hbrevebelow:7722,Hcedilla:7720,Hcircle:9405,Hcircumflex:292,Hdieresis:7718,Hdotaccent:7714,Hdotbelow:7716,Hmonospace:65320,Hoarmenian:1344,Horicoptic:1e3,Hsmall:63336,Hungarumlaut:63183,Hungarumlautsmall:63224,Hzsquare:13200,I:73,IAcyrillic:1071,IJ:306,IUcyrillic:1070,Iacute:205,Iacutesmall:63469,Ibreve:300,Icaron:463,Icircle:9406,Icircumflex:206,Icircumflexsmall:63470,Icyrillic:1030,Idblgrave:520,Idieresis:207,Idieresisacute:7726,Idieresiscyrillic:1252,Idieresissmall:63471,Idot:304,Idotaccent:304,Idotbelow:7882,Iebrevecyrillic:1238,Iecyrillic:1045,Ifraktur:8465,Igrave:204,Igravesmall:63468,Ihookabove:7880,Iicyrillic:1048,Iinvertedbreve:522,Iishortcyrillic:1049,Imacron:298,Imacroncyrillic:1250,Imonospace:65321,Iniarmenian:1339,Iocyrillic:1025,Iogonek:302,Iota:921,Iotaafrican:406,Iotadieresis:938,Iotatonos:906,Ismall:63337,Istroke:407,Itilde:296,Itildebelow:7724,Izhitsacyrillic:1140,Izhitsadblgravecyrillic:1142,J:74,Jaarmenian:1345,Jcircle:9407,Jcircumflex:308,Jecyrillic:1032,Jheharmenian:1355,Jmonospace:65322,Jsmall:63338,K:75,KBsquare:13189,KKsquare:13261,Kabashkircyrillic:1184,Kacute:7728,Kacyrillic:1050,Kadescendercyrillic:1178,Kahookcyrillic:1219,Kappa:922,Kastrokecyrillic:1182,Kaverticalstrokecyrillic:1180,Kcaron:488,Kcedilla:310,Kcircle:9408,Kcommaaccent:310,Kdotbelow:7730,Keharmenian:1364,Kenarmenian:1343,Khacyrillic:1061,Kheicoptic:998,Khook:408,Kjecyrillic:1036,Klinebelow:7732,Kmonospace:65323,Koppacyrillic:1152,Koppagreek:990,Ksicyrillic:1134,Ksmall:63339,L:76,LJ:455,LL:63167,Lacute:313,Lambda:923,Lcaron:317,Lcedilla:315,Lcircle:9409,Lcircumflexbelow:7740,Lcommaaccent:315,Ldot:319,Ldotaccent:319,Ldotbelow:7734,Ldotbelowmacron:7736,Liwnarmenian:1340,Lj:456,Ljecyrillic:1033,Llinebelow:7738,Lmonospace:65324,Lslash:321,Lslashsmall:63225,Lsmall:63340,M:77,MBsquare:13190,Macron:63184,Macronsmall:63407,Macute:7742,Mcircle:9410,Mdotaccent:7744,Mdotbelow:7746,Menarmenian:1348,Mmonospace:65325,Msmall:63341,Mturned:412,Mu:924,N:78,NJ:458,Nacute:323,Ncaron:327,Ncedilla:325,Ncircle:9411,Ncircumflexbelow:7754,Ncommaaccent:325,Ndotaccent:7748,Ndotbelow:7750,Nhookleft:413,Nineroman:8552,Nj:459,Njecyrillic:1034,Nlinebelow:7752,Nmonospace:65326,Nowarmenian:1350,Nsmall:63342,Ntilde:209,Ntildesmall:63473,Nu:925,O:79,OE:338,OEsmall:63226,Oacute:211,Oacutesmall:63475,Obarredcyrillic:1256,Obarreddieresiscyrillic:1258,Obreve:334,Ocaron:465,Ocenteredtilde:415,Ocircle:9412,Ocircumflex:212,Ocircumflexacute:7888,Ocircumflexdotbelow:7896,Ocircumflexgrave:7890,Ocircumflexhookabove:7892,Ocircumflexsmall:63476,Ocircumflextilde:7894,Ocyrillic:1054,Odblacute:336,Odblgrave:524,Odieresis:214,Odieresiscyrillic:1254,Odieresissmall:63478,Odotbelow:7884,Ogoneksmall:63227,Ograve:210,Ogravesmall:63474,Oharmenian:1365,Ohm:8486,Ohookabove:7886,Ohorn:416,Ohornacute:7898,Ohorndotbelow:7906,Ohorngrave:7900,Ohornhookabove:7902,Ohorntilde:7904,Ohungarumlaut:336,Oi:418,Oinvertedbreve:526,Omacron:332,Omacronacute:7762,Omacrongrave:7760,Omega:8486,Omegacyrillic:1120,Omegagreek:937,Omegaroundcyrillic:1146,Omegatitlocyrillic:1148,Omegatonos:911,Omicron:927,Omicrontonos:908,Omonospace:65327,Oneroman:8544,Oogonek:490,Oogonekmacron:492,Oopen:390,Oslash:216,Oslashacute:510,Oslashsmall:63480,Osmall:63343,Ostrokeacute:510,Otcyrillic:1150,Otilde:213,Otildeacute:7756,Otildedieresis:7758,Otildesmall:63477,P:80,Pacute:7764,Pcircle:9413,Pdotaccent:7766,Pecyrillic:1055,Peharmenian:1354,Pemiddlehookcyrillic:1190,Phi:934,Phook:420,Pi:928,Piwrarmenian:1363,Pmonospace:65328,Psi:936,Psicyrillic:1136,Psmall:63344,Q:81,Qcircle:9414,Qmonospace:65329,Qsmall:63345,R:82,Raarmenian:1356,Racute:340,Rcaron:344,Rcedilla:342,Rcircle:9415,Rcommaaccent:342,Rdblgrave:528,Rdotaccent:7768,Rdotbelow:7770,Rdotbelowmacron:7772,Reharmenian:1360,Rfraktur:8476,Rho:929,Ringsmall:63228,Rinvertedbreve:530,Rlinebelow:7774,Rmonospace:65330,Rsmall:63346,Rsmallinverted:641,Rsmallinvertedsuperior:694,S:83,SF010000:9484,SF020000:9492,SF030000:9488,SF040000:9496,SF050000:9532,SF060000:9516,SF070000:9524,SF080000:9500,SF090000:9508,SF100000:9472,SF110000:9474,SF190000:9569,SF200000:9570,SF210000:9558,SF220000:9557,SF230000:9571,SF240000:9553,SF250000:9559,SF260000:9565,SF270000:9564,SF280000:9563,SF360000:9566,SF370000:9567,SF380000:9562,SF390000:9556,SF400000:9577,SF410000:9574,SF420000:9568,SF430000:9552,SF440000:9580,SF450000:9575,SF460000:9576,SF470000:9572,SF480000:9573,SF490000:9561,SF500000:9560,SF510000:9554,SF520000:9555,SF530000:9579,SF540000:9578,Sacute:346,Sacutedotaccent:7780,Sampigreek:992,Scaron:352,Scarondotaccent:7782,Scaronsmall:63229,Scedilla:350,Schwa:399,Schwacyrillic:1240,Schwadieresiscyrillic:1242,Scircle:9416,Scircumflex:348,Scommaaccent:536,Sdotaccent:7776,Sdotbelow:7778,Sdotbelowdotaccent:7784,Seharmenian:1357,Sevenroman:8550,Shaarmenian:1351,Shacyrillic:1064,Shchacyrillic:1065,Sheicoptic:994,Shhacyrillic:1210,Shimacoptic:1004,Sigma:931,Sixroman:8549,Smonospace:65331,Softsigncyrillic:1068,Ssmall:63347,Stigmagreek:986,T:84,Tau:932,Tbar:358,Tcaron:356,Tcedilla:354,Tcircle:9417,Tcircumflexbelow:7792,Tcommaaccent:354,Tdotaccent:7786,Tdotbelow:7788,Tecyrillic:1058,Tedescendercyrillic:1196,Tenroman:8553,Tetsecyrillic:1204,Theta:920,Thook:428,Thorn:222,Thornsmall:63486,Threeroman:8546,Tildesmall:63230,Tiwnarmenian:1359,Tlinebelow:7790,Tmonospace:65332,Toarmenian:1337,Tonefive:444,Tonesix:388,Tonetwo:423,Tretroflexhook:430,Tsecyrillic:1062,Tshecyrillic:1035,Tsmall:63348,Twelveroman:8555,Tworoman:8545,U:85,Uacute:218,Uacutesmall:63482,Ubreve:364,Ucaron:467,Ucircle:9418,Ucircumflex:219,Ucircumflexbelow:7798,Ucircumflexsmall:63483,Ucyrillic:1059,Udblacute:368,Udblgrave:532,Udieresis:220,Udieresisacute:471,Udieresisbelow:7794,Udieresiscaron:473,Udieresiscyrillic:1264,Udieresisgrave:475,Udieresismacron:469,Udieresissmall:63484,Udotbelow:7908,Ugrave:217,Ugravesmall:63481,Uhookabove:7910,Uhorn:431,Uhornacute:7912,Uhorndotbelow:7920,Uhorngrave:7914,Uhornhookabove:7916,Uhorntilde:7918,Uhungarumlaut:368,Uhungarumlautcyrillic:1266,Uinvertedbreve:534,Ukcyrillic:1144,Umacron:362,Umacroncyrillic:1262,Umacrondieresis:7802,Umonospace:65333,Uogonek:370,Upsilon:933,Upsilon1:978,Upsilonacutehooksymbolgreek:979,Upsilonafrican:433,Upsilondieresis:939,Upsilondieresishooksymbolgreek:980,Upsilonhooksymbol:978,Upsilontonos:910,Uring:366,Ushortcyrillic:1038,Usmall:63349,Ustraightcyrillic:1198,Ustraightstrokecyrillic:1200,Utilde:360,Utildeacute:7800,Utildebelow:7796,V:86,Vcircle:9419,Vdotbelow:7806,Vecyrillic:1042,Vewarmenian:1358,Vhook:434,Vmonospace:65334,Voarmenian:1352,Vsmall:63350,Vtilde:7804,W:87,Wacute:7810,Wcircle:9420,Wcircumflex:372,Wdieresis:7812,Wdotaccent:7814,Wdotbelow:7816,Wgrave:7808,Wmonospace:65335,Wsmall:63351,X:88,Xcircle:9421,Xdieresis:7820,Xdotaccent:7818,Xeharmenian:1341,Xi:926,Xmonospace:65336,Xsmall:63352,Y:89,Yacute:221,Yacutesmall:63485,Yatcyrillic:1122,Ycircle:9422,Ycircumflex:374,Ydieresis:376,Ydieresissmall:63487,Ydotaccent:7822,Ydotbelow:7924,Yericyrillic:1067,Yerudieresiscyrillic:1272,Ygrave:7922,Yhook:435,Yhookabove:7926,Yiarmenian:1349,Yicyrillic:1031,Yiwnarmenian:1362,Ymonospace:65337,Ysmall:63353,Ytilde:7928,Yusbigcyrillic:1130,Yusbigiotifiedcyrillic:1132,Yuslittlecyrillic:1126,Yuslittleiotifiedcyrillic:1128,Z:90,Zaarmenian:1334,Zacute:377,Zcaron:381,Zcaronsmall:63231,Zcircle:9423,Zcircumflex:7824,Zdot:379,Zdotaccent:379,Zdotbelow:7826,Zecyrillic:1047,Zedescendercyrillic:1176,Zedieresiscyrillic:1246,Zeta:918,Zhearmenian:1338,Zhebrevecyrillic:1217,Zhecyrillic:1046,Zhedescendercyrillic:1174,Zhedieresiscyrillic:1244,Zlinebelow:7828,Zmonospace:65338,Zsmall:63354,Zstroke:437,a:97,aabengali:2438,aacute:225,aadeva:2310,aagujarati:2694,aagurmukhi:2566,aamatragurmukhi:2622,aarusquare:13059,aavowelsignbengali:2494,aavowelsigndeva:2366,aavowelsigngujarati:2750,abbreviationmarkarmenian:1375,abbreviationsigndeva:2416,abengali:2437,abopomofo:12570,abreve:259,abreveacute:7855,abrevecyrillic:1233,abrevedotbelow:7863,abrevegrave:7857,abrevehookabove:7859,abrevetilde:7861,acaron:462,acircle:9424,acircumflex:226,acircumflexacute:7845,acircumflexdotbelow:7853,acircumflexgrave:7847,acircumflexhookabove:7849,acircumflextilde:7851,acute:180,acutebelowcmb:791,acutecmb:769,acutecomb:769,acutedeva:2388,acutelowmod:719,acutetonecmb:833,acyrillic:1072,adblgrave:513,addakgurmukhi:2673,adeva:2309,adieresis:228,adieresiscyrillic:1235,adieresismacron:479,adotbelow:7841,adotmacron:481,ae:230,aeacute:509,aekorean:12624,aemacron:483,afii00208:8213,afii08941:8356,afii10017:1040,afii10018:1041,afii10019:1042,afii10020:1043,afii10021:1044,afii10022:1045,afii10023:1025,afii10024:1046,afii10025:1047,afii10026:1048,afii10027:1049,afii10028:1050,afii10029:1051,afii10030:1052,afii10031:1053,afii10032:1054,afii10033:1055,afii10034:1056,afii10035:1057,afii10036:1058,afii10037:1059,afii10038:1060,afii10039:1061,afii10040:1062,afii10041:1063,afii10042:1064,afii10043:1065,afii10044:1066,afii10045:1067,afii10046:1068,afii10047:1069,afii10048:1070,afii10049:1071,afii10050:1168,afii10051:1026,afii10052:1027,afii10053:1028,afii10054:1029,afii10055:1030,afii10056:1031,afii10057:1032,afii10058:1033,afii10059:1034,afii10060:1035,afii10061:1036,afii10062:1038,afii10063:63172,afii10064:63173,afii10065:1072,afii10066:1073,afii10067:1074,afii10068:1075,afii10069:1076,afii10070:1077,afii10071:1105,afii10072:1078,afii10073:1079,afii10074:1080,afii10075:1081,afii10076:1082,afii10077:1083,afii10078:1084,afii10079:1085,afii10080:1086,afii10081:1087,afii10082:1088,afii10083:1089,afii10084:1090,afii10085:1091,afii10086:1092,afii10087:1093,afii10088:1094,afii10089:1095,afii10090:1096,afii10091:1097,afii10092:1098,afii10093:1099,afii10094:1100,afii10095:1101,afii10096:1102,afii10097:1103,afii10098:1169,afii10099:1106,afii10100:1107,afii10101:1108,afii10102:1109,afii10103:1110,afii10104:1111,afii10105:1112,afii10106:1113,afii10107:1114,afii10108:1115,afii10109:1116,afii10110:1118,afii10145:1039,afii10146:1122,afii10147:1138,afii10148:1140,afii10192:63174,afii10193:1119,afii10194:1123,afii10195:1139,afii10196:1141,afii10831:63175,afii10832:63176,afii10846:1241,afii299:8206,afii300:8207,afii301:8205,afii57381:1642,afii57388:1548,afii57392:1632,afii57393:1633,afii57394:1634,afii57395:1635,afii57396:1636,afii57397:1637,afii57398:1638,afii57399:1639,afii57400:1640,afii57401:1641,afii57403:1563,afii57407:1567,afii57409:1569,afii57410:1570,afii57411:1571,afii57412:1572,afii57413:1573,afii57414:1574,afii57415:1575,afii57416:1576,afii57417:1577,afii57418:1578,afii57419:1579,afii57420:1580,afii57421:1581,afii57422:1582,afii57423:1583,afii57424:1584,afii57425:1585,afii57426:1586,afii57427:1587,afii57428:1588,afii57429:1589,afii57430:1590,afii57431:1591,afii57432:1592,afii57433:1593,afii57434:1594,afii57440:1600,afii57441:1601,afii57442:1602,afii57443:1603,afii57444:1604,afii57445:1605,afii57446:1606,afii57448:1608,afii57449:1609,afii57450:1610,afii57451:1611,afii57452:1612,afii57453:1613,afii57454:1614,afii57455:1615,afii57456:1616,afii57457:1617,afii57458:1618,afii57470:1607,afii57505:1700,afii57506:1662,afii57507:1670,afii57508:1688,afii57509:1711,afii57511:1657,afii57512:1672,afii57513:1681,afii57514:1722,afii57519:1746,afii57534:1749,afii57636:8362,afii57645:1470,afii57658:1475,afii57664:1488,afii57665:1489,afii57666:1490,afii57667:1491,afii57668:1492,afii57669:1493,afii57670:1494,afii57671:1495,afii57672:1496,afii57673:1497,afii57674:1498,afii57675:1499,afii57676:1500,afii57677:1501,afii57678:1502,afii57679:1503,afii57680:1504,afii57681:1505,afii57682:1506,afii57683:1507,afii57684:1508,afii57685:1509,afii57686:1510,afii57687:1511,afii57688:1512,afii57689:1513,afii57690:1514,afii57694:64298,afii57695:64299,afii57700:64331,afii57705:64287,afii57716:1520,afii57717:1521,afii57718:1522,afii57723:64309,afii57793:1460,afii57794:1461,afii57795:1462,afii57796:1467,afii57797:1464,afii57798:1463,afii57799:1456,afii57800:1458,afii57801:1457,afii57802:1459,afii57803:1474,afii57804:1473,afii57806:1465,afii57807:1468,afii57839:1469,afii57841:1471,afii57842:1472,afii57929:700,afii61248:8453,afii61289:8467,afii61352:8470,afii61573:8236,afii61574:8237,afii61575:8238,afii61664:8204,afii63167:1645,afii64937:701,agrave:224,agujarati:2693,agurmukhi:2565,ahiragana:12354,ahookabove:7843,aibengali:2448,aibopomofo:12574,aideva:2320,aiecyrillic:1237,aigujarati:2704,aigurmukhi:2576,aimatragurmukhi:2632,ainarabic:1593,ainfinalarabic:65226,aininitialarabic:65227,ainmedialarabic:65228,ainvertedbreve:515,aivowelsignbengali:2504,aivowelsigndeva:2376,aivowelsigngujarati:2760,akatakana:12450,akatakanahalfwidth:65393,akorean:12623,alef:1488,alefarabic:1575,alefdageshhebrew:64304,aleffinalarabic:65166,alefhamzaabovearabic:1571,alefhamzaabovefinalarabic:65156,alefhamzabelowarabic:1573,alefhamzabelowfinalarabic:65160,alefhebrew:1488,aleflamedhebrew:64335,alefmaddaabovearabic:1570,alefmaddaabovefinalarabic:65154,alefmaksuraarabic:1609,alefmaksurafinalarabic:65264,alefmaksurainitialarabic:65267,alefmaksuramedialarabic:65268,alefpatahhebrew:64302,alefqamatshebrew:64303,aleph:8501,allequal:8780,alpha:945,alphatonos:940,amacron:257,amonospace:65345,ampersand:38,ampersandmonospace:65286,ampersandsmall:63270,amsquare:13250,anbopomofo:12578,angbopomofo:12580,angbracketleft:12296,angbracketright:12297,angkhankhuthai:3674,angle:8736,anglebracketleft:12296,anglebracketleftvertical:65087,anglebracketright:12297,anglebracketrightvertical:65088,angleleft:9001,angleright:9002,angstrom:8491,anoteleia:903,anudattadeva:2386,anusvarabengali:2434,anusvaradeva:2306,anusvaragujarati:2690,aogonek:261,apaatosquare:13056,aparen:9372,apostrophearmenian:1370,apostrophemod:700,apple:63743,approaches:8784,approxequal:8776,approxequalorimage:8786,approximatelyequal:8773,araeaekorean:12686,araeakorean:12685,arc:8978,arighthalfring:7834,aring:229,aringacute:507,aringbelow:7681,arrowboth:8596,arrowdashdown:8675,arrowdashleft:8672,arrowdashright:8674,arrowdashup:8673,arrowdblboth:8660,arrowdbldown:8659,arrowdblleft:8656,arrowdblright:8658,arrowdblup:8657,arrowdown:8595,arrowdownleft:8601,arrowdownright:8600,arrowdownwhite:8681,arrowheaddownmod:709,arrowheadleftmod:706,arrowheadrightmod:707,arrowheadupmod:708,arrowhorizex:63719,arrowleft:8592,arrowleftdbl:8656,arrowleftdblstroke:8653,arrowleftoverright:8646,arrowleftwhite:8678,arrowright:8594,arrowrightdblstroke:8655,arrowrightheavy:10142,arrowrightoverleft:8644,arrowrightwhite:8680,arrowtableft:8676,arrowtabright:8677,arrowup:8593,arrowupdn:8597,arrowupdnbse:8616,arrowupdownbase:8616,arrowupleft:8598,arrowupleftofdown:8645,arrowupright:8599,arrowupwhite:8679,arrowvertex:63718,asciicircum:94,asciicircummonospace:65342,asciitilde:126,asciitildemonospace:65374,ascript:593,ascriptturned:594,asmallhiragana:12353,asmallkatakana:12449,asmallkatakanahalfwidth:65383,asterisk:42,asteriskaltonearabic:1645,asteriskarabic:1645,asteriskmath:8727,asteriskmonospace:65290,asterisksmall:65121,asterism:8258,asuperior:63209,asymptoticallyequal:8771,at:64,atilde:227,atmonospace:65312,atsmall:65131,aturned:592,aubengali:2452,aubopomofo:12576,audeva:2324,augujarati:2708,augurmukhi:2580,aulengthmarkbengali:2519,aumatragurmukhi:2636,auvowelsignbengali:2508,auvowelsigndeva:2380,auvowelsigngujarati:2764,avagrahadeva:2365,aybarmenian:1377,ayin:1506,ayinaltonehebrew:64288,ayinhebrew:1506,b:98,babengali:2476,backslash:92,backslashmonospace:65340,badeva:2348,bagujarati:2732,bagurmukhi:2604,bahiragana:12400,bahtthai:3647,bakatakana:12496,bar:124,barmonospace:65372,bbopomofo:12549,bcircle:9425,bdotaccent:7683,bdotbelow:7685,beamedsixteenthnotes:9836,because:8757,becyrillic:1073,beharabic:1576,behfinalarabic:65168,behinitialarabic:65169,behiragana:12409,behmedialarabic:65170,behmeeminitialarabic:64671,behmeemisolatedarabic:64520,behnoonfinalarabic:64621,bekatakana:12505,benarmenian:1378,bet:1489,beta:946,betasymbolgreek:976,betdagesh:64305,betdageshhebrew:64305,bethebrew:1489,betrafehebrew:64332,bhabengali:2477,bhadeva:2349,bhagujarati:2733,bhagurmukhi:2605,bhook:595,bihiragana:12403,bikatakana:12499,bilabialclick:664,bindigurmukhi:2562,birusquare:13105,blackcircle:9679,blackdiamond:9670,blackdownpointingtriangle:9660,blackleftpointingpointer:9668,blackleftpointingtriangle:9664,blacklenticularbracketleft:12304,blacklenticularbracketleftvertical:65083,blacklenticularbracketright:12305,blacklenticularbracketrightvertical:65084,blacklowerlefttriangle:9699,blacklowerrighttriangle:9698,blackrectangle:9644,blackrightpointingpointer:9658,blackrightpointingtriangle:9654,blacksmallsquare:9642,blacksmilingface:9787,blacksquare:9632,blackstar:9733,blackupperlefttriangle:9700,blackupperrighttriangle:9701,blackuppointingsmalltriangle:9652,blackuppointingtriangle:9650,blank:9251,blinebelow:7687,block:9608,bmonospace:65346,bobaimaithai:3610,bohiragana:12412,bokatakana:12508,bparen:9373,bqsquare:13251,braceex:63732,braceleft:123,braceleftbt:63731,braceleftmid:63730,braceleftmonospace:65371,braceleftsmall:65115,bracelefttp:63729,braceleftvertical:65079,braceright:125,bracerightbt:63742,bracerightmid:63741,bracerightmonospace:65373,bracerightsmall:65116,bracerighttp:63740,bracerightvertical:65080,bracketleft:91,bracketleftbt:63728,bracketleftex:63727,bracketleftmonospace:65339,bracketlefttp:63726,bracketright:93,bracketrightbt:63739,bracketrightex:63738,bracketrightmonospace:65341,bracketrighttp:63737,breve:728,brevebelowcmb:814,brevecmb:774,breveinvertedbelowcmb:815,breveinvertedcmb:785,breveinverteddoublecmb:865,bridgebelowcmb:810,bridgeinvertedbelowcmb:826,brokenbar:166,bstroke:384,bsuperior:63210,btopbar:387,buhiragana:12406,bukatakana:12502,bullet:8226,bulletinverse:9688,bulletoperator:8729,bullseye:9678,c:99,caarmenian:1390,cabengali:2458,cacute:263,cadeva:2330,cagujarati:2714,cagurmukhi:2586,calsquare:13192,candrabindubengali:2433,candrabinducmb:784,candrabindudeva:2305,candrabindugujarati:2689,capslock:8682,careof:8453,caron:711,caronbelowcmb:812,caroncmb:780,carriagereturn:8629,cbopomofo:12568,ccaron:269,ccedilla:231,ccedillaacute:7689,ccircle:9426,ccircumflex:265,ccurl:597,cdot:267,cdotaccent:267,cdsquare:13253,cedilla:184,cedillacmb:807,cent:162,centigrade:8451,centinferior:63199,centmonospace:65504,centoldstyle:63394,centsuperior:63200,chaarmenian:1401,chabengali:2459,chadeva:2331,chagujarati:2715,chagurmukhi:2587,chbopomofo:12564,cheabkhasiancyrillic:1213,checkmark:10003,checyrillic:1095,chedescenderabkhasiancyrillic:1215,chedescendercyrillic:1207,chedieresiscyrillic:1269,cheharmenian:1395,chekhakassiancyrillic:1228,cheverticalstrokecyrillic:1209,chi:967,chieuchacirclekorean:12919,chieuchaparenkorean:12823,chieuchcirclekorean:12905,chieuchkorean:12618,chieuchparenkorean:12809,chochangthai:3594,chochanthai:3592,chochingthai:3593,chochoethai:3596,chook:392,cieucacirclekorean:12918,cieucaparenkorean:12822,cieuccirclekorean:12904,cieuckorean:12616,cieucparenkorean:12808,cieucuparenkorean:12828,circle:9675,circlecopyrt:169,circlemultiply:8855,circleot:8857,circleplus:8853,circlepostalmark:12342,circlewithlefthalfblack:9680,circlewithrighthalfblack:9681,circumflex:710,circumflexbelowcmb:813,circumflexcmb:770,clear:8999,clickalveolar:450,clickdental:448,clicklateral:449,clickretroflex:451,club:9827,clubsuitblack:9827,clubsuitwhite:9831,cmcubedsquare:13220,cmonospace:65347,cmsquaredsquare:13216,coarmenian:1409,colon:58,colonmonetary:8353,colonmonospace:65306,colonsign:8353,colonsmall:65109,colontriangularhalfmod:721,colontriangularmod:720,comma:44,commaabovecmb:787,commaaboverightcmb:789,commaaccent:63171,commaarabic:1548,commaarmenian:1373,commainferior:63201,commamonospace:65292,commareversedabovecmb:788,commareversedmod:701,commasmall:65104,commasuperior:63202,commaturnedabovecmb:786,commaturnedmod:699,compass:9788,congruent:8773,contourintegral:8750,control:8963,controlACK:6,controlBEL:7,controlBS:8,controlCAN:24,controlCR:13,controlDC1:17,controlDC2:18,controlDC3:19,controlDC4:20,controlDEL:127,controlDLE:16,controlEM:25,controlENQ:5,controlEOT:4,controlESC:27,controlETB:23,controlETX:3,controlFF:12,controlFS:28,controlGS:29,controlHT:9,controlLF:10,controlNAK:21,controlRS:30,controlSI:15,controlSO:14,controlSOT:2,controlSTX:1,controlSUB:26,controlSYN:22,controlUS:31,controlVT:11,copyright:169,copyrightsans:63721,copyrightserif:63193,cornerbracketleft:12300,cornerbracketlefthalfwidth:65378,cornerbracketleftvertical:65089,cornerbracketright:12301,cornerbracketrighthalfwidth:65379,cornerbracketrightvertical:65090,corporationsquare:13183,cosquare:13255,coverkgsquare:13254,cparen:9374,cruzeiro:8354,cstretched:663,curlyand:8911,curlyor:8910,currency:164,cyrBreve:63185,cyrFlex:63186,cyrbreve:63188,cyrflex:63189,d:100,daarmenian:1380,dabengali:2470,dadarabic:1590,dadeva:2342,dadfinalarabic:65214,dadinitialarabic:65215,dadmedialarabic:65216,dagesh:1468,dageshhebrew:1468,dagger:8224,daggerdbl:8225,dagujarati:2726,dagurmukhi:2598,dahiragana:12384,dakatakana:12480,dalarabic:1583,dalet:1491,daletdagesh:64307,daletdageshhebrew:64307,dalethebrew:1491,dalfinalarabic:65194,dammaarabic:1615,dammalowarabic:1615,dammatanaltonearabic:1612,dammatanarabic:1612,danda:2404,dargahebrew:1447,dargalefthebrew:1447,dasiapneumatacyrilliccmb:1157,dblGrave:63187,dblanglebracketleft:12298,dblanglebracketleftvertical:65085,dblanglebracketright:12299,dblanglebracketrightvertical:65086,dblarchinvertedbelowcmb:811,dblarrowleft:8660,dblarrowright:8658,dbldanda:2405,dblgrave:63190,dblgravecmb:783,dblintegral:8748,dbllowline:8215,dbllowlinecmb:819,dbloverlinecmb:831,dblprimemod:698,dblverticalbar:8214,dblverticallineabovecmb:782,dbopomofo:12553,dbsquare:13256,dcaron:271,dcedilla:7697,dcircle:9427,dcircumflexbelow:7699,dcroat:273,ddabengali:2465,ddadeva:2337,ddagujarati:2721,ddagurmukhi:2593,ddalarabic:1672,ddalfinalarabic:64393,dddhadeva:2396,ddhabengali:2466,ddhadeva:2338,ddhagujarati:2722,ddhagurmukhi:2594,ddotaccent:7691,ddotbelow:7693,decimalseparatorarabic:1643,decimalseparatorpersian:1643,decyrillic:1076,degree:176,dehihebrew:1453,dehiragana:12391,deicoptic:1007,dekatakana:12487,deleteleft:9003,deleteright:8998,delta:948,deltaturned:397,denominatorminusonenumeratorbengali:2552,dezh:676,dhabengali:2471,dhadeva:2343,dhagujarati:2727,dhagurmukhi:2599,dhook:599,dialytikatonos:901,dialytikatonoscmb:836,diamond:9830,diamondsuitwhite:9826,dieresis:168,dieresisacute:63191,dieresisbelowcmb:804,dieresiscmb:776,dieresisgrave:63192,dieresistonos:901,dihiragana:12386,dikatakana:12482,dittomark:12291,divide:247,divides:8739,divisionslash:8725,djecyrillic:1106,dkshade:9619,dlinebelow:7695,dlsquare:13207,dmacron:273,dmonospace:65348,dnblock:9604,dochadathai:3598,dodekthai:3604,dohiragana:12393,dokatakana:12489,dollar:36,dollarinferior:63203,dollarmonospace:65284,dollaroldstyle:63268,dollarsmall:65129,dollarsuperior:63204,dong:8363,dorusquare:13094,dotaccent:729,dotaccentcmb:775,dotbelowcmb:803,dotbelowcomb:803,dotkatakana:12539,dotlessi:305,dotlessj:63166,dotlessjstrokehook:644,dotmath:8901,dottedcircle:9676,doubleyodpatah:64287,doubleyodpatahhebrew:64287,downtackbelowcmb:798,downtackmod:725,dparen:9375,dsuperior:63211,dtail:598,dtopbar:396,duhiragana:12389,dukatakana:12485,dz:499,dzaltone:675,dzcaron:454,dzcurl:677,dzeabkhasiancyrillic:1249,dzecyrillic:1109,dzhecyrillic:1119,e:101,eacute:233,earth:9793,ebengali:2447,ebopomofo:12572,ebreve:277,ecandradeva:2317,ecandragujarati:2701,ecandravowelsigndeva:2373,ecandravowelsigngujarati:2757,ecaron:283,ecedillabreve:7709,echarmenian:1381,echyiwnarmenian:1415,ecircle:9428,ecircumflex:234,ecircumflexacute:7871,ecircumflexbelow:7705,ecircumflexdotbelow:7879,ecircumflexgrave:7873,ecircumflexhookabove:7875,ecircumflextilde:7877,ecyrillic:1108,edblgrave:517,edeva:2319,edieresis:235,edot:279,edotaccent:279,edotbelow:7865,eegurmukhi:2575,eematragurmukhi:2631,efcyrillic:1092,egrave:232,egujarati:2703,eharmenian:1383,ehbopomofo:12573,ehiragana:12360,ehookabove:7867,eibopomofo:12575,eight:56,eightarabic:1640,eightbengali:2542,eightcircle:9319,eightcircleinversesansserif:10129,eightdeva:2414,eighteencircle:9329,eighteenparen:9349,eighteenperiod:9369,eightgujarati:2798,eightgurmukhi:2670,eighthackarabic:1640,eighthangzhou:12328,eighthnotebeamed:9835,eightideographicparen:12839,eightinferior:8328,eightmonospace:65304,eightoldstyle:63288,eightparen:9339,eightperiod:9359,eightpersian:1784,eightroman:8567,eightsuperior:8312,eightthai:3672,einvertedbreve:519,eiotifiedcyrillic:1125,ekatakana:12456,ekatakanahalfwidth:65396,ekonkargurmukhi:2676,ekorean:12628,elcyrillic:1083,element:8712,elevencircle:9322,elevenparen:9342,elevenperiod:9362,elevenroman:8570,ellipsis:8230,ellipsisvertical:8942,emacron:275,emacronacute:7703,emacrongrave:7701,emcyrillic:1084,emdash:8212,emdashvertical:65073,emonospace:65349,emphasismarkarmenian:1371,emptyset:8709,enbopomofo:12579,encyrillic:1085,endash:8211,endashvertical:65074,endescendercyrillic:1187,eng:331,engbopomofo:12581,enghecyrillic:1189,enhookcyrillic:1224,enspace:8194,eogonek:281,eokorean:12627,eopen:603,eopenclosed:666,eopenreversed:604,eopenreversedclosed:606,eopenreversedhook:605,eparen:9376,epsilon:949,epsilontonos:941,equal:61,equalmonospace:65309,equalsmall:65126,equalsuperior:8316,equivalence:8801,erbopomofo:12582,ercyrillic:1088,ereversed:600,ereversedcyrillic:1101,escyrillic:1089,esdescendercyrillic:1195,esh:643,eshcurl:646,eshortdeva:2318,eshortvowelsigndeva:2374,eshreversedloop:426,eshsquatreversed:645,esmallhiragana:12359,esmallkatakana:12455,esmallkatakanahalfwidth:65386,estimated:8494,esuperior:63212,eta:951,etarmenian:1384,etatonos:942,eth:240,etilde:7869,etildebelow:7707,etnahtafoukhhebrew:1425,etnahtafoukhlefthebrew:1425,etnahtahebrew:1425,etnahtalefthebrew:1425,eturned:477,eukorean:12641,euro:8364,evowelsignbengali:2503,evowelsigndeva:2375,evowelsigngujarati:2759,exclam:33,exclamarmenian:1372,exclamdbl:8252,exclamdown:161,exclamdownsmall:63393,exclammonospace:65281,exclamsmall:63265,existential:8707,ezh:658,ezhcaron:495,ezhcurl:659,ezhreversed:441,ezhtail:442,f:102,fadeva:2398,fagurmukhi:2654,fahrenheit:8457,fathaarabic:1614,fathalowarabic:1614,fathatanarabic:1611,fbopomofo:12552,fcircle:9429,fdotaccent:7711,feharabic:1601,feharmenian:1414,fehfinalarabic:65234,fehinitialarabic:65235,fehmedialarabic:65236,feicoptic:997,female:9792,ff:64256,ffi:64259,ffl:64260,fi:64257,fifteencircle:9326,fifteenparen:9346,fifteenperiod:9366,figuredash:8210,filledbox:9632,filledrect:9644,finalkaf:1498,finalkafdagesh:64314,finalkafdageshhebrew:64314,finalkafhebrew:1498,finalmem:1501,finalmemhebrew:1501,finalnun:1503,finalnunhebrew:1503,finalpe:1507,finalpehebrew:1507,finaltsadi:1509,finaltsadihebrew:1509,firsttonechinese:713,fisheye:9673,fitacyrillic:1139,five:53,fivearabic:1637,fivebengali:2539,fivecircle:9316,fivecircleinversesansserif:10126,fivedeva:2411,fiveeighths:8541,fivegujarati:2795,fivegurmukhi:2667,fivehackarabic:1637,fivehangzhou:12325,fiveideographicparen:12836,fiveinferior:8325,fivemonospace:65301,fiveoldstyle:63285,fiveparen:9336,fiveperiod:9356,fivepersian:1781,fiveroman:8564,fivesuperior:8309,fivethai:3669,fl:64258,florin:402,fmonospace:65350,fmsquare:13209,fofanthai:3615,fofathai:3613,fongmanthai:3663,forall:8704,four:52,fourarabic:1636,fourbengali:2538,fourcircle:9315,fourcircleinversesansserif:10125,fourdeva:2410,fourgujarati:2794,fourgurmukhi:2666,fourhackarabic:1636,fourhangzhou:12324,fourideographicparen:12835,fourinferior:8324,fourmonospace:65300,fournumeratorbengali:2551,fouroldstyle:63284,fourparen:9335,fourperiod:9355,fourpersian:1780,fourroman:8563,foursuperior:8308,fourteencircle:9325,fourteenparen:9345,fourteenperiod:9365,fourthai:3668,fourthtonechinese:715,fparen:9377,fraction:8260,franc:8355,g:103,gabengali:2455,gacute:501,gadeva:2327,gafarabic:1711,gaffinalarabic:64403,gafinitialarabic:64404,gafmedialarabic:64405,gagujarati:2711,gagurmukhi:2583,gahiragana:12364,gakatakana:12460,gamma:947,gammalatinsmall:611,gammasuperior:736,gangiacoptic:1003,gbopomofo:12557,gbreve:287,gcaron:487,gcedilla:291,gcircle:9430,gcircumflex:285,gcommaaccent:291,gdot:289,gdotaccent:289,gecyrillic:1075,gehiragana:12370,gekatakana:12466,geometricallyequal:8785,gereshaccenthebrew:1436,gereshhebrew:1523,gereshmuqdamhebrew:1437,germandbls:223,gershayimaccenthebrew:1438,gershayimhebrew:1524,getamark:12307,ghabengali:2456,ghadarmenian:1394,ghadeva:2328,ghagujarati:2712,ghagurmukhi:2584,ghainarabic:1594,ghainfinalarabic:65230,ghaininitialarabic:65231,ghainmedialarabic:65232,ghemiddlehookcyrillic:1173,ghestrokecyrillic:1171,gheupturncyrillic:1169,ghhadeva:2394,ghhagurmukhi:2650,ghook:608,ghzsquare:13203,gihiragana:12366,gikatakana:12462,gimarmenian:1379,gimel:1490,gimeldagesh:64306,gimeldageshhebrew:64306,gimelhebrew:1490,gjecyrillic:1107,glottalinvertedstroke:446,glottalstop:660,glottalstopinverted:662,glottalstopmod:704,glottalstopreversed:661,glottalstopreversedmod:705,glottalstopreversedsuperior:740,glottalstopstroke:673,glottalstopstrokereversed:674,gmacron:7713,gmonospace:65351,gohiragana:12372,gokatakana:12468,gparen:9378,gpasquare:13228,gradient:8711,grave:96,gravebelowcmb:790,gravecmb:768,gravecomb:768,gravedeva:2387,gravelowmod:718,gravemonospace:65344,gravetonecmb:832,greater:62,greaterequal:8805,greaterequalorless:8923,greatermonospace:65310,greaterorequivalent:8819,greaterorless:8823,greateroverequal:8807,greatersmall:65125,gscript:609,gstroke:485,guhiragana:12368,guillemotleft:171,guillemotright:187,guilsinglleft:8249,guilsinglright:8250,gukatakana:12464,guramusquare:13080,gysquare:13257,h:104,haabkhasiancyrillic:1193,haaltonearabic:1729,habengali:2489,hadescendercyrillic:1203,hadeva:2361,hagujarati:2745,hagurmukhi:2617,haharabic:1581,hahfinalarabic:65186,hahinitialarabic:65187,hahiragana:12399,hahmedialarabic:65188,haitusquare:13098,hakatakana:12495,hakatakanahalfwidth:65418,halantgurmukhi:2637,hamzaarabic:1569,hamzalowarabic:1569,hangulfiller:12644,hardsigncyrillic:1098,harpoonleftbarbup:8636,harpoonrightbarbup:8640,hasquare:13258,hatafpatah:1458,hatafpatah16:1458,
hatafpatah23:1458,hatafpatah2f:1458,hatafpatahhebrew:1458,hatafpatahnarrowhebrew:1458,hatafpatahquarterhebrew:1458,hatafpatahwidehebrew:1458,hatafqamats:1459,hatafqamats1b:1459,hatafqamats28:1459,hatafqamats34:1459,hatafqamatshebrew:1459,hatafqamatsnarrowhebrew:1459,hatafqamatsquarterhebrew:1459,hatafqamatswidehebrew:1459,hatafsegol:1457,hatafsegol17:1457,hatafsegol24:1457,hatafsegol30:1457,hatafsegolhebrew:1457,hatafsegolnarrowhebrew:1457,hatafsegolquarterhebrew:1457,hatafsegolwidehebrew:1457,hbar:295,hbopomofo:12559,hbrevebelow:7723,hcedilla:7721,hcircle:9431,hcircumflex:293,hdieresis:7719,hdotaccent:7715,hdotbelow:7717,he:1492,heart:9829,heartsuitblack:9829,heartsuitwhite:9825,hedagesh:64308,hedageshhebrew:64308,hehaltonearabic:1729,heharabic:1607,hehebrew:1492,hehfinalaltonearabic:64423,hehfinalalttwoarabic:65258,hehfinalarabic:65258,hehhamzaabovefinalarabic:64421,hehhamzaaboveisolatedarabic:64420,hehinitialaltonearabic:64424,hehinitialarabic:65259,hehiragana:12408,hehmedialaltonearabic:64425,hehmedialarabic:65260,heiseierasquare:13179,hekatakana:12504,hekatakanahalfwidth:65421,hekutaarusquare:13110,henghook:615,herutusquare:13113,het:1495,hethebrew:1495,hhook:614,hhooksuperior:689,hieuhacirclekorean:12923,hieuhaparenkorean:12827,hieuhcirclekorean:12909,hieuhkorean:12622,hieuhparenkorean:12813,hihiragana:12402,hikatakana:12498,hikatakanahalfwidth:65419,hiriq:1460,hiriq14:1460,hiriq21:1460,hiriq2d:1460,hiriqhebrew:1460,hiriqnarrowhebrew:1460,hiriqquarterhebrew:1460,hiriqwidehebrew:1460,hlinebelow:7830,hmonospace:65352,hoarmenian:1392,hohipthai:3627,hohiragana:12411,hokatakana:12507,hokatakanahalfwidth:65422,holam:1465,holam19:1465,holam26:1465,holam32:1465,holamhebrew:1465,holamnarrowhebrew:1465,holamquarterhebrew:1465,holamwidehebrew:1465,honokhukthai:3630,hookabovecomb:777,hookcmb:777,hookpalatalizedbelowcmb:801,hookretroflexbelowcmb:802,hoonsquare:13122,horicoptic:1001,horizontalbar:8213,horncmb:795,hotsprings:9832,house:8962,hparen:9379,hsuperior:688,hturned:613,huhiragana:12405,huiitosquare:13107,hukatakana:12501,hukatakanahalfwidth:65420,hungarumlaut:733,hungarumlautcmb:779,hv:405,hyphen:45,hypheninferior:63205,hyphenmonospace:65293,hyphensmall:65123,hyphensuperior:63206,hyphentwo:8208,i:105,iacute:237,iacyrillic:1103,ibengali:2439,ibopomofo:12583,ibreve:301,icaron:464,icircle:9432,icircumflex:238,icyrillic:1110,idblgrave:521,ideographearthcircle:12943,ideographfirecircle:12939,ideographicallianceparen:12863,ideographiccallparen:12858,ideographiccentrecircle:12965,ideographicclose:12294,ideographiccomma:12289,ideographiccommaleft:65380,ideographiccongratulationparen:12855,ideographiccorrectcircle:12963,ideographicearthparen:12847,ideographicenterpriseparen:12861,ideographicexcellentcircle:12957,ideographicfestivalparen:12864,ideographicfinancialcircle:12950,ideographicfinancialparen:12854,ideographicfireparen:12843,ideographichaveparen:12850,ideographichighcircle:12964,ideographiciterationmark:12293,ideographiclaborcircle:12952,ideographiclaborparen:12856,ideographicleftcircle:12967,ideographiclowcircle:12966,ideographicmedicinecircle:12969,ideographicmetalparen:12846,ideographicmoonparen:12842,ideographicnameparen:12852,ideographicperiod:12290,ideographicprintcircle:12958,ideographicreachparen:12867,ideographicrepresentparen:12857,ideographicresourceparen:12862,ideographicrightcircle:12968,ideographicsecretcircle:12953,ideographicselfparen:12866,ideographicsocietyparen:12851,ideographicspace:12288,ideographicspecialparen:12853,ideographicstockparen:12849,ideographicstudyparen:12859,ideographicsunparen:12848,ideographicsuperviseparen:12860,ideographicwaterparen:12844,ideographicwoodparen:12845,ideographiczero:12295,ideographmetalcircle:12942,ideographmooncircle:12938,ideographnamecircle:12948,ideographsuncircle:12944,ideographwatercircle:12940,ideographwoodcircle:12941,ideva:2311,idieresis:239,idieresisacute:7727,idieresiscyrillic:1253,idotbelow:7883,iebrevecyrillic:1239,iecyrillic:1077,ieungacirclekorean:12917,ieungaparenkorean:12821,ieungcirclekorean:12903,ieungkorean:12615,ieungparenkorean:12807,igrave:236,igujarati:2695,igurmukhi:2567,ihiragana:12356,ihookabove:7881,iibengali:2440,iicyrillic:1080,iideva:2312,iigujarati:2696,iigurmukhi:2568,iimatragurmukhi:2624,iinvertedbreve:523,iishortcyrillic:1081,iivowelsignbengali:2496,iivowelsigndeva:2368,iivowelsigngujarati:2752,ij:307,ikatakana:12452,ikatakanahalfwidth:65394,ikorean:12643,ilde:732,iluyhebrew:1452,imacron:299,imacroncyrillic:1251,imageorapproximatelyequal:8787,imatragurmukhi:2623,imonospace:65353,increment:8710,infinity:8734,iniarmenian:1387,integral:8747,integralbottom:8993,integralbt:8993,integralex:63733,integraltop:8992,integraltp:8992,intersection:8745,intisquare:13061,invbullet:9688,invcircle:9689,invsmileface:9787,iocyrillic:1105,iogonek:303,iota:953,iotadieresis:970,iotadieresistonos:912,iotalatin:617,iotatonos:943,iparen:9380,irigurmukhi:2674,ismallhiragana:12355,ismallkatakana:12451,ismallkatakanahalfwidth:65384,issharbengali:2554,istroke:616,isuperior:63213,iterationhiragana:12445,iterationkatakana:12541,itilde:297,itildebelow:7725,iubopomofo:12585,iucyrillic:1102,ivowelsignbengali:2495,ivowelsigndeva:2367,ivowelsigngujarati:2751,izhitsacyrillic:1141,izhitsadblgravecyrillic:1143,j:106,jaarmenian:1393,jabengali:2460,jadeva:2332,jagujarati:2716,jagurmukhi:2588,jbopomofo:12560,jcaron:496,jcircle:9433,jcircumflex:309,jcrossedtail:669,jdotlessstroke:607,jecyrillic:1112,jeemarabic:1580,jeemfinalarabic:65182,jeeminitialarabic:65183,jeemmedialarabic:65184,jeharabic:1688,jehfinalarabic:64395,jhabengali:2461,jhadeva:2333,jhagujarati:2717,jhagurmukhi:2589,jheharmenian:1403,jis:12292,jmonospace:65354,jparen:9381,jsuperior:690,k:107,kabashkircyrillic:1185,kabengali:2453,kacute:7729,kacyrillic:1082,kadescendercyrillic:1179,kadeva:2325,kaf:1499,kafarabic:1603,kafdagesh:64315,kafdageshhebrew:64315,kaffinalarabic:65242,kafhebrew:1499,kafinitialarabic:65243,kafmedialarabic:65244,kafrafehebrew:64333,kagujarati:2709,kagurmukhi:2581,kahiragana:12363,kahookcyrillic:1220,kakatakana:12459,kakatakanahalfwidth:65398,kappa:954,kappasymbolgreek:1008,kapyeounmieumkorean:12657,kapyeounphieuphkorean:12676,kapyeounpieupkorean:12664,kapyeounssangpieupkorean:12665,karoriisquare:13069,kashidaautoarabic:1600,kashidaautonosidebearingarabic:1600,kasmallkatakana:12533,kasquare:13188,kasraarabic:1616,kasratanarabic:1613,kastrokecyrillic:1183,katahiraprolongmarkhalfwidth:65392,kaverticalstrokecyrillic:1181,kbopomofo:12558,kcalsquare:13193,kcaron:489,kcedilla:311,kcircle:9434,kcommaaccent:311,kdotbelow:7731,keharmenian:1412,kehiragana:12369,kekatakana:12465,kekatakanahalfwidth:65401,kenarmenian:1391,kesmallkatakana:12534,kgreenlandic:312,khabengali:2454,khacyrillic:1093,khadeva:2326,khagujarati:2710,khagurmukhi:2582,khaharabic:1582,khahfinalarabic:65190,khahinitialarabic:65191,khahmedialarabic:65192,kheicoptic:999,khhadeva:2393,khhagurmukhi:2649,khieukhacirclekorean:12920,khieukhaparenkorean:12824,khieukhcirclekorean:12906,khieukhkorean:12619,khieukhparenkorean:12810,khokhaithai:3586,khokhonthai:3589,khokhuatthai:3587,khokhwaithai:3588,khomutthai:3675,khook:409,khorakhangthai:3590,khzsquare:13201,kihiragana:12365,kikatakana:12461,kikatakanahalfwidth:65399,kiroguramusquare:13077,kiromeetorusquare:13078,kirosquare:13076,kiyeokacirclekorean:12910,kiyeokaparenkorean:12814,kiyeokcirclekorean:12896,kiyeokkorean:12593,kiyeokparenkorean:12800,kiyeoksioskorean:12595,kjecyrillic:1116,klinebelow:7733,klsquare:13208,kmcubedsquare:13222,kmonospace:65355,kmsquaredsquare:13218,kohiragana:12371,kohmsquare:13248,kokaithai:3585,kokatakana:12467,kokatakanahalfwidth:65402,kooposquare:13086,koppacyrillic:1153,koreanstandardsymbol:12927,koroniscmb:835,kparen:9382,kpasquare:13226,ksicyrillic:1135,ktsquare:13263,kturned:670,kuhiragana:12367,kukatakana:12463,kukatakanahalfwidth:65400,kvsquare:13240,kwsquare:13246,l:108,labengali:2482,lacute:314,ladeva:2354,lagujarati:2738,lagurmukhi:2610,lakkhangyaothai:3653,lamaleffinalarabic:65276,lamalefhamzaabovefinalarabic:65272,lamalefhamzaaboveisolatedarabic:65271,lamalefhamzabelowfinalarabic:65274,lamalefhamzabelowisolatedarabic:65273,lamalefisolatedarabic:65275,lamalefmaddaabovefinalarabic:65270,lamalefmaddaaboveisolatedarabic:65269,lamarabic:1604,lambda:955,lambdastroke:411,lamed:1500,lameddagesh:64316,lameddageshhebrew:64316,lamedhebrew:1500,lamfinalarabic:65246,lamhahinitialarabic:64714,laminitialarabic:65247,lamjeeminitialarabic:64713,lamkhahinitialarabic:64715,lamlamhehisolatedarabic:65010,lammedialarabic:65248,lammeemhahinitialarabic:64904,lammeeminitialarabic:64716,largecircle:9711,lbar:410,lbelt:620,lbopomofo:12556,lcaron:318,lcedilla:316,lcircle:9435,lcircumflexbelow:7741,lcommaaccent:316,ldot:320,ldotaccent:320,ldotbelow:7735,ldotbelowmacron:7737,leftangleabovecmb:794,lefttackbelowcmb:792,less:60,lessequal:8804,lessequalorgreater:8922,lessmonospace:65308,lessorequivalent:8818,lessorgreater:8822,lessoverequal:8806,lesssmall:65124,lezh:622,lfblock:9612,lhookretroflex:621,lira:8356,liwnarmenian:1388,lj:457,ljecyrillic:1113,ll:63168,lladeva:2355,llagujarati:2739,llinebelow:7739,llladeva:2356,llvocalicbengali:2529,llvocalicdeva:2401,llvocalicvowelsignbengali:2531,llvocalicvowelsigndeva:2403,lmiddletilde:619,lmonospace:65356,lmsquare:13264,lochulathai:3628,logicaland:8743,logicalnot:172,logicalnotreversed:8976,logicalor:8744,lolingthai:3621,longs:383,lowlinecenterline:65102,lowlinecmb:818,lowlinedashed:65101,lozenge:9674,lparen:9383,lslash:322,lsquare:8467,lsuperior:63214,ltshade:9617,luthai:3622,lvocalicbengali:2444,lvocalicdeva:2316,lvocalicvowelsignbengali:2530,lvocalicvowelsigndeva:2402,lxsquare:13267,m:109,mabengali:2478,macron:175,macronbelowcmb:817,macroncmb:772,macronlowmod:717,macronmonospace:65507,macute:7743,madeva:2350,magujarati:2734,magurmukhi:2606,mahapakhhebrew:1444,mahapakhlefthebrew:1444,mahiragana:12414,maichattawalowleftthai:63637,maichattawalowrightthai:63636,maichattawathai:3659,maichattawaupperleftthai:63635,maieklowleftthai:63628,maieklowrightthai:63627,maiekthai:3656,maiekupperleftthai:63626,maihanakatleftthai:63620,maihanakatthai:3633,maitaikhuleftthai:63625,maitaikhuthai:3655,maitholowleftthai:63631,maitholowrightthai:63630,maithothai:3657,maithoupperleftthai:63629,maitrilowleftthai:63634,maitrilowrightthai:63633,maitrithai:3658,maitriupperleftthai:63632,maiyamokthai:3654,makatakana:12510,makatakanahalfwidth:65423,male:9794,mansyonsquare:13127,maqafhebrew:1470,mars:9794,masoracirclehebrew:1455,masquare:13187,mbopomofo:12551,mbsquare:13268,mcircle:9436,mcubedsquare:13221,mdotaccent:7745,mdotbelow:7747,meemarabic:1605,meemfinalarabic:65250,meeminitialarabic:65251,meemmedialarabic:65252,meemmeeminitialarabic:64721,meemmeemisolatedarabic:64584,meetorusquare:13133,mehiragana:12417,meizierasquare:13182,mekatakana:12513,mekatakanahalfwidth:65426,mem:1502,memdagesh:64318,memdageshhebrew:64318,memhebrew:1502,menarmenian:1396,merkhahebrew:1445,merkhakefulahebrew:1446,merkhakefulalefthebrew:1446,merkhalefthebrew:1445,mhook:625,mhzsquare:13202,middledotkatakanahalfwidth:65381,middot:183,mieumacirclekorean:12914,mieumaparenkorean:12818,mieumcirclekorean:12900,mieumkorean:12609,mieumpansioskorean:12656,mieumparenkorean:12804,mieumpieupkorean:12654,mieumsioskorean:12655,mihiragana:12415,mikatakana:12511,mikatakanahalfwidth:65424,minus:8722,minusbelowcmb:800,minuscircle:8854,minusmod:727,minusplus:8723,minute:8242,miribaarusquare:13130,mirisquare:13129,mlonglegturned:624,mlsquare:13206,mmcubedsquare:13219,mmonospace:65357,mmsquaredsquare:13215,mohiragana:12418,mohmsquare:13249,mokatakana:12514,mokatakanahalfwidth:65427,molsquare:13270,momathai:3617,moverssquare:13223,moverssquaredsquare:13224,mparen:9384,mpasquare:13227,mssquare:13235,msuperior:63215,mturned:623,mu:181,mu1:181,muasquare:13186,muchgreater:8811,muchless:8810,mufsquare:13196,mugreek:956,mugsquare:13197,muhiragana:12416,mukatakana:12512,mukatakanahalfwidth:65425,mulsquare:13205,multiply:215,mumsquare:13211,munahhebrew:1443,munahlefthebrew:1443,musicalnote:9834,musicalnotedbl:9835,musicflatsign:9837,musicsharpsign:9839,mussquare:13234,muvsquare:13238,muwsquare:13244,mvmegasquare:13241,mvsquare:13239,mwmegasquare:13247,mwsquare:13245,n:110,nabengali:2472,nabla:8711,nacute:324,nadeva:2344,nagujarati:2728,nagurmukhi:2600,nahiragana:12394,nakatakana:12490,nakatakanahalfwidth:65413,napostrophe:329,nasquare:13185,nbopomofo:12555,nbspace:160,ncaron:328,ncedilla:326,ncircle:9437,ncircumflexbelow:7755,ncommaaccent:326,ndotaccent:7749,ndotbelow:7751,nehiragana:12397,nekatakana:12493,nekatakanahalfwidth:65416,newsheqelsign:8362,nfsquare:13195,ngabengali:2457,ngadeva:2329,ngagujarati:2713,ngagurmukhi:2585,ngonguthai:3591,nhiragana:12435,nhookleft:626,nhookretroflex:627,nieunacirclekorean:12911,nieunaparenkorean:12815,nieuncieuckorean:12597,nieuncirclekorean:12897,nieunhieuhkorean:12598,nieunkorean:12596,nieunpansioskorean:12648,nieunparenkorean:12801,nieunsioskorean:12647,nieuntikeutkorean:12646,nihiragana:12395,nikatakana:12491,nikatakanahalfwidth:65414,nikhahitleftthai:63641,nikhahitthai:3661,nine:57,ninearabic:1641,ninebengali:2543,ninecircle:9320,ninecircleinversesansserif:10130,ninedeva:2415,ninegujarati:2799,ninegurmukhi:2671,ninehackarabic:1641,ninehangzhou:12329,nineideographicparen:12840,nineinferior:8329,ninemonospace:65305,nineoldstyle:63289,nineparen:9340,nineperiod:9360,ninepersian:1785,nineroman:8568,ninesuperior:8313,nineteencircle:9330,nineteenparen:9350,nineteenperiod:9370,ninethai:3673,nj:460,njecyrillic:1114,nkatakana:12531,nkatakanahalfwidth:65437,nlegrightlong:414,nlinebelow:7753,nmonospace:65358,nmsquare:13210,nnabengali:2467,nnadeva:2339,nnagujarati:2723,nnagurmukhi:2595,nnnadeva:2345,nohiragana:12398,nokatakana:12494,nokatakanahalfwidth:65417,nonbreakingspace:160,nonenthai:3603,nonuthai:3609,noonarabic:1606,noonfinalarabic:65254,noonghunnaarabic:1722,noonghunnafinalarabic:64415,nooninitialarabic:65255,noonjeeminitialarabic:64722,noonjeemisolatedarabic:64587,noonmedialarabic:65256,noonmeeminitialarabic:64725,noonmeemisolatedarabic:64590,noonnoonfinalarabic:64653,notcontains:8716,notelement:8713,notelementof:8713,notequal:8800,notgreater:8815,notgreaternorequal:8817,notgreaternorless:8825,notidentical:8802,notless:8814,notlessnorequal:8816,notparallel:8742,notprecedes:8832,notsubset:8836,notsucceeds:8833,notsuperset:8837,nowarmenian:1398,nparen:9385,nssquare:13233,nsuperior:8319,ntilde:241,nu:957,nuhiragana:12396,nukatakana:12492,nukatakanahalfwidth:65415,nuktabengali:2492,nuktadeva:2364,nuktagujarati:2748,nuktagurmukhi:2620,numbersign:35,numbersignmonospace:65283,numbersignsmall:65119,numeralsigngreek:884,numeralsignlowergreek:885,numero:8470,nun:1504,nundagesh:64320,nundageshhebrew:64320,nunhebrew:1504,nvsquare:13237,nwsquare:13243,nyabengali:2462,nyadeva:2334,nyagujarati:2718,nyagurmukhi:2590,o:111,oacute:243,oangthai:3629,obarred:629,obarredcyrillic:1257,obarreddieresiscyrillic:1259,obengali:2451,obopomofo:12571,obreve:335,ocandradeva:2321,ocandragujarati:2705,ocandravowelsigndeva:2377,ocandravowelsigngujarati:2761,ocaron:466,ocircle:9438,ocircumflex:244,ocircumflexacute:7889,ocircumflexdotbelow:7897,ocircumflexgrave:7891,ocircumflexhookabove:7893,ocircumflextilde:7895,ocyrillic:1086,odblacute:337,odblgrave:525,odeva:2323,odieresis:246,odieresiscyrillic:1255,odotbelow:7885,oe:339,oekorean:12634,ogonek:731,ogonekcmb:808,ograve:242,ogujarati:2707,oharmenian:1413,ohiragana:12362,ohookabove:7887,ohorn:417,ohornacute:7899,ohorndotbelow:7907,ohorngrave:7901,ohornhookabove:7903,ohorntilde:7905,ohungarumlaut:337,oi:419,oinvertedbreve:527,okatakana:12458,okatakanahalfwidth:65397,okorean:12631,olehebrew:1451,omacron:333,omacronacute:7763,omacrongrave:7761,omdeva:2384,omega:969,omega1:982,omegacyrillic:1121,omegalatinclosed:631,omegaroundcyrillic:1147,omegatitlocyrillic:1149,omegatonos:974,omgujarati:2768,omicron:959,omicrontonos:972,omonospace:65359,one:49,onearabic:1633,onebengali:2535,onecircle:9312,onecircleinversesansserif:10122,onedeva:2407,onedotenleader:8228,oneeighth:8539,onefitted:63196,onegujarati:2791,onegurmukhi:2663,onehackarabic:1633,onehalf:189,onehangzhou:12321,oneideographicparen:12832,oneinferior:8321,onemonospace:65297,onenumeratorbengali:2548,oneoldstyle:63281,oneparen:9332,oneperiod:9352,onepersian:1777,onequarter:188,oneroman:8560,onesuperior:185,onethai:3665,onethird:8531,oogonek:491,oogonekmacron:493,oogurmukhi:2579,oomatragurmukhi:2635,oopen:596,oparen:9386,openbullet:9702,option:8997,ordfeminine:170,ordmasculine:186,orthogonal:8735,oshortdeva:2322,oshortvowelsigndeva:2378,oslash:248,oslashacute:511,osmallhiragana:12361,osmallkatakana:12457,osmallkatakanahalfwidth:65387,ostrokeacute:511,osuperior:63216,otcyrillic:1151,otilde:245,otildeacute:7757,otildedieresis:7759,oubopomofo:12577,overline:8254,overlinecenterline:65098,overlinecmb:773,overlinedashed:65097,overlinedblwavy:65100,overlinewavy:65099,overscore:175,ovowelsignbengali:2507,ovowelsigndeva:2379,ovowelsigngujarati:2763,p:112,paampssquare:13184,paasentosquare:13099,pabengali:2474,pacute:7765,padeva:2346,pagedown:8671,pageup:8670,pagujarati:2730,pagurmukhi:2602,pahiragana:12401,paiyannoithai:3631,pakatakana:12497,palatalizationcyrilliccmb:1156,palochkacyrillic:1216,pansioskorean:12671,paragraph:182,parallel:8741,parenleft:40,parenleftaltonearabic:64830,parenleftbt:63725,parenleftex:63724,parenleftinferior:8333,parenleftmonospace:65288,parenleftsmall:65113,parenleftsuperior:8317,parenlefttp:63723,parenleftvertical:65077,parenright:41,parenrightaltonearabic:64831,parenrightbt:63736,parenrightex:63735,parenrightinferior:8334,parenrightmonospace:65289,parenrightsmall:65114,parenrightsuperior:8318,parenrighttp:63734,parenrightvertical:65078,partialdiff:8706,paseqhebrew:1472,pashtahebrew:1433,pasquare:13225,patah:1463,patah11:1463,patah1d:1463,patah2a:1463,patahhebrew:1463,patahnarrowhebrew:1463,patahquarterhebrew:1463,patahwidehebrew:1463,pazerhebrew:1441,pbopomofo:12550,pcircle:9439,pdotaccent:7767,pe:1508,pecyrillic:1087,pedagesh:64324,pedageshhebrew:64324,peezisquare:13115,pefinaldageshhebrew:64323,peharabic:1662,peharmenian:1402,pehebrew:1508,pehfinalarabic:64343,pehinitialarabic:64344,pehiragana:12410,pehmedialarabic:64345,pekatakana:12506,pemiddlehookcyrillic:1191,perafehebrew:64334,percent:37,percentarabic:1642,percentmonospace:65285,percentsmall:65130,period:46,periodarmenian:1417,periodcentered:183,periodhalfwidth:65377,periodinferior:63207,periodmonospace:65294,periodsmall:65106,periodsuperior:63208,perispomenigreekcmb:834,perpendicular:8869,perthousand:8240,peseta:8359,pfsquare:13194,phabengali:2475,phadeva:2347,phagujarati:2731,phagurmukhi:2603,phi:966,phi1:981,phieuphacirclekorean:12922,phieuphaparenkorean:12826,phieuphcirclekorean:12908,phieuphkorean:12621,phieuphparenkorean:12812,philatin:632,phinthuthai:3642,phisymbolgreek:981,phook:421,phophanthai:3614,phophungthai:3612,phosamphaothai:3616,pi:960,pieupacirclekorean:12915,pieupaparenkorean:12819,pieupcieuckorean:12662,pieupcirclekorean:12901,pieupkiyeokkorean:12658,pieupkorean:12610,pieupparenkorean:12805,pieupsioskiyeokkorean:12660,pieupsioskorean:12612,pieupsiostikeutkorean:12661,pieupthieuthkorean:12663,pieuptikeutkorean:12659,pihiragana:12404,pikatakana:12500,pisymbolgreek:982,piwrarmenian:1411,plus:43,plusbelowcmb:799,pluscircle:8853,plusminus:177,plusmod:726,plusmonospace:65291,plussmall:65122,plussuperior:8314,pmonospace:65360,pmsquare:13272,pohiragana:12413,pointingindexdownwhite:9759,pointingindexleftwhite:9756,pointingindexrightwhite:9758,pointingindexupwhite:9757,pokatakana:12509,poplathai:3611,postalmark:12306,postalmarkface:12320,pparen:9387,precedes:8826,prescription:8478,primemod:697,primereversed:8245,product:8719,projective:8965,prolongedkana:12540,propellor:8984,propersubset:8834,propersuperset:8835,proportion:8759,proportional:8733,psi:968,psicyrillic:1137,psilipneumatacyrilliccmb:1158,pssquare:13232,puhiragana:12407,pukatakana:12503,pvsquare:13236,pwsquare:13242,q:113,qadeva:2392,qadmahebrew:1448,qafarabic:1602,qaffinalarabic:65238,qafinitialarabic:65239,qafmedialarabic:65240,qamats:1464,qamats10:1464,qamats1a:1464,qamats1c:1464,qamats27:1464,qamats29:1464,qamats33:1464,qamatsde:1464,qamatshebrew:1464,qamatsnarrowhebrew:1464,qamatsqatanhebrew:1464,qamatsqatannarrowhebrew:1464,qamatsqatanquarterhebrew:1464,qamatsqatanwidehebrew:1464,qamatsquarterhebrew:1464,qamatswidehebrew:1464,qarneyparahebrew:1439,qbopomofo:12561,qcircle:9440,qhook:672,qmonospace:65361,qof:1511,qofdagesh:64327,qofdageshhebrew:64327,qofhebrew:1511,qparen:9388,quarternote:9833,qubuts:1467,qubuts18:1467,qubuts25:1467,qubuts31:1467,qubutshebrew:1467,qubutsnarrowhebrew:1467,qubutsquarterhebrew:1467,qubutswidehebrew:1467,question:63,questionarabic:1567,questionarmenian:1374,questiondown:191,questiondownsmall:63423,questiongreek:894,questionmonospace:65311,questionsmall:63295,quotedbl:34,quotedblbase:8222,quotedblleft:8220,quotedblmonospace:65282,quotedblprime:12318,quotedblprimereversed:12317,quotedblright:8221,quoteleft:8216,quoteleftreversed:8219,quotereversed:8219,quoteright:8217,quoterightn:329,quotesinglbase:8218,quotesingle:39,quotesinglemonospace:65287,r:114,raarmenian:1404,rabengali:2480,racute:341,radeva:2352,radical:8730,radicalex:63717,radoverssquare:13230,radoverssquaredsquare:13231,radsquare:13229,rafe:1471,rafehebrew:1471,ragujarati:2736,ragurmukhi:2608,rahiragana:12425,rakatakana:12521,rakatakanahalfwidth:65431,ralowerdiagonalbengali:2545,ramiddlediagonalbengali:2544,ramshorn:612,ratio:8758,rbopomofo:12566,rcaron:345,rcedilla:343,rcircle:9441,rcommaaccent:343,rdblgrave:529,rdotaccent:7769,rdotbelow:7771,rdotbelowmacron:7773,referencemark:8251,reflexsubset:8838,reflexsuperset:8839,registered:174,registersans:63720,registerserif:63194,reharabic:1585,reharmenian:1408,rehfinalarabic:65198,rehiragana:12428,rekatakana:12524,rekatakanahalfwidth:65434,resh:1512,reshdageshhebrew:64328,reshhebrew:1512,reversedtilde:8765,reviahebrew:1431,reviamugrashhebrew:1431,revlogicalnot:8976,rfishhook:638,rfishhookreversed:639,rhabengali:2525,rhadeva:2397,rho:961,rhook:637,rhookturned:635,rhookturnedsuperior:693,rhosymbolgreek:1009,rhotichookmod:734,rieulacirclekorean:12913,rieulaparenkorean:12817,rieulcirclekorean:12899,rieulhieuhkorean:12608,rieulkiyeokkorean:12602,rieulkiyeoksioskorean:12649,rieulkorean:12601,rieulmieumkorean:12603,rieulpansioskorean:12652,rieulparenkorean:12803,rieulphieuphkorean:12607,rieulpieupkorean:12604,rieulpieupsioskorean:12651,rieulsioskorean:12605,rieulthieuthkorean:12606,rieultikeutkorean:12650,rieulyeorinhieuhkorean:12653,rightangle:8735,righttackbelowcmb:793,righttriangle:8895,rihiragana:12426,rikatakana:12522,rikatakanahalfwidth:65432,ring:730,ringbelowcmb:805,ringcmb:778,ringhalfleft:703,ringhalfleftarmenian:1369,ringhalfleftbelowcmb:796,ringhalfleftcentered:723,ringhalfright:702,ringhalfrightbelowcmb:825,ringhalfrightcentered:722,rinvertedbreve:531,rittorusquare:13137,rlinebelow:7775,rlongleg:636,rlonglegturned:634,rmonospace:65362,rohiragana:12429,rokatakana:12525,rokatakanahalfwidth:65435,roruathai:3619,rparen:9389,rrabengali:2524,rradeva:2353,rragurmukhi:2652,rreharabic:1681,rrehfinalarabic:64397,rrvocalicbengali:2528,rrvocalicdeva:2400,rrvocalicgujarati:2784,rrvocalicvowelsignbengali:2500,rrvocalicvowelsigndeva:2372,rrvocalicvowelsigngujarati:2756,rsuperior:63217,rtblock:9616,rturned:633,rturnedsuperior:692,ruhiragana:12427,rukatakana:12523,rukatakanahalfwidth:65433,rupeemarkbengali:2546,rupeesignbengali:2547,rupiah:63197,ruthai:3620,rvocalicbengali:2443,rvocalicdeva:2315,rvocalicgujarati:2699,rvocalicvowelsignbengali:2499,rvocalicvowelsigndeva:2371,rvocalicvowelsigngujarati:2755,s:115,sabengali:2488,sacute:347,sacutedotaccent:7781,sadarabic:1589,sadeva:2360,sadfinalarabic:65210,sadinitialarabic:65211,sadmedialarabic:65212,sagujarati:2744,sagurmukhi:2616,sahiragana:12373,sakatakana:12469,sakatakanahalfwidth:65403,sallallahoualayhewasallamarabic:65018,samekh:1505,samekhdagesh:64321,samekhdageshhebrew:64321,samekhhebrew:1505,saraaathai:3634,saraaethai:3649,saraaimaimalaithai:3652,saraaimaimuanthai:3651,saraamthai:3635,saraathai:3632,saraethai:3648,saraiileftthai:63622,saraiithai:3637,saraileftthai:63621,saraithai:3636,saraothai:3650,saraueeleftthai:63624,saraueethai:3639,saraueleftthai:63623,sarauethai:3638,sarauthai:3640,sarauuthai:3641,sbopomofo:12569,scaron:353,scarondotaccent:7783,scedilla:351,schwa:601,schwacyrillic:1241,schwadieresiscyrillic:1243,schwahook:602,scircle:9442,scircumflex:349,scommaaccent:537,sdotaccent:7777,sdotbelow:7779,sdotbelowdotaccent:7785,seagullbelowcmb:828,second:8243,secondtonechinese:714,section:167,seenarabic:1587,seenfinalarabic:65202,seeninitialarabic:65203,seenmedialarabic:65204,segol:1462,segol13:1462,segol1f:1462,segol2c:1462,segolhebrew:1462,segolnarrowhebrew:1462,segolquarterhebrew:1462,segoltahebrew:1426,segolwidehebrew:1462,seharmenian:1405,sehiragana:12379,sekatakana:12475,sekatakanahalfwidth:65406,semicolon:59,semicolonarabic:1563,semicolonmonospace:65307,semicolonsmall:65108,semivoicedmarkkana:12444,semivoicedmarkkanahalfwidth:65439,sentisquare:13090,sentosquare:13091,seven:55,sevenarabic:1639,sevenbengali:2541,sevencircle:9318,sevencircleinversesansserif:10128,sevendeva:2413,seveneighths:8542,sevengujarati:2797,sevengurmukhi:2669,sevenhackarabic:1639,sevenhangzhou:12327,sevenideographicparen:12838,seveninferior:8327,sevenmonospace:65303,sevenoldstyle:63287,sevenparen:9338,sevenperiod:9358,sevenpersian:1783,sevenroman:8566,sevensuperior:8311,seventeencircle:9328,seventeenparen:9348,seventeenperiod:9368,seventhai:3671,sfthyphen:173,shaarmenian:1399,shabengali:2486,shacyrillic:1096,shaddaarabic:1617,shaddadammaarabic:64609,shaddadammatanarabic:64606,shaddafathaarabic:64608,shaddakasraarabic:64610,shaddakasratanarabic:64607,shade:9618,shadedark:9619,shadelight:9617,shademedium:9618,shadeva:2358,shagujarati:2742,shagurmukhi:2614,shalshelethebrew:1427,shbopomofo:12565,shchacyrillic:1097,sheenarabic:1588,sheenfinalarabic:65206,sheeninitialarabic:65207,sheenmedialarabic:65208,sheicoptic:995,sheqel:8362,sheqelhebrew:8362,sheva:1456,sheva115:1456,sheva15:1456,sheva22:1456,sheva2e:1456,shevahebrew:1456,shevanarrowhebrew:1456,shevaquarterhebrew:1456,shevawidehebrew:1456,shhacyrillic:1211,shimacoptic:1005,shin:1513,shindagesh:64329,shindageshhebrew:64329,shindageshshindot:64300,shindageshshindothebrew:64300,shindageshsindot:64301,shindageshsindothebrew:64301,shindothebrew:1473,shinhebrew:1513,shinshindot:64298,shinshindothebrew:64298,shinsindot:64299,shinsindothebrew:64299,shook:642,sigma:963,sigma1:962,sigmafinal:962,sigmalunatesymbolgreek:1010,sihiragana:12375,sikatakana:12471,sikatakanahalfwidth:65404,siluqhebrew:1469,siluqlefthebrew:1469,similar:8764,sindothebrew:1474,siosacirclekorean:12916,siosaparenkorean:12820,sioscieuckorean:12670,sioscirclekorean:12902,sioskiyeokkorean:12666,sioskorean:12613,siosnieunkorean:12667,siosparenkorean:12806,siospieupkorean:12669,siostikeutkorean:12668,six:54,sixarabic:1638,sixbengali:2540,sixcircle:9317,sixcircleinversesansserif:10127,sixdeva:2412,sixgujarati:2796,sixgurmukhi:2668,sixhackarabic:1638,sixhangzhou:12326,sixideographicparen:12837,sixinferior:8326,sixmonospace:65302,sixoldstyle:63286,sixparen:9337,sixperiod:9357,sixpersian:1782,sixroman:8565,sixsuperior:8310,sixteencircle:9327,sixteencurrencydenominatorbengali:2553,sixteenparen:9347,sixteenperiod:9367,sixthai:3670,slash:47,slashmonospace:65295,slong:383,slongdotaccent:7835,smileface:9786,smonospace:65363,sofpasuqhebrew:1475,softhyphen:173,softsigncyrillic:1100,sohiragana:12381,sokatakana:12477,sokatakanahalfwidth:65407,soliduslongoverlaycmb:824,solidusshortoverlaycmb:823,sorusithai:3625,sosalathai:3624,sosothai:3595,sosuathai:3626,space:32,spacehackarabic:32,spade:9824,spadesuitblack:9824,spadesuitwhite:9828,sparen:9390,squarebelowcmb:827,squarecc:13252,squarecm:13213,squarediagonalcrosshatchfill:9641,squarehorizontalfill:9636,squarekg:13199,squarekm:13214,squarekmcapital:13262,squareln:13265,squarelog:13266,squaremg:13198,squaremil:13269,squaremm:13212,squaremsquared:13217,squareorthogonalcrosshatchfill:9638,squareupperlefttolowerrightfill:9639,squareupperrighttolowerleftfill:9640,squareverticalfill:9637,squarewhitewithsmallblack:9635,srsquare:13275,ssabengali:2487,ssadeva:2359,ssagujarati:2743,ssangcieuckorean:12617,ssanghieuhkorean:12677,ssangieungkorean:12672,ssangkiyeokkorean:12594,ssangnieunkorean:12645,ssangpieupkorean:12611,ssangsioskorean:12614,ssangtikeutkorean:12600,ssuperior:63218,sterling:163,sterlingmonospace:65505,strokelongoverlaycmb:822,strokeshortoverlaycmb:821,subset:8834,subsetnotequal:8842,subsetorequal:8838,succeeds:8827,suchthat:8715,suhiragana:12377,sukatakana:12473,sukatakanahalfwidth:65405,sukunarabic:1618,summation:8721,sun:9788,superset:8835,supersetnotequal:8843,supersetorequal:8839,svsquare:13276,syouwaerasquare:13180,t:116,tabengali:2468,tackdown:8868,tackleft:8867,tadeva:2340,tagujarati:2724,tagurmukhi:2596,taharabic:1591,tahfinalarabic:65218,tahinitialarabic:65219,tahiragana:12383,tahmedialarabic:65220,taisyouerasquare:13181,takatakana:12479,takatakanahalfwidth:65408,tatweelarabic:1600,tau:964,tav:1514,tavdages:64330,tavdagesh:64330,tavdageshhebrew:64330,tavhebrew:1514,tbar:359,tbopomofo:12554,tcaron:357,tccurl:680,tcedilla:355,tcheharabic:1670,tchehfinalarabic:64379,tchehinitialarabic:64380,tchehmedialarabic:64381,tcircle:9443,tcircumflexbelow:7793,tcommaaccent:355,tdieresis:7831,tdotaccent:7787,tdotbelow:7789,tecyrillic:1090,tedescendercyrillic:1197,teharabic:1578,tehfinalarabic:65174,tehhahinitialarabic:64674,tehhahisolatedarabic:64524,tehinitialarabic:65175,tehiragana:12390,tehjeeminitialarabic:64673,tehjeemisolatedarabic:64523,tehmarbutaarabic:1577,tehmarbutafinalarabic:65172,tehmedialarabic:65176,tehmeeminitialarabic:64676,tehmeemisolatedarabic:64526,tehnoonfinalarabic:64627,tekatakana:12486,tekatakanahalfwidth:65411,telephone:8481,telephoneblack:9742,telishagedolahebrew:1440,telishaqetanahebrew:1449,tencircle:9321,tenideographicparen:12841,tenparen:9341,tenperiod:9361,tenroman:8569,tesh:679,tet:1496,tetdagesh:64312,tetdageshhebrew:64312,tethebrew:1496,tetsecyrillic:1205,tevirhebrew:1435,tevirlefthebrew:1435,thabengali:2469,thadeva:2341,thagujarati:2725,thagurmukhi:2597,thalarabic:1584,thalfinalarabic:65196,thanthakhatlowleftthai:63640,thanthakhatlowrightthai:63639,thanthakhatthai:3660,thanthakhatupperleftthai:63638,theharabic:1579,thehfinalarabic:65178,thehinitialarabic:65179,thehmedialarabic:65180,thereexists:8707,therefore:8756,theta:952,theta1:977,thetasymbolgreek:977,thieuthacirclekorean:12921,thieuthaparenkorean:12825,thieuthcirclekorean:12907,thieuthkorean:12620,thieuthparenkorean:12811,thirteencircle:9324,thirteenparen:9344,thirteenperiod:9364,thonangmonthothai:3601,thook:429,thophuthaothai:3602,thorn:254,thothahanthai:3607,thothanthai:3600,thothongthai:3608,thothungthai:3606,thousandcyrillic:1154,thousandsseparatorarabic:1644,thousandsseparatorpersian:1644,three:51,threearabic:1635,threebengali:2537,threecircle:9314,threecircleinversesansserif:10124,threedeva:2409,threeeighths:8540,threegujarati:2793,threegurmukhi:2665,threehackarabic:1635,threehangzhou:12323,threeideographicparen:12834,threeinferior:8323,threemonospace:65299,threenumeratorbengali:2550,threeoldstyle:63283,threeparen:9334,threeperiod:9354,threepersian:1779,threequarters:190,threequartersemdash:63198,threeroman:8562,threesuperior:179,threethai:3667,thzsquare:13204,tihiragana:12385,tikatakana:12481,tikatakanahalfwidth:65409,tikeutacirclekorean:12912,tikeutaparenkorean:12816,tikeutcirclekorean:12898,tikeutkorean:12599,tikeutparenkorean:12802,tilde:732,tildebelowcmb:816,tildecmb:771,tildecomb:771,tildedoublecmb:864,tildeoperator:8764,tildeoverlaycmb:820,tildeverticalcmb:830,timescircle:8855,tipehahebrew:1430,tipehalefthebrew:1430,tippigurmukhi:2672,titlocyrilliccmb:1155,tiwnarmenian:1407,tlinebelow:7791,tmonospace:65364,toarmenian:1385,tohiragana:12392,tokatakana:12488,tokatakanahalfwidth:65412,tonebarextrahighmod:741,tonebarextralowmod:745,tonebarhighmod:742,
tonebarlowmod:744,tonebarmidmod:743,tonefive:445,tonesix:389,tonetwo:424,tonos:900,tonsquare:13095,topatakthai:3599,tortoiseshellbracketleft:12308,tortoiseshellbracketleftsmall:65117,tortoiseshellbracketleftvertical:65081,tortoiseshellbracketright:12309,tortoiseshellbracketrightsmall:65118,tortoiseshellbracketrightvertical:65082,totaothai:3605,tpalatalhook:427,tparen:9391,trademark:8482,trademarksans:63722,trademarkserif:63195,tretroflexhook:648,triagdn:9660,triaglf:9668,triagrt:9658,triagup:9650,ts:678,tsadi:1510,tsadidagesh:64326,tsadidageshhebrew:64326,tsadihebrew:1510,tsecyrillic:1094,tsere:1461,tsere12:1461,tsere1e:1461,tsere2b:1461,tserehebrew:1461,tserenarrowhebrew:1461,tserequarterhebrew:1461,tserewidehebrew:1461,tshecyrillic:1115,tsuperior:63219,ttabengali:2463,ttadeva:2335,ttagujarati:2719,ttagurmukhi:2591,tteharabic:1657,ttehfinalarabic:64359,ttehinitialarabic:64360,ttehmedialarabic:64361,tthabengali:2464,tthadeva:2336,tthagujarati:2720,tthagurmukhi:2592,tturned:647,tuhiragana:12388,tukatakana:12484,tukatakanahalfwidth:65410,tusmallhiragana:12387,tusmallkatakana:12483,tusmallkatakanahalfwidth:65391,twelvecircle:9323,twelveparen:9343,twelveperiod:9363,twelveroman:8571,twentycircle:9331,twentyhangzhou:21316,twentyparen:9351,twentyperiod:9371,two:50,twoarabic:1634,twobengali:2536,twocircle:9313,twocircleinversesansserif:10123,twodeva:2408,twodotenleader:8229,twodotleader:8229,twodotleadervertical:65072,twogujarati:2792,twogurmukhi:2664,twohackarabic:1634,twohangzhou:12322,twoideographicparen:12833,twoinferior:8322,twomonospace:65298,twonumeratorbengali:2549,twooldstyle:63282,twoparen:9333,twoperiod:9353,twopersian:1778,tworoman:8561,twostroke:443,twosuperior:178,twothai:3666,twothirds:8532,u:117,uacute:250,ubar:649,ubengali:2441,ubopomofo:12584,ubreve:365,ucaron:468,ucircle:9444,ucircumflex:251,ucircumflexbelow:7799,ucyrillic:1091,udattadeva:2385,udblacute:369,udblgrave:533,udeva:2313,udieresis:252,udieresisacute:472,udieresisbelow:7795,udieresiscaron:474,udieresiscyrillic:1265,udieresisgrave:476,udieresismacron:470,udotbelow:7909,ugrave:249,ugujarati:2697,ugurmukhi:2569,uhiragana:12358,uhookabove:7911,uhorn:432,uhornacute:7913,uhorndotbelow:7921,uhorngrave:7915,uhornhookabove:7917,uhorntilde:7919,uhungarumlaut:369,uhungarumlautcyrillic:1267,uinvertedbreve:535,ukatakana:12454,ukatakanahalfwidth:65395,ukcyrillic:1145,ukorean:12636,umacron:363,umacroncyrillic:1263,umacrondieresis:7803,umatragurmukhi:2625,umonospace:65365,underscore:95,underscoredbl:8215,underscoremonospace:65343,underscorevertical:65075,underscorewavy:65103,union:8746,universal:8704,uogonek:371,uparen:9392,upblock:9600,upperdothebrew:1476,upsilon:965,upsilondieresis:971,upsilondieresistonos:944,upsilonlatin:650,upsilontonos:973,uptackbelowcmb:797,uptackmod:724,uragurmukhi:2675,uring:367,ushortcyrillic:1118,usmallhiragana:12357,usmallkatakana:12453,usmallkatakanahalfwidth:65385,ustraightcyrillic:1199,ustraightstrokecyrillic:1201,utilde:361,utildeacute:7801,utildebelow:7797,uubengali:2442,uudeva:2314,uugujarati:2698,uugurmukhi:2570,uumatragurmukhi:2626,uuvowelsignbengali:2498,uuvowelsigndeva:2370,uuvowelsigngujarati:2754,uvowelsignbengali:2497,uvowelsigndeva:2369,uvowelsigngujarati:2753,v:118,vadeva:2357,vagujarati:2741,vagurmukhi:2613,vakatakana:12535,vav:1493,vavdagesh:64309,vavdagesh65:64309,vavdageshhebrew:64309,vavhebrew:1493,vavholam:64331,vavholamhebrew:64331,vavvavhebrew:1520,vavyodhebrew:1521,vcircle:9445,vdotbelow:7807,vecyrillic:1074,veharabic:1700,vehfinalarabic:64363,vehinitialarabic:64364,vehmedialarabic:64365,vekatakana:12537,venus:9792,verticalbar:124,verticallineabovecmb:781,verticallinebelowcmb:809,verticallinelowmod:716,verticallinemod:712,vewarmenian:1406,vhook:651,vikatakana:12536,viramabengali:2509,viramadeva:2381,viramagujarati:2765,visargabengali:2435,visargadeva:2307,visargagujarati:2691,vmonospace:65366,voarmenian:1400,voicediterationhiragana:12446,voicediterationkatakana:12542,voicedmarkkana:12443,voicedmarkkanahalfwidth:65438,vokatakana:12538,vparen:9393,vtilde:7805,vturned:652,vuhiragana:12436,vukatakana:12532,w:119,wacute:7811,waekorean:12633,wahiragana:12431,wakatakana:12527,wakatakanahalfwidth:65436,wakorean:12632,wasmallhiragana:12430,wasmallkatakana:12526,wattosquare:13143,wavedash:12316,wavyunderscorevertical:65076,wawarabic:1608,wawfinalarabic:65262,wawhamzaabovearabic:1572,wawhamzaabovefinalarabic:65158,wbsquare:13277,wcircle:9446,wcircumflex:373,wdieresis:7813,wdotaccent:7815,wdotbelow:7817,wehiragana:12433,weierstrass:8472,wekatakana:12529,wekorean:12638,weokorean:12637,wgrave:7809,whitebullet:9702,whitecircle:9675,whitecircleinverse:9689,whitecornerbracketleft:12302,whitecornerbracketleftvertical:65091,whitecornerbracketright:12303,whitecornerbracketrightvertical:65092,whitediamond:9671,whitediamondcontainingblacksmalldiamond:9672,whitedownpointingsmalltriangle:9663,whitedownpointingtriangle:9661,whiteleftpointingsmalltriangle:9667,whiteleftpointingtriangle:9665,whitelenticularbracketleft:12310,whitelenticularbracketright:12311,whiterightpointingsmalltriangle:9657,whiterightpointingtriangle:9655,whitesmallsquare:9643,whitesmilingface:9786,whitesquare:9633,whitestar:9734,whitetelephone:9743,whitetortoiseshellbracketleft:12312,whitetortoiseshellbracketright:12313,whiteuppointingsmalltriangle:9653,whiteuppointingtriangle:9651,wihiragana:12432,wikatakana:12528,wikorean:12639,wmonospace:65367,wohiragana:12434,wokatakana:12530,wokatakanahalfwidth:65382,won:8361,wonmonospace:65510,wowaenthai:3623,wparen:9394,wring:7832,wsuperior:695,wturned:653,wynn:447,x:120,xabovecmb:829,xbopomofo:12562,xcircle:9447,xdieresis:7821,xdotaccent:7819,xeharmenian:1389,xi:958,xmonospace:65368,xparen:9395,xsuperior:739,y:121,yaadosquare:13134,yabengali:2479,yacute:253,yadeva:2351,yaekorean:12626,yagujarati:2735,yagurmukhi:2607,yahiragana:12420,yakatakana:12516,yakatakanahalfwidth:65428,yakorean:12625,yamakkanthai:3662,yasmallhiragana:12419,yasmallkatakana:12515,yasmallkatakanahalfwidth:65388,yatcyrillic:1123,ycircle:9448,ycircumflex:375,ydieresis:255,ydotaccent:7823,ydotbelow:7925,yeharabic:1610,yehbarreearabic:1746,yehbarreefinalarabic:64431,yehfinalarabic:65266,yehhamzaabovearabic:1574,yehhamzaabovefinalarabic:65162,yehhamzaaboveinitialarabic:65163,yehhamzaabovemedialarabic:65164,yehinitialarabic:65267,yehmedialarabic:65268,yehmeeminitialarabic:64733,yehmeemisolatedarabic:64600,yehnoonfinalarabic:64660,yehthreedotsbelowarabic:1745,yekorean:12630,yen:165,yenmonospace:65509,yeokorean:12629,yeorinhieuhkorean:12678,yerahbenyomohebrew:1450,yerahbenyomolefthebrew:1450,yericyrillic:1099,yerudieresiscyrillic:1273,yesieungkorean:12673,yesieungpansioskorean:12675,yesieungsioskorean:12674,yetivhebrew:1434,ygrave:7923,yhook:436,yhookabove:7927,yiarmenian:1397,yicyrillic:1111,yikorean:12642,yinyang:9775,yiwnarmenian:1410,ymonospace:65369,yod:1497,yoddagesh:64313,yoddageshhebrew:64313,yodhebrew:1497,yodyodhebrew:1522,yodyodpatahhebrew:64287,yohiragana:12424,yoikorean:12681,yokatakana:12520,yokatakanahalfwidth:65430,yokorean:12635,yosmallhiragana:12423,yosmallkatakana:12519,yosmallkatakanahalfwidth:65390,yotgreek:1011,yoyaekorean:12680,yoyakorean:12679,yoyakthai:3618,yoyingthai:3597,yparen:9396,ypogegrammeni:890,ypogegrammenigreekcmb:837,yr:422,yring:7833,ysuperior:696,ytilde:7929,yturned:654,yuhiragana:12422,yuikorean:12684,yukatakana:12518,yukatakanahalfwidth:65429,yukorean:12640,yusbigcyrillic:1131,yusbigiotifiedcyrillic:1133,yuslittlecyrillic:1127,yuslittleiotifiedcyrillic:1129,yusmallhiragana:12421,yusmallkatakana:12517,yusmallkatakanahalfwidth:65389,yuyekorean:12683,yuyeokorean:12682,yyabengali:2527,yyadeva:2399,z:122,zaarmenian:1382,zacute:378,zadeva:2395,zagurmukhi:2651,zaharabic:1592,zahfinalarabic:65222,zahinitialarabic:65223,zahiragana:12374,zahmedialarabic:65224,zainarabic:1586,zainfinalarabic:65200,zakatakana:12470,zaqefgadolhebrew:1429,zaqefqatanhebrew:1428,zarqahebrew:1432,zayin:1494,zayindagesh:64310,zayindageshhebrew:64310,zayinhebrew:1494,zbopomofo:12567,zcaron:382,zcircle:9449,zcircumflex:7825,zcurl:657,zdot:380,zdotaccent:380,zdotbelow:7827,zecyrillic:1079,zedescendercyrillic:1177,zedieresiscyrillic:1247,zehiragana:12380,zekatakana:12476,zero:48,zeroarabic:1632,zerobengali:2534,zerodeva:2406,zerogujarati:2790,zerogurmukhi:2662,zerohackarabic:1632,zeroinferior:8320,zeromonospace:65296,zerooldstyle:63280,zeropersian:1776,zerosuperior:8304,zerothai:3664,zerowidthjoiner:65279,zerowidthnonjoiner:8204,zerowidthspace:8203,zeta:950,zhbopomofo:12563,zhearmenian:1386,zhebrevecyrillic:1218,zhecyrillic:1078,zhedescendercyrillic:1175,zhedieresiscyrillic:1245,zihiragana:12376,zikatakana:12472,zinorhebrew:1454,zlinebelow:7829,zmonospace:65370,zohiragana:12382,zokatakana:12478,zparen:9397,zretroflexhook:656,zstroke:438,zuhiragana:12378,zukatakana:12474,".notdef":0},ka={space:32,a1:9985,a2:9986,a202:9987,a3:9988,a4:9742,a5:9990,a119:9991,a118:9992,a117:9993,a11:9755,a12:9758,a13:9996,a14:9997,a15:9998,a16:9999,a105:1e4,a17:10001,a18:10002,a19:10003,a20:10004,a21:10005,a22:10006,a23:10007,a24:10008,a25:10009,a26:10010,a27:10011,a28:10012,a6:10013,a7:10014,a8:10015,a9:10016,a10:10017,a29:10018,a30:10019,a31:10020,a32:10021,a33:10022,a34:10023,a35:9733,a36:10025,a37:10026,a38:10027,a39:10028,a40:10029,a41:10030,a42:10031,a43:10032,a44:10033,a45:10034,a46:10035,a47:10036,a48:10037,a49:10038,a50:10039,a51:10040,a52:10041,a53:10042,a54:10043,a55:10044,a56:10045,a57:10046,a58:10047,a59:10048,a60:10049,a61:10050,a62:10051,a63:10052,a64:10053,a65:10054,a66:10055,a67:10056,a68:10057,a69:10058,a70:10059,a71:9679,a72:10061,a73:9632,a74:10063,a203:10064,a75:10065,a204:10066,a76:9650,a77:9660,a78:9670,a79:10070,a81:9687,a82:10072,a83:10073,a84:10074,a97:10075,a98:10076,a99:10077,a100:10078,a101:10081,a102:10082,a103:10083,a104:10084,a106:10085,a107:10086,a108:10087,a112:9827,a111:9830,a110:9829,a109:9824,a120:9312,a121:9313,a122:9314,a123:9315,a124:9316,a125:9317,a126:9318,a127:9319,a128:9320,a129:9321,a130:10102,a131:10103,a132:10104,a133:10105,a134:10106,a135:10107,a136:10108,a137:10109,a138:10110,a139:10111,a140:10112,a141:10113,a142:10114,a143:10115,a144:10116,a145:10117,a146:10118,a147:10119,a148:10120,a149:10121,a150:10122,a151:10123,a152:10124,a153:10125,a154:10126,a155:10127,a156:10128,a157:10129,a158:10130,a159:10131,a160:10132,a161:8594,a163:8596,a164:8597,a196:10136,a165:10137,a192:10138,a166:10139,a167:10140,a168:10141,a169:10142,a170:10143,a171:10144,a172:10145,a173:10146,a162:10147,a174:10148,a175:10149,a176:10150,a177:10151,a178:10152,a179:10153,a193:10154,a180:10155,a199:10156,a181:10157,a200:10158,a182:10159,a201:10161,a183:10162,a184:10163,a197:10164,a185:10165,a194:10166,a198:10167,a186:10168,a195:10169,a187:10170,a188:10171,a189:10172,a190:10173,a191:10174,a89:10088,a90:10089,a93:10090,a94:10091,a91:10092,a92:10093,a205:10094,a85:10095,a206:10096,a86:10097,a87:10098,a88:10099,a95:10100,a96:10101,".notdef":0},wa=function(){function r(e,t,a,r){if(r instanceof Fa&&r.isNativelyDecodable(t,a)){var i=r.dict,n=i.get("ColorSpace","CS");n=_e.parse(n,t,a);var o=n.numComps,s=e.sendWithPromise("JpegDecode",[r.getIR(),o]);return s.then(function(e){var t=e.data;return new Pa(t,0,t.length,r.dict)})}return Promise.resolve(r)}function n(e,t,a,r){return e=t+e*a,0>e?0:e>r?r:e}function o(t,r,i,n,s,c,l){this.image=i;var h=i.dict;if(h.has("Filter")){var u=h.get("Filter").name;if("JPXDecode"===u){var f=new er;f.parseImageProperties(i.stream),i.stream.reset(),i.bitsPerComponent=f.bitsPerComponent,i.numComps=f.componentsCount}else"JBIG2Decode"===u&&(i.bitsPerComponent=1,i.numComps=1)}this.width=h.get("Width","W"),this.height=h.get("Height","H"),(this.width<1||this.height<1)&&a("Invalid image width: "+this.width+" or height: "+this.height),this.interpolate=h.get("Interpolate","I")||!1,this.imageMask=h.get("ImageMask","IM")||!1,this.matte=h.get("Matte")||!1;var d=i.bitsPerComponent;if(d||(d=h.get("BitsPerComponent","BPC"),d||(this.imageMask?d=1:a("Bits per component missing in image: "+this.imageMask))),this.bpc=d,!this.imageMask){var g=h.get("ColorSpace","CS");if(!g)switch(e("JPX images (which do not require color spaces)"),i.numComps){case 1:g=ye.get("DeviceGray");break;case 3:g=ye.get("DeviceRGB");break;case 4:g=ye.get("DeviceCMYK");break;default:a("JPX images with "+this.numComps+" color components not supported.")}this.colorSpace=_e.parse(g,t,r),this.numComps=this.colorSpace.numComps}if(this.decode=h.get("Decode","D"),this.needsDecode=!1,this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode)||l&&!_e.isDefaultDecode(this.decode,1))){this.needsDecode=!0;var m=(1<<d)-1;this.decodeCoefficients=[],this.decodeAddends=[];for(var p=0,b=0;p<this.decode.length;p+=2,++b){var v=this.decode[p],y=this.decode[p+1];this.decodeCoefficients[b]=y-v,this.decodeAddends[b]=m*v}}s?this.smask=new o(t,r,s,!1):c&&(I(c)?this.mask=new o(t,r,c,!1,null,null,!0):this.mask=c)}return o.buildImage=function(e,a,i,n,s){var c,l,h=r(e,a,i,n),u=n.dict.get("SMask"),f=n.dict.get("Mask");return u?(c=r(e,a,i,u),l=Promise.resolve(null)):(c=Promise.resolve(null),f?I(f)?l=r(e,a,i,f):B(f)?l=Promise.resolve(f):(t("Unsupported mask format."),l=Promise.resolve(null)):l=Promise.resolve(null)),Promise.all([h,c,l]).then(function(e){var t=e[0],r=e[1],n=e[2];return new o(a,i,t,s,r,n)})},o.resize=function(e,t,r,i,n,o,s,c,l){1!==r&&3!==r&&a("Unsupported component count for resizing.");var h,u,f,d,g=o*s*r,m=c?c:8>=t?new Uint8Array(g):16>=t?new Uint16Array(g):new Uint32Array(g),p=i/o,b=n/s,v=0,y=new Uint16Array(o),k=i*r;for(1!==l&&(l=0),u=0;o>u;u++)y[u]=Math.floor(u*p)*r;if(1===r)for(h=0;s>h;h++)for(f=Math.floor(h*b)*k,u=0;o>u;u++)d=f+y[u],m[v++]=e[d];else if(3===r)for(h=0;s>h;h++)for(f=Math.floor(h*b)*k,u=0;o>u;u++)d=f+y[u],m[v++]=e[d++],m[v++]=e[d++],m[v++]=e[d++],v+=l;return m},o.createMask=function(e,t,a,r,i){var n,o,s=(t+7>>3)*a,c=e.byteLength,l=s===c;if(!r||i&&!l)if(i)for(n=new Uint8Array(s),n.set(e),o=c;s>o;o++)n[o]=255;else n=new Uint8Array(c),n.set(e);else n=e;if(i)for(o=0;c>o;o++)n[o]=~n[o];return{data:n,width:t,height:a}},o.prototype={get drawWidth(){return Math.max(this.width,this.smask&&this.smask.width||0,this.mask&&this.mask.width||0)},get drawHeight(){return Math.max(this.height,this.smask&&this.smask.height||0,this.mask&&this.mask.height||0)},decodeBuffer:function(e){var t,a,r=this.bpc,i=this.numComps,o=this.decodeAddends,s=this.decodeCoefficients,c=(1<<r)-1;if(1!==r){var l=0;for(t=0,a=this.width*this.height;a>t;t++)for(var h=0;i>h;h++)e[l]=n(e[l],o[h],s[h],c),l++}else for(t=0,a=e.length;a>t;t++)e[t]=+!e[t]},getComponents:function(e){var t=this.bpc;if(8===t)return e;var a,r,i=this.width,n=this.height,o=this.numComps,s=i*n*o,c=0,l=8>=t?new Uint8Array(s):16>=t?new Uint16Array(s):new Uint32Array(s),h=i*o,u=(1<<t)-1,f=0;if(1===t)for(var d,g,m,p=0;n>p;p++){for(g=f+(-8&h),m=f+h;g>f;)r=e[c++],l[f]=r>>7&1,l[f+1]=r>>6&1,l[f+2]=r>>5&1,l[f+3]=r>>4&1,l[f+4]=r>>3&1,l[f+5]=r>>2&1,l[f+6]=r>>1&1,l[f+7]=1&r,f+=8;if(m>f)for(r=e[c++],d=128;m>f;)l[f++]=+!!(r&d),d>>=1}else{var b=0;for(r=0,f=0,a=s;a>f;++f){for(f%h===0&&(r=0,b=0);t>b;)r=r<<8|e[c++],b+=8;var v=b-t,y=r>>v;l[f]=0>y?0:y>u?u:y,r&=(1<<v)-1,b=v}}return l},fillOpacity:function(e,t,r,i,n){var s,c,l,h,u,f,d=this.smask,g=this.mask;if(d)c=d.width,l=d.height,s=new Uint8Array(c*l),d.fillGrayBuffer(s),c===t&&l===r||(s=o.resize(s,d.bpc,1,c,l,t,r));else if(g)if(g instanceof o){for(c=g.width,l=g.height,s=new Uint8Array(c*l),g.numComps=1,g.fillGrayBuffer(s),h=0,u=c*l;u>h;++h)s[h]=255-s[h];c===t&&l===r||(s=o.resize(s,g.bpc,1,c,l,t,r))}else if(B(g)){s=new Uint8Array(t*r);var m=this.numComps;for(h=0,u=t*r;u>h;++h){var p=0,b=h*m;for(f=0;m>f;++f){var v=n[b+f],y=2*f;if(v<g[y]||v>g[y+1]){p=255;break}}s[h]=p}}else a("Unknown mask format.");if(s)for(h=0,f=3,u=t*i;u>h;++h,f+=4)e[f]=s[h];else for(h=0,f=3,u=t*i;u>h;++h,f+=4)e[f]=255},undoPreblend:function(e,t,a){var r=this.smask&&this.smask.matte;if(r)for(var i,n,o,s=this.colorSpace.getRgb(r,0),c=s[0],l=s[1],h=s[2],u=t*a*4,f=0;u>f;f+=4){var d=e[f+3];if(0!==d){var g=255/d;i=(e[f]-c)*g+c,n=(e[f+1]-l)*g+l,o=(e[f+2]-h)*g+h,e[f]=0>=i?0:i>=255?255:0|i,e[f+1]=0>=n?0:n>=255?255:0|n,e[f+2]=0>=o?0:o>=255?255:0|o}else e[f]=255,e[f+1]=255,e[f+2]=255}},createImageData:function(e){var t,a=this.drawWidth,r=this.drawHeight,n={width:a,height:r},o=this.numComps,s=this.width,c=this.height,l=this.bpc,h=s*o*l+7>>3;if(!e){var u;if("DeviceGray"===this.colorSpace.name&&1===l?u=X.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==l||this.needsDecode||(u=X.RGB_24BPP),u&&!this.smask&&!this.mask&&a===s&&r===c){if(n.kind=u,t=this.getImageBytes(c*h),this.image instanceof Da)n.data=t;else{var f=new Uint8Array(t.length);f.set(t),n.data=f}if(this.needsDecode){i(u===X.GRAYSCALE_1BPP);for(var d=n.data,g=0,m=d.length;m>g;g++)d[g]^=255}return n}if(this.image instanceof Fa&&!this.smask&&!this.mask)return n.kind=X.RGB_24BPP,n.data=this.getImageBytes(c*h,a,r,!0),n}t=this.getImageBytes(c*h);var p,b,v=0|t.length/h*r/c,y=this.getComponents(t);return e||this.smask||this.mask?(n.kind=X.RGBA_32BPP,n.data=new Uint8Array(a*r*4),p=1,b=!0,this.fillOpacity(n.data,a,r,v,y)):(n.kind=X.RGB_24BPP,n.data=new Uint8Array(a*r*3),p=0,b=!1),this.needsDecode&&this.decodeBuffer(y),this.colorSpace.fillRgb(n.data,s,c,a,r,v,l,y,p),b&&this.undoPreblend(n.data,a,v),n},fillGrayBuffer:function(e){var t=this.numComps;1!==t&&a("Reading gray scale from a color image: "+t);var r,i,n=this.width,o=this.height,s=this.bpc,c=n*t*s+7>>3,l=this.getImageBytes(o*c),h=this.getComponents(l);if(1!==s){this.needsDecode&&this.decodeBuffer(h),i=n*o;var u=255/((1<<s)-1);for(r=0;i>r;++r)e[r]=u*h[r]|0}else if(i=n*o,this.needsDecode)for(r=0;i>r;++r)e[r]=h[r]-1&255;else for(r=0;i>r;++r)e[r]=255&-h[r]},getImageBytes:function(e,t,a,r){return this.image.reset(),this.image.drawWidth=t||this.width,this.image.drawHeight=a||this.height,this.image.forceRGB=!!r,this.image.getBytes(e)}},o}(),xa={Courier:600,"Courier-Bold":600,"Courier-BoldOblique":600,"Courier-Oblique":600,Helvetica:{space:278,exclam:278,quotedbl:355,numbersign:556,dollar:556,percent:889,ampersand:667,quoteright:222,parenleft:333,parenright:333,asterisk:389,plus:584,comma:278,hyphen:333,period:278,slash:278,zero:556,one:556,two:556,three:556,four:556,five:556,six:556,seven:556,eight:556,nine:556,colon:278,semicolon:278,less:584,equal:584,greater:584,question:556,at:1015,A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,bracketleft:278,backslash:278,bracketright:278,asciicircum:469,underscore:556,quoteleft:222,a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833,n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500,braceleft:334,bar:260,braceright:334,asciitilde:584,exclamdown:333,cent:556,sterling:556,fraction:167,yen:556,florin:556,section:556,currency:556,quotesingle:191,quotedblleft:333,guillemotleft:556,guilsinglleft:333,guilsinglright:333,fi:500,fl:500,endash:556,dagger:556,daggerdbl:556,periodcentered:278,paragraph:537,bullet:350,quotesinglbase:222,quotedblbase:333,quotedblright:333,guillemotright:556,ellipsis:1e3,perthousand:1e3,questiondown:611,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:1e3,AE:1e3,ordfeminine:370,Lslash:556,Oslash:778,OE:1e3,ordmasculine:365,ae:889,dotlessi:278,lslash:222,oslash:611,oe:944,germandbls:611,Idieresis:278,eacute:556,abreve:556,uhungarumlaut:556,ecaron:556,Ydieresis:667,divide:584,Yacute:667,Acircumflex:667,aacute:556,Ucircumflex:722,yacute:500,scommaaccent:500,ecircumflex:556,Uring:722,Udieresis:722,aogonek:556,Uacute:722,uogonek:556,Edieresis:667,Dcroat:722,commaaccent:250,copyright:737,Emacron:667,ccaron:500,aring:556,Ncommaaccent:722,lacute:222,agrave:556,Tcommaaccent:611,Cacute:722,atilde:556,Edotaccent:667,scaron:500,scedilla:500,iacute:278,lozenge:471,Rcaron:722,Gcommaaccent:778,ucircumflex:556,acircumflex:556,Amacron:667,rcaron:333,ccedilla:500,Zdotaccent:611,Thorn:667,Omacron:778,Racute:722,Sacute:667,dcaron:643,Umacron:722,uring:556,threesuperior:333,Ograve:778,Agrave:667,Abreve:667,multiply:584,uacute:556,Tcaron:611,partialdiff:476,ydieresis:500,Nacute:722,icircumflex:278,Ecircumflex:667,adieresis:556,edieresis:556,cacute:500,nacute:556,umacron:556,Ncaron:722,Iacute:278,plusminus:584,brokenbar:260,registered:737,Gbreve:778,Idotaccent:278,summation:600,Egrave:667,racute:333,omacron:556,Zacute:611,Zcaron:611,greaterequal:549,Eth:722,Ccedilla:722,lcommaaccent:222,tcaron:317,eogonek:556,Uogonek:722,Aacute:667,Adieresis:667,egrave:556,zacute:500,iogonek:222,Oacute:778,oacute:556,amacron:556,sacute:500,idieresis:278,Ocircumflex:778,Ugrave:722,Delta:612,thorn:556,twosuperior:333,Odieresis:778,mu:556,igrave:278,ohungarumlaut:556,Eogonek:667,dcroat:556,threequarters:834,Scedilla:667,lcaron:299,Kcommaaccent:667,Lacute:556,trademark:1e3,edotaccent:556,Igrave:278,Imacron:278,Lcaron:556,onehalf:834,lessequal:549,ocircumflex:556,ntilde:556,Uhungarumlaut:722,Eacute:667,emacron:556,gbreve:556,onequarter:834,Scaron:667,Scommaaccent:667,Ohungarumlaut:778,degree:400,ograve:556,Ccaron:722,ugrave:556,radical:453,Dcaron:722,rcommaaccent:333,Ntilde:722,otilde:556,Rcommaaccent:722,Lcommaaccent:556,Atilde:667,Aogonek:667,Aring:667,Otilde:778,zdotaccent:500,Ecaron:667,Iogonek:278,kcommaaccent:500,minus:584,Icircumflex:278,ncaron:556,tcommaaccent:278,logicalnot:584,odieresis:556,udieresis:556,notequal:549,gcommaaccent:556,eth:556,zcaron:500,ncommaaccent:556,onesuperior:333,imacron:278,Euro:556},"Helvetica-Bold":{space:278,exclam:333,quotedbl:474,numbersign:556,dollar:556,percent:889,ampersand:722,quoteright:278,parenleft:333,parenright:333,asterisk:389,plus:584,comma:278,hyphen:333,period:278,slash:278,zero:556,one:556,two:556,three:556,four:556,five:556,six:556,seven:556,eight:556,nine:556,colon:333,semicolon:333,less:584,equal:584,greater:584,question:611,at:975,A:722,B:722,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:556,K:722,L:611,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,bracketleft:333,backslash:278,bracketright:333,asciicircum:584,underscore:556,quoteleft:278,a:556,b:611,c:556,d:611,e:556,f:333,g:611,h:611,i:278,j:278,k:556,l:278,m:889,n:611,o:611,p:611,q:611,r:389,s:556,t:333,u:611,v:556,w:778,x:556,y:556,z:500,braceleft:389,bar:280,braceright:389,asciitilde:584,exclamdown:333,cent:556,sterling:556,fraction:167,yen:556,florin:556,section:556,currency:556,quotesingle:238,quotedblleft:500,guillemotleft:556,guilsinglleft:333,guilsinglright:333,fi:611,fl:611,endash:556,dagger:556,daggerdbl:556,periodcentered:278,paragraph:556,bullet:350,quotesinglbase:278,quotedblbase:500,quotedblright:500,guillemotright:556,ellipsis:1e3,perthousand:1e3,questiondown:611,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:1e3,AE:1e3,ordfeminine:370,Lslash:611,Oslash:778,OE:1e3,ordmasculine:365,ae:889,dotlessi:278,lslash:278,oslash:611,oe:944,germandbls:611,Idieresis:278,eacute:556,abreve:556,uhungarumlaut:611,ecaron:556,Ydieresis:667,divide:584,Yacute:667,Acircumflex:722,aacute:556,Ucircumflex:722,yacute:556,scommaaccent:556,ecircumflex:556,Uring:722,Udieresis:722,aogonek:556,Uacute:722,uogonek:611,Edieresis:667,Dcroat:722,commaaccent:250,copyright:737,Emacron:667,ccaron:556,aring:556,Ncommaaccent:722,lacute:278,agrave:556,Tcommaaccent:611,Cacute:722,atilde:556,Edotaccent:667,scaron:556,scedilla:556,iacute:278,lozenge:494,Rcaron:722,Gcommaaccent:778,ucircumflex:611,acircumflex:556,Amacron:722,rcaron:389,ccedilla:556,Zdotaccent:611,Thorn:667,Omacron:778,Racute:722,Sacute:667,dcaron:743,Umacron:722,uring:611,threesuperior:333,Ograve:778,Agrave:722,Abreve:722,multiply:584,uacute:611,Tcaron:611,partialdiff:494,ydieresis:556,Nacute:722,icircumflex:278,Ecircumflex:667,adieresis:556,edieresis:556,cacute:556,nacute:611,umacron:611,Ncaron:722,Iacute:278,plusminus:584,brokenbar:280,registered:737,Gbreve:778,Idotaccent:278,summation:600,Egrave:667,racute:389,omacron:611,Zacute:611,Zcaron:611,greaterequal:549,Eth:722,Ccedilla:722,lcommaaccent:278,tcaron:389,eogonek:556,Uogonek:722,Aacute:722,Adieresis:722,egrave:556,zacute:500,iogonek:278,Oacute:778,oacute:611,amacron:556,sacute:556,idieresis:278,Ocircumflex:778,Ugrave:722,Delta:612,thorn:611,twosuperior:333,Odieresis:778,mu:611,igrave:278,ohungarumlaut:611,Eogonek:667,dcroat:611,threequarters:834,Scedilla:667,lcaron:400,Kcommaaccent:722,Lacute:611,trademark:1e3,edotaccent:556,Igrave:278,Imacron:278,Lcaron:611,onehalf:834,lessequal:549,ocircumflex:611,ntilde:611,Uhungarumlaut:722,Eacute:667,emacron:556,gbreve:611,onequarter:834,Scaron:667,Scommaaccent:667,Ohungarumlaut:778,degree:400,ograve:611,Ccaron:722,ugrave:611,radical:549,Dcaron:722,rcommaaccent:389,Ntilde:722,otilde:611,Rcommaaccent:722,Lcommaaccent:611,Atilde:722,Aogonek:722,Aring:722,Otilde:778,zdotaccent:500,Ecaron:667,Iogonek:278,kcommaaccent:556,minus:584,Icircumflex:278,ncaron:611,tcommaaccent:333,logicalnot:584,odieresis:611,udieresis:611,notequal:549,gcommaaccent:611,eth:611,zcaron:500,ncommaaccent:611,onesuperior:333,imacron:278,Euro:556},"Helvetica-BoldOblique":{space:278,exclam:333,quotedbl:474,numbersign:556,dollar:556,percent:889,ampersand:722,quoteright:278,parenleft:333,parenright:333,asterisk:389,plus:584,comma:278,hyphen:333,period:278,slash:278,zero:556,one:556,two:556,three:556,four:556,five:556,six:556,seven:556,eight:556,nine:556,colon:333,semicolon:333,less:584,equal:584,greater:584,question:611,at:975,A:722,B:722,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:556,K:722,L:611,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,bracketleft:333,backslash:278,bracketright:333,asciicircum:584,underscore:556,quoteleft:278,a:556,b:611,c:556,d:611,e:556,f:333,g:611,h:611,i:278,j:278,k:556,l:278,m:889,n:611,o:611,p:611,q:611,r:389,s:556,t:333,u:611,v:556,w:778,x:556,y:556,z:500,braceleft:389,bar:280,braceright:389,asciitilde:584,exclamdown:333,cent:556,sterling:556,fraction:167,yen:556,florin:556,section:556,currency:556,quotesingle:238,quotedblleft:500,guillemotleft:556,guilsinglleft:333,guilsinglright:333,fi:611,fl:611,endash:556,dagger:556,daggerdbl:556,periodcentered:278,paragraph:556,bullet:350,quotesinglbase:278,quotedblbase:500,quotedblright:500,guillemotright:556,ellipsis:1e3,perthousand:1e3,questiondown:611,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:1e3,AE:1e3,ordfeminine:370,Lslash:611,Oslash:778,OE:1e3,ordmasculine:365,ae:889,dotlessi:278,lslash:278,oslash:611,oe:944,germandbls:611,Idieresis:278,eacute:556,abreve:556,uhungarumlaut:611,ecaron:556,Ydieresis:667,divide:584,Yacute:667,Acircumflex:722,aacute:556,Ucircumflex:722,yacute:556,scommaaccent:556,ecircumflex:556,Uring:722,Udieresis:722,aogonek:556,Uacute:722,uogonek:611,Edieresis:667,Dcroat:722,commaaccent:250,copyright:737,Emacron:667,ccaron:556,aring:556,Ncommaaccent:722,lacute:278,agrave:556,Tcommaaccent:611,Cacute:722,atilde:556,Edotaccent:667,scaron:556,scedilla:556,iacute:278,lozenge:494,Rcaron:722,Gcommaaccent:778,ucircumflex:611,acircumflex:556,Amacron:722,rcaron:389,ccedilla:556,Zdotaccent:611,Thorn:667,Omacron:778,Racute:722,Sacute:667,dcaron:743,Umacron:722,uring:611,threesuperior:333,Ograve:778,Agrave:722,Abreve:722,multiply:584,uacute:611,Tcaron:611,partialdiff:494,ydieresis:556,Nacute:722,icircumflex:278,Ecircumflex:667,adieresis:556,edieresis:556,cacute:556,nacute:611,umacron:611,Ncaron:722,Iacute:278,plusminus:584,brokenbar:280,registered:737,Gbreve:778,Idotaccent:278,summation:600,Egrave:667,racute:389,omacron:611,Zacute:611,Zcaron:611,greaterequal:549,Eth:722,Ccedilla:722,lcommaaccent:278,tcaron:389,eogonek:556,Uogonek:722,Aacute:722,Adieresis:722,egrave:556,zacute:500,iogonek:278,Oacute:778,oacute:611,amacron:556,sacute:556,idieresis:278,Ocircumflex:778,Ugrave:722,Delta:612,thorn:611,twosuperior:333,Odieresis:778,mu:611,igrave:278,ohungarumlaut:611,Eogonek:667,dcroat:611,threequarters:834,Scedilla:667,lcaron:400,Kcommaaccent:722,Lacute:611,trademark:1e3,edotaccent:556,Igrave:278,Imacron:278,Lcaron:611,onehalf:834,lessequal:549,ocircumflex:611,ntilde:611,Uhungarumlaut:722,Eacute:667,emacron:556,gbreve:611,onequarter:834,Scaron:667,Scommaaccent:667,Ohungarumlaut:778,degree:400,ograve:611,Ccaron:722,ugrave:611,radical:549,Dcaron:722,rcommaaccent:389,Ntilde:722,otilde:611,Rcommaaccent:722,Lcommaaccent:611,Atilde:722,Aogonek:722,Aring:722,Otilde:778,zdotaccent:500,Ecaron:667,Iogonek:278,kcommaaccent:556,minus:584,Icircumflex:278,ncaron:611,tcommaaccent:333,logicalnot:584,odieresis:611,udieresis:611,notequal:549,gcommaaccent:611,eth:611,zcaron:500,ncommaaccent:611,onesuperior:333,imacron:278,Euro:556},"Helvetica-Oblique":{space:278,exclam:278,quotedbl:355,numbersign:556,dollar:556,percent:889,ampersand:667,quoteright:222,parenleft:333,parenright:333,asterisk:389,plus:584,comma:278,hyphen:333,period:278,slash:278,zero:556,one:556,two:556,three:556,four:556,five:556,six:556,seven:556,eight:556,nine:556,colon:278,semicolon:278,less:584,equal:584,greater:584,question:556,at:1015,A:667,B:667,C:722,D:722,E:667,F:611,G:778,H:722,I:278,J:500,K:667,L:556,M:833,N:722,O:778,P:667,Q:778,R:722,S:667,T:611,U:722,V:667,W:944,X:667,Y:667,Z:611,bracketleft:278,backslash:278,bracketright:278,asciicircum:469,underscore:556,quoteleft:222,a:556,b:556,c:500,d:556,e:556,f:278,g:556,h:556,i:222,j:222,k:500,l:222,m:833,n:556,o:556,p:556,q:556,r:333,s:500,t:278,u:556,v:500,w:722,x:500,y:500,z:500,braceleft:334,bar:260,braceright:334,asciitilde:584,exclamdown:333,cent:556,sterling:556,fraction:167,yen:556,florin:556,section:556,currency:556,quotesingle:191,quotedblleft:333,guillemotleft:556,guilsinglleft:333,guilsinglright:333,fi:500,fl:500,endash:556,dagger:556,daggerdbl:556,periodcentered:278,paragraph:537,bullet:350,quotesinglbase:222,quotedblbase:333,quotedblright:333,guillemotright:556,ellipsis:1e3,perthousand:1e3,questiondown:611,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:1e3,AE:1e3,ordfeminine:370,Lslash:556,Oslash:778,OE:1e3,ordmasculine:365,ae:889,dotlessi:278,lslash:222,oslash:611,oe:944,germandbls:611,Idieresis:278,eacute:556,abreve:556,uhungarumlaut:556,ecaron:556,Ydieresis:667,divide:584,Yacute:667,Acircumflex:667,aacute:556,Ucircumflex:722,yacute:500,scommaaccent:500,ecircumflex:556,Uring:722,Udieresis:722,aogonek:556,Uacute:722,uogonek:556,Edieresis:667,Dcroat:722,commaaccent:250,copyright:737,Emacron:667,ccaron:500,aring:556,Ncommaaccent:722,lacute:222,agrave:556,Tcommaaccent:611,Cacute:722,atilde:556,Edotaccent:667,scaron:500,scedilla:500,iacute:278,lozenge:471,Rcaron:722,Gcommaaccent:778,ucircumflex:556,acircumflex:556,Amacron:667,rcaron:333,ccedilla:500,Zdotaccent:611,Thorn:667,Omacron:778,Racute:722,Sacute:667,dcaron:643,Umacron:722,uring:556,threesuperior:333,Ograve:778,Agrave:667,Abreve:667,multiply:584,uacute:556,Tcaron:611,partialdiff:476,ydieresis:500,Nacute:722,icircumflex:278,Ecircumflex:667,adieresis:556,edieresis:556,cacute:500,nacute:556,umacron:556,Ncaron:722,Iacute:278,plusminus:584,brokenbar:260,registered:737,Gbreve:778,Idotaccent:278,summation:600,Egrave:667,racute:333,omacron:556,Zacute:611,Zcaron:611,greaterequal:549,Eth:722,Ccedilla:722,lcommaaccent:222,tcaron:317,eogonek:556,Uogonek:722,Aacute:667,Adieresis:667,egrave:556,zacute:500,iogonek:222,Oacute:778,oacute:556,amacron:556,sacute:500,idieresis:278,Ocircumflex:778,Ugrave:722,Delta:612,thorn:556,twosuperior:333,Odieresis:778,mu:556,igrave:278,ohungarumlaut:556,Eogonek:667,dcroat:556,threequarters:834,Scedilla:667,lcaron:299,Kcommaaccent:667,Lacute:556,trademark:1e3,edotaccent:556,Igrave:278,Imacron:278,Lcaron:556,onehalf:834,lessequal:549,ocircumflex:556,ntilde:556,Uhungarumlaut:722,Eacute:667,
emacron:556,gbreve:556,onequarter:834,Scaron:667,Scommaaccent:667,Ohungarumlaut:778,degree:400,ograve:556,Ccaron:722,ugrave:556,radical:453,Dcaron:722,rcommaaccent:333,Ntilde:722,otilde:556,Rcommaaccent:722,Lcommaaccent:556,Atilde:667,Aogonek:667,Aring:667,Otilde:778,zdotaccent:500,Ecaron:667,Iogonek:278,kcommaaccent:500,minus:584,Icircumflex:278,ncaron:556,tcommaaccent:278,logicalnot:584,odieresis:556,udieresis:556,notequal:549,gcommaaccent:556,eth:556,zcaron:500,ncommaaccent:556,onesuperior:333,imacron:278,Euro:556},Symbol:{space:250,exclam:333,universal:713,numbersign:500,existential:549,percent:833,ampersand:778,suchthat:439,parenleft:333,parenright:333,asteriskmath:500,plus:549,comma:250,minus:549,period:250,slash:278,zero:500,one:500,two:500,three:500,four:500,five:500,six:500,seven:500,eight:500,nine:500,colon:278,semicolon:278,less:549,equal:549,greater:549,question:444,congruent:549,Alpha:722,Beta:667,Chi:722,Delta:612,Epsilon:611,Phi:763,Gamma:603,Eta:722,Iota:333,theta1:631,Kappa:722,Lambda:686,Mu:889,Nu:722,Omicron:722,Pi:768,Theta:741,Rho:556,Sigma:592,Tau:611,Upsilon:690,sigma1:439,Omega:768,Xi:645,Psi:795,Zeta:611,bracketleft:333,therefore:863,bracketright:333,perpendicular:658,underscore:500,radicalex:500,alpha:631,beta:549,chi:549,delta:494,epsilon:439,phi:521,gamma:411,eta:603,iota:329,phi1:603,kappa:549,lambda:549,mu:576,nu:521,omicron:549,pi:549,theta:521,rho:549,sigma:603,tau:439,upsilon:576,omega1:713,omega:686,xi:493,psi:686,zeta:494,braceleft:480,bar:200,braceright:480,similar:549,Euro:750,Upsilon1:620,minute:247,lessequal:549,fraction:167,infinity:713,florin:500,club:753,diamond:753,heart:753,spade:753,arrowboth:1042,arrowleft:987,arrowup:603,arrowright:987,arrowdown:603,degree:400,plusminus:549,second:411,greaterequal:549,multiply:549,proportional:713,partialdiff:494,bullet:460,divide:549,notequal:549,equivalence:549,approxequal:549,ellipsis:1e3,arrowvertex:603,arrowhorizex:1e3,carriagereturn:658,aleph:823,Ifraktur:686,Rfraktur:795,weierstrass:987,circlemultiply:768,circleplus:768,emptyset:823,intersection:768,union:768,propersuperset:713,reflexsuperset:713,notsubset:713,propersubset:713,reflexsubset:713,element:713,notelement:713,angle:768,gradient:713,registerserif:790,copyrightserif:790,trademarkserif:890,product:823,radical:549,dotmath:250,logicalnot:713,logicaland:603,logicalor:603,arrowdblboth:1042,arrowdblleft:987,arrowdblup:603,arrowdblright:987,arrowdbldown:603,lozenge:494,angleleft:329,registersans:790,copyrightsans:790,trademarksans:786,summation:713,parenlefttp:384,parenleftex:384,parenleftbt:384,bracketlefttp:384,bracketleftex:384,bracketleftbt:384,bracelefttp:494,braceleftmid:494,braceleftbt:494,braceex:494,angleright:329,integral:274,integraltp:686,integralex:686,integralbt:686,parenrighttp:384,parenrightex:384,parenrightbt:384,bracketrighttp:384,bracketrightex:384,bracketrightbt:384,bracerighttp:494,bracerightmid:494,bracerightbt:494,apple:790},"Times-Roman":{space:250,exclam:333,quotedbl:408,numbersign:500,dollar:500,percent:833,ampersand:778,quoteright:333,parenleft:333,parenright:333,asterisk:500,plus:564,comma:250,hyphen:333,period:250,slash:278,zero:500,one:500,two:500,three:500,four:500,five:500,six:500,seven:500,eight:500,nine:500,colon:278,semicolon:278,less:564,equal:564,greater:564,question:444,at:921,A:722,B:667,C:667,D:722,E:611,F:556,G:722,H:722,I:333,J:389,K:722,L:611,M:889,N:722,O:722,P:556,Q:722,R:667,S:556,T:611,U:722,V:722,W:944,X:722,Y:722,Z:611,bracketleft:333,backslash:278,bracketright:333,asciicircum:469,underscore:500,quoteleft:333,a:444,b:500,c:444,d:500,e:444,f:333,g:500,h:500,i:278,j:278,k:500,l:278,m:778,n:500,o:500,p:500,q:500,r:333,s:389,t:278,u:500,v:500,w:722,x:500,y:500,z:444,braceleft:480,bar:200,braceright:480,asciitilde:541,exclamdown:333,cent:500,sterling:500,fraction:167,yen:500,florin:500,section:500,currency:500,quotesingle:180,quotedblleft:444,guillemotleft:500,guilsinglleft:333,guilsinglright:333,fi:556,fl:556,endash:500,dagger:500,daggerdbl:500,periodcentered:250,paragraph:453,bullet:350,quotesinglbase:333,quotedblbase:444,quotedblright:444,guillemotright:500,ellipsis:1e3,perthousand:1e3,questiondown:444,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:1e3,AE:889,ordfeminine:276,Lslash:611,Oslash:722,OE:889,ordmasculine:310,ae:667,dotlessi:278,lslash:278,oslash:500,oe:722,germandbls:500,Idieresis:333,eacute:444,abreve:444,uhungarumlaut:500,ecaron:444,Ydieresis:722,divide:564,Yacute:722,Acircumflex:722,aacute:444,Ucircumflex:722,yacute:500,scommaaccent:389,ecircumflex:444,Uring:722,Udieresis:722,aogonek:444,Uacute:722,uogonek:500,Edieresis:611,Dcroat:722,commaaccent:250,copyright:760,Emacron:611,ccaron:444,aring:444,Ncommaaccent:722,lacute:278,agrave:444,Tcommaaccent:611,Cacute:667,atilde:444,Edotaccent:611,scaron:389,scedilla:389,iacute:278,lozenge:471,Rcaron:667,Gcommaaccent:722,ucircumflex:500,acircumflex:444,Amacron:722,rcaron:333,ccedilla:444,Zdotaccent:611,Thorn:556,Omacron:722,Racute:667,Sacute:556,dcaron:588,Umacron:722,uring:500,threesuperior:300,Ograve:722,Agrave:722,Abreve:722,multiply:564,uacute:500,Tcaron:611,partialdiff:476,ydieresis:500,Nacute:722,icircumflex:278,Ecircumflex:611,adieresis:444,edieresis:444,cacute:444,nacute:500,umacron:500,Ncaron:722,Iacute:333,plusminus:564,brokenbar:200,registered:760,Gbreve:722,Idotaccent:333,summation:600,Egrave:611,racute:333,omacron:500,Zacute:611,Zcaron:611,greaterequal:549,Eth:722,Ccedilla:667,lcommaaccent:278,tcaron:326,eogonek:444,Uogonek:722,Aacute:722,Adieresis:722,egrave:444,zacute:444,iogonek:278,Oacute:722,oacute:500,amacron:444,sacute:389,idieresis:278,Ocircumflex:722,Ugrave:722,Delta:612,thorn:500,twosuperior:300,Odieresis:722,mu:500,igrave:278,ohungarumlaut:500,Eogonek:611,dcroat:500,threequarters:750,Scedilla:556,lcaron:344,Kcommaaccent:722,Lacute:611,trademark:980,edotaccent:444,Igrave:333,Imacron:333,Lcaron:611,onehalf:750,lessequal:549,ocircumflex:500,ntilde:500,Uhungarumlaut:722,Eacute:611,emacron:444,gbreve:500,onequarter:750,Scaron:556,Scommaaccent:556,Ohungarumlaut:722,degree:400,ograve:500,Ccaron:667,ugrave:500,radical:453,Dcaron:722,rcommaaccent:333,Ntilde:722,otilde:500,Rcommaaccent:667,Lcommaaccent:611,Atilde:722,Aogonek:722,Aring:722,Otilde:722,zdotaccent:444,Ecaron:611,Iogonek:333,kcommaaccent:500,minus:564,Icircumflex:333,ncaron:500,tcommaaccent:278,logicalnot:564,odieresis:500,udieresis:500,notequal:549,gcommaaccent:500,eth:500,zcaron:444,ncommaaccent:500,onesuperior:300,imacron:278,Euro:500},"Times-Bold":{space:250,exclam:333,quotedbl:555,numbersign:500,dollar:500,percent:1e3,ampersand:833,quoteright:333,parenleft:333,parenright:333,asterisk:500,plus:570,comma:250,hyphen:333,period:250,slash:278,zero:500,one:500,two:500,three:500,four:500,five:500,six:500,seven:500,eight:500,nine:500,colon:333,semicolon:333,less:570,equal:570,greater:570,question:500,at:930,A:722,B:667,C:722,D:722,E:667,F:611,G:778,H:778,I:389,J:500,K:778,L:667,M:944,N:722,O:778,P:611,Q:778,R:722,S:556,T:667,U:722,V:722,W:1e3,X:722,Y:722,Z:667,bracketleft:333,backslash:278,bracketright:333,asciicircum:581,underscore:500,quoteleft:333,a:500,b:556,c:444,d:556,e:444,f:333,g:500,h:556,i:278,j:333,k:556,l:278,m:833,n:556,o:500,p:556,q:556,r:444,s:389,t:333,u:556,v:500,w:722,x:500,y:500,z:444,braceleft:394,bar:220,braceright:394,asciitilde:520,exclamdown:333,cent:500,sterling:500,fraction:167,yen:500,florin:500,section:500,currency:500,quotesingle:278,quotedblleft:500,guillemotleft:500,guilsinglleft:333,guilsinglright:333,fi:556,fl:556,endash:500,dagger:500,daggerdbl:500,periodcentered:250,paragraph:540,bullet:350,quotesinglbase:333,quotedblbase:500,quotedblright:500,guillemotright:500,ellipsis:1e3,perthousand:1e3,questiondown:500,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:1e3,AE:1e3,ordfeminine:300,Lslash:667,Oslash:778,OE:1e3,ordmasculine:330,ae:722,dotlessi:278,lslash:278,oslash:500,oe:722,germandbls:556,Idieresis:389,eacute:444,abreve:500,uhungarumlaut:556,ecaron:444,Ydieresis:722,divide:570,Yacute:722,Acircumflex:722,aacute:500,Ucircumflex:722,yacute:500,scommaaccent:389,ecircumflex:444,Uring:722,Udieresis:722,aogonek:500,Uacute:722,uogonek:556,Edieresis:667,Dcroat:722,commaaccent:250,copyright:747,Emacron:667,ccaron:444,aring:500,Ncommaaccent:722,lacute:278,agrave:500,Tcommaaccent:667,Cacute:722,atilde:500,Edotaccent:667,scaron:389,scedilla:389,iacute:278,lozenge:494,Rcaron:722,Gcommaaccent:778,ucircumflex:556,acircumflex:500,Amacron:722,rcaron:444,ccedilla:444,Zdotaccent:667,Thorn:611,Omacron:778,Racute:722,Sacute:556,dcaron:672,Umacron:722,uring:556,threesuperior:300,Ograve:778,Agrave:722,Abreve:722,multiply:570,uacute:556,Tcaron:667,partialdiff:494,ydieresis:500,Nacute:722,icircumflex:278,Ecircumflex:667,adieresis:500,edieresis:444,cacute:444,nacute:556,umacron:556,Ncaron:722,Iacute:389,plusminus:570,brokenbar:220,registered:747,Gbreve:778,Idotaccent:389,summation:600,Egrave:667,racute:444,omacron:500,Zacute:667,Zcaron:667,greaterequal:549,Eth:722,Ccedilla:722,lcommaaccent:278,tcaron:416,eogonek:444,Uogonek:722,Aacute:722,Adieresis:722,egrave:444,zacute:444,iogonek:278,Oacute:778,oacute:500,amacron:500,sacute:389,idieresis:278,Ocircumflex:778,Ugrave:722,Delta:612,thorn:556,twosuperior:300,Odieresis:778,mu:556,igrave:278,ohungarumlaut:500,Eogonek:667,dcroat:556,threequarters:750,Scedilla:556,lcaron:394,Kcommaaccent:778,Lacute:667,trademark:1e3,edotaccent:444,Igrave:389,Imacron:389,Lcaron:667,onehalf:750,lessequal:549,ocircumflex:500,ntilde:556,Uhungarumlaut:722,Eacute:667,emacron:444,gbreve:500,onequarter:750,Scaron:556,Scommaaccent:556,Ohungarumlaut:778,degree:400,ograve:500,Ccaron:722,ugrave:556,radical:549,Dcaron:722,rcommaaccent:444,Ntilde:722,otilde:500,Rcommaaccent:722,Lcommaaccent:667,Atilde:722,Aogonek:722,Aring:722,Otilde:778,zdotaccent:444,Ecaron:667,Iogonek:389,kcommaaccent:556,minus:570,Icircumflex:389,ncaron:556,tcommaaccent:333,logicalnot:570,odieresis:500,udieresis:556,notequal:549,gcommaaccent:500,eth:500,zcaron:444,ncommaaccent:556,onesuperior:300,imacron:278,Euro:500},"Times-BoldItalic":{space:250,exclam:389,quotedbl:555,numbersign:500,dollar:500,percent:833,ampersand:778,quoteright:333,parenleft:333,parenright:333,asterisk:500,plus:570,comma:250,hyphen:333,period:250,slash:278,zero:500,one:500,two:500,three:500,four:500,five:500,six:500,seven:500,eight:500,nine:500,colon:333,semicolon:333,less:570,equal:570,greater:570,question:500,at:832,A:667,B:667,C:667,D:722,E:667,F:667,G:722,H:778,I:389,J:500,K:667,L:611,M:889,N:722,O:722,P:611,Q:722,R:667,S:556,T:611,U:722,V:667,W:889,X:667,Y:611,Z:611,bracketleft:333,backslash:278,bracketright:333,asciicircum:570,underscore:500,quoteleft:333,a:500,b:500,c:444,d:500,e:444,f:333,g:500,h:556,i:278,j:278,k:500,l:278,m:778,n:556,o:500,p:500,q:500,r:389,s:389,t:278,u:556,v:444,w:667,x:500,y:444,z:389,braceleft:348,bar:220,braceright:348,asciitilde:570,exclamdown:389,cent:500,sterling:500,fraction:167,yen:500,florin:500,section:500,currency:500,quotesingle:278,quotedblleft:500,guillemotleft:500,guilsinglleft:333,guilsinglright:333,fi:556,fl:556,endash:500,dagger:500,daggerdbl:500,periodcentered:250,paragraph:500,bullet:350,quotesinglbase:333,quotedblbase:500,quotedblright:500,guillemotright:500,ellipsis:1e3,perthousand:1e3,questiondown:500,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:1e3,AE:944,ordfeminine:266,Lslash:611,Oslash:722,OE:944,ordmasculine:300,ae:722,dotlessi:278,lslash:278,oslash:500,oe:722,germandbls:500,Idieresis:389,eacute:444,abreve:500,uhungarumlaut:556,ecaron:444,Ydieresis:611,divide:570,Yacute:611,Acircumflex:667,aacute:500,Ucircumflex:722,yacute:444,scommaaccent:389,ecircumflex:444,Uring:722,Udieresis:722,aogonek:500,Uacute:722,uogonek:556,Edieresis:667,Dcroat:722,commaaccent:250,copyright:747,Emacron:667,ccaron:444,aring:500,Ncommaaccent:722,lacute:278,agrave:500,Tcommaaccent:611,Cacute:667,atilde:500,Edotaccent:667,scaron:389,scedilla:389,iacute:278,lozenge:494,Rcaron:667,Gcommaaccent:722,ucircumflex:556,acircumflex:500,Amacron:667,rcaron:389,ccedilla:444,Zdotaccent:611,Thorn:611,Omacron:722,Racute:667,Sacute:556,dcaron:608,Umacron:722,uring:556,threesuperior:300,Ograve:722,Agrave:667,Abreve:667,multiply:570,uacute:556,Tcaron:611,partialdiff:494,ydieresis:444,Nacute:722,icircumflex:278,Ecircumflex:667,adieresis:500,edieresis:444,cacute:444,nacute:556,umacron:556,Ncaron:722,Iacute:389,plusminus:570,brokenbar:220,registered:747,Gbreve:722,Idotaccent:389,summation:600,Egrave:667,racute:389,omacron:500,Zacute:611,Zcaron:611,greaterequal:549,Eth:722,Ccedilla:667,lcommaaccent:278,tcaron:366,eogonek:444,Uogonek:722,Aacute:667,Adieresis:667,egrave:444,zacute:389,iogonek:278,Oacute:722,oacute:500,amacron:500,sacute:389,idieresis:278,Ocircumflex:722,Ugrave:722,Delta:612,thorn:500,twosuperior:300,Odieresis:722,mu:576,igrave:278,ohungarumlaut:500,Eogonek:667,dcroat:500,threequarters:750,Scedilla:556,lcaron:382,Kcommaaccent:667,Lacute:611,trademark:1e3,edotaccent:444,Igrave:389,Imacron:389,Lcaron:611,onehalf:750,lessequal:549,ocircumflex:500,ntilde:556,Uhungarumlaut:722,Eacute:667,emacron:444,gbreve:500,onequarter:750,Scaron:556,Scommaaccent:556,Ohungarumlaut:722,degree:400,ograve:500,Ccaron:667,ugrave:556,radical:549,Dcaron:722,rcommaaccent:389,Ntilde:722,otilde:500,Rcommaaccent:667,Lcommaaccent:611,Atilde:667,Aogonek:667,Aring:667,Otilde:722,zdotaccent:389,Ecaron:667,Iogonek:389,kcommaaccent:500,minus:606,Icircumflex:389,ncaron:556,tcommaaccent:278,logicalnot:606,odieresis:500,udieresis:556,notequal:549,gcommaaccent:500,eth:500,zcaron:389,ncommaaccent:556,onesuperior:300,imacron:278,Euro:500},"Times-Italic":{space:250,exclam:333,quotedbl:420,numbersign:500,dollar:500,percent:833,ampersand:778,quoteright:333,parenleft:333,parenright:333,asterisk:500,plus:675,comma:250,hyphen:333,period:250,slash:278,zero:500,one:500,two:500,three:500,four:500,five:500,six:500,seven:500,eight:500,nine:500,colon:333,semicolon:333,less:675,equal:675,greater:675,question:500,at:920,A:611,B:611,C:667,D:722,E:611,F:611,G:722,H:722,I:333,J:444,K:667,L:556,M:833,N:667,O:722,P:611,Q:722,R:611,S:500,T:556,U:722,V:611,W:833,X:611,Y:556,Z:556,bracketleft:389,backslash:278,bracketright:389,asciicircum:422,underscore:500,quoteleft:333,a:500,b:500,c:444,d:500,e:444,f:278,g:500,h:500,i:278,j:278,k:444,l:278,m:722,n:500,o:500,p:500,q:500,r:389,s:389,t:278,u:500,v:444,w:667,x:444,y:444,z:389,braceleft:400,bar:275,braceright:400,asciitilde:541,exclamdown:389,cent:500,sterling:500,fraction:167,yen:500,florin:500,section:500,currency:500,quotesingle:214,quotedblleft:556,guillemotleft:500,guilsinglleft:333,guilsinglright:333,fi:500,fl:500,endash:500,dagger:500,daggerdbl:500,periodcentered:250,paragraph:523,bullet:350,quotesinglbase:333,quotedblbase:556,quotedblright:556,guillemotright:500,ellipsis:889,perthousand:1e3,questiondown:500,grave:333,acute:333,circumflex:333,tilde:333,macron:333,breve:333,dotaccent:333,dieresis:333,ring:333,cedilla:333,hungarumlaut:333,ogonek:333,caron:333,emdash:889,AE:889,ordfeminine:276,Lslash:556,Oslash:722,OE:944,ordmasculine:310,ae:667,dotlessi:278,lslash:278,oslash:500,oe:667,germandbls:500,Idieresis:333,eacute:444,abreve:500,uhungarumlaut:500,ecaron:444,Ydieresis:556,divide:675,Yacute:556,Acircumflex:611,aacute:500,Ucircumflex:722,yacute:444,scommaaccent:389,ecircumflex:444,Uring:722,Udieresis:722,aogonek:500,Uacute:722,uogonek:500,Edieresis:611,Dcroat:722,commaaccent:250,copyright:760,Emacron:611,ccaron:444,aring:500,Ncommaaccent:667,lacute:278,agrave:500,Tcommaaccent:556,Cacute:667,atilde:500,Edotaccent:611,scaron:389,scedilla:389,iacute:278,lozenge:471,Rcaron:611,Gcommaaccent:722,ucircumflex:500,acircumflex:500,Amacron:611,rcaron:389,ccedilla:444,Zdotaccent:556,Thorn:611,Omacron:722,Racute:611,Sacute:500,dcaron:544,Umacron:722,uring:500,threesuperior:300,Ograve:722,Agrave:611,Abreve:611,multiply:675,uacute:500,Tcaron:556,partialdiff:476,ydieresis:444,Nacute:667,icircumflex:278,Ecircumflex:611,adieresis:500,edieresis:444,cacute:444,nacute:500,umacron:500,Ncaron:667,Iacute:333,plusminus:675,brokenbar:275,registered:760,Gbreve:722,Idotaccent:333,summation:600,Egrave:611,racute:389,omacron:500,Zacute:556,Zcaron:556,greaterequal:549,Eth:722,Ccedilla:667,lcommaaccent:278,tcaron:300,eogonek:444,Uogonek:722,Aacute:611,Adieresis:611,egrave:444,zacute:389,iogonek:278,Oacute:722,oacute:500,amacron:500,sacute:389,idieresis:278,Ocircumflex:722,Ugrave:722,Delta:612,thorn:500,twosuperior:300,Odieresis:722,mu:500,igrave:278,ohungarumlaut:500,Eogonek:611,dcroat:500,threequarters:750,Scedilla:500,lcaron:300,Kcommaaccent:667,Lacute:556,trademark:980,edotaccent:444,Igrave:333,Imacron:333,Lcaron:611,onehalf:750,lessequal:549,ocircumflex:500,ntilde:500,Uhungarumlaut:722,Eacute:611,emacron:444,gbreve:500,onequarter:750,Scaron:500,Scommaaccent:500,Ohungarumlaut:722,degree:400,ograve:500,Ccaron:667,ugrave:500,radical:453,Dcaron:722,rcommaaccent:389,Ntilde:667,otilde:500,Rcommaaccent:611,Lcommaaccent:556,Atilde:611,Aogonek:611,Aring:611,Otilde:722,zdotaccent:389,Ecaron:611,Iogonek:333,kcommaaccent:444,minus:675,Icircumflex:333,ncaron:500,tcommaaccent:278,logicalnot:675,odieresis:500,udieresis:500,notequal:549,gcommaaccent:500,eth:500,zcaron:389,ncommaaccent:500,onesuperior:300,imacron:278,Euro:500},ZapfDingbats:{space:278,a1:974,a2:961,a202:974,a3:980,a4:719,a5:789,a119:790,a118:791,a117:690,a11:960,a12:939,a13:549,a14:855,a15:911,a16:933,a105:911,a17:945,a18:974,a19:755,a20:846,a21:762,a22:761,a23:571,a24:677,a25:763,a26:760,a27:759,a28:754,a6:494,a7:552,a8:537,a9:577,a10:692,a29:786,a30:788,a31:788,a32:790,a33:793,a34:794,a35:816,a36:823,a37:789,a38:841,a39:823,a40:833,a41:816,a42:831,a43:923,a44:744,a45:723,a46:749,a47:790,a48:792,a49:695,a50:776,a51:768,a52:792,a53:759,a54:707,a55:708,a56:682,a57:701,a58:826,a59:815,a60:789,a61:789,a62:707,a63:687,a64:696,a65:689,a66:786,a67:787,a68:713,a69:791,a70:785,a71:791,a72:873,a73:761,a74:762,a203:762,a75:759,a204:759,a76:892,a77:892,a78:788,a79:784,a81:438,a82:138,a83:277,a84:415,a97:392,a98:392,a99:668,a100:668,a89:390,a90:390,a93:317,a94:317,a91:276,a92:276,a205:509,a85:509,a206:410,a86:410,a87:234,a88:234,a95:334,a96:334,a101:732,a102:544,a103:544,a104:910,a106:667,a107:760,a108:760,a112:776,a111:595,a110:694,a109:626,a120:788,a121:788,a122:788,a123:788,a124:788,a125:788,a126:788,a127:788,a128:788,a129:788,a130:788,a131:788,a132:788,a133:788,a134:788,a135:788,a136:788,a137:788,a138:788,a139:788,a140:788,a141:788,a142:788,a143:788,a144:788,a145:788,a146:788,a147:788,a148:788,a149:788,a150:788,a151:788,a152:788,a153:788,a154:788,a155:788,a156:788,a157:788,a158:788,a159:788,a160:894,a161:838,a163:1016,a164:458,a196:748,a165:924,a192:748,a166:918,a167:927,a168:928,a169:928,a170:834,a171:873,a172:828,a173:924,a162:924,a174:917,a175:930,a176:931,a177:463,a178:883,a179:836,a193:836,a180:867,a199:867,a181:696,a200:696,a182:874,a201:874,a183:760,a184:946,a197:771,a185:865,a194:771,a198:888,a186:967,a195:888,a187:831,a188:873,a189:927,a190:970,a191:918}},Ca={},Sa=1e3,Aa=function(){function r(e,t,a){this.lexer=e,this.allowStreams=t,this.xref=a,this.imageCache={},this.refill()}return r.prototype={refill:function(){this.buf1=this.lexer.getObj(),this.buf2=this.lexer.getObj()},shift:function(){S(this.buf2,"ID")?(this.buf1=this.buf2,this.buf2=null):(this.buf1=this.buf2,this.buf2=this.lexer.getObj())},getObj:function(t){var r=this.buf1;if(this.shift(),r instanceof ke)switch(r.cmd){case"BI":return this.makeInlineImage(t);case"[":for(var i=[];!S(this.buf1,"]")&&!j(this.buf1);)i.push(this.getObj(t));return j(this.buf1)&&a("End of file inside array"),this.shift(),i;case"<<":for(var n=new we(this.xref);!S(this.buf1,">>")&&!j(this.buf1);)if(C(this.buf1)){var o=this.buf1.name;if(this.shift(),j(this.buf1))break;n.set(o,this.getObj(t))}else e("Malformed dictionary: key must be a name object"),this.shift();return j(this.buf1)&&a("End of file inside dictionary"),S(this.buf2,"stream")?this.allowStreams?this.makeStream(n,t):n:(this.shift(),n);default:return r}if(k(r)){var s=r;if(k(this.buf1)&&S(this.buf2,"R")){var c=new xe(s,this.buf1);return this.shift(),this.shift(),c}return s}if(x(r)){var l=r;return t&&(l=t.decryptString(l)),l}return r},makeInlineImage:function(e){for(var t=this.lexer,r=t.stream,n=new we(null);!S(this.buf1,"ID")&&!j(this.buf1);){C(this.buf1)||a("Dictionary key must be a name object");var o=this.buf1.name;if(this.shift(),j(this.buf1))break;n.set(o,this.getObj(e))}for(var s,c,l,h=r.pos,u=0,f=69,d=73,g=32,m=10,p=13;-1!==(s=r.getByte());)if(0===u)u=s===f?1:0;else if(1===u)u=s===d?2:0;else if(i(2===u),s===g||s===m||s===p){var b=5,v=r.peekBytes(b);for(c=0;b>c;c++)if(s=v[c],s!==m&&s!==p&&(g>s||s>127)){u=0;break}if(2===u)break}else u=0;var y,k=r.pos-4-h,w=r.makeSubStream(h,k,n);if(Sa>k){var x=w.getBytes();w.reset();var A=1,B=0;for(c=0,l=x.length;l>c;++c)A+=255&x[c],B+=A;if(y=B%65521<<16|A%65521,this.imageCache.adler32===y)return this.buf2=ke.get("EI"),this.shift(),this.imageCache[y].reset(),this.imageCache[y]}return e&&(w=e.createStream(w,k)),w=this.filter(w,n,k),w.dict=n,void 0!==y&&(w.cacheKey="inline_"+k+"_"+y,this.imageCache[y]=w),this.buf2=ke.get("EI"),this.shift(),w},fetchIfRef:function(e){return O(e)?this.xref.fetch(e):e},makeStream:function(t,r){var i=this.lexer,n=i.stream;i.skipToNextLine();var o=n.pos-1,s=this.fetchIfRef(t.get("Length"));if(k(s)||(e("Bad "+s+" attribute in stream"),s=0),n.pos=o+s,i.nextChar(),this.shift(),this.shift(),!S(this.buf1,"endstream")){n.pos=o;for(var c,l,h=2048,u=9,f=[101,110,100,115,116,114,101,97,109],d=0,g=!1;n.pos<n.end;){var m=n.peekBytes(h),p=m.length-u;if(0>=p)break;for(g=!1,c=0,l=0;p>c;c++){var b=m[c];if(b!==f[l])c-=l,l=0;else if(l++,l>=u){c++,g=!0;break}}if(g){d+=c-u,n.pos+=c-u;break}d+=p,n.pos+=p}g||a("Missing endstream"),s=d,i.nextChar(),this.shift(),this.shift()}return this.shift(),n=n.makeSubStream(o,s,t),r&&(n=r.createStream(n,s)),n=this.filter(n,t,s),n.dict=t,n},filter:function(e,t,r){var i=this.fetchIfRef(t.get("Filter","F")),n=this.fetchIfRef(t.get("DecodeParms","DP"));if(C(i))return this.makeFilter(e,i.name,r,n);var o=r;if(B(i))for(var s=i,c=n,l=0,h=s.length;h>l;++l)i=s[l],C(i)||a("Bad filter name: "+i),n=null,B(c)&&l in c&&(n=c[l]),e=this.makeFilter(e,i.name,o,n),o=null;return e},makeFilter:function(e,a,r,i){if(0===e.dict.get("Length"))return new Va(e);try{i&&(i=this.fetchIfRef(i));var n=this.xref.stats.streamTypes;if("FlateDecode"===a||"Fl"===a)return n[J.FLATE]=!0,i?new Ua(new qa(e,r),r,i):new qa(e,r);if("LZWDecode"===a||"LZW"===a){n[J.LZW]=!0;var o=1;return i?(i.has("EarlyChange")&&(o=i.get("EarlyChange")),new Ua(new Ja(e,r,o),r,i)):new Ja(e,r,o)}return"DCTDecode"===a||"DCT"===a?(n[J.DCT]=!0,new Fa(e,r,e.dict,this.xref)):"JPXDecode"===a||"JPX"===a?(n[J.JPX]=!0,new Na(e,r,e.dict)):"ASCII85Decode"===a||"A85"===a?(n[J.A85]=!0,new Ha(e,r)):"ASCIIHexDecode"===a||"AHx"===a?(n[J.AHX]=!0,new Ga(e,r)):"CCITTFaxDecode"===a||"CCF"===a?(n[J.CCF]=!0,new _a(e,r,i)):"RunLengthDecode"===a||"RL"===a?(n[J.RL]=!0,new Xa(e,r)):"JBIG2Decode"===a?(n[J.JBIG]=!0,new ja(e,r,e.dict)):(t('filter "'+a+'" not supported yet'),e)}catch(s){if(s instanceof ie)throw s;return t('Invalid stream: "'+s+'"'),new Va(e)}}},r}(),Ba=function(){function e(e,t){this.stream=e,this.nextChar(),this.strBuf=[],this.knownCommands=t}function r(e){return e>=48&&57>=e?15&e:e>=65&&70>=e||e>=97&&102>=e?(15&e)+9:-1}e.isSpace=function(e){return 32===e||9===e||13===e||10===e};var i=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];return e.prototype={nextChar:function(){return this.currentChar=this.stream.getByte()},peekChar:function(){return this.stream.peekByte()},getNumber:function(){var e=this.currentChar,r=!1,i=0,n=1;if(45===e?(n=-1,e=this.nextChar()):43===e&&(e=this.nextChar()),46===e&&(i=10,e=this.nextChar()),48>e||e>57)return a("Invalid number: "+String.fromCharCode(e)),0;for(var o=e-48,s=0,c=1;(e=this.nextChar())>=0;)if(e>=48&&57>=e){var l=e-48;r?s=10*s+l:(0!==i&&(i*=10),o=10*o+l)}else if(46===e){if(0!==i)break;i=1}else if(45===e)t("Badly formated number");else{if(69!==e&&101!==e)break;if(e=this.peekChar(),43===e||45===e)c=45===e?-1:1,this.nextChar();else if(48>e||e>57)break;r=!0}return 0!==i&&(o/=i),r&&(o*=Math.pow(10,c*s)),n*o},getString:function(){var e=1,a=!1,r=this.strBuf;r.length=0;for(var i=this.nextChar();;){var n=!1;switch(0|i){case-1:t("Unterminated string"),a=!0;break;case 40:++e,r.push("(");break;case 41:0===--e?(this.nextChar(),a=!0):r.push(")");break;case 92:switch(i=this.nextChar()){case-1:t("Unterminated string"),a=!0;break;case 110:r.push("\n");break;case 114:r.push("\r");break;case 116:r.push(" ");break;case 98:r.push("\b");break;case 102:r.push("\f");break;case 92:case 40:case 41:r.push(String.fromCharCode(i));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var o=15&i;i=this.nextChar(),n=!0,i>=48&&55>=i&&(o=(o<<3)+(15&i),i=this.nextChar(),i>=48&&55>=i&&(n=!1,o=(o<<3)+(15&i))),r.push(String.fromCharCode(o));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:r.push(String.fromCharCode(i))}break;default:r.push(String.fromCharCode(i))}if(a)break;n||(i=this.nextChar())}return r.join("")},getName:function(){var e,t=this.strBuf;for(t.length=0;(e=this.nextChar())>=0&&!i[e];)if(35===e){e=this.nextChar();var n=r(e);if(-1!==n){var o=r(this.nextChar());-1===o&&a("Illegal digit in hex char in name: "+o),t.push(String.fromCharCode(n<<4|o))}else t.push("#",String.fromCharCode(e))}else t.push(String.fromCharCode(e));return t.length>128&&a("Warning: name token is longer than allowed by the spec: "+t.length),ye.get(t.join(""))},getHexString:function(){var e=this.strBuf;e.length=0;for(var a,n,o=this.currentChar,s=!0;;){if(0>o){t("Unterminated hex string");break}if(62===o){this.nextChar();break}if(1!==i[o]){if(s){if(a=r(o),-1===a){t('Ignoring invalid character "'+o+'" in hex string'),o=this.nextChar();continue}}else{if(n=r(o),-1===n){t('Ignoring invalid character "'+o+'" in hex string'),o=this.nextChar();continue}e.push(String.fromCharCode(a<<4|n))}s=!s,o=this.nextChar()}else o=this.nextChar()}return e.join("")},getObj:function(){for(var e=!1,t=this.currentChar;;){if(0>t)return Ca;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==i[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:return this.nextChar(),ke.get("[");case 93:return this.nextChar(),ke.get("]");case 60:return t=this.nextChar(),60===t?(this.nextChar(),ke.get("<<")):this.getHexString();case 62:return t=this.nextChar(),62===t?(this.nextChar(),ke.get(">>")):ke.get(">");case 123:return this.nextChar(),ke.get("{");case 125:return this.nextChar(),ke.get("}");case 41:a("Illegal character: "+t)}for(var r=String.fromCharCode(t),n=this.knownCommands,o=n&&void 0!==n[r];(t=this.nextChar())>=0&&!i[t];){var s=r+String.fromCharCode(t);if(o&&void 0===n[s])break;128===r.length&&a("Command token too long: "+r.length),r=s,o=n&&void 0!==n[r]}return"true"===r?!0:"false"===r?!1:"null"===r?null:ke.get(r)},skipToNextLine:function(){for(var e=this.currentChar;e>=0;){if(13===e){e=this.nextChar(),10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}},e}(),Ia={create:function(e){function t(e,t){var a=l.get(e);if(k(a)&&(t?a>=0:a>0))return a;throw new Error('The "'+e+'" parameter in the linearization dictionary is invalid.')}function a(){var e,t,a=l.get("H");if(B(a)&&(2===(e=a.length)||4===e)){for(var r=0;e>r;r++)if(!(k(t=a[r])&&t>0))throw new Error("Hint ("+r+") in the linearization dictionary is invalid.");return a}throw new Error("Hint array in the linearization dictionary is invalid.")}var r,i,n=new Aa(new Ba(e),!1,null),o=n.getObj(),s=n.getObj(),c=n.getObj(),l=n.getObj();if(!(k(o)&&k(s)&&S(c,"obj")&&A(l)&&w(r=l.get("Linearized"))&&r>0))return null;if((i=t("L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:i,hints:a(),objectNumberFirst:t("O"),endFirst:t("E"),numPages:t("N"),mainXRefEntriesOffset:t("T"),pageFirst:l.has("P")?t("P",!0):0}}},Ta=function(){function e(e){this.lexer=e,this.operators=[],this.token=null,this.prev=null}return e.prototype={nextToken:function(){this.prev=this.token,this.token=this.lexer.getToken()},accept:function(e){return this.token.type===e?(this.nextToken(),!0):!1},expect:function(e){return this.accept(e)?!0:void a("Unexpected symbol: found "+this.token.type+" expected "+e+".")},parse:function(){return this.nextToken(),this.expect(Oa.LBRACE),this.parseBlock(),this.expect(Oa.RBRACE),this.operators},parseBlock:function(){for(;;)if(this.accept(Oa.NUMBER))this.operators.push(this.prev.value);else if(this.accept(Oa.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(Oa.LBRACE))return;this.parseCondition()}},parseCondition:function(){var e=this.operators.length;if(this.operators.push(null,null),this.parseBlock(),this.expect(Oa.RBRACE),this.accept(Oa.IF))this.operators[e]=this.operators.length,this.operators[e+1]="jz";else if(this.accept(Oa.LBRACE)){var t=this.operators.length;this.operators.push(null,null);var r=this.operators.length;this.parseBlock(),this.expect(Oa.RBRACE),this.expect(Oa.IFELSE),this.operators[t]=this.operators.length,this.operators[t+1]="j",this.operators[e]=r,this.operators[e+1]="jz"}else a("PS Function: error parsing conditional.")}},e}(),Oa={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5},La=function(){function e(e,t){this.type=e,this.value=t}var t={};return e.getOperator=function(a){var r=t[a];return r?r:t[a]=new e(Oa.OPERATOR,a)},e.LBRACE=new e(Oa.LBRACE,"{"),e.RBRACE=new e(Oa.RBRACE,"}"),e.IF=new e(Oa.IF,"IF"),e.IFELSE=new e(Oa.IFELSE,"IFELSE"),e}(),Ra=function(){function e(e){this.stream=e,this.nextChar(),this.strBuf=[]}return e.prototype={nextChar:function(){return this.currentChar=this.stream.getByte()},getToken:function(){for(var e=!1,t=this.currentChar;;){if(0>t)return Ca;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!Ba.isSpace(t))break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new La(Oa.NUMBER,this.getNumber());case 123:return this.nextChar(),La.LBRACE;case 125:return this.nextChar(),La.RBRACE}var a=this.strBuf;for(a.length=0,a[0]=String.fromCharCode(t);(t=this.nextChar())>=0&&(t>=65&&90>=t||t>=97&&122>=t);)a.push(String.fromCharCode(t));var r=a.join("");switch(r.toLowerCase()){case"if":return La.IF;case"ifelse":return La.IFELSE;default:return La.getOperator(r)}},getNumber:function(){var e=this.currentChar,t=this.strBuf;for(t.length=0,t[0]=String.fromCharCode(e);(e=this.nextChar())>=0&&(e>=48&&57>=e||45===e||46===e);)t.push(String.fromCharCode(e));var r=parseFloat(t.join(""));return isNaN(r)&&a("Invalid floating point number: "+r),r}},e}(),Pa=function(){function e(e,t,a,r){this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+a||this.bytes.length,this.dict=r}return e.prototype={get length(){return this.end-this.start},get isEmpty(){return 0===this.length},getByte:function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},getUint16:function(){var e=this.getByte(),t=this.getByte();
return(e<<8)+t},getInt32:function(){var e=this.getByte(),t=this.getByte(),a=this.getByte(),r=this.getByte();return(e<<24)+(t<<16)+(a<<8)+r},getBytes:function(e){var t=this.bytes,a=this.pos,r=this.end;if(!e)return t.subarray(a,r);var i=a+e;return i>r&&(i=r),this.pos=i,t.subarray(a,i)},peekByte:function(){var e=this.getByte();return this.pos--,e},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=this.start},moveStart:function(){this.start=this.pos},makeSubStream:function(t,a,r){return new e(this.bytes.buffer,t,a,r)},isStream:!0},e}(),Ma=function(){function e(e){for(var t=e.length,a=new Uint8Array(t),r=0;t>r;++r)a[r]=e.charCodeAt(r);Pa.call(this,a)}return e.prototype=Pa.prototype,e}(),Da=function(){function e(e){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=t,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}var t=new Uint8Array(0);return e.prototype={get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength},ensureBuffer:function(e){var t=this.buffer;if(e<=t.byteLength)return t;for(var a=this.minBufferLength;e>a;)a*=2;var r=new Uint8Array(a);return r.set(t),this.buffer=r},getByte:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]},getUint16:function(){var e=this.getByte(),t=this.getByte();return(e<<8)+t},getInt32:function(){var e=this.getByte(),t=this.getByte(),a=this.getByte(),r=this.getByte();return(e<<24)+(t<<16)+(a<<8)+r},getBytes:function(e){var t,a=this.pos;if(e){for(this.ensureBuffer(a+e),t=a+e;!this.eof&&this.bufferLength<t;)this.readBlock();var r=this.bufferLength;t>r&&(t=r)}else{for(;!this.eof;)this.readBlock();t=this.bufferLength}return this.pos=t,this.buffer.subarray(a,t)},peekByte:function(){var e=this.getByte();return this.pos--,e},peekBytes:function(e){var t=this.getBytes(e);return this.pos-=t.length,t},makeSubStream:function(e,t,a){for(var r=e+t;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Pa(this.buffer,e,t,a)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0},getBaseStreams:function(){return this.str&&this.str.getBaseStreams?this.str.getBaseStreams():[]}},e}(),Ea=function(){function e(e){this.streams=e,Da.call(this,null)}return e.prototype=Object.create(Da.prototype),e.prototype.readBlock=function(){var e=this.streams;if(0===e.length)return void(this.eof=!0);var t=e.shift(),a=t.getBytes(),r=this.bufferLength,i=r+a.length,n=this.ensureBuffer(i);n.set(a,r),this.bufferLength=i},e.prototype.getBaseStreams=function(){for(var e=[],t=0,a=this.streams.length;a>t;t++){var r=this.streams[t];r.getBaseStreams&&ce.appendToArray(e,r.getBaseStreams())}return e},e}(),qa=function(){function e(e,t){this.str=e,this.dict=e.dict;var r=e.getByte(),i=e.getByte();-1!==r&&-1!==i||a("Invalid header in flate stream: "+r+", "+i),8!==(15&r)&&a("Unknown compression method in flate stream: "+r+", "+i),((r<<8)+i)%31!==0&&a("Bad FCHECK in flate stream: "+r+", "+i),32&i&&a("FDICT bit set in flate stream: "+r+", "+i),this.codeSize=0,this.codeBuf=0,Da.call(this,t)}var t=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),r=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),i=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),n=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],o=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return e.prototype=Object.create(Da.prototype),e.prototype.getBits=function(e){for(var t,r=this.str,i=this.codeSize,n=this.codeBuf;e>i;)-1===(t=r.getByte())&&a("Bad encoding in flate stream"),n|=t<<i,i+=8;return t=n&(1<<e)-1,this.codeBuf=n>>e,this.codeSize=i-=e,t},e.prototype.getCode=function(e){for(var t,r=this.str,i=e[0],n=e[1],o=this.codeSize,s=this.codeBuf;n>o&&-1!==(t=r.getByte());)s|=t<<o,o+=8;var c=i[s&(1<<n)-1],l=c>>16,h=65535&c;return(1>l||l>o)&&a("Bad encoding in flate stream"),this.codeBuf=s>>l,this.codeSize=o-l,h},e.prototype.generateHuffmanTable=function(e){var t,a=e.length,r=0;for(t=0;a>t;++t)e[t]>r&&(r=e[t]);for(var i=1<<r,n=new Uint32Array(i),o=1,s=0,c=2;r>=o;++o,s<<=1,c<<=1)for(var l=0;a>l;++l)if(e[l]===o){var h=0,u=s;for(t=0;o>t;++t)h=h<<1|1&u,u>>=1;for(t=h;i>t;t+=c)n[t]=o<<16|l;++s}return[n,r]},e.prototype.readBlock=function(){var e,s,c=this.str,l=this.getBits(3);if(1&l&&(this.eof=!0),l>>=1,0!==l){var h,u;if(1===l)h=n,u=o;else if(2===l){var f,d=this.getBits(5)+257,g=this.getBits(5)+1,m=this.getBits(4)+4,p=new Uint8Array(t.length);for(f=0;m>f;++f)p[t[f]]=this.getBits(3);var b=this.generateHuffmanTable(p);s=0,f=0;for(var v,y,k,w=d+g,x=new Uint8Array(w);w>f;){var C=this.getCode(b);if(16===C)v=2,y=3,k=s;else if(17===C)v=3,y=3,k=s=0;else{if(18!==C){x[f++]=s=C;continue}v=7,y=11,k=s=0}for(var S=this.getBits(v)+y;S-- >0;)x[f++]=k}h=this.generateHuffmanTable(x.subarray(0,d)),u=this.generateHuffmanTable(x.subarray(d,w))}else a("Unknown block type in flate stream");e=this.buffer;for(var A=e?e.length:0,B=this.bufferLength;;){var I=this.getCode(h);if(256>I)B+1>=A&&(e=this.ensureBuffer(B+1),A=e.length),e[B++]=I;else{if(256===I)return void(this.bufferLength=B);I-=257,I=r[I];var T=I>>16;T>0&&(T=this.getBits(T)),s=(65535&I)+T,I=this.getCode(u),I=i[I],T=I>>16,T>0&&(T=this.getBits(T));var O=(65535&I)+T;B+s>=A&&(e=this.ensureBuffer(B+s),A=e.length);for(var L=0;s>L;++L,++B)e[B]=e[B-O]}}}else{var R;-1===(R=c.getByte())&&a("Bad block header in flate stream");var P=R;-1===(R=c.getByte())&&a("Bad block header in flate stream"),P|=R<<8,-1===(R=c.getByte())&&a("Bad block header in flate stream");var M=R;-1===(R=c.getByte())&&a("Bad block header in flate stream"),M|=R<<8,M===(65535&~P)||0===P&&0===M||a("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var D=this.bufferLength;e=this.ensureBuffer(D+P);var E=D+P;if(this.bufferLength=E,0===P)-1===c.peekByte()&&(this.eof=!0);else for(var q=D;E>q;++q){if(-1===(R=c.getByte())){this.eof=!0;break}e[q]=R}}},e}(),Ua=function(){function e(e,t,r){var i=this.predictor=r.get("Predictor")||1;if(1>=i)return e;2!==i&&(10>i||i>15)&&a("Unsupported predictor: "+i),2===i?this.readBlock=this.readBlockTiff:this.readBlock=this.readBlockPng,this.str=e,this.dict=e.dict;var n=this.colors=r.get("Colors")||1,o=this.bits=r.get("BitsPerComponent")||8,s=this.columns=r.get("Columns")||1;return this.pixBytes=n*o+7>>3,this.rowBytes=s*n*o+7>>3,Da.call(this,t),this}return e.prototype=Object.create(Da.prototype),e.prototype.readBlockTiff=function(){var e=this.rowBytes,t=this.bufferLength,a=this.ensureBuffer(t+e),r=this.bits,i=this.colors,n=this.str.getBytes(e);if(this.eof=!n.length,!this.eof){var o,s=0,c=0,l=0,h=0,u=t;if(1===r)for(o=0;e>o;++o){var f=n[o];s=s<<8|f,a[u++]=255&(f^s>>i),s&=65535}else if(8===r){for(o=0;i>o;++o)a[u++]=n[o];for(;e>o;++o)a[u]=a[u-i]+n[o],u++}else{var d=new Uint8Array(i+1),g=(1<<r)-1,m=0,p=t,b=this.columns;for(o=0;b>o;++o)for(var v=0;i>v;++v)r>l&&(s=s<<8|255&n[m++],l+=8),d[v]=d[v]+(s>>l-r)&g,l-=r,c=c<<r|d[v],h+=r,h>=8&&(a[p++]=c>>h-8&255,h-=8);h>0&&(a[p++]=(c<<8-h)+(s&(1<<8-h)-1))}this.bufferLength+=e}},e.prototype.readBlockPng=function(){var e=this.rowBytes,t=this.pixBytes,r=this.str.getByte(),i=this.str.getBytes(e);if(this.eof=!i.length,!this.eof){var n=this.bufferLength,o=this.ensureBuffer(n+e),s=o.subarray(n-e,n);0===s.length&&(s=new Uint8Array(e));var c,l,h,u=n;switch(r){case 0:for(c=0;e>c;++c)o[u++]=i[c];break;case 1:for(c=0;t>c;++c)o[u++]=i[c];for(;e>c;++c)o[u]=o[u-t]+i[c]&255,u++;break;case 2:for(c=0;e>c;++c)o[u++]=s[c]+i[c]&255;break;case 3:for(c=0;t>c;++c)o[u++]=(s[c]>>1)+i[c];for(;e>c;++c)o[u]=(s[c]+o[u-t]>>1)+i[c]&255,u++;break;case 4:for(c=0;t>c;++c)l=s[c],h=i[c],o[u++]=l+h;for(;e>c;++c){l=s[c];var f=s[c-t],d=o[u-t],g=d+l-f,m=g-d;0>m&&(m=-m);var p=g-l;0>p&&(p=-p);var b=g-f;0>b&&(b=-b),h=i[c],p>=m&&b>=m?o[u++]=d+h:b>=p?o[u++]=l+h:o[u++]=f+h}break;default:a("Unsupported predictor: "+r)}this.bufferLength+=e}},e}(),Fa=function(){function e(e,t,a,r){for(var i;-1!==(i=e.getByte());)if(255===i){e.skip(-1);break}this.stream=e,this.maybeLength=t,this.dict=a,Da.call(this,t)}return e.prototype=Object.create(Da.prototype),Object.defineProperty(e.prototype,"bytes",{get:function(){return o(this,"bytes",this.stream.getBytes(this.maybeLength))},configurable:!0}),e.prototype.ensureBuffer=function(e){if(!this.bufferLength)try{var t=new $a;if(this.forceRGB&&this.dict&&B(this.dict.get("Decode"))){for(var r=this.dict.get("Decode"),i=this.dict.get("BitsPerComponent")||8,n=r.length,o=new Int32Array(n),s=!1,c=(1<<i)-1,l=0;n>l;l+=2)o[l]=256*(r[l+1]-r[l])|0,o[l+1]=r[l]*c|0,256===o[l]&&0===o[l+1]||(s=!0);s&&(t.decodeTransform=o)}t.parse(this.bytes);var h=t.getData(this.drawWidth,this.drawHeight,this.forceRGB);this.buffer=h,this.bufferLength=h.length,this.eof=!0}catch(u){a("JPEG error: "+u)}},e.prototype.getBytes=function(e){return this.ensureBuffer(),this.buffer},e.prototype.getIR=function(){return PDFJS.createObjectURL(this.bytes,"image/jpeg")},e.prototype.isNativelySupported=function(e,t){var a=_e.parse(this.dict.get("ColorSpace","CS"),e,t);return"DeviceGray"===a.name||"DeviceRGB"===a.name},e.prototype.isNativelyDecodable=function(e,t){var a=_e.parse(this.dict.get("ColorSpace","CS"),e,t),r=a.numComps;return 1===r||3===r},e}(),Na=function(){function e(e,t,a){this.stream=e,this.maybeLength=t,this.dict=a,Da.call(this,t)}return e.prototype=Object.create(Da.prototype),Object.defineProperty(e.prototype,"bytes",{get:function(){return o(this,"bytes",this.stream.getBytes(this.maybeLength))},configurable:!0}),e.prototype.ensureBuffer=function(e){if(!this.bufferLength){var t=new er;t.parse(this.bytes);var a=t.width,r=t.height,i=t.componentsCount,n=t.tiles.length;if(1===n)this.buffer=t.tiles[0].items;else{for(var o=new Uint8Array(a*r*i),s=0;n>s;s++)for(var c=t.tiles[s],l=c.width,h=c.height,u=c.left,f=c.top,d=c.items,g=0,m=(a*f+u)*i,p=a*i,b=l*i,v=0;h>v;v++){var y=d.subarray(g,g+b);o.set(y,m),g+=b,m+=p}this.buffer=o}this.bufferLength=this.buffer.length,this.eof=!0}},e}(),ja=function(){function e(e,t,a){this.stream=e,this.maybeLength=t,this.dict=a,Da.call(this,t)}return e.prototype=Object.create(Da.prototype),Object.defineProperty(e.prototype,"bytes",{get:function(){return o(this,"bytes",this.stream.getBytes(this.maybeLength))},configurable:!0}),e.prototype.ensureBuffer=function(e){if(!this.bufferLength){var a=new tr,r=[],i=this.dict.xref,n=i.fetchIfRef(this.dict.get("DecodeParms"));if(B(n)&&(n.length>1&&t("JBIG2 - 'DecodeParms' array with multiple elements not supported."),n=i.fetchIfRef(n[0])),n&&n.has("JBIG2Globals")){var o=n.get("JBIG2Globals"),s=o.getBytes();r.push({data:s,start:0,end:s.length})}r.push({data:this.bytes,start:0,end:this.bytes.length});for(var c=a.parseChunks(r),l=c.length,h=0;l>h;h++)c[h]^=255;this.buffer=c,this.bufferLength=l,this.eof=!0}},e}(),za=function(){function e(e,t,a){this.str=e,this.dict=e.dict,this.decrypt=a,this.nextChunk=null,this.initialized=!1,Da.call(this,t)}var t=512;return e.prototype=Object.create(Da.prototype),e.prototype.readBlock=function(){var e;if(this.initialized?e=this.nextChunk:(e=this.str.getBytes(t),this.initialized=!0),!e||0===e.length)return void(this.eof=!0);this.nextChunk=this.str.getBytes(t);var a=this.nextChunk&&this.nextChunk.length>0,r=this.decrypt;e=r(e,!a);var i,n=this.bufferLength,o=e.length,s=this.ensureBuffer(n+o);for(i=0;o>i;i++)s[n++]=e[i];this.bufferLength=n},e}(),Ha=function(){function e(e,t){this.str=e,this.dict=e.dict,this.input=new Uint8Array(5),t&&(t=.8*t),Da.call(this,t)}return e.prototype=Object.create(Da.prototype),e.prototype.readBlock=function(){for(var e=126,t=122,a=-1,r=this.str,i=r.getByte();Ba.isSpace(i);)i=r.getByte();if(i===a||i===e)return void(this.eof=!0);var n,o,s=this.bufferLength;if(i===t){for(n=this.ensureBuffer(s+4),o=0;4>o;++o)n[s+o]=0;this.bufferLength+=4}else{var c=this.input;for(c[0]=i,o=1;5>o;++o){for(i=r.getByte();Ba.isSpace(i);)i=r.getByte();if(c[o]=i,i===a||i===e)break}if(n=this.ensureBuffer(s+o-1),this.bufferLength+=o-1,5>o){for(;5>o;++o)c[o]=117;this.eof=!0}var l=0;for(o=0;5>o;++o)l=85*l+(c[o]-33);for(o=3;o>=0;--o)n[s+o]=255&l,l>>=8}},e}(),Ga=function(){function e(e,t){this.str=e,this.dict=e.dict,this.firstDigit=-1,t&&(t=.5*t),Da.call(this,t)}return e.prototype=Object.create(Da.prototype),e.prototype.readBlock=function(){var e=8e3,t=this.str.getBytes(e);if(!t.length)return void(this.eof=!0);for(var a=t.length+1>>1,r=this.ensureBuffer(this.bufferLength+a),i=this.bufferLength,n=this.firstDigit,o=0,s=t.length;s>o;o++){var c,l=t[o];if(l>=48&&57>=l)c=15&l;else{if(!(l>=65&&70>=l||l>=97&&102>=l)){if(62===l){this.eof=!0;break}continue}c=(15&l)+9}0>n?n=c:(r[i++]=n<<4|c,n=-1)}n>=0&&this.eof&&(r[i++]=n<<4,n=-1),this.firstDigit=n,this.bufferLength=i},e}(),Xa=function(){function e(e,t){this.str=e,this.dict=e.dict,Da.call(this,t)}return e.prototype=Object.create(Da.prototype),e.prototype.readBlock=function(){var e=this.str.getBytes(2);if(!e||e.length<2||128===e[0])return void(this.eof=!0);var t,a=this.bufferLength,r=e[0];if(128>r){if(t=this.ensureBuffer(a+r+1),t[a++]=e[1],r>0){var i=this.str.getBytes(r);t.set(i,a),a+=r}}else{r=257-r;var n=e[1];t=this.ensureBuffer(a+r+1);for(var o=0;r>o;o++)t[a++]=n}this.bufferLength=a},e}(),_a=function(){function t(e,t,a){this.str=e,this.dict=e.dict,a=a||we.empty,this.encoding=a.get("K")||0,this.eoline=a.get("EndOfLine")||!1,this.byteAlign=a.get("EncodedByteAlign")||!1,this.columns=a.get("Columns")||1728,this.rows=a.get("Rows")||0;var r=a.get("EndOfBlock");null!==r&&void 0!==r||(r=!0),this.eoblock=r,this.black=a.get("BlackIs1")||!1,this.codingLine=new Uint32Array(this.columns+1),this.refLine=new Uint32Array(this.columns+2),this.codingLine[0]=this.columns,this.codingPos=0,this.row=0,this.nextLine2D=this.encoding<0,this.inputBits=0,this.inputBuf=0,this.outputBits=0;for(var i;0===(i=this.lookBits(12));)this.eatBits(1);1===i&&this.eatBits(12),this.encoding>0&&(this.nextLine2D=!this.lookBits(1),this.eatBits(1)),Da.call(this,t)}var a=-2,r=0,i=1,n=2,o=3,s=4,c=5,l=6,h=7,u=8,f=[[-1,-1],[-1,-1],[7,u],[7,h],[6,l],[6,l],[6,c],[6,c],[4,r],[4,r],[4,r],[4,r],[4,r],[4,r],[4,r],[4,r],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,i],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,s],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[3,o],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n],[1,n]],d=[[-1,-1],[12,a],[-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],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],g=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],m=[[-1,-1],[-1,-1],[12,a],[12,a],[-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],[-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],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],p=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],b=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];return t.prototype=Object.create(Da.prototype),t.prototype.readBlock=function(){for(;!this.eof;){var e=this.lookChar();this.ensureBuffer(this.bufferLength+1),this.buffer[this.bufferLength++]=e}},t.prototype.addPixels=function(t,a){var r=this.codingLine,i=this.codingPos;t>r[i]&&(t>this.columns&&(e("row is wrong length"),this.err=!0,t=this.columns),1&i^a&&++i,r[i]=t),this.codingPos=i},t.prototype.addPixelsNeg=function(t,a){var r=this.codingLine,i=this.codingPos;if(t>r[i])t>this.columns&&(e("row is wrong length"),this.err=!0,t=this.columns),1&i^a&&++i,r[i]=t;else if(t<r[i]){for(0>t&&(e("invalid code"),this.err=!0,t=0);i>0&&t<r[i-1];)--i;r[i]=t}this.codingPos=i},t.prototype.lookChar=function(){var t,a,f,d,g=this.refLine,m=this.codingLine,p=this.columns;if(0===this.outputBits){if(this.eof)return null;this.err=!1;var b,v,y;if(this.nextLine2D){for(d=0;m[d]<p;++d)g[d]=m[d];for(g[d++]=p,g[d]=p,m[0]=0,this.codingPos=0,t=0,a=0;m[this.codingPos]<p;)switch(b=this.getTwoDimCode()){case r:this.addPixels(g[t+1],a),g[t+1]<p&&(t+=2);break;case i:if(b=v=0,a){do b+=y=this.getBlackCode();while(y>=64);do v+=y=this.getWhiteCode();while(y>=64)}else{do b+=y=this.getWhiteCode();while(y>=64);do v+=y=this.getBlackCode();while(y>=64)}for(this.addPixels(m[this.codingPos]+b,a),m[this.codingPos]<p&&this.addPixels(m[this.codingPos]+v,1^a);g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case h:if(this.addPixels(g[t]+3,a),a^=1,m[this.codingPos]<p)for(++t;g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case c:if(this.addPixels(g[t]+2,a),a^=1,m[this.codingPos]<p)for(++t;g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case o:if(this.addPixels(g[t]+1,a),a^=1,m[this.codingPos]<p)for(++t;g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case n:if(this.addPixels(g[t],a),a^=1,m[this.codingPos]<p)for(++t;g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case u:if(this.addPixelsNeg(g[t]-3,a),a^=1,m[this.codingPos]<p)for(t>0?--t:++t;g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case l:if(this.addPixelsNeg(g[t]-2,a),a^=1,m[this.codingPos]<p)for(t>0?--t:++t;g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case s:if(this.addPixelsNeg(g[t]-1,a),a^=1,m[this.codingPos]<p)for(t>0?--t:++t;g[t]<=m[this.codingPos]&&g[t]<p;)t+=2;break;case Ca:this.addPixels(p,0),this.eof=!0;break;default:e("bad 2d code"),this.addPixels(p,0),this.err=!0}}else for(m[0]=0,this.codingPos=0,a=0;m[this.codingPos]<p;){if(b=0,a){do b+=y=this.getBlackCode();while(y>=64)}else do b+=y=this.getWhiteCode();while(y>=64);this.addPixels(m[this.codingPos]+b,a),a^=1}var k=!1;if(this.eoblock||this.row!==this.rows-1){if(this.eoline||!this.byteAlign){if(b=this.lookBits(12),this.eoline)for(;b!==Ca&&1!==b;)this.eatBits(1),b=this.lookBits(12);else for(;0===b;)this.eatBits(1),b=this.lookBits(12);1===b?(this.eatBits(12),k=!0):b===Ca&&(this.eof=!0)}}else this.eof=!0;if(this.byteAlign&&!k&&(this.inputBits&=-8),!this.eof&&this.encoding>0&&(this.nextLine2D=!this.lookBits(1),this.eatBits(1)),this.eoblock&&k&&this.byteAlign){if(b=this.lookBits(12),1===b){if(this.eatBits(12),this.encoding>0&&(this.lookBits(1),this.eatBits(1)),this.encoding>=0)for(d=0;4>d;++d)b=this.lookBits(12),1!==b&&e("bad rtc code: "+b),this.eatBits(12),this.encoding>0&&(this.lookBits(1),this.eatBits(1));this.eof=!0}}else if(this.err&&this.eoline){for(;;){if(b=this.lookBits(13),b===Ca)return this.eof=!0,null;if(b>>1===1)break;this.eatBits(1)}this.eatBits(12),this.encoding>0&&(this.eatBits(1),this.nextLine2D=!(1&b))}m[0]>0?this.outputBits=m[this.codingPos=0]:this.outputBits=m[this.codingPos=1],this.row++}var w;if(this.outputBits>=8)w=1&this.codingPos?0:255,this.outputBits-=8,0===this.outputBits&&m[this.codingPos]<p&&(this.codingPos++,this.outputBits=m[this.codingPos]-m[this.codingPos-1]);else{f=8,w=0;do this.outputBits>f?(w<<=f,1&this.codingPos||(w|=255>>8-f),this.outputBits-=f,f=0):(w<<=this.outputBits,1&this.codingPos||(w|=255>>8-this.outputBits),f-=this.outputBits,this.outputBits=0,m[this.codingPos]<p?(this.codingPos++,this.outputBits=m[this.codingPos]-m[this.codingPos-1]):f>0&&(w<<=f,f=0));while(f)}return this.black&&(w^=255),w},t.prototype.findTableCode=function(e,t,a,r){for(var i=r||0,n=e;t>=n;++n){var o=this.lookBits(n);if(o===Ca)return[!0,1,!1];if(t>n&&(o<<=t-n),!i||o>=i){var s=a[o-i];if(s[0]===n)return this.eatBits(n),[!0,s[1],!0]}}return[!1,0,!1]},t.prototype.getTwoDimCode=function(){var t,a=0;if(this.eoblock){if(a=this.lookBits(7),t=f[a],t&&t[0]>0)return this.eatBits(t[0]),t[1]}else{var r=this.findTableCode(1,7,f);if(r[0]&&r[2])return r[1]}return e("Bad two dim code"),Ca},t.prototype.getWhiteCode=function(){var t,a=0;if(this.eoblock){if(a=this.lookBits(12),a===Ca)return 1;if(t=a>>5===0?d[a]:g[a>>3],t[0]>0)return this.eatBits(t[0]),t[1]}else{var r=this.findTableCode(1,9,g);if(r[0])return r[1];if(r=this.findTableCode(11,12,d),r[0])return r[1]}return e("bad white code"),this.eatBits(1),1},t.prototype.getBlackCode=function(){var t,a;if(this.eoblock){if(t=this.lookBits(13),t===Ca)return 1;if(a=t>>7===0?m[t]:t>>9===0&&t>>7!==0?p[(t>>1)-64]:b[t>>7],a[0]>0)return this.eatBits(a[0]),a[1]}else{var r=this.findTableCode(2,6,b);if(r[0])return r[1];if(r=this.findTableCode(7,12,p,64),r[0])return r[1];if(r=this.findTableCode(10,13,m),r[0])return r[1]}return e("bad black code"),this.eatBits(1),1},t.prototype.lookBits=function(e){for(var t;this.inputBits<e;){if(-1===(t=this.str.getByte()))return 0===this.inputBits?Ca:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=(this.inputBuf<<8)+t,this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e},t.prototype.eatBits=function(e){(this.inputBits-=e)<0&&(this.inputBits=0)},t}(),Ja=function(){function e(e,t,a){this.str=e,this.dict=e.dict,this.cachedData=0,this.bitsCached=0;for(var r=4096,i={earlyChange:a,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(r),dictionaryLengths:new Uint16Array(r),dictionaryPrevCodes:new Uint16Array(r),currentSequence:new Uint8Array(r),currentSequenceLength:0},n=0;256>n;++n)i.dictionaryValues[n]=n,i.dictionaryLengths[n]=1;this.lzwState=i,Da.call(this,t)}return e.prototype=Object.create(Da.prototype),e.prototype.readBits=function(e){for(var t=this.bitsCached,a=this.cachedData;e>t;){var r=this.str.getByte();if(-1===r)return this.eof=!0,null;a=a<<8|r,t+=8}return this.bitsCached=t-=e,this.cachedData=a,this.lastCode=null,a>>>t&(1<<e)-1},e.prototype.readBlock=function(){var e,t,a,r=512,i=2*r,n=r,o=this.lzwState;if(o){var s=o.earlyChange,c=o.nextCode,l=o.dictionaryValues,h=o.dictionaryLengths,u=o.dictionaryPrevCodes,f=o.codeLength,d=o.prevCode,g=o.currentSequence,m=o.currentSequenceLength,p=0,b=this.bufferLength,v=this.ensureBuffer(this.bufferLength+i);
for(e=0;r>e;e++){var y=this.readBits(f),k=m>0;if(256>y)g[0]=y,m=1;else{if(!(y>=258)){if(256===y){f=9,c=258,m=0;continue}this.eof=!0,delete this.lzwState;break}if(c>y)for(m=h[y],t=m-1,a=y;t>=0;t--)g[t]=l[a],a=u[a];else g[m++]=g[0]}if(k&&(u[c]=d,h[c]=h[d]+1,l[c]=g[0],c++,f=c+s&c+s-1?f:0|Math.min(Math.log(c+s)/.6931471805599453+1,12)),d=y,p+=m,p>i){do i+=n;while(p>i);v=this.ensureBuffer(this.bufferLength+i)}for(t=0;m>t;t++)v[b++]=g[t]}o.nextCode=c,o.codeLength=f,o.prevCode=d,o.currentSequenceLength=m,this.bufferLength=b}},e}(),Va=function(){function e(){Pa.call(this,new Uint8Array(0))}return e.prototype=Pa.prototype,e}(),Wa=PDFJS.WorkerMessageHandler={setup:function(a){function r(e){var t=L(),a=function(){var e=n.ensureDoc("numPages"),a=n.ensureDoc("fingerprint"),i=n.ensureXRef("encrypt");Promise.all([e,a,i]).then(function(e){var a={numPages:e[0],fingerprint:e[1],encrypted:!!e[2]};t.resolve(a)},r)},r=function(e){t.reject(e)};return n.ensureDoc("checkHeader",[]).then(function(){n.ensureDoc("parseStartXRef",[]).then(function(){n.ensureDoc("parse",[e]).then(a,r)},r)},r),t.promise}function i(e){var r=L(),i=e.source,o=e.disableRange;if(i.data){try{n=new me(i.data,i.password),r.resolve()}catch(s){r.reject(s)}return r.promise}if(i.chunkedViewerLoading){try{n=new pe(i,a),r.resolve()}catch(s){r.reject(s)}return r.promise}var c=new he(i.url,{httpHeaders:i.httpHeaders,withCredentials:i.withCredentials}),l=[],h=c.requestFull({onHeadersReceived:function(){if(!o){var e=c.getRequestXhr(h);if("bytes"===e.getResponseHeader("Accept-Ranges")){var t=e.getResponseHeader("Content-Encoding")||"identity";if("identity"===t){var s=e.getResponseHeader("Content-Length");if(s=parseInt(s,10),k(s)&&(i.length=s,!(2*de>=s))){c.isStreamingRequest(h)?i.disableAutoFetch=!0:c.abortRequest(h);try{n=new pe(i,a),r.resolve(n)}catch(l){r.reject(l)}}}}}},onProgressiveData:i.disableStream?null:function(e){return n?void n.sendProgressiveData(e):void l.push(e)},onDone:function(e){if(!n){var a;if(null===e){var o=0,s=0;l.forEach(function(e){o+=e.byteLength}),i.length&&o!==i.length&&t("reported HTTP length is different from actual");var c=new Uint8Array(o);l.forEach(function(e){c.set(new Uint8Array(e),s),s+=e.byteLength}),a=c.buffer}else a=e.chunk;try{n=new me(a,i.password),r.resolve()}catch(h){r.reject(h)}}},onError:function(e){var t;404===e?(t=new te('Missing PDF "'+i.url+'".'),a.send("MissingPDF",t)):(t=new ae("Unexpected server response ("+e+') while retrieving PDF "'+i.url+'".',e),a.send("UnexpectedResponse",t))},onProgress:function(e){a.send("DocProgress",{loaded:e.loaded,total:e.lengthComputable?e.total:i.length})}});return r.promise}var n;a.on("test",function(e){if(!(e instanceof Uint8Array))return void a.send("test",!1);var t=255===e[0];a.postMessageTransfers=t;var r=new XMLHttpRequest,i="response"in r;try{r.responseType}catch(n){i=!1}return i?void a.send("test",{supportTypedArray:!0,supportTransfers:t}):void a.send("test",!1)}),a.on("GetDocRequest",function(e){var t=function(e){a.send("GetDoc",{pdfInfo:e})},o=function(e){e instanceof Q?e.code===Z.NEED_PASSWORD?a.send("NeedPassword",e):e.code===Z.INCORRECT_PASSWORD&&a.send("IncorrectPassword",e):e instanceof ee?a.send("InvalidPDF",e):e instanceof te?a.send("MissingPDF",e):e instanceof ae?a.send("UnexpectedResponse",e):a.send("UnknownError",new $(e.message,e.toString()))};PDFJS.maxImageSize=void 0===e.maxImageSize?-1:e.maxImageSize,PDFJS.disableFontFace=e.disableFontFace,PDFJS.disableCreateObjectURL=e.disableCreateObjectURL,PDFJS.verbosity=e.verbosity,PDFJS.cMapUrl=void 0===e.cMapUrl?null:e.cMapUrl,PDFJS.cMapPacked=e.cMapPacked===!0,i(e).then(function(){a.send("PDFManagerReady",null),n.onLoadedStream().then(function(e){a.send("DataLoaded",{length:e.bytes.byteLength})})}).then(function s(){r(!1).then(t,function(e){return e instanceof ne?(n.requestLoadedStream(),void n.onLoadedStream().then(function(){r(!0).then(t,o)})):(e instanceof Q&&n.passwordChanged().then(s),void o(e))},o)},o)}),a.on("GetPage",function(e){return n.getPage(e.pageIndex).then(function(e){var t=n.ensure(e,"rotate"),a=n.ensure(e,"ref"),r=n.ensure(e,"view");return Promise.all([t,a,r]).then(function(e){return{rotate:e[0],ref:e[1],view:e[2]}})})}),a.on("GetPageIndex",function(e){var t=new xe(e.ref.num,e.ref.gen),a=n.pdfDocument.catalog;return a.getPageIndex(t)}),a.on("GetDestinations",function(e){return n.ensureCatalog("destinations")}),a.on("GetDestination",function(e){return n.ensureCatalog("getDestination",[e.id])}),a.on("GetAttachments",function(e){return n.ensureCatalog("attachments")}),a.on("GetJavaScript",function(e){return n.ensureCatalog("javaScript")}),a.on("GetOutline",function(e){return n.ensureCatalog("documentOutline")}),a.on("GetMetadata",function(e){return Promise.all([n.ensureDoc("documentInfo"),n.ensureCatalog("metadata")])}),a.on("GetData",function(e){return n.requestLoadedStream(),n.onLoadedStream().then(function(e){return e.bytes})}),a.on("GetStats",function(e){return n.pdfDocument.xref.stats}),a.on("UpdatePassword",function(e){n.updatePassword(e)}),a.on("GetAnnotations",function(e){return n.getPage(e.pageIndex).then(function(e){return n.ensure(e,"getAnnotationsData",[])})}),a.on("RenderPageRequest",function(t){n.getPage(t.pageIndex).then(function(r){var i=t.pageIndex+1,n=Date.now();r.getOperatorList(a,t.intent).then(function(t){e("page="+i+" - getOperatorList: time="+(Date.now()-n)+"ms, len="+t.fnArray.length)},function(e){var r,n="worker.js: while trying to getPage() and getOperatorList()";r="string"==typeof e?{message:e,stack:n}:"object"==typeof e?{message:e.message||e.toString(),stack:e.stack||n}:{message:"Unknown exception type: "+typeof e,stack:n},a.send("PageError",{pageNum:i,error:r,intent:t.intent})})})},this),a.on("GetTextContent",function(t){return n.getPage(t.pageIndex).then(function(a){var r=t.pageIndex+1,i=Date.now();return a.extractTextContent().then(function(t){return e("text indexing: page="+r+" - time="+(Date.now()-i)+"ms"),t})})}),a.on("Cleanup",function(e){return n.cleanup()}),a.on("Terminate",function(e){n.terminate()})}},Ka={},Ya={log:function(){var e=Array.prototype.slice.call(arguments);z.postMessage({action:"console_log",data:e})},error:function(){var e=Array.prototype.slice.call(arguments);throw z.postMessage({action:"console_error",data:e}),"pdf.js execution error"},time:function(e){Ka[e]=Date.now()},timeEnd:function(e){var t=Ka[e];t||a("Unknown timer name "+e),this.log("Timer:",e,Date.now()-t)}};if("undefined"==typeof window){"console"in z||(z.console=Ya),PDFJS.UnsupportedManager.listen(function(e){z.postMessage({action:"_unsupported_feature",data:e})});var Za=new R("worker_processor",this);Wa.setup(Za)}var Qa=function(){function e(e,t,a){this.data=e,this.bp=t,this.dataEnd=a,this.chigh=e[t],this.clow=0,this.byteIn(),this.chigh=this.chigh<<7&65535|this.clow>>9&127,this.clow=this.clow<<7&65535,this.ct-=7,this.a=32768}var t=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];return e.prototype={byteIn:function(){var e=this.data,t=this.bp;if(255===e[t]){var a=e[t+1];a>143?(this.clow+=65280,this.ct=8):(t++,this.clow+=e[t]<<9,this.ct=7,this.bp=t)}else t++,this.clow+=t<this.dataEnd?e[t]<<8:65280,this.ct=8,this.bp=t;this.clow>65535&&(this.chigh+=this.clow>>16,this.clow&=65535)},readBit:function(e,a){var r,i=e[a]>>1,n=1&e[a],o=t[i],s=o.qe,c=this.a-s;if(this.chigh<s)s>c?(c=s,r=n,i=o.nmps):(c=s,r=1^n,1===o.switchFlag&&(n=r),i=o.nlps);else{if(this.chigh-=s,0!==(32768&c))return this.a=c,n;s>c?(r=1^n,1===o.switchFlag&&(n=r),i=o.nlps):(r=n,i=o.nmps)}do 0===this.ct&&this.byteIn(),c<<=1,this.chigh=this.chigh<<1&65535|this.clow>>15&1,this.clow=this.clow<<1&65535,this.ct--;while(0===(32768&c));return this.a=c,e[a]=i<<1|n,r}},e}(),$a=function(){function e(){}function t(e,t){for(var a,r,i=0,n=[],o=16;o>0&&!e[o-1];)o--;n.push({children:[],index:0});var s,c=n[0];for(a=0;o>a;a++){for(r=0;r<e[a];r++){for(c=n.pop(),c.children[c.index]=t[i];c.index>0;)c=n.pop();for(c.index++,n.push(c);n.length<=a;)n.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s;i++}o>a+1&&(n.push(s={children:[],index:0}),c.children[c.index]=s.children,c=s)}return n[0].children}function a(e,t,a){return 64*((e.blocksPerLine+1)*t+a)}function r(e,t,r,i,n,o,c,l,h){function u(){if(M>0)return M--,P>>M&1;if(P=e[t++],255===P){var a=e[t++];if(a)throw"unexpected marker: "+(P<<8|a).toString(16)}return M=7,P>>>7}function f(e){for(var t=e;;){if(t=t[u()],"number"==typeof t)return t;if("object"!=typeof t)throw"invalid huffman sequence"}}function d(e){for(var t=0;e>0;)t=t<<1|u(),e--;return t}function g(e){if(1===e)return 1===u()?1:-1;var t=d(e);return t>=1<<e-1?t:t+(-1<<e)+1}function m(e,t){var a=f(e.huffmanTableDC),r=0===a?0:g(a);e.blockData[t]=e.pred+=r;for(var i=1;64>i;){var n=f(e.huffmanTableAC),o=15&n,c=n>>4;if(0!==o){i+=c;var l=s[i];e.blockData[t+l]=g(o),i++}else{if(15>c)break;i+=16}}}function p(e,t){var a=f(e.huffmanTableDC),r=0===a?0:g(a)<<h;e.blockData[t]=e.pred+=r}function b(e,t){e.blockData[t]|=u()<<h}function v(e,t){if(D>0)return void D--;for(var a=o,r=c;r>=a;){var i=f(e.huffmanTableAC),n=15&i,l=i>>4;if(0!==n){a+=l;var u=s[a];e.blockData[t+u]=g(n)*(1<<h),a++}else{if(15>l){D=d(l)+(1<<l)-1;break}a+=16}}}function y(e,t){for(var a,r,i=o,n=c,l=0;n>=i;){var m=s[i];switch(E){case 0:if(r=f(e.huffmanTableAC),a=15&r,l=r>>4,0===a)15>l?(D=d(l)+(1<<l),E=4):(l=16,E=1);else{if(1!==a)throw"invalid ACn encoding";x=g(a),E=l?2:3}continue;case 1:case 2:e.blockData[t+m]?e.blockData[t+m]+=u()<<h:(l--,0===l&&(E=2===E?3:0));break;case 3:e.blockData[t+m]?e.blockData[t+m]+=u()<<h:(e.blockData[t+m]=x<<h,E=0);break;case 4:e.blockData[t+m]&&(e.blockData[t+m]+=u()<<h)}i++}4===E&&(D--,0===D&&(E=0))}function k(e,t,r,i,n){var o=r/O|0,s=r%O,c=o*e.v+i,l=s*e.h+n,h=a(e,c,l);t(e,h)}function w(e,t,r){var i=r/e.blocksPerLine|0,n=r%e.blocksPerLine,o=a(e,i,n);t(e,o)}var x,C,S,A,B,I,T,O=(r.precision,r.samplesPerLine,r.scanLines,r.mcusPerLine),L=r.progressive,R=(r.maxH,r.maxV,t),P=0,M=0,D=0,E=0,q=i.length;T=L?0===o?0===l?p:b:0===l?v:y:m;var U,F,N=0;F=1===q?i[0].blocksPerLine*i[0].blocksPerColumn:O*r.mcusPerColumn,n||(n=F);for(var j,z;F>N;){for(S=0;q>S;S++)i[S].pred=0;if(D=0,1===q)for(C=i[0],I=0;n>I;I++)w(C,T,N),N++;else for(I=0;n>I;I++){for(S=0;q>S;S++)for(C=i[S],j=C.h,z=C.v,A=0;z>A;A++)for(B=0;j>B;B++)k(C,T,N,A,B);N++}if(M=0,U=e[t]<<8|e[t+1],65280>=U)throw"marker was not found";if(!(U>=65488&&65495>=U))break;t+=2}return t-R}function i(e,t,a){for(var r,i,n,o,s,p,b,v,y,k,w,x,C,S,A,B,I,T=e.quantizationTable,O=e.blockData,L=0;64>L;L+=8)y=O[t+L],k=O[t+L+1],w=O[t+L+2],x=O[t+L+3],C=O[t+L+4],S=O[t+L+5],A=O[t+L+6],B=O[t+L+7],y*=T[L],0!==(k|w|x|C|S|A|B)?(k*=T[L+1],w*=T[L+2],x*=T[L+3],C*=T[L+4],S*=T[L+5],A*=T[L+6],B*=T[L+7],r=g*y+128>>8,i=g*C+128>>8,n=w,o=A,s=m*(k-B)+128>>8,v=m*(k+B)+128>>8,p=x<<4,b=S<<4,r=r+i+1>>1,i=r-i,I=n*d+o*f+128>>8,n=n*f-o*d+128>>8,o=I,s=s+b+1>>1,b=s-b,v=v+p+1>>1,p=v-p,r=r+o+1>>1,o=r-o,i=i+n+1>>1,n=i-n,I=s*u+v*h+2048>>12,s=s*h-v*u+2048>>12,v=I,I=p*l+b*c+2048>>12,p=p*c-b*l+2048>>12,b=I,a[L]=r+v,a[L+7]=r-v,a[L+1]=i+b,a[L+6]=i-b,a[L+2]=n+p,a[L+5]=n-p,a[L+3]=o+s,a[L+4]=o-s):(I=g*y+512>>10,a[L]=I,a[L+1]=I,a[L+2]=I,a[L+3]=I,a[L+4]=I,a[L+5]=I,a[L+6]=I,a[L+7]=I);for(var R=0;8>R;++R)y=a[R],k=a[R+8],w=a[R+16],x=a[R+24],C=a[R+32],S=a[R+40],A=a[R+48],B=a[R+56],0!==(k|w|x|C|S|A|B)?(r=g*y+2048>>12,i=g*C+2048>>12,n=w,o=A,s=m*(k-B)+2048>>12,v=m*(k+B)+2048>>12,p=x,b=S,r=(r+i+1>>1)+4112,i=r-i,I=n*d+o*f+2048>>12,n=n*f-o*d+2048>>12,o=I,s=s+b+1>>1,b=s-b,v=v+p+1>>1,p=v-p,r=r+o+1>>1,o=r-o,i=i+n+1>>1,n=i-n,I=s*u+v*h+2048>>12,s=s*h-v*u+2048>>12,v=I,I=p*l+b*c+2048>>12,p=p*c-b*l+2048>>12,b=I,y=r+v,B=r-v,k=i+b,A=i-b,w=n+p,S=n-p,x=o+s,C=o-s,y=16>y?0:y>=4080?255:y>>4,k=16>k?0:k>=4080?255:k>>4,w=16>w?0:w>=4080?255:w>>4,x=16>x?0:x>=4080?255:x>>4,C=16>C?0:C>=4080?255:C>>4,S=16>S?0:S>=4080?255:S>>4,A=16>A?0:A>=4080?255:A>>4,B=16>B?0:B>=4080?255:B>>4,O[t+R]=y,O[t+R+8]=k,O[t+R+16]=w,O[t+R+24]=x,O[t+R+32]=C,O[t+R+40]=S,O[t+R+48]=A,O[t+R+56]=B):(I=g*y+8192>>14,I=-2040>I?0:I>=2024?255:I+2056>>4,O[t+R]=I,O[t+R+8]=I,O[t+R+16]=I,O[t+R+24]=I,O[t+R+32]=I,O[t+R+40]=I,O[t+R+48]=I,O[t+R+56]=I)}function n(e,t){for(var r=t.blocksPerLine,n=t.blocksPerColumn,o=new Int16Array(64),s=0;n>s;s++)for(var c=0;r>c;c++){var l=a(t,s,c);i(t,l,o)}return t.blockData}function o(e){return 0>=e?0:e>=255?255:e}var s=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),c=4017,l=799,h=3406,u=2276,f=1567,d=3784,g=5793,m=2896;return e.prototype={parse:function(e){function a(){var t=e[h]<<8|e[h+1];return h+=2,t}function i(){var t=a(),r=e.subarray(h,h+t-2);return h+=r.length,r}function o(e){for(var t=Math.ceil(e.samplesPerLine/8/e.maxH),a=Math.ceil(e.scanLines/8/e.maxV),r=0;r<e.components.length;r++){F=e.components[r];var i=Math.ceil(Math.ceil(e.samplesPerLine/8)*F.h/e.maxH),n=Math.ceil(Math.ceil(e.scanLines/8)*F.v/e.maxV),o=t*F.h,s=a*F.v,c=64*s*(o+1);F.blockData=new Int16Array(c),F.blocksPerLine=i,F.blocksPerColumn=n}e.mcusPerLine=t,e.mcusPerColumn=a}var c,l,h=0,u=(e.length,null),f=null,d=[],g=[],m=[],p=a();if(65496!==p)throw"SOI not found";for(p=a();65497!==p;){var b,v,y;switch(p){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var k=i();65504===p&&74===k[0]&&70===k[1]&&73===k[2]&&70===k[3]&&0===k[4]&&(u={version:{major:k[5],minor:k[6]},densityUnits:k[7],xDensity:k[8]<<8|k[9],yDensity:k[10]<<8|k[11],thumbWidth:k[12],thumbHeight:k[13],thumbData:k.subarray(14,14+3*k[12]*k[13])}),65518===p&&65===k[0]&&100===k[1]&&111===k[2]&&98===k[3]&&101===k[4]&&0===k[5]&&(f={version:k[6],flags0:k[7]<<8|k[8],flags1:k[9]<<8|k[10],transformCode:k[11]});break;case 65499:for(var w,x=a(),C=x+h-2;C>h;){var S=e[h++],A=new Uint16Array(64);if(S>>4===0)for(v=0;64>v;v++)w=s[v],A[w]=e[h++];else{if(S>>4!==1)throw"DQT: invalid table spec";for(v=0;64>v;v++)w=s[v],A[w]=a()}d[15&S]=A}break;case 65472:case 65473:case 65474:if(c)throw"Only single frame JPEGs supported";a(),c={},c.extended=65473===p,c.progressive=65474===p,c.precision=e[h++],c.scanLines=a(),c.samplesPerLine=a(),c.components=[],c.componentIds={};var B,I=e[h++],T=0,O=0;for(b=0;I>b;b++){B=e[h];var L=e[h+1]>>4,R=15&e[h+1];L>T&&(T=L),R>O&&(O=R);var P=e[h+2];y=c.components.push({h:L,v:R,quantizationTable:d[P]}),c.componentIds[B]=y-1,h+=3}c.maxH=T,c.maxV=O,o(c);break;case 65476:var M=a();for(b=2;M>b;){var D=e[h++],E=new Uint8Array(16),q=0;for(v=0;16>v;v++,h++)q+=E[v]=e[h];var U=new Uint8Array(q);for(v=0;q>v;v++,h++)U[v]=e[h];b+=17+q,(D>>4===0?m:g)[15&D]=t(E,U)}break;case 65501:a(),l=a();break;case 65498:var F,N=(a(),e[h++]),j=[];for(b=0;N>b;b++){var z=c.componentIds[e[h++]];F=c.components[z];var H=e[h++];F.huffmanTableDC=m[H>>4],F.huffmanTableAC=g[15&H],j.push(F)}var G=e[h++],X=e[h++],_=e[h++],J=r(e,h,c,j,l,G,X,_>>4,15&_);h+=J;break;default:if(255===e[h-3]&&e[h-2]>=192&&e[h-2]<=254){h-=3;break}throw"unknown JPEG marker "+p.toString(16)}p=a()}for(this.width=c.samplesPerLine,this.height=c.scanLines,this.jfif=u,this.adobe=f,this.components=[],b=0;b<c.components.length;b++)F=c.components[b],this.components.push({output:n(c,F),scaleX:F.h/c.maxH,scaleY:F.v/c.maxV,blocksPerLine:F.blocksPerLine,blocksPerColumn:F.blocksPerColumn});this.numComponents=this.components.length},_getLinearizedBlockData:function(e,t){var a,r,i,n,o,s,c,l,h,u,f,d=this.width/e,g=this.height/t,m=0,p=this.components.length,b=e*t*p,v=new Uint8Array(b),y=new Uint32Array(e),k=4294967288;for(c=0;p>c;c++){for(a=this.components[c],r=a.scaleX*d,i=a.scaleY*g,m=c,f=a.output,n=a.blocksPerLine+1<<3,o=0;e>o;o++)l=0|o*r,y[o]=(l&k)<<3|7&l;for(s=0;t>s;s++)for(l=0|s*i,u=n*(l&k)|(7&l)<<3,o=0;e>o;o++)v[m]=f[u+y[o]],m+=p}var w=this.decodeTransform;if(w)for(c=0;b>c;)for(l=0,h=0;p>l;l++,c++,h+=2)v[c]=(v[c]*w[h]>>8)+w[h+1];return v},_isColorConversionNeeded:function(){return this.adobe&&this.adobe.transformCode?!0:3===this.numComponents},_convertYccToRgb:function(e){for(var t,a,r,i=0,n=e.length;n>i;i+=3)t=e[i],a=e[i+1],r=e[i+2],e[i]=o(t-179.456+1.402*r),e[i+1]=o(t+135.459-.344*a-.714*r),e[i+2]=o(t-226.816+1.772*a);return e},_convertYcckToRgb:function(e){for(var t,a,r,i,n=0,s=0,c=e.length;c>s;s+=4){t=e[s],a=e[s+1],r=e[s+2],i=e[s+3];var l=-122.67195406894+a*(-660635669420364e-19*a+.000437130475926232*r-54080610064599e-18*t+.00048449797120281*i-.154362151871126)+r*(-.000957964378445773*r+.000817076911346625*t-.00477271405408747*i+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*i+.48357088451265)+i*(-.000336197177618394*i+.484791561490776),h=107.268039397724+a*(219927104525741e-19*a-.000640992018297945*r+.000659397001245577*t+.000426105652938837*i-.176491792462875)+r*(-.000778269941513683*r+.00130872261408275*t+.000770482631801132*i-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*i+.25802910206845)+i*(-.000318913117588328*i-.213742400323665),u=-20.810012546947+a*(-.000570115196973677*a-263409051004589e-19*r+.0020741088115012*t-.00288260236853442*i+.814272968359295)+r*(-153496057440975e-19*r-.000132689043961446*t+.000560833691242812*i-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*i+.116935020465145)+i*(-.000343531996510555*i+.24165260232407);e[n++]=o(l),e[n++]=o(h),e[n++]=o(u)}return e},_convertYcckToCmyk:function(e){for(var t,a,r,i=0,n=e.length;n>i;i+=4)t=e[i],a=e[i+1],r=e[i+2],e[i]=o(434.456-t-1.402*r),e[i+1]=o(119.541-t+.344*a+.714*r),e[i+2]=o(481.816-t-1.772*a);return e},_convertCmykToRgb:function(e){for(var t,a,r,i,n=0,o=-16581375,s=1/255/255,c=0,l=e.length;l>c;c+=4){t=e[c],a=e[c+1],r=e[c+2],i=e[c+3];var h=t*(-4.387332384609988*t+54.48615194189176*a+18.82290502165302*r+212.25662451639585*i-72734.4411664936)+a*(1.7149763477362134*a-5.6096736904047315*r-17.873870861415444*i-1401.7366389350734)+r*(-2.5217340131683033*r-21.248923337353073*i+4465.541406466231)-i*(21.86122147463605*i+48317.86113160301),u=t*(8.841041422036149*t+60.118027045597366*a+6.871425592049007*r+31.159100130055922*i-20220.756542821975)+a*(-15.310361306967817*a+17.575251261109482*r+131.35250912493976*i-48691.05921601825)+r*(4.444339102852739*r+9.8632861493405*i-6341.191035517494)-i*(20.737325471181034*i+47890.15695978492),f=t*(.8842522430003296*t+8.078677503112928*a+30.89978309703729*r-.23883238689178934*i-3616.812083916688)+a*(10.49593273432072*a+63.02378494754052*r+50.606957656360734*i-28620.90484698408)+r*(.03296041114873217*r+115.60384449646641*i-49363.43385999684)-i*(22.33816807309886*i+45932.16563550634);e[n++]=h>=0?255:o>=h?0:255+h*s|0,e[n++]=u>=0?255:o>=u?0:255+u*s|0,e[n++]=f>=0?255:o>=f?0:255+f*s|0}return e},getData:function(e,t,a){if(this.numComponents>4)throw"Unsupported color mode";var r=this._getLinearizedBlockData(e,t);if(3===this.numComponents)return this._convertYccToRgb(r);if(4===this.numComponents){if(this._isColorConversionNeeded())return a?this._convertYcckToRgb(r):this._convertYcckToCmyk(r);if(a)return this._convertCmykToRgb(r)}return r}},e}(),er=function(){function a(){this.failOnCorruptedImage=!1}function r(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz),e.x1=Math.ceil(t.Xsiz/e.XRsiz),e.y0=Math.ceil(t.YOsiz/e.YRsiz),e.y1=Math.ceil(t.Ysiz/e.YRsiz),e.width=e.x1-e.x0,e.height=e.y1-e.y0}function i(e,t){for(var a,r=e.SIZ,i=[],n=Math.ceil((r.Xsiz-r.XTOsiz)/r.XTsiz),o=Math.ceil((r.Ysiz-r.YTOsiz)/r.YTsiz),s=0;o>s;s++)for(var c=0;n>c;c++)a={},a.tx0=Math.max(r.XTOsiz+c*r.XTsiz,r.XOsiz),a.ty0=Math.max(r.YTOsiz+s*r.YTsiz,r.YOsiz),a.tx1=Math.min(r.XTOsiz+(c+1)*r.XTsiz,r.Xsiz),a.ty1=Math.min(r.YTOsiz+(s+1)*r.YTsiz,r.Ysiz),a.width=a.tx1-a.tx0,a.height=a.ty1-a.ty0,a.components=[],i.push(a);e.tiles=i;for(var l=r.Csiz,h=0,u=l;u>h;h++)for(var f=t[h],d=0,g=i.length;g>d;d++){var m={};a=i[d],m.tcx0=Math.ceil(a.tx0/f.XRsiz),m.tcy0=Math.ceil(a.ty0/f.YRsiz),m.tcx1=Math.ceil(a.tx1/f.XRsiz),m.tcy1=Math.ceil(a.ty1/f.YRsiz),m.width=m.tcx1-m.tcx0,m.height=m.tcy1-m.tcy0,a.components[h]=m}}function n(e,t,a){var r=t.codingStyleParameters,i={};return r.entropyCoderWithCustomPrecincts?(i.PPx=r.precinctsSizes[a].PPx,i.PPy=r.precinctsSizes[a].PPy):(i.PPx=15,i.PPy=15),i.xcb_=a>0?Math.min(r.xcb,i.PPx-1):Math.min(r.xcb,i.PPx),i.ycb_=a>0?Math.min(r.ycb,i.PPy-1):Math.min(r.ycb,i.PPy),i}function o(e,t,a){var r=1<<a.PPx,i=1<<a.PPy,n=0===t.resLevel,o=1<<a.PPx+(n?0:-1),s=1<<a.PPy+(n?0:-1),c=t.trx1>t.trx0?Math.ceil(t.trx1/r)-Math.floor(t.trx0/r):0,l=t.try1>t.try0?Math.ceil(t.try1/i)-Math.floor(t.try0/i):0,h=c*l;t.precinctParameters={precinctWidth:r,precinctHeight:i,numprecinctswide:c,numprecinctshigh:l,numprecincts:h,precinctWidthInSubband:o,precinctHeightInSubband:s}}function s(e,t,a){var r,i,n,o,s=a.xcb_,c=a.ycb_,l=1<<s,h=1<<c,u=t.tbx0>>s,f=t.tby0>>c,d=t.tbx1+l-1>>s,g=t.tby1+h-1>>c,m=t.resolution.precinctParameters,p=[],b=[];for(i=f;g>i;i++)for(r=u;d>r;r++){n={cbx:r,cby:i,tbx0:l*r,tby0:h*i,tbx1:l*(r+1),tby1:h*(i+1)},n.tbx0_=Math.max(t.tbx0,n.tbx0),n.tby0_=Math.max(t.tby0,n.tby0),n.tbx1_=Math.min(t.tbx1,n.tbx1),n.tby1_=Math.min(t.tby1,n.tby1);var v=Math.floor((n.tbx0_-t.tbx0)/m.precinctWidthInSubband),y=Math.floor((n.tby0_-t.tby0)/m.precinctHeightInSubband);if(o=v+y*m.numprecinctswide,n.precinctNumber=o,n.subbandType=t.type,n.Lblock=3,!(n.tbx1_<=n.tbx0_||n.tby1_<=n.tby0_)){p.push(n);var k=b[o];void 0!==k?(r<k.cbxMin?k.cbxMin=r:r>k.cbxMax&&(k.cbxMax=r),i<k.cbyMin?k.cbxMin=i:i>k.cbyMax&&(k.cbyMax=i)):b[o]=k={cbxMin:r,cbyMin:i,cbxMax:r,cbyMax:i},n.precinct=k}}t.codeblockParameters={codeblockWidth:s,codeblockHeight:c,numcodeblockwide:d-u+1,numcodeblockhigh:g-f+1},t.codeblocks=p,t.precincts=b}function c(e,t,a){for(var r=[],i=e.subbands,n=0,o=i.length;o>n;n++)for(var s=i[n],c=s.codeblocks,l=0,h=c.length;h>l;l++){var u=c[l];u.precinctNumber===t&&r.push(u)}return{layerNumber:a,codeblocks:r}}function l(e){for(var t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],i=r.codingStyleDefaultParameters.layersCount,n=t.Csiz,o=0,s=0;n>s;s++)o=Math.max(o,r.components[s].codingStyleParameters.decompositionLevelsCount);var l=0,h=0,u=0,f=0;this.nextPacket=function(){for(;i>l;l++){for(;o>=h;h++){for(;n>u;u++){var e=r.components[u];if(!(h>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[h],a=t.precinctParameters.numprecincts;a>f;){var s=c(t,f,l);return f++,s}f=0}}u=0}h=0}throw new Error("JPX Error: Out of packets")}}function u(e){for(var t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],i=r.codingStyleDefaultParameters.layersCount,n=t.Csiz,o=0,s=0;n>s;s++)o=Math.max(o,r.components[s].codingStyleParameters.decompositionLevelsCount);var l=0,h=0,u=0,f=0;this.nextPacket=function(){for(;o>=l;l++){for(;i>h;h++){for(;n>u;u++){var e=r.components[u];if(!(l>e.codingStyleParameters.decompositionLevelsCount)){for(var t=e.resolutions[l],a=t.precinctParameters.numprecincts;a>f;){var s=c(t,f,h);return f++,s}f=0}}u=0}h=0}throw new Error("JPX Error: Out of packets")}}function g(e){for(var t=e.SIZ,a=e.currentTile.index,r=e.tiles[a],i=t.Csiz,c=0;i>c;c++){for(var h=r.components[c],f=h.codingStyleParameters.decompositionLevelsCount,d=[],g=[],m=0;f>=m;m++){var p=n(e,h,m),b={},v=1<<f-m;b.trx0=Math.ceil(h.tcx0/v),b.try0=Math.ceil(h.tcy0/v),b.trx1=Math.ceil(h.tcx1/v),b.try1=Math.ceil(h.tcy1/v),b.resLevel=m,o(e,b,p),d.push(b);var y;if(0===m)y={},y.type="LL",y.tbx0=Math.ceil(h.tcx0/v),y.tby0=Math.ceil(h.tcy0/v),y.tbx1=Math.ceil(h.tcx1/v),y.tby1=Math.ceil(h.tcy1/v),y.resolution=b,s(e,y,p),g.push(y),b.subbands=[y];else{var k=1<<f-m+1,w=[];y={},y.type="HL",y.tbx0=Math.ceil(h.tcx0/k-.5),y.tby0=Math.ceil(h.tcy0/k),y.tbx1=Math.ceil(h.tcx1/k-.5),y.tby1=Math.ceil(h.tcy1/k),y.resolution=b,s(e,y,p),g.push(y),w.push(y),y={},y.type="LH",y.tbx0=Math.ceil(h.tcx0/k),y.tby0=Math.ceil(h.tcy0/k-.5),y.tbx1=Math.ceil(h.tcx1/k),y.tby1=Math.ceil(h.tcy1/k-.5),y.resolution=b,s(e,y,p),g.push(y),w.push(y),y={},y.type="HH",y.tbx0=Math.ceil(h.tcx0/k-.5),y.tby0=Math.ceil(h.tcy0/k-.5),y.tbx1=Math.ceil(h.tcx1/k-.5),y.tby1=Math.ceil(h.tcy1/k-.5),y.resolution=b,s(e,y,p),g.push(y),w.push(y),b.subbands=w}}h.resolutions=d,h.subbands=g}var x=r.codingStyleDefaultParameters.progressionOrder;switch(x){case 0:r.packetsIterator=new l(e);break;case 1:r.packetsIterator=new u(e);break;default:throw new Error("JPX Error: Unsupported progression order "+x)}}function m(e,t,a,r){function i(e){for(;e>l;){var r=t[a+c];c++,u?(s=s<<7|r,l+=7,u=!1):(s=s<<8|r,l+=8),255===r&&(u=!0)}return l-=e,s>>>l&(1<<e)-1}function n(){l=0,u&&(c++,u=!1)}function o(){if(0===i(1))return 1;if(0===i(1))return 2;var e=i(2);return 3>e?e+3:(e=i(5),31>e?e+6:(e=i(7),e+37))}for(var s,c=0,l=0,u=!1,f=e.currentTile.index,d=e.tiles[f],g=d.packetsIterator;r>c;)if(n(),i(1)){for(var m,p=g.nextPacket(),b=p.layerNumber,v=[],y=0,k=p.codeblocks.length;k>y;y++){m=p.codeblocks[y];var C,S=m.precinct,A=m.cbx-S.cbxMin,B=m.cby-S.cbyMin,I=!1,T=!1;if(void 0!==m.included)I=!!i(1);else{S=m.precinct;var O,L;if(void 0!==S.inclusionTree)O=S.inclusionTree;else{var R=S.cbxMax-S.cbxMin+1,P=S.cbyMax-S.cbyMin+1;O=new x(R,P,b),L=new w(R,P),S.inclusionTree=O,S.zeroBitPlanesTree=L}if(O.reset(A,B,b))for(;;){if(!i(1)){O.incrementValue(b);break}if(C=!O.nextLevel()){m.included=!0,I=T=!0;break}}}if(I){if(T){for(L=S.zeroBitPlanesTree,L.reset(A,B);;)if(i(1)){if(C=!L.nextLevel())break}else L.incrementValue();m.zeroBitPlanes=L.value}for(var M=o();i(1);)m.Lblock++;var D=h(M),E=(1<<D>M?D-1:D)+m.Lblock,q=i(E);v.push({codeblock:m,codingpasses:M,dataLength:q})}}for(n();v.length>0;){var U=v.shift();m=U.codeblock,void 0===m.data&&(m.data=[]),m.data.push({data:t,start:a+c,end:a+c+U.dataLength,codingpasses:U.codingpasses}),c+=U.dataLength}}return c}function p(e,t,a,r,i,n,o,s){for(var c=r.tbx0,l=r.tby0,h=r.tbx1-r.tbx0,u=r.codeblocks,f="H"===r.type.charAt(0)?1:0,d="H"===r.type.charAt(1)?t:0,g=0,m=u.length;m>g;++g){var p=u[g],b=p.tbx1_-p.tbx0_,v=p.tby1_-p.tby0_;if(0!==b&&0!==v&&void 0!==p.data){var y,k;y=new C(b,v,p.subbandType,p.zeroBitPlanes,n),k=2;var w,x,S,A=p.data,B=0,I=0;for(w=0,x=A.length;x>w;w++)S=A[w],B+=S.end-S.start,I+=S.codingpasses;var T=new Uint8Array(B),O=0;for(w=0,x=A.length;x>w;w++){S=A[w];var L=S.data.subarray(S.start,S.end);T.set(L,O),O+=L.length}var R=new Qa(T,0,B);for(y.setDecoder(R),w=0;I>w;w++){switch(k){case 0:y.runSignificancePropogationPass();break;case 1:y.runMagnitudeRefinementPass();break;case 2:y.runCleanupPass(),s&&y.checkSegmentationSymbol()}k=(k+1)%3}var P,M,D,E=p.tbx0_-c+(p.tby0_-l)*h,q=y.coefficentsSign,U=y.coefficentsMagnitude,F=y.bitsDecoded,N=o?0:.5;O=0;var j="LL"!==r.type;for(w=0;v>w;w++){var z=E/h|0,H=2*z*(t-h)+f+d;for(P=0;b>P;P++){if(M=U[O],0!==M){M=(M+N)*i,0!==q[O]&&(M=-M),D=F[O];var G=j?H+(E<<1):E;o&&D>=n?e[G]=M:e[G]=M*(1<<n-D)}E++,O++}E+=h-b}}}}function b(e,t,a){for(var r=t.components[a],i=r.codingStyleParameters,n=r.quantizationParameters,o=i.decompositionLevelsCount,s=n.SPqcds,c=n.scalarExpounded,l=n.guardBits,h=i.segmentationSymbolUsed,u=e.components[a].precision,f=i.reversibleTransformation,d=f?new B:new A,g=[],m=0,b=0;o>=b;b++){for(var v=r.resolutions[b],y=v.trx1-v.trx0,w=v.try1-v.try0,x=new Float32Array(y*w),C=0,S=v.subbands.length;S>C;C++){var I,T;c?(I=s[m].mu,T=s[m].epsilon,m++):(I=s[0].mu,T=s[0].epsilon+(b>0?1-b:0));var O=v.subbands[C],L=k[O.type],R=f?1:Math.pow(2,u+L-T)*(1+I/2048),P=l+T-1;p(x,y,w,O,R,P,f,h)}g.push({width:y,height:w,items:x})}var M=d.calculate(g,r.tcx0,r.tcy0);return{left:r.tcx0,top:r.tcy0,width:M.width,height:M.height,items:M.items}}function v(e){for(var t=e.SIZ,a=e.components,r=t.Csiz,i=[],n=0,o=e.tiles.length;o>n;n++){var s,c=e.tiles[n],l=[];for(s=0;r>s;s++)l[s]=b(e,c,s);var h,u,f,d,g,m,p,v,y,k,w,x,C,S,A,B=l[0],I=new Uint8Array(B.items.length*r),T={left:B.left,top:B.top,width:B.width,height:B.height,items:I},O=0;if(c.codingStyleDefaultParameters.multipleComponentTransform){var L=4===r,R=l[0].items,P=l[1].items,M=l[2].items,D=L?l[3].items:null;h=a[0].precision-8,u=(128<<h)+.5,f=255*(1<<h),g=.5*f,d=-g;var E=c.components[0],q=r-3;if(p=R.length,E.codingStyleParameters.reversibleTransformation)for(m=0;p>m;m++,O+=q)v=R[m]+u,y=P[m],k=M[m],x=v-(k+y>>2),w=x+k,C=x+y,I[O++]=0>=w?0:w>=f?255:w>>h,I[O++]=0>=x?0:x>=f?255:x>>h,I[O++]=0>=C?0:C>=f?255:C>>h;else for(m=0;p>m;m++,O+=q)v=R[m]+u,y=P[m],k=M[m],w=v+1.402*k,x=v-.34413*y-.71414*k,C=v+1.772*y,I[O++]=0>=w?0:w>=f?255:w>>h,I[O++]=0>=x?0:x>=f?255:x>>h,I[O++]=0>=C?0:C>=f?255:C>>h;if(L)for(m=0,O=3;p>m;m++,O+=4)S=D[m],I[O]=d>=S?0:S>=g?255:S+u>>h}else for(s=0;r>s;s++){var U=l[s].items;for(h=a[s].precision-8,u=(128<<h)+.5,f=127.5*(1<<h),d=-f,O=s,m=0,p=U.length;p>m;m++)A=U[m],I[O]=d>=A?0:A>=f?255:A+u>>h,O+=r}i.push(T)}return i}function y(e,t){for(var a=e.SIZ,r=a.Csiz,i=e.tiles[t],n=0;r>n;n++){var o=i.components[n],s=void 0!==e.currentTile.QCC[n]?e.currentTile.QCC[n]:e.currentTile.QCD;o.quantizationParameters=s;var c=void 0!==e.currentTile.COC[n]?e.currentTile.COC[n]:e.currentTile.COD;o.codingStyleParameters=c}i.codingStyleDefaultParameters=e.currentTile.COD}var k={LL:0,LH:1,HL:1,HH:2};a.prototype={parse:function(a){var r=f(a,0);if(65359===r)return void this.parseCodestream(a,0,a.length);for(var i=0,n=a.length;n>i;){var o=8,s=d(a,i),c=d(a,i+4);if(i+=o,1===s&&(s=4294967296*d(a,i)+d(a,i+4),i+=8,o+=8),0===s&&(s=n-i+o),o>s)throw new Error("JPX Error: Invalid box field size");var l=s-o,h=!0;switch(c){case 1785737832:h=!1;break;case 1668246642:var u=a[i];a[i+1],a[i+2];if(1===u){var g=d(a,i+3);switch(g){case 16:case 17:case 18:break;default:t("Unknown colorspace "+g)}}else 2===u&&e("ICC profile not supported");break;case 1785737827:this.parseCodestream(a,i,i+l);break;case 1783636e3:218793738!==d(a,i)&&t("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var m=String.fromCharCode(c>>24&255,c>>16&255,c>>8&255,255&c);t("Unsupported header type "+c+" ("+m+")")}h&&(i+=l)}},parseImageProperties:function(e){for(var t=e.getByte();t>=0;){var a=t;t=e.getByte();var r=a<<8|t;if(65361===r){e.skip(4);var i=e.getInt32()>>>0,n=e.getInt32()>>>0,o=e.getInt32()>>>0,s=e.getInt32()>>>0;e.skip(16);var c=e.getUint16();return this.width=i-o,this.height=n-s,this.componentsCount=c,void(this.bitsPerComponent=8)}}throw new Error("JPX Error: No size marker found in JPX stream")},parseCodestream:function(e,a,n){var o={};try{for(var s=!1,c=a;n>c+1;){var l=f(e,c);c+=2;var h,u,p,b,k,w,x=0;switch(l){case 65359:o.mainHeader=!0;break;case 65497:break;case 65361:x=f(e,c);var C={};C.Xsiz=d(e,c+4),C.Ysiz=d(e,c+8),
C.XOsiz=d(e,c+12),C.YOsiz=d(e,c+16),C.XTsiz=d(e,c+20),C.YTsiz=d(e,c+24),C.XTOsiz=d(e,c+28),C.YTOsiz=d(e,c+32);var S=f(e,c+36);C.Csiz=S;var A=[];h=c+38;for(var B=0;S>B;B++){var I={precision:(127&e[h])+1,isSigned:!!(128&e[h]),XRsiz:e[h+1],YRsiz:e[h+1]};r(I,C),A.push(I)}o.SIZ=C,o.components=A,i(o,A),o.QCC=[],o.COC=[];break;case 65365:var T=f(e,c);c+=T;break;case 65372:x=f(e,c);var O={};switch(h=c+2,u=e[h++],31&u){case 0:b=8,k=!0;break;case 1:b=16,k=!1;break;case 2:b=16,k=!0;break;default:throw new Error("JPX Error: Invalid SQcd value "+u)}for(O.noQuantization=8===b,O.scalarExpounded=k,O.guardBits=u>>5,p=[];x+c>h;){var L={};8===b?(L.epsilon=e[h++]>>3,L.mu=0):(L.epsilon=e[h]>>3,L.mu=(7&e[h])<<8|e[h+1],h+=2),p.push(L)}O.SPqcds=p,o.mainHeader?o.QCD=O:(o.currentTile.QCD=O,o.currentTile.QCC=[]);break;case 65373:x=f(e,c);var R={};h=c+2;var P;switch(o.SIZ.Csiz<257?P=e[h++]:(P=f(e,h),h+=2),u=e[h++],31&u){case 0:b=8,k=!0;break;case 1:b=16,k=!1;break;case 2:b=16,k=!0;break;default:throw new Error("JPX Error: Invalid SQcd value "+u)}for(R.noQuantization=8===b,R.scalarExpounded=k,R.guardBits=u>>5,p=[];x+c>h;)L={},8===b?(L.epsilon=e[h++]>>3,L.mu=0):(L.epsilon=e[h]>>3,L.mu=(7&e[h])<<8|e[h+1],h+=2),p.push(L);R.SPqcds=p,o.mainHeader?o.QCC[P]=R:o.currentTile.QCC[P]=R;break;case 65362:x=f(e,c);var M={};h=c+2;var D=e[h++];M.entropyCoderWithCustomPrecincts=!!(1&D),M.sopMarkerUsed=!!(2&D),M.ephMarkerUsed=!!(4&D),M.progressionOrder=e[h++],M.layersCount=f(e,h),h+=2,M.multipleComponentTransform=e[h++],M.decompositionLevelsCount=e[h++],M.xcb=(15&e[h++])+2,M.ycb=(15&e[h++])+2;var E=e[h++];if(M.selectiveArithmeticCodingBypass=!!(1&E),M.resetContextProbabilities=!!(2&E),M.terminationOnEachCodingPass=!!(4&E),M.verticalyStripe=!!(8&E),M.predictableTermination=!!(16&E),M.segmentationSymbolUsed=!!(32&E),M.reversibleTransformation=e[h++],M.entropyCoderWithCustomPrecincts){for(var q=[];x+c>h;){var U=e[h++];q.push({PPx:15&U,PPy:U>>4})}M.precinctsSizes=q}var F=[];if(M.sopMarkerUsed&&F.push("sopMarkerUsed"),M.ephMarkerUsed&&F.push("ephMarkerUsed"),M.selectiveArithmeticCodingBypass&&F.push("selectiveArithmeticCodingBypass"),M.resetContextProbabilities&&F.push("resetContextProbabilities"),M.terminationOnEachCodingPass&&F.push("terminationOnEachCodingPass"),M.verticalyStripe&&F.push("verticalyStripe"),M.predictableTermination&&F.push("predictableTermination"),F.length>0)throw s=!0,new Error("JPX Error: Unsupported COD options ("+F.join(", ")+")");o.mainHeader?o.COD=M:(o.currentTile.COD=M,o.currentTile.COC=[]);break;case 65424:x=f(e,c),w={},w.index=f(e,c+2),w.length=d(e,c+4),w.dataEnd=w.length+c-2,w.partIndex=e[c+8],w.partsCount=e[c+9],o.mainHeader=!1,0===w.partIndex&&(w.COD=o.COD,w.COC=o.COC.slice(0),w.QCD=o.QCD,w.QCC=o.QCC.slice(0)),o.currentTile=w;break;case 65427:w=o.currentTile,0===w.partIndex&&(y(o,w.index),g(o)),x=w.dataEnd-c,m(o,e,c,x);break;case 65380:x=f(e,c);break;case 65363:throw new Error("JPX Error: Codestream code 0xFF53 (COC) is not implemented");default:throw new Error("JPX Error: Unknown codestream code: "+l.toString(16))}c+=x}}catch(N){if(s||this.failOnCorruptedImage)throw N;t("Trying to recover from "+N.message)}this.tiles=v(o),this.width=o.SIZ.Xsiz-o.SIZ.XOsiz,this.height=o.SIZ.Ysiz-o.SIZ.YOsiz,this.componentsCount=o.SIZ.Csiz}};var w=function(){function e(e,t){var a=h(Math.max(e,t))+1;this.levels=[];for(var r=0;a>r;r++){var i={width:e,height:t,items:[]};this.levels.push(i),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t){for(var a,r=0,i=0;r<this.levels.length;){a=this.levels[r];var n=e+t*a.width;if(void 0!==a.items[n]){i=a.items[n];break}a.index=n,e>>=1,t>>=1,r++}r--,a=this.levels[r],a.items[a.index]=i,this.currentLevel=r,delete this.value},incrementValue:function(){var e=this.levels[this.currentLevel];e.items[e.index]++},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],a=t.items[t.index];return e--,0>e?(this.value=a,!1):(this.currentLevel=e,t=this.levels[e],t.items[t.index]=a,!0)}},e}(),x=function(){function e(e,t,a){var r=h(Math.max(e,t))+1;this.levels=[];for(var i=0;r>i;i++){for(var n=new Uint8Array(e*t),o=0,s=n.length;s>o;o++)n[o]=a;var c={width:e,height:t,items:n};this.levels.push(c),e=Math.ceil(e/2),t=Math.ceil(t/2)}}return e.prototype={reset:function(e,t,a){for(var r=0;r<this.levels.length;){var i=this.levels[r],n=e+t*i.width;i.index=n;var o=i.items[n];if(255===o)break;if(o>a)return this.currentLevel=r,this.propagateValues(),!1;e>>=1,t>>=1,r++}return this.currentLevel=r-1,!0},incrementValue:function(e){var t=this.levels[this.currentLevel];t.items[t.index]=e+1,this.propagateValues()},propagateValues:function(){for(var e=this.currentLevel,t=this.levels[e],a=t.items[t.index];--e>=0;)t=this.levels[e],t.items[t.index]=a},nextLevel:function(){var e=this.currentLevel,t=this.levels[e],a=t.items[t.index];return t.items[t.index]=255,e--,0>e?!1:(this.currentLevel=e,t=this.levels[e],t.items[t.index]=a,!0)}},e}(),C=function(){function e(e,t,a,o,s){this.width=e,this.height=t,this.contextLabelTable="HH"===a?n:"HL"===a?i:r;var c=e*t;this.neighborsSignificance=new Uint8Array(c),this.coefficentsSign=new Uint8Array(c),this.coefficentsMagnitude=s>14?new Uint32Array(c):s>6?new Uint16Array(c):new Uint8Array(c),this.processingFlags=new Uint8Array(c);var l=new Uint8Array(c);if(0!==o)for(var h=0;c>h;h++)l[h]=o;this.bitsDecoded=l,this.reset()}var t=17,a=18,r=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),i=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),n=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);return e.prototype={setDecoder:function(e){this.decoder=e},reset:function(){this.contexts=new Int8Array(19),this.contexts[0]=8,this.contexts[t]=92,this.contexts[a]=6},setNeighborsSignificance:function(e,t,a){var r,i=this.neighborsSignificance,n=this.width,o=this.height,s=t>0,c=n>t+1;e>0&&(r=a-n,s&&(i[r-1]+=16),c&&(i[r+1]+=16),i[r]+=4),o>e+1&&(r=a+n,s&&(i[r-1]+=16),c&&(i[r+1]+=16),i[r]+=4),s&&(i[a-1]+=1),c&&(i[a+1]+=1),i[a]|=128},runSignificancePropogationPass:function(){for(var e=this.decoder,t=this.width,a=this.height,r=this.coefficentsMagnitude,i=this.coefficentsSign,n=this.neighborsSignificance,o=this.processingFlags,s=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=-2,u=1,f=2,d=0;a>d;d+=4)for(var g=0;t>g;g++)for(var m=d*t+g,p=0;4>p;p++,m+=t){var b=d+p;if(b>=a)break;if(o[m]&=h,!r[m]&&n[m]){var v=c[n[m]],y=e.readBit(s,v);if(y){var k=this.decodeSignBit(b,g,m);i[m]=k,r[m]=1,this.setNeighborsSignificance(b,g,m),o[m]|=f}l[m]++,o[m]|=u}}},decodeSignBit:function(e,t,a){var r,i,n,o,s,c,l=this.width,h=this.height,u=this.coefficentsMagnitude,f=this.coefficentsSign;o=t>0&&0!==u[a-1],l>t+1&&0!==u[a+1]?(n=f[a+1],o?(i=f[a-1],r=1-n-i):r=1-n-n):o?(i=f[a-1],r=1-i-i):r=0;var d=3*r;return o=e>0&&0!==u[a-l],h>e+1&&0!==u[a+l]?(n=f[a+l],o?(i=f[a-l],r=1-n-i+d):r=1-n-n+d):o?(i=f[a-l],r=1-i-i+d):r=d,r>=0?(s=9+r,c=this.decoder.readBit(this.contexts,s)):(s=9-r,c=1^this.decoder.readBit(this.contexts,s)),c},runMagnitudeRefinementPass:function(){for(var e,t=this.decoder,a=this.width,r=this.height,i=this.coefficentsMagnitude,n=this.neighborsSignificance,o=this.contexts,s=this.bitsDecoded,c=this.processingFlags,l=1,h=2,u=a*r,f=4*a,d=0;u>d;d=e){e=Math.min(u,d+f);for(var g=0;a>g;g++)for(var m=d+g;e>m;m+=a)if(i[m]&&0===(c[m]&l)){var p=16;if(0!==(c[m]&h)){c[m]^=h;var b=127&n[m];p=0===b?15:14}var v=t.readBit(o,p);i[m]=i[m]<<1|v,s[m]++,c[m]|=l}}},runCleanupPass:function(){for(var e,r=this.decoder,i=this.width,n=this.height,o=this.neighborsSignificance,s=this.coefficentsMagnitude,c=this.coefficentsSign,l=this.contexts,h=this.contextLabelTable,u=this.bitsDecoded,f=this.processingFlags,d=1,g=2,m=i,p=2*i,b=3*i,v=0;n>v;v=e){e=Math.min(v+4,n);for(var y=v*i,k=n>v+3,w=0;i>w;w++){var x,C=y+w,S=k&&0===f[C]&&0===f[C+m]&&0===f[C+p]&&0===f[C+b]&&0===o[C]&&0===o[C+m]&&0===o[C+p]&&0===o[C+b],A=0,B=C,I=v;if(S){var T=r.readBit(l,a);if(!T){u[C]++,u[C+m]++,u[C+p]++,u[C+b]++;continue}A=r.readBit(l,t)<<1|r.readBit(l,t),0!==A&&(I=v+A,B+=A*i),x=this.decodeSignBit(I,w,B),c[B]=x,s[B]=1,this.setNeighborsSignificance(I,w,B),f[B]|=g,B=C;for(var O=v;I>=O;O++,B+=i)u[B]++;A++}for(I=v+A;e>I;I++,B+=i)if(!s[B]&&0===(f[B]&d)){var L=h[o[B]],R=r.readBit(l,L);1===R&&(x=this.decodeSignBit(I,w,B),c[B]=x,s[B]=1,this.setNeighborsSignificance(I,w,B),f[B]|=g),u[B]++}}}},checkSegmentationSymbol:function(){var e=this.decoder,a=this.contexts,r=e.readBit(a,t)<<3|e.readBit(a,t)<<2|e.readBit(a,t)<<1|e.readBit(a,t);if(10!==r)throw new Error("JPX Error: Invalid segmentation symbol")}},e}(),S=function(){function e(){}return e.prototype.calculate=function(e,t,a){for(var r=e[0],i=1,n=e.length;n>i;i++)r=this.iterate(r,e[i],t,a);return r},e.prototype.extend=function(e,t,a){var r=t-1,i=t+1,n=t+a-2,o=t+a;e[r--]=e[i++],e[o++]=e[n--],e[r--]=e[i++],e[o++]=e[n--],e[r--]=e[i++],e[o++]=e[n--],e[r]=e[i],e[o]=e[n]},e.prototype.iterate=function(e,t,a,r){var i,n,o,s,c,l,h=e.width,u=e.height,f=e.items,d=t.width,g=t.height,m=t.items;for(o=0,i=0;u>i;i++)for(s=2*i*d,n=0;h>n;n++,o++,s+=2)m[s]=f[o];f=e.items=null;var p=4,b=new Float32Array(d+2*p);if(1===d){if(0!==(1&a))for(l=0,o=0;g>l;l++,o+=d)m[o]*=.5}else for(l=0,o=0;g>l;l++,o+=d)b.set(m.subarray(o,o+d),p),this.extend(b,p,d),this.filter(b,p,d),m.set(b.subarray(p,p+d),o);var v=16,y=[];for(i=0;v>i;i++)y.push(new Float32Array(g+2*p));var k,w=0;if(e=p+g,1===g){if(0!==(1&r))for(c=0;d>c;c++)m[c]*=.5}else for(c=0;d>c;c++){if(0===w){for(v=Math.min(d-c,v),o=c,s=p;e>s;o+=d,s++)for(k=0;v>k;k++)y[k][s]=m[o+k];w=v}w--;var x=y[w];if(this.extend(x,p,g),this.filter(x,p,g),0===w)for(o=c-v+1,s=p;e>s;o+=d,s++)for(k=0;v>k;k++)m[o+k]=y[k][s]}return{width:d,height:g,items:m}},e}(),A=function(){function e(){S.call(this)}return e.prototype=Object.create(S.prototype),e.prototype.filter=function(e,t,a){var r=a>>1;t=0|t;var i,n,o,s,c=-1.586134342059924,l=-.052980118572961,h=.882911075530934,u=.443506852043971,f=1.230174104914001,d=1/f;for(i=t-3,n=r+4;n--;i+=2)e[i]*=d;for(i=t-2,o=u*e[i-1],n=r+3;n--&&(s=u*e[i+1],e[i]=f*e[i]-o-s,n--);i+=2)i+=2,o=u*e[i+1],e[i]=f*e[i]-o-s;for(i=t-1,o=h*e[i-1],n=r+2;n--&&(s=h*e[i+1],e[i]-=o+s,n--);i+=2)i+=2,o=h*e[i+1],e[i]-=o+s;for(i=t,o=l*e[i-1],n=r+1;n--&&(s=l*e[i+1],e[i]-=o+s,n--);i+=2)i+=2,o=l*e[i+1],e[i]-=o+s;if(0!==r)for(i=t+1,o=c*e[i-1],n=r;n--&&(s=c*e[i+1],e[i]-=o+s,n--);i+=2)i+=2,o=c*e[i+1],e[i]-=o+s},e}(),B=function(){function e(){S.call(this)}return e.prototype=Object.create(S.prototype),e.prototype.filter=function(e,t,a){var r=a>>1;t=0|t;var i,n;for(i=t,n=r+1;n--;i+=2)e[i]-=e[i-1]+e[i+1]+2>>2;for(i=t+1,n=r;n--;i+=2)e[i]+=e[i-1]+e[i+1]>>1},e}();return a}(),tr=function(){function e(){}function t(e,t,a){this.data=e,this.start=t,this.end=a}function r(e,t,a){function r(e){for(var t=0,r=0;e>r;r++){var o=a.readBit(i,n);n=256>n?n<<1|o:511&(n<<1|o)|256,t=t<<1|o}return t>>>0}var i=e.getContexts(t),n=1,o=r(1),s=r(1)?r(1)?r(1)?r(1)?r(1)?r(32)+4436:r(12)+340:r(8)+84:r(6)+20:r(4)+4:r(2);return 0===o?s:s>0?-s:null}function i(e,t,a){for(var r=e.getContexts("IAID"),i=1,n=0;a>n;n++){var o=t.readBit(r,i);i=i<<1|o}return 31>a?i&(1<<a)-1:2147483647&i}function n(e,t,a){var r,i,n,o,s,c,l,h=a.decoder,u=a.contextCache.getContexts("GB"),f=[],d=31735;for(i=0;t>i;i++)for(s=f[i]=new Uint8Array(e),c=1>i?s:f[i-1],l=2>i?s:f[i-2],r=l[0]<<13|l[1]<<12|l[2]<<11|c[0]<<7|c[1]<<6|c[2]<<5|c[3]<<4,n=0;e>n;n++)s[n]=o=h.readBit(u,r),r=(r&d)<<1|l[n+3]<<11|c[n+4]<<4|o;return f}function s(e,t,r,i,o,s,c,l){if(e&&a("JBIG2 error: MMR encoding is not supported"),0===i&&!s&&!o&&4===c.length&&3===c[0].x&&-1===c[0].y&&-3===c[1].x&&-1===c[1].y&&2===c[2].x&&-2===c[2].y&&-2===c[3].x&&-2===c[3].y)return n(t,r,l);var h=!!s,u=S[i].concat(c);u.sort(function(e,t){return e.y-t.y||e.x-t.x});var f,d,g=u.length,m=new Int8Array(g),p=new Int8Array(g),b=[],v=0,y=0,k=0,w=0;for(d=0;g>d;d++)m[d]=u[d].x,p[d]=u[d].y,y=Math.min(y,u[d].x),k=Math.max(k,u[d].x),w=Math.min(w,u[d].y),g-1>d&&u[d].y===u[d+1].y&&u[d].x===u[d+1].x-1?v|=1<<g-1-d:b.push(d);var x=b.length,C=new Int8Array(x),A=new Int8Array(x),I=new Uint16Array(x);for(f=0;x>f;f++)d=b[f],C[f]=u[d].x,A[f]=u[d].y,I[f]=1<<g-1-d;for(var T,O,L,R,P,M=-y,D=-w,E=t-k,q=B[i],U=new Uint8Array(t),F=[],N=l.decoder,j=l.contextCache.getContexts("GB"),z=0,H=0,G=0;r>G;G++){if(o){var X=N.readBit(j,q);if(z^=X){F.push(U);continue}}for(U=new Uint8Array(U),F.push(U),T=0;t>T;T++)if(h&&s[G][T])U[T]=0;else{if(T>=M&&E>T&&G>=D)for(H=H<<1&v,d=0;x>d;d++)O=G+A[d],L=T+C[d],R=F[O][L],R&&(R=I[d],H|=R);else for(H=0,P=g-1,d=0;g>d;d++,P--)L=T+m[d],L>=0&&t>L&&(O=G+p[d],O>=0&&(R=F[O][L],R&&(H|=R<<P)));var _=N.readBit(j,H);U[T]=_}}return F}function c(e,t,r,i,n,o,s,c,l){var h=A[r].coding;0===r&&(h=h.concat([c[0]]));var u,f=h.length,d=new Int32Array(f),g=new Int32Array(f);for(u=0;f>u;u++)d[u]=h[u].x,g[u]=h[u].y;var m=A[r].reference;0===r&&(m=m.concat([c[1]]));var p=m.length,b=new Int32Array(p),v=new Int32Array(p);for(u=0;p>u;u++)b[u]=m[u].x,v[u]=m[u].y;for(var y=i[0].length,k=i.length,w=I[r],x=[],C=l.decoder,S=l.contextCache.getContexts("GR"),B=0,T=0;t>T;T++){if(s){var O=C.readBit(S,w);B^=O,B&&a("JBIG2 error: prediction is not supported")}var L=new Uint8Array(e);x.push(L);for(var R=0;e>R;R++){var P,M,D=0;for(u=0;f>u;u++)P=T+g[u],M=R+d[u],0>P||0>M||M>=e?D<<=1:D=D<<1|x[P][M];for(u=0;p>u;u++)P=T+v[u]+o,M=R+b[u]+n,0>P||P>=k||0>M||M>=y?D<<=1:D=D<<1|i[P][M];var E=C.readBit(S,D);L[R]=E}}return x}function l(e,t,n,o,l,u,f,d,m,p,b){e&&a("JBIG2 error: huffman is not supported");for(var v=[],y=0,k=h(n.length+o),w=b.decoder,x=b.contextCache;v.length<o;){var C=r(x,"IADH",w);y+=C;for(var S=0,A=0;;){var B=r(x,"IADW",w);if(null===B)break;S+=B,A+=S;var I;if(t){var T=r(x,"IAAI",w);if(T>1)I=g(e,t,S,y,0,T,1,n.concat(v),k,0,0,1,0,u,m,p,b);else{var O=i(x,w,k),L=r(x,"IARDX",w),R=r(x,"IARDY",w),P=O<n.length?n[O]:v[O-n.length];I=c(S,y,m,P,L,R,!1,p,b)}}else I=s(!1,S,y,f,!1,null,d,b);v.push(I)}}for(var M=[],D=[],E=!1,q=n.length+o;D.length<q;){for(var U=r(x,"IAEX",w);U--;)D.push(E);E=!E}for(var F=0,N=n.length;N>F;F++)D[F]&&M.push(n[F]);for(var j=0;o>j;F++,j++)D[F]&&M.push(v[j]);return M}function g(e,t,n,o,s,l,h,u,f,d,g,m,p,b,v,y,k){e&&a("JBIG2 error: huffman is not supported");var w,x,C=[];for(w=0;o>w;w++){if(x=new Uint8Array(n),s)for(var S=0;n>S;S++)x[S]=s;C.push(x)}var A=k.decoder,B=k.contextCache,I=-r(B,"IADT",A),T=0;for(w=0;l>w;){var O=r(B,"IADT",A);I+=O;var L=r(B,"IAFS",A);T+=L;for(var R=T;;){var P=1===h?0:r(B,"IAIT",A),M=h*I+P,D=i(B,A,f),E=t&&r(B,"IARI",A),q=u[D],U=q[0].length,F=q.length;if(E){var N=r(B,"IARDW",A),j=r(B,"IARDH",A),z=r(B,"IARDX",A),H=r(B,"IARDY",A);U+=N,F+=j,q=c(U,F,v,q,(N>>1)+z,(j>>1)+H,!1,y,k)}var G,X,_,J=M-(1&m?0:F),V=R-(2&m?U:0);if(d){for(G=0;F>G;G++)if(x=C[V+G]){_=q[G];var W=Math.min(n-J,U);switch(p){case 0:for(X=0;W>X;X++)x[J+X]|=_[X];break;case 2:for(X=0;W>X;X++)x[J+X]^=_[X];break;default:a("JBIG2 error: operator "+p+" is not supported")}}R+=F-1}else{for(X=0;F>X;X++)if(x=C[J+X])switch(_=q[X],p){case 0:for(G=0;U>G;G++)x[V+G]|=_[G];break;case 2:for(G=0;U>G;G++)x[V+G]^=_[G];break;default:a("JBIG2 error: operator "+p+" is not supported")}R+=U-1}w++;var K=r(B,"IADS",A);if(null===K)break;R+=K+g}}return C}function m(e,t){var r={};r.number=d(e,t);var i=e[t+4],n=63&i;C[n]||a("JBIG2 error: invalid segment type: "+n),r.type=n,r.typeName=C[n],r.deferredNonRetain=!!(128&i);var o=!!(64&i),s=e[t+5],c=s>>5&7,l=[31&s],h=t+6;if(7===s){c=536870911&d(e,h-1),h+=3;var u=c+7>>3;for(l[0]=e[h++];--u>0;)l.push(e[h++])}else 5!==s&&6!==s||a("JBIG2 error: invalid referred-to flags");r.retainBits=l;var g,m,p=r.number<=256?1:r.number<=65536?2:4,v=[];for(g=0;c>g;g++){var y=1===p?e[h]:2===p?f(e,h):d(e,h);v.push(y),h+=p}if(r.referredTo=v,o?(r.pageAssociation=d(e,h),h+=4):r.pageAssociation=e[h++],r.length=d(e,h),h+=4,4294967295===r.length)if(38===n){var k=b(e,h),w=e[h+T],x=!!(1&w),S=6,A=new Uint8Array(S);for(x||(A[0]=255,A[1]=172),A[2]=k.height>>>24&255,A[3]=k.height>>16&255,A[4]=k.height>>8&255,A[5]=255&k.height,g=h,m=e.length;m>g;g++){for(var B=0;S>B&&A[B]===e[g+B];)B++;if(B===S){r.length=g+S;break}}4294967295===r.length&&a("JBIG2 error: segment end was not found")}else a("JBIG2 error: invalid unknown segment length");return r.headerEnd=h,r}function p(e,t,a,r){for(var i=[],n=a;r>n;){var o=m(t,n);n=o.headerEnd;var s={header:o,data:t};if(e.randomAccess||(s.start=n,n+=o.length,s.end=n),i.push(s),51===o.type)break}if(e.randomAccess)for(var c=0,l=i.length;l>c;c++)i[c].start=n,n+=i[c].header.length,i[c].end=n;return i}function b(e,t){return{width:d(e,t),height:d(e,t+4),x:d(e,t+8),y:d(e,t+12),combinationOperator:7&e[t+16]}}function v(e,t){var r,i,n,o,s=e.header,c=e.data,l=e.start,h=e.end;switch(s.type){case 0:var g={},m=f(c,l);if(g.huffman=!!(1&m),g.refinement=!!(2&m),g.huffmanDHSelector=m>>2&3,g.huffmanDWSelector=m>>4&3,g.bitmapSizeSelector=m>>6&1,g.aggregationInstancesSelector=m>>7&1,g.bitmapCodingContextUsed=!!(256&m),g.bitmapCodingContextRetained=!!(512&m),g.template=m>>10&3,g.refinementTemplate=m>>12&1,l+=2,!g.huffman){for(o=0===g.template?4:1,i=[],n=0;o>n;n++)i.push({x:u(c,l),y:u(c,l+1)}),l+=2;g.at=i}if(g.refinement&&!g.refinementTemplate){for(i=[],n=0;2>n;n++)i.push({x:u(c,l),y:u(c,l+1)}),l+=2;g.refinementAt=i}g.numberOfExportedSymbols=d(c,l),l+=4,g.numberOfNewSymbols=d(c,l),l+=4,r=[g,s.number,s.referredTo,c,l,h];break;case 6:case 7:var p={};p.info=b(c,l),l+=T;var v=f(c,l);if(l+=2,p.huffman=!!(1&v),p.refinement=!!(2&v),p.stripSize=1<<(v>>2&3),p.referenceCorner=v>>4&3,p.transposed=!!(64&v),p.combinationOperator=v>>7&3,p.defaultPixelValue=v>>9&1,p.dsOffset=v<<17>>27,p.refinementTemplate=v>>15&1,p.huffman){var y=f(c,l);l+=2,p.huffmanFS=3&y,p.huffmanDS=y>>2&3,p.huffmanDT=y>>4&3,p.huffmanRefinementDW=y>>6&3,p.huffmanRefinementDH=y>>8&3,p.huffmanRefinementDX=y>>10&3,p.huffmanRefinementDY=y>>12&3,p.huffmanRefinementSizeSelector=!!(14&y)}if(p.refinement&&!p.refinementTemplate){for(i=[],n=0;2>n;n++)i.push({x:u(c,l),y:u(c,l+1)}),l+=2;p.refinementAt=i}p.numberOfSymbolInstances=d(c,l),l+=4,p.huffman&&a("JBIG2 error: huffman is not supported"),r=[p,s.referredTo,c,l,h];break;case 38:case 39:var k={};k.info=b(c,l),l+=T;var w=c[l++];if(k.mmr=!!(1&w),k.template=w>>1&3,k.prediction=!!(8&w),!k.mmr){for(o=0===k.template?4:1,i=[],n=0;o>n;n++)i.push({x:u(c,l),y:u(c,l+1)}),l+=2;k.at=i}r=[k,c,l,h];break;case 48:var x={width:d(c,l),height:d(c,l+4),resolutionX:d(c,l+8),resolutionY:d(c,l+12)};4294967295===x.height&&delete x.height;var C=c[l+16];f(c,l+17);x.lossless=!!(1&C),x.refinement=!!(2&C),x.defaultPixelValue=C>>2&1,x.combinationOperator=C>>3&3,x.requiresBuffer=!!(32&C),x.combinationOperatorOverride=!!(64&C),r=[x];break;case 49:break;case 50:break;case 51:break;case 62:break;default:a("JBIG2 error: segment type "+s.typeName+"("+s.type+") is not implemented")}var S="on"+s.typeName;S in t&&t[S].apply(t,r)}function y(e,t){for(var a=0,r=e.length;r>a;a++)v(e[a],t)}function k(e){for(var t=new w,a=0,r=e.length;r>a;a++){var i=e[a],n=p({},i.data,i.start,i.end);y(n,t)}return t.buffer}function w(){}function x(){}e.prototype={getContexts:function(e){return e in this?this[e]:this[e]=new Int8Array(65536)}},t.prototype={get decoder(){var e=new Qa(this.data,this.start,this.end);return o(this,"decoder",e)},get contextCache(){var t=new e;return o(this,"contextCache",t)}};var C=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"patternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],S=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],A=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],B=[39717,1941,229,405],I=[32,8],T=17;return w.prototype={onPageInformation:function(e){this.currentPageInfo=e;var t=e.width+7>>3,a=new Uint8Array(t*e.height);if(e.defaultPixelValue)for(var r=0,i=a.length;i>r;r++)a[r]=255;this.buffer=a},drawBitmap:function(e,t){var r,i,n,o,s=this.currentPageInfo,c=e.width,l=e.height,h=s.width+7>>3,u=s.combinationOperatorOverride?e.combinationOperator:s.combinationOperator,f=this.buffer,d=128>>(7&e.x),g=e.y*h+(e.x>>3);switch(u){case 0:for(r=0;l>r;r++){for(n=d,o=g,i=0;c>i;i++)t[r][i]&&(f[o]|=n),n>>=1,n||(n=128,o++);g+=h}break;case 2:for(r=0;l>r;r++){for(n=d,o=g,i=0;c>i;i++)t[r][i]&&(f[o]^=n),n>>=1,n||(n=128,o++);g+=h}break;default:a("JBIG2 error: operator "+u+" is not supported")}},onImmediateGenericRegion:function(e,a,r,i){var n=e.info,o=new t(a,r,i),c=s(e.mmr,n.width,n.height,e.template,e.prediction,null,e.at,o);this.drawBitmap(n,c)},onImmediateLosslessGenericRegion:function(){this.onImmediateGenericRegion.apply(this,arguments)},onSymbolDictionary:function(e,r,i,n,o,s){var c;e.huffman&&a("JBIG2 error: huffman is not supported");var h=this.symbols;h||(this.symbols=h={});for(var u=[],f=0,d=i.length;d>f;f++)u=u.concat(h[i[f]]);var g=new t(n,o,s);h[r]=l(e.huffman,e.refinement,u,e.numberOfNewSymbols,e.numberOfExportedSymbols,c,e.template,e.at,e.refinementTemplate,e.refinementAt,g)},onImmediateTextRegion:function(e,a,r,i,n){for(var o,s=e.info,c=this.symbols,l=[],u=0,f=a.length;f>u;u++)l=l.concat(c[a[u]]);var d=h(l.length),m=new t(r,i,n),p=g(e.huffman,e.refinement,s.width,s.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,l,d,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,o,e.refinementTemplate,e.refinementAt,m);this.drawBitmap(s,p)},onImmediateLosslessTextRegion:function(){this.onImmediateTextRegion.apply(this,arguments)}},x.prototype={parseChunks:function(e){return k(e)}},x}(),ar=(PDFJS.bidi=function(){function e(e){return 0!==(1&e)}function t(e){return 0===(1&e)}function a(e,t,a){for(var r=t,i=e.length;i>r;++r)if(e[r]!==a)return r;return r}function r(e,t,a,r){for(var i=t;a>i;++i)e[i]=r}function i(e,t,a){for(var r=t,i=a-1;i>r;++r,--i){var n=e[r];e[r]=e[i],e[i]=n}}function n(e,t,a){return{str:e,dir:a?"ttb":t?"ltr":"rtl"}}function o(o,u,f){var d=!0,g=o.length;if(0===g||f)return n(o,d,f);l.length=g,h.length=g;var m,p,b=0;for(m=0;g>m;++m){l[m]=o.charAt(m);var v=o.charCodeAt(m),y="L";255>=v?y=s[v]:v>=1424&&1524>=v?y="R":v>=1536&&1791>=v?y=c[255&v]:v>=1792&&2220>=v&&(y="AL"),"R"!==y&&"AL"!==y&&"AN"!==y||b++,h[m]=y}if(0===b)return d=!0,n(o,d);-1===u&&(.3>g/b?(d=!0,u=0):(d=!1,u=1));var k=[];for(m=0;g>m;++m)k[m]=u;var w=e(u)?"R":"L",x=w,C=x,S=x;for(m=0;g>m;++m)"NSM"===h[m]?h[m]=S:S=h[m];S=x;var A;for(m=0;g>m;++m)A=h[m],"EN"===A?h[m]="AL"===S?"AN":"EN":"R"!==A&&"L"!==A&&"AL"!==A||(S=A);for(m=0;g>m;++m)A=h[m],"AL"===A&&(h[m]="R");for(m=1;g-1>m;++m)"ES"===h[m]&&"EN"===h[m-1]&&"EN"===h[m+1]&&(h[m]="EN"),"CS"!==h[m]||"EN"!==h[m-1]&&"AN"!==h[m-1]||h[m+1]!==h[m-1]||(h[m]=h[m-1]);for(m=0;g>m;++m)if("EN"===h[m]){var B;for(B=m-1;B>=0&&"ET"===h[B];--B)h[B]="EN";for(B=m+1;g>B&&"ET"===h[B];--B)h[B]="EN"}for(m=0;g>m;++m)A=h[m],"WS"!==A&&"ES"!==A&&"ET"!==A&&"CS"!==A||(h[m]="ON");for(S=x,m=0;g>m;++m)A=h[m],"EN"===A?h[m]="L"===S?"L":"EN":"R"!==A&&"L"!==A||(S=A);for(m=0;g>m;++m)if("ON"===h[m]){var I=a(h,m+1,"ON"),T=x;m>0&&(T=h[m-1]);var O=C;g>I+1&&(O=h[I+1]),"L"!==T&&(T="R"),"L"!==O&&(O="R"),T===O&&r(h,m,I,T),m=I-1}for(m=0;g>m;++m)"ON"===h[m]&&(h[m]=w);for(m=0;g>m;++m)A=h[m],t(k[m])?"R"===A?k[m]+=1:"AN"!==A&&"EN"!==A||(k[m]+=2):"L"!==A&&"AN"!==A&&"EN"!==A||(k[m]+=1);var L,R=-1,P=99;for(m=0,p=k.length;p>m;++m)L=k[m],L>R&&(R=L),P>L&&e(L)&&(P=L);for(L=R;L>=P;--L){var M=-1;for(m=0,p=k.length;p>m;++m)k[m]<L?M>=0&&(i(l,M,m),M=-1):0>M&&(M=m);M>=0&&i(l,M,k.length)}var D="";for(m=0,p=l.length;p>m;++m){var E=l[m];"<"!==E&&">"!==E&&(D+=E)}return n(D,d)}var s=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ON","CS","ON","CS","ON","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ON","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","ON","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],c=["AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL"],l=[],h=[];return o}(),function(e){function t(e){var t=3285377520;this.h1=e?4294967295&e:t,this.h2=e?4294967295&e:t}var a=4294901760,r=65535,i=!1;try{new Uint32Array(new Uint8Array(5).buffer,0,1)}catch(n){i=!0}return t.prototype={update:function(e){var t,n=i;if("string"==typeof e){var o=new Uint8Array(2*e.length),s=0;for(t=0;t<e.length;t++){var c=e.charCodeAt(t);255>=c?o[s++]=c:(o[s++]=c>>>8,o[s++]=255&c)}}else if(e instanceof Uint8Array)o=e,s=o.length;else{if(!("object"==typeof e&&"length"in e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");o=e,s=o.length,n=!0}var l=s>>2,h=s-4*l,u=n?new oe(o,l):new Uint32Array(o.buffer,0,l),f=0,d=0,g=this.h1,m=this.h2,p=3432918353,b=461845907,v=p&r,y=b&r;for(t=0;l>t;t++)1&t?(f=u[t],f=f*p&a|f*v&r,f=f<<15|f>>>17,f=f*b&a|f*y&r,g^=f,g=g<<13|g>>>19,g=5*g+3864292196):(d=u[t],d=d*p&a|d*v&r,d=d<<15|d>>>17,d=d*b&a|d*y&r,m^=d,m=m<<13|m>>>19,m=5*m+3864292196);switch(f=0,h){case 3:f^=o[4*l+2]<<16;case 2:f^=o[4*l+1]<<8;case 1:f^=o[4*l],f=f*p&a|f*v&r,f=f<<15|f>>>17,f=f*b&a|f*y&r,1&l?g^=f:m^=f}return this.h1=g,this.h2=m,this},hexdigest:function(){var e=this.h1,t=this.h2;e^=t>>>1,e=3981806797*e&a|36045*e&r,t=4283543511*t&a|(2950163797*(t<<16|e>>>16)&a)>>>16,e^=t>>>1,e=444984403*e&a|60499*e&r,t=3301882366*t&a|(3120437893*(t<<16|e>>>16)&a)>>>16,e^=t>>>1;for(var i=0,n=[e,t],o="";i<n.length;i++){for(var s=(n[i]>>>0).toString(16);s.length<8;)s="0"+s;o+=s}return o}},t}())}.call("undefined"==typeof window?this:window),PDFJS.workerSrc||"undefined"==typeof document||(PDFJS.workerSrc=function(){"use strict";var e=document.body||document.getElementsByTagName("head")[0],t=e.lastChild.src;return t&&t.replace(/\.js$/i,".worker.js")}());
//# sourceMappingURL=pdf.worker.min.js.map | pvnr0082t/cdnjs | ajax/libs/pdf.js/1.0.982/pdf.worker.min.js | JavaScript | mit | 518,498 |
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.avalon=t():e.avalon=t()}(this,function(){return function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}({0:function(e,t,n){var a=n(107);n(108),n(109),e.exports=a},107:function(e,t,n){!function(t,n){e.exports=n()}(this,function(){return function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={exports:{},id:a,loaded:!1};return e[a].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var a=n(84);n(8),n(15),n(86),n(95),n(72),n(103),n(104),e.exports=a},,,function(e,t){(function(t){function n(e){return new n.init(e)}t.avalon=n,"undefined"!=typeof window&&(window.avalon=n),n.init=function(e){this[0]=this.element=e},n.fn=n.prototype=n.init.prototype,n.shadowCopy=function(e,t){for(var n in t)e[n]=t[n];return e};var a=/[^, ]+/g,r=t.console;n.shadowCopy(n,{noop:function(){},rword:a,inspect:{}.toString,ohasOwn:{}.hasOwnProperty,log:function(){r&&n.config.debug&&Function.apply.call(console.log,console,arguments)},warn:function(){if(r&&n.config.debug){var e=console.warn||console.log;Function.apply.call(e,console,arguments)}},error:function(e,t){throw(t||Error)(e)},oneObject:function(e,t){"string"==typeof e&&(e=e.match(a)||[]);for(var n={},r=void 0!==t?t:1,o=0,i=e.length;i>o;o++)n[e[o]]=r;return n}}),e.exports=n}).call(t,function(){return this}())},function(e,t){(function(t){var n=t,a={window:n,document:{createElement:function(){return{}},createElementNS:function(){return{}},contains:Boolean},root:{outerHTML:"x"},msie:NaN,modern:!0,avalonDiv:{},avalonFragment:null};if(n.location&&n.navigator&&n.window){var r=n.document;a.document=r,a.modern=n.dispatchEvent,a.root=r.documentElement,a.avalonDiv=r.createElement("div"),a.avalonFragment=r.createDocumentFragment(),n.VBArray&&(a.msie=r.documentMode||(n.XMLHttpRequest?7:6))}e.exports=a}).call(t,function(){return this}())},,function(e,t){function n(e,t,n){e[n.name]=avalon.parseExpr(n)}var a={},r=/([a-z\d])([A-Z]+)/g,o=/[-_][^-_]/g,i=/\d\.\d{4}/,l=/[-.*+?^${}()|[\]\/\\]/g,s=[].slice;avalon.shadowCopy(avalon,{caches:{},vmodels:{},filters:{},components:{},directives:{},eventHooks:{},eventListeners:{},validators:{},scopes:{},cssHooks:a,parsers:{number:function(e){return""===e?"":parseFloat(e)||0},string:function(e){return null===e||void 0===e?"":e+""},"boolean":function(e){return"true"===e}},version:"2.07",slice:function(e,t,n){return s.call(e,t,n)},css:function(e,t,n,r){e instanceof avalon&&(e=e[0]);var o=avalon.camelize(t);if(t=avalon.cssName(o)||o,void 0===n||"boolean"==typeof n){r=a[o+":get"]||a["@:get"],"background"===t&&(t="backgroundColor");var i=r(e,t);return n===!0?parseFloat(i)||0:i}if(""===n)e.style[t]="";else{if(null==n||n!==n)return;isFinite(n)&&!avalon.cssNumber[o]&&(n+="px"),r=a[o+":set"]||a["@:set"],r(e,t,n)}},directive:function(e,t){return t.parse=t.parse||n,this.directives[e]=t},isObject:function(e){return null!==e&&"object"==typeof e},range:function(e,t,n){n||(n=1),null==t&&(t=e||0,e=0);for(var a=-1,r=Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++a<r;)o[a]=e,e+=n;return o},hyphen:function(e){return e.replace(r,"$1-$2").toLowerCase()},camelize:function(e){return!e||e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(o,function(e){return e.charAt(1).toUpperCase()})},makeHashCode:function(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(i,e)},escapeRegExp:function(e){return(e+"").replace(l,"\\$&")},Array:{merge:function(e,t){e.push.apply(e,t)},ensure:function(e,t){return-1===e.indexOf(t)?e.push(t):void 0},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var n=e.indexOf(t);return~n?avalon.Array.removeAt(e,n):!1}}}),"undefined"!=typeof performance&&performance.now&&(avalon.makeHashCode=function(e){return e=e||"avalon",(e+performance.now()).replace(".","")});var c=1;e.exports={avalon:avalon,getLongID:function(e){return e.uuid||(e.uuid=avalon.makeHashCode("e"))},getShortID:function(e){return e.uuid||(e.uuid="_"+ ++c)}}},function(e,t){function n(e){for(var t in e)if(avalon.ohasOwn.call(e,t)){var a=e[t];"function"==typeof n.plugins[t]?n.plugins[t](a):"object"==typeof n[t]?avalon.shadowCopy(n[t],a):n[t]=a}return this}avalon.config=n;var a={interpolate:function(e){var t=e[0],a=e[1];if(t===a)throw new SyntaxError("openTag!==closeTag");var r=t+"test"+a,o=avalon.avalonDiv;if(o.innerHTML=r,o.innerHTML!==r&&o.innerHTML.indexOf("<")>-1)throw new SyntaxError("此定界符不合法");o.innerHTML="",n.openTag=t,n.closeTag=a;var i=avalon.escapeRegExp(t),l=avalon.escapeRegExp(a);n.rexpr=new RegExp(i+"([\\ss\\S]*)"+l),n.rexprg=new RegExp(i+"([\\ss\\S]*)"+l,"g"),n.rbind=new RegExp(i+"[\\ss\\S]*"+l+"|\\bms-|\\bslot\\b")}};n.plugins=a,avalon.config({interpolate:["{{","}}"],debug:!0})},function(e,t,n){function a(e){return e}var r=n(9),o=n(10),i=n(11),l=n(12),s=n(13),c=n(14),u=avalon.filters;avalon.__format__=function(e){var t=u[e];return t?t.get?t.get:t:a},avalon.mix(u,{uppercase:function(e){return String(e).toUpperCase()},lowercase:function(e){return String(e).toLowerCase()},truncate:function(e,t,n){return t=t||30,n="string"==typeof n?n:"...",e.length>t?e.slice(0,t-n.length)+n:String(e)},camelize:avalon.camelize,date:l,escape:o,sanitize:i,number:r,currency:function(e,t,n){return(t||"¥")+r(e,isFinite(n)?n:2)}},s,c),e.exports=avalon},function(e,t){function n(e,t,n,a){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,o=isFinite(+t)?Math.abs(t):3,i=a||",",l=n||".",s="",c=function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)};return s=(o?c(r,o):""+Math.round(r)).split("."),s[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(s[1]||"").length<o&&(s[1]=s[1]||"",s[1]+=new Array(o-s[1].length+1).join("0")),s.join(l)}e.exports=n},function(e,t){function n(e){return String(e).replace(/&/g,"&").replace(a,function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1);return"&#"+(1024*(t-55296)+(n-56320)+65536)+";"}).replace(r,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(/</g,"<").replace(/>/g,">")}var a=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,r=/([^\#-~| |!])/g;e.exports=n},function(e,t){var n=/<script[^>]*>([\S\s]*?)<\/script\s*>/gim,a=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,r=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,o={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi};e.exports=function(e){return e.replace(n,"").replace(r,function(e,t){var n=e.toLowerCase().match(/<(\w+)\s/);if(n){var r=o[n[1]];r&&(e=e.replace(r,function(e,t,n){var a=n.charAt(0);return t+"="+a+"javascript:void(0)"+a}))}return e.replace(a," ").replace(/\s+/g," ")})}},function(e,t){function n(e){return parseInt(e,10)||0}function a(e,t,n){var a="";for(0>e&&(a="-",e=-e),e=""+e;e.length<t;)e="0"+e;return n&&(e=e.substr(e.length-t)),a+e}function r(e,t,n,r){return function(o){var i=o["get"+e]();return(n>0||i>-n)&&(i+=n),0===i&&-12===n&&(i=12),a(i,t,r)}}function o(e,t){return function(n,a){var r=n["get"+e](),o=(t?"SHORT"+e:e).toUpperCase();return a[o][r]}}function i(e){var t=-1*e.getTimezoneOffset(),n=t>=0?"+":"";return n+=a(Math[t>0?"floor":"ceil"](t/60),2)+a(Math.abs(t%60),2)}function l(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function s(e,t){var a,r,o=s.locate,i="",l=[];if(t=t||"mediumDate",t=o[t]||t,"string"==typeof e)if(/^\d+$/.test(e))e=n(e);else if(v.test(e))e=+RegExp.$1;else{var p=e.trim(),d=[0,0,0,0,0,0,0],f=new Date(0);p=p.replace(/^(\d+)\D(\d+)\D(\d+)/,function(e,t,a,r){var o=4===r.length?[r,t,a]:[t,a,r];return d[0]=n(o[0]),d[1]=n(o[1])-1,d[2]=n(o[2]),""});var h=f.setFullYear,m=f.setHours;p=p.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(e,t,a,r,o){return d[3]=n(t),d[4]=n(a),d[5]=n(r),o&&(d[6]=Math.round(1e3*parseFloat("0."+o))),""});var y=0,g=0;p=p.replace(/Z|([+-])(\d\d):?(\d\d)/,function(e,t,a,r){return h=f.setUTCFullYear,m=f.setUTCHours,t&&(y=n(t+a),g=n(t+r)),""}),d[3]-=y,d[4]-=g,h.apply(f,d.slice(0,3)),m.apply(f,d.slice(3)),e=f}if("number"==typeof e&&(e=new Date(e)),"date"===avalon.type(e)){for(;t;)r=u.exec(t),r?(l=l.concat(r.slice(1)),t=l.pop()):(l.push(t),t=null);return l.forEach(function(t){a=c[t],i+=a?a(e,o):t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),i}}var c={yyyy:r("FullYear",4),yy:r("FullYear",2,0,!0),y:r("FullYear",1),MMMM:o("Month"),MMM:o("Month",!0),MM:r("Month",2,1),M:r("Month",1,1),dd:r("Date",2),d:r("Date",1),HH:r("Hours",2),H:r("Hours",1),hh:r("Hours",2,-12),h:r("Hours",1,-12),mm:r("Minutes",2),m:r("Minutes",1),ss:r("Seconds",2),s:r("Seconds",1),sss:r("Milliseconds",3),EEEE:o("Day"),EEE:o("Day",!0),a:l,Z:i},u=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,v=/^\/Date\((\d+)\)\/$/,p={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss","short":"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};p.SHORTMONTH=p.MONTH,s.locate=p,e.exports=s},function(e,t){function n(e,t,n){var a=avalon.type(e);if("array"!==a&&"object"!==a)throw"orderBy只能处理对象或数组";var r=n&&0>n?-1:1;if("string"==typeof t){var o=t;t=function(e){return e&&e[o]}}e=l(e),e.forEach(function(e){e.order=t(e.value,e.key)}),e.sort(function(e,t){var n=e.order,a=t.order;return Number.isNaN(n)&&Number.isNaN(a)?0:n===a?0:n>a?r:-r});var s="array"===a,c=s?[]:{};return i(c,e,function(e){s?c.push(e.value):c[e.key]=e.value})}function a(e,t){var n=avalon.type(e);if("array"!==n&&"object"!==n)throw"filterBy只能处理对象或数组";var a=avalon.slice(arguments,2),r=avalon.type(t);if("function"===r)var o=t;else{if("string"!==r&&"number"!==r)return e;if(""===t)return e;var s=new RegExp(avalon.escapeRegExp(t),"i");o=function(e){return s.test(e)}}e=l(e).filter(function(e,t){return!!o.apply(e,[e.value,t].concat(a))});var c="array"===n,u=c?[]:{};return i(u,e,function(e){c?u.push(e.value):u[e.key]=e.value})}function r(e,t,n){if(avalon.isObject(e)&&!Array.isArray(e)){var a=[];return i(a,t,function(t){a.push(e.hasOwnProperty(t)?e[t]:n?n[t]:"")})}return e}function o(e,t,n){var a=avalon.type(e);if("array"!==a&&"object"!==a)throw"limitBy只能处理对象或数组";if(t=Math.abs(Number(t))===1/0?Number(t):parseInt(t,10),Number.isNaN(t))return e;"object"===a&&(e=l(e)),t=Math.min(e.length,t),n=!n||Number.isNaN(n)?0:~~n,0>n&&(n=Math.max(0,e.length+n));for(var r=[],o=n;t>o;o++)r.push(e[o]);var s="array"===a;if(s)return r;var c={};return i(c,r,function(e){c[e.key]=e.value})}function i(e,t,n){for(var a=0,r=t.length;r>a;a++)n(t[a]);return e}function l(e){var t=[],n=0;return avalon.each(e,function(e,a){t[n++]={value:a,key:e}}),t}Number.isNaN=Number.isNaN||function(e){return e!==e},e.exports={limitBy:o,orderBy:n,selectBy:r,filterBy:a}},function(e,t){var n={stop:function(e){return e.stopPropagation(),e},prevent:function(e){return e.preventDefault(),e}},a={esc:27,tab:9,enter:13,space:32,del:46,up:38,left:37,right:39,down:40};avalon.each(a,function(e,t){n[e]=function(e){return e.which!==t&&(e.$return=!0),e}}),e.exports=n},function(e,t,n){var a=n(16),r=n(17),o=n(18);avalon.vdomAdaptor=function(e,t){if(!e)return"toHTML"===t?"":avalon.avalonFragment.cloneNode(!1);switch(e.nodeType){case 3:return a.prototype[t].call(e);case 8:return r.prototype[t].call(e);default:return o.prototype[t].call(e)}},e.exports={VText:a,VComment:r,VElement:o}},function(e,t){function n(e){if("string"==typeof e)this.type="#text",this.nodeValue=e,this.skipContent=!a.test(e),this.nodeType=3;else for(var t in e)this[t]=e[t]}var a=avalon.config.rexpr;n.prototype={constructor:n,toDOM:function(){return document.createTextNode(this.nodeValue)},toHTML:function(){return this.nodeValue}},e.exports=n},function(e,t){function n(e){if("string"==typeof e)this.type="#comment",this.nodeValue=e,this.skipContent=!0,this.nodeType=8;else for(var t in e)this[t]=e[t]}n.prototype={constructor:n,toDOM:function(){return document.createComment(this.nodeValue)},toHTML:function(){return"<!--"+this.nodeValue+"-->"}},e.exports=n},function(e,t){function n(e,t,n){if("object"==typeof e)for(var a in e)this[a]=e[a];else this.nodeType=1,this.type=e,this.props=t,this.children=n,this.template=""}function a(e){return e!==!1&&Object(e)!==e}var r={"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t},"for":function(e,t){e.htmlFor=t}};n.prototype={constructor:n,toDOM:function(){var e=document.createElement(this.type);for(var t in this.props){var n=this.props[t];a(n)&&(r[t]&&avalon.msie<8?r[t](e,n):e.setAttribute(t,n+""))}if(this.wid){var o=avalon.scopes[this.wid];if(o&&o.dom)return o.dom}if(this.skipContent)switch(this.type){case"script":e.text=this.template;break;case"style":case"template":e.innerHTML=this.template;break;case"noscript":e.textContent=this.template;break;default:var i=avalon.parseHTML(this.template);e.appendChild(i)}else this.isVoidTag||(this.children.length?this.children.forEach(function(t){t&&e.appendChild(avalon.vdomAdaptor(t,"toDOM"))}):e.appendChild(avalon.parseHTML(this.template)));return e},toHTML:function(){var e=[];for(var t in this.props){var n=this.props[t];a(n)&&e.push(t+"="+avalon.quote(this.props[t]+""))}e=e.length?" "+e.join(" "):"";var r="<"+this.type+e;return this.isVoidTag?r+"/>":(r+=">",r+=this.children.length?this.children.map(function(e){return e?avalon.vdomAdaptor(e,"toHTML"):""}).join(""):this.template,r+"</"+this.type+">")}},e.exports=n},,,,,function(e,t){var n={"accept-charset":"acceptCharset","char":"ch",charoff:"chOff","class":"className","for":"htmlFor","http-equiv":"httpEquiv"},a=["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected,","isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(",");a.replace(/\w+/g,function(e){n[e.toLowerCase()]=e});var r=["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,contentEditable,frameBorder,longDesc,maxLength,marginWidth,marginHeight,rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",");r.replace(/\w+/g,function(e){n[e.toLowerCase()]=e}),e.exports=n},,,,,function(e,t){function n(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}var a=n.prototype;a.put=function(e,t){var n={key:e,value:t};return this._keymap[e]=n,this.tail?(this.tail.newer=n,n.older=this.tail):this.head=n,this.tail=n,this.size===this.limit?this.shift():this.size++,t},a.shift=function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key])},a.get=function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)},e.exports=n},function(e,t){function n(e){var t="undefined"!=typeof e.querySelectorAll?e.querySelectorAll("script"):e.getElementsByTagName("script");if(t.length)for(var n,o=0;n=t[o++];)if(r[n.type]){var i=a.cloneNode(!1);Array.prototype.forEach.call(n.attributes,function(e){e&&e.specified&&(i[e.name]=e.value,i.setAttribute(e.name,e.value))}),i.text=n.text,n.parentNode.replaceChild(i,n)}}var a=avalon.document.createElement("script"),r=avalon.oneObject(["","text/javascript","text/ecmascript","application/ecmascript","application/javascript"]);e.exports=n},,,,function(e,t){e.exports={click:!0,dblclick:!0,keydown:!0,keypress:!0,keyup:!0,mousedown:!0,mousemove:!0,mouseup:!0,mouseover:!0,mouseout:!0,wheel:!0,mousewheel:!0,input:!0,change:!0,beforeinput:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,select:!0,cut:!0,copy:!0,paste:!0,beforecut:!0,beforecopy:!0,beforepaste:!0,focusin:!0,focusout:!0,DOMFocusIn:!0,DOMFocusOut:!0,DOMActivate:!0,dragend:!0,datasetchanged:!0}},,function(e,t){function n(e,t){for(var i,l=0;i=e[l++];)if(1===i.nodeType){var s=r(i);s&&++o;var c=avalon.vmodels[s];if(c&&!c.$element){a(i),avalon(i).removeClass("ms-controller"),c.$element=i;var u=new Date;i.vtree=avalon.lexer(i.outerHTML.trim());var v=new Date;avalon.log("create primitive vtree",v-u),c.$render=avalon.render(i.vtree),avalon.scopes[c.$id]={vmodel:c,local:{},dom:i,render:c.$render};var p=new Date;avalon.log("create template Function ",p-v),avalon.rerenderStart=p,avalon.batch(s,!0),"function"==typeof t&&t(c)}else s||n(i.childNodes,t)}}function a(e){for(var t,n=0;n<e.childNodes.length;n++){var r=e.childNodes[n];3!==r.nodeType||i.test(r.nodeValue)?1===r.nodeType&&a(r):(t=e.removeChild(r),n--)}0===e.childNodes.length&&t&&e.appendChild(t)}function r(e){return e.getAttribute("ms-controller")||e.getAttribute("ms-important")}var o=0,i=/\S/;e.exports=avalon.scan=function(e,t){return e&&e.nodeType?(n([e],t),void(o=0)):void avalon.warn("[avalon.scan] first argument must be element , documentFragment, or document")}},,function(e,t,n){var a=n(38);avalon.directive("important",{priority:1,parse:function(e,t,n){var a=n.expr,r=avalon.quote(a),o=n.name;e[o]=r,t.$prepend=["(function(__vmodel__){","var important = avalon.scopes["+r+"]",'if(important && important.fast){avalon.log("不进入"+'+r+");return }","var __top__ = __vmodel__","var __synth__ = avalon.vmodels["+r+"]","var __present__ = __synth__","var __vmodel__ = __synth__","/*controller:"+a+"*/"].join("\n")+"\n\n",e.synth="__synth__",e.local="{}",e.top="__top__",e.present="__present__",t.$append="/*controller:"+a+"*/\n})(__vmodel__);"},diff:function(e,t,n,r){t[r]!==e[r]&&a(e,this.update,n,"controller")},update:function(e,t,n){avalon.directives.controller.update(e,t,n,"important")}})},function(e,t){e.exports=function(e,t,n,a,r){r=r||"change";var o=e[r]||(e[r]=[]);avalon.Array.ensure(o,t)&&(n.count+=1,avalon.config.showDiff&&avalon.log(a+" change"))}},function(e,t,n){var a=n(38);avalon.directive("controller",{priority:2,parse:function(e,t,n){var a=n.expr,r=avalon.quote(a),o=n.name;e[o]=r,t.$prepend=["(function(__vmodel__){","var __top__ = __vmodel__","var __present__ = avalon.vmodels["+r+"]","if(__present__ && __top__ && __present__ !== __top__){","var __synth__ = avalon.mediatorFactory(__vmodel__, __present__)","var __vmodel__ = __synth__","}else{","__vmodel__ = __top__ || __present__","}","/*controller:"+a+"*/"].join("\n")+"\n\n",e.synth="__synth__",e.local="__local__",e.top="__top__",e.present="__present__",t.$append="/*controller:"+a+"*/\n})(__vmodel__);"},diff:function(e,t,n,r){t[r]!==e[r]&&a(e,this.update,n,"controller")},update:function(e,t,n,a){var r=t.top,o=t.present,i=t.synth;if(r===o){if(void 0===r)return;var l=avalon.scopes[r.$id];if(l&&(!a||a.fast))return}if(r&&o){var s=r.$render+"",c="/*controller:"+o.$id+"*/",u=s.indexOf(c)+c.length,v=s.lastIndexOf(c),p=s.slice(u,v),d=t.local||{},f=[];for(var h in d)f.push("var "+h+" = __local__["+avalon.quote(h)+"]");f.push("var vnodes = []");var m=f.join("\n")+p+"\nreturn vnodes",y=avalon.render(m);i.$render=o.$render=y,i.$element=o.$element=e,avalon.scopes[o.$id]={vmodel:o,synth:i,local:d,dom:e,render:y,fast:"important"}}}})},,function(e,t,n){var a=n(38);avalon.directive("css",{diff:function(e,t,n,r){var o=e[r],i=t[r];if(Object(o)===o){if(o=o.$model||o,Array.isArray(o)&&(o=e[r]=avalon.mix.apply({},o)),"object"!=typeof i)e.changeStyle=o;else{var l={},s=!1;for(var c in o)o[c]!==i[c]&&(s=!0,l[c]=o[c]);s&&(e.changeStyle=l)}e.changeStyle&&a(e,this.update,n,"css")}else e[r]=i},update:function(e,t){var n=t.changeStyle,a=avalon(e);for(var r in n)a.css(r,n[r]);delete t.changeStyle}})},function(e,t,n){function a(e,t){var n=e.ownerDocument,r=e.nodeName,i="_"+r;if(!a[i]){var l=n.body.appendChild(n.createElement(r));t=avalon.modern?getComputedStyle(l,null).display:l.currentStyle.display,n.body.removeChild(l),t===o&&(t="block"),a[i]=t}return a[i]}var r=n(38),o="none";avalon.parseDisplay=a,avalon.directive("visible",{diff:function(e,t,n,a){var o=e[a]=!!e[a];e.displayValue=t.displayValue,o!==t.props[a]&&r(e,this.update,n,"visible")},update:function(e,t){function n(){void 0!==r&&(e.style.display=r)}var r,i=t["ms-visible"],l=e.style.display;i?(l===o&&(r=t.displayValue,r||(e.style.display="")),""===e.style.display&&avalon(e).css("display")===o&&avalon.contains(e.ownerDocument,e)&&(r=a(e))):l!==o&&(r=o,t.displayValue=l),avalon.applyEffect(e,t,{hook:i?"onEnterDone":"onLeaveDone",cb:n})}})},,function(e,t,n){var a=n(45).ident,r=n(38);avalon.directive("text",{parse:function(e,t,n){e.children="[]",e.skipContent=!0;var r=a.test(n.expr)?n.expr:avalon.parseExpr(n);e[n.name]=r},diff:function(e,t,n,a){var o=e[a],i=t[a];e.children=t.children;var l=e.dom=t.dom;return o===i&&0!==e.children.length||(e.children[0]||(e.children[0]={type:"#text",nodeType:3}),e.children[0].nodeValue=o,l?this.update(l,e):r(e,this.update,n,"text")),t.dom=null,!1},update:function(e,t){var n=t["ms-text"];"textContent"in e?e.textContent=n+"":e.innerText=n+"",t.dom=e}})},function(e,t){e.exports={ident:/^[$a-zA-Z_][$a-zA-Z0-9_]*$/,sp:/^\s+$/,leftSp:/^\s+/,rightSp:/s+$/,binding:/^ms-(\w+)-?(.*)/,string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/g}},function(e,t,n){var a=n(38);n(47);avalon.htmlFactory=function(e,t,n){var a=avalon.lexer(e+""),r=avalon.render(a);return r(t,n)},avalon.directive("html",{parse:function(e,t,n){t.isVoidTag?e.children="[]":(e[n.name]=avalon.parseExpr(n),delete t.children,e.children="avalon.htmlFactory("+avalon.parseExpr(n)+",__vmodel__,__local__)")},diff:function(e,t,n,r){var o=e[r],i=t[r];o!==i&&a(e,this.update,n,"html")},update:function(e,t){if(1===e.nodeType){avalon.clearHTML(e);var n=document.createDocumentFragment();t.children.forEach(function(e){e&&n.appendChild(avalon.vdomAdaptor(e,"toDOM"))}),e.appendChild(n)}}})},function(e,t,n){function a(e){return m.test(e)?e:c(e,"text")}function r(e){return"vnodes.push("+e+");"}function o(e){return r(p(e))}function i(e){for(var t,n=["\nvar vnodes = [];"],a=[],r=0;t=e[r++];){var o=l(t,a);t.$prepend&&n.push(t.$prepend);var i=t.$append;delete t.$append,delete t.$prepend,o&&n.push(o+"\n"),i&&n.push(i)}return n.push("return vnodes\n"),n.join("\n")}function l(e,t,n){var a=avalon.directives;if(3===e.nodeType)return d.rexpr.test(e.nodeValue)?r(s(e)):o(e);if(1===e.nodeType){var l=e.props;0===e.type.indexOf("ms-")&&(l["ms-widget"]||(l["ms-widget"]="{is:"+f(e.type)+"}"));var v={props:{},type:e.type,nodeType:1,template:""},p=u(v,l);if(p.length||(v.skipAttrs=!0),v.order=p.map(function(t){return a[t.type].parse(v,e,t),t.name}).join(";;"),"widget"===e.directive&&(v.order=v.order?"ms-widget;;"+v.order:"ms-widget",v.directive="widget",v.local="__local__",v.vmodel="__vmodel__",v.wid=avalon.quote(e.props.wid),delete v.skipAttrs),e.isVoidTag)v.isVoidTag=!0;else if(!("children"in v)){var h=e.children;h.length?v.children="(function(){"+i(h)+"})()":(v.template=e.template,v.children="[]")}return o(v)}if(8===e.nodeType){var m=e.nodeValue;if(y.test(m)){0!==m.indexOf("ms-for:")&&avalon.error("ms-for指令前不能有空格"),t.push(e);var v=avalon.mix({directive:"for",vmodel:"__vmodel__"},e);return a["for"].parse(v,e,e),o(v)}if(g.test(m)){var b=t[t.length-1],w=b.signature;return 0!==m.indexOf("ms-for-end:")&&avalon.error("ms-for-end指令前不能有空格"),e.$append=o({nodeType:8,type:"#comment",nodeValue:w,key:"traceKey"})+"\n\n})",t.length&&(e.$append+="\n"+w+".end ="+o({nodeType:8,type:"#comment",signature:w,nodeValue:"ms-for-end:"})+"\n",t.pop()),""}if(0===m.indexOf("ms-js:")){var x=c(m.replace("ms-js:",""),"js")+"\n",T=o(e),$=x.match(_);return $&&$[1]?e.$append=(e.$append||"")+x+"\n__local__."+$[1]+" = "+$[1]+"\n":avalon.warn(m+" parse fail!"),T}return o(e)}}function s(e){var t=v(e.nodeValue),n="";if(1===t.length)n=a(t[0].expr);else{var r=t.map(function(e){return e.type?a(e.expr):f(e.expr)}).join(" + ");n="String("+r+")"}return'{\ntype: "#text",\nnodeType:3,\nfixIESkip: true,\nnodeValue: '+n+"\n}"}var c=n(48),u=n(50),v=n(51),p=n(52),d=avalon.config,f=avalon.quote,h=(avalon.makeHashCode,n(45)),m=h.ident,y=(h.sp,/^\s*ms\-for:/),g=/^\s*ms\-for\-end:/,_=/^\s*var\s+([$\w]+)\s*\=\s*\S+/;e.exports=i},function(e,t,n){function a(e,t){function n(e){var t="??"+g++;return _[t]=e,t}function a(e){return _[e]}var h={};if(t=t||"other","object"==typeof e&&(t=e.type,h=e,e=h.expr),"string"!=typeof e)return"";var m=e,y=o.get(t+":"+m);if(y)return y;var g=1,_={},b=e.replace(i,n).replace(l,n).replace(u,n).replace(p,"$1").split(v),w=b.shift().replace(s,a).trim();if("on"===t&&f.test(w)&&(w+="($event)"),w=w.replace(d,"$1__vmodel__."),"js"===t)return o.put(t+":"+m,w);var x=b.map(function(e){e=e.replace(s,a).replace(d,"$1__vmodel__.");var t=!1;return e=e.replace(c,function(e,n){return t=!0,/\S/.test(n)?"(__value__,"+n+");":"(__value__);"}),t||(e+="(__value__);"),e=e.replace(/(\w+)/,'avalon.__format__("$1")'),"__value__ = "+e}),T=[];if("on"===t)x=x.map(function(e){return e.replace(/__value__/g,"$event")}),x.length&&x.push("if($event.$return){\n return;\n}"),avalon.modern||(w=w.replace(/__vmodel__\.([^(]+)\(([^)]*)\)/,function(e,t,n){return"__vmodel__."+t+".call(__vmodel__"+(/\S/.test(n)?","+n:"")+")"})),T=["function ms_on($event){","try{"," var __vmodel__ = this;"," "+w,"}catch(e){",r(e,t),"}","}"],x.unshift(2,0);else{if("duplex"===t){var $=["function (__vmodel__){","try{","return "+w+"\n","}catch(e){",r(e,t).replace("parse","get"),"}","}"];o.put("duplex:"+m,$.join("\n"));var C=["function (__vmodel__,__value__){","try{"," "+w+" = __value__","}catch(e){",r(e,t).replace("parse","set"),"}","}"];if(o.put("duplex:set:"+m,C.join("\n")),b.length){var E=["function (__vmodel__, __value__){","try{",x.join("\n"),"return __value__\n","}catch(e){",r(e,t).replace("parse","format"),"}","}"];o.put("duplex:format:"+m,E.join("\n"))}return o.get("duplex:"+m)}T=["(function(){","try{","var __value__ = "+w,"text"===t?"return avalon.parsers.string(__value__)":"return __value__","}catch(e){",r(e,t),' return ""',"}","})()"],x.unshift(3,0)}return T.splice.apply(T,x),y=T.join("\n"),o.put(t+":"+m,y),y}function r(e,t){return" avalon.warn(e, "+avalon.quote("parse "+t+" binding【 "+e+" 】fail")+")"}var o=n(49),i=/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/g,l=n(45).string,s=/\?\?\d+/g,c=/\(([^)]*)\)/,u=/\|\|/g,v=/\|(?=\w)/,p=/\s*(\.|\|)\s*/g,d=/(^|[^\w\u00c0-\uFFFF_])(@|##)(?=[$\w])/g,f=/^(?:\@|##)[$\w]+$/i;e.exports=avalon.parseExpr=a},function(e,t,n){var a=n(28);e.exports=new a(512)},function(e,t,n){function a(e,t){var n=[],a="ms-skip"in t,s={};for(var c in t){var u,v=t[c];if(!a&&(u=c.match(i))){var p=u[1],d=u[2]||"",f=c;if(l[p]){var h=parseFloat(d)||0;d=p,p="on"}if(f="ms-"+p+(d?"-"+d:""),c!==f&&(delete t[c],t[f]=v),o[p]){var m={type:p,param:d,name:f,expr:v,priority:o[p].priority||100*p.charCodeAt(0)};"on"===p&&(h=h||0,m.name+="-"+h,m.priority+=100*d.charCodeAt(0)+h),s[m.name]||(s[m.name]=1,n.push(m))}}else e.props[c]=t[c]}n.sort(r);for(var y,g=[],_=0;y=n[_++];){var p=y.type;if(g.type=p,g.push(y),"widget"===p)break}return g}function r(e,t){return e.priority-t.priority}var o=avalon.directives,i=n(45).binding,l=avalon.oneObject("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit");e.exports=a},function(e,t,n){function a(e){for(var t,n,a=[],l=0;;){if(n=e.indexOf(i.openTag,l),-1===n)break;if(t=e.slice(l,n),0===l&&(t=t.replace(o.leftSp,"")),t&&a.push({expr:t}),l=n+i.openTag.length,n=e.indexOf(i.closeTag,l),-1===n)break;t=e.slice(l,n),t&&a.push({expr:t.replace(r,""),type:"{{}}"}),l=n+avalon.config.closeTag.length}t=e.slice(l);var s=t.replace(o.rightSp,"");return s&&a.push({expr:s.replace(/^\s+$/," ")}),a}var r=/\r?\n/g,o=n(45),i=avalon.config;e.exports=a},function(e,t){function n(e){return i.test(e)||r[e]?l(e):e}function a(e){var t=[];for(var a in e)if("props"===a){var r=[];for(var i in e.props){var s=e.props[i];"string"==typeof s&&(s=l(s)),r.push(n(i)+": "+s)}t.push("props: {"+r.join(",\n")+"}")}else if(e.hasOwnProperty(a)){var c=e[a];"string"==typeof c&&(c=o[a]?l(c):c),t.push(n(a)+":"+c)}return"{\n"+t.join(",\n")+"}"}var r=avalon.oneObject("break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile"),o={type:1,template:1,innerHTML:1,outerHTML:1,order:1,nodeValue:1,directive:1,signature:1,cid:1},i=/[W-]/,l=avalon.quote;e.exports=a},function(e,t,n){function a(e){return Object.keys(e).filter(function(t){return e[t]}).join(" ")}function r(e){var t=e.target;avalon(t).addClass(t.getAttribute(u[e.type])||"")}function o(e){var t=e.target,n=u[e.type];avalon(t).removeClass(t.getAttribute(n)||""),"change-active"!==n&&avalon(t).removeClass(t.getAttribute("change-active")||"")}function i(e,t){var n=e.getAttribute("old-change-class")||"",a=t["ms-class"];avalon(e).removeClass(n).addClass(a),e.setAttribute("old-change-class",a)}var l=n(6).getLongID,s=n(38),c=avalon.directives;avalon.directive("class",{diff:function(e,t,n,i){var l=i.slice(3),c=e[i],u=t[i];if(void 0===u&&(u=""),t.classEvent)e.classEvent=t.classEvent;else{var v={};"hover"===l?(v.mouseenter=r,v.mouseleave=o):"active"===l&&(e.props.tabindex=e.props.tabindex||-1,v.tabIndex=e.props.tabindex,v.mousedown=r,v.mouseup=o,v.mouseleave=o),e.classEvent=v}t.classEvent=null;var p=avalon.noop;Array.isArray(c)?p=c.map(function(e){return e&&"object"==typeof e?a(e):e?e:""}).join(" "):avalon.isObject(c)?p=a(c):c||0===c?p=String(c):c||(p=""),p=e[i]=p.trim().replace(/\s+/," "),u!==p&&(e["change-"+l]=p,s(e,this.update,n,l))},update:function(e,t){if(e&&1===e.nodeType){var n=t.classEvent;if(n){for(var a in n)"tabIndex"===a?e[a]=n[a]:avalon.bind(e,a,n[a]);t.classEvent={}}var r=["class","hover","active"];r.forEach(function(n){var a="change-"+n,r=t[a];if(void 0!==r)if("class"===n)e&&i(e,t);else{var o=e.getAttribute("change-"+n);o&&avalon(e).removeClass(o),e.setAttribute(a,r)}})}}}),c.active=c.hover=c["class"];var u={mouseenter:"change-hover",mouseleave:"change-hover",mousedown:"change-active",mouseup:"change-active"};l(r),l(o)},function(e,t,n){var a=n(6).getLongID,r=n(28),o=new r(128),i=(avalon.quote,n(38)),l=/^ms-on-([a-z]+)/,s=/\|.+/g,c=/((?:\@|\$|\#\#)?\w+)/g,u=n(45).string;avalon.directive("on",{priority:3e3,parse:function(e,t,n){var r=n.expr.replace(u," ").replace(s,"").match(c),i=r.every(function(e){return"@"===e.charAt(0)||"##"===e.slice(0,2)||"$event"===e});if(e.vmodel="__vmodel__",i){var l=n.expr,v=o.get(l);if(v)p=v.uuid;else{var v=Function("return "+avalon.parseExpr(n,"on"))(),p=a(v);o.put(l,v)}avalon.eventListeners[p]=v,e[n.name]="avalon.eventListeners."+p}else e[n.name]=avalon.parseExpr(n,"on")},diff:function(e,t,n,r){var o=e[r],s=t[r];if(o!==s){if("function"==typeof s&&"function"==typeof o){var c=s.uuid;return o.uuid=c,void(avalon.eventListeners[c]=o)}var u=r.match(l),v=u[1],p=v+":"+a(o);e.addEvents=e.addEvents||{},e.addEvents[p]=o,i(e,this.update,n,"on")}},update:function(e,t){if(e&&!(e.nodeType>1)){var n,a,r;e._ms_context_=t.vmodel;for(n in t.addEvents)a=n.split(":").shift(),r=t.addEvents[n],avalon.bind(e,a,r);delete t.addEvents}}})},,function(e,t){function n(e,t){var n=[];e.children.forEach(function(e){"option"===e.type?n.push(e):"optgroup"===e.type&&e.children.forEach(function(e){"option"===e.type&&n.push(e)})});var a=e.props.multiple,r={},o=null===a||void 0===a||a===!1;Array.isArray(t)?t.forEach(function(e){r[e]=1}):r[t]=1;for(var i,l=0;i=n[l++];){var s="value"in i.props?i.props.value:(i.children[0]||{nodeValue:""}).nodeValue.trim();if(i.props.selected=!!r[s],r[s]&&o)break}}e.exports=n},,function(e,t,n){
function a(){var e=this,t=this.__ms_duplex__;if(!e.composing&&e.value!==t.lastViewValue){if(e.caret)try{var n=t.getCaret(e);n.start!==n.end&&n.start+1!==n.end||(t.caretPos=n)}catch(a){avalon.warn("fixCaret error",a)}if(t.debounceTime>4){var o=new Date,i=o-t.time||0;t.time=o,i>=t.debounceTime?r[t.type].call(t):(clearTimeout(t.debounceID),t.debounceID=setTimeout(function(){r[t.type].call(t)},i))}else r[t.type].call(t)}}var r=n(59);e.exports=a},function(e,t){function n(e){e.validator&&avalon.directives.validate.validate(e,!1),e.callback&&e.callback.call(e.vmodel,{type:"changed",target:e.element})}var a={input:function(e){var t=this;e=e||"value";var a=t.element[e],r=t.format(t.vmodel,a);r!==a&&(t.formatedValue=r,t.element[e]=r);var o=t.parse(r);o!==t.modelValue&&(t.set(t.vmodel,o),n(t))},radio:function(){var e=this;if(e.isChecked){var t=e.modelValue=!e.modelValue;e.set(e.vmodel,t),n(e)}else a.input.call(e)},checkbox:function(){var e=this,t=e.modelValue;Array.isArray(t)||(avalon.warn("ms-duplex应用于checkbox上要对应一个数组"),t=[t]);var a=e.element.checked?"ensure":"remove";if(t[a]){var r=e.parse(e.element.value);t[a](r),n(e)}},select:function(){var e=this,t=avalon(e.element).val();t+""!=this.modelValue+""&&(t=Array.isArray(t)?t.map(function(t){return e.parse(t)}):e.parse(t),e.modelValue=t,e.set(e.vmodel,t),n(e))},contenteditable:function(){a.input.call(this,"innerHTML")}};e.exports=a},function(e,t){function n(e){r[this.tagName].call(this,e),!this.caret&&this._ms_field_&&this._ms_field_.update.call(this)}var a=!1;try{var r={},o=HTMLInputElement.prototype,i=HTMLTextAreaElement.prototype,l=HTMLInputElement.prototype;Object.getOwnPropertyNames(l),r.INPUT=Object.getOwnPropertyDescriptor(o,"value").set,Object.defineProperty(o,"value",{set:n}),r.TEXTAREA=Object.getOwnPropertyDescriptor(i,"value").set,Object.defineProperty(i,"value",{set:n}),a=!0}catch(s){}e.exports=a},,function(e,t){e.exports=function(e,t){var n=e.__ms_duplex__,a=t["ms-rules"];if(a&&!n.validator)for(;e&&1===e.nodeType;){var r=e._ms_validator_;if(r){n.rules=a,n.validator=r,avalon.Array.ensure(r.fields,n)&&r.addField(n);break}e=e.parentNode}}},function(e,t,n){function a(){var e=this.data||{};return this.message.replace(i,function(t,n){return null==e[n]?"":e[n]})}var r=n(38),o=avalon.directive("validate",{diff:function(e,t,n,a){var i=e[a],l=t[a];if(l&&l.onError&&l.addField)e[a]=l;else if(Object(i)===i){i.$id&&(i=i.$model),e[a]=i;for(var a in o.defaults)i[a]||(i[a]=o.defaults[a]);i.fields=i.fields||[],r(e,this.update,n,"validate")}},update:function(e,t){var n=t["ms-validate"];e._ms_validator_=n,n.element=e,e.setAttribute("novalidate","novalidate"),n.validateAllInSubmit&&avalon.bind(e,"submit",function(e){e.preventDefault(),o.validateAll.call(n,n.onValidateAll)}),"function"==typeof n.onInit&&n.onInit.call(e)},validateAll:function(e){var t=this,n="function"==typeof e?e:t.onValidateAll,a=t.fields.filter(function(e){var n=e.element;return n&&!n.disabled&&t.element.contains(n)}).map(function(e){return o.validate(e,!0)}),r=[];Promise.all(a).then(function(e){for(var a,o=0;a=e[o++];)r=r.concat(a);if(t.deduplicateInValidateAll){var i={};r=r.filter(function(e){var t=e.element,n=t.uniqueID||(t.uniqueID=setTimeout("1"));return i[n]?!1:(i[n]=!0,!0)})}n.call(t.element,r)})},addField:function(e){var t=this,n=e.element;!t.validateInKeyup||e.isChanged||e.debounceTime||avalon.bind(n,"keyup",function(t){o.validate(e,0,t)}),t.validateInBlur&&avalon.bind(n,"blur",function(t){o.validate(e,0,t)}),t.resetInFocus&&avalon.bind(n,"focus",function(a){t.onReset.call(n,a,e)})},validate:function(e,t,n){var r=[],o=e.modelValue,i=e.element,l=e.validator;if(!i.disabled){for(var s in e.rules){var c=e.rules[s];if(c!==!1){var u,v,p=avalon.validators[s];r.push(new Promise(function(e,t){u=e,v=t}));var d=function(t){if(e.norequired&&""===o&&(t=!0),t)u(!0);else{var n={element:i,data:e.data,message:i.getAttribute("data-"+s+"-message")||i.getAttribute("data-message")||p.message,validateRule:s,getMessage:a};u(n)}};e.data={},e.data[s]=c,p.get(o,e,d)}}var f=[],h=Promise.all(r).then(function(e){for(var a,r=0;a=e[r++];)"object"==typeof a&&f.push(a);return t||(f.length?l.onError.call(i,f,n):l.onSuccess.call(i,f,n),l.onComplete.call(i,f,n)),f});return h}}}),i=/\\?{{([^{}]+)\}}/gm;o.defaults={addField:o.addField,onError:avalon.noop,onSuccess:avalon.noop,onComplete:avalon.noop,onReset:avalon.noop,validateInBlur:!0,validateInKeyup:!0,validateAllInSubmit:!0,resetInFocus:!0,deduplicateInValidateAll:!1}},function(e,t){function n(e){return"regexp"===avalon.type(e)}function a(e){if("string"==typeof e&&e){var t=e.split("-");if(3===t.length&&4===t[0].length){var n=~~t[0],a=~~t[1]-1,r=~~t[2],o=new Date(n,a,r);return o.getFullYear()===n&&o.getMonth()===a&&o.getDate()===r}}return!1}avalon.directive("rules",{parse:function(e,t,n){var a=n.expr;/{.+}/.test(a)&&(e[n.name]=avalon.parseExpr(n))},diff:avalon.noop});var r=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i,o=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;avalon.shadowCopy(avalon.validators,{pattern:{message:"必须匹配{{pattern}}这样的格式",get:function(e,t,a){var r=t.element,o=t.data;if(!n(o.pattern)){var i=r.getAttribute("pattern");o.pattern=new RegExp("^(?:"+i+")$")}return a(o.pattern.test(e)),e}},digits:{message:"必须整数",get:function(e,t,n){return n(/^\-?\d+$/.test(e)),e}},number:{message:"必须数字",get:function(e,t,n){return n(isFinite(e)),e}},required:{message:"必须填写",get:function(e,t,n){return n(""!==e),e}},equalto:{message:"密码输入不一致",get:function(e,t,n){var a=String(t.data.equalto),r=avalon(document.getElementById(a)).val()||"";return n(e===r),e}},date:{message:"日期格式不正确",get:function(e,t,n){var r=t.data;return n("regexp"===avalon.type(r.date)?r.date.test(e):a(e)),e}},url:{message:"URL格式不正确",get:function(e,t,n){return n(o.test(e)),e}},email:{message:"email格式不正确",get:function(e,t,n){return n(r.test(e)),e}},minlength:{message:"最少输入{{minlength}}个字",get:function(e,t,n){var a=parseInt(t.data.minlength,10);return n(e.length>=a),e}},maxlength:{message:"最多输入{{maxlength}}个字",get:function(e,t,n){var a=parseInt(t.data.maxlength,10);return n(e.length<=a),e}},min:{message:"输入值不能小于{{min}}",get:function(e,t,n){var a=parseInt(t.data.min,10);return n(parseFloat(e)>=a),e}},max:{message:"输入值不能大于{{max}}",get:function(e,t,n){var a=parseInt(t.data.max,10);return n(parseFloat(e)<=a),e}},chs:{message:"必须是中文字符",get:function(e,t,n){return n(/^[\u4e00-\u9fa5]+$/.test(e)),e}}})},function(e,t,n){var a=n(66),r=n(38);avalon.directive("if",{priority:6,parse:function(e,t,n){t.$prepend=(t.$prepend||"")+"var varIf = "+avalon.parseExpr(n)+"\nif(varIf){\n";var a=t.$append||"";t.$append='}else{\n\nvnodes.push({\nnodeType: 8,\ndirective:"if",\ntype: "#comment",\nnodeValue:"ms-if"\n})\n}'+a},diff:function(e,t,n){e.dom=t.dom,e.nodeType!==t.nodeType&&(e.steps=n,8===e.nodeType&&(e["ms-effect"]=t["ms-effect"]),r(e,this.update,n,"if"))},update:function(e,t,n){var r=e.nodeType,o=t.nodeType;if(r!==o){if(1===o){var i=t.dom;if(!i){i=avalon.vdomAdaptor(t,"toDOM"),t.dom=i;for(var l in t)if(0===l.indexOf("ms-on")){var s=t[l];"function"==typeof s&&(i._ms_context_=t.vmodel,avalon.bind(i,l.split("-")[2],s))}}return n.replaceChild(i,e),t.steps.count&&a([i],[t],n,t.steps),avalon.applyEffect(e,t,{hook:"onEnterDone"}),t.steps=!1}8===o&&avalon.applyEffect(e,t,{hook:"onLeaveDone",cb:function(){var a=e._ms_if_||(e._ms_if_=document.createComment(t.nodeValue));delete t["ms-effect"],n.replaceChild(a,e)}})}}})},function(e,t){function n(e,t,i,l){var s=e[0];if((s||i)&&l.count){i=i||s.parentNode;for(var c=0,u=t.length;u>c;c++){var v=t[c],p=s;if(!(avalon.msie<9&&!v.fixIESkip&&3===v.nodeType&&o.test(v.nodeValue))){if(p&&(s=p.nextSibling),"for"===v.directive&&v.forDiff){if(!p)return;if(1===p.nodeType){var d=document.createComment(v.nodeValue);i.insertBefore(d,p),v.endRepeat=document.createComment("ms-for-end:"),i.insertBefore(v.endRepeat,p.nextSibling),p=d}else v.endRepeat||(v.endRepeat=a(p));8!==p.nodeType&&(p=p.nextSibling),s=v.endRepeat.nextSibling}if(!1!==r(p,v,i,l,"change")){!v.skipContent&&v.children&&p&&1===p.nodeType&&n(avalon.slice(p.childNodes),v.children,p,l);var f=v.props&&v.props["ms-controller"];if(f&&p){var h=avalon.vmodels[f];h.$render&&(h.$render.dom=p)}if(r(p,v,i,l,"afterChange"),!l.count)break}else"number"==typeof v.repeatCount&&(c+=v.repeatCount+1),r(p,v,i,l,"afterChange")}}}}function a(e){for(var e,t=0,n=[];e&&(8===e.nodeType&&(0===e.nodeValue.indexOf("ms-for:")?++t:0===e.nodeValue.indexOf("ms-for-end:")&&--t),n.push(e),e=e.nextSibling,0!==t););return n.pop()}function r(e,t,n,a,r){var o=t[r];if(o){for(var i;i=o.shift();)if(a.count-=1,!1===i(e,t,n))return!1;delete t[r]}}var o=/^\s*$/;e.exports=n},function(e,t,n){function a(e){var t=typeof e;return e&&"object"===t?e.$hashcode:t+":"+e}function r(e,t){for(var n,a=t.signature,r=[],o=[],i={children:[]},l=0;n=e[l];l++)8===n.nodeType&&n.nodeValue===a?(i.children.push(n),i.key=n.key,o.push(n.key),i.index=r.length,r.push(i),i={children:[]}):i.children.push(n);t.components=r,t.compareText=o.length+"|"+o.join(";;")}function o(e,t,n){for(var a=[],r=[],o=[],i=e;i&&i!==t;i=i.nextSibling)r.push(i),8===i.nodeType&&i.nodeValue===n?(o.push(i),a.push(o),o=[]):o.push(i);return a.all=r,a}function i(e,t){for(var n,a=0,r=[];(n=e[t++])&&("#comment"===n.type&&(0===n.nodeValue.indexOf("ms-for:")?a++:0===n.nodeValue.indexOf("ms-for-end:")&&a--),r.push(n),0!==a););return r}function l(e){for(var t,n=0;t=e[n++];)t.dom&&(t.dom=null),t.children&&l(t.children)}function s(e,t){var n=t.match(b);if(n){var a=n[1];for(var r in e){var o=r.match(w);if(o&&o[1]===a)return c(e,r)}}}function c(e,t){var n=e[t],a=t;if(n){var r=e["***"+t];if(r){var o=r.pop();return delete e[o.id],0==r.length&&delete e["***"+t],o.c}for(var i=[{id:t,c:n}];;){if(t+="_",!e[t])break;i.push({id:t,c:e[t]})}var o=i.pop();return delete e[o.id],i.length&&(e["***"+a]=i),o.c}return n}function u(e,t){var n=t.key;if(e[n]){for(;;)if(n+="_",!e[n]){e[n]=t;break}}else e[n]=t}var v=n(66),p=/ms-for\:\s*/,d=/^\s*\(\s*/,f=/\s*\)\s*$/,h=/\s*,\s*/,m=/\s+as\s+([$\w]+)/,y=n(45).ident,g=n(38),_=/^(null|undefined|NaN|window|this|\$index|\$id)$/;avalon._each=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++){var r=e[n],o=a(r);t(n,r,o)}else for(var n in e)e.hasOwnProperty(n)&&t(n,e[n],n)},avalon.directive("for",{priority:3,parse:function(e,t,n){var a,r=t.nodeValue;r=r.replace(m,function(e,t){return!y.test(t)||_.test(t)?avalon.error("alias "+t+" is invalid --- must be a valid JS identifier which is not a reserved name."):a=t,""});var o=r.replace(p,"").split(" in "),i="var loop = "+avalon.parseExpr(o[1])+" \n",l="var "+t.signature+" = vnodes[vnodes.length-1]\n",s=a?"var "+a+" = loop\n":"",c=o[0].replace(d,"").replace(f,"").split(h);1===c.length&&c.unshift("$key"),c.push("traceKey");var u=avalon.quote,v=[u(c[0])+":"+c[0],u(c[1])+":"+c[1]];a&&v.push(u(a)+":loop");var g="{"+v.join(",\n")+"}";t.$append=i+l+s+"avalon._each(loop,function("+c.join(", ")+"){\n__local__ = avalon.mix(__local__, "+g+")\n"},diff:function(e,t,n,a){var o=e[a],v=t[a]||{},p=e.slice(a,o.end);if(o.items=p.slice(1,-1),r(o.items,o),delete v.forDiff,o.compareText===v.compareText)return void avalon.shadowCopy(o,v);o.forDiff=!0;var d,f,h,m=!("items"in v);if(m){var y=i(t,a);v.items=y.slice(1,-1),v.components=[],v.repeatCount=v.items.length}var _=v.components.length;o.endRepeat=v.endRepeat;var b=Math.max(p.length-2,0)-v.repeatCount;if(b>0){for(var w=[a+1,0],d=0;b>d;d++)w.push(null);t.splice.apply(t,w)}else 0>b&&t.splice.apply(t,[a,Math.abs(b)]);if(o.action=m?"init":"update",m){var x=o.cache={};for(d=0;f=o.components[d];d++)u(x,f),f.action="enter",o.fixAction&&(f.action="move",f.domIndex=d);o.removedComponents={}}else{var x=v.cache;if(!x)return;var T=o.cache={};for(d=0;f=o.components[d];d++){var h=c(x,f.key);h?_--:_&&(h=s(x,f.key),h&&_--),f.action=h?"move":"enter",h&&(l(h.children),f.domIndex=h.index),u(T,f)}for(d in x){o.removedComponents=x;break}}return v.components.length=0,o.prevItems=v.items,o.steps=n,delete v.cache,delete v.items,g(o,this.update,n,"for"),a+p.length-1},update:function(e,t,n){var a=t.endRepeat,r=t.signature,i=o(e.nextSibling,a,r);0===i.length&&i.all.forEach(function(e){n.removeChild(e)});var l=avalon.avalonFragment,s=avalon.parseHTML(t.template);for(var c in t.removedComponents){var u=t.removedComponents[c],p=i[u.index];p&&(p.forEach(function(e,t){e.parentNode&&avalon.applyEffect(e,u.children[t],{hook:"onLeaveDone",cb:function(){e.parentNode.removeChild(e)},staggerKey:r+"leave"})}),u.children.length=0)}delete t.removedComponents;for(var d=e,f=[],c=0;c<t.components.length;c++){var h=t.components[c];if("enter"===h.action){var m=s.cloneNode(!0);m.appendChild(document.createComment(t.signature));var y=avalon.slice(m.childNodes);n.insertBefore(m,d.nextSibling),x(y,h.children,{hook:"onEnterDone",staggerKey:r+"enter"})}else if("move"===h.action){for(var g,_=l.cloneNode(!1),y=i[h.domIndex]||[],b=0;g=y[b++];)_.appendChild(g);n.insertBefore(_,d.nextSibling),x(y,h.children,{hook:"onMoveDone",staggerKey:r+"move"})}if(f.push.apply(f,y),d=y[y.length-1],!d)break}var w=t.items,T=t.steps,$=T.count;t.repeatCount=w.length,avalon.diff(w,t.prevItems,T),T.count!==$&&v(f,w,n,T);var C=avalon.caches[t.cid];return C&&C.call(t.vmodel,{type:"rendered",target:e,endRepeat:a,signature:t.signature}),!1}});var b=/^(string|number|boolean)/,w=/^_*(string|number|boolean)/,x=function(e,t,n){t.forEach(function(a,r){avalon.applyEffect(e[r],t[r],n)})}},,,function(e,t,n){function a(e,t){for(var n in e)if(e[n]!==t[n])return!0;return!1}function r(){if(!p.lock){var e=p[0];e&&(r.lock=!0,e())}}function o(e){var t=f.test(e)?1e3:1;return parseFloat(e)*t}function i(e,t,n){var a=e[t];a=Array.isArray(a)?a:"function"==typeof a?[a]:[],a.forEach(function(e){e&&e(n)})}function l(e){var t=e.toLowerCase();return function(n){var a,l=this.el,s=avalon(l),u=isFinite(n.stagger)?1e3*n.stagger:0;if(u&&n.staggerKey){var v=h.get(n.staggerKey)||h.put(n.staggerKey,{count:0,items:0});v.count++,v.items++}var d=v&&v.count||0,f=function(t){var o=t!==!1;l.animating=void 0,a=!0;var s=o?"Done":"Abort";i(n,"on"+e+s,l),avalon.unbind(l,c.transitionEndEvent),avalon.unbind(l,c.animationEndEvent),v&&0===--v.items&&(v.count=0),n.queue&&(p.lock=!1,p.shift(),r())};i(n,"onBefore"+e,l),n[t]?n[t](l,function(e){f(e!==!1)}):c.css&&(s.addClass(n[t+"Class"]),"leave"===t?s.removeClass(n.enterClass+" "+n.enterActiveClass):"enter"===t&&s.removeClass(n.leaveClass+" "+n.leaveActiveClass),s.bind(c.transitionEndEvent,f),s.bind(c.animationEndEvent,f),setTimeout(function(){a=NaN===avalon.root.offsetWidth,s.addClass(n[t+"ActiveClass"]);var e=window.getComputedStyle(l),r=e[c.transitionDuration],i=e[c.animationDuration],v=o(r)||o(i);0===!v?f(!1):u||setTimeout(function(){a||f(!1)},v+130)},17+u*d))}}function s(e){e.acton||(e.action=e.hook.replace(/^on/,"").replace(/Done$/,"").toLowerCase())}var c=n(71),u=n(28),v=n(38);avalon.directive("effect",{priority:5,diff:function(e,t,n,r){var o=e[r];if("string"==typeof o){var i=o;o=e[r]={is:i}}else Array.isArray(o)&&(o=e[r]=avalon.mix.apply({},o));if(o.action=o.action||"enter",Object(o)===o){var l=t[r];(Object(l)!==l||a(o,l))&&v(e,this.update,n,"effect","afterChange")}},update:function(e,t,n,a){if(!e.animating){e.animating=!0;var o=t["ms-effect"],i=o.is;if(a=a||{},!i)return avalon.warn("need is option");var l=avalon.effects;c.css&&!l[i]&&avalon.effect(i,{});var s=l[i];if(!s)return avalon.warn(i+" effect is undefined");var u=a.action||o.action,v=avalon.Effect;if("function"!=typeof v.prototype[u])return avalon.warn(u+" action is undefined");var d=new v(e),f=avalon.mix(a,s,o);f.queue?(p.push(function(){d[u](f)}),r()):setTimeout(function(){d[u](f)},4)}}});var p=[];avalon.effects={},avalon.effect=function(e,t){avalon.effects[e]=t||{},c.css&&(t.enterClass||(t.enterClass=e+"-enter"),t.enterActiveClass||(t.enterActiveClass=t.enterClass+"-active"),t.leaveClass||(t.leaveClass=e+"-leave"),t.leaveActiveClass||(t.leaveActiveClass=t.leaveClass+"-active")),t.action||(t.action="enter")};var d=function(e){this.el=e};avalon.Effect=d,d.prototype={enter:l("Enter"),leave:l("Leave"),move:l("Move")};var f=/\d+s$/,h=new u(128);avalon.applyEffect=function(e,t,n){var a=n.cb,r=n.hook,o=t["ms-effect"];if(o&&!avalon.document.hidden){var i=o[r];a&&(Array.isArray(i)?i.push(a):i?o[r]=[i,a]:o[r]=[a]),s(n),e.animate=!0,avalon.directives.effect.update(e,t,0,avalon.shadowCopy({},n))}else a&&a()}},function(e,t){var n,a,r,o=!1,i=!1,l=!1,s=avalon.cssName("transition-duration"),c=avalon.cssName("animation-duration"),u={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"},v=avalon.window;for(var p in u){if(v[p]){r=u[p];break}try{document.createEvent(p);r=u[p];break}catch(d){}}"string"==typeof r&&(o=!0,l=!0,n=r),u={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};var f;for(p in u)if(v[p]){f=u[p];break}"string"==typeof f&&(i=!0,l=!0,a=f),e.exports={transition:o,animation:i,css:l,transitionEndEvent:n,animationEndEvent:a,transitionDuration:s,animationDuration:c}},function(e,t,n){function a(e,t){var n=Array.isArray(e)?r(e):e,a=[];if(t)for(var o in t)a.push("var "+o+" = __local__["+avalon.quote(o)+"]");var i="__local__ = __local__ || {};\nvar __present__, __top__,__synth__;\n"+a.join(";\n")+n,l=Function("__vmodel__","__local__",i);return l}avalon.lexer=n(73),avalon.diff=n(74),avalon.batch=n(75);var r=n(47);avalon.render=a,e.exports=avalon},function(e,t,n){function a(e){var t="??"+j++;return M[t]=e,t}function r(e){var t=M[e];return t}function o(e){return S.test(e)?e.replace(V,"").replace(k,a):e}function i(e,t,n){var i=[];if(n=n||1,"number"!=typeof t?t=0:t+=1,t>=n&&!O.rbind.test(e))return i;for(t||(e=e.replace(k,a));;){var u="",p=!1,f=e.match(_);if(f&&(u=f[0],p=new h(u.replace(E,r))),!p&&(f=e.match(b))){u=f[0],p=new m(f[1].replace(E,r));var w=p.nodeValue;if(T.test(w)){var $=i[i.length-1];$&&3===$.nodeType&&C.test($.nodeValue)&&i.pop(),l(i)}}if(!p&&(f=e.match(y))){u=f[0];var j=f[1].toLowerCase();u=s(u,j),f=u.match(g);var S={};f[2]&&v(o(f[2]),S);var V=u.slice(f[0].length,-1*(j.length+3));p={nodeType:1,type:j,props:S,template:V.replace(E,r).trim(),children:[]},p=c(p,V,i,t,n)}if(p||(f=e.match(g),f&&(u=f[0],j=f[1].toLowerCase(),S={},f[2]&&v(o(f[2]),S),p={nodeType:1,type:j,props:S,template:"",children:[],isVoidTag:!0},p=c(p,"",i,t,n))),!p)break;i.push(p),e=e.slice(u.length),8===p.nodeType&&x.test(p.nodeValue)&&(p.signature=d("for"),e=e.replace(A,""))}return t||(M={}),i}function l(e){for(var t,n=1,a=e.length,r=[];(t=e[--a])&&(8!==t.nodeType||(x.test(t.nodeValue)?n-=1:T.test(t.nodeValue)&&(n+=1),0!==n));)r.push(avalon.vdomAdaptor(t,"toHTML"));return t.template=r.reverse().join("")}function s(e,t){var n=[],a=[],r=N[t+"open"]||(N[t+"open"]=new RegExp("<"+t+D,H)),o=N[t+"close"]||(N[t+"close"]=new RegExp("</"+t+">",H));e.replace(r,function(e,t){return n.push(("0000000000"+t+"<").slice(-10)),e.replace(L,"1")}).replace(o,function(e,t){a.push(("0000000000"+t+">").slice(-10))});for(var i=n.concat(a).sort(),l=i.join("").replace(w,""),s=0,c=0,u=0,v=l.length;v>u;u++){var p=l.charAt(u);if("<"===p?s+=1:s-=1,0===s){c=u;break}}var d=parseFloat(i[c])+t.length+3;return e.slice(0,d)}function c(e,t,n,a,r){var o=e.type;if("ms-skip"in e.props)e.skipContent=!0;else{switch(o){case"style":case"script":case"noscript":case"template":case"textarea":e.skipContent=!0,"textarea"===o&&(e.props.type="textarea");break;case"input":e.props.type||(e.props.type="text");break;case"select":e.props.hasOwnProperty("multiple")&&(e.props.multiple="multiple",e.multiple=!0);break;case"xmp":e.children.push(new h(e.template));break;case"option":e.children.push(new h(p(e.template)))}if(!e.isVoidTag){var l=i(t,a,r);e.children=l,"table"===o&&u(e.children)}var s=e.props["ms-for"];if(s){var c=e.props["data-for-rendered"],v=c+":cb";return delete e.props["ms-for"],n.push({nodeType:8,type:"#comment",nodeValue:"ms-for:"+s,signature:d("for"),cid:v,template:avalon.vdomAdaptor(e,"toHTML")}),c&&!avalon.caches[v]&&(avalon.caches[v]=Function("return "+avalon.parseExpr(c,"on"))()),n.push(e),{nodeType:8,skipContent:!0,type:"#comment",nodeValue:"ms-for-end:"}}}return e}function u(e){for(var t,n=!1,a=0,r=0,o=e.length,i=0;o>i;i++){var l=e[i];t?"tr"!==l.type&&1===l.nodeType?t=!1:(t.children.push(l),a++,e[i]=0):"tr"===l.type&&(t={nodeType:1,type:"tbody",template:"",children:[],props:{}},t.children.push(l),n=!0,0===r&&(r=i),e[i]=t)}if(n)for(i=r;o>i&&(0!==e[i]||(e.splice(i,1),i--,a--,0!==a));i++);}function v(e,t){e.replace(R,"=").replace(P,function(e){var n=e.split("="),a=n[1]||"",o=n[0].toLowerCase();2===n.length&&0===a.indexOf("??")&&(a=a.replace(E,r).slice(1,-1).replace(F,"&").replace(I,'"')),t[o]=a})}function p(e){return String(e).replace(B,"").trim()}var d=avalon.makeHashCode,f=n(15),h=f.VText,m=f.VComment,y=/^<([^\s>\/=.$<]+)(?:\s+[^=\s]+(?:=[^>\s]+)?)*\s*>(?:[\s\S]*)<\/\1>/,g=/^<([^\s>\/=.$<]+)\s*([^>]*?)\/?>/,_=/^[^<]+/,b=/^<!--([\w\W]*?)-->/,w=/\d+/g,x=/^\s*ms-for\:/,T=/^\s*ms-for-end\:/,$=n(45),C=$.sp,E=/\?\?\d+/g,A=$.leftSp,k=$.string,O=avalon.config,M={},j=1,S=/=["']/,V=/\n\s*/g,D="(?:\\s+[^>=]*?(?:=[^>]+?)?)*>",N={},L=/./g,H=avalon.msie<9?"ig":"g",F=/&/g,P=/\S+/g,I=/"/g,R=/\s*=\s*/g,B=/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi;e.exports=i},function(e,t,n){function a(e,t,n){if(e)for(var s=0;s<e.length;s++){var c=e[s],u=t[s]||i();switch(c.nodeType){case 3:c.skipContent||l.expr.diff(c,u,n);break;case 8:if("for"===c.directive){var v=l["for"].diff(e,t,n,s);"number"==typeof v&&(s=v)}else c.directive&&l[c.directive].diff(c,u,n);break;default:c.skipAttrs||r(c,u,n),c.skipContent||a(c.children,u.children||o,n)}}}function r(e,t,n){if(e.order){var a;try{e.order.replace(/([^;]+)/g,function(r){var o=r.match(s),c=o&&o[1];return a=c,l[c]&&l[c].diff(e,t||i(),n,r),r})}catch(r){avalon.log(a,r,r.message,"diffProps error")}}}var o=[],i=function(){return{children:[],props:{}}},l=avalon.directives,s=n(45).binding;avalon.diffProps=r,e.exports=a},function(e,t,n){function a(e){if(i)return avalon.Array.ensure(o,e);i=e;var t=avalon.scopes[e];if(!t||!document.nodeName)return i=null;var n=t.dom,l={count:0},s=t.render(t.synth||t.vmodel,t.local);avalon.diff(s,n.vtree||[],l),r([n],s,null,l),l.count=0,n.vtree=s,i=null;var c=o.indexOf(e);if(c>-1){var u=o.splice(c,1);return a(u[0])}var e=o.shift();e&&a(e)}var r=n(66),o=[],i=!1;avalon.suspendUpdate=0,e.exports=avalon.batch=a},,function(e,t){e.exports=avalon.oneObject("$id,$render,$track,$element,$watch,$fire,$events,$model,$skipArray,$accessors,$hashcode,__proxy__,__data__,__const__")},,,function(e,t,n){function a(e,t){t.__vmodel__=e;var n=p.hideProperty;n(e,"$events",t),n(e,"$watch",function(){if(2===arguments.length)return m.apply(e,arguments);throw"$watch方法参数不对"}),n(e,"$fire",function(t,n,a){var r=e.$events[t];h(r,e,t,n,a)})}function r(e,t,n){return"$"===e.charAt(0)||n[e]||"function"==typeof t||t&&t.nodeName&&t.nodeType>0}function o(e,t,n,a){if(Array.isArray(e))return p.arrayFactory(e,t,n,a);if(Object(e)===e&&"function"!=typeof e){if(t&&t.$id){if(++avalon.suspendUpdate,t.$track!==Object.keys(e).sort().join(";;"))var r=p.slaveFactory(t,e,n,a);else r=t;for(var o in e)d[o]||(r[o]=e[o]);return--avalon.suspendUpdate,r}return r=p.masterFactory(e,n,a)}return e}function i(e,t,n){function a(){return r}var r=NaN;return a.heirloom=n,{get:a,set:function(o){if(r!==o){o&&"object"==typeof o&&(o=p.modelAdaptor(o,r,n,{pathname:t,id:e}));var i=r;r=o;var u=n.__vmodel__;if(this.$hashcode&&u&&!avalon.suspendUpdate){n!==u.$events&&(a.heirloom=u.$events),s(a.$decompose,t,o,i),-1===t.indexOf("*")&&h(a.heirloom[t],u,t,o,i),l(e,u,t,o,i),c(a.heirloom,u,t,o,i),avalon.rerenderStart=new Date;var v=u.$id.indexOf(".");v>0?avalon.batch(u.$id.slice(0,v),!0):avalon.batch(u.$id,!0)}}},enumerable:!0,configurable:!0}}function l(e,t,n,a,r){if(e.indexOf(".*.")>0){var o=e.match(y),i=avalon.vmodels[o[1]];if(i){var l=o[2];h(i.$events[l],t,n,a,r)}}}function s(e,t,n,a){if(e&&e[t]){var r=e[t];if(r.$hashcode){var o=t.replace(/^[^.]+\./,"");o!==t&&h(r.$events[o],r,o,n,a)}else delete e[t]}}function c(e,t,n,a,r){e.__fuzzy__&&e.__fuzzy__.replace(avalon.rword,function(o){var i=e[o],l=i.reg;return l&&l.test(n)&&h(i,t,n,a,r),o})}function u(e){var t=e.$id;if(!t&&avalon.config.debug&&avalon.warn("vm.$id must be specified"),avalon.vmodels[t])throw Error("error:["+t+"] had defined!");var n=p.masterFactory(e,{},{pathname:"",id:t,master:!0});return avalon.vmodels[t]=n}function v(e,t,n,a){if(t&&t.splice){var r=[0,t.length].concat(e);return++avalon.suspendUpdate,t.splice.apply(t,r),--avalon.suspendUpdate,t}for(var i in g)e[i]=g[i];e.notify=function(e,t,r,o){var i=n.__vmodel__;if(i){var l=null===e||void 0===e?a.pathname:a.pathname+"."+e;i.$fire(l,t,r),o||avalon.suspendUpdate||(avalon.rerenderStart=new Date,avalon.batch(i.$id,!0))}};var l=avalon.makeHashCode("$");a.array=!0,a.hashcode=l,a.id=a.id||l,p.initViewModel(e,n,{},{},a);for(var s=0,c=e.length;c>s;s++)e[s]=o(e[s],0,{},{id:e.$id+".*",master:!0});return e}var p={},d=n(77),f=n(81),h=f.$emit,m=f.$watch;p.modelAdaptor=o;var y=/([^.]+)\.(.+)/;p.arrayFactory=v;var g={set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");this.splice(e,1,t)}},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return this.contains(e)||this.push(e),this},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},clear:function(){return this.removeAll(),this}};avalon.define=u,e.exports={$$midway:p,$$skipArray:d,isSkip:r,__array__:g,initEvents:a,makeAccessor:i,modelAdaptor:o}},function(e,t){function n(e,t){var n,a=t.split(".")[0];try{e.hasOwnProperty(a)&&(n=e.$accessors?e.$accessors[a].get.heirloom.__vmodel__:Object.getOwnPropertyDescriptor(e,a).get.heirloom.__vmodel__)}catch(r){}return n||e}function a(e){var t=e.split(".");return new RegExp("^"+t.map(function(e){return"*"===e?"(?:[^.]+)":e}).join("\\.")+"$","i")}function r(e,t,n){e&&(t.__fuzzy__?-1===t.__fuzzy__.indexOf(","+n)&&(t.__fuzzy__+=","+n):t.__fuzzy__=n)}function o(e,t){var n=e.indexOf(".*")>0||"*"===e,i=n?this:o.adjust(this,e),l=i.$events,s=l[e]||(l[e]=[]);return n&&(s.reg=s.reg||a(e)),r(n,l,e),i!==this&&(r(n,this.$events,e),this.$events[e]=s),avalon.Array.ensure(s,t),function(){avalon.Array.remove(s,t)}}function i(e,t,n,a,r,o){if(e&&e.length)try{for(o=o||e.length-1;o>=0;o--){var l=e[o];l.call(t,a,r,n)}}catch(s){o-1>0&&i(e,t,n,a,r,o-1),avalon.log(s,n)}}o.adjust=n,e.exports={$emit:i,$watch:o,adjustVm:n}},,,function(e,t,n){var a=n(3),r=n(4);a.shadowCopy(a,r),n(85),n(6),n(7),e.exports=a},function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.length,n=a.call(e);if(o.test(n))return!0;if("[object Object]"===n&&t===t>>>0)return!0}return!1}var a=avalon.inspect,r=/^\[object (?:Window|DOMWindow|global)\]$/,o=/(Array|List|Collection|Map|Arguments)\]$/;avalon.quote=JSON.stringify;var i={};"Boolean Number String Function Array Date RegExp Object Error".replace(avalon.rword,function(e){i["[object "+e+"]"]=e.toLowerCase()}),avalon.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?i[a.call(e)]||"object":typeof e},avalon.isFunction=function(e){return"function"==typeof e},avalon.isWindow=function(e){return r.test(a.call(e))},avalon.isPlainObject=function(e){return"[object Object]"===a.call(e)&&Object.getPrototypeOf(e)===Object.prototype},avalon.mix=avalon.fn.mix=function(){var e,t,n,a,r,o,i=arguments[0]||{},l=1,s=arguments.length,c=!1;for("boolean"==typeof i&&(c=i,i=arguments[1]||{},l++),"object"!=typeof i&&"function"!=typeof i&&(i={}),l===s&&(i=this,l--);s>l;l++)if(null!=(e=arguments[l]))for(t in e){n=i[t];try{a=e[t]}catch(u){continue}i!==a&&(c&&a&&(avalon.isPlainObject(a)||(r=Array.isArray(a)))?(r?(r=!1,o=n&&Array.isArray(n)?n:[]):o=n&&avalon.isPlainObject(n)?n:{},i[t]=avalon.mix(c,o,a)):void 0!==a&&(i[t]=a))}return i},avalon.each=function(e,t){if(e){var a=0;if(n(e))for(var r=e.length;r>a&&t(a,e[a])!==!1;a++);else for(a in e)if(e.hasOwnProperty(a)&&t(a,e[a])===!1)break}},e.exports={avalon:avalon,isArrayLike:n}},function(e,t,n){n(87),n(88),n(89),n(90),n(91),n(92),n(93),n(94),e.exports=avalon},function(e,t){function n(){return(new XMLSerializer).serializeToString(this)}function a(e,t){if(e&&e.childNodes)for(var n,o=e.childNodes,i=0;n=o[i++];)if(1===n.nodeType){var l=document.createElementNS(r,n.nodeName.toLowerCase());avalon.each(n.attributes,function(e,t){l.setAttribute(t.name,t.value)}),a(n,l),t.appendChild(l)}else t.appendChild(n.cloneNode(!0))}avalon.document.contains||(Node.prototype.contains=function(e){return!!(16&this.compareDocumentPosition(e))}),avalon.contains=function(e,t){try{for(;t=t.parentNode;)if(t===e)return!0;return!1}catch(n){return!1}};var r="http://www.w3.org/2000/svg",o=avalon.document.createElementNS(r,"svg");o.innerHTML='<circle fill="red" />',/^\[object SVG\w*Element\]$/.test(o.firstChild)||Object.defineProperties(SVGElement.prototype,{outerHTML:{configurable:!0,get:n,set:function(e){var t=this.tagName.toLowerCase(),n=this.parent,r=avalon.parseHTML(e);if("svg"===t)n.insertBefore(r,this);else{var o=document.createDocumentFragment();a(r,o),n.insertBefore(o,this)}n.removeChild(this)}},innerHTML:{configurable:!0,get:function(){var e=this.outerHTML,t=new RegExp("<"+this.nodeName+'\\b(?:(["\'])[^"]*?(\\1)|[^>])*>',"i"),n=new RegExp("</"+this.nodeName+">$","i");return e.replace(t,"").replace(n,"")},set:function(e){if(avalon.clearHTML){avalon.clearHTML(this);var t=avalon.parseHTML(e);a(t,this)}}}})},function(e,t){var n=/\S+/g;"add,remove".replace(avalon.rword,function(e){avalon.fn[e+"Class"]=function(t){var a=this[0]||{};return t&&"string"==typeof t&&1===a.nodeType&&t.replace(n,function(t){a.classList[e](t)}),this}}),avalon.fn.mix({hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&t.classList.contains(e)},toggleClass:function(e,t){var a="boolean"==typeof t,r=this;return String(e).replace(n,function(e){var n=a?t:!r.hasClass(e);r[n?"addClass":"removeClass"](e)}),this}})},function(e,t,n){function a(e,t){var n=t.changeAttr;if(n)for(var a in n){var i=n[a];if("src"===a&&window.chrome&&"EMBED"===e.tagName){e[a]=i;var l=e.parentNode,s=document.createComment("ms-src");l.replaceChild(s,e),l.replaceChild(e,s)}else if(0==a.indexOf("data-"))e.setAttribute(a,i);else{var c=r[a]||a;if("boolean"==typeof e[c]&&(e[c]=!!i),i===!1){e.removeAttribute(a);continue}var u=o.test(e)?!1:a in e.cloneNode(!1);u?e[c]=i+"":e.setAttribute(a,i)}}t.changeAttr=null}var r=n(23),o=/^\[object SVG\w*Element\]$/;avalon.parseJSON=JSON.parse,avalon.fn.attr=function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)},e.exports=a},function(e,t){function n(e,t){if(e.offsetWidth<=0){var a=getComputedStyle(e,null);if(u.test(a.display)){var r={node:e};for(var o in c)r[o]=a[o],e.style[o]=c[o];t.push(r)}var i=e.parentNode;i&&1===i.nodeType&&n(i,t)}}function a(e){return e.window||e.defaultView||!1}var r=avalon.root,o=avalon.camelize,i=avalon.cssHooks,l=["","-webkit-","-o-","-moz-","-ms-"],s={"float":"cssFloat"};avalon.cssNumber=avalon.oneObject("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom"),avalon.cssName=function(e,t,n){if(s[e])return s[e];t=t||r.style;for(var a=0,i=l.length;i>a;a++)if(n=o(l[a]+e),n in t)return s[e]=n;return null},avalon.fn.css=function(e,t){if(avalon.isPlainObject(e))for(var n in e)avalon.css(this,n,e[n]);else var a=avalon.css(this,e,t);return void 0!==a?a:this},avalon.fn.position=function(){var e,t,n=this[0],a={top:0,left:0};return n?("fixed"===this.css("position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(a=e.offset()),a.top+=avalon.css(e[0],"borderTopWidth",!0),a.left+=avalon.css(e[0],"borderLeftWidth",!0),a.top-=e.scrollTop(),a.left-=e.scrollLeft()),{top:t.top-a.top-avalon.css(n,"marginTop",!0),left:t.left-a.left-avalon.css(n,"marginLeft",!0)}):a},avalon.fn.offsetParent=function(){
for(var e=this[0].offsetParent;e&&"static"===avalon.css(e,"position");)e=e.offsetParent;return avalon(e||r)},i["@:set"]=function(e,t,n){e.style[t]=n},i["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var n,a=getComputedStyle(e);return a&&(n="filter"===t?a.getPropertyValue(t):a[t],""===n&&(n=e.style[t])),n},i["opacity:get"]=function(e){var t=i["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(avalon.rword,function(e){i[e+":get"]=function(t){var n=i["@:get"](t,e);return/px$/.test(n)?n:avalon(t).position()[e]+"px"}});var c={position:"absolute",visibility:"hidden",display:"block"},u=/^(none|table(?!-c[ea]).+)/;avalon.each({Width:"width",Height:"height"},function(e,t){var a="client"+e,r="scroll"+e,o="offset"+e;i[t+":get"]=function(t,n,a){var r=-4;"number"==typeof a&&(r=a),n="Width"===e?["Left","Right"]:["Top","Bottom"];var i=t[o];return 2===r?i+avalon.css(t,"margin"+n[0],!0)+avalon.css(t,"margin"+n[1],!0):(0>r&&(i=i-avalon.css(t,"border"+n[0]+"Width",!0)-avalon.css(t,"border"+n[1]+"Width",!0)),-4===r&&(i=i-avalon.css(t,"padding"+n[0],!0)-avalon.css(t,"padding"+n[1],!0)),i)},i[t+"&get"]=function(e){var a=[];n(e,a);for(var r,o=i[t+":get"](e),l=0;r=a[l++];){e=r.node;for(var s in r)"string"==typeof r[s]&&(e.style[s]=r[s])}return o},avalon.fn[t]=function(n){var l=this[0];if(0===arguments.length){if(l.setTimeout)return l["inner"+e];if(9===l.nodeType){var s=l.documentElement;return Math.max(l.body[r],s[r],l.body[o],s[o],s[a])}return i[t+"&get"](l)}return this.css(t,n)},avalon.fn["inner"+e]=function(){return i[t+":get"](this[0],void 0,-2)},avalon.fn["outer"+e]=function(e){return i[t+":get"](this[0],void 0,e===!0?2:0)}}),avalon.fn.offset=function(){var e=this[0];try{var t=e.getBoundingClientRect();if(t.width||t.height||e.getClientRects().length){var n=e.ownerDocument,a=n.documentElement,r=n.defaultView;return{top:t.top+r.pageYOffset-a.clientTop,left:t.left+r.pageXOffset-a.clientLeft}}}catch(o){return{left:0,top:0}}},avalon.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){avalon.fn[e]=function(n){var r=this[0]||{},o=a(r),i="scrollTop"===e;return arguments.length?void(o?o.scrollTo(i?o[t]:n,i?n:o[t]):r[e]=n):o?o[t]:r[e]}})},function(e,t){function n(e){var t=e.tagName.toLowerCase();return"input"===t&&/checkbox|radio/.test(e.type)?"checked":t}var a={"select:get":function r(e,t,n,o){var i,l=e.children;a["option:get"];n=t?n:e.selectedIndex,o=t?o:"select-one"===e.type||0>n,t=t||[];for(var s,c=0;s=l[c++];)if(!s.disabled)switch(s.nodeName.toLowerCase()){case"option":if(s.selected||s.index===n){if(i=s.value,o)return i;t.push(i)}break;case"optgroup":if(i=r(s,t,n,o),"string"==typeof i)return i}return o?null:t},"select:set":function(e,t,n){t=[].concat(t);for(var a,r=0;a=e.options[r++];)(a.selected=t.indexOf(a.value)>-1)&&(n=!0);n||(e.selectedIndex=-1)}};avalon.fn.val=function(e){var t=this[0];if(t&&1===t.nodeType){var r=0===arguments.length,o=r?":get":":set",i=a[n(t)+o];if(i)var l=i(t,e);else{if(r)return(t.value||"").replace(/\r/g,"");t.value=e}}return r?l:this}},function(e,t,n){var a=n(28),r=n(29),o=new function(){avalon.shadowCopy(this,{option:document.createElement("select"),thead:document.createElement("table"),td:document.createElement("tr"),area:document.createElement("map"),tr:document.createElement("tbody"),col:document.createElement("colgroup"),legend:document.createElement("fieldset"),_default:document.createElement("div"),g:document.createElementNS("http://www.w3.org/2000/svg","svg")}),this.optgroup=this.option,this.tbody=this.tfoot=this.colgroup=this.caption=this.thead,this.th=this.td},i={g:o.g};String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(avalon.rword,function(e){i[e]=o.g});var l,s=/<([\w:]+)/,c=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,u=/<|&#?\w+;/,v=new a(128),l=avalon.document.createElement("template");/HTMLTemplateElement/.test(l)||(l=null,avalon.shadowCopy(o,i)),avalon.parseHTML=function(e){var t,n=avalon.avalonFragment.cloneNode(!1);if("string"!=typeof e)return n;if(!u.test(e))return n.appendChild(document.createTextNode(e)),n;e=e.replace(c,"<$1></$2>").trim();var a=v.get(e);if(a)return a.cloneNode(!0);var t,p=(s.exec(e)||["",""])[1].toLowerCase(),d=i[p];if(d?d.innerHTML=e:l?(l.innerHTML=e,d=l.content):(d=o[p]||o._default,d.innerHTML=e),r(d),l)n=d;else for(;t=d.firstChild;)n.appendChild(t);return e.length<1024&&v.put(e,n.cloneNode(!0)),n},avalon.innerHTML=function(e,t){var n=this.parseHTML(t);this.clearHTML(e).appendChild(n)},avalon.clearHTML=function(e){for(avalon.$$unbind(e),e.textContent="";e.lastChild;)e.removeChild(e.lastChild);return e}},function(e,t,n){function a(e,t,n){var r=e.getAttribute("avalon-events");if(r&&(e.disabled!==!0||"click"!==t)){var o=[],i=h[t]||(h[t]=new RegExp(t+"\\:([^?s]+)","g"));r.replace(i,function(e,t){return o.push(t),e}),o.length&&n.push({elem:e,uuids:o})}e=e.parentNode;var l=avalon.gestureEvents||{};e&&e.getAttribute&&(v[t]||l[t])&&a(e,t,n)}function r(e){e=new i(e);var t=e.type,n=e.target,r=[];a(n,t,r);for(var o,l,s,c=0;(s=r[c++])&&!e.cancelBubble;)for(e.currentTarget=s.elem,o=0;(l=s.uuids[o++])&&!e.isImmediatePropagationStopped;){var u=avalon.eventListeners[l];if(u){var v=m.test(l)?s.elem._ms_context_:0;if(v&&v.$hashcode===!1)return avalon.unbind(n,t,u);if(y.test(t)){var p=+new Date;if(p-f>16){var d=u.call(v||n,e);f=p}}else d=u.call(v||n,e);d===!1&&(e.preventDefault(),e.stopPropagation())}}}function o(e){var t=c.getAttribute("delegate-events")||"";if(-1===t.indexOf(e)){var n=t.match(d)||[];n.push(e),c.setAttribute("delegate-events",n.join("??")),_(c,e,r,!!g[e])}}function i(e){if(e.originalEvent)return this;for(var t in e)w.test(t)||"function"==typeof e[t]||(this[t]=e[t]);this.timeStamp=new Date-0,this.originalEvent=e}var l=avalon.document,s=avalon.window,c=avalon.root,u=n(6).getShortID,v=n(33),p=avalon.eventHooks;avalon.bind=function(e,t,n){if(1===e.nodeType){var a=e.getAttribute("avalon-events")||"",i=u(n),l=p[t];l&&(t=l.type||t,l.fix&&(n=l.fix(e,n),n.uuid=i));var s=t+":"+i;avalon.eventListeners[n.uuid]=n,-1===a.indexOf(t+":")&&(v[t]||g[t]?o(t):_(e,t,r));var c=a.split("??");""===c[0]&&c.shift(),-1===c.indexOf(s)&&(c.push(s),e.setAttribute("avalon-events",c.join("??")))}else _(e,t,n);return n},avalon.unbind=function(e,t,n){if(1===e.nodeType){var a=e.getAttribute("avalon-events")||"";switch(arguments.length){case 1:b(e,t,r),e.removeAttribute("avalon-events");break;case 2:a=a.split("??").filter(function(e){return-1===e.indexOf(t+":")}).join("??"),e.setAttribute("avalon-events",a);break;default:var o=t+":"+n.uuid;a=a.split("??").filter(function(e){return e!==o}).join("??"),e.setAttribute("avalon-events",a),delete avalon.eventListeners[n.uuid]}}else b(e,t,n)};var d=/[^\s\?]+/g,f=Date.now(),h={},m=/^e\d+/,y=/move|scroll/,g={focus:!0,blur:!0},_=function(e,t,n,a){e.addEventListener(t,n,a)},b=function(e,t,n){e.removeEventListener(t,n)},w=/^(?:ms|webkit|moz)/;i.prototype={preventDefault:function(){var e=this.originalEvent;this.returnValue=!1,e&&(e.returnValue=!1,e.preventDefault())},stopPropagation:function(){var e=this.originalEvent;this.cancelBubble=!0,e&&(e.cancelBubble=!0,e.stopPropagation())},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=!0,e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},avalon.fireDom=function(e,t,n){var a=l.createEvent("Events");a.initEvent(t,!0,!0),avalon.shadowCopy(a,n),e.dispatchEvent(a)};var p=avalon.eventHooks;"onmouseenter"in c||avalon.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){p[e]={type:t,fn:function(t,n){return function(a){var r=a.relatedTarget;return r&&(r===t||16&t.compareDocumentPosition(r))?void 0:(delete a.type,a.type=e,n.call(this,a))}}}}),avalon.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(e,t){s[e]&&!p.animationend&&(p.animationend={type:t})}),void 0===l.onmousewheel&&(p.mousewheel={type:"wheel",fn:function(e,t){return function(e){e.wheelDeltaY=e.wheelDelta=e.deltaY>0?-120:120,e.wheelDeltaX=0,Object.defineProperty(e,"type",{value:"mousewheel"}),t.call(this,e)}}}),avalon.fn.bind=function(e,t,n){return this[0]?avalon.bind(this[0],e,t,n):void 0},avalon.fn.unbind=function(e,t,n){return this[0]&&avalon.unbind(this[0],e,t,n),this},avalon.$$unbind=function(e){var t=e.querySelectorAll("[avalon-events]");avalon.each(t,function(e,t){avalon.unbind(t)})}},function(e,t,n){var a,r=n(35),o=avalon.document,i=avalon.window,l=[],s=function(e){for(a=!0;e=l.shift();)e(avalon)};"complete"===o.readyState?setTimeout(s):o.addEventListener("DOMContentLoaded",s),avalon.bind(i,"load",s),avalon.ready=function(e){a?e(avalon):l.push(e)},avalon.ready(function(){r(o.body)})},function(e,t,n){n(37),n(39),n(96),n(41),n(42),n(97),n(44),n(46),n(53),n(54),n(98),n(63),n(64),n(65),n(67),n(101),n(70)},function(e,t,n){var a=n(89),r=n(38);avalon.directive("attr",{diff:function(e,t,n,o){var i=e[o],l=t[o];if(Object(i)===i){if(Array.isArray(i)&&(i=e[o]=avalon.mix.apply({},i)),"object"!=typeof l)e.changeAttr=i;else{var s={},c=!1;for(var u in i)i[u]!==l[u]&&(c=!0,s[u]=i[u]);c&&(e.changeAttr=s,n.count+=1)}e.changeAttr&&r(e,a,n,"attr")}else e[o]=l},update:a})},function(e,t,n){var a=n(38);avalon.directive("expr",{parse:function(){},diff:function(e,t,n){e.nodeValue!==t.nodeValue&&a(e,this.update,n,"expr")},update:function(e,t,n){if(3!==e.nodeType){var a=document.createTextNode(t.nodeValue);n.replaceChild(a,e)}else e.nodeValue=t.nodeValue}})},function(e,t,n){function a(e){for(var t,n=0;t=this.parser[n++];){var a=avalon.parsers[t];a&&(e=a.call(this,e))}return e}var r=n(38),o=n(49),i=n(52),l=/\|\s*change\b/,s=/^(?:checkbox|radio)$/,c=/\|\s*debounce(?:\(([^)]+)\))?/,u=n(56),v=n(99),p=n(60),d=n(58),f=n(100),h=n(62);avalon.directive("duplex",{priority:2e3,parse:function(e,t,n){var a,r=n.expr,u=t.props.type,v=n.param,p=!1;v=v?"["+v.split("-").map(function(e){return"checked"===e&&(p=!0),avalon.quote(e)})+"]":"[]",s.test(u)&&p&&(v="[]",a="radio"),/input|textarea|select/.test(t.type)?a||(a="select"===t.type?"select":"checkbox"===u?"checkbox":"radio"===u?"radio":"input"):"contenteditable"in t.props&&(a="contenteditable");var d=!1,f=0;if(("input"===a||"contenteditable"===a)&&(l.test(r)&&(d=!0),!d)){var h=r.match(c);h&&(f=parseInt(h[1],10)||300)}e.vmodel="__vmodel__",e.modelValue="("+avalon.parseExpr(n,"duplex")+")(__vmodel__)",e.duplexSetter=o.get("duplex:set:"+r);var m=o.get("duplex:format:"+r),y=e.props["data-duplex-changed"];e.callback=y?avalon.parseExpr(y,"on"):"avalon.noop",e.duplexFormat=m||"function(vm, a){return a}",e.duplexData=i({type:a,isChecked:p,isChanged:d,parser:v,callback:y?avalon.parseExpr(n,"on"):"avalon.noop",debounceTime:f,vmodel:"__vmodel__"})},diff:function(e,t,n){var a=e.modelValue,o=t.modelValue,i=e.duplexFormat(e.vmodel,a);String(i)!==String(e.duplexFormat(e.vmodel,o))&&(e.viewValue=i,"select"!==e.type||e.children.length||(avalon.Array.merge(e.children,avalon.lexer(e.template,0,2)),u(e,i)),r(e,this.update,n,"duplex","afterChange"))},update:function(e,t){if(e&&1===e.nodeType){e.getAttribute("duplex-inited")||(e.__ms_duplex__=t.duplexData,e.setAttribute("duplex-inited","true"),v(e,t));var n=e.__ms_duplex__;if(n.format=t.duplexFormat,n.set=t.duplexSetter,n.parse=a,n.element=e,n.callback=t.callback,h(e,t),!avalon.msie&&p===!1&&!e.valueHijack){e.valueHijack=d;var r=setInterval(function(){avalon.contains(avalon.root,e)?e.valueHijack():clearInterval(r)},30)}if(n.viewValue!==t.viewValue){if(n.modelValue=t.modelValue,!Array.isArray(t.modelValue)){var o=n.parse(t.viewValue);o!==n.modelValue&&n.set(n.vmodel,o)}if(n.viewValue=t.viewValue,n.element=e,f[n.type].call(n),e.caret){var i=n.caretPos;i&&n.setCaret(e,i.start,i.end),n.caretPos=null}}}}})},function(e,t,n){function a(e,t){var n={},a=t.duplexData;switch(a.update=u,a.type){case"radio":"radio"===t.props.type?n.click=u:n.change=u;break;case"checkbox":case"select":n.change=u;break;case"contenteditable":a.isChanged?n.blur=u:(p.webkitURL?n.webkitEditableContentChanged=u:p.MutationEvent&&(n.DOMCharacterDataModified=u),n.input=u);break;case"input":a.isChanged?n.change=u:(n.input=u,avalon.msie||(n.compositionstart=i,n.compositionend=l))}/password|text/.test(t.props.type)&&(n.focus=r,n.blur=o,a.getCaret=s,a.setCaret=c);for(var v in n)avalon.bind(e,v,n[v])}function r(){this.caret=!0}function o(){this.caret=!1}function i(){this.composing=!0}function l(e){this.composing=!1}function s(e){var t=NaN,n=NaN;return e.setSelectionRange&&(t=e.selectionStart,n=e.selectionEnd),{start:t,end:n}}function c(e,t,n){e.value&&!e.readOnly&&(e.selectionStart=t,e.selectionEnd=n)}var u=n(58),v=n(6).getShortID,p=(avalon.msie,avalon.window);avalon.document;v(r),v(o),v(i),v(l),v(u),e.exports=a},function(e,t){var n={input:function(){this.element.value=this.viewValue},radio:function(){var e;e=this.isChecked?!!this.viewValue:this.viewValue+""===this.element.value;var t=this.element;t.checked=e},checkbox:function(){for(var e=!1,t=this.element,n=t.value,a=0;a<this.modelValue.length;a++){var r=this.modelValue[a];r+""===n&&(e=!0)}t.checked=e},select:function(){var e=Array.isArray(this.viewValue)?this.viewValue.map(String):this.viewValue+"";avalon(this.element).val(e)},contenteditable:function(){this.element.innerHTML=this.viewValue,this.update.call(this.element)}};e.exports=n},function(e,t,n){function a(e){for(var t,n=0;t=e[n++];)"for"===t.directive&&(t.fixAction=!0),t.children&&a(t.children)}var r=n(102),o=n(66),i=n(38),l=avalon.directive("widget",{priority:4,parse:function(e,t,n){var a=t.props.wid||avalon.makeHashCode("w");e.wid=avalon.quote(a),e.directive="widget",e.template=t.template,e.children="[]",e[n.name]=avalon.parseExpr(n);var r=t.$append||"";t.$append=["var il1492 = vnodes.length - 1","var el1492 = vnodes[il1492]","if(el1492.nodeType === 1){","el1492.local = __local__","el1492.vmodel = __vmodel__","avalon.component(el1492, vnodes, il1492,"+e.wid+")","}"].join("\n ")+r},define:function(){return avalon.mediatorFactory.apply(this,arguments)},diff:function(e,t,n){function r(t,n){e.vmodel.$fire("onReady",{type:"ready",target:t,wid:o,vmodel:n.vmodel})}var o=e.wid,l=avalon.scopes[o];if(8===e.nodeType)n.count+=1,e.change=[this.replaceByComment];else if(l&&1===l.renderCount)l.vmodel.$fire("onInit",{type:"init",vmodel:l.vmodel,wid:o,componentName:l.componentName}),l.renderCount=2,t.children=[],e.steps=n,a(e.children),i(e,this.replaceByComponent,n,"widget"),i(e,r,n,"widget","afterChange");else{l.renderCount++;var s=!e.diff||e.diff(e,t,n);e.skipContent=!s,t.wid&&e.wid!==t.wid&&!t.props.cached&&(delete avalon.scopes[t.wid],delete avalon.vmodels[t.wid]);var c=e.vmodel.$events.onViewChange;c&&c.length&&(n.count+=1,e.afterChange=[function(n,a){var r=t.outerHTML,i=e.outerHTML||(e.outerHTML=avalon.vdomAdaptor(e,"toHTML"));r!==i&&e.vmodel.$fire("onViewChange",{type:"viewchange",target:n,wid:o,vmodel:a.vmodel})}])}},addDisposeMonitor:function(e){r.byRewritePrototype(e)},replaceByComment:function(e,t,n){var a=document.createComment(t.nodeValue);e?n.replaceChild(a,e):n.appendChild(a)},replaceByComponent:function(e,t,n){var a=avalon.vdomAdaptor(t,"toDOM");t.ouerHTML=avalon.vdomAdaptor(t,"toHTML"),e?n.replaceChild(a,e):n.appendChild(a),o([a],[t],n,t.steps);var r=t.vmodel,i=avalon.scopes[r.$id];return i.dom=a,r.$element=a,a.vtree=[t],l.addDisposeMonitor(a),!1}})},function(e,t){function n(){function e(e,t){var n=a[e];a[e]=function(e,a){return t.call(this,n,e,a)}}function t(e){var t=avalon.slice(this.getElementsByTagName("*"));s.call(this,e),i(t)}if(!n.execute){n.execute=!0;var a=Node.prototype;e("removeChild",function(e,t,n){return e.call(this,t,n),1===t.nodeType&&o(t),t}),e("replaceChild",function(e,t,n){return e.call(this,t,n),1===t.nodeType&&o(t),t});var r=Element.prototype,l=Object.getOwnPropertyDescriptor(r,"innerHTML"),s=l.set;l.set=t,Object.defineProperty(r,"innerHTML",l),e("appendChild",function(e,t){return e.call(this,t),1===t.nodeType&&11===this.nodeType&&o(t),t}),e("insertBefore",function(e,t,n){return e.call(this,t,n),1===t.nodeType&&11===this.nodeType&&o(t),t})}}function a(e){for(;e;){if(9===e.nodeType)return!0;e=e.parentNode}return!1}function r(e){if(1===e.nodeType&&e.getAttribute("wid")&&!a(e)){var t=e.getAttribute("wid"),n=avalon.scopes[t];if(!n)return;var r=n.vmodel;return n.vmodel.$fire("onDispose",{type:"dispose",target:e,vmodel:r}),n&&!e.getAttribute("cached")&&(r.$element=null,r.$hashcode=!1,delete n.vmodel,delete n.dom,delete avalon.scopes[t]),!1}}function o(e){setTimeout(function(){r(e)},4)}function i(e){for(var t,n=0;t=e[n++];)r(t)}e.exports={byRewritePrototype:n}},function(e,t,n){function a(e,t){if(!e)return!0;var n=avalon.mix(t||{},e);for(var a in n)if("is"!==a&&"$id"!==a)return!1;return!0}function r(e,t,n,a,r){if(!l(e))return n[a]=y;var o=t.$id,i=avalon.scopes[o];if(i&&i.dom)i.dom.vtree=[e];else{var i={componentName:r,vmodel:t,render:t.$render,local:e.local,renderCount:1};avalon.scopes[o]=i}n[a]=e}function o(e){return g.test(e)}function i(e,t,n){for(var a in t)if(t.hasOwnProperty(a)){var r=t[a];h[a]?a in e?e[a].push(r):e[a]=[t[a]]:isFinite(n)&&(e[a]=r)}}function l(e){var t=!0;try{s(e)}catch(n){t=!1}return t}function s(e){e.children.forEach(function(e){if(8===e.nodeType){if(e===y)throw"unresolved"}else e.children&&s(e)})}function c(e,t,n){var a={};n?a[n]=t.children:t.children.forEach(function(e){if(1===e.nodeType){var t=e.props.slot||"default";a[t]?a[t].push(e):a[t]=[e]}}),u(e,a)}function u(e,t){for(var n,a=0;n=e[a++];)if(1===n.nodeType)if("slot"===n.type){var r=n.props.name||"default";if(t[r]){var o=t[r];e.splice.apply(e,[a-1,1].concat(o)),1===o.length&&3===o[0].nodeType&&v(e)}}else u(n.children,t);return e}function v(e){for(var t,n=0;t=e[n];n++)if(t.skipContent===!1&&3===t.nodeType){var a=e[n-1],r=e[n+1];a&&3===a.nodeType&&!/\S/.test(a.nodeValue)&&(avalon.Array.remove(e,a),--n),r&&3===r.nodeType&&!/\S/.test(r.nodeValue)&&avalon.Array.remove(e,r)}}var p=n(16),d=(n(47),n(77),{wbr:1,xmp:1,template:1}),f="onInit,onReady,onViewChange,onDispose",h=avalon.oneObject(f),m=f.split(",").concat("is","diff","define"),y={nodeType:8,type:"#comment",directive:"widget",nodeValue:"unresolved component placeholder"};avalon.component=function(e,t){if(arguments.length<4)avalon.components[e]||(avalon.components[e]=t);else{var n=arguments[0],l=arguments[1],s=arguments[2],v=arguments[3],f=n.vmodel,g={};if(a(n["ms-widget"],g))b=!0;else{var _=[].concat(n["ms-widget"]||[]);_.forEach(function(e,t){i(g,e,t)});var b=a(g)}var w=n.type.indexOf("-")>0?n.type:g.is;if(!avalon.components[w])return l[s]=y;var x=w.replace(/-/g,"_");f.hasOwnProperty(x)&&"object"==typeof f[x]&&(g={},_=[f[x]],i(g,f[x],0),m=[x].concat(m));var T=avalon.scopes[g.$id]||avalon.scopes[v];if(T&&T.dom){var $=T.render(T.vmodel,T.local);if($[0])return r($[0],T.vmodel,l,s)}var C=n.type;d[C]||o(C)||avalon.warn(C+"不合适做组件的标签"),"xmp"!==C&&"template"!==C&&0!==n.children.length||(n.children=avalon.lexer(n.template)),t=avalon.components[w];var E=g.diff,A=g.define;A=A||avalon.directives.widget.define;var k=g.$id||v,O=avalon.mix(!0,{},t.defaults);i(g,O,!1),defineArgs=[f,O].concat(_);var M=A.apply(function(e,t){m.forEach(function(n){delete e[n],delete t[n]})},defineArgs);M.$id=k;var j=t.template.trim();"function"==typeof t.getTemplate&&(j=t.getTemplate(M,j));var S=avalon.lexer(j);S.length>1&&avalon.error("组件必须用一个元素包起来");var V=S[0];if(avalon.vmodels[k]=M,avalon.mix(V.props,n.props),V.props.wid=k,t.soleSlot){var D={},N=t.soleSlot;D[N]=/\S/.test(n.template)?n.children:new p("{{@"+N+"}}"),u(S,D)}else n.isVoidTag||c(S,n,t.soleSlot);for(var L in h)g[L]&&g[L].forEach(function(e){M.$watch(L,e)});S[0].directive="widget";var H=avalon.render(S,n.local);M.$render=H;try{var $=H(M,n.local)}catch(L){$=[y]}var F=$[0];F.diff=E,r(F,M,l,s,w)}};var g=/^[a-z]([a-z\d]+\-)+[a-z\d]+$/},function(e,t,n){function a(){}function r(e,t,n){var r={};e.$skipArray&&(r=avalon.oneObject(e.$skipArray),delete e.$skipArray);var o={};n=n||{},t=t||{};var i={},l=m("$"),s=n.pathname||"";n.id=n.id||l,n.hashcode=l;var u,h,y;for(u in e)if(!v[u]){var g=o[u]=e[u];c(u,g,r)||(h=n.id+"."+u,y=s?s+"."+u:u,i[u]=p(h,y,t))}i.$model=f;var _=new a;Object.defineProperties(_,i);for(u in o)_[u]=o[u],u in r?delete o[u]:o[u]=!0;return d(_,t,o,i,n),_}function o(e,t,n,a){var r={},o={},i=a.pathname;n=n||{};var l,s,u;for(l in t)if(!v[l]&&(r[l]=t[l],!c(l,t[l],y))){var h=Object.getOwnPropertyDescriptor(e,l);h&&h.get?o[l]=h:(s=a.id+"."+l,u=i?i+"."+l:l,o[l]=p(s,u,n))}for(l in e)delete e[l];a.hashcode=e.$hashcode||m("$"),o.$model=f;var g=e;Object.defineProperties(g,o);for(l in r)o[l]||(g[l]=r[l]),r[l]=!0;return d(g,n,r,o,a),g}function i(e,t){for(var n,r,o={},i={},l={},s={},u={},f=avalon.slice(arguments),h=0;h<f.length;h++){var y=f[h];for(var g in y){o[g]=y[g],"$skipArray"===g&&Array.isArray(y.$skipArray)&&y.$skipArray.forEach(function(e){u[e]=1});var _=Object.getOwnPropertyDescriptor(y,g);_.set?-1===f.indexOf(y[g])?i[g]=_:(n=o[g],r=g,delete o[g]):"function"!=typeof o[g]&&(l[g]=1)}}"function"==typeof this&&this(o,l);for(g in l)v[g]||i[g]||c(g,o[g],u)||(i[g]=p(e.$id+"."+g,g,s),i[g].set(o[g]));var b=new a;Object.defineProperties(b,i);for(g in o){if(i[g]||(b[g]=o[g]),r&&i[g]&&n.hasOwnProperty(g)){var w=i[g];w.get.$decompose||(w.get.$decompose={}),w.get.$decompose[r+"."+g]=b}o[g]=!0}return d(b,s,o,i,{id:e.$id,hashcode:m("$"),master:!0}),b}function l(e,t){e.length!==t&&e.notify("length",e.length,t,!0)}var s=n(105),c=s.isSkip,u=s.$$midway,v=s.$$skipArray;delete v.$accessors,delete v.__data__,delete v.__proxy__,delete v.__const__;var p=s.makeAccessor,d=s.initViewModel,f=s.modelAccessor,h=s.modelAdaptor,m=avalon.makeHashCode;u.masterFactory=r;var y={};u.slaveFactory=o,u.mediatorFactory=avalon.mediatorFactory=i;var g=s.__array__,_=Array.prototype,b=_.splice;g.removeAll=function(e){var t=this.length;if(Array.isArray(e))for(var n=this.length-1;n>=0;n--)-1!==e.indexOf(this[n])&&b.call(this,n,1);else if("function"==typeof e)for(n=this.length-1;n>=0;n--){var a=this[n];e(a,n)&&b.call(this,n,1)}else b.call(this,0,this.length);l(this,t),this.notify()};var w=["push","pop","shift","unshift","splice"];w.forEach(function(e){var t=_[e];g[e]=function(n,a){var r=[],o=this.length;if("splice"===e&&Object(this[0])===this[0])for(var i=this.slice(n,a),s=_.slice.call(arguments,2),r=[n,a],c=0,u=s.length;u>c;c++){var v=i[c];r[c+2]=h(s[c],v,v&&v.$events||{},{id:this.$id+".*",master:!0})}else for(var p=0,d=arguments.length;d>p;p++)r[p]=h(arguments[p],0,{},{id:this.$id+".*",master:!0});var f=t.apply(this,r);return l(this,o),this.notify(),f}}),"sort,reverse".replace(avalon.rword,function(e){g[e]=function(){return _[e].apply(this,arguments),this.notify(),this}}),e.exports=avalon},function(e,t,n){function a(e){var t=avalon.type(e);if("array"===t){for(var n=[],r=0;r<e.length;r++)n[r]=a(e[r]);return n}if("object"===t){var o={};for(r in e)if(e.hasOwnProperty(r)){var i=e[r];o[r]=i&&i.nodeType?i:a(i)}return o}return e}function r(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!1,configurable:!0})}function o(e,t,n,a,o){function i(e){return n[e]===!0}o.array?Object.defineProperty(e,"$model",s):r(e,"hasOwnProperty",i),r(e,"$id",o.id),r(e,"$hashcode",o.hashcode),r(e,"$track",Object.keys(n).sort().join(";;")),o.master===!0&&(r(e,"$element",null),r(e,"$render",0),l(e,t))}var i=n(80),l=i.initEvents,s={get:function(){return a(this)},set:avalon.noop,enumerable:!1,configurable:!0};i.$$midway.hideProperty=r,i.$$midway.initViewModel=o;var c={toJson:a,initViewModel:o,modelAccessor:s};for(var u in i)c[u]=i[u];e.exports=c}])})},108:function(e,t){avalon.component("ms-button",{template:'<button type="button"><span><slot name="buttonText"></slot></span></button>',defaults:{buttonText:"button"},soleSlot:"buttonText"})},109:function(e,t,n){var a=(n(108),n(110));avalon.component("ms-panel",{template:a,defaults:{body:" ",ms_button:{buttonText:"click me!"}},soleSlot:"body"})},110:function(e,t){e.exports='<div>\n <div class="body">\n <slot name="body"></slot>\n </div>\n <p><ms-button /></p>\n</div>'}})});
//# sourceMappingURL=avalon.test.min.js.map | extend1994/cdnjs | ajax/libs/avalon.js/2.0.5/avalon.test.min.js | JavaScript | mit | 88,612 |
/*!
* jquery-timepicker v1.6.0 - A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.
* Copyright (c) 2015 Jon Thornton - http://jonthornton.github.com/jquery-timepicker/
* License:
*/
!function(a){"object"==typeof exports&&exports&&"object"==typeof module&&module&&module.exports===exports?a(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){function b(a){var b=a[0];return b.offsetWidth>0&&b.offsetHeight>0}function c(b){if(b.minTime&&(b.minTime=t(b.minTime)),b.maxTime&&(b.maxTime=t(b.maxTime)),b.durationTime&&"function"!=typeof b.durationTime&&(b.durationTime=t(b.durationTime)),"now"==b.scrollDefault?b.scrollDefault=t(new Date):b.scrollDefault?b.scrollDefault=t(b.scrollDefault):b.minTime&&(b.scrollDefault=b.minTime),b.scrollDefault&&(b.scrollDefault=b.roundingFunction(b.scrollDefault,b)),"string"===a.type(b.timeFormat)&&b.timeFormat.match(/[gh]/)&&(b._twelveHourTime=!0),b.disableTimeRanges.length>0){for(var c in b.disableTimeRanges)b.disableTimeRanges[c]=[t(b.disableTimeRanges[c][0]),t(b.disableTimeRanges[c][1])];b.disableTimeRanges=b.disableTimeRanges.sort(function(a,b){return a[0]-b[0]});for(var c=b.disableTimeRanges.length-1;c>0;c--)b.disableTimeRanges[c][0]<=b.disableTimeRanges[c-1][1]&&(b.disableTimeRanges[c-1]=[Math.min(b.disableTimeRanges[c][0],b.disableTimeRanges[c-1][0]),Math.max(b.disableTimeRanges[c][1],b.disableTimeRanges[c-1][1])],b.disableTimeRanges.splice(c,1))}return b}function d(b){var c=b.data("timepicker-settings"),d=b.data("timepicker-list");if(d&&d.length&&(d.remove(),b.data("timepicker-list",!1)),c.useSelect){d=a("<select />",{"class":"ui-timepicker-select"});var g=d}else{d=a("<ul />",{"class":"ui-timepicker-list"});var g=a("<div />",{"class":"ui-timepicker-wrapper",tabindex:-1});g.css({display:"none",position:"absolute"}).append(d)}if(c.noneOption)if(c.noneOption===!0&&(c.noneOption=c.useSelect?"Time...":"None"),a.isArray(c.noneOption)){for(var h in c.noneOption)if(parseInt(h,10)==h){var j=e(c.noneOption[h],c.useSelect);d.append(j)}}else{var j=e(c.noneOption,c.useSelect);d.append(j)}if(c.className&&g.addClass(c.className),(null!==c.minTime||null!==c.durationTime)&&c.showDuration){{"function"==typeof c.step?"function":c.step}g.addClass("ui-timepicker-with-duration"),g.addClass("ui-timepicker-step-"+c.step)}var l=c.minTime;"function"==typeof c.durationTime?l=t(c.durationTime()):null!==c.durationTime&&(l=c.durationTime);var m=null!==c.minTime?c.minTime:0,o=null!==c.maxTime?c.maxTime:m+v-1;m>o&&(o+=v),o===v-1&&"string"===a.type(c.timeFormat)&&c.show2400&&(o=v);var p=c.disableTimeRanges,u=0,w=p.length,y=c.step;"function"!=typeof y&&(y=function(){return c.step});for(var h=m,z=0;o>=h;z++,h+=60*y(z)){var A=h,B=s(A,c);if(c.useSelect){var C=a("<option />",{value:B});C.text(B)}else{var C=a("<li />");C.data("time",86400>=A?A:A%86400),C.text(B)}if((null!==c.minTime||null!==c.durationTime)&&c.showDuration){var D=r(h-l,c.step);if(c.useSelect)C.text(C.text()+" ("+D+")");else{var E=a("<span />",{"class":"ui-timepicker-duration"});E.text(" ("+D+")"),C.append(E)}}w>u&&(A>=p[u][1]&&(u+=1),p[u]&&A>=p[u][0]&&A<p[u][1]&&(c.useSelect?C.prop("disabled",!0):C.addClass("ui-timepicker-disabled"))),d.append(C)}if(g.data("timepicker-input",b),b.data("timepicker-list",g),c.useSelect)b.val()&&d.val(f(b.val(),c)),d.on("focus",function(){a(this).data("timepicker-input").trigger("showTimepicker")}),d.on("blur",function(){a(this).data("timepicker-input").trigger("hideTimepicker")}),d.on("change",function(){n(b,a(this).val(),"select")}),n(b,d.val()),b.hide().after(d);else{var F=c.appendTo;"string"==typeof F?F=a(F):"function"==typeof F&&(F=F(b)),F.append(g),k(b,d),d.on("mousedown","li",function(){b.off("focus.timepicker"),b.on("focus.timepicker-ie-hack",function(){b.off("focus.timepicker-ie-hack"),b.on("focus.timepicker",x.show)}),i(b)||b[0].focus(),d.find("li").removeClass("ui-timepicker-selected"),a(this).addClass("ui-timepicker-selected"),q(b)&&(b.trigger("hideTimepicker"),d.on("mouseup.timepicker","li",function(){d.off("mouseup.timepicker"),g.hide()}))})}}function e(b,c){var d,e,f;return"object"==typeof b?(d=b.label,e=b.className,f=b.value):"string"==typeof b?d=b:a.error("Invalid noneOption value"),c?a("<option />",{value:f,"class":e,text:d}):a("<li />",{"class":e,text:d}).data("time",f)}function f(a,b){return a=b.roundingFunction(a,b),null!==a?s(a,b):void 0}function g(){return new Date(1970,1,1,0,0,0)}function h(b){var c=a(b.target),d=c.closest(".ui-timepicker-input");0===d.length&&0===c.closest(".ui-timepicker-wrapper").length&&(x.hide(),a(document).unbind(".ui-timepicker"))}function i(a){var b=a.data("timepicker-settings");return(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&b.disableTouchKeyboard}function j(b,c,d){if(!d&&0!==d)return!1;var e=b.data("timepicker-settings"),f=!1,d=e.roundingFunction(d,e);return c.find("li").each(function(b,c){var e=a(c);if("number"==typeof e.data("time"))return e.data("time")==d?(f=e,!1):void 0}),f}function k(a,b){b.find("li").removeClass("ui-timepicker-selected");var c=t(m(a),a.data("timepicker-settings"));if(null!==c){var d=j(a,b,c);if(d){var e=d.offset().top-b.offset().top;(e+d.outerHeight()>b.outerHeight()||0>e)&&b.scrollTop(b.scrollTop()+d.position().top-d.outerHeight()),d.addClass("ui-timepicker-selected")}}}function l(b,c){if(""!==this.value&&"timepicker"!=c){var d=a(this);if(!d.is(":focus")||b&&"change"==b.type){var e=d.data("timepicker-settings"),f=t(this.value,e);if(null===f)return void d.trigger("timeFormatError");var g=!1;null!==e.minTime&&f<e.minTime?g=!0:null!==e.maxTime&&f>e.maxTime&&(g=!0),a.each(e.disableTimeRanges,function(){return f>=this[0]&&f<this[1]?(g=!0,!1):void 0}),e.forceRoundTime&&(f=e.roundingFunction(f,e));var h=s(f,e);g?n(d,h,"error")&&d.trigger("timeRangeError"):n(d,h)}}}function m(a){return a.is("input")?a.val():a.data("ui-timepicker-value")}function n(a,b,c){if(a.is("input")){a.val(b);var d=a.data("timepicker-settings");d.useSelect&&"select"!=c&&a.data("timepicker-list").val(f(b,d))}return a.data("ui-timepicker-value")!=b?(a.data("ui-timepicker-value",b),"select"==c?a.trigger("selectTime").trigger("changeTime").trigger("change","timepicker"):"error"!=c&&a.trigger("changeTime"),!0):(a.trigger("selectTime"),!1)}function o(c){var d=a(this),e=d.data("timepicker-list");if(!e||!b(e)){if(40!=c.keyCode)return!0;x.show.call(d.get(0)),e=d.data("timepicker-list"),i(d)||d.focus()}switch(c.keyCode){case 13:return q(d)&&x.hide.apply(this),c.preventDefault(),!1;case 38:var f=e.find(".ui-timepicker-selected");return f.length?f.is(":first-child")||(f.removeClass("ui-timepicker-selected"),f.prev().addClass("ui-timepicker-selected"),f.prev().position().top<f.outerHeight()&&e.scrollTop(e.scrollTop()-f.outerHeight())):(e.find("li").each(function(b,c){return a(c).position().top>0?(f=a(c),!1):void 0}),f.addClass("ui-timepicker-selected")),!1;case 40:return f=e.find(".ui-timepicker-selected"),0===f.length?(e.find("li").each(function(b,c){return a(c).position().top>0?(f=a(c),!1):void 0}),f.addClass("ui-timepicker-selected")):f.is(":last-child")||(f.removeClass("ui-timepicker-selected"),f.next().addClass("ui-timepicker-selected"),f.next().position().top+2*f.outerHeight()>e.outerHeight()&&e.scrollTop(e.scrollTop()+f.outerHeight())),!1;case 27:e.find("li").removeClass("ui-timepicker-selected"),x.hide();break;case 9:x.hide();break;default:return!0}}function p(c){var d=a(this),e=d.data("timepicker-list");if(!e||!b(e))return!0;if(!d.data("timepicker-settings").typeaheadHighlight)return e.find("li").removeClass("ui-timepicker-selected"),!0;switch(c.keyCode){case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 65:case 77:case 80:case 186:case 8:case 46:k(d,e);break;default:return}}function q(a){var b=a.data("timepicker-settings"),c=a.data("timepicker-list"),d=null,e=c.find(".ui-timepicker-selected");if(e.hasClass("ui-timepicker-disabled"))return!1;if(e.length&&(d=e.data("time")),null!==d)if("string"==typeof d)a.val(d),a.trigger("selectTime").trigger("changeTime").trigger("change","timepicker");else{var f=s(d,b);n(a,f,"select")}return!0}function r(a,b){a=Math.abs(a);var c,d,e=Math.round(a/60),f=[];return 60>e?f=[e,w.mins]:(c=Math.floor(e/60),d=e%60,30==b&&30==d&&(c+=w.decimal+5),f.push(c),f.push(1==c?w.hr:w.hrs),30!=b&&d&&(f.push(d),f.push(w.mins))),f.join(" ")}function s(b,c){if(null!==b){var d=new Date(u.valueOf()+1e3*b);if(!isNaN(d.getTime())){if("function"===a.type(c.timeFormat))return c.timeFormat(d);for(var e,f,g="",h=0;h<c.timeFormat.length;h++)switch(f=c.timeFormat.charAt(h)){case"a":g+=d.getHours()>11?w.pm:w.am;break;case"A":g+=d.getHours()>11?w.PM:w.AM;break;case"g":e=d.getHours()%12,g+=0===e?"12":e;break;case"G":e=d.getHours(),b===v&&(e=24),g+=e;break;case"h":e=d.getHours()%12,0!==e&&10>e&&(e="0"+e),g+=0===e?"12":e;break;case"H":e=d.getHours(),b===v&&(e=24),g+=e>9?e:"0"+e;break;case"i":var i=d.getMinutes();g+=i>9?i:"0"+i;break;case"s":b=d.getSeconds(),g+=b>9?b:"0"+b;break;case"\\":h++,g+=format.charAt(h);break;default:g+=f}return g}}}function t(a,b){if(""===a)return null;if(!a||a+0==a)return a;if("object"==typeof a)return 3600*a.getHours()+60*a.getMinutes()+a.getSeconds();a=a.toLowerCase().replace(".",""),("a"==a.slice(-1)||"p"==a.slice(-1))&&(a+="m");var c="("+w.am.replace(".","")+"|"+w.pm.replace(".","")+"|"+w.AM.replace(".","")+"|"+w.PM.replace(".","")+")?",d=new RegExp("^"+c+"\\s*([0-2]?[0-9])\\W?([0-5][0-9])?\\W?([0-5][0-9])?\\s*"+c+"$"),e=a.match(d);if(!e)return null;var f=parseInt(1*e[2],10),g=e[1]||e[5],h=f;if(12>=f&&g){var i=g==w.pm||g==w.PM;h=12==f?i?12:0:f+(i?12:0)}var j=1*e[3]||0,k=1*e[4]||0,l=3600*h+60*j+k;if(!g&&b&&b._twelveHourTime&&b.scrollDefault){var m=l-b.scrollDefault;0>m&&m>=v/-2&&(l=(l+v/2)%v)}return l}var u=g(),v=86400,w={am:"am",pm:"pm",AM:"AM",PM:"PM",decimal:".",mins:"mins",hr:"hr",hrs:"hrs"},x={init:function(b){return this.each(function(){var e=a(this),f=[];for(var g in a.fn.timepicker.defaults)e.data(g)&&(f[g]=e.data(g));var h=a.extend({},a.fn.timepicker.defaults,f,b);h.lang&&(w=a.extend(w,h.lang)),h=c(h),e.data("timepicker-settings",h),e.addClass("ui-timepicker-input"),h.useSelect?d(e):(e.prop("autocomplete","off"),e.on("click.timepicker focus.timepicker",x.show),e.on("change.timepicker",l),e.on("keydown.timepicker",o),e.on("keyup.timepicker",p),l.call(e.get(0)))})},show:function(c){var e=a(this),f=e.data("timepicker-settings");if(c){if(!f.showOnFocus)return!0;c.preventDefault()}if(f.useSelect)return void e.data("timepicker-list").focus();i(e)&&e.blur();var g=e.data("timepicker-list");if(!e.prop("readonly")&&(g&&0!==g.length&&"function"!=typeof f.durationTime||(d(e),g=e.data("timepicker-list")),!b(g))){x.hide(),g.show();var k={};k.left=f.orientation.match(/r/)?e.offset().left+e.outerWidth()-g.outerWidth()+parseInt(g.css("marginLeft").replace("px",""),10):e.offset().left+parseInt(g.css("marginLeft").replace("px",""),10);var l;l=f.orientation.match(/t/)?"t":f.orientation.match(/b/)?"b":e.offset().top+e.outerHeight(!0)+g.outerHeight()>a(window).height()+a(window).scrollTop()?"t":"b","t"==l?(g.addClass("ui-timepicker-positioned-top"),k.top=e.offset().top-g.outerHeight()+parseInt(g.css("marginTop").replace("px",""),10)):(g.removeClass("ui-timepicker-positioned-top"),k.top=e.offset().top+e.outerHeight()+parseInt(g.css("marginTop").replace("px",""),10)),g.offset(k);var n=g.find(".ui-timepicker-selected");if(n.length||(m(e)?n=j(e,g,t(m(e))):f.scrollDefault&&(n=j(e,g,f.scrollDefault))),n&&n.length){var o=g.scrollTop()+n.position().top-n.outerHeight();g.scrollTop(o)}else g.scrollTop(0);return a(document).on("touchstart.ui-timepicker mousedown.ui-timepicker",h),f.closeOnWindowScroll&&a(document).on("scroll.ui-timepicker",h),e.trigger("showTimepicker"),this}},hide:function(){var c=a(this),d=c.data("timepicker-settings");return d&&d.useSelect&&c.blur(),a(".ui-timepicker-wrapper").each(function(){var c=a(this);if(b(c)){var d=c.data("timepicker-input"),e=d.data("timepicker-settings");e&&e.selectOnBlur&&q(d),c.hide(),d.trigger("hideTimepicker")}}),this},option:function(b,e){return this.each(function(){var f=a(this),g=f.data("timepicker-settings"),h=f.data("timepicker-list");if("object"==typeof b)g=a.extend(g,b);else if("string"==typeof b&&"undefined"!=typeof e)g[b]=e;else if("string"==typeof b)return g[b];g=c(g),f.data("timepicker-settings",g),h&&(h.remove(),f.data("timepicker-list",!1)),g.useSelect&&d(f)})},getSecondsFromMidnight:function(){return t(m(this))},getTime:function(a){var b=this,c=m(b);if(!c)return null;a||(a=new Date);var d=t(c),e=new Date(a);return e.setHours(d/3600),e.setMinutes(d%3600/60),e.setSeconds(d%60),e.setMilliseconds(0),e},setTime:function(a){var b=this,c=b.data("timepicker-settings");if(c.forceRoundTime)var d=f(a,c);else var d=s(t(a),c);return n(b,d),b.data("timepicker-list")&&k(b,b.data("timepicker-list")),this},remove:function(){var a=this;if(a.hasClass("ui-timepicker-input")){var b=a.data("timepicker-settings");return a.removeAttr("autocomplete","off"),a.removeClass("ui-timepicker-input"),a.removeData("timepicker-settings"),a.off(".timepicker"),a.data("timepicker-list")&&a.data("timepicker-list").remove(),b.useSelect&&a.show(),a.removeData("timepicker-list"),this}}};a.fn.timepicker=function(b){return this.length?x[b]?this.hasClass("ui-timepicker-input")?x[b].apply(this,Array.prototype.slice.call(arguments,1)):this:"object"!=typeof b&&b?void a.error("Method "+b+" does not exist on jQuery.timepicker"):x.init.apply(this,arguments):this},a.fn.timepicker.defaults={className:null,minTime:null,maxTime:null,durationTime:null,step:30,showDuration:!1,showOnFocus:!0,timeFormat:"g:ia",scrollDefault:null,selectOnBlur:!1,disableTouchKeyboard:!1,forceRoundTime:!1,roundingFunction:function(a,b){if(null===a)return null;var c=a%(60*b.step);return c>=30*b.step?a+=60*b.step-c:a-=c,a},appendTo:"body",orientation:"l",disableTimeRanges:[],closeOnWindowScroll:!1,typeaheadHighlight:!0,noneOption:!1,show2400:!1}}); | paleozogt/cdnjs | ajax/libs/jquery-timepicker/1.6.0/jquery.timepicker.min.js | JavaScript | mit | 14,071 |
!function(e){Ember.libraries.register("Ember Simple Auth Devise","0.6.4");var t,i;!function(){var e={},s={};t=function(t,i,s){e[t]={deps:i,callback:s}},i=function(t){function r(e){if("."!==e.charAt(0))return e;for(var i=e.split("/"),s=t.split("/").slice(0,-1),r=0,n=i.length;n>r;r++){var u=i[r];if(".."===u)s.pop();else{if("."===u)continue;s.push(u)}}return s.join("/")}if(s.hasOwnProperty(t))return s[t];if(s[t]={},!e[t])throw new Error("Could not find module "+t);for(var n,u=e[t],a=u.deps,o=u.callback,l=[],c=0,p=a.length;p>c;c++)l.push("exports"===a[c]?n={}:i(r(a[c])));var h=o.apply(this,l);return s[t]=n||h},i.registry=e}(),t("simple-auth-devise/authenticators/devise",["simple-auth/authenticators/base","simple-auth/utils/is-secure-url","simple-auth/utils/get-global-config","exports"],function(e,t,i,s){"use strict";var r=e["default"],n=t["default"],u=i["default"];s["default"]=r.extend({serverTokenEndpoint:"/users/sign_in",resourceName:"user",init:function(){var e=u("simple-auth-devise");this.serverTokenEndpoint=e.serverTokenEndpoint||this.serverTokenEndpoint,this.resourceName=e.resourceName||this.resourceName},restore:function(e){return new Ember.RSVP.Promise(function(t,i){Ember.isEmpty(e.user_token)||Ember.isEmpty(e.user_email)?i():t(e)})},authenticate:function(e){var t=this;return new Ember.RSVP.Promise(function(i,s){var r={};r[t.resourceName]={email:e.identification,password:e.password},t.makeRequest(r).then(function(e){Ember.run(function(){i(e)})},function(e){Ember.run(function(){s(e.responseJSON||e.responseText)})})})},invalidate:function(){return Ember.RSVP.resolve()},makeRequest:function(e){return n(this.serverTokenEndpoint)||Ember.Logger.warn("Credentials are transmitted via an insecure connection - use HTTPS to keep them secure."),Ember.$.ajax({url:this.serverTokenEndpoint,type:"POST",data:e,dataType:"json",beforeSend:function(e,t){e.setRequestHeader("Accept",t.accepts.json)}})}})}),t("simple-auth-devise/authorizers/devise",["simple-auth/authorizers/base","simple-auth/utils/is-secure-url","exports"],function(e,t,i){"use strict";var s=e["default"],r=t["default"];i["default"]=s.extend({authorize:function(e,t){var i=this.get("session.user_token"),s=this.get("session.user_email");if(this.get("session.isAuthenticated")&&!Ember.isEmpty(i)&&!Ember.isEmpty(s)){r(t.url)||Ember.Logger.warn("Credentials are transmitted via an insecure connection - use HTTPS to keep them secure.");var n='token="'+i+'", user_email="'+s+'"';e.setRequestHeader("Authorization","Token "+n)}}})}),t("simple-auth-devise/ember",["./initializer"],function(e){"use strict";var t=e["default"];Ember.onLoad("Ember.Application",function(e){e.initializer(t)})}),t("simple-auth-devise/initializer",["simple-auth-devise/authenticators/devise","simple-auth-devise/authorizers/devise","exports"],function(e,t,i){"use strict";var s=e["default"],r=t["default"];i["default"]={name:"simple-auth-devise",before:"simple-auth",initialize:function(e){e.register("simple-auth-authorizer:devise",r),e.register("simple-auth-authenticator:devise",s)}}}),t("simple-auth/authenticators/base",["exports"],function(t){t["default"]=e.SimpleAuth.Authenticators.Base}),t("simple-auth/authorizers/base",["exports"],function(t){t["default"]=e.SimpleAuth.Authorizers.Base}),t("simple-auth/utils/is-secure-url",["exports"],function(t){t["default"]=e.SimpleAuth.Utils.isSecureUrl}),t("simple-auth/utils/get-global-config",["exports"],function(t){t["default"]=e.SimpleAuth.Utils.getGlobalConfig});var s=(i("simple-auth-devise/initializer").default,i("simple-auth-devise/authenticators/devise").default),r=i("simple-auth-devise/authorizers/devise").default;e.SimpleAuth.Authenticators.Devise=s,e.SimpleAuth.Authorizers.Devise=r,i("simple-auth-devise/ember")}("undefined"!=typeof global?global:window); | dhowe/cdnjs | ajax/libs/ember-simple-auth/0.6.4/simple-auth-devise.min.js | JavaScript | mit | 3,779 |
!function(t){Ember.libraries.register("Ember Simple Auth Testing","0.7.2");var e,i;!function(){var t={},n={};e=function(e,i,n){t[e]={deps:i,callback:n}},i=function(e){function r(t){if("."!==t.charAt(0))return t;for(var i=t.split("/"),n=e.split("/").slice(0,-1),r=0,s=i.length;s>r;r++){var a=i[r];if(".."===a)n.pop();else{if("."===a)continue;n.push(a)}}return n.join("/")}if(n.hasOwnProperty(e))return n[e];if(n[e]={},!t[e])throw new Error("Could not find module "+e);for(var s,a=t[e],u=a.deps,o=a.callback,l=[],c=0,p=u.length;p>c;c++)l.push("exports"===u[c]?s={}:i(r(u[c])));var f=o.apply(this,l);return n[e]=s||f},i.registry=t}(),e("simple-auth-testing/authenticators/test",["simple-auth/authenticators/base","exports"],function(t,e){"use strict";var i=t["default"];e["default"]=i.extend({restore:function(){return new Ember.RSVP.resolve},authenticate:function(){return new Ember.RSVP.resolve},invalidate:function(){return new Ember.RSVP.resolve}})}),e("simple-auth-testing/ember",["./initializer"],function(t){"use strict";var e=t["default"];Ember.onLoad("Ember.Application",function(t){t.initializer(e)})}),e("simple-auth-testing/initializer",["simple-auth-testing/authenticators/test","exports"],function(t,e){"use strict";var i=t["default"];e["default"]={name:"simple-auth-testing",before:"simple-auth",initialize:function(t){t.register("simple-auth-authenticator:test",i)}}}),e("simple-auth-testing/test-helpers",["simple-auth/configuration","exports"],function(t,e){"use strict";var i=t["default"],n=function(){Ember.Test.registerAsyncHelper("authenticateSession",function(t){var e=t.__container__.lookup(i.session);return e.authenticate("simple-auth-authenticator:test"),wait()}),Ember.Test.registerHelper("currentSession",function(t){var e=t.__container__.lookup(i.session);return e}),Ember.Test.registerAsyncHelper("invalidateSession",function(t){var e=t.__container__.lookup(i.session);return e.get("isAuthenticated")&&e.invalidate(),wait()})}();e["default"]=n}),e("simple-auth/authenticators/base",["exports"],function(e){e["default"]=t.SimpleAuth.Authenticators.Base}),e("simple-auth/configuration",["exports"],function(e){e["default"]=t.SimpleAuth.Configuration}),i("simple-auth-testing/ember"),i("simple-auth-testing/test-helpers")}("undefined"!=typeof global?global:window); | noraesae/cdnjs | ajax/libs/ember-simple-auth/0.7.2/simple-auth-testing.min.js | JavaScript | mit | 2,290 |
!function(t){Ember.libraries.register("Ember Simple Auth","0.6.5");var e,i;!function(){var t={},n={};e=function(e,i,n){t[e]={deps:i,callback:n}},i=function(e){function s(t){if("."!==t.charAt(0))return t;for(var i=t.split("/"),n=e.split("/").slice(0,-1),s=0,r=i.length;r>s;s++){var o=i[s];if(".."===o)n.pop();else{if("."===o)continue;n.push(o)}}return n.join("/")}if(n.hasOwnProperty(e))return n[e];if(n[e]={},!t[e])throw new Error("Could not find module "+e);for(var r,o=t[e],a=o.deps,u=o.callback,l=[],c=0,h=a.length;h>c;c++)l.push("exports"===a[c]?r={}:i(s(a[c])));var f=u.apply(this,l);return n[e]=r||f},i.registry=t}(),e("simple-auth/authenticators/base",["exports"],function(t){"use strict";t["default"]=Ember.Object.extend(Ember.Evented,{restore:function(){return new Ember.RSVP.reject},authenticate:function(){return new Ember.RSVP.reject},invalidate:function(){return new Ember.RSVP.resolve}})}),e("simple-auth/authorizers/base",["exports"],function(t){"use strict";t["default"]=Ember.Object.extend({session:null,authorize:function(){}})}),e("simple-auth/configuration",["./utils/get-global-config","exports"],function(t,e){"use strict";var i=t["default"];e["default"]={authenticationRoute:"login",routeAfterAuthentication:"index",routeIfAlreadyAuthenticated:"index",sessionPropertyName:"session",authorizer:null,session:"simple-auth-session:main",store:"simple-auth-session-store:local-storage",crossOriginWhitelist:[],applicationRootUrl:null,load:function(t){var e=i("simple-auth");this.authenticationRoute=e.authenticationRoute||this.authenticationRoute,this.routeAfterAuthentication=e.routeAfterAuthentication||this.routeAfterAuthentication,this.routeIfAlreadyAuthenticated=e.routeIfAlreadyAuthenticated||this.routeIfAlreadyAuthenticated,this.sessionPropertyName=e.sessionPropertyName||this.sessionPropertyName,this.authorizer=e.authorizer||this.authorizer,this.session=e.session||this.session,this.store=e.store||this.store,this.crossOriginWhitelist=e.crossOriginWhitelist||this.crossOriginWhitelist,this.applicationRootUrl=t.lookup("router:main").get("rootURL")||"/"}}}),e("simple-auth/ember",["./initializer"],function(t){"use strict";var e=t["default"];Ember.onLoad("Ember.Application",function(t){t.initializer(e)})}),e("simple-auth/initializer",["./setup","exports"],function(t,e){"use strict";var i=t["default"];e["default"]={name:"simple-auth",initialize:function(t,e){i(t,e)}}}),e("simple-auth/mixins/application-route-mixin",["./../configuration","exports"],function(t,e){"use strict";var i=t["default"];e["default"]=Ember.Mixin.create({beforeModel:function(t){if(this._super(t),!this.get("_authEventListenersAssigned")){this.set("_authEventListenersAssigned",!0);var e=this;Ember.A(["sessionAuthenticationSucceeded","sessionAuthenticationFailed","sessionInvalidationSucceeded","sessionInvalidationFailed","authorizationFailed"]).forEach(function(n){e.get(i.sessionPropertyName).on(n,function(){Array.prototype.unshift.call(arguments,n),t.send.apply(t,arguments)})})}},actions:{authenticateSession:function(){this.transitionTo(i.authenticationRoute)},sessionAuthenticationSucceeded:function(){var t=this.get(i.sessionPropertyName).get("attemptedTransition");t?(t.retry(),this.get(i.sessionPropertyName).set("attemptedTransition",null)):this.transitionTo(i.routeAfterAuthentication)},sessionAuthenticationFailed:function(){},invalidateSession:function(){this.get(i.sessionPropertyName).invalidate()},sessionInvalidationSucceeded:function(){window.location.replace(i.applicationRootUrl)},sessionInvalidationFailed:function(){},authorizationFailed:function(){this.get(i.sessionPropertyName).get("isAuthenticated")&&this.get(i.sessionPropertyName).invalidate()}}})}),e("simple-auth/mixins/authenticated-route-mixin",["./../configuration","exports"],function(t,e){"use strict";var i=t["default"];e["default"]=Ember.Mixin.create({beforeModel:function(t){this._super(t),this.get(i.sessionPropertyName).get("isAuthenticated")||(t.abort(),this.get(i.sessionPropertyName).set("attemptedTransition",t),Ember.assert("The route configured as Configuration.authenticationRoute cannot implement the AuthenticatedRouteMixin mixin as that leads to an infinite transitioning loop.",this.get("routeName")!==i.authenticationRoute),t.send("authenticateSession"))}})}),e("simple-auth/mixins/authentication-controller-mixin",["./../configuration","exports"],function(t,e){"use strict";var i=t["default"];e["default"]=Ember.Mixin.create({authenticator:null,actions:{authenticate:function(t){var e=this.get("authenticator");return Ember.assert("AuthenticationControllerMixin/LoginControllerMixin require the authenticator property to be set on the controller",!Ember.isEmpty(e)),this.get(i.sessionPropertyName).authenticate(this.get("authenticator"),t)}}})}),e("simple-auth/mixins/login-controller-mixin",["./../configuration","./authentication-controller-mixin","exports"],function(t,e,i){"use strict";var n=(t["default"],e["default"]);i["default"]=Ember.Mixin.create(n,{actions:{authenticate:function(){var t=this.getProperties("identification","password");return this.set("password",null),this._super(t)}}})}),e("simple-auth/mixins/unauthenticated-route-mixin",["./../configuration","exports"],function(t,e){"use strict";var i=t["default"];e["default"]=Ember.Mixin.create({beforeModel:function(t){this.get(i.sessionPropertyName).get("isAuthenticated")&&(t.abort(),Ember.assert("The route configured as Configuration.routeIfAlreadyAuthenticated cannot implement the UnauthenticatedRouteMixin mixin as that leads to an infinite transitioning loop.",this.get("routeName")!==i.routeIfAlreadyAuthenticated),this.transitionTo(i.routeIfAlreadyAuthenticated))}})}),e("simple-auth/session",["exports"],function(t){"use strict";t["default"]=Ember.ObjectProxy.extend(Ember.Evented,{authenticator:null,store:null,container:null,isAuthenticated:!1,attemptedTransition:null,content:{},authenticate:function(t,e){Ember.assert("Session#authenticate requires the authenticator factory to be specified, was "+t,!Ember.isEmpty(t));var i=this;return new Ember.RSVP.Promise(function(n,s){i.container.lookup(t).authenticate(e).then(function(e){i.setup(t,e,!0),n()},function(t){i.clear(),i.trigger("sessionAuthenticationFailed",t),s(t)})})},invalidate:function(){Ember.assert("Session#invalidate requires the session to be authenticated",this.get("isAuthenticated"));var t=this;return new Ember.RSVP.Promise(function(e,i){var n=t.container.lookup(t.authenticator);n.invalidate(t.content).then(function(){n.off("sessionDataUpdated"),t.clear(!0),e()},function(e){t.trigger("sessionInvalidationFailed",e),i(e)})})},restore:function(){var t=this;return new Ember.RSVP.Promise(function(e,i){var n=t.store.restore(),s=n.authenticator;s?(delete n.authenticator,t.container.lookup(s).restore(n).then(function(i){t.setup(s,i),e()},function(){t.store.clear(),i()})):(t.store.clear(),i())})},setup:function(t,e,i){e=Ember.merge(Ember.merge({},this.content),e),i=!!i&&!this.get("isAuthenticated"),this.beginPropertyChanges(),this.setProperties({isAuthenticated:!0,authenticator:t,content:e}),this.bindToAuthenticatorEvents(),this.updateStore(),this.endPropertyChanges(),i&&this.trigger("sessionAuthenticationSucceeded")},clear:function(t){t=!!t&&this.get("isAuthenticated"),this.beginPropertyChanges(),this.setProperties({isAuthenticated:!1,authenticator:null,content:{}}),this.store.clear(),this.endPropertyChanges(),t&&this.trigger("sessionInvalidationSucceeded")},setUnknownProperty:function(t,e){var i=this._super(t,e);return this.updateStore(),i},updateStore:function(){var t=this.content;Ember.isEmpty(this.authenticator)||(t=Ember.merge({authenticator:this.authenticator},t)),Ember.isEmpty(t)||this.store.persist(t)},bindToAuthenticatorEvents:function(){var t=this,e=this.container.lookup(this.authenticator);e.off("sessionDataUpdated"),e.off("sessionDataInvalidated"),e.on("sessionDataUpdated",function(e){t.setup(t.authenticator,e)}),e.on("sessionDataInvalidated",function(){t.clear(!0)})},bindToStoreEvents:function(){var t=this;this.store.on("sessionDataUpdated",function(e){var i=e.authenticator;i?(delete e.authenticator,t.container.lookup(i).restore(e).then(function(e){t.setup(i,e,!0)},function(){t.clear(!0)})):t.clear(!0)})}.observes("store")})}),e("simple-auth/setup",["./configuration","./session","./stores/local-storage","./stores/ephemeral","exports"],function(t,e,i,n,s){"use strict";function r(t){if("string"===Ember.typeOf(t)){var e=document.createElement("a");e.href=t,e.href=e.href,t=e}var i=t.port;return Ember.isEmpty(i)&&(i="http:"===t.protocol?"80":"https:"===t.protocol?"443":""),t.protocol+"//"+t.hostname+(""!==i?":"+i:"")}function o(t){if(t.crossDomain===!1)return!0;var e=d[t.url]=d[t.url]||r(t.url);return u.indexOf(e)>-1}function a(t){t.register("simple-auth-session-store:local-storage",h),t.register("simple-auth-session-store:ephemeral",f),t.register("simple-auth-session:main",c)}var u,l=t["default"],c=e["default"],h=i["default"],f=n["default"],d={};s["default"]=function(t,e){l.load(t),e.deferReadiness(),a(t);var i=t.lookup(l.store),n=t.lookup(l.session);if(n.setProperties({store:i,container:t}),Ember.A(["controller","route"]).forEach(function(e){t.injection(e,l.sessionPropertyName,l.session)}),u=Ember.A(l.crossOriginWhitelist).map(function(t){return r(t)}),Ember.isEmpty(l.authorizer))Ember.Logger.info("No authorizer was configured for Ember Simple Auth - specify one if backend requests need to be authorized.");else{var s=t.lookup(l.authorizer);s&&(s.set("session",n),Ember.$.ajaxPrefilter(function(t,e,i){!s.isDestroyed&&o(t)&&(i.__simple_auth_authorized__=!0,s.authorize(i,t))}),Ember.$(document).ajaxError(function(t,e){e.__simple_auth_authorized__&&401===e.status&&n.trigger("authorizationFailed")}))}var c=function(){e.advanceReadiness()};n.restore().then(c,c)}}),e("simple-auth/stores/base",["../utils/flat-objects-are-equal","exports"],function(t,e){"use strict";t["default"];e["default"]=Ember.Object.extend(Ember.Evented,{persist:function(){},restore:function(){return{}},clear:function(){}})}),e("simple-auth/stores/ephemeral",["./base","exports"],function(t,e){"use strict";var i=t["default"];e["default"]=i.extend({init:function(){this.clear()},persist:function(t){this._data=JSON.stringify(t||{})},restore:function(){return JSON.parse(this._data)||{}},clear:function(){delete this._data,this._data="{}"}})}),e("simple-auth/stores/local-storage",["./base","../utils/flat-objects-are-equal","simple-auth/utils/get-global-config","exports"],function(t,e,i,n){"use strict";var s=t["default"],r=e["default"],o=i["default"];n["default"]=s.extend({key:"ember_simple_auth:session",init:function(){var t=o("simple-auth");this.key=t.localStorageKey||this.key,this.bindToStorageEvents()},persist:function(t){t=JSON.stringify(t||{}),localStorage.setItem(this.key,t),this._lastData=this.restore()},restore:function(){var t=localStorage.getItem(this.key);return JSON.parse(t)||{}},clear:function(){localStorage.removeItem(this.key),this._lastData=null},bindToStorageEvents:function(){var t=this;Ember.$(window).bind("storage",function(){var e=t.restore();r(e,t._lastData)||(t._lastData=e,t.trigger("sessionDataUpdated",e))})}})}),e("simple-auth/utils/flat-objects-are-equal",["exports"],function(t){"use strict";t["default"]=function(t,e){function i(t){var e=[];for(var i in t)e.push([i,t[i]]);return e.sort(function(t,e){return t[0]<e[0]?-1:t[0]>e[0]?1:0})}return JSON.stringify(i(t))===JSON.stringify(i(e))}}),e("simple-auth/utils/get-global-config",["exports"],function(t){"use strict";var e="undefined"!=typeof window?window:{};t["default"]=function(t){return(e.ENV||{})[t]||{}}}),e("simple-auth/utils/is-secure-url",["exports"],function(t){"use strict";t["default"]=function(t){var e=document.createElement("a");return e.href=t,e.href=e.href,"https:"==e.protocol}});var n=(i("simple-auth/initializer")["default"],i("simple-auth/configuration")["default"]),s=i("simple-auth/session")["default"],r=i("simple-auth/authenticators/base")["default"],o=i("simple-auth/authorizers/base")["default"],a=i("simple-auth/stores/base")["default"],u=i("simple-auth/stores/local-storage")["default"],l=i("simple-auth/stores/ephemeral")["default"],c=i("simple-auth/utils/flat-objects-are-equal")["default"],h=i("simple-auth/utils/is-secure-url")["default"],f=i("simple-auth/utils/get-global-config")["default"],d=i("simple-auth/mixins/application-route-mixin")["default"],p=i("simple-auth/mixins/authenticated-route-mixin")["default"],m=i("simple-auth/mixins/authentication-controller-mixin")["default"],g=i("simple-auth/mixins/login-controller-mixin")["default"],b=i("simple-auth/mixins/unauthenticated-route-mixin")["default"];t.SimpleAuth={Configuration:n,Session:s,Authenticators:{Base:r},Authorizers:{Base:o},Stores:{Base:a,LocalStorage:u,Ephemeral:l},Utils:{flatObjectsAreEqual:c,isSecureUrl:h,getGlobalConfig:f},ApplicationRouteMixin:d,AuthenticatedRouteMixin:p,AuthenticationControllerMixin:m,LoginControllerMixin:g,UnauthenticatedRouteMixin:b},i("simple-auth/ember"),Ember.libraries.register("Ember Simple Auth","0.6.5")}("undefined"!=typeof global?global:window); | Kaakati/cdnjs | ajax/libs/ember-simple-auth/0.6.5/simple-auth.min.js | JavaScript | mit | 13,078 |
<?php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Twig_NodeVisitor_Escaper implements output escaping.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface
{
protected $statusStack = array();
protected $blocks = array();
protected $safeAnalysis;
protected $traverser;
protected $defaultStrategy = false;
protected $safeVars = array();
public function __construct()
{
$this->safeAnalysis = new Twig_NodeVisitor_SafeAnalysis();
}
/**
* Called before child nodes are visited.
*
* @param Twig_NodeInterface $node The node to visit
* @param Twig_Environment $env The Twig environment instance
*
* @return Twig_NodeInterface The modified node
*/
public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
{
if ($node instanceof Twig_Node_Module) {
if ($env->hasExtension('escaper') && $defaultStrategy = $env->getExtension('escaper')->getDefaultStrategy($node->getAttribute('filename'))) {
$this->defaultStrategy = $defaultStrategy;
}
$this->safeVars = array();
} elseif ($node instanceof Twig_Node_AutoEscape) {
$this->statusStack[] = $node->getAttribute('value');
} elseif ($node instanceof Twig_Node_Block) {
$this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env);
} elseif ($node instanceof Twig_Node_Import) {
$this->safeVars[] = $node->getNode('var')->getAttribute('name');
}
return $node;
}
/**
* Called after child nodes are visited.
*
* @param Twig_NodeInterface $node The node to visit
* @param Twig_Environment $env The Twig environment instance
*
* @return Twig_NodeInterface The modified node
*/
public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
{
if ($node instanceof Twig_Node_Module) {
$this->defaultStrategy = false;
$this->safeVars = array();
} elseif ($node instanceof Twig_Node_Expression_Filter) {
return $this->preEscapeFilterNode($node, $env);
} elseif ($node instanceof Twig_Node_Print) {
return $this->escapePrintNode($node, $env, $this->needEscaping($env));
}
if ($node instanceof Twig_Node_AutoEscape || $node instanceof Twig_Node_Block) {
array_pop($this->statusStack);
} elseif ($node instanceof Twig_Node_BlockReference) {
$this->blocks[$node->getAttribute('name')] = $this->needEscaping($env);
}
return $node;
}
protected function escapePrintNode(Twig_Node_Print $node, Twig_Environment $env, $type)
{
if (false === $type) {
return $node;
}
$expression = $node->getNode('expr');
if ($this->isSafeFor($type, $expression, $env)) {
return $node;
}
$class = get_class($node);
return new $class(
$this->getEscaperFilter($type, $expression),
$node->getLine()
);
}
protected function preEscapeFilterNode(Twig_Node_Expression_Filter $filter, Twig_Environment $env)
{
$name = $filter->getNode('filter')->getAttribute('value');
$type = $env->getFilter($name)->getPreEscape();
if (null === $type) {
return $filter;
}
$node = $filter->getNode('node');
if ($this->isSafeFor($type, $node, $env)) {
return $filter;
}
$filter->setNode('node', $this->getEscaperFilter($type, $node));
return $filter;
}
protected function isSafeFor($type, Twig_NodeInterface $expression, $env)
{
$safe = $this->safeAnalysis->getSafe($expression);
if (null === $safe) {
if (null === $this->traverser) {
$this->traverser = new Twig_NodeTraverser($env, array($this->safeAnalysis));
}
$this->safeAnalysis->setSafeVars($this->safeVars);
$this->traverser->traverse($expression);
$safe = $this->safeAnalysis->getSafe($expression);
}
return in_array($type, $safe) || in_array('all', $safe);
}
protected function needEscaping(Twig_Environment $env)
{
if (count($this->statusStack)) {
return $this->statusStack[count($this->statusStack) - 1];
}
return $this->defaultStrategy ? $this->defaultStrategy : false;
}
protected function getEscaperFilter($type, Twig_NodeInterface $node)
{
$line = $node->getLine();
$name = new Twig_Node_Expression_Constant('escape', $line);
$args = new Twig_Node(array(new Twig_Node_Expression_Constant((string) $type, $line), new Twig_Node_Expression_Constant(null, $line), new Twig_Node_Expression_Constant(true, $line)));
return new Twig_Node_Expression_Filter($node, $name, $args, $line);
}
/**
* {@inheritdoc}
*/
public function getPriority()
{
return 0;
}
}
| paxappturbo/blogSymfony | vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php | PHP | mit | 5,366 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../clike/clike"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../clike/clike"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
var keywords = ("this super static final const abstract class extends external factory " +
"implements get native operator set typedef with enum throw rethrow " +
"assert break case continue default in return new deferred async await " +
"try catch finally do else for if switch while import library export " +
"part of show hide is").split(" ");
var blockKeywords = "try catch finally do else for if switch while".split(" ");
var atoms = "true false null".split(" ");
var builtins = "void bool num int double dynamic var String".split(" ");
function set(words) {
var obj = {};
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
CodeMirror.defineMIME("application/dart", {
name: "clike",
keywords: set(keywords),
multiLineStrings: true,
blockKeywords: set(blockKeywords),
builtin: set(builtins),
atoms: set(atoms),
hooks: {
"@": function(stream) {
stream.eatWhile(/[\w\$_]/);
return "meta";
}
}
});
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
// This is needed to make loading through meta.js work.
CodeMirror.defineMode("dart", function(conf) {
return CodeMirror.getMode(conf, "application/dart");
}, "clike");
});
| Sneezry/cdnjs | ajax/libs/codemirror/4.12.0/mode/dart/dart.js | JavaScript | mit | 1,820 |
.remodal-bg.remodal-is-opened,.remodal-bg.remodal-is-opening{-webkit-filter:blur(3px);filter:blur(3px)}.remodal-overlay{background:rgba(43,46,56,.9)}.remodal-overlay.remodal-is-closing,.remodal-overlay.remodal-is-opening{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.remodal-overlay.remodal-is-opening{-webkit-animation-name:remodal-overlay-opening-keyframes;animation-name:remodal-overlay-opening-keyframes}.remodal-overlay.remodal-is-closing{-webkit-animation-name:remodal-overlay-closing-keyframes;animation-name:remodal-overlay-closing-keyframes}.remodal-wrapper{padding:10px 10px 0}.remodal{box-sizing:border-box;width:100%;margin-bottom:10px;padding:35px;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);color:#2b2e38;background:#fff}.remodal-close,.remodal-close:before{position:absolute;top:0;left:0;display:block;width:35px}.remodal-cancel,.remodal-close,.remodal-confirm{overflow:visible;margin:0;cursor:pointer;text-decoration:none;outline:0;border:0}.remodal.remodal-is-closing,.remodal.remodal-is-opening{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.remodal.remodal-is-opening{-webkit-animation-name:remodal-opening-keyframes;animation-name:remodal-opening-keyframes}.remodal.remodal-is-closing{-webkit-animation-name:remodal-closing-keyframes;animation-name:remodal-closing-keyframes}.remodal,.remodal-wrapper:after{vertical-align:middle}.remodal-close{height:35px;padding:0;-webkit-transition:color .2s;transition:color .2s;color:#95979c;background:0 0}.remodal-close:focus,.remodal-close:hover{color:#2b2e38}.remodal-close:before{font-family:Arial,"Helvetica CY","Nimbus Sans L",sans-serif!important;font-size:25px;line-height:35px;content:"\00d7";text-align:center}.remodal-cancel,.remodal-confirm{font:inherit;display:inline-block;min-width:110px;padding:12px 0;-webkit-transition:background .2s;transition:background .2s;text-align:center;vertical-align:middle}.remodal-confirm{color:#fff;background:#81c784}.remodal-confirm:focus,.remodal-confirm:hover{background:#66bb6a}.remodal-cancel{color:#fff;background:#e57373}.remodal-cancel:focus,.remodal-cancel:hover{background:#ef5350}.remodal-cancel::-moz-focus-inner,.remodal-close::-moz-focus-inner,.remodal-confirm::-moz-focus-inner{padding:0;border:0}@-webkit-keyframes remodal-opening-keyframes{from{-webkit-transform:scale(1.05);transform:scale(1.05);opacity:0}to{-webkit-transform:none;transform:none;opacity:1}}@keyframes remodal-opening-keyframes{from{-webkit-transform:scale(1.05);transform:scale(1.05);opacity:0}to{-webkit-transform:none;transform:none;opacity:1}}@-webkit-keyframes remodal-closing-keyframes{from{-webkit-transform:scale(1);transform:scale(1);opacity:1}to{-webkit-transform:scale(.95);transform:scale(.95);opacity:0}}@keyframes remodal-closing-keyframes{from{-webkit-transform:scale(1);transform:scale(1);opacity:1}to{-webkit-transform:scale(.95);transform:scale(.95);opacity:0}}@-webkit-keyframes remodal-overlay-opening-keyframes{from{opacity:0}to{opacity:1}}@keyframes remodal-overlay-opening-keyframes{from{opacity:0}to{opacity:1}}@-webkit-keyframes remodal-overlay-closing-keyframes{from{opacity:1}to{opacity:0}}@keyframes remodal-overlay-closing-keyframes{from{opacity:1}to{opacity:0}}@media only screen and (min-width:641px){.remodal{max-width:700px}}.lt-ie9 .remodal-overlay{background:#2b2e38}.lt-ie9 .remodal{width:700px}/*# sourceMappingURL=remodal-default-theme.min.css.map */ | jdh8/cdnjs | ajax/libs/remodal/1.1.0/remodal-default-theme.min.css | CSS | mit | 3,551 |
'use strict';
/**
* Module dependencies.
*/
var init = require('./config/init')(),
config = require('./config/config'),
mongoose = require('mongoose'),
chalk = require('chalk');
/**
* Main application entry file.
* Please note that the order of loading is important.
*/
// Bootstrap db connection
var db = mongoose.connect(config.db.uri, config.db.options, function(err) {
if (err) {
console.error(chalk.red('Could not connect to MongoDB!'));
console.log(chalk.red(err));
}
});
mongoose.connection.on('error', function(err) {
console.error(chalk.red('MongoDB connection error: ' + err));
process.exit(-1);
}
);
// Init the express application
var app = require('./config/express')(db);
// Bootstrap passport config
require('./config/passport')();
// Start the app by listening on <port>
app.listen(config.port);
// Expose app
exports = module.exports = app;
// Logging initialization
console.log('--');
console.log(chalk.green(config.app.title + ' application started'));
console.log(chalk.green('Environment:\t\t\t' + process.env.NODE_ENV));
console.log(chalk.green('Port:\t\t\t\t' + config.port));
console.log(chalk.green('Database:\t\t\t' + config.db.uri));
if (process.env.NODE_ENV === 'secure') {
console.log(chalk.green('HTTPs:\t\t\t\ton'));
}
console.log('--'); | kinuz/meanjsStudy | server.js | JavaScript | mit | 1,293 |
(function($){$.fn.markItUp=function(settings,extraSettings){var method,params,options,ctrlKey,shiftKey,altKey;ctrlKey=shiftKey=altKey=false;if(typeof settings=="string"){method=settings;params=extraSettings}options={id:"",nameSpace:"",root:"",previewHandler:false,previewInWindow:"",previewInElement:"",previewAutoRefresh:true,previewPosition:"after",previewTemplatePath:"~/templates/preview.html",previewParser:false,previewParserPath:"",previewParserVar:"data",resizeHandle:true,beforeInsert:"",afterInsert:"",onEnter:{},onShiftEnter:{},onCtrlEnter:{},onTab:{},markupSet:[{}]};$.extend(options,settings,extraSettings);if(!options.root){$("script").each(function(a,tag){miuScript=$(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/);if(miuScript!==null){options.root=miuScript[1]}})}var uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"}};var matched=uaMatch(navigator.userAgent);var browser={};if(matched.browser){browser[matched.browser]=true;browser.version=matched.version}if(browser.chrome){browser.webkit=true}else{if(browser.webkit){browser.safari=true}}return this.each(function(){var $$,textarea,levels,scrollPosition,caretPosition,caretOffset,clicked,hash,header,footer,previewWindow,template,iFrame,abort;$$=$(this);textarea=this;levels=[];abort=false;scrollPosition=caretPosition=0;caretOffset=-1;options.previewParserPath=localize(options.previewParserPath);options.previewTemplatePath=localize(options.previewTemplatePath);if(method){switch(method){case"remove":remove();break;case"insert":markup(params);break;default:$.error("Method "+method+" does not exist on jQuery.markItUp")}return}function localize(data,inText){if(inText){return data.replace(/("|')~\//g,"$1"+options.root)}return data.replace(/^~\//,options.root)}function init(){id="";nameSpace="";if(options.id){id='id="'+options.id+'"'}else{if($$.attr("id")){id='id="markItUp'+($$.attr("id").substr(0,1).toUpperCase())+($$.attr("id").substr(1))+'"'}}if(options.nameSpace){nameSpace='class="'+options.nameSpace+'"'}$$.wrap("<div "+nameSpace+"></div>");$$.wrap("<div "+id+' class="markItUp"></div>');$$.wrap('<div class="markItUpContainer"></div>');$$.addClass("markItUpEditor");header=$('<div class="markItUpHeader"></div>').insertBefore($$);$(dropMenus(options.markupSet)).appendTo(header);footer=$('<div class="markItUpFooter"></div>').insertAfter($$);if(options.resizeHandle===true&&browser.safari!==true){resizeHandle=$('<div class="markItUpResizeHandle"></div>').insertAfter($$).bind("mousedown.markItUp",function(e){var h=$$.height(),y=e.clientY,mouseMove,mouseUp;mouseMove=function(e){$$.css("height",Math.max(20,e.clientY+h-y)+"px");return false};mouseUp=function(e){$("html").unbind("mousemove.markItUp",mouseMove).unbind("mouseup.markItUp",mouseUp);return false};$("html").bind("mousemove.markItUp",mouseMove).bind("mouseup.markItUp",mouseUp)});footer.append(resizeHandle)}$$.bind("keydown.markItUp",keyPressed).bind("keyup",keyPressed);$$.bind("insertion.markItUp",function(e,settings){if(settings.target!==false){get()}if(textarea===$.markItUp.focused){markup(settings)}});$$.bind("focus.markItUp",function(){$.markItUp.focused=this});if(options.previewInElement){refreshPreview()}}function dropMenus(markupSet){var ul=$("<ul></ul>"),i=0;$("li:hover > ul",ul).css("display","block");$.each(markupSet,function(){var button=this,t="",title,li,j;title=(button.key)?(button.name||"")+" [Ctrl+"+button.key+"]":(button.name||"");key=(button.key)?'accesskey="'+button.key+'"':"";if(button.separator){li=$('<li class="markItUpSeparator">'+(button.separator||"")+"</li>").appendTo(ul)}else{i++;for(j=levels.length-1;j>=0;j--){t+=levels[j]+"-"}li=$('<li class="markItUpButton markItUpButton'+t+(i)+" "+(button.className||"")+'"><a href="" '+key+' title="'+title+'">'+(button.name||"")+"</a></li>").bind("contextmenu.markItUp",function(){return false}).bind("click.markItUp",function(e){e.preventDefault()}).bind("focusin.markItUp",function(){$$.focus()}).bind("mouseup",function(){if(button.call){eval(button.call)()}setTimeout(function(){markup(button)},1);return false}).bind("mouseenter.markItUp",function(){$("> ul",this).show();$(document).one("click",function(){$("ul ul",header).hide()})}).bind("mouseleave.markItUp",function(){$("> ul",this).hide()}).appendTo(ul);if(button.dropMenu){levels.push(i);$(li).addClass("markItUpDropMenu").append(dropMenus(button.dropMenu))}}});levels.pop();return ul}function magicMarkups(string){if(string){string=string.toString();string=string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,function(x,a){var b=a.split("|!|");if(altKey===true){return(b[1]!==undefined)?b[1]:b[0]}else{return(b[1]===undefined)?"":b[0]}});string=string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,function(x,a){var b=a.split(":!:");if(abort===true){return false}value=prompt(b[0],(b[1])?b[1]:"");if(value===null){abort=true}return value});return string}return""}function prepare(action){if($.isFunction(action)){action=action(hash)}return magicMarkups(action)}function build(string){var openWith=prepare(clicked.openWith);var placeHolder=prepare(clicked.placeHolder);var replaceWith=prepare(clicked.replaceWith);var closeWith=prepare(clicked.closeWith);var openBlockWith=prepare(clicked.openBlockWith);var closeBlockWith=prepare(clicked.closeBlockWith);var multiline=clicked.multiline;if(replaceWith!==""){block=openWith+replaceWith+closeWith}else{if(selection===""&&placeHolder!==""){block=openWith+placeHolder+closeWith}else{string=string||selection;var lines=[string],blocks=[];if(multiline===true){lines=string.split(/\r?\n/)}for(var l=0;l<lines.length;l++){line=lines[l];var trailingSpaces;if(trailingSpaces=line.match(/ *$/)){blocks.push(openWith+line.replace(/ *$/g,"")+closeWith+trailingSpaces)}else{blocks.push(openWith+line+closeWith)}}block=blocks.join("\n")}}block=openBlockWith+block+closeBlockWith;return{block:block,openBlockWith:openBlockWith,openWith:openWith,replaceWith:replaceWith,placeHolder:placeHolder,closeWith:closeWith,closeBlockWith:closeBlockWith}}function markup(button){var len,j,n,i;hash=clicked=button;get();$.extend(hash,{line:"",root:options.root,textarea:textarea,selection:(selection||""),caretPosition:caretPosition,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey});prepare(options.beforeInsert);prepare(clicked.beforeInsert);if((ctrlKey===true&&shiftKey===true)||button.multiline===true){prepare(clicked.beforeMultiInsert)}$.extend(hash,{line:1});if((ctrlKey===true&&shiftKey===true)){lines=selection.split(/\r?\n/);for(j=0,n=lines.length,i=0;i<n;i++){if($.trim(lines[i])!==""){$.extend(hash,{line:++j,selection:lines[i]});lines[i]=build(lines[i]).block}else{lines[i]=""}}string={block:lines.join("\n")};start=caretPosition;len=string.block.length+((browser.opera)?n-1:0)}else{if(ctrlKey===true){string=build(selection);start=caretPosition+string.openWith.length;len=string.block.length-string.openWith.length-string.closeWith.length;len=len-(string.block.match(/ $/)?1:0);len-=fixIeBug(string.block)}else{if(shiftKey===true){string=build(selection);start=caretPosition;len=string.block.length;len-=fixIeBug(string.block)}else{string=build(selection);start=caretPosition+string.block.length;len=0;start-=fixIeBug(string.block)}}}if((selection===""&&string.replaceWith==="")){caretOffset+=fixOperaBug(string.block);start=caretPosition+string.openBlockWith.length+string.openWith.length;len=string.block.length-string.openBlockWith.length-string.openWith.length-string.closeWith.length-string.closeBlockWith.length;caretOffset=$$.val().substring(caretPosition,$$.val().length).length;caretOffset-=fixOperaBug($$.val().substring(0,caretPosition))}$.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition});if(string.block!==selection&&abort===false){insert(string.block);set(start,len)}else{caretOffset=-1}get();$.extend(hash,{line:"",selection:selection});if((ctrlKey===true&&shiftKey===true)||button.multiline===true){prepare(clicked.afterMultiInsert)}prepare(clicked.afterInsert);prepare(options.afterInsert);if(previewWindow&&options.previewAutoRefresh){refreshPreview()}shiftKey=altKey=ctrlKey=abort=false}function fixOperaBug(string){if(browser.opera){return string.length-string.replace(/\n*/g,"").length}return 0}function fixIeBug(string){if(browser.msie){return string.length-string.replace(/\r*/g,"").length}return 0}function insert(block){if(document.selection){var newSelection=document.selection.createRange();newSelection.text=block}else{textarea.value=textarea.value.substring(0,caretPosition)+block+textarea.value.substring(caretPosition+selection.length,textarea.value.length)}}function set(start,len){if(textarea.createTextRange){if(browser.opera&&browser.version>=9.5&&len==0){return false}range=textarea.createTextRange();range.collapse(true);range.moveStart("character",start);range.moveEnd("character",len);range.select()}else{if(textarea.setSelectionRange){textarea.setSelectionRange(start,start+len)}}textarea.scrollTop=scrollPosition;textarea.focus()}function get(){textarea.focus();scrollPosition=textarea.scrollTop;if(document.selection){selection=document.selection.createRange().text;if(browser.msie){var range=document.selection.createRange(),rangeCopy=range.duplicate();rangeCopy.moveToElementText(textarea);caretPosition=-1;while(rangeCopy.inRange(range)){rangeCopy.moveStart("character");caretPosition++}}else{caretPosition=textarea.selectionStart}}else{caretPosition=textarea.selectionStart;selection=textarea.value.substring(caretPosition,textarea.selectionEnd)}return selection}function preview(){if(typeof options.previewHandler==="function"){previewWindow=true}else{if(options.previewInElement){previewWindow=$(options.previewInElement)}else{if(!previewWindow||previewWindow.closed){if(options.previewInWindow){previewWindow=window.open("","preview",options.previewInWindow);$(window).unload(function(){previewWindow.close()})}else{iFrame=$('<iframe class="markItUpPreviewFrame"></iframe>');if(options.previewPosition=="after"){iFrame.insertAfter(footer)}else{iFrame.insertBefore(header)}previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]}}else{if(altKey===true){if(iFrame){iFrame.remove()}else{previewWindow.close()}previewWindow=iFrame=false}}}}if(!options.previewAutoRefresh){refreshPreview()}if(options.previewInWindow){previewWindow.focus()}}function refreshPreview(){renderPreview()}function renderPreview(){var phtml;if(options.previewHandler&&typeof options.previewHandler==="function"){options.previewHandler($$.val())}else{if(options.previewParser&&typeof options.previewParser==="function"){var data=options.previewParser($$.val());writeInPreview(localize(data,1))}else{if(options.previewParserPath!==""){$.ajax({type:"POST",dataType:"text",global:false,url:options.previewParserPath,data:options.previewParserVar+"="+encodeURIComponent($$.val()),success:function(data){writeInPreview(localize(data,1))}})}else{if(!template){$.ajax({url:options.previewTemplatePath,dataType:"text",global:false,success:function(data){writeInPreview(localize(data,1).replace(/<!-- content -->/g,$$.val()))}})}}}}return false}function writeInPreview(data){if(options.previewInElement){$(options.previewInElement).html(data)}else{if(previewWindow&&previewWindow.document){try{sp=previewWindow.document.documentElement.scrollTop}catch(e){sp=0}previewWindow.document.open();previewWindow.document.write(data);previewWindow.document.close();previewWindow.document.documentElement.scrollTop=sp}}}function keyPressed(e){shiftKey=e.shiftKey;altKey=e.altKey;ctrlKey=(!(e.altKey&&e.ctrlKey))?(e.ctrlKey||e.metaKey):false;if(e.type==="keydown"){if(ctrlKey===true){li=$('a[accesskey="'+((e.keyCode==13)?"\\n":String.fromCharCode(e.keyCode))+'"]',header).parent("li");if(li.length!==0){ctrlKey=false;setTimeout(function(){li.triggerHandler("mouseup")},1);return false}}if(e.keyCode===13||e.keyCode===10){if(ctrlKey===true){ctrlKey=false;markup(options.onCtrlEnter);return options.onCtrlEnter.keepDefault}else{if(shiftKey===true){shiftKey=false;markup(options.onShiftEnter);return options.onShiftEnter.keepDefault}else{markup(options.onEnter);return options.onEnter.keepDefault}}}if(e.keyCode===9){if(shiftKey==true||ctrlKey==true||altKey==true){return false}if(caretOffset!==-1){get();caretOffset=$$.val().length-caretOffset;set(caretOffset,0);caretOffset=-1;return false}else{markup(options.onTab);return options.onTab.keepDefault}}}}function remove(){$$.unbind(".markItUp").removeClass("markItUpEditor");$$.parent("div").parent("div.markItUp").parent("div").replaceWith($$);$$.data("markItUp",null)}init()})};$.fn.markItUpRemove=function(){return this.each(function(){$(this).markItUp("remove")})};$.markItUp=function(settings){var options={target:false};$.extend(options,settings);if(options.target){return $(options.target).each(function(){$(this).focus();$(this).trigger("insertion",[options])})}else{$("textarea").trigger("insertion",[options])}}})(jQuery);
var markitup_sonataMarkdownSettings={previewParserPath:"",onShiftEnter:{keepDefault:false,openWith:"\n\n"},markupSet:[{name:"First Level Heading",key:"1",placeHolder:"Your title here...",closeWith:function(a){return miu.markdownTitle(a,"=")}},{name:"Second Level Heading",key:"2",placeHolder:"Your title here...",closeWith:function(a){return miu.markdownTitle(a,"-")}},{name:"Heading 3",key:"3",openWith:"### ",placeHolder:"Your title here..."},{name:"Heading 4",key:"4",openWith:"#### ",placeHolder:"Your title here..."},{name:"Heading 5",key:"5",openWith:"##### ",placeHolder:"Your title here..."},{name:"Heading 6",key:"6",openWith:"###### ",placeHolder:"Your title here..."},{separator:"---------------"},{name:"Bold",key:"B",openWith:"**",closeWith:"**"},{name:"Italic",key:"I",openWith:"_",closeWith:"_"},{separator:"---------------"},{name:"Bulleted List",openWith:"- "},{name:"Numeric List",openWith:function(a){return a.line+". "}},{separator:"---------------"},{name:"Picture",key:"P",replaceWith:'![[![Alternative text]!]]([![Url:!:http://]!] "[![Title]!]")'},{name:"Link",key:"L",openWith:"[",closeWith:']([![Url:!:http://]!] "[![Title]!]")',placeHolder:"Your text to link here..."},{separator:"---------------"},{name:"Quotes",openWith:"> "},{name:"Code Block / Code",openWith:"(!(\t|!|`)!)",closeWith:"(!(`)!)"}]};miu={markdownTitle:function(b,a){heading="";n=$.trim(b.selection||b.placeHolder).length;for(i=0;i<n;i++){heading+=a}return"\n"+heading}};
var markitup_sonataHtmlSettings={onShiftEnter:{keepDefault:false,replaceWith:"<br />\n"},onCtrlEnter:{keepDefault:false,openWith:"\n<p>",closeWith:"</p>\n"},onTab:{keepDefault:false,openWith:" "},markupSet:[{name:"Heading 1",key:"1",openWith:'<h1(!( class="[![Class]!]")!)>',closeWith:"</h1>",placeHolder:"Your title here..."},{name:"Heading 2",key:"2",openWith:'<h2(!( class="[![Class]!]")!)>',closeWith:"</h2>",placeHolder:"Your title here..."},{name:"Heading 3",key:"3",openWith:'<h3(!( class="[![Class]!]")!)>',closeWith:"</h3>",placeHolder:"Your title here..."},{name:"Heading 4",key:"4",openWith:'<h4(!( class="[![Class]!]")!)>',closeWith:"</h4>",placeHolder:"Your title here..."},{name:"Heading 5",key:"5",openWith:'<h5(!( class="[![Class]!]")!)>',closeWith:"</h5>",placeHolder:"Your title here..."},{name:"Heading 6",key:"6",openWith:'<h6(!( class="[![Class]!]")!)>',closeWith:"</h6>",placeHolder:"Your title here..."},{name:"Paragraph",openWith:'<p(!( class="[![Class]!]")!)>',closeWith:"</p>"},{separator:"---------------"},{name:"Bold",key:"B",openWith:"(!(<strong>|!|<b>)!)",closeWith:"(!(</strong>|!|</b>)!)"},{name:"Italic",key:"I",openWith:"(!(<em>|!|<i>)!)",closeWith:"(!(</em>|!|</i>)!)"},{name:"Stroke through",key:"S",openWith:"<del>",closeWith:"</del>"},{separator:"---------------"},{name:"Ul",openWith:"<ul>\n",closeWith:"</ul>\n"},{name:"Ol",openWith:"<ol>\n",closeWith:"</ol>\n"},{name:"Li",openWith:"<li>",closeWith:"</li>"},{separator:"---------------"},{name:"Picture",key:"P",replaceWith:'<img src="[![Source:!:http://]!]" alt="[![Alternative text]!]" />'},{name:"Link",key:"L",openWith:'<a href="[![Link:!:http://]!]"(!( title="[![Title]!]")!)>',closeWith:"</a>",placeHolder:"Your text to link..."}]};
var markitup_sonataTextileSettings={previewParserPath:"",onShiftEnter:{keepDefault:false,replaceWith:"\n\n"},markupSet:[{name:"Heading 1",key:"1",openWith:"h1(!(([![Class]!]))!). ",placeHolder:"Your title here..."},{name:"Heading 2",key:"2",openWith:"h2(!(([![Class]!]))!). ",placeHolder:"Your title here..."},{name:"Heading 3",key:"3",openWith:"h3(!(([![Class]!]))!). ",placeHolder:"Your title here..."},{name:"Heading 4",key:"4",openWith:"h4(!(([![Class]!]))!). ",placeHolder:"Your title here..."},{name:"Heading 5",key:"5",openWith:"h5(!(([![Class]!]))!). ",placeHolder:"Your title here..."},{name:"Heading 6",key:"6",openWith:"h6(!(([![Class]!]))!). ",placeHolder:"Your title here..."},{name:"Paragraph",key:"P",openWith:"p(!(([![Class]!]))!). "},{separator:"---------------"},{name:"Bold",key:"B",closeWith:"*",openWith:"*"},{name:"Italic",key:"I",closeWith:"_",openWith:"_"},{name:"Stroke through",key:"S",closeWith:"-",openWith:"-"},{separator:"---------------"},{name:"Bulleted list",openWith:"(!(* |!|*)!)"},{name:"Numeric list",openWith:"(!(# |!|#)!)"},{separator:"---------------"},{name:"Picture",replaceWith:"![![Source:!:http://]!]([![Alternative text]!])!"},{name:"Link",openWith:'"',closeWith:'([![Title]!])":[![Link:!:http://]!]',placeHolder:"Your text to link here..."},{separator:"---------------"},{name:"Quotes",openWith:"bq(!(([![Class]!]))!). "},{name:"Code",openWith:"@",closeWith:"@"}]}; | ThomasHaddad/reverse-engineering | web/assetic/sonata_formatter_js.js | JavaScript | mit | 17,720 |
/*
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
*/
/*
This is an optimized version of Dojo, built for deployment and not for
development. To get sources and documentation, please visit:
http://dojotoolkit.org
*/
//>>built
(function(_1,_2){var _3=function(){},_4=function(it){for(var p in it){return 0;}return 1;},_5={}.toString,_6=function(it){return _5.call(it)=="[object Function]";},_7=function(it){return _5.call(it)=="[object String]";},_8=function(it){return _5.call(it)=="[object Array]";},_9=function(_a,_b){if(_a){for(var i=0;i<_a.length;){_b(_a[i++]);}}},_c=function(_d,_e){for(var p in _e){_d[p]=_e[p];}return _d;},_f=function(_10,_11){return _c(new Error(_10),{src:"dojoLoader",info:_11});},_12=1,uid=function(){return "_"+_12++;},req=function(_13,_14,_15){return _16(_13,_14,_15,0,req);},_17=this,doc=_17.document,_18=doc&&doc.createElement("DiV"),has=req.has=function(_19){return _6(_1a[_19])?(_1a[_19]=_1a[_19](_17,doc,_18)):_1a[_19];},_1a=has.cache=_2.hasCache;has.add=function(_1b,_1c,now,_1d){(_1a[_1b]===undefined||_1d)&&(_1a[_1b]=_1c);return now&&has(_1b);};0&&has.add("host-node",_1.has&&"host-node" in _1.has?_1.has["host-node"]:(typeof process=="object"&&process.versions&&process.versions.node&&process.versions.v8));if(0){require("./_base/configNode.js").config(_2);_2.loaderPatch.nodeRequire=require;}0&&has.add("host-rhino",_1.has&&"host-rhino" in _1.has?_1.has["host-rhino"]:(typeof load=="function"&&(typeof Packages=="function"||typeof Packages=="object")));if(0){for(var _1e=_1.baseUrl||".",arg,_1f=this.arguments,i=0;i<_1f.length;){arg=(_1f[i++]+"").split("=");if(arg[0]=="baseUrl"){_1e=arg[1];break;}}load(_1e+"/_base/configRhino.js");rhinoDojoConfig(_2,_1e,_1f);}for(var p in _1.has){has.add(p,_1.has[p],0,1);}var _20=1,_21=2,_22=3,_23=4,_24=5;if(0){_20="requested";_21="arrived";_22="not-a-module";_23="executing";_24="executed";}var _25=0,_26="sync",xd="xd",_27=[],_28=0,_29=_3,_2a=_3,_2b;if(1){req.isXdUrl=_3;req.initSyncLoader=function(_2c,_2d,_2e){if(!_28){_28=_2c;_29=_2d;_2a=_2e;}return {sync:_26,requested:_20,arrived:_21,nonmodule:_22,executing:_23,executed:_24,syncExecStack:_27,modules:_2f,execQ:_30,getModule:_31,injectModule:_32,setArrived:_33,signal:_34,finishExec:_35,execModule:_36,dojoRequirePlugin:_28,getLegacyMode:function(){return _25;},guardCheckComplete:_37};};if(1){var _38=location.protocol,_39=location.host;req.isXdUrl=function(url){if(/^\./.test(url)){return false;}if(/^\/\//.test(url)){return true;}var _3a=url.match(/^([^\/\:]+\:)\/+([^\/]+)/);return _3a&&(_3a[1]!=_38||(_39&&_3a[2]!=_39));};1||has.add("dojo-xhr-factory",1);has.add("dojo-force-activex-xhr",1&&!doc.addEventListener&&window.location.protocol=="file:");has.add("native-xhr",typeof XMLHttpRequest!="undefined");if(has("native-xhr")&&!has("dojo-force-activex-xhr")){_2b=function(){return new XMLHttpRequest();};}else{for(var _3b=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],_3c,i=0;i<3;){try{_3c=_3b[i++];if(new ActiveXObject(_3c)){break;}}catch(e){}}_2b=function(){return new ActiveXObject(_3c);};}req.getXhr=_2b;has.add("dojo-gettext-api",1);req.getText=function(url,_3d,_3e){var xhr=_2b();xhr.open("GET",_3f(url),false);xhr.send(null);if(xhr.status==200||(!location.host&&!xhr.status)){if(_3e){_3e(xhr.responseText,_3d);}}else{throw _f("xhrFailed",xhr.status);}return xhr.responseText;};}}else{req.async=1;}var _40=new Function("return eval(arguments[0]);");req.eval=function(_41,_42){return _40(_41+"\r\n//# sourceURL="+_42);};var _43={},_44="error",_34=req.signal=function(_45,_46){var _47=_43[_45];_9(_47&&_47.slice(0),function(_48){_48.apply(null,_8(_46)?_46:[_46]);});},on=req.on=function(_49,_4a){var _4b=_43[_49]||(_43[_49]=[]);_4b.push(_4a);return {remove:function(){for(var i=0;i<_4b.length;i++){if(_4b[i]===_4a){_4b.splice(i,1);return;}}}};};var _4c=[],_4d={},_4e=[],_4f={},map=req.map={},_50=[],_2f={},_51="",_52={},_53="url:",_54={},_55={};if(1){var _56=function(_57){var p,_58,_59,now,m;for(p in _54){_58=_54[p];_59=p.match(/^url\:(.+)/);if(_59){_52[_53+_5a(_59[1],_57)]=_58;}else{if(p=="*now"){now=_58;}else{if(p!="*noref"){m=_5b(p,_57,true);_52[m.mid]=_52[_53+m.url]=_58;}}}}if(now){now(_5c(_57));}_54={};},_5d=function(s){return s.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,function(c){return "\\"+c;});},_5e=function(map,_5f){_5f.splice(0,_5f.length);for(var p in map){_5f.push([p,map[p],new RegExp("^"+_5d(p)+"(/|$)"),p.length]);}_5f.sort(function(lhs,rhs){return rhs[3]-lhs[3];});return _5f;},_60=function(_61){var _62=_61.name;if(!_62){_62=_61;_61={name:_62};}_61=_c({main:"main"},_61);_61.location=_61.location?_61.location:_62;if(_61.packageMap){map[_62]=_61.packageMap;}if(!_61.main.indexOf("./")){_61.main=_61.main.substring(2);}_4f[_62]=_61;},_63=[],_64=function(_65,_66,_67){for(var p in _65){if(p=="waitSeconds"){req.waitms=(_65[p]||0)*1000;}if(p=="cacheBust"){_51=_65[p]?(_7(_65[p])?_65[p]:(new Date()).getTime()+""):"";}if(p=="baseUrl"||p=="combo"){req[p]=_65[p];}if(1&&p=="async"){var _68=_65[p];req.legacyMode=_25=(_7(_68)&&/sync|legacyAsync/.test(_68)?_68:(!_68?_26:false));req.async=!_25;}if(_65[p]!==_1a){req.rawConfig[p]=_65[p];p!="has"&&has.add("config-"+p,_65[p],0,_66);}}if(!req.baseUrl){req.baseUrl="./";}if(!/\/$/.test(req.baseUrl)){req.baseUrl+="/";}for(p in _65.has){has.add(p,_65.has[p],0,_66);}_9(_65.packages,_60);for(var _69 in _65.packagePaths){_9(_65.packagePaths[_69],function(_6a){var _6b=_69+"/"+_6a;if(_7(_6a)){_6a={name:_6a};}_6a.location=_6b;_60(_6a);});}_5e(_c(map,_65.map),_50);_9(_50,function(_6c){_6c[1]=_5e(_6c[1],[]);if(_6c[0]=="*"){_50.star=_6c;}});_5e(_c(_4d,_65.paths),_4e);_9(_65.aliases,function(_6d){if(_7(_6d[0])){_6d[0]=new RegExp("^"+_5d(_6d[0])+"$");}_4c.push(_6d);});if(_66){_63.push({config:_65.config});}else{for(p in _65.config){var _6e=_31(p,_67);_6e.config=_c(_6e.config||{},_65.config[p]);}}if(_65.cache){_56();_54=_65.cache;if(_65.cache["*noref"]){_56();}}_34("config",[_65,req.rawConfig]);};if(has("dojo-cdn")||1){var _6f=doc.getElementsByTagName("script"),i=0,_70,_71,src,_72;while(i<_6f.length){_70=_6f[i++];if((src=_70.getAttribute("src"))&&(_72=src.match(/(((.*)\/)|^)dojo\.js(\W|$)/i))){_71=_72[3]||"";_2.baseUrl=_2.baseUrl||_71;src=(_70.getAttribute("data-dojo-config")||_70.getAttribute("djConfig"));if(src){_55=req.eval("({ "+src+" })","data-dojo-config");}if(0){var _73=_70.getAttribute("data-main");if(_73){_55.deps=_55.deps||[_73];}}break;}}}if(0){try{if(window.parent!=window&&window.parent.require){var doh=window.parent.require("doh");doh&&_c(_55,doh.testConfig);}}catch(e){}}req.rawConfig={};_64(_2,1);if(has("dojo-cdn")){_4f.dojo.location=_71;if(_71){_71+="/";}_4f.dijit.location=_71+"../dijit/";_4f.dojox.location=_71+"../dojox/";}_64(_1,1);_64(_55,1);}else{_4d=_2.paths;_4e=_2.pathsMapProg;_4f=_2.packs;_4c=_2.aliases;_50=_2.mapProgs;_2f=_2.modules;_52=_2.cache;_51=_2.cacheBust;req.rawConfig=_2;}if(0){req.combo=req.combo||{add:_3};var _74=0,_75=[],_76=null;}var _77=function(_78){_37(function(){_9(_78.deps,_32);if(0&&_74&&!_76){_76=setTimeout(function(){_74=0;_76=null;req.combo.done(function(_79,url){var _7a=function(){_7b(0,_79);_7c();};_75.push(_79);_7d=_79;req.injectUrl(url,_7a,_79);_7d=0;},req);},0);}});},_16=function(a1,a2,a3,_7e,_7f){var _80,_81;if(_7(a1)){_80=_31(a1,_7e,true);if(_80&&_80.executed){return _80.result;}throw _f("undefinedModule",a1);}if(!_8(a1)){_64(a1,0,_7e);a1=a2;a2=a3;}if(_8(a1)){if(!a1.length){a2&&a2();}else{_81="require*"+uid();for(var mid,_82=[],i=0;i<a1.length;){mid=a1[i++];_82.push(_31(mid,_7e));}_80=_c(_83("",_81,0,""),{injected:_21,deps:_82,def:a2||_3,require:_7e?_7e.require:req,gc:1});_2f[_80.mid]=_80;_77(_80);var _84=_85&&_25!=_26;_37(function(){_36(_80,_84);});if(!_80.executed){_30.push(_80);}_7c();}}return _7f;},_5c=function(_86){if(!_86){return req;}var _87=_86.require;if(!_87){_87=function(a1,a2,a3){return _16(a1,a2,a3,_86,_87);};_86.require=_c(_87,req);_87.module=_86;_87.toUrl=function(_88){return _5a(_88,_86);};_87.toAbsMid=function(mid){return _b6(mid,_86);};if(0){_87.undef=function(mid){req.undef(mid,_86);};}if(1){_87.syncLoadNls=function(mid){var _89=_5b(mid,_86),_8a=_2f[_89.mid];if(!_8a||!_8a.executed){_8b=_52[_89.mid]||_52[_53+_89.url];if(_8b){_8c(_8b);_8a=_2f[_89.mid];}}return _8a&&_8a.executed&&_8a.result;};}}return _87;},_30=[],_8d=[],_8e={},_8f=function(_90){_90.injected=_20;_8e[_90.mid]=1;if(_90.url){_8e[_90.url]=_90.pack||1;}_91();},_33=function(_92){_92.injected=_21;delete _8e[_92.mid];if(_92.url){delete _8e[_92.url];}if(_4(_8e)){_93();1&&_25==xd&&(_25=_26);}},_94=req.idle=function(){return !_8d.length&&_4(_8e)&&!_30.length&&!_85;},_95=function(_96,map){if(map){for(var i=0;i<map.length;i++){if(map[i][2].test(_96)){return map[i];}}}return 0;},_97=function(_98){var _99=[],_9a,_9b;_98=_98.replace(/\\/g,"/").split("/");while(_98.length){_9a=_98.shift();if(_9a==".."&&_99.length&&_9b!=".."){_99.pop();_9b=_99[_99.length-1];}else{if(_9a!="."){_99.push(_9b=_9a);}}}return _99.join("/");},_83=function(pid,mid,_9c,url){if(1){var xd=req.isXdUrl(url);return {pid:pid,mid:mid,pack:_9c,url:url,executed:0,def:0,isXd:xd,isAmd:!!(xd||(_4f[pid]&&_4f[pid].isAmd))};}else{return {pid:pid,mid:mid,pack:_9c,url:url,executed:0,def:0};}},_9d=function(mid,_9e,_9f,_a0,_a1,_a2,_a3,_a4){var pid,_a5,_a6,_a7,_a8,url,_a9,_aa,_ab;_ab=mid;_aa=/^\./.test(mid);if(/(^\/)|(\:)|(\.js$)/.test(mid)||(_aa&&!_9e)){return _83(0,mid,0,mid);}else{mid=_97(_aa?(_9e.mid+"/../"+mid):mid);if(/^\./.test(mid)){throw _f("irrationalPath",mid);}if(_9e){_a8=_95(_9e.mid,_a2);}_a8=_a8||_a2.star;_a8=_a8&&_95(mid,_a8[1]);if(_a8){mid=_a8[1]+mid.substring(_a8[3]);}_72=mid.match(/^([^\/]+)(\/(.+))?$/);pid=_72?_72[1]:"";if((_a5=_9f[pid])){mid=pid+"/"+(_a6=(_72[3]||_a5.main));}else{pid="";}var _ac=0,_ad=0;_9(_4c,function(_ae){var _af=mid.match(_ae[0]);if(_af&&_af.length>_ac){_ad=_6(_ae[1])?mid.replace(_ae[0],_ae[1]):_ae[1];}});if(_ad){return _9d(_ad,0,_9f,_a0,_a1,_a2,_a3,_a4);}_a9=_a0[mid];if(_a9){return _a4?_83(_a9.pid,_a9.mid,_a9.pack,_a9.url):_a0[mid];}}_a8=_95(mid,_a3);if(_a8){url=_a8[1]+mid.substring(_a8[3]);}else{if(pid){url=_a5.location+"/"+_a6;}else{if(has("config-tlmSiblingOfDojo")){url="../"+mid;}else{url=mid;}}}if(!(/(^\/)|(\:)/.test(url))){url=_a1+url;}url+=".js";return _83(pid,mid,_a5,_97(url));},_5b=function(mid,_b0,_b1){return _9d(mid,_b0,_4f,_2f,req.baseUrl,_b1?[]:_50,_b1?[]:_4e);},_b2=function(_b3,_b4,_b5){return _b3.normalize?_b3.normalize(_b4,function(mid){return _b6(mid,_b5);}):_b6(_b4,_b5);},_b7=0,_31=function(mid,_b8,_b9){var _ba,_bb,_bc,_bd;_ba=mid.match(/^(.+?)\!(.*)$/);if(_ba){_bb=_31(_ba[1],_b8,_b9);if(1&&_25==_26&&!_bb.executed){_32(_bb);if(_bb.injected===_21&&!_bb.executed){_37(function(){_36(_bb);});}if(_bb.executed){_be(_bb);}else{_30.unshift(_bb);}}if(_bb.executed===_24&&!_bb.load){_be(_bb);}if(_bb.load){_bc=_b2(_bb,_ba[2],_b8);mid=(_bb.mid+"!"+(_bb.dynamic?++_b7+"!":"")+_bc);}else{_bc=_ba[2];mid=_bb.mid+"!"+(++_b7)+"!waitingForPlugin";}_bd={plugin:_bb,mid:mid,req:_5c(_b8),prid:_bc};}else{_bd=_5b(mid,_b8);}return _2f[_bd.mid]||(!_b9&&(_2f[_bd.mid]=_bd));},_b6=req.toAbsMid=function(mid,_bf){return _5b(mid,_bf).mid;},_5a=req.toUrl=function(_c0,_c1){var _c2=_5b(_c0+"/x",_c1),url=_c2.url;return _3f(_c2.pid===0?_c0:url.substring(0,url.length-5));},_c3={injected:_21,executed:_24,def:_22,result:_22},_c4=function(mid){return _2f[mid]=_c({mid:mid},_c3);},_c5=_c4("require"),_c6=_c4("exports"),_c7=_c4("module"),_c8=function(_c9,_ca){req.trace("loader-run-factory",[_c9.mid]);var _cb=_c9.def,_cc;1&&_27.unshift(_c9);if(has("config-dojo-loader-catches")){try{_cc=_6(_cb)?_cb.apply(null,_ca):_cb;}catch(e){_34(_44,_c9.result=_f("factoryThrew",[_c9,e]));}}else{_cc=_6(_cb)?_cb.apply(null,_ca):_cb;}_c9.result=_cc===undefined&&_c9.cjs?_c9.cjs.exports:_cc;1&&_27.shift(_c9);},_cd={},_ce=0,_be=function(_cf){var _d0=_cf.result;_cf.dynamic=_d0.dynamic;_cf.normalize=_d0.normalize;_cf.load=_d0.load;return _cf;},_d1=function(_d2){var map={};_9(_d2.loadQ,function(_d3){var _d4=_b2(_d2,_d3.prid,_d3.req.module),mid=_d2.dynamic?_d3.mid.replace(/waitingForPlugin$/,_d4):(_d2.mid+"!"+_d4),_d5=_c(_c({},_d3),{mid:mid,prid:_d4,injected:0});if(!_2f[mid]){_e7(_2f[mid]=_d5);}map[_d3.mid]=_2f[mid];_33(_d3);delete _2f[_d3.mid];});_d2.loadQ=0;var _d6=function(_d7){for(var _d8,_d9=_d7.deps||[],i=0;i<_d9.length;i++){_d8=map[_d9[i].mid];if(_d8){_d9[i]=_d8;}}};for(var p in _2f){_d6(_2f[p]);}_9(_30,_d6);},_35=function(_da){req.trace("loader-finish-exec",[_da.mid]);_da.executed=_24;_da.defOrder=_ce++;1&&_9(_da.provides,function(cb){cb();});if(_da.loadQ){_be(_da);_d1(_da);}for(i=0;i<_30.length;){if(_30[i]===_da){_30.splice(i,1);}else{i++;}}if(/^require\*/.test(_da.mid)){delete _2f[_da.mid];}},_db=[],_36=function(_dc,_dd){if(_dc.executed===_23){req.trace("loader-circular-dependency",[_db.concat(_dc.mid).join("->")]);return (!_dc.def||_dd)?_cd:(_dc.cjs&&_dc.cjs.exports);}if(!_dc.executed){if(!_dc.def){return _cd;}var mid=_dc.mid,_de=_dc.deps||[],arg,_df,_e0=[],i=0;if(0){_db.push(mid);req.trace("loader-exec-module",["exec",_db.length,mid]);}_dc.executed=_23;while(i<_de.length){arg=_de[i++];_df=((arg===_c5)?_5c(_dc):((arg===_c6)?_dc.cjs.exports:((arg===_c7)?_dc.cjs:_36(arg,_dd))));if(_df===_cd){_dc.executed=0;req.trace("loader-exec-module",["abort",mid]);0&&_db.pop();return _cd;}_e0.push(_df);}_c8(_dc,_e0);_35(_dc);0&&_db.pop();}return _dc.result;},_85=0,_37=function(_e1){try{_85++;_e1();}finally{_85--;}if(_94()){_34("idle",[]);}},_7c=function(){if(_85){return;}_37(function(){_29();for(var _e2,_e3,i=0;i<_30.length;){_e2=_ce;_e3=_30[i];_36(_e3);if(_e2!=_ce){_29();i=0;}else{i++;}}});};if(0){req.undef=function(_e4,_e5){var _e6=_31(_e4,_e5);_33(_e6);delete _2f[_e6.mid];};}if(1){if(has("dojo-loader-eval-hint-url")===undefined){has.add("dojo-loader-eval-hint-url",1);}var _3f=function(url){url+="";return url+(_51?((/\?/.test(url)?"&":"?")+_51):"");},_e7=function(_e8){var _e9=_e8.plugin;if(_e9.executed===_24&&!_e9.load){_be(_e9);}var _ea=function(def){_e8.result=def;_33(_e8);_35(_e8);_7c();};if(_e9.load){_e9.load(_e8.prid,_e8.req,_ea);}else{if(_e9.loadQ){_e9.loadQ.push(_e8);}else{_e9.loadQ=[_e8];_30.unshift(_e9);_32(_e9);}}},_8b=0,_7d=0,_eb=0,_8c=function(_ec,_ed){if(has("config-stripStrict")){_ec=_ec.replace(/"use strict"/g,"");}_eb=1;if(has("config-dojo-loader-catches")){try{if(_ec===_8b){_8b.call(null);}else{req.eval(_ec,has("dojo-loader-eval-hint-url")?_ed.url:_ed.mid);}}catch(e){_34(_44,_f("evalModuleThrew",_ed));}}else{if(_ec===_8b){_8b.call(null);}else{req.eval(_ec,has("dojo-loader-eval-hint-url")?_ed.url:_ed.mid);}}_eb=0;},_32=function(_ee){var mid=_ee.mid,url=_ee.url;if(_ee.executed||_ee.injected||_8e[mid]||(_ee.url&&((_ee.pack&&_8e[_ee.url]===_ee.pack)||_8e[_ee.url]==1))){return;}_8f(_ee);if(0){var _ef=0;if(_ee.plugin&&_ee.plugin.isCombo){req.combo.add(_ee.plugin.mid,_ee.prid,0,req);_ef=1;}else{if(!_ee.plugin){_ef=req.combo.add(0,_ee.mid,_ee.url,req);}}if(_ef){_74=1;return;}}if(_ee.plugin){_e7(_ee);return;}var _f0=function(){_7b(_ee);if(_ee.injected!==_21){_33(_ee);_c(_ee,_c3);req.trace("loader-define-nonmodule",[_ee.url]);}if(1&&_25){!_27.length&&_7c();}else{_7c();}};_8b=_52[mid]||_52[_53+_ee.url];if(_8b){req.trace("loader-inject",["cache",_ee.mid,url]);_8c(_8b,_ee);_f0();return;}if(1&&_25){if(_ee.isXd){_25==_26&&(_25=xd);}else{if(_ee.isAmd&&_25!=_26){}else{var _f1=function(_f2){if(_25==_26){_27.unshift(_ee);_8c(_f2,_ee);_27.shift();_7b(_ee);if(!_ee.cjs){_33(_ee);_35(_ee);}if(_ee.finish){var _f3=mid+"*finish",_f4=_ee.finish;delete _ee.finish;def(_f3,["dojo",("dojo/require!"+_f4.join(",")).replace(/\./g,"/")],function(_f5){_9(_f4,function(mid){_f5.require(mid);});});_30.unshift(_31(_f3));}_f0();}else{_f2=_2a(_ee,_f2);if(_f2){_8c(_f2,_ee);_f0();}else{_7d=_ee;req.injectUrl(_3f(url),_f0,_ee);_7d=0;}}};req.trace("loader-inject",["xhr",_ee.mid,url,_25!=_26]);if(has("config-dojo-loader-catches")){try{req.getText(url,_25!=_26,_f1);}catch(e){_34(_44,_f("xhrInjectFailed",[_ee,e]));}}else{req.getText(url,_25!=_26,_f1);}return;}}}req.trace("loader-inject",["script",_ee.mid,url]);_7d=_ee;req.injectUrl(_3f(url),_f0,_ee);_7d=0;},_f6=function(_f7,_f8,def){req.trace("loader-define-module",[_f7.mid,_f8]);if(0&&_f7.plugin&&_f7.plugin.isCombo){_f7.result=_6(def)?def():def;_33(_f7);_35(_f7);return _f7;}var mid=_f7.mid;if(_f7.injected===_21){_34(_44,_f("multipleDefine",_f7));return _f7;}_c(_f7,{deps:_f8,def:def,cjs:{id:_f7.mid,uri:_f7.url,exports:(_f7.result={}),setExports:function(_f9){_f7.cjs.exports=_f9;},config:function(){return _f7.config;}}});for(var i=0;i<_f8.length;i++){_f8[i]=_31(_f8[i],_f7);}if(1&&_25&&!_8e[mid]){_77(_f7);_30.push(_f7);_7c();}_33(_f7);if(!_6(def)&&!_f8.length){_f7.result=def;_35(_f7);}return _f7;},_7b=function(_fa,_fb){var _fc=[],_fd,_fe;while(_8d.length){_fe=_8d.shift();_fb&&(_fe[0]=_fb.shift());_fd=(_fe[0]&&_31(_fe[0]))||_fa;_fc.push([_fd,_fe[1],_fe[2]]);}_56(_fa);_9(_fc,function(_ff){_77(_f6.apply(null,_ff));});};}var _100=0,_93=_3,_91=_3;if(1){_93=function(){_100&&clearTimeout(_100);_100=0;},_91=function(){_93();if(req.waitms){_100=window.setTimeout(function(){_93();_34(_44,_f("timeout",_8e));},req.waitms);}};}if(1){has.add("ie-event-behavior",!!doc.attachEvent&&(typeof opera==="undefined"||opera.toString()!="[object Opera]"));}if(1&&(1||1)){var _101=function(node,_102,_103,_104){if(!has("ie-event-behavior")){node.addEventListener(_102,_104,false);return function(){node.removeEventListener(_102,_104,false);};}else{node.attachEvent(_103,_104);return function(){node.detachEvent(_103,_104);};}},_105=_101(window,"load","onload",function(){req.pageLoaded=1;doc.readyState!="complete"&&(doc.readyState="complete");_105();});if(1){var _106=doc.getElementsByTagName("script")[0],_107=_106.parentNode;req.injectUrl=function(url,_108,_109){var node=_109.node=doc.createElement("script"),_10a=function(e){e=e||window.event;var node=e.target||e.srcElement;if(e.type==="load"||/complete|loaded/.test(node.readyState)){_10b();_10c();_108&&_108();}},_10b=_101(node,"load","onreadystatechange",_10a),_10c=_101(node,"error","onerror",function(e){_10b();_10c();_34(_44,_f("scriptError",[url,e]));});node.type="text/javascript";node.charset="utf-8";node.src=url;_107.insertBefore(node,_106);return node;};}}if(1){req.log=function(){try{for(var i=0;i<arguments.length;i++){}}catch(e){}};}else{req.log=_3;}if(0){var _10d=req.trace=function(_10e,args){if(_10d.on&&_10d.group[_10e]){_34("trace",[_10e,args]);for(var arg,dump=[],text="trace:"+_10e+(args.length?(":"+args[0]):""),i=1;i<args.length;){arg=args[i++];if(_7(arg)){text+=", "+arg;}else{dump.push(arg);}}req.log(text);dump.length&&dump.push(".");req.log.apply(req,dump);}};_c(_10d,{on:1,group:{},set:function(_10f,_110){if(_7(_10f)){_10d.group[_10f]=_110;}else{_c(_10d.group,_10f);}}});_10d.set(_c(_c(_c({},_2.trace),_1.trace),_55.trace));on("config",function(_111){_111.trace&&_10d.set(_111.trace);});}else{req.trace=_3;}var def=function(mid,_112,_113){var _114=arguments.length,_115=["require","exports","module"],args=[0,mid,_112];if(_114==1){args=[0,(_6(mid)?_115:[]),mid];}else{if(_114==2&&_7(mid)){args=[mid,(_6(_112)?_115:[]),_112];}else{if(_114==3){args=[mid,_112,_113];}}}if(0&&args[1]===_115){args[2].toString().replace(/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,"").replace(/require\(["']([\w\!\-_\.\/]+)["']\)/g,function(_116,dep){args[1].push(dep);});}req.trace("loader-define",args.slice(0,2));var _117=args[0]&&_31(args[0]),_118;if(_117&&!_8e[_117.mid]){_77(_f6(_117,args[1],args[2]));}else{if(!has("ie-event-behavior")||!1||_eb){_8d.push(args);}else{_117=_117||_7d;if(!_117){for(mid in _8e){_118=_2f[mid];if(_118&&_118.node&&_118.node.readyState==="interactive"){_117=_118;break;}}if(0&&!_117){for(var i=0;i<_75.length;i++){_117=_75[i];if(_117.node&&_117.node.readyState==="interactive"){break;}_117=0;}}}if(0&&_8(_117)){_77(_f6(_31(_117.shift()),args[1],args[2]));if(!_117.length){_75.splice(i,1);}}else{if(_117){_56(_117);_77(_f6(_117,args[1],args[2]));}else{_34(_44,_f("ieDefineFailed",args[0]));}}_7c();}}};def.amd={vendor:"dojotoolkit.org"};if(0){req.def=def;}_c(_c(req,_2.loaderPatch),_1.loaderPatch);on(_44,function(arg){try{console.error(arg);if(arg instanceof Error){for(var p in arg){}}}catch(e){}});_c(req,{uid:uid,cache:_52,packs:_4f});if(0){_c(req,{paths:_4d,aliases:_4c,modules:_2f,legacyMode:_25,execQ:_30,defQ:_8d,waiting:_8e,packs:_4f,mapProgs:_50,pathsMapProg:_4e,listenerQueues:_43,computeMapProg:_5e,runMapProg:_95,compactPath:_97,getModuleInfo:_9d});}if(_17.define){if(1){_34(_44,_f("defineAlreadyDefined",0));}return;}else{_17.define=def;_17.require=req;if(0){require=req;}}if(0&&req.combo&&req.combo.plugins){var _119=req.combo.plugins,_11a;for(_11a in _119){_c(_c(_31(_11a),_119[_11a]),{isCombo:1,executed:"executed",load:1});}}if(1){_9(_63,function(c){_64(c);});var _11b=_55.deps||_1.deps||_2.deps,_11c=_55.callback||_1.callback||_2.callback;req.boot=(_11b||_11c)?[_11b||[],_11c]:0;}if(!1){!req.async&&req(["dojo"]);req.boot&&req.apply(null,req.boot);}})(this.dojoConfig||this.djConfig||this.require||{},{async:0,hasCache:{"config-selectorEngine":"acme","config-tlmSiblingOfDojo":1,"dojo-built":1,"dojo-loader":1,dom:1,"host-browser":1},packages:[{location:"../dijit",name:"dijit"},{location:"../dojox",name:"dojox"},{location:".",name:"dojo"}]});require({cache:{"dojo/_base/fx":function(){define(["./kernel","./config","./lang","../Evented","./Color","./connect","./sniff","../dom","../dom-style"],function(dojo,_11d,lang,_11e,_11f,_120,has,dom,_121){var _122=lang.mixin;var _123={};var _124=_123._Line=function(_125,end){this.start=_125;this.end=end;};_124.prototype.getValue=function(n){return ((this.end-this.start)*n)+this.start;};var _126=_123.Animation=function(args){_122(this,args);if(lang.isArray(this.curve)){this.curve=new _124(this.curve[0],this.curve[1]);}};_126.prototype=new _11e();lang.extend(_126,{duration:350,repeat:0,rate:20,_percent:0,_startRepeatCount:0,_getStep:function(){var _127=this._percent,_128=this.easing;return _128?_128(_127):_127;},_fire:function(evt,args){var a=args||[];if(this[evt]){if(_11d.debugAtAllCosts){this[evt].apply(this,a);}else{try{this[evt].apply(this,a);}catch(e){console.error("exception in animation handler for:",evt);console.error(e);}}}return this;},play:function(_129,_12a){var _12b=this;if(_12b._delayTimer){_12b._clearTimer();}if(_12a){_12b._stopTimer();_12b._active=_12b._paused=false;_12b._percent=0;}else{if(_12b._active&&!_12b._paused){return _12b;}}_12b._fire("beforeBegin",[_12b.node]);var de=_129||_12b.delay,_12c=lang.hitch(_12b,"_play",_12a);if(de>0){_12b._delayTimer=setTimeout(_12c,de);return _12b;}_12c();return _12b;},_play:function(_12d){var _12e=this;if(_12e._delayTimer){_12e._clearTimer();}_12e._startTime=new Date().valueOf();if(_12e._paused){_12e._startTime-=_12e.duration*_12e._percent;}_12e._active=true;_12e._paused=false;var _12f=_12e.curve.getValue(_12e._getStep());if(!_12e._percent){if(!_12e._startRepeatCount){_12e._startRepeatCount=_12e.repeat;}_12e._fire("onBegin",[_12f]);}_12e._fire("onPlay",[_12f]);_12e._cycle();return _12e;},pause:function(){var _130=this;if(_130._delayTimer){_130._clearTimer();}_130._stopTimer();if(!_130._active){return _130;}_130._paused=true;_130._fire("onPause",[_130.curve.getValue(_130._getStep())]);return _130;},gotoPercent:function(_131,_132){var _133=this;_133._stopTimer();_133._active=_133._paused=true;_133._percent=_131;if(_132){_133.play();}return _133;},stop:function(_134){var _135=this;if(_135._delayTimer){_135._clearTimer();}if(!_135._timer){return _135;}_135._stopTimer();if(_134){_135._percent=1;}_135._fire("onStop",[_135.curve.getValue(_135._getStep())]);_135._active=_135._paused=false;return _135;},status:function(){if(this._active){return this._paused?"paused":"playing";}return "stopped";},_cycle:function(){var _136=this;if(_136._active){var curr=new Date().valueOf();var step=_136.duration===0?1:(curr-_136._startTime)/(_136.duration);if(step>=1){step=1;}_136._percent=step;if(_136.easing){step=_136.easing(step);}_136._fire("onAnimate",[_136.curve.getValue(step)]);if(_136._percent<1){_136._startTimer();}else{_136._active=false;if(_136.repeat>0){_136.repeat--;_136.play(null,true);}else{if(_136.repeat==-1){_136.play(null,true);}else{if(_136._startRepeatCount){_136.repeat=_136._startRepeatCount;_136._startRepeatCount=0;}}}_136._percent=0;_136._fire("onEnd",[_136.node]);!_136.repeat&&_136._stopTimer();}}return _136;},_clearTimer:function(){clearTimeout(this._delayTimer);delete this._delayTimer;}});var ctr=0,_137=null,_138={run:function(){}};lang.extend(_126,{_startTimer:function(){if(!this._timer){this._timer=_120.connect(_138,"run",this,"_cycle");ctr++;}if(!_137){_137=setInterval(lang.hitch(_138,"run"),this.rate);}},_stopTimer:function(){if(this._timer){_120.disconnect(this._timer);this._timer=null;ctr--;}if(ctr<=0){clearInterval(_137);_137=null;ctr=0;}}});var _139=has("ie")?function(node){var ns=node.style;if(!ns.width.length&&_121.get(node,"width")=="auto"){ns.width="auto";}}:function(){};_123._fade=function(args){args.node=dom.byId(args.node);var _13a=_122({properties:{}},args),_13b=(_13a.properties.opacity={});_13b.start=!("start" in _13a)?function(){return +_121.get(_13a.node,"opacity")||0;}:_13a.start;_13b.end=_13a.end;var anim=_123.animateProperty(_13a);_120.connect(anim,"beforeBegin",lang.partial(_139,_13a.node));return anim;};_123.fadeIn=function(args){return _123._fade(_122({end:1},args));};_123.fadeOut=function(args){return _123._fade(_122({end:0},args));};_123._defaultEasing=function(n){return 0.5+((Math.sin((n+1.5)*Math.PI))/2);};var _13c=function(_13d){this._properties=_13d;for(var p in _13d){var prop=_13d[p];if(prop.start instanceof _11f){prop.tempColor=new _11f();}}};_13c.prototype.getValue=function(r){var ret={};for(var p in this._properties){var prop=this._properties[p],_13e=prop.start;if(_13e instanceof _11f){ret[p]=_11f.blendColors(_13e,prop.end,r,prop.tempColor).toCss();}else{if(!lang.isArray(_13e)){ret[p]=((prop.end-_13e)*r)+_13e+(p!="opacity"?prop.units||"px":0);}}}return ret;};_123.animateProperty=function(args){var n=args.node=dom.byId(args.node);if(!args.easing){args.easing=dojo._defaultEasing;}var anim=new _126(args);_120.connect(anim,"beforeBegin",anim,function(){var pm={};for(var p in this.properties){if(p=="width"||p=="height"){this.node.display="block";}var prop=this.properties[p];if(lang.isFunction(prop)){prop=prop(n);}prop=pm[p]=_122({},(lang.isObject(prop)?prop:{end:prop}));if(lang.isFunction(prop.start)){prop.start=prop.start(n);}if(lang.isFunction(prop.end)){prop.end=prop.end(n);}var _13f=(p.toLowerCase().indexOf("color")>=0);function _140(node,p){var v={height:node.offsetHeight,width:node.offsetWidth}[p];if(v!==undefined){return v;}v=_121.get(node,p);return (p=="opacity")?+v:(_13f?v:parseFloat(v));};if(!("end" in prop)){prop.end=_140(n,p);}else{if(!("start" in prop)){prop.start=_140(n,p);}}if(_13f){prop.start=new _11f(prop.start);prop.end=new _11f(prop.end);}else{prop.start=(p=="opacity")?+prop.start:parseFloat(prop.start);}}this.curve=new _13c(pm);});_120.connect(anim,"onAnimate",lang.hitch(_121,"set",anim.node));return anim;};_123.anim=function(node,_141,_142,_143,_144,_145){return _123.animateProperty({node:node,duration:_142||_126.prototype.duration,properties:_141,easing:_143,onEnd:_144}).play(_145||0);};if(1){_122(dojo,_123);dojo._Animation=_126;}return _123;});},"dojo/dom-form":function(){define(["./_base/lang","./dom","./io-query","./json"],function(lang,dom,ioq,json){function _146(obj,name,_147){if(_147===null){return;}var val=obj[name];if(typeof val=="string"){obj[name]=[val,_147];}else{if(lang.isArray(val)){val.push(_147);}else{obj[name]=_147;}}};var _148="file|submit|image|reset|button";var form={fieldToObject:function fieldToObject(_149){var ret=null;_149=dom.byId(_149);if(_149){var _14a=_149.name,type=(_149.type||"").toLowerCase();if(_14a&&type&&!_149.disabled){if(type=="radio"||type=="checkbox"){if(_149.checked){ret=_149.value;}}else{if(_149.multiple){ret=[];var _14b=[_149.firstChild];while(_14b.length){for(var node=_14b.pop();node;node=node.nextSibling){if(node.nodeType==1&&node.tagName.toLowerCase()=="option"){if(node.selected){ret.push(node.value);}}else{if(node.nextSibling){_14b.push(node.nextSibling);}if(node.firstChild){_14b.push(node.firstChild);}break;}}}}else{ret=_149.value;}}}}return ret;},toObject:function formToObject(_14c){var ret={},_14d=dom.byId(_14c).elements;for(var i=0,l=_14d.length;i<l;++i){var item=_14d[i],_14e=item.name,type=(item.type||"").toLowerCase();if(_14e&&type&&_148.indexOf(type)<0&&!item.disabled){_146(ret,_14e,form.fieldToObject(item));if(type=="image"){ret[_14e+".x"]=ret[_14e+".y"]=ret[_14e].x=ret[_14e].y=0;}}}return ret;},toQuery:function formToQuery(_14f){return ioq.objectToQuery(form.toObject(_14f));},toJson:function formToJson(_150,_151){return json.stringify(form.toObject(_150),null,_151?4:0);}};return form;});},"dojo/i18n":function(){define(["./_base/kernel","require","./has","./_base/array","./_base/config","./_base/lang","./_base/xhr","./json","module"],function(dojo,_152,has,_153,_154,lang,xhr,json,_155){has.add("dojo-preload-i18n-Api",1);1||has.add("dojo-v1x-i18n-Api",1);var _156=dojo.i18n={},_157=/(^.*(^|\/)nls)(\/|$)([^\/]*)\/?([^\/]*)/,_158=function(root,_159,_15a,_15b){for(var _15c=[_15a+_15b],_15d=_159.split("-"),_15e="",i=0;i<_15d.length;i++){_15e+=(_15e?"-":"")+_15d[i];if(!root||root[_15e]){_15c.push(_15a+_15e+"/"+_15b);}}return _15c;},_15f={},_160=function(_161,_162,_163){_163=_163?_163.toLowerCase():dojo.locale;_161=_161.replace(/\./g,"/");_162=_162.replace(/\./g,"/");return (/root/i.test(_163))?(_161+"/nls/"+_162):(_161+"/nls/"+_163+"/"+_162);},_164=dojo.getL10nName=function(_165,_166,_167){return _165=_155.id+"!"+_160(_165,_166,_167);},_168=function(_169,_16a,_16b,_16c,_16d,load){_169([_16a],function(root){var _16e=lang.clone(root.root||root.ROOT),_16f=_158(!root._v1x&&root,_16d,_16b,_16c);_169(_16f,function(){for(var i=1;i<_16f.length;i++){_16e=lang.mixin(lang.clone(_16e),arguments[i]);}var _170=_16a+"/"+_16d;_15f[_170]=_16e;load();});});},_171=function(id,_172){return /^\./.test(id)?_172(id):id;},_173=function(_174){var list=_154.extraLocale||[];list=lang.isArray(list)?list:[list];list.push(_174);return list;},load=function(id,_175,load){if(has("dojo-preload-i18n-Api")){var _176=id.split("*"),_177=_176[1]=="preload";if(_177){if(!_15f[id]){_15f[id]=1;_178(_176[2],json.parse(_176[3]),1,_175);}load(1);}if(_177||_179(id,_175,load)){return;}}var _17a=_157.exec(id),_17b=_17a[1]+"/",_17c=_17a[5]||_17a[4],_17d=_17b+_17c,_17e=(_17a[5]&&_17a[4]),_17f=_17e||dojo.locale,_180=_17d+"/"+_17f,_181=_17e?[_17f]:_173(_17f),_182=_181.length,_183=function(){if(!--_182){load(lang.delegate(_15f[_180]));}};_153.forEach(_181,function(_184){var _185=_17d+"/"+_184;if(has("dojo-preload-i18n-Api")){_186(_185);}if(!_15f[_185]){_168(_175,_17d,_17b,_17c,_184,_183);}else{_183();}});};if(has("dojo-unit-tests")){var _187=_156.unitTests=[];}if(has("dojo-preload-i18n-Api")||1){var _188=_156.normalizeLocale=function(_189){var _18a=_189?_189.toLowerCase():dojo.locale;return _18a=="root"?"ROOT":_18a;},isXd=function(mid,_18b){return (1&&1)?_18b.isXdUrl(_152.toUrl(mid+".js")):true;},_18c=0,_18d=[],_178=_156._preloadLocalizations=function(_18e,_18f,_190,_191){_191=_191||_152;function _192(mid,_193){if(isXd(mid,_191)||_190){_191([mid],_193);}else{_1ad([mid],_193,_191);}};function _194(_195,func){var _196=_195.split("-");while(_196.length){if(func(_196.join("-"))){return;}_196.pop();}func("ROOT");};function _197(){_18c++;};function _198(){--_18c;while(!_18c&&_18d.length){load.apply(null,_18d.shift());}};function _199(path,name,loc,_19a){return _19a.toAbsMid(path+name+"/"+loc);};function _19b(_19c){_19c=_188(_19c);_194(_19c,function(loc){if(_153.indexOf(_18f,loc)>=0){var mid=_18e.replace(/\./g,"/")+"_"+loc;_197();_192(mid,function(_19d){for(var p in _19d){var _19e=_19d[p],_19f=p.match(/(.+)\/([^\/]+)$/),_1a0,_1a1;if(!_19f){continue;}_1a0=_19f[2];_1a1=_19f[1]+"/";_19e._localized=_19e._localized||{};var _1a2;if(loc==="ROOT"){var root=_1a2=_19e._localized;delete _19e._localized;root.root=_19e;_15f[_152.toAbsMid(p)]=root;}else{_1a2=_19e._localized;_15f[_199(_1a1,_1a0,loc,_152)]=_19e;}if(loc!==_19c){function _1a3(_1a4,_1a5,_1a6,_1a7){var _1a8=[],_1a9=[];_194(_19c,function(loc){if(_1a7[loc]){_1a8.push(_152.toAbsMid(_1a4+loc+"/"+_1a5));_1a9.push(_199(_1a4,_1a5,loc,_152));}});if(_1a8.length){_197();_191(_1a8,function(){for(var i=0;i<_1a8.length;i++){_1a6=lang.mixin(lang.clone(_1a6),arguments[i]);_15f[_1a9[i]]=_1a6;}_15f[_199(_1a4,_1a5,_19c,_152)]=lang.clone(_1a6);_198();});}else{_15f[_199(_1a4,_1a5,_19c,_152)]=_1a6;}};_1a3(_1a1,_1a0,_19e,_1a2);}}_198();});return true;}return false;});};_19b();_153.forEach(dojo.config.extraLocale,_19b);},_179=function(id,_1aa,load){if(_18c){_18d.push([id,_1aa,load]);}return _18c;},_186=function(){};}if(1){var _1ab={},_1ac=new Function("__bundle","__checkForLegacyModules","__mid","__amdValue","var define = function(mid, factory){define.called = 1; __amdValue.result = factory || mid;},"+"\t require = function(){define.called = 1;};"+"try{"+"define.called = 0;"+"eval(__bundle);"+"if(define.called==1)"+"return __amdValue;"+"if((__checkForLegacyModules = __checkForLegacyModules(__mid)))"+"return __checkForLegacyModules;"+"}catch(e){}"+"try{"+"return eval('('+__bundle+')');"+"}catch(e){"+"return e;"+"}"),_1ad=function(deps,_1ae,_1af){var _1b0=[];_153.forEach(deps,function(mid){var url=_1af.toUrl(mid+".js");function load(text){var _1b1=_1ac(text,_186,mid,_1ab);if(_1b1===_1ab){_1b0.push(_15f[url]=_1ab.result);}else{if(_1b1 instanceof Error){console.error("failed to evaluate i18n bundle; url="+url,_1b1);_1b1={};}_1b0.push(_15f[url]=(/nls\/[^\/]+\/[^\/]+$/.test(url)?_1b1:{root:_1b1,_v1x:1}));}};if(_15f[url]){_1b0.push(_15f[url]);}else{var _1b2=_1af.syncLoadNls(mid);if(_1b2){_1b0.push(_1b2);}else{if(!xhr){try{_1af.getText(url,true,load);}catch(e){_1b0.push(_15f[url]={});}}else{xhr.get({url:url,sync:true,load:load,error:function(){_1b0.push(_15f[url]={});}});}}}});_1ae&&_1ae.apply(null,_1b0);};_186=function(_1b3){for(var _1b4,_1b5=_1b3.split("/"),_1b6=dojo.global[_1b5[0]],i=1;_1b6&&i<_1b5.length-1;_1b6=_1b6[_1b5[i++]]){}if(_1b6){_1b4=_1b6[_1b5[i]];if(!_1b4){_1b4=_1b6[_1b5[i].replace(/-/g,"_")];}if(_1b4){_15f[_1b3]=_1b4;}}return _1b4;};_156.getLocalization=function(_1b7,_1b8,_1b9){var _1ba,_1bb=_160(_1b7,_1b8,_1b9);load(_1bb,(!isXd(_1bb,_152)?function(deps,_1bc){_1ad(deps,_1bc,_152);}:_152),function(_1bd){_1ba=_1bd;});return _1ba;};if(has("dojo-unit-tests")){_187.push(function(doh){doh.register("tests.i18n.unit",function(t){var _1be;_1be=_1ac("{prop:1}",_186,"nonsense",_1ab);t.is({prop:1},_1be);t.is(undefined,_1be[1]);_1be=_1ac("({prop:1})",_186,"nonsense",_1ab);t.is({prop:1},_1be);t.is(undefined,_1be[1]);_1be=_1ac("{'prop-x':1}",_186,"nonsense",_1ab);t.is({"prop-x":1},_1be);t.is(undefined,_1be[1]);_1be=_1ac("({'prop-x':1})",_186,"nonsense",_1ab);t.is({"prop-x":1},_1be);t.is(undefined,_1be[1]);_1be=_1ac("define({'prop-x':1})",_186,"nonsense",_1ab);t.is(_1ab,_1be);t.is({"prop-x":1},_1ab.result);_1be=_1ac("define('some/module', {'prop-x':1})",_186,"nonsense",_1ab);t.is(_1ab,_1be);t.is({"prop-x":1},_1ab.result);_1be=_1ac("this is total nonsense and should throw an error",_186,"nonsense",_1ab);t.is(_1be instanceof Error,true);});});}}return lang.mixin(_156,{dynamic:true,normalize:_171,load:load,cache:_15f});});},"dojo/promise/tracer":function(){define(["../_base/lang","./Promise","../Evented"],function(lang,_1bf,_1c0){"use strict";var _1c1=new _1c0;var emit=_1c1.emit;_1c1.emit=null;function _1c2(args){setTimeout(function(){emit.apply(_1c1,args);},0);};_1bf.prototype.trace=function(){var args=lang._toArray(arguments);this.then(function(_1c3){_1c2(["resolved",_1c3].concat(args));},function(_1c4){_1c2(["rejected",_1c4].concat(args));},function(_1c5){_1c2(["progress",_1c5].concat(args));});return this;};_1bf.prototype.traceRejected=function(){var args=lang._toArray(arguments);this.otherwise(function(_1c6){_1c2(["rejected",_1c6].concat(args));});return this;};return _1c1;});},"dojo/errors/RequestError":function(){define(["./create"],function(_1c7){return _1c7("RequestError",function(_1c8,_1c9){this.response=_1c9;});});},"dojo/_base/html":function(){define("dojo/_base/html",["./kernel","../dom","../dom-style","../dom-attr","../dom-prop","../dom-class","../dom-construct","../dom-geometry"],function(dojo,dom,_1ca,attr,prop,cls,ctr,geom){dojo.byId=dom.byId;dojo.isDescendant=dom.isDescendant;dojo.setSelectable=dom.setSelectable;dojo.getAttr=attr.get;dojo.setAttr=attr.set;dojo.hasAttr=attr.has;dojo.removeAttr=attr.remove;dojo.getNodeProp=attr.getNodeProp;dojo.attr=function(node,name,_1cb){if(arguments.length==2){return attr[typeof name=="string"?"get":"set"](node,name);}return attr.set(node,name,_1cb);};dojo.hasClass=cls.contains;dojo.addClass=cls.add;dojo.removeClass=cls.remove;dojo.toggleClass=cls.toggle;dojo.replaceClass=cls.replace;dojo._toDom=dojo.toDom=ctr.toDom;dojo.place=ctr.place;dojo.create=ctr.create;dojo.empty=function(node){ctr.empty(node);};dojo._destroyElement=dojo.destroy=function(node){ctr.destroy(node);};dojo._getPadExtents=dojo.getPadExtents=geom.getPadExtents;dojo._getBorderExtents=dojo.getBorderExtents=geom.getBorderExtents;dojo._getPadBorderExtents=dojo.getPadBorderExtents=geom.getPadBorderExtents;dojo._getMarginExtents=dojo.getMarginExtents=geom.getMarginExtents;dojo._getMarginSize=dojo.getMarginSize=geom.getMarginSize;dojo._getMarginBox=dojo.getMarginBox=geom.getMarginBox;dojo.setMarginBox=geom.setMarginBox;dojo._getContentBox=dojo.getContentBox=geom.getContentBox;dojo.setContentSize=geom.setContentSize;dojo._isBodyLtr=dojo.isBodyLtr=geom.isBodyLtr;dojo._docScroll=dojo.docScroll=geom.docScroll;dojo._getIeDocumentElementOffset=dojo.getIeDocumentElementOffset=geom.getIeDocumentElementOffset;dojo._fixIeBiDiScrollLeft=dojo.fixIeBiDiScrollLeft=geom.fixIeBiDiScrollLeft;dojo.position=geom.position;dojo.marginBox=function marginBox(node,box){return box?geom.setMarginBox(node,box):geom.getMarginBox(node);};dojo.contentBox=function contentBox(node,box){return box?geom.setContentSize(node,box):geom.getContentBox(node);};dojo.coords=function(node,_1cc){dojo.deprecated("dojo.coords()","Use dojo.position() or dojo.marginBox().");node=dom.byId(node);var s=_1ca.getComputedStyle(node),mb=geom.getMarginBox(node,s);var abs=geom.position(node,_1cc);mb.x=abs.x;mb.y=abs.y;return mb;};dojo.getProp=prop.get;dojo.setProp=prop.set;dojo.prop=function(node,name,_1cd){if(arguments.length==2){return prop[typeof name=="string"?"get":"set"](node,name);}return prop.set(node,name,_1cd);};dojo.getStyle=_1ca.get;dojo.setStyle=_1ca.set;dojo.getComputedStyle=_1ca.getComputedStyle;dojo.__toPixelValue=dojo.toPixelValue=_1ca.toPixelValue;dojo.style=function(node,name,_1ce){switch(arguments.length){case 1:return _1ca.get(node);case 2:return _1ca[typeof name=="string"?"get":"set"](node,name);}return _1ca.set(node,name,_1ce);};return dojo;});},"dojo/_base/kernel":function(){define(["../has","./config","require","module"],function(has,_1cf,_1d0,_1d1){var i,p,_1d2=(function(){return this;})(),_1d3={},_1d4={},dojo={config:_1cf,global:_1d2,dijit:_1d3,dojox:_1d4};var _1d5={dojo:["dojo",dojo],dijit:["dijit",_1d3],dojox:["dojox",_1d4]},_1d6=(_1d0.map&&_1d0.map[_1d1.id.match(/[^\/]+/)[0]]),item;for(p in _1d6){if(_1d5[p]){_1d5[p][0]=_1d6[p];}else{_1d5[p]=[_1d6[p],{}];}}for(p in _1d5){item=_1d5[p];item[1]._scopeName=item[0];if(!_1cf.noGlobals){_1d2[item[0]]=item[1];}}dojo.scopeMap=_1d5;dojo.baseUrl=dojo.config.baseUrl=_1d0.baseUrl;dojo.isAsync=!1||_1d0.async;dojo.locale=_1cf.locale;var rev="$Rev: f737cd5 $".match(/[0-9a-f]{7,}/);dojo.version={major:1,minor:8,patch:8,flag:"",revision:rev?rev[0]:NaN,toString:function(){var v=dojo.version;return v.major+"."+v.minor+"."+v.patch+v.flag+" ("+v.revision+")";}};1||has.add("extend-dojo",1);(Function("d","d.eval = function(){return d.global.eval ? d.global.eval(arguments[0]) : eval(arguments[0]);}"))(dojo);if(0){dojo.exit=function(_1d7){quit(_1d7);};}else{dojo.exit=function(){};}1||has.add("dojo-guarantee-console",1);if(1){typeof console!="undefined"||(console={});var cn=["assert","count","debug","dir","dirxml","error","group","groupEnd","info","profile","profileEnd","time","timeEnd","trace","warn","log"];var tn;i=0;while((tn=cn[i++])){if(!console[tn]){(function(){var tcn=tn+"";console[tcn]=("log" in console)?function(){var a=Array.prototype.slice.call(arguments);a.unshift(tcn+":");console["log"](a.join(" "));}:function(){};console[tcn]._fake=true;})();}}}has.add("dojo-debug-messages",!!_1cf.isDebug);dojo.deprecated=dojo.experimental=function(){};if(has("dojo-debug-messages")){dojo.deprecated=function(_1d8,_1d9,_1da){var _1db="DEPRECATED: "+_1d8;if(_1d9){_1db+=" "+_1d9;}if(_1da){_1db+=" -- will be removed in version: "+_1da;}console.warn(_1db);};dojo.experimental=function(_1dc,_1dd){var _1de="EXPERIMENTAL: "+_1dc+" -- APIs subject to change without notice.";if(_1dd){_1de+=" "+_1dd;}console.warn(_1de);};}1||has.add("dojo-modulePaths",1);if(1){if(_1cf.modulePaths){dojo.deprecated("dojo.modulePaths","use paths configuration");var _1df={};for(p in _1cf.modulePaths){_1df[p.replace(/\./g,"/")]=_1cf.modulePaths[p];}_1d0({paths:_1df});}}1||has.add("dojo-moduleUrl",1);if(1){dojo.moduleUrl=function(_1e0,url){dojo.deprecated("dojo.moduleUrl()","use require.toUrl","2.0");var _1e1=null;if(_1e0){_1e1=_1d0.toUrl(_1e0.replace(/\./g,"/")+(url?("/"+url):"")+"/*.*").replace(/\/\*\.\*/,"")+(url?"":"/");}return _1e1;};}dojo._hasResource={};return dojo;});},"dojo/io-query":function(){define(["./_base/lang"],function(lang){var _1e2={};return {objectToQuery:function objectToQuery(map){var enc=encodeURIComponent,_1e3=[];for(var name in map){var _1e4=map[name];if(_1e4!=_1e2[name]){var _1e5=enc(name)+"=";if(lang.isArray(_1e4)){for(var i=0,l=_1e4.length;i<l;++i){_1e3.push(_1e5+enc(_1e4[i]));}}else{_1e3.push(_1e5+enc(_1e4));}}}return _1e3.join("&");},queryToObject:function queryToObject(str){var dec=decodeURIComponent,qp=str.split("&"),ret={},name,val;for(var i=0,l=qp.length,item;i<l;++i){item=qp[i];if(item.length){var s=item.indexOf("=");if(s<0){name=dec(item);val="";}else{name=dec(item.slice(0,s));val=dec(item.slice(s+1));}if(typeof ret[name]=="string"){ret[name]=[ret[name]];}if(lang.isArray(ret[name])){ret[name].push(val);}else{ret[name]=val;}}}return ret;}};});},"dojo/_base/Deferred":function(){define(["./kernel","../Deferred","../promise/Promise","../errors/CancelError","../has","./lang","../when"],function(dojo,_1e6,_1e7,_1e8,has,lang,when){var _1e9=function(){};var _1ea=Object.freeze||function(){};var _1eb=dojo.Deferred=function(_1ec){var _1ed,_1ee,_1ef,head,_1f0;var _1f1=(this.promise=new _1e7());function _1f2(_1f3){if(_1ee){throw new Error("This deferred has already been resolved");}_1ed=_1f3;_1ee=true;_1f4();};function _1f4(){var _1f5;while(!_1f5&&_1f0){var _1f6=_1f0;_1f0=_1f0.next;if((_1f5=(_1f6.progress==_1e9))){_1ee=false;}var func=(_1ef?_1f6.error:_1f6.resolved);if(has("config-useDeferredInstrumentation")){if(_1ef&&_1e6.instrumentRejected){_1e6.instrumentRejected(_1ed,!!func);}}if(func){try{var _1f7=func(_1ed);if(_1f7&&typeof _1f7.then==="function"){_1f7.then(lang.hitch(_1f6.deferred,"resolve"),lang.hitch(_1f6.deferred,"reject"),lang.hitch(_1f6.deferred,"progress"));continue;}var _1f8=_1f5&&_1f7===undefined;if(_1f5&&!_1f8){_1ef=_1f7 instanceof Error;}_1f6.deferred[_1f8&&_1ef?"reject":"resolve"](_1f8?_1ed:_1f7);}catch(e){_1f6.deferred.reject(e);}}else{if(_1ef){_1f6.deferred.reject(_1ed);}else{_1f6.deferred.resolve(_1ed);}}}};this.resolve=this.callback=function(_1f9){this.fired=0;this.results=[_1f9,null];_1f2(_1f9);};this.reject=this.errback=function(_1fa){_1ef=true;this.fired=1;if(has("config-useDeferredInstrumentation")){if(_1e6.instrumentRejected){_1e6.instrumentRejected(_1fa,!!_1f0);}}_1f2(_1fa);this.results=[null,_1fa];};this.progress=function(_1fb){var _1fc=_1f0;while(_1fc){var _1fd=_1fc.progress;_1fd&&_1fd(_1fb);_1fc=_1fc.next;}};this.addCallbacks=function(_1fe,_1ff){this.then(_1fe,_1ff,_1e9);return this;};_1f1.then=this.then=function(_200,_201,_202){var _203=_202==_1e9?this:new _1eb(_1f1.cancel);var _204={resolved:_200,error:_201,progress:_202,deferred:_203};if(_1f0){head=head.next=_204;}else{_1f0=head=_204;}if(_1ee){_1f4();}return _203.promise;};var _205=this;_1f1.cancel=this.cancel=function(){if(!_1ee){var _206=_1ec&&_1ec(_205);if(!_1ee){if(!(_206 instanceof Error)){_206=new _1e8(_206);}_206.log=false;_205.reject(_206);}}};_1ea(_1f1);};lang.extend(_1eb,{addCallback:function(_207){return this.addCallbacks(lang.hitch.apply(dojo,arguments));},addErrback:function(_208){return this.addCallbacks(null,lang.hitch.apply(dojo,arguments));},addBoth:function(_209){var _20a=lang.hitch.apply(dojo,arguments);return this.addCallbacks(_20a,_20a);},fired:-1});_1eb.when=dojo.when=when;return _1eb;});},"dojo/NodeList-dom":function(){define(["./_base/kernel","./query","./_base/array","./_base/lang","./dom-class","./dom-construct","./dom-geometry","./dom-attr","./dom-style"],function(dojo,_20b,_20c,lang,_20d,_20e,_20f,_210,_211){var _212=function(a){return a.length==1&&(typeof a[0]=="string");};var _213=function(node){var p=node.parentNode;if(p){p.removeChild(node);}};var _214=_20b.NodeList,awc=_214._adaptWithCondition,aafe=_214._adaptAsForEach,aam=_214._adaptAsMap;function _215(_216){return function(node,name,_217){if(arguments.length==2){return _216[typeof name=="string"?"get":"set"](node,name);}return _216.set(node,name,_217);};};lang.extend(_214,{_normalize:function(_218,_219){var _21a=_218.parse===true;if(typeof _218.template=="string"){var _21b=_218.templateFunc||(dojo.string&&dojo.string.substitute);_218=_21b?_21b(_218.template,_218):_218;}var type=(typeof _218);if(type=="string"||type=="number"){_218=_20e.toDom(_218,(_219&&_219.ownerDocument));if(_218.nodeType==11){_218=lang._toArray(_218.childNodes);}else{_218=[_218];}}else{if(!lang.isArrayLike(_218)){_218=[_218];}else{if(!lang.isArray(_218)){_218=lang._toArray(_218);}}}if(_21a){_218._runParse=true;}return _218;},_cloneNode:function(node){return node.cloneNode(true);},_place:function(ary,_21c,_21d,_21e){if(_21c.nodeType!=1&&_21d=="only"){return;}var _21f=_21c,_220;var _221=ary.length;for(var i=_221-1;i>=0;i--){var node=(_21e?this._cloneNode(ary[i]):ary[i]);if(ary._runParse&&dojo.parser&&dojo.parser.parse){if(!_220){_220=_21f.ownerDocument.createElement("div");}_220.appendChild(node);dojo.parser.parse(_220);node=_220.firstChild;while(_220.firstChild){_220.removeChild(_220.firstChild);}}if(i==_221-1){_20e.place(node,_21f,_21d);}else{_21f.parentNode.insertBefore(node,_21f);}_21f=node;}},position:aam(_20f.position),attr:awc(_215(_210),_212),style:awc(_215(_211),_212),addClass:aafe(_20d.add),removeClass:aafe(_20d.remove),toggleClass:aafe(_20d.toggle),replaceClass:aafe(_20d.replace),empty:aafe(_20e.empty),removeAttr:aafe(_210.remove),marginBox:aam(_20f.getMarginBox),place:function(_222,_223){var item=_20b(_222)[0];return this.forEach(function(node){_20e.place(node,item,_223);});},orphan:function(_224){return (_224?_20b._filterResult(this,_224):this).forEach(_213);},adopt:function(_225,_226){return _20b(_225).place(this[0],_226)._stash(this);},query:function(_227){if(!_227){return this;}var ret=new _214;this.map(function(node){_20b(_227,node).forEach(function(_228){if(_228!==undefined){ret.push(_228);}});});return ret._stash(this);},filter:function(_229){var a=arguments,_22a=this,_22b=0;if(typeof _229=="string"){_22a=_20b._filterResult(this,a[0]);if(a.length==1){return _22a._stash(this);}_22b=1;}return this._wrap(_20c.filter(_22a,a[_22b],a[_22b+1]),this);},addContent:function(_22c,_22d){_22c=this._normalize(_22c,this[0]);for(var i=0,node;(node=this[i]);i++){this._place(_22c,node,_22d,i>0);}return this;}});return _214;});},"dojo/query":function(){define(["./_base/kernel","./has","./dom","./on","./_base/array","./_base/lang","./selector/_loader","./selector/_loader!default"],function(dojo,has,dom,on,_22e,lang,_22f,_230){"use strict";has.add("array-extensible",function(){return lang.delegate([],{length:1}).length==1&&!has("bug-for-in-skips-shadowed");});var ap=Array.prototype,aps=ap.slice,apc=ap.concat,_231=_22e.forEach;var tnl=function(a,_232,_233){var _234=new (_233||this._NodeListCtor||nl)(a);return _232?_234._stash(_232):_234;};var _235=function(f,a,o){a=[0].concat(aps.call(a,0));o=o||dojo.global;return function(node){a[0]=node;return f.apply(o,a);};};var _236=function(f,o){return function(){this.forEach(_235(f,arguments,o));return this;};};var _237=function(f,o){return function(){return this.map(_235(f,arguments,o));};};var _238=function(f,o){return function(){return this.filter(_235(f,arguments,o));};};var _239=function(f,g,o){return function(){var a=arguments,body=_235(f,a,o);if(g.call(o||dojo.global,a)){return this.map(body);}this.forEach(body);return this;};};var _23a=function(_23b){var _23c=this instanceof nl&&has("array-extensible");if(typeof _23b=="number"){_23b=Array(_23b);}var _23d=(_23b&&"length" in _23b)?_23b:arguments;if(_23c||!_23d.sort){var _23e=_23c?this:[],l=_23e.length=_23d.length;for(var i=0;i<l;i++){_23e[i]=_23d[i];}if(_23c){return _23e;}_23d=_23e;}lang._mixin(_23d,nlp);_23d._NodeListCtor=function(_23f){return nl(_23f);};return _23d;};var nl=_23a,nlp=nl.prototype=has("array-extensible")?[]:{};nl._wrap=nlp._wrap=tnl;nl._adaptAsMap=_237;nl._adaptAsForEach=_236;nl._adaptAsFilter=_238;nl._adaptWithCondition=_239;_231(["slice","splice"],function(name){var f=ap[name];nlp[name]=function(){return this._wrap(f.apply(this,arguments),name=="slice"?this:null);};});_231(["indexOf","lastIndexOf","every","some"],function(name){var f=_22e[name];nlp[name]=function(){return f.apply(dojo,[this].concat(aps.call(arguments,0)));};});lang.extend(_23a,{constructor:nl,_NodeListCtor:nl,toString:function(){return this.join(",");},_stash:function(_240){this._parent=_240;return this;},on:function(_241,_242){var _243=this.map(function(node){return on(node,_241,_242);});_243.remove=function(){for(var i=0;i<_243.length;i++){_243[i].remove();}};return _243;},end:function(){if(this._parent){return this._parent;}else{return new this._NodeListCtor(0);}},concat:function(item){var t=aps.call(this,0),m=_22e.map(arguments,function(a){return aps.call(a,0);});return this._wrap(apc.apply(t,m),this);},map:function(func,obj){return this._wrap(_22e.map(this,func,obj),this);},forEach:function(_244,_245){_231(this,_244,_245);return this;},filter:function(_246){var a=arguments,_247=this,_248=0;if(typeof _246=="string"){_247=_249._filterResult(this,a[0]);if(a.length==1){return _247._stash(this);}_248=1;}return this._wrap(_22e.filter(_247,a[_248],a[_248+1]),this);},instantiate:function(_24a,_24b){var c=lang.isFunction(_24a)?_24a:lang.getObject(_24a);_24b=_24b||{};return this.forEach(function(node){new c(_24b,node);});},at:function(){var t=new this._NodeListCtor(0);_231(arguments,function(i){if(i<0){i=this.length+i;}if(this[i]){t.push(this[i]);}},this);return t._stash(this);}});function _24c(_24d,_24e){var _24f=function(_250,root){if(typeof root=="string"){root=dom.byId(root);if(!root){return new _24e([]);}}var _251=typeof _250=="string"?_24d(_250,root):_250?_250.orphan?_250:[_250]:[];if(_251.orphan){return _251;}return new _24e(_251);};_24f.matches=_24d.match||function(node,_252,root){return _24f.filter([node],_252,root).length>0;};_24f.filter=_24d.filter||function(_253,_254,root){return _24f(_254,root).filter(function(node){return _22e.indexOf(_253,node)>-1;});};if(typeof _24d!="function"){var _255=_24d.search;_24d=function(_256,root){return _255(root||document,_256);};}return _24f;};var _249=_24c(_230,_23a);dojo.query=_24c(_230,function(_257){return _23a(_257);});_249.load=function(id,_258,_259){_22f.load(id,_258,function(_25a){_259(_24c(_25a,_23a));});};dojo._filterQueryResult=_249._filterResult=function(_25b,_25c,root){return new _23a(_249.filter(_25b,_25c,root));};dojo.NodeList=_249.NodeList=_23a;return _249;});},"dojo/has":function(){define(["require","module"],function(_25d,_25e){var has=_25d.has||function(){};if(!1){var _25f=typeof window!="undefined"&&typeof location!="undefined"&&typeof document!="undefined"&&window.location==location&&window.document==document,_260=(function(){return this;})(),doc=_25f&&document,_261=doc&&doc.createElement("DiV"),_262=(_25e.config&&_25e.config())||{};has=function(name){return typeof _262[name]=="function"?(_262[name]=_262[name](_260,doc,_261)):_262[name];};has.cache=_262;has.add=function(name,test,now,_263){(typeof _262[name]=="undefined"||_263)&&(_262[name]=test);return now&&has(name);};1||has.add("host-browser",_25f);0&&has.add("host-node",(typeof process=="object"&&process.versions&&process.versions.node&&process.versions.v8));0&&has.add("host-rhino",(typeof load=="function"&&(typeof Packages=="function"||typeof Packages=="object")));1||has.add("dom",_25f);1||has.add("dojo-dom-ready-api",1);1||has.add("dojo-sniff",1);}if(1){has.add("dom-addeventlistener",!!document.addEventListener);has.add("touch","ontouchstart" in document||window.navigator.msMaxTouchPoints>0);has.add("device-width",screen.availWidth||innerWidth);var form=document.createElement("form");has.add("dom-attributes-explicit",form.attributes.length==0);has.add("dom-attributes-specified-flag",form.attributes.length>0&&form.attributes.length<40);}has.clearElement=function(_264){_264.innerHTML="";return _264;};has.normalize=function(id,_265){var _266=id.match(/[\?:]|[^:\?]*/g),i=0,get=function(skip){var term=_266[i++];if(term==":"){return 0;}else{if(_266[i++]=="?"){if(!skip&&has(term)){return get();}else{get(true);return get(skip);}}return term||0;}};id=get();return id&&_265(id);};has.load=function(id,_267,_268){if(id){_267([id],_268);}else{_268();}};return has;});},"dojo/_base/loader":function(){define(["./kernel","../has","require","module","./json","./lang","./array"],function(dojo,has,_269,_26a,json,lang,_26b){if(!1){console.error("cannot load the Dojo v1.x loader with a foreign loader");return 0;}1||has.add("dojo-fast-sync-require",1);var _26c=function(id){return {src:_26a.id,id:id};},_26d=function(name){return name.replace(/\./g,"/");},_26e=/\/\/>>built/,_26f=[],_270=[],_271=function(mid,_272,_273){_26f.push(_273);_26b.forEach(mid.split(","),function(mid){var _274=_275(mid,_272.module);_270.push(_274);_276(_274);});_277();},_277=(1?function(){var _278,mid;for(mid in _279){_278=_279[mid];if(_278.noReqPluginCheck===undefined){_278.noReqPluginCheck=/loadInit\!/.test(mid)||/require\!/.test(mid)?1:0;}if(!_278.executed&&!_278.noReqPluginCheck&&_278.injected==_27a){return;}}_27b(function(){var _27c=_26f;_26f=[];_26b.forEach(_27c,function(cb){cb(1);});});}:(function(){var _27d,_27e=function(m){_27d[m.mid]=1;for(var t,_27f,deps=m.deps||[],i=0;i<deps.length;i++){_27f=deps[i];if(!(t=_27d[_27f.mid])){if(t===0||!_27e(_27f)){_27d[m.mid]=0;return false;}}}return true;};return function(){var _280,mid;_27d={};for(mid in _279){_280=_279[mid];if(_280.executed||_280.noReqPluginCheck){_27d[mid]=1;}else{if(_280.noReqPluginCheck!==0){_280.noReqPluginCheck=/loadInit\!/.test(mid)||/require\!/.test(mid)?1:0;}if(_280.noReqPluginCheck){_27d[mid]=1;}else{if(_280.injected!==_2ac){_27d[mid]=0;}}}}for(var t,i=0,end=_270.length;i<end;i++){_280=_270[i];if(!(t=_27d[_280.mid])){if(t===0||!_27e(_280)){return;}}}_27b(function(){var _281=_26f;_26f=[];_26b.forEach(_281,function(cb){cb(1);});});};})()),_282=function(mid,_283,_284){_283([mid],function(_285){_283(_285.names,function(){for(var _286="",args=[],i=0;i<arguments.length;i++){_286+="var "+_285.names[i]+"= arguments["+i+"]; ";args.push(arguments[i]);}eval(_286);var _287=_283.module,_288=[],_289,_28a={provide:function(_28b){_28b=_26d(_28b);var _28c=_275(_28b,_287);if(_28c!==_287){_2b2(_28c);}},require:function(_28d,_28e){_28d=_26d(_28d);_28e&&(_275(_28d,_287).result=_2ad);_288.push(_28d);},requireLocalization:function(_28f,_290,_291){if(!_289){_289=["dojo/i18n"];}_291=(_291||dojo.locale).toLowerCase();_28f=_26d(_28f)+"/nls/"+(/root/i.test(_291)?"":_291+"/")+_26d(_290);if(_275(_28f,_287).isXd){_289.push("dojo/i18n!"+_28f);}},loadInit:function(f){f();}},hold={},p;try{for(p in _28a){hold[p]=dojo[p];dojo[p]=_28a[p];}_285.def.apply(null,args);}catch(e){_292("error",[_26c("failedDojoLoadInit"),e]);}finally{for(p in _28a){dojo[p]=hold[p];}}if(_289){_288=_288.concat(_289);}if(_288.length){_271(_288.join(","),_283,_284);}else{_284();}});});},_293=function(text,_294,_295){var _296=/\(|\)/g,_297=1,_298;_296.lastIndex=_294;while((_298=_296.exec(text))){if(_298[0]==")"){_297-=1;}else{_297+=1;}if(_297==0){break;}}if(_297!=0){throw "unmatched paren around character "+_296.lastIndex+" in: "+text;}return [dojo.trim(text.substring(_295,_296.lastIndex))+";\n",_296.lastIndex];},_299=/(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,_29a=/(^|\s)dojo\.(loadInit|require|provide|requireLocalization|requireIf|requireAfterIf|platformRequire)\s*\(/mg,_29b=/(^|\s)(require|define)\s*\(/m,_29c=function(text,_29d){var _29e,_29f,_2a0,_2a1,_2a2=[],_2a3=[],_2a4=[];_29d=_29d||text.replace(_299,function(_2a5){_29a.lastIndex=_29b.lastIndex=0;return (_29a.test(_2a5)||_29b.test(_2a5))?"":_2a5;});while((_29e=_29a.exec(_29d))){_29f=_29a.lastIndex;_2a0=_29f-_29e[0].length;_2a1=_293(_29d,_29f,_2a0);if(_29e[2]=="loadInit"){_2a2.push(_2a1[0]);}else{_2a3.push(_2a1[0]);}_29a.lastIndex=_2a1[1];}_2a4=_2a2.concat(_2a3);if(_2a4.length||!_29b.test(_29d)){return [text.replace(/(^|\s)dojo\.loadInit\s*\(/g,"\n0 && dojo.loadInit("),_2a4.join(""),_2a4];}else{return 0;}},_2a6=function(_2a7,text){var _2a8,id,_2a9=[],_2aa=[];if(_26e.test(text)||!(_2a8=_29c(text))){return 0;}id=_2a7.mid+"-*loadInit";for(var p in _275("dojo",_2a7).result.scopeMap){_2a9.push(p);_2aa.push("\""+p+"\"");}return "// xdomain rewrite of "+_2a7.mid+"\n"+"define('"+id+"',{\n"+"\tnames:"+dojo.toJson(_2a9)+",\n"+"\tdef:function("+_2a9.join(",")+"){"+_2a8[1]+"}"+"});\n\n"+"define("+dojo.toJson(_2a9.concat(["dojo/loadInit!"+id]))+", function("+_2a9.join(",")+"){\n"+_2a8[0]+"});";},_2ab=_269.initSyncLoader(_271,_277,_2a6),sync=_2ab.sync,_27a=_2ab.requested,_2ac=_2ab.arrived,_2ad=_2ab.nonmodule,_2ae=_2ab.executing,_2af=_2ab.executed,_2b0=_2ab.syncExecStack,_279=_2ab.modules,_2b1=_2ab.execQ,_275=_2ab.getModule,_276=_2ab.injectModule,_2b2=_2ab.setArrived,_292=_2ab.signal,_2b3=_2ab.finishExec,_2b4=_2ab.execModule,_2b5=_2ab.getLegacyMode,_27b=_2ab.guardCheckComplete;_271=_2ab.dojoRequirePlugin;dojo.provide=function(mid){var _2b6=_2b0[0],_2b7=lang.mixin(_275(_26d(mid),_269.module),{executed:_2ae,result:lang.getObject(mid,true)});_2b2(_2b7);if(_2b6){(_2b6.provides||(_2b6.provides=[])).push(function(){_2b7.result=lang.getObject(mid);delete _2b7.provides;_2b7.executed!==_2af&&_2b3(_2b7);});}return _2b7.result;};has.add("config-publishRequireResult",1,0,0);dojo.require=function(_2b8,_2b9){function _2ba(mid,_2bb){var _2bc=_275(_26d(mid),_269.module);if(_2b0.length&&_2b0[0].finish){_2b0[0].finish.push(mid);return undefined;}if(_2bc.executed){return _2bc.result;}_2bb&&(_2bc.result=_2ad);var _2bd=_2b5();_276(_2bc);_2bd=_2b5();if(_2bc.executed!==_2af&&_2bc.injected===_2ac){_2ab.guardCheckComplete(function(){_2b4(_2bc);});}if(_2bc.executed){return _2bc.result;}if(_2bd==sync){if(_2bc.cjs){_2b1.unshift(_2bc);}else{_2b0.length&&(_2b0[0].finish=[mid]);}}else{_2b1.push(_2bc);}return undefined;};var _2be=_2ba(_2b8,_2b9);if(has("config-publishRequireResult")&&!lang.exists(_2b8)&&_2be!==undefined){lang.setObject(_2b8,_2be);}return _2be;};dojo.loadInit=function(f){f();};dojo.registerModulePath=function(_2bf,_2c0){var _2c1={};_2c1[_2bf.replace(/\./g,"/")]=_2c0;_269({paths:_2c1});};dojo.platformRequire=function(_2c2){var _2c3=(_2c2.common||[]).concat(_2c2[dojo._name]||_2c2["default"]||[]),temp;while(_2c3.length){if(lang.isArray(temp=_2c3.shift())){dojo.require.apply(dojo,temp);}else{dojo.require(temp);}}};dojo.requireIf=dojo.requireAfterIf=function(_2c4,_2c5,_2c6){if(_2c4){dojo.require(_2c5,_2c6);}};dojo.requireLocalization=function(_2c7,_2c8,_2c9){_269(["../i18n"],function(i18n){i18n.getLocalization(_2c7,_2c8,_2c9);});};return {extractLegacyApiApplications:_29c,require:_271,loadInit:_282};});},"dojo/json":function(){define(["./has"],function(has){"use strict";var _2ca=typeof JSON!="undefined";has.add("json-parse",_2ca);has.add("json-stringify",_2ca&&JSON.stringify({a:0},function(k,v){return v||1;})=="{\"a\":1}");if(has("json-stringify")){return JSON;}else{var _2cb=function(str){return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");};return {parse:has("json-parse")?JSON.parse:function(str,_2cc){if(_2cc&&!/^([\s\[\{]*(?:"(?:\\.|[^"])+"|-?\d[\d\.]*(?:[Ee][+-]?\d+)?|null|true|false|)[\s\]\}]*(?:,|:|$))+$/.test(str)){throw new SyntaxError("Invalid characters in JSON");}return eval("("+str+")");},stringify:function(_2cd,_2ce,_2cf){var _2d0;if(typeof _2ce=="string"){_2cf=_2ce;_2ce=null;}function _2d1(it,_2d2,key){if(_2ce){it=_2ce(key,it);}var val,_2d3=typeof it;if(_2d3=="number"){return isFinite(it)?it+"":"null";}if(_2d3=="boolean"){return it+"";}if(it===null){return "null";}if(typeof it=="string"){return _2cb(it);}if(_2d3=="function"||_2d3=="undefined"){return _2d0;}if(typeof it.toJSON=="function"){return _2d1(it.toJSON(key),_2d2,key);}if(it instanceof Date){return "\"{FullYear}-{Month+}-{Date}T{Hours}:{Minutes}:{Seconds}Z\"".replace(/\{(\w+)(\+)?\}/g,function(t,prop,plus){var num=it["getUTC"+prop]()+(plus?1:0);return num<10?"0"+num:num;});}if(it.valueOf()!==it){return _2d1(it.valueOf(),_2d2,key);}var _2d4=_2cf?(_2d2+_2cf):"";var sep=_2cf?" ":"";var _2d5=_2cf?"\n":"";if(it instanceof Array){var itl=it.length,res=[];for(key=0;key<itl;key++){var obj=it[key];val=_2d1(obj,_2d4,key);if(typeof val!="string"){val="null";}res.push(_2d5+_2d4+val);}return "["+res.join(",")+_2d5+_2d2+"]";}var _2d6=[];for(key in it){var _2d7;if(it.hasOwnProperty(key)){if(typeof key=="number"){_2d7="\""+key+"\"";}else{if(typeof key=="string"){_2d7=_2cb(key);}else{continue;}}val=_2d1(it[key],_2d4,key);if(typeof val!="string"){continue;}_2d6.push(_2d5+_2d4+_2d7+":"+sep+val);}}return "{"+_2d6.join(",")+_2d5+_2d2+"}";};return _2d1(_2cd,"","");}};}});},"dojo/_base/declare":function(){define(["./kernel","../has","./lang"],function(dojo,has,lang){var mix=lang.mixin,op=Object.prototype,opts=op.toString,xtor=new Function,_2d8=0,_2d9="constructor";function err(msg,cls){throw new Error("declare"+(cls?" "+cls:"")+": "+msg);};function _2da(_2db,_2dc){var _2dd=[],_2de=[{cls:0,refs:[]}],_2df={},_2e0=1,l=_2db.length,i=0,j,lin,base,top,_2e1,rec,name,refs;for(;i<l;++i){base=_2db[i];if(!base){err("mixin #"+i+" is unknown. Did you use dojo.require to pull it in?",_2dc);}else{if(opts.call(base)!="[object Function]"){err("mixin #"+i+" is not a callable constructor.",_2dc);}}lin=base._meta?base._meta.bases:[base];top=0;for(j=lin.length-1;j>=0;--j){_2e1=lin[j].prototype;if(!_2e1.hasOwnProperty("declaredClass")){_2e1.declaredClass="uniqName_"+(_2d8++);}name=_2e1.declaredClass;if(!_2df.hasOwnProperty(name)){_2df[name]={count:0,refs:[],cls:lin[j]};++_2e0;}rec=_2df[name];if(top&&top!==rec){rec.refs.push(top);++top.count;}top=rec;}++top.count;_2de[0].refs.push(top);}while(_2de.length){top=_2de.pop();_2dd.push(top.cls);--_2e0;while(refs=top.refs,refs.length==1){top=refs[0];if(!top||--top.count){top=0;break;}_2dd.push(top.cls);--_2e0;}if(top){for(i=0,l=refs.length;i<l;++i){top=refs[i];if(!--top.count){_2de.push(top);}}}}if(_2e0){err("can't build consistent linearization",_2dc);}base=_2db[0];_2dd[0]=base?base._meta&&base===_2dd[_2dd.length-base._meta.bases.length]?base._meta.bases.length:1:0;return _2dd;};function _2e2(args,a,f){var name,_2e3,_2e4,_2e5,meta,base,_2e6,opf,pos,_2e7=this._inherited=this._inherited||{};if(typeof args=="string"){name=args;args=a;a=f;}f=0;_2e5=args.callee;name=name||_2e5.nom;if(!name){err("can't deduce a name to call inherited()",this.declaredClass);}meta=this.constructor._meta;_2e4=meta.bases;pos=_2e7.p;if(name!=_2d9){if(_2e7.c!==_2e5){pos=0;base=_2e4[0];meta=base._meta;if(meta.hidden[name]!==_2e5){_2e3=meta.chains;if(_2e3&&typeof _2e3[name]=="string"){err("calling chained method with inherited: "+name,this.declaredClass);}do{meta=base._meta;_2e6=base.prototype;if(meta&&(_2e6[name]===_2e5&&_2e6.hasOwnProperty(name)||meta.hidden[name]===_2e5)){break;}}while(base=_2e4[++pos]);pos=base?pos:-1;}}base=_2e4[++pos];if(base){_2e6=base.prototype;if(base._meta&&_2e6.hasOwnProperty(name)){f=_2e6[name];}else{opf=op[name];do{_2e6=base.prototype;f=_2e6[name];if(f&&(base._meta?_2e6.hasOwnProperty(name):f!==opf)){break;}}while(base=_2e4[++pos]);}}f=base&&f||op[name];}else{if(_2e7.c!==_2e5){pos=0;meta=_2e4[0]._meta;if(meta&&meta.ctor!==_2e5){_2e3=meta.chains;if(!_2e3||_2e3.constructor!=="manual"){err("calling chained constructor with inherited",this.declaredClass);}while(base=_2e4[++pos]){meta=base._meta;if(meta&&meta.ctor===_2e5){break;}}pos=base?pos:-1;}}while(base=_2e4[++pos]){meta=base._meta;f=meta?meta.ctor:base;if(f){break;}}f=base&&f;}_2e7.c=f;_2e7.p=pos;if(f){return a===true?f:f.apply(this,a||args);}};function _2e8(name,args){if(typeof name=="string"){return this.__inherited(name,args,true);}return this.__inherited(name,true);};function _2e9(args,a1,a2){var f=this.getInherited(args,a1);if(f){return f.apply(this,a2||a1||args);}};var _2ea=dojo.config.isDebug?_2e9:_2e2;function _2eb(cls){var _2ec=this.constructor._meta.bases;for(var i=0,l=_2ec.length;i<l;++i){if(_2ec[i]===cls){return true;}}return this instanceof cls;};function _2ed(_2ee,_2ef){for(var name in _2ef){if(name!=_2d9&&_2ef.hasOwnProperty(name)){_2ee[name]=_2ef[name];}}if(has("bug-for-in-skips-shadowed")){for(var _2f0=lang._extraNames,i=_2f0.length;i;){name=_2f0[--i];if(name!=_2d9&&_2ef.hasOwnProperty(name)){_2ee[name]=_2ef[name];}}}};function _2f1(_2f2,_2f3){var name,t;for(name in _2f3){t=_2f3[name];if((t!==op[name]||!(name in op))&&name!=_2d9){if(opts.call(t)=="[object Function]"){t.nom=name;}_2f2[name]=t;}}if(has("bug-for-in-skips-shadowed")){for(var _2f4=lang._extraNames,i=_2f4.length;i;){name=_2f4[--i];t=_2f3[name];if((t!==op[name]||!(name in op))&&name!=_2d9){if(opts.call(t)=="[object Function]"){t.nom=name;}_2f2[name]=t;}}}return _2f2;};function _2f5(_2f6){_2f7.safeMixin(this.prototype,_2f6);return this;};function _2f8(_2f9){return _2f7([this].concat(_2f9));};function _2fa(_2fb,_2fc){return function(){var a=arguments,args=a,a0=a[0],f,i,m,l=_2fb.length,_2fd;if(!(this instanceof a.callee)){return _2fe(a);}if(_2fc&&(a0&&a0.preamble||this.preamble)){_2fd=new Array(_2fb.length);_2fd[0]=a;for(i=0;;){a0=a[0];if(a0){f=a0.preamble;if(f){a=f.apply(this,a)||a;}}f=_2fb[i].prototype;f=f.hasOwnProperty("preamble")&&f.preamble;if(f){a=f.apply(this,a)||a;}if(++i==l){break;}_2fd[i]=a;}}for(i=l-1;i>=0;--i){f=_2fb[i];m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,_2fd?_2fd[i]:a);}}f=this.postscript;if(f){f.apply(this,args);}};};function _2ff(ctor,_300){return function(){var a=arguments,t=a,a0=a[0],f;if(!(this instanceof a.callee)){return _2fe(a);}if(_300){if(a0){f=a0.preamble;if(f){t=f.apply(this,t)||t;}}f=this.preamble;if(f){f.apply(this,t);}}if(ctor){ctor.apply(this,a);}f=this.postscript;if(f){f.apply(this,a);}};};function _301(_302){return function(){var a=arguments,i=0,f,m;if(!(this instanceof a.callee)){return _2fe(a);}for(;f=_302[i];++i){m=f._meta;f=m?m.ctor:f;if(f){f.apply(this,a);break;}}f=this.postscript;if(f){f.apply(this,a);}};};function _303(name,_304,_305){return function(){var b,m,f,i=0,step=1;if(_305){i=_304.length-1;step=-1;}for(;b=_304[i];i+=step){m=b._meta;f=(m?m.hidden:b.prototype)[name];if(f){f.apply(this,arguments);}}};};function _306(ctor){xtor.prototype=ctor.prototype;var t=new xtor;xtor.prototype=null;return t;};function _2fe(args){var ctor=args.callee,t=_306(ctor);ctor.apply(t,args);return t;};function _2f7(_307,_308,_309){if(typeof _307!="string"){_309=_308;_308=_307;_307="";}_309=_309||{};var _30a,i,t,ctor,name,_30b,_30c,_30d=1,_30e=_308;if(opts.call(_308)=="[object Array]"){_30b=_2da(_308,_307);t=_30b[0];_30d=_30b.length-t;_308=_30b[_30d];}else{_30b=[0];if(_308){if(opts.call(_308)=="[object Function]"){t=_308._meta;_30b=_30b.concat(t?t.bases:_308);}else{err("base class is not a callable constructor.",_307);}}else{if(_308!==null){err("unknown base class. Did you use dojo.require to pull it in?",_307);}}}if(_308){for(i=_30d-1;;--i){_30a=_306(_308);if(!i){break;}t=_30b[i];(t._meta?_2ed:mix)(_30a,t.prototype);ctor=new Function;ctor.superclass=_308;ctor.prototype=_30a;_308=_30a.constructor=ctor;}}else{_30a={};}_2f7.safeMixin(_30a,_309);t=_309.constructor;if(t!==op.constructor){t.nom=_2d9;_30a.constructor=t;}for(i=_30d-1;i;--i){t=_30b[i]._meta;if(t&&t.chains){_30c=mix(_30c||{},t.chains);}}if(_30a["-chains-"]){_30c=mix(_30c||{},_30a["-chains-"]);}t=!_30c||!_30c.hasOwnProperty(_2d9);_30b[0]=ctor=(_30c&&_30c.constructor==="manual")?_301(_30b):(_30b.length==1?_2ff(_309.constructor,t):_2fa(_30b,t));ctor._meta={bases:_30b,hidden:_309,chains:_30c,parents:_30e,ctor:_309.constructor};ctor.superclass=_308&&_308.prototype;ctor.extend=_2f5;ctor.createSubclass=_2f8;ctor.prototype=_30a;_30a.constructor=ctor;_30a.getInherited=_2e8;_30a.isInstanceOf=_2eb;_30a.inherited=_2ea;_30a.__inherited=_2e2;if(_307){_30a.declaredClass=_307;lang.setObject(_307,ctor);}if(_30c){for(name in _30c){if(_30a[name]&&typeof _30c[name]=="string"&&name!=_2d9){t=_30a[name]=_303(name,_30b,_30c[name]==="after");t.nom=name;}}}return ctor;};dojo.safeMixin=_2f7.safeMixin=_2f1;dojo.declare=_2f7;return _2f7;});},"dojo/dom":function(){define(["./sniff","./_base/window"],function(has,win){if(has("ie")<=7){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}var dom={};if(has("ie")){dom.byId=function(id,doc){if(typeof id!="string"){return id;}var _30f=doc||win.doc,te=id&&_30f.getElementById(id);if(te&&(te.attributes.id.value==id||te.id==id)){return te;}else{var eles=_30f.all[id];if(!eles||eles.nodeName){eles=[eles];}var i=0;while((te=eles[i++])){if((te.attributes&&te.attributes.id&&te.attributes.id.value==id)||te.id==id){return te;}}}};}else{dom.byId=function(id,doc){return ((typeof id=="string")?(doc||win.doc).getElementById(id):id)||null;};}dom.isDescendant=function(node,_310){try{node=dom.byId(node);_310=dom.byId(_310);while(node){if(node==_310){return true;}node=node.parentNode;}}catch(e){}return false;};has.add("css-user-select",function(_311,doc,_312){if(!_312){return false;}var _313=_312.style;var _314=["Khtml","O","Moz","Webkit"],i=_314.length,name="userSelect",_315;do{if(typeof _313[name]!=="undefined"){return name;}}while(i--&&(name=_314[i]+"UserSelect"));return false;});var _316=has("css-user-select");dom.setSelectable=_316?function(node,_317){dom.byId(node).style[_316]=_317?"":"none";}:function(node,_318){node=dom.byId(node);var _319=node.getElementsByTagName("*"),i=_319.length;if(_318){node.removeAttribute("unselectable");while(i--){_319[i].removeAttribute("unselectable");}}else{node.setAttribute("unselectable","on");while(i--){_319[i].setAttribute("unselectable","on");}}};return dom;});},"dojo/_base/browser":function(){if(require.has){require.has.add("config-selectorEngine","acme");}define(["../ready","./kernel","./connect","./unload","./window","./event","./html","./NodeList","../query","./xhr","./fx"],function(dojo){return dojo;});},"dojo/selector/acme":function(){define(["../dom","../sniff","../_base/array","../_base/lang","../_base/window"],function(dom,has,_31a,lang,win){var trim=lang.trim;var each=_31a.forEach;var _31b=function(){return win.doc;};var _31c=(_31b().compatMode)=="BackCompat";var _31d=">~+";var _31e=false;var _31f=function(){return true;};var _320=function(_321){if(_31d.indexOf(_321.slice(-1))>=0){_321+=" * ";}else{_321+=" ";}var ts=function(s,e){return trim(_321.slice(s,e));};var _322=[];var _323=-1,_324=-1,_325=-1,_326=-1,_327=-1,inId=-1,_328=-1,_329,lc="",cc="",_32a;var x=0,ql=_321.length,_32b=null,_32c=null;var _32d=function(){if(_328>=0){var tv=(_328==x)?null:ts(_328,x);_32b[(_31d.indexOf(tv)<0)?"tag":"oper"]=tv;_328=-1;}};var _32e=function(){if(inId>=0){_32b.id=ts(inId,x).replace(/\\/g,"");inId=-1;}};var _32f=function(){if(_327>=0){_32b.classes.push(ts(_327+1,x).replace(/\\/g,""));_327=-1;}};var _330=function(){_32e();_32d();_32f();};var _331=function(){_330();if(_326>=0){_32b.pseudos.push({name:ts(_326+1,x)});}_32b.loops=(_32b.pseudos.length||_32b.attrs.length||_32b.classes.length);_32b.oquery=_32b.query=ts(_32a,x);_32b.otag=_32b.tag=(_32b["oper"])?null:(_32b.tag||"*");if(_32b.tag){_32b.tag=_32b.tag.toUpperCase();}if(_322.length&&(_322[_322.length-1].oper)){_32b.infixOper=_322.pop();_32b.query=_32b.infixOper.query+" "+_32b.query;}_322.push(_32b);_32b=null;};for(;lc=cc,cc=_321.charAt(x),x<ql;x++){if(lc=="\\"){continue;}if(!_32b){_32a=x;_32b={query:null,pseudos:[],attrs:[],classes:[],tag:null,oper:null,id:null,getTag:function(){return _31e?this.otag:this.tag;}};_328=x;}if(_329){if(cc==_329){_329=null;}continue;}else{if(cc=="'"||cc=="\""){_329=cc;continue;}}if(_323>=0){if(cc=="]"){if(!_32c.attr){_32c.attr=ts(_323+1,x);}else{_32c.matchFor=ts((_325||_323+1),x);}var cmf=_32c.matchFor;if(cmf){if((cmf.charAt(0)=="\"")||(cmf.charAt(0)=="'")){_32c.matchFor=cmf.slice(1,-1);}}if(_32c.matchFor){_32c.matchFor=_32c.matchFor.replace(/\\/g,"");}_32b.attrs.push(_32c);_32c=null;_323=_325=-1;}else{if(cc=="="){var _332=("|~^$*".indexOf(lc)>=0)?lc:"";_32c.type=_332+cc;_32c.attr=ts(_323+1,x-_332.length);_325=x+1;}}}else{if(_324>=0){if(cc==")"){if(_326>=0){_32c.value=ts(_324+1,x);}_326=_324=-1;}}else{if(cc=="#"){_330();inId=x+1;}else{if(cc=="."){_330();_327=x;}else{if(cc==":"){_330();_326=x;}else{if(cc=="["){_330();_323=x;_32c={};}else{if(cc=="("){if(_326>=0){_32c={name:ts(_326+1,x),value:null};_32b.pseudos.push(_32c);}_324=x;}else{if((cc==" ")&&(lc!=cc)){_331();}}}}}}}}}return _322;};var _333=function(_334,_335){if(!_334){return _335;}if(!_335){return _334;}return function(){return _334.apply(window,arguments)&&_335.apply(window,arguments);};};var _336=function(i,arr){var r=arr||[];if(i){r.push(i);}return r;};var _337=function(n){return (1==n.nodeType);};var _338="";var _339=function(elem,attr){if(!elem){return _338;}if(attr=="class"){return elem.className||_338;}if(attr=="for"){return elem.htmlFor||_338;}if(attr=="style"){return elem.style.cssText||_338;}return (_31e?elem.getAttribute(attr):elem.getAttribute(attr,2))||_338;};var _33a={"*=":function(attr,_33b){return function(elem){return (_339(elem,attr).indexOf(_33b)>=0);};},"^=":function(attr,_33c){return function(elem){return (_339(elem,attr).indexOf(_33c)==0);};},"$=":function(attr,_33d){return function(elem){var ea=" "+_339(elem,attr);var _33e=ea.lastIndexOf(_33d);return _33e>-1&&(_33e==(ea.length-_33d.length));};},"~=":function(attr,_33f){var tval=" "+_33f+" ";return function(elem){var ea=" "+_339(elem,attr)+" ";return (ea.indexOf(tval)>=0);};},"|=":function(attr,_340){var _341=_340+"-";return function(elem){var ea=_339(elem,attr);return ((ea==_340)||(ea.indexOf(_341)==0));};},"=":function(attr,_342){return function(elem){return (_339(elem,attr)==_342);};}};var _343=(typeof _31b().firstChild.nextElementSibling=="undefined");var _344=!_343?"nextElementSibling":"nextSibling";var _345=!_343?"previousElementSibling":"previousSibling";var _346=(_343?_337:_31f);var _347=function(node){while(node=node[_345]){if(_346(node)){return false;}}return true;};var _348=function(node){while(node=node[_344]){if(_346(node)){return false;}}return true;};var _349=function(node){var root=node.parentNode;root=root.nodeType!=7?root:root.nextSibling;var i=0,tret=root.children||root.childNodes,ci=(node["_i"]||node.getAttribute("_i")||-1),cl=(root["_l"]||(typeof root.getAttribute!=="undefined"?root.getAttribute("_l"):-1));if(!tret){return -1;}var l=tret.length;if(cl==l&&ci>=0&&cl>=0){return ci;}if(has("ie")&&typeof root.setAttribute!=="undefined"){root.setAttribute("_l",l);}else{root["_l"]=l;}ci=-1;for(var te=root["firstElementChild"]||root["firstChild"];te;te=te[_344]){if(_346(te)){if(has("ie")){te.setAttribute("_i",++i);}else{te["_i"]=++i;}if(node===te){ci=i;}}}return ci;};var _34a=function(elem){return !((_349(elem))%2);};var _34b=function(elem){return ((_349(elem))%2);};var _34c={"checked":function(name,_34d){return function(elem){return !!("checked" in elem?elem.checked:elem.selected);};},"disabled":function(name,_34e){return function(elem){return elem.disabled;};},"enabled":function(name,_34f){return function(elem){return !elem.disabled;};},"first-child":function(){return _347;},"last-child":function(){return _348;},"only-child":function(name,_350){return function(node){return _347(node)&&_348(node);};},"empty":function(name,_351){return function(elem){var cn=elem.childNodes;var cnl=elem.childNodes.length;for(var x=cnl-1;x>=0;x--){var nt=cn[x].nodeType;if((nt===1)||(nt==3)){return false;}}return true;};},"contains":function(name,_352){var cz=_352.charAt(0);if(cz=="\""||cz=="'"){_352=_352.slice(1,-1);}return function(elem){return (elem.innerHTML.indexOf(_352)>=0);};},"not":function(name,_353){var p=_320(_353)[0];var _354={el:1};if(p.tag!="*"){_354.tag=1;}if(!p.classes.length){_354.classes=1;}var ntf=_355(p,_354);return function(elem){return (!ntf(elem));};},"nth-child":function(name,_356){var pi=parseInt;if(_356=="odd"){return _34b;}else{if(_356=="even"){return _34a;}}if(_356.indexOf("n")!=-1){var _357=_356.split("n",2);var pred=_357[0]?((_357[0]=="-")?-1:pi(_357[0])):1;var idx=_357[1]?pi(_357[1]):0;var lb=0,ub=-1;if(pred>0){if(idx<0){idx=(idx%pred)&&(pred+(idx%pred));}else{if(idx>0){if(idx>=pred){lb=idx-idx%pred;}idx=idx%pred;}}}else{if(pred<0){pred*=-1;if(idx>0){ub=idx;idx=idx%pred;}}}if(pred>0){return function(elem){var i=_349(elem);return (i>=lb)&&(ub<0||i<=ub)&&((i%pred)==idx);};}else{_356=idx;}}var _358=pi(_356);return function(elem){return (_349(elem)==_358);};}};var _359=(has("ie")<9||has("ie")==9&&has("quirks"))?function(cond){var clc=cond.toLowerCase();if(clc=="class"){cond="className";}return function(elem){return (_31e?elem.getAttribute(cond):elem[cond]||elem[clc]);};}:function(cond){return function(elem){return (elem&&elem.getAttribute&&elem.hasAttribute(cond));};};var _355=function(_35a,_35b){if(!_35a){return _31f;}_35b=_35b||{};var ff=null;if(!("el" in _35b)){ff=_333(ff,_337);}if(!("tag" in _35b)){if(_35a.tag!="*"){ff=_333(ff,function(elem){return (elem&&((_31e?elem.tagName:elem.tagName.toUpperCase())==_35a.getTag()));});}}if(!("classes" in _35b)){each(_35a.classes,function(_35c,idx,arr){var re=new RegExp("(?:^|\\s)"+_35c+"(?:\\s|$)");ff=_333(ff,function(elem){return re.test(elem.className);});ff.count=idx;});}if(!("pseudos" in _35b)){each(_35a.pseudos,function(_35d){var pn=_35d.name;if(_34c[pn]){ff=_333(ff,_34c[pn](pn,_35d.value));}});}if(!("attrs" in _35b)){each(_35a.attrs,function(attr){var _35e;var a=attr.attr;if(attr.type&&_33a[attr.type]){_35e=_33a[attr.type](a,attr.matchFor);}else{if(a.length){_35e=_359(a);}}if(_35e){ff=_333(ff,_35e);}});}if(!("id" in _35b)){if(_35a.id){ff=_333(ff,function(elem){return (!!elem&&(elem.id==_35a.id));});}}if(!ff){if(!("default" in _35b)){ff=_31f;}}return ff;};var _35f=function(_360){return function(node,ret,bag){while(node=node[_344]){if(_343&&(!_337(node))){continue;}if((!bag||_361(node,bag))&&_360(node)){ret.push(node);}break;}return ret;};};var _362=function(_363){return function(root,ret,bag){var te=root[_344];while(te){if(_346(te)){if(bag&&!_361(te,bag)){break;}if(_363(te)){ret.push(te);}}te=te[_344];}return ret;};};var _364=function(_365){_365=_365||_31f;return function(root,ret,bag){var te,x=0,tret=root.children||root.childNodes;while(te=tret[x++]){if(_346(te)&&(!bag||_361(te,bag))&&(_365(te,x))){ret.push(te);}}return ret;};};var _366=function(node,root){var pn=node.parentNode;while(pn){if(pn==root){break;}pn=pn.parentNode;}return !!pn;};var _367={};var _368=function(_369){var _36a=_367[_369.query];if(_36a){return _36a;}var io=_369.infixOper;var oper=(io?io.oper:"");var _36b=_355(_369,{el:1});var qt=_369.tag;var _36c=("*"==qt);var ecs=_31b()["getElementsByClassName"];if(!oper){if(_369.id){_36b=(!_369.loops&&_36c)?_31f:_355(_369,{el:1,id:1});_36a=function(root,arr){var te=dom.byId(_369.id,(root.ownerDocument||root));if(!te||!_36b(te)){return;}if(9==root.nodeType){return _336(te,arr);}else{if(_366(te,root)){return _336(te,arr);}}};}else{if(ecs&&/\{\s*\[native code\]\s*\}/.test(String(ecs))&&_369.classes.length&&!_31c){_36b=_355(_369,{el:1,classes:1,id:1});var _36d=_369.classes.join(" ");_36a=function(root,arr,bag){var ret=_336(0,arr),te,x=0;var tret=root.getElementsByClassName(_36d);while((te=tret[x++])){if(_36b(te,root)&&_361(te,bag)){ret.push(te);}}return ret;};}else{if(!_36c&&!_369.loops){_36a=function(root,arr,bag){var ret=_336(0,arr),te,x=0;var tag=_369.getTag(),tret=tag?root.getElementsByTagName(tag):[];while((te=tret[x++])){if(_361(te,bag)){ret.push(te);}}return ret;};}else{_36b=_355(_369,{el:1,tag:1,id:1});_36a=function(root,arr,bag){var ret=_336(0,arr),te,x=0;var tag=_369.getTag(),tret=tag?root.getElementsByTagName(tag):[];while((te=tret[x++])){if(_36b(te,root)&&_361(te,bag)){ret.push(te);}}return ret;};}}}}else{var _36e={el:1};if(_36c){_36e.tag=1;}_36b=_355(_369,_36e);if("+"==oper){_36a=_35f(_36b);}else{if("~"==oper){_36a=_362(_36b);}else{if(">"==oper){_36a=_364(_36b);}}}}return _367[_369.query]=_36a;};var _36f=function(root,_370){var _371=_336(root),qp,x,te,qpl=_370.length,bag,ret;for(var i=0;i<qpl;i++){ret=[];qp=_370[i];x=_371.length-1;if(x>0){bag={};ret.nozip=true;}var gef=_368(qp);for(var j=0;(te=_371[j]);j++){gef(te,ret,bag);}if(!ret.length){break;}_371=ret;}return ret;};var _372={},_373={};var _374=function(_375){var _376=_320(trim(_375));if(_376.length==1){var tef=_368(_376[0]);return function(root){var r=tef(root,[]);if(r){r.nozip=true;}return r;};}return function(root){return _36f(root,_376);};};var _377=has("ie")?"commentStrip":"nozip";var qsa="querySelectorAll";var _378=!!_31b()[qsa];var _379=/\\[>~+]|n\+\d|([^ \\])?([>~+])([^ =])?/g;var _37a=function(_37b,pre,ch,post){return ch?(pre?pre+" ":"")+ch+(post?" "+post:""):_37b;};var _37c=/([^[]*)([^\]]*])?/g;var _37d=function(_37e,_37f,att){return _37f.replace(_379,_37a)+(att||"");};var _380=function(_381,_382){_381=_381.replace(_37c,_37d);if(_378){var _383=_373[_381];if(_383&&!_382){return _383;}}var _384=_372[_381];if(_384){return _384;}var qcz=_381.charAt(0);var _385=(-1==_381.indexOf(" "));if((_381.indexOf("#")>=0)&&(_385)){_382=true;}var _386=(_378&&(!_382)&&(_31d.indexOf(qcz)==-1)&&(!has("ie")||(_381.indexOf(":")==-1))&&(!(_31c&&(_381.indexOf(".")>=0)))&&(_381.indexOf(":contains")==-1)&&(_381.indexOf(":checked")==-1)&&(_381.indexOf("|=")==-1));if(_386){var tq=(_31d.indexOf(_381.charAt(_381.length-1))>=0)?(_381+" *"):_381;return _373[_381]=function(root){try{if(!((9==root.nodeType)||_385)){throw "";}var r=root[qsa](tq);r[_377]=true;return r;}catch(e){return _380(_381,true)(root);}};}else{var _387=_381.match(/([^\s,](?:"(?:\\.|[^"])+"|'(?:\\.|[^'])+'|[^,])*)/g);return _372[_381]=((_387.length<2)?_374(_381):function(root){var _388=0,ret=[],tp;while((tp=_387[_388++])){ret=ret.concat(_374(tp)(root));}return ret;});}};var _389=0;var _38a=has("ie")?function(node){if(_31e){return (node.getAttribute("_uid")||node.setAttribute("_uid",++_389)||_389);}else{return node.uniqueID;}}:function(node){return (node._uid||(node._uid=++_389));};var _361=function(node,bag){if(!bag){return 1;}var id=_38a(node);if(!bag[id]){return bag[id]=1;}return 0;};var _38b="_zipIdx";var _38c=function(arr){if(arr&&arr.nozip){return arr;}var ret=[];if(!arr||!arr.length){return ret;}if(arr[0]){ret.push(arr[0]);}if(arr.length<2){return ret;}_389++;var x,te;if(has("ie")&&_31e){var _38d=_389+"";arr[0].setAttribute(_38b,_38d);for(x=1;te=arr[x];x++){if(arr[x].getAttribute(_38b)!=_38d){ret.push(te);}te.setAttribute(_38b,_38d);}}else{if(has("ie")&&arr.commentStrip){try{for(x=1;te=arr[x];x++){if(_337(te)){ret.push(te);}}}catch(e){}}else{if(arr[0]){arr[0][_38b]=_389;}for(x=1;te=arr[x];x++){if(arr[x][_38b]!=_389){ret.push(te);}te[_38b]=_389;}}}return ret;};var _38e=function(_38f,root){root=root||_31b();var od=root.ownerDocument||root;_31e=(od.createElement("div").tagName==="div");var r=_380(_38f)(root);if(r&&r.nozip){return r;}return _38c(r);};_38e.filter=function(_390,_391,root){var _392=[],_393=_320(_391),_394=(_393.length==1&&!/[^\w#\.]/.test(_391))?_355(_393[0]):function(node){return _31a.indexOf(_38e(_391,dom.byId(root)),node)!=-1;};for(var x=0,te;te=_390[x];x++){if(_394(te)){_392.push(te);}}return _392;};return _38e;});},"dojo/errors/RequestTimeoutError":function(){define("dojo/errors/RequestTimeoutError",["./create","./RequestError"],function(_395,_396){return _395("RequestTimeoutError",null,_396,{dojoType:"timeout"});});},"dojo/dom-style":function(){define("dojo/dom-style",["./sniff","./dom"],function(has,dom){var _397,_398={};if(has("webkit")){_397=function(node){var s;if(node.nodeType==1){var dv=node.ownerDocument.defaultView;s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}}return s||{};};}else{if(has("ie")&&(has("ie")<9||has("quirks"))){_397=function(node){return node.nodeType==1&&node.currentStyle?node.currentStyle:{};};}else{_397=function(node){return node.nodeType==1?node.ownerDocument.defaultView.getComputedStyle(node,null):{};};}}_398.getComputedStyle=_397;var _399;if(!has("ie")){_399=function(_39a,_39b){return parseFloat(_39b)||0;};}else{_399=function(_39c,_39d){if(!_39d){return 0;}if(_39d=="medium"){return 4;}if(_39d.slice&&_39d.slice(-2)=="px"){return parseFloat(_39d);}var s=_39c.style,rs=_39c.runtimeStyle,cs=_39c.currentStyle,_39e=s.left,_39f=rs.left;rs.left=cs.left;try{s.left=_39d;_39d=s.pixelLeft;}catch(e){_39d=0;}s.left=_39e;rs.left=_39f;return _39d;};}_398.toPixelValue=_399;var astr="DXImageTransform.Microsoft.Alpha";var af=function(n,f){try{return n.filters.item(astr);}catch(e){return f?{}:null;}};var _3a0=has("ie")<9||(has("ie")<10&&has("quirks"))?function(node){try{return af(node).Opacity/100;}catch(e){return 1;}}:function(node){return _397(node).opacity;};var _3a1=has("ie")<9||(has("ie")<10&&has("quirks"))?function(node,_3a2){var ov=_3a2*100,_3a3=_3a2==1;node.style.zoom=_3a3?"":1;if(!af(node)){if(_3a3){return _3a2;}node.style.filter+=" progid:"+astr+"(Opacity="+ov+")";}else{af(node,1).Opacity=ov;}af(node,1).Enabled=!_3a3;if(node.tagName.toLowerCase()=="tr"){for(var td=node.firstChild;td;td=td.nextSibling){if(td.tagName.toLowerCase()=="td"){_3a1(td,_3a2);}}}return _3a2;}:function(node,_3a4){return node.style.opacity=_3a4;};var _3a5={left:true,top:true};var _3a6=/margin|padding|width|height|max|min|offset/;function _3a7(node,type,_3a8){type=type.toLowerCase();if(has("ie")||has("trident")){if(_3a8=="auto"){if(type=="height"){return node.offsetHeight;}if(type=="width"){return node.offsetWidth;}}if(type=="fontweight"){switch(_3a8){case 700:return "bold";case 400:default:return "normal";}}}if(!(type in _3a5)){_3a5[type]=_3a6.test(type);}return _3a5[type]?_399(node,_3a8):_3a8;};var _3a9={cssFloat:1,styleFloat:1,"float":1};_398.get=function getStyle(node,name){var n=dom.byId(node),l=arguments.length,op=(name=="opacity");if(l==2&&op){return _3a0(n);}name=_3a9[name]?"cssFloat" in n.style?"cssFloat":"styleFloat":name;var s=_398.getComputedStyle(n);return (l==1)?s:_3a7(n,name,s[name]||n.style[name]);};_398.set=function setStyle(node,name,_3aa){var n=dom.byId(node),l=arguments.length,op=(name=="opacity");name=_3a9[name]?"cssFloat" in n.style?"cssFloat":"styleFloat":name;if(l==3){return op?_3a1(n,_3aa):n.style[name]=_3aa;}for(var x in name){_398.set(node,x,name[x]);}return _398.getComputedStyle(n);};return _398;});},"dojo/dom-geometry":function(){define(["./sniff","./_base/window","./dom","./dom-style"],function(has,win,dom,_3ab){var geom={};geom.boxModel="content-box";if(has("ie")){geom.boxModel=document.compatMode=="BackCompat"?"border-box":"content-box";}geom.getPadExtents=function getPadExtents(node,_3ac){node=dom.byId(node);var s=_3ac||_3ab.getComputedStyle(node),px=_3ab.toPixelValue,l=px(node,s.paddingLeft),t=px(node,s.paddingTop),r=px(node,s.paddingRight),b=px(node,s.paddingBottom);return {l:l,t:t,r:r,b:b,w:l+r,h:t+b};};var none="none";geom.getBorderExtents=function getBorderExtents(node,_3ad){node=dom.byId(node);var px=_3ab.toPixelValue,s=_3ad||_3ab.getComputedStyle(node),l=s.borderLeftStyle!=none?px(node,s.borderLeftWidth):0,t=s.borderTopStyle!=none?px(node,s.borderTopWidth):0,r=s.borderRightStyle!=none?px(node,s.borderRightWidth):0,b=s.borderBottomStyle!=none?px(node,s.borderBottomWidth):0;return {l:l,t:t,r:r,b:b,w:l+r,h:t+b};};geom.getPadBorderExtents=function getPadBorderExtents(node,_3ae){node=dom.byId(node);var s=_3ae||_3ab.getComputedStyle(node),p=geom.getPadExtents(node,s),b=geom.getBorderExtents(node,s);return {l:p.l+b.l,t:p.t+b.t,r:p.r+b.r,b:p.b+b.b,w:p.w+b.w,h:p.h+b.h};};geom.getMarginExtents=function getMarginExtents(node,_3af){node=dom.byId(node);var s=_3af||_3ab.getComputedStyle(node),px=_3ab.toPixelValue,l=px(node,s.marginLeft),t=px(node,s.marginTop),r=px(node,s.marginRight),b=px(node,s.marginBottom);return {l:l,t:t,r:r,b:b,w:l+r,h:t+b};};geom.getMarginBox=function getMarginBox(node,_3b0){node=dom.byId(node);var s=_3b0||_3ab.getComputedStyle(node),me=geom.getMarginExtents(node,s),l=node.offsetLeft-me.l,t=node.offsetTop-me.t,p=node.parentNode,px=_3ab.toPixelValue,pcs;if(has("mozilla")){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl;t=st;}else{if(p&&p.style){pcs=_3ab.getComputedStyle(p);if(pcs.overflow!="visible"){l+=pcs.borderLeftStyle!=none?px(node,pcs.borderLeftWidth):0;t+=pcs.borderTopStyle!=none?px(node,pcs.borderTopWidth):0;}}}}else{if(has("opera")||(has("ie")==8&&!has("quirks"))){if(p){pcs=_3ab.getComputedStyle(p);l-=pcs.borderLeftStyle!=none?px(node,pcs.borderLeftWidth):0;t-=pcs.borderTopStyle!=none?px(node,pcs.borderTopWidth):0;}}}return {l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};geom.getContentBox=function getContentBox(node,_3b1){node=dom.byId(node);var s=_3b1||_3ab.getComputedStyle(node),w=node.clientWidth,h,pe=geom.getPadExtents(node,s),be=geom.getBorderExtents(node,s);if(!w){w=node.offsetWidth;h=node.offsetHeight;}else{h=node.clientHeight;be.w=be.h=0;}if(has("opera")){pe.l+=be.l;pe.t+=be.t;}return {l:pe.l,t:pe.t,w:w-pe.w-be.w,h:h-pe.h-be.h};};function _3b2(node,l,t,w,h,u){u=u||"px";var s=node.style;if(!isNaN(l)){s.left=l+u;}if(!isNaN(t)){s.top=t+u;}if(w>=0){s.width=w+u;}if(h>=0){s.height=h+u;}};function _3b3(node){return node.tagName.toLowerCase()=="button"||node.tagName.toLowerCase()=="input"&&(node.getAttribute("type")||"").toLowerCase()=="button";};function _3b4(node){return geom.boxModel=="border-box"||node.tagName.toLowerCase()=="table"||_3b3(node);};geom.setContentSize=function setContentSize(node,box,_3b5){node=dom.byId(node);var w=box.w,h=box.h;if(_3b4(node)){var pb=geom.getPadBorderExtents(node,_3b5);if(w>=0){w+=pb.w;}if(h>=0){h+=pb.h;}}_3b2(node,NaN,NaN,w,h);};var _3b6={l:0,t:0,w:0,h:0};geom.setMarginBox=function setMarginBox(node,box,_3b7){node=dom.byId(node);var s=_3b7||_3ab.getComputedStyle(node),w=box.w,h=box.h,pb=_3b4(node)?_3b6:geom.getPadBorderExtents(node,s),mb=geom.getMarginExtents(node,s);if(has("webkit")){if(_3b3(node)){var ns=node.style;if(w>=0&&!ns.width){ns.width="4px";}if(h>=0&&!ns.height){ns.height="4px";}}}if(w>=0){w=Math.max(w-pb.w-mb.w,0);}if(h>=0){h=Math.max(h-pb.h-mb.h,0);}_3b2(node,box.l,box.t,w,h);};geom.isBodyLtr=function isBodyLtr(doc){doc=doc||win.doc;return (win.body(doc).dir||doc.documentElement.dir||"ltr").toLowerCase()=="ltr";};geom.docScroll=function docScroll(doc){doc=doc||win.doc;var node=win.doc.parentWindow||win.doc.defaultView;return "pageXOffset" in node?{x:node.pageXOffset,y:node.pageYOffset}:(node=has("quirks")?win.body(doc):doc.documentElement)&&{x:geom.fixIeBiDiScrollLeft(node.scrollLeft||0,doc),y:node.scrollTop||0};};if(has("ie")){geom.getIeDocumentElementOffset=function getIeDocumentElementOffset(doc){doc=doc||win.doc;var de=doc.documentElement;if(has("ie")<8){var r=de.getBoundingClientRect(),l=r.left,t=r.top;if(has("ie")<7){l+=de.clientLeft;t+=de.clientTop;}return {x:l<0?0:l,y:t<0?0:t};}else{return {x:0,y:0};}};}geom.fixIeBiDiScrollLeft=function fixIeBiDiScrollLeft(_3b8,doc){doc=doc||win.doc;var ie=has("ie");if(ie&&!geom.isBodyLtr(doc)){var qk=has("quirks"),de=qk?win.body(doc):doc.documentElement,pwin=win.global;if(ie==6&&!qk&&pwin.frameElement&&de.scrollHeight>de.clientHeight){_3b8+=de.clientLeft;}return (ie<8||qk)?(_3b8+de.clientWidth-de.scrollWidth):-_3b8;}return _3b8;};geom.position=function(node,_3b9){node=dom.byId(node);var db=win.body(node.ownerDocument),ret=node.getBoundingClientRect();ret={x:ret.left,y:ret.top,w:ret.right-ret.left,h:ret.bottom-ret.top};if(has("ie")<9){var _3ba=geom.getIeDocumentElementOffset(node.ownerDocument);ret.x-=_3ba.x+(has("quirks")?db.clientLeft+db.offsetLeft:0);ret.y-=_3ba.y+(has("quirks")?db.clientTop+db.offsetTop:0);}if(_3b9){var _3bb=geom.docScroll(node.ownerDocument);ret.x+=_3bb.x;ret.y+=_3bb.y;}return ret;};geom.getMarginSize=function getMarginSize(node,_3bc){node=dom.byId(node);var me=geom.getMarginExtents(node,_3bc||_3ab.getComputedStyle(node));var size=node.getBoundingClientRect();return {w:(size.right-size.left)+me.w,h:(size.bottom-size.top)+me.h};};geom.normalizeEvent=function(_3bd){if(!("layerX" in _3bd)){_3bd.layerX=_3bd.offsetX;_3bd.layerY=_3bd.offsetY;}if(!has("dom-addeventlistener")){var se=_3bd.target;var doc=(se&&se.ownerDocument)||document;var _3be=has("quirks")?doc.body:doc.documentElement;var _3bf=geom.getIeDocumentElementOffset(doc);_3bd.pageX=_3bd.clientX+geom.fixIeBiDiScrollLeft(_3be.scrollLeft||0,doc)-_3bf.x;_3bd.pageY=_3bd.clientY+(_3be.scrollTop||0)-_3bf.y;}};return geom;});},"dojo/dom-prop":function(){define(["exports","./_base/kernel","./sniff","./_base/lang","./dom","./dom-style","./dom-construct","./_base/connect"],function(_3c0,dojo,has,lang,dom,_3c1,ctr,conn){var _3c2={},_3c3=0,_3c4=dojo._scopeName+"attrid";_3c0.names={"class":"className","for":"htmlFor",tabindex:"tabIndex",readonly:"readOnly",colspan:"colSpan",frameborder:"frameBorder",rowspan:"rowSpan",valuetype:"valueType"};_3c0.get=function getProp(node,name){node=dom.byId(node);var lc=name.toLowerCase(),_3c5=_3c0.names[lc]||name;return node[_3c5];};_3c0.set=function setProp(node,name,_3c6){node=dom.byId(node);var l=arguments.length;if(l==2&&typeof name!="string"){for(var x in name){_3c0.set(node,x,name[x]);}return node;}var lc=name.toLowerCase(),_3c7=_3c0.names[lc]||name;if(_3c7=="style"&&typeof _3c6!="string"){_3c1.set(node,_3c6);return node;}if(_3c7=="innerHTML"){if(has("ie")&&node.tagName.toLowerCase() in {col:1,colgroup:1,table:1,tbody:1,tfoot:1,thead:1,tr:1,title:1}){ctr.empty(node);node.appendChild(ctr.toDom(_3c6,node.ownerDocument));}else{node[_3c7]=_3c6;}return node;}if(lang.isFunction(_3c6)){var _3c8=node[_3c4];if(!_3c8){_3c8=_3c3++;node[_3c4]=_3c8;}if(!_3c2[_3c8]){_3c2[_3c8]={};}var h=_3c2[_3c8][_3c7];if(h){conn.disconnect(h);}else{try{delete node[_3c7];}catch(e){}}if(_3c6){_3c2[_3c8][_3c7]=conn.connect(node,_3c7,_3c6);}else{node[_3c7]=null;}return node;}node[_3c7]=_3c6;return node;};});},"dojo/when":function(){define(["./Deferred","./promise/Promise"],function(_3c9,_3ca){"use strict";return function when(_3cb,_3cc,_3cd,_3ce){var _3cf=_3cb&&typeof _3cb.then==="function";var _3d0=_3cf&&_3cb instanceof _3ca;if(!_3cf){if(arguments.length>1){return _3cc?_3cc(_3cb):_3cb;}else{return new _3c9().resolve(_3cb);}}else{if(!_3d0){var _3d1=new _3c9(_3cb.cancel);_3cb.then(_3d1.resolve,_3d1.reject,_3d1.progress);_3cb=_3d1.promise;}}if(_3cc||_3cd||_3ce){return _3cb.then(_3cc,_3cd,_3ce);}return _3cb;};});},"dojo/dom-attr":function(){define(["exports","./sniff","./_base/lang","./dom","./dom-style","./dom-prop"],function(_3d2,has,lang,dom,_3d3,prop){var _3d4={innerHTML:1,className:1,htmlFor:has("ie"),value:1},_3d5={classname:"class",htmlfor:"for",tabindex:"tabIndex",readonly:"readOnly"};function _3d6(node,name){var attr=node.getAttributeNode&&node.getAttributeNode(name);return !!attr&&attr.specified;};_3d2.has=function hasAttr(node,name){var lc=name.toLowerCase();return _3d4[prop.names[lc]||name]||_3d6(dom.byId(node),_3d5[lc]||name);};_3d2.get=function getAttr(node,name){node=dom.byId(node);var lc=name.toLowerCase(),_3d7=prop.names[lc]||name,_3d8=_3d4[_3d7],_3d9=node[_3d7];if(_3d8&&typeof _3d9!="undefined"){return _3d9;}if(_3d7!="href"&&(typeof _3d9=="boolean"||lang.isFunction(_3d9))){return _3d9;}var _3da=_3d5[lc]||name;return _3d6(node,_3da)?node.getAttribute(_3da):null;};_3d2.set=function setAttr(node,name,_3db){node=dom.byId(node);if(arguments.length==2){for(var x in name){_3d2.set(node,x,name[x]);}return node;}var lc=name.toLowerCase(),_3dc=prop.names[lc]||name,_3dd=_3d4[_3dc];if(_3dc=="style"&&typeof _3db!="string"){_3d3.set(node,_3db);return node;}if(_3dd||typeof _3db=="boolean"||lang.isFunction(_3db)){return prop.set(node,name,_3db);}node.setAttribute(_3d5[lc]||name,_3db);return node;};_3d2.remove=function removeAttr(node,name){dom.byId(node).removeAttribute(_3d5[name.toLowerCase()]||name);};_3d2.getNodeProp=function getNodeProp(node,name){node=dom.byId(node);var lc=name.toLowerCase(),_3de=prop.names[lc]||name;if((_3de in node)&&_3de!="href"){return node[_3de];}var _3df=_3d5[lc]||name;return _3d6(node,_3df)?node.getAttribute(_3df):null;};});},"dojo/dom-construct":function(){define(["exports","./_base/kernel","./sniff","./_base/window","./dom","./dom-attr","./on"],function(_3e0,dojo,has,win,dom,attr,on){var _3e1={option:["select"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","thead","tr"],legend:["fieldset"],caption:["table"],colgroup:["table"],col:["table","colgroup"],li:["ul"]},_3e2=/<\s*([\w\:]+)/,_3e3={},_3e4=0,_3e5="__"+dojo._scopeName+"ToDomId";for(var _3e6 in _3e1){if(_3e1.hasOwnProperty(_3e6)){var tw=_3e1[_3e6];tw.pre=_3e6=="option"?"<select multiple=\"multiple\">":"<"+tw.join("><")+">";tw.post="</"+tw.reverse().join("></")+">";}}function _3e7(node,ref){var _3e8=ref.parentNode;if(_3e8){_3e8.insertBefore(node,ref);}};function _3e9(node,ref){var _3ea=ref.parentNode;if(_3ea){if(_3ea.lastChild==ref){_3ea.appendChild(node);}else{_3ea.insertBefore(node,ref.nextSibling);}}};_3e0.toDom=function toDom(frag,doc){doc=doc||win.doc;var _3eb=doc[_3e5];if(!_3eb){doc[_3e5]=_3eb=++_3e4+"";_3e3[_3eb]=doc.createElement("div");}frag+="";var _3ec=frag.match(_3e2),tag=_3ec?_3ec[1].toLowerCase():"",_3ed=_3e3[_3eb],wrap,i,fc,df;if(_3ec&&_3e1[tag]){wrap=_3e1[tag];_3ed.innerHTML=wrap.pre+frag+wrap.post;for(i=wrap.length;i;--i){_3ed=_3ed.firstChild;}}else{_3ed.innerHTML=frag;}if(_3ed.childNodes.length==1){return _3ed.removeChild(_3ed.firstChild);}df=doc.createDocumentFragment();while((fc=_3ed.firstChild)){df.appendChild(fc);}return df;};_3e0.place=function place(node,_3ee,_3ef){_3ee=dom.byId(_3ee);if(typeof node=="string"){node=/^\s*</.test(node)?_3e0.toDom(node,_3ee.ownerDocument):dom.byId(node);}if(typeof _3ef=="number"){var cn=_3ee.childNodes;if(!cn.length||cn.length<=_3ef){_3ee.appendChild(node);}else{_3e7(node,cn[_3ef<0?0:_3ef]);}}else{switch(_3ef){case "before":_3e7(node,_3ee);break;case "after":_3e9(node,_3ee);break;case "replace":_3ee.parentNode.replaceChild(node,_3ee);break;case "only":_3e0.empty(_3ee);_3ee.appendChild(node);break;case "first":if(_3ee.firstChild){_3e7(node,_3ee.firstChild);break;}default:_3ee.appendChild(node);}}return node;};_3e0.create=function create(tag,_3f0,_3f1,pos){var doc=win.doc;if(_3f1){_3f1=dom.byId(_3f1);doc=_3f1.ownerDocument;}if(typeof tag=="string"){tag=doc.createElement(tag);}if(_3f0){attr.set(tag,_3f0);}if(_3f1){_3e0.place(tag,_3f1,pos);}return tag;};function _3f2(node){if(node.canHaveChildren){try{node.innerHTML="";return;}catch(e){}}for(var c;c=node.lastChild;){_3f3(c,node);}};_3e0.empty=function empty(node){_3f2(dom.byId(node));};function _3f3(node,_3f4){if(node.firstChild){_3f2(node);}if(_3f4){has("ie")&&_3f4.canHaveChildren&&"removeNode" in node?node.removeNode(false):_3f4.removeChild(node);}};_3e0.destroy=function destroy(node){node=dom.byId(node);if(!node){return;}_3f3(node,node.parentNode);};});},"dojo/request/xhr":function(){define("dojo/request/xhr",["../errors/RequestError","./watch","./handlers","./util","../has"],function(_3f5,_3f6,_3f7,util,has){has.add("native-xhr",function(){return typeof XMLHttpRequest!=="undefined";});has.add("dojo-force-activex-xhr",function(){return has("activex")&&!document.addEventListener&&window.location.protocol==="file:";});has.add("native-xhr2",function(){if(!has("native-xhr")){return;}var x=new XMLHttpRequest();return typeof x["addEventListener"]!=="undefined"&&(typeof opera==="undefined"||typeof x["upload"]!=="undefined");});has.add("native-formdata",function(){return typeof FormData==="function";});function _3f8(_3f9,_3fa){var _3fb=_3f9.xhr;_3f9.status=_3f9.xhr.status;_3f9.text=_3fb.responseText;if(_3f9.options.handleAs==="xml"){_3f9.data=_3fb.responseXML;}if(!_3fa){try{_3f7(_3f9);}catch(e){_3fa=e;}}if(_3fa){this.reject(_3fa);}else{if(util.checkStatus(_3fb.status)){this.resolve(_3f9);}else{_3fa=new _3f5("Unable to load "+_3f9.url+" status: "+_3fb.status,_3f9);this.reject(_3fa);}}};var _3fc,_3fd,_3fe,_3ff;if(has("native-xhr2")){_3fc=function(_400){return !this.isFulfilled();};_3ff=function(dfd,_401){_401.xhr.abort();};_3fe=function(_402,dfd,_403){function _404(evt){dfd.handleResponse(_403);};function _405(evt){var _406=evt.target;var _407=new _3f5("Unable to load "+_403.url+" status: "+_406.status,_403);dfd.handleResponse(_403,_407);};function _408(evt){if(evt.lengthComputable){_403.loaded=evt.loaded;_403.total=evt.total;dfd.progress(_403);}};_402.addEventListener("load",_404,false);_402.addEventListener("error",_405,false);_402.addEventListener("progress",_408,false);return function(){_402.removeEventListener("load",_404,false);_402.removeEventListener("error",_405,false);_402.removeEventListener("progress",_408,false);_402=null;};};}else{_3fc=function(_409){return _409.xhr.readyState;};_3fd=function(_40a){return 4===_40a.xhr.readyState;};_3ff=function(dfd,_40b){var xhr=_40b.xhr;var _40c=typeof xhr.abort;if(_40c==="function"||_40c==="object"||_40c==="unknown"){xhr.abort();}};}function _40d(_40e){return this.xhr.getResponseHeader(_40e);};var _40f,_410={data:null,query:null,sync:false,method:"GET"};function xhr(url,_411,_412){var _413=util.parseArgs(url,util.deepCreate(_410,_411),has("native-formdata")&&_411&&_411.data&&_411.data instanceof FormData);url=_413.url;_411=_413.options;var _414,last=function(){_414&&_414();};var dfd=util.deferred(_413,_3ff,_3fc,_3fd,_3f8,last);var _415=_413.xhr=xhr._create();if(!_415){dfd.cancel(new _3f5("XHR was not created"));return _412?dfd:dfd.promise;}_413.getHeader=_40d;if(_3fe){_414=_3fe(_415,dfd,_413);}var data=_411.data,_416=!_411.sync,_417=_411.method;try{_415.open(_417,url,_416,_411.user||_40f,_411.password||_40f);if(_411.withCredentials){_415.withCredentials=_411.withCredentials;}var _418=_411.headers,_419="application/x-www-form-urlencoded";if(_418){for(var hdr in _418){if(hdr.toLowerCase()==="content-type"){_419=_418[hdr];}else{if(_418[hdr]){_415.setRequestHeader(hdr,_418[hdr]);}}}}if(_419&&_419!==false){_415.setRequestHeader("Content-Type",_419);}if(!_418||!("X-Requested-With" in _418)){_415.setRequestHeader("X-Requested-With","XMLHttpRequest");}if(util.notify){util.notify.emit("send",_413,dfd.promise.cancel);}_415.send(data);}catch(e){dfd.reject(e);}_3f6(dfd);_415=null;return _412?dfd:dfd.promise;};xhr._create=function(){throw new Error("XMLHTTP not available");};if(has("native-xhr")&&!has("dojo-force-activex-xhr")){xhr._create=function(){return new XMLHttpRequest();};}else{if(has("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){}}}}util.addCommonMethods(xhr);return xhr;});},"dojo/text":function(){define(["./_base/kernel","require","./has","./_base/xhr"],function(dojo,_41a,has,xhr){var _41b;if(1){_41b=function(url,sync,load){xhr("GET",{url:url,sync:!!sync,load:load,headers:dojo.config.textPluginHeaders||{}});};}else{if(_41a.getText){_41b=_41a.getText;}else{console.error("dojo/text plugin failed to load because loader does not support getText");}}var _41c={},_41d=function(text){if(text){text=text.replace(/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,"");var _41e=text.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im);if(_41e){text=_41e[1];}}else{text="";}return text;},_41f={},_420={};dojo.cache=function(_421,url,_422){var key;if(typeof _421=="string"){if(/\//.test(_421)){key=_421;_422=url;}else{key=_41a.toUrl(_421.replace(/\./g,"/")+(url?("/"+url):""));}}else{key=_421+"";_422=url;}var val=(_422!=undefined&&typeof _422!="string")?_422.value:_422,_423=_422&&_422.sanitize;if(typeof val=="string"){_41c[key]=val;return _423?_41d(val):val;}else{if(val===null){delete _41c[key];return null;}else{if(!(key in _41c)){_41b(key,true,function(text){_41c[key]=text;});}return _423?_41d(_41c[key]):_41c[key];}}};return {dynamic:true,normalize:function(id,_424){var _425=id.split("!"),url=_425[0];return (/^\./.test(url)?_424(url):url)+(_425[1]?"!"+_425[1]:"");},load:function(id,_426,load){var _427=id.split("!"),_428=_427.length>1,_429=_427[0],url=_426.toUrl(_427[0]),_42a="url:"+url,text=_41f,_42b=function(text){load(_428?_41d(text):text);};if(_429 in _41c){text=_41c[_429];}else{if(_42a in _426.cache){text=_426.cache[_42a];}else{if(url in _41c){text=_41c[url];}}}if(text===_41f){if(_420[url]){_420[url].push(_42b);}else{var _42c=_420[url]=[_42b];_41b(url,!_426.async,function(text){_41c[_429]=_41c[url]=text;for(var i=0;i<_42c.length;){_42c[i++](text);}delete _420[url];});}}else{_42b(text);}}};});},"dojo/keys":function(){define("dojo/keys",["./_base/kernel","./sniff"],function(dojo,has){return dojo.keys={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,META:has("webkit")?91:224,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,INSERT:45,DELETE:46,HELP:47,LEFT_WINDOW:91,RIGHT_WINDOW:92,SELECT:93,NUMPAD_0:96,NUMPAD_1:97,NUMPAD_2:98,NUMPAD_3:99,NUMPAD_4:100,NUMPAD_5:101,NUMPAD_6:102,NUMPAD_7:103,NUMPAD_8:104,NUMPAD_9:105,NUMPAD_MULTIPLY:106,NUMPAD_PLUS:107,NUMPAD_ENTER:108,NUMPAD_MINUS:109,NUMPAD_PERIOD:110,NUMPAD_DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,F13:124,F14:125,F15:126,NUM_LOCK:144,SCROLL_LOCK:145,UP_DPAD:175,DOWN_DPAD:176,LEFT_DPAD:177,RIGHT_DPAD:178,copyKey:has("mac")&&!has("air")?(has("safari")?91:224):17};});},"dojo/domReady":function(){define(["./has"],function(has){var _42d=(function(){return this;})(),doc=document,_42e={"loaded":1,"complete":1},_42f=typeof doc.readyState!="string",_430=!!_42e[doc.readyState],_431=[],_432;function _433(_434){_431.push(_434);if(_430){_435();}};_433.load=function(id,req,load){_433(load);};_433._Q=_431;_433._onQEmpty=function(){};if(_42f){doc.readyState="loading";}function _435(){if(_432){return;}_432=true;while(_431.length){try{(_431.shift())(doc);}catch(err){}}_432=false;_433._onQEmpty();};if(!_430){var _436=[],_437=function(evt){evt=evt||_42d.event;if(_430||(evt.type=="readystatechange"&&!_42e[doc.readyState])){return;}if(_42f){doc.readyState="complete";}_430=1;_435();},on=function(node,_438){node.addEventListener(_438,_437,false);_431.push(function(){node.removeEventListener(_438,_437,false);});};if(!has("dom-addeventlistener")){on=function(node,_439){_439="on"+_439;node.attachEvent(_439,_437);_431.push(function(){node.detachEvent(_439,_437);});};var div=doc.createElement("div");try{if(div.doScroll&&_42d.frameElement===null){_436.push(function(){try{div.doScroll("left");return 1;}catch(e){}});}}catch(e){}}on(doc,"DOMContentLoaded");on(_42d,"load");if("onreadystatechange" in doc){on(doc,"readystatechange");}else{if(!_42f){_436.push(function(){return _42e[doc.readyState];});}}if(_436.length){var _43a=function(){if(_430){return;}var i=_436.length;while(i--){if(_436[i]()){_437("poller");return;}}setTimeout(_43a,30);};_43a();}}return _433;});},"dojo/_base/lang":function(){define("dojo/_base/lang",["./kernel","../has","../sniff"],function(dojo,has){has.add("bug-for-in-skips-shadowed",function(){for(var i in {toString:1}){return 0;}return 1;});var _43b=has("bug-for-in-skips-shadowed")?"hasOwnProperty.valueOf.isPrototypeOf.propertyIsEnumerable.toLocaleString.toString.constructor".split("."):[],_43c=_43b.length,_43d=function(_43e,_43f,_440){var p,i=0,_441=dojo.global;if(!_440){if(!_43e.length){return _441;}else{p=_43e[i++];try{_440=dojo.scopeMap[p]&&dojo.scopeMap[p][1];}catch(e){}_440=_440||(p in _441?_441[p]:(_43f?_441[p]={}:undefined));}}while(_440&&(p=_43e[i++])){_440=(p in _440?_440[p]:(_43f?_440[p]={}:undefined));}return _440;},opts=Object.prototype.toString,_442=function(obj,_443,_444){return (_444||[]).concat(Array.prototype.slice.call(obj,_443||0));},_445=/\{([^\}]+)\}/g;var lang={_extraNames:_43b,_mixin:function(dest,_446,_447){var name,s,i,_448={};for(name in _446){s=_446[name];if(!(name in dest)||(dest[name]!==s&&(!(name in _448)||_448[name]!==s))){dest[name]=_447?_447(s):s;}}if(has("bug-for-in-skips-shadowed")){if(_446){for(i=0;i<_43c;++i){name=_43b[i];s=_446[name];if(!(name in dest)||(dest[name]!==s&&(!(name in _448)||_448[name]!==s))){dest[name]=_447?_447(s):s;}}}}return dest;},mixin:function(dest,_449){if(!dest){dest={};}for(var i=1,l=arguments.length;i<l;i++){lang._mixin(dest,arguments[i]);}return dest;},setObject:function(name,_44a,_44b){var _44c=name.split("."),p=_44c.pop(),obj=_43d(_44c,true,_44b);return obj&&p?(obj[p]=_44a):undefined;},getObject:function(name,_44d,_44e){return _43d(name.split("."),_44d,_44e);},exists:function(name,obj){return lang.getObject(name,false,obj)!==undefined;},isString:function(it){return (typeof it=="string"||it instanceof String);},isArray:function(it){return it&&(it instanceof Array||typeof it=="array");},isFunction:function(it){return opts.call(it)==="[object Function]";},isObject:function(it){return it!==undefined&&(it===null||typeof it=="object"||lang.isArray(it)||lang.isFunction(it));},isArrayLike:function(it){return it&&it!==undefined&&!lang.isString(it)&&!lang.isFunction(it)&&!(it.tagName&&it.tagName.toLowerCase()=="form")&&(lang.isArray(it)||isFinite(it.length));},isAlien:function(it){return it&&!lang.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));},extend:function(ctor,_44f){for(var i=1,l=arguments.length;i<l;i++){lang._mixin(ctor.prototype,arguments[i]);}return ctor;},_hitchArgs:function(_450,_451){var pre=lang._toArray(arguments,2);var _452=lang.isString(_451);return function(){var args=lang._toArray(arguments);var f=_452?(_450||dojo.global)[_451]:_451;return f&&f.apply(_450||this,pre.concat(args));};},hitch:function(_453,_454){if(arguments.length>2){return lang._hitchArgs.apply(dojo,arguments);}if(!_454){_454=_453;_453=null;}if(lang.isString(_454)){_453=_453||dojo.global;if(!_453[_454]){throw (["lang.hitch: scope[\"",_454,"\"] is null (scope=\"",_453,"\")"].join(""));}return function(){return _453[_454].apply(_453,arguments||[]);};}return !_453?_454:function(){return _454.apply(_453,arguments||[]);};},delegate:(function(){function TMP(){};return function(obj,_455){TMP.prototype=obj;var tmp=new TMP();TMP.prototype=null;if(_455){lang._mixin(tmp,_455);}return tmp;};})(),_toArray:has("ie")?(function(){function slow(obj,_456,_457){var arr=_457||[];for(var x=_456||0;x<obj.length;x++){arr.push(obj[x]);}return arr;};return function(obj){return ((obj.item)?slow:_442).apply(this,arguments);};})():_442,partial:function(_458){var arr=[null];return lang.hitch.apply(dojo,arr.concat(lang._toArray(arguments)));},clone:function(src){if(!src||typeof src!="object"||lang.isFunction(src)){return src;}if(src.nodeType&&"cloneNode" in src){return src.cloneNode(true);}if(src instanceof Date){return new Date(src.getTime());}if(src instanceof RegExp){return new RegExp(src);}var r,i,l;if(lang.isArray(src)){r=[];for(i=0,l=src.length;i<l;++i){if(i in src){r.push(lang.clone(src[i]));}}}else{r=src.constructor?new src.constructor():{};}return lang._mixin(r,src,lang.clone);},trim:String.prototype.trim?function(str){return str.trim();}:function(str){return str.replace(/^\s\s*/,"").replace(/\s\s*$/,"");},replace:function(tmpl,map,_459){return tmpl.replace(_459||_445,lang.isFunction(map)?map:function(_45a,k){return lang.getObject(k,false,map);});}};1&&lang.mixin(dojo,lang);return lang;});},"dojo/request/util":function(){define("dojo/request/util",["exports","../errors/RequestError","../errors/CancelError","../Deferred","../io-query","../_base/array","../_base/lang","../promise/Promise"],function(_45b,_45c,_45d,_45e,_45f,_460,lang,_461){_45b.deepCopy=function deepCopy(_462,_463){for(var name in _463){var tval=_462[name],sval=_463[name];if(tval!==sval){if(tval&&typeof tval==="object"&&sval&&typeof sval==="object"){_45b.deepCopy(tval,sval);}else{_462[name]=sval;}}}return _462;};_45b.deepCreate=function deepCreate(_464,_465){_465=_465||{};var _466=lang.delegate(_464),name,_467;for(name in _464){_467=_464[name];if(_467&&typeof _467==="object"){_466[name]=_45b.deepCreate(_467,_465[name]);}}return _45b.deepCopy(_466,_465);};var _468=Object.freeze||function(obj){return obj;};function _469(_46a){return _468(_46a);};function _46b(_46c){return _46c.data||_46c.text;};_45b.deferred=function deferred(_46d,_46e,_46f,_470,_471,last){var def=new _45e(function(_472){_46e&&_46e(def,_46d);if(!_472||!(_472 instanceof _45c)&&!(_472 instanceof _45d)){return new _45d("Request canceled",_46d);}return _472;});def.response=_46d;def.isValid=_46f;def.isReady=_470;def.handleResponse=_471;function _473(_474){_474.response=_46d;throw _474;};var _475=def.then(_469).otherwise(_473);if(_45b.notify){_475.then(lang.hitch(_45b.notify,"emit","load"),lang.hitch(_45b.notify,"emit","error"));}var _476=_475.then(_46b);var _477=new _461();for(var prop in _476){if(_476.hasOwnProperty(prop)){_477[prop]=_476[prop];}}_477.response=_475;_468(_477);if(last){def.then(function(_478){last.call(def,_478);},function(_479){last.call(def,_46d,_479);});}def.promise=_477;def.then=_477.then;return def;};_45b.addCommonMethods=function addCommonMethods(_47a,_47b){_460.forEach(_47b||["GET","POST","PUT","DELETE"],function(_47c){_47a[(_47c==="DELETE"?"DEL":_47c).toLowerCase()]=function(url,_47d){_47d=lang.delegate(_47d||{});_47d.method=_47c;return _47a(url,_47d);};});};_45b.parseArgs=function parseArgs(url,_47e,_47f){var data=_47e.data,_480=_47e.query;if(data&&!_47f){if(typeof data==="object"){_47e.data=_45f.objectToQuery(data);}}if(_480){if(typeof _480==="object"){_480=_45f.objectToQuery(_480);}if(_47e.preventCache){_480+=(_480?"&":"")+"request.preventCache="+(+(new Date));}}else{if(_47e.preventCache){_480="request.preventCache="+(+(new Date));}}if(url&&_480){url+=(~url.indexOf("?")?"&":"?")+_480;}return {url:url,options:_47e,getHeader:function(_481){return null;}};};_45b.checkStatus=function(stat){stat=stat||0;return (stat>=200&&stat<300)||stat===304||stat===1223||!stat;};});},"dojo/Evented":function(){define("dojo/Evented",["./aspect","./on"],function(_482,on){"use strict";var _483=_482.after;function _484(){};_484.prototype={on:function(type,_485){return on.parse(this,type,_485,function(_486,type){return _483(_486,"on"+type,_485,true);});},emit:function(type,_487){var args=[this];args.push.apply(args,arguments);return on.emit.apply(on,args);}};return _484;});},"dojo/mouse":function(){define("dojo/mouse",["./_base/kernel","./on","./has","./dom","./_base/window"],function(dojo,on,has,dom,win){has.add("dom-quirks",win.doc&&win.doc.compatMode=="BackCompat");has.add("events-mouseenter",win.doc&&"onmouseenter" in win.doc.createElement("div"));has.add("events-mousewheel",win.doc&&"onmousewheel" in win.doc);var _488;if((has("dom-quirks")&&has("ie"))||!has("dom-addeventlistener")){_488={LEFT:1,MIDDLE:4,RIGHT:2,isButton:function(e,_489){return e.button&_489;},isLeft:function(e){return e.button&1;},isMiddle:function(e){return e.button&4;},isRight:function(e){return e.button&2;}};}else{_488={LEFT:0,MIDDLE:1,RIGHT:2,isButton:function(e,_48a){return e.button==_48a;},isLeft:function(e){return e.button==0;},isMiddle:function(e){return e.button==1;},isRight:function(e){return e.button==2;}};}dojo.mouseButtons=_488;function _48b(type,_48c){var _48d=function(node,_48e){return on(node,type,function(evt){if(_48c){return _48c(evt,_48e);}if(!dom.isDescendant(evt.relatedTarget,node)){return _48e.call(this,evt);}});};_48d.bubble=function(_48f){return _48b(type,function(evt,_490){var _491=_48f(evt.target);var _492=evt.relatedTarget;if(_491&&(_491!=(_492&&_492.nodeType==1&&_48f(_492)))){return _490.call(_491,evt);}});};return _48d;};var _493;if(has("events-mousewheel")){_493="mousewheel";}else{_493=function(node,_494){return on(node,"DOMMouseScroll",function(evt){evt.wheelDelta=-evt.detail;_494.call(this,evt);});};}return {_eventHandler:_48b,enter:_48b("mouseover"),leave:_48b("mouseout"),wheel:_493,isLeft:_488.isLeft,isMiddle:_488.isMiddle,isRight:_488.isRight};});},"dojo/topic":function(){define("dojo/topic",["./Evented"],function(_495){var hub=new _495;return {publish:function(_496,_497){return hub.emit.apply(hub,arguments);},subscribe:function(_498,_499){return hub.on.apply(hub,arguments);}};});},"dojo/_base/xhr":function(){define("dojo/_base/xhr",["./kernel","./sniff","require","../io-query","../dom","../dom-form","./Deferred","./config","./json","./lang","./array","../on","../aspect","../request/watch","../request/xhr","../request/util"],function(dojo,has,_49a,ioq,dom,_49b,_49c,_49d,json,lang,_49e,on,_49f,_4a0,_4a1,util){dojo._xhrObj=_4a1._create;var cfg=dojo.config;dojo.objectToQuery=ioq.objectToQuery;dojo.queryToObject=ioq.queryToObject;dojo.fieldToObject=_49b.fieldToObject;dojo.formToObject=_49b.toObject;dojo.formToQuery=_49b.toQuery;dojo.formToJson=_49b.toJson;dojo._blockAsync=false;var _4a2=dojo._contentHandlers=dojo.contentHandlers={"text":function(xhr){return xhr.responseText;},"json":function(xhr){return json.fromJson(xhr.responseText||null);},"json-comment-filtered":function(xhr){if(!_49d.useCommentedJson){console.warn("Consider using the standard mimetype:application/json."+" json-commenting can introduce security issues. To"+" decrease the chances of hijacking, use the standard the 'json' handler and"+" prefix your json with: {}&&\n"+"Use djConfig.useCommentedJson=true to turn off this message.");}var _4a3=xhr.responseText;var _4a4=_4a3.indexOf("/*");var _4a5=_4a3.lastIndexOf("*/");if(_4a4==-1||_4a5==-1){throw new Error("JSON was not comment filtered");}return json.fromJson(_4a3.substring(_4a4+2,_4a5));},"javascript":function(xhr){return dojo.eval(xhr.responseText);},"xml":function(xhr){var _4a6=xhr.responseXML;if(_4a6&&has("dom-qsa2.1")&&!_4a6.querySelectorAll&&has("dom-parser")){_4a6=new DOMParser().parseFromString(xhr.responseText,"application/xml");}if(has("ie")){if((!_4a6||!_4a6.documentElement)){var ms=function(n){return "MSXML"+n+".DOMDocument";};var dp=["Microsoft.XMLDOM",ms(6),ms(4),ms(3),ms(2)];_49e.some(dp,function(p){try{var dom=new ActiveXObject(p);dom.async=false;dom.loadXML(xhr.responseText);_4a6=dom;}catch(e){return false;}return true;});}}return _4a6;},"json-comment-optional":function(xhr){if(xhr.responseText&&/^[^{\[]*\/\*/.test(xhr.responseText)){return _4a2["json-comment-filtered"](xhr);}else{return _4a2["json"](xhr);}}};dojo._ioSetArgs=function(args,_4a7,_4a8,_4a9){var _4aa={args:args,url:args.url};var _4ab=null;if(args.form){var form=dom.byId(args.form);var _4ac=form.getAttributeNode("action");_4aa.url=_4aa.url||(_4ac?_4ac.value:null);_4ab=_49b.toObject(form);}var _4ad=[{}];if(_4ab){_4ad.push(_4ab);}if(args.content){_4ad.push(args.content);}if(args.preventCache){_4ad.push({"dojo.preventCache":new Date().valueOf()});}_4aa.query=ioq.objectToQuery(lang.mixin.apply(null,_4ad));_4aa.handleAs=args.handleAs||"text";var d=new _49c(function(dfd){dfd.canceled=true;_4a7&&_4a7(dfd);var err=dfd.ioArgs.error;if(!err){err=new Error("request cancelled");err.dojoType="cancel";dfd.ioArgs.error=err;}return err;});d.addCallback(_4a8);var ld=args.load;if(ld&&lang.isFunction(ld)){d.addCallback(function(_4ae){return ld.call(args,_4ae,_4aa);});}var err=args.error;if(err&&lang.isFunction(err)){d.addErrback(function(_4af){return err.call(args,_4af,_4aa);});}var _4b0=args.handle;if(_4b0&&lang.isFunction(_4b0)){d.addBoth(function(_4b1){return _4b0.call(args,_4b1,_4aa);});}d.addErrback(function(_4b2){return _4a9(_4b2,d);});if(cfg.ioPublish&&dojo.publish&&_4aa.args.ioPublish!==false){d.addCallbacks(function(res){dojo.publish("/dojo/io/load",[d,res]);return res;},function(res){dojo.publish("/dojo/io/error",[d,res]);return res;});d.addBoth(function(res){dojo.publish("/dojo/io/done",[d,res]);return res;});}d.ioArgs=_4aa;return d;};var _4b3=function(dfd){var ret=_4a2[dfd.ioArgs.handleAs](dfd.ioArgs.xhr);return ret===undefined?null:ret;};var _4b4=function(_4b5,dfd){if(!dfd.ioArgs.args.failOk){console.error(_4b5);}return _4b5;};var _4b6=function(dfd){if(_4b7<=0){_4b7=0;if(cfg.ioPublish&&dojo.publish&&(!dfd||dfd&&dfd.ioArgs.args.ioPublish!==false)){dojo.publish("/dojo/io/stop");}}};var _4b7=0;_49f.after(_4a0,"_onAction",function(){_4b7-=1;});_49f.after(_4a0,"_onInFlight",_4b6);dojo._ioCancelAll=_4a0.cancelAll;dojo._ioNotifyStart=function(dfd){if(cfg.ioPublish&&dojo.publish&&dfd.ioArgs.args.ioPublish!==false){if(!_4b7){dojo.publish("/dojo/io/start");}_4b7+=1;dojo.publish("/dojo/io/send",[dfd]);}};dojo._ioWatch=function(dfd,_4b8,_4b9,_4ba){var args=dfd.ioArgs.options=dfd.ioArgs.args;lang.mixin(dfd,{response:dfd.ioArgs,isValid:function(_4bb){return _4b8(dfd);},isReady:function(_4bc){return _4b9(dfd);},handleResponse:function(_4bd){return _4ba(dfd);}});_4a0(dfd);_4b6(dfd);};var _4be="application/x-www-form-urlencoded";dojo._ioAddQueryToUrl=function(_4bf){if(_4bf.query.length){_4bf.url+=(_4bf.url.indexOf("?")==-1?"?":"&")+_4bf.query;_4bf.query=null;}};dojo.xhr=function(_4c0,args,_4c1){var rDfd;var dfd=dojo._ioSetArgs(args,function(dfd){rDfd&&rDfd.cancel();},_4b3,_4b4);var _4c2=dfd.ioArgs;if("postData" in args){_4c2.query=args.postData;}else{if("putData" in args){_4c2.query=args.putData;}else{if("rawBody" in args){_4c2.query=args.rawBody;}else{if((arguments.length>2&&!_4c1)||"POST|PUT".indexOf(_4c0.toUpperCase())===-1){dojo._ioAddQueryToUrl(_4c2);}}}}var _4c3={method:_4c0,handleAs:"text",timeout:args.timeout,withCredentials:args.withCredentials,ioArgs:_4c2};if(typeof args.headers!=="undefined"){_4c3.headers=args.headers;}if(typeof args.contentType!=="undefined"){if(!_4c3.headers){_4c3.headers={};}_4c3.headers["Content-Type"]=args.contentType;}if(typeof _4c2.query!=="undefined"){_4c3.data=_4c2.query;}if(typeof args.sync!=="undefined"){_4c3.sync=args.sync;}dojo._ioNotifyStart(dfd);try{rDfd=_4a1(_4c2.url,_4c3,true);}catch(e){dfd.cancel();return dfd;}dfd.ioArgs.xhr=rDfd.response.xhr;rDfd.then(function(){dfd.resolve(dfd);}).otherwise(function(_4c4){_4c2.error=_4c4;if(_4c4.response){_4c4.status=_4c4.response.status;_4c4.responseText=_4c4.response.text;_4c4.xhr=_4c4.response.xhr;}dfd.reject(_4c4);});return dfd;};dojo.xhrGet=function(args){return dojo.xhr("GET",args);};dojo.rawXhrPost=dojo.xhrPost=function(args){return dojo.xhr("POST",args,true);};dojo.rawXhrPut=dojo.xhrPut=function(args){return dojo.xhr("PUT",args,true);};dojo.xhrDelete=function(args){return dojo.xhr("DELETE",args);};dojo._isDocumentOk=function(x){return util.checkStatus(x.status);};dojo._getText=function(url){var _4c5;dojo.xhrGet({url:url,sync:true,load:function(text){_4c5=text;}});return _4c5;};lang.mixin(dojo.xhr,{_xhrObj:dojo._xhrObj,fieldToObject:_49b.fieldToObject,formToObject:_49b.toObject,objectToQuery:ioq.objectToQuery,formToQuery:_49b.toQuery,formToJson:_49b.toJson,queryToObject:ioq.queryToObject,contentHandlers:_4a2,_ioSetArgs:dojo._ioSetArgs,_ioCancelAll:dojo._ioCancelAll,_ioNotifyStart:dojo._ioNotifyStart,_ioWatch:dojo._ioWatch,_ioAddQueryToUrl:dojo._ioAddQueryToUrl,_isDocumentOk:dojo._isDocumentOk,_getText:dojo._getText,get:dojo.xhrGet,post:dojo.xhrPost,put:dojo.xhrPut,del:dojo.xhrDelete});return dojo.xhr;});},"dojo/loadInit":function(){define("dojo/loadInit",["./_base/loader"],function(_4c6){return {dynamic:0,normalize:function(id){return id;},load:_4c6.loadInit};});},"dojo/_base/unload":function(){define(["./kernel","./lang","../on"],function(dojo,lang,on){var win=window;var _4c7={addOnWindowUnload:function(obj,_4c8){if(!dojo.windowUnloaded){on(win,"unload",(dojo.windowUnloaded=function(){}));}on(win,"unload",lang.hitch(obj,_4c8));},addOnUnload:function(obj,_4c9){on(win,"beforeunload",lang.hitch(obj,_4c9));}};dojo.addOnWindowUnload=_4c7.addOnWindowUnload;dojo.addOnUnload=_4c7.addOnUnload;return _4c7;});},"dojo/Deferred":function(){define(["./has","./_base/lang","./errors/CancelError","./promise/Promise","./promise/instrumentation"],function(has,lang,_4ca,_4cb,_4cc){"use strict";var _4cd=0,_4ce=1,_4cf=2;var _4d0="This deferred has already been fulfilled.";var _4d1=Object.freeze||function(){};var _4d2=function(_4d3,type,_4d4,_4d5,_4d6){if(1){if(type===_4cf&&_4d7.instrumentRejected&&_4d3.length===0){_4d7.instrumentRejected(_4d4,false,_4d5,_4d6);}}for(var i=0;i<_4d3.length;i++){_4d8(_4d3[i],type,_4d4,_4d5);}};var _4d8=function(_4d9,type,_4da,_4db){var func=_4d9[type];var _4dc=_4d9.deferred;if(func){try{var _4dd=func(_4da);if(type===_4cd){if(typeof _4dd!=="undefined"){_4de(_4dc,type,_4dd);}}else{if(_4dd&&typeof _4dd.then==="function"){_4d9.cancel=_4dd.cancel;_4dd.then(_4df(_4dc,_4ce),_4df(_4dc,_4cf),_4df(_4dc,_4cd));return;}_4de(_4dc,_4ce,_4dd);}}catch(error){_4de(_4dc,_4cf,error);}}else{_4de(_4dc,type,_4da);}if(1){if(type===_4cf&&_4d7.instrumentRejected){_4d7.instrumentRejected(_4da,!!func,_4db,_4dc.promise);}}};var _4df=function(_4e0,type){return function(_4e1){_4de(_4e0,type,_4e1);};};var _4de=function(_4e2,type,_4e3){if(!_4e2.isCanceled()){switch(type){case _4cd:_4e2.progress(_4e3);break;case _4ce:_4e2.resolve(_4e3);break;case _4cf:_4e2.reject(_4e3);break;}}};var _4d7=function(_4e4){var _4e5=this.promise=new _4cb();var _4e6=this;var _4e7,_4e8,_4e9;var _4ea=false;var _4eb=[];if(1&&Error.captureStackTrace){Error.captureStackTrace(_4e6,_4d7);Error.captureStackTrace(_4e5,_4d7);}this.isResolved=_4e5.isResolved=function(){return _4e7===_4ce;};this.isRejected=_4e5.isRejected=function(){return _4e7===_4cf;};this.isFulfilled=_4e5.isFulfilled=function(){return !!_4e7;};this.isCanceled=_4e5.isCanceled=function(){return _4ea;};this.progress=function(_4ec,_4ed){if(!_4e7){_4d2(_4eb,_4cd,_4ec,null,_4e6);return _4e5;}else{if(_4ed===true){throw new Error(_4d0);}else{return _4e5;}}};this.resolve=function(_4ee,_4ef){if(!_4e7){_4d2(_4eb,_4e7=_4ce,_4e8=_4ee,null,_4e6);_4eb=null;return _4e5;}else{if(_4ef===true){throw new Error(_4d0);}else{return _4e5;}}};var _4f0=this.reject=function(_4f1,_4f2){if(!_4e7){if(1&&Error.captureStackTrace){Error.captureStackTrace(_4e9={},_4f0);}_4d2(_4eb,_4e7=_4cf,_4e8=_4f1,_4e9,_4e6);_4eb=null;return _4e5;}else{if(_4f2===true){throw new Error(_4d0);}else{return _4e5;}}};this.then=_4e5.then=function(_4f3,_4f4,_4f5){var _4f6=[_4f5,_4f3,_4f4];_4f6.cancel=_4e5.cancel;_4f6.deferred=new _4d7(function(_4f7){return _4f6.cancel&&_4f6.cancel(_4f7);});if(_4e7&&!_4eb){_4d8(_4f6,_4e7,_4e8,_4e9);}else{_4eb.push(_4f6);}return _4f6.deferred.promise;};this.cancel=_4e5.cancel=function(_4f8,_4f9){if(!_4e7){if(_4e4){var _4fa=_4e4(_4f8);_4f8=typeof _4fa==="undefined"?_4f8:_4fa;}_4ea=true;if(!_4e7){if(typeof _4f8==="undefined"){_4f8=new _4ca();}_4f0(_4f8);return _4f8;}else{if(_4e7===_4cf&&_4e8===_4f8){return _4f8;}}}else{if(_4f9===true){throw new Error(_4d0);}}};_4d1(_4e5);};_4d7.prototype.toString=function(){return "[object Deferred]";};if(_4cc){_4cc(_4d7);}return _4d7;});},"dojo/_base/NodeList":function(){define("dojo/_base/NodeList",["./kernel","../query","./array","./html","../NodeList-dom"],function(dojo,_4fb,_4fc){var _4fd=_4fb.NodeList,nlp=_4fd.prototype;nlp.connect=_4fd._adaptAsForEach(function(){return dojo.connect.apply(this,arguments);});nlp.coords=_4fd._adaptAsMap(dojo.coords);_4fd.events=["blur","focus","change","click","error","keydown","keypress","keyup","load","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","submit"];_4fc.forEach(_4fd.events,function(evt){var _4fe="on"+evt;nlp[_4fe]=function(a,b){return this.connect(_4fe,a,b);};});dojo.NodeList=_4fd;return _4fd;});},"dojo/_base/Color":function(){define(["./kernel","./lang","./array","./config"],function(dojo,lang,_4ff,_500){var _501=dojo.Color=function(_502){if(_502){this.setColor(_502);}};_501.named={"black":[0,0,0],"silver":[192,192,192],"gray":[128,128,128],"white":[255,255,255],"maroon":[128,0,0],"red":[255,0,0],"purple":[128,0,128],"fuchsia":[255,0,255],"green":[0,128,0],"lime":[0,255,0],"olive":[128,128,0],"yellow":[255,255,0],"navy":[0,0,128],"blue":[0,0,255],"teal":[0,128,128],"aqua":[0,255,255],"transparent":_500.transparentColor||[0,0,0,0]};lang.extend(_501,{r:255,g:255,b:255,a:1,_set:function(r,g,b,a){var t=this;t.r=r;t.g=g;t.b=b;t.a=a;},setColor:function(_503){if(lang.isString(_503)){_501.fromString(_503,this);}else{if(lang.isArray(_503)){_501.fromArray(_503,this);}else{this._set(_503.r,_503.g,_503.b,_503.a);if(!(_503 instanceof _501)){this.sanitize();}}}return this;},sanitize:function(){return this;},toRgb:function(){var t=this;return [t.r,t.g,t.b];},toRgba:function(){var t=this;return [t.r,t.g,t.b,t.a];},toHex:function(){var arr=_4ff.map(["r","g","b"],function(x){var s=this[x].toString(16);return s.length<2?"0"+s:s;},this);return "#"+arr.join("");},toCss:function(_504){var t=this,rgb=t.r+", "+t.g+", "+t.b;return (_504?"rgba("+rgb+", "+t.a:"rgb("+rgb)+")";},toString:function(){return this.toCss(true);}});_501.blendColors=dojo.blendColors=function(_505,end,_506,obj){var t=obj||new _501();_4ff.forEach(["r","g","b","a"],function(x){t[x]=_505[x]+(end[x]-_505[x])*_506;if(x!="a"){t[x]=Math.round(t[x]);}});return t.sanitize();};_501.fromRgb=dojo.colorFromRgb=function(_507,obj){var m=_507.toLowerCase().match(/^rgba?\(([\s\.,0-9]+)\)/);return m&&_501.fromArray(m[1].split(/\s*,\s*/),obj);};_501.fromHex=dojo.colorFromHex=function(_508,obj){var t=obj||new _501(),bits=(_508.length==4)?4:8,mask=(1<<bits)-1;_508=Number("0x"+_508.substr(1));if(isNaN(_508)){return null;}_4ff.forEach(["b","g","r"],function(x){var c=_508&mask;_508>>=bits;t[x]=bits==4?17*c:c;});t.a=1;return t;};_501.fromArray=dojo.colorFromArray=function(a,obj){var t=obj||new _501();t._set(Number(a[0]),Number(a[1]),Number(a[2]),Number(a[3]));if(isNaN(t.a)){t.a=1;}return t.sanitize();};_501.fromString=dojo.colorFromString=function(str,obj){var a=_501.named[str];return a&&_501.fromArray(a,obj)||_501.fromRgb(str,obj)||_501.fromHex(str,obj);};return _501;});},"dojo/promise/instrumentation":function(){define(["./tracer","../has","../_base/lang","../_base/array"],function(_509,has,lang,_50a){has.add("config-useDeferredInstrumentation","report-unhandled-rejections");function _50b(_50c,_50d,_50e){var _50f="";if(_50c&&_50c.stack){_50f+=_50c.stack;}if(_50d&&_50d.stack){_50f+="\n ----------------------------------------\n rejected"+_50d.stack.split("\n").slice(1).join("\n").replace(/^\s+/," ");}if(_50e&&_50e.stack){_50f+="\n ----------------------------------------\n"+_50e.stack;}console.error(_50c,_50f);};function _510(_511,_512,_513,_514){if(!_512){_50b(_511,_513,_514);}};var _515=[];var _516=false;var _517=1000;function _518(_519,_51a,_51b,_51c){if(!_50a.some(_515,function(obj){if(obj.error===_519){if(_51a){obj.handled=true;}return true;}})){_515.push({error:_519,rejection:_51b,handled:_51a,deferred:_51c,timestamp:new Date().getTime()});}if(!_516){_516=setTimeout(_51d,_517);}};function _51d(){var now=new Date().getTime();var _51e=now-_517;_515=_50a.filter(_515,function(obj){if(obj.timestamp<_51e){if(!obj.handled){_50b(obj.error,obj.rejection,obj.deferred);}return false;}return true;});if(_515.length){_516=setTimeout(_51d,_515[0].timestamp+_517-now);}else{_516=false;}};return function(_51f){var _520=has("config-useDeferredInstrumentation");if(_520){_509.on("resolved",lang.hitch(console,"log","resolved"));_509.on("rejected",lang.hitch(console,"log","rejected"));_509.on("progress",lang.hitch(console,"log","progress"));var args=[];if(typeof _520==="string"){args=_520.split(",");_520=args.shift();}if(_520==="report-rejections"){_51f.instrumentRejected=_510;}else{if(_520==="report-unhandled-rejections"||_520===true||_520===1){_51f.instrumentRejected=_518;_517=parseInt(args[0],10)||_517;}else{throw new Error("Unsupported instrumentation usage <"+_520+">");}}}};});},"dojo/selector/_loader":function(){define(["../has","require"],function(has,_521){"use strict";var _522=document.createElement("div");has.add("dom-qsa2.1",!!_522.querySelectorAll);has.add("dom-qsa3",function(){try{_522.innerHTML="<p class='TEST'></p>";return _522.querySelectorAll(".TEST:empty").length==1;}catch(e){}});var _523;var acme="./acme",lite="./lite";return {load:function(id,_524,_525,_526){var req=_521;id=id=="default"?has("config-selectorEngine")||"css3":id;id=id=="css2"||id=="lite"?lite:id=="css2.1"?has("dom-qsa2.1")?lite:acme:id=="css3"?has("dom-qsa3")?lite:acme:id=="acme"?acme:(req=_524)&&id;if(id.charAt(id.length-1)=="?"){id=id.substring(0,id.length-1);var _527=true;}if(_527&&(has("dom-compliant-qsa")||_523)){return _525(_523);}req([id],function(_528){if(id!="./lite"){_523=_528;}_525(_528);});}};});},"dojo/promise/Promise":function(){define(["../_base/lang"],function(lang){"use strict";function _529(){throw new TypeError("abstract");};return lang.extend(function Promise(){},{then:function(_52a,_52b,_52c){_529();},cancel:function(_52d,_52e){_529();},isResolved:function(){_529();},isRejected:function(){_529();},isFulfilled:function(){_529();},isCanceled:function(){_529();},always:function(_52f){return this.then(_52f,_52f);},otherwise:function(_530){return this.then(null,_530);},trace:function(){return this;},traceRejected:function(){return this;},toString:function(){return "[object Promise]";}});});},"dojo/request/watch":function(){define(["./util","../errors/RequestTimeoutError","../errors/CancelError","../_base/array","../_base/window","../has!host-browser?dom-addeventlistener?:../on:"],function(util,_531,_532,_533,win,on){var _534=null,_535=[];function _536(){var now=+(new Date);for(var i=0,dfd;i<_535.length&&(dfd=_535[i]);i++){var _537=dfd.response,_538=_537.options;if((dfd.isCanceled&&dfd.isCanceled())||(dfd.isValid&&!dfd.isValid(_537))){_535.splice(i--,1);_539._onAction&&_539._onAction();}else{if(dfd.isReady&&dfd.isReady(_537)){_535.splice(i--,1);dfd.handleResponse(_537);_539._onAction&&_539._onAction();}else{if(dfd.startTime){if(dfd.startTime+(_538.timeout||0)<now){_535.splice(i--,1);dfd.cancel(new _531("Timeout exceeded",_537));_539._onAction&&_539._onAction();}}}}}_539._onInFlight&&_539._onInFlight(dfd);if(!_535.length){clearInterval(_534);_534=null;}};function _539(dfd){if(dfd.response.options.timeout){dfd.startTime=+(new Date);}if(dfd.isFulfilled()){return;}_535.push(dfd);if(!_534){_534=setInterval(_536,50);}if(dfd.response.options.sync){_536();}};_539.cancelAll=function cancelAll(){try{_533.forEach(_535,function(dfd){try{dfd.cancel(new _532("All requests canceled."));}catch(e){}});}catch(e){}};if(win&&on&&win.doc.attachEvent){on(win.global,"unload",function(){_539.cancelAll();});}return _539;});},"dojo/on":function(){define(["./has!dom-addeventlistener?:./aspect","./_base/kernel","./has"],function(_53a,dojo,has){"use strict";if(1){var _53b=window.ScriptEngineMajorVersion;has.add("jscript",_53b&&(_53b()+ScriptEngineMinorVersion()/10));has.add("event-orientationchange",has("touch")&&!has("android"));has.add("event-stopimmediatepropagation",window.Event&&!!window.Event.prototype&&!!window.Event.prototype.stopImmediatePropagation);has.add("event-focusin",function(_53c,doc,_53d){return "onfocusin" in _53d;});if(has("touch")){has.add("touch-can-modify-event-delegate",function(){var _53e=function(){};_53e.prototype=document.createEvent("MouseEvents");try{var _53f=new _53e;_53f.target=null;return _53f.target===null;}catch(e){return false;}});}}var on=function(_540,type,_541,_542){if(typeof _540.on=="function"&&typeof type!="function"&&!_540.nodeType){return _540.on(type,_541);}return on.parse(_540,type,_541,_543,_542,this);};on.pausable=function(_544,type,_545,_546){var _547;var _548=on(_544,type,function(){if(!_547){return _545.apply(this,arguments);}},_546);_548.pause=function(){_547=true;};_548.resume=function(){_547=false;};return _548;};on.once=function(_549,type,_54a,_54b){var _54c=on(_549,type,function(){_54c.remove();return _54a.apply(this,arguments);});return _54c;};on.parse=function(_54d,type,_54e,_54f,_550,_551){if(type.call){return type.call(_551,_54d,_54e);}if(type.indexOf(",")>-1){var _552=type.split(/\s*,\s*/);var _553=[];var i=0;var _554;while(_554=_552[i++]){_553.push(_54f(_54d,_554,_54e,_550,_551));}_553.remove=function(){for(var i=0;i<_553.length;i++){_553[i].remove();}};return _553;}return _54f(_54d,type,_54e,_550,_551);};var _555=/^touch/;function _543(_556,type,_557,_558,_559){var _55a=type.match(/(.*):(.*)/);if(_55a){type=_55a[2];_55a=_55a[1];return on.selector(_55a,type).call(_559,_556,_557);}if(has("touch")){if(_555.test(type)){_557=_55b(_557);}if(!has("event-orientationchange")&&(type=="orientationchange")){type="resize";_556=window;_557=_55b(_557);}}if(_55c){_557=_55c(_557);}if(_556.addEventListener){var _55d=type in _55e,_55f=_55d?_55e[type]:type;_556.addEventListener(_55f,_557,_55d);return {remove:function(){_556.removeEventListener(_55f,_557,_55d);}};}type="on"+type;if(_560&&_556.attachEvent){return _560(_556,type,_557);}throw new Error("Target must be an event emitter");};on.selector=function(_561,_562,_563){return function(_564,_565){var _566=typeof _561=="function"?{matches:_561}:this,_567=_562.bubble;function _568(_569){_566=_566&&_566.matches?_566:dojo.query;while(!_566.matches(_569,_561,_564)){if(_569==_564||_563===false||!(_569=_569.parentNode)||_569.nodeType!=1){return;}}return _569;};if(_567){return on(_564,_567(_568),_565);}return on(_564,_562,function(_56a){var _56b=_568(_56a.target);if(_56b){return _565.call(_56b,_56a);}});};};function _56c(){this.cancelable=false;};function _56d(){this.bubbles=false;};var _56e=[].slice,_56f=on.emit=function(_570,type,_571){var args=_56e.call(arguments,2);var _572="on"+type;if("parentNode" in _570){var _573=args[0]={};for(var i in _571){_573[i]=_571[i];}_573.preventDefault=_56c;_573.stopPropagation=_56d;_573.target=_570;_573.type=type;_571=_573;}do{_570[_572]&&_570[_572].apply(_570,args);}while(_571&&_571.bubbles&&(_570=_570.parentNode));return _571&&_571.cancelable&&_571;};var _55e=has("event-focusin")?{}:{focusin:"focus",focusout:"blur"};if(!has("event-stopimmediatepropagation")){var _574=function(){this.immediatelyStopped=true;this.modified=true;};var _55c=function(_575){return function(_576){if(!_576.immediatelyStopped){_576.stopImmediatePropagation=_574;return _575.apply(this,arguments);}};};}if(has("dom-addeventlistener")){on.emit=function(_577,type,_578){if(_577.dispatchEvent&&document.createEvent){var _579=_577.ownerDocument||document;var _57a=_579.createEvent("HTMLEvents");_57a.initEvent(type,!!_578.bubbles,!!_578.cancelable);for(var i in _578){var _57b=_578[i];if(!(i in _57a)){_57a[i]=_578[i];}}return _577.dispatchEvent(_57a)&&_57a;}return _56f.apply(on,arguments);};}else{on._fixEvent=function(evt,_57c){if(!evt){var w=_57c&&(_57c.ownerDocument||_57c.document||_57c).parentWindow||window;evt=w.event;}if(!evt){return evt;}if(_57d&&evt.type==_57d.type){evt=_57d;}if(!evt.target){evt.target=evt.srcElement;evt.currentTarget=(_57c||evt.srcElement);if(evt.type=="mouseover"){evt.relatedTarget=evt.fromElement;}if(evt.type=="mouseout"){evt.relatedTarget=evt.toElement;}if(!evt.stopPropagation){evt.stopPropagation=_57e;evt.preventDefault=_57f;}switch(evt.type){case "keypress":var c=("charCode" in evt?evt.charCode:evt.keyCode);if(c==10){c=0;evt.keyCode=13;}else{if(c==13||c==27){c=0;}else{if(c==3){c=99;}}}evt.charCode=c;_580(evt);break;}}return evt;};var _57d,_581=function(_582){this.handle=_582;};_581.prototype.remove=function(){delete _dojoIEListeners_[this.handle];};var _583=function(_584){return function(evt){evt=on._fixEvent(evt,this);var _585=_584.call(this,evt);if(evt.modified){if(!_57d){setTimeout(function(){_57d=null;});}_57d=evt;}return _585;};};var _560=function(_586,type,_587){_587=_583(_587);if(((_586.ownerDocument?_586.ownerDocument.parentWindow:_586.parentWindow||_586.window||window)!=top||has("jscript")<5.8)&&!has("config-_allow_leaks")){if(typeof _dojoIEListeners_=="undefined"){_dojoIEListeners_=[];}var _588=_586[type];if(!_588||!_588.listeners){var _589=_588;_588=Function("event","var callee = arguments.callee; for(var i = 0; i<callee.listeners.length; i++){var listener = _dojoIEListeners_[callee.listeners[i]]; if(listener){listener.call(this,event);}}");_588.listeners=[];_586[type]=_588;_588.global=this;if(_589){_588.listeners.push(_dojoIEListeners_.push(_589)-1);}}var _58a;_588.listeners.push(_58a=(_588.global._dojoIEListeners_.push(_587)-1));return new _581(_58a);}return _53a.after(_586,type,_587,true);};var _580=function(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";evt.charOrCode=evt.keyChar||evt.keyCode;};var _57e=function(){this.cancelBubble=true;};var _57f=on._preventDefault=function(){this.bubbledKeyCode=this.keyCode;if(this.ctrlKey){try{this.keyCode=0;}catch(e){}}this.defaultPrevented=true;this.returnValue=false;};}if(has("touch")){var _58b=function(){};var _58c=window.orientation;var _55b=function(_58d){return function(_58e){var _58f=_58e.corrected;if(!_58f){var type=_58e.type;try{delete _58e.type;}catch(e){}if(_58e.type){if(has("touch-can-modify-event-delegate")){_58b.prototype=_58e;_58f=new _58b;}else{_58f={};for(var name in _58e){_58f[name]=_58e[name];}}_58f.preventDefault=function(){_58e.preventDefault();};_58f.stopPropagation=function(){_58e.stopPropagation();};}else{_58f=_58e;_58f.type=type;}_58e.corrected=_58f;if(type=="resize"){if(_58c==window.orientation){return null;}_58c=window.orientation;_58f.type="orientationchange";return _58d.call(this,_58f);}if(!("rotation" in _58f)){_58f.rotation=0;_58f.scale=1;}var _590=_58f.changedTouches[0];for(var i in _590){delete _58f[i];_58f[i]=_590[i];}}return _58d.call(this,_58f);};};}return on;});},"dojo/_base/sniff":function(){define(["./kernel","./lang","../sniff"],function(dojo,lang,has){if(!1){return has;}dojo._name="browser";lang.mixin(dojo,{isBrowser:true,isFF:has("ff"),isIE:has("ie"),isKhtml:has("khtml"),isWebKit:has("webkit"),isMozilla:has("mozilla"),isMoz:has("mozilla"),isOpera:has("opera"),isSafari:has("safari"),isChrome:has("chrome"),isMac:has("mac"),isIos:has("ios"),isAndroid:has("android"),isWii:has("wii"),isQuirks:has("quirks"),isAir:has("air")});dojo.locale=dojo.locale||(has("ie")?navigator.userLanguage:navigator.language).toLowerCase();return has;});},"dojo/errors/create":function(){define(["../_base/lang"],function(lang){return function(name,ctor,base,_591){base=base||Error;var _592=function(_593){if(base===Error){if(Error.captureStackTrace){Error.captureStackTrace(this,_592);}var err=Error.call(this,_593),prop;for(prop in err){if(err.hasOwnProperty(prop)){this[prop]=err[prop];}}this.message=_593;this.stack=err.stack;}else{base.apply(this,arguments);}if(ctor){ctor.apply(this,arguments);}};_592.prototype=lang.delegate(base.prototype,_591);_592.prototype.name=name;_592.prototype.constructor=_592;return _592;};});},"dojo/_base/array":function(){define(["./kernel","../has","./lang"],function(dojo,has,lang){var _594={},u;function _595(fn){return _594[fn]=new Function("item","index","array",fn);};function _596(some){var _597=!some;return function(a,fn,o){var i=0,l=a&&a.length||0,_598;if(l&&typeof a=="string"){a=a.split("");}if(typeof fn=="string"){fn=_594[fn]||_595(fn);}if(o){for(;i<l;++i){_598=!fn.call(o,a[i],i,a);if(some^_598){return !_598;}}}else{for(;i<l;++i){_598=!fn(a[i],i,a);if(some^_598){return !_598;}}}return _597;};};function _599(up){var _59a=1,_59b=0,_59c=0;if(!up){_59a=_59b=_59c=-1;}return function(a,x,from,last){if(last&&_59a>0){return _59d.lastIndexOf(a,x,from);}var l=a&&a.length||0,end=up?l+_59c:_59b,i;if(from===u){i=up?_59b:l+_59c;}else{if(from<0){i=l+from;if(i<0){i=_59b;}}else{i=from>=l?l+_59c:from;}}if(l&&typeof a=="string"){a=a.split("");}for(;i!=end;i+=_59a){if(a[i]==x){return i;}}return -1;};};var _59d={every:_596(false),some:_596(true),indexOf:_599(true),lastIndexOf:_599(false),forEach:function(arr,_59e,_59f){var i=0,l=arr&&arr.length||0;if(l&&typeof arr=="string"){arr=arr.split("");}if(typeof _59e=="string"){_59e=_594[_59e]||_595(_59e);}if(_59f){for(;i<l;++i){_59e.call(_59f,arr[i],i,arr);}}else{for(;i<l;++i){_59e(arr[i],i,arr);}}},map:function(arr,_5a0,_5a1,Ctr){var i=0,l=arr&&arr.length||0,out=new (Ctr||Array)(l);if(l&&typeof arr=="string"){arr=arr.split("");}if(typeof _5a0=="string"){_5a0=_594[_5a0]||_595(_5a0);}if(_5a1){for(;i<l;++i){out[i]=_5a0.call(_5a1,arr[i],i,arr);}}else{for(;i<l;++i){out[i]=_5a0(arr[i],i,arr);}}return out;},filter:function(arr,_5a2,_5a3){var i=0,l=arr&&arr.length||0,out=[],_5a4;if(l&&typeof arr=="string"){arr=arr.split("");}if(typeof _5a2=="string"){_5a2=_594[_5a2]||_595(_5a2);}if(_5a3){for(;i<l;++i){_5a4=arr[i];if(_5a2.call(_5a3,_5a4,i,arr)){out.push(_5a4);}}}else{for(;i<l;++i){_5a4=arr[i];if(_5a2(_5a4,i,arr)){out.push(_5a4);}}}return out;},clearCache:function(){_594={};}};1&&lang.mixin(dojo,_59d);return _59d;});},"dojo/_base/json":function(){define(["./kernel","../json"],function(dojo,json){dojo.fromJson=function(js){return eval("("+js+")");};dojo._escapeString=json.stringify;dojo.toJsonIndentStr="\t";dojo.toJson=function(it,_5a5){return json.stringify(it,function(key,_5a6){if(_5a6){var tf=_5a6.__json__||_5a6.json;if(typeof tf=="function"){return tf.call(_5a6);}}return _5a6;},_5a5&&dojo.toJsonIndentStr);};return dojo;});},"dojo/_base/window":function(){define("dojo/_base/window",["./kernel","./lang","../sniff"],function(dojo,lang,has){var ret={global:dojo.global,doc:dojo.global["document"]||null,body:function(doc){doc=doc||dojo.doc;return doc.body||doc.getElementsByTagName("body")[0];},setContext:function(_5a7,_5a8){dojo.global=ret.global=_5a7;dojo.doc=ret.doc=_5a8;},withGlobal:function(_5a9,_5aa,_5ab,_5ac){var _5ad=dojo.global;try{dojo.global=ret.global=_5a9;return ret.withDoc.call(null,_5a9.document,_5aa,_5ab,_5ac);}finally{dojo.global=ret.global=_5ad;}},withDoc:function(_5ae,_5af,_5b0,_5b1){var _5b2=ret.doc,oldQ=has("quirks"),_5b3=has("ie"),isIE,mode,pwin;try{dojo.doc=ret.doc=_5ae;dojo.isQuirks=has.add("quirks",dojo.doc.compatMode=="BackCompat",true,true);if(has("ie")){if((pwin=_5ae.parentWindow)&&pwin.navigator){isIE=parseFloat(pwin.navigator.appVersion.split("MSIE ")[1])||undefined;mode=_5ae.documentMode;if(mode&&mode!=5&&Math.floor(isIE)!=mode){isIE=mode;}dojo.isIE=has.add("ie",isIE,true,true);}}if(_5b0&&typeof _5af=="string"){_5af=_5b0[_5af];}return _5af.apply(_5b0,_5b1||[]);}finally{dojo.doc=ret.doc=_5b2;dojo.isQuirks=has.add("quirks",oldQ,true,true);dojo.isIE=has.add("ie",_5b3,true,true);}}};1&&lang.mixin(dojo,ret);return ret;});},"dojo/dom-class":function(){define(["./_base/lang","./_base/array","./dom"],function(lang,_5b4,dom){var _5b5="className";var cls,_5b6=/\s+/,a1=[""];function _5b7(s){if(typeof s=="string"||s instanceof String){if(s&&!_5b6.test(s)){a1[0]=s;return a1;}var a=s.split(_5b6);if(a.length&&!a[0]){a.shift();}if(a.length&&!a[a.length-1]){a.pop();}return a;}if(!s){return [];}return _5b4.filter(s,function(x){return x;});};var _5b8={};cls={contains:function containsClass(node,_5b9){return ((" "+dom.byId(node)[_5b5]+" ").indexOf(" "+_5b9+" ")>=0);},add:function addClass(node,_5ba){node=dom.byId(node);_5ba=_5b7(_5ba);var cls=node[_5b5],_5bb;cls=cls?" "+cls+" ":" ";_5bb=cls.length;for(var i=0,len=_5ba.length,c;i<len;++i){c=_5ba[i];if(c&&cls.indexOf(" "+c+" ")<0){cls+=c+" ";}}if(_5bb<cls.length){node[_5b5]=cls.substr(1,cls.length-2);}},remove:function removeClass(node,_5bc){node=dom.byId(node);var cls;if(_5bc!==undefined){_5bc=_5b7(_5bc);cls=" "+node[_5b5]+" ";for(var i=0,len=_5bc.length;i<len;++i){cls=cls.replace(" "+_5bc[i]+" "," ");}cls=lang.trim(cls);}else{cls="";}if(node[_5b5]!=cls){node[_5b5]=cls;}},replace:function replaceClass(node,_5bd,_5be){node=dom.byId(node);_5b8[_5b5]=node[_5b5];cls.remove(_5b8,_5be);cls.add(_5b8,_5bd);if(node[_5b5]!==_5b8[_5b5]){node[_5b5]=_5b8[_5b5];}},toggle:function toggleClass(node,_5bf,_5c0){node=dom.byId(node);if(_5c0===undefined){_5bf=_5b7(_5bf);for(var i=0,len=_5bf.length,c;i<len;++i){c=_5bf[i];cls[cls.contains(node,c)?"remove":"add"](node,c);}}else{cls[_5c0?"add":"remove"](node,_5bf);}return _5c0;}};return cls;});},"dojo/_base/config":function(){define(["../has","require"],function(has,_5c1){var _5c2={};if(1){var src=_5c1.rawConfig,p;for(p in src){_5c2[p]=src[p];}}else{var _5c3=function(_5c4,_5c5,_5c6){for(p in _5c4){p!="has"&&has.add(_5c5+p,_5c4[p],0,_5c6);}};var _5c7=(function(){return this;})();_5c2=1?_5c1.rawConfig:_5c7.dojoConfig||_5c7.djConfig||{};_5c3(_5c2,"config",1);_5c3(_5c2.has,"",1);}return _5c2;});},"dojo/main":function(){define(["./_base/kernel","./has","require","./sniff","./_base/lang","./_base/array","./_base/config","./ready","./_base/declare","./_base/connect","./_base/Deferred","./_base/json","./_base/Color","./has!dojo-firebug?./_firebug/firebug","./_base/browser","./_base/loader"],function(_5c8,has,_5c9,_5ca,lang,_5cb,_5cc,_5cd){if(_5cc.isDebug){_5c9(["./_firebug/firebug"]);}1||has.add("dojo-config-require",1);if(1){var deps=_5cc.require;if(deps){deps=_5cb.map(lang.isArray(deps)?deps:[deps],function(item){return item.replace(/\./g,"/");});if(_5c8.isAsync){_5c9(deps);}else{_5cd(1,function(){_5c9(deps);});}}}return _5c8;});},"dojo/_base/event":function(){define("dojo/_base/event",["./kernel","../on","../has","../dom-geometry"],function(dojo,on,has,dom){if(on._fixEvent){var _5ce=on._fixEvent;on._fixEvent=function(evt,se){evt=_5ce(evt,se);if(evt){dom.normalizeEvent(evt);}return evt;};}var ret={fix:function(evt,_5cf){if(on._fixEvent){return on._fixEvent(evt,_5cf);}return evt;},stop:function(evt){if(has("dom-addeventlistener")||(evt&&evt.preventDefault)){evt.preventDefault();evt.stopPropagation();}else{evt=evt||window.event;evt.cancelBubble=true;on._preventDefault.call(evt);}}};if(1){dojo.fixEvent=ret.fix;dojo.stopEvent=ret.stop;}return ret;});},"dojo/sniff":function(){define(["./has"],function(has){if(1){var n=navigator,dua=n.userAgent,dav=n.appVersion,tv=parseFloat(dav);has.add("air",dua.indexOf("AdobeAIR")>=0),has.add("khtml",dav.indexOf("Konqueror")>=0?tv:undefined);has.add("webkit",parseFloat(dua.split("WebKit/")[1])||undefined);has.add("chrome",parseFloat(dua.split("Chrome/")[1])||undefined);has.add("safari",dav.indexOf("Safari")>=0&&!has("chrome")?parseFloat(dav.split("Version/")[1]):undefined);has.add("mac",dav.indexOf("Macintosh")>=0);has.add("quirks",document.compatMode=="BackCompat");has.add("ios",/iPhone|iPod|iPad/.test(dua));has.add("android",parseFloat(dua.split("Android ")[1])||undefined);has.add("trident",parseFloat(dav.split("Trident/")[1])||undefined);if(!has("webkit")){if(dua.indexOf("Opera")>=0){has.add("opera",tv>=9.8?parseFloat(dua.split("Version/")[1])||tv:tv);}if(dua.indexOf("Gecko")>=0&&!has("khtml")&&!has("webkit")&&!has("trident")){has.add("mozilla",tv);}if(has("mozilla")){has.add("ff",parseFloat(dua.split("Firefox/")[1]||dua.split("Minefield/")[1])||undefined);}if(document.all&&!has("opera")){var isIE=parseFloat(dav.split("MSIE ")[1])||undefined;var mode=document.documentMode;if(mode&&mode!=5&&Math.floor(isIE)!=mode){isIE=mode;}has.add("ie",isIE);}has.add("wii",typeof opera!="undefined"&&opera.wiiremote);}}return has;});},"dojo/request/handlers":function(){define(["../json","../_base/kernel","../_base/array","../has","../selector/_loader"],function(JSON,_5d0,_5d1,has){has.add("activex",typeof ActiveXObject!=="undefined");has.add("dom-parser",function(_5d2){return "DOMParser" in _5d2;});var _5d3;if(has("activex")){var dp=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML.DOMDocument"];_5d3=function(_5d4){var _5d5=_5d4.data;if(_5d5&&has("dom-qsa2.1")&&!_5d5.querySelectorAll&&has("dom-parser")){_5d5=new DOMParser().parseFromString(_5d4.text,"application/xml");}if(!_5d5||!_5d5.documentElement){var text=_5d4.text;_5d1.some(dp,function(p){try{var dom=new ActiveXObject(p);dom.async=false;dom.loadXML(text);_5d5=dom;}catch(e){return false;}return true;});}return _5d5;};}var _5d6={"javascript":function(_5d7){return _5d0.eval(_5d7.text||"");},"json":function(_5d8){return JSON.parse(_5d8.text||null);},"xml":_5d3};function _5d9(_5da){var _5db=_5d6[_5da.options.handleAs];_5da.data=_5db?_5db(_5da):(_5da.data||_5da.text);return _5da;};_5d9.register=function(name,_5dc){_5d6[name]=_5dc;};return _5d9;});},"dojo/aspect":function(){define("dojo/aspect",[],function(){"use strict";var _5dd,_5de=0;function _5df(_5e0,type,_5e1,_5e2){var _5e3=_5e0[type];var _5e4=type=="around";var _5e5;if(_5e4){var _5e6=_5e1(function(){return _5e3.advice(this,arguments);});_5e5={remove:function(){if(_5e6){_5e6=_5e0=_5e1=null;}},advice:function(_5e7,args){return _5e6?_5e6.apply(_5e7,args):_5e3.advice(_5e7,args);}};}else{_5e5={remove:function(){if(_5e5.advice){var _5e8=_5e5.previous;var next=_5e5.next;if(!next&&!_5e8){delete _5e0[type];}else{if(_5e8){_5e8.next=next;}else{_5e0[type]=next;}if(next){next.previous=_5e8;}}_5e0=_5e1=_5e5.advice=null;}},id:_5de++,advice:_5e1,receiveArguments:_5e2};}if(_5e3&&!_5e4){if(type=="after"){while(_5e3.next&&(_5e3=_5e3.next)){}_5e3.next=_5e5;_5e5.previous=_5e3;}else{if(type=="before"){_5e0[type]=_5e5;_5e5.next=_5e3;_5e3.previous=_5e5;}}}else{_5e0[type]=_5e5;}return _5e5;};function _5e9(type){return function(_5ea,_5eb,_5ec,_5ed){var _5ee=_5ea[_5eb],_5ef;if(!_5ee||_5ee.target!=_5ea){_5ea[_5eb]=_5ef=function(){var _5f0=_5de;var args=arguments;var _5f1=_5ef.before;while(_5f1){args=_5f1.advice.apply(this,args)||args;_5f1=_5f1.next;}if(_5ef.around){var _5f2=_5ef.around.advice(this,args);}var _5f3=_5ef.after;while(_5f3&&_5f3.id<_5f0){if(_5f3.receiveArguments){var _5f4=_5f3.advice.apply(this,args);_5f2=_5f4===_5dd?_5f2:_5f4;}else{_5f2=_5f3.advice.call(this,_5f2,args);}_5f3=_5f3.next;}return _5f2;};if(_5ee){_5ef.around={advice:function(_5f5,args){return _5ee.apply(_5f5,args);}};}_5ef.target=_5ea;}var _5f6=_5df((_5ef||_5ee),type,_5ec,_5ed);_5ec=null;return _5f6;};};var _5f7=_5e9("after");var _5f8=_5e9("before");var _5f9=_5e9("around");return {before:_5f8,around:_5f9,after:_5f7};});},"dojo/ready":function(){define("dojo/ready",["./_base/kernel","./has","require","./domReady","./_base/lang"],function(dojo,has,_5fa,_5fb,lang){var _5fc=0,_5fd=[],_5fe=0,_5ff=function(){_5fc=1;dojo._postLoad=dojo.config.afterOnLoad=true;_600();},_600=function(){if(_5fe){return;}_5fe=1;while(_5fc&&(!_5fb||_5fb._Q.length==0)&&_5fa.idle()&&_5fd.length){var f=_5fd.shift();try{f();}catch(e){}}_5fe=0;};_5fa.on("idle",_600);if(_5fb){_5fb._onQEmpty=_600;}var _601=dojo.ready=dojo.addOnLoad=function(_602,_603,_604){var _605=lang._toArray(arguments);if(typeof _602!="number"){_604=_603;_603=_602;_602=1000;}else{_605.shift();}_604=_604?lang.hitch.apply(dojo,_605):function(){_603();};_604.priority=_602;for(var i=0;i<_5fd.length&&_602>=_5fd[i].priority;i++){}_5fd.splice(i,0,_604);_600();};1||has.add("dojo-config-addOnLoad",1);if(1){var dca=dojo.config.addOnLoad;if(dca){_601[(lang.isArray(dca)?"apply":"call")](dojo,dca);}}if(1&&dojo.config.parseOnLoad&&!dojo.isAsync){_601(99,function(){if(!dojo.parser){dojo.deprecated("Add explicit require(['dojo/parser']);","","2.0");_5fa(["dojo/parser"]);}});}if(_5fb){_5fb(_5ff);}else{_5ff();}return _601;});},"dojo/_base/connect":function(){define(["./kernel","../on","../topic","../aspect","./event","../mouse","./sniff","./lang","../keys"],function(dojo,on,hub,_606,_607,_608,has,lang){has.add("events-keypress-typed",function(){var _609={charCode:0};try{_609=document.createEvent("KeyboardEvent");(_609.initKeyboardEvent||_609.initKeyEvent).call(_609,"keypress",true,true,null,false,false,false,false,9,3);}catch(e){}return _609.charCode==0&&!has("opera");});function _60a(obj,_60b,_60c,_60d,_60e){_60d=lang.hitch(_60c,_60d);if(!obj||!(obj.addEventListener||obj.attachEvent)){return _606.after(obj||dojo.global,_60b,_60d,true);}if(typeof _60b=="string"&&_60b.substring(0,2)=="on"){_60b=_60b.substring(2);}if(!obj){obj=dojo.global;}if(!_60e){switch(_60b){case "keypress":_60b=_60f;break;case "mouseenter":_60b=_608.enter;break;case "mouseleave":_60b=_608.leave;break;}}return on(obj,_60b,_60d,_60e);};var _610={106:42,111:47,186:59,187:43,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39,229:113};var _611=has("mac")?"metaKey":"ctrlKey";var _612=function(evt,_613){var faux=lang.mixin({},evt,_613);_614(faux);faux.preventDefault=function(){evt.preventDefault();};faux.stopPropagation=function(){evt.stopPropagation();};return faux;};function _614(evt){evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";evt.charOrCode=evt.keyChar||evt.keyCode;};var _60f;if(has("events-keypress-typed")){var _615=function(e,code){try{return (e.keyCode=code);}catch(e){return 0;}};_60f=function(_616,_617){var _618=on(_616,"keydown",function(evt){var k=evt.keyCode;var _619=(k!=13)&&k!=32&&(k!=27||!has("ie"))&&(k<48||k>90)&&(k<96||k>111)&&(k<186||k>192)&&(k<219||k>222)&&k!=229;if(_619||evt.ctrlKey){var c=_619?0:k;if(evt.ctrlKey){if(k==3||k==13){return _617.call(evt.currentTarget,evt);}else{if(c>95&&c<106){c-=48;}else{if((!evt.shiftKey)&&(c>=65&&c<=90)){c+=32;}else{c=_610[c]||c;}}}}var faux=_612(evt,{type:"keypress",faux:true,charCode:c});_617.call(evt.currentTarget,faux);if(has("ie")){_615(evt,faux.keyCode);}}});var _61a=on(_616,"keypress",function(evt){var c=evt.charCode;c=c>=32?c:0;evt=_612(evt,{charCode:c,faux:true});return _617.call(this,evt);});return {remove:function(){_618.remove();_61a.remove();}};};}else{if(has("opera")){_60f=function(_61b,_61c){return on(_61b,"keypress",function(evt){var c=evt.which;if(c==3){c=99;}c=c<32&&!evt.shiftKey?0:c;if(evt.ctrlKey&&!evt.shiftKey&&c>=65&&c<=90){c+=32;}return _61c.call(this,_612(evt,{charCode:c}));});};}else{_60f=function(_61d,_61e){return on(_61d,"keypress",function(evt){_614(evt);return _61e.call(this,evt);});};}}var _61f={_keypress:_60f,connect:function(obj,_620,_621,_622,_623){var a=arguments,args=[],i=0;args.push(typeof a[0]=="string"?null:a[i++],a[i++]);var a1=a[i+1];args.push(typeof a1=="string"||typeof a1=="function"?a[i++]:null,a[i++]);for(var l=a.length;i<l;i++){args.push(a[i]);}return _60a.apply(this,args);},disconnect:function(_624){if(_624){_624.remove();}},subscribe:function(_625,_626,_627){return hub.subscribe(_625,lang.hitch(_626,_627));},publish:function(_628,args){return hub.publish.apply(hub,[_628].concat(args));},connectPublisher:function(_629,obj,_62a){var pf=function(){_61f.publish(_629,arguments);};return _62a?_61f.connect(obj,_62a,pf):_61f.connect(obj,pf);},isCopyKey:function(e){return e[_611];}};_61f.unsubscribe=_61f.disconnect;1&&lang.mixin(dojo,_61f);return _61f;});},"dojo/errors/CancelError":function(){define(["./create"],function(_62b){return _62b("CancelError",null,null,{dojoType:"cancel"});});}}});(function(){var _62c=this.require;_62c({cache:{}});!_62c.async&&_62c(["dojo"]);_62c.boot&&_62c.apply(null,_62c.boot);})(); | 2947721120/cdnjs | ajax/libs/dojo/1.8.8/dojo.js | JavaScript | mit | 159,225 |
/*!
* js-data-localstorage
* @version 2.0.0-beta.4 - Homepage <http://www.js-data.io/docs/dslocalstorageadapter>
* @author Jason Dobry <jason.dobry@gmail.com>
* @copyright (c) 2014-2015 Jason Dobry
* @license MIT <https://github.com/js-data/js-data-localstorage/blob/master/LICENSE>
*
* @overview localStorage adapter for js-data.
*/
!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("js-data")):"function"==typeof define&&define.amd?define(["js-data"],b):"object"==typeof exports?exports.DSLocalStorageAdapter=b(require("js-data")):a.DSLocalStorageAdapter=b(a.JSData)}(this,function(a){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a){C.push(a)}function e(){C.length&&!D&&(D=!0,C[0]())}function f(a){C.length?d(a):(d(a),e())}function g(a){return new t.Promise(a).then(function(a){return D=!1,C.shift(),setTimeout(e,0),a},function(a){return D=!1,C.shift(),setTimeout(e,0),t.Promise.reject(a)})}var h=function(a){return a&&a.__esModule?a:{"default":a}},i=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),j=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(b,"__esModule",{value:!0});var k=c(1),l=h(k),m=c(2),n=h(m),o=c(3),p=h(o),q=c(4),r=h(q),s=new l["default"].DS,t=l["default"].DSUtils,u=t.makePath,v=t.deepMixIn,w=t.toJson,x=t.fromJson,y=t.forEach,z=t.removeCircular,A=s.defaults.defaultFilter,B=function F(){j(this,F)};B.prototype.basePath="";var C=[],D=!1,E=function(){function a(b){j(this,a),b=b||{},this.defaults=new B,v(this.defaults,b)}return i(a,[{key:"getPath",value:function(a,b){return u(b.basePath||this.defaults.basePath||a.basePath,a.name)}},{key:"getIdPath",value:function(a,b,c){return u(b.basePath||this.defaults.basePath||a.basePath,a.getEndpoint(c,b),c)}},{key:"getIds",value:function(a,b){var c=void 0,d=this.getPath(a,b),e=localStorage.getItem(d);return e?c=x(e):(localStorage.setItem(d,w({})),c={}),c}},{key:"saveKeys",value:function(a,b,c){localStorage.setItem(this.getPath(b,c),w(a))}},{key:"ensureId",value:function(a,b,c){var d=this.getIds(b,c);d[a]=1,this.saveKeys(d,b,c)}},{key:"removeId",value:function(a,b,c){var d=this.getIds(b,c);delete d[a],this.saveKeys(d,b,c)}},{key:"GET",value:function(a){return new t.Promise(function(b){var c=localStorage.getItem(a);b(c?x(c):void 0)})}},{key:"PUT",value:function(a,b){var c=this;return c.GET(a).then(function(d){return d&&v(d,z(b)),localStorage.setItem(a,w(d||b)),c.GET(a)})}},{key:"DEL",value:function(a){return new t.Promise(function(b){localStorage.removeItem(a),b()})}},{key:"find",value:function(a,b,c){var d=this;return g(function(e,g){f(function(){d.GET(d.getIdPath(a,c||{},b)).then(function(a){return a?e(a):g(new Error("Not Found!"))},g)})})}},{key:"findAll",value:function(a,b,c){var d=this;return g(function(e,g){f(function(){try{!function(){c=c||{},"allowSimpleWhere"in c||(c.allowSimpleWhere=!0);var f=[],g=p["default"](d.getIds(a,c));y(g,function(b){var e=localStorage.getItem(d.getIdPath(a,c,b));e&&f.push(x(e))}),e(A.call(s,f,a.name,b,c))}()}catch(f){g(f)}})})}},{key:"create",value:function(a,b,c){var d=this;return g(function(e,g){f(function(){b[a.idAttribute]=b[a.idAttribute]||r["default"](),c=c||{},d.PUT(u(d.getIdPath(a,c,b[a.idAttribute])),n["default"](b,a.relationFields||[])).then(function(b){d.ensureId(b[a.idAttribute],a,c),e(b)})["catch"](g)})})}},{key:"update",value:function(a,b,c,d){var e=this;return g(function(g,h){f(function(){d=d||{},e.PUT(e.getIdPath(a,d,b),n["default"](c,a.relationFields||[])).then(function(b){e.ensureId(b[a.idAttribute],a,d),g(b)})["catch"](h)})})}},{key:"updateAll",value:function(a,b,c,d){var e=this;return this.findAll(a,c,d).then(function(c){var f=[];return y(c,function(c){return f.push(e.update(a,c[a.idAttribute],n["default"](b,a.relationFields||[]),d))}),t.Promise.all(f)})}},{key:"destroy",value:function(a,b,c){var d=this;return g(function(e,g){f(function(){c=c||{},d.DEL(d.getIdPath(a,c,b)).then(function(){return d.removeId(b,a.name,c)}).then(function(){return e(null)},g)})})}},{key:"destroyAll",value:function(a,b,c){var d=this;return this.findAll(a,b,c).then(function(b){var e=[];return y(b,function(b){return e.push(d.destroy(a,b[a.idAttribute],c))}),t.Promise.all(e)})}}]),a}();b["default"]=E,a.exports=b["default"]},function(b,c,d){b.exports=a},function(a,b,c){function d(a,b){var c="string"!=typeof arguments[1]?arguments[1]:e(arguments,1),d={};for(var g in a)a.hasOwnProperty(g)&&!f(c,g)&&(d[g]=a[g]);return d}var e=c(5),f=c(6);a.exports=d},function(a,b,c){var d=c(7),e=Object.keys||function(a){var b=[];return d(a,function(a,c){b.push(c)}),b};a.exports=e},function(a,b,c){function d(){return e(8)+"-"+e(4)+"-4"+e(3)+"-"+f(8,9,"a","b")+e(3)+"-"+e(12)}var e=c(8),f=c(9);a.exports=d},function(a,b,c){function d(a,b,c){var d=a.length;b=null==b?0:0>b?Math.max(d+b,0):Math.min(b,d),c=null==c?d:0>c?Math.max(d+c,0):Math.min(c,d);for(var e=[];c>b;)e.push(a[b++]);return e}a.exports=d},function(a,b,c){function d(a,b){return-1!==e(a,b)}var e=c(10);a.exports=d},function(a,b,c){function d(a,b,c){f(a,function(d,f){return e(a,f)?b.call(c,a[f],f,a):void 0})}var e=c(11),f=c(12);a.exports=d},function(a,b,c){function d(a){a=a&&a>0?a:6;for(var b="";a--;)b+=e(f);return b}var e=c(9),f="0123456789abcdef".split("");a.exports=d},function(a,b,c){function d(a){var b=1===arguments.length&&f(a)?a:arguments;return b[e(0,b.length-1)]}var e=c(13),f=c(14);a.exports=d},function(a,b,c){function d(a,b,c){if(c=c||0,null==a)return-1;for(var d=a.length,e=0>c?d+c:c;d>e;){if(a[e]===b)return e;e++}return-1}a.exports=d},function(a,b,c){function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}a.exports=d},function(a,b,c){function d(){h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],g=!0;for(var a in{toString:null})g=!1}function e(a,b,c){var e,j=0;null==g&&d();for(e in a)if(f(b,a,e,c)===!1)break;if(g)for(var k=a.constructor,l=!!k&&a===k.prototype;(e=h[j++])&&("constructor"===e&&(l||!i(a,e))||a[e]===Object.prototype[e]||f(b,a,e,c)!==!1););}function f(a,b,c,d){return a.call(d,b[c],c,b)}var g,h,i=c(11);a.exports=e},function(a,b,c){function d(a,b){return a=null==a?e:~~a,b=null==b?f:~~b,Math.round(g(a-.5,b+.499999999999))}var e=c(15),f=c(16),g=c(17);a.exports=d},function(a,b,c){var d=c(18),e=Array.isArray||function(a){return d(a,"Array")};a.exports=e},function(a,b,c){a.exports=-2147483648},function(a,b,c){a.exports=2147483647},function(a,b,c){function d(a,b){return a=null==a?f:a,b=null==b?g:b,a+(b-a)*e()}var e=c(19),f=c(15),g=c(16);a.exports=d},function(a,b,c){function d(a,b){return e(a)===b}var e=c(20);a.exports=d},function(a,b,c){function d(){return d.get()}d.get=Math.random,a.exports=d},function(a,b,c){function d(a){return null===a?"Null":a===e?"Undefined":f.exec(g.call(a))[1]}var e,f=/^\[object (.*)\]$/,g=Object.prototype.toString;a.exports=d}])});
//# sourceMappingURL=js-data-localstorage.min.map | shallaa/cdnjs | ajax/libs/js-data-localstorage/2.0.0-beta.4/js-data-localstorage.min.js | JavaScript | mit | 7,300 |
/*
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/on",["./has!dom-addeventlistener?:./aspect","./_base/kernel","./has"],function(_1,_2,_3){
"use strict";
if(1){
var _4=window.ScriptEngineMajorVersion;
_3.add("jscript",_4&&(_4()+ScriptEngineMinorVersion()/10));
_3.add("event-orientationchange",_3("touch")&&!_3("android"));
_3.add("event-stopimmediatepropagation",window.Event&&!!window.Event.prototype&&!!window.Event.prototype.stopImmediatePropagation);
_3.add("event-focusin",function(_5,_6,_7){
return "onfocusin" in _7;
});
}
var on=function(_8,_9,_a,_b){
if(typeof _8.on=="function"&&typeof _9!="function"&&!_8.nodeType){
return _8.on(_9,_a);
}
return on.parse(_8,_9,_a,_c,_b,this);
};
on.pausable=function(_d,_e,_f,_10){
var _11;
var _12=on(_d,_e,function(){
if(!_11){
return _f.apply(this,arguments);
}
},_10);
_12.pause=function(){
_11=true;
};
_12.resume=function(){
_11=false;
};
return _12;
};
on.once=function(_13,_14,_15,_16){
var _17=on(_13,_14,function(){
_17.remove();
return _15.apply(this,arguments);
});
return _17;
};
on.parse=function(_18,_19,_1a,_1b,_1c,_1d){
if(_19.call){
return _19.call(_1d,_18,_1a);
}
if(_19.indexOf(",")>-1){
var _1e=_19.split(/\s*,\s*/);
var _1f=[];
var i=0;
var _20;
while(_20=_1e[i++]){
_1f.push(_1b(_18,_20,_1a,_1c,_1d));
}
_1f.remove=function(){
for(var i=0;i<_1f.length;i++){
_1f[i].remove();
}
};
return _1f;
}
return _1b(_18,_19,_1a,_1c,_1d);
};
var _21=/^touch/;
function _c(_22,_23,_24,_25,_26){
var _27=_23.match(/(.*):(.*)/);
if(_27){
_23=_27[2];
_27=_27[1];
return on.selector(_27,_23).call(_26,_22,_24);
}
if(_3("touch")){
if(_21.test(_23)){
_24=_28(_24);
}
if(!_3("event-orientationchange")&&(_23=="orientationchange")){
_23="resize";
_22=window;
_24=_28(_24);
}
}
if(_29){
_24=_29(_24);
}
if(_22.addEventListener){
var _2a=_23 in _2b,_2c=_2a?_2b[_23]:_23;
_22.addEventListener(_2c,_24,_2a);
return {remove:function(){
_22.removeEventListener(_2c,_24,_2a);
}};
}
_23="on"+_23;
if(_2d&&_22.attachEvent){
return _2d(_22,_23,_24);
}
throw new Error("Target must be an event emitter");
};
on.selector=function(_2e,_2f,_30){
return function(_31,_32){
var _33=typeof _2e=="function"?{matches:_2e}:this,_34=_2f.bubble;
function _35(_36){
_33=_33&&_33.matches?_33:_2.query;
while(!_33.matches(_36,_2e,_31)){
if(_36==_31||_30===false||!(_36=_36.parentNode)||_36.nodeType!=1){
return;
}
}
return _36;
};
if(_34){
return on(_31,_34(_35),_32);
}
return on(_31,_2f,function(_37){
var _38=_35(_37.target);
return _38&&_32.call(_38,_37);
});
};
};
function _39(){
this.cancelable=false;
};
function _3a(){
this.bubbles=false;
};
var _3b=[].slice,_3c=on.emit=function(_3d,_3e,_3f){
var _40=_3b.call(arguments,2);
var _41="on"+_3e;
if("parentNode" in _3d){
var _42=_40[0]={};
for(var i in _3f){
_42[i]=_3f[i];
}
_42.preventDefault=_39;
_42.stopPropagation=_3a;
_42.target=_3d;
_42.type=_3e;
_3f=_42;
}
do{
_3d[_41]&&_3d[_41].apply(_3d,_40);
}while(_3f&&_3f.bubbles&&(_3d=_3d.parentNode));
return _3f&&_3f.cancelable&&_3f;
};
var _2b=_3("event-focusin")?{}:{focusin:"focus",focusout:"blur"};
if(!_3("event-stopimmediatepropagation")){
var _43=function(){
this.immediatelyStopped=true;
this.modified=true;
};
var _29=function(_44){
return function(_45){
if(!_45.immediatelyStopped){
_45.stopImmediatePropagation=_43;
return _44.apply(this,arguments);
}
};
};
}
if(_3("dom-addeventlistener")){
on.emit=function(_46,_47,_48){
if(_46.dispatchEvent&&document.createEvent){
var _49=_46.ownerDocument||document;
var _4a=_49.createEvent("HTMLEvents");
_4a.initEvent(_47,!!_48.bubbles,!!_48.cancelable);
for(var i in _48){
var _4b=_48[i];
if(!(i in _4a)){
_4a[i]=_48[i];
}
}
return _46.dispatchEvent(_4a)&&_4a;
}
return _3c.apply(on,arguments);
};
}else{
on._fixEvent=function(evt,_4c){
if(!evt){
var w=_4c&&(_4c.ownerDocument||_4c.document||_4c).parentWindow||window;
evt=w.event;
}
if(!evt){
return evt;
}
if(_4d&&evt.type==_4d.type){
evt=_4d;
}
if(!evt.target){
evt.target=evt.srcElement;
evt.currentTarget=(_4c||evt.srcElement);
if(evt.type=="mouseover"){
evt.relatedTarget=evt.fromElement;
}
if(evt.type=="mouseout"){
evt.relatedTarget=evt.toElement;
}
if(!evt.stopPropagation){
evt.stopPropagation=_4e;
evt.preventDefault=_4f;
}
switch(evt.type){
case "keypress":
var c=("charCode" in evt?evt.charCode:evt.keyCode);
if(c==10){
c=0;
evt.keyCode=13;
}else{
if(c==13||c==27){
c=0;
}else{
if(c==3){
c=99;
}
}
}
evt.charCode=c;
_50(evt);
break;
}
}
return evt;
};
var _4d,_51=function(_52){
this.handle=_52;
};
_51.prototype.remove=function(){
delete _dojoIEListeners_[this.handle];
};
var _53=function(_54){
return function(evt){
evt=on._fixEvent(evt,this);
var _55=_54.call(this,evt);
if(evt.modified){
if(!_4d){
setTimeout(function(){
_4d=null;
});
}
_4d=evt;
}
return _55;
};
};
var _2d=function(_56,_57,_58){
_58=_53(_58);
if(((_56.ownerDocument?_56.ownerDocument.parentWindow:_56.parentWindow||_56.window||window)!=top||_3("jscript")<5.8)&&!_3("config-_allow_leaks")){
if(typeof _dojoIEListeners_=="undefined"){
_dojoIEListeners_=[];
}
var _59=_56[_57];
if(!_59||!_59.listeners){
var _5a=_59;
_59=Function("event","var callee = arguments.callee; for(var i = 0; i<callee.listeners.length; i++){var listener = _dojoIEListeners_[callee.listeners[i]]; if(listener){listener.call(this,event);}}");
_59.listeners=[];
_56[_57]=_59;
_59.global=this;
if(_5a){
_59.listeners.push(_dojoIEListeners_.push(_5a)-1);
}
}
var _5b;
_59.listeners.push(_5b=(_59.global._dojoIEListeners_.push(_58)-1));
return new _51(_5b);
}
return _1.after(_56,_57,_58,true);
};
var _50=function(evt){
evt.keyChar=evt.charCode?String.fromCharCode(evt.charCode):"";
evt.charOrCode=evt.keyChar||evt.keyCode;
};
var _4e=function(){
this.cancelBubble=true;
};
var _4f=on._preventDefault=function(){
this.bubbledKeyCode=this.keyCode;
if(this.ctrlKey){
try{
this.keyCode=0;
}
catch(e){
}
}
this.defaultPrevented=true;
this.returnValue=false;
};
}
if(_3("touch")){
var _5c=function(){
};
var _5d=window.orientation;
var _28=function(_5e){
return function(_5f){
var _60=_5f.corrected;
if(!_60){
var _61=_5f.type;
try{
delete _5f.type;
}
catch(e){
}
if(_5f.type){
if(_3("mozilla")){
var _60={};
for(var _62 in _5f){
_60[_62]=_5f[_62];
}
}else{
_5c.prototype=_5f;
var _60=new _5c;
}
_60.preventDefault=function(){
_5f.preventDefault();
};
_60.stopPropagation=function(){
_5f.stopPropagation();
};
}else{
_60=_5f;
_60.type=_61;
}
_5f.corrected=_60;
if(_61=="resize"){
if(_5d==window.orientation){
return null;
}
_5d=window.orientation;
_60.type="orientationchange";
return _5e.call(this,_60);
}
if(!("rotation" in _60)){
_60.rotation=0;
_60.scale=1;
}
var _63=_60.changedTouches[0];
for(var i in _63){
delete _60[i];
_60[i]=_63[i];
}
}
return _5e.call(this,_60);
};
};
}
return on;
});
| dakshshah96/cdnjs | ajax/libs/dojo/1.8.6/on.js | JavaScript | mit | 6,849 |
"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:["posz.","büz."],DAY:["sudel","mudel","tudel","vedel","dödel","fridel","zädel"],ERANAMES:["b. t. kr.","p. t. kr."],ERAS:["b. t. kr.","p. t. kr."],FIRSTDAYOFWEEK:0,MONTH:["janul","febul","mäzil","prilul","mayul","yunul","yulul","gustul","setul","tobul","novul","dekul"],SHORTDAY:["su.","mu.","tu.","ve.","dö.","fr.","zä."],SHORTMONTH:["jan","feb","mäz","prl","may","yun","yul","gst","set","ton","nov","dek"],WEEKENDRANGE:[5,6],fullDate:"y MMMMa 'd'. d'id'",longDate:"y MMMM d",medium:"y MMM. d HH:mm:ss",mediumDate:"y MMM. d",mediumTime:"HH:mm:ss","short":"y-MM-dd HH:mm",shortDate:"y-MM-dd",shortTime:"HH:mm"},NUMBER_FORMATS:{CURRENCY_SYM:"$",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:"",posPre:"¤ ",posSuf:""}]},id:"vo-001",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}})}]); | jdh8/cdnjs | ajax/libs/angular-i18n/1.4.9/angular-locale_vo-001.min.js | JavaScript | mit | 1,500 |
/* Copyright (c) 2010-2012 Marcus Westin */
this.JSON||(this.JSON={}),function(){function f(a){return a<10?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return typeof b=="string"?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i&&typeof i=="object"&&typeof i.toJSON=="function"&&(i=i.toJSON(a)),typeof rep=="function"&&(i=rep.call(b,a,i));switch(typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";gap+=indent,h=[];if(Object.prototype.toString.apply(i)==="[object Array]"){f=i.length;for(c=0;c<f;c+=1)h[c]=str(c,i)||"null";return e=h.length===0?"[]":gap?"[\n"+gap+h.join(",\n"+gap)+"\n"+g+"]":"["+h.join(",")+"]",gap=g,e}if(rep&&typeof rep=="object"){f=rep.length;for(c=0;c<f;c+=1)d=rep[c],typeof d=="string"&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e))}else for(d in i)Object.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&h.push(quote(d)+(gap?": ":":")+e));return e=h.length===0?"{}":gap?"{\n"+gap+h.join(",\n"+gap)+"\n"+g+"}":"{"+h.join(",")+"}",gap=g,e}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(a){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(a){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;typeof JSON.stringify!="function"&&(JSON.stringify=function(a,b,c){var d;gap="",indent="";if(typeof c=="number")for(d=0;d<c;d+=1)indent+=" ";else typeof c=="string"&&(indent=c);rep=b;if(!b||typeof b=="function"||typeof b=="object"&&typeof b.length=="number")return str("",{"":a});throw new Error("JSON.stringify")}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&typeof e=="object")for(c in e)Object.hasOwnProperty.call(e,c)&&(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(){function h(){try{return d in b&&b[d]}catch(a){return!1}}function i(){try{return e in b&&b[e]&&b[e][b.location.hostname]}catch(a){return!1}}var a={},b=window,c=b.document,d="localStorage",e="globalStorage",f="__storejs__",g;a.disabled=!1,a.set=function(a,b){},a.get=function(a){},a.remove=function(a){},a.clear=function(){},a.transact=function(b,c,d){var e=a.get(b);d==null&&(d=c,c=null),typeof e=="undefined"&&(e=c||{}),d(e),a.set(b,e)},a.getAll=function(){},a.serialize=function(a){return JSON.stringify(a)},a.deserialize=function(a){if(typeof a!="string")return undefined;try{return JSON.parse(a)}catch(b){return a||undefined}};if(h())g=b[d],a.set=function(b,c){return c===undefined?a.remove(b):(g.setItem(b,a.serialize(c)),c)},a.get=function(b){return a.deserialize(g.getItem(b))},a.remove=function(a){g.removeItem(a)},a.clear=function(){g.clear()},a.getAll=function(){var b={};for(var c=0;c<g.length;++c){var d=g.key(c);b[d]=a.get(d)}return b};else if(i())g=b[e][b.location.hostname],a.set=function(b,c){return c===undefined?a.remove(b):(g[b]=a.serialize(c),c)},a.get=function(b){return a.deserialize(g[b]&&g[b].value)},a.remove=function(a){delete g[a]},a.clear=function(){for(var a in g)delete g[a]},a.getAll=function(){var b={};for(var c=0;c<g.length;++c){var d=g.key(c);b[d]=a.get(d)}return b};else if(c.documentElement.addBehavior){var j,k;try{k=new ActiveXObject("htmlfile"),k.open(),k.write('<script>document.w=window</script><iframe src="/favicon.ico"></frame>'),k.close(),j=k.w.frames[0].document,g=j.createElement("div")}catch(l){g=c.createElement("div"),j=c.body}function m(b){return function(){var c=Array.prototype.slice.call(arguments,0);c.unshift(g),j.appendChild(g),g.addBehavior("#default#userData"),g.load(d);var e=b.apply(a,c);return j.removeChild(g),e}}var n=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function o(a){return a.replace(n,"___")}a.set=m(function(b,c,e){return c=o(c),e===undefined?a.remove(c):(b.setAttribute(c,a.serialize(e)),b.save(d),e)}),a.get=m(function(b,c){return c=o(c),a.deserialize(b.getAttribute(c))}),a.remove=m(function(a,b){b=o(b),a.removeAttribute(b),a.save(d)}),a.clear=m(function(a){var b=a.XMLDocument.documentElement.attributes;a.load(d);for(var c=0,e;e=b[c];c++)a.removeAttribute(e.name);a.save(d)}),a.getAll=m(function(b){var c=b.XMLDocument.documentElement.attributes;b.load(d);var e={};for(var f=0,g;g=c[f];++f)e[g]=a.get(g);return e})}try{a.set(f,f),a.get(f)!=f&&(a.disabled=!0),a.remove(f)}catch(l){a.disabled=!0}a.enabled=!a.disabled,typeof module!="undefined"&&typeof module!="function"?module.exports=a:typeof define=="function"&&define.amd?define(a):this.store=a}() | JimBobSquarePants/cdnjs | ajax/libs/store.js/1.3.5/store+json2.min.js | JavaScript | mit | 5,619 |
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.to5=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(global){"use strict";var transform=module.exports=require("./transformation/transform");transform.version=require("../../package").version;transform.transform=transform;transform.run=function(code,opts){opts=opts||{};opts.sourceMap="inline";return new Function(transform(code,opts).code)()};transform.load=function(url,callback,opts,hold){opts=opts||{};opts.filename=opts.filename||url;var xhr=global.ActiveXObject?new global.ActiveXObject("Microsoft.XMLHTTP"):new global.XMLHttpRequest;xhr.open("GET",url,true);if("overrideMimeType"in xhr)xhr.overrideMimeType("text/plain");xhr.onreadystatechange=function(){if(xhr.readyState!==4)return;var status=xhr.status;if(status===0||status===200){var param=[xhr.responseText,opts];if(!hold)transform.run.apply(transform,param);if(callback)callback(param)}else{throw new Error("Could not load "+url)}};xhr.send(null)};var runScripts=function(){var scripts=[];var types=["text/ecmascript-6","text/6to5","module"];var index=0;var exec=function(){var param=scripts[index];if(param instanceof Array){transform.run.apply(transform,param);index++;exec()}};var run=function(script,i){var opts={};if(script.src){transform.load(script.src,function(param){scripts[i]=param;exec()},opts,true)}else{opts.filename="embedded";scripts[i]=[script.innerHTML,opts]}};var _scripts=global.document.getElementsByTagName("script");for(var i=0;i<_scripts.length;++i){var _script=_scripts[i];if(types.indexOf(_script.type)>=0)scripts.push(_script)}for(i in scripts){run(scripts[i],i)}exec()};if(global.addEventListener){global.addEventListener("DOMContentLoaded",runScripts,false)}else if(global.attachEvent){global.attachEvent("onload",runScripts)}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"../../package":193,"./transformation/transform":47}],2:[function(require,module,exports){"use strict";module.exports=File;var SHEBANG_REGEX=/^\#\!.*/;var transform=require("./transformation/transform");var generate=require("./generation/generator");var clone=require("./helpers/clone");var Scope=require("./traverse/scope");var util=require("./util");var t=require("./types");var _=require("lodash");function File(opts){this.dynamicImportIds={};this.dynamicImported=[];this.dynamicImports=[];this.dynamicData={};this.data={};this.lastStatements=[];this.opts=File.normaliseOptions(opts);this.ast={};this.buildTransformers()}File.helpers=["inherits","defaults","prototype-properties","apply-constructor","tagged-template-literal","tagged-template-literal-loose","interop-require","to-array","sliced-to-array","object-without-properties","has-own","slice","bind","define-property","async-to-generator","interop-require-wildcard","typeof","extends","get"];File.validOptions=["filename","filenameRelative","blacklist","whitelist","loose","optional","modules","sourceMap","sourceMapName","sourceFileName","sourceRoot","moduleRoot","moduleIds","comments","reactCompat","keepModuleIdExtensions","code","ast","format","playground","experimental"];File.normaliseOptions=function(opts){opts=clone(opts);for(var key in opts){if(File.validOptions.indexOf(key)<0){throw new ReferenceError("Unknown option: "+key)}}_.defaults(opts,{keepModuleIdExtensions:false,experimental:false,reactCompat:false,playground:false,whitespace:true,moduleIds:false,blacklist:[],whitelist:[],sourceMap:false,optional:[],comments:true,filename:"unknown",modules:"common",loose:[],code:true,ast:true});opts.filename=opts.filename.replace(/\\/g,"/");opts.blacklist=util.arrayify(opts.blacklist);opts.whitelist=util.arrayify(opts.whitelist);opts.optional=util.arrayify(opts.optional);opts.loose=util.arrayify(opts.loose);if(_.contains(opts.loose,"all")){opts.loose=Object.keys(transform.transformers)}_.defaults(opts,{moduleRoot:opts.sourceRoot});_.defaults(opts,{sourceRoot:opts.moduleRoot});_.defaults(opts,{filenameRelative:opts.filename});_.defaults(opts,{sourceFileName:opts.filenameRelative,sourceMapName:opts.filenameRelative});if(opts.playground){opts.experimental=true}opts.blacklist=transform._ensureTransformerNames("blacklist",opts.blacklist);opts.whitelist=transform._ensureTransformerNames("whitelist",opts.whitelist);opts.optional=transform._ensureTransformerNames("optional",opts.optional);opts.loose=transform._ensureTransformerNames("loose",opts.loose);return opts};File.prototype.isLoose=function(key){return _.contains(this.opts.loose,key)};File.prototype.buildTransformers=function(){var file=this;var transformers={};var secondaryStack=[];var stack=[];_.each(transform.transformers,function(transformer,key){var pass=transformers[key]=transformer.buildPass(file);if(pass.canRun(file)){stack.push(pass);if(transformer.secondPass){secondaryStack.push(pass)}if(transformer.manipulateOptions){transformer.manipulateOptions(file.opts,file)}}});this.transformerStack=stack.concat(secondaryStack);this.transformers=transformers};File.prototype.toArray=function(node,i){if(t.isArrayExpression(node)){return node}else if(t.isIdentifier(node)&&node.name==="arguments"){return t.callExpression(t.memberExpression(this.addHelper("slice"),t.identifier("call")),[node])}else{var declarationName="to-array";var args=[node];if(i){args.push(t.literal(i));declarationName="sliced-to-array"}return t.callExpression(this.addHelper(declarationName),args)}};File.prototype.getModuleFormatter=function(type){var ModuleFormatter=_.isFunction(type)?type:transform.moduleFormatters[type];if(!ModuleFormatter){var loc=util.resolve(type);if(loc)ModuleFormatter=require(loc)}if(!ModuleFormatter){throw new ReferenceError("Unknown module formatter type "+JSON.stringify(type))}return new ModuleFormatter(this)};File.prototype.parseShebang=function(code){var shebangMatch=code.match(SHEBANG_REGEX);if(shebangMatch){this.shebang=shebangMatch[0];code=code.replace(SHEBANG_REGEX,"")}return code};File.prototype.set=function(key,val){return this.data[key]=val};File.prototype.setDynamic=function(key,fn){this.dynamicData[key]=fn};File.prototype.get=function(key){var data=this.data[key];if(data){return data}else{var dynamic=this.dynamicData[key];if(dynamic){return this.set(key,dynamic())}}};File.prototype.addImport=function(source,name){name=name||source;var id=this.dynamicImportIds[name];if(!id){id=this.dynamicImportIds[name]=this.generateUidIdentifier(name);var specifiers=[t.importSpecifier(t.identifier("default"),id)];var declar=t.importDeclaration(specifiers,t.literal(source));declar._blockHoist=3;this.dynamicImported.push(declar);this.moduleFormatter.importSpecifier(specifiers[0],declar,this.dynamicImports)}return id};File.prototype.isConsequenceExpressionStatement=function(node){return t.isExpressionStatement(node)&&this.lastStatements.indexOf(node)>=0};File.prototype.addHelper=function(name){if(!_.contains(File.helpers,name)){throw new ReferenceError("unknown declaration "+name)}var program=this.ast.program;var declar=program._declarations&&program._declarations[name];if(declar)return declar.id;var runtime=this.get("runtimeIdentifier");if(runtime){name=t.identifier(t.toIdentifier(name));return t.memberExpression(runtime,name)}else{var ref=util.template(name);ref._compact=true;var uid=this.generateUidIdentifier(name);this.scope.push({key:name,id:uid,init:ref});return uid}};File.prototype.errorWithNode=function(node,msg,Error){Error=Error||SyntaxError;var loc=node.loc.start;var err=new Error("Line "+loc.line+": "+msg);err.loc=loc;return err};File.prototype.addCode=function(code){code=(code||"")+"";this.code=code;return this.parseShebang(code)};File.prototype.parse=function(code){var self=this;code=this.addCode(code);var opts=this.opts;opts.allowImportExportEverywhere=this.isLoose("modules");return util.parse(opts,code,function(tree){self.transform(tree);return self.generate()})};File.prototype.transform=function(ast){var self=this;this.ast=ast;this.lastStatements=t.getLastStatements(ast.program);this.scope=new Scope(ast.program,null,this);this.moduleFormatter=this.getModuleFormatter(this.opts.modules);var astRun=function(key){_.each(self.transformerStack,function(pass){pass.astRun(key)})};astRun("enter");_.each(this.transformerStack,function(pass){pass.transform()});astRun("exit")};File.prototype.generate=function(){var opts=this.opts;var ast=this.ast;var result={code:"",opts:opts,map:null,ast:null};if(opts.ast)result.ast=ast;if(!opts.code)return result;var _result=generate(ast,opts,this.code);result.code=_result.code;result.map=_result.map;if(this.shebang){result.code=this.shebang+"\n"+result.code}if(opts.sourceMap==="inline"){result.code+="\n"+util.sourceMapToComment(result.map)}return result};File.prototype.generateUid=function(name,scope){name=t.toIdentifier(name).replace(/^_+/,"");scope=scope||this.scope;var uid;var i=0;do{uid=this._generateUid(name,i);i++}while(scope.has(uid));return uid};File.prototype.generateUidIdentifier=function(name,scope){scope=scope||this.scope;var id=t.identifier(this.generateUid(name,scope));scope.add(id);return id};File.prototype._generateUid=function(name,i){var id=name;if(i>1)id+=i;return"_"+id}},{"./generation/generator":4,"./helpers/clone":23,"./transformation/transform":47,"./traverse/scope":98,"./types":101,"./util":104,lodash:164}],3:[function(require,module,exports){"use strict";module.exports=Buffer;var util=require("../util");var _=require("lodash");function Buffer(position,format){this.position=position;this._indent=format.indent.base;this.format=format;this.buf=""}Buffer.prototype.get=function(){return util.trimRight(this.buf)};Buffer.prototype.getIndent=function(){if(this.format.compact){return""}else{return util.repeat(this._indent,this.format.indent.style)}};Buffer.prototype.indentSize=function(){return this.getIndent().length};Buffer.prototype.indent=function(){this._indent++};Buffer.prototype.dedent=function(){this._indent--};Buffer.prototype.semicolon=function(){this.push(";")};Buffer.prototype.ensureSemicolon=function(){if(!this.isLast(";"))this.semicolon()};Buffer.prototype.rightBrace=function(){this.newline(true);this.push("}")};Buffer.prototype.keyword=function(name){this.push(name);this.push(" ")};Buffer.prototype.space=function(){if(this.buf&&!this.isLast([" ","\n"])){this.push(" ")}};Buffer.prototype.removeLast=function(cha){if(!this.isLast(cha))return;this.buf=this.buf.substr(0,this.buf.length-1);this.position.unshift(cha)};Buffer.prototype.newline=function(i,removeLast){if(this.format.compact){this.space();return}removeLast=removeLast||false;if(_.isNumber(i)){if(this.endsWith("{\n"))i--;if(this.endsWith(util.repeat(i,"\n")))return;while(i--){this._newline(removeLast)}return}if(_.isBoolean(i)){removeLast=i}this._newline(removeLast)};Buffer.prototype._newline=function(removeLast){if(removeLast&&this.isLast("\n"))this.removeLast("\n");this.removeLast(" ");this._removeSpacesAfterLastNewline();this._push("\n")};Buffer.prototype._removeSpacesAfterLastNewline=function(){var lastNewlineIndex=this.buf.lastIndexOf("\n");if(lastNewlineIndex===-1)return;var index=this.buf.length-1;while(index>lastNewlineIndex){if(this.buf[index]!==" "){break}index--}if(index===lastNewlineIndex){this.buf=this.buf.substring(0,index+1)}};Buffer.prototype.push=function(str,noIndent){if(this._indent&&!noIndent&&str!=="\n"){var indent=this.getIndent();str=str.replace(/\n/g,"\n"+indent);if(this.isLast("\n"))str=indent+str}this._push(str)};Buffer.prototype._push=function(str){this.position.push(str);this.buf+=str};Buffer.prototype.endsWith=function(str){var d=this.buf.length-str.length;return d>=0&&this.buf.lastIndexOf(str)===d};Buffer.prototype.isLast=function(cha,trimRight){var buf=this.buf;if(trimRight)buf=util.trimRight(buf);var last=buf[buf.length-1];if(Array.isArray(cha)){return _.contains(cha,last)}else{return cha===last}}},{"../util":104,lodash:164}],4:[function(require,module,exports){"use strict";module.exports=function(ast,opts,code){var gen=new CodeGenerator(ast,opts,code);return gen.generate()};module.exports.CodeGenerator=CodeGenerator;var detectIndent=require("detect-indent");var Whitespace=require("./whitespace");var SourceMap=require("./source-map");var Position=require("./position");var Buffer=require("./buffer");var util=require("../util");var n=require("./node");var t=require("../types");var _=require("lodash");function CodeGenerator(ast,opts,code){opts=opts||{};this.comments=ast.comments||[];this.tokens=ast.tokens||[];this.format=CodeGenerator.normaliseOptions(code,opts);this.ast=ast;this.whitespace=new Whitespace(this.tokens,this.comments);this.position=new Position;this.map=new SourceMap(this.position,opts,code);this.buffer=new Buffer(this.position,this.format)}_.each(Buffer.prototype,function(fn,key){CodeGenerator.prototype[key]=function(){return fn.apply(this.buffer,arguments)}});CodeGenerator.normaliseOptions=function(code,opts){var indent=detectIndent(code);var style=indent.indent;if(!style||style===" ")style=" ";return _.merge({parentheses:true,comments:opts.comments==null||opts.comments,compact:false,indent:{adjustMultilineComment:true,style:style,base:0}},opts.format||{})};CodeGenerator.generators={templateLiterals:require("./generators/template-literals"),comprehensions:require("./generators/comprehensions"),expressions:require("./generators/expressions"),statements:require("./generators/statements"),playground:require("./generators/playground"),classes:require("./generators/classes"),methods:require("./generators/methods"),modules:require("./generators/modules"),types:require("./generators/types"),flow:require("./generators/flow"),base:require("./generators/base"),jsx:require("./generators/jsx")};_.each(CodeGenerator.generators,function(generator){_.extend(CodeGenerator.prototype,generator)});CodeGenerator.prototype.generate=function(){var ast=this.ast;this.print(ast);var comments=[];_.each(ast.comments,function(comment){if(!comment._displayed)comments.push(comment)});this._printComments(comments);return{map:this.map.get(),code:this.buffer.get()}};CodeGenerator.prototype.buildPrint=function(parent){var self=this;var print=function(node,opts){return self.print(node,parent,opts)};print.sequence=function(nodes,opts){opts=opts||{};opts.statement=true;return self.printJoin(print,nodes,opts)};print.join=function(nodes,opts){return self.printJoin(print,nodes,opts)};print.block=function(node){return self.printBlock(print,node)};print.indentOnComments=function(node){return self.printAndIndentOnComments(print,node)};return print};CodeGenerator.prototype.print=function(node,parent,opts){if(!node)return"";if(parent&&parent._compact){node._compact=true}var oldCompact=this.format.compact;if(node._compact){this.format.compact=true}var self=this;opts=opts||{};var newline=function(leading){if(!opts.statement&&!n.isUserWhitespacable(node,parent)){return}var lines=0;if(node.start!=null&&!node._ignoreUserWhitespace){if(leading){lines=self.whitespace.getNewlinesBefore(node)}else{lines=self.whitespace.getNewlinesAfter(node)}}else{if(!leading)lines++;var needs=n.needsWhitespaceAfter;if(leading)needs=n.needsWhitespaceBefore;lines+=needs(node,parent);if(!self.buffer.get())lines=0}self.newline(lines)};if(this[node.type]){var needsNoLineTermParens=n.needsParensNoLineTerminator(node,parent);var needsParens=needsNoLineTermParens||n.needsParens(node,parent);if(needsParens)this.push("(");if(needsNoLineTermParens)this.indent();this.printLeadingComments(node,parent);newline(true);if(opts.before)opts.before();this.map.mark(node,"start");this[node.type](node,this.buildPrint(node),parent);if(needsNoLineTermParens){this.newline();this.dedent()}if(needsParens)this.push(")");this.map.mark(node,"end");if(opts.after)opts.after();newline(false);this.printTrailingComments(node,parent)}else{throw new ReferenceError("unknown node of type "+JSON.stringify(node.type)+" with constructor "+JSON.stringify(node&&node.constructor.name))}this.format.compact=oldCompact};CodeGenerator.prototype.printJoin=function(print,nodes,opts){if(!nodes||!nodes.length)return;opts=opts||{};var self=this;var len=nodes.length;if(opts.indent)self.indent();_.each(nodes,function(node,i){print(node,{statement:opts.statement,after:function(){if(opts.iterator){opts.iterator(node,i)}if(opts.separator&&i<len-1){self.push(opts.separator)}}})});if(opts.indent)self.dedent()};CodeGenerator.prototype.printAndIndentOnComments=function(print,node){var indent=!!node.leadingComments;if(indent)this.indent();print(node);if(indent)this.dedent()};CodeGenerator.prototype.printBlock=function(print,node){if(t.isEmptyStatement(node)){this.semicolon()}else{this.push(" ");print(node)}};CodeGenerator.prototype.generateComment=function(comment){var val=comment.value;if(comment.type==="Line"){val="//"+val}else{val="/*"+val+"*/"}return val};CodeGenerator.prototype.printTrailingComments=function(node,parent){this._printComments(this.getComments("trailingComments",node,parent))};CodeGenerator.prototype.printLeadingComments=function(node,parent){this._printComments(this.getComments("leadingComments",node,parent))};CodeGenerator.prototype.getComments=function(key,node,parent){if(t.isExpressionStatement(parent)){return[]}var comments=[];var nodes=[node];var self=this;if(t.isExpressionStatement(node)){nodes.push(node.argument)}_.each(nodes,function(node){comments=comments.concat(self._getComments(key,node))});return comments};CodeGenerator.prototype._getComments=function(key,node){return node&&node[key]||[]};CodeGenerator.prototype._printComments=function(comments){if(this.format.compact)return;if(!this.format.comments)return;if(!comments||!comments.length)return;var self=this;_.each(comments,function(comment){var skip=false;_.each(self.ast.comments,function(origComment){if(origComment.start===comment.start){if(origComment._displayed)skip=true;origComment._displayed=true;return false}});if(skip)return;self.newline(self.whitespace.getNewlinesBefore(comment));var column=self.position.column;var val=self.generateComment(comment);if(column&&!self.isLast(["\n"," ","[","{"])){self._push(" ");column++}if(comment.type==="Block"&&self.format.indent.adjustMultilineComment){var offset=comment.loc.start.column;if(offset){var newlineRegex=new RegExp("\\n\\s{1,"+offset+"}","g");val=val.replace(newlineRegex,"\n")}var indent=Math.max(self.indentSize(),column);val=val.replace(/\n/g,"\n"+util.repeat(indent))}if(column===0){val=self.getIndent()+val}self._push(val);self.newline(self.whitespace.getNewlinesAfter(comment))})}},{"../types":101,"../util":104,"./buffer":3,"./generators/base":5,"./generators/classes":6,"./generators/comprehensions":7,"./generators/expressions":8,"./generators/flow":9,"./generators/jsx":10,"./generators/methods":11,"./generators/modules":12,"./generators/playground":13,"./generators/statements":14,"./generators/template-literals":15,"./generators/types":16,"./node":17,"./position":20,"./source-map":21,"./whitespace":22,"detect-indent":155,lodash:164}],5:[function(require,module,exports){"use strict";exports.File=function(node,print){print(node.program)};exports.Program=function(node,print){print.sequence(node.body)};exports.BlockStatement=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();print.sequence(node.body,{indent:true});this.removeLast("\n");this.rightBrace()}}},{}],6:[function(require,module,exports){"use strict";exports.ClassExpression=exports.ClassDeclaration=function(node,print){this.push("class");if(node.id){this.space();print(node.id)}if(node.superClass){this.push(" extends ");print(node.superClass)}this.space();print(node.body)};exports.ClassBody=function(node,print){if(node.body.length===0){this.push("{}")}else{this.push("{");this.newline();this.indent();print.sequence(node.body);this.dedent();this.rightBrace()}};exports.MethodDefinition=function(node,print){if(node.static){this.push("static ")}this._method(node,print)}},{}],7:[function(require,module,exports){"use strict";exports.ComprehensionBlock=function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" of ");print(node.right);this.push(")")};exports.ComprehensionExpression=function(node,print){this.push(node.generator?"(":"[");print.join(node.blocks,{separator:" "});this.space();if(node.filter){this.keyword("if");this.push("(");print(node.filter);this.push(")");this.space()}print(node.body);this.push(node.generator?")":"]")}},{}],8:[function(require,module,exports){"use strict";var util=require("../../util");var t=require("../../types");var _=require("lodash");exports.UnaryExpression=function(node,print){var hasSpace=/[a-z]$/.test(node.operator);var arg=node.argument;if(t.isUpdateExpression(arg)||t.isUnaryExpression(arg)){hasSpace=true}if(t.isUnaryExpression(arg)&&arg.operator==="!"){hasSpace=false}this.push(node.operator);if(hasSpace)this.space();print(node.argument)};exports.UpdateExpression=function(node,print){if(node.prefix){this.push(node.operator);print(node.argument)}else{print(node.argument);this.push(node.operator)}};exports.ConditionalExpression=function(node,print){print(node.test);this.push(" ? ");print(node.consequent);this.push(" : ");print(node.alternate)};exports.NewExpression=function(node,print){this.push("new ");print(node.callee);if(node.arguments.length||this.format.parentheses){this.push("(");print.join(node.arguments,{separator:", "});this.push(")")}};exports.SequenceExpression=function(node,print){print.join(node.expressions,{separator:", "})};exports.ThisExpression=function(){this.push("this")};exports.CallExpression=function(node,print){print(node.callee);this.push("(");var separator=",";if(node._prettyCall){separator+="\n";this.newline();this.indent()}else{separator+=" "}print.join(node.arguments,{separator:separator});if(node._prettyCall){this.newline();this.dedent()}this.push(")")};var buildYieldAwait=function(keyword){return function(node,print){this.push(keyword);if(node.delegate)this.push("*");if(node.argument){this.space();print(node.argument)}}};exports.YieldExpression=buildYieldAwait("yield");exports.AwaitExpression=buildYieldAwait("await");exports.EmptyStatement=function(){this.semicolon()};exports.ExpressionStatement=function(node,print){print(node.expression);this.semicolon()};exports.BinaryExpression=exports.LogicalExpression=exports.AssignmentPattern=exports.AssignmentExpression=function(node,print){print(node.left);this.space();this.push(node.operator);this.space();print(node.right)};var SCIENTIFIC_NOTATION=/e/i;exports.MemberExpression=function(node,print){var obj=node.object;print(obj);if(!node.computed&&t.isMemberExpression(node.property)){throw new TypeError("Got a MemberExpression for MemberExpression property")}var computed=node.computed;if(t.isLiteral(node.property)&&_.isNumber(node.property.value)){computed=true}if(computed){this.push("[");print(node.property);this.push("]")}else{if(t.isLiteral(obj)&&util.isInteger(obj.value)&&!SCIENTIFIC_NOTATION.test(obj.value.toString())){this.push(".")}this.push(".");print(node.property)}}},{"../../types":101,"../../util":104,lodash:164}],9:[function(require,module,exports){"use strict";exports.AnyTypeAnnotation=exports.ArrayTypeAnnotation=exports.BooleanTypeAnnotation=exports.ClassProperty=exports.DeclareClass=exports.DeclareFunction=exports.DeclareModule=exports.DeclareVariable=exports.FunctionTypeAnnotation=exports.FunctionTypeParam=exports.GenericTypeAnnotation=exports.InterfaceExtends=exports.InterfaceDeclaration=exports.IntersectionTypeAnnotation=exports.NullableTypeAnnotation=exports.NumberTypeAnnotation=exports.StringLiteralTypeAnnotation=exports.StringTypeAnnotation=exports.TupleTypeAnnotation=exports.TypeofTypeAnnotation=exports.TypeAlias=exports.TypeAnnotation=exports.TypeParameterDeclaration=exports.TypeParameterInstantiation=exports.ObjectTypeAnnotation=exports.ObjectTypeCallProperty=exports.ObjectTypeIndexer=exports.ObjectTypeProperty=exports.QualifiedTypeIdentifier=exports.UnionTypeAnnotation=exports.VoidTypeAnnotation=function(){}},{}],10:[function(require,module,exports){"use strict";var t=require("../../types");var _=require("lodash");exports.JSXAttribute=function(node,print){print(node.name);if(node.value){this.push("=");print(node.value)}};exports.JSXIdentifier=function(node){this.push(node.name)};exports.JSXNamespacedName=function(node,print){print(node.namespace);this.push(":");print(node.name)};exports.JSXMemberExpression=function(node,print){print(node.object);this.push(".");print(node.property)};exports.JSXSpreadAttribute=function(node,print){this.push("{...");print(node.argument);this.push("}")};exports.JSXExpressionContainer=function(node,print){this.push("{");print(node.expression);this.push("}")};exports.JSXElement=function(node,print){var self=this;var open=node.openingElement;print(open);if(open.selfClosing)return;this.indent();_.each(node.children,function(child){if(t.isLiteral(child)){self.push(child.value)}else{print(child)}});this.dedent();print(node.closingElement)};exports.JSXOpeningElement=function(node,print){this.push("<");print(node.name);if(node.attributes.length>0){this.push(" ");print.join(node.attributes,{separator:" "})}this.push(node.selfClosing?" />":">")};exports.JSXClosingElement=function(node,print){this.push("</");print(node.name);this.push(">")};exports.JSXEmptyExpression=function(){}},{"../../types":101,lodash:164}],11:[function(require,module,exports){"use strict";var t=require("../../types");exports._params=function(node,print){this.push("(");print.join(node.params,{separator:", "});this.push(")")};exports._method=function(node,print){var value=node.value;var kind=node.kind;var key=node.key;if(!kind||kind==="init"){if(value.generator){this.push("*")}}else{this.push(kind+" ")}if(value.async)this.push("async ");if(node.computed){this.push("[");print(key);this.push("]")}else{print(key)}this._params(value,print);this.push(" ");print(value.body)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,print){if(node.async)this.push("async ");this.push("function");if(node.generator)this.push("*");this.push(" ");if(node.id){this.space();print(node.id)}this._params(node,print);this.space();print(node.body)};exports.ArrowFunctionExpression=function(node,print){if(node.async)this.push("async ");if(node.params.length===1&&t.isIdentifier(node.params[0])){print(node.params[0])}else{this._params(node,print)}this.push(" => ");print(node.body)}},{"../../types":101}],12:[function(require,module,exports){"use strict";var t=require("../../types");var _=require("lodash");exports.ImportSpecifier=function(node,print){if(t.isSpecifierDefault(node)){print(t.getSpecifierName(node))}else{return exports.ExportSpecifier.apply(this,arguments)}};exports.ExportSpecifier=function(node,print){print(node.id);if(node.name){this.push(" as ");print(node.name)}};exports.ExportBatchSpecifier=function(){this.push("*")};exports.ExportDeclaration=function(node,print){this.push("export ");var specifiers=node.specifiers;if(node.default){this.push("default ")}if(node.declaration){print(node.declaration);if(t.isStatement(node.declaration))return}else{if(specifiers.length===1&&t.isExportBatchSpecifier(specifiers[0])){print(specifiers[0])}else{this.push("{");if(specifiers.length){this.space();print.join(specifiers,{separator:", "});this.space()}this.push("}")}if(node.source){this.push(" from ");print(node.source)}}this.ensureSemicolon()};exports.ImportDeclaration=function(node,print){var self=this;this.push("import ");var specfiers=node.specifiers;if(specfiers&&specfiers.length){var foundImportSpecifier=false;_.each(node.specifiers,function(spec,i){if(+i>0){self.push(", ")}var isDefault=t.isSpecifierDefault(spec);if(!isDefault&&spec.type!=="ImportBatchSpecifier"&&!foundImportSpecifier){foundImportSpecifier=true;self.push("{ ")}print(spec)});if(foundImportSpecifier){this.push(" }")}this.push(" from ")}print(node.source);this.semicolon()};exports.ImportBatchSpecifier=function(node,print){this.push("* as ");print(node.name)}},{"../../types":101,lodash:164}],13:[function(require,module,exports){"use strict";var _=require("lodash");_.each(["BindMemberExpression","BindFunctionExpression"],function(type){exports[type]=function(){throw new ReferenceError("Trying to render non-standard playground node "+JSON.stringify(type))}})},{lodash:164}],14:[function(require,module,exports){"use strict";var util=require("../../util");var t=require("../../types");exports.WithStatement=function(node,print){this.keyword("with");this.push("(");print(node.object);this.push(")");print.block(node.body)};exports.IfStatement=function(node,print){this.keyword("if");this.push("(");print(node.test);this.push(")");this.space();print.indentOnComments(node.consequent);if(node.alternate){if(this.isLast("}"))this.push(" ");this.keyword("else");print.indentOnComments(node.alternate)}};exports.ForStatement=function(node,print){this.keyword("for");this.push("(");print(node.init);this.push(";");if(node.test){this.push(" ");print(node.test)}this.push(";");if(node.update){this.push(" ");print(node.update)}this.push(")");print.block(node.body)};exports.WhileStatement=function(node,print){this.keyword("while");this.push("(");print(node.test);this.push(")");print.block(node.body)};var buildForXStatement=function(op){return function(node,print){this.keyword("for");this.push("(");print(node.left);this.push(" "+op+" ");print(node.right);this.push(")");print.block(node.body)}};exports.ForInStatement=buildForXStatement("in");exports.ForOfStatement=buildForXStatement("of");exports.DoWhileStatement=function(node,print){this.keyword("do");print(node.body);this.space();this.keyword("while");this.push("(");print(node.test);this.push(");")};var buildLabelStatement=function(prefix,key){return function(node,print){this.push(prefix);var label=node[key||"label"];if(label){this.push(" ");print(label)}this.semicolon()}};exports.ContinueStatement=buildLabelStatement("continue");exports.ReturnStatement=buildLabelStatement("return","argument");exports.BreakStatement=buildLabelStatement("break");exports.LabeledStatement=function(node,print){print(node.label);this.push(": ");print(node.body)};exports.TryStatement=function(node,print){this.keyword("try");print(node.block);this.space();if(node.handlers){print(node.handlers[0])}else{print(node.handler)}if(node.finalizer){this.space();this.push("finally ");print(node.finalizer)}};exports.CatchClause=function(node,print){this.keyword("catch");this.push("(");print(node.param);this.push(") ");print(node.body)};exports.ThrowStatement=function(node,print){this.push("throw ");print(node.argument);this.semicolon()};exports.SwitchStatement=function(node,print){this.keyword("switch");this.push("(");print(node.discriminant);this.push(")");this.space();this.push("{");print.sequence(node.cases,{indent:true});this.push("}")};exports.SwitchCase=function(node,print){if(node.test){this.push("case ");print(node.test);this.push(":")}else{this.push("default:")}this.newline();print.sequence(node.consequent,{indent:true})};exports.DebuggerStatement=function(){this.push("debugger;")};exports.VariableDeclaration=function(node,print,parent){this.push(node.kind+" ");var hasInits=false;if(!t.isFor(parent)){for(var i=0;i<node.declarations.length;i++){if(node.declarations[i].init){hasInits=true}}}var sep=",";if(hasInits){sep+="\n"+util.repeat(node.kind.length+1)}else{sep+=" "}print.join(node.declarations,{separator:sep});
if(!t.isFor(parent)){this.semicolon()}};exports.PrivateDeclaration=function(node,print){this.push("private ");print.join(node.declarations,{separator:", "});this.semicolon()};exports.VariableDeclarator=function(node,print){if(node.init){print(node.id);this.space();this.push("=");this.space();print(node.init)}else{print(node.id)}}},{"../../types":101,"../../util":104}],15:[function(require,module,exports){"use strict";var _=require("lodash");exports.TaggedTemplateExpression=function(node,print){print(node.tag);print(node.quasi)};exports.TemplateElement=function(node){this._push(node.value.raw)};exports.TemplateLiteral=function(node,print){this.push("`");var quasis=node.quasis;var self=this;var len=quasis.length;_.each(quasis,function(quasi,i){print(quasi);if(i+1<len){self.push("${ ");print(node.expressions[i]);self.push(" }")}});this._push("`")}},{lodash:164}],16:[function(require,module,exports){"use strict";var _=require("lodash");exports.Identifier=function(node){this.push(node.name)};exports.RestElement=exports.SpreadElement=exports.SpreadProperty=function(node,print){this.push("...");print(node.argument)};exports.VirtualPropertyExpression=function(node,print){print(node.object);this.push("::");print(node.property)};exports.ObjectExpression=exports.ObjectPattern=function(node,print){var props=node.properties;if(props.length){this.push("{");this.space();print.join(props,{separator:", ",indent:true});this.space();this.push("}")}else{this.push("{}")}};exports.Property=function(node,print){if(node.method||node.kind==="get"||node.kind==="set"){this._method(node,print)}else{if(node.computed){this.push("[");print(node.key);this.push("]")}else{print(node.key);if(node.shorthand)return}this.push(": ");print(node.value)}};exports.ArrayExpression=exports.ArrayPattern=function(node,print){var elems=node.elements;var self=this;var len=elems.length;this.push("[");_.each(elems,function(elem,i){if(!elem){self.push(",")}else{if(i>0)self.push(" ");print(elem);if(i<len-1)self.push(",")}});this.push("]")};exports.Literal=function(node){var val=node.value;var type=typeof val;if(type==="string"){val=JSON.stringify(val);val=val.replace(/[\u000A\u000D\u2028\u2029]/g,function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)});this.push(val)}else if(type==="boolean"||type==="number"){this.push(JSON.stringify(val))}else if(node.regex){this.push("/"+node.regex.pattern+"/"+node.regex.flags)}else if(val===null){this.push("null")}}},{lodash:164}],17:[function(require,module,exports){"use strict";module.exports=Node;var whitespace=require("./whitespace");var parens=require("./parentheses");var t=require("../../types");var _=require("lodash");var find=function(obj,node,parent){if(!obj)return;var result;var types=Object.keys(obj);for(var i=0;i<types.length;i++){var type=types[i];if(t.is(type,node)){var fn=obj[type];result=fn(node,parent);if(result!=null)break}}return result};function Node(node,parent){this.parent=parent;this.node=node}Node.isUserWhitespacable=function(node){return t.isUserWhitespacable(node)};Node.needsWhitespace=function(node,parent,type){if(!node)return 0;if(t.isExpressionStatement(node)){node=node.expression}var lines=find(whitespace[type].nodes,node,parent);if(lines)return lines;_.each(find(whitespace[type].list,node,parent),function(expr){lines=Node.needsWhitespace(expr,node,type);if(lines)return false});return lines||0};Node.needsWhitespaceBefore=function(node,parent){return Node.needsWhitespace(node,parent,"before")};Node.needsWhitespaceAfter=function(node,parent){return Node.needsWhitespace(node,parent,"after")};Node.needsParens=function(node,parent){if(!parent)return false;if(t.isNewExpression(parent)&&parent.callee===node){if(t.isCallExpression(node))return true;var hasCall=_.some(node,function(val){return t.isCallExpression(val)});if(hasCall)return true}return find(parens,node,parent)};Node.needsParensNoLineTerminator=function(node,parent){if(!parent)return false;if(!node.leadingComments||!node.leadingComments.length){return false}if(t.isYieldExpression(parent)||t.isAwaitExpression(parent)){return true}if(t.isContinueStatement(parent)||t.isBreakStatement(parent)||t.isReturnStatement(parent)||t.isThrowStatement(parent)){return true}return false};_.each(Node,function(fn,key){Node.prototype[key]=function(){var args=new Array(arguments.length+2);args[0]=this.node;args[1]=this.parent;for(var i=0;i<args.length;i++){args[i+2]=arguments[i]}return Node[key].apply(null,args)}})},{"../../types":101,"./parentheses":18,"./whitespace":19,lodash:164}],18:[function(require,module,exports){"use strict";var t=require("../../types");var _=require("lodash");var PRECEDENCE={};_.each([["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]],function(tier,i){_.each(tier,function(op){PRECEDENCE[op]=i})});exports.UpdateExpression=function(node,parent){if(t.isMemberExpression(parent)&&parent.object===node){return true}};exports.ObjectExpression=function(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false};exports.Binary=function(node,parent){if((t.isCallExpression(parent)||t.isNewExpression(parent))&&parent.callee===node){return true}if(t.isUnaryLike(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isBinary(parent)){var parentOp=parent.operator;var parentPos=PRECEDENCE[parentOp];var nodeOp=node.operator;var nodePos=PRECEDENCE[nodeOp];if(parentPos>nodePos){return true}if(parentPos===nodePos&&parent.right===node){return true}}};exports.BinaryExpression=function(node,parent){if(node.operator==="in"){if(t.isVariableDeclarator(parent)){return true}if(t.isFor(parent)){return true}}};exports.SequenceExpression=function(node,parent){if(t.isForStatement(parent)){return false}if(t.isExpressionStatement(parent)&&parent.expression===node){return false}return true};exports.YieldExpression=function(node,parent){return t.isBinary(parent)||t.isUnaryLike(parent)||t.isCallExpression(parent)||t.isMemberExpression(parent)||t.isNewExpression(parent)||t.isConditionalExpression(parent)||t.isYieldExpression(parent)};exports.ClassExpression=function(node,parent){return t.isExpressionStatement(parent)};exports.UnaryLike=function(node,parent){return t.isMemberExpression(parent)&&parent.object===node};exports.FunctionExpression=function(node,parent){if(t.isExpressionStatement(parent)){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}if(t.isCallExpression(parent)&&parent.callee===node){return true}};exports.AssignmentExpression=exports.ConditionalExpression=function(node,parent){if(t.isUnaryLike(parent)){return true}if(t.isBinary(parent)){return true}if(t.isCallExpression(parent)||t.isNewExpression(parent)){if(parent.callee===node){return true}}if(t.isConditionalExpression(parent)&&parent.test===node){return true}if(t.isMemberExpression(parent)&&parent.object===node){return true}return false}},{"../../types":101,lodash:164}],19:[function(require,module,exports){"use strict";var _=require("lodash");var t=require("../../types");exports.before={nodes:{Property:function(node,parent){if(parent.properties[0]===node){return 1}},SpreadProperty:function(node,parent){return exports.before.nodes.Property(node,parent)},SwitchCase:function(node,parent){if(parent.cases[0]===node){return 1}},CallExpression:function(node){if(t.isFunction(node.callee)){return 1}}}};exports.after={nodes:{AssignmentExpression:function(node){if(t.isFunction(node.right)){return 1}}},list:{VariableDeclaration:function(node){return _.map(node.declarations,"init")},ArrayExpression:function(node){return node.elements},ObjectExpression:function(node){return node.properties}}};_.each({Function:1,Class:1,For:1,ArrayExpression:{after:1},ObjectExpression:{after:1},SwitchStatement:1,IfStatement:{before:1},CallExpression:{after:1},Literal:{after:1}},function(amounts,type){if(_.isNumber(amounts)){amounts={after:amounts,before:amounts}}_.each([type].concat(t.FLIPPED_ALIAS_KEYS[type]||[]),function(type){_.each(amounts,function(amount,key){exports[key].nodes[type]=function(){return amount}})})})},{"../../types":101,lodash:164}],20:[function(require,module,exports){"use strict";module.exports=Position;function Position(){this.line=1;this.column=0}Position.prototype.push=function(str){for(var i=0;i<str.length;i++){if(str[i]==="\n"){this.line++;this.column=0}else{this.column++}}};Position.prototype.unshift=function(str){for(var i=0;i<str.length;i++){if(str[i]==="\n"){this.line--}else{this.column--}}}},{}],21:[function(require,module,exports){"use strict";module.exports=SourceMap;var sourceMap=require("source-map");var t=require("../types");function SourceMap(position,opts,code){this.position=position;this.opts=opts;if(opts.sourceMap){this.map=new sourceMap.SourceMapGenerator({file:opts.sourceMapName,sourceRoot:opts.sourceRoot});this.map.setSourceContent(opts.sourceFileName,code)}else{this.map=null}}SourceMap.prototype.get=function(){var map=this.map;if(map){return map.toJSON()}else{return map}};SourceMap.prototype.mark=function(node,type){var loc=node.loc;if(!loc)return;var map=this.map;if(!map)return;if(t.isProgram(node)||t.isFile(node))return;var position=this.position;var generated={line:position.line,column:position.column};var original=loc[type];if(generated.line===original.line&&generated.column===original.column)return;map.addMapping({source:this.opts.sourceFileName,generated:generated,original:original})}},{"../types":101,"source-map":181}],22:[function(require,module,exports){"use strict";module.exports=Whitespace;var _=require("lodash");function getLookupIndex(i,base,max){i+=base;if(i>=max)i-=max;return i}function Whitespace(tokens,comments){this.tokens=_.sortBy(tokens.concat(comments),"start");this.used={};this._lastFoundIndex=0}Whitespace.prototype.getNewlinesBefore=function(node){var startToken;var endToken;var tokens=this.tokens;var token;for(var j=0;j<tokens.length;j++){var i=getLookupIndex(j,this._lastFoundIndex,this.tokens.length);token=tokens[i];if(node.start===token.start){startToken=tokens[i-1];endToken=token;this._lastFoundIndex=i;break}}return this.getNewlinesBetween(startToken,endToken)};Whitespace.prototype.getNewlinesAfter=function(node){var startToken;var endToken;var tokens=this.tokens;var token;for(var j=0;j<tokens.length;j++){var i=getLookupIndex(j,this._lastFoundIndex,this.tokens.length);token=tokens[i];if(node.end===token.end){startToken=token;endToken=tokens[i+1];this._lastFoundIndex=i;break}}if(endToken.type.type==="eof"){return 1}else{var lines=this.getNewlinesBetween(startToken,endToken);if(node.type==="Line"&&!lines){return 1}else{return lines}}};Whitespace.prototype.getNewlinesBetween=function(startToken,endToken){var start=startToken?startToken.loc.end.line:1;var end=endToken.loc.start.line;var lines=0;for(var line=start;line<end;line++){if(typeof this.used[line]==="undefined"){this.used[line]=true;lines++}}return lines}},{lodash:164}],23:[function(require,module,exports){"use strict";module.exports=function cloneDeep(obj){var obj2={};if(!obj)return obj2;for(var key in obj){obj2[key]=obj[key]}return obj2}},{}],24:[function(require,module,exports){var supportsColor=require("supports-color");var tokenize=require("js-tokenizer");var chalk=require("chalk");var util=require("../util");var defs={string1:"red",string2:"red",punct:["white","bold"],curly:"green",parens:["blue","bold"],square:["yellow"],name:"white",keyword:["cyan"],number:"magenta",regexp:"magenta",comment1:"grey",comment2:"grey"};var highlight=function(text){var colorize=function(str,col){if(!col)return str;if(Array.isArray(col)){col.forEach(function(col){str=chalk[col](str)})}else{str=chalk[col](str)}return str};return tokenize(text,true).map(function(str){var type=tokenize.type(str);return colorize(str,defs[type])}).join("")};module.exports=function(lines,lineNumber,colNumber){colNumber=Math.max(colNumber,0);if(supportsColor){lines=highlight(lines)}lines=lines.split("\n");var start=Math.max(lineNumber-3,0);var end=Math.min(lines.length,lineNumber+3);var width=(end+"").length;if(!lineNumber&&!colNumber){start=0;end=lines.length}return"\n"+lines.slice(start,end).map(function(line,i){var curr=i+start+1;var gutter=curr===lineNumber?"> ":" ";var sep=curr+util.repeat(width+1);gutter+=sep+"| ";var str=gutter+line;if(colNumber&&curr===lineNumber){str+="\n";str+=util.repeat(gutter.length-2);str+="|"+util.repeat(colNumber)+"^"}return str}).join("\n")}},{"../util":104,chalk:146,"js-tokenizer":163,"supports-color":192}],25:[function(require,module,exports){"use strict";module.exports=function(){return Object.create(null)}},{}],26:[function(require,module,exports){"use strict";module.exports=function toFastProperties(obj){function f(){}f.prototype=obj;return f;eval(obj)}},{}],27:[function(require,module,exports){"use strict";var t=require("./types");var _=require("lodash");require("./types/node");var estraverse=require("estraverse");_.extend(estraverse.VisitorKeys,t.VISITOR_KEYS);var types=require("ast-types");var def=types.Type.def;var or=types.Type.or;def("File").bases("Node").build("program").field("program",def("Program"));def("AssignmentPattern").bases("Pattern").build("left","right").field("left",def("Pattern")).field("right",def("Expression"));def("ImportBatchSpecifier").bases("Specifier").build("name").field("name",def("Identifier"));def("RestElement").bases("Node").build("argument").field("argument",def("Pattern"));def("VirtualPropertyExpression").bases("Expression").build("object","property").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression")));def("PrivateDeclaration").bases("Declaration").build("declarations").field("declarations",[def("Identifier")]);def("BindMemberExpression").bases("Expression").build("object","property","arguments").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("arguments",[def("Expression")]);def("BindFunctionExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);types.finalize()},{"./types":101,"./types/node":102,"ast-types":119,estraverse:158,lodash:164}],28:[function(require,module,exports){"use strict";var explode=require("./explode-assignable-expression");var t=require("../../types");module.exports=function(exports,opts){var isAssignment=function(node){return node.operator===opts.operator+"="};var buildAssignment=function(left,right){return t.assignmentExpression("=",left,right)};exports.ExpressionStatement=function(node,parent,scope,context,file){if(file.isConsequenceExpressionStatement(node))return;var expr=node.expression;if(!isAssignment(expr))return;var nodes=[];var exploded=explode(expr.left,nodes,file,scope,true);nodes.push(t.expressionStatement(buildAssignment(exploded.ref,opts.build(exploded.uid,expr.right))));return nodes};exports.AssignmentExpression=function(node,parent,scope,context,file){if(!isAssignment(node))return;var nodes=[];var exploded=explode(node.left,nodes,file,scope);nodes.push(buildAssignment(exploded.ref,opts.build(exploded.uid,node.right)));return t.toSequenceExpression(nodes,scope)};exports.BinaryExpression=function(node){if(node.operator!==opts.operator)return;return opts.build(node.left,node.right)}}},{"../../types":101,"./explode-assignable-expression":31}],29:[function(require,module,exports){"use strict";var t=require("../../types");module.exports=function build(node,buildBody){var self=node.blocks.shift();if(!self)return;var child=build(node,buildBody);if(!child){child=buildBody();if(node.filter){child=t.ifStatement(node.filter,t.blockStatement([child]))}}return t.forOfStatement(t.variableDeclaration("let",[t.variableDeclarator(self.left)]),self.right,t.blockStatement([child]))}},{"../../types":101}],30:[function(require,module,exports){"use strict";var explode=require("./explode-assignable-expression");var t=require("../../types");module.exports=function(exports,opts){var buildAssignment=function(left,right){return t.assignmentExpression("=",left,right)};exports.ExpressionStatement=function(node,parent,scope,context,file){if(file.isConsequenceExpressionStatement(node))return;var expr=node.expression;if(!opts.is(expr,file))return;var nodes=[];var exploded=explode(expr.left,nodes,file,scope);nodes.push(t.ifStatement(opts.build(exploded.uid,file),t.expressionStatement(buildAssignment(exploded.ref,expr.right))));return nodes};exports.AssignmentExpression=function(node,parent,scope,context,file){if(!opts.is(node,file))return;var nodes=[];var exploded=explode(node.left,nodes,file,scope);nodes.push(t.logicalExpression("&&",opts.build(exploded.uid,file),buildAssignment(exploded.ref,node.right)));nodes.push(exploded.ref);return t.toSequenceExpression(nodes,scope)}}},{"../../types":101,"./explode-assignable-expression":31}],31:[function(require,module,exports){"use strict";var t=require("../../types");var getObjRef=function(node,nodes,file,scope){var ref;if(t.isIdentifier(node)){if(scope.has(node.name,true)){return node}else{ref=node}}else if(t.isMemberExpression(node)){ref=node.object;if(t.isIdentifier(ref)&&scope.has(ref.name)){return ref}}else{throw new Error("We can't explode this node type "+node.type)}var temp=scope.generateUidBasedOnNode(ref);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(temp,ref)]));return temp};var getPropRef=function(node,nodes,file,scope){var prop=node.property;var key=t.toComputedKey(node,prop);if(t.isLiteral(key))return key;var temp=scope.generateUidBasedOnNode(prop);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(temp,prop)]));return temp};module.exports=function(node,nodes,file,scope,allowedSingleIdent){var obj;if(t.isIdentifier(node)&&allowedSingleIdent){obj=node}else{obj=getObjRef(node,nodes,file,scope)}var ref,uid;if(t.isIdentifier(node)){ref=node;uid=obj}else{var prop=getPropRef(node,nodes,file,scope);var computed=node.computed||t.isLiteral(prop);uid=ref=t.memberExpression(obj,prop,computed)}return{uid:uid,ref:ref}}},{"../../types":101}],32:[function(require,module,exports){"use strict";var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var visitor={enter:function(node,parent,scope,context,state){if(!t.isIdentifier(node,{name:state.id}))return;if(!t.isReferenced(node,parent))return;var localDeclar=scope.get(state.id,true);if(localDeclar!==state.outerDeclar)return;state.selfReference=true;context.stop()}};exports.property=function(node,file,scope){var key=t.toComputedKey(node,node.key);if(!t.isLiteral(key))return node;var id=t.toIdentifier(key.value);key=t.identifier(id);var state={id:id,selfReference:false,outerDeclar:scope.get(id,true)};traverse(node,visitor,scope,state);if(state.selfReference){node.value=util.template("property-method-assignment-wrapper",{FUNCTION:node.value,FUNCTION_ID:key,FUNCTION_KEY:scope.generateUidIdentifier(id),WRAPPER_KEY:scope.generateUidIdentifier(id+"Wrapper")})}else{node.value.id=key}}},{"../../traverse":97,"../../types":101,"../../util":104}],33:[function(require,module,exports){"use strict";var traverse=require("../../traverse");var t=require("../../types");var visitor={enter:function(node,parent,scope,context){if(t.isFunction(node))context.skip();if(t.isAwaitExpression(node)){node.type="YieldExpression"}}};module.exports=function(node,callId,scope){node.async=false;node.generator=true;traverse(node,visitor,scope);var call=t.callExpression(callId,[node]);var id=node.id;delete node.id;if(t.isFunctionDeclaration(node)){var declar=t.variableDeclaration("let",[t.variableDeclarator(id,call)]);declar._blockHoist=true;return declar}else{return call}}},{"../../traverse":97,"../../types":101}],34:[function(require,module,exports){"use strict";module.exports=ReplaceSupers;var traverse=require("../../traverse");var t=require("../../types");function ReplaceSupers(opts){this.topLevelThisReference=null;this.methodNode=opts.methodNode;this.className=opts.className;this.superName=opts.superName;this.isLoose=opts.isLoose;this.scope=opts.scope;this.file=opts.file}ReplaceSupers.prototype.superProperty=function(property,isStatic,isComputed,thisExpression){return t.callExpression(this.file.addHelper("get"),[t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("getPrototypeOf")),[isStatic?this.className:t.memberExpression(this.className,t.identifier("prototype"))]),isComputed?property:t.literal(property.name),thisExpression])};ReplaceSupers.prototype.looseSuperProperty=function(methodNode,id,parent){var methodName=methodNode.key;var superName=this.superName||t.identifier("Function");if(parent.property===id){return}else if(t.isCallExpression(parent,{callee:id})){parent.arguments.unshift(t.thisExpression());if(methodName.name==="constructor"){return t.memberExpression(superName,t.identifier("call"))}else{id=superName;if(!methodNode.static){id=t.memberExpression(id,t.identifier("prototype"))}id=t.memberExpression(id,methodName,methodNode.computed);return t.memberExpression(id,t.identifier("call"))}}else if(t.isMemberExpression(parent)&&!methodNode.static){return t.memberExpression(superName,t.identifier("prototype"))}else{return superName}};ReplaceSupers.prototype.replace=function(){this.traverseLevel(this.methodNode.value,true)};var visitor={enter:function(node,parent,scope,context,state){var topLevel=state.topLevel;var self=state.self;if(t.isFunction(node)&&!t.isArrowFunctionExpression(node)){self.traverseLevel(node,false);return context.skip()}if(t.isProperty(node,{method:true})||t.isMethodDefinition(node)){return context.skip()}var getThisReference=topLevel?t.thisExpression:self.getThisReference;var callback=self.specHandle;if(self.isLoose)callback=self.looseHandle;return callback.call(self,getThisReference,node,parent)}};ReplaceSupers.prototype.traverseLevel=function(node,topLevel){var state={self:this,topLevel:topLevel};traverse(node,visitor,this.scope,state)};ReplaceSupers.prototype.getThisReference=function(){if(this.topLevelThisReference){return this.topLevelThisReference}else{var ref=this.topLevelThisReference=this.file.generateUidIdentifier("this");this.methodNode.value.body.body.unshift(t.variableDeclaration("var",[t.variableDeclarator(this.topLevelThisReference,t.thisExpression())]));return ref}};ReplaceSupers.prototype.looseHandle=function(getThisReference,node,parent){if(t.isIdentifier(node,{name:"super"})){return this.looseSuperProperty(this.methodNode,node,parent)}else if(t.isCallExpression(node)){var callee=node.callee;if(!t.isMemberExpression(callee))return;if(callee.object.name!=="super")return;t.appendToMemberExpression(callee,t.identifier("call"));node.arguments.unshift(getThisReference())}};ReplaceSupers.prototype.specHandle=function(getThisReference,node,parent){var methodNode=this.methodNode;var property;var computed;var args;if(t.isIdentifier(node,{name:"super"})){if(!(t.isMemberExpression(parent)&&!parent.computed&&parent.property===node)){throw this.file.errorWithNode(node,"illegal use of bare super")}}else if(t.isCallExpression(node)){var callee=node.callee;if(t.isIdentifier(callee,{name:"super"})){property=methodNode.key;computed=methodNode.computed;args=node.arguments;if(methodNode.key.name!=="constructor"){var methodName=methodNode.key.name||"METHOD_NAME";throw this.file.errorWithNode(node,"Direct super call is illegal in non-constructor, use super."+methodName+"() instead")}}else{if(!t.isMemberExpression(callee))return;if(callee.object.name!=="super")return;property=callee.property;computed=callee.computed;args=node.arguments}}else if(t.isMemberExpression(node)){if(!t.isIdentifier(node.object,{name:"super"}))return;property=node.property;computed=node.computed}if(!property)return;var thisReference=getThisReference();var superProperty=this.superProperty(property,methodNode.static,computed,thisReference);if(args){if(args.length===1&&t.isSpreadElement(args[0])){return t.callExpression(t.memberExpression(superProperty,t.identifier("apply")),[thisReference,args[0].argument])}else{return t.callExpression(t.memberExpression(superProperty,t.identifier("call")),[thisReference].concat(args))}}else{return superProperty}}},{"../../traverse":97,"../../types":101}],35:[function(require,module,exports){"use strict";var t=require("../../types");exports.has=function(node){var first=node.body[0];return t.isExpressionStatement(first)&&t.isLiteral(first.expression,{value:"use strict"})};exports.wrap=function(node,callback){var useStrictNode;if(exports.has(node)){useStrictNode=node.body.shift()}callback();if(useStrictNode){node.body.unshift(useStrictNode)}}},{"../../types":101}],36:[function(require,module,exports){"use strict";module.exports=DefaultFormatter;var traverse=require("../../traverse");var object=require("../../helpers/object");var util=require("../../util");var t=require("../../types");var _=require("lodash");function DefaultFormatter(file){this.file=file;this.ids=object();this.hasNonDefaultExports=false;this.hasLocalExports=false;this.hasLocalImports=false;this.localImportOccurences=object();this.localExports=object();this.localImports=object();this.getLocalExports();this.getLocalImports();this.remapAssignments()}DefaultFormatter.prototype.doDefaultExportInterop=function(node){return node.default&&!this.noInteropRequire&&!this.hasNonDefaultExports};DefaultFormatter.prototype.bumpImportOccurences=function(node){var source=node.source.value;var occurs=this.localImportOccurences;occurs[source]=occurs[source]||0;occurs[source]+=node.specifiers.length};var exportsVisitor={enter:function(node,parent,scope,context,formatter){var declar=node&&node.declaration;if(t.isExportDeclaration(node)){formatter.hasLocalImports=true;if(declar&&t.isStatement(declar)){_.extend(formatter.localExports,t.getIds(declar,true))}if(!node.default){formatter.hasNonDefaultExports=true}if(node.source){formatter.bumpImportOccurences(node)}}}};DefaultFormatter.prototype.getLocalExports=function(){traverse(this.file.ast,exportsVisitor,this.file.scope,this)};var importsVisitor={enter:function(node,parent,scope,context,formatter){if(t.isImportDeclaration(node)){formatter.hasLocalImports=true;_.extend(formatter.localImports,t.getIds(node,true));formatter.bumpImportOccurences(node)}}};DefaultFormatter.prototype.getLocalImports=function(){traverse(this.file.ast,importsVisitor,this.file.scope,this)};var remapVisitor={enter:function(node,parent,scope,context,formatter){if(t.isUpdateExpression(node)&&formatter.isLocalReference(node.argument,scope)){context.skip();var assign=t.assignmentExpression(node.operator[0]+"=",node.argument,t.literal(1));var remapped=formatter.remapExportAssignment(assign);if(t.isExpressionStatement(parent)||node.prefix){return remapped}var nodes=[];nodes.push(remapped);var operator;if(node.operator==="--"){operator="+"}else{operator="-"}nodes.push(t.binaryExpression(operator,node.argument,t.literal(1)));return t.sequenceExpression(nodes)}if(t.isAssignmentExpression(node)&&formatter.isLocalReference(node.left,scope)){context.skip();return formatter.remapExportAssignment(node)}}};DefaultFormatter.prototype.remapAssignments=function(){if(this.hasLocalImports){traverse(this.file.ast,remapVisitor,this.file.scope,this)}};DefaultFormatter.prototype.isLocalReference=function(node){var localImports=this.localImports;return t.isIdentifier(node)&&localImports[node.name]&&localImports[node.name]!==node};DefaultFormatter.prototype.checkLocalReference=function(node){var file=this.file;if(this.isLocalReference(node)){throw file.errorWithNode(node,"Illegal assignment of module import")}};DefaultFormatter.prototype.remapExportAssignment=function(node){return t.assignmentExpression("=",node.left,t.assignmentExpression(node.operator,t.memberExpression(t.identifier("exports"),node.left),node.right))};DefaultFormatter.prototype.isLocalReference=function(node,scope){var localExports=this.localExports;var name=node.name;return t.isIdentifier(node)&&localExports[name]&&localExports[name]===scope.get(name,true)};DefaultFormatter.prototype.getModuleName=function(){var opts=this.file.opts;var filenameRelative=opts.filenameRelative;var moduleName="";if(opts.moduleRoot){moduleName=opts.moduleRoot+"/"}if(!opts.filenameRelative){return moduleName+opts.filename.replace(/^\//,"")}if(opts.sourceRoot){var sourceRootRegEx=new RegExp("^"+opts.sourceRoot+"/?");filenameRelative=filenameRelative.replace(sourceRootRegEx,"")}if(!opts.keepModuleIdExtensions){filenameRelative=filenameRelative.replace(/\.(.*?)$/,"")}moduleName+=filenameRelative;moduleName=moduleName.replace(/\\/g,"/");return moduleName};DefaultFormatter.prototype._pushStatement=function(ref,nodes){if(t.isClass(ref)||t.isFunction(ref)){if(ref.id){nodes.push(t.toStatement(ref));ref=ref.id}}return ref};DefaultFormatter.prototype._hoistExport=function(declar,assign,priority){if(t.isFunctionDeclaration(declar)){assign._blockHoist=priority||2}return assign};DefaultFormatter.prototype.getExternalReference=function(node,nodes){var ids=this.ids;var id=node.source.value;if(ids[id]){return ids[id]}else{return this.ids[id]=this._getExternalReference(node,nodes)}};DefaultFormatter.prototype.exportSpecifier=function(specifier,node,nodes){var inherits=false;if(node.specifiers.length===1)inherits=node;if(node.source){var ref=this.getExternalReference(node,nodes);if(t.isExportBatchSpecifier(specifier)){nodes.push(this.buildExportsWildcard(ref,node))}else{if(t.isSpecifierDefault(specifier)&&!this.noInteropRequire){ref=t.callExpression(this.file.addHelper("interop-require"),[ref])}else{ref=t.memberExpression(ref,t.getSpecifierId(specifier))}nodes.push(this.buildExportsAssignment(t.getSpecifierName(specifier),ref,node))}}else{nodes.push(this.buildExportsAssignment(t.getSpecifierName(specifier),specifier.id,node))}};DefaultFormatter.prototype.buildExportsWildcard=function(objectIdentifier){return t.expressionStatement(t.callExpression(this.file.addHelper("defaults"),[t.identifier("exports"),t.callExpression(this.file.addHelper("interop-require-wildcard"),[objectIdentifier])]))};DefaultFormatter.prototype.buildExportsAssignment=function(id,init){return util.template("exports-assign",{VALUE:init,KEY:id},true)};DefaultFormatter.prototype.exportDeclaration=function(node,nodes){var declar=node.declaration;var id=declar.id;if(node.default){id=t.identifier("default")}var assign;if(t.isVariableDeclaration(declar)){for(var i=0;i<declar.declarations.length;i++){var decl=declar.declarations[i];decl.init=this.buildExportsAssignment(decl.id,decl.init,node).expression;var newDeclar=t.variableDeclaration(declar.kind,[decl]);if(i===0)t.inherits(newDeclar,declar);nodes.push(newDeclar)}}else{var ref=declar;if(t.isFunctionDeclaration(declar)||t.isClassDeclaration(declar)){ref=declar.id;nodes.push(declar)}assign=this.buildExportsAssignment(id,ref,node);nodes.push(assign);this._hoistExport(declar,assign)}}},{"../../helpers/object":25,"../../traverse":97,"../../types":101,"../../util":104,lodash:164}],37:[function(require,module,exports){"use strict";var util=require("../../util");module.exports=function(Parent){var Constructor=function(){this.noInteropRequire=true;Parent.apply(this,arguments)};util.inherits(Constructor,Parent);return Constructor}},{"../../util":104}],38:[function(require,module,exports){"use strict";module.exports=require("./_strict")(require("./amd"))},{"./_strict":37,"./amd":39}],39:[function(require,module,exports){"use strict";module.exports=AMDFormatter;var DefaultFormatter=require("./_default");var CommonFormatter=require("./common");var util=require("../../util");var t=require("../../types");var _=require("lodash");function AMDFormatter(){CommonFormatter.apply(this,arguments)}util.inherits(AMDFormatter,DefaultFormatter);AMDFormatter.prototype.buildDependencyLiterals=function(){var names=[];for(var name in this.ids){names.push(t.literal(name))}return names};AMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[t.literal("exports")];
if(this.passModuleArg)names.push(t.literal("module"));names=names.concat(this.buildDependencyLiterals());names=t.arrayExpression(names);var params=_.values(this.ids);if(this.passModuleArg)params.unshift(t.identifier("module"));params.unshift(t.identifier("exports"));var container=t.functionExpression(null,params,t.blockStatement(body));var defineArgs=[names,container];var moduleName=this.getModuleName();if(moduleName)defineArgs.unshift(t.literal(moduleName));var call=t.callExpression(t.identifier("define"),defineArgs);program.body=[t.expressionStatement(call)]};AMDFormatter.prototype.getModuleName=function(){if(this.file.opts.moduleIds){return DefaultFormatter.prototype.getModuleName.apply(this,arguments)}else{return null}};AMDFormatter.prototype._getExternalReference=function(node){return this.file.generateUidIdentifier(node.source.value)};AMDFormatter.prototype.importDeclaration=function(node){this.getExternalReference(node)};AMDFormatter.prototype.importSpecifier=function(specifier,node,nodes){var key=t.getSpecifierName(specifier);var ref=this.getExternalReference(node);if(_.contains(this.file.dynamicImported,node)){this.ids[node.source.value]=key;return}else if(t.isImportBatchSpecifier(specifier)){}else if(t.isSpecifierDefault(specifier)&&!this.noInteropRequire){ref=t.callExpression(this.file.addHelper("interop-require"),[ref])}else{ref=t.memberExpression(ref,t.getSpecifierId(specifier),false)}nodes.push(t.variableDeclaration("var",[t.variableDeclarator(key,ref)]))};AMDFormatter.prototype.exportDeclaration=function(node){if(this.doDefaultExportInterop(node)){this.passModuleArg=true}CommonFormatter.prototype.exportDeclaration.apply(this,arguments)}},{"../../types":101,"../../util":104,"./_default":36,"./common":41,lodash:164}],40:[function(require,module,exports){"use strict";module.exports=require("./_strict")(require("./common"))},{"./_strict":37,"./common":41}],41:[function(require,module,exports){"use strict";module.exports=CommonJSFormatter;var DefaultFormatter=require("./_default");var util=require("../../util");var t=require("../../types");var _=require("lodash");function CommonJSFormatter(file){DefaultFormatter.apply(this,arguments);if(this.hasNonDefaultExports){file.ast.program.body.push(util.template("exports-module-declaration",true))}}util.inherits(CommonJSFormatter,DefaultFormatter);CommonJSFormatter.prototype.importSpecifier=function(specifier,node,nodes){var variableName=t.getSpecifierName(specifier);var ref=this.getExternalReference(node,nodes);if(t.isSpecifierDefault(specifier)){if(!_.contains(this.file.dynamicImported,node)){ref=t.callExpression(this.file.addHelper("interop-require"),[ref])}nodes.push(t.variableDeclaration("var",[t.variableDeclarator(variableName,ref)]))}else{if(specifier.type==="ImportBatchSpecifier"){nodes.push(t.variableDeclaration("var",[t.variableDeclarator(variableName,t.callExpression(this.file.addHelper("interop-require-wildcard"),[ref]))]))}else{nodes.push(t.variableDeclaration("var",[t.variableDeclarator(variableName,t.memberExpression(ref,t.getSpecifierId(specifier)))]))}}};CommonJSFormatter.prototype.importDeclaration=function(node,nodes){nodes.push(util.template("require",{MODULE_NAME:node.source},true))};CommonJSFormatter.prototype.exportDeclaration=function(node,nodes){if(this.doDefaultExportInterop(node)){var declar=node.declaration;var assign=util.template("exports-default-assign",{VALUE:this._pushStatement(declar,nodes)},true);if(t.isFunctionDeclaration(declar)){assign._blockHoist=3}nodes.push(assign);return}DefaultFormatter.prototype.exportDeclaration.apply(this,arguments)};CommonJSFormatter.prototype._getExternalReference=function(node,nodes){var source=node.source.value;var call=t.callExpression(t.identifier("require"),[node.source]);if(this.localImportOccurences[source]>1){var uid=this.file.generateUidIdentifier(source);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(uid,call)]));return uid}else{return call}}},{"../../types":101,"../../util":104,"./_default":36,lodash:164}],42:[function(require,module,exports){"use strict";module.exports=IgnoreFormatter;var t=require("../../types");function IgnoreFormatter(){}IgnoreFormatter.prototype.exportDeclaration=function(node,nodes){var declar=t.toStatement(node.declaration,true);if(declar)nodes.push(t.inherits(declar,node))};IgnoreFormatter.prototype.importDeclaration=IgnoreFormatter.prototype.importSpecifier=IgnoreFormatter.prototype.exportSpecifier=function(){}},{"../../types":101}],43:[function(require,module,exports){module.exports={commonStrict:require("./common-strict"),amdStrict:require("./amd-strict"),umdStrict:require("./umd-strict"),common:require("./common"),system:require("./system"),ignore:require("./ignore"),amd:require("./amd"),umd:require("./umd")}},{"./amd":39,"./amd-strict":38,"./common":41,"./common-strict":40,"./ignore":42,"./system":44,"./umd":46,"./umd-strict":45}],44:[function(require,module,exports){"use strict";module.exports=SystemFormatter;var DefaultFormatter=require("./_default");var AMDFormatter=require("./amd");var useStrict=require("../helpers/use-strict");var traverse=require("../../traverse");var util=require("../../util");var t=require("../../types");var _=require("lodash");function SystemFormatter(file){this.exportIdentifier=file.generateUidIdentifier("export");this.noInteropRequire=true;DefaultFormatter.apply(this,arguments)}util.inherits(SystemFormatter,AMDFormatter);SystemFormatter.prototype._addImportSource=function(node,exportNode){node._importSource=exportNode.source&&exportNode.source.value;return node};SystemFormatter.prototype.buildExportsWildcard=function(objectIdentifier,node){var leftIdentifier=this.file.generateUidIdentifier("key");var valIdentifier=t.memberExpression(objectIdentifier,leftIdentifier,true);var left=t.variableDeclaration("var",[t.variableDeclarator(leftIdentifier)]);var right=objectIdentifier;var block=t.blockStatement([t.expressionStatement(this.buildExportCall(leftIdentifier,valIdentifier))]);return this._addImportSource(t.forInStatement(left,right,block),node)};SystemFormatter.prototype.buildExportsAssignment=function(id,init,node){var call=this.buildExportCall(t.literal(id.name),init,true);return this._addImportSource(call,node)};SystemFormatter.prototype.remapExportAssignment=function(node){return this.buildExportCall(t.literal(node.left.name),node)};SystemFormatter.prototype.buildExportCall=function(id,init,isStatement){var call=t.callExpression(this.exportIdentifier,[id,init]);if(isStatement){return t.expressionStatement(call)}else{return call}};SystemFormatter.prototype.importSpecifier=function(specifier,node,nodes){AMDFormatter.prototype.importSpecifier.apply(this,arguments);this._addImportSource(_.last(nodes),node)};var runnerSettersVisitor={enter:function(node,parent,scope,context,state){if(node._importSource===state.source){if(t.isVariableDeclaration(node)){_.each(node.declarations,function(declar){state.hoistDeclarators.push(t.variableDeclarator(declar.id));state.nodes.push(t.expressionStatement(t.assignmentExpression("=",declar.id,declar.init)))})}else{state.nodes.push(node)}context.remove()}}};SystemFormatter.prototype.buildRunnerSetters=function(block,hoistDeclarators){var scope=this.file.scope;return t.arrayExpression(_.map(this.ids,function(uid,source){var state={source:source,nodes:[],hoistDeclarators:hoistDeclarators};traverse(block,runnerSettersVisitor,scope,state);return t.functionExpression(null,[uid],t.blockStatement(state.nodes))}))};var hoistVariablesVisitor={enter:function(node,parent,scope,context,hoistDeclarators){if(t.isFunction(node)){return context.skip()}if(t.isVariableDeclaration(node)){if(node.kind!=="var"&&!t.isProgram(parent)){return}if(node._blockHoist)return;var nodes=[];for(var i=0;i<node.declarations.length;i++){var declar=node.declarations[i];hoistDeclarators.push(t.variableDeclarator(declar.id));if(declar.init){var assign=t.expressionStatement(t.assignmentExpression("=",declar.id,declar.init));nodes.push(assign)}}if(t.isFor(parent)){if(parent.left===node){return node.declarations[0].id}if(parent.init===node){return t.toSequenceExpression(nodes,scope)}}return nodes}}};var hoistFunctionsVisitor={enter:function(node,parent,scope,context,handlerBody){if(t.isFunction(node))context.skip();if(t.isFunctionDeclaration(node)||node._blockHoist){handlerBody.push(node);context.remove()}}};SystemFormatter.prototype.transform=function(ast){var program=ast.program;var hoistDeclarators=[];var moduleName=this.getModuleName();var moduleNameLiteral=t.literal(moduleName);var block=t.blockStatement(program.body);var runner=util.template("system",{MODULE_NAME:moduleNameLiteral,MODULE_DEPENDENCIES:t.arrayExpression(this.buildDependencyLiterals()),EXPORT_IDENTIFIER:this.exportIdentifier,SETTERS:this.buildRunnerSetters(block,hoistDeclarators),EXECUTE:t.functionExpression(null,[],block)},true);var handlerBody=runner.expression.arguments[2].body.body;if(!moduleName)runner.expression.arguments.shift();var returnStatement=handlerBody.pop();traverse(block,hoistVariablesVisitor,this.file.scope,hoistDeclarators);if(hoistDeclarators.length){var hoistDeclar=t.variableDeclaration("var",hoistDeclarators);hoistDeclar._blockHoist=true;handlerBody.unshift(hoistDeclar)}traverse(block,hoistFunctionsVisitor,this.file.scope,handlerBody);handlerBody.push(returnStatement);if(useStrict.has(block)){handlerBody.unshift(block.body.shift())}program.body=[runner]}},{"../../traverse":97,"../../types":101,"../../util":104,"../helpers/use-strict":35,"./_default":36,"./amd":39,lodash:164}],45:[function(require,module,exports){"use strict";module.exports=require("./_strict")(require("./umd"))},{"./_strict":37,"./umd":46}],46:[function(require,module,exports){"use strict";module.exports=UMDFormatter;var AMDFormatter=require("./amd");var util=require("../../util");var t=require("../../types");var _=require("lodash");function UMDFormatter(){AMDFormatter.apply(this,arguments)}util.inherits(UMDFormatter,AMDFormatter);UMDFormatter.prototype.transform=function(ast){var program=ast.program;var body=program.body;var names=[];for(var name in this.ids){names.push(t.literal(name))}var ids=_.values(this.ids);var args=[t.identifier("exports")];if(this.passModuleArg)args.push(t.identifier("module"));args=args.concat(ids);var factory=t.functionExpression(null,args,t.blockStatement(body));var defineArgs=[t.literal("exports")];if(this.passModuleArg)defineArgs.push(t.literal("module"));defineArgs=defineArgs.concat(names);defineArgs=[t.arrayExpression(defineArgs)];var testExports=util.template("test-exports");var testModule=util.template("test-module");var commonTests=this.passModuleArg?t.logicalExpression("&&",testExports,testModule):testExports;var commonArgs=[t.identifier("exports")];if(this.passModuleArg)commonArgs.push(t.identifier("module"));commonArgs=commonArgs.concat(names.map(function(name){return t.callExpression(t.identifier("require"),[name])}));var moduleName=this.getModuleName();if(moduleName)defineArgs.unshift(t.literal(moduleName));var runner=util.template("umd-runner-body",{AMD_ARGUMENTS:defineArgs,COMMON_TEST:commonTests,COMMON_ARGUMENTS:commonArgs});var call=t.callExpression(runner,[factory]);program.body=[t.expressionStatement(call)]}},{"../../types":101,"../../util":104,"./amd":39,lodash:164}],47:[function(require,module,exports){"use strict";module.exports=transform;var Transformer=require("./transformer");var object=require("../helpers/object");var File=require("../file");var util=require("../util");var _=require("lodash");function transform(code,opts){var file=new File(opts);return file.parse(code)}transform.fromAst=function(ast,code,opts){ast=util.normaliseAst(ast);var file=new File(opts);file.addCode(code);file.transform(ast);return file.generate()};transform._ensureTransformerNames=function(type,rawKeys){var keys=[];for(var i=0;i<rawKeys.length;i++){var key=rawKeys[i];var deprecatedKey=transform.deprecatedTransformerMap[key];if(deprecatedKey){console.error("The transformer "+key+" has been renamed to "+deprecatedKey+" in v3.0.0 - backwards compatibilty will be removed 4.0.0");rawKeys.push(deprecatedKey)}else if(transform.transformers[key]){keys.push(key)}else if(transform.namespaces[key]){keys=keys.concat(transform.namespaces[key])}else{throw new ReferenceError("Unknown transformer "+key+" specified in "+type+" - "+"transformer key names have been changed in 3.0.0 see "+"the changelog for more info "+"https://github.com/6to5/6to5/blob/master/CHANGELOG.md#300")}}return keys};transform.transformers=object();transform.namespaces=object();transform.deprecatedTransformerMap=require("./transformers/deprecated");transform.moduleFormatters=require("./modules");var rawTransformers=require("./transformers");_.each(rawTransformers,function(transformer,key){var namespace=key.split(".")[0];transform.namespaces[namespace]=transform.namespaces[namespace]||[];transform.namespaces[namespace].push(key);transform.transformers[key]=new Transformer(key,transformer)})},{"../file":2,"../helpers/object":25,"../util":104,"./modules":43,"./transformer":49,"./transformers":71,"./transformers/deprecated":50,lodash:164}],48:[function(require,module,exports){module.exports=TransformerPass;var traverse=require("../traverse");var _=require("lodash");function TransformerPass(file,transformer){this.transformer=transformer;this.handlers=transformer.handlers;this.file=file}TransformerPass.prototype.astRun=function(key){var handlers=this.handlers;var file=this.file;if(handlers.ast&&handlers.ast[key]){handlers.ast[key](file.ast,file)}};TransformerPass.prototype.canRun=function(){var transformer=this.transformer;var opts=this.file.opts;var key=transformer.key;if(key[0]==="_")return true;var blacklist=opts.blacklist;if(blacklist.length&&_.contains(blacklist,key))return false;var whitelist=opts.whitelist;if(whitelist.length&&!_.contains(whitelist,key))return false;if(transformer.optional&&!_.contains(opts.optional,key))return false;if(transformer.experimental&&!opts.experimental)return false;return true};var transformVisitor={enter:function(node,parent,scope,context,state){var fns=state.handlers[node.type];if(!fns)return;return fns.enter(node,parent,scope,context,state.file,state.pass)},exit:function(node,parent,scope,context,state){var fns=state.handlers[node.type];if(!fns)return;return fns.exit(node,parent,scope,context,state.file,state.pass)}};TransformerPass.prototype.transform=function(){var file=this.file;this.astRun("before");var state={file:file,handlers:this.handlers,pass:this};traverse(file.ast,transformVisitor,file.scope,state);this.astRun("after")}},{"../traverse":97,lodash:164}],49:[function(require,module,exports){"use strict";module.exports=Transformer;var TransformerPass=require("./transformer-pass");var t=require("../types");var _=require("lodash");function Transformer(key,transformer,opts){this.manipulateOptions=transformer.manipulateOptions;this.experimental=!!transformer.experimental;this.secondPass=!!transformer.secondPass;this.optional=!!transformer.optional;this.handlers=this.normalise(transformer);this.opts=opts||{};this.key=key}Transformer.prototype.normalise=function(transformer){var self=this;if(_.isFunction(transformer)){transformer={ast:transformer}}_.each(transformer,function(fns,type){if(type[0]==="_"){self[type]=fns;return}if(_.isFunction(fns))fns={enter:fns};if(!_.isObject(fns))return;if(!fns.enter)fns.enter=_.noop;if(!fns.exit)fns.exit=_.noop;transformer[type]=fns;var aliases=t.FLIPPED_ALIAS_KEYS[type];if(aliases){_.each(aliases,function(alias){transformer[alias]=fns})}});return transformer};Transformer.prototype.buildPass=function(file){return new TransformerPass(file,this)}},{"../types":101,"./transformer-pass":48,lodash:164}],50:[function(require,module,exports){module.exports={specNoForInOfAssignment:"validation.noForInOfAssignment",specSetters:"validation.setters",specBlockScopedFunctions:"spec.blockScopedFunctions",malletOperator:"playground.malletOperator",methodBinding:"playground.methodBinding",memoizationOperator:"playground.memoizationOperator",objectGetterMemoization:"playground.objectGetterMemoization",modules:"es6.modules",propertyNameShorthand:"es6.properties.shorthand",arrayComprehension:"es7.comprehensions",generatorComprehension:"es7.comprehensions",arrowFunctions:"es6.arrowFunctions",classes:"es6.classes",objectSpread:"es7.objectSpread",exponentiationOperator:"es7.exponentiationOperator",spread:"es6.spread",templateLiterals:"es6.templateLiterals",propertyMethodAssignment:"es6.properties.shorthand",computedPropertyNames:"es6.properties.computed",defaultParameters:"es6.parameters.default",restParameters:"es6.parameters.rest",destructuring:"es6.destructuring",forOf:"es6.forOf",unicodeRegex:"es6.unicodeRegex",abstractReferences:"es7.abstractReferences",constants:"es6.constants",letScoping:"es6.letScoping",blockScopingTDZ:"es6.blockScopingTDZ",generators:"regenerator",protoToAssign:"spec.protoToAssign",typeofSymbol:"spec.typeofSymbol",coreAliasing:"selfContained",undefinedToVoid:"spec.undefinedToVoid",undeclaredVariableCheck:"validation.undeclaredVariableCheck",specPropertyLiterals:"minification.propertyLiterals",specMemberExpressionLiterals:"minification.memberExpressionLiterals"}},{}],51:[function(require,module,exports){"use strict";var util=require("../../../util");var t=require("../../../types");exports.ObjectExpression=function(node){var mutatorMap={};var hasAny=false;node.properties=node.properties.filter(function(prop){if(prop.kind==="get"||prop.kind==="set"){hasAny=true;util.pushMutatorMap(mutatorMap,prop.key,prop.kind,prop.computed,prop.value);return false}else{return true}});if(!hasAny)return;return t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("defineProperties")),[node,util.buildDefineProperties(mutatorMap)])}},{"../../../types":101,"../../../util":104}],52:[function(require,module,exports){"use strict";var t=require("../../../types");exports.ArrowFunctionExpression=function(node){t.ensureBlock(node);node._aliasFunction="arrow";node.expression=false;node.type="FunctionExpression";return node}},{"../../../types":101}],53:[function(require,module,exports){"use strict";var traverse=require("../../../traverse");var t=require("../../../types");var visitor={enter:function(node,parent,scope,context,state){if(!t.isReferencedIdentifier(node,parent))return;var declared=state.letRefs[node.name];if(!declared)return;if(scope.get(node.name,true)!==declared)return;var declaredLoc=declared.loc;var referenceLoc=node.loc;if(!declaredLoc||!referenceLoc)return;var before=referenceLoc.start.line<declaredLoc.start.line;if(referenceLoc.start.line===declaredLoc.start.line){before=referenceLoc.start.col<declaredLoc.start.col}if(before){throw state.file.errorWithNode(node,"Temporal dead zone - accessing a variable before it's initialized")}}};exports.optional=true;exports.Loop=exports.Program=exports.BlockStatement=function(node,parent,scope,context,file){var letRefs=node._letReferences;if(!letRefs)return;var state={letRefs:letRefs,file:file};traverse(node,visitor,scope,state)}},{"../../../traverse":97,"../../../types":101}],54:[function(require,module,exports){"use strict";var traverse=require("../../../traverse");var object=require("../../../helpers/object");var util=require("../../../util");var t=require("../../../types");var _=require("lodash");var isLet=function(node,parent){if(!t.isVariableDeclaration(node))return false;if(node._let)return true;if(node.kind!=="let")return false;if(!t.isFor(parent)||t.isFor(parent)&&parent.left!==node){for(var i=0;i<node.declarations.length;i++){var declar=node.declarations[i];declar.init=declar.init||t.identifier("undefined")}}node._let=true;node.kind="var";return true};var isVar=function(node,parent){return t.isVariableDeclaration(node,{kind:"var"})&&!isLet(node,parent)};var standardiseLets=function(declars){for(var i=0;i<declars.length;i++){delete declars[i]._let}};exports.VariableDeclaration=function(node,parent){isLet(node,parent)};exports.Loop=function(node,parent,scope,context,file){var init=node.left||node.init;if(isLet(init,node)){t.ensureBlock(node);node.body._letDeclarators=[init]}if(t.isLabeledStatement(parent)){node.label=parent.label}var letScoping=new LetScoping(node,node.body,parent,scope,file);letScoping.run();if(node.label&&!t.isLabeledStatement(parent)){return t.labeledStatement(node.label,node)}};exports.Program=exports.BlockStatement=function(block,parent,scope,context,file){if(!t.isLoop(parent)){var letScoping=new LetScoping(false,block,parent,scope,file);letScoping.run()}};function LetScoping(loopParent,block,parent,scope,file){this.loopParent=loopParent;this.parent=parent;this.scope=scope;this.block=block;this.file=file;this.outsideLetReferences=object();this.hasLetReferences=false;this.letReferences=block._letReferences=object();this.body=[]}LetScoping.prototype.run=function(){var block=this.block;if(block._letDone)return;block._letDone=true;var needsClosure=this.getLetReferences();if(t.isFunction(this.parent)||t.isProgram(this.block))return;if(!this.hasLetReferences)return;if(needsClosure){this.needsClosure()}else{this.remap()}};function replace(node,parent,scope,context,remaps){if(!t.isReferencedIdentifier(node,parent))return;var remap=remaps[node.name];if(!remap)return;var own=scope.get(node.name,true);if(own===remap.node){node.name=remap.uid}else{if(context)context.skip()}}var replaceVisitor={enter:replace};function traverseReplace(node,parent,scope,remaps){replace(node,parent,scope,null,remaps);traverse(node,replaceVisitor,scope,remaps)}LetScoping.prototype.remap=function(){var hasRemaps=false;var letRefs=this.letReferences;var scope=this.scope;var remaps=object();for(var key in letRefs){var ref=letRefs[key];if(scope.parentHas(key)){var uid=scope.generateUidIdentifier(ref.name).name;ref.name=uid;hasRemaps=true;remaps[key]=remaps[uid]={node:ref,uid:uid}}}if(!hasRemaps)return;var loopParent=this.loopParent;if(loopParent){traverseReplace(loopParent.right,loopParent,scope,remaps);traverseReplace(loopParent.test,loopParent,scope,remaps);traverseReplace(loopParent.update,loopParent,scope,remaps)}traverse(this.block,replaceVisitor,scope,remaps)};LetScoping.prototype.needsClosure=function(){var block=this.block;this.has=this.checkLoop();this.hoistVarDeclarations();var params=_.values(this.outsideLetReferences);var fn=t.functionExpression(null,params,t.blockStatement(block.body));fn._aliasFunction=true;block.body=this.body;var call=t.callExpression(fn,params);var ret=this.scope.generateUidIdentifier("ret");var hasYield=traverse.hasType(fn.body,this.scope,"YieldExpression",t.FUNCTION_TYPES);if(hasYield){fn.generator=true;call=t.yieldExpression(call,true)}var hasAsync=traverse.hasType(fn.body,this.scope,"AwaitExpression",t.FUNCTION_TYPES);if(hasAsync){fn.async=true;call=t.awaitExpression(call,true)}this.build(ret,call)};var letReferenceFunctionVisitor={enter:function(node,parent,scope,context,state){if(!t.isReferencedIdentifier(node,parent))return;if(scope.hasOwn(node.name,true))return;if(!state.letReferences[node.name])return;state.closurify=true}};var letReferenceBlockVisitor={enter:function(node,parent,scope,context,state){if(t.isFunction(node)){traverse(node,letReferenceFunctionVisitor,scope,state);return context.skip()}}};LetScoping.prototype.getLetReferences=function(){var block=this.block;var declarators=block._letDeclarators||[];var declar;for(var i=0;i<declarators.length;i++){declar=declarators[i];_.extend(this.outsideLetReferences,t.getIds(declar,true))}if(block.body){for(i=0;i<block.body.length;i++){declar=block.body[i];if(isLet(declar,block)){declarators=declarators.concat(declar.declarations)}}}for(i=0;i<declarators.length;i++){declar=declarators[i];var keys=t.getIds(declar,true);_.extend(this.letReferences,keys);this.hasLetReferences=true}if(!this.hasLetReferences)return;standardiseLets(declarators);var state={letReferences:this.letReferences,closurify:false};traverse(this.block,letReferenceBlockVisitor,this.scope,state);return state.closurify};var loopVisitor={enter:function(node,parent,scope,context,state){var replace;if(t.isFunction(node)||t.isLoop(node)){return context.skip()}if(node&&!node.label&&state.isLoop){if(t.isBreakStatement(node)){if(t.isSwitchCase(parent))return;state.hasBreak=true;replace=t.returnStatement(t.literal("break"))}else if(t.isContinueStatement(node)){state.hasContinue=true;replace=t.returnStatement(t.literal("continue"))}}if(t.isReturnStatement(node)){state.hasReturn=true;replace=t.returnStatement(t.objectExpression([t.property("init",t.identifier("v"),node.argument||t.identifier("undefined"))]))}if(replace)return t.inherits(replace,node)}};LetScoping.prototype.checkLoop=function(){var state={hasContinue:false,hasReturn:false,hasBreak:false,isLoop:!!this.loopParent};traverse(this.block,loopVisitor,this.scope,state);return state};var hoistVarDeclarationsVisitor={enter:function(node,parent,scope,context,self){if(t.isForStatement(node)){if(isVar(node.init,node)){node.init=t.sequenceExpression(self.pushDeclar(node.init))}}else if(t.isFor(node)){if(isVar(node.left,node)){node.left=node.left.declarations[0].id}}else if(isVar(node,parent)){return self.pushDeclar(node).map(t.expressionStatement)}else if(t.isFunction(node)){return context.skip()}}};LetScoping.prototype.hoistVarDeclarations=function(){traverse(this.block,hoistVarDeclarationsVisitor,this.scope,this)};LetScoping.prototype.pushDeclar=function(node){this.body.push(t.variableDeclaration(node.kind,node.declarations.map(function(declar){return t.variableDeclarator(declar.id)})));var replace=[];for(var i=0;i<node.declarations.length;i++){var declar=node.declarations[i];if(!declar.init)continue;var expr=t.assignmentExpression("=",declar.id,declar.init);replace.push(t.inherits(expr,declar))}return replace};LetScoping.prototype.build=function(ret,call){var has=this.has;if(has.hasReturn||has.hasBreak||has.hasContinue){this.buildHas(ret,call)}else{this.body.push(t.expressionStatement(call))}};LetScoping.prototype.buildHas=function(ret,call){var body=this.body;body.push(t.variableDeclaration("var",[t.variableDeclarator(ret,call)]));var loopParent=this.loopParent;var retCheck;var has=this.has;var cases=[];if(has.hasReturn){retCheck=util.template("let-scoping-return",{RETURN:ret})}if(has.hasBreak||has.hasContinue){if(!loopParent){throw new Error("Has no loop parent but we're trying to reassign breaks "+"and continues, something is going wrong here.")}var label=loopParent.label=loopParent.label||this.scope.generateUidIdentifier("loop");if(has.hasBreak){cases.push(t.switchCase(t.literal("break"),[t.breakStatement(label)]))}if(has.hasContinue){cases.push(t.switchCase(t.literal("continue"),[t.continueStatement(label)]))}if(has.hasReturn){cases.push(t.switchCase(null,[retCheck]))}if(cases.length===1){var single=cases[0];body.push(t.ifStatement(t.binaryExpression("===",ret,single.test),single.consequent[0]))}else{body.push(t.switchStatement(ret,cases))}}else{if(has.hasReturn)body.push(retCheck)}}},{"../../../helpers/object":25,"../../../traverse":97,"../../../types":101,"../../../util":104,lodash:164}],55:[function(require,module,exports){"use strict";var ReplaceSupers=require("../../helpers/replace-supers");var nameMethod=require("../../helpers/name-method");var util=require("../../../util");var t=require("../../../types");exports.ClassDeclaration=function(node,parent,scope,context,file){return new Class(node,file,scope,true).run()};exports.ClassExpression=function(node,parent,scope,context,file){if(!node.id){if(t.isProperty(parent)&&parent.value===node&&!parent.computed&&t.isIdentifier(parent.key)){node.id=parent.key}if(t.isVariableDeclarator(parent)&&t.isIdentifier(parent.id)){node.id=parent.id}}return new Class(node,file,scope,false).run()};function Class(node,file,scope,isStatement){this.isStatement=isStatement;this.scope=scope;this.node=node;this.file=file;this.hasInstanceMutators=false;this.hasStaticMutators=false;this.instanceMutatorMap={};this.staticMutatorMap={};this.hasConstructor=false;this.className=node.id||scope.generateUidIdentifier("class");this.superName=node.superClass;this.isLoose=file.isLoose("es6.classes")}Class.prototype.run=function(){var superName=this.superName;var className=this.className;var file=this.file;var body=this.body=[];var constructor;if(this.node.id){constructor=t.functionDeclaration(className,[],t.blockStatement([]));body.push(constructor)}else{constructor=t.functionExpression(null,[],t.blockStatement([]));body.push(t.variableDeclaration("var",[t.variableDeclarator(className,constructor)]))}this.constructor=constructor;var closureParams=[];var closureArgs=[];if(superName){closureArgs.push(superName);if(!t.isIdentifier(superName)){var superRef=this.scope.generateUidBasedOnNode(superName,this.file);superName=superRef}closureParams.push(superName);this.superName=superName;body.push(t.expressionStatement(t.callExpression(file.addHelper("inherits"),[className,superName])))}this.buildBody();t.inheritsComments(body[0],this.node);var init;if(body.length===1){init=t.toExpression(constructor)}else{body.push(t.returnStatement(className));init=t.callExpression(t.functionExpression(null,closureParams,t.blockStatement(body)),closureArgs)}if(this.isStatement){return t.variableDeclaration("let",[t.variableDeclarator(className,init)])}else{return init}};Class.prototype.buildBody=function(){var constructor=this.constructor;var className=this.className;var superName=this.superName;var classBody=this.node.body.body;var body=this.body;for(var i=0;i<classBody.length;i++){var node=classBody[i];if(t.isMethodDefinition(node)){var replaceSupers=new ReplaceSupers({methodNode:node,className:this.className,superName:this.superName,isLoose:this.isLoose,scope:this.scope,file:this.file});replaceSupers.replace();if(node.key.name==="constructor"){this.pushConstructor(node)}else{this.pushMethod(node)}}else if(t.isPrivateDeclaration(node)){this.closure=true;body.unshift(node)}}if(!this.hasConstructor&&superName&&!t.isFalsyExpression(superName)){var defaultConstructorTemplate="class-super-constructor-call";if(this.isLoose)defaultConstructorTemplate+="-loose";constructor.body.body.push(util.template(defaultConstructorTemplate,{CLASS_NAME:className,SUPER_NAME:this.superName},true))}var instanceProps;var staticProps;if(this.hasInstanceMutators){instanceProps=util.buildDefineProperties(this.instanceMutatorMap)}if(this.hasStaticMutators){staticProps=util.buildDefineProperties(this.staticMutatorMap)}if(instanceProps||staticProps){staticProps=staticProps||t.literal(null);var args=[className,staticProps];if(instanceProps)args.push(instanceProps);body.push(t.expressionStatement(t.callExpression(this.file.addHelper("prototype-properties"),args)))}};Class.prototype.pushMethod=function(node){var methodName=node.key;var kind=node.kind;if(kind===""){nameMethod.property(node,this.file,this.scope);if(this.isLoose){var className=this.className;if(!node.static)className=t.memberExpression(className,t.identifier("prototype"));methodName=t.memberExpression(className,methodName,node.computed);var expr=t.expressionStatement(t.assignmentExpression("=",methodName,node.value));t.inheritsComments(expr,node);this.body.push(expr);return}kind="value"}var mutatorMap=this.instanceMutatorMap;if(node.static){this.hasStaticMutators=true;mutatorMap=this.staticMutatorMap}else{this.hasInstanceMutators=true}util.pushMutatorMap(mutatorMap,methodName,kind,node.computed,node)};Class.prototype.pushConstructor=function(method){if(method.kind){throw this.file.errorWithNode(method,"illegal kind for constructor method")}var construct=this.constructor;var fn=method.value;this.hasConstructor=true;t.inherits(construct,fn);t.inheritsComments(construct,method);construct._ignoreUserWhitespace=true;construct.params=fn.params;construct.body=fn.body}},{"../../../types":101,"../../../util":104,"../../helpers/name-method":32,"../../helpers/replace-supers":34}],56:[function(require,module,exports){"use strict";var traverse=require("../../../traverse");var t=require("../../../types");var visitor={enter:function(node,parent,scope,context,state){if(t.isDeclaration(node)||t.isAssignmentExpression(node)){var ids=t.getIds(node,true);
for(var key in ids){var id=ids[key];var constant=state.constants[key];if(!constant)continue;if(id===constant)continue;throw state.file.errorWithNode(id,key+" is read-only")}}else if(t.isScope(node)){context.skip()}}};exports.Scope=function(node,parent,scope,context,file){traverse(node,visitor,scope,{constants:scope.getAllOfKind("const"),file:file})};exports.VariableDeclaration=function(node){if(node.kind==="const")node.kind="let"}},{"../../../traverse":97,"../../../types":101}],57:[function(require,module,exports){"use strict";var t=require("../../../types");var buildVariableAssign=function(opts,id,init){var op=opts.operator;if(t.isMemberExpression(id))op="=";var node;if(op){node=t.expressionStatement(t.assignmentExpression(op,id,init))}else{node=t.variableDeclaration(opts.kind,[t.variableDeclarator(id,init)])}node._blockHoist=opts.blockHoist;return node};var buildVariableDeclar=function(opts,id,init){var declar=t.variableDeclaration("var",[t.variableDeclarator(id,init)]);declar._blockHoist=opts.blockHoist;return declar};var push=function(opts,nodes,elem,parentId){if(t.isObjectPattern(elem)){pushObjectPattern(opts,nodes,elem,parentId)}else if(t.isArrayPattern(elem)){pushArrayPattern(opts,nodes,elem,parentId)}else if(t.isAssignmentPattern(elem)){pushAssignmentPattern(opts,nodes,elem,parentId)}else{nodes.push(buildVariableAssign(opts,elem,parentId))}};var pushAssignmentPattern=function(opts,nodes,pattern,parentId){var tempParentId=opts.scope.generateUidBasedOnNode(parentId,opts.file);nodes.push(t.variableDeclaration("var",[t.variableDeclarator(tempParentId,parentId)]));nodes.push(buildVariableAssign(opts,pattern.left,t.conditionalExpression(t.binaryExpression("===",tempParentId,t.identifier("undefined")),pattern.right,tempParentId)))};var pushObjectPattern=function(opts,nodes,pattern,parentId){for(var i=0;i<pattern.properties.length;i++){var prop=pattern.properties[i];if(t.isSpreadProperty(prop)){var keys=[];for(var i2=0;i2<pattern.properties.length;i2++){var prop2=pattern.properties[i2];if(i2>=i)break;if(t.isSpreadProperty(prop2))continue;var key=prop2.key;if(t.isIdentifier(key)){key=t.literal(prop2.key.name)}keys.push(key)}keys=t.arrayExpression(keys);var value=t.callExpression(opts.file.addHelper("object-without-properties"),[parentId,keys]);nodes.push(buildVariableAssign(opts,prop.argument,value))}else{if(t.isLiteral(prop.key))prop.computed=true;var pattern2=prop.value;var patternId2=t.memberExpression(parentId,prop.key,prop.computed);if(t.isPattern(pattern2)){push(opts,nodes,pattern2,patternId2)}else{nodes.push(buildVariableAssign(opts,pattern2,patternId2))}}}};var pushArrayPattern=function(opts,nodes,pattern,parentId){if(!pattern.elements)return;var i;var hasRest=false;for(i=0;i<pattern.elements.length;i++){if(t.isRestElement(pattern.elements[i])){hasRest=true;break}}var toArray=opts.file.toArray(parentId,!hasRest&&pattern.elements.length);var _parentId=opts.scope.generateUidBasedOnNode(parentId,opts.file);nodes.push(buildVariableDeclar(opts,_parentId,toArray));parentId=_parentId;for(i=0;i<pattern.elements.length;i++){var elem=pattern.elements[i];if(!elem)continue;i=+i;var newPatternId;if(t.isRestElement(elem)){newPatternId=opts.file.toArray(parentId);if(i>0){newPatternId=t.callExpression(t.memberExpression(newPatternId,t.identifier("slice")),[t.literal(i)])}elem=elem.argument}else{newPatternId=t.memberExpression(parentId,t.literal(i),true)}push(opts,nodes,elem,newPatternId)}};var pushPattern=function(opts){var nodes=opts.nodes;var pattern=opts.pattern;var parentId=opts.id;var scope=opts.scope;if(!t.isArrayExpression(parentId)&&!t.isMemberExpression(parentId)&&!t.isIdentifier(parentId)){var key=scope.generateUidBasedOnNode(parentId);nodes.push(buildVariableDeclar(opts,key,parentId));parentId=key}push(opts,nodes,pattern,parentId)};exports.ForInStatement=exports.ForOfStatement=function(node,parent,scope,context,file){var declar=node.left;if(!t.isVariableDeclaration(declar))return;var pattern=declar.declarations[0].id;if(!t.isPattern(pattern))return;var key=scope.generateUidIdentifier("ref");node.left=t.variableDeclaration(declar.kind,[t.variableDeclarator(key,null)]);var nodes=[];push({kind:declar.kind,file:file,scope:scope},nodes,pattern,key);t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.Function=function(node,parent,scope,context,file){var nodes=[];var hasDestructuring=false;node.params=node.params.map(function(pattern,i){if(!t.isPattern(pattern))return pattern;hasDestructuring=true;var parentId=scope.generateUidIdentifier("ref");pushPattern({blockHoist:node.params.length-i,pattern:pattern,nodes:nodes,scope:scope,file:file,kind:"var",id:parentId});return parentId});if(!hasDestructuring)return;t.ensureBlock(node);var block=node.body;block.body=nodes.concat(block.body)};exports.CatchClause=function(node,parent,scope,context,file){var pattern=node.param;if(!t.isPattern(pattern))return;var ref=scope.generateUidIdentifier("ref");node.param=ref;var nodes=[];push({kind:"var",file:file,scope:scope},nodes,pattern,ref);node.body.body=nodes.concat(node.body.body)};exports.ExpressionStatement=function(node,parent,scope,context,file){var expr=node.expression;if(expr.type!=="AssignmentExpression")return;if(!t.isPattern(expr.left))return;if(file.isConsequenceExpressionStatement(node))return;var nodes=[];var ref=scope.generateUidIdentifier("ref");nodes.push(t.variableDeclaration("var",[t.variableDeclarator(ref,expr.right)]));push({operator:expr.operator,file:file,scope:scope},nodes,expr.left,ref);return nodes};exports.AssignmentExpression=function(node,parent,scope,context,file){if(!t.isPattern(node.left))return;var ref=scope.generateUidIdentifier("temp");scope.push({key:ref.name,id:ref});var nodes=[];nodes.push(t.assignmentExpression("=",ref,node.right));push({operator:node.operator,file:file,scope:scope},nodes,node.left,ref);nodes.push(ref);return t.toSequenceExpression(nodes,scope)};exports.VariableDeclaration=function(node,parent,scope,context,file){if(t.isForInStatement(parent)||t.isForOfStatement(parent))return;var nodes=[];var i;var declar;var hasPattern=false;for(i=0;i<node.declarations.length;i++){declar=node.declarations[i];if(t.isPattern(declar.id)){hasPattern=true;break}}if(!hasPattern)return;for(i=0;i<node.declarations.length;i++){declar=node.declarations[i];var patternId=declar.init;var pattern=declar.id;var opts={pattern:pattern,nodes:nodes,scope:scope,kind:node.kind,file:file,id:patternId};if(t.isPattern(pattern)&&patternId){pushPattern(opts);if(+i!==node.declarations.length-1){t.inherits(nodes[nodes.length-1],declar)}}else{nodes.push(t.inherits(buildVariableAssign(opts,declar.id,declar.init),declar))}}if(!t.isProgram(parent)&&!t.isBlockStatement(parent)){declar=null;for(i=0;i<nodes.length;i++){node=nodes[i];declar=declar||t.variableDeclaration(node.kind,[]);if(!t.isVariableDeclaration(node)&&declar.kind!==node.kind){throw file.errorWithNode(node,"Cannot use this node within the current parent")}declar.declarations=declar.declarations.concat(node.declarations)}return declar}return nodes}},{"../../../types":101}],58:[function(require,module,exports){"use strict";var util=require("../../../util");var t=require("../../../types");exports.ForOfStatement=function(node,parent,scope,context,file){var callback=spec;if(file.isLoose("es6.forOf"))callback=loose;var build=callback(node,parent,scope,context,file);var declar=build.declar;var loop=build.loop;var block=loop.body;t.inheritsComments(loop,node);t.ensureBlock(node);if(declar){if(build.shouldUnshift){block.body.unshift(declar)}else{block.body.push(declar)}}block.body=block.body.concat(node.body.body);loop._scopeInfo=node._scopeInfo;return loop};var loose=function(node,parent,scope,context,file){var left=node.left;var declar,id;if(t.isIdentifier(left)||t.isPattern(left)){id=left}else if(t.isVariableDeclaration(left)){id=left.declarations[0].id;declar=t.variableDeclaration(left.kind,[t.variableDeclarator(id)])}else{throw file.errorWithNode(left,"Unknown node type "+left.type+" in ForOfStatement")}var loop=util.template("for-of-loose",{LOOP_OBJECT:scope.generateUidIdentifier("iterator"),IS_ARRAY:scope.generateUidIdentifier("isArray"),OBJECT:node.right,INDEX:scope.generateUidIdentifier("i"),ID:id});return{shouldUnshift:true,declar:declar,loop:loop}};var spec=function(node,parent,scope,context,file){var left=node.left;var declar;var stepKey=scope.generateUidIdentifier("step");var stepValue=t.memberExpression(stepKey,t.identifier("value"));if(t.isIdentifier(left)||t.isPattern(left)){declar=t.expressionStatement(t.assignmentExpression("=",left,stepValue))}else if(t.isVariableDeclaration(left)){declar=t.variableDeclaration(left.kind,[t.variableDeclarator(left.declarations[0].id,stepValue)])}else{throw file.errorWithNode(left,"Unknown node type "+left.type+" in ForOfStatement")}var loop=util.template("for-of",{ITERATOR_KEY:scope.generateUidIdentifier("iterator"),STEP_KEY:stepKey,OBJECT:node.right});return{declar:declar,loop:loop}}},{"../../../types":101,"../../../util":104}],59:[function(require,module,exports){"use strict";var t=require("../../../types");exports.ImportDeclaration=function(node,parent,scope,context,file){var nodes=[];if(node.specifiers.length){for(var i=0;i<node.specifiers.length;i++){file.moduleFormatter.importSpecifier(node.specifiers[i],node,nodes,parent)}}else{file.moduleFormatter.importDeclaration(node,nodes,parent)}if(nodes.length===1){nodes[0]._blockHoist=node._blockHoist}return nodes};exports.ExportDeclaration=function(node,parent,scope,context,file){var nodes=[];var i;if(node.declaration){if(t.isVariableDeclaration(node.declaration)){var declar=node.declaration.declarations[0];declar.init=declar.init||t.identifier("undefined")}file.moduleFormatter.exportDeclaration(node,nodes,parent)}else if(node.specifiers){for(i=0;i<node.specifiers.length;i++){file.moduleFormatter.exportSpecifier(node.specifiers[i],node,nodes,parent)}}if(node._blockHoist){for(i=0;i<nodes.length;i++){nodes[i]._blockHoist=node._blockHoist}}return nodes}},{"../../../types":101}],60:[function(require,module,exports){"use strict";var util=require("../../../util");var t=require("../../../types");var hasDefaults=function(node){for(var i=0;i<node.params.length;i++){if(t.isAssignmentPattern(node.params[i]))return true}return false};exports.Function=function(node,parent,scope){if(!hasDefaults(node))return;t.ensureBlock(node);var iife=false;var body=[];var argsIdentifier=t.identifier("arguments");argsIdentifier._ignoreAliasFunctions=true;var lastNonDefaultParam=0;for(var i=0;i<node.params.length;i++){var param=node.params[i];if(!t.isAssignmentPattern(param)){lastNonDefaultParam=+i+1;continue}var left=param.left;var right=param.right;node.params[i]=scope.generateUidIdentifier("x");var localDeclar=scope.get(left.name,true);if(localDeclar!==left){iife=true}var defNode=util.template("default-parameter",{VARIABLE_NAME:left,DEFAULT_VALUE:right,ARGUMENT_KEY:t.literal(+i),ARGUMENTS:argsIdentifier},true);defNode._blockHoist=node.params.length-i;body.push(defNode)}node.params=node.params.slice(0,lastNonDefaultParam);if(iife){var container=t.functionExpression(null,[],node.body,node.generator);container._aliasFunction=true;body.push(t.returnStatement(t.callExpression(container,[])));node.body=t.blockStatement(body)}else{node.body.body=body.concat(node.body.body)}}},{"../../../types":101,"../../../util":104}],61:[function(require,module,exports){"use strict";var util=require("../../../util");var t=require("../../../types");var hasRest=function(node){return t.isRestElement(node.params[node.params.length-1])};exports.Function=function(node,parent,scope){if(!hasRest(node))return;var rest=node.params.pop().argument;t.ensureBlock(node);var argsId=t.identifier("arguments");argsId._ignoreAliasFunctions=true;var start=t.literal(node.params.length);var key=scope.generateUidIdentifier("key");var len=scope.generateUidIdentifier("len");var arrKey=key;var arrLen=len;if(node.params.length){arrKey=t.binaryExpression("-",key,start);arrLen=t.conditionalExpression(t.binaryExpression(">",len,start),t.binaryExpression("-",len,start),t.literal(0))}if(t.isPattern(rest)){var pattern=rest;rest=scope.generateUidIdentifier("ref");var restDeclar=t.variableDeclaration("var",[t.variableDeclarator(pattern,rest)]);restDeclar._blockHoist=node.params.length+1;node.body.body.unshift(restDeclar)}node.body.body.unshift(util.template("rest",{ARGUMENTS:argsId,ARRAY_KEY:arrKey,ARRAY_LEN:arrLen,START:start,ARRAY:rest,KEY:key,LEN:len}))}},{"../../../types":101,"../../../util":104}],62:[function(require,module,exports){"use strict";var t=require("../../../types");exports.ObjectExpression=function(node,parent,scope,context,file){var hasComputed=false;for(var i=0;i<node.properties.length;i++){hasComputed=t.isProperty(node.properties[i],{computed:true,kind:"init"});if(hasComputed)break}if(!hasComputed)return;var initProps=[];var objId=scope.generateUidBasedOnNode(parent);var body=[];var container=t.functionExpression(null,[],t.blockStatement(body));container._aliasFunction=true;var callback=spec;if(file.isLoose("es6.properties.computed"))callback=loose;var result=callback(node,body,objId,initProps,file);if(result)return result;body.unshift(t.variableDeclaration("var",[t.variableDeclarator(objId,t.objectExpression(initProps))]));body.push(t.returnStatement(objId));return t.callExpression(container,[])};var loose=function(node,body,objId){for(var i=0;i<node.properties.length;i++){var prop=node.properties[i];body.push(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(objId,prop.key,prop.computed),prop.value)))}};var spec=function(node,body,objId,initProps,file){var props=node.properties;var prop,key;for(var i=0;i<props.length;i++){prop=props[i];if(prop.kind!=="init")continue;key=prop.key;if(!prop.computed&&t.isIdentifier(key)){prop.key=t.literal(key.name)}}var broken=false;for(i=0;i<props.length;i++){prop=props[i];if(prop.computed){broken=true}if(prop.kind!=="init"||!broken||t.isLiteral(t.toComputedKey(prop,prop.key),{value:"__proto__"})){initProps.push(prop);props[i]=null}}for(i=0;i<props.length;i++){prop=props[i];if(!prop)continue;key=prop.key;var bodyNode;if(prop.computed&&t.isMemberExpression(key)&&t.isIdentifier(key.object,{name:"Symbol"})){bodyNode=t.assignmentExpression("=",t.memberExpression(objId,key,true),prop.value)}else{bodyNode=t.callExpression(file.addHelper("define-property"),[objId,key,prop.value])}body.push(t.expressionStatement(bodyNode))}if(body.length===1){var first=body[0].expression;if(t.isCallExpression(first)){first.arguments[0]=t.objectExpression(initProps);return first}}}},{"../../../types":101}],63:[function(require,module,exports){"use strict";var nameMethod=require("../../helpers/name-method");var t=require("../../../types");var _=require("lodash");exports.Property=function(node,parent,scope,context,file){if(node.method){node.method=false;nameMethod.property(node,file,scope)}if(node.shorthand){node.shorthand=false;node.key=t.removeComments(_.clone(node.key))}}},{"../../../types":101,"../../helpers/name-method":32,lodash:164}],64:[function(require,module,exports){"use strict";var t=require("../../../types");var _=require("lodash");var getSpreadLiteral=function(spread,file){return file.toArray(spread.argument)};var hasSpread=function(nodes){for(var i=0;i<nodes.length;i++){if(t.isSpreadElement(nodes[i])){return true}}return false};var build=function(props,file){var nodes=[];var _props=[];var push=function(){if(!_props.length)return;nodes.push(t.arrayExpression(_props));_props=[]};for(var i=0;i<props.length;i++){var prop=props[i];if(t.isSpreadElement(prop)){push();nodes.push(getSpreadLiteral(prop,file))}else{_props.push(prop)}}push();return nodes};exports.ArrayExpression=function(node,parent,scope,context,file){var elements=node.elements;if(!hasSpread(elements))return;var nodes=build(elements,file);var first=nodes.shift();if(!t.isArrayExpression(first)){nodes.unshift(first);first=t.arrayExpression([])}return t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes)};exports.CallExpression=function(node,parent,scope,context,file){var args=node.arguments;if(!hasSpread(args))return;var contextLiteral=t.identifier("undefined");node.arguments=[];var nodes;if(args.length===1&&args[0].argument.name==="arguments"){nodes=[args[0].argument]}else{nodes=build(args,file)}var first=nodes.shift();if(nodes.length){node.arguments.push(t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes))}else{node.arguments.push(first)}var callee=node.callee;if(t.isMemberExpression(callee)){var temp=scope.generateTempBasedOnNode(callee.object);if(temp){callee.object=t.assignmentExpression("=",temp,callee.object);contextLiteral=temp}else{contextLiteral=callee.object}t.appendToMemberExpression(callee,t.identifier("apply"))}else{node.callee=t.memberExpression(node.callee,t.identifier("apply"))}node.arguments.unshift(contextLiteral)};exports.NewExpression=function(node,parent,scope,context,file){var args=node.arguments;if(!hasSpread(args))return;var nativeType=t.isIdentifier(node.callee)&&_.contains(t.NATIVE_TYPE_NAMES,node.callee.name);var nodes=build(args,file);if(nativeType){nodes.unshift(t.arrayExpression([t.literal(null)]))}var first=nodes.shift();if(nodes.length){args=t.callExpression(t.memberExpression(first,t.identifier("concat")),nodes)}else{args=first}if(nativeType){return t.newExpression(t.callExpression(t.memberExpression(file.addHelper("bind"),t.identifier("apply")),[node.callee,args]),[])}else{return t.callExpression(file.addHelper("apply-constructor"),[node.callee,args])}}},{"../../../types":101,lodash:164}],65:[function(require,module,exports){"use strict";var t=require("../../../types");var buildBinaryExpression=function(left,right){return t.binaryExpression("+",left,right)};exports.TaggedTemplateExpression=function(node,parent,scope,context,file){var args=[];var quasi=node.quasi;var strings=[];var raw=[];for(var i=0;i<quasi.quasis.length;i++){var elem=quasi.quasis[i];strings.push(t.literal(elem.value.cooked));raw.push(t.literal(elem.value.raw))}strings=t.arrayExpression(strings);raw=t.arrayExpression(raw);var templateName="tagged-template-literal";if(file.isLoose("es6.templateLiterals"))templateName+="-loose";args.push(t.callExpression(file.addHelper(templateName),[strings,raw]));args=args.concat(quasi.expressions);return t.callExpression(node.tag,args)};exports.TemplateLiteral=function(node){var nodes=[];var i;for(i=0;i<node.quasis.length;i++){var elem=node.quasis[i];nodes.push(t.literal(elem.value.cooked));var expr=node.expressions.shift();if(expr)nodes.push(expr)}if(nodes.length>1){var last=nodes[nodes.length-1];if(t.isLiteral(last,{value:""}))nodes.pop();var root=buildBinaryExpression(nodes.shift(),nodes.shift());for(i=0;i<nodes.length;i++){root=buildBinaryExpression(root,nodes[i])}return root}else{return nodes[0]}}},{"../../../types":101}],66:[function(require,module,exports){"use strict";var rewritePattern=require("regexpu/rewrite-pattern");var _=require("lodash");exports.Literal=function(node){var regex=node.regex;if(!regex)return;var flags=regex.flags.split("");if(regex.flags.indexOf("u")<0)return;_.pull(flags,"u");regex.pattern=rewritePattern(regex.pattern,regex.flags);regex.flags=flags.join("")}},{lodash:164,"regexpu/rewrite-pattern":180}],67:[function(require,module,exports){"use strict";var util=require("../../../util");var t=require("../../../types");exports.experimental=true;var container=function(parent,call,ret,file){if(t.isExpressionStatement(parent)&&!file.isConsequenceExpressionStatement(parent)){return call}else{var exprs=[];if(t.isSequenceExpression(call)){exprs=call.expressions}else{exprs.push(call)}exprs.push(ret);return t.sequenceExpression(exprs)}};exports.AssignmentExpression=function(node,parent,scope,context,file){var left=node.left;if(!t.isVirtualPropertyExpression(left))return;var value=node.right;var temp;if(!t.isExpressionStatement(parent)){temp=scope.generateTempBasedOnNode(node.right);if(temp)value=temp}if(node.operator!=="="){value=t.binaryExpression(node.operator[0],util.template("abstract-expression-get",{PROPERTY:node.property,OBJECT:node.object}),value)}var call=util.template("abstract-expression-set",{PROPERTY:left.property,OBJECT:left.object,VALUE:value});if(temp){call=t.sequenceExpression([t.assignmentExpression("=",temp,node.right),call])}return container(parent,call,value,file)};exports.UnaryExpression=function(node,parent,scope,context,file){var arg=node.argument;if(!t.isVirtualPropertyExpression(arg))return;if(node.operator!=="delete")return;var call=util.template("abstract-expression-delete",{PROPERTY:arg.property,OBJECT:arg.object});return container(parent,call,t.literal(true),file)};exports.CallExpression=function(node,parent,scope){var callee=node.callee;if(!t.isVirtualPropertyExpression(callee))return;var temp=scope.generateTempBasedOnNode(callee.object);var call=util.template("abstract-expression-call",{PROPERTY:callee.property,OBJECT:temp||callee.object});call.arguments=call.arguments.concat(node.arguments);if(temp){return t.sequenceExpression([t.assignmentExpression("=",temp,callee.object),call])}else{return call}};exports.VirtualPropertyExpression=function(node){return util.template("abstract-expression-get",{PROPERTY:node.property,OBJECT:node.object})};exports.PrivateDeclaration=function(node){return t.variableDeclaration("const",node.declarations.map(function(id){return t.variableDeclarator(id,t.newExpression(t.identifier("WeakMap"),[]))}))}},{"../../../types":101,"../../../util":104}],68:[function(require,module,exports){"use strict";var buildComprehension=require("../../helpers/build-comprehension");var traverse=require("../../../traverse");var util=require("../../../util");var t=require("../../../types");exports.experimental=true;exports.ComprehensionExpression=function(node,parent,scope,context,file){var callback=array;if(node.generator)callback=generator;return callback(node,parent,scope,file)};var generator=function(node){var body=[];var container=t.functionExpression(null,[],t.blockStatement(body),true);container._aliasFunction=true;body.push(buildComprehension(node,function(){return t.expressionStatement(t.yieldExpression(node.body))}));return t.callExpression(container,[])};var array=function(node,parent,scope,file){var uid=scope.generateUidBasedOnNode(parent,file);var container=util.template("array-comprehension-container",{KEY:uid});container.callee._aliasFunction=true;var block=container.callee.body;var body=block.body;if(traverse.hasType(node,scope,"YieldExpression",t.FUNCTION_TYPES)){container.callee.generator=true;container=t.yieldExpression(container,true)}var returnStatement=body.pop();body.push(buildComprehension(node,function(){return util.template("array-push",{STATEMENT:node.body,KEY:uid},true)}));body.push(returnStatement);return container}},{"../../../traverse":97,"../../../types":101,"../../../util":104,"../../helpers/build-comprehension":29}],69:[function(require,module,exports){"use strict";exports.experimental=true;var build=require("../../helpers/build-binary-assignment-operator-transformer");var t=require("../../../types");var MATH_POW=t.memberExpression(t.identifier("Math"),t.identifier("pow"));build(exports,{operator:"**",build:function(left,right){return t.callExpression(MATH_POW,[left,right])}})},{"../../../types":101,"../../helpers/build-binary-assignment-operator-transformer":28}],70:[function(require,module,exports){"use strict";var t=require("../../../types");exports.experimental=true;exports.ObjectExpression=function(node,parent,scope,context,file){var hasSpread=false;var i;var prop;for(i=0;i<node.properties.length;i++){prop=node.properties[i];if(t.isSpreadProperty(prop)){hasSpread=true;break}}if(!hasSpread)return;var args=[];var props=[];var push=function(){if(!props.length)return;args.push(t.objectExpression(props));props=[]};for(i=0;i<node.properties.length;i++){prop=node.properties[i];if(t.isSpreadProperty(prop)){push();args.push(prop.argument)}else{props.push(prop)}}push();if(!t.isObjectExpression(args[0])){args.unshift(t.objectExpression([]))}return t.callExpression(file.addHelper("extends"),args)}},{"../../../types":101}],71:[function(require,module,exports){module.exports={useStrict:require("./other/use-strict"),"validation.undeclaredVariableCheck":require("./validation/undeclared-variable-check"),"validation.noForInOfAssignment":require("./validation/no-for-in-of-assignment"),"validation.setters":require("./validation/setters"),"spec.blockScopedFunctions":require("./spec/block-scoped-functions"),"playground.malletOperator":require("./playground/mallet-operator"),"playground.methodBinding":require("./playground/method-binding"),"playground.memoizationOperator":require("./playground/memoization-operator"),"playground.objectGetterMemoization":require("./playground/object-getter-memoization"),react:require("./other/react"),_modulesSplit:require("./internal/modules-split"),"es7.comprehensions":require("./es7/comprehensions"),"es6.arrowFunctions":require("./es6/arrow-functions"),"es6.classes":require("./es6/classes"),asyncToGenerator:require("./other/async-to-generator"),bluebirdCoroutines:require("./other/bluebird-coroutines"),"es7.objectSpread":require("./es7/object-spread"),"es7.exponentiationOperator":require("./es7/exponentiation-operator"),"es6.spread":require("./es6/spread"),"es6.templateLiterals":require("./es6/template-literals"),"es5.properties.mutators":require("./es5/properties.mutators"),"es6.properties.shorthand":require("./es6/properties.shorthand"),"es6.properties.computed":require("./es6/properties.computed"),"es6.forOf":require("./es6/for-of"),"es6.unicodeRegex":require("./es6/unicode-regex"),"es7.abstractReferences":require("./es7/abstract-references"),"es6.constants":require("./es6/constants"),"es6.blockScoping":require("./es6/block-scoping"),"es6.blockScopingTDZ":require("./es6/block-scoping-tdz"),regenerator:require("./other/regenerator"),"es6.parameters.default":require("./es6/parameters.default"),"es6.parameters.rest":require("./es6/parameters.rest"),"es6.destructuring":require("./es6/destructuring"),selfContained:require("./other/self-contained"),"es6.modules":require("./es6/modules"),_blockHoist:require("./internal/block-hoist"),"spec.protoToAssign":require("./spec/proto-to-assign"),_declarations:require("./internal/declarations"),_aliasFunctions:require("./internal/alias-functions"),_moduleFormatter:require("./internal/module-formatter"),"spec.typeofSymbol":require("./spec/typeof-symbol"),"spec.undefinedToVoid":require("./spec/undefined-to-void"),"minification.propertyLiterals":require("./minification/property-literals"),"minification.memberExpressionLiterals":require("./minification/member-expression-literals")}},{"./es5/properties.mutators":51,"./es6/arrow-functions":52,"./es6/block-scoping":54,"./es6/block-scoping-tdz":53,"./es6/classes":55,"./es6/constants":56,"./es6/destructuring":57,"./es6/for-of":58,"./es6/modules":59,"./es6/parameters.default":60,"./es6/parameters.rest":61,"./es6/properties.computed":62,"./es6/properties.shorthand":63,"./es6/spread":64,"./es6/template-literals":65,"./es6/unicode-regex":66,"./es7/abstract-references":67,"./es7/comprehensions":68,"./es7/exponentiation-operator":69,"./es7/object-spread":70,"./internal/alias-functions":72,"./internal/block-hoist":73,"./internal/declarations":74,"./internal/module-formatter":75,"./internal/modules-split":76,"./minification/member-expression-literals":77,"./minification/property-literals":78,"./other/async-to-generator":79,"./other/bluebird-coroutines":80,"./other/react":81,"./other/regenerator":82,"./other/self-contained":83,"./other/use-strict":84,"./playground/mallet-operator":85,"./playground/memoization-operator":86,"./playground/method-binding":87,"./playground/object-getter-memoization":88,"./spec/block-scoped-functions":89,"./spec/proto-to-assign":90,"./spec/typeof-symbol":91,"./spec/undefined-to-void":92,"./validation/no-for-in-of-assignment":93,"./validation/setters":94,"./validation/undeclared-variable-check":95}],72:[function(require,module,exports){"use strict";var traverse=require("../../../traverse");var t=require("../../../types");var functionChildrenVisitor={enter:function(node,parent,scope,context,state){if(t.isFunction(node)&&!node._aliasFunction){return context.skip()}if(node._ignoreAliasFunctions)return context.skip();var getId;if(t.isIdentifier(node)&&node.name==="arguments"){getId=state.getArgumentsId}else if(t.isThisExpression(node)){getId=state.getThisId}else{return}if(t.isReferenced(node,parent))return getId()}};var functionVisitor={enter:function(node,parent,scope,context,state){if(!node._aliasFunction){if(t.isFunction(node)){return context.skip()}else{return}}traverse(node,functionChildrenVisitor,scope,state);return context.skip()}};var go=function(getBody,node,scope){var argumentsId;var thisId;var state={getArgumentsId:function(){return argumentsId=argumentsId||scope.generateUidIdentifier("arguments")},getThisId:function(){return thisId=thisId||scope.generateUidIdentifier("this")}};traverse(node,functionVisitor,scope,state);var body;var pushDeclaration=function(id,init){body=body||getBody();body.unshift(t.variableDeclaration("var",[t.variableDeclarator(id,init)]))};if(argumentsId){pushDeclaration(argumentsId,t.identifier("arguments"))}if(thisId){pushDeclaration(thisId,t.thisExpression())}};exports.Program=function(node,parent,scope){go(function(){return node.body},node,scope)};exports.FunctionDeclaration=exports.FunctionExpression=function(node,parent,scope){go(function(){t.ensureBlock(node);return node.body.body},node,scope)}},{"../../../traverse":97,"../../../types":101}],73:[function(require,module,exports){"use strict";var useStrict=require("../../helpers/use-strict");var _=require("lodash");exports.BlockStatement=exports.Program={exit:function(node){var hasChange=false;for(var i=0;i<node.body.length;i++){var bodyNode=node.body[i];if(bodyNode&&bodyNode._blockHoist!=null)hasChange=true}if(!hasChange)return;useStrict.wrap(node,function(){var nodePriorities=_.groupBy(node.body,function(bodyNode){var priority=bodyNode._blockHoist;if(priority==null)priority=1;if(priority===true)priority=2;return priority});node.body=_.flatten(_.values(nodePriorities).reverse())})}}},{"../../helpers/use-strict":35,lodash:164}],74:[function(require,module,exports){"use strict";var useStrict=require("../../helpers/use-strict");var t=require("../../../types");exports.secondPass=true;exports.BlockStatement=exports.Program=function(node){if(!node._declarations)return;var kinds={};var kind;useStrict.wrap(node,function(){for(var i in node._declarations){var declar=node._declarations[i];kind=declar.kind||"var";var declarNode=t.variableDeclarator(declar.id,declar.init);if(!declar.init){kinds[kind]=kinds[kind]||[];kinds[kind].push(declarNode)}else{node.body.unshift(t.variableDeclaration(kind,[declarNode]))}}for(kind in kinds){node.body.unshift(t.variableDeclaration(kind,kinds[kind]))}});node._declarations=null}},{"../../../types":101,"../../helpers/use-strict":35}],75:[function(require,module,exports){"use strict";var useStrict=require("../../helpers/use-strict");exports.ast={exit:function(ast,file){if(!file.transformers["es6.modules"].canRun())return;useStrict.wrap(ast.program,function(){ast.program.body=file.dynamicImports.concat(ast.program.body)});if(file.moduleFormatter.transform){file.moduleFormatter.transform(ast)}}}},{"../../helpers/use-strict":35}],76:[function(require,module,exports){"use strict";var t=require("../../../types");exports.ExportDeclaration=function(node,parent,scope){var declar=node.declaration;if(node.default){if(t.isClassDeclaration(declar)){node.declaration=declar.id;return[declar,node]}else if(t.isClassExpression(declar)){var temp=scope.generateUidIdentifier("default");declar=t.variableDeclaration("var",[t.variableDeclarator(temp,declar)]);node.declaration=temp;return[declar,node]}}else{if(t.isFunctionDeclaration(declar)){node.specifiers=[t.importSpecifier(declar.id,declar.id)];node.declaration=null;
node._blockHoist=2;return[declar,node]}}}},{"../../../types":101}],77:[function(require,module,exports){"use strict";var t=require("../../../types");exports.MemberExpression=function(node){var prop=node.property;if(node.computed&&t.isLiteral(prop)&&t.isValidIdentifier(prop.value)){node.property=t.identifier(prop.value);node.computed=false}else if(!node.computed&&t.isIdentifier(prop)&&!t.isValidIdentifier(prop.name)){node.property=t.literal(prop.name);node.computed=true}}},{"../../../types":101}],78:[function(require,module,exports){"use strict";var t=require("../../../types");exports.Property=function(node){var key=node.key;if(t.isLiteral(key)&&t.isValidIdentifier(key.value)){node.key=t.identifier(key.value);node.computed=false}else if(!node.computed&&t.isIdentifier(key)&&!t.isValidIdentifier(key.name)){node.key=t.literal(key.name)}}},{"../../../types":101}],79:[function(require,module,exports){"use strict";var remapAsyncToGenerator=require("../../helpers/remap-async-to-generator");var bluebirdCoroutines=require("./bluebird-coroutines");exports.optional=true;exports.manipulateOptions=bluebirdCoroutines.manipulateOptions;exports.Function=function(node,parent,scope,context,file){if(!node.async||node.generator)return;return remapAsyncToGenerator(node,file.addHelper("async-to-generator"),scope)}},{"../../helpers/remap-async-to-generator":33,"./bluebird-coroutines":80}],80:[function(require,module,exports){"use strict";var remapAsyncToGenerator=require("../../helpers/remap-async-to-generator");var t=require("../../../types");exports.manipulateOptions=function(opts){opts.experimental=true;opts.blacklist.push("regenerator")};exports.optional=true;exports.Function=function(node,parent,scope,context,file){if(!node.async||node.generator)return;return remapAsyncToGenerator(node,t.memberExpression(file.addImport("bluebird"),t.identifier("coroutine")),scope)}},{"../../../types":101,"../../helpers/remap-async-to-generator":33}],81:[function(require,module,exports){"use strict";var esutils=require("esutils");var t=require("../../../types");exports.JSXIdentifier=function(node){if(esutils.keyword.isIdentifierName(node.name)){node.type="Identifier"}else{return t.literal(node.name)}};exports.JSXNamespacedName=function(node,parent,scope,context,file){throw file.errorWithNode(node,"Namespace tags are not supported. ReactJSX is not XML.")};exports.JSXMemberExpression={exit:function(node){node.computed=t.isLiteral(node.property);node.type="MemberExpression"}};exports.JSXExpressionContainer=function(node){return node.expression};exports.JSXAttribute={exit:function(node){var value=node.value||t.literal(true);return t.inherits(t.property("init",node.name,value),node)}};var isCompatTag=function(tagName){return/^[a-z]|\-/.test(tagName)};exports.JSXOpeningElement={exit:function(node,parent,scope,context,file){var reactCompat=file.opts.reactCompat;var tagExpr=node.name;var args=[];var tagName;if(t.isIdentifier(tagExpr)){tagName=tagExpr.name}else if(t.isLiteral(tagExpr)){tagName=tagExpr.value}if(!reactCompat){if(tagName&&isCompatTag(tagName)){args.push(t.literal(tagName))}else{args.push(tagExpr)}}var attribs=node.attributes;if(attribs.length){attribs=buildJSXOpeningElementAttributes(attribs,file)}else{attribs=t.literal(null)}args.push(attribs);if(reactCompat){if(tagName&&isCompatTag(tagName)){return t.callExpression(t.memberExpression(t.memberExpression(t.identifier("React"),t.identifier("DOM")),tagExpr,t.isLiteral(tagExpr)),args)}}else{tagExpr=t.memberExpression(t.identifier("React"),t.identifier("createElement"))}return t.callExpression(tagExpr,args)}};var buildJSXOpeningElementAttributes=function(attribs,file){var _props=[];var objs=[];var pushProps=function(){if(!_props.length)return;objs.push(t.objectExpression(_props));_props=[]};while(attribs.length){var prop=attribs.shift();if(t.isJSXSpreadAttribute(prop)){pushProps();objs.push(prop.argument)}else{_props.push(prop)}}pushProps();if(objs.length===1){attribs=objs[0]}else{if(!t.isObjectExpression(objs[0])){objs.unshift(t.objectExpression([]))}attribs=t.callExpression(file.addHelper("extends"),objs)}return attribs};exports.JSXElement={exit:function(node){var callExpr=node.openingElement;for(var i=0;i<node.children.length;i++){var child=node.children[i];if(t.isLiteral(child)&&typeof child.value==="string"){cleanJSXElementLiteralChild(child,callExpr.arguments);continue}else if(t.isJSXEmptyExpression(child)){continue}callExpr.arguments.push(child)}if(callExpr.arguments.length>=3){callExpr._prettyCall=true}return t.inherits(callExpr,node)}};var cleanJSXElementLiteralChild=function(child,args){var lines=child.value.split(/\r\n|\n|\r/);for(var i=0;i<lines.length;i++){var line=lines[i];var isFirstLine=i===0;var isLastLine=i===lines.length-1;var trimmedLine=line.replace(/\t/g," ");if(!isFirstLine){trimmedLine=trimmedLine.replace(/^[ ]+/,"")}if(!isLastLine){trimmedLine=trimmedLine.replace(/[ ]+$/,"")}if(trimmedLine){args.push(t.literal(trimmedLine))}}};var isCreateClass=function(call){if(!call||!t.isCallExpression(call))return false;var callee=call.callee;if(!t.isMemberExpression(callee))return false;var obj=callee.object;if(!t.isIdentifier(obj,{name:"React"}))return false;var prop=callee.property;if(!t.isIdentifier(prop,{name:"createClass"}))return false;var args=call.arguments;if(args.length!==1)return false;var first=args[0];if(!t.isObjectExpression(first))return;return true};var addDisplayName=function(id,call){if(!isCreateClass(call))return;var props=call.arguments[0].properties;var safe=true;for(var i=0;i<props.length;i++){var prop=props[i];if(t.isIdentifier(prop.key,{name:"displayName"})){safe=false;break}}if(safe){props.unshift(t.property("init",t.identifier("displayName"),t.literal(id)))}};exports.AssignmentExpression=exports.Property=exports.VariableDeclarator=function(node){var left,right;if(t.isAssignmentExpression(node)){left=node.left;right=node.right}else if(t.isProperty(node)){left=node.key;right=node.value}else if(t.isVariableDeclarator(node)){left=node.id;right=node.init}if(t.isMemberExpression(left)){left=left.property}if(t.isIdentifier(left)){addDisplayName(left.name,right)}}},{"../../../types":101,esutils:162}],82:[function(require,module,exports){"use strict";var regenerator=require("regenerator-6to5");exports.ast={before:function(ast,file){regenerator.transform(ast,{includeRuntime:file.opts.includeRegenerator&&"if used"})}}},{"regenerator-6to5":172}],83:[function(require,module,exports){"use strict";var traverse=require("../../../traverse");var util=require("../../../util");var core=require("core-js/library");var t=require("../../../types");var _=require("lodash");var coreHas=function(node){return node.name!=="_"&&_.has(core,node.name)};var ALIASABLE_CONSTRUCTORS=["Symbol","Promise","Map","WeakMap","Set","WeakSet"];var astVisitor={enter:function(node,parent,scope,context,file){var prop;if(t.isMemberExpression(node)&&t.isReferenced(node,parent)){var obj=node.object;prop=node.property;if(!t.isReferenced(obj,node))return;if(!node.computed&&coreHas(obj)&&_.has(core[obj.name],prop.name)){context.skip();return t.prependToMemberExpression(node,file.get("coreIdentifier"))}}else if(t.isReferencedIdentifier(node,parent)&&!t.isMemberExpression(parent)&&_.contains(ALIASABLE_CONSTRUCTORS,node.name)&&!scope.get(node.name,true)){return t.memberExpression(file.get("coreIdentifier"),node)}else if(t.isCallExpression(node)){if(node.arguments.length)return;var callee=node.callee;if(!t.isMemberExpression(callee))return;if(!callee.computed)return;prop=callee.property;if(!t.isIdentifier(prop.object,{name:"Symbol"}))return;if(!t.isIdentifier(prop.property,{name:"iterator"}))return;return util.template("corejs-iterator",{CORE_ID:file.get("coreIdentifier"),VALUE:callee.object})}}};exports.optional=true;exports.ast={enter:function(ast,file){file.setDynamic("runtimeIdentifier",function(){return file.addImport("6to5-runtime/helpers","to5Helpers")});file.setDynamic("coreIdentifier",function(){return file.addImport("6to5-runtime/core-js","core")});file.setDynamic("regeneratorIdentifier",function(){return file.addImport("6to5-runtime/regenerator","regeneratorRuntime")})},after:function(ast,file){traverse(ast,astVisitor,null,file)}};exports.Identifier=function(node,parent,scope,context,file){if(node.name==="regeneratorRuntime"&&t.isReferenced(node,parent)){return file.get("regeneratorIdentifier")}}},{"../../../traverse":97,"../../../types":101,"../../../util":104,"core-js/library":154,lodash:164}],84:[function(require,module,exports){"use strict";var useStrict=require("../../helpers/use-strict");var t=require("../../../types");exports.ast={exit:function(ast){if(!useStrict.has(ast.program)){ast.program.body.unshift(t.expressionStatement(t.literal("use strict")))}}};exports.FunctionDeclaration=exports.FunctionExpression=function(node,parent,scope,context){context.skip()};exports.ThisExpression=function(node,parent,scope,context,file){throw file.errorWithNode(node,"Top level `this` is not allowed",ReferenceError)}},{"../../../types":101,"../../helpers/use-strict":35}],85:[function(require,module,exports){"use strict";var build=require("../../helpers/build-conditional-assignment-operator-transformer");var t=require("../../../types");build(exports,{is:function(node,file){var is=t.isAssignmentExpression(node)&&node.operator==="||=";if(is){var left=node.left;if(!t.isMemberExpression(left)&&!t.isIdentifier(left)){throw file.errorWithNode(left,"Expected type MemeberExpression or Identifier")}return true}},build:function(node){return t.unaryExpression("!",node,true)}})},{"../../../types":101,"../../helpers/build-conditional-assignment-operator-transformer":30}],86:[function(require,module,exports){"use strict";var build=require("../../helpers/build-conditional-assignment-operator-transformer");var t=require("../../../types");build(exports,{is:function(node){var is=t.isAssignmentExpression(node)&&node.operator==="?=";if(is)t.assertMemberExpression(node.left);return is},build:function(node,file){return t.unaryExpression("!",t.callExpression(t.memberExpression(file.addHelper("has-own"),t.identifier("call")),[node.object,node.property]),true)}})},{"../../../types":101,"../../helpers/build-conditional-assignment-operator-transformer":30}],87:[function(require,module,exports){"use strict";var t=require("../../../types");exports.BindMemberExpression=function(node,parent,scope){var object=node.object;var prop=node.property;var temp=scope.generateTempBasedOnNode(node.object);if(temp)object=temp;var call=t.callExpression(t.memberExpression(t.memberExpression(object,prop),t.identifier("bind")),[object].concat(node.arguments));if(temp){return t.sequenceExpression([t.assignmentExpression("=",temp,node.object),call])}else{return call}};exports.BindFunctionExpression=function(node,parent,scope,context,file){var buildCall=function(args){var param=scope.generateUidIdentifier("val");return t.functionExpression(null,[param],t.blockStatement([t.returnStatement(t.callExpression(t.memberExpression(param,node.callee),args))]))};var temp=scope.generateTemp(file,"args");return t.sequenceExpression([t.assignmentExpression("=",temp,t.arrayExpression(node.arguments)),buildCall(node.arguments.map(function(node,i){return t.memberExpression(temp,t.literal(i),true)}))])}},{"../../../types":101}],88:[function(require,module,exports){"use strict";var traverse=require("../../../traverse");var t=require("../../../types");var visitor={enter:function(node,parent,scope,context,state){if(t.isFunction(node))return;if(t.isReturnStatement(node)&&node.argument){node.argument=t.memberExpression(t.callExpression(state.file.addHelper("define-property"),[t.thisExpression(),state.key,node.argument]),state.key,true)}}};exports.Property=exports.MethodDefinition=function(node,parent,scope,context,file){if(node.kind!=="memo")return;node.kind="get";var value=node.value;t.ensureBlock(value);var key=node.key;if(t.isIdentifier(key)&&!node.computed){key=t.literal(key.name)}var state={key:key,file:file};traverse(value,visitor,scope,state)}},{"../../../traverse":97,"../../../types":101}],89:[function(require,module,exports){"use strict";var t=require("../../../types");exports.BlockStatement=function(node,parent){if(t.isFunction(parent)||t.isExportDeclaration(parent)){return}for(var i=0;i<node.body.length;i++){var func=node.body[i];if(!t.isFunctionDeclaration(i))continue;var declar=t.variableDeclaration("let",[t.variableDeclarator(func.id,t.toExpression(func))]);declar._blockHoist=2;func.id=null;func.body[i]=declar}}},{"../../../types":101}],90:[function(require,module,exports){"use strict";var t=require("../../../types");var _=require("lodash");var isProtoKey=function(node){return t.isLiteral(t.toComputedKey(node,node.key),{value:"__proto__"})};var isProtoAssignmentExpression=function(node){var left=node.left;return t.isMemberExpression(left)&&t.isLiteral(t.toComputedKey(left,left.property),{value:"__proto__"})};var buildDefaultsCallExpression=function(expr,ref,file){return t.expressionStatement(t.callExpression(file.addHelper("defaults"),[ref,expr.right]))};exports.optional=true;exports.secondPass=true;exports.AssignmentExpression=function(node,parent,scope,context,file){if(!isProtoAssignmentExpression(node))return;var nodes=[];var left=node.left.object;var temp=scope.generateTempBasedOnNode(node.left.object);nodes.push(t.expressionStatement(t.assignmentExpression("=",temp,left)));nodes.push(buildDefaultsCallExpression(node,temp,file));if(temp)nodes.push(temp);return t.toSequenceExpression(nodes)};exports.ExpressionStatement=function(node,parent,scope,context,file){var expr=node.expression;if(!t.isAssignmentExpression(expr,{operator:"="}))return;if(isProtoAssignmentExpression(expr)){return buildDefaultsCallExpression(expr,expr.left.object,file)}};exports.ObjectExpression=function(node,parent,scope,context,file){var proto;for(var i=0;i<node.properties.length;i++){var prop=node.properties[i];if(isProtoKey(prop)){proto=prop.value;_.pull(node.properties,prop)}}if(proto){var args=[t.objectExpression([]),proto];if(node.properties.length)args.push(node);return t.callExpression(file.addHelper("extends"),args)}}},{"../../../types":101,lodash:164}],91:[function(require,module,exports){"use strict";var t=require("../../../types");exports.optional=true;exports.UnaryExpression=function(node,parent,scope,context,file){context.skip();if(node.operator==="typeof"){var call=t.callExpression(file.addHelper("typeof"),[node.argument]);if(t.isIdentifier(node.argument)){var undefLiteral=t.literal("undefined");return t.conditionalExpression(t.binaryExpression("===",t.unaryExpression("typeof",node.argument),undefLiteral),undefLiteral,call)}else{return call}}}},{"../../../types":101}],92:[function(require,module,exports){"use strict";var t=require("../../../types");exports.optional=true;exports.Identifier=function(node,parent){if(node.name==="undefined"&&t.isReferenced(node,parent)){return t.unaryExpression("void",t.literal(0),true)}}},{"../../../types":101}],93:[function(require,module,exports){"use strict";var t=require("../../../types");exports.ForInStatement=exports.ForOfStatement=function(node,parent,scope,context,file){var left=node.left;if(t.isVariableDeclaration(left)){var declar=left.declarations[0];if(declar.init)throw file.errorWithNode(declar,"No assignments allowed in for-in/of head")}}},{"../../../types":101}],94:[function(require,module,exports){"use strict";exports.MethodDefinition=exports.Property=function(node,parent,scope,context,file){if(node.kind==="set"&&node.value.params.length!==1){throw file.errorWithNode(node.value,"Setters must have only one parameter")}}},{}],95:[function(require,module,exports){"use strict";exports.optional=true;exports.Identifier=function(node,parent,scope,context,file){if(!scope.has(node.name,true)){throw file.errorWithNode(node,"Reference to undeclared variable",ReferenceError)}}},{}],96:[function(require,module,exports){module.exports=["Set","Map","WeakMap","WeakSet","Proxy","Promise","Reflect","Symbol","System","__filename","__dirname","GLOBAL","global","module","require","Buffer","console","exports","process","setTimeout","clearTimeout","setInterval","clearInterval","setImmediate","clearImmediate","Array","Boolean","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Function","hasOwnProperty","isFinite","isNaN","JSON","Map","Math","Number","Object","Proxy","Promise","parseInt","parseFloat","RangeError","ReferenceError","RegExp","Set","String","SyntaxError","TypeError","URIError","WeakMap","WeakSet","arguments","NaN","window","self"]},{}],97:[function(require,module,exports){"use strict";module.exports=traverse;var Scope=require("./scope");var t=require("../types");var _=require("lodash");function TraversalContext(){this.shouldFlatten=false;this.shouldRemove=false;this.shouldSkip=false;this.shouldStop=false}TraversalContext.prototype.flatten=function(){this.shouldFlatten=true};TraversalContext.prototype.remove=function(){this.shouldRemove=true;this.shouldSkip=true};TraversalContext.prototype.skip=function(){this.shouldSkip=true};TraversalContext.prototype.stop=function(){this.shouldStop=true;this.shouldSkip=true};TraversalContext.prototype.reset=function(){this.shouldRemove=false;this.shouldSkip=false;this.shouldStop=false};function replaceNode(obj,key,node,result){var isArray=Array.isArray(result);var inheritTo=result;if(isArray)inheritTo=result[0];if(inheritTo)t.inheritsComments(inheritTo,node);obj[key]=result;if(isArray&&_.contains(t.STATEMENT_OR_BLOCK_KEYS,key)&&!t.isBlockStatement(obj)){t.ensureBlock(obj,key)}if(isArray){return true}}TraversalContext.prototype.enterNode=function(obj,key,node,enter,parent,scope,state){var result=enter(node,parent,scope,this,state);var flatten=false;if(result){flatten=replaceNode(obj,key,node,result);node=result;if(flatten){this.shouldFlatten=true}}if(this.shouldRemove){obj[key]=null;this.shouldFlatten=true}return node};TraversalContext.prototype.exitNode=function(obj,key,node,exit,parent,scope,state){var result=exit(node,parent,scope,this,state);var flatten=false;if(result){flatten=replaceNode(obj,key,node,result);node=result;if(flatten){this.shouldFlatten=true}}return node};TraversalContext.prototype.visitNode=function(obj,key,opts,scope,parent,state){this.reset();var node=obj[key];if(opts.blacklist&&opts.blacklist.indexOf(node.type)>-1){return}var ourScope=scope;if(t.isScope(node)){ourScope=new Scope(node,scope)}node=this.enterNode(obj,key,node,opts.enter,parent,ourScope,state);if(this.shouldSkip){return this.shouldStop}if(Array.isArray(node)){for(var i=0;i<node.length;i++){traverseNode(node[i],opts,ourScope,state)}}else{traverseNode(node,opts,ourScope,state);this.exitNode(obj,key,node,opts.exit,parent,ourScope,state)}return this.shouldStop};TraversalContext.prototype.visit=function(node,key,opts,scope,state){var nodes=node[key];if(!nodes)return;if(!Array.isArray(nodes)){return this.visitNode(node,key,opts,scope,node,state)}if(nodes.length===0){return}for(var i=0;i<nodes.length;i++){if(nodes[i]&&this.visitNode(nodes,i,opts,scope,node,state)){return true}}if(this.shouldFlatten){node[key]=_.flatten(node[key]);if(key==="body"){node[key]=_.compact(node[key])}}};function traverseNode(node,opts,scope,state){var keys=t.VISITOR_KEYS[node.type];if(!keys)return;var context=new TraversalContext;for(var i=0;i<keys.length;i++){if(context.visit(node,keys[i],opts,scope,state)){return}}}function traverse(parent,opts,scope,state){if(!parent)return;if(!scope){if(parent.type!=="Program"&&parent.type!=="File"){throw new Error("Must pass a scope unless traversing a Program/File got a "+parent.type+" node")}}if(!opts)opts={};if(!opts.enter)opts.enter=_.noop;if(!opts.exit)opts.exit=_.noop;if(Array.isArray(parent)){for(var i=0;i<parent.length;i++){traverseNode(parent[i],opts,scope,state)}}else{traverseNode(parent,opts,scope,state)}}function clearNode(node){node._declarations=null;node.extendedRange=null;node._scopeInfo=null;node.tokens=null;node.range=null;node.start=null;node.end=null;node.loc=null;node.raw=null;if(Array.isArray(node.trailingComments)){clearComments(node.trailingComments)}if(Array.isArray(node.leadingComments)){clearComments(node.leadingComments)}}var clearVisitor={enter:clearNode};function clearComments(comments){for(var i=0;i<comments.length;i++){clearNode(comments[i])}}traverse.removeProperties=function(tree){clearNode(tree);traverse(tree,clearVisitor);return tree};function hasBlacklistedType(node,parent,scope,context,state){if(node.type===state.type){state.has=true;context.skip()}}traverse.hasType=function(tree,scope,type,blacklistTypes){if(_.contains(blacklistTypes,tree.type))return false;if(tree.type===type)return true;var state={has:false,type:type};traverse(tree,{blacklist:blacklistTypes,enter:hasBlacklistedType},scope,state);return state.has}},{"../types":101,"./scope":98,lodash:164}],98:[function(require,module,exports){"use strict";module.exports=Scope;var traverse=require("./index");var object=require("../helpers/object");var t=require("../types");var _=require("lodash");var FOR_KEYS=["left","init"];function Scope(block,parent,file){this.parent=parent;this.block=block;this.file=parent?parent.file:file;var info=this.getInfo();this.references=info.references;this.declarations=info.declarations;this.declarationKinds=info.declarationKinds}Scope.defaultDeclarations=require("./global-keys");Scope.prototype._add=function(node,references,throwOnDuplicate){if(!node)return;var ids=t.getIds(node,true);for(var key in ids){var id=ids[key];if(throwOnDuplicate&&references[key]){throw this.file.errorWithNode(id,"Duplicate declaration",TypeError)}references[key]=id}};Scope.prototype.generateTemp=function(file,name){var id=file.generateUidIdentifier(name||"temp",this);this.push({key:id.name,id:id});return id};Scope.prototype.generateUidIdentifier=function(name){return this.file.generateUidIdentifier(name,this)};Scope.prototype.generateUidBasedOnNode=function(parent){var node=parent;if(t.isAssignmentExpression(parent)){node=parent.left}else if(t.isVariableDeclarator(parent)){node=parent.id}else if(t.isProperty(node)){node=node.key}var parts=[];var add=function(node){if(t.isMemberExpression(node)){add(node.object);add(node.property)}else if(t.isIdentifier(node)){parts.push(node.name)}else if(t.isLiteral(node)){parts.push(node.value)}else if(t.isCallExpression(node)){add(node.callee)}};add(node);var id=parts.join("$");id=id.replace(/^_/,"")||"ref";return this.file.generateUidIdentifier(id,this)};Scope.prototype.generateTempBasedOnNode=function(node){if(t.isIdentifier(node)&&this.has(node.name,true)){return null}var id=this.generateUidBasedOnNode(node);this.push({key:id.name,id:id});return id};var functionVariableVisitor={enter:function(node,parent,scope,context,state){if(t.isFor(node)){_.each(FOR_KEYS,function(key){var declar=node[key];if(t.isVar(declar))state.add(declar)})}if(t.isFunction(node))return context.skip();if(state.blockId&&node===state.blockId)return;if(t.isDeclaration(node)&&!t.isBlockScoped(node)){state.add(node)}}};var programReferenceVisitor={enter:function(node,parent,scope,context,add){if(t.isReferencedIdentifier(node,parent)&&!scope.has(node.name)){add(node,true)}}};var blockVariableVisitor={enter:function(node,parent,scope,context,add){if(t.isBlockScoped(node)){add(node,false,true);context.stop()}else if(t.isScope(node)){context.skip()}}};Scope.prototype.getInfo=function(){var parent=this.parent;var block=this.block;var self=this;if(block._scopeInfo)return block._scopeInfo;var info=block._scopeInfo={};var references=info.references=object();var declarations=info.declarations=object();var declarationKinds=info.declarationKinds={};var add=function(node,reference,throwOnDuplicate){self._add(node,references);if(!reference){self._add(node,declarations,throwOnDuplicate);self._add(node,declarationKinds[node.kind]=declarationKinds[node.kind]||object())}};if(parent&&t.isBlockStatement(block)&&t.isFor(parent.block)){return info}if(t.isFor(block)){_.each(FOR_KEYS,function(key){var node=block[key];if(t.isBlockScoped(node))add(node,false,true)});if(t.isBlockStatement(block.body)){block=block.body}}if(t.isBlockStatement(block)||t.isProgram(block)){traverse(block,blockVariableVisitor,this,add)}if(t.isCatchClause(block)){add(block.param)}if(t.isComprehensionExpression(block)){add(block)}if(t.isProgram(block)||t.isFunction(block)){traverse(block,functionVariableVisitor,this,{blockId:block.id,add:add})}if(t.isProgram(block)){traverse(block,programReferenceVisitor,this,add)}if(t.isFunction(block)){_.each(block.params,function(param){add(param)})}return info};Scope.prototype.push=function(opts){var block=this.block;if(t.isFor(block)||t.isCatchClause(block)||t.isFunction(block)){t.ensureBlock(block);block=block.body}if(t.isBlockStatement(block)||t.isProgram(block)){block._declarations=block._declarations||{};block._declarations[opts.key]={kind:opts.kind,id:opts.id,init:opts.init}}else{throw new TypeError("cannot add a declaration here in node type "+block.type)}};Scope.prototype.add=function(node){var scope=this.getFunctionParent();scope._add(node,scope.references)};Scope.prototype.getFunctionParent=function(){var scope=this;while(scope.parent&&!t.isFunction(scope.block)){scope=scope.parent}return scope};Scope.prototype.getAllOfKind=function(kind){var ids=object();var scope=this;do{_.defaults(ids,scope.declarationKinds[kind]);scope=scope.parent}while(scope);return ids};Scope.prototype.get=function(id,decl){return id&&(this.getOwn(id,decl)||this.parentGet(id,decl))};Scope.prototype.getOwn=function(id,decl){var refs=this.references;if(decl)refs=this.declarations;return _.has(refs,id)&&refs[id]};Scope.prototype.parentGet=function(id,decl){return this.parent&&this.parent.get(id,decl)};Scope.prototype.has=function(id,decl){return id&&(this.hasOwn(id,decl)||this.parentHas(id,decl))||_.contains(Scope.defaultDeclarations,id)};Scope.prototype.hasOwn=function(id,decl){return!!this.getOwn(id,decl)};Scope.prototype.parentHas=function(id,decl){return this.parent&&this.parent.has(id,decl)}},{"../helpers/object":25,"../types":101,"./global-keys":96,"./index":97,lodash:164}],99:[function(require,module,exports){module.exports={ExpressionStatement:["Statement"],BreakStatement:["Statement"],ContinueStatement:["Statement"],DebuggerStatement:["Statement"],DoWhileStatement:["Statement","Loop","While"],IfStatement:["Statement"],ReturnStatement:["Statement"],SwitchStatement:["Statement"],ThrowStatement:["Statement"],TryStatement:["Statement"],WhileStatement:["Statement","Loop","While"],WithStatement:["Statement"],EmptyStatement:["Statement"],LabeledStatement:["Statement"],VariableDeclaration:["Statement","Declaration"],ExportDeclaration:["Statement","Declaration"],ImportDeclaration:["Statement","Declaration"],PrivateDeclaration:["Statement","Declaration"],ArrowFunctionExpression:["Scope","Function","Expression"],FunctionDeclaration:["Statement","Declaration","Scope","Function"],FunctionExpression:["Scope","Function","Expression"],BlockStatement:["Statement","Scope"],Program:["Scope"],CatchClause:["Scope"],LogicalExpression:["Binary","Expression"],BinaryExpression:["Binary","Expression"],UnaryExpression:["UnaryLike","Expression"],SpreadProperty:["UnaryLike"],SpreadElement:["UnaryLike"],ClassDeclaration:["Statement","Declaration","Class"],ClassExpression:["Class","Expression"],ForOfStatement:["Statement","For","Scope","Loop"],ForInStatement:["Statement","For","Scope","Loop"],ForStatement:["Statement","For","Scope","Loop"],ObjectPattern:["Pattern"],ArrayPattern:["Pattern"],AssignmentPattern:["Pattern"],Property:["UserWhitespacable"],JSXElement:["UserWhitespacable","Expression"],ArrayExpression:["Expression"],AssignmentExpression:["Expression"],AwaitExpression:["Expression"],BindFunctionExpression:["Expression"],BindMemberExpression:["Expression"],CallExpression:["Expression"],ComprehensionExpression:["Expression","Scope"],ConditionalExpression:["Expression"],Identifier:["Expression"],Literal:["Expression"],MemberExpression:["Expression"],NewExpression:["Expression"],ObjectExpression:["Expression"],SequenceExpression:["Expression"],TaggedTemplateExpression:["Expression"],ThisExpression:["Expression"],UpdateExpression:["Expression"],VirtualPropertyExpression:["Expression"],JSXEmptyExpression:["Expression"],JSXMemberExpression:["Expression"],YieldExpression:["Expression"]}},{}],100:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrowFunctionExpression:["params","body"],AssignmentExpression:["operator","left","right"],BinaryExpression:["operator","left","right"],BlockStatement:["body"],CallExpression:["callee","arguments"],ConditionalExpression:["test","consequent","alternate"],ExpressionStatement:["expression"],File:["program","comments","tokens"],FunctionExpression:["id","params","body","generator"],FunctionDeclaration:["id","params","body","generator"],Identifier:["name"],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],Literal:["value"],LogicalExpression:["operator","left","right"],MemberExpression:["object","property","computed"],MethodDefinition:["key","value","computed","kind"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],Program:["body"],Property:["kind","key","value","computed"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ThrowExpression:["argument"],UnaryExpression:["operator","argument","prefix"],VariableDeclaration:["kind","declarations"],VariableDeclarator:["id","init"],WithStatement:["object","body"],YieldExpression:["argument","delegate"]}},{}],101:[function(require,module,exports){"use strict";var toFastProperties=require("../helpers/to-fast-properties");var esutils=require("esutils");var Node=require("./node");var _=require("lodash");var t=exports;t.NATIVE_TYPE_NAMES=["Array","Object","Number","Boolean","Date","Array","String"];function registerType(type,skipAliasCheck){var is=t["is"+type]=function(node,opts){return t.is(type,node,opts,skipAliasCheck)};t["assert"+type]=function(node,opts){opts=opts||{};if(!is(node,opts)){throw new Error("Expected type "+JSON.stringify(type)+" with option "+JSON.stringify(opts))}}}t.STATEMENT_OR_BLOCK_KEYS=["consequent","body"];t.VISITOR_KEYS=require("./visitor-keys");t.ALIAS_KEYS=require("./alias-keys");t.FLIPPED_ALIAS_KEYS={};_.each(t.VISITOR_KEYS,function(keys,type){registerType(type,true)});_.each(t.ALIAS_KEYS,function(aliases,type){_.each(aliases,function(alias){var types=t.FLIPPED_ALIAS_KEYS[alias]=t.FLIPPED_ALIAS_KEYS[alias]||[];types.push(type)})});_.each(t.FLIPPED_ALIAS_KEYS,function(types,type){t[type.toUpperCase()+"_TYPES"]=types;registerType(type,false)});t.is=function(type,node,opts,skipAliasCheck){if(!node)return;var typeMatches=type===node.type;if(!typeMatches&&!skipAliasCheck){var aliases=t.FLIPPED_ALIAS_KEYS[type];if(typeof aliases!=="undefined"){typeMatches=aliases.indexOf(node.type)>-1}}if(!typeMatches){return false}if(typeof opts!=="undefined"){return t.shallowEqual(node,opts)}return true};t.BUILDER_KEYS=_.defaults(require("./builder-keys"),t.VISITOR_KEYS);_.each(t.BUILDER_KEYS,function(keys,type){t[type[0].toLowerCase()+type.slice(1)]=function(){var args=arguments;var node=new Node;node.start=null;node.type=type;_.each(keys,function(key,i){node[key]=args[i]});return node}});t.toComputedKey=function(node,key){if(!node.computed){if(t.isIdentifier(key))key=t.literal(key.name)}return key};t.isFalsyExpression=function(node){if(t.isLiteral(node)){return!node.value}else if(t.isIdentifier(node)){return node.name==="undefined"}return false};t.toSequenceExpression=function(nodes,scope){var exprs=[];_.each(nodes,function(node){if(t.isExpression(node)){exprs.push(node)}if(t.isExpressionStatement(node)){exprs.push(node.expression)}else if(t.isVariableDeclaration(node)){_.each(node.declarations,function(declar){scope.push({kind:node.kind,key:declar.id.name,id:declar.id});exprs.push(t.assignmentExpression("=",declar.id,declar.init))})}});if(exprs.length===1){return exprs[0]}else{return t.sequenceExpression(exprs)
}};t.shallowEqual=function(actual,expected){var keys=Object.keys(expected);var key;for(var i=0;i<keys.length;i++){key=keys[i];if(actual[key]!==expected[key])return false}return true};t.appendToMemberExpression=function(member,append,computed){member.object=t.memberExpression(member.object,member.property,member.computed);member.property=append;member.computed=!!computed;return member};t.prependToMemberExpression=function(member,append){member.object=t.memberExpression(append,member.object);return member};t.isReferenced=function(node,parent){if(t.isProperty(parent)&&parent.key===node&&!parent.computed)return false;if(t.isFunction(parent)){if(_.contains(parent.params,node))return false;for(var i=0;i<parent.params.length;i++){var param=parent.params[i];if(param===node){return false}else if(t.isRestElement(param)&¶m.argument===node){return false}}}if(t.isMethodDefinition(parent)&&parent.key===node&&!parent.computed){return false}if(t.isCatchClause(parent)&&parent.param===node)return false;if(t.isVariableDeclarator(parent)&&parent.id===node)return false;var isMemberExpression=t.isMemberExpression(parent);var isComputedProperty=isMemberExpression&&parent.property===node&&parent.computed;var isObject=isMemberExpression&&parent.object===node;if(!isMemberExpression||isComputedProperty||isObject)return true;return false};t.isReferencedIdentifier=function(node,parent){return t.isIdentifier(node)&&t.isReferenced(node,parent)};t.isValidIdentifier=function(name){return _.isString(name)&&esutils.keyword.isIdentifierName(name)&&!esutils.keyword.isReservedWordES6(name,true)};t.toIdentifier=function(name){if(t.isIdentifier(name))return name.name;name=name+"";name=name.replace(/[^a-zA-Z0-9$_]/g,"-");name=name.replace(/^[-0-9]+/,"");name=name.replace(/[-_\s]+(.)?/g,function(match,c){return c?c.toUpperCase():""});name=name.replace(/^\_/,"");if(!t.isValidIdentifier(name)){name="_"+name}return name||"_"};t.ensureBlock=function(node,key){key=key||"body";node[key]=t.toBlock(node[key],node)};t.toStatement=function(node,ignore){if(t.isStatement(node)){return node}var mustHaveId=false;var newType;if(t.isClass(node)){mustHaveId=true;newType="ClassDeclaration"}else if(t.isFunction(node)){mustHaveId=true;newType="FunctionDeclaration"}else if(t.isAssignmentExpression(node)){return t.expressionStatement(node)}if(mustHaveId&&!node.id){newType=false}if(!newType){if(ignore){return false}else{throw new Error("cannot turn "+node.type+" to a statement")}}node.type=newType;return node};exports.toExpression=function(node){if(t.isExpressionStatement(node)){node=node.expression}if(t.isClass(node)){node.type="ClassExpression"}else if(t.isFunction(node)){node.type="FunctionExpression"}if(t.isExpression(node)){return node}else{throw new Error("cannot turn "+node.type+" to an expression")}};t.toBlock=function(node,parent){if(t.isBlockStatement(node)){return node}if(t.isEmptyStatement(node)){node=[]}if(!Array.isArray(node)){if(!t.isStatement(node)){if(t.isFunction(parent)){node=t.returnStatement(node)}else{node=t.expressionStatement(node)}}node=[node]}return t.blockStatement(node)};t.getIds=function(node,map,ignoreTypes){ignoreTypes=ignoreTypes||[];var search=[].concat(node);var ids={};while(search.length){var id=search.shift();if(!id)continue;if(_.contains(ignoreTypes,id.type))continue;var nodeKeys=t.getIds.nodes[id.type];var arrKeys=t.getIds.arrays[id.type];var i,key;if(t.isIdentifier(id)){ids[id.name]=id}else if(nodeKeys){for(i=0;i<nodeKeys.length;i++){key=nodeKeys[i];if(id[key]){search.push(id[key]);break}}}else if(arrKeys){for(i=0;i<arrKeys.length;i++){key=arrKeys[i];search=search.concat(id[key]||[])}}}if(!map)ids=_.keys(ids);return ids};t.getIds.nodes={AssignmentExpression:["left"],ImportBatchSpecifier:["name"],ImportSpecifier:["name","id"],ExportSpecifier:["name","id"],VariableDeclarator:["id"],FunctionDeclaration:["id"],ClassDeclaration:["id"],MemeberExpression:["object"],SpreadElement:["argument"],RestElement:["argument"],Property:["value"],ComprehensionBlock:["left"],AssignmentPattern:["left"]};t.getIds.arrays={PrivateDeclaration:["declarations"],ComprehensionExpression:["blocks"],ExportDeclaration:["specifiers","declaration"],ImportDeclaration:["specifiers"],VariableDeclaration:["declarations"],ArrayPattern:["elements"],ObjectPattern:["properties"]};t.isLet=function(node){return t.isVariableDeclaration(node)&&(node.kind!=="var"||node._let)};t.isBlockScoped=function(node){return t.isFunctionDeclaration(node)||t.isLet(node)};t.isVar=function(node){return t.isVariableDeclaration(node,{kind:"var"})&&!node._let};t.COMMENT_KEYS=["leadingComments","trailingComments"];t.removeComments=function(child){_.each(t.COMMENT_KEYS,function(key){delete child[key]});return child};t.inheritsComments=function(child,parent){_.each(t.COMMENT_KEYS,function(key){child[key]=_.uniq(_.compact([].concat(child[key],parent[key])))});return child};t.inherits=function(child,parent){child.range=parent.range;child.start=parent.start;child.loc=parent.loc;child.end=parent.end;t.inheritsComments(child,parent);return child};t.getLastStatements=function(node){var nodes=[];var add=function(node){nodes=nodes.concat(t.getLastStatements(node))};if(t.isIfStatement(node)){add(node.consequent);add(node.alternate)}else if(t.isFor(node)||t.isWhile(node)){add(node.body)}else if(t.isProgram(node)||t.isBlockStatement(node)){add(node.body[node.body.length-1])}else if(node){nodes.push(node)}return nodes};t.getSpecifierName=function(specifier){return specifier.name||specifier.id};t.getSpecifierId=function(specifier){if(specifier.default){return t.identifier("default")}else{return specifier.id}};t.isSpecifierDefault=function(specifier){return specifier.default||t.isIdentifier(specifier.id)&&specifier.id.name==="default"};toFastProperties(t);toFastProperties(t.VISITOR_KEYS)},{"../helpers/to-fast-properties":26,"./alias-keys":99,"./builder-keys":100,"./node":102,"./visitor-keys":103,esutils:162,lodash:164}],102:[function(require,module,exports){"use strict";module.exports=Node;var acorn=require("acorn-6to5");var oldNode=acorn.Node;acorn.Node=Node;function Node(){oldNode.apply(this)}},{"acorn-6to5":105}],103:[function(require,module,exports){module.exports={ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],AwaitExpression:["argument"],BinaryExpression:["left","right"],BindFunctionExpression:["callee","arguments"],BindMemberExpression:["object","property","arguments"],BlockStatement:["body"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right","body"],ComprehensionExpression:["filter","blocks","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportBatchSpecifier:["id"],ImportDeclaration:["specifiers","source"],ImportSpecifier:["id","name"],LabeledStatement:["label","body"],Literal:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateDeclaration:["declarations"],Program:["body"],Property:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SpreadProperty:["argument"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],VirtualPropertyExpression:["object","property"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"],AnyTypeAnnotation:[],ArrayTypeAnnotation:[],BooleanTypeAnnotation:[],ClassProperty:["key"],DeclareClass:[],DeclareFunction:[],DeclareModule:[],DeclareVariable:[],FunctionTypeAnnotation:[],FunctionTypeParam:[],GenericTypeAnnotation:[],InterfaceExtends:[],InterfaceDeclaration:[],IntersectionTypeAnnotation:[],NullableTypeAnnotation:[],NumberTypeAnnotation:[],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],TupleTypeAnnotation:[],TypeofTypeAnnotation:[],TypeAlias:[],TypeAnnotation:[],TypeParameterDeclaration:[],TypeParameterInstantiation:[],ObjectTypeAnnotation:[],ObjectTypeCallProperty:[],ObjectTypeIndexer:[],ObjectTypeProperty:[],QualifiedTypeIdentifier:[],UnionTypeAnnotation:[],VoidTypeAnnotation:[],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","closingElement","children"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes"],JSXSpreadAttribute:["argument"]}},{}],104:[function(require,module,exports){(function(Buffer,__dirname){"use strict";require("./patch");var estraverse=require("estraverse");var codeFrame=require("./helpers/code-frame");var traverse=require("./traverse");var acorn=require("acorn-6to5");var path=require("path");var util=require("util");var fs=require("fs");var t=require("./types");var _=require("lodash");exports.inherits=util.inherits;exports.canCompile=function(filename,altExts){var exts=altExts||exports.canCompile.EXTENSIONS;var ext=path.extname(filename);return _.contains(exts,ext)};exports.canCompile.EXTENSIONS=[".js",".jsx",".es6",".es"];exports.isInteger=function(i){return _.isNumber(i)&&i%1===0};exports.resolve=function(loc){try{return require.resolve(loc)}catch(err){return null}};exports.trimRight=function(str){return str.replace(/[\n\s]+$/g,"")};exports.list=function(val){return val?val.split(","):[]};exports.regexify=function(val){if(!val)return new RegExp(/.^/);if(Array.isArray(val))val=val.join("|");if(_.isString(val))return new RegExp(val);if(_.isRegExp(val))return val;throw new TypeError("illegal type for regexify")};exports.arrayify=function(val){if(!val)return[];if(_.isString(val))return exports.list(val);if(Array.isArray(val))return val;throw new TypeError("illegal type for arrayify")};exports.isAbsolute=function(loc){if(!loc)return false;if(loc[0]==="/")return true;if(loc[1]===":"&&loc[2]==="\\")return true;return false};exports.sourceMapToComment=function(map){var json=JSON.stringify(map);var base64=new Buffer(json).toString("base64");return"//# sourceMappingURL=data:application/json;base64,"+base64};exports.pushMutatorMap=function(mutatorMap,key,kind,computed,method){var alias;if(t.isIdentifier(key)){alias=key.name;if(computed)alias="computed:"+alias}else if(t.isLiteral(key)){alias=String(key.value)}else{alias=JSON.stringify(traverse.removeProperties(_.cloneDeep(key)))}var map;if(_.has(mutatorMap,alias)){map=mutatorMap[alias]}else{map={}}mutatorMap[alias]=map;map._key=key;if(computed){map._computed=true}map[kind]=method};exports.buildDefineProperties=function(mutatorMap){var objExpr=t.objectExpression([]);_.each(mutatorMap,function(map){var mapNode=t.objectExpression([]);var propNode=t.property("init",map._key,mapNode,map._computed);if(!map.get&&!map.set){map.writable=t.literal(true)}map.enumerable=t.literal(true);map.configurable=t.literal(true);_.each(map,function(node,key){if(key[0]==="_")return;node=_.clone(node);var inheritNode=node;if(t.isMethodDefinition(node))node=node.value;var prop=t.property("init",t.identifier(key),node);t.inheritsComments(prop,inheritNode);t.removeComments(inheritNode);mapNode.properties.push(prop)});objExpr.properties.push(propNode)});return objExpr};var templateVisitor={enter:function(node,parent,scope,context,nodes){if(t.isIdentifier(node)&&_.has(nodes,node.name)){return nodes[node.name]}}};exports.template=function(name,nodes,keepExpression){var template=exports.templates[name];if(!template)throw new ReferenceError("unknown template "+name);if(nodes===true){keepExpression=true;nodes=null}template=_.cloneDeep(template);if(!_.isEmpty(nodes)){traverse(template,templateVisitor,null,nodes)}var node=template.body[0];if(!keepExpression&&t.isExpressionStatement(node)){return node.expression}else{return node}};exports.repeat=function(width,cha){cha=cha||" ";var result="";for(var i=0;i<width;i++){result+=cha}return result};exports.normaliseAst=function(ast,comments,tokens){if(ast&&ast.type==="Program"){return t.file(ast,comments||[],tokens||[])}else{throw new Error("Not a valid ast?")}};exports.parse=function(opts,code,callback){try{var comments=[];var tokens=[];var ast=acorn.parse(code,{allowImportExportEverywhere:opts.allowImportExportEverywhere,allowReturnOutsideFunction:true,ecmaVersion:opts.experimental?7:6,playground:opts.playground,strictMode:true,onComment:comments,locations:true,onToken:tokens,ranges:true});estraverse.attachComments(ast,comments,tokens);ast=exports.normaliseAst(ast,comments,tokens);if(callback){return callback(ast)}else{return ast}}catch(err){if(!err._6to5){err._6to5=true;var message=opts.filename+": "+err.message;var loc=err.loc;if(loc){var frame=codeFrame(code,loc.line,loc.column+1);message+=frame}if(err.stack)err.stack=err.stack.replace(err.message,message);err.message=message}throw err}};exports.parseTemplate=function(loc,code){var ast=exports.parse({filename:loc},code).program;return traverse.removeProperties(ast)};var loadTemplates=function(){var templates={};var templatesLoc=__dirname+"/transformation/templates";if(!fs.existsSync(templatesLoc)){throw new Error("no templates directory - this is most likely the "+"result of a broken `npm publish`. Please report to "+"https://github.com/6to5/6to5/issues")}_.each(fs.readdirSync(templatesLoc),function(name){if(name[0]===".")return;var key=path.basename(name,path.extname(name));var loc=templatesLoc+"/"+name;var code=fs.readFileSync(loc,"utf8");templates[key]=exports.parseTemplate(loc,code)});return templates};try{exports.templates=require("../../templates.json")}catch(err){if(err.code!=="MODULE_NOT_FOUND")throw err;exports.templates=loadTemplates()}}).call(this,require("buffer").Buffer,"/lib/6to5")},{"../../templates.json":194,"./helpers/code-frame":24,"./patch":27,"./traverse":97,"./types":101,"acorn-6to5":105,buffer:122,estraverse:158,fs:120,lodash:164,path:129,util:145}],105:[function(require,module,exports){(function(root,mod){if(typeof exports=="object"&&typeof module=="object")return mod(exports);if(typeof define=="function"&&define.amd)return define(["exports"],mod);mod(root.acorn||(root.acorn={}))})(this,function(exports){"use strict";exports.version="0.11.1";var options,input,inputLen,sourceFile;exports.parse=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();var startPos=options.locations?[tokPos,curPosition()]:tokPos;initParserState();return parseTopLevel(options.program||startNodeAt(startPos))};var defaultOptions=exports.defaultOptions={playground:false,ecmaVersion:5,strictSemicolons:false,allowTrailingCommas:true,forbidReserved:false,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowHashBang:false,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false};exports.parseExpressionAt=function(inpt,pos,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState(pos);initParserState();return parseExpression()};var isArray=function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};function setOptions(opts){options={};for(var opt in defaultOptions)options[opt]=opts&&has(opts,opt)?opts[opt]:defaultOptions[opt];sourceFile=options.sourceFile||null;if(isArray(options.onToken)){var tokens=options.onToken;options.onToken=function(token){tokens.push(token)}}if(isArray(options.onComment)){var comments=options.onComment;options.onComment=function(block,text,start,end,startLoc,endLoc){var comment={type:block?"Block":"Line",value:text,start:start,end:end};if(options.locations){comment.loc=new SourceLocation;comment.loc.start=startLoc;comment.loc.end=endLoc}if(options.ranges)comment.range=[start,end];comments.push(comment)}}if(options.strictMode){strict=true}if(options.ecmaVersion>=6){isKeyword=isEcma6Keyword}else{isKeyword=isEcma5AndLessKeyword}}var getLineInfo=exports.getLineInfo=function(input,offset){for(var line=1,cur=0;;){lineBreak.lastIndex=cur;var match=lineBreak.exec(input);if(match&&match.index<offset){++line;cur=match.index+match[0].length}else break}return{line:line,column:offset-cur}};function Token(){this.type=tokType;this.value=tokVal;this.start=tokStart;this.end=tokEnd;if(options.locations){this.loc=new SourceLocation;this.loc.end=tokEndLoc}if(options.ranges)this.range=[tokStart,tokEnd]}exports.Token=Token;exports.tokenize=function(inpt,opts){input=String(inpt);inputLen=input.length;setOptions(opts);initTokenState();skipSpace();function getToken(){lastEnd=tokEnd;readToken();return new Token}getToken.jumpTo=function(pos,exprAllowed){tokPos=pos;if(options.locations){tokCurLine=1;tokLineStart=lineBreak.lastIndex=0;var match;while((match=lineBreak.exec(input))&&match.index<pos){++tokCurLine;tokLineStart=match.index+match[0].length}}tokExprAllowed=!!exprAllowed;skipSpace()};getToken.current=function(){return new Token};if(typeof Symbol!=="undefined"){getToken[Symbol.iterator]=function(){return{next:function(){var token=getToken();return{done:token.type===_eof,value:token}}}}}getToken.options=options;return getToken};var tokPos;var tokStart,tokEnd;var tokStartLoc,tokEndLoc;var tokType,tokVal;var tokContext,tokExprAllowed;var tokCurLine,tokLineStart;var lastStart,lastEnd,lastEndLoc;var inFunction,inGenerator,inAsync,labels,strict,inXJSChild,inXJSTag,inType;function initParserState(){lastStart=lastEnd=tokPos;if(options.locations)lastEndLoc=curPosition();inFunction=inGenerator=inAsync=false;labels=[];skipSpace();readToken()}function raise(pos,message){var loc=getLineInfo(input,pos);message+=" ("+loc.line+":"+loc.column+")";var err=new SyntaxError(message);err.pos=pos;err.loc=loc;err.raisedAt=tokPos;throw err}var empty=[];var _num={type:"num"},_regexp={type:"regexp"},_string={type:"string"};var _name={type:"name"},_eof={type:"eof"};var _jsxName={type:"jsxName"};var _xjsName={type:"xjsName"},_xjsText={type:"xjsText"};var _break={keyword:"break"},_case={keyword:"case",beforeExpr:true},_catch={keyword:"catch"};var _continue={keyword:"continue"},_debugger={keyword:"debugger"},_default={keyword:"default"};var _do={keyword:"do",isLoop:true},_else={keyword:"else",beforeExpr:true};var _finally={keyword:"finally"},_for={keyword:"for",isLoop:true},_function={keyword:"function"};var _if={keyword:"if"},_return={keyword:"return",beforeExpr:true},_switch={keyword:"switch"};var _throw={keyword:"throw",beforeExpr:true},_try={keyword:"try"},_var={keyword:"var"};var _let={keyword:"let"},_const={keyword:"const"};var _while={keyword:"while",isLoop:true},_with={keyword:"with"},_new={keyword:"new",beforeExpr:true};var _this={keyword:"this"};var _class={keyword:"class"},_extends={keyword:"extends",beforeExpr:true};var _export={keyword:"export"},_import={keyword:"import"};var _yield={keyword:"yield",beforeExpr:true};var _null={keyword:"null",atomValue:null},_true={keyword:"true",atomValue:true};var _false={keyword:"false",atomValue:false};var _in={keyword:"in",binop:7,beforeExpr:true};var keywordTypes={"break":_break,"case":_case,"catch":_catch,"continue":_continue,"debugger":_debugger,"default":_default,"do":_do,"else":_else,"finally":_finally,"for":_for,"function":_function,"if":_if,"return":_return,"switch":_switch,"throw":_throw,"try":_try,"var":_var,let:_let,"const":_const,"while":_while,"with":_with,"null":_null,"true":_true,"false":_false,"new":_new,"in":_in,"instanceof":{keyword:"instanceof",binop:7,beforeExpr:true},"this":_this,"typeof":{keyword:"typeof",prefix:true,beforeExpr:true},"void":{keyword:"void",prefix:true,beforeExpr:true},"delete":{keyword:"delete",prefix:true,beforeExpr:true},"class":_class,"extends":_extends,"export":_export,"import":_import,"yield":_yield};var _bracketL={type:"[",beforeExpr:true},_bracketR={type:"]"},_braceL={type:"{",beforeExpr:true};var _braceR={type:"}"},_parenL={type:"(",beforeExpr:true},_parenR={type:")"};var _comma={type:",",beforeExpr:true},_semi={type:";",beforeExpr:true};var _colon={type:":",beforeExpr:true},_dot={type:"."},_question={type:"?",beforeExpr:true};var _arrow={type:"=>",beforeExpr:true},_template={type:"template"};var _ellipsis={type:"...",beforeExpr:true};var _backQuote={type:"`"},_dollarBraceL={type:"${",beforeExpr:true};var _jsxText={type:"jsxText"};var _paamayimNekudotayim={type:"::",beforeExpr:true};var _at={type:"@"};var _hash={type:"#"};var _slash={binop:10,beforeExpr:true},_eq={isAssign:true,beforeExpr:true};var _assign={isAssign:true,beforeExpr:true};var _incDec={postfix:true,prefix:true,isUpdate:true},_prefix={prefix:true,beforeExpr:true};var _logicalOR={binop:1,beforeExpr:true};var _logicalAND={binop:2,beforeExpr:true};var _bitwiseOR={binop:3,beforeExpr:true};var _bitwiseXOR={binop:4,beforeExpr:true};var _bitwiseAND={binop:5,beforeExpr:true};var _equality={binop:6,beforeExpr:true};var _relational={binop:7,beforeExpr:true};var _bitShift={binop:8,beforeExpr:true};var _plusMin={binop:9,prefix:true,beforeExpr:true};var _modulo={binop:10,beforeExpr:true};var _star={binop:10,beforeExpr:true};var _exponent={binop:11,beforeExpr:true,rightAssociative:true};var _jsxTagStart={type:"jsxTagStart"},_jsxTagEnd={type:"jsxTagEnd"};exports.tokTypes={bracketL:_bracketL,bracketR:_bracketR,braceL:_braceL,braceR:_braceR,parenL:_parenL,parenR:_parenR,comma:_comma,semi:_semi,colon:_colon,dot:_dot,ellipsis:_ellipsis,question:_question,slash:_slash,eq:_eq,name:_name,eof:_eof,num:_num,regexp:_regexp,string:_string,paamayimNekudotayim:_paamayimNekudotayim,exponent:_exponent,at:_at,hash:_hash,arrow:_arrow,template:_template,star:_star,assign:_assign,backQuote:_backQuote,dollarBraceL:_dollarBraceL};for(var kw in keywordTypes)exports.tokTypes["_"+kw]=keywordTypes[kw];var isReservedWord3=function anonymous(str){switch(str.length){case 6:switch(str){case"double":case"export":case"import":case"native":case"public":case"static":case"throws":return true}return false;case 4:switch(str){case"byte":case"char":case"enum":case"goto":case"long":return true}return false;case 5:switch(str){case"class":case"final":case"float":case"short":case"super":return true}return false;case 7:switch(str){case"boolean":case"extends":case"package":case"private":return true}return false;case 9:switch(str){case"interface":case"protected":case"transient":return true}return false;case 8:switch(str){case"abstract":case"volatile":return true}return false;case 10:return str==="implements";case 3:return str==="int";case 12:return str==="synchronized"}};var isReservedWord5=function anonymous(str){switch(str.length){case 5:switch(str){case"class":case"super":case"const":return true}return false;case 6:switch(str){case"export":case"import":return true}return false;case 4:return str==="enum";case 7:return str==="extends"}};var isStrictReservedWord=function anonymous(str){switch(str.length){case 9:switch(str){case"interface":case"protected":return true}return false;case 7:switch(str){case"package":case"private":return true}return false;case 6:switch(str){case"public":case"static":return true}return false;case 10:return str==="implements";case 3:return str==="let";case 5:return str==="yield"}};var isStrictBadIdWord=function anonymous(str){switch(str){case"eval":case"arguments":return true}return false};var ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";var isEcma5AndLessKeyword=function anonymous(str){switch(str.length){case 4:switch(str){case"case":case"else":case"with":case"null":case"true":case"void":case"this":return true}return false;case 5:switch(str){case"break":case"catch":case"throw":case"while":case"false":return true}return false;case 3:switch(str){case"for":case"try":case"var":case"new":return true}return false;case 6:switch(str){case"return":case"switch":case"typeof":case"delete":return true}return false;case 8:switch(str){case"continue":case"debugger":case"function":return true}return false;case 2:switch(str){case"do":case"if":case"in":return true}return false;case 7:switch(str){case"default":case"finally":return true}return false;case 10:return str==="instanceof"}};var ecma6AndLessKeywords=ecma5AndLessKeywords+" let const class extends export import yield";var isEcma6Keyword=function anonymous(str){switch(str.length){case 5:switch(str){case"break":case"catch":case"throw":case"while":case"false":case"const":case"class":case"yield":return true}return false;case 4:switch(str){case"case":case"else":case"with":case"null":case"true":case"void":case"this":return true}return false;case 6:switch(str){case"return":case"switch":case"typeof":case"delete":case"export":case"import":return true}return false;case 3:switch(str){case"for":case"try":case"var":case"new":case"let":return true}return false;case 8:switch(str){case"continue":case"debugger":case"function":return true}return false;case 7:switch(str){case"default":case"finally":case"extends":return true}return false;case 2:switch(str){case"do":case"if":case"in":return true}return false;case 10:return str==="instanceof"}};var isKeyword=isEcma5AndLessKeyword;var nonASCIIwhitespace=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;var nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";var nonASCIIidentifierChars="̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧙ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_";var nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]");var nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");var decimalNumber=/^\d+$/;var hexNumber=/^[\da-fA-F]+$/;var newline=/[\n\r\u2028\u2029]/;function isNewLine(code){return code===10||code===13||code===8232||code==8233}var lineBreak=/\r\n|[\n\r\u2028\u2029]/g;var isIdentifierStart=exports.isIdentifierStart=function(code){if(code<65)return code===36;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifierStart.test(String.fromCharCode(code))};var isIdentifierChar=exports.isIdentifierChar=function(code){if(code<48)return code===36;if(code<58)return true;if(code<65)return false;if(code<91)return true;if(code<97)return code===95;if(code<123)return true;return code>=170&&nonASCIIidentifier.test(String.fromCharCode(code))};function Position(line,col){this.line=line;this.column=col}Position.prototype.offset=function(n){return new Position(this.line,this.column+n)};function curPosition(){return new Position(tokCurLine,tokPos-tokLineStart)}function initTokenState(pos){if(pos){tokPos=pos;tokLineStart=Math.max(0,input.lastIndexOf("\n",pos));tokCurLine=input.slice(0,tokLineStart).split(newline).length}else{tokCurLine=1;tokPos=tokLineStart=0}tokType=_eof;tokContext=[b_stat];tokExprAllowed=true;inType=strict=false;if(tokPos===0&&options.allowHashBang&&input.slice(0,2)==="#!"){skipLineComment(2)}}var b_stat={token:"{",isExpr:false},b_expr={token:"{",isExpr:true},b_tmpl={token:"${",isExpr:true};var p_stat={token:"(",isExpr:false},p_expr={token:"(",isExpr:true};var q_tmpl={token:"`",isExpr:true},f_expr={token:"function",isExpr:true};var j_oTag={token:"<tag",isExpr:false},j_cTag={token:"</tag",isExpr:false},j_expr={token:"<tag>...</tag>",isExpr:true};function curTokContext(){return tokContext[tokContext.length-1]}function braceIsBlock(prevType){var parent;if(prevType===_colon&&(parent=curTokContext()).token=="{")return!parent.isExpr;if(prevType===_return)return newline.test(input.slice(lastEnd,tokStart));if(prevType===_else||prevType===_semi||prevType===_eof)return true;if(prevType==_braceL)return curTokContext()===b_stat;return!tokExprAllowed}function finishToken(type,val){tokEnd=tokPos;if(options.locations)tokEndLoc=curPosition();var prevType=tokType,preserveSpace=false;tokType=type;tokVal=val;if(type===_parenR||type===_braceR){var out=tokContext.pop();if(out===b_tmpl){preserveSpace=tokExprAllowed=true}else if(out===b_stat&&curTokContext()===f_expr){tokContext.pop();tokExprAllowed=false}else{tokExprAllowed=!(out&&out.isExpr)}}else if(type===_braceL){switch(curTokContext()){case j_oTag:tokContext.push(b_expr);break;case j_expr:tokContext.push(b_tmpl);break;default:tokContext.push(braceIsBlock(prevType)?b_stat:b_expr)}tokExprAllowed=true}else if(type===_dollarBraceL){tokContext.push(b_tmpl);tokExprAllowed=true}else if(type==_parenL){var statementParens=prevType===_if||prevType===_for||prevType===_with||prevType===_while;tokContext.push(statementParens?p_stat:p_expr);tokExprAllowed=true}else if(type==_incDec){}else if(type.keyword&&prevType==_dot){tokExprAllowed=false}else if(type==_function){if(curTokContext()!==b_stat){tokContext.push(f_expr)}tokExprAllowed=false}else if(type===_backQuote){if(curTokContext()===q_tmpl){tokContext.pop()}else{tokContext.push(q_tmpl);preserveSpace=true}tokExprAllowed=false}else if(type===_jsxTagStart){tokContext.push(j_expr);tokContext.push(j_oTag);tokExprAllowed=false}else if(type===_jsxTagEnd){var out=tokContext.pop();if(out===j_oTag&&prevType===_slash||out===j_cTag){tokContext.pop();preserveSpace=tokExprAllowed=curTokContext()===j_expr}else{preserveSpace=tokExprAllowed=true}}else if(type===_jsxText){preserveSpace=tokExprAllowed=true}else if(type===_slash&&prevType===_jsxTagStart){tokContext.length-=2;tokContext.push(j_cTag);tokExprAllowed=false}else{tokExprAllowed=type.beforeExpr}if(!preserveSpace)skipSpace()}function skipBlockComment(){var startLoc=options.onComment&&options.locations&&curPosition();var start=tokPos,end=input.indexOf("*/",tokPos+=2);if(end===-1)raise(tokPos-2,"Unterminated comment");tokPos=end+2;if(options.locations){lineBreak.lastIndex=start;
var match;while((match=lineBreak.exec(input))&&match.index<tokPos){++tokCurLine;tokLineStart=match.index+match[0].length}}if(options.onComment)options.onComment(true,input.slice(start+2,end),start,tokPos,startLoc,options.locations&&curPosition())}function skipLineComment(startSkip){var start=tokPos;var startLoc=options.onComment&&options.locations&&curPosition();var ch=input.charCodeAt(tokPos+=startSkip);while(tokPos<inputLen&&ch!==10&&ch!==13&&ch!==8232&&ch!==8233){++tokPos;ch=input.charCodeAt(tokPos)}if(options.onComment)options.onComment(false,input.slice(start+startSkip,tokPos),start,tokPos,startLoc,options.locations&&curPosition())}function skipSpace(){while(tokPos<inputLen){var ch=input.charCodeAt(tokPos);if(ch===32){++tokPos}else if(ch===13){++tokPos;var next=input.charCodeAt(tokPos);if(next===10){++tokPos}if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch===10||ch===8232||ch===8233){++tokPos;if(options.locations){++tokCurLine;tokLineStart=tokPos}}else if(ch>8&&ch<14){++tokPos}else if(ch===47){var next=input.charCodeAt(tokPos+1);if(next===42){skipBlockComment()}else if(next===47){skipLineComment(2)}else break}else if(ch===160){++tokPos}else if(ch>=5760&&nonASCIIwhitespace.test(String.fromCharCode(ch))){++tokPos}else{break}}}function readToken_dot(){var next=input.charCodeAt(tokPos+1);if(next>=48&&next<=57)return readNumber(true);var next2=input.charCodeAt(tokPos+2);if(options.playground&&next===63){tokPos+=2;return finishToken(_dotQuestion)}else if(options.ecmaVersion>=6&&next===46&&next2===46){tokPos+=3;return finishToken(_ellipsis)}else{++tokPos;return finishToken(_dot)}}function readToken_slash(){var next=input.charCodeAt(tokPos+1);if(tokExprAllowed){++tokPos;return readRegexp()}if(next===61)return finishOp(_assign,2);return finishOp(_slash,1)}function readToken_modulo(){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(_modulo,1)}function readToken_mult(){var type=_star;var width=1;var next=input.charCodeAt(tokPos+1);if(options.ecmaVersion>=7&&next===42){width++;next=input.charCodeAt(tokPos+2);type=_exponent}if(next===61){width++;type=_assign}return finishOp(type,width)}function readToken_pipe_amp(code){var next=input.charCodeAt(tokPos+1);if(next===code){if(options.playground&&input.charCodeAt(tokPos+2)===61)return finishOp(_assign,3);return finishOp(code===124?_logicalOR:_logicalAND,2)}if(next===61)return finishOp(_assign,2);return finishOp(code===124?_bitwiseOR:_bitwiseAND,1)}function readToken_caret(){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_assign,2);return finishOp(_bitwiseXOR,1)}function readToken_plus_min(code){var next=input.charCodeAt(tokPos+1);if(next===code){if(next==45&&input.charCodeAt(tokPos+2)==62&&newline.test(input.slice(lastEnd,tokPos))){skipLineComment(3);skipSpace();return readToken()}return finishOp(_incDec,2)}if(next===61)return finishOp(_assign,2);return finishOp(_plusMin,1)}function readToken_lt_gt(code){var next=input.charCodeAt(tokPos+1);var size=1;if(!inType&&next===code){size=code===62&&input.charCodeAt(tokPos+2)===62?3:2;if(input.charCodeAt(tokPos+size)===61)return finishOp(_assign,size+1);return finishOp(_bitShift,size)}if(next==33&&code==60&&input.charCodeAt(tokPos+2)==45&&input.charCodeAt(tokPos+3)==45){skipLineComment(4);skipSpace();return readToken()}if(!inType){if(tokExprAllowed&&code===60){++tokPos;return finishToken(_jsxTagStart)}if(code===62){var context=curTokContext();if(context===j_oTag||context===j_cTag){++tokPos;return finishToken(_jsxTagEnd)}}}if(next===61)size=input.charCodeAt(tokPos+2)===61?3:2;return finishOp(_relational,size)}function readToken_eq_excl(code){var next=input.charCodeAt(tokPos+1);if(next===61)return finishOp(_equality,input.charCodeAt(tokPos+2)===61?3:2);if(code===61&&next===62&&options.ecmaVersion>=6){tokPos+=2;return finishToken(_arrow)}return finishOp(code===61?_eq:_prefix,1)}function getTemplateToken(code){if(tokType===_string){if(code===96){++tokPos;return finishToken(_bquote)}else if(code===36&&input.charCodeAt(tokPos+1)===123){tokPos+=2;return finishToken(_dollarBraceL)}}return readTmplString()}function getTokenFromCode(code){switch(code){case 46:return readToken_dot();case 40:++tokPos;return finishToken(_parenL);case 41:++tokPos;return finishToken(_parenR);case 59:++tokPos;return finishToken(_semi);case 44:++tokPos;return finishToken(_comma);case 91:++tokPos;return finishToken(_bracketL);case 93:++tokPos;return finishToken(_bracketR);case 123:++tokPos;return finishToken(_braceL);case 125:++tokPos;return finishToken(_braceR);case 63:++tokPos;return finishToken(_question);case 64:if(options.playground){++tokPos;return finishToken(_at)}case 35:if(options.playground){++tokPos;return finishToken(_hash)}case 58:++tokPos;if(options.ecmaVersion>=7){var next=input.charCodeAt(tokPos);if(next===58){++tokPos;return finishToken(_paamayimNekudotayim)}}return finishToken(_colon);case 96:if(options.ecmaVersion>=6){++tokPos;return finishToken(_backQuote)}else{return false}case 48:var next=input.charCodeAt(tokPos+1);if(next===120||next===88)return readRadixNumber(16);if(options.ecmaVersion>=6){if(next===111||next===79)return readRadixNumber(8);if(next===98||next===66)return readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return readNumber(false);case 34:case 39:return inXJSTag?readXJSStringLiteral():readString(code);case 47:return readToken_slash();case 37:return readToken_modulo();case 42:return readToken_mult();case 124:case 38:return readToken_pipe_amp(code);case 94:return readToken_caret();case 43:case 45:return readToken_plus_min(code);case 60:case 62:return readToken_lt_gt(code);case 61:case 33:return readToken_eq_excl(code);case 126:return finishOp(_prefix,1)}return false}function readToken(){tokStart=tokPos;if(options.locations)tokStartLoc=curPosition();if(tokPos>=inputLen)return finishToken(_eof);var context=curTokContext();if(context===q_tmpl){return readTmplToken()}if(context===j_expr){return readJSXToken()}var code=input.charCodeAt(tokPos);if(context===j_oTag||context===j_cTag){if(isIdentifierStart(code))return readJSXWord()}else if(context===j_expr){return readJSXToken()}else{if(isIdentifierStart(code)||code===92)return readWord()}var tok=getTokenFromCode(code);if(tok===false){var ch=String.fromCharCode(code);if(ch==="\\"||nonASCIIidentifierStart.test(ch))return readWord();raise(tokPos,"Unexpected character '"+ch+"'")}return tok}function finishOp(type,size,shouldSkipSpace){var str=input.slice(tokPos,tokPos+size);tokPos+=size;finishToken(type,str,shouldSkipSpace)}var regexpUnicodeSupport=false;try{new RegExp("","u");regexpUnicodeSupport=true}catch(e){}function readRegexp(){var content="",escaped,inClass,start=tokPos;for(;;){if(tokPos>=inputLen)raise(start,"Unterminated regular expression");var ch=nextChar();if(newline.test(ch))raise(start,"Unterminated regular expression");if(!escaped){if(ch==="[")inClass=true;else if(ch==="]"&&inClass)inClass=false;else if(ch==="/"&&!inClass)break;escaped=ch==="\\"}else escaped=false;++tokPos}var content=input.slice(start,tokPos);++tokPos;var mods=readWord1();var tmp=content;if(mods){var validFlags=/^[gmsiy]*$/;if(options.ecmaVersion>=6)validFlags=/^[gmsiyu]*$/;if(!validFlags.test(mods))raise(start,"Invalid regular expression flag");if(mods.indexOf("u")>=0&&!regexpUnicodeSupport){tmp=tmp.replace(/\\u\{([0-9a-fA-F]{5,6})\}/g,"x").replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}}try{new RegExp(tmp)}catch(e){if(e instanceof SyntaxError)raise(start,"Error parsing regular expression: "+e.message);raise(e)}try{var value=new RegExp(content,mods)}catch(err){value=null}return finishToken(_regexp,{pattern:content,flags:mods,value:value})}function readInt(radix,len){var start=tokPos,total=0;for(var i=0,e=len==null?Infinity:len;i<e;++i){var code=input.charCodeAt(tokPos),val;if(code>=97)val=code-97+10;else if(code>=65)val=code-65+10;else if(code>=48&&code<=57)val=code-48;else val=Infinity;if(val>=radix)break;++tokPos;total=total*radix+val}if(tokPos===start||len!=null&&tokPos-start!==len)return null;return total}function readRadixNumber(radix){tokPos+=2;var val=readInt(radix);if(val==null)raise(tokStart+2,"Expected number in radix "+radix);if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");return finishToken(_num,val)}function readNumber(startsWithDot){var start=tokPos,isFloat=false,octal=input.charCodeAt(tokPos)===48;if(!startsWithDot&&readInt(10)===null)raise(start,"Invalid number");if(input.charCodeAt(tokPos)===46){++tokPos;readInt(10);isFloat=true}var next=input.charCodeAt(tokPos);if(next===69||next===101){next=input.charCodeAt(++tokPos);if(next===43||next===45)++tokPos;if(readInt(10)===null)raise(start,"Invalid number");isFloat=true}if(isIdentifierStart(input.charCodeAt(tokPos)))raise(tokPos,"Identifier directly after number");var str=input.slice(start,tokPos),val;if(isFloat)val=parseFloat(str);else if(!octal||str.length===1)val=parseInt(str,10);else if(/[89]/.test(str)||strict)raise(start,"Invalid number");else val=parseInt(str,8);return finishToken(_num,val)}function readCodePoint(){var ch=input.charCodeAt(tokPos),code;if(ch===123){if(options.ecmaVersion<6)unexpected();++tokPos;code=readHexChar(input.indexOf("}",tokPos)-tokPos);++tokPos;if(code>1114111)unexpected()}else{code=readHexChar(4)}if(code<=65535){return String.fromCharCode(code)}var cu1=(code-65536>>10)+55296;var cu2=(code-65536&1023)+56320;return String.fromCharCode(cu1,cu2)}function readString(quote){var isJSX=curTokContext()===j_oTag;var out="",chunkStart=++tokPos;for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated string constant");var ch=input.charCodeAt(tokPos);if(ch===quote)break;if(ch===92&&!isJSX){out+=input.slice(chunkStart,tokPos);out+=readEscapedChar();chunkStart=tokPos}else if(ch===38&&isJSX){out+=input.slice(chunkStart,tokPos);out+=readJSXEntity();chunkStart=tokPos}else{if(isNewLine(ch))raise(tokStart,"Unterminated string constant");++tokPos}}out+=input.slice(chunkStart,tokPos++);return finishToken(_string,out)}function readTmplToken(){var out="",chunkStart=tokPos;for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated template");var ch=input.charCodeAt(tokPos);if(ch===96||ch===36&&input.charCodeAt(tokPos+1)===123){if(tokPos===tokStart&&tokType===_template){if(ch===36){tokPos+=2;return finishToken(_dollarBraceL)}else{++tokPos;return finishToken(_backQuote)}}out+=input.slice(chunkStart,tokPos);return finishToken(_template,out)}if(ch===92){out+=input.slice(chunkStart,tokPos);out+=readEscapedChar();chunkStart=tokPos}else if(isNewLine(ch)){out+=input.slice(chunkStart,tokPos);++tokPos;if(ch===13&&input.charCodeAt(tokPos)===10){++tokPos;out+="\n"}else{out+=String.fromCharCode(ch)}if(options.locations){++tokCurLine;tokLineStart=tokPos}chunkStart=tokPos}else{++tokPos}}}var XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function readJSXEntity(){var str="",count=0,entity;var ch=input[tokPos];if(ch!=="&")raise(tokPos,"Entity must start with an ampersand");var startPos=++tokPos;while(tokPos<inputLen&&count++<10){ch=input[tokPos++];if(ch===";"){if(str[0]==="#"){if(str[1]==="x"){str=str.substr(2);if(hexNumber.test(str)){entity=String.fromCharCode(parseInt(str,16))}}else{str=str.substr(1);if(decimalNumber.test(str)){entity=String.fromCharCode(parseInt(str,10))}}}else{entity=XHTMLEntities[str]}break}str+=ch}if(!entity){tokPos=startPos;return"&"}return entity}function readJSXToken(){var out="",start=tokPos;for(;;){if(tokPos>=inputLen)raise(tokStart,"Unterminated JSX contents");var ch=input.charCodeAt(tokPos);switch(ch){case 123:case 60:if(tokPos===start){return getTokenFromCode(ch)}return finishToken(_jsxText,out);case 38:out+=readJSXEntity();break;default:++tokPos;if(isNewLine(ch)){if(ch===13&&input.charCodeAt(tokPos)===10){++tokPos;ch=10}if(options.locations){++tokCurLine;tokLineStart=tokPos}}out+=String.fromCharCode(ch)}}}function readEscapedChar(){var ch=input.charCodeAt(++tokPos);var octal=/^[0-7]+/.exec(input.slice(tokPos,tokPos+3));if(octal)octal=octal[0];while(octal&&parseInt(octal,8)>255)octal=octal.slice(0,-1);if(octal==="0")octal=null;++tokPos;if(octal){if(strict)raise(tokPos-2,"Octal literal in strict mode");tokPos+=octal.length-1;return String.fromCharCode(parseInt(octal,8))}else{switch(ch){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(readHexChar(2));case 117:return readCodePoint();case 116:return" ";case 98:return"\b";case 118:return"";case 102:return"\f";case 48:return"\x00";case 13:if(input.charCodeAt(tokPos)===10)++tokPos;case 10:if(options.locations){tokLineStart=tokPos;++tokCurLine}return"";default:return String.fromCharCode(ch)}}}var XHTMLEntities={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪","int":"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"};function readXJSEntity(){var str="",count=0,entity;var ch=nextChar();if(ch!=="&")raise(tokPos,"Entity must start with an ampersand");var startPos=++tokPos;while(tokPos<inputLen&&count++<10){ch=nextChar();tokPos++;if(ch===";"){if(str[0]==="#"){if(str[1]==="x"){str=str.substr(2);if(hexNumber.test(str)){entity=String.fromCharCode(parseInt(str,16))}}else{str=str.substr(1);if(decimalNumber.test(str)){entity=String.fromCharCode(parseInt(str,10))}}}else{entity=XHTMLEntities[str]}break}str+=ch}if(!entity){tokPos=startPos;return"&"}return entity}function readXJSText(stopChars){var str="";while(tokPos<inputLen){var ch=nextChar();if(stopChars.indexOf(ch)!==-1){break}if(ch==="&"){str+=readXJSEntity()}else{++tokPos;if(ch==="\r"&&nextChar()==="\n"){str+=ch;++tokPos;ch="\n"}if(ch==="\n"&&options.locations){tokLineStart=tokPos;++tokCurLine}str+=ch}}return finishToken(_xjsText,str)}function readXJSStringLiteral(){var quote=input.charCodeAt(tokPos);if(quote!==34&"e!==39){raise("String literal must starts with a quote")}++tokPos;readXJSText([String.fromCharCode(quote)]);if(quote!==input.charCodeAt(tokPos)){unexpected()}++tokPos;return finishToken(tokType,tokVal)}function readHexChar(len){var n=readInt(16,len);if(n===null)raise(tokStart,"Bad character escape sequence");return n}var containsEsc;function readWord1(){containsEsc=false;var word="",first=true,chunkStart=tokPos;for(;;){var ch=input.charCodeAt(tokPos);if(isIdentifierChar(ch)){++tokPos}else if(ch===92){containsEsc=true;word+=input.slice(chunkStart,tokPos);if(input.charCodeAt(++tokPos)!=117)raise(tokPos,"Expecting Unicode escape sequence \\uXXXX");++tokPos;var esc=readHexChar(4);var escStr=String.fromCharCode(esc);if(!escStr)raise(tokPos-1,"Invalid Unicode escape");if(!(first?isIdentifierStart(esc):isIdentifierChar(esc)))raise(tokPos-4,"Invalid Unicode escape");word+=escStr;chunkStart=tokPos}else{break}first=false}return word+input.slice(chunkStart,tokPos)}function readWord(){var word=readWord1();var type=inXJSTag?_xjsName:_name;if(!containsEsc&&isKeyword(word))type=keywordTypes[word];return finishToken(type,word)}function readJSXWord(){var ch,start=tokPos;do{ch=input.charCodeAt(++tokPos)}while(isIdentifierChar(ch)||ch===45);return finishToken(_jsxName,input.slice(start,tokPos))}function next(){if(options.onToken)options.onToken(new Token);lastStart=tokStart;lastEnd=tokEnd;lastEndLoc=tokEndLoc;readToken()}function setStrict(strct){strict=strct;if(tokType!==_num&&tokType!==_string)return;tokPos=tokStart;if(options.locations){while(tokPos<tokLineStart){tokLineStart=input.lastIndexOf("\n",tokLineStart-2)+1;--tokCurLine}}skipSpace();readToken()}function Node(){this.type=null;this.start=tokStart;this.end=null}exports.Node=Node;function SourceLocation(){this.start=tokStartLoc;this.end=null;if(sourceFile!==null)this.source=sourceFile}function startNode(){var node=new exports.Node;if(options.locations)node.loc=new SourceLocation;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[tokStart,0];return node}function storeCurrentPos(){return options.locations?[tokStart,tokStartLoc]:tokStart}function startNodeAt(pos){var node=new exports.Node,start=pos;if(options.locations){node.loc=new SourceLocation;node.loc.start=start[1];start=pos[0]}node.start=start;if(options.directSourceFile)node.sourceFile=options.directSourceFile;if(options.ranges)node.range=[start,0];return node}function finishNode(node,type){node.type=type;node.end=lastEnd;if(options.locations)node.loc.end=lastEndLoc;if(options.ranges)node.range[1]=lastEnd;return node}function finishNodeAt(node,type,pos){if(options.locations){node.loc.end=pos[1];pos=pos[0]}node.type=type;node.end=pos;if(options.ranges)node.range[1]=pos;return node}function isUseStrict(stmt){return options.ecmaVersion>=5&&stmt.type==="ExpressionStatement"&&stmt.expression.type==="Literal"&&stmt.expression.value==="use strict"}function eat(type){if(tokType===type){next();return true}else{return false}}function isContextual(name){return tokType===_name&&tokVal===name}function eatContextual(name){return tokVal===name&&eat(_name)}function expectContextual(name){if(!eatContextual(name))unexpected()}function canInsertSemicolon(){return!options.strictSemicolons&&(tokType===_eof||tokType===_braceR||newline.test(input.slice(lastEnd,tokStart)))}function semicolon(){if(!eat(_semi)&&!canInsertSemicolon())unexpected()}function expect(type){eat(type)||unexpected()}function nextChar(){return input.charAt(tokPos)}function unexpected(pos){raise(pos!=null?pos:tokStart,"Unexpected token")}function has(obj,propName){return Object.prototype.hasOwnProperty.call(obj,propName)}function toAssignable(node){if(options.ecmaVersion>=6&&node){switch(node.type){case"Identifier":case"MemberExpression":case"VirtualPropertyExpression":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":node.type="ObjectPattern";for(var i=0;i<node.properties.length;i++){var prop=node.properties[i];if(prop.kind!=="init")raise(prop.key.start,"Object pattern can't contain getter or setter");toAssignable(prop.value)}break;case"ArrayExpression":node.type="ArrayPattern";toAssignableList(node.elements);break;case"AssignmentExpression":if(node.operator==="="){node.type="AssignmentPattern"}else{raise(node.left.end,"Only '=' operator can be used for specifying default value.")}break;default:raise(node.start,"Assigning to rvalue")}}return node}function toAssignableList(exprList){if(exprList.length){for(var i=0;i<exprList.length-1;i++){toAssignable(exprList[i])}var last=exprList[exprList.length-1];switch(last.type){case"RestElement":break;case"SpreadElement":last.type="RestElement";var arg=last.argument;toAssignable(arg);if(arg.type!=="Identifier"&&arg.type!=="ArrayPattern")unexpected(arg.start);break;default:toAssignable(last)}}return exprList}function parseSpread(refShorthandDefaultPos){var node=startNode();next();node.argument=parseMaybeAssign(refShorthandDefaultPos);return finishNode(node,"SpreadElement")}function parseRest(){var node=startNode();next();node.argument=tokType===_name||tokType===_bracketL?parseAssignableAtom():unexpected();return finishNode(node,"RestElement")}function parseAssignableAtom(){if(options.ecmaVersion<6)return parseIdent();switch(tokType){case _name:return parseIdent();case _bracketL:var node=startNode();next();node.elements=parseAssignableList(_bracketR,true);return finishNode(node,"ArrayPattern");case _braceL:return parseObj(true);default:unexpected()}}function parseAssignableList(close,allowEmpty){var elts=[],first=true;while(!eat(close)){first?first=false:expect(_comma);if(tokType===_ellipsis){elts.push(parseAssignableListItemTypes(parseRest()));expect(close);break}var elem;if(allowEmpty&&tokType===_comma){elem=null}else{var left=parseAssignableAtom();parseAssignableListItemTypes(left);elem=parseMaybeDefault(null,left)}elts.push(elem)}return elts}function parseAssignableListItemTypes(param){if(eat(_question)){param.optional=true}if(tokType===_colon){param.typeAnnotation=parseTypeAnnotation()}finishNode(param,param.type);return param}function parseMaybeDefault(startPos,left){left=left||parseAssignableAtom();if(!eat(_eq))return left;var node=startPos?startNodeAt(startPos):startNode();node.operator="=";node.left=left;node.right=parseMaybeAssign();return finishNode(node,"AssignmentPattern")}function checkFunctionParam(param,nameHash){switch(param.type){case"Identifier":if(isStrictReservedWord(param.name)||isStrictBadIdWord(param.name))raise(param.start,"Defining '"+param.name+"' in strict mode");if(has(nameHash,param.name))raise(param.start,"Argument name clash in strict mode");nameHash[param.name]=true;break;case"ObjectPattern":for(var i=0;i<param.properties.length;i++)checkFunctionParam(param.properties[i].value,nameHash);break;case"ArrayPattern":for(var i=0;i<param.elements.length;i++){var elem=param.elements[i];if(elem)checkFunctionParam(elem,nameHash)}break;case"RestElement":return checkFunctionParam(param.argument,nameHash)}}function checkPropClash(prop,propHash){if(options.ecmaVersion>=6)return;var key=prop.key,name;switch(key.type){case"Identifier":name=key.name;break;case"Literal":name=String(key.value);break;default:return}var kind=prop.kind||"init",other;if(has(propHash,name)){other=propHash[name];var isGetSet=kind!=="init";if((strict||isGetSet)&&other[kind]||!(isGetSet^other.init))raise(key.start,"Redefinition of property")}else{other=propHash[name]={init:false,get:false,set:false}}other[kind]=true}function checkLVal(expr,isBinding){switch(expr.type){case"Identifier":if(strict&&(isStrictBadIdWord(expr.name)||isStrictReservedWord(expr.name)))raise(expr.start,(isBinding?"Binding ":"Assigning to ")+expr.name+" in strict mode");break;case"MemberExpression":if(isBinding)raise(expr.start,"Binding to member expression");break;case"ObjectPattern":for(var i=0;i<expr.properties.length;i++){var prop=expr.properties[i];if(prop.type==="Property")prop=prop.value;checkLVal(prop,isBinding)}break;case"ArrayPattern":for(var i=0;i<expr.elements.length;i++){var elem=expr.elements[i];if(elem)checkLVal(elem,isBinding)}break;case"AssignmentPattern":checkLVal(expr.left);break;case"SpreadProperty":case"VirtualPropertyExpression":break;case"RestElement":checkLVal(expr.argument);break;default:raise(expr.start,"Assigning to rvalue")}}function parseTopLevel(node){var first=true;if(!node.body)node.body=[];while(tokType!==_eof){var stmt=parseStatement(true,true);node.body.push(stmt);if(first&&isUseStrict(stmt))setStrict(true);first=false}next();return finishNode(node,"Program")}var loopLabel={kind:"loop"},switchLabel={kind:"switch"};function parseStatement(declaration,topLevel){var starttype=tokType,node=startNode();switch(starttype){case _break:case _continue:return parseBreakContinueStatement(node,starttype.keyword);case _debugger:return parseDebuggerStatement(node);case _do:return parseDoStatement(node);case _for:return parseForStatement(node);case _function:if(!declaration&&options.ecmaVersion>=6)unexpected();return parseFunctionStatement(node);case _class:if(!declaration)unexpected();return parseClass(node,true);case _if:return parseIfStatement(node);case _return:return parseReturnStatement(node);case _switch:return parseSwitchStatement(node);case _throw:return parseThrowStatement(node);case _try:return parseTryStatement(node);case _let:case _const:if(!declaration)unexpected();case _var:return parseVarStatement(node,starttype.keyword);case _while:return parseWhileStatement(node);case _with:return parseWithStatement(node);case _braceL:return parseBlock();case _semi:return parseEmptyStatement(node);case _export:case _import:if(!topLevel&&!options.allowImportExportEverywhere)raise(tokStart,"'import' and 'export' may only appear at the top level");return starttype===_import?parseImport(node):parseExport(node);default:var maybeName=tokVal,expr=parseExpression();if(options.ecmaVersion>=7&&starttype===_name&&maybeName==="async"&&tokType===_function&&!canInsertSemicolon()){next();var func=parseFunctionStatement(node);func.async=true;return func}if(starttype===_name&&expr.type==="Identifier"){if(eat(_colon)){return parseLabeledStatement(node,maybeName,expr)}if(options.ecmaVersion>=7&&expr.name==="private"&&tokType===_name){return parsePrivate(node)}else if(expr.name==="declare"){if(tokType===_class||tokType===_name||tokType===_function||tokType===_var){return parseDeclare(node)}}else if(tokType===_name){if(expr.name==="interface"){return parseInterface(node)}else if(expr.name==="type"){return parseTypeAlias(node)}}}if(expr.type==="FunctionExpression"&&expr.async){if(expr.id){expr.type="FunctionDeclaration";return expr}else{unexpected(expr.start+"async function ".length)}}return parseExpressionStatement(node,expr)}}function parseBreakContinueStatement(node,keyword){var isBreak=keyword=="break";next();if(eat(_semi)||canInsertSemicolon())node.label=null;else if(tokType!==_name)unexpected();else{node.label=parseIdent();semicolon()}for(var i=0;i<labels.length;++i){var lab=labels[i];if(node.label==null||lab.name===node.label.name){if(lab.kind!=null&&(isBreak||lab.kind==="loop"))break;if(node.label&&isBreak)break}}if(i===labels.length)raise(node.start,"Unsyntactic "+keyword);return finishNode(node,isBreak?"BreakStatement":"ContinueStatement")}function parseDebuggerStatement(node){next();semicolon();return finishNode(node,"DebuggerStatement")}function parseDoStatement(node){next();labels.push(loopLabel);node.body=parseStatement(false);labels.pop();expect(_while);node.test=parseParenExpression();if(options.ecmaVersion>=6)eat(_semi);else semicolon();return finishNode(node,"DoWhileStatement")}function parseForStatement(node){next();labels.push(loopLabel);expect(_parenL);if(tokType===_semi)return parseFor(node,null);if(tokType===_var||tokType===_let){var init=startNode(),varKind=tokType.keyword,isLet=tokType===_let;next();parseVar(init,true,varKind);finishNode(init,"VariableDeclaration");if((tokType===_in||options.ecmaVersion>=6&&isContextual("of"))&&init.declarations.length===1&&!(isLet&&init.declarations[0].init))return parseForIn(node,init);return parseFor(node,init)}var refShorthandDefaultPos={start:0};var init=parseExpression(true,refShorthandDefaultPos);if(tokType===_in||options.ecmaVersion>=6&&isContextual("of")){toAssignable(init);checkLVal(init);return parseForIn(node,init)}else if(refShorthandDefaultPos.start){unexpected(refShorthandDefaultPos.start)}return parseFor(node,init)}function parseFunctionStatement(node){next();return parseFunction(node,true,false)}function parseIfStatement(node){next();node.test=parseParenExpression();node.consequent=parseStatement(false);node.alternate=eat(_else)?parseStatement(false):null;return finishNode(node,"IfStatement")}function parseReturnStatement(node){if(!inFunction&&!options.allowReturnOutsideFunction)raise(tokStart,"'return' outside of function");next();if(eat(_semi)||canInsertSemicolon())node.argument=null;else{node.argument=parseExpression();semicolon()}return finishNode(node,"ReturnStatement")}function parseSwitchStatement(node){next();node.discriminant=parseParenExpression();node.cases=[];expect(_braceL);labels.push(switchLabel);for(var cur,sawDefault;tokType!=_braceR;){if(tokType===_case||tokType===_default){var isCase=tokType===_case;if(cur)finishNode(cur,"SwitchCase");node.cases.push(cur=startNode());cur.consequent=[];next();if(isCase)cur.test=parseExpression();else{if(sawDefault)raise(lastStart,"Multiple default clauses");sawDefault=true;cur.test=null}expect(_colon)}else{if(!cur)unexpected();
cur.consequent.push(parseStatement(true))}}if(cur)finishNode(cur,"SwitchCase");next();labels.pop();return finishNode(node,"SwitchStatement")}function parseThrowStatement(node){next();if(newline.test(input.slice(lastEnd,tokStart)))raise(lastEnd,"Illegal newline after throw");node.argument=parseExpression();semicolon();return finishNode(node,"ThrowStatement")}function parseTryStatement(node){next();node.block=parseBlock();node.handler=null;if(tokType===_catch){var clause=startNode();next();expect(_parenL);clause.param=parseAssignableAtom();checkLVal(clause.param,true);expect(_parenR);clause.guard=null;clause.body=parseBlock();node.handler=finishNode(clause,"CatchClause")}node.guardedHandlers=empty;node.finalizer=eat(_finally)?parseBlock():null;if(!node.handler&&!node.finalizer)raise(node.start,"Missing catch or finally clause");return finishNode(node,"TryStatement")}function parseVarStatement(node,kind){next();parseVar(node,false,kind);semicolon();return finishNode(node,"VariableDeclaration")}function parseWhileStatement(node){next();node.test=parseParenExpression();labels.push(loopLabel);node.body=parseStatement(false);labels.pop();return finishNode(node,"WhileStatement")}function parseWithStatement(node){if(strict)raise(tokStart,"'with' in strict mode");next();node.object=parseParenExpression();node.body=parseStatement(false);return finishNode(node,"WithStatement")}function parseEmptyStatement(node){next();return finishNode(node,"EmptyStatement")}function parseLabeledStatement(node,maybeName,expr){for(var i=0;i<labels.length;++i)if(labels[i].name===maybeName)raise(expr.start,"Label '"+maybeName+"' is already declared");var kind=tokType.isLoop?"loop":tokType===_switch?"switch":null;labels.push({name:maybeName,kind:kind});node.body=parseStatement(true);labels.pop();node.label=expr;return finishNode(node,"LabeledStatement")}function parseExpressionStatement(node,expr){node.expression=expr;semicolon();return finishNode(node,"ExpressionStatement")}function parseParenExpression(){expect(_parenL);var val=parseExpression();expect(_parenR);return val}function parseBlock(allowStrict){var node=startNode(),first=true,oldStrict;node.body=[];expect(_braceL);while(!eat(_braceR)){var stmt=parseStatement(true);node.body.push(stmt);if(first&&allowStrict&&isUseStrict(stmt)){oldStrict=strict;setStrict(strict=true)}first=false}if(oldStrict===false)setStrict(false);return finishNode(node,"BlockStatement")}function parseFor(node,init){node.init=init;expect(_semi);node.test=tokType===_semi?null:parseExpression();expect(_semi);node.update=tokType===_parenR?null:parseExpression();expect(_parenR);node.body=parseStatement(false);labels.pop();return finishNode(node,"ForStatement")}function parseForIn(node,init){var type=tokType===_in?"ForInStatement":"ForOfStatement";next();node.left=init;node.right=parseExpression();expect(_parenR);node.body=parseStatement(false);labels.pop();return finishNode(node,type)}function parseVar(node,noIn,kind){node.declarations=[];node.kind=kind;for(;;){var decl=startNode();decl.id=parseAssignableAtom();checkLVal(decl.id,true);if(tokType===_colon){decl.id.typeAnnotation=parseTypeAnnotation();finishNode(decl.id,decl.id.type)}decl.init=eat(_eq)?parseMaybeAssign(noIn):kind===_const.keyword?unexpected():null;node.declarations.push(finishNode(decl,"VariableDeclarator"));if(!eat(_comma))break}return node}function parseExpression(noIn,refShorthandDefaultPos){var start=storeCurrentPos();var expr=parseMaybeAssign(noIn,refShorthandDefaultPos);if(tokType===_comma){var node=startNodeAt(start);node.expressions=[expr];while(eat(_comma))node.expressions.push(parseMaybeAssign(noIn,refShorthandDefaultPos));return finishNode(node,"SequenceExpression")}return expr}function parseMaybeAssign(noIn,refShorthandDefaultPos,afterLeftParse){var failOnShorthandAssign;if(!refShorthandDefaultPos){refShorthandDefaultPos={start:0};failOnShorthandAssign=true}else{failOnShorthandAssign=false}var start=storeCurrentPos();var left=parseMaybeConditional(noIn,refShorthandDefaultPos);if(afterLeftParse)afterLeftParse(left);if(tokType.isAssign){var node=startNodeAt(start);node.operator=tokVal;node.left=tokType===_eq?toAssignable(left):left;refShorthandDefaultPos.start=0;checkLVal(left);next();node.right=parseMaybeAssign(noIn);return finishNode(node,"AssignmentExpression")}else if(failOnShorthandAssign&&refShorthandDefaultPos.start){unexpected(refShorthandDefaultPos.start)}return left}function parseMaybeConditional(noIn,refShorthandDefaultPos){var start=storeCurrentPos();var expr=parseExprOps(noIn,refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;if(eat(_question)){var node=startNodeAt(start);if(options.playground&&eat(_eq)){var left=node.left=toAssignable(expr);if(left.type!=="MemberExpression")raise(left.start,"You can only use member expressions in memoization assignment");node.right=parseMaybeAssign(noIn);node.operator="?=";return finishNode(node,"AssignmentExpression")}node.test=expr;node.consequent=parseMaybeAssign();expect(_colon);node.alternate=parseMaybeAssign(noIn);return finishNode(node,"ConditionalExpression")}return expr}function parseExprOps(noIn,refShorthandDefaultPos){var start=storeCurrentPos();var expr=parseMaybeUnary(refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;return parseExprOp(expr,start,-1,noIn)}function parseExprOp(left,leftStart,minPrec,noIn){var prec=tokType.binop;if(prec!=null&&(!noIn||tokType!==_in)){if(prec>minPrec){var node=startNodeAt(leftStart);node.left=left;node.operator=tokVal;var op=tokType;next();var start=storeCurrentPos();node.right=parseExprOp(parseMaybeUnary(),start,op.rightAssociative?prec-1:prec,noIn);finishNode(node,op===_logicalOR||op===_logicalAND?"LogicalExpression":"BinaryExpression");return parseExprOp(node,leftStart,minPrec,noIn)}}return left}function parseMaybeUnary(refShorthandDefaultPos){if(tokType.prefix){var node=startNode(),update=tokType.isUpdate;node.operator=tokVal;node.prefix=true;next();node.argument=parseMaybeUnary();if(refShorthandDefaultPos&&refShorthandDefaultPos.start)unexpected(refShorthandDefaultPos.start);if(update)checkLVal(node.argument);else if(strict&&node.operator==="delete"&&node.argument.type==="Identifier")raise(node.start,"Deleting local variable in strict mode");return finishNode(node,update?"UpdateExpression":"UnaryExpression")}var start=storeCurrentPos();var expr=parseExprSubscripts(refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;while(tokType.postfix&&!canInsertSemicolon()){var node=startNodeAt(start);node.operator=tokVal;node.prefix=false;node.argument=expr;checkLVal(expr);next();expr=finishNode(node,"UpdateExpression")}return expr}function parseExprSubscripts(refShorthandDefaultPos){var start=storeCurrentPos();var expr=parseExprAtom(refShorthandDefaultPos);if(refShorthandDefaultPos&&refShorthandDefaultPos.start)return expr;return parseSubscripts(expr,start)}function parseSubscripts(base,start,noCalls){if(options.playground&&eat(_hash)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);if(eat(_parenL)){node.arguments=parseExprList(_parenR,false)}else{node.arguments=[]}return parseSubscripts(finishNode(node,"BindMemberExpression"),start,noCalls)}else if(eat(_paamayimNekudotayim)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);return parseSubscripts(finishNode(node,"VirtualPropertyExpression"),start,noCalls)}else if(eat(_dot)){var node=startNodeAt(start);node.object=base;node.property=parseIdent(true);node.computed=false;return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(eat(_bracketL)){var node=startNodeAt(start);node.object=base;node.property=parseExpression();node.computed=true;expect(_bracketR);return parseSubscripts(finishNode(node,"MemberExpression"),start,noCalls)}else if(!noCalls&&eat(_parenL)){var node=startNodeAt(start);node.callee=base;node.arguments=parseExprList(_parenR,false);return parseSubscripts(finishNode(node,"CallExpression"),start,noCalls)}else if(tokType===_backQuote){var node=startNodeAt(start);node.tag=base;node.quasi=parseTemplate();return parseSubscripts(finishNode(node,"TaggedTemplateExpression"),start,noCalls)}return base}function parseExprAtom(refShorthandDefaultPos){switch(tokType){case _this:var node=startNode();next();return finishNode(node,"ThisExpression");case _at:var start=storeCurrentPos();var node=startNode();var thisNode=startNode();next();node.object=finishNode(thisNode,"ThisExpression");node.property=parseSubscripts(parseIdent(),start);node.computed=false;return finishNode(node,"MemberExpression");case _yield:if(inGenerator)return parseYield();case _name:var start=storeCurrentPos();var node=startNode();var id=parseIdent(tokType!==_name);if(options.ecmaVersion>=7){if(id.name==="async"){if(tokType===_parenL){next();var exprList;if(tokType!==_parenR){var val=parseExpression();exprList=val.type==="SequenceExpression"?val.expressions:[val]}else{exprList=[]}expect(_parenR);if(eat(_arrow)){return parseArrowExpression(node,exprList,true)}else{node.callee=id;node.arguments=exprList;return parseSubscripts(finishNode(node,"CallExpression"),start)}}else if(tokType===_name){id=parseIdent();if(eat(_arrow)){return parseArrowExpression(node,[id],true)}return id}if(tokType===_function&&!canInsertSemicolon()){next();return parseFunction(node,false,true)}}else if(id.name==="await"){if(inAsync)return parseAwait(node)}}if(eat(_arrow)){return parseArrowExpression(node,[id])}return id;case _regexp:var node=startNode();node.regex={pattern:tokVal.pattern,flags:tokVal.flags};node.value=tokVal.value;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _num:case _string:case _jsxText:var node=startNode();node.value=tokVal;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"Literal");case _null:case _true:case _false:var node=startNode();node.value=tokType.atomValue;node.raw=tokType.keyword;next();return finishNode(node,"Literal");case _parenL:return parseParenAndDistinguishExpression();case _bracketL:var node=startNode();next();if(options.ecmaVersion>=7&&tokType===_for){return parseComprehension(node,false)}node.elements=parseExprList(_bracketR,true,true,refShorthandDefaultPos);return finishNode(node,"ArrayExpression");case _braceL:return parseObj(false,refShorthandDefaultPos);case _function:var node=startNode();next();return parseFunction(node,false,false);case _class:return parseClass(startNode(),false);case _new:return parseNew();case _backQuote:return parseTemplate();case _hash:return parseBindFunctionExpression();case _jsxTagStart:return parseJSXElement();default:unexpected()}}function parseBindFunctionExpression(){var node=startNode();next();var start=storeCurrentPos();node.callee=parseSubscripts(parseExprAtom(),start,true);if(eat(_parenL)){node.arguments=parseExprList(_parenR,false)}else{node.arguments=[]}return finishNode(node,"BindFunctionExpression")}function parseParenAndDistinguishExpression(){var start=storeCurrentPos(),val;if(options.ecmaVersion>=6){next();if(options.ecmaVersion>=7&&tokType===_for){return parseComprehension(startNodeAt(start),true)}var innerStart=storeCurrentPos(),exprList=[],first=true;var refShorthandDefaultPos={start:0},spreadStart,innerParenStart,typeStart;var parseParenItem=function(node){if(tokType===_colon){typeStart=typeStart||tokStart;node.returnType=parseTypeAnnotation()}return node};while(tokType!==_parenR){first?first=false:expect(_comma);if(tokType===_ellipsis){spreadStart=tokStart;exprList.push(parseParenItem(parseRest()));break}else{if(tokType===_parenL&&!innerParenStart){innerParenStart=tokStart}exprList.push(parseMaybeAssign(false,refShorthandDefaultPos,parseParenItem))}}var innerEnd=storeCurrentPos();expect(_parenR);if(eat(_arrow)){if(innerParenStart)unexpected(innerParenStart);return parseArrowExpression(startNodeAt(start),exprList)}if(!exprList.length)unexpected(lastStart);if(typeStart)unexpected(typeStart);if(spreadStart)unexpected(spreadStart);if(refShorthandDefaultPos.start)unexpected(refShorthandDefaultPos.start);if(exprList.length>1){val=startNodeAt(innerStart);val.expressions=exprList;finishNodeAt(val,"SequenceExpression",innerEnd)}else{val=exprList[0]}}else{val=parseParenExpression()}if(options.preserveParens){var par=startNodeAt(start);par.expression=val;return finishNode(par,"ParenthesizedExpression")}else{return val}}function parseNew(){var node=startNode();next();var start=storeCurrentPos();node.callee=parseSubscripts(parseExprAtom(),start,true);if(eat(_parenL))node.arguments=parseExprList(_parenR,false);else node.arguments=empty;return finishNode(node,"NewExpression")}function parseTemplateElement(){var elem=startNode();elem.value={raw:input.slice(tokStart,tokEnd),cooked:tokVal};next();elem.tail=tokType===_backQuote;return finishNode(elem,"TemplateElement")}function parseTemplate(){var node=startNode();next();node.expressions=[];var curElt=parseTemplateElement();node.quasis=[curElt];while(!curElt.tail){expect(_dollarBraceL);node.expressions.push(parseExpression());expect(_braceR);node.quasis.push(curElt=parseTemplateElement())}next();return finishNode(node,"TemplateLiteral")}function parseObj(isPattern,refShorthandDefaultPos){var node=startNode(),first=true,propHash={};node.properties=[];next();while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var prop=startNode(),start,isGenerator=false,isAsync=false;if(options.ecmaVersion>=7&&tokType===_ellipsis){prop=parseSpread();prop.type="SpreadProperty";node.properties.push(prop);continue}if(options.ecmaVersion>=6){prop.method=false;prop.shorthand=false;if(isPattern){start=storeCurrentPos()}else{isGenerator=eat(_star)}}if(options.ecmaVersion>=7&&isContextual("async")){var asyncId=parseIdent();if(tokType===_colon||tokType===_parenL){prop.key=asyncId}else{isAsync=true;parsePropertyName(prop)}}else{parsePropertyName(prop)}var typeParameters;if(isRelational("<")){typeParameters=parseTypeParameterDeclaration();if(tokType!==_parenL)unexpected()}if(eat(_colon)){prop.value=isPattern?parseMaybeDefault(start):parseMaybeAssign(false,refShorthandDefaultPos);prop.kind="init"}else if(options.ecmaVersion>=6&&tokType===_parenL){if(isPattern)unexpected();prop.kind="init";prop.method=true;prop.value=parseMethod(isGenerator,isAsync)}else if(options.ecmaVersion>=5&&!prop.computed&&prop.key.type==="Identifier"&&(prop.key.name==="get"||prop.key.name==="set"||options.playground&&prop.key.name==="memo")&&(tokType!=_comma&&tokType!=_braceR)){if(isGenerator||isAsync||isPattern)unexpected();prop.kind=prop.key.name;parsePropertyName(prop);prop.value=parseMethod(false,false)}else if(options.ecmaVersion>=6&&!prop.computed&&prop.key.type==="Identifier"){prop.kind="init";if(isPattern){prop.value=parseMaybeDefault(start,prop.key)}else if(tokType===_eq&&refShorthandDefaultPos){if(!refShorthandDefaultPos.start)refShorthandDefaultPos.start=tokStart;prop.value=parseMaybeDefault(start,prop.key)}else{prop.value=prop.key}prop.shorthand=true}else unexpected();prop.value.typeParameters=typeParameters;checkPropClash(prop,propHash);node.properties.push(finishNode(prop,"Property"))}return finishNode(node,isPattern?"ObjectPattern":"ObjectExpression")}function parsePropertyName(prop){if(options.ecmaVersion>=6){if(eat(_bracketL)){prop.computed=true;prop.key=parseExpression();expect(_bracketR);return}else{prop.computed=false}}prop.key=tokType===_num||tokType===_string?parseExprAtom():parseIdent(true)}function initFunction(node,isAsync){node.id=null;if(options.ecmaVersion>=6){node.generator=false;node.expression=false}if(options.ecmaVersion>=7){node.async=isAsync}}function parseFunction(node,isStatement,isAsync,allowExpressionBody){initFunction(node,isAsync);if(options.ecmaVersion>=6){node.generator=eat(_star)}if(isStatement||tokType===_name){node.id=parseIdent()}if(isRelational("<")){node.typeParameters=parseTypeParameterDeclaration()}parseFunctionParams(node);parseFunctionBody(node,allowExpressionBody);return finishNode(node,isStatement?"FunctionDeclaration":"FunctionExpression")}function parseMethod(isGenerator,isAsync){var node=startNode();initFunction(node,isAsync);parseFunctionParams(node);var allowExpressionBody;if(options.ecmaVersion>=6){node.generator=isGenerator;allowExpressionBody=true}else{allowExpressionBody=false}parseFunctionBody(node,allowExpressionBody);return finishNode(node,"FunctionExpression")}function parseFunctionParams(node){expect(_parenL);node.params=parseAssignableList(_parenR,false);if(tokType===_colon){node.returnType=parseTypeAnnotation()}}function parseArrowExpression(node,params,isAsync){initFunction(node,isAsync);node.params=toAssignableList(params,true);parseFunctionBody(node,true);return finishNode(node,"ArrowFunctionExpression")}function parseFunctionBody(node,allowExpression){var isExpression=allowExpression&&tokType!==_braceL;var oldInAsync=inAsync;inAsync=node.async;if(isExpression){node.body=parseMaybeAssign();node.expression=true}else{var oldInFunc=inFunction,oldInGen=inGenerator,oldLabels=labels;inFunction=true;inGenerator=node.generator;labels=[];node.body=parseBlock(true);node.expression=false;inFunction=oldInFunc;inGenerator=oldInGen;labels=oldLabels}inAsync=oldInAsync;if(strict||!isExpression&&node.body.body.length&&isUseStrict(node.body.body[0])){var nameHash={};if(node.id)checkFunctionParam(node.id,{});for(var i=0;i<node.params.length;i++)checkFunctionParam(node.params[i],nameHash)}}function parsePrivate(node){node.declarations=[];do{node.declarations.push(parseIdent())}while(eat(_comma));semicolon();return finishNode(node,"PrivateDeclaration")}function parseClass(node,isStatement){next();node.id=tokType===_name?parseIdent():isStatement?unexpected():null;if(isRelational("<")){node.typeParameters=parseTypeParameterDeclaration()}node.superClass=eat(_extends)?parseExprSubscripts():null;if(node.superClass&&isRelational("<")){node.superTypeParameters=parseTypeParameterInstantiation()}if(isContextual("implements")){next();node.implements=parseClassImplements()}var classBody=startNode();classBody.body=[];expect(_braceL);while(!eat(_braceR)){if(eat(_semi))continue;var method=startNode();if(options.ecmaVersion>=7&&isContextual("private")){next();classBody.body.push(parsePrivate(method));continue}var isGenerator=eat(_star);var isAsync=false;parsePropertyName(method);if(tokType!==_parenL&&!method.computed&&method.key.type==="Identifier"&&method.key.name==="static"){if(isGenerator||isAsync)unexpected();method["static"]=true;isGenerator=eat(_star);parsePropertyName(method)}else{method["static"]=false}if(tokType!==_parenL&&!method.computed&&method.key.type==="Identifier"&&method.key.name==="async"){isAsync=true;parsePropertyName(method)}if(tokType!==_parenL&&!method.computed&&method.key.type==="Identifier"&&(method.key.name==="get"||method.key.name==="set")||options.playground&&method.key.name==="memo"){if(isGenerator||isAsync)unexpected();method.kind=method.key.name;parsePropertyName(method)}else{method.kind=""}if(tokType===_colon){method.typeAnnotation=parseTypeAnnotation();semicolon();classBody.body.push(finishNode(method,"ClassProperty"))}else{var typeParameters;if(isRelational("<")){typeParameters=parseTypeParameterDeclaration()}method.value=parseMethod(isGenerator,isAsync);method.value.typeParameters=typeParameters;classBody.body.push(finishNode(method,"MethodDefinition"));eat(_semi)}}node.body=finishNode(classBody,"ClassBody");return finishNode(node,isStatement?"ClassDeclaration":"ClassExpression")}function parseClassImplements(){var implemented=[];do{var node=startNode();node.id=parseIdent();if(isRelational("<")){node.typeParameters=parseTypeParameterInstantiation()}else{node.typeParameters=null}implemented.push(finishNode(node,"ClassImplements"))}while(eat(_comma));return implemented}function parseExprList(close,allowTrailingComma,allowEmpty,refShorthandDefaultPos){var elts=[],first=true;while(!eat(close)){if(!first){expect(_comma);if(allowTrailingComma&&options.allowTrailingCommas&&eat(close))break}else first=false;if(allowEmpty&&tokType===_comma){elts.push(null)}else{if(tokType===_ellipsis)elts.push(parseSpread(refShorthandDefaultPos));else elts.push(parseMaybeAssign(false,refShorthandDefaultPos))}}return elts}function parseIdent(liberal){var node=startNode();if(liberal&&options.forbidReserved=="everywhere")liberal=false;if(tokType===_name){if(!liberal&&(options.forbidReserved&&(options.ecmaVersion===3?isReservedWord3:isReservedWord5)(tokVal)||strict&&isStrictReservedWord(tokVal))&&input.slice(tokStart,tokEnd).indexOf("\\")==-1)raise(tokStart,"The keyword '"+tokVal+"' is reserved");node.name=tokVal}else if(liberal&&tokType.keyword){node.name=tokType.keyword}else{unexpected()}next();return finishNode(node,"Identifier")}function parseExport(node){next();if(tokType===_var||tokType===_const||tokType===_let||tokType===_function||tokType===_class||isContextual("async")){node.declaration=parseStatement(true);node["default"]=false;node.specifiers=null;node.source=null}else if(eat(_default)){var declar=node.declaration=parseMaybeAssign(true);if(declar.id){if(declar.type==="FunctionExpression"){declar.type="FunctionDeclaration"}else if(declar.type==="ClassExpression"){declar.type="ClassDeclaration"}}node["default"]=true;node.specifiers=null;node.source=null;semicolon()}else{var isBatch=tokType===_star;node.declaration=null;node["default"]=false;node.specifiers=parseExportSpecifiers();if(eatContextual("from")){node.source=tokType===_string?parseExprAtom():unexpected()}else{if(isBatch)unexpected();node.source=null}semicolon()}return finishNode(node,"ExportDeclaration")}function parseExportSpecifiers(){var nodes=[],first=true;if(tokType===_star){var node=startNode();next();nodes.push(finishNode(node,"ExportBatchSpecifier"))}else{expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent(tokType===_default);node.name=eatContextual("as")?parseIdent(true):null;nodes.push(finishNode(node,"ExportSpecifier"))}}return nodes}function parseImport(node){next();if(tokType===_string){node.specifiers=[];node.source=parseExprAtom()}else{node.specifiers=parseImportSpecifiers();expectContextual("from");node.source=tokType===_string?parseExprAtom():unexpected()}semicolon();return finishNode(node,"ImportDeclaration")}function parseImportSpecifiers(){var nodes=[],first=true;if(tokType===_name){var node=startNode();node.id=parseIdent();checkLVal(node.id,true);node.name=null;node["default"]=true;nodes.push(finishNode(node,"ImportSpecifier"));if(!eat(_comma))return nodes}if(tokType===_star){var node=startNode();next();expectContextual("as");node.name=parseIdent();checkLVal(node.name,true);nodes.push(finishNode(node,"ImportBatchSpecifier"));return nodes}expect(_braceL);while(!eat(_braceR)){if(!first){expect(_comma);if(options.allowTrailingCommas&&eat(_braceR))break}else first=false;var node=startNode();node.id=parseIdent(true);node.name=eatContextual("as")?parseIdent():null;checkLVal(node.name||node.id,true);node["default"]=false;nodes.push(finishNode(node,"ImportSpecifier"))}return nodes}function parseYield(){var node=startNode();next();if(eat(_semi)||canInsertSemicolon()){node.delegate=false;node.argument=null}else{node.delegate=eat(_star);node.argument=parseMaybeAssign()}return finishNode(node,"YieldExpression")}function parseAwait(node){if(eat(_semi)||canInsertSemicolon()){unexpected()}node.delegate=eat(_star);node.argument=parseMaybeAssign(true);return finishNode(node,"AwaitExpression")}function parseComprehension(node,isGenerator){node.blocks=[];while(tokType===_for){var block=startNode();next();expect(_parenL);block.left=parseAssignableAtom();checkLVal(block.left,true);expectContextual("of");block.right=parseExpression();expect(_parenR);node.blocks.push(finishNode(block,"ComprehensionBlock"))}node.filter=eat(_if)?parseParenExpression():null;node.body=parseExpression();expect(isGenerator?_parenR:_bracketR);node.generator=isGenerator;return finishNode(node,"ComprehensionExpression")}function getQualifiedJSXName(object){if(object.type==="JSXIdentifier"){return object.name}if(object.type==="JSXNamespacedName"){return object.namespace.name+":"+object.name.name}if(object.type==="JSXMemberExpression"){return getQualifiedJSXName(object.object)+"."+getQualifiedJSXName(object.property)}}function parseJSXIdentifier(){var node=startNode();if(tokType===_jsxName){node.name=tokVal}else if(tokType.keyword){node.name=tokType.keyword}else{unexpected()}next();return finishNode(node,"JSXIdentifier")}function parseJSXNamespacedName(){var start=storeCurrentPos();var name=parseJSXIdentifier();if(!eat(_colon))return name;var node=startNodeAt(start);node.namespace=name;node.name=parseJSXIdentifier();return finishNode(node,"JSXNamespacedName")}function parseJSXElementName(){var start=storeCurrentPos();var node=parseJSXNamespacedName();while(eat(_dot)){var newNode=startNodeAt(start);newNode.object=node;newNode.property=parseJSXIdentifier();node=finishNode(newNode,"JSXMemberExpression")}return node}function parseJSXAttributeValue(){switch(tokType){case _braceL:var node=parseJSXExpressionContainer();if(node.expression.type==="JSXEmptyExpression"){raise(node.start,"JSX attributes must only be assigned a non-empty "+"expression")}return node;case _jsxTagStart:return parseJSXElement();case _jsxText:case _string:return parseExprAtom();default:raise(tokStart,"JSX value should be either an expression or a quoted JSX text")}}function parseJSXEmptyExpression(){if(tokType!==_braceR){unexpected()}var tmp;tmp=tokStart;tokStart=lastEnd;lastEnd=tmp;tmp=tokStartLoc;tokStartLoc=lastEndLoc;lastEndLoc=tmp;return finishNode(startNode(),"JSXEmptyExpression")}function parseJSXExpressionContainer(){var node=startNode();next();node.expression=tokType===_braceR?parseJSXEmptyExpression():parseExpression();expect(_braceR);return finishNode(node,"JSXExpressionContainer")}function parseJSXAttribute(){var node=startNode();if(eat(_braceL)){expect(_ellipsis);node.argument=parseMaybeAssign();expect(_braceR);return finishNode(node,"JSXSpreadAttribute")}node.name=parseJSXNamespacedName();node.value=eat(_eq)?parseJSXAttributeValue():null;return finishNode(node,"JSXAttribute")}function parseJSXOpeningElementAt(start){var node=startNodeAt(start);node.attributes=[];node.name=parseJSXElementName();while(tokType!==_slash&&tokType!==_jsxTagEnd){node.attributes.push(parseJSXAttribute())}node.selfClosing=eat(_slash);expect(_jsxTagEnd);return finishNode(node,"JSXOpeningElement")}function parseJSXClosingElementAt(start){var node=startNodeAt(start);node.name=parseJSXElementName();expect(_jsxTagEnd);return finishNode(node,"JSXClosingElement")}function parseJSXElementAt(start){var node=startNodeAt(start);var children=[];var openingElement=parseJSXOpeningElementAt(start);var closingElement=null;if(!openingElement.selfClosing){contents:for(;;){switch(tokType){case _jsxTagStart:start=storeCurrentPos();next();if(eat(_slash)){closingElement=parseJSXClosingElementAt(start);break contents}children.push(parseJSXElementAt(start));break;case _jsxText:children.push(parseExprAtom());break;case _braceL:children.push(parseJSXExpressionContainer());break;default:unexpected()}}if(getQualifiedJSXName(closingElement.name)!==getQualifiedJSXName(openingElement.name)){raise(closingElement.start,"Expected corresponding JSX closing tag for <"+getQualifiedJSXName(openingElement.name)+">")}}node.openingElement=openingElement;node.closingElement=closingElement;node.children=children;return finishNode(node,"JSXElement")}function isRelational(op){return tokType===_relational&&tokVal===op}function expectRelational(op){if(isRelational(op)){next()}else{unexpected()}}function parseJSXElement(){var start=storeCurrentPos();next();return parseJSXElementAt(start)}function parseDeclareClass(node){next();parseInterfaceish(node,true);return finishNode(node,"DeclareClass")}function parseDeclareFunction(node){next();var id=node.id=parseIdent();var typeNode=startNode();var typeContainer=startNode();if(isRelational("<")){typeNode.typeParameters=parseTypeParameterDeclaration()}else{typeNode.typeParameters=null}expect(_parenL);var tmp=parseFunctionTypeParams();typeNode.params=tmp.params;typeNode.rest=tmp.rest;expect(_parenR);expect(_colon);typeNode.returnType=parseType();typeContainer.typeAnnotation=finishNode(typeNode,"FunctionTypeAnnotation");id.typeAnnotation=finishNode(typeContainer,"TypeAnnotation");finishNode(id,id.type);semicolon();return finishNode(node,"DeclareFunction")}function parseDeclare(node){if(tokType===_class){return parseDeclareClass(node)}else if(tokType===_function){return parseDeclareFunction(node)}else if(tokType===_var){return parseDeclareVariable(node)}else if(isContextual("module")){return parseDeclareModule(node)}else{unexpected()}}function parseDeclareVariable(node){next();node.id=parseTypeAnnotatableIdentifier();semicolon();return finishNode(node,"DeclareVariable")}function parseDeclareModule(node){next();if(tokType===_string){node.id=parseExprAtom()}else{node.id=parseIdent()}var bodyNode=node.body=startNode();var body=bodyNode.body=[];expect(_braceL);while(tokType!==_braceR){var node2=startNode();next();body.push(parseDeclare(node2))}expect(_braceR);finishNode(bodyNode,"BlockStatement");return finishNode(node,"DeclareModule")}function parseInterfaceish(node,allowStatic){node.id=parseIdent();if(isRelational("<")){node.typeParameters=parseTypeParameterDeclaration()}else{node.typeParameters=null}node.extends=[];if(eat(_extends)){do{node.extends.push(parseInterfaceExtends())}while(eat(_comma))}node.body=parseObjectType(allowStatic)}function parseInterfaceExtends(){var node=startNode();node.id=parseIdent();if(isRelational("<")){node.typeParameters=parseTypeParameterInstantiation()}else{node.typeParameters=null}return finishNode(node,"InterfaceExtends")}function parseInterface(node){parseInterfaceish(node,false);return finishNode(node,"InterfaceDeclaration")}function parseTypeAlias(node){node.id=parseIdent();if(isRelational("<")){node.typeParameters=parseTypeParameterDeclaration()}else{node.typeParameters=null}expect(_eq);node.right=parseType();semicolon();return finishNode(node,"TypeAlias")}function parseTypeParameterDeclaration(){var node=startNode();node.params=[];expectRelational("<");while(!isRelational(">")){node.params.push(parseIdent());if(!isRelational(">")){expect(_comma)}}expectRelational(">");return finishNode(node,"TypeParameterDeclaration")}function parseTypeParameterInstantiation(){var node=startNode(),oldInType=inType;node.params=[];inType=true;expectRelational("<");while(!isRelational(">")){node.params.push(parseType());if(!isRelational(">")){expect(_comma)}}expectRelational(">");inType=oldInType;return finishNode(node,"TypeParameterInstantiation")}function parseObjectPropertyKey(){return tokType===_num||tokType===_string?parseExprAtom():parseIdent(true)}function parseObjectTypeIndexer(node,isStatic){node.static=isStatic;expect(_bracketL);node.id=parseObjectPropertyKey();expect(_colon);node.key=parseType();expect(_bracketR);expect(_colon);node.value=parseType();return finishNode(node,"ObjectTypeIndexer")}function parseObjectTypeMethodish(node){node.params=[];node.rest=null;node.typeParameters=null;if(isRelational("<")){node.typeParameters=parseTypeParameterDeclaration()}expect(_parenL);while(tokType===_name){node.params.push(parseFunctionTypeParam());if(tokType!==_parenR){expect(_comma)}}if(eat(_ellipsis)){node.rest=parseFunctionTypeParam()}expect(_parenR);expect(_colon);node.returnType=parseType();return finishNode(node,"FunctionTypeAnnotation")}function parseObjectTypeMethod(start,isStatic,key){var node=startNodeAt(start);node.value=parseObjectTypeMethodish(startNodeAt(start));node.static=isStatic;node.key=key;node.optional=false;return finishNode(node,"ObjectTypeProperty")}function parseObjectTypeCallProperty(node,isStatic){var valueNode=startNode();node.static=isStatic;node.value=parseObjectTypeMethodish(valueNode);
return finishNode(node,"ObjectTypeCallProperty")}function parseObjectType(allowStatic){var nodeStart=startNode();var node;var optional=false;var property;var propertyKey;var propertyTypeAnnotation;var token;var isStatic;nodeStart.callProperties=[];nodeStart.properties=[];nodeStart.indexers=[];expect(_braceL);while(tokType!==_braceR){var start=storeCurrentPos();node=startNode();if(allowStatic&&isContextual("static")){next();isStatic=true}if(tokType===_bracketL){nodeStart.indexers.push(parseObjectTypeIndexer(node,isStatic))}else if(tokType===_parenL||isRelational("<")){nodeStart.callProperties.push(parseObjectTypeCallProperty(node,allowStatic))}else{if(isStatic&&tokType===_colon){propertyKey=parseIdent()}else{propertyKey=parseObjectPropertyKey()}if(isRelational("<")||tokType===_parenL){nodeStart.properties.push(parseObjectTypeMethod(start,isStatic,propertyKey))}else{if(eat(_question)){optional=true}expect(_colon);node.key=propertyKey;node.value=parseType();node.optional=optional;node.static=isStatic;nodeStart.properties.push(finishNode(node,"ObjectTypeProperty"))}}if(!eat(_semi)&&tokType!==_braceR){unexpected()}}expect(_braceR);return finishNode(nodeStart,"ObjectTypeAnnotation")}function parseGenericType(start,id){var node=startNodeAt(start);node.typeParameters=null;node.id=id;while(eat(_dot)){var node2=startNodeAt(start);node2.qualification=node.id;node2.id=parseIdent();node.id=finishNode(node2,"QualifiedTypeIdentifier")}if(isRelational("<")){node.typeParameters=parseTypeParameterInstantiation()}return finishNode(node,"GenericTypeAnnotation")}function parseVoidType(){var node=startNode();expect(keywordTypes["void"]);return finishNode(node,"VoidTypeAnnotation")}function parseTypeofType(){var node=startNode();expect(keywordTypes["typeof"]);node.argument=parsePrimaryType();return finishNode(node,"TypeofTypeAnnotation")}function parseTupleType(){var node=startNode();node.types=[];expect(_bracketL);while(tokPos<inputLen&&tokType!==_bracketR){node.types.push(parseType());if(tokType===_bracketR)break;expect(_comma)}expect(_bracketR);return finishNode(node,"TupleTypeAnnotation")}function parseFunctionTypeParam(){var optional=false;var node=startNode();node.name=parseIdent();if(eat(_question)){optional=true}expect(_colon);node.optional=optional;node.typeAnnotation=parseType();return finishNode(node,"FunctionTypeParam")}function parseFunctionTypeParams(){var ret={params:[],rest:null};while(tokType===_name){ret.params.push(parseFunctionTypeParam());if(tokType!==_parenR){expect(_comma)}}if(eat(_ellipsis)){ret.rest=parseFunctionTypeParam()}return ret}function identToTypeAnnotation(start,node,id){switch(id.name){case"any":return finishNode(node,"AnyTypeAnnotation");case"bool":case"boolean":return finishNode(node,"BooleanTypeAnnotation");case"number":return finishNode(node,"NumberTypeAnnotation");case"string":return finishNode(node,"StringTypeAnnotation");default:return parseGenericType(start,id)}}function parsePrimaryType(){var typeIdentifier=null;var params=null;var returnType=null;var start=storeCurrentPos();var node=startNode();var rest=null;var tmp;var typeParameters;var token;var type;var isGroupedType=false;switch(tokType){case _name:return identToTypeAnnotation(start,node,parseIdent());case _braceL:return parseObjectType();case _bracketL:return parseTupleType();case _relational:if(tokVal==="<"){node.typeParameters=parseTypeParameterDeclaration();expect(_parenL);tmp=parseFunctionTypeParams();node.params=tmp.params;node.rest=tmp.rest;expect(_parenR);expect(_arrow);node.returnType=parseType();return finishNode(node,"FunctionTypeAnnotation")}case _parenL:next();var tmpId;if(tokType!==_parenR&&tokType!==_ellipsis){if(tokType===_name){}else{isGroupedType=true}}if(isGroupedType){if(tmpId&&_parenR){type=tmpId}else{type=parseType();expect(_parenR)}if(eat(_arrow)){raise(node,"Unexpected token =>. It looks like "+"you are trying to write a function type, but you ended up "+"writing a grouped type followed by an =>, which is a syntax "+"error. Remember, function type parameters are named so function "+"types look like (name1: type1, name2: type2) => returnType. You "+"probably wrote (type1) => returnType")}return type}tmp=parseFunctionTypeParams();node.params=tmp.params;node.rest=tmp.rest;expect(_parenR);expect(_arrow);node.returnType=parseType();node.typeParameters=null;return finishNode(node,"FunctionTypeAnnotation");case _string:node.value=tokVal;node.raw=input.slice(tokStart,tokEnd);next();return finishNode(node,"StringLiteralTypeAnnotation");default:if(tokType.keyword){switch(tokType.keyword){case"void":return parseVoidType();case"typeof":return parseTypeofType()}}}unexpected()}function parsePostfixType(){var node=startNode();var type=node.elementType=parsePrimaryType();if(tokType===_bracketL){expect(_bracketL);expect(_bracketR);return finishNode(node,"ArrayTypeAnnotation")}return type}function parsePrefixType(){var node=startNode();if(eat(_question)){node.typeAnnotation=parsePrefixType();return finishNode(node,"NullableTypeAnnotation")}return parsePostfixType()}function parseIntersectionType(){var node=startNode();var type=parsePrefixType();node.types=[type];while(eat(_bitwiseAND)){node.types.push(parsePrefixType())}return node.types.length===1?type:finishNode(node,"IntersectionTypeAnnotation")}function parseUnionType(){var node=startNode();var type=parseIntersectionType();node.types=[type];while(eat(_bitwiseOR)){node.types.push(parseIntersectionType())}return node.types.length===1?type:finishNode(node,"UnionTypeAnnotation")}function parseType(){var oldInType=inType;inType=true;var type=parseUnionType();inType=oldInType;return type}function parseTypeAnnotation(){var node=startNode();var oldInType=inType;inType=true;expect(_colon);node.typeAnnotation=parseType();inType=oldInType;return finishNode(node,"TypeAnnotation")}function parseTypeAnnotatableIdentifier(requireTypeAnnotation,canBeOptionalParam){var node=startNode();var ident=parseIdent();var isOptionalParam=false;if(canBeOptionalParam&&eat(_question)){expect(_question);isOptionalParam=true}if(requireTypeAnnotation||tokType===_colon){ident.typeAnnotation=parseTypeAnnotation();finishNode(ident,ident.type)}if(isOptionalParam){ident.optional=true;finishNode(ident,ident.type)}return ident}})},{}],106:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var def=Type.def;var or=Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isNumber=builtin.number;var isBoolean=builtin.boolean;var isRegExp=builtin.RegExp;var shared=require("../lib/shared");var defaults=shared.defaults;var geq=shared.geq;def("Printable").field("loc",or(def("SourceLocation"),null),defaults["null"],true);def("Node").bases("Printable").field("type",isString);def("SourceLocation").build("start","end","source").field("start",def("Position")).field("end",def("Position")).field("source",or(isString,null),defaults["null"]);def("Position").build("line","column").field("line",geq(1)).field("column",geq(0));def("Program").bases("Node").build("body").field("body",[def("Statement")]).field("comments",or([or(def("Block"),def("Line"))],null),defaults["null"],true);def("Function").bases("Node").field("id",or(def("Identifier"),null),defaults["null"]).field("params",[def("Pattern")]).field("body",or(def("BlockStatement"),def("Expression")));def("Statement").bases("Node");def("EmptyStatement").bases("Statement").build();def("BlockStatement").bases("Statement").build("body").field("body",[def("Statement")]);def("ExpressionStatement").bases("Statement").build("expression").field("expression",def("Expression"));def("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Statement")).field("alternate",or(def("Statement"),null),defaults["null"]);def("LabeledStatement").bases("Statement").build("label","body").field("label",def("Identifier")).field("body",def("Statement"));def("BreakStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("ContinueStatement").bases("Statement").build("label").field("label",or(def("Identifier"),null),defaults["null"]);def("WithStatement").bases("Statement").build("object","body").field("object",def("Expression")).field("body",def("Statement"));def("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",def("Expression")).field("cases",[def("SwitchCase")]).field("lexical",isBoolean,defaults["false"]);def("ReturnStatement").bases("Statement").build("argument").field("argument",or(def("Expression"),null));def("ThrowStatement").bases("Statement").build("argument").field("argument",def("Expression"));def("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",def("BlockStatement")).field("handler",or(def("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[def("CatchClause")],function(){return this.handler?[this.handler]:[]},true).field("guardedHandlers",[def("CatchClause")],defaults.emptyArray).field("finalizer",or(def("BlockStatement"),null),defaults["null"]);def("CatchClause").bases("Node").build("param","guard","body").field("param",def("Pattern")).field("guard",or(def("Expression"),null),defaults["null"]).field("body",def("BlockStatement"));def("WhileStatement").bases("Statement").build("test","body").field("test",def("Expression")).field("body",def("Statement"));def("DoWhileStatement").bases("Statement").build("body","test").field("body",def("Statement")).field("test",def("Expression"));def("ForStatement").bases("Statement").build("init","test","update","body").field("init",or(def("VariableDeclaration"),def("Expression"),null)).field("test",or(def("Expression"),null)).field("update",or(def("Expression"),null)).field("body",def("Statement"));def("ForInStatement").bases("Statement").build("left","right","body","each").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement")).field("each",isBoolean);def("DebuggerStatement").bases("Statement").build();def("Declaration").bases("Statement");def("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",def("Identifier"));def("FunctionExpression").bases("Function","Expression").build("id","params","body");def("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",or("var","let","const")).field("declarations",[or(def("VariableDeclarator"),def("Identifier"))]);def("VariableDeclarator").bases("Node").build("id","init").field("id",def("Pattern")).field("init",or(def("Expression"),null));def("Expression").bases("Node","Pattern");def("ThisExpression").bases("Expression").build();def("ArrayExpression").bases("Expression").build("elements").field("elements",[or(def("Expression"),null)]);def("ObjectExpression").bases("Expression").build("properties").field("properties",[def("Property")]);def("Property").bases("Node").build("kind","key","value").field("kind",or("init","get","set")).field("key",or(def("Literal"),def("Identifier"))).field("value",def("Expression"));def("SequenceExpression").bases("Expression").build("expressions").field("expressions",[def("Expression")]);var UnaryOperator=or("-","+","!","~","typeof","void","delete");def("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",UnaryOperator).field("argument",def("Expression")).field("prefix",isBoolean,defaults["true"]);var BinaryOperator=or("==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");def("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",BinaryOperator).field("left",def("Expression")).field("right",def("Expression"));var AssignmentOperator=or("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");def("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",AssignmentOperator).field("left",def("Pattern")).field("right",def("Expression"));var UpdateOperator=or("++","--");def("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",UpdateOperator).field("argument",def("Expression")).field("prefix",isBoolean);var LogicalOperator=or("||","&&");def("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",LogicalOperator).field("left",def("Expression")).field("right",def("Expression"));def("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",def("Expression")).field("consequent",def("Expression")).field("alternate",def("Expression"));def("NewExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("CallExpression").bases("Expression").build("callee","arguments").field("callee",def("Expression")).field("arguments",[def("Expression")]);def("MemberExpression").bases("Expression").build("object","property","computed").field("object",def("Expression")).field("property",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("Pattern").bases("Node");def("ObjectPattern").bases("Pattern").build("properties").field("properties",[def("PropertyPattern")]);def("PropertyPattern").bases("Pattern").build("key","pattern").field("key",or(def("Literal"),def("Identifier"))).field("pattern",def("Pattern"));def("ArrayPattern").bases("Pattern").build("elements").field("elements",[or(def("Pattern"),null)]);def("SwitchCase").bases("Node").build("test","consequent").field("test",or(def("Expression"),null)).field("consequent",[def("Statement")]);def("Identifier").bases("Node","Expression","Pattern").build("name").field("name",isString);def("Literal").bases("Node","Expression").build("value").field("value",or(isString,isBoolean,null,isNumber,isRegExp));def("Block").bases("Printable").build("loc","value").field("value",isString);def("Line").bases("Printable").build("loc","value").field("value",isString)},{"../lib/shared":117,"../lib/types":118}],107:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;def("XMLDefaultDeclaration").bases("Declaration").field("namespace",def("Expression"));def("XMLAnyName").bases("Expression");def("XMLQualifiedIdentifier").bases("Expression").field("left",or(def("Identifier"),def("XMLAnyName"))).field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",or(def("Identifier"),def("Expression"))).field("computed",isBoolean);def("XMLAttributeSelector").bases("Expression").field("attribute",def("Expression"));def("XMLFilterExpression").bases("Expression").field("left",def("Expression")).field("right",def("Expression"));def("XMLElement").bases("XML","Expression").field("contents",[def("XML")]);def("XMLList").bases("XML","Expression").field("contents",[def("XML")]);def("XML").bases("Node");def("XMLEscape").bases("XML").field("expression",def("Expression"));def("XMLText").bases("XML").field("text",isString);def("XMLStartTag").bases("XML").field("contents",[def("XML")]);def("XMLEndTag").bases("XML").field("contents",[def("XML")]);def("XMLPointTag").bases("XML").field("contents",[def("XML")]);def("XMLName").bases("XML").field("contents",or(isString,[def("XML")]));def("XMLAttribute").bases("XML").field("value",isString);def("XMLCdata").bases("XML").field("contents",isString);def("XMLComment").bases("XML").field("contents",isString);def("XMLProcessingInstruction").bases("XML").field("target",isString).field("contents",or(isString,null))},{"../lib/types":118,"./core":106}],108:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var isObject=builtin.object;var isString=builtin.string;var defaults=require("../lib/shared").defaults;def("Function").field("generator",isBoolean,defaults["false"]).field("expression",isBoolean,defaults["false"]).field("defaults",[or(def("Expression"),null)],defaults.emptyArray).field("rest",or(def("Identifier"),null),defaults["null"]);def("FunctionDeclaration").build("id","params","body","generator","expression");def("FunctionExpression").build("id","params","body","generator","expression");def("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,defaults["null"]).field("generator",false);def("YieldExpression").bases("Expression").build("argument","delegate").field("argument",or(def("Expression"),null)).field("delegate",isBoolean,defaults["false"]);def("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",def("Expression")).field("blocks",[def("ComprehensionBlock")]).field("filter",or(def("Expression"),null));def("ComprehensionBlock").bases("Node").build("left","right","each").field("left",def("Pattern")).field("right",def("Expression")).field("each",isBoolean);def("ModuleSpecifier").bases("Literal").build("value").field("value",isString);def("Property").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("method",isBoolean,defaults["false"]).field("shorthand",isBoolean,defaults["false"]).field("computed",isBoolean,defaults["false"]);def("PropertyPattern").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("MethodDefinition").bases("Declaration").build("kind","key","value").field("kind",or("init","get","set","")).field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("value",def("Function")).field("computed",isBoolean,defaults["false"]);def("SpreadElement").bases("Node").build("argument").field("argument",def("Expression"));def("ArrayExpression").field("elements",[or(def("Expression"),def("SpreadElement"),null)]);def("NewExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("CallExpression").field("arguments",[or(def("Expression"),def("SpreadElement"))]);def("SpreadElementPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));var ClassBodyElement=or(def("MethodDefinition"),def("VariableDeclarator"),def("ClassPropertyDefinition"),def("ClassProperty"));def("ClassProperty").bases("Declaration").build("key").field("key",or(def("Literal"),def("Identifier"),def("Expression"))).field("computed",isBoolean,defaults["false"]);def("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",ClassBodyElement);def("ClassBody").bases("Declaration").build("body").field("body",[ClassBodyElement]);def("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",def("Identifier")).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]);def("ClassExpression").bases("Expression").build("id","body","superClass").field("id",or(def("Identifier"),null),defaults["null"]).field("body",def("ClassBody")).field("superClass",or(def("Expression"),null),defaults["null"]).field("implements",[def("ClassImplements")],defaults.emptyArray);def("ClassImplements").bases("Node").build("id").field("id",def("Identifier")).field("superClass",or(def("Expression"),null),defaults["null"]);def("Specifier").bases("Node");def("NamedSpecifier").bases("Specifier").field("id",def("Identifier")).field("name",or(def("Identifier"),null),defaults["null"]);def("ExportSpecifier").bases("NamedSpecifier").build("id","name");def("ExportBatchSpecifier").bases("Specifier").build();def("ImportSpecifier").bases("NamedSpecifier").build("id","name");def("ImportNamespaceSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ImportDefaultSpecifier").bases("Specifier").build("id").field("id",def("Identifier"));def("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",isBoolean).field("declaration",or(def("Declaration"),def("Expression"),null)).field("specifiers",[or(def("ExportSpecifier"),def("ExportBatchSpecifier"))],defaults.emptyArray).field("source",or(def("ModuleSpecifier"),null),defaults["null"]);def("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[or(def("ImportSpecifier"),def("ImportNamespaceSpecifier"),def("ImportDefaultSpecifier"))],defaults.emptyArray).field("source",def("ModuleSpecifier"));def("TaggedTemplateExpression").bases("Expression").field("tag",def("Expression")).field("quasi",def("TemplateLiteral"));def("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[def("TemplateElement")]).field("expressions",[def("Expression")]);def("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:isString,raw:isString}).field("tail",isBoolean)},{"../lib/shared":117,"../lib/types":118,"./core":106}],109:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("Function").field("async",isBoolean,defaults["false"]);def("SpreadProperty").bases("Node").build("argument").field("argument",def("Expression"));def("ObjectExpression").field("properties",[or(def("Property"),def("SpreadProperty"))]);def("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",def("Pattern"));def("ObjectPattern").field("properties",[or(def("PropertyPattern"),def("SpreadPropertyPattern"))]);def("AwaitExpression").bases("Expression").build("argument","all").field("argument",or(def("Expression"),null)).field("all",isBoolean,defaults["false"])},{"../lib/shared":117,"../lib/types":118,"./core":106}],110:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var builtin=types.builtInTypes;var isString=builtin.string;var isBoolean=builtin.boolean;var defaults=require("../lib/shared").defaults;def("XJSAttribute").bases("Node").build("name","value").field("name",or(def("XJSIdentifier"),def("XJSNamespacedName"))).field("value",or(def("Literal"),def("XJSExpressionContainer"),null),defaults["null"]);def("XJSIdentifier").bases("Node").build("name").field("name",isString);def("XJSNamespacedName").bases("Node").build("namespace","name").field("namespace",def("XJSIdentifier")).field("name",def("XJSIdentifier"));def("XJSMemberExpression").bases("MemberExpression").build("object","property").field("object",or(def("XJSIdentifier"),def("XJSMemberExpression"))).field("property",def("XJSIdentifier")).field("computed",isBoolean,defaults.false);var XJSElementName=or(def("XJSIdentifier"),def("XJSNamespacedName"),def("XJSMemberExpression"));def("XJSSpreadAttribute").bases("Node").build("argument").field("argument",def("Expression"));var XJSAttributes=[or(def("XJSAttribute"),def("XJSSpreadAttribute"))];def("XJSExpressionContainer").bases("Expression").build("expression").field("expression",def("Expression"));def("XJSElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",def("XJSOpeningElement")).field("closingElement",or(def("XJSClosingElement"),null),defaults["null"]).field("children",[or(def("XJSElement"),def("XJSExpressionContainer"),def("XJSText"),def("Literal"))],defaults.emptyArray).field("name",XJSElementName,function(){return this.openingElement.name}).field("selfClosing",isBoolean,function(){return this.openingElement.selfClosing}).field("attributes",XJSAttributes,function(){return this.openingElement.attributes});def("XJSOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",XJSElementName).field("attributes",XJSAttributes,defaults.emptyArray).field("selfClosing",isBoolean,defaults["false"]);def("XJSClosingElement").bases("Node").build("name").field("name",XJSElementName);def("XJSText").bases("Literal").build("value").field("value",isString);def("XJSEmptyExpression").bases("Expression").build();def("Type").bases("Node");def("AnyTypeAnnotation").bases("Type");def("VoidTypeAnnotation").bases("Type");def("NumberTypeAnnotation").bases("Type");def("StringTypeAnnotation").bases("Type");def("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",isString).field("raw",isString);def("BooleanTypeAnnotation").bases("Type");def("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",def("Type"));def("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",def("Type"));def("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[def("FunctionTypeParam")]).field("returnType",def("Type")).field("rest",or(def("FunctionTypeParam"),null)).field("typeParameters",or(def("TypeParameterDeclaration"),null));def("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",def("Identifier")).field("typeAnnotation",def("Type")).field("optional",isBoolean);def("ArrayTypeAnnotation").bases("Type").build("elementType").field("elementType",def("Type"));def("ObjectTypeAnnotation").bases("Type").build("properties").field("properties",[def("ObjectTypeProperty")]).field("indexers",[def("ObjectTypeIndexer")],defaults.emptyArray).field("callProperties",[def("ObjectTypeCallProperty")],defaults.emptyArray);def("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",or(def("Literal"),def("Identifier"))).field("value",def("Type")).field("optional",isBoolean);def("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",def("Identifier")).field("key",def("Type")).field("value",def("Type"));def("ObjectTypeCallProperty").bases("Node").build("value").field("value",def("FunctionTypeAnnotation")).field("static",isBoolean,false);def("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("id",def("Identifier"));def("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",or(def("Identifier"),def("QualifiedTypeIdentifier"))).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("MemberTypeAnnotation").bases("Type").build("object","property").field("object",def("Identifier")).field("property",or(def("MemberTypeAnnotation"),def("GenericTypeAnnotation")));def("UnionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",def("Type"));def("Identifier").field("typeAnnotation",or(def("TypeAnnotation"),null),defaults["null"]);def("TypeParameterDeclaration").bases("Node").build("params").field("params",[def("Identifier")]);def("TypeParameterInstantiation").bases("Node").build("params").field("params",[def("Type")]);def("Function").field("returnType",or(def("TypeAnnotation"),null),defaults["null"]).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]);def("ClassProperty").build("key","typeAnnotation").field("typeAnnotation",def("TypeAnnotation")).field("static",isBoolean,false);def("ClassImplements").field("typeParameters",or(def("TypeParameterInstantiation"),null),defaults["null"]);def("InterfaceDeclaration").bases("Statement").build("id","body","extends").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null),defaults["null"]).field("body",def("ObjectTypeAnnotation")).field("extends",[def("InterfaceExtends")]);def("InterfaceExtends").bases("Node").build("id").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterInstantiation"),null));def("TypeAlias").bases("Statement").build("id","typeParameters","right").field("id",def("Identifier")).field("typeParameters",or(def("TypeParameterDeclaration"),null)).field("right",def("Type"));def("TupleTypeAnnotation").bases("Type").build("types").field("types",[def("Type")]);def("DeclareVariable").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareFunction").bases("Statement").build("id").field("id",def("Identifier"));def("DeclareClass").bases("InterfaceDeclaration").build("id");def("DeclareModule").bases("Statement").build("id","body").field("id",or(def("Identifier"),def("Literal"))).field("body",def("BlockStatement"))},{"../lib/shared":117,"../lib/types":118,"./core":106}],111:[function(require,module,exports){require("./core");var types=require("../lib/types");var def=types.Type.def;var or=types.Type.or;var geq=require("../lib/shared").geq;def("ForOfStatement").bases("Statement").build("left","right","body").field("left",or(def("VariableDeclaration"),def("Expression"))).field("right",def("Expression")).field("body",def("Statement"));def("LetStatement").bases("Statement").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Statement"));def("LetExpression").bases("Expression").build("head","body").field("head",[def("VariableDeclarator")]).field("body",def("Expression"));def("GraphExpression").bases("Expression").build("index","expression").field("index",geq(0)).field("expression",def("Literal"));def("GraphIndexExpression").bases("Expression").build("index").field("index",geq(0))},{"../lib/shared":117,"../lib/types":118,"./core":106}],112:[function(require,module,exports){var assert=require("assert");var types=require("../main");var getFieldNames=types.getFieldNames;var getFieldValue=types.getFieldValue;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isDate=types.builtInTypes.Date;var isRegExp=types.builtInTypes.RegExp;var hasOwn=Object.prototype.hasOwnProperty;function astNodesAreEquivalent(a,b,problemPath){if(isArray.check(problemPath)){problemPath.length=0}else{problemPath=null}return areEquivalent(a,b,problemPath)}astNodesAreEquivalent.assert=function(a,b){var problemPath=[];if(!astNodesAreEquivalent(a,b,problemPath)){if(problemPath.length===0){assert.strictEqual(a,b)}else{assert.ok(false,"Nodes differ in the following path: "+problemPath.map(subscriptForProperty).join(""))}}};function subscriptForProperty(property){if(/[_$a-z][_$a-z0-9]*/i.test(property)){return"."+property}return"["+JSON.stringify(property)+"]"}function areEquivalent(a,b,problemPath){if(a===b){return true}if(isArray.check(a)){return arraysAreEquivalent(a,b,problemPath)}if(isObject.check(a)){return objectsAreEquivalent(a,b,problemPath)}if(isDate.check(a)){return isDate.check(b)&&+a===+b}if(isRegExp.check(a)){return isRegExp.check(b)&&(a.source===b.source&&a.global===b.global&&a.multiline===b.multiline&&a.ignoreCase===b.ignoreCase)}return a==b}function arraysAreEquivalent(a,b,problemPath){isArray.assert(a);var aLength=a.length;if(!isArray.check(b)||b.length!==aLength){if(problemPath){problemPath.push("length")}return false}for(var i=0;i<aLength;++i){if(problemPath){problemPath.push(i)}if(i in a!==i in b){return false}if(!areEquivalent(a[i],b[i],problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),i)}}return true}function objectsAreEquivalent(a,b,problemPath){isObject.assert(a);if(!isObject.check(b)){return false}if(a.type!==b.type){if(problemPath){problemPath.push("type")}return false}var aNames=getFieldNames(a);var aNameCount=aNames.length;var bNames=getFieldNames(b);var bNameCount=bNames.length;if(aNameCount===bNameCount){for(var i=0;i<aNameCount;++i){var name=aNames[i];var aChild=getFieldValue(a,name);var bChild=getFieldValue(b,name);if(problemPath){problemPath.push(name)
}if(!areEquivalent(aChild,bChild,problemPath)){return false}if(problemPath){assert.strictEqual(problemPath.pop(),name)}}return true}if(!problemPath){return false}var seenNames=Object.create(null);for(i=0;i<aNameCount;++i){seenNames[aNames[i]]=true}for(i=0;i<bNameCount;++i){name=bNames[i];if(!hasOwn.call(seenNames,name)){problemPath.push(name);return false}delete seenNames[name]}for(name in seenNames){problemPath.push(name);break}return false}module.exports=astNodesAreEquivalent},{"../main":119,assert:121}],113:[function(require,module,exports){var assert=require("assert");var types=require("./types");var n=types.namedTypes;var b=types.builders;var isNumber=types.builtInTypes.number;var isArray=types.builtInTypes.array;var Path=require("./path");var Scope=require("./scope");function NodePath(value,parentPath,name){assert.ok(this instanceof NodePath);Path.call(this,value,parentPath,name)}require("util").inherits(NodePath,Path);var NPp=NodePath.prototype;Object.defineProperties(NPp,{node:{get:function(){Object.defineProperty(this,"node",{configurable:true,value:this._computeNode()});return this.node}},parent:{get:function(){Object.defineProperty(this,"parent",{configurable:true,value:this._computeParent()});return this.parent}},scope:{get:function(){Object.defineProperty(this,"scope",{configurable:true,value:this._computeScope()});return this.scope}}});NPp.replace=function(){delete this.node;delete this.parent;delete this.scope;return Path.prototype.replace.apply(this,arguments)};NPp.prune=function(){var remainingNodePath=this.parent;this.replace();return cleanUpNodesAfterPrune(remainingNodePath)};NPp._computeNode=function(){var value=this.value;if(n.Node.check(value)){return value}var pp=this.parentPath;return pp&&pp.node||null};NPp._computeParent=function(){var value=this.value;var pp=this.parentPath;if(!n.Node.check(value)){while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}if(pp){pp=pp.parentPath}}while(pp&&!n.Node.check(pp.value)){pp=pp.parentPath}return pp||null};NPp._computeScope=function(){var value=this.value;var pp=this.parentPath;var scope=pp&&pp.scope;if(n.Node.check(value)&&Scope.isEstablishedBy(value)){scope=new Scope(this,scope)}return scope||null};NPp.getValueProperty=function(name){return types.getFieldValue(this.value,name)};NPp.needsParens=function(assumeExpressionContext){var pp=this.parentPath;if(!pp){return false}var node=this.value;if(!n.Expression.check(node)){return false}if(node.type==="Identifier"){return false}while(!n.Node.check(pp.value)){pp=pp.parentPath;if(!pp){return false}}var parent=pp.value;switch(node.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return parent.type==="MemberExpression"&&this.name==="object"&&parent.object===node;case"BinaryExpression":case"LogicalExpression":switch(parent.type){case"CallExpression":return this.name==="callee"&&parent.callee===node;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return true;case"MemberExpression":return this.name==="object"&&parent.object===node;case"BinaryExpression":case"LogicalExpression":var po=parent.operator;var pp=PRECEDENCE[po];var no=node.operator;var np=PRECEDENCE[no];if(pp>np){return true}if(pp===np&&this.name==="right"){assert.strictEqual(parent.right,node);return true}default:return false}case"SequenceExpression":switch(parent.type){case"ForStatement":return false;case"ExpressionStatement":return this.name!=="expression";default:return true}case"YieldExpression":switch(parent.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return true;default:return false}case"Literal":return parent.type==="MemberExpression"&&isNumber.check(node.value)&&this.name==="object"&&parent.object===node;case"AssignmentExpression":case"ConditionalExpression":switch(parent.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return true;case"CallExpression":return this.name==="callee"&&parent.callee===node;case"ConditionalExpression":return this.name==="test"&&parent.test===node;case"MemberExpression":return this.name==="object"&&parent.object===node;default:return false}default:if(parent.type==="NewExpression"&&this.name==="callee"&&parent.callee===node){return containsCallExpression(node)}}if(assumeExpressionContext!==true&&!this.canBeFirstInStatement()&&this.firstInStatement())return true;return false};function isBinary(node){return n.BinaryExpression.check(node)||n.LogicalExpression.check(node)}function isUnaryLike(node){return n.UnaryExpression.check(node)||n.SpreadElement&&n.SpreadElement.check(node)||n.SpreadProperty&&n.SpreadProperty.check(node)}var PRECEDENCE={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(tier,i){tier.forEach(function(op){PRECEDENCE[op]=i})});function containsCallExpression(node){if(n.CallExpression.check(node)){return true}if(isArray.check(node)){return node.some(containsCallExpression)}if(n.Node.check(node)){return types.someField(node,function(name,child){return containsCallExpression(child)})}return false}NPp.canBeFirstInStatement=function(){var node=this.node;return!n.FunctionExpression.check(node)&&!n.ObjectExpression.check(node)};NPp.firstInStatement=function(){return firstInStatement(this)};function firstInStatement(path){for(var node,parent;path.parent;path=path.parent){node=path.node;parent=path.parent.node;if(n.BlockStatement.check(parent)&&path.parent.name==="body"&&path.name===0){assert.strictEqual(parent.body[0],node);return true}if(n.ExpressionStatement.check(parent)&&path.name==="expression"){assert.strictEqual(parent.expression,node);return true}if(n.SequenceExpression.check(parent)&&path.parent.name==="expressions"&&path.name===0){assert.strictEqual(parent.expressions[0],node);continue}if(n.CallExpression.check(parent)&&path.name==="callee"){assert.strictEqual(parent.callee,node);continue}if(n.MemberExpression.check(parent)&&path.name==="object"){assert.strictEqual(parent.object,node);continue}if(n.ConditionalExpression.check(parent)&&path.name==="test"){assert.strictEqual(parent.test,node);continue}if(isBinary(parent)&&path.name==="left"){assert.strictEqual(parent.left,node);continue}if(n.UnaryExpression.check(parent)&&!parent.prefix&&path.name==="argument"){assert.strictEqual(parent.argument,node);continue}return false}return true}function cleanUpNodesAfterPrune(remainingNodePath){if(n.VariableDeclaration.check(remainingNodePath.node)){var declarations=remainingNodePath.get("declarations").value;if(!declarations||declarations.length===0){return remainingNodePath.prune()}}else if(n.ExpressionStatement.check(remainingNodePath.node)){if(!remainingNodePath.get("expression").value){return remainingNodePath.prune()}}else if(n.IfStatement.check(remainingNodePath.node)){cleanUpIfStatementAfterPrune(remainingNodePath)}return remainingNodePath}function cleanUpIfStatementAfterPrune(ifStatement){var testExpression=ifStatement.get("test").value;var alternate=ifStatement.get("alternate").value;var consequent=ifStatement.get("consequent").value;if(!consequent&&!alternate){var testExpressionStatement=b.expressionStatement(testExpression);ifStatement.replace(testExpressionStatement)}else if(!consequent&&alternate){var negatedTestExpression=b.unaryExpression("!",testExpression,true);if(n.UnaryExpression.check(testExpression)&&testExpression.operator==="!"){negatedTestExpression=testExpression.argument}ifStatement.get("test").replace(negatedTestExpression);ifStatement.get("consequent").replace(alternate);ifStatement.get("alternate").replace()}}module.exports=NodePath},{"./path":115,"./scope":116,"./types":118,assert:121,util:145}],114:[function(require,module,exports){var assert=require("assert");var types=require("./types");var NodePath=require("./node-path");var Node=types.namedTypes.Node;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var isFunction=types.builtInTypes.function;var hasOwn=Object.prototype.hasOwnProperty;var undefined;function PathVisitor(){assert.ok(this instanceof PathVisitor);this._reusableContextStack=[];this._methodNameTable=computeMethodNameTable(this);this.Context=makeContextConstructor(this);this._visiting=false;this._changeReported=false}function computeMethodNameTable(visitor){var typeNames=Object.create(null);for(var methodName in visitor){if(/^visit[A-Z]/.test(methodName)){typeNames[methodName.slice("visit".length)]=true}}var supertypeTable=types.computeSupertypeLookupTable(typeNames);var methodNameTable=Object.create(null);var typeNames=Object.keys(supertypeTable);var typeNameCount=typeNames.length;for(var i=0;i<typeNameCount;++i){var typeName=typeNames[i];methodName="visit"+supertypeTable[typeName];if(isFunction.check(visitor[methodName])){methodNameTable[typeName]=methodName}}return methodNameTable}PathVisitor.fromMethodsObject=function fromMethodsObject(methods){if(methods instanceof PathVisitor){return methods}if(!isObject.check(methods)){return new PathVisitor}function Visitor(){assert.ok(this instanceof Visitor);PathVisitor.call(this)}var Vp=Visitor.prototype=Object.create(PVp);Vp.constructor=Visitor;extend(Vp,methods);extend(Visitor,PathVisitor);isFunction.assert(Visitor.fromMethodsObject);isFunction.assert(Visitor.visit);return new Visitor};function extend(target,source){for(var property in source){if(hasOwn.call(source,property)){target[property]=source[property]}}return target}PathVisitor.visit=function visit(node,methods){return PathVisitor.fromMethodsObject(methods).visit(node)};var PVp=PathVisitor.prototype;var recursiveVisitWarning=["Recursively calling visitor.visit(path) resets visitor state.","Try this.visit(path) or this.traverse(path) instead."].join(" ");PVp.visit=function(){assert.ok(!this._visiting,recursiveVisitWarning);this._visiting=true;this._changeReported=false;var argc=arguments.length;var args=new Array(argc);for(var i=0;i<argc;++i){args[i]=arguments[i]}if(!(args[0]instanceof NodePath)){args[0]=new NodePath({root:args[0]}).get("root")}this.reset.apply(this,args);try{return this.visitWithoutReset(args[0])}finally{this._visiting=false}};PVp.reset=function(path){};PVp.visitWithoutReset=function(path){if(this instanceof this.Context){return this.visitor.visitWithoutReset(path)}assert.ok(path instanceof NodePath);var value=path.value;var methodName=Node.check(value)&&this._methodNameTable[value.type];if(methodName){var context=this.acquireContext(path);try{return context.invokeVisitorMethod(methodName)}finally{this.releaseContext(context)}}else{return visitChildren(path,this)}};function visitChildren(path,visitor){assert.ok(path instanceof NodePath);assert.ok(visitor instanceof PathVisitor);var value=path.value;if(isArray.check(value)){path.each(visitor.visitWithoutReset,visitor)}else if(!isObject.check(value)){}else{var childNames=types.getFieldNames(value);var childCount=childNames.length;var childPaths=[];for(var i=0;i<childCount;++i){var childName=childNames[i];if(!hasOwn.call(value,childName)){value[childName]=types.getFieldValue(value,childName)}childPaths.push(path.get(childName))}for(var i=0;i<childCount;++i){visitor.visitWithoutReset(childPaths[i])}}return path.value}PVp.acquireContext=function(path){if(this._reusableContextStack.length===0){return new this.Context(path)}return this._reusableContextStack.pop().reset(path)};PVp.releaseContext=function(context){assert.ok(context instanceof this.Context);this._reusableContextStack.push(context);context.currentPath=null};PVp.reportChanged=function(){this._changeReported=true};PVp.wasChangeReported=function(){return this._changeReported};function makeContextConstructor(visitor){function Context(path){assert.ok(this instanceof Context);assert.ok(this instanceof PathVisitor);assert.ok(path instanceof NodePath);Object.defineProperty(this,"visitor",{value:visitor,writable:false,enumerable:true,configurable:false});this.currentPath=path;this.needToCallTraverse=true;Object.seal(this)}assert.ok(visitor instanceof PathVisitor);var Cp=Context.prototype=Object.create(visitor);Cp.constructor=Context;extend(Cp,sharedContextProtoMethods);return Context}var sharedContextProtoMethods=Object.create(null);sharedContextProtoMethods.reset=function reset(path){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);this.currentPath=path;this.needToCallTraverse=true;return this};sharedContextProtoMethods.invokeVisitorMethod=function invokeVisitorMethod(methodName){assert.ok(this instanceof this.Context);assert.ok(this.currentPath instanceof NodePath);var result=this.visitor[methodName].call(this,this.currentPath);if(result===false){this.needToCallTraverse=false}else if(result!==undefined){this.currentPath=this.currentPath.replace(result)[0];if(this.needToCallTraverse){this.traverse(this.currentPath)}}assert.strictEqual(this.needToCallTraverse,false,"Must either call this.traverse or return false in "+methodName);var path=this.currentPath;return path&&path.value};sharedContextProtoMethods.traverse=function traverse(path,newVisitor){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);assert.ok(this.currentPath instanceof NodePath);this.needToCallTraverse=false;return visitChildren(path,PathVisitor.fromMethodsObject(newVisitor||this.visitor))};sharedContextProtoMethods.visit=function visit(path,newVisitor){assert.ok(this instanceof this.Context);assert.ok(path instanceof NodePath);assert.ok(this.currentPath instanceof NodePath);this.needToCallTraverse=false;return PathVisitor.fromMethodsObject(newVisitor||this.visitor).visitWithoutReset(path)};sharedContextProtoMethods.reportChanged=function reportChanged(){this.visitor.reportChanged()};module.exports=PathVisitor},{"./node-path":113,"./types":118,assert:121}],115:[function(require,module,exports){var assert=require("assert");var Op=Object.prototype;var hasOwn=Op.hasOwnProperty;var types=require("./types");var isArray=types.builtInTypes.array;var isNumber=types.builtInTypes.number;var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;function Path(value,parentPath,name){assert.ok(this instanceof Path);if(parentPath){assert.ok(parentPath instanceof Path)}else{parentPath=null;name=null}this.value=value;this.parentPath=parentPath;this.name=name;this.__childCache=null}var Pp=Path.prototype;function getChildCache(path){return path.__childCache||(path.__childCache=Object.create(null))}function getChildPath(path,name){var cache=getChildCache(path);var actualChildValue=path.getValueProperty(name);var childPath=cache[name];if(!hasOwn.call(cache,name)||childPath.value!==actualChildValue){childPath=cache[name]=new path.constructor(actualChildValue,path,name)}return childPath}Pp.getValueProperty=function getValueProperty(name){return this.value[name]};Pp.get=function get(name){var path=this;var names=arguments;var count=names.length;for(var i=0;i<count;++i){path=getChildPath(path,names[i])}return path};Pp.each=function each(callback,context){var childPaths=[];var len=this.value.length;var i=0;for(var i=0;i<len;++i){if(hasOwn.call(this.value,i)){childPaths[i]=this.get(i)}}context=context||this;for(i=0;i<len;++i){if(hasOwn.call(childPaths,i)){callback.call(context,childPaths[i])}}};Pp.map=function map(callback,context){var result=[];this.each(function(childPath){result.push(callback.call(this,childPath))},context);return result};Pp.filter=function filter(callback,context){var result=[];this.each(function(childPath){if(callback.call(this,childPath)){result.push(childPath)}},context);return result};function emptyMoves(){}function getMoves(path,offset,start,end){isArray.assert(path.value);if(offset===0){return emptyMoves}var length=path.value.length;if(length<1){return emptyMoves}var argc=arguments.length;if(argc===2){start=0;end=length}else if(argc===3){start=Math.max(start,0);end=length}else{start=Math.max(start,0);end=Math.min(end,length)}isNumber.assert(start);isNumber.assert(end);var moves=Object.create(null);var cache=getChildCache(path);for(var i=start;i<end;++i){if(hasOwn.call(path.value,i)){var childPath=path.get(i);assert.strictEqual(childPath.name,i);var newIndex=i+offset;childPath.name=newIndex;moves[newIndex]=childPath;delete cache[i]}}delete cache.length;return function(){for(var newIndex in moves){var childPath=moves[newIndex];assert.strictEqual(childPath.name,+newIndex);cache[newIndex]=childPath;path.value[newIndex]=childPath.value}}}Pp.shift=function shift(){var move=getMoves(this,-1);var result=this.value.shift();move();return result};Pp.unshift=function unshift(node){var move=getMoves(this,arguments.length);var result=this.value.unshift.apply(this.value,arguments);move();return result};Pp.push=function push(node){isArray.assert(this.value);delete getChildCache(this).length;return this.value.push.apply(this.value,arguments)};Pp.pop=function pop(){isArray.assert(this.value);var cache=getChildCache(this);delete cache[this.value.length-1];delete cache.length;return this.value.pop()};Pp.insertAt=function insertAt(index,node){var argc=arguments.length;var move=getMoves(this,argc-1,index);if(move===emptyMoves){return this}index=Math.max(index,0);for(var i=1;i<argc;++i){this.value[index+i-1]=arguments[i]}move();return this};Pp.insertBefore=function insertBefore(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};Pp.insertAfter=function insertAfter(node){var pp=this.parentPath;var argc=arguments.length;var insertAtArgs=[this.name+1];for(var i=0;i<argc;++i){insertAtArgs.push(arguments[i])}return pp.insertAt.apply(pp,insertAtArgs)};function repairRelationshipWithParent(path){assert.ok(path instanceof Path);var pp=path.parentPath;if(!pp){return path}var parentValue=pp.value;var parentCache=getChildCache(pp);if(parentValue[path.name]===path.value){parentCache[path.name]=path}else if(isArray.check(parentValue)){var i=parentValue.indexOf(path.value);if(i>=0){parentCache[path.name=i]=path}}else{parentValue[path.name]=path.value;parentCache[path.name]=path}assert.strictEqual(parentValue[path.name],path.value);assert.strictEqual(path.parentPath.get(path.name),path);return path}Pp.replace=function replace(replacement){var results=[];var parentValue=this.parentPath.value;var parentCache=getChildCache(this.parentPath);var count=arguments.length;repairRelationshipWithParent(this);if(isArray.check(parentValue)){var originalLength=parentValue.length;var move=getMoves(this.parentPath,count-1,this.name+1);var spliceArgs=[this.name,1];for(var i=0;i<count;++i){spliceArgs.push(arguments[i])}var splicedOut=parentValue.splice.apply(parentValue,spliceArgs);assert.strictEqual(splicedOut[0],this.value);assert.strictEqual(parentValue.length,originalLength-1+count);move();if(count===0){delete this.value;delete parentCache[this.name];this.__childCache=null}else{assert.strictEqual(parentValue[this.name],replacement);if(this.value!==replacement){this.value=replacement;this.__childCache=null}for(i=0;i<count;++i){results.push(this.parentPath.get(this.name+i))}assert.strictEqual(results[0],this)}}else if(count===1){if(this.value!==replacement){this.__childCache=null}this.value=parentValue[this.name]=replacement;results.push(this)}else if(count===0){delete parentValue[this.name];delete this.value;this.__childCache=null}else{assert.ok(false,"Could not replace path")}return results};module.exports=Path},{"./types":118,assert:121}],116:[function(require,module,exports){var assert=require("assert");var types=require("./types");var Type=types.Type;var namedTypes=types.namedTypes;var Node=namedTypes.Node;var Expression=namedTypes.Expression;var isArray=types.builtInTypes.array;var hasOwn=Object.prototype.hasOwnProperty;var b=types.builders;function Scope(path,parentScope){assert.ok(this instanceof Scope);assert.ok(path instanceof require("./node-path"));ScopeType.assert(path.value);var depth;if(parentScope){assert.ok(parentScope instanceof Scope);depth=parentScope.depth+1}else{parentScope=null;depth=0}Object.defineProperties(this,{path:{value:path},node:{value:path.value},isGlobal:{value:!parentScope,enumerable:true},depth:{value:depth},parent:{value:parentScope},bindings:{value:{}}})}var scopeTypes=[namedTypes.Program,namedTypes.Function,namedTypes.CatchClause];var ScopeType=Type.or.apply(Type,scopeTypes);Scope.isEstablishedBy=function(node){return ScopeType.check(node)};var Sp=Scope.prototype;Sp.didScan=false;Sp.declares=function(name){this.scan();return hasOwn.call(this.bindings,name)};Sp.declareTemporary=function(prefix){if(prefix){assert.ok(/^[a-z$_]/i.test(prefix),prefix)}else{prefix="t$"}prefix+=this.depth.toString(36)+"$";this.scan();var index=0;while(this.declares(prefix+index)){++index}var name=prefix+index;return this.bindings[name]=types.builders.identifier(name)};Sp.injectTemporary=function(identifier,init){identifier||(identifier=this.declareTemporary());var bodyPath=this.path.get("body");if(namedTypes.BlockStatement.check(bodyPath.value)){bodyPath=bodyPath.get("body")}bodyPath.unshift(b.variableDeclaration("var",[b.variableDeclarator(identifier,init||null)]));return identifier};Sp.scan=function(force){if(force||!this.didScan){for(var name in this.bindings){delete this.bindings[name]}scanScope(this.path,this.bindings);this.didScan=true}};Sp.getBindings=function(){this.scan();return this.bindings};function scanScope(path,bindings){var node=path.value;ScopeType.assert(node);if(namedTypes.CatchClause.check(node)){addPattern(path.get("param"),bindings)}else{recursiveScanScope(path,bindings)}}function recursiveScanScope(path,bindings){var node=path.value;if(path.parent&&namedTypes.FunctionExpression.check(path.parent.node)&&path.parent.node.id){addPattern(path.parent.get("id"),bindings)}if(!node){}else if(isArray.check(node)){path.each(function(childPath){recursiveScanChild(childPath,bindings)})}else if(namedTypes.Function.check(node)){path.get("params").each(function(paramPath){addPattern(paramPath,bindings)});recursiveScanChild(path.get("body"),bindings)}else if(namedTypes.VariableDeclarator.check(node)){addPattern(path.get("id"),bindings);recursiveScanChild(path.get("init"),bindings)}else if(node.type==="ImportSpecifier"||node.type==="ImportNamespaceSpecifier"||node.type==="ImportDefaultSpecifier"){addPattern(node.name?path.get("name"):path.get("id"),bindings)}else if(Node.check(node)&&!Expression.check(node)){types.eachField(node,function(name,child){var childPath=path.get(name);assert.strictEqual(childPath.value,child);recursiveScanChild(childPath,bindings)})}}function recursiveScanChild(path,bindings){var node=path.value;if(!node||Expression.check(node)){}else if(namedTypes.FunctionDeclaration.check(node)){addPattern(path.get("id"),bindings)}else if(namedTypes.ClassDeclaration&&namedTypes.ClassDeclaration.check(node)){addPattern(path.get("id"),bindings)}else if(ScopeType.check(node)){if(namedTypes.CatchClause.check(node)){var catchParamName=node.param.name;var hadBinding=hasOwn.call(bindings,catchParamName);recursiveScanScope(path.get("body"),bindings);if(!hadBinding){delete bindings[catchParamName]}}}else{recursiveScanScope(path,bindings)}}function addPattern(patternPath,bindings){var pattern=patternPath.value;namedTypes.Pattern.assert(pattern);if(namedTypes.Identifier.check(pattern)){if(hasOwn.call(bindings,pattern.name)){bindings[pattern.name].push(patternPath)}else{bindings[pattern.name]=[patternPath]}}else if(namedTypes.SpreadElement&&namedTypes.SpreadElement.check(pattern)){addPattern(patternPath.get("argument"),bindings)}}Sp.lookup=function(name){for(var scope=this;scope;scope=scope.parent)if(scope.declares(name))break;return scope};Sp.getGlobalScope=function(){var scope=this;while(!scope.isGlobal)scope=scope.parent;return scope};module.exports=Scope},{"./node-path":113,"./types":118,assert:121}],117:[function(require,module,exports){var types=require("../lib/types");var Type=types.Type;var builtin=types.builtInTypes;var isNumber=builtin.number;exports.geq=function(than){return new Type(function(value){return isNumber.check(value)&&value>=than},isNumber+" >= "+than)};exports.defaults={"null":function(){return null},emptyArray:function(){return[]},"false":function(){return false},"true":function(){return true},undefined:function(){}};var naiveIsPrimitive=Type.or(builtin.string,builtin.number,builtin.boolean,builtin.null,builtin.undefined);exports.isPrimitive=new Type(function(value){if(value===null)return true;var type=typeof value;return!(type==="object"||type==="function")},naiveIsPrimitive.toString())},{"../lib/types":118}],118:[function(require,module,exports){var assert=require("assert");var Ap=Array.prototype;var slice=Ap.slice;var map=Ap.map;var each=Ap.forEach;var Op=Object.prototype;var objToStr=Op.toString;var funObjStr=objToStr.call(function(){});var strObjStr=objToStr.call("");var hasOwn=Op.hasOwnProperty;function Type(check,name){var self=this;assert.ok(self instanceof Type,self);assert.strictEqual(objToStr.call(check),funObjStr,check+" is not a function");var nameObjStr=objToStr.call(name);assert.ok(nameObjStr===funObjStr||nameObjStr===strObjStr,name+" is neither a function nor a string");Object.defineProperties(self,{name:{value:name},check:{value:function(value,deep){var result=check.call(self,value,deep);if(!result&&deep&&objToStr.call(deep)===funObjStr)deep(self,value);return result}}})}var Tp=Type.prototype;exports.Type=Type;Tp.assert=function(value,deep){if(!this.check(value,deep)){var str=shallowStringify(value);assert.ok(false,str+" does not match type "+this);return false}return true};function shallowStringify(value){if(isObject.check(value))return"{"+Object.keys(value).map(function(key){return key+": "+value[key]}).join(", ")+"}";if(isArray.check(value))return"["+value.map(shallowStringify).join(", ")+"]";return JSON.stringify(value)}Tp.toString=function(){var name=this.name;if(isString.check(name))return name;if(isFunction.check(name))return name.call(this)+"";return name+" type"};var builtInTypes={};exports.builtInTypes=builtInTypes;function defBuiltInType(example,name){var objStr=objToStr.call(example);Object.defineProperty(builtInTypes,name,{enumerable:true,value:new Type(function(value){return objToStr.call(value)===objStr},name)});return builtInTypes[name]}var isString=defBuiltInType("","string");var isFunction=defBuiltInType(function(){},"function");var isArray=defBuiltInType([],"array");var isObject=defBuiltInType({},"object");var isRegExp=defBuiltInType(/./,"RegExp");var isDate=defBuiltInType(new Date,"Date");var isNumber=defBuiltInType(3,"number");var isBoolean=defBuiltInType(true,"boolean");var isNull=defBuiltInType(null,"null");var isUndefined=defBuiltInType(void 0,"undefined");function toType(from,name){if(from instanceof Type)return from;if(from instanceof Def)return from.type;if(isArray.check(from))return Type.fromArray(from);if(isObject.check(from))return Type.fromObject(from);if(isFunction.check(from))return new Type(from,name);return new Type(function(value){return value===from},isUndefined.check(name)?function(){return from+""}:name)}Type.or=function(){var types=[];var len=arguments.length;for(var i=0;i<len;++i)types.push(toType(arguments[i]));return new Type(function(value,deep){for(var i=0;i<len;++i)if(types[i].check(value,deep))return true;return false},function(){return types.join(" | ")})};Type.fromArray=function(arr){assert.ok(isArray.check(arr));assert.strictEqual(arr.length,1,"only one element type is permitted for typed arrays");return toType(arr[0]).arrayOf()};Tp.arrayOf=function(){var elemType=this;return new Type(function(value,deep){return isArray.check(value)&&value.every(function(elem){return elemType.check(elem,deep)})},function(){return"["+elemType+"]"})};Type.fromObject=function(obj){var fields=Object.keys(obj).map(function(name){return new Field(name,obj[name])});return new Type(function(value,deep){return isObject.check(value)&&fields.every(function(field){return field.type.check(value[field.name],deep)})},function(){return"{ "+fields.join(", ")+" }"})};function Field(name,type,defaultFn,hidden){var self=this;assert.ok(self instanceof Field);isString.assert(name);type=toType(type);var properties={name:{value:name},type:{value:type},hidden:{value:!!hidden}};if(isFunction.check(defaultFn)){properties.defaultFn={value:defaultFn}}Object.defineProperties(self,properties)}var Fp=Field.prototype;Fp.toString=function(){return JSON.stringify(this.name)+": "+this.type};Fp.getValue=function(obj){var value=obj[this.name];if(!isUndefined.check(value))return value;if(this.defaultFn)value=this.defaultFn.call(obj);return value};Type.def=function(typeName){isString.assert(typeName);return hasOwn.call(defCache,typeName)?defCache[typeName]:defCache[typeName]=new Def(typeName)};var defCache=Object.create(null);function Def(typeName){var self=this;assert.ok(self instanceof Def);Object.defineProperties(self,{typeName:{value:typeName},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new Type(function(value,deep){return self.check(value,deep)},typeName)}})}Def.fromValue=function(value){if(value&&typeof value==="object"){var type=value.type;if(typeof type==="string"&&hasOwn.call(defCache,type)){var d=defCache[type];if(d.finalized){return d}}}return null};var Dp=Def.prototype;Dp.isSupertypeOf=function(that){if(that instanceof Def){assert.strictEqual(this.finalized,true);assert.strictEqual(that.finalized,true);return hasOwn.call(that.allSupertypes,this.typeName)}else{assert.ok(false,that+" is not a Def")}};exports.getSupertypeNames=function(typeName){assert.ok(hasOwn.call(defCache,typeName));var d=defCache[typeName];assert.strictEqual(d.finalized,true);return d.supertypeList.slice(1)};exports.computeSupertypeLookupTable=function(candidates){var table={};var typeNames=Object.keys(defCache);var typeNameCount=typeNames.length;for(var i=0;i<typeNameCount;++i){var typeName=typeNames[i];var d=defCache[typeName];assert.strictEqual(d.finalized,true);for(var j=0;j<d.supertypeList.length;++j){var superTypeName=d.supertypeList[j];if(hasOwn.call(candidates,superTypeName)){table[typeName]=superTypeName;break}}}return table};Dp.checkAllFields=function(value,deep){var allFields=this.allFields;assert.strictEqual(this.finalized,true);function checkFieldByName(name){var field=allFields[name];var type=field.type;var child=field.getValue(value);return type.check(child,deep)}return isObject.check(value)&&Object.keys(allFields).every(checkFieldByName)};Dp.check=function(value,deep){assert.strictEqual(this.finalized,true,"prematurely checking unfinalized type "+this.typeName);if(!isObject.check(value))return false;var vDef=Def.fromValue(value);if(!vDef){if(this.typeName==="SourceLocation"||this.typeName==="Position"){return this.checkAllFields(value,deep)}return false}if(deep&&vDef===this)return this.checkAllFields(value,deep);if(!this.isSupertypeOf(vDef))return false;if(!deep)return true;return vDef.checkAllFields(value,deep)&&this.checkAllFields(value,false)};Dp.bases=function(){var bases=this.baseNames;assert.strictEqual(this.finalized,false);each.call(arguments,function(baseName){isString.assert(baseName);if(bases.indexOf(baseName)<0)bases.push(baseName)});return this};Object.defineProperty(Dp,"buildable",{value:false});var builders={};exports.builders=builders;var nodePrototype={};exports.defineMethod=function(name,func){var old=nodePrototype[name];if(isUndefined.check(func)){delete nodePrototype[name]}else{isFunction.assert(func);Object.defineProperty(nodePrototype,name,{enumerable:true,configurable:true,value:func})}return old};Dp.build=function(){var self=this;Object.defineProperty(self,"buildParams",{value:slice.call(arguments),writable:false,enumerable:false,configurable:true});assert.strictEqual(self.finalized,false);
isString.arrayOf().assert(self.buildParams);if(self.buildable){return self}self.field("type",self.typeName,function(){return self.typeName});Object.defineProperty(self,"buildable",{value:true});Object.defineProperty(builders,getBuilderName(self.typeName),{enumerable:true,value:function(){var args=arguments;var argc=args.length;var built=Object.create(nodePrototype);assert.ok(self.finalized,"attempting to instantiate unfinalized type "+self.typeName);function add(param,i){if(hasOwn.call(built,param))return;var all=self.allFields;assert.ok(hasOwn.call(all,param),param);var field=all[param];var type=field.type;var value;if(isNumber.check(i)&&i<argc){value=args[i]}else if(field.defaultFn){value=field.defaultFn.call(built)}else{var message="no value or default function given for field "+JSON.stringify(param)+" of "+self.typeName+"("+self.buildParams.map(function(name){return all[name]}).join(", ")+")";assert.ok(false,message)}if(!type.check(value)){assert.ok(false,shallowStringify(value)+" does not match field "+field+" of type "+self.typeName)}built[param]=value}self.buildParams.forEach(function(param,i){add(param,i)});Object.keys(self.allFields).forEach(function(param){add(param)});assert.strictEqual(built.type,self.typeName);return built}});return self};function getBuilderName(typeName){return typeName.replace(/^[A-Z]+/,function(upperCasePrefix){var len=upperCasePrefix.length;switch(len){case 0:return"";case 1:return upperCasePrefix.toLowerCase();default:return upperCasePrefix.slice(0,len-1).toLowerCase()+upperCasePrefix.charAt(len-1)}})}Dp.field=function(name,type,defaultFn,hidden){assert.strictEqual(this.finalized,false);this.ownFields[name]=new Field(name,type,defaultFn,hidden);return this};var namedTypes={};exports.namedTypes=namedTypes;function getFieldNames(object){var d=Def.fromValue(object);if(d){return d.fieldNames.slice(0)}if("type"in object){assert.ok(false,"did not recognize object of type "+JSON.stringify(object.type))}return Object.keys(object)}exports.getFieldNames=getFieldNames;function getFieldValue(object,fieldName){var d=Def.fromValue(object);if(d){var field=d.allFields[fieldName];if(field){return field.getValue(object)}}return object[fieldName]}exports.getFieldValue=getFieldValue;exports.eachField=function(object,callback,context){getFieldNames(object).forEach(function(name){callback.call(this,name,getFieldValue(object,name))},context)};exports.someField=function(object,callback,context){return getFieldNames(object).some(function(name){return callback.call(this,name,getFieldValue(object,name))},context)};Object.defineProperty(Dp,"finalized",{value:false});Dp.finalize=function(){if(!this.finalized){var allFields=this.allFields;var allSupertypes=this.allSupertypes;this.baseNames.forEach(function(name){var def=defCache[name];def.finalize();extend(allFields,def.allFields);extend(allSupertypes,def.allSupertypes)});extend(allFields,this.ownFields);allSupertypes[this.typeName]=this;this.fieldNames.length=0;for(var fieldName in allFields){if(hasOwn.call(allFields,fieldName)&&!allFields[fieldName].hidden){this.fieldNames.push(fieldName)}}Object.defineProperty(namedTypes,this.typeName,{enumerable:true,value:this.type});Object.defineProperty(this,"finalized",{value:true});populateSupertypeList(this.typeName,this.supertypeList)}};function populateSupertypeList(typeName,list){list.length=0;list.push(typeName);var lastSeen=Object.create(null);for(var pos=0;pos<list.length;++pos){typeName=list[pos];var d=defCache[typeName];assert.strictEqual(d.finalized,true);if(hasOwn.call(lastSeen,typeName)){delete list[lastSeen[typeName]]}lastSeen[typeName]=pos;list.push.apply(list,d.baseNames)}for(var to=0,from=to,len=list.length;from<len;++from){if(hasOwn.call(list,from)){list[to++]=list[from]}}list.length=to}function extend(into,from){Object.keys(from).forEach(function(name){into[name]=from[name]});return into}exports.finalize=function(){Object.keys(defCache).forEach(function(name){defCache[name].finalize()})}},{assert:121}],119:[function(require,module,exports){var types=require("./lib/types");require("./def/core");require("./def/es6");require("./def/es7");require("./def/mozilla");require("./def/e4x");require("./def/fb-harmony");types.finalize();exports.Type=types.Type;exports.builtInTypes=types.builtInTypes;exports.namedTypes=types.namedTypes;exports.builders=types.builders;exports.defineMethod=types.defineMethod;exports.getFieldNames=types.getFieldNames;exports.getFieldValue=types.getFieldValue;exports.eachField=types.eachField;exports.someField=types.someField;exports.getSupertypeNames=types.getSupertypeNames;exports.astNodesAreEquivalent=require("./lib/equiv");exports.finalize=types.finalize;exports.NodePath=require("./lib/node-path");exports.PathVisitor=require("./lib/path-visitor");exports.visit=exports.PathVisitor.visit},{"./def/core":106,"./def/e4x":107,"./def/es6":108,"./def/es7":109,"./def/fb-harmony":110,"./def/mozilla":111,"./lib/equiv":112,"./lib/node-path":113,"./lib/path-visitor":114,"./lib/types":118}],120:[function(require,module,exports){},{}],121:[function(require,module,exports){var util=require("util/");var pSlice=Array.prototype.slice;var hasOwn=Object.prototype.hasOwnProperty;var assert=module.exports=ok;assert.AssertionError=function AssertionError(options){this.name="AssertionError";this.actual=options.actual;this.expected=options.expected;this.operator=options.operator;if(options.message){this.message=options.message;this.generatedMessage=false}else{this.message=getMessage(this);this.generatedMessage=true}var stackStartFunction=options.stackStartFunction||fail;if(Error.captureStackTrace){Error.captureStackTrace(this,stackStartFunction)}else{var err=new Error;if(err.stack){var out=err.stack;var fn_name=stackStartFunction.name;var idx=out.indexOf("\n"+fn_name);if(idx>=0){var next_line=out.indexOf("\n",idx+1);out=out.substring(next_line+1)}this.stack=out}}};util.inherits(assert.AssertionError,Error);function replacer(key,value){if(util.isUndefined(value)){return""+value}if(util.isNumber(value)&&!isFinite(value)){return value.toString()}if(util.isFunction(value)||util.isRegExp(value)){return value.toString()}return value}function truncate(s,n){if(util.isString(s)){return s.length<n?s:s.slice(0,n)}else{return s}}function getMessage(self){return truncate(JSON.stringify(self.actual,replacer),128)+" "+self.operator+" "+truncate(JSON.stringify(self.expected,replacer),128)}function fail(actual,expected,message,operator,stackStartFunction){throw new assert.AssertionError({message:message,actual:actual,expected:expected,operator:operator,stackStartFunction:stackStartFunction})}assert.fail=fail;function ok(value,message){if(!value)fail(value,true,message,"==",assert.ok)}assert.ok=ok;assert.equal=function equal(actual,expected,message){if(actual!=expected)fail(actual,expected,message,"==",assert.equal)};assert.notEqual=function notEqual(actual,expected,message){if(actual==expected){fail(actual,expected,message,"!=",assert.notEqual)}};assert.deepEqual=function deepEqual(actual,expected,message){if(!_deepEqual(actual,expected)){fail(actual,expected,message,"deepEqual",assert.deepEqual)}};function _deepEqual(actual,expected){if(actual===expected){return true}else if(util.isBuffer(actual)&&util.isBuffer(expected)){if(actual.length!=expected.length)return false;for(var i=0;i<actual.length;i++){if(actual[i]!==expected[i])return false}return true}else if(util.isDate(actual)&&util.isDate(expected)){return actual.getTime()===expected.getTime()}else if(util.isRegExp(actual)&&util.isRegExp(expected)){return actual.source===expected.source&&actual.global===expected.global&&actual.multiline===expected.multiline&&actual.lastIndex===expected.lastIndex&&actual.ignoreCase===expected.ignoreCase}else if(!util.isObject(actual)&&!util.isObject(expected)){return actual==expected}else{return objEquiv(actual,expected)}}function isArguments(object){return Object.prototype.toString.call(object)=="[object Arguments]"}function objEquiv(a,b){if(util.isNullOrUndefined(a)||util.isNullOrUndefined(b))return false;if(a.prototype!==b.prototype)return false;if(util.isPrimitive(a)||util.isPrimitive(b)){return a===b}var aIsArgs=isArguments(a),bIsArgs=isArguments(b);if(aIsArgs&&!bIsArgs||!aIsArgs&&bIsArgs)return false;if(aIsArgs){a=pSlice.call(a);b=pSlice.call(b);return _deepEqual(a,b)}var ka=objectKeys(a),kb=objectKeys(b),key,i;if(ka.length!=kb.length)return false;ka.sort();kb.sort();for(i=ka.length-1;i>=0;i--){if(ka[i]!=kb[i])return false}for(i=ka.length-1;i>=0;i--){key=ka[i];if(!_deepEqual(a[key],b[key]))return false}return true}assert.notDeepEqual=function notDeepEqual(actual,expected,message){if(_deepEqual(actual,expected)){fail(actual,expected,message,"notDeepEqual",assert.notDeepEqual)}};assert.strictEqual=function strictEqual(actual,expected,message){if(actual!==expected){fail(actual,expected,message,"===",assert.strictEqual)}};assert.notStrictEqual=function notStrictEqual(actual,expected,message){if(actual===expected){fail(actual,expected,message,"!==",assert.notStrictEqual)}};function expectedException(actual,expected){if(!actual||!expected){return false}if(Object.prototype.toString.call(expected)=="[object RegExp]"){return expected.test(actual)}else if(actual instanceof expected){return true}else if(expected.call({},actual)===true){return true}return false}function _throws(shouldThrow,block,expected,message){var actual;if(util.isString(expected)){message=expected;expected=null}try{block()}catch(e){actual=e}message=(expected&&expected.name?" ("+expected.name+").":".")+(message?" "+message:".");if(shouldThrow&&!actual){fail(actual,expected,"Missing expected exception"+message)}if(!shouldThrow&&expectedException(actual,expected)){fail(actual,expected,"Got unwanted exception"+message)}if(shouldThrow&&actual&&expected&&!expectedException(actual,expected)||!shouldThrow&&actual){throw actual}}assert.throws=function(block,error,message){_throws.apply(this,[true].concat(pSlice.call(arguments)))};assert.doesNotThrow=function(block,message){_throws.apply(this,[false].concat(pSlice.call(arguments)))};assert.ifError=function(err){if(err){throw err}};var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj){if(hasOwn.call(obj,key))keys.push(key)}return keys}},{"util/":145}],122:[function(require,module,exports){var base64=require("base64-js");var ieee754=require("ieee754");var isArray=require("is-array");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.poolSize=8192;var kMaxLength=1073741823;var rootParent={};Buffer.TYPED_ARRAY_SUPPORT=function(){try{var buf=new ArrayBuffer(0);var arr=new Uint8Array(buf);arr.foo=function(){return 42};return 42===arr.foo()&&typeof arr.subarray==="function"&&new Uint8Array(1).subarray(1,1).byteLength===0}catch(e){return false}}();function Buffer(subject,encoding,noZero){if(!(this instanceof Buffer))return new Buffer(subject,encoding,noZero);var type=typeof subject;var length;if(type==="number")length=subject>0?subject>>>0:0;else if(type==="string"){length=Buffer.byteLength(subject,encoding)}else if(type==="object"&&subject!==null){if(subject.type==="Buffer"&&isArray(subject.data))subject=subject.data;length=+subject.length>0?Math.floor(+subject.length):0}else throw new TypeError("must start with number, buffer, array or string");if(length>kMaxLength)throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength.toString(16)+" bytes");var buf;if(Buffer.TYPED_ARRAY_SUPPORT){buf=Buffer._augment(new Uint8Array(length))}else{buf=this;buf.length=length;buf._isBuffer=true}var i;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof subject.byteLength==="number"){buf._set(subject)}else if(isArrayish(subject)){if(Buffer.isBuffer(subject)){for(i=0;i<length;i++)buf[i]=subject.readUInt8(i)}else{for(i=0;i<length;i++)buf[i]=(subject[i]%256+256)%256}}else if(type==="string"){buf.write(subject,0,encoding)}else if(type==="number"&&!Buffer.TYPED_ARRAY_SUPPORT&&!noZero){for(i=0;i<length;i++){buf[i]=0}}if(length>0&&length<=Buffer.poolSize)buf.parent=rootParent;return buf}function SlowBuffer(subject,encoding,noZero){if(!(this instanceof SlowBuffer))return new SlowBuffer(subject,encoding,noZero);var buf=new Buffer(subject,encoding,noZero);delete buf.parent;return buf}Buffer.isBuffer=function(b){return!!(b!=null&&b._isBuffer)};Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");var x=a.length;var y=b.length;for(var i=0,len=Math.min(x,y);i<len&&a[i]===b[i];i++){}if(i!==len){x=a[i];y=b[i]}if(x<y)return-1;if(y<x)return 1;return 0};Buffer.isEncoding=function(encoding){switch(String(encoding).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function(list,totalLength){if(!isArray(list))throw new TypeError("Usage: Buffer.concat(list[, length])");if(list.length===0){return new Buffer(0)}else if(list.length===1){return list[0]}var i;if(totalLength===undefined){totalLength=0;for(i=0;i<list.length;i++){totalLength+=list[i].length}}var buf=new Buffer(totalLength);var pos=0;for(i=0;i<list.length;i++){var item=list[i];item.copy(buf,pos);pos+=item.length}return buf};Buffer.byteLength=function(str,encoding){var ret;str=str+"";switch(encoding||"utf8"){case"ascii":case"binary":case"raw":ret=str.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=str.length*2;break;case"hex":ret=str.length>>>1;break;case"utf8":case"utf-8":ret=utf8ToBytes(str).length;break;case"base64":ret=base64ToBytes(str).length;break;default:ret=str.length}return ret};Buffer.prototype.length=undefined;Buffer.prototype.parent=undefined;Buffer.prototype.toString=function(encoding,start,end){var loweredCase=false;start=start>>>0;end=end===undefined||end===Infinity?this.length:end>>>0;if(!encoding)encoding="utf8";if(start<0)start=0;if(end>this.length)end=this.length;if(end<=start)return"";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"binary":return binarySlice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}};Buffer.prototype.equals=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)===0};Buffer.prototype.inspect=function(){var str="";var max=exports.INSPECT_MAX_BYTES;if(this.length>0){str=this.toString("hex",0,max).match(/.{2}/g).join(" ");if(this.length>max)str+=" ... "}return"<Buffer "+str+">"};Buffer.prototype.compare=function(b){if(!Buffer.isBuffer(b))throw new TypeError("Argument must be a Buffer");return Buffer.compare(this,b)};Buffer.prototype.get=function(offset){console.log(".get() is deprecated. Access using array indexes instead.");return this.readUInt8(offset)};Buffer.prototype.set=function(v,offset){console.log(".set() is deprecated. Access using array indexes instead.");return this.writeUInt8(v,offset)};function hexWrite(buf,string,offset,length){offset=Number(offset)||0;var remaining=buf.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}var strLen=string.length;if(strLen%2!==0)throw new Error("Invalid hex string");if(length>strLen/2){length=strLen/2}for(var i=0;i<length;i++){var byte=parseInt(string.substr(i*2,2),16);if(isNaN(byte))throw new Error("Invalid hex string");buf[offset+i]=byte}return i}function utf8Write(buf,string,offset,length){var charsWritten=blitBuffer(utf8ToBytes(string,buf.length-offset),buf,offset,length);return charsWritten}function asciiWrite(buf,string,offset,length){var charsWritten=blitBuffer(asciiToBytes(string),buf,offset,length);return charsWritten}function binaryWrite(buf,string,offset,length){return asciiWrite(buf,string,offset,length)}function base64Write(buf,string,offset,length){var charsWritten=blitBuffer(base64ToBytes(string),buf,offset,length);return charsWritten}function utf16leWrite(buf,string,offset,length){var charsWritten=blitBuffer(utf16leToBytes(string,buf.length-offset),buf,offset,length,2);return charsWritten}Buffer.prototype.write=function(string,offset,length,encoding){if(isFinite(offset)){if(!isFinite(length)){encoding=length;length=undefined}}else{var swap=encoding;encoding=offset;offset=length;length=swap}offset=Number(offset)||0;if(length<0||offset<0||offset>this.length)throw new RangeError("attempt to write outside buffer bounds");var remaining=this.length-offset;if(!length){length=remaining}else{length=Number(length);if(length>remaining){length=remaining}}encoding=String(encoding||"utf8").toLowerCase();var ret;switch(encoding){case"hex":ret=hexWrite(this,string,offset,length);break;case"utf8":case"utf-8":ret=utf8Write(this,string,offset,length);break;case"ascii":ret=asciiWrite(this,string,offset,length);break;case"binary":ret=binaryWrite(this,string,offset,length);break;case"base64":ret=base64Write(this,string,offset,length);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":ret=utf16leWrite(this,string,offset,length);break;default:throw new TypeError("Unknown encoding: "+encoding)}return ret};Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){var res="";var tmp="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){if(buf[i]<=127){res+=decodeUtf8Char(tmp)+String.fromCharCode(buf[i]);tmp=""}else{tmp+="%"+buf[i].toString(16)}}return res+decodeUtf8Char(tmp)}function asciiSlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i]&127)}return ret}function binarySlice(buf,start,end){var ret="";end=Math.min(buf.length,end);for(var i=start;i<end;i++){ret+=String.fromCharCode(buf[i])}return ret}function hexSlice(buf,start,end){var len=buf.length;if(!start||start<0)start=0;if(!end||end<0||end>len)end=len;var out="";for(var i=start;i<end;i++){out+=toHex(buf[i])}return out}function utf16leSlice(buf,start,end){var bytes=buf.slice(start,end);var res="";for(var i=0;i<bytes.length;i+=2){res+=String.fromCharCode(bytes[i]+bytes[i+1]*256)}return res}Buffer.prototype.slice=function(start,end){var len=this.length;start=~~start;end=end===undefined?len:~~end;if(start<0){start+=len;if(start<0)start=0}else if(start>len){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(end<start)end=start;var newBuf;if(Buffer.TYPED_ARRAY_SUPPORT){newBuf=Buffer._augment(this.subarray(start,end))}else{var sliceLen=end-start;newBuf=new Buffer(sliceLen,undefined,true);for(var i=0;i<sliceLen;i++){newBuf[i]=this[i+start]}}if(newBuf.length)newBuf.parent=this.parent||this;return newBuf};function checkOffset(offset,ext,length){if(offset%1!==0||offset<0)throw new RangeError("offset is not uint");if(offset+ext>length)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;return val};Buffer.prototype.readUIntBE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset+--byteLength];var mul=1;while(byteLength>0&&(mul*=256))val+=this[offset+--byteLength]*mul;return val};Buffer.prototype.readUInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readIntLE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var val=this[offset];var mul=1;var i=0;while(++i<byteLength&&(mul*=256))val+=this[offset+i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);var i=byteLength;var mul=1;var val=this[offset+--i];while(i>0&&(mul*=256))val+=this[offset+--i]*mul;mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function(offset,noAssert){if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,2,this.length);var val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readFloatLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function(offset,noAssert){if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError("buffer must be a Buffer instance");if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range")}Buffer.prototype.writeUIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var mul=1;var i=0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength),0);var i=byteLength-1;var mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=value/mul>>>0&255;return offset+byteLength};Buffer.prototype.writeUInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);this[offset]=value;return offset+1};function objectWriteUInt16(buf,value,offset,littleEndian){if(value<0)value=65535+value+1;for(var i=0,j=Math.min(buf.length-offset,2);i<j;i++){buf[offset+i]=(value&255<<8*(littleEndian?i:1-i))>>>(littleEndian?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeUInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};function objectWriteUInt32(buf,value,offset,littleEndian){if(value<0)value=4294967295+value+1;for(var i=0,j=Math.min(buf.length-offset,4);i<j;i++){buf[offset+i]=value>>>(littleEndian?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeUInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};Buffer.prototype.writeIntLE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=0;var mul=1;var sub=value<0?1:0;this[offset]=value&255;while(++i<byteLength&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeIntBE=function(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkInt(this,value,offset,byteLength,Math.pow(2,8*byteLength-1)-1,-Math.pow(2,8*byteLength-1))}var i=byteLength-1;var mul=1;var sub=value<0?1:0;this[offset+i]=value&255;while(--i>=0&&(mul*=256))this[offset+i]=(value/mul>>0)-sub&255;return offset+byteLength};Buffer.prototype.writeInt8=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)value=Math.floor(value);if(value<0)value=255+value+1;this[offset]=value;return offset+1};Buffer.prototype.writeInt16LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8}else objectWriteUInt16(this,value,offset,true);return offset+2};Buffer.prototype.writeInt16BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>8;this[offset+1]=value}else objectWriteUInt16(this,value,offset,false);return offset+2};Buffer.prototype.writeInt32LE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24}else objectWriteUInt32(this,value,offset,true);return offset+4};Buffer.prototype.writeInt32BE=function(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value}else objectWriteUInt32(this,value,offset,false);return offset+4};function checkIEEE754(buf,value,offset,ext,max,min){if(value>max||value<min)throw new RangeError("value is out of bounds");if(offset+ext>buf.length)throw new RangeError("index out of range");if(offset<0)throw new RangeError("index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,4,3.4028234663852886e38,-3.4028234663852886e38);ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){if(!noAssert)checkIEEE754(buf,value,offset,8,1.7976931348623157e308,-1.7976931348623157e308);ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function(target,target_start,start,end){var source=this;if(!start)start=0;if(!end&&end!==0)end=this.length;if(target_start>=target.length)target_start=target.length;if(!target_start)target_start=0;if(end>0&&end<start)end=start;if(end===start)return 0;if(target.length===0||source.length===0)return 0;if(target_start<0)throw new RangeError("targetStart out of bounds");if(start<0||start>=source.length)throw new RangeError("sourceStart out of bounds");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-target_start<end-start)end=target.length-target_start+start;var len=end-start;if(len<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(var i=0;i<len;i++){target[i+target_start]=this[i+start]}}else{target._set(this.subarray(start,start+len),target_start)}return len};Buffer.prototype.fill=function(value,start,end){if(!value)value=0;if(!start)start=0;if(!end)end=this.length;if(end<start)throw new RangeError("end < start");if(end===start)return;if(this.length===0)return;if(start<0||start>=this.length)throw new RangeError("start out of bounds");if(end<0||end>this.length)throw new RangeError("end out of bounds");var i;if(typeof value==="number"){for(i=start;i<end;i++){this[i]=value}}else{var bytes=utf8ToBytes(value.toString());var len=bytes.length;for(i=start;i<end;i++){this[i]=bytes[i%len]}}return this};Buffer.prototype.toArrayBuffer=function(){if(typeof Uint8Array!=="undefined"){if(Buffer.TYPED_ARRAY_SUPPORT){return new Buffer(this).buffer}else{var buf=new Uint8Array(this.length);for(var i=0,len=buf.length;i<len;i+=1){buf[i]=this[i]}return buf.buffer}}else{throw new TypeError("Buffer.toArrayBuffer not supported in this browser")}};var BP=Buffer.prototype;Buffer._augment=function(arr){arr.constructor=Buffer;arr._isBuffer=true;arr._get=arr.get;arr._set=arr.set;arr.get=BP.get;arr.set=BP.set;arr.write=BP.write;arr.toString=BP.toString;arr.toLocaleString=BP.toString;arr.toJSON=BP.toJSON;arr.equals=BP.equals;arr.compare=BP.compare;arr.copy=BP.copy;arr.slice=BP.slice;arr.readUIntLE=BP.readUIntLE;arr.readUIntBE=BP.readUIntBE;arr.readUInt8=BP.readUInt8;arr.readUInt16LE=BP.readUInt16LE;arr.readUInt16BE=BP.readUInt16BE;arr.readUInt32LE=BP.readUInt32LE;arr.readUInt32BE=BP.readUInt32BE;arr.readIntLE=BP.readIntLE;arr.readIntBE=BP.readIntBE;arr.readInt8=BP.readInt8;arr.readInt16LE=BP.readInt16LE;arr.readInt16BE=BP.readInt16BE;arr.readInt32LE=BP.readInt32LE;arr.readInt32BE=BP.readInt32BE;arr.readFloatLE=BP.readFloatLE;arr.readFloatBE=BP.readFloatBE;arr.readDoubleLE=BP.readDoubleLE;arr.readDoubleBE=BP.readDoubleBE;arr.writeUInt8=BP.writeUInt8;arr.writeUIntLE=BP.writeUIntLE;arr.writeUIntBE=BP.writeUIntBE;arr.writeUInt16LE=BP.writeUInt16LE;arr.writeUInt16BE=BP.writeUInt16BE;arr.writeUInt32LE=BP.writeUInt32LE;arr.writeUInt32BE=BP.writeUInt32BE;arr.writeIntLE=BP.writeIntLE;arr.writeIntBE=BP.writeIntBE;arr.writeInt8=BP.writeInt8;arr.writeInt16LE=BP.writeInt16LE;
arr.writeInt16BE=BP.writeInt16BE;arr.writeInt32LE=BP.writeInt32LE;arr.writeInt32BE=BP.writeInt32BE;arr.writeFloatLE=BP.writeFloatLE;arr.writeFloatBE=BP.writeFloatBE;arr.writeDoubleLE=BP.writeDoubleLE;arr.writeDoubleBE=BP.writeDoubleBE;arr.fill=BP.fill;arr.inspect=BP.inspect;arr.toArrayBuffer=BP.toArrayBuffer;return arr};var INVALID_BASE64_RE=/[^+\/0-9A-z\-]/g;function base64clean(str){str=stringtrim(str).replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function stringtrim(str){if(str.trim)return str.trim();return str.replace(/^\s+|\s+$/g,"")}function isArrayish(subject){return isArray(subject)||Buffer.isBuffer(subject)||subject&&typeof subject==="object"&&typeof subject.length==="number"}function toHex(n){if(n<16)return"0"+n.toString(16);return n.toString(16)}function utf8ToBytes(string,units){var codePoint,length=string.length;var leadSurrogate=null;units=units||Infinity;var bytes=[];var i=0;for(;i<length;i++){codePoint=string.charCodeAt(i);if(codePoint>55295&&codePoint<57344){if(leadSurrogate){if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}else{codePoint=leadSurrogate-55296<<10|codePoint-56320|65536;leadSurrogate=null}}else{if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}else{leadSurrogate=codePoint;continue}}}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=null}if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<2097152){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){var byteArray=[];for(var i=0;i<str.length;i++){byteArray.push(str.charCodeAt(i)&255)}return byteArray}function utf16leToBytes(str,units){var c,hi,lo;var byteArray=[];for(var i=0;i<str.length;i++){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length,unitSize){if(unitSize)length-=length%unitSize;for(var i=0;i<length;i++){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function decodeUtf8Char(str){try{return decodeURIComponent(str)}catch(err){return String.fromCharCode(65533)}}},{"base64-js":123,ieee754:124,"is-array":125}],123:[function(require,module,exports){var lookup="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";(function(exports){"use strict";var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var PLUS="+".charCodeAt(0);var SLASH="/".charCodeAt(0);var NUMBER="0".charCodeAt(0);var LOWER="a".charCodeAt(0);var UPPER="A".charCodeAt(0);var PLUS_URL_SAFE="-".charCodeAt(0);var SLASH_URL_SAFE="_".charCodeAt(0);function decode(elt){var code=elt.charCodeAt(0);if(code===PLUS||code===PLUS_URL_SAFE)return 62;if(code===SLASH||code===SLASH_URL_SAFE)return 63;if(code<NUMBER)return-1;if(code<NUMBER+10)return code-NUMBER+26+26;if(code<UPPER+26)return code-UPPER;if(code<LOWER+26)return code-LOWER+26}function b64ToByteArray(b64){var i,j,l,tmp,placeHolders,arr;if(b64.length%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var len=b64.length;placeHolders="="===b64.charAt(len-2)?2:"="===b64.charAt(len-1)?1:0;arr=new Arr(b64.length*3/4-placeHolders);l=placeHolders>0?b64.length-4:b64.length;var L=0;function push(v){arr[L++]=v}for(i=0,j=0;i<l;i+=4,j+=3){tmp=decode(b64.charAt(i))<<18|decode(b64.charAt(i+1))<<12|decode(b64.charAt(i+2))<<6|decode(b64.charAt(i+3));push((tmp&16711680)>>16);push((tmp&65280)>>8);push(tmp&255)}if(placeHolders===2){tmp=decode(b64.charAt(i))<<2|decode(b64.charAt(i+1))>>4;push(tmp&255)}else if(placeHolders===1){tmp=decode(b64.charAt(i))<<10|decode(b64.charAt(i+1))<<4|decode(b64.charAt(i+2))>>2;push(tmp>>8&255);push(tmp&255)}return arr}function uint8ToBase64(uint8){var i,extraBytes=uint8.length%3,output="",temp,length;function encode(num){return lookup.charAt(num)}function tripletToBase64(num){return encode(num>>18&63)+encode(num>>12&63)+encode(num>>6&63)+encode(num&63)}for(i=0,length=uint8.length-extraBytes;i<length;i+=3){temp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output+=tripletToBase64(temp)}switch(extraBytes){case 1:temp=uint8[uint8.length-1];output+=encode(temp>>2);output+=encode(temp<<4&63);output+="==";break;case 2:temp=(uint8[uint8.length-2]<<8)+uint8[uint8.length-1];output+=encode(temp>>10);output+=encode(temp>>4&63);output+=encode(temp<<2&63);output+="=";break}return output}exports.toByteArray=b64ToByteArray;exports.fromByteArray=uint8ToBase64})(typeof exports==="undefined"?this.base64js={}:exports)},{}],124:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){var e,m,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,nBits=-7,i=isLE?nBytes-1:0,d=isLE?-1:1,s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8);m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8);if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c,eLen=nBytes*8-mLen-1,eMax=(1<<eLen)-1,eBias=eMax>>1,rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=isLE?0:nBytes-1,d=isLE?1:-1,s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8);e=e<<mLen|m;eLen+=mLen;for(;eLen>0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8);buffer[offset+i-d]|=s*128}},{}],125:[function(require,module,exports){var isArray=Array.isArray;var str=Object.prototype.toString;module.exports=isArray||function(val){return!!val&&"[object Array]"==str.call(val)}},{}],126:[function(require,module,exports){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throw TypeError("n must be a positive number");this._maxListeners=n;return this};EventEmitter.prototype.emit=function(type){var er,handler,len,args,i,listeners;if(!this._events)this._events={};if(type==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){er=arguments[1];if(er instanceof Error){throw er}throw TypeError('Uncaught, unspecified "error" event.')}}handler=this._events[type];if(isUndefined(handler))return false;if(isFunction(handler)){switch(arguments.length){case 1:handler.call(this);break;case 2:handler.call(this,arguments[1]);break;case 3:handler.call(this,arguments[1],arguments[2]);break;default:len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];handler.apply(this,args)}}else if(isObject(handler)){len=arguments.length;args=new Array(len-1);for(i=1;i<len;i++)args[i-1]=arguments[i];listeners=handler.slice();len=listeners.length;for(i=0;i<len;i++)listeners[i].apply(this,args)}return true};EventEmitter.prototype.addListener=function(type,listener){var m;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",type,isFunction(listener.listener)?listener.listener:listener);if(!this._events[type])this._events[type]=listener;else if(isObject(this._events[type]))this._events[type].push(listener);else this._events[type]=[this._events[type],listener];if(isObject(this._events[type])&&!this._events[type].warned){var m;if(!isUndefined(this._maxListeners)){m=this._maxListeners}else{m=EventEmitter.defaultMaxListeners}if(m&&m>0&&this._events[type].length>m){this._events[type].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[type].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(type,listener){if(!isFunction(listener))throw TypeError("listener must be a function");var fired=false;function g(){this.removeListener(type,g);if(!fired){fired=true;listener.apply(this,arguments)}}g.listener=listener;this.on(type,g);return this};EventEmitter.prototype.removeListener=function(type,listener){var list,position,length,i;if(!isFunction(listener))throw TypeError("listener must be a function");if(!this._events||!this._events[type])return this;list=this._events[type];length=list.length;position=-1;if(list===listener||isFunction(list.listener)&&list.listener===listener){delete this._events[type];if(this._events.removeListener)this.emit("removeListener",type,listener)}else if(isObject(list)){for(i=length;i-->0;){if(list[i]===listener||list[i].listener&&list[i].listener===listener){position=i;break}}if(position<0)return this;if(list.length===1){list.length=0;delete this._events[type]}else{list.splice(position,1)}if(this._events.removeListener)this.emit("removeListener",type,listener)}return this};EventEmitter.prototype.removeAllListeners=function(type){var key,listeners;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[type])delete this._events[type];return this}if(arguments.length===0){for(key in this._events){if(key==="removeListener")continue;this.removeAllListeners(key)}this.removeAllListeners("removeListener");this._events={};return this}listeners=this._events[type];if(isFunction(listeners)){this.removeListener(type,listeners)}else{while(listeners.length)this.removeListener(type,listeners[listeners.length-1])}delete this._events[type];return this};EventEmitter.prototype.listeners=function(type){var ret;if(!this._events||!this._events[type])ret=[];else if(isFunction(this._events[type]))ret=[this._events[type]];else ret=this._events[type].slice();return ret};EventEmitter.listenerCount=function(emitter,type){var ret;if(!emitter._events||!emitter._events[type])ret=0;else if(isFunction(emitter._events[type]))ret=1;else ret=emitter._events[type].length;return ret};function isFunction(arg){return typeof arg==="function"}function isNumber(arg){return typeof arg==="number"}function isObject(arg){return typeof arg==="object"&&arg!==null}function isUndefined(arg){return arg===void 0}},{}],127:[function(require,module,exports){if(typeof Object.create==="function"){module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;ctor.prototype=Object.create(superCtor.prototype,{constructor:{value:ctor,enumerable:false,writable:true,configurable:true}})}}else{module.exports=function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}}},{}],128:[function(require,module,exports){module.exports=Array.isArray||function(arr){return Object.prototype.toString.call(arr)=="[object Array]"}},{}],129:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")};exports.sep="/";exports.delimiter=":";exports.dirname=function(path){var result=splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir};exports.basename=function(path,ext){var f=splitPath(path)[2];if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPath(path)[3]};function filter(xs,f){if(xs.filter)return xs.filter(f);var res=[];for(var i=0;i<xs.length;i++){if(f(xs[i],i,xs))res.push(xs[i])}return res}var substr="ab".substr(-1)==="b"?function(str,start,len){return str.substr(start,len)}:function(str,start,len){if(start<0)start=str.length+start;return str.substr(start,len)}}).call(this,require("_process"))},{_process:130}],130:[function(require,module,exports){var process=module.exports={};var queue=[];var draining=false;function drainQueue(){if(draining){return}draining=true;var currentQueue;var len=queue.length;while(len){currentQueue=queue;queue=[];var i=-1;while(++i<len){currentQueue[i]()}len=queue.length}draining=false}process.nextTick=function(fun){queue.push(fun);if(!draining){setTimeout(drainQueue,0)}};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],131:[function(require,module,exports){module.exports=require("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":132}],132:[function(require,module,exports){(function(process){module.exports=Duplex;var objectKeys=Object.keys||function(obj){var keys=[];for(var key in obj)keys.push(key);return keys};var util=require("core-util-is");util.inherits=require("inherits");var Readable=require("./_stream_readable");var Writable=require("./_stream_writable");util.inherits(Duplex,Readable);forEach(objectKeys(Writable.prototype),function(method){if(!Duplex.prototype[method])Duplex.prototype[method]=Writable.prototype[method]});function Duplex(options){if(!(this instanceof Duplex))return new Duplex(options);Readable.call(this,options);Writable.call(this,options);if(options&&options.readable===false)this.readable=false;if(options&&options.writable===false)this.writable=false;this.allowHalfOpen=true;if(options&&options.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}function onend(){if(this.allowHalfOpen||this._writableState.ended)return;process.nextTick(this.end.bind(this))}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}}).call(this,require("_process"))},{"./_stream_readable":134,"./_stream_writable":136,_process:130,"core-util-is":137,inherits:127}],133:[function(require,module,exports){module.exports=PassThrough;var Transform=require("./_stream_transform");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(PassThrough,Transform);function PassThrough(options){if(!(this instanceof PassThrough))return new PassThrough(options);Transform.call(this,options)}PassThrough.prototype._transform=function(chunk,encoding,cb){cb(null,chunk)}},{"./_stream_transform":135,"core-util-is":137,inherits:127}],134:[function(require,module,exports){(function(process){module.exports=Readable;var isArray=require("isarray");var Buffer=require("buffer").Buffer;Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter;if(!EE.listenerCount)EE.listenerCount=function(emitter,type){return emitter.listeners(type).length};var Stream=require("stream");var util=require("core-util-is");util.inherits=require("inherits");var StringDecoder;util.inherits(Readable,Stream);function ReadableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.highWaterMark=~~this.highWaterMark;this.buffer=[];this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=false;this.ended=false;this.endEmitted=false;this.reading=false;this.calledRead=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.objectMode=!!options.objectMode;this.defaultEncoding=options.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(options.encoding){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this.decoder=new StringDecoder(options.encoding);this.encoding=options.encoding}}function Readable(options){if(!(this instanceof Readable))return new Readable(options);this._readableState=new ReadableState(options,this);this.readable=true;Stream.call(this)}Readable.prototype.push=function(chunk,encoding){var state=this._readableState;if(typeof chunk==="string"&&!state.objectMode){encoding=encoding||state.defaultEncoding;if(encoding!==state.encoding){chunk=new Buffer(chunk,encoding);encoding=""}}return readableAddChunk(this,state,chunk,encoding,false)};Readable.prototype.unshift=function(chunk){var state=this._readableState;return readableAddChunk(this,state,chunk,"",true)};function readableAddChunk(stream,state,chunk,encoding,addToFront){var er=chunkInvalid(state,chunk);if(er){stream.emit("error",er)}else if(chunk===null||chunk===undefined){state.reading=false;if(!state.ended)onEofChunk(stream,state)}else if(state.objectMode||chunk&&chunk.length>0){if(state.ended&&!addToFront){var e=new Error("stream.push() after EOF");stream.emit("error",e)}else if(state.endEmitted&&addToFront){var e=new Error("stream.unshift() after end event");stream.emit("error",e)}else{if(state.decoder&&!addToFront&&!encoding)chunk=state.decoder.write(chunk);state.length+=state.objectMode?1:chunk.length;if(addToFront){state.buffer.unshift(chunk)}else{state.reading=false;state.buffer.push(chunk)}if(state.needReadable)emitReadable(stream);maybeReadMore(stream,state)}}else if(!addToFront){state.reading=false}return needMoreData(state)}function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}Readable.prototype.setEncoding=function(enc){if(!StringDecoder)StringDecoder=require("string_decoder/").StringDecoder;this._readableState.decoder=new StringDecoder(enc);this._readableState.encoding=enc};var MAX_HWM=8388608;function roundUpToNextPowerOf2(n){if(n>=MAX_HWM){n=MAX_HWM}else{n--;for(var p=1;p<32;p<<=1)n|=n>>p;n++}return n}function howMuchToRead(n,state){if(state.length===0&&state.ended)return 0;if(state.objectMode)return n===0?0:1;if(n===null||isNaN(n)){if(state.flowing&&state.buffer.length)return state.buffer[0].length;else return state.length}if(n<=0)return 0;if(n>state.highWaterMark)state.highWaterMark=roundUpToNextPowerOf2(n);if(n>state.length){if(!state.ended){state.needReadable=true;return 0}else return state.length}return n}Readable.prototype.read=function(n){var state=this._readableState;state.calledRead=true;var nOrig=n;var ret;if(typeof n!=="number"||n>0)state.emittedReadable=false;if(n===0&&state.needReadable&&(state.length>=state.highWaterMark||state.ended)){emitReadable(this);return null}n=howMuchToRead(n,state);if(n===0&&state.ended){ret=null;if(state.length>0&&state.decoder){ret=fromList(n,state);state.length-=ret.length}if(state.length===0)endReadable(this);return ret}var doRead=state.needReadable;if(state.length-n<=state.highWaterMark)doRead=true;if(state.ended||state.reading)doRead=false;if(doRead){state.reading=true;state.sync=true;if(state.length===0)state.needReadable=true;this._read(state.highWaterMark);state.sync=false}if(doRead&&!state.reading)n=howMuchToRead(nOrig,state);if(n>0)ret=fromList(n,state);else ret=null;if(ret===null){state.needReadable=true;n=0}state.length-=n;if(state.length===0&&!state.ended)state.needReadable=true;if(state.ended&&!state.endEmitted&&state.length===0)endReadable(this);return ret};function chunkInvalid(state,chunk){var er=null;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){er=new TypeError("Invalid non-string/buffer chunk")}return er}function onEofChunk(stream,state){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length){state.buffer.push(chunk);state.length+=state.objectMode?1:chunk.length}}state.ended=true;if(state.length>0)emitReadable(stream);else endReadable(stream)}function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(state.emittedReadable)return;state.emittedReadable=true;if(state.sync)process.nextTick(function(){emitReadable_(stream)});else emitReadable_(stream)}function emitReadable_(stream){stream.emit("readable")}function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(function(){maybeReadMore_(stream,state)})}}function maybeReadMore_(stream,state){var len=state.length;while(!state.reading&&!state.flowing&&!state.ended&&state.length<state.highWaterMark){stream.read(0);if(len===state.length)break;else len=state.length}state.readingMore=false}Readable.prototype._read=function(n){this.emit("error",new Error("not implemented"))};Readable.prototype.pipe=function(dest,pipeOpts){var src=this;var state=this._readableState;switch(state.pipesCount){case 0:state.pipes=dest;break;case 1:state.pipes=[state.pipes,dest];break;default:state.pipes.push(dest);break}state.pipesCount+=1;var doEnd=(!pipeOpts||pipeOpts.end!==false)&&dest!==process.stdout&&dest!==process.stderr;var endFn=doEnd?onend:cleanup;if(state.endEmitted)process.nextTick(endFn);else src.once("end",endFn);dest.on("unpipe",onunpipe);function onunpipe(readable){if(readable!==src)return;cleanup()}function onend(){dest.end()}var ondrain=pipeOnDrain(src);dest.on("drain",ondrain);function cleanup(){dest.removeListener("close",onclose);dest.removeListener("finish",onfinish);dest.removeListener("drain",ondrain);dest.removeListener("error",onerror);dest.removeListener("unpipe",onunpipe);src.removeListener("end",onend);src.removeListener("end",cleanup);if(!dest._writableState||dest._writableState.needDrain)ondrain()}function onerror(er){unpipe();dest.removeListener("error",onerror);if(EE.listenerCount(dest,"error")===0)dest.emit("error",er)}if(!dest._events||!dest._events.error)dest.on("error",onerror);else if(isArray(dest._events.error))dest._events.error.unshift(onerror);else dest._events.error=[onerror,dest._events.error];function onclose(){dest.removeListener("finish",onfinish);unpipe()}dest.once("close",onclose);function onfinish(){dest.removeListener("close",onclose);unpipe()}dest.once("finish",onfinish);function unpipe(){src.unpipe(dest)}dest.emit("pipe",src);if(!state.flowing){this.on("readable",pipeOnReadable);state.flowing=true;process.nextTick(function(){flow(src)})}return dest};function pipeOnDrain(src){return function(){var dest=this;var state=src._readableState;state.awaitDrain--;if(state.awaitDrain===0)flow(src)}}function flow(src){var state=src._readableState;var chunk;state.awaitDrain=0;function write(dest,i,list){var written=dest.write(chunk);if(false===written){state.awaitDrain++}}while(state.pipesCount&&null!==(chunk=src.read())){if(state.pipesCount===1)write(state.pipes,0,null);else forEach(state.pipes,write);src.emit("data",chunk);if(state.awaitDrain>0)return}if(state.pipesCount===0){state.flowing=false;if(EE.listenerCount(src,"data")>0)emitDataEvents(src);return}state.ranOut=true}function pipeOnReadable(){if(this._readableState.ranOut){this._readableState.ranOut=false;flow(this)}}Readable.prototype.unpipe=function(dest){var state=this._readableState;if(state.pipesCount===0)return this;if(state.pipesCount===1){if(dest&&dest!==state.pipes)return this;if(!dest)dest=state.pipes;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;if(dest)dest.emit("unpipe",this);return this}if(!dest){var dests=state.pipes;var len=state.pipesCount;state.pipes=null;state.pipesCount=0;this.removeListener("readable",pipeOnReadable);state.flowing=false;for(var i=0;i<len;i++)dests[i].emit("unpipe",this);return this}var i=indexOf(state.pipes,dest);if(i===-1)return this;state.pipes.splice(i,1);state.pipesCount-=1;if(state.pipesCount===1)state.pipes=state.pipes[0];dest.emit("unpipe",this);return this};Readable.prototype.on=function(ev,fn){var res=Stream.prototype.on.call(this,ev,fn);if(ev==="data"&&!this._readableState.flowing)emitDataEvents(this);if(ev==="readable"&&this.readable){var state=this._readableState;if(!state.readableListening){state.readableListening=true;state.emittedReadable=false;state.needReadable=true;if(!state.reading){this.read(0)}else if(state.length){emitReadable(this,state)}}}return res};Readable.prototype.addListener=Readable.prototype.on;Readable.prototype.resume=function(){emitDataEvents(this);this.read(0);this.emit("resume")};Readable.prototype.pause=function(){emitDataEvents(this,true);this.emit("pause")};function emitDataEvents(stream,startPaused){var state=stream._readableState;if(state.flowing){throw new Error("Cannot switch to old mode now.")}var paused=startPaused||false;var readable=false;stream.readable=true;stream.pipe=Stream.prototype.pipe;stream.on=stream.addListener=Stream.prototype.on;stream.on("readable",function(){readable=true;var c;while(!paused&&null!==(c=stream.read()))stream.emit("data",c);if(c===null){readable=false;stream._readableState.needReadable=true}});stream.pause=function(){paused=true;this.emit("pause")};stream.resume=function(){paused=false;if(readable)process.nextTick(function(){stream.emit("readable")});else this.read(0);this.emit("resume")};stream.emit("readable")}Readable.prototype.wrap=function(stream){var state=this._readableState;var paused=false;var self=this;stream.on("end",function(){if(state.decoder&&!state.ended){var chunk=state.decoder.end();if(chunk&&chunk.length)self.push(chunk)}self.push(null)});stream.on("data",function(chunk){if(state.decoder)chunk=state.decoder.write(chunk);if(state.objectMode&&(chunk===null||chunk===undefined))return;else if(!state.objectMode&&(!chunk||!chunk.length))return;var ret=self.push(chunk);if(!ret){paused=true;stream.pause()}});for(var i in stream){if(typeof stream[i]==="function"&&typeof this[i]==="undefined"){this[i]=function(method){return function(){return stream[method].apply(stream,arguments)}}(i)}}var events=["error","close","destroy","pause","resume"];forEach(events,function(ev){stream.on(ev,self.emit.bind(self,ev))});self._read=function(n){if(paused){paused=false;stream.resume()}};return self};Readable._fromList=fromList;function fromList(n,state){var list=state.buffer;var length=state.length;var stringMode=!!state.decoder;var objectMode=!!state.objectMode;var ret;if(list.length===0)return null;if(length===0)ret=null;else if(objectMode)ret=list.shift();else if(!n||n>=length){if(stringMode)ret=list.join("");else ret=Buffer.concat(list,length);list.length=0}else{if(n<list[0].length){var buf=list[0];ret=buf.slice(0,n);list[0]=buf.slice(n)}else if(n===list[0].length){ret=list.shift()}else{if(stringMode)ret="";else ret=new Buffer(n);var c=0;for(var i=0,l=list.length;i<l&&c<n;i++){var buf=list[0];var cpy=Math.min(n-c,buf.length);if(stringMode)ret+=buf.slice(0,cpy);else buf.copy(ret,c,0,cpy);if(cpy<buf.length)list[0]=buf.slice(cpy);else list.shift();c+=cpy}}}return ret}function endReadable(stream){var state=stream._readableState;if(state.length>0)throw new Error("endReadable called on non-empty stream");if(!state.endEmitted&&state.calledRead){state.ended=true;process.nextTick(function(){if(!state.endEmitted&&state.length===0){state.endEmitted=true;stream.readable=false;stream.emit("end")}})}}function forEach(xs,f){for(var i=0,l=xs.length;i<l;i++){f(xs[i],i)}}function indexOf(xs,x){for(var i=0,l=xs.length;i<l;i++){if(xs[i]===x)return i}return-1}}).call(this,require("_process"))},{_process:130,buffer:122,"core-util-is":137,events:126,inherits:127,isarray:128,stream:142,"string_decoder/":143}],135:[function(require,module,exports){module.exports=Transform;var Duplex=require("./_stream_duplex");var util=require("core-util-is");util.inherits=require("inherits");util.inherits(Transform,Duplex);function TransformState(options,stream){this.afterTransform=function(er,data){return afterTransform(stream,er,data)};this.needTransform=false;this.transforming=false;this.writecb=null;this.writechunk=null}function afterTransform(stream,er,data){var ts=stream._transformState;ts.transforming=false;var cb=ts.writecb;if(!cb)return stream.emit("error",new Error("no writecb in Transform class"));ts.writechunk=null;ts.writecb=null;if(data!==null&&data!==undefined)stream.push(data);if(cb)cb(er);var rs=stream._readableState;rs.reading=false;if(rs.needReadable||rs.length<rs.highWaterMark){stream._read(rs.highWaterMark)}}function Transform(options){if(!(this instanceof Transform))return new Transform(options);Duplex.call(this,options);var ts=this._transformState=new TransformState(options,this);var stream=this;this._readableState.needReadable=true;this._readableState.sync=false;this.once("finish",function(){if("function"===typeof this._flush)this._flush(function(er){done(stream,er)});else done(stream)})}Transform.prototype.push=function(chunk,encoding){this._transformState.needTransform=false;return Duplex.prototype.push.call(this,chunk,encoding)};Transform.prototype._transform=function(chunk,encoding,cb){throw new Error("not implemented")};Transform.prototype._write=function(chunk,encoding,cb){var ts=this._transformState;ts.writecb=cb;ts.writechunk=chunk;ts.writeencoding=encoding;if(!ts.transforming){var rs=this._readableState;if(ts.needTransform||rs.needReadable||rs.length<rs.highWaterMark)this._read(rs.highWaterMark)
}};Transform.prototype._read=function(n){var ts=this._transformState;if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){ts.transforming=true;this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform)}else{ts.needTransform=true}};function done(stream,er){if(er)return stream.emit("error",er);var ws=stream._writableState;var rs=stream._readableState;var ts=stream._transformState;if(ws.length)throw new Error("calling transform done when ws.length != 0");if(ts.transforming)throw new Error("calling transform done when still transforming");return stream.push(null)}},{"./_stream_duplex":132,"core-util-is":137,inherits:127}],136:[function(require,module,exports){(function(process){module.exports=Writable;var Buffer=require("buffer").Buffer;Writable.WritableState=WritableState;var util=require("core-util-is");util.inherits=require("inherits");var Stream=require("stream");util.inherits(Writable,Stream);function WriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb}function WritableState(options,stream){options=options||{};var hwm=options.highWaterMark;this.highWaterMark=hwm||hwm===0?hwm:16*1024;this.objectMode=!!options.objectMode;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;var noDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.buffer=[];this.errorEmitted=false}function Writable(options){var Duplex=require("./_stream_duplex");if(!(this instanceof Writable)&&!(this instanceof Duplex))return new Writable(options);this._writableState=new WritableState(options,this);this.writable=true;Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))};function writeAfterEnd(stream,state,cb){var er=new Error("write after end");stream.emit("error",er);process.nextTick(function(){cb(er)})}function validChunk(stream,state,chunk,cb){var valid=true;if(!Buffer.isBuffer(chunk)&&"string"!==typeof chunk&&chunk!==null&&chunk!==undefined&&!state.objectMode){var er=new TypeError("Invalid non-string/buffer chunk");stream.emit("error",er);process.nextTick(function(){cb(er)});valid=false}return valid}Writable.prototype.write=function(chunk,encoding,cb){var state=this._writableState;var ret=false;if(typeof encoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";else if(!encoding)encoding=state.defaultEncoding;if(typeof cb!=="function")cb=function(){};if(state.ended)writeAfterEnd(this,state,cb);else if(validChunk(this,state,chunk,cb))ret=writeOrBuffer(this,state,chunk,encoding,cb);return ret};function decodeChunk(state,chunk,encoding){if(!state.objectMode&&state.decodeStrings!==false&&typeof chunk==="string"){chunk=new Buffer(chunk,encoding)}return chunk}function writeOrBuffer(stream,state,chunk,encoding,cb){chunk=decodeChunk(state,chunk,encoding);if(Buffer.isBuffer(chunk))encoding="buffer";var len=state.objectMode?1:chunk.length;state.length+=len;var ret=state.length<state.highWaterMark;if(!ret)state.needDrain=true;if(state.writing)state.buffer.push(new WriteReq(chunk,encoding,cb));else doWrite(stream,state,len,chunk,encoding,cb);return ret}function doWrite(stream,state,len,chunk,encoding,cb){state.writelen=len;state.writecb=cb;state.writing=true;state.sync=true;stream._write(chunk,encoding,state.onwrite);state.sync=false}function onwriteError(stream,state,sync,er,cb){if(sync)process.nextTick(function(){cb(er)});else cb(er);stream._writableState.errorEmitted=true;stream.emit("error",er)}function onwriteStateUpdate(state){state.writing=false;state.writecb=null;state.length-=state.writelen;state.writelen=0}function onwrite(stream,er){var state=stream._writableState;var sync=state.sync;var cb=state.writecb;onwriteStateUpdate(state);if(er)onwriteError(stream,state,sync,er,cb);else{var finished=needFinish(stream,state);if(!finished&&!state.bufferProcessing&&state.buffer.length)clearBuffer(stream,state);if(sync){process.nextTick(function(){afterWrite(stream,state,finished,cb)})}else{afterWrite(stream,state,finished,cb)}}}function afterWrite(stream,state,finished,cb){if(!finished)onwriteDrain(stream,state);cb();if(finished)finishMaybe(stream,state)}function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit("drain")}}function clearBuffer(stream,state){state.bufferProcessing=true;for(var c=0;c<state.buffer.length;c++){var entry=state.buffer[c];var chunk=entry.chunk;var encoding=entry.encoding;var cb=entry.callback;var len=state.objectMode?1:chunk.length;doWrite(stream,state,len,chunk,encoding,cb);if(state.writing){c++;break}}state.bufferProcessing=false;if(c<state.buffer.length)state.buffer=state.buffer.slice(c);else state.buffer.length=0}Writable.prototype._write=function(chunk,encoding,cb){cb(new Error("not implemented"))};Writable.prototype.end=function(chunk,encoding,cb){var state=this._writableState;if(typeof chunk==="function"){cb=chunk;chunk=null;encoding=null}else if(typeof encoding==="function"){cb=encoding;encoding=null}if(typeof chunk!=="undefined"&&chunk!==null)this.write(chunk,encoding);if(!state.ending&&!state.finished)endWritable(this,state,cb)};function needFinish(stream,state){return state.ending&&state.length===0&&!state.finished&&!state.writing}function finishMaybe(stream,state){var need=needFinish(stream,state);if(need){state.finished=true;stream.emit("finish")}return need}function endWritable(stream,state,cb){state.ending=true;finishMaybe(stream,state);if(cb){if(state.finished)process.nextTick(cb);else stream.once("finish",cb)}state.ended=true}}).call(this,require("_process"))},{"./_stream_duplex":132,_process:130,buffer:122,"core-util-is":137,inherits:127,stream:142}],137:[function(require,module,exports){(function(Buffer){function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;function isBuffer(arg){return Buffer.isBuffer(arg)}exports.isBuffer=isBuffer;function objectToString(o){return Object.prototype.toString.call(o)}}).call(this,require("buffer").Buffer)},{buffer:122}],138:[function(require,module,exports){module.exports=require("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":133}],139:[function(require,module,exports){var Stream=require("stream");exports=module.exports=require("./lib/_stream_readable.js");exports.Stream=Stream;exports.Readable=exports;exports.Writable=require("./lib/_stream_writable.js");exports.Duplex=require("./lib/_stream_duplex.js");exports.Transform=require("./lib/_stream_transform.js");exports.PassThrough=require("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":132,"./lib/_stream_passthrough.js":133,"./lib/_stream_readable.js":134,"./lib/_stream_transform.js":135,"./lib/_stream_writable.js":136,stream:142}],140:[function(require,module,exports){module.exports=require("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":135}],141:[function(require,module,exports){module.exports=require("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":136}],142:[function(require,module,exports){module.exports=Stream;var EE=require("events").EventEmitter;var inherits=require("inherits");inherits(Stream,EE);Stream.Readable=require("readable-stream/readable.js");Stream.Writable=require("readable-stream/writable.js");Stream.Duplex=require("readable-stream/duplex.js");Stream.Transform=require("readable-stream/transform.js");Stream.PassThrough=require("readable-stream/passthrough.js");Stream.Stream=Stream;function Stream(){EE.call(this)}Stream.prototype.pipe=function(dest,options){var source=this;function ondata(chunk){if(dest.writable){if(false===dest.write(chunk)&&source.pause){source.pause()}}}source.on("data",ondata);function ondrain(){if(source.readable&&source.resume){source.resume()}}dest.on("drain",ondrain);if(!dest._isStdio&&(!options||options.end!==false)){source.on("end",onend);source.on("close",onclose)}var didOnEnd=false;function onend(){if(didOnEnd)return;didOnEnd=true;dest.end()}function onclose(){if(didOnEnd)return;didOnEnd=true;if(typeof dest.destroy==="function")dest.destroy()}function onerror(er){cleanup();if(EE.listenerCount(this,"error")===0){throw er}}source.on("error",onerror);dest.on("error",onerror);function cleanup(){source.removeListener("data",ondata);dest.removeListener("drain",ondrain);source.removeListener("end",onend);source.removeListener("close",onclose);source.removeListener("error",onerror);dest.removeListener("error",onerror);source.removeListener("end",cleanup);source.removeListener("close",cleanup);dest.removeListener("close",cleanup)}source.on("end",cleanup);source.on("close",cleanup);dest.on("close",cleanup);dest.emit("pipe",source);return dest}},{events:126,inherits:127,"readable-stream/duplex.js":131,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],143:[function(require,module,exports){var Buffer=require("buffer").Buffer;var isBufferEncoding=Buffer.isEncoding||function(encoding){switch(encoding&&encoding.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(encoding){if(encoding&&!isBufferEncoding(encoding)){throw new Error("Unknown encoding: "+encoding)}}var StringDecoder=exports.StringDecoder=function(encoding){this.encoding=(encoding||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(encoding);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0};StringDecoder.prototype.write=function(buffer){var charStr="";while(this.charLength){var available=buffer.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:buffer.length;buffer.copy(this.charBuffer,this.charReceived,0,available);this.charReceived+=available;if(this.charReceived<this.charLength){return""}buffer=buffer.slice(available,buffer.length);charStr=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var charCode=charStr.charCodeAt(charStr.length-1);if(charCode>=55296&&charCode<=56319){this.charLength+=this.surrogateSize;charStr="";continue}this.charReceived=this.charLength=0;if(buffer.length===0){return charStr}break}this.detectIncompleteChar(buffer);var end=buffer.length;if(this.charLength){buffer.copy(this.charBuffer,0,buffer.length-this.charReceived,end);end-=this.charReceived}charStr+=buffer.toString(this.encoding,0,end);var end=charStr.length-1;var charCode=charStr.charCodeAt(end);if(charCode>=55296&&charCode<=56319){var size=this.surrogateSize;this.charLength+=size;this.charReceived+=size;this.charBuffer.copy(this.charBuffer,size,0,size);buffer.copy(this.charBuffer,0,0,size);return charStr.substring(0,end)}return charStr};StringDecoder.prototype.detectIncompleteChar=function(buffer){var i=buffer.length>=3?3:buffer.length;for(;i>0;i--){var c=buffer[buffer.length-i];if(i==1&&c>>5==6){this.charLength=2;break}if(i<=2&&c>>4==14){this.charLength=3;break}if(i<=3&&c>>3==30){this.charLength=4;break}}this.charReceived=i};StringDecoder.prototype.end=function(buffer){var res="";if(buffer&&buffer.length)res=this.write(buffer);if(this.charReceived){var cr=this.charReceived;var buf=this.charBuffer;var enc=this.encoding;res+=buf.slice(0,cr).toString(enc)}return res};function passThroughWrite(buffer){return buffer.toString(this.encoding)}function utf16DetectIncompleteChar(buffer){this.charReceived=buffer.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(buffer){this.charReceived=buffer.length%3;this.charLength=this.charReceived?3:0}},{buffer:122}],144:[function(require,module,exports){module.exports=function isBuffer(arg){return arg&&typeof arg==="object"&&typeof arg.copy==="function"&&typeof arg.fill==="function"&&typeof arg.readUInt8==="function"}},{}],145:[function(require,module,exports){(function(process,global){var formatRegExp=/%[sdj%]/g;exports.format=function(f){if(!isString(f)){var objects=[];for(var i=0;i<arguments.length;i++){objects.push(inspect(arguments[i]))}return objects.join(" ")}var i=1;var args=arguments;var len=args.length;var str=String(f).replace(formatRegExp,function(x){if(x==="%%")return"%";if(i>=len)return x;switch(x){case"%s":return String(args[i++]);case"%d":return Number(args[i++]);case"%j":try{return JSON.stringify(args[i++])}catch(_){return"[Circular]"}default:return x}});for(var x=args[i];i<len;x=args[++i]){if(isNull(x)||!isObject(x)){str+=" "+x}else{str+=" "+inspect(x)}}return str};exports.deprecate=function(fn,msg){if(isUndefined(global.process)){return function(){return exports.deprecate(fn,msg).apply(this,arguments)}}if(process.noDeprecation===true){return fn}var warned=false;function deprecated(){if(!warned){if(process.throwDeprecation){throw new Error(msg)}else if(process.traceDeprecation){console.trace(msg)}else{console.error(msg)}warned=true}return fn.apply(this,arguments)}return deprecated};var debugs={};var debugEnviron;exports.debuglog=function(set){if(isUndefined(debugEnviron))debugEnviron=process.env.NODE_DEBUG||"";set=set.toUpperCase();if(!debugs[set]){if(new RegExp("\\b"+set+"\\b","i").test(debugEnviron)){var pid=process.pid;debugs[set]=function(){var msg=exports.format.apply(exports,arguments);console.error("%s %d: %s",set,pid,msg)}}else{debugs[set]=function(){}}}return debugs[set]};function inspect(obj,opts){var ctx={seen:[],stylize:stylizeNoColor};if(arguments.length>=3)ctx.depth=arguments[2];if(arguments.length>=4)ctx.colors=arguments[3];if(isBoolean(opts)){ctx.showHidden=opts}else if(opts){exports._extend(ctx,opts)}if(isUndefined(ctx.showHidden))ctx.showHidden=false;if(isUndefined(ctx.depth))ctx.depth=2;if(isUndefined(ctx.colors))ctx.colors=false;if(isUndefined(ctx.customInspect))ctx.customInspect=true;if(ctx.colors)ctx.stylize=stylizeWithColor;return formatValue(ctx,obj,ctx.depth)}exports.inspect=inspect;inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};inspect.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(str,styleType){var style=inspect.styles[styleType];if(style){return"["+inspect.colors[style][0]+"m"+str+"["+inspect.colors[style][1]+"m"}else{return str}}function stylizeNoColor(str,styleType){return str}function arrayToHash(array){var hash={};array.forEach(function(val,idx){hash[val]=true});return hash}function formatValue(ctx,value,recurseTimes){if(ctx.customInspect&&value&&isFunction(value.inspect)&&value.inspect!==exports.inspect&&!(value.constructor&&value.constructor.prototype===value)){var ret=value.inspect(recurseTimes,ctx);if(!isString(ret)){ret=formatValue(ctx,ret,recurseTimes)}return ret}var primitive=formatPrimitive(ctx,value);if(primitive){return primitive}var keys=Object.keys(value);var visibleKeys=arrayToHash(keys);if(ctx.showHidden){keys=Object.getOwnPropertyNames(value)}if(isError(value)&&(keys.indexOf("message")>=0||keys.indexOf("description")>=0)){return formatError(value)}if(keys.length===0){if(isFunction(value)){var name=value.name?": "+value.name:"";return ctx.stylize("[Function"+name+"]","special")}if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}if(isDate(value)){return ctx.stylize(Date.prototype.toString.call(value),"date")}if(isError(value)){return formatError(value)}}var base="",array=false,braces=["{","}"];if(isArray(value)){array=true;braces=["[","]"]}if(isFunction(value)){var n=value.name?": "+value.name:"";base=" [Function"+n+"]"}if(isRegExp(value)){base=" "+RegExp.prototype.toString.call(value)}if(isDate(value)){base=" "+Date.prototype.toUTCString.call(value)}if(isError(value)){base=" "+formatError(value)}if(keys.length===0&&(!array||value.length==0)){return braces[0]+base+braces[1]}if(recurseTimes<0){if(isRegExp(value)){return ctx.stylize(RegExp.prototype.toString.call(value),"regexp")}else{return ctx.stylize("[Object]","special")}}ctx.seen.push(value);var output;if(array){output=formatArray(ctx,value,recurseTimes,visibleKeys,keys)}else{output=keys.map(function(key){return formatProperty(ctx,value,recurseTimes,visibleKeys,key,array)})}ctx.seen.pop();return reduceToSingleString(output,base,braces)}function formatPrimitive(ctx,value){if(isUndefined(value))return ctx.stylize("undefined","undefined");if(isString(value)){var simple="'"+JSON.stringify(value).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return ctx.stylize(simple,"string")}if(isNumber(value))return ctx.stylize(""+value,"number");if(isBoolean(value))return ctx.stylize(""+value,"boolean");if(isNull(value))return ctx.stylize("null","null")}function formatError(value){return"["+Error.prototype.toString.call(value)+"]"}function formatArray(ctx,value,recurseTimes,visibleKeys,keys){var output=[];for(var i=0,l=value.length;i<l;++i){if(hasOwnProperty(value,String(i))){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,String(i),true))}else{output.push("")}}keys.forEach(function(key){if(!key.match(/^\d+$/)){output.push(formatProperty(ctx,value,recurseTimes,visibleKeys,key,true))}});return output}function formatProperty(ctx,value,recurseTimes,visibleKeys,key,array){var name,str,desc;desc=Object.getOwnPropertyDescriptor(value,key)||{value:value[key]};if(desc.get){if(desc.set){str=ctx.stylize("[Getter/Setter]","special")}else{str=ctx.stylize("[Getter]","special")}}else{if(desc.set){str=ctx.stylize("[Setter]","special")}}if(!hasOwnProperty(visibleKeys,key)){name="["+key+"]"}if(!str){if(ctx.seen.indexOf(desc.value)<0){if(isNull(recurseTimes)){str=formatValue(ctx,desc.value,null)}else{str=formatValue(ctx,desc.value,recurseTimes-1)}if(str.indexOf("\n")>-1){if(array){str=str.split("\n").map(function(line){return" "+line}).join("\n").substr(2)}else{str="\n"+str.split("\n").map(function(line){return" "+line}).join("\n")}}}else{str=ctx.stylize("[Circular]","special")}}if(isUndefined(name)){if(array&&key.match(/^\d+$/)){return str}name=JSON.stringify(""+key);if(name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){name=name.substr(1,name.length-2);name=ctx.stylize(name,"name")}else{name=name.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");name=ctx.stylize(name,"string")}}return name+": "+str}function reduceToSingleString(output,base,braces){var numLinesEst=0;var length=output.reduce(function(prev,cur){numLinesEst++;if(cur.indexOf("\n")>=0)numLinesEst++;return prev+cur.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(length>60){return braces[0]+(base===""?"":base+"\n ")+" "+output.join(",\n ")+" "+braces[1]}return braces[0]+base+" "+output.join(", ")+" "+braces[1]}function isArray(ar){return Array.isArray(ar)}exports.isArray=isArray;function isBoolean(arg){return typeof arg==="boolean"}exports.isBoolean=isBoolean;function isNull(arg){return arg===null}exports.isNull=isNull;function isNullOrUndefined(arg){return arg==null}exports.isNullOrUndefined=isNullOrUndefined;function isNumber(arg){return typeof arg==="number"}exports.isNumber=isNumber;function isString(arg){return typeof arg==="string"}exports.isString=isString;function isSymbol(arg){return typeof arg==="symbol"}exports.isSymbol=isSymbol;function isUndefined(arg){return arg===void 0}exports.isUndefined=isUndefined;function isRegExp(re){return isObject(re)&&objectToString(re)==="[object RegExp]"}exports.isRegExp=isRegExp;function isObject(arg){return typeof arg==="object"&&arg!==null}exports.isObject=isObject;function isDate(d){return isObject(d)&&objectToString(d)==="[object Date]"}exports.isDate=isDate;function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}exports.isError=isError;function isFunction(arg){return typeof arg==="function"}exports.isFunction=isFunction;function isPrimitive(arg){return arg===null||typeof arg==="boolean"||typeof arg==="number"||typeof arg==="string"||typeof arg==="symbol"||typeof arg==="undefined"}exports.isPrimitive=isPrimitive;exports.isBuffer=require("./support/isBuffer");function objectToString(o){return Object.prototype.toString.call(o)}function pad(n){return n<10?"0"+n.toString(10):n.toString(10)}var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var d=new Date;var time=[pad(d.getHours()),pad(d.getMinutes()),pad(d.getSeconds())].join(":");return[d.getDate(),months[d.getMonth()],time].join(" ")}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))};exports.inherits=require("inherits");exports._extend=function(origin,add){if(!add||!isObject(add))return origin;var keys=Object.keys(add);var i=keys.length;while(i--){origin[keys[i]]=add[keys[i]]}return origin};function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop)}}).call(this,require("_process"),typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./support/isBuffer":144,_process:130,inherits:127}],146:[function(require,module,exports){"use strict";var escapeStringRegexp=require("escape-string-regexp");var ansiStyles=require("ansi-styles");var stripAnsi=require("strip-ansi");var hasAnsi=require("has-ansi");var supportsColor=require("supports-color");var defineProps=Object.defineProperties;var chalk=module.exports;function build(_styles){var builder=function builder(){return applyStyle.apply(builder,arguments)};builder._styles=_styles;builder.__proto__=proto;return builder}var styles=function(){var ret={};ansiStyles.grey=ansiStyles.gray;Object.keys(ansiStyles).forEach(function(key){ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),"g");ret[key]={get:function(){return build(this._styles.concat(key))}}});return ret}();var proto=defineProps(function chalk(){},styles);function applyStyle(){var args=arguments;var argsLen=args.length;var str=argsLen!==0&&String(arguments[0]);if(argsLen>1){for(var a=1;a<argsLen;a++){str+=" "+args[a]}}if(!chalk.enabled||!str){return str}var nestedStyles=this._styles;for(var i=0;i<nestedStyles.length;i++){var code=ansiStyles[nestedStyles[i]];str=code.open+str.replace(code.closeRe,code.open)+code.close}return str}function init(){var ret={};Object.keys(styles).forEach(function(name){ret[name]={get:function(){return build([name])}}});return ret}defineProps(chalk,init());chalk.styles=ansiStyles;chalk.hasColor=hasAnsi;chalk.stripColor=stripAnsi;chalk.supportsColor=supportsColor;if(chalk.enabled===undefined){chalk.enabled=chalk.supportsColor}},{"ansi-styles":147,"escape-string-regexp":148,"has-ansi":149,"strip-ansi":151,"supports-color":153}],147:[function(require,module,exports){"use strict";var styles=module.exports;var codes={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49]};Object.keys(codes).forEach(function(key){var val=codes[key];var style=styles[key]={};style.open="["+val[0]+"m";style.close="["+val[1]+"m"})},{}],148:[function(require,module,exports){"use strict";var matchOperatorsRe=/[|\\{}()[\]^$+*?.]/g;module.exports=function(str){if(typeof str!=="string"){throw new TypeError("Expected a string")}return str.replace(matchOperatorsRe,"\\$&")}},{}],149:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex");var re=new RegExp(ansiRegex().source);module.exports=re.test.bind(re)},{"ansi-regex":150}],150:[function(require,module,exports){"use strict";module.exports=function(){return/\u001b\[(?:[0-9]{1,3}(?:;[0-9]{1,3})*)?[m|K]/g}},{}],151:[function(require,module,exports){"use strict";var ansiRegex=require("ansi-regex")();module.exports=function(str){return typeof str==="string"?str.replace(ansiRegex,""):str}},{"ansi-regex":152}],152:[function(require,module,exports){arguments[4][150][0].apply(exports,arguments)},{dup:150}],153:[function(require,module,exports){(function(process){"use strict";module.exports=function(){if(process.argv.indexOf("--no-color")!==-1){return false}if(process.argv.indexOf("--color")!==-1){return true}if(process.stdout&&!process.stdout.isTTY){return false}if(process.platform==="win32"){return true}if("COLORTERM"in process.env){return true}if(process.env.TERM==="dumb"){return false}if(/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)){return true}return false}()}).call(this,require("_process"))},{_process:130}],154:[function(require,module,exports){!function(global,framework,undefined){"use strict";var OBJECT="Object",FUNCTION="Function",ARRAY="Array",STRING="String",NUMBER="Number",REGEXP="RegExp",DATE="Date",MAP="Map",SET="Set",WEAKMAP="WeakMap",WEAKSET="WeakSet",SYMBOL="Symbol",PROMISE="Promise",MATH="Math",ARGUMENTS="Arguments",PROTOTYPE="prototype",CONSTRUCTOR="constructor",TO_STRING="toString",TO_STRING_TAG=TO_STRING+"Tag",TO_LOCALE="toLocaleString",HAS_OWN="hasOwnProperty",FOR_EACH="forEach",ITERATOR="iterator",FF_ITERATOR="@@"+ITERATOR,PROCESS="process",CREATE_ELEMENT="createElement",Function=global[FUNCTION],Object=global[OBJECT],Array=global[ARRAY],String=global[STRING],Number=global[NUMBER],RegExp=global[REGEXP],Date=global[DATE],Map=global[MAP],Set=global[SET],WeakMap=global[WEAKMAP],WeakSet=global[WEAKSET],Symbol=global[SYMBOL],Math=global[MATH],TypeError=global.TypeError,setTimeout=global.setTimeout,setImmediate=global.setImmediate,clearImmediate=global.clearImmediate,process=global[PROCESS],nextTick=process&&process.nextTick,document=global.document,html=document&&document.documentElement,navigator=global.navigator,define=global.define,ArrayProto=Array[PROTOTYPE],ObjectProto=Object[PROTOTYPE],FunctionProto=Function[PROTOTYPE],Infinity=1/0,DOT=".";function isObject(it){return it!=null&&(typeof it=="object"||typeof it=="function")}function isFunction(it){return typeof it=="function"}var isNative=ctx(/./.test,/\[native code\]\s*\}\s*$/,1);var buildIn={Undefined:1,Null:1,Array:1,String:1,Arguments:1,Function:1,Error:1,Boolean:1,Number:1,Date:1,RegExp:1},toString=ObjectProto[TO_STRING];function setToStringTag(it,tag,stat){if(it&&!has(it=stat?it:it[PROTOTYPE],SYMBOL_TAG))hidden(it,SYMBOL_TAG,tag)}function cof(it){return it==undefined?it===undefined?"Undefined":"Null":toString.call(it).slice(8,-1)}function classof(it){var klass=cof(it),tag;return klass==OBJECT&&(tag=it[SYMBOL_TAG])?has(buildIn,tag)?"~"+tag:tag:klass}var call=FunctionProto.call,apply=FunctionProto.apply,REFERENCE_GET;function part(){var fn=assertFunction(this),length=arguments.length,args=Array(length),i=0,_=path._,holder=false;while(length>i)if((args[i]=arguments[i++])===_)holder=true;return function(){var that=this,_length=arguments.length,i=0,j=0,_args;if(!holder&&!_length)return invoke(fn,args,that);_args=args.slice();if(holder)for(;length>i;i++)if(_args[i]===_)_args[i]=arguments[j++];while(_length>j)_args.push(arguments[j++]);return invoke(fn,_args,that)}}function ctx(fn,that,length){assertFunction(fn);if(~length&&that===undefined)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}function invoke(fn,args,that){var un=that===undefined;switch(args.length|0){case 0:return un?fn():fn.call(that);case 1:return un?fn(args[0]):fn.call(that,args[0]);case 2:return un?fn(args[0],args[1]):fn.call(that,args[0],args[1]);case 3:return un?fn(args[0],args[1],args[2]):fn.call(that,args[0],args[1],args[2]);case 4:return un?fn(args[0],args[1],args[2],args[3]):fn.call(that,args[0],args[1],args[2],args[3]);case 5:return un?fn(args[0],args[1],args[2],args[3],args[4]):fn.call(that,args[0],args[1],args[2],args[3],args[4])}return fn.apply(that,args)}function construct(target,argumentsList){var instance=create((arguments.length<3?target:assertFunction(arguments[2]))[PROTOTYPE]),result=apply.call(target,instance,argumentsList);return isObject(result)?result:instance}var create=Object.create,getPrototypeOf=Object.getPrototypeOf,setPrototypeOf=Object.setPrototypeOf,defineProperty=Object.defineProperty,defineProperties=Object.defineProperties,getOwnDescriptor=Object.getOwnPropertyDescriptor,getKeys=Object.keys,getNames=Object.getOwnPropertyNames,getSymbols=Object.getOwnPropertySymbols,has=ctx(call,ObjectProto[HAS_OWN],2),ES5Object=Object,Dict;function toObject(it){return ES5Object(assertDefined(it))}function returnIt(it){return it}function returnThis(){return this}function get(object,key){if(has(object,key))return object[key]}function ownKeys(it){assertObject(it);return getSymbols?getNames(it).concat(getSymbols(it)):getNames(it)}var assign=Object.assign||function(target,source){var T=Object(assertDefined(target)),l=arguments.length,i=1;while(l>i){var S=ES5Object(arguments[i++]),keys=getKeys(S),length=keys.length,j=0,key;while(length>j)T[key=keys[j++]]=S[key]}return T};function keyOf(object,el){var O=toObject(object),keys=getKeys(O),length=keys.length,index=0,key;while(length>index)if(O[key=keys[index++]]===el)return key}function array(it){return String(it).split(",")}var push=ArrayProto.push,unshift=ArrayProto.unshift,slice=ArrayProto.slice,splice=ArrayProto.splice,indexOf=ArrayProto.indexOf,forEach=ArrayProto[FOR_EACH];function createArrayMethod(type){var isMap=type==1,isFilter=type==2,isSome=type==3,isEvery=type==4,isFindIndex=type==6,noholes=type==5||isFindIndex;return function(callbackfn){var O=Object(assertDefined(this)),that=arguments[1],self=ES5Object(O),f=ctx(callbackfn,that,3),length=toLength(self.length),index=0,result=isMap?Array(length):isFilter?[]:undefined,val,res;for(;length>index;index++)if(noholes||index in self){val=self[index];res=f(val,index,O);if(type){if(isMap)result[index]=res;else if(res)switch(type){case 3:return true;case 5:return val;case 6:return index;case 2:result.push(val)}else if(isEvery)return false}}return isFindIndex?-1:isSome||isEvery?isEvery:result}}function createArrayContains(isContains){return function(el){var O=toObject(this),length=toLength(O.length),index=toIndex(arguments[1],length);
if(isContains&&el!=el){for(;length>index;index++)if(sameNaN(O[index]))return isContains||index}else for(;length>index;index++)if(isContains||index in O){if(O[index]===el)return isContains||index}return!isContains&&-1}}function generic(A,B){return typeof A=="function"?A:B}var MAX_SAFE_INTEGER=9007199254740991,ceil=Math.ceil,floor=Math.floor,max=Math.max,min=Math.min,random=Math.random,trunc=Math.trunc||function(it){return(it>0?floor:ceil)(it)};function sameNaN(number){return number!=number}function toInteger(it){return isNaN(it)?0:trunc(it)}function toLength(it){return it>0?min(toInteger(it),MAX_SAFE_INTEGER):0}function toIndex(index,length){var index=toInteger(index);return index<0?max(index+length,0):min(index,length)}function createReplacer(regExp,replace,isStatic){var replacer=isObject(replace)?function(part){return replace[part]}:replace;return function(it){return String(isStatic?it:this).replace(regExp,replacer)}}function createPointAt(toString){return function(pos){var s=String(assertDefined(this)),i=toInteger(pos),l=s.length,a,b;if(i<0||i>=l)return toString?"":undefined;a=s.charCodeAt(i);return a<55296||a>56319||i+1===l||(b=s.charCodeAt(i+1))<56320||b>57343?toString?s.charAt(i):a:toString?s.slice(i,i+2):(a-55296<<10)+(b-56320)+65536}}var REDUCE_ERROR="Reduce of empty object with no initial value";function assert(condition,msg1,msg2){if(!condition)throw TypeError(msg2?msg1+msg2:msg1)}function assertDefined(it){if(it==undefined)throw TypeError("Function called on null or undefined");return it}function assertFunction(it){assert(isFunction(it),it," is not a function!");return it}function assertObject(it){assert(isObject(it),it," is not an object!");return it}function assertInstance(it,Constructor,name){assert(it instanceof Constructor,name,": use the 'new' operator!")}function descriptor(bitmap,value){return{enumerable:!(bitmap&1),configurable:!(bitmap&2),writable:!(bitmap&4),value:value}}function simpleSet(object,key,value){object[key]=value;return object}function createDefiner(bitmap){return DESC?function(object,key,value){return defineProperty(object,key,descriptor(bitmap,value))}:simpleSet}function uid(key){return SYMBOL+"("+key+")_"+(++sid+random())[TO_STRING](36)}function getWellKnownSymbol(name,setter){return Symbol&&Symbol[name]||(setter?Symbol:safeSymbol)(SYMBOL+DOT+name)}var DESC=!!function(){try{return defineProperty({},DOT,ObjectProto)}catch(e){}}(),sid=0,hidden=createDefiner(1),set=Symbol?simpleSet:hidden,safeSymbol=Symbol||uid;function assignHidden(target,src){for(var key in src)hidden(target,key,src[key]);return target}var SYMBOL_UNSCOPABLES=getWellKnownSymbol("unscopables"),ArrayUnscopables=ArrayProto[SYMBOL_UNSCOPABLES]||{},SYMBOL_SPECIES=getWellKnownSymbol("species");function setSpecies(C){if(framework||!isNative(C))defineProperty(C,SYMBOL_SPECIES,{configurable:true,get:returnThis})}var SYMBOL_ITERATOR=getWellKnownSymbol(ITERATOR),SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG),SUPPORT_FF_ITER=FF_ITERATOR in ArrayProto,ITER=safeSymbol("iter"),KEY=1,VALUE=2,Iterators={},IteratorPrototype={},NATIVE_ITERATORS=SYMBOL_ITERATOR in ArrayProto,BUGGY_ITERATORS="keys"in ArrayProto&&!("next"in[].keys());setIterator(IteratorPrototype,returnThis);function setIterator(O,value){hidden(O,SYMBOL_ITERATOR,value);SUPPORT_FF_ITER&&hidden(O,FF_ITERATOR,value)}function createIterator(Constructor,NAME,next,proto){Constructor[PROTOTYPE]=create(proto||IteratorPrototype,{next:descriptor(1,next)});setToStringTag(Constructor,NAME+" Iterator")}function defineIterator(Constructor,NAME,value,DEFAULT){var proto=Constructor[PROTOTYPE],iter=get(proto,SYMBOL_ITERATOR)||get(proto,FF_ITERATOR)||DEFAULT&&get(proto,DEFAULT)||value;if(framework){setIterator(proto,iter);if(iter!==value){var iterProto=getPrototypeOf(iter.call(new Constructor));setToStringTag(iterProto,NAME+" Iterator",true);has(proto,FF_ITERATOR)&&setIterator(iterProto,returnThis)}}Iterators[NAME]=iter;Iterators[NAME+" Iterator"]=returnThis;return iter}function defineStdIterators(Base,NAME,Constructor,next,DEFAULT,IS_SET){function createIter(kind){return function(){return new Constructor(this,kind)}}createIterator(Constructor,NAME,next);var entries=createIter(KEY+VALUE),values=createIter(VALUE);if(DEFAULT==VALUE)values=defineIterator(Base,NAME,values,"values");else entries=defineIterator(Base,NAME,entries,"entries");if(DEFAULT){$define(PROTO+FORCED*BUGGY_ITERATORS,NAME,{entries:entries,keys:IS_SET?values:createIter(KEY),values:values})}}function iterResult(done,value){return{value:value,done:!!done}}function isIterable(it){var O=Object(it),Symbol=global[SYMBOL],hasExt=(Symbol&&Symbol[ITERATOR]||FF_ITERATOR)in O;return hasExt||SYMBOL_ITERATOR in O||has(Iterators,classof(O))}function getIterator(it){var Symbol=global[SYMBOL],ext=it[Symbol&&Symbol[ITERATOR]||FF_ITERATOR],getIter=ext||it[SYMBOL_ITERATOR]||Iterators[classof(it)];return assertObject(getIter.call(it))}function stepCall(fn,value,entries){return entries?invoke(fn,value):fn(value)}function forOf(iterable,entries,fn,that){var iterator=getIterator(iterable),f=ctx(fn,that,entries?2:1),step;while(!(step=iterator.next()).done)if(stepCall(f,step.value,entries)===false)return}var NODE=cof(process)==PROCESS,core={},path=framework?global:core,old=global.core,exportGlobal,FORCED=1,GLOBAL=2,STATIC=4,PROTO=8,BIND=16,WRAP=32;function $define(type,name,source){var key,own,out,exp,isGlobal=type&GLOBAL,target=isGlobal?global:type&STATIC?global[name]:(global[name]||ObjectProto)[PROTOTYPE],exports=isGlobal?core:core[name]||(core[name]={});if(isGlobal)source=name;for(key in source){own=!(type&FORCED)&&target&&key in target&&(!isFunction(target[key])||isNative(target[key]));out=(own?target:source)[key];if(type&BIND&&own)exp=ctx(out,global);else if(type&WRAP&&!framework&&target[key]==out){exp=function(param){return this instanceof out?new out(param):out(param)};exp[PROTOTYPE]=out[PROTOTYPE]}else exp=type&PROTO&&isFunction(out)?ctx(call,out):out;if(exports[key]!=out)hidden(exports,key,exp);if(framework&&target&&!own){if(isGlobal)target[key]=out;else delete target[key]&&hidden(target,key,out)}}}if(typeof module!="undefined"&&module.exports)module.exports=core;else if(isFunction(define)&&define.amd)define(function(){return core});else exportGlobal=true;if(exportGlobal||framework){core.noConflict=function(){global.core=old;return core};global.core=core}$define(GLOBAL+FORCED,{global:global});!function(TAG,SymbolRegistry,AllSymbols,setter){if(!isNative(Symbol)){Symbol=function(description){assert(!(this instanceof Symbol),SYMBOL+" is not a "+CONSTRUCTOR);var tag=uid(description);AllSymbols[tag]=true;DESC&&setter&&defineProperty(ObjectProto,tag,{configurable:true,set:function(value){hidden(this,tag,value)}});return set(create(Symbol[PROTOTYPE]),TAG,tag)};hidden(Symbol[PROTOTYPE],TO_STRING,function(){return this[TAG]})}$define(GLOBAL+WRAP,{Symbol:Symbol});var symbolStatics={"for":function(key){return has(SymbolRegistry,key+="")?SymbolRegistry[key]:SymbolRegistry[key]=Symbol(key)},iterator:SYMBOL_ITERATOR,keyFor:part.call(keyOf,SymbolRegistry),species:SYMBOL_SPECIES,toStringTag:SYMBOL_TAG=getWellKnownSymbol(TO_STRING_TAG,true),unscopables:SYMBOL_UNSCOPABLES,pure:safeSymbol,set:set,useSetter:function(){setter=true},useSimple:function(){setter=false}};forEach.call(array("hasInstance,isConcatSpreadable,match,replace,search,split,toPrimitive"),function(it){symbolStatics[it]=getWellKnownSymbol(it)});$define(STATIC,SYMBOL,symbolStatics);setToStringTag(Symbol,SYMBOL);$define(STATIC+FORCED*!isNative(Symbol),OBJECT,{getOwnPropertyNames:function(it){var names=getNames(toObject(it)),result=[],key,i=0;while(names.length>i)has(AllSymbols,key=names[i++])||result.push(key);return result},getOwnPropertySymbols:function(it){var names=getNames(toObject(it)),result=[],key,i=0;while(names.length>i)has(AllSymbols,key=names[i++])&&result.push(key);return result}})}(safeSymbol("tag"),{},{},true);!function(RegExpProto,isFinite,tmp,NAME){var RangeError=global.RangeError,isInteger=Number.isInteger||function(it){return!isObject(it)&&isFinite(it)&&floor(it)===it},sign=Math.sign||function sign(x){return(x=+x)==0||x!=x?x:x<0?-1:1},E=Math.E,pow=Math.pow,abs=Math.abs,exp=Math.exp,log=Math.log,sqrt=Math.sqrt,fcc=String.fromCharCode,at=createPointAt(true);var objectStatic={assign:assign,is:function(x,y){return x===y?x!==0||1/x===1/y:x!=x&&y!=y}};"__proto__"in ObjectProto&&function(buggy,set){try{set=ctx(call,getOwnDescriptor(ObjectProto,"__proto__").set,2);set({},ArrayProto)}catch(e){buggy=true}objectStatic.setPrototypeOf=setPrototypeOf=setPrototypeOf||function(O,proto){assertObject(O);assert(proto===null||isObject(proto),proto,": can't set as prototype!");if(buggy)O.__proto__=proto;else set(O,proto);return O}}();$define(STATIC,OBJECT,objectStatic);function asinh(x){return!isFinite(x=+x)||x==0?x:x<0?-asinh(-x):log(x+sqrt(x*x+1))}function expm1(x){return(x=+x)==0?x:x>-1e-6&&x<1e-6?x+x*x/2:exp(x)-1}$define(STATIC,NUMBER,{EPSILON:pow(2,-52),isFinite:function(it){return typeof it=="number"&&isFinite(it)},isInteger:isInteger,isNaN:sameNaN,isSafeInteger:function(number){return isInteger(number)&&abs(number)<=MAX_SAFE_INTEGER},MAX_SAFE_INTEGER:MAX_SAFE_INTEGER,MIN_SAFE_INTEGER:-MAX_SAFE_INTEGER,parseFloat:parseFloat,parseInt:parseInt});$define(STATIC,MATH,{acosh:function(x){return(x=+x)<1?NaN:isFinite(x)?log(x/E+sqrt(x+1)*sqrt(x-1)/E)+1:x},asinh:asinh,atanh:function(x){return(x=+x)==0?x:log((1+x)/(1-x))/2},cbrt:function(x){return sign(x=+x)*pow(abs(x),1/3)},clz32:function(x){return(x>>>=0)?32-x[TO_STRING](2).length:32},cosh:function(x){return(exp(x=+x)+exp(-x))/2},expm1:expm1,fround:function(x){return new Float32Array([x])[0]},hypot:function(value1,value2){var sum=0,len1=arguments.length,len2=len1,args=Array(len1),larg=-Infinity,arg;while(len1--){arg=args[len1]=+arguments[len1];if(arg==Infinity||arg==-Infinity)return Infinity;if(arg>larg)larg=arg}larg=arg||1;while(len2--)sum+=pow(args[len2]/larg,2);return larg*sqrt(sum)},imul:function(x,y){var UInt16=65535,xn=+x,yn=+y,xl=UInt16&xn,yl=UInt16&yn;return 0|xl*yl+((UInt16&xn>>>16)*yl+xl*(UInt16&yn>>>16)<<16>>>0)},log1p:function(x){return(x=+x)>-1e-8&&x<1e-8?x-x*x/2:log(1+x)},log10:function(x){return log(x)/Math.LN10},log2:function(x){return log(x)/Math.LN2},sign:sign,sinh:function(x){return abs(x=+x)<1?(expm1(x)-expm1(-x))/2:(exp(x-1)-exp(-x-1))*(E/2)},tanh:function(x){var a=expm1(x=+x),b=expm1(-x);return a==Infinity?1:b==Infinity?-1:(a-b)/(exp(x)+exp(-x))},trunc:trunc});setToStringTag(Math,MATH,true);function assertNotRegExp(it){if(cof(it)==REGEXP)throw TypeError()}$define(STATIC,STRING,{fromCodePoint:function(x){var res=[],len=arguments.length,i=0,code;while(len>i){code=+arguments[i++];if(toIndex(code,1114111)!==code)throw RangeError(code+" is not a valid code point");res.push(code<65536?fcc(code):fcc(((code-=65536)>>10)+55296,code%1024+56320))}return res.join("")},raw:function(callSite){var raw=toObject(callSite.raw),len=toLength(raw.length),sln=arguments.length,res=[],i=0;while(len>i){res.push(String(raw[i++]));if(i<sln)res.push(String(arguments[i]))}return res.join("")}});$define(PROTO,STRING,{codePointAt:createPointAt(false),endsWith:function(searchString){assertNotRegExp(searchString);var that=String(assertDefined(this)),endPosition=arguments[1],len=toLength(that.length),end=endPosition===undefined?len:min(toLength(endPosition),len);searchString+="";return that.slice(end-searchString.length,end)===searchString},includes:function(searchString){assertNotRegExp(searchString);return!!~String(assertDefined(this)).indexOf(searchString,arguments[1])},repeat:function(count){var str=String(assertDefined(this)),res="",n=toInteger(count);if(0>n||n==Infinity)throw RangeError("Count can't be negative");for(;n>0;(n>>>=1)&&(str+=str))if(n&1)res+=str;return res},startsWith:function(searchString){assertNotRegExp(searchString);var that=String(assertDefined(this)),index=toLength(min(arguments[1],that.length));searchString+="";return that.slice(index,index+searchString.length)===searchString}});defineStdIterators(String,STRING,function(iterated){set(this,ITER,{o:String(iterated),i:0})},function(){var iter=this[ITER],O=iter.o,index=iter.i,point;if(index>=O.length)return iterResult(1);point=at.call(O,index);iter.i+=point.length;return iterResult(0,point)});$define(STATIC,ARRAY,{from:function(arrayLike){var O=Object(assertDefined(arrayLike)),result=new(generic(this,Array)),mapfn=arguments[1],that=arguments[2],mapping=mapfn!==undefined,f=mapping?ctx(mapfn,that,2):undefined,index=0,length;if(isIterable(O))for(var iter=getIterator(O),step;!(step=iter.next()).done;index++){result[index]=mapping?f(step.value,index):step.value}else for(length=toLength(O.length);length>index;index++){result[index]=mapping?f(O[index],index):O[index]}result.length=index;return result},of:function(){var index=0,length=arguments.length,result=new(generic(this,Array))(length);while(length>index)result[index]=arguments[index++];result.length=length;return result}});$define(PROTO,ARRAY,{copyWithin:function(target,start){var O=Object(assertDefined(this)),len=toLength(O.length),to=toIndex(target,len),from=toIndex(start,len),end=arguments[2],fin=end===undefined?len:toIndex(end,len),count=min(fin-from,len-to),inc=1;if(from<to&&to<from+count){inc=-1;from=from+count-1;to=to+count-1}while(count-->0){if(from in O)O[to]=O[from];else delete O[to];to+=inc;from+=inc}return O},fill:function(value){var O=Object(assertDefined(this)),length=toLength(O.length),index=toIndex(arguments[1],length),end=arguments[2],endPos=end===undefined?length:toIndex(end,length);while(endPos>index)O[index++]=value;return O},find:createArrayMethod(5),findIndex:createArrayMethod(6)});defineStdIterators(Array,ARRAY,function(iterated,kind){set(this,ITER,{o:toObject(iterated),i:0,k:kind})},function(){var iter=this[ITER],O=iter.o,kind=iter.k,index=iter.i++;if(!O||index>=O.length)return iter.o=undefined,iterResult(1);if(kind==KEY)return iterResult(0,index);if(kind==VALUE)return iterResult(0,O[index]);return iterResult(0,[index,O[index]])},VALUE);Iterators[ARGUMENTS]=Iterators[ARRAY];setToStringTag(global.JSON,"JSON",true);function wrapObjectMethod(key,MODE){var fn=Object[key],exp=core[OBJECT][key],f=0,o={};if(!exp||isNative(exp)){o[key]=MODE==1?function(it){return isObject(it)?fn(it):it}:MODE==2?function(it){return isObject(it)?fn(it):true}:MODE==3?function(it){return isObject(it)?fn(it):false}:MODE==4?function(it,key){return fn(toObject(it),key)}:function(it){return fn(toObject(it))};try{fn(DOT)}catch(e){f=1}$define(STATIC+FORCED*f,OBJECT,o)}}wrapObjectMethod("freeze",1);wrapObjectMethod("seal",1);wrapObjectMethod("preventExtensions",1);wrapObjectMethod("isFrozen",2);wrapObjectMethod("isSealed",2);wrapObjectMethod("isExtensible",3);wrapObjectMethod("getOwnPropertyDescriptor",4);wrapObjectMethod("getPrototypeOf");wrapObjectMethod("keys");wrapObjectMethod("getOwnPropertyNames");if(framework){tmp[SYMBOL_TAG]=DOT;if(cof(tmp)!=DOT)hidden(ObjectProto,TO_STRING,function(){return"[object "+classof(this)+"]"});NAME in FunctionProto||defineProperty(FunctionProto,NAME,{configurable:true,get:function(){var match=String(this).match(/^\s*function ([^ (]*)/),name=match?match[1]:"";has(this,NAME)||defineProperty(this,NAME,descriptor(5,name));return name},set:function(value){has(this,NAME)||defineProperty(this,NAME,descriptor(0,value))}});if(DESC&&!function(){try{return RegExp(/a/g,"i")=="/a/i"}catch(e){}}()){var _RegExp=RegExp;RegExp=function RegExp(pattern,flags){return new _RegExp(cof(pattern)==REGEXP&&flags!==undefined?pattern.source:pattern,flags)};forEach.call(getNames(_RegExp),function(key){key in RegExp||defineProperty(RegExp,key,{configurable:true,get:function(){return _RegExp[key]},set:function(it){_RegExp[key]=it}})});RegExpProto[CONSTRUCTOR]=RegExp;RegExp[PROTOTYPE]=RegExpProto;hidden(global,REGEXP,RegExp)}if(/./g.flags!="g")defineProperty(RegExpProto,"flags",{configurable:true,get:createReplacer(/^.*\/(\w*)$/,"$1")});forEach.call(array("find,findIndex,fill,copyWithin,entries,keys,values"),function(it){ArrayUnscopables[it]=true});SYMBOL_UNSCOPABLES in ArrayProto||hidden(ArrayProto,SYMBOL_UNSCOPABLES,ArrayUnscopables)}setSpecies(RegExp);setSpecies(Array)}(RegExp[PROTOTYPE],isFinite,{},"name");isFunction(setImmediate)&&isFunction(clearImmediate)||function(ONREADYSTATECHANGE){var postMessage=global.postMessage,addEventListener=global.addEventListener,MessageChannel=global.MessageChannel,counter=0,queue={},defer,channel,port;setImmediate=function(fn){var args=[],i=1;while(arguments.length>i)args.push(arguments[i++]);queue[++counter]=function(){invoke(isFunction(fn)?fn:Function(fn),args)};defer(counter);return counter};clearImmediate=function(id){delete queue[id]};function run(id){if(has(queue,id)){var fn=queue[id];delete queue[id];fn()}}function listner(event){run(event.data)}if(NODE){defer=function(id){nextTick(part.call(run,id))}}else if(addEventListener&&isFunction(postMessage)&&!global.importScripts){defer=function(id){postMessage(id,"*")};addEventListener("message",listner,false)}else if(isFunction(MessageChannel)){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=listner;defer=ctx(port.postMessage,port,1)}else if(document&&ONREADYSTATECHANGE in document[CREATE_ELEMENT]("script")){defer=function(id){html.appendChild(document[CREATE_ELEMENT]("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this);run(id)}}}else{defer=function(id){setTimeout(part.call(run,id),0)}}}("onreadystatechange");$define(GLOBAL+BIND,{setImmediate:setImmediate,clearImmediate:clearImmediate});!function(Promise,test){isFunction(Promise)&&isFunction(Promise.resolve)&&Promise.resolve(test=new Promise(function(){}))==test||function(asap,DEF){function isThenable(o){var then;if(isObject(o))then=o.then;return isFunction(then)?then:false}function notify(def){var chain=def.chain;chain.length&&asap(function(){var msg=def.msg,ok=def.state==1,i=0;while(chain.length>i)!function(react){var cb=ok?react.ok:react.fail,ret,then;try{if(cb){ret=cb===true?msg:cb(msg);if(ret===react.P){react.rej(TypeError(PROMISE+"-chain cycle"))}else if(then=isThenable(ret)){then.call(ret,react.res,react.rej)}else react.res(ret)}else react.rej(msg)}catch(err){react.rej(err)}}(chain[i++]);chain.length=0})}function resolve(msg){var def=this,then,wrapper;if(def.done)return;def.done=true;def=def.def||def;try{if(then=isThenable(msg)){wrapper={def:def,done:false};then.call(msg,ctx(resolve,wrapper,1),ctx(reject,wrapper,1))}else{def.msg=msg;def.state=1;notify(def)}}catch(err){reject.call(wrapper||{def:def,done:false},err)}}function reject(msg){var def=this;if(def.done)return;def.done=true;def=def.def||def;def.msg=msg;def.state=2;notify(def)}function getConstructor(C){var S=assertObject(C)[SYMBOL_SPECIES];return S!=undefined?S:C}Promise=function(executor){assertFunction(executor);assertInstance(this,Promise,PROMISE);var def={chain:[],state:0,done:false,msg:undefined};hidden(this,DEF,def);try{executor(ctx(resolve,def,1),ctx(reject,def,1))}catch(err){reject.call(def,err)}};assignHidden(Promise[PROTOTYPE],{then:function(onFulfilled,onRejected){var S=assertObject(assertObject(this)[CONSTRUCTOR])[SYMBOL_SPECIES];var react={ok:isFunction(onFulfilled)?onFulfilled:true,fail:isFunction(onRejected)?onRejected:false},P=react.P=new(S!=undefined?S:Promise)(function(resolve,reject){react.res=assertFunction(resolve);react.rej=assertFunction(reject)}),def=this[DEF];def.chain.push(react);def.state&¬ify(def);return P},"catch":function(onRejected){return this.then(undefined,onRejected)}});assignHidden(Promise,{all:function(iterable){var Promise=getConstructor(this),values=[];return new Promise(function(resolve,reject){forOf(iterable,false,push,values);var remaining=values.length,results=Array(remaining);if(remaining)forEach.call(values,function(promise,index){Promise.resolve(promise).then(function(value){results[index]=value;--remaining||resolve(results)},reject)});else resolve(results)})},race:function(iterable){var Promise=getConstructor(this);return new Promise(function(resolve,reject){forOf(iterable,false,function(promise){Promise.resolve(promise).then(resolve,reject)})})},reject:function(r){return new(getConstructor(this))(function(resolve,reject){reject(r)})},resolve:function(x){return isObject(x)&&DEF in x&&getPrototypeOf(x)===this[PROTOTYPE]?x:new(getConstructor(this))(function(resolve,reject){resolve(x)})}})}(nextTick||setImmediate,safeSymbol("def"));setToStringTag(Promise,PROMISE);setSpecies(Promise);$define(GLOBAL+FORCED*!isNative(Promise),{Promise:Promise})}(global[PROMISE]);!function(){var UID=safeSymbol("uid"),DATA=safeSymbol("data"),WEAK=safeSymbol("weak"),LAST=safeSymbol("last"),FIRST=safeSymbol("first"),SIZE=DESC?safeSymbol("size"):"size",uid=0;function getCollection(C,NAME,methods,commonMethods,isMap,isWeak){var ADDER=isMap?"set":"add",proto=C&&C[PROTOTYPE],O={};function initFromIterable(that,iterable){if(iterable!=undefined)forOf(iterable,isMap,that[ADDER],that);return that}function fixSVZ(key,chain){var method=proto[key];framework&&hidden(proto,key,function(a,b){var result=method.call(this,a===0?0:a,b);return chain?this:result})}if(!isNative(C)||!(isWeak||!BUGGY_ITERATORS&&has(proto,"entries"))){C=isWeak?function(iterable){assertInstance(this,C,NAME);set(this,UID,uid++);initFromIterable(this,iterable)}:function(iterable){var that=this;assertInstance(that,C,NAME);set(that,DATA,create(null));set(that,SIZE,0);set(that,LAST,undefined);set(that,FIRST,undefined);initFromIterable(that,iterable)};assignHidden(assignHidden(C[PROTOTYPE],methods),commonMethods);isWeak||defineProperty(C[PROTOTYPE],"size",{get:function(){return assertDefined(this[SIZE])}})}else{var Native=C,inst=new C,chain=inst[ADDER](isWeak?{}:-0,1),buggyZero;if(!NATIVE_ITERATORS||!C.length){C=function(iterable){assertInstance(this,C,NAME);return initFromIterable(new Native,iterable)};C[PROTOTYPE]=proto}isWeak||inst[FOR_EACH](function(val,key){buggyZero=1/key===-Infinity});if(buggyZero){fixSVZ("delete");fixSVZ("has");isMap&&fixSVZ("get")}if(buggyZero||chain!==inst)fixSVZ(ADDER,true)}setToStringTag(C,NAME);setSpecies(C);O[NAME]=C;$define(GLOBAL+WRAP+FORCED*!isNative(C),O);isWeak||defineStdIterators(C,NAME,function(iterated,kind){set(this,ITER,{o:iterated,k:kind})},function(){var iter=this[ITER],O=iter.o,kind=iter.k,entry=iter.l;while(entry&&entry.r)entry=entry.p;if(!O||!(iter.l=entry=entry?entry.n:O[FIRST]))return iter.o=undefined,iterResult(1);if(kind==KEY)return iterResult(0,entry.k);if(kind==VALUE)return iterResult(0,entry.v);return iterResult(0,[entry.k,entry.v])},isMap?KEY+VALUE:VALUE,!isMap);return C}function fastKey(it,create){if(!isObject(it))return(typeof it=="string"?"S":"P")+it;if(!has(it,UID)){if(create)hidden(it,UID,++uid);else return""}return"O"+it[UID]}function def(that,key,value){var index=fastKey(key,true),data=that[DATA],last=that[LAST],entry;if(index in data)data[index].v=value;else{entry=data[index]={k:key,v:value,p:last};if(!that[FIRST])that[FIRST]=entry;if(last)last.n=entry;that[LAST]=entry;that[SIZE]++}return that}function del(that,index){var data=that[DATA],entry=data[index],next=entry.n,prev=entry.p;delete data[index];entry.r=true;if(prev)prev.n=next;if(next)next.p=prev;if(that[FIRST]==entry)that[FIRST]=next;if(that[LAST]==entry)that[LAST]=prev;that[SIZE]--}var collectionMethods={clear:function(){for(var index in this[DATA])del(this,index)},"delete":function(key){var index=fastKey(key),contains=index in this[DATA];if(contains)del(this,index);return contains},forEach:function(callbackfn){var f=ctx(callbackfn,arguments[1],3),entry;while(entry=entry?entry.n:this[FIRST]){f(entry.v,entry.k,this);while(entry&&entry.r)entry=entry.p}},has:function(key){return fastKey(key)in this[DATA]}};Map=getCollection(Map,MAP,{get:function(key){var entry=this[DATA][fastKey(key)];return entry&&entry.v},set:function(key,value){return def(this,key===0?0:key,value)}},collectionMethods,true);Set=getCollection(Set,SET,{add:function(value){return def(this,value=value===0?0:value,value)}},collectionMethods);function setWeak(that,key,value){has(assertObject(key),WEAK)||hidden(key,WEAK,{});key[WEAK][that[UID]]=value;return that}function hasWeak(key){return isObject(key)&&has(key,WEAK)&&has(key[WEAK],this[UID])}var weakMethods={"delete":function(key){return hasWeak.call(this,key)&&delete key[WEAK][this[UID]]},has:hasWeak};WeakMap=getCollection(WeakMap,WEAKMAP,{get:function(key){if(isObject(key)&&has(key,WEAK))return key[WEAK][this[UID]]},set:function(key,value){return setWeak(this,key,value)}},weakMethods,true,true);WeakSet=getCollection(WeakSet,WEAKSET,{add:function(value){return setWeak(this,value,true)}},weakMethods,false,true)}();!function(){function Enumerate(iterated){var keys=[],key;for(key in iterated)keys.push(key);set(this,ITER,{o:iterated,a:keys,i:0})}createIterator(Enumerate,OBJECT,function(){var iter=this[ITER],keys=iter.a,key;do{if(iter.i>=keys.length)return iterResult(1)}while(!((key=keys[iter.i++])in iter.o));return iterResult(0,key)});function wrap(fn){return function(it){assertObject(it);try{return fn.apply(undefined,arguments),true}catch(e){return false}}}function reflectGet(target,propertyKey){var receiver=arguments.length<3?target:arguments[2],desc=getOwnDescriptor(assertObject(target),propertyKey),proto;if(desc)return desc.get?desc.get.call(receiver):desc.value;return isObject(proto=getPrototypeOf(target))?reflectGet(proto,propertyKey,receiver):undefined}function reflectSet(target,propertyKey,V){var receiver=arguments.length<4?target:arguments[3],desc=getOwnDescriptor(assertObject(target),propertyKey),proto;if(desc){if(desc.writable===false)return false;if(desc.set)return desc.set.call(receiver,V),true}if(isObject(proto=getPrototypeOf(target)))return reflectSet(proto,propertyKey,V,receiver);desc=getOwnDescriptor(receiver,propertyKey)||descriptor(0);desc.value=V;return defineProperty(receiver,propertyKey,desc),true}var isExtensible=Object.isExtensible||returnIt;var reflect={apply:ctx(call,apply,3),construct:construct,defineProperty:wrap(defineProperty),deleteProperty:function(target,propertyKey){var desc=getOwnDescriptor(assertObject(target),propertyKey);return desc&&!desc.configurable?false:delete target[propertyKey]},enumerate:function(target){return new Enumerate(assertObject(target))},get:reflectGet,getOwnPropertyDescriptor:function(target,propertyKey){return getOwnDescriptor(assertObject(target),propertyKey)},getPrototypeOf:function(target){return getPrototypeOf(assertObject(target))},has:function(target,propertyKey){return propertyKey in target},isExtensible:function(target){return!!isExtensible(assertObject(target))},ownKeys:ownKeys,preventExtensions:wrap(Object.preventExtensions||returnIt),set:reflectSet};if(setPrototypeOf)reflect.setPrototypeOf=function(target,proto){return setPrototypeOf(assertObject(target),proto),true};$define(GLOBAL,{Reflect:{}});$define(STATIC,"Reflect",reflect)}();!function(){$define(PROTO,ARRAY,{includes:createArrayContains(true)});$define(PROTO,STRING,{at:createPointAt(true)});function createObjectToArray(isEntries){return function(object){var O=toObject(object),keys=getKeys(object),length=keys.length,i=0,result=Array(length),key;if(isEntries)while(length>i)result[i]=[key=keys[i++],O[key]];else while(length>i)result[i]=O[keys[i++]];return result}}$define(STATIC,OBJECT,{values:createObjectToArray(false),entries:createObjectToArray(true)});$define(STATIC,REGEXP,{escape:createReplacer(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",true)})}();!function(REFERENCE){REFERENCE_GET=getWellKnownSymbol(REFERENCE+"Get",true);var REFERENCE_SET=getWellKnownSymbol(REFERENCE+SET,true),REFERENCE_DELETE=getWellKnownSymbol(REFERENCE+"Delete",true);$define(STATIC,SYMBOL,{referenceGet:REFERENCE_GET,referenceSet:REFERENCE_SET,referenceDelete:REFERENCE_DELETE});hidden(FunctionProto,REFERENCE_GET,returnThis);function setMapMethods(Constructor){if(Constructor){var MapProto=Constructor[PROTOTYPE];hidden(MapProto,REFERENCE_GET,MapProto.get);hidden(MapProto,REFERENCE_SET,MapProto.set);hidden(MapProto,REFERENCE_DELETE,MapProto["delete"])}}setMapMethods(Map);setMapMethods(WeakMap)}("reference");!function(NodeList){if(framework&&NodeList&&!(SYMBOL_ITERATOR in NodeList[PROTOTYPE])){hidden(NodeList[PROTOTYPE],SYMBOL_ITERATOR,Iterators[ARRAY])}Iterators.NodeList=Iterators[ARRAY]}(global.NodeList);!function(DICT){Dict=function(iterable){var dict=create(null);if(iterable!=undefined){if(isIterable(iterable)){for(var iter=getIterator(iterable),step,value;!(step=iter.next()).done;){value=step.value;dict[value[0]]=value[1]}}else assign(dict,iterable)}return dict};Dict[PROTOTYPE]=null;function DictIterator(iterated,kind){set(this,ITER,{o:toObject(iterated),a:getKeys(iterated),i:0,k:kind})}createIterator(DictIterator,DICT,function(){var iter=this[ITER],O=iter.o,keys=iter.a,kind=iter.k,key;do{if(iter.i>=keys.length)return iterResult(1)}while(!has(O,key=keys[iter.i++]));if(kind==KEY)return iterResult(0,key);if(kind==VALUE)return iterResult(0,O[key]);return iterResult(0,[key,O[key]])});function createDictIter(kind){return function(it){return new DictIterator(it,kind)}}function createDictMethod(type){var isMap=type==1,isEvery=type==4;return function(object,callbackfn,that){var f=ctx(callbackfn,that,3),O=toObject(object),result=isMap||type==7||type==2?new(generic(this,Dict)):undefined,key,val,res;for(key in O)if(has(O,key)){val=O[key];res=f(val,key,object);if(type){if(isMap)result[key]=res;else if(res)switch(type){case 2:result[key]=val;break;case 3:return true;case 5:return val;case 6:return key;case 7:result[res[0]]=res[1]}else if(isEvery)return false}}return type==3||isEvery?isEvery:result}}function createDictReduce(isTurn){return function(object,mapfn,init){assertFunction(mapfn);var O=toObject(object),keys=getKeys(O),length=keys.length,i=0,memo,key,result;if(isTurn)memo=init==undefined?new(generic(this,Dict)):Object(init);else if(arguments.length<3){assert(length,REDUCE_ERROR);memo=O[keys[i++]]}else memo=Object(init);while(length>i)if(has(O,key=keys[i++])){result=mapfn(memo,O[key],key,object);if(isTurn){if(result===false)break}else memo=result}return memo}}var findKey=createDictMethod(6);function includes(object,el){return(el==el?keyOf(object,el):findKey(object,sameNaN))!==undefined}var dictMethods={keys:createDictIter(KEY),values:createDictIter(VALUE),entries:createDictIter(KEY+VALUE),forEach:createDictMethod(0),map:createDictMethod(1),filter:createDictMethod(2),some:createDictMethod(3),every:createDictMethod(4),find:createDictMethod(5),findKey:findKey,mapPairs:createDictMethod(7),reduce:createDictReduce(false),turn:createDictReduce(true),keyOf:keyOf,includes:includes,has:has,get:get,set:createDefiner(0),isDict:function(it){return isObject(it)&&getPrototypeOf(it)===Dict[PROTOTYPE]}};if(REFERENCE_GET)for(var key in dictMethods)!function(fn){function method(){for(var args=[this],i=0;i<arguments.length;)args.push(arguments[i++]);return invoke(fn,args)}fn[REFERENCE_GET]=function(){return method}}(dictMethods[key]);$define(GLOBAL+FORCED,{Dict:assignHidden(Dict,dictMethods)})}("Dict");!function(ENTRIES,FN){function $for(iterable,entries){if(!(this instanceof $for))return new $for(iterable,entries);this[ITER]=getIterator(iterable);this[ENTRIES]=!!entries}createIterator($for,"Wrapper",function(){return this[ITER].next()});var $forProto=$for[PROTOTYPE];setIterator($forProto,function(){return this[ITER]});function createChainIterator(next){function Iter(I,fn,that){this[ITER]=getIterator(I);this[ENTRIES]=I[ENTRIES];this[FN]=ctx(fn,that,I[ENTRIES]?2:1)}createIterator(Iter,"Chain",next,$forProto);setIterator(Iter[PROTOTYPE],returnThis);return Iter}var MapIter=createChainIterator(function(){var step=this[ITER].next();return step.done?step:iterResult(0,stepCall(this[FN],step.value,this[ENTRIES]))});var FilterIter=createChainIterator(function(){for(;;){var step=this[ITER].next();if(step.done||stepCall(this[FN],step.value,this[ENTRIES]))return step}});assignHidden($forProto,{of:function(fn,that){forOf(this,this[ENTRIES],fn,that)},array:function(fn,that){var result=[];forOf(fn!=undefined?this.map(fn,that):this,false,push,result);
return result},filter:function(fn,that){return new FilterIter(this,fn,that)},map:function(fn,that){return new MapIter(this,fn,that)}});$for.isIterable=isIterable;$for.getIterator=getIterator;$define(GLOBAL+FORCED,{$for:$for})}("entries",safeSymbol("fn"));!function(_,toLocaleString){core._=path._=path._||{};$define(PROTO+FORCED,FUNCTION,{part:part,only:function(numberArguments,that){var fn=assertFunction(this),n=toLength(numberArguments),isThat=arguments.length>1;return function(){var length=min(n,arguments.length),args=Array(length),i=0;while(length>i)args[i]=arguments[i++];return invoke(fn,args,isThat?that:this)}}});function tie(key){var that=this,bound={};return hidden(that,_,function(key){if(key===undefined||!(key in that))return toLocaleString.call(that);return has(bound,key)?bound[key]:bound[key]=ctx(that[key],that,-1)})[_](key)}hidden(path._,TO_STRING,function(){return _});hidden(ObjectProto,_,tie);DESC||hidden(ArrayProto,_,tie)}(DESC?uid("tie"):TO_LOCALE,ObjectProto[TO_LOCALE]);!function(){function define(target,mixin){var keys=ownKeys(toObject(mixin)),length=keys.length,i=0,key;while(length>i)defineProperty(target,key=keys[i++],getOwnDescriptor(mixin,key));return target}$define(STATIC+FORCED,OBJECT,{isObject:isObject,classof:classof,define:define,make:function(proto,mixin){return define(create(proto),mixin)}})}();$define(PROTO+FORCED,ARRAY,{turn:function(fn,target){assertFunction(fn);var memo=target==undefined?[]:Object(target),O=ES5Object(this),length=toLength(O.length),index=0;while(length>index)if(fn(memo,O[index],index++,this)===false)break;return memo}});if(framework)ArrayUnscopables.turn=true;!function(arrayStatics){function setArrayStatics(keys,length){forEach.call(array(keys),function(key){if(key in ArrayProto)arrayStatics[key]=ctx(call,ArrayProto[key],length)})}setArrayStatics("pop,reverse,shift,keys,values,entries",1);setArrayStatics("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3);setArrayStatics("join,slice,concat,push,splice,unshift,sort,lastIndexOf,"+"reduce,reduceRight,copyWithin,fill,turn");$define(STATIC,ARRAY,arrayStatics)}({});!function(numberMethods){function NumberIterator(iterated){set(this,ITER,{l:toLength(iterated),i:0})}createIterator(NumberIterator,NUMBER,function(){var iter=this[ITER],i=iter.i++;return i<iter.l?iterResult(0,i):iterResult(1)});defineIterator(Number,NUMBER,function(){return new NumberIterator(this)});numberMethods.random=function(lim){var a=+this,b=lim==undefined?0:+lim,m=min(a,b);return random()*(max(a,b)-m)+m};forEach.call(array("round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,"+"acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc"),function(key){var fn=Math[key];if(fn)numberMethods[key]=function(){var args=[+this],i=0;while(arguments.length>i)args.push(arguments[i++]);return invoke(fn,args)}});$define(PROTO+FORCED,NUMBER,numberMethods)}({});!function(){var escapeHTMLDict={"&":"&","<":"<",">":">",'"':""","'":"'"},unescapeHTMLDict={},key;for(key in escapeHTMLDict)unescapeHTMLDict[escapeHTMLDict[key]]=key;$define(PROTO+FORCED,STRING,{escapeHTML:createReplacer(/[&<>"']/g,escapeHTMLDict),unescapeHTML:createReplacer(/&(?:amp|lt|gt|quot|apos);/g,unescapeHTMLDict)})}();!function(formatRegExp,flexioRegExp,locales,current,SECONDS,MINUTES,HOURS,MONTH,YEAR){function createFormat(prefix){return function(template,locale){var that=this,dict=locales[has(locales,locale)?locale:current];function get(unit){return that[prefix+unit]()}return String(template).replace(formatRegExp,function(part){switch(part){case"s":return get(SECONDS);case"ss":return lz(get(SECONDS));case"m":return get(MINUTES);case"mm":return lz(get(MINUTES));case"h":return get(HOURS);case"hh":return lz(get(HOURS));case"D":return get(DATE);case"DD":return lz(get(DATE));case"W":return dict[0][get("Day")];case"N":return get(MONTH)+1;case"NN":return lz(get(MONTH)+1);case"M":return dict[2][get(MONTH)];case"MM":return dict[1][get(MONTH)];case"Y":return get(YEAR);case"YY":return lz(get(YEAR)%100)}return part})}}function lz(num){return num>9?num:"0"+num}function addLocale(lang,locale){function split(index){var result=[];forEach.call(array(locale.months),function(it){result.push(it.replace(flexioRegExp,"$"+index))});return result}locales[lang]=[array(locale.weekdays),split(1),split(2)];return core}$define(PROTO+FORCED,DATE,{format:createFormat("get"),formatUTC:createFormat("getUTC")});addLocale(current,{weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",months:"January,February,March,April,May,June,July,August,September,October,November,December"});addLocale("ru",{weekdays:"Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота",months:"Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,"+"Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь"});core.locale=function(locale){return has(locales,locale)?current=locale:current};core.addLocale=addLocale}(/\b\w\w?\b/g,/:(.*)\|(.*)$/,{},"en","Seconds","Minutes","Hours","Month","FullYear")}(typeof self!="undefined"&&self.Math===Math?self:Function("return this")(),false)},{}],155:[function(require,module,exports){"use strict";var repeating=require("repeating");var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){var result=0;var maxUsed=0;var maxWeight=0;for(var n in indents){var indent=indents[n];var u=indent[0];var w=indent[1];if(u>maxUsed||u===maxUsed&&w>maxWeight){maxUsed=u;maxWeight=w;result=+n}}return result}module.exports=function(str){if(typeof str!=="string"){throw new TypeError("Expected a string")}var tabs=0;var spaces=0;var prev=0;var indents={};var current;var isIndent;str.split(/\n/g).forEach(function(line){if(!line){return}var indent;var matches=line.match(INDENT_RE);if(!matches){indent=0}else{indent=matches[0].length;if(matches[1]){spaces++}else{tabs++}}var diff=indent-prev;prev=indent;if(diff){isIndent=diff>0;current=indents[isIndent?diff:-diff];if(current){current[0]++}else{current=indents[diff]=[1,0]}}else if(current){current[1]+=+isIndent}});var amount=getMostUsed(indents);var type;var actual;if(!amount){type=null;actual=""}else if(spaces>=tabs){type="space";actual=repeating(" ",amount)}else{type="tab";actual=repeating(" ",amount)}return{amount:amount,type:type,indent:actual}}},{repeating:156}],156:[function(require,module,exports){"use strict";var isFinite=require("is-finite");module.exports=function(str,n){if(typeof str!=="string"){throw new TypeError("Expected a string as the first argument")}if(n<0||!isFinite(n)){throw new TypeError("Expected a finite positive number")}var ret="";do{if(n&1){ret+=str}str+=str}while(n=n>>1);return ret}},{"is-finite":157}],157:[function(require,module,exports){"use strict";module.exports=Number.isFinite||function(val){if(typeof val!=="number"||val!==val||val===Infinity||val===-Infinity){return false}return true}},{}],158:[function(require,module,exports){(function(root,factory){"use strict";if(typeof define==="function"&&define.amd){define(["exports"],factory)}else if(typeof exports!=="undefined"){factory(exports)}else{factory(root.estraverse={})}})(this,function clone(exports){"use strict";var Syntax,isArray,VisitorOption,VisitorKeys,objectCreate,objectKeys,BREAK,SKIP,REMOVE;function ignoreJSHintError(){}isArray=Array.isArray;if(!isArray){isArray=function isArray(array){return Object.prototype.toString.call(array)==="[object Array]"}}function deepCopy(obj){var ret={},key,val;for(key in obj){if(obj.hasOwnProperty(key)){val=obj[key];if(typeof val==="object"&&val!==null){ret[key]=deepCopy(val)}else{ret[key]=val}}}return ret}function shallowCopy(obj){var ret={},key;for(key in obj){if(obj.hasOwnProperty(key)){ret[key]=obj[key]}}return ret}ignoreJSHintError(shallowCopy);function upperBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){len=diff}else{i=current+1;len-=diff+1}}return i}function lowerBound(array,func){var diff,len,i,current;len=array.length;i=0;while(len){diff=len>>>1;current=i+diff;if(func(array[current])){i=current+1;len-=diff+1}else{len=diff}}return i}ignoreJSHintError(lowerBound);objectCreate=Object.create||function(){function F(){}return function(o){F.prototype=o;return new F}}();objectKeys=Object.keys||function(o){var keys=[],key;for(key in o){keys.push(key)}return keys};function extend(to,from){objectKeys(from).forEach(function(key){to[key]=from[key]});return to}Syntax={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportBatchSpecifier:"ExportBatchSpecifier",ExportDeclaration:"ExportDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"};VisitorKeys={AssignmentExpression:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","defaults","rest","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ClassBody:["body"],ClassDeclaration:["id","body","superClass"],ClassExpression:["id","body","superClass"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportBatchSpecifier:[],ExportDeclaration:["declaration","specifiers","source"],ExportSpecifier:["id","name"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","defaults","rest","body"],FunctionExpression:["id","params","defaults","rest","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["id"],ImportNamespaceSpecifier:["id"],ImportSpecifier:["id","name"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],Program:["body"],Property:["key","value"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handlers","handler","guardedHandlers","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]};BREAK={};SKIP={};REMOVE={};VisitorOption={Break:BREAK,Skip:SKIP,Remove:REMOVE};function Reference(parent,key){this.parent=parent;this.key=key}Reference.prototype.replace=function replace(node){this.parent[this.key]=node};Reference.prototype.remove=function remove(){if(isArray(this.parent)){this.parent.splice(this.key,1);return true}else{this.replace(null);return false}};function Element(node,path,wrap,ref){this.node=node;this.path=path;this.wrap=wrap;this.ref=ref}function Controller(){}Controller.prototype.path=function path(){var i,iz,j,jz,result,element;function addToPath(result,path){if(isArray(path)){for(j=0,jz=path.length;j<jz;++j){result.push(path[j])}}else{result.push(path)}}if(!this.__current.path){return null}result=[];for(i=2,iz=this.__leavelist.length;i<iz;++i){element=this.__leavelist[i];addToPath(result,element.path)}addToPath(result,this.__current.path);return result};Controller.prototype.type=function(){var node=this.current();return node.type||this.__current.wrap};Controller.prototype.parents=function parents(){var i,iz,result;result=[];for(i=1,iz=this.__leavelist.length;i<iz;++i){result.push(this.__leavelist[i].node)}return result};Controller.prototype.current=function current(){return this.__current.node};Controller.prototype.__execute=function __execute(callback,element){var previous,result;result=undefined;previous=this.__current;this.__current=element;this.__state=null;if(callback){result=callback.call(this,element.node,this.__leavelist[this.__leavelist.length-1].node)}this.__current=previous;return result};Controller.prototype.notify=function notify(flag){this.__state=flag};Controller.prototype.skip=function(){this.notify(SKIP)};Controller.prototype["break"]=function(){this.notify(BREAK)};Controller.prototype.remove=function(){this.notify(REMOVE)};Controller.prototype.__initialize=function(root,visitor){this.visitor=visitor;this.root=root;this.__worklist=[];this.__leavelist=[];this.__current=null;this.__state=null;this.__fallback=visitor.fallback==="iteration";this.__keys=VisitorKeys;if(visitor.keys){this.__keys=extend(objectCreate(this.__keys),visitor.keys)}};function isNode(node){if(node==null){return false}return typeof node==="object"&&typeof node.type==="string"}function isProperty(nodeType,key){return(nodeType===Syntax.ObjectExpression||nodeType===Syntax.ObjectPattern)&&"properties"===key}Controller.prototype.traverse=function traverse(root,visitor){var worklist,leavelist,element,node,nodeType,ret,key,current,current2,candidates,candidate,sentinel;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;worklist.push(new Element(root,null,null,null));leavelist.push(new Element(null,null,null,null));while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();ret=this.__execute(visitor.leave,element);if(this.__state===BREAK||ret===BREAK){return}continue}if(element.node){ret=this.__execute(visitor.enter,element);if(this.__state===BREAK||ret===BREAK){return}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||ret===SKIP){continue}node=element.node;nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",null)}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,null)}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,null))}}}}};Controller.prototype.replace=function replace(root,visitor){function removeElem(element){var i,key,nextElem,parent;if(element.ref.remove()){key=element.ref.key;parent=element.ref.parent;i=worklist.length;while(i--){nextElem=worklist[i];if(nextElem.ref&&nextElem.ref.parent===parent){if(nextElem.ref.key<key){break}--nextElem.ref.key}}}}var worklist,leavelist,node,nodeType,target,element,current,current2,candidates,candidate,sentinel,outer,key;this.__initialize(root,visitor);sentinel={};worklist=this.__worklist;leavelist=this.__leavelist;outer={root:root};element=new Element(root,null,null,new Reference(outer,"root"));worklist.push(element);leavelist.push(element);while(worklist.length){element=worklist.pop();if(element===sentinel){element=leavelist.pop();target=this.__execute(visitor.leave,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target)}if(this.__state===REMOVE||target===REMOVE){removeElem(element)}if(this.__state===BREAK||target===BREAK){return outer.root}continue}target=this.__execute(visitor.enter,element);if(target!==undefined&&target!==BREAK&&target!==SKIP&&target!==REMOVE){element.ref.replace(target);element.node=target}if(this.__state===REMOVE||target===REMOVE){removeElem(element);element.node=null}if(this.__state===BREAK||target===BREAK){return outer.root}node=element.node;if(!node){continue}worklist.push(sentinel);leavelist.push(element);if(this.__state===SKIP||target===SKIP){continue}nodeType=element.wrap||node.type;candidates=this.__keys[nodeType];if(!candidates){if(this.__fallback){candidates=objectKeys(node)}else{throw new Error("Unknown node type "+nodeType+".")}}current=candidates.length;while((current-=1)>=0){key=candidates[current];candidate=node[key];if(!candidate){continue}if(isArray(candidate)){current2=candidate.length;while((current2-=1)>=0){if(!candidate[current2]){continue}if(isProperty(nodeType,candidates[current])){element=new Element(candidate[current2],[key,current2],"Property",new Reference(candidate,current2))}else if(isNode(candidate[current2])){element=new Element(candidate[current2],[key,current2],null,new Reference(candidate,current2))}else{continue}worklist.push(element)}}else if(isNode(candidate)){worklist.push(new Element(candidate,key,null,new Reference(node,key)))}}}return outer.root};function traverse(root,visitor){var controller=new Controller;return controller.traverse(root,visitor)}function replace(root,visitor){var controller=new Controller;return controller.replace(root,visitor)}function extendCommentRange(comment,tokens){var target;target=upperBound(tokens,function search(token){return token.range[0]>comment.range[0]});comment.extendedRange=[comment.range[0],comment.range[1]];if(target!==tokens.length){comment.extendedRange[1]=tokens[target].range[0]}target-=1;if(target>=0){comment.extendedRange[0]=tokens[target].range[1]}return comment}function attachComments(tree,providedComments,tokens){var comments=[],comment,len,i,cursor;if(!tree.range){throw new Error("attachComments needs range information")}if(!tokens.length){if(providedComments.length){for(i=0,len=providedComments.length;i<len;i+=1){comment=deepCopy(providedComments[i]);comment.extendedRange=[0,tree.range[0]];comments.push(comment)}tree.leadingComments=comments}return tree}for(i=0,len=providedComments.length;i<len;i+=1){comments.push(extendCommentRange(deepCopy(providedComments[i]),tokens))}cursor=0;traverse(tree,{enter:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(comment.extendedRange[1]>node.range[0]){break}if(comment.extendedRange[1]===node.range[0]){if(!node.leadingComments){node.leadingComments=[]}node.leadingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip}}});cursor=0;traverse(tree,{leave:function(node){var comment;while(cursor<comments.length){comment=comments[cursor];if(node.range[1]<comment.extendedRange[0]){break}if(node.range[1]===comment.extendedRange[0]){if(!node.trailingComments){node.trailingComments=[]}node.trailingComments.push(comment);comments.splice(cursor,1)}else{cursor+=1}}if(cursor===comments.length){return VisitorOption.Break}if(comments[cursor].extendedRange[0]>node.range[1]){return VisitorOption.Skip}}});return tree}exports.version="1.8.1-dev";exports.Syntax=Syntax;exports.traverse=traverse;exports.replace=replace;exports.attachComments=attachComments;exports.VisitorKeys=VisitorKeys;exports.VisitorOption=VisitorOption;exports.Controller=Controller;exports.cloneEnvironment=function(){return clone({})};return exports})},{}],159:[function(require,module,exports){(function(){"use strict";function isExpression(node){if(node==null){return false}switch(node.type){case"ArrayExpression":case"AssignmentExpression":case"BinaryExpression":case"CallExpression":case"ConditionalExpression":case"FunctionExpression":case"Identifier":case"Literal":case"LogicalExpression":case"MemberExpression":case"NewExpression":case"ObjectExpression":case"SequenceExpression":case"ThisExpression":case"UnaryExpression":case"UpdateExpression":return true}return false}function isIterationStatement(node){if(node==null){return false}switch(node.type){case"DoWhileStatement":case"ForInStatement":case"ForStatement":case"WhileStatement":return true}return false}function isStatement(node){if(node==null){return false}switch(node.type){case"BlockStatement":case"BreakStatement":case"ContinueStatement":case"DebuggerStatement":case"DoWhileStatement":case"EmptyStatement":case"ExpressionStatement":case"ForInStatement":case"ForStatement":case"IfStatement":case"LabeledStatement":case"ReturnStatement":case"SwitchStatement":case"ThrowStatement":case"TryStatement":case"VariableDeclaration":case"WhileStatement":case"WithStatement":return true}return false}function isSourceElement(node){return isStatement(node)||node!=null&&node.type==="FunctionDeclaration"}function trailingStatement(node){switch(node.type){case"IfStatement":if(node.alternate!=null){return node.alternate}return node.consequent;case"LabeledStatement":case"ForStatement":case"ForInStatement":case"WhileStatement":case"WithStatement":return node.body}return null}function isProblematicIfStatement(node){var current;if(node.type!=="IfStatement"){return false}if(node.alternate==null){return false}current=node.consequent;do{if(current.type==="IfStatement"){if(current.alternate==null){return true}}current=trailingStatement(current)}while(current);return false}module.exports={isExpression:isExpression,isStatement:isStatement,isIterationStatement:isIterationStatement,isSourceElement:isSourceElement,isProblematicIfStatement:isProblematicIfStatement,trailingStatement:trailingStatement}})()},{}],160:[function(require,module,exports){(function(){"use strict";var Regex,NON_ASCII_WHITESPACES;Regex={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")};function isDecimalDigit(ch){return ch>=48&&ch<=57}function isHexDigit(ch){return isDecimalDigit(ch)||97<=ch&&ch<=102||65<=ch&&ch<=70}function isOctalDigit(ch){return ch>=48&&ch<=55}NON_ASCII_WHITESPACES=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function isWhiteSpace(ch){return ch===32||ch===9||ch===11||ch===12||ch===160||ch>=5760&&NON_ASCII_WHITESPACES.indexOf(ch)>=0}function isLineTerminator(ch){return ch===10||ch===13||ch===8232||ch===8233}function isIdentifierStart(ch){return ch>=97&&ch<=122||ch>=65&&ch<=90||ch===36||ch===95||ch===92||ch>=128&&Regex.NonAsciiIdentifierStart.test(String.fromCharCode(ch))}function isIdentifierPart(ch){return ch>=97&&ch<=122||ch>=65&&ch<=90||ch>=48&&ch<=57||ch===36||ch===95||ch===92||ch>=128&&Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch))}module.exports={isDecimalDigit:isDecimalDigit,isHexDigit:isHexDigit,isOctalDigit:isOctalDigit,isWhiteSpace:isWhiteSpace,isLineTerminator:isLineTerminator,isIdentifierStart:isIdentifierStart,isIdentifierPart:isIdentifierPart}})()},{}],161:[function(require,module,exports){(function(){"use strict";var code=require("./code");function isStrictModeReservedWordES6(id){switch(id){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return true;default:return false}}function isKeywordES5(id,strict){if(!strict&&id==="yield"){return false}return isKeywordES6(id,strict)}function isKeywordES6(id,strict){if(strict&&isStrictModeReservedWordES6(id)){return true}switch(id.length){case 2:return id==="if"||id==="in"||id==="do";case 3:return id==="var"||id==="for"||id==="new"||id==="try";case 4:return id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum";case 5:return id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="yield"||id==="class"||id==="super";case 6:return id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import";case 7:return id==="default"||id==="finally"||id==="extends";case 8:return id==="function"||id==="continue"||id==="debugger";case 10:return id==="instanceof";default:return false}}function isReservedWordES5(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES5(id,strict)}function isReservedWordES6(id,strict){return id==="null"||id==="true"||id==="false"||isKeywordES6(id,strict)}function isRestrictedWord(id){return id==="eval"||id==="arguments"}function isIdentifierName(id){var i,iz,ch;if(id.length===0){return false}ch=id.charCodeAt(0);if(!code.isIdentifierStart(ch)||ch===92){return false}for(i=1,iz=id.length;i<iz;++i){ch=id.charCodeAt(i);if(!code.isIdentifierPart(ch)||ch===92){return false}}return true}function isIdentifierES5(id,strict){return isIdentifierName(id)&&!isReservedWordES5(id,strict)}function isIdentifierES6(id,strict){return isIdentifierName(id)&&!isReservedWordES6(id,strict)}module.exports={isKeywordES5:isKeywordES5,isKeywordES6:isKeywordES6,isReservedWordES5:isReservedWordES5,isReservedWordES6:isReservedWordES6,isRestrictedWord:isRestrictedWord,isIdentifierName:isIdentifierName,isIdentifierES5:isIdentifierES5,isIdentifierES6:isIdentifierES6}})()},{"./code":160}],162:[function(require,module,exports){(function(){"use strict";exports.ast=require("./ast");exports.code=require("./code");exports.keyword=require("./keyword")})()},{"./ast":159,"./code":160,"./keyword":161}],163:[function(require,module,exports){function combine(){return new RegExp("("+[].slice.call(arguments).map(function(e){var e=e.toString();return"(?:"+e.substring(1,e.length-1)+")"}).join("|")+")")}function makeTester(rx){var s=rx.toString();return new RegExp("^"+s.substring(1,s.length-1)+"$")}var pattern={string1:/"(?:(?:\\\n|\\"|[^"\n]))*?"/,string2:/'(?:(?:\\\n|\\'|[^'\n]))*?'/,comment1:/\/\*[\s\S]*?\*\//,comment2:/\/\/.*?\n/,whitespace:/\s+/,keyword:/\b(?:var|let|for|if|else|in|class|function|return|with|case|break|switch|export|new|while|do|throw|catch)\b/,regexp:/\/(?:(?:\\\/|[^\n\/]))*?\//,name:/[a-zA-Z_\$][a-zA-Z_\$0-9]*/,number:/\d+(?:\.\d+)?(?:e[+-]?\d+)?/,parens:/[\(\)]/,curly:/[{}]/,square:/[\[\]]/,punct:/[;.:\?\^%<>=!&|+\-,~]/};var match=combine(pattern.string1,pattern.string2,pattern.comment1,pattern.comment2,pattern.regexp,pattern.whitespace,pattern.name,pattern.number,pattern.parens,pattern.curly,pattern.square,pattern.punct);var tester={};for(var k in pattern){tester[k]=makeTester(pattern[k])}module.exports=function(str,doNotThrow){return str.split(match).filter(function(e,i){if(i%2)return true;if(e!==""){if(!doNotThrow)throw new Error("invalid token:"+JSON.stringify(e));return true}})};module.exports.type=function(e){for(var type in pattern)if(tester[type].test(e))return type;return"invalid"}},{}],164:[function(require,module,exports){(function(global){(function(){var undefined;var VERSION="3.0.0";var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8,CURRY_RIGHT_FLAG=16,PARTIAL_FLAG=32,PARTIAL_RIGHT_FLAG=64,REARG_FLAG=128,ARY_FLAG=256;var DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION="...";var HOT_COUNT=150,HOT_SPAN=16;var LAZY_FILTER_FLAG=0,LAZY_MAP_FLAG=1,LAZY_WHILE_FLAG=2;var FUNC_ERROR_TEXT="Expected a function";var PLACEHOLDER="__lodash_placeholder__";var argsTag="[object Arguments]",arrayTag="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag="[object Map]",numberTag="[object Number]",objectTag="[object Object]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",weakMapTag="[object WeakMap]";var arrayBufferTag="[object ArrayBuffer]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]";var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var reEscapedHtml=/&(?:amp|lt|gt|quot|#39|#96);/g,reUnescapedHtml=/[&<>"'`]/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source);
var reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g;var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var reFlags=/\w*$/;var reFuncName=/^\s*function[ \n\r\t]+\w/;var reHexPrefix=/^0[xX]/;var reHostCtor=/^\[object .+?Constructor\]$/;var reLatin1=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;var reNoMatch=/($^)/;var reRegExpChars=/[.*+?^${}()|[\]\/\\]/g,reHasRegExpChars=RegExp(reRegExpChars.source);var reThis=/\bthis\b/;var reUnescapedString=/['\n\r\u2028\u2029\\]/g;var reWords=function(){var upper="[A-Z\\xc0-\\xd6\\xd8-\\xde]",lower="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(upper+"{2,}(?="+upper+lower+")|"+upper+"?"+lower+"|"+upper+"+|[0-9]+","g")}();var whitespace=" \f "+"\n\r\u2028\u2029"+" ";var contextProps=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","document","isFinite","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","window","WinRTError"];var templateCounter=-1;var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[stringTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[mapTag]=cloneableTags[setTag]=cloneableTags[weakMapTag]=false;var debounceOptions={leading:false,maxWait:0,trailing:false};var deburredLetters={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"};var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};var htmlUnescapes={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"};var objectTypes={"function":true,object:true};var stringEscapes={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var root=objectTypes[typeof window]&&window!==(this&&this.window)?window:this;var freeExports=objectTypes[typeof exports]&&exports&&!exports.nodeType&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var freeGlobal=freeExports&&freeModule&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)){root=freeGlobal}var moduleExports=freeModule&&freeModule.exports===freeExports&&freeExports;function baseCompareAscending(value,other){if(value!==other){var valIsReflexive=value===value,othIsReflexive=other===other;if(value>other||!valIsReflexive||typeof value=="undefined"&&othIsReflexive){return 1}if(value<other||!othIsReflexive||typeof other=="undefined"&&valIsReflexive){return-1}}return 0}function baseIndexOf(array,value,fromIndex){if(value!==value){return indexOfNaN(array,fromIndex)}var index=(fromIndex||0)-1,length=array.length;while(++index<length){if(array[index]===value){return index}}return-1}function baseSortBy(array,comparer){var length=array.length;array.sort(comparer);while(length--){array[length]=array[length].value}return array}function baseToString(value){if(typeof value=="string"){return value}return value==null?"":value+""}function charAtCallback(string){return string.charCodeAt(0)}function charsLeftIndex(string,chars){var index=-1,length=string.length;while(++index<length&&chars.indexOf(string.charAt(index))>-1){}return index}function charsRightIndex(string,chars){var index=string.length;while(index--&&chars.indexOf(string.charAt(index))>-1){}return index}function compareAscending(object,other){return baseCompareAscending(object.criteria,other.criteria)||object.index-other.index}function compareMultipleAscending(object,other){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length;while(++index<length){var result=baseCompareAscending(objCriteria[index],othCriteria[index]);if(result){return result}}return object.index-other.index}function deburrLetter(letter){return deburredLetters[letter]}function escapeHtmlChar(chr){return htmlEscapes[chr]}function escapeStringChar(chr){return"\\"+stringEscapes[chr]}function indexOfNaN(array,fromIndex,fromRight){var length=array.length,index=fromRight?fromIndex||length:(fromIndex||0)-1;while(fromRight?index--:++index<length){var other=array[index];if(other!==other){return index}}return-1}function isObjectLike(value){return value&&typeof value=="object"||false}function isSpace(charCode){return charCode<=160&&(charCode>=9&&charCode<=13)||charCode==32||charCode==160||charCode==5760||charCode==6158||charCode>=8192&&(charCode<=8202||charCode==8232||charCode==8233||charCode==8239||charCode==8287||charCode==12288||charCode==65279)}function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=-1,result=[];while(++index<length){if(array[index]===placeholder){array[index]=PLACEHOLDER;result[++resIndex]=index}}return result}function sortedUniq(array,iteratee){var seen,index=-1,length=array.length,resIndex=-1,result=[];while(++index<length){var value=array[index],computed=iteratee?iteratee(value,index,array):value;if(!index||seen!==computed){seen=computed;result[++resIndex]=value}}return result}function trimmedLeftIndex(string){var index=-1,length=string.length;while(++index<length&&isSpace(string.charCodeAt(index))){}return index}function trimmedRightIndex(string){var index=string.length;while(index--&&isSpace(string.charCodeAt(index))){}return index}function unescapeHtmlChar(chr){return htmlUnescapes[chr]}function runInContext(context){context=context?_.defaults(root.Object(),context,_.pick(root,contextProps)):root;var Array=context.Array,Date=context.Date,Error=context.Error,Function=context.Function,Math=context.Math,Number=context.Number,Object=context.Object,RegExp=context.RegExp,String=context.String,TypeError=context.TypeError;var arrayProto=Array.prototype,objectProto=Object.prototype;var document=(document=context.window)&&document.document;var fnToString=Function.prototype.toString;var getLength=baseProperty("length");var hasOwnProperty=objectProto.hasOwnProperty;var idCounter=0;var objToString=objectProto.toString;var oldDash=context._;var reNative=RegExp("^"+escapeRegExp(objToString).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var ArrayBuffer=isNative(ArrayBuffer=context.ArrayBuffer)&&ArrayBuffer,bufferSlice=isNative(bufferSlice=ArrayBuffer&&new ArrayBuffer(0).slice)&&bufferSlice,ceil=Math.ceil,clearTimeout=context.clearTimeout,floor=Math.floor,getPrototypeOf=isNative(getPrototypeOf=Object.getPrototypeOf)&&getPrototypeOf,push=arrayProto.push,propertyIsEnumerable=objectProto.propertyIsEnumerable,Set=isNative(Set=context.Set)&&Set,setTimeout=context.setTimeout,splice=arrayProto.splice,Uint8Array=isNative(Uint8Array=context.Uint8Array)&&Uint8Array,unshift=arrayProto.unshift,WeakMap=isNative(WeakMap=context.WeakMap)&&WeakMap;var Float64Array=function(){try{var func=isNative(func=context.Float64Array)&&func,result=new func(new ArrayBuffer(10),0,1)&&func}catch(e){}return result}();var nativeIsArray=isNative(nativeIsArray=Array.isArray)&&nativeIsArray,nativeCreate=isNative(nativeCreate=Object.create)&&nativeCreate,nativeIsFinite=context.isFinite,nativeKeys=isNative(nativeKeys=Object.keys)&&nativeKeys,nativeMax=Math.max,nativeMin=Math.min,nativeNow=isNative(nativeNow=Date.now)&&nativeNow,nativeNumIsFinite=isNative(nativeNumIsFinite=Number.isFinite)&&nativeNumIsFinite,nativeParseInt=context.parseInt,nativeRandom=Math.random;var NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY,POSITIVE_INFINITY=Number.POSITIVE_INFINITY;var MAX_ARRAY_LENGTH=Math.pow(2,32)-1,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1;var FLOAT64_BYTES_PER_ELEMENT=Float64Array?Float64Array.BYTES_PER_ELEMENT:0;var MAX_SAFE_INTEGER=Math.pow(2,53)-1;var metaMap=WeakMap&&new WeakMap;function lodash(value){if(isObjectLike(value)&&!isArray(value)){if(value instanceof LodashWrapper){return value}if(hasOwnProperty.call(value,"__wrapped__")){return new LodashWrapper(value.__wrapped__,value.__chain__,arrayCopy(value.__actions__))}}return new LodashWrapper(value)}function LodashWrapper(value,chainAll,actions){this.__actions__=actions||[];this.__chain__=!!chainAll;this.__wrapped__=value}var support=lodash.support={};(function(x){support.funcDecomp=!isNative(context.WinRTError)&&reThis.test(runInContext);support.funcNames=typeof Function.name=="string";try{support.dom=document.createDocumentFragment().nodeType===11}catch(e){support.dom=false}try{support.nonEnumArgs=!propertyIsEnumerable.call(arguments,1)}catch(e){support.nonEnumArgs=true}})(0,0);lodash.templateSettings={escape:reEscape,evaluate:reEvaluate,interpolate:reInterpolate,variable:"",imports:{_:lodash}};function LazyWrapper(value){this.actions=null;this.dir=1;this.dropCount=0;this.filtered=false;this.iteratees=null;this.takeCount=POSITIVE_INFINITY;this.views=null;this.wrapped=value}function lazyClone(){var actions=this.actions,iteratees=this.iteratees,views=this.views,result=new LazyWrapper(this.wrapped);result.actions=actions?arrayCopy(actions):null;result.dir=this.dir;result.dropCount=this.dropCount;result.filtered=this.filtered;result.iteratees=iteratees?arrayCopy(iteratees):null;result.takeCount=this.takeCount;result.views=views?arrayCopy(views):null;return result}function lazyReverse(){var filtered=this.filtered,result=filtered?new LazyWrapper(this):this.clone();result.dir=this.dir*-1;result.filtered=filtered;return result}function lazyValue(){var array=this.wrapped.value();if(!isArray(array)){return baseWrapperValue(array,this.actions)}var dir=this.dir,isRight=dir<0,length=array.length,view=getView(0,length,this.views),start=view.start,end=view.end,dropCount=this.dropCount,takeCount=nativeMin(end-start,this.takeCount-dropCount),index=isRight?end:start-1,iteratees=this.iteratees,iterLength=iteratees?iteratees.length:0,resIndex=0,result=[];outer:while(length--&&resIndex<takeCount){index+=dir;var iterIndex=-1,value=array[index];while(++iterIndex<iterLength){var data=iteratees[iterIndex],iteratee=data.iteratee,computed=iteratee(value,index,array),type=data.type;if(type==LAZY_MAP_FLAG){value=computed}else if(!computed){if(type==LAZY_FILTER_FLAG){continue outer}else{break outer}}}if(dropCount){dropCount--}else{result[resIndex++]=value}}return isRight?result.reverse():result}function MapCache(){this.__data__={}}function mapDelete(key){return this.has(key)&&delete this.__data__[key]}function mapGet(key){return key=="__proto__"?undefined:this.__data__[key]}function mapHas(key){return key!="__proto__"&&hasOwnProperty.call(this.__data__,key)}function mapSet(key,value){if(key!="__proto__"){this.__data__[key]=value}return this}function SetCache(values){var length=values?values.length:0;this.data={hash:nativeCreate(null),set:new Set};while(length--){this.push(values[length])}}function cacheIndexOf(cache,value){var data=cache.data,result=typeof value=="string"||isObject(value)?data.set.has(value):data.hash[value];return result?0:-1}function cachePush(value){var data=this.data;if(typeof value=="string"||isObject(value)){data.set.add(value)}else{data.hash[value]=true}}function arrayCopy(source,array){var index=-1,length=source.length;array||(array=Array(length));while(++index<length){array[index]=source[index]}return array}function arrayEach(array,iteratee){var index=-1,length=array.length;while(++index<length){if(iteratee(array[index],index,array)===false){break}}return array}function arrayEachRight(array,iteratee){var length=array.length;while(length--){if(iteratee(array[length],length,array)===false){break}}return array}function arrayEvery(array,predicate){var index=-1,length=array.length;while(++index<length){if(!predicate(array[index],index,array)){return false}}return true}function arrayFilter(array,predicate){var index=-1,length=array.length,resIndex=-1,result=[];while(++index<length){var value=array[index];if(predicate(value,index,array)){result[++resIndex]=value}}return result}function arrayMap(array,iteratee){var index=-1,length=array.length,result=Array(length);while(++index<length){result[index]=iteratee(array[index],index,array)}return result}function arrayMax(array){var index=-1,length=array.length,result=NEGATIVE_INFINITY;while(++index<length){var value=array[index];if(value>result){result=value}}return result}function arrayMin(array){var index=-1,length=array.length,result=POSITIVE_INFINITY;while(++index<length){var value=array[index];if(value<result){result=value}}return result}function arrayReduce(array,iteratee,accumulator,initFromArray){var index=-1,length=array.length;if(initFromArray&&length){accumulator=array[++index]}while(++index<length){accumulator=iteratee(accumulator,array[index],index,array)}return accumulator}function arrayReduceRight(array,iteratee,accumulator,initFromArray){var length=array.length;if(initFromArray&&length){accumulator=array[--length]}while(length--){accumulator=iteratee(accumulator,array[length],length,array)}return accumulator}function arraySome(array,predicate){var index=-1,length=array.length;while(++index<length){if(predicate(array[index],index,array)){return true}}return false}function assignDefaults(objectValue,sourceValue){return typeof objectValue=="undefined"?sourceValue:objectValue}function assignOwnDefaults(objectValue,sourceValue,key,object){return typeof objectValue=="undefined"||!hasOwnProperty.call(object,key)?sourceValue:objectValue}function baseAssign(object,source,customizer){var props=keys(source);if(!customizer){return baseCopy(source,object,props)}var index=-1,length=props.length;while(++index<length){var key=props[index],value=object[key],result=customizer(value,source[key],key,object,source);if((result===result?result!==value:value===value)||typeof value=="undefined"&&!(key in object)){object[key]=result}}return object}function baseAt(collection,props){var index=-1,length=collection.length,isArr=isLength(length),propsLength=props.length,result=Array(propsLength);while(++index<propsLength){var key=props[index];if(isArr){key=parseFloat(key);result[index]=isIndex(key,length)?collection[key]:undefined}else{result[index]=collection[key]}}return result}function baseCopy(source,object,props){if(!props){props=object;object={}}var index=-1,length=props.length;while(++index<length){var key=props[index];object[key]=source[key]}return object}function baseBindAll(object,methodNames){var index=-1,length=methodNames.length;while(++index<length){var key=methodNames[index];object[key]=createWrapper(object[key],BIND_FLAG,object)}return object}function baseCallback(func,thisArg,argCount){var type=typeof func;if(type=="function"){return typeof thisArg!="undefined"&&isBindable(func)?bindCallback(func,thisArg,argCount):func}if(func==null){return identity}return type=="object"?baseMatches(func,!argCount):baseProperty(argCount?baseToString(func):func)}function baseClone(value,isDeep,customizer,key,object,stackA,stackB){var result;if(customizer){result=object?customizer(value,key,object):customizer(value)}if(typeof result!="undefined"){return result}if(!isObject(value)){return value}var isArr=isArray(value);if(isArr){result=initCloneArray(value);if(!isDeep){return arrayCopy(value,result)}}else{var tag=objToString.call(value),isFunc=tag==funcTag;if(tag==objectTag||tag==argsTag||isFunc&&!object){result=initCloneObject(isFunc?{}:value);if(!isDeep){return baseCopy(value,result,keys(value))}}else{return cloneableTags[tag]?initCloneByTag(value,tag,isDeep):object?value:{}}}stackA||(stackA=[]);stackB||(stackB=[]);var length=stackA.length;while(length--){if(stackA[length]==value){return stackB[length]}}stackA.push(value);stackB.push(result);(isArr?arrayEach:baseForOwn)(value,function(subValue,key){result[key]=baseClone(subValue,isDeep,customizer,key,value,stackA,stackB)});return result}var baseCreate=function(){function Object(){}return function(prototype){if(isObject(prototype)){Object.prototype=prototype;var result=new Object;Object.prototype=null}return result||context.Object()}}();function baseDelay(func,wait,args,fromIndex){if(!isFunction(func)){throw new TypeError(FUNC_ERROR_TEXT)}return setTimeout(function(){func.apply(undefined,baseSlice(args,fromIndex))},wait)}function baseDifference(array,values){var length=array?array.length:0,result=[];if(!length){return result}var index=-1,indexOf=getIndexOf(),isCommon=indexOf==baseIndexOf,cache=isCommon&&values.length>=200&&createCache(values),valuesLength=values.length;if(cache){indexOf=cacheIndexOf;isCommon=false;values=cache}outer:while(++index<length){var value=array[index];if(isCommon&&value===value){var valuesIndex=valuesLength;while(valuesIndex--){if(values[valuesIndex]===value){continue outer}}result.push(value)}else if(indexOf(values,value)<0){result.push(value)}}return result}function baseEach(collection,iteratee){var length=collection?collection.length:0;if(!isLength(length)){return baseForOwn(collection,iteratee)}var index=-1,iterable=toObject(collection);while(++index<length){if(iteratee(iterable[index],index,iterable)===false){break}}return collection}function baseEachRight(collection,iteratee){var length=collection?collection.length:0;if(!isLength(length)){return baseForOwnRight(collection,iteratee)}var iterable=toObject(collection);while(length--){if(iteratee(iterable[length],length,iterable)===false){break}}return collection}function baseEvery(collection,predicate){var result=true;baseEach(collection,function(value,index,collection){result=!!predicate(value,index,collection);return result});return result}function baseFilter(collection,predicate){var result=[];baseEach(collection,function(value,index,collection){if(predicate(value,index,collection)){result.push(value)}});return result}function baseFind(collection,predicate,eachFunc,retKey){var result;eachFunc(collection,function(value,key,collection){if(predicate(value,key,collection)){result=retKey?key:value;return false}});return result}function baseFlatten(array,isDeep,isStrict,fromIndex){var index=(fromIndex||0)-1,length=array.length,resIndex=-1,result=[];while(++index<length){var value=array[index];if(isObjectLike(value)&&isLength(value.length)&&(isArray(value)||isArguments(value))){if(isDeep){value=baseFlatten(value,isDeep,isStrict)}var valIndex=-1,valLength=value.length;result.length+=valLength;while(++valIndex<valLength){result[++resIndex]=value[valIndex]}}else if(!isStrict){result[++resIndex]=value}}return result}function baseFor(object,iteratee,keysFunc){var index=-1,iterable=toObject(object),props=keysFunc(object),length=props.length;while(++index<length){var key=props[index];if(iteratee(iterable[key],key,iterable)===false){break}}return object}function baseForRight(object,iteratee,keysFunc){var iterable=toObject(object),props=keysFunc(object),length=props.length;while(length--){var key=props[length];if(iteratee(iterable[key],key,iterable)===false){break}}return object}function baseForIn(object,iteratee){return baseFor(object,iteratee,keysIn)}function baseForOwn(object,iteratee){return baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return baseForRight(object,iteratee,keys)}function baseFunctions(object,props){var index=-1,length=props.length,resIndex=-1,result=[];while(++index<length){var key=props[index];if(isFunction(object[key])){result[++resIndex]=key}}return result}function baseInvoke(collection,methodName,args){var index=-1,isFunc=typeof methodName=="function",length=collection?collection.length:0,result=isLength(length)?Array(length):[];baseEach(collection,function(value){var func=isFunc?methodName:value!=null&&value[methodName];result[++index]=func?func.apply(value,args):undefined});return result}function baseIsEqual(value,other,customizer,isWhere,stackA,stackB){if(value===other){return value!==0||1/value==1/other}var valType=typeof value,othType=typeof other;if(valType!="function"&&valType!="object"&&othType!="function"&&othType!="object"||value==null||other==null){return value!==value&&other!==other}return baseIsEqualDeep(value,other,baseIsEqual,customizer,isWhere,stackA,stackB)}function baseIsEqualDeep(object,other,equalFunc,customizer,isWhere,stackA,stackB){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=arrayTag,othTag=arrayTag;if(!objIsArr){objTag=objToString.call(object);if(objTag==argsTag){objTag=objectTag}else if(objTag!=objectTag){objIsArr=isTypedArray(object)}}if(!othIsArr){othTag=objToString.call(other);if(othTag==argsTag){othTag=objectTag}else if(othTag!=objectTag){othIsArr=isTypedArray(other)}}var objIsObj=objTag==objectTag,othIsObj=othTag==objectTag,isSameTag=objTag==othTag;if(isSameTag&&!(objIsArr||objIsObj)){return equalByTag(object,other,objTag)}var valWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(valWrapped||othWrapped){return equalFunc(valWrapped?object.value():object,othWrapped?other.value():other,customizer,isWhere,stackA,stackB)}if(!isSameTag){return false}stackA||(stackA=[]);stackB||(stackB=[]);var length=stackA.length;while(length--){if(stackA[length]==object){return stackB[length]==other}}stackA.push(object);stackB.push(other);var result=(objIsArr?equalArrays:equalObjects)(object,other,equalFunc,customizer,isWhere,stackA,stackB);stackA.pop();stackB.pop();return result}function baseIsMatch(object,props,values,strictCompareFlags,customizer){var length=props.length;if(object==null){return!length}var index=-1,noCustomizer=!customizer;while(++index<length){if(noCustomizer&&strictCompareFlags[index]?values[index]!==object[props[index]]:!hasOwnProperty.call(object,props[index])){return false}}index=-1;while(++index<length){var key=props[index];if(noCustomizer&&strictCompareFlags[index]){var result=hasOwnProperty.call(object,key)}else{var objValue=object[key],srcValue=values[index];result=customizer?customizer(objValue,srcValue,key):undefined;if(typeof result=="undefined"){result=baseIsEqual(srcValue,objValue,customizer,true)}}if(!result){return false}}return true}function baseMap(collection,iteratee){var result=[];baseEach(collection,function(value,key,collection){result.push(iteratee(value,key,collection))});return result}function baseMatches(source,isCloned){var props=keys(source),length=props.length;if(length==1){var key=props[0],value=source[key];if(isStrictComparable(value)){return function(object){return object!=null&&value===object[key]&&hasOwnProperty.call(object,key)}}}if(isCloned){source=baseClone(source,true)}var values=Array(length),strictCompareFlags=Array(length);while(length--){value=source[props[length]];values[length]=value;strictCompareFlags[length]=isStrictComparable(value)}return function(object){return baseIsMatch(object,props,values,strictCompareFlags)}}function baseMerge(object,source,customizer,stackA,stackB){var isSrcArr=isLength(source.length)&&(isArray(source)||isTypedArray(source));(isSrcArr?arrayEach:baseForOwn)(source,function(srcValue,key,source){if(isObjectLike(srcValue)){stackA||(stackA=[]);stackB||(stackB=[]);return baseMergeDeep(object,source,key,baseMerge,customizer,stackA,stackB)}var value=object[key],result=customizer?customizer(value,srcValue,key,object,source):undefined,isCommon=typeof result=="undefined";if(isCommon){result=srcValue}if((isSrcArr||typeof result!="undefined")&&(isCommon||(result===result?result!==value:value===value))){object[key]=result}});return object}function baseMergeDeep(object,source,key,mergeFunc,customizer,stackA,stackB){var length=stackA.length,srcValue=source[key];while(length--){if(stackA[length]==srcValue){object[key]=stackB[length];return}}var value=object[key],result=customizer?customizer(value,srcValue,key,object,source):undefined,isCommon=typeof result=="undefined";if(isCommon){result=srcValue;if(isLength(srcValue.length)&&(isArray(srcValue)||isTypedArray(srcValue))){result=isArray(value)?value:value?arrayCopy(value):[]}else if(isPlainObject(srcValue)||isArguments(srcValue)){result=isArguments(value)?toPlainObject(value):isPlainObject(value)?value:{}}}stackA.push(srcValue);stackB.push(result);if(isCommon){object[key]=mergeFunc(result,srcValue,customizer,stackA,stackB)}else if(result===result?result!==value:value===value){object[key]=result}}function baseProperty(key){return function(object){return object==null?undefined:object[key]}}function basePullAt(array,indexes){var length=indexes.length,result=baseAt(array,indexes);indexes.sort(baseCompareAscending);while(length--){var index=parseFloat(indexes[length]);if(index!=previous&&isIndex(index)){var previous=index;splice.call(array,index,1)}}return result}function baseRandom(min,max){return min+floor(nativeRandom()*(max-min+1))}function baseReduce(collection,iteratee,accumulator,initFromCollection,eachFunc){eachFunc(collection,function(value,index,collection){accumulator=initFromCollection?(initFromCollection=false,value):iteratee(accumulator,value,index,collection)});return accumulator}var baseSetData=!metaMap?identity:function(func,data){metaMap.set(func,data);return func};function baseSlice(array,start,end){var index=-1,length=array.length;start=start==null?0:+start||0;if(start<0){start=-start>length?0:length+start}end=typeof end=="undefined"||end>length?length:+end||0;if(end<0){end+=length}length=start>end?0:end-start;var result=Array(length);while(++index<length){result[index]=array[index+start]}return result}function baseSome(collection,predicate){var result;baseEach(collection,function(value,index,collection){result=predicate(value,index,collection);return!result});return!!result}function baseUniq(array,iteratee){var index=-1,indexOf=getIndexOf(),length=array.length,isCommon=indexOf==baseIndexOf,isLarge=isCommon&&length>=200,seen=isLarge&&createCache(),result=[];if(seen){indexOf=cacheIndexOf;isCommon=false}else{isLarge=false;seen=iteratee?[]:result}outer:while(++index<length){var value=array[index],computed=iteratee?iteratee(value,index,array):value;if(isCommon&&value===value){var seenIndex=seen.length;while(seenIndex--){if(seen[seenIndex]===computed){continue outer}}if(iteratee){seen.push(computed)}result.push(value)}else if(indexOf(seen,computed)<0){if(iteratee||isLarge){seen.push(computed)}result.push(value)}}return result}function baseValues(object,props){var index=-1,length=props.length,result=Array(length);while(++index<length){result[index]=object[props[index]]}return result}function baseWrapperValue(value,actions){var result=value;if(result instanceof LazyWrapper){result=result.value()}var index=-1,length=actions.length;while(++index<length){var args=[result],action=actions[index];push.apply(args,action.args);result=action.func.apply(action.thisArg,args)}return result}function binaryIndex(array,value,retHighest){var low=0,high=array?array.length:low;if(typeof value=="number"&&value===value&&high<=HALF_MAX_ARRAY_LENGTH){while(low<high){var mid=low+high>>>1,computed=array[mid];if(retHighest?computed<=value:computed<value){low=mid+1}else{high=mid}}return high}return binaryIndexBy(array,value,identity,retHighest)}function binaryIndexBy(array,value,iteratee,retHighest){value=iteratee(value);var low=0,high=array?array.length:0,valIsNaN=value!==value,valIsUndef=typeof value=="undefined";while(low<high){var mid=floor((low+high)/2),computed=iteratee(array[mid]),isReflexive=computed===computed;if(valIsNaN){var setLow=isReflexive||retHighest}else if(valIsUndef){setLow=isReflexive&&(retHighest||typeof computed!="undefined")}else{setLow=retHighest?computed<=value:computed<value}if(setLow){low=mid+1}else{high=mid}}return nativeMin(high,MAX_ARRAY_INDEX)}function bindCallback(func,thisArg,argCount){if(typeof func!="function"){return identity}if(typeof thisArg=="undefined"){return func}switch(argCount){case 1:return function(value){return func.call(thisArg,value)};case 3:return function(value,index,collection){return func.call(thisArg,value,index,collection)};case 4:return function(accumulator,value,index,collection){return func.call(thisArg,accumulator,value,index,collection)};case 5:return function(value,other,key,object,source){return func.call(thisArg,value,other,key,object,source)}}return function(){return func.apply(thisArg,arguments)}}function bufferClone(buffer){return bufferSlice.call(buffer,0)}if(!bufferSlice){bufferClone=!(ArrayBuffer&&Uint8Array)?constant(null):function(buffer){var byteLength=buffer.byteLength,floatLength=Float64Array?floor(byteLength/FLOAT64_BYTES_PER_ELEMENT):0,offset=floatLength*FLOAT64_BYTES_PER_ELEMENT,result=new ArrayBuffer(byteLength);if(floatLength){var view=new Float64Array(result,0,floatLength);view.set(new Float64Array(buffer,0,floatLength))}if(byteLength!=offset){view=new Uint8Array(result,offset);view.set(new Uint8Array(buffer,offset))}return result}}function composeArgs(args,partials,holders){var holdersLength=holders.length,argsIndex=-1,argsLength=nativeMax(args.length-holdersLength,0),leftIndex=-1,leftLength=partials.length,result=Array(argsLength+leftLength);while(++leftIndex<leftLength){result[leftIndex]=partials[leftIndex]}while(++argsIndex<holdersLength){result[holders[argsIndex]]=args[argsIndex]}while(argsLength--){result[leftIndex++]=args[argsIndex++]}return result}function composeArgsRight(args,partials,holders){var holdersIndex=-1,holdersLength=holders.length,argsIndex=-1,argsLength=nativeMax(args.length-holdersLength,0),rightIndex=-1,rightLength=partials.length,result=Array(argsLength+rightLength);while(++argsIndex<argsLength){result[argsIndex]=args[argsIndex]}var pad=argsIndex;while(++rightIndex<rightLength){result[pad+rightIndex]=partials[rightIndex]}while(++holdersIndex<holdersLength){result[pad+holders[holdersIndex]]=args[argsIndex++]}return result}function createAggregator(setter,initializer){return function(collection,iteratee,thisArg){var result=initializer?initializer():{};iteratee=getCallback(iteratee,thisArg,3);if(isArray(collection)){var index=-1,length=collection.length;while(++index<length){var value=collection[index];setter(result,value,iteratee(value,index,collection),collection)}}else{baseEach(collection,function(value,key,collection){setter(result,value,iteratee(value,key,collection),collection)})}return result}}function createAssigner(assigner){return function(){var length=arguments.length,object=arguments[0];if(length<2||object==null){return object}if(length>3&&isIterateeCall(arguments[1],arguments[2],arguments[3])){length=2}if(length>3&&typeof arguments[length-2]=="function"){var customizer=bindCallback(arguments[--length-1],arguments[length--],5)}else if(length>2&&typeof arguments[length-1]=="function"){customizer=arguments[--length]}var index=0;while(++index<length){var source=arguments[index];if(source){assigner(object,source,customizer)}}return object}}function createBindWrapper(func,thisArg){var Ctor=createCtorWrapper(func);
function wrapper(){return(this instanceof wrapper?Ctor:func).apply(thisArg,arguments)}return wrapper}var createCache=!(nativeCreate&&Set)?constant(null):function(values){return new SetCache(values)};function createCompounder(callback){return function(string){var index=-1,array=words(deburr(string)),length=array.length,result="";while(++index<length){result=callback(result,array[index],index)}return result}}function createCtorWrapper(Ctor){return function(){var thisBinding=baseCreate(Ctor.prototype),result=Ctor.apply(thisBinding,arguments);return isObject(result)?result:thisBinding}}function createExtremum(arrayFunc,isMin){return function(collection,iteratee,thisArg){if(thisArg&&isIterateeCall(collection,iteratee,thisArg)){iteratee=null}var func=getCallback(),noIteratee=iteratee==null;if(!(func===baseCallback&&noIteratee)){noIteratee=false;iteratee=func(iteratee,thisArg,3)}if(noIteratee){var isArr=isArray(collection);if(!isArr&&isString(collection)){iteratee=charAtCallback}else{return arrayFunc(isArr?collection:toIterable(collection))}}return extremumBy(collection,iteratee,isMin)}}function createHybridWrapper(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&ARY_FLAG,isBind=bitmask&BIND_FLAG,isBindKey=bitmask&BIND_KEY_FLAG,isCurry=bitmask&CURRY_FLAG,isCurryBound=bitmask&CURRY_BOUND_FLAG,isCurryRight=bitmask&CURRY_RIGHT_FLAG;var Ctor=!isBindKey&&createCtorWrapper(func),key=func;function wrapper(){var length=arguments.length,index=length,args=Array(length);while(index--){args[index]=arguments[index]}if(partials){args=composeArgs(args,partials,holders)}if(partialsRight){args=composeArgsRight(args,partialsRight,holdersRight)}if(isCurry||isCurryRight){var placeholder=wrapper.placeholder,argsHolders=replaceHolders(args,placeholder);length-=argsHolders.length;if(length<arity){var newArgPos=argPos?arrayCopy(argPos):null,newArity=nativeMax(arity-length,0),newsHolders=isCurry?argsHolders:null,newHoldersRight=isCurry?null:argsHolders,newPartials=isCurry?args:null,newPartialsRight=isCurry?null:args;bitmask|=isCurry?PARTIAL_FLAG:PARTIAL_RIGHT_FLAG;bitmask&=~(isCurry?PARTIAL_RIGHT_FLAG:PARTIAL_FLAG);if(!isCurryBound){bitmask&=~(BIND_FLAG|BIND_KEY_FLAG)}var result=createHybridWrapper(func,bitmask,thisArg,newPartials,newsHolders,newPartialsRight,newHoldersRight,newArgPos,ary,newArity);result.placeholder=placeholder;return result}}var thisBinding=isBind?thisArg:this;if(isBindKey){func=thisBinding[key]}if(argPos){args=reorder(args,argPos)}if(isAry&&ary<args.length){args.length=ary}return(this instanceof wrapper?Ctor||createCtorWrapper(func):func).apply(thisBinding,args)}return wrapper}function createPad(string,length,chars){var strLength=string.length;length=+length;if(strLength>=length||!nativeIsFinite(length)){return""}var padLength=length-strLength;chars=chars==null?" ":baseToString(chars);return repeat(chars,ceil(padLength/chars.length)).slice(0,padLength)}function createPartialWrapper(func,bitmask,thisArg,partials){var isBind=bitmask&BIND_FLAG,Ctor=createCtorWrapper(func);function wrapper(){var argsIndex=-1,argsLength=arguments.length,leftIndex=-1,leftLength=partials.length,args=Array(argsLength+leftLength);while(++leftIndex<leftLength){args[leftIndex]=partials[leftIndex]}while(argsLength--){args[leftIndex++]=arguments[++argsIndex]}return(this instanceof wrapper?Ctor:func).apply(isBind?thisArg:this,args)}return wrapper}function createWrapper(func,bitmask,thisArg,partials,holders,argPos,ary,arity){var isBindKey=bitmask&BIND_KEY_FLAG;if(!isBindKey&&!isFunction(func)){throw new TypeError(FUNC_ERROR_TEXT)}var length=partials?partials.length:0;if(!length){bitmask&=~(PARTIAL_FLAG|PARTIAL_RIGHT_FLAG);partials=holders=null}length-=holders?holders.length:0;if(bitmask&PARTIAL_RIGHT_FLAG){var partialsRight=partials,holdersRight=holders;partials=holders=null}var data=!isBindKey&&getData(func),newData=[func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity];if(data&&data!==true){mergeData(newData,data);bitmask=newData[1];arity=newData[9]}newData[9]=arity==null?isBindKey?0:func.length:nativeMax(arity-length,0)||0;if(bitmask==BIND_FLAG){var result=createBindWrapper(newData[0],newData[2])}else if((bitmask==PARTIAL_FLAG||bitmask==(BIND_FLAG|PARTIAL_FLAG))&&!newData[4].length){result=createPartialWrapper.apply(null,newData)}else{result=createHybridWrapper.apply(null,newData)}var setter=data?baseSetData:setData;return setter(result,newData)}function equalArrays(array,other,equalFunc,customizer,isWhere,stackA,stackB){var index=-1,arrLength=array.length,othLength=other.length,result=true;if(arrLength!=othLength&&!(isWhere&&othLength>arrLength)){return false}while(result&&++index<arrLength){var arrValue=array[index],othValue=other[index];result=undefined;if(customizer){result=isWhere?customizer(othValue,arrValue,index):customizer(arrValue,othValue,index)}if(typeof result=="undefined"){if(isWhere){var othIndex=othLength;while(othIndex--){othValue=other[othIndex];result=arrValue&&arrValue===othValue||equalFunc(arrValue,othValue,customizer,isWhere,stackA,stackB);if(result){break}}}else{result=arrValue&&arrValue===othValue||equalFunc(arrValue,othValue,customizer,isWhere,stackA,stackB)}}}return!!result}function equalByTag(object,other,tag){switch(tag){case boolTag:case dateTag:return+object==+other;case errorTag:return object.name==other.name&&object.message==other.message;case numberTag:return object!=+object?other!=+other:object==0?1/object==1/other:object==+other;case regexpTag:case stringTag:return object==baseToString(other)}return false}function equalObjects(object,other,equalFunc,customizer,isWhere,stackA,stackB){var objProps=keys(object),objLength=objProps.length,othProps=keys(other),othLength=othProps.length;if(objLength!=othLength&&!isWhere){return false}var hasCtor,index=-1;while(++index<objLength){var key=objProps[index],result=hasOwnProperty.call(other,key);if(result){var objValue=object[key],othValue=other[key];result=undefined;if(customizer){result=isWhere?customizer(othValue,objValue,key):customizer(objValue,othValue,key)}if(typeof result=="undefined"){result=objValue&&objValue===othValue||equalFunc(objValue,othValue,customizer,isWhere,stackA,stackB)}}if(!result){return false}hasCtor||(hasCtor=key=="constructor")}if(!hasCtor){var objCtor=object.constructor,othCtor=other.constructor;if(objCtor!=othCtor&&("constructor"in object&&"constructor"in other)&&!(typeof objCtor=="function"&&objCtor instanceof objCtor&&typeof othCtor=="function"&&othCtor instanceof othCtor)){return false}}return true}function extremumBy(collection,iteratee,isMin){var exValue=isMin?POSITIVE_INFINITY:NEGATIVE_INFINITY,computed=exValue,result=computed;baseEach(collection,function(value,index,collection){var current=iteratee(value,index,collection);if((isMin?current<computed:current>computed)||current===exValue&¤t===result){computed=current;result=value}});return result}function getCallback(func,thisArg,argCount){var result=lodash.callback||callback;result=result===callback?baseCallback:result;return argCount?result(func,thisArg,argCount):result}var getData=!metaMap?noop:function(func){return metaMap.get(func)};function getIndexOf(collection,target,fromIndex){var result=lodash.indexOf||indexOf;result=result===indexOf?baseIndexOf:result;return collection?result(collection,target,fromIndex):result}function getView(start,end,transforms){var index=-1,length=transforms?transforms.length:0;while(++index<length){var data=transforms[index],size=data.size;switch(data.type){case"drop":start+=size;break;case"dropRight":end-=size;break;case"take":end=nativeMin(end,start+size);break;case"takeRight":start=nativeMax(start,end-size);break}}return{start:start,end:end}}function initCloneArray(array){var length=array.length,result=new array.constructor(length);if(length&&typeof array[0]=="string"&&hasOwnProperty.call(array,"index")){result.index=array.index;result.input=array.input}return result}function initCloneObject(object){var Ctor=object.constructor;if(!(typeof Ctor=="function"&&Ctor instanceof Ctor)){Ctor=Object}return new Ctor}function initCloneByTag(object,tag,isDeep){var Ctor=object.constructor;switch(tag){case arrayBufferTag:return bufferClone(object);case boolTag:case dateTag:return new Ctor(+object);case float32Tag:case float64Tag:case int8Tag:case int16Tag:case int32Tag:case uint8Tag:case uint8ClampedTag:case uint16Tag:case uint32Tag:var buffer=object.buffer;return new Ctor(isDeep?bufferClone(buffer):buffer,object.byteOffset,object.length);case numberTag:case stringTag:return new Ctor(object);case regexpTag:var result=new Ctor(object.source,reFlags.exec(object));result.lastIndex=object.lastIndex}return result}function isBindable(func){var support=lodash.support,result=!(support.funcNames?func.name:support.funcDecomp);if(!result){var source=fnToString.call(func);if(!support.funcNames){result=!reFuncName.test(source)}if(!result){result=reThis.test(source)||isNative(func);baseSetData(func,result)}}return result}function isIndex(value,length){value=+value;length=length==null?MAX_SAFE_INTEGER:length;return value>-1&&value%1==0&&value<length}function isIterateeCall(value,index,object){if(!isObject(object)){return false}var type=typeof index;if(type=="number"){var length=object.length,prereq=isLength(length)&&isIndex(index,length)}else{prereq=type=="string"&&index in value}return prereq&&object[index]===value}function isLength(value){return typeof value=="number"&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isStrictComparable(value){return value===value&&(value===0?1/value>0:!isObject(value))}function mergeData(data,source){var bitmask=data[1],srcBitmask=source[1],newBitmask=bitmask|srcBitmask;var arityFlags=ARY_FLAG|REARG_FLAG,bindFlags=BIND_FLAG|BIND_KEY_FLAG,comboFlags=arityFlags|bindFlags|CURRY_BOUND_FLAG|CURRY_RIGHT_FLAG;var isAry=bitmask&ARY_FLAG&&!(srcBitmask&ARY_FLAG),isRearg=bitmask&REARG_FLAG&&!(srcBitmask&REARG_FLAG),argPos=(isRearg?data:source)[7],ary=(isAry?data:source)[8];var isCommon=!(bitmask>=REARG_FLAG&&srcBitmask>bindFlags)&&!(bitmask>bindFlags&&srcBitmask>=REARG_FLAG);var isCombo=newBitmask>=arityFlags&&newBitmask<=comboFlags&&(bitmask<REARG_FLAG||(isRearg||isAry)&&argPos.length<=ary);if(!(isCommon||isCombo)){return data}if(srcBitmask&BIND_FLAG){data[2]=source[2];newBitmask|=bitmask&BIND_FLAG?0:CURRY_BOUND_FLAG}var value=source[3];if(value){var partials=data[3];data[3]=partials?composeArgs(partials,value,source[4]):arrayCopy(value);data[4]=partials?replaceHolders(data[3],PLACEHOLDER):arrayCopy(source[4])}value=source[5];if(value){partials=data[5];data[5]=partials?composeArgsRight(partials,value,source[6]):arrayCopy(value);data[6]=partials?replaceHolders(data[5],PLACEHOLDER):arrayCopy(source[6])}value=source[7];if(value){data[7]=arrayCopy(value)}if(srcBitmask&ARY_FLAG){data[8]=data[8]==null?source[8]:nativeMin(data[8],source[8])}if(data[9]==null){data[9]=source[9]}data[0]=source[0];data[1]=newBitmask;return data}function pickByArray(object,props){object=toObject(object);var index=-1,length=props.length,result={};while(++index<length){var key=props[index];if(key in object){result[key]=object[key]}}return result}function pickByCallback(object,predicate){var result={};baseForIn(object,function(value,key,object){if(predicate(value,key,object)){result[key]=value}});return result}function reorder(array,indexes){var arrLength=array.length,length=nativeMin(indexes.length,arrLength),oldArray=arrayCopy(array);while(length--){var index=indexes[length];array[length]=isIndex(index,arrLength)?oldArray[index]:undefined}return array}var setData=function(){var count=0,lastCalled=0;return function(key,value){var stamp=now(),remaining=HOT_SPAN-(stamp-lastCalled);lastCalled=stamp;if(remaining>0){if(++count>=HOT_COUNT){return key}}else{count=0}return baseSetData(key,value)}}();function shimIsPlainObject(value){var Ctor,support=lodash.support;if(!(isObjectLike(value)&&objToString.call(value)==objectTag)||!hasOwnProperty.call(value,"constructor")&&(Ctor=value.constructor,typeof Ctor=="function"&&!(Ctor instanceof Ctor))){return false}var result;baseForIn(value,function(subValue,key){result=key});return typeof result=="undefined"||hasOwnProperty.call(value,result)}function shimKeys(object){var props=keysIn(object),propsLength=props.length,length=propsLength&&object.length,support=lodash.support;var allowIndexes=length&&isLength(length)&&(isArray(object)||support.nonEnumArgs&&isArguments(object));var index=-1,result=[];while(++index<propsLength){var key=props[index];if(allowIndexes&&isIndex(key,length)||hasOwnProperty.call(object,key)){result.push(key)}}return result}function toIterable(value){if(value==null){return[]}if(!isLength(value.length)){return values(value)}return isObject(value)?value:Object(value)}function toObject(value){return isObject(value)?value:Object(value)}function chunk(array,size,guard){if(guard?isIterateeCall(array,size,guard):size==null){size=1}else{size=nativeMax(+size||1,1)}var index=0,length=array?array.length:0,resIndex=-1,result=Array(ceil(length/size));while(index<length){result[++resIndex]=baseSlice(array,index,index+=size)}return result}function compact(array){var index=-1,length=array?array.length:0,resIndex=-1,result=[];while(++index<length){var value=array[index];if(value){result[++resIndex]=value}}return result}function difference(){var index=-1,length=arguments.length;while(++index<length){var value=arguments[index];if(isArray(value)||isArguments(value)){break}}return baseDifference(value,baseFlatten(arguments,false,true,++index))}function drop(array,n,guard){var length=array?array.length:0;if(!length){return[]}if(guard?isIterateeCall(array,n,guard):n==null){n=1}return baseSlice(array,n<0?0:n)}function dropRight(array,n,guard){var length=array?array.length:0;if(!length){return[]}if(guard?isIterateeCall(array,n,guard):n==null){n=1}n=length-(+n||0);return baseSlice(array,0,n<0?0:n)}function dropRightWhile(array,predicate,thisArg){var length=array?array.length:0;if(!length){return[]}predicate=getCallback(predicate,thisArg,3);while(length--&&predicate(array[length],length,array)){}return baseSlice(array,0,length+1)}function dropWhile(array,predicate,thisArg){var length=array?array.length:0;if(!length){return[]}var index=-1;predicate=getCallback(predicate,thisArg,3);while(++index<length&&predicate(array[index],index,array)){}return baseSlice(array,index)}function findIndex(array,predicate,thisArg){var index=-1,length=array?array.length:0;predicate=getCallback(predicate,thisArg,3);while(++index<length){if(predicate(array[index],index,array)){return index}}return-1}function findLastIndex(array,predicate,thisArg){var length=array?array.length:0;predicate=getCallback(predicate,thisArg,3);while(length--){if(predicate(array[length],length,array)){return length}}return-1}function first(array){return array?array[0]:undefined}function flatten(array,isDeep,guard){var length=array?array.length:0;if(guard&&isIterateeCall(array,isDeep,guard)){isDeep=false}return length?baseFlatten(array,isDeep):[]}function flattenDeep(array){var length=array?array.length:0;return length?baseFlatten(array,true):[]}function indexOf(array,value,fromIndex){var length=array?array.length:0;if(!length){return-1}if(typeof fromIndex=="number"){fromIndex=fromIndex<0?nativeMax(length+fromIndex,0):fromIndex||0}else if(fromIndex){var index=binaryIndex(array,value),other=array[index];return(value===value?value===other:other!==other)?index:-1}return baseIndexOf(array,value,fromIndex)}function initial(array){return dropRight(array,1)}function intersection(){var args=[],argsIndex=-1,argsLength=arguments.length,caches=[],indexOf=getIndexOf(),isCommon=indexOf==baseIndexOf;while(++argsIndex<argsLength){var value=arguments[argsIndex];if(isArray(value)||isArguments(value)){args.push(value);caches.push(isCommon&&value.length>=120&&createCache(argsIndex&&value))}}argsLength=args.length;var array=args[0],index=-1,length=array?array.length:0,result=[],seen=caches[0];outer:while(++index<length){value=array[index];if((seen?cacheIndexOf(seen,value):indexOf(result,value))<0){argsIndex=argsLength;while(--argsIndex){var cache=caches[argsIndex];if((cache?cacheIndexOf(cache,value):indexOf(args[argsIndex],value))<0){continue outer}}if(seen){seen.push(value)}result.push(value)}}return result}function last(array){var length=array?array.length:0;return length?array[length-1]:undefined}function lastIndexOf(array,value,fromIndex){var length=array?array.length:0;if(!length){return-1}var index=length;if(typeof fromIndex=="number"){index=(fromIndex<0?nativeMax(length+fromIndex,0):nativeMin(fromIndex||0,length-1))+1}else if(fromIndex){index=binaryIndex(array,value,true)-1;var other=array[index];return(value===value?value===other:other!==other)?index:-1}if(value!==value){return indexOfNaN(array,index,true)}while(index--){if(array[index]===value){return index}}return-1}function pull(){var array=arguments[0];if(!(array&&array.length)){return array}var index=0,indexOf=getIndexOf(),length=arguments.length;while(++index<length){var fromIndex=0,value=arguments[index];while((fromIndex=indexOf(array,value,fromIndex))>-1){splice.call(array,fromIndex,1)}}return array}function pullAt(array){return basePullAt(array||[],baseFlatten(arguments,false,false,1))}function remove(array,predicate,thisArg){var index=-1,length=array?array.length:0,result=[];predicate=getCallback(predicate,thisArg,3);while(++index<length){var value=array[index];if(predicate(value,index,array)){result.push(value);splice.call(array,index--,1);length--}}return result}function rest(array){return drop(array,1)}function slice(array,start,end){var length=array?array.length:0;if(!length){return[]}if(end&&typeof end!="number"&&isIterateeCall(array,start,end)){start=0;end=length}return baseSlice(array,start,end)}function sortedIndex(array,value,iteratee,thisArg){var func=getCallback(iteratee);return func===baseCallback&&iteratee==null?binaryIndex(array,value):binaryIndexBy(array,value,func(iteratee,thisArg,1))}function sortedLastIndex(array,value,iteratee,thisArg){var func=getCallback(iteratee);return func===baseCallback&&iteratee==null?binaryIndex(array,value,true):binaryIndexBy(array,value,func(iteratee,thisArg,1),true)}function take(array,n,guard){var length=array?array.length:0;if(!length){return[]}if(guard?isIterateeCall(array,n,guard):n==null){n=1}return baseSlice(array,0,n<0?0:n)}function takeRight(array,n,guard){var length=array?array.length:0;if(!length){return[]}if(guard?isIterateeCall(array,n,guard):n==null){n=1}n=length-(+n||0);return baseSlice(array,n<0?0:n)}function takeRightWhile(array,predicate,thisArg){var length=array?array.length:0;if(!length){return[]}predicate=getCallback(predicate,thisArg,3);while(length--&&predicate(array[length],length,array)){}return baseSlice(array,length+1)}function takeWhile(array,predicate,thisArg){var length=array?array.length:0;if(!length){return[]}var index=-1;predicate=getCallback(predicate,thisArg,3);while(++index<length&&predicate(array[index],index,array)){}return baseSlice(array,0,index)}function union(){return baseUniq(baseFlatten(arguments,false,true))}function uniq(array,isSorted,iteratee,thisArg){var length=array?array.length:0;if(!length){return[]}if(typeof isSorted!="boolean"&&isSorted!=null){thisArg=iteratee;iteratee=isIterateeCall(array,isSorted,thisArg)?null:isSorted;isSorted=false}var func=getCallback();if(!(func===baseCallback&&iteratee==null)){iteratee=func(iteratee,thisArg,3)}return isSorted&&getIndexOf()==baseIndexOf?sortedUniq(array,iteratee):baseUniq(array,iteratee)}function unzip(array){var index=-1,length=(array&&array.length&&arrayMax(arrayMap(array,getLength)))>>>0,result=Array(length);while(++index<length){result[index]=arrayMap(array,baseProperty(index))}return result}function without(array){return baseDifference(array,baseSlice(arguments,1))}function xor(){var index=-1,length=arguments.length;while(++index<length){var array=arguments[index];if(isArray(array)||isArguments(array)){var result=result?baseDifference(result,array).concat(baseDifference(array,result)):array}}return result?baseUniq(result):[]}function zip(){var length=arguments.length,array=Array(length);while(length--){array[length]=arguments[length]}return unzip(array)}function zipObject(props,values){var index=-1,length=props?props.length:0,result={};if(length&&!values&&!isArray(props[0])){values=[]}while(++index<length){var key=props[index];if(values){result[key]=values[index]}else if(key){result[key[0]]=key[1]}}return result}function chain(value){var result=lodash(value);result.__chain__=true;return result}function tap(value,interceptor,thisArg){interceptor.call(thisArg,value);return value}function thru(value,interceptor,thisArg){return interceptor.call(thisArg,value)}function wrapperChain(){return chain(this)}function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){return new LodashWrapper(value.reverse())}return this.thru(function(value){return value.reverse()})}function wrapperToString(){return this.value()+""}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}function at(collection){var length=collection?collection.length:0;if(isLength(length)){collection=toIterable(collection)}return baseAt(collection,baseFlatten(arguments,false,false,1))}function includes(collection,target,fromIndex){var length=collection?collection.length:0;if(!isLength(length)){collection=values(collection);length=collection.length}if(!length){return false}if(typeof fromIndex=="number"){fromIndex=fromIndex<0?nativeMax(length+fromIndex,0):fromIndex||0}else{fromIndex=0}return typeof collection=="string"||!isArray(collection)&&isString(collection)?fromIndex<length&&collection.indexOf(target,fromIndex)>-1:getIndexOf(collection,target,fromIndex)>-1}var countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:result[key]=1});function every(collection,predicate,thisArg){var func=isArray(collection)?arrayEvery:baseEvery;if(typeof predicate!="function"||typeof thisArg!="undefined"){predicate=getCallback(predicate,thisArg,3)}return func(collection,predicate)}function filter(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;predicate=getCallback(predicate,thisArg,3);return func(collection,predicate)}function find(collection,predicate,thisArg){if(isArray(collection)){var index=findIndex(collection,predicate,thisArg);return index>-1?collection[index]:undefined}predicate=getCallback(predicate,thisArg,3);return baseFind(collection,predicate,baseEach)}function findLast(collection,predicate,thisArg){predicate=getCallback(predicate,thisArg,3);return baseFind(collection,predicate,baseEachRight)}function findWhere(collection,source){return find(collection,matches(source))}function forEach(collection,iteratee,thisArg){return typeof iteratee=="function"&&typeof thisArg=="undefined"&&isArray(collection)?arrayEach(collection,iteratee):baseEach(collection,bindCallback(iteratee,thisArg,3))}function forEachRight(collection,iteratee,thisArg){return typeof iteratee=="function"&&typeof thisArg=="undefined"&&isArray(collection)?arrayEachRight(collection,iteratee):baseEachRight(collection,bindCallback(iteratee,thisArg,3))}var groupBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){result[key].push(value)}else{result[key]=[value]}});var indexBy=createAggregator(function(result,value,key){result[key]=value});function invoke(collection,methodName){return baseInvoke(collection,methodName,baseSlice(arguments,2))}function map(collection,iteratee,thisArg){var func=isArray(collection)?arrayMap:baseMap;iteratee=getCallback(iteratee,thisArg,3);return func(collection,iteratee)}var max=createExtremum(arrayMax);var min=createExtremum(arrayMin,true);var partition=createAggregator(function(result,value,key){result[key?0:1].push(value)},function(){return[[],[]]});function pluck(collection,key){return map(collection,property(key))}function reduce(collection,iteratee,accumulator,thisArg){var func=isArray(collection)?arrayReduce:baseReduce;return func(collection,getCallback(iteratee,thisArg,4),accumulator,arguments.length<3,baseEach)}function reduceRight(collection,iteratee,accumulator,thisArg){var func=isArray(collection)?arrayReduceRight:baseReduce;return func(collection,getCallback(iteratee,thisArg,4),accumulator,arguments.length<3,baseEachRight)}function reject(collection,predicate,thisArg){var func=isArray(collection)?arrayFilter:baseFilter;predicate=getCallback(predicate,thisArg,3);return func(collection,function(value,index,collection){return!predicate(value,index,collection)})}function sample(collection,n,guard){if(guard?isIterateeCall(collection,n,guard):n==null){collection=toIterable(collection);var length=collection.length;return length>0?collection[baseRandom(0,length-1)]:undefined}var result=shuffle(collection);result.length=nativeMin(n<0?0:+n||0,result.length);return result}function shuffle(collection){collection=toIterable(collection);var index=-1,length=collection.length,result=Array(length);while(++index<length){var rand=baseRandom(0,index);if(index!=rand){result[index]=result[rand]}result[rand]=collection[index]}return result}function size(collection){var length=collection?collection.length:0;return isLength(length)?length:keys(collection).length}function some(collection,predicate,thisArg){var func=isArray(collection)?arraySome:baseSome;if(typeof predicate!="function"||typeof thisArg!="undefined"){predicate=getCallback(predicate,thisArg,3)}return func(collection,predicate)}function sortBy(collection,iteratee,thisArg){var index=-1,length=collection?collection.length:0,result=isLength(length)?Array(length):[];if(thisArg&&isIterateeCall(collection,iteratee,thisArg)){iteratee=null}iteratee=getCallback(iteratee,thisArg,3);baseEach(collection,function(value,key,collection){result[++index]={criteria:iteratee(value,key,collection),index:index,value:value}});return baseSortBy(result,compareAscending)}function sortByAll(collection){var args=arguments;if(args.length>3&&isIterateeCall(args[1],args[2],args[3])){args=[collection,args[1]]}var index=-1,length=collection?collection.length:0,props=baseFlatten(args,false,false,1),result=isLength(length)?Array(length):[];baseEach(collection,function(value,key,collection){var length=props.length,criteria=Array(length);while(length--){criteria[length]=value==null?undefined:value[props[length]]}result[++index]={criteria:criteria,index:index,value:value}});return baseSortBy(result,compareMultipleAscending)}function where(collection,source){return filter(collection,matches(source))}var now=nativeNow||function(){return(new Date).getTime()};function after(n,func){if(!isFunction(func)){if(isFunction(n)){var temp=n;n=func;func=temp}else{throw new TypeError(FUNC_ERROR_TEXT)}}n=nativeIsFinite(n=+n)?n:0;return function(){if(--n<1){return func.apply(this,arguments)}}}function ary(func,n,guard){if(guard&&isIterateeCall(func,n,guard)){n=null}n=func&&n==null?func.length:nativeMax(+n||0,0);return createWrapper(func,ARY_FLAG,null,null,null,null,n)}function before(n,func){var result;if(!isFunction(func)){if(isFunction(n)){var temp=n;n=func;func=temp}else{throw new TypeError(FUNC_ERROR_TEXT)}}return function(){if(--n>0){result=func.apply(this,arguments)}else{func=null}return result}}function bind(func,thisArg){var bitmask=BIND_FLAG;if(arguments.length>2){var partials=baseSlice(arguments,2),holders=replaceHolders(partials,bind.placeholder);bitmask|=PARTIAL_FLAG}return createWrapper(func,bitmask,thisArg,partials,holders)}function bindAll(object){return baseBindAll(object,arguments.length>1?baseFlatten(arguments,false,false,1):functions(object))}function bindKey(object,key){var bitmask=BIND_FLAG|BIND_KEY_FLAG;if(arguments.length>2){var partials=baseSlice(arguments,2),holders=replaceHolders(partials,bindKey.placeholder);bitmask|=PARTIAL_FLAG}return createWrapper(key,bitmask,object,partials,holders)}function curry(func,arity,guard){if(guard&&isIterateeCall(func,arity,guard)){arity=null}var result=createWrapper(func,CURRY_FLAG,null,null,null,null,null,arity);result.placeholder=curry.placeholder;return result}function curryRight(func,arity,guard){if(guard&&isIterateeCall(func,arity,guard)){arity=null}var result=createWrapper(func,CURRY_RIGHT_FLAG,null,null,null,null,null,arity);result.placeholder=curryRight.placeholder;return result}function debounce(func,wait,options){var args,maxTimeoutId,result,stamp,thisArg,timeoutId,trailingCall,lastCalled=0,maxWait=false,trailing=true;if(!isFunction(func)){throw new TypeError(FUNC_ERROR_TEXT)}wait=wait<0?0:wait;if(options===true){var leading=true;trailing=false}else if(isObject(options)){leading=options.leading;maxWait="maxWait"in options&&nativeMax(+options.maxWait||0,wait);trailing="trailing"in options?options.trailing:trailing}function cancel(){if(timeoutId){clearTimeout(timeoutId)}if(maxTimeoutId){clearTimeout(maxTimeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined}function delayed(){var remaining=wait-(now()-stamp);if(remaining<=0||remaining>wait){if(maxTimeoutId){clearTimeout(maxTimeoutId)}var isCalled=trailingCall;maxTimeoutId=timeoutId=trailingCall=undefined;if(isCalled){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}else{timeoutId=setTimeout(delayed,remaining)}}function maxDelayed(){if(timeoutId){clearTimeout(timeoutId)}maxTimeoutId=timeoutId=trailingCall=undefined;if(trailing||maxWait!==wait){lastCalled=now();result=func.apply(thisArg,args);if(!timeoutId&&!maxTimeoutId){args=thisArg=null}}}function debounced(){args=arguments;stamp=now();thisArg=this;trailingCall=trailing&&(timeoutId||!leading);if(maxWait===false){var leadingCall=leading&&!timeoutId}else{if(!maxTimeoutId&&!leading){lastCalled=stamp}var remaining=maxWait-(stamp-lastCalled),isCalled=remaining<=0||remaining>maxWait;if(isCalled){if(maxTimeoutId){maxTimeoutId=clearTimeout(maxTimeoutId)}lastCalled=stamp;result=func.apply(thisArg,args)}else if(!maxTimeoutId){maxTimeoutId=setTimeout(maxDelayed,remaining)}}if(isCalled&&timeoutId){timeoutId=clearTimeout(timeoutId)}else if(!timeoutId&&wait!==maxWait){timeoutId=setTimeout(delayed,wait)}if(leadingCall){isCalled=true;result=func.apply(thisArg,args)}if(isCalled&&!timeoutId&&!maxTimeoutId){args=thisArg=null}return result}debounced.cancel=cancel;return debounced}function defer(func){return baseDelay(func,1,arguments,1)}function delay(func,wait){return baseDelay(func,wait,arguments,2)}function flow(){var funcs=arguments,length=funcs.length;if(!length){return function(){}}if(!arrayEvery(funcs,isFunction)){throw new TypeError(FUNC_ERROR_TEXT)}return function(){var index=0,result=funcs[index].apply(this,arguments);while(++index<length){result=funcs[index].call(this,result)}return result}}function flowRight(){var funcs=arguments,fromIndex=funcs.length-1;if(fromIndex<0){return function(){}}if(!arrayEvery(funcs,isFunction)){throw new TypeError(FUNC_ERROR_TEXT)}return function(){var index=fromIndex,result=funcs[index].apply(this,arguments);while(index--){result=funcs[index].call(this,result)}return result}}function memoize(func,resolver){if(!isFunction(func)||resolver&&!isFunction(resolver)){throw new TypeError(FUNC_ERROR_TEXT)}var memoized=function(){var cache=memoized.cache,key=resolver?resolver.apply(this,arguments):arguments[0];if(cache.has(key)){return cache.get(key)}var result=func.apply(this,arguments);cache.set(key,result);return result};memoized.cache=new memoize.Cache;return memoized}function negate(predicate){if(!isFunction(predicate)){throw new TypeError(FUNC_ERROR_TEXT)}return function(){return!predicate.apply(this,arguments)}}function once(func){return before(func,2)}function partial(func){var partials=baseSlice(arguments,1),holders=replaceHolders(partials,partial.placeholder);return createWrapper(func,PARTIAL_FLAG,null,partials,holders)}function partialRight(func){var partials=baseSlice(arguments,1),holders=replaceHolders(partials,partialRight.placeholder);return createWrapper(func,PARTIAL_RIGHT_FLAG,null,partials,holders)
}function rearg(func){var indexes=baseFlatten(arguments,false,false,1);return createWrapper(func,REARG_FLAG,null,null,null,indexes)}function throttle(func,wait,options){var leading=true,trailing=true;if(!isFunction(func)){throw new TypeError(FUNC_ERROR_TEXT)}if(options===false){leading=false}else if(isObject(options)){leading="leading"in options?!!options.leading:leading;trailing="trailing"in options?!!options.trailing:trailing}debounceOptions.leading=leading;debounceOptions.maxWait=+wait;debounceOptions.trailing=trailing;return debounce(func,wait,debounceOptions)}function wrap(value,wrapper){wrapper=wrapper==null?identity:wrapper;return createWrapper(wrapper,PARTIAL_FLAG,null,[value],[])}function clone(value,isDeep,customizer,thisArg){if(typeof isDeep!="boolean"&&isDeep!=null){thisArg=customizer;customizer=isIterateeCall(value,isDeep,thisArg)?null:isDeep;isDeep=false}customizer=typeof customizer=="function"&&bindCallback(customizer,thisArg,1);return baseClone(value,isDeep,customizer)}function cloneDeep(value,customizer,thisArg){customizer=typeof customizer=="function"&&bindCallback(customizer,thisArg,1);return baseClone(value,true,customizer)}function isArguments(value){var length=isObjectLike(value)?value.length:undefined;return isLength(length)&&objToString.call(value)==argsTag||false}var isArray=nativeIsArray||function(value){return isObjectLike(value)&&isLength(value.length)&&objToString.call(value)==arrayTag||false};function isBoolean(value){return value===true||value===false||isObjectLike(value)&&objToString.call(value)==boolTag||false}function isDate(value){return isObjectLike(value)&&objToString.call(value)==dateTag||false}function isElement(value){return value&&value.nodeType===1&&isObjectLike(value)&&objToString.call(value).indexOf("Element")>-1||false}if(!support.dom){isElement=function(value){return value&&value.nodeType===1&&isObjectLike(value)&&!isPlainObject(value)||false}}function isEmpty(value){if(value==null){return true}var length=value.length;if(isLength(length)&&(isArray(value)||isString(value)||isArguments(value)||isObjectLike(value)&&isFunction(value.splice))){return!length}return!keys(value).length}function isEqual(value,other,customizer,thisArg){customizer=typeof customizer=="function"&&bindCallback(customizer,thisArg,3);if(!customizer&&isStrictComparable(value)&&isStrictComparable(other)){return value===other}var result=customizer?customizer(value,other):undefined;return typeof result=="undefined"?baseIsEqual(value,other,customizer):!!result}function isError(value){return isObjectLike(value)&&typeof value.message=="string"&&objToString.call(value)==errorTag||false}var isFinite=nativeNumIsFinite||function(value){return typeof value=="number"&&nativeIsFinite(value)};function isFunction(value){return typeof value=="function"||false}if(isFunction(/x/)||Uint8Array&&!isFunction(Uint8Array)){isFunction=function(value){return objToString.call(value)==funcTag}}function isObject(value){var type=typeof value;return type=="function"||value&&type=="object"||false}function isMatch(object,source,customizer,thisArg){var props=keys(source),length=props.length;customizer=typeof customizer=="function"&&bindCallback(customizer,thisArg,3);if(!customizer&&length==1){var key=props[0],value=source[key];if(isStrictComparable(value)){return object!=null&&value===object[key]&&hasOwnProperty.call(object,key)}}var values=Array(length),strictCompareFlags=Array(length);while(length--){value=values[length]=source[props[length]];strictCompareFlags[length]=isStrictComparable(value)}return baseIsMatch(object,props,values,strictCompareFlags,customizer)}function isNaN(value){return isNumber(value)&&value!=+value}function isNative(value){if(value==null){return false}if(objToString.call(value)==funcTag){return reNative.test(fnToString.call(value))}return isObjectLike(value)&&reHostCtor.test(value)||false}function isNull(value){return value===null}function isNumber(value){return typeof value=="number"||isObjectLike(value)&&objToString.call(value)==numberTag||false}var isPlainObject=!getPrototypeOf?shimIsPlainObject:function(value){if(!(value&&objToString.call(value)==objectTag)){return false}var valueOf=value.valueOf,objProto=isNative(valueOf)&&(objProto=getPrototypeOf(valueOf))&&getPrototypeOf(objProto);return objProto?value==objProto||getPrototypeOf(value)==objProto:shimIsPlainObject(value)};function isRegExp(value){return isObjectLike(value)&&objToString.call(value)==regexpTag||false}function isString(value){return typeof value=="string"||isObjectLike(value)&&objToString.call(value)==stringTag||false}function isTypedArray(value){return isObjectLike(value)&&isLength(value.length)&&typedArrayTags[objToString.call(value)]||false}function isUndefined(value){return typeof value=="undefined"}function toArray(value){var length=value?value.length:0;if(!isLength(length)){return values(value)}if(!length){return[]}return arrayCopy(value)}function toPlainObject(value){return baseCopy(value,keysIn(value))}var assign=createAssigner(baseAssign);function create(prototype,properties,guard){var result=baseCreate(prototype);if(guard&&isIterateeCall(prototype,properties,guard)){properties=null}return properties?baseCopy(properties,result,keys(properties)):result}function defaults(object){if(object==null){return object}var args=arrayCopy(arguments);args.push(assignDefaults);return assign.apply(undefined,args)}function findKey(object,predicate,thisArg){predicate=getCallback(predicate,thisArg,3);return baseFind(object,predicate,baseForOwn,true)}function findLastKey(object,predicate,thisArg){predicate=getCallback(predicate,thisArg,3);return baseFind(object,predicate,baseForOwnRight,true)}function forIn(object,iteratee,thisArg){if(typeof iteratee!="function"||typeof thisArg!="undefined"){iteratee=bindCallback(iteratee,thisArg,3)}return baseFor(object,iteratee,keysIn)}function forInRight(object,iteratee,thisArg){iteratee=bindCallback(iteratee,thisArg,3);return baseForRight(object,iteratee,keysIn)}function forOwn(object,iteratee,thisArg){if(typeof iteratee!="function"||typeof thisArg!="undefined"){iteratee=bindCallback(iteratee,thisArg,3)}return baseForOwn(object,iteratee)}function forOwnRight(object,iteratee,thisArg){iteratee=bindCallback(iteratee,thisArg,3);return baseForRight(object,iteratee,keys)}function functions(object){return baseFunctions(object,keysIn(object))}function has(object,key){return object?hasOwnProperty.call(object,key):false}function invert(object,multiValue,guard){if(guard&&isIterateeCall(object,multiValue,guard)){multiValue=null}var index=-1,props=keys(object),length=props.length,result={};while(++index<length){var key=props[index],value=object[key];if(multiValue){if(hasOwnProperty.call(result,value)){result[value].push(key)}else{result[value]=[key]}}else{result[value]=key}}return result}var keys=!nativeKeys?shimKeys:function(object){if(object){var Ctor=object.constructor,length=object.length}if(typeof Ctor=="function"&&Ctor.prototype===object||typeof object!="function"&&(length&&isLength(length))){return shimKeys(object)}return isObject(object)?nativeKeys(object):[]};function keysIn(object){if(object==null){return[]}if(!isObject(object)){object=Object(object)}var length=object.length;length=length&&isLength(length)&&(isArray(object)||support.nonEnumArgs&&isArguments(object))&&length||0;var Ctor=object.constructor,index=-1,isProto=typeof Ctor=="function"&&Ctor.prototype==object,result=Array(length),skipIndexes=length>0;while(++index<length){result[index]=index+""}for(var key in object){if(!(skipIndexes&&isIndex(key,length))&&!(key=="constructor"&&(isProto||!hasOwnProperty.call(object,key)))){result.push(key)}}return result}function mapValues(object,iteratee,thisArg){var result={};iteratee=getCallback(iteratee,thisArg,3);baseForOwn(object,function(value,key,object){result[key]=iteratee(value,key,object)});return result}var merge=createAssigner(baseMerge);function omit(object,predicate,thisArg){if(object==null){return{}}if(typeof predicate!="function"){var props=arrayMap(baseFlatten(arguments,false,false,1),String);return pickByArray(object,baseDifference(keysIn(object),props))}predicate=bindCallback(predicate,thisArg,3);return pickByCallback(object,function(value,key,object){return!predicate(value,key,object)})}function pairs(object){var index=-1,props=keys(object),length=props.length,result=Array(length);while(++index<length){var key=props[index];result[index]=[key,object[key]]}return result}function pick(object,predicate,thisArg){if(object==null){return{}}return typeof predicate=="function"?pickByCallback(object,bindCallback(predicate,thisArg,3)):pickByArray(object,baseFlatten(arguments,false,false,1))}function result(object,key,defaultValue){var value=object==null?undefined:object[key];if(typeof value=="undefined"){value=defaultValue}return isFunction(value)?value.call(object):value}function transform(object,iteratee,accumulator,thisArg){var isArr=isArray(object)||isTypedArray(object);iteratee=getCallback(iteratee,thisArg,4);if(accumulator==null){if(isArr||isObject(object)){var Ctor=object.constructor;if(isArr){accumulator=isArray(object)?new Ctor:[]}else{accumulator=baseCreate(typeof Ctor=="function"&&Ctor.prototype)}}else{accumulator={}}}(isArr?arrayEach:baseForOwn)(object,function(value,index,object){return iteratee(accumulator,value,index,object)});return accumulator}function values(object){return baseValues(object,keys(object))}function valuesIn(object){return baseValues(object,keysIn(object))}function random(min,max,floating){if(floating&&isIterateeCall(min,max,floating)){max=floating=null}var noMin=min==null,noMax=max==null;if(floating==null){if(noMax&&typeof min=="boolean"){floating=min;min=1}else if(typeof max=="boolean"){floating=max;noMax=true}}if(noMin&&noMax){max=1;noMax=false}min=+min||0;if(noMax){max=min;min=0}else{max=+max||0}if(floating||min%1||max%1){var rand=nativeRandom();return nativeMin(min+rand*(max-min+parseFloat("1e-"+((rand+"").length-1))),max)}return baseRandom(min,max)}var camelCase=createCompounder(function(result,word,index){word=word.toLowerCase();return index?result+word.charAt(0).toUpperCase()+word.slice(1):word});function capitalize(string){string=baseToString(string);return string&&string.charAt(0).toUpperCase()+string.slice(1)}function deburr(string){string=baseToString(string);return string&&string.replace(reLatin1,deburrLetter)}function endsWith(string,target,position){string=baseToString(string);target=target+"";var length=string.length;position=(typeof position=="undefined"?length:nativeMin(position<0?0:+position||0,length))-target.length;return position>=0&&string.indexOf(target,position)==position}function escape(string){string=baseToString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}function escapeRegExp(string){string=baseToString(string);return string&&reHasRegExpChars.test(string)?string.replace(reRegExpChars,"\\$&"):string}var kebabCase=createCompounder(function(result,word,index){return result+(index?"-":"")+word.toLowerCase()});function pad(string,length,chars){string=baseToString(string);length=+length;var strLength=string.length;if(strLength>=length||!nativeIsFinite(length)){return string}var mid=(length-strLength)/2,leftLength=floor(mid),rightLength=ceil(mid);chars=createPad("",rightLength,chars);return chars.slice(0,leftLength)+string+chars}function padLeft(string,length,chars){string=baseToString(string);return string&&createPad(string,length,chars)+string}function padRight(string,length,chars){string=baseToString(string);return string&&string+createPad(string,length,chars)}function parseInt(string,radix,guard){if(guard&&isIterateeCall(string,radix,guard)){radix=0}return nativeParseInt(string,radix)}if(nativeParseInt(whitespace+"08")!=8){parseInt=function(string,radix,guard){if(guard?isIterateeCall(string,radix,guard):radix==null){radix=0}else if(radix){radix=+radix}string=trim(string);return nativeParseInt(string,radix||(reHexPrefix.test(string)?16:10))}}function repeat(string,n){var result="";string=baseToString(string);n=+n;if(n<1||!string||!nativeIsFinite(n)){return result}do{if(n%2){result+=string}n=floor(n/2);string+=string}while(n);return result}var snakeCase=createCompounder(function(result,word,index){return result+(index?"_":"")+word.toLowerCase()});function startsWith(string,target,position){string=baseToString(string);position=position==null?0:nativeMin(position<0?0:+position||0,string.length);return string.lastIndexOf(target,position)==position}function template(string,options,otherOptions){var settings=lodash.templateSettings;if(otherOptions&&isIterateeCall(string,options,otherOptions)){options=otherOptions=null}string=baseToString(string);options=baseAssign(baseAssign({},otherOptions||options),settings,assignOwnDefaults);var imports=baseAssign(baseAssign({},options.imports),settings.imports,assignOwnDefaults),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys);var isEscaping,isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";var reDelimiters=RegExp((options.escape||reNoMatch).source+"|"+interpolate.source+"|"+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+"|"+(options.evaluate||reNoMatch).source+"|$","g");var sourceURL="//# sourceURL="+("sourceURL"in options?options.sourceURL:"lodash.templateSources["+ ++templateCounter+"]")+"\n";string.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar);if(escapeValue){isEscaping=true;source+="' +\n__e("+escapeValue+") +\n'"}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '"}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'"}index=offset+match.length;return match});source+="';\n";var variable=options.variable;if(!variable){source="with (obj) {\n"+source+"\n}\n"}source=(isEvaluating?source.replace(reEmptyStringLeading,""):source).replace(reEmptyStringMiddle,"$1").replace(reEmptyStringTrailing,"$1;");source="function("+(variable||"obj")+") {\n"+(variable?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(isEscaping?", __e = _.escape":"")+(isEvaluating?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+source+"return __p\n}";var result=attempt(function(){return Function(importsKeys,sourceURL+"return "+source).apply(undefined,importsValues)});result.source=source;if(isError(result)){throw result}return result}function trim(string,chars,guard){var value=string;string=baseToString(string);if(!string){return string}if(guard?isIterateeCall(value,chars,guard):chars==null){return string.slice(trimmedLeftIndex(string),trimmedRightIndex(string)+1)}chars=baseToString(chars);return string.slice(charsLeftIndex(string,chars),charsRightIndex(string,chars)+1)}function trimLeft(string,chars,guard){var value=string;string=baseToString(string);if(!string){return string}if(guard?isIterateeCall(value,chars,guard):chars==null){return string.slice(trimmedLeftIndex(string))}return string.slice(charsLeftIndex(string,baseToString(chars)))}function trimRight(string,chars,guard){var value=string;string=baseToString(string);if(!string){return string}if(guard?isIterateeCall(value,chars,guard):chars==null){return string.slice(0,trimmedRightIndex(string)+1)}return string.slice(0,charsRightIndex(string,baseToString(chars))+1)}function trunc(string,options,guard){if(guard&&isIterateeCall(string,options,guard)){options=null}var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(options!=null){if(isObject(options)){var separator="separator"in options?options.separator:separator;length="length"in options?+options.length||0:length;omission="omission"in options?baseToString(options.omission):omission}else{length=+options||0}}string=baseToString(string);if(length>=string.length){return string}var end=length-omission.length;if(end<1){return omission}var result=string.slice(0,end);if(separator==null){return result+omission}if(isRegExp(separator)){if(string.slice(end).search(separator)){var match,newEnd,substring=string.slice(0,end);if(!separator.global){separator=RegExp(separator.source,(reFlags.exec(separator)||"")+"g")}separator.lastIndex=0;while(match=separator.exec(substring)){newEnd=match.index}result=result.slice(0,newEnd==null?end:newEnd)}}else if(string.indexOf(separator,end)!=end){var index=result.lastIndexOf(separator);if(index>-1){result=result.slice(0,index)}}return result+omission}function unescape(string){string=baseToString(string);return string&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string}function words(string,pattern,guard){if(guard&&isIterateeCall(string,pattern,guard)){pattern=null}string=baseToString(string);return string.match(pattern||reWords)||[]}function attempt(func){try{return func()}catch(e){return isError(e)?e:Error(e)}}function callback(func,thisArg,guard){if(guard&&isIterateeCall(func,thisArg,guard)){thisArg=null}return baseCallback(func,thisArg)}function constant(value){return function(){return value}}function identity(value){return value}function matches(source){return baseMatches(source,true)}function mixin(object,source,options){if(options==null){var isObj=isObject(source),props=isObj&&keys(source),methodNames=props&&props.length&&baseFunctions(source,props);if(!(methodNames?methodNames.length:isObj)){methodNames=false;options=source;source=object;object=this}}if(!methodNames){methodNames=baseFunctions(source,keys(source))}var chain=true,index=-1,isFunc=isFunction(object),length=methodNames.length;if(options===false){chain=false}else if(isObject(options)&&"chain"in options){chain=options.chain}while(++index<length){var methodName=methodNames[index],func=source[methodName];object[methodName]=func;if(isFunc){object.prototype[methodName]=function(func){return function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__);(result.__actions__=arrayCopy(this.__actions__)).push({func:func,args:arguments,thisArg:object});result.__chain__=chainAll;return result}var args=[this.value()];push.apply(args,arguments);return func.apply(object,args)}}(func)}}return object}function noConflict(){context._=oldDash;return this}function noop(){}function property(key){return baseProperty(key+"")}function propertyOf(object){return function(key){return object==null?undefined:object[key]}}function range(start,end,step){if(step&&isIterateeCall(start,end,step)){end=step=null}start=+start||0;step=step==null?1:+step||0;if(end==null){end=start;start=0}else{end=+end||0}var index=-1,length=nativeMax(ceil((end-start)/(step||1)),0),result=Array(length);while(++index<length){result[index]=start;start+=step}return result}function times(n,iteratee,thisArg){n=+n;if(n<1||!nativeIsFinite(n)){return[]}var index=-1,result=Array(nativeMin(n,MAX_ARRAY_LENGTH));iteratee=bindCallback(iteratee,thisArg,1);while(++index<n){if(index<MAX_ARRAY_LENGTH){result[index]=iteratee(index)}else{iteratee(index)}}return result}function uniqueId(prefix){var id=++idCounter;return baseToString(prefix)+id}LodashWrapper.prototype=lodash.prototype;MapCache.prototype["delete"]=mapDelete;MapCache.prototype.get=mapGet;MapCache.prototype.has=mapHas;MapCache.prototype.set=mapSet;SetCache.prototype.push=cachePush;memoize.Cache=MapCache;lodash.after=after;lodash.ary=ary;lodash.assign=assign;lodash.at=at;lodash.before=before;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.callback=callback;lodash.chain=chain;lodash.chunk=chunk;lodash.compact=compact;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.curry=curry;lodash.curryRight=curryRight;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.drop=drop;lodash.dropRight=dropRight;lodash.dropRightWhile=dropRightWhile;lodash.dropWhile=dropWhile;lodash.filter=filter;lodash.flatten=flatten;lodash.flattenDeep=flattenDeep;lodash.flow=flow;lodash.flowRight=flowRight;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.functions=functions;lodash.groupBy=groupBy;lodash.indexBy=indexBy;lodash.initial=initial;lodash.intersection=intersection;lodash.invert=invert;lodash.invoke=invoke;lodash.keys=keys;lodash.keysIn=keysIn;lodash.map=map;lodash.mapValues=mapValues;lodash.matches=matches;lodash.memoize=memoize;lodash.merge=merge;lodash.mixin=mixin;lodash.negate=negate;lodash.omit=omit;lodash.once=once;lodash.pairs=pairs;lodash.partial=partial;lodash.partialRight=partialRight;lodash.partition=partition;lodash.pick=pick;lodash.pluck=pluck;lodash.property=property;lodash.propertyOf=propertyOf;lodash.pull=pull;lodash.pullAt=pullAt;lodash.range=range;lodash.rearg=rearg;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.shuffle=shuffle;lodash.slice=slice;lodash.sortBy=sortBy;lodash.sortByAll=sortByAll;lodash.take=take;lodash.takeRight=takeRight;lodash.takeRightWhile=takeRightWhile;lodash.takeWhile=takeWhile;lodash.tap=tap;lodash.throttle=throttle;lodash.thru=thru;lodash.times=times;lodash.toArray=toArray;lodash.toPlainObject=toPlainObject;lodash.transform=transform;lodash.union=union;lodash.uniq=uniq;lodash.unzip=unzip;lodash.values=values;lodash.valuesIn=valuesIn;lodash.where=where;lodash.without=without;lodash.wrap=wrap;lodash.xor=xor;lodash.zip=zip;lodash.zipObject=zipObject;lodash.backflow=flowRight;lodash.collect=map;lodash.compose=flowRight;lodash.each=forEach;lodash.eachRight=forEachRight;lodash.extend=assign;lodash.iteratee=callback;lodash.methods=functions;lodash.object=zipObject;lodash.select=filter;lodash.tail=rest;lodash.unique=uniq;mixin(lodash,lodash);lodash.attempt=attempt;lodash.camelCase=camelCase;lodash.capitalize=capitalize;lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.deburr=deburr;lodash.endsWith=endsWith;lodash.escape=escape;lodash.escapeRegExp=escapeRegExp;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.findWhere=findWhere;lodash.first=first;lodash.has=has;lodash.identity=identity;lodash.includes=includes;lodash.indexOf=indexOf;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isBoolean=isBoolean;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isError=isError;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isMatch=isMatch;lodash.isNaN=isNaN;lodash.isNative=isNative;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isString=isString;lodash.isTypedArray=isTypedArray;lodash.isUndefined=isUndefined;lodash.kebabCase=kebabCase;lodash.last=last;lodash.lastIndexOf=lastIndexOf;lodash.max=max;lodash.min=min;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.pad=pad;lodash.padLeft=padLeft;lodash.padRight=padRight;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.repeat=repeat;lodash.result=result;lodash.runInContext=runInContext;lodash.size=size;lodash.snakeCase=snakeCase;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.sortedLastIndex=sortedLastIndex;lodash.startsWith=startsWith;lodash.template=template;lodash.trim=trim;lodash.trimLeft=trimLeft;lodash.trimRight=trimRight;lodash.trunc=trunc;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.words=words;lodash.all=every;lodash.any=some;lodash.contains=includes;lodash.detect=find;lodash.foldl=reduce;lodash.foldr=reduceRight;lodash.head=first;lodash.include=includes;lodash.inject=reduce;mixin(lodash,function(){var source={};baseForOwn(lodash,function(func,methodName){if(!lodash.prototype[methodName]){source[methodName]=func}});return source}(),false);lodash.sample=sample;lodash.prototype.sample=function(n){if(!this.__chain__&&n==null){return sample(this.value())}return this.thru(function(value){return sample(value,n)})};lodash.VERSION=VERSION;arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],function(methodName){lodash[methodName].placeholder=lodash});arrayEach(["filter","map","takeWhile"],function(methodName,index){var isFilter=index==LAZY_FILTER_FLAG;LazyWrapper.prototype[methodName]=function(iteratee,thisArg){var result=this.clone(),filtered=result.filtered,iteratees=result.iteratees||(result.iteratees=[]);result.filtered=filtered||isFilter||index==LAZY_WHILE_FLAG&&result.dir<0;iteratees.push({iteratee:getCallback(iteratee,thisArg,3),type:index});return result}});arrayEach(["drop","take"],function(methodName,index){var countName=methodName+"Count",whileName=methodName+"While";LazyWrapper.prototype[methodName]=function(n){n=n==null?1:nativeMax(+n||0,0);var result=this.clone();if(result.filtered){var value=result[countName];result[countName]=index?nativeMin(value,n):value+n}else{var views=result.views||(result.views=[]);views.push({size:n,type:methodName+(result.dir<0?"Right":"")})}return result};LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()};LazyWrapper.prototype[methodName+"RightWhile"]=function(predicate,thisArg){return this.reverse()[whileName](predicate,thisArg).reverse()}});arrayEach(["first","last"],function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}});arrayEach(["initial","rest"],function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this[dropName](1)}});arrayEach(["pluck","where"],function(methodName,index){var operationName=index?"filter":"map",createCallback=index?matches:property;LazyWrapper.prototype[methodName]=function(value){return this[operationName](createCallback(value))}});LazyWrapper.prototype.dropWhile=function(iteratee,thisArg){var done,lastIndex,isRight=this.dir<0;iteratee=getCallback(iteratee,thisArg,3);return this.filter(function(value,index,array){done=done&&(isRight?index<lastIndex:index>lastIndex);lastIndex=index;return done||(done=!iteratee(value,index,array))})};LazyWrapper.prototype.reject=function(iteratee,thisArg){iteratee=getCallback(iteratee,thisArg,3);return this.filter(function(value,index,array){return!iteratee(value,index,array)})};LazyWrapper.prototype.slice=function(start,end){start=start==null?0:+start||0;var result=start<0?this.takeRight(-start):this.drop(start);if(typeof end!="undefined"){end=+end||0;result=end<0?result.dropRight(-end):result.take(end-start)}return result};baseForOwn(LazyWrapper.prototype,function(func,methodName){var retUnwrapped=/^(?:first|last)$/.test(methodName);lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=arguments,chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isLazy=value instanceof LazyWrapper,onlyLazy=isLazy&&!isHybrid;if(retUnwrapped&&!chainAll){return onlyLazy?func.call(value):lodash[methodName](this.value())}var interceptor=function(value){var otherArgs=[value];push.apply(otherArgs,args);return lodash[methodName].apply(lodash,otherArgs)};if(isLazy||isArray(value)){var wrapper=onlyLazy?value:new LazyWrapper(this),result=func.apply(wrapper,args);if(!retUnwrapped&&(isHybrid||result.actions)){var actions=result.actions||(result.actions=[]);actions.push({func:thru,args:[interceptor],thisArg:lodash})}return new LodashWrapper(result,chainAll)}return this.thru(interceptor)}});arrayEach(["concat","join","pop","push","shift","sort","splice","unshift"],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:join|pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){return func.apply(this.value(),args)}return this[chainName](function(value){return func.apply(value,args)})}});LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;lodash.prototype.chain=wrapperChain;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toString=wrapperToString;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;lodash.prototype.collect=lodash.prototype.map;lodash.prototype.head=lodash.prototype.first;lodash.prototype.select=lodash.prototype.filter;lodash.prototype.tail=lodash.prototype.rest;return lodash}var _=runInContext();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){root._=_;define(function(){return _})}else if(freeExports&&freeModule){if(moduleExports){(freeModule.exports=_)._=_}else{freeExports._=_}}else{root._=_}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],165:[function(require,module,exports){"use strict";var originalObject=Object;var originalDefProp=Object.defineProperty;var originalCreate=Object.create;function defProp(obj,name,value){if(originalDefProp)try{originalDefProp.call(originalObject,obj,name,{value:value})}catch(definePropertyIsBrokenInIE8){obj[name]=value}else{obj[name]=value}}function makeSafeToCall(fun){if(fun){defProp(fun,"call",fun.call);defProp(fun,"apply",fun.apply)}return fun}makeSafeToCall(originalDefProp);makeSafeToCall(originalCreate);var hasOwn=makeSafeToCall(Object.prototype.hasOwnProperty);var numToStr=makeSafeToCall(Number.prototype.toString);var strSlice=makeSafeToCall(String.prototype.slice);var cloner=function(){};function create(prototype){if(originalCreate){return originalCreate.call(originalObject,prototype)}cloner.prototype=prototype||null;return new cloner}var rand=Math.random;var uniqueKeys=create(null);function makeUniqueKey(){do var uniqueKey=internString(strSlice.call(numToStr.call(rand(),36),2));while(hasOwn.call(uniqueKeys,uniqueKey));return uniqueKeys[uniqueKey]=uniqueKey}function internString(str){var obj={};obj[str]=true;return Object.keys(obj)[0]}defProp(exports,"makeUniqueKey",makeUniqueKey);var originalGetOPNs=Object.getOwnPropertyNames;Object.getOwnPropertyNames=function getOwnPropertyNames(object){for(var names=originalGetOPNs(object),src=0,dst=0,len=names.length;src<len;++src){if(!hasOwn.call(uniqueKeys,names[src])){if(src>dst){names[dst]=names[src]}++dst}}names.length=dst;return names};function defaultCreatorFn(object){return create(null)}function makeAccessor(secretCreatorFn){var brand=makeUniqueKey();var passkey=create(null);secretCreatorFn=secretCreatorFn||defaultCreatorFn;function register(object){var secret;function vault(key,forget){if(key===passkey){return forget?secret=null:secret||(secret=secretCreatorFn(object))}}defProp(object,brand,vault)}function accessor(object){if(!hasOwn.call(object,brand))register(object);return object[brand](passkey)}accessor.forget=function(object){if(hasOwn.call(object,brand))object[brand](passkey,true)};return accessor}defProp(exports,"makeAccessor",makeAccessor)},{}],166:[function(require,module,exports){var assert=require("assert");var types=require("ast-types");var isArray=types.builtInTypes.array;var b=types.builders;var n=types.namedTypes;var leap=require("./leap");var meta=require("./meta");var util=require("./util");var runtimeKeysMethod=util.runtimeProperty("keys");var hasOwn=Object.prototype.hasOwnProperty;function Emitter(contextId){assert.ok(this instanceof Emitter);n.Identifier.assert(contextId);Object.defineProperties(this,{contextId:{value:contextId},listing:{value:[]},marked:{value:[true]},finalLoc:{value:loc()},tryEntries:{value:[]}});Object.defineProperties(this,{leapManager:{value:new leap.LeapManager(this)}})}var Ep=Emitter.prototype;exports.Emitter=Emitter;function loc(){return b.literal(-1)}Ep.mark=function(loc){n.Literal.assert(loc);var index=this.listing.length;if(loc.value===-1){loc.value=index
}else{assert.strictEqual(loc.value,index)}this.marked[index]=true;return loc};Ep.emit=function(node){if(n.Expression.check(node))node=b.expressionStatement(node);n.Statement.assert(node);this.listing.push(node)};Ep.emitAssign=function(lhs,rhs){this.emit(this.assign(lhs,rhs));return lhs};Ep.assign=function(lhs,rhs){return b.expressionStatement(b.assignmentExpression("=",lhs,rhs))};Ep.contextProperty=function(name,computed){return b.memberExpression(this.contextId,computed?b.literal(name):b.identifier(name),!!computed)};var volatileContextPropertyNames={prev:true,next:true,sent:true,rval:true};Ep.isVolatileContextProperty=function(expr){if(n.MemberExpression.check(expr)){if(expr.computed){return true}if(n.Identifier.check(expr.object)&&n.Identifier.check(expr.property)&&expr.object.name===this.contextId.name&&hasOwn.call(volatileContextPropertyNames,expr.property.name)){return true}}return false};Ep.stop=function(rval){if(rval){this.setReturnValue(rval)}this.jump(this.finalLoc)};Ep.setReturnValue=function(valuePath){n.Expression.assert(valuePath.value);this.emitAssign(this.contextProperty("rval"),this.explodeExpression(valuePath))};Ep.clearPendingException=function(tryLoc,assignee){n.Literal.assert(tryLoc);var catchCall=b.callExpression(this.contextProperty("catch",true),[tryLoc]);if(assignee){this.emitAssign(assignee,catchCall)}else{this.emit(catchCall)}};Ep.jump=function(toLoc){this.emitAssign(this.contextProperty("next"),toLoc);this.emit(b.breakStatement())};Ep.jumpIf=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);this.emit(b.ifStatement(test,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};Ep.jumpIfNot=function(test,toLoc){n.Expression.assert(test);n.Literal.assert(toLoc);var negatedTest;if(n.UnaryExpression.check(test)&&test.operator==="!"){negatedTest=test.argument}else{negatedTest=b.unaryExpression("!",test)}this.emit(b.ifStatement(negatedTest,b.blockStatement([this.assign(this.contextProperty("next"),toLoc),b.breakStatement()])))};var nextTempId=0;Ep.makeTempVar=function(){return this.contextProperty("t"+nextTempId++)};Ep.getContextFunction=function(id){var func=b.functionExpression(id||null,[this.contextId],b.blockStatement([this.getDispatchLoop()]),false,false);func._aliasFunction=true;return func};Ep.getDispatchLoop=function(){var self=this;var cases=[];var current;var alreadyEnded=false;self.listing.forEach(function(stmt,i){if(self.marked.hasOwnProperty(i)){cases.push(b.switchCase(b.literal(i),current=[]));alreadyEnded=false}if(!alreadyEnded){current.push(stmt);if(isSwitchCaseEnder(stmt))alreadyEnded=true}});this.finalLoc.value=this.listing.length;cases.push(b.switchCase(this.finalLoc,[]),b.switchCase(b.literal("end"),[b.returnStatement(b.callExpression(this.contextProperty("stop"),[]))]));return b.whileStatement(b.literal(1),b.switchStatement(b.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),cases))};function isSwitchCaseEnder(stmt){return n.BreakStatement.check(stmt)||n.ContinueStatement.check(stmt)||n.ReturnStatement.check(stmt)||n.ThrowStatement.check(stmt)}Ep.getTryEntryList=function(){if(this.tryEntries.length===0){return null}var lastLocValue=0;return b.arrayExpression(this.tryEntries.map(function(tryEntry){var thisLocValue=tryEntry.firstLoc.value;assert.ok(thisLocValue>=lastLocValue,"try entries out of order");lastLocValue=thisLocValue;var ce=tryEntry.catchEntry;var fe=tryEntry.finallyEntry;var triple=[tryEntry.firstLoc,ce?ce.firstLoc:null];if(fe){triple[2]=fe.firstLoc}return b.arrayExpression(triple)}))};Ep.explode=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var node=path.value;var self=this;n.Node.assert(node);if(n.Statement.check(node))return self.explodeStatement(path);if(n.Expression.check(node))return self.explodeExpression(path,ignoreResult);if(n.Declaration.check(node))throw getDeclError(node);switch(node.type){case"Program":return path.get("body").map(self.explodeStatement,self);case"VariableDeclarator":throw getDeclError(node);case"Property":case"SwitchCase":case"CatchClause":throw new Error(node.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+JSON.stringify(node.type))}};function getDeclError(node){return new Error("all declarations should have been transformed into "+"assignments before the Exploder began its work: "+JSON.stringify(node))}Ep.explodeStatement=function(path,labelId){assert.ok(path instanceof types.NodePath);var stmt=path.value;var self=this;n.Statement.assert(stmt);if(labelId){n.Identifier.assert(labelId)}else{labelId=null}if(n.BlockStatement.check(stmt)){return path.get("body").each(self.explodeStatement,self)}if(!meta.containsLeap(stmt)){self.emit(stmt);return}switch(stmt.type){case"ExpressionStatement":self.explodeExpression(path.get("expression"),true);break;case"LabeledStatement":var after=loc();self.leapManager.withEntry(new leap.LabeledEntry(after,stmt.label),function(){self.explodeStatement(path.get("body"),stmt.label)});self.mark(after);break;case"WhileStatement":var before=loc();var after=loc();self.mark(before);self.jumpIfNot(self.explodeExpression(path.get("test")),after);self.leapManager.withEntry(new leap.LoopEntry(after,before,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(before);self.mark(after);break;case"DoWhileStatement":var first=loc();var test=loc();var after=loc();self.mark(first);self.leapManager.withEntry(new leap.LoopEntry(after,test,labelId),function(){self.explode(path.get("body"))});self.mark(test);self.jumpIf(self.explodeExpression(path.get("test")),first);self.mark(after);break;case"ForStatement":var head=loc();var update=loc();var after=loc();if(stmt.init){self.explode(path.get("init"),true)}self.mark(head);if(stmt.test){self.jumpIfNot(self.explodeExpression(path.get("test")),after)}else{}self.leapManager.withEntry(new leap.LoopEntry(after,update,labelId),function(){self.explodeStatement(path.get("body"))});self.mark(update);if(stmt.update){self.explode(path.get("update"),true)}self.jump(head);self.mark(after);break;case"ForInStatement":n.Identifier.assert(stmt.left);var head=loc();var after=loc();var keyIterNextFn=self.makeTempVar();self.emitAssign(keyIterNextFn,b.callExpression(runtimeKeysMethod,[self.explodeExpression(path.get("right"))]));self.mark(head);var keyInfoTmpVar=self.makeTempVar();self.jumpIf(b.memberExpression(b.assignmentExpression("=",keyInfoTmpVar,b.callExpression(keyIterNextFn,[])),b.identifier("done"),false),after);self.emitAssign(stmt.left,b.memberExpression(keyInfoTmpVar,b.identifier("value"),false));self.leapManager.withEntry(new leap.LoopEntry(after,head,labelId),function(){self.explodeStatement(path.get("body"))});self.jump(head);self.mark(after);break;case"BreakStatement":self.emitAbruptCompletion({type:"break",target:self.leapManager.getBreakLoc(stmt.label)});break;case"ContinueStatement":self.emitAbruptCompletion({type:"continue",target:self.leapManager.getContinueLoc(stmt.label)});break;case"SwitchStatement":var disc=self.emitAssign(self.makeTempVar(),self.explodeExpression(path.get("discriminant")));var after=loc();var defaultLoc=loc();var condition=defaultLoc;var caseLocs=[];var cases=stmt.cases||[];for(var i=cases.length-1;i>=0;--i){var c=cases[i];n.SwitchCase.assert(c);if(c.test){condition=b.conditionalExpression(b.binaryExpression("===",disc,c.test),caseLocs[i]=loc(),condition)}else{caseLocs[i]=defaultLoc}}self.jump(self.explodeExpression(new types.NodePath(condition,path,"discriminant")));self.leapManager.withEntry(new leap.SwitchEntry(after),function(){path.get("cases").each(function(casePath){var c=casePath.value;var i=casePath.name;self.mark(caseLocs[i]);casePath.get("consequent").each(self.explodeStatement,self)})});self.mark(after);if(defaultLoc.value===-1){self.mark(defaultLoc);assert.strictEqual(after.value,defaultLoc.value)}break;case"IfStatement":var elseLoc=stmt.alternate&&loc();var after=loc();self.jumpIfNot(self.explodeExpression(path.get("test")),elseLoc||after);self.explodeStatement(path.get("consequent"));if(elseLoc){self.jump(after);self.mark(elseLoc);self.explodeStatement(path.get("alternate"))}self.mark(after);break;case"ReturnStatement":self.emitAbruptCompletion({type:"return",value:self.explodeExpression(path.get("argument"))});break;case"WithStatement":throw new Error(node.type+" not supported in generator functions.");case"TryStatement":var after=loc();var handler=stmt.handler;if(!handler&&stmt.handlers){handler=stmt.handlers[0]||null}var catchLoc=handler&&loc();var catchEntry=catchLoc&&new leap.CatchEntry(catchLoc,handler.param);var finallyLoc=stmt.finalizer&&loc();var finallyEntry=finallyLoc&&new leap.FinallyEntry(finallyLoc);var tryEntry=new leap.TryEntry(self.getUnmarkedCurrentLoc(),catchEntry,finallyEntry);self.tryEntries.push(tryEntry);self.updateContextPrevLoc(tryEntry.firstLoc);self.leapManager.withEntry(tryEntry,function(){self.explodeStatement(path.get("block"));if(catchLoc){if(finallyLoc){self.jump(finallyLoc)}else{self.jump(after)}self.updateContextPrevLoc(self.mark(catchLoc));var bodyPath=path.get("handler","body");var safeParam=self.makeTempVar();self.clearPendingException(tryEntry.firstLoc,safeParam);var catchScope=bodyPath.scope;var catchParamName=handler.param.name;n.CatchClause.assert(catchScope.node);assert.strictEqual(catchScope.lookup(catchParamName),catchScope);types.visit(bodyPath,{visitIdentifier:function(path){if(util.isReference(path,catchParamName)&&path.scope.lookup(catchParamName)===catchScope){return safeParam}this.traverse(path)},visitFunction:function(path){if(path.scope.declares(catchParamName)){return false}this.traverse(path)}});self.leapManager.withEntry(catchEntry,function(){self.explodeStatement(bodyPath)})}if(finallyLoc){self.updateContextPrevLoc(self.mark(finallyLoc));self.leapManager.withEntry(finallyEntry,function(){self.explodeStatement(path.get("finalizer"))});self.emit(b.callExpression(self.contextProperty("finish"),[finallyEntry.firstLoc]))}});self.mark(after);break;case"ThrowStatement":self.emit(b.throwStatement(self.explodeExpression(path.get("argument"))));break;default:throw new Error("unknown Statement of type "+JSON.stringify(stmt.type))}};Ep.emitAbruptCompletion=function(record){if(!isValidCompletion(record)){assert.ok(false,"invalid completion record: "+JSON.stringify(record))}assert.notStrictEqual(record.type,"normal","normal completions are not abrupt");var abruptArgs=[b.literal(record.type)];if(record.type==="break"||record.type==="continue"){n.Literal.assert(record.target);abruptArgs[1]=record.target}else if(record.type==="return"||record.type==="throw"){if(record.value){n.Expression.assert(record.value);abruptArgs[1]=record.value}}this.emit(b.returnStatement(b.callExpression(this.contextProperty("abrupt"),abruptArgs)))};function isValidCompletion(record){var type=record.type;if(type==="normal"){return!hasOwn.call(record,"target")}if(type==="break"||type==="continue"){return!hasOwn.call(record,"value")&&n.Literal.check(record.target)}if(type==="return"||type==="throw"){return hasOwn.call(record,"value")&&!hasOwn.call(record,"target")}return false}Ep.getUnmarkedCurrentLoc=function(){return b.literal(this.listing.length)};Ep.updateContextPrevLoc=function(loc){if(loc){n.Literal.assert(loc);if(loc.value===-1){loc.value=this.listing.length}else{assert.strictEqual(loc.value,this.listing.length)}}else{loc=this.getUnmarkedCurrentLoc()}this.emitAssign(this.contextProperty("prev"),loc)};Ep.explodeExpression=function(path,ignoreResult){assert.ok(path instanceof types.NodePath);var expr=path.value;if(expr){n.Expression.assert(expr)}else{return expr}var self=this;var result;function finish(expr){n.Expression.assert(expr);if(ignoreResult){self.emit(expr)}else{return expr}}if(!meta.containsLeap(expr)){return finish(expr)}var hasLeapingChildren=meta.containsLeap.onlyChildren(expr);function explodeViaTempVar(tempVar,childPath,ignoreChildResult){assert.ok(childPath instanceof types.NodePath);assert.ok(!ignoreChildResult||!tempVar,"Ignoring the result of a child expression but forcing it to "+"be assigned to a temporary variable?");var result=self.explodeExpression(childPath,ignoreChildResult);if(ignoreChildResult){}else if(tempVar||hasLeapingChildren&&(self.isVolatileContextProperty(result)||meta.hasSideEffects(result))){result=self.emitAssign(tempVar||self.makeTempVar(),result)}return result}switch(expr.type){case"MemberExpression":return finish(b.memberExpression(self.explodeExpression(path.get("object")),expr.computed?explodeViaTempVar(null,path.get("property")):expr.property,expr.computed));case"CallExpression":var oldCalleePath=path.get("callee");var newCallee=self.explodeExpression(oldCalleePath);if(!n.MemberExpression.check(oldCalleePath.node)&&n.MemberExpression.check(newCallee)){newCallee=b.sequenceExpression([b.literal(0),newCallee])}return finish(b.callExpression(newCallee,path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"NewExpression":return finish(b.newExpression(explodeViaTempVar(null,path.get("callee")),path.get("arguments").map(function(argPath){return explodeViaTempVar(null,argPath)})));case"ObjectExpression":return finish(b.objectExpression(path.get("properties").map(function(propPath){return b.property(propPath.value.kind,propPath.value.key,explodeViaTempVar(null,propPath.get("value")))})));case"ArrayExpression":return finish(b.arrayExpression(path.get("elements").map(function(elemPath){return explodeViaTempVar(null,elemPath)})));case"SequenceExpression":var lastIndex=expr.expressions.length-1;path.get("expressions").each(function(exprPath){if(exprPath.name===lastIndex){result=self.explodeExpression(exprPath,ignoreResult)}else{self.explodeExpression(exprPath,true)}});return result;case"LogicalExpression":var after=loc();if(!ignoreResult){result=self.makeTempVar()}var left=explodeViaTempVar(result,path.get("left"));if(expr.operator==="&&"){self.jumpIfNot(left,after)}else{assert.strictEqual(expr.operator,"||");self.jumpIf(left,after)}explodeViaTempVar(result,path.get("right"),ignoreResult);self.mark(after);return result;case"ConditionalExpression":var elseLoc=loc();var after=loc();var test=self.explodeExpression(path.get("test"));self.jumpIfNot(test,elseLoc);if(!ignoreResult){result=self.makeTempVar()}explodeViaTempVar(result,path.get("consequent"),ignoreResult);self.jump(after);self.mark(elseLoc);explodeViaTempVar(result,path.get("alternate"),ignoreResult);self.mark(after);return result;case"UnaryExpression":return finish(b.unaryExpression(expr.operator,self.explodeExpression(path.get("argument")),!!expr.prefix));case"BinaryExpression":return finish(b.binaryExpression(expr.operator,explodeViaTempVar(null,path.get("left")),explodeViaTempVar(null,path.get("right"))));case"AssignmentExpression":return finish(b.assignmentExpression(expr.operator,self.explodeExpression(path.get("left")),self.explodeExpression(path.get("right"))));case"UpdateExpression":return finish(b.updateExpression(expr.operator,self.explodeExpression(path.get("argument")),expr.prefix));case"YieldExpression":var after=loc();var arg=expr.argument&&self.explodeExpression(path.get("argument"));if(arg&&expr.delegate){var result=self.makeTempVar();self.emit(b.returnStatement(b.callExpression(self.contextProperty("delegateYield"),[arg,b.literal(result.property.name),after])));self.mark(after);return result}self.emitAssign(self.contextProperty("next"),after);self.emit(b.returnStatement(arg||null));self.mark(after);return self.contextProperty("sent");default:throw new Error("unknown Expression of type "+JSON.stringify(expr.type))}}},{"./leap":168,"./meta":169,"./util":170,assert:121,"ast-types":119}],167:[function(require,module,exports){var assert=require("assert");var types=require("ast-types");var n=types.namedTypes;var b=types.builders;var hasOwn=Object.prototype.hasOwnProperty;exports.hoist=function(funPath){assert.ok(funPath instanceof types.NodePath);n.Function.assert(funPath.value);var vars={};function varDeclToExpr(vdec,includeIdentifiers){n.VariableDeclaration.assert(vdec);var exprs=[];vdec.declarations.forEach(function(dec){vars[dec.id.name]=dec.id;if(dec.init){exprs.push(b.assignmentExpression("=",dec.id,dec.init))}else if(includeIdentifiers){exprs.push(dec.id)}});if(exprs.length===0)return null;if(exprs.length===1)return exprs[0];return b.sequenceExpression(exprs)}types.visit(funPath.get("body"),{visitVariableDeclaration:function(path){var expr=varDeclToExpr(path.value,false);if(expr===null){path.replace()}else{return b.expressionStatement(expr)}return false},visitForStatement:function(path){var init=path.value.init;if(n.VariableDeclaration.check(init)){path.get("init").replace(varDeclToExpr(init,false))}this.traverse(path)},visitForInStatement:function(path){var left=path.value.left;if(n.VariableDeclaration.check(left)){path.get("left").replace(varDeclToExpr(left,true))}this.traverse(path)},visitFunctionDeclaration:function(path){var node=path.value;vars[node.id.name]=node.id;var parentNode=path.parent.node;var assignment=b.expressionStatement(b.assignmentExpression("=",node.id,b.functionExpression(node.id,node.params,node.body,node.generator,node.expression)));if(n.BlockStatement.check(path.parent.node)){path.parent.get("body").unshift(assignment);path.replace()}else{path.replace(assignment)}return false},visitFunctionExpression:function(path){return false}});var paramNames={};funPath.get("params").each(function(paramPath){var param=paramPath.value;if(n.Identifier.check(param)){paramNames[param.name]=param}else{}});var declarations=[];Object.keys(vars).forEach(function(name){if(!hasOwn.call(paramNames,name)){declarations.push(b.variableDeclarator(vars[name],null))}});if(declarations.length===0){return null}return b.variableDeclaration("var",declarations)}},{assert:121,"ast-types":119}],168:[function(require,module,exports){var assert=require("assert");var types=require("ast-types");var n=types.namedTypes;var b=types.builders;var inherits=require("util").inherits;var hasOwn=Object.prototype.hasOwnProperty;function Entry(){assert.ok(this instanceof Entry)}function FunctionEntry(returnLoc){Entry.call(this);n.Literal.assert(returnLoc);this.returnLoc=returnLoc}inherits(FunctionEntry,Entry);exports.FunctionEntry=FunctionEntry;function LoopEntry(breakLoc,continueLoc,label){Entry.call(this);n.Literal.assert(breakLoc);n.Literal.assert(continueLoc);if(label){n.Identifier.assert(label)}else{label=null}this.breakLoc=breakLoc;this.continueLoc=continueLoc;this.label=label}inherits(LoopEntry,Entry);exports.LoopEntry=LoopEntry;function SwitchEntry(breakLoc){Entry.call(this);n.Literal.assert(breakLoc);this.breakLoc=breakLoc}inherits(SwitchEntry,Entry);exports.SwitchEntry=SwitchEntry;function TryEntry(firstLoc,catchEntry,finallyEntry){Entry.call(this);n.Literal.assert(firstLoc);if(catchEntry){assert.ok(catchEntry instanceof CatchEntry)}else{catchEntry=null}if(finallyEntry){assert.ok(finallyEntry instanceof FinallyEntry)}else{finallyEntry=null}assert.ok(catchEntry||finallyEntry);this.firstLoc=firstLoc;this.catchEntry=catchEntry;this.finallyEntry=finallyEntry}inherits(TryEntry,Entry);exports.TryEntry=TryEntry;function CatchEntry(firstLoc,paramId){Entry.call(this);n.Literal.assert(firstLoc);n.Identifier.assert(paramId);this.firstLoc=firstLoc;this.paramId=paramId}inherits(CatchEntry,Entry);exports.CatchEntry=CatchEntry;function FinallyEntry(firstLoc){Entry.call(this);n.Literal.assert(firstLoc);this.firstLoc=firstLoc}inherits(FinallyEntry,Entry);exports.FinallyEntry=FinallyEntry;function LabeledEntry(breakLoc,label){Entry.call(this);n.Literal.assert(breakLoc);n.Identifier.assert(label);this.breakLoc=breakLoc;this.label=label}inherits(LabeledEntry,Entry);exports.LabeledEntry=LabeledEntry;function LeapManager(emitter){assert.ok(this instanceof LeapManager);var Emitter=require("./emit").Emitter;assert.ok(emitter instanceof Emitter);this.emitter=emitter;this.entryStack=[new FunctionEntry(emitter.finalLoc)]}var LMp=LeapManager.prototype;exports.LeapManager=LeapManager;LMp.withEntry=function(entry,callback){assert.ok(entry instanceof Entry);this.entryStack.push(entry);try{callback.call(this.emitter)}finally{var popped=this.entryStack.pop();assert.strictEqual(popped,entry)}};LMp._findLeapLocation=function(property,label){for(var i=this.entryStack.length-1;i>=0;--i){var entry=this.entryStack[i];var loc=entry[property];if(loc){if(label){if(entry.label&&entry.label.name===label.name){return loc}}else if(entry instanceof LabeledEntry){}else{return loc}}}return null};LMp.getBreakLoc=function(label){return this._findLeapLocation("breakLoc",label)};LMp.getContinueLoc=function(label){return this._findLeapLocation("continueLoc",label)}},{"./emit":166,assert:121,"ast-types":119,util:145}],169:[function(require,module,exports){var assert=require("assert");var m=require("private").makeAccessor();var types=require("ast-types");var isArray=types.builtInTypes.array;var n=types.namedTypes;var hasOwn=Object.prototype.hasOwnProperty;function makePredicate(propertyName,knownTypes){function onlyChildren(node){n.Node.assert(node);var result=false;function check(child){if(result){}else if(isArray.check(child)){child.some(check)}else if(n.Node.check(child)){assert.strictEqual(result,false);result=predicate(child)}return result}types.eachField(node,function(name,child){check(child)});return result}function predicate(node){n.Node.assert(node);var meta=m(node);if(hasOwn.call(meta,propertyName))return meta[propertyName];if(hasOwn.call(opaqueTypes,node.type))return meta[propertyName]=false;if(hasOwn.call(knownTypes,node.type))return meta[propertyName]=true;return meta[propertyName]=onlyChildren(node)}predicate.onlyChildren=onlyChildren;return predicate}var opaqueTypes={FunctionExpression:true};var sideEffectTypes={CallExpression:true,ForInStatement:true,UnaryExpression:true,BinaryExpression:true,AssignmentExpression:true,UpdateExpression:true,NewExpression:true};var leapTypes={YieldExpression:true,BreakStatement:true,ContinueStatement:true,ReturnStatement:true,ThrowStatement:true};for(var type in leapTypes){if(hasOwn.call(leapTypes,type)){sideEffectTypes[type]=leapTypes[type]}}exports.hasSideEffects=makePredicate("hasSideEffects",sideEffectTypes);exports.containsLeap=makePredicate("containsLeap",leapTypes)},{assert:121,"ast-types":119,"private":165}],170:[function(require,module,exports){var assert=require("assert");var types=require("ast-types");var n=types.namedTypes;var b=types.builders;var hasOwn=Object.prototype.hasOwnProperty;exports.defaults=function(obj){var len=arguments.length;var extension;for(var i=1;i<len;++i){if(extension=arguments[i]){for(var key in extension){if(hasOwn.call(extension,key)&&!hasOwn.call(obj,key)){obj[key]=extension[key]}}}}return obj};exports.runtimeProperty=function(name){return b.memberExpression(b.identifier("regeneratorRuntime"),b.identifier(name),false)};exports.isReference=function(path,name){var node=path.value;if(!n.Identifier.check(node)){return false}if(name&&node.name!==name){return false}var parent=path.parent.value;switch(parent.type){case"VariableDeclarator":return path.name==="init";case"MemberExpression":return path.name==="object"||parent.computed&&path.name==="property";case"FunctionExpression":case"FunctionDeclaration":case"ArrowFunctionExpression":if(path.name==="id"){return false}if(parent.params===path.parentPath&&parent.params[path.name]===node){return false}return true;case"ClassDeclaration":case"ClassExpression":return path.name!=="id";case"CatchClause":return path.name!=="param";case"Property":case"MethodDefinition":return path.name!=="key";case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"LabeledStatement":return false;default:return true}}},{assert:121,"ast-types":119}],171:[function(require,module,exports){var assert=require("assert");var fs=require("fs");var types=require("ast-types");var n=types.namedTypes;var b=types.builders;var isArray=types.builtInTypes.array;var isObject=types.builtInTypes.object;var NodePath=types.NodePath;var hoist=require("./hoist").hoist;var Emitter=require("./emit").Emitter;var runtimeProperty=require("./util").runtimeProperty;var runtimeWrapMethod=runtimeProperty("wrap");var runtimeMarkMethod=runtimeProperty("mark");var runtimeValuesMethod=runtimeProperty("values");var runtimeAsyncMethod=runtimeProperty("async");exports.transform=function transform(node,options){options=options||{};var path=node instanceof NodePath?node:new NodePath(node);visitor.visit(path,options);node=path.value;options.madeChanges=visitor.wasChangeReported();return node};var visitor=types.PathVisitor.fromMethodsObject({reset:function(node,options){this.options=options},visitFunction:function(path){this.traverse(path);var node=path.value;var shouldTransformAsync=node.async&&!this.options.disableAsync;if(!node.generator&&!shouldTransformAsync){return}this.reportChanged();node.generator=false;if(node.expression){node.expression=false;node.body=b.blockStatement([b.returnStatement(node.body)])}if(shouldTransformAsync){awaitVisitor.visit(path.get("body"))}var outerFnId=node.id||(node.id=path.scope.parent.declareTemporary("callee$"));var innerFnId=b.identifier(node.id.name+"$");var contextId=path.scope.declareTemporary("context$");var vars=hoist(path);var emitter=new Emitter(contextId);emitter.explode(path.get("body"));var outerBody=[];if(vars&&vars.declarations.length>0){outerBody.push(vars)}var wrapArgs=[emitter.getContextFunction(innerFnId),shouldTransformAsync?b.literal(null):outerFnId,b.thisExpression()];var tryEntryList=emitter.getTryEntryList();if(tryEntryList){wrapArgs.push(tryEntryList)}var wrapCall=b.callExpression(shouldTransformAsync?runtimeAsyncMethod:runtimeWrapMethod,wrapArgs);outerBody.push(b.returnStatement(wrapCall));node.body=b.blockStatement(outerBody);if(shouldTransformAsync){node.async=false;return}if(n.FunctionDeclaration.check(node)){var pp=path.parent;while(pp&&!(n.BlockStatement.check(pp.value)||n.Program.check(pp.value))){pp=pp.parent}if(!pp){return}path.replace();node.type="FunctionExpression";var varDecl=b.variableDeclaration("var",[b.variableDeclarator(node.id,b.callExpression(runtimeMarkMethod,[node]))]);if(node.comments){varDecl.leadingComments=node.leadingComments;varDecl.trailingComments=node.trailingComments;node.leadingComments=null;node.trailingComments=null}varDecl._blockHoist=3;var bodyPath=pp.get("body");var bodyLen=bodyPath.value.length;bodyPath.push(varDecl)}else{n.FunctionExpression.assert(node);return b.callExpression(runtimeMarkMethod,[node])}}});function shouldNotHoistAbove(stmtPath){var value=stmtPath.value;n.Statement.assert(value);if(n.ExpressionStatement.check(value)&&n.Literal.check(value.expression)&&value.expression.value==="use strict"){return true}if(n.VariableDeclaration.check(value)){for(var i=0;i<value.declarations.length;++i){var decl=value.declarations[i];if(n.CallExpression.check(decl.init)&&types.astNodesAreEquivalent(decl.init.callee,runtimeMarkMethod)){return true}}}return false}var awaitVisitor=types.PathVisitor.fromMethodsObject({visitFunction:function(path){return false},visitAwaitExpression:function(path){return b.yieldExpression(path.value.argument,false)}})},{"./emit":166,"./hoist":167,"./util":170,assert:121,"ast-types":119,fs:120}],172:[function(require,module,exports){(function(__dirname){var assert=require("assert");var path=require("path");var fs=require("fs");var through=require("through");var transform=require("./lib/visit").transform;var utils=require("./lib/util");var types=require("ast-types");var genOrAsyncFunExp=/\bfunction\s*\*|\basync\b/;var blockBindingExp=/\b(let|const)\s+/;function exports(file,options){var data=[];return through(write,end);function write(buf){data.push(buf)}function end(){this.queue(compile(data.join(""),options).code);this.queue(null)}}module.exports=exports;function runtime(){require("./runtime")}exports.runtime=runtime;runtime.path=path.join(__dirname,"runtime.js");exports.transform=transform}).call(this,"/node_modules/regenerator-6to5")},{"./lib/util":170,"./lib/visit":171,"./runtime":174,assert:121,"ast-types":119,fs:120,path:129,through:173}],173:[function(require,module,exports){(function(process){var Stream=require("stream");exports=module.exports=through;through.through=through;function through(write,end,opts){write=write||function(data){this.queue(data)};end=end||function(){this.queue(null)};var ended=false,destroyed=false,buffer=[],_ended=false;var stream=new Stream;stream.readable=stream.writable=true;stream.paused=false;stream.autoDestroy=!(opts&&opts.autoDestroy===false);stream.write=function(data){write.call(this,data);return!stream.paused};function drain(){while(buffer.length&&!stream.paused){var data=buffer.shift();if(null===data)return stream.emit("end");else stream.emit("data",data)}}stream.queue=stream.push=function(data){if(_ended)return stream;if(data==null)_ended=true;buffer.push(data);drain();return stream};stream.on("end",function(){stream.readable=false;if(!stream.writable&&stream.autoDestroy)process.nextTick(function(){stream.destroy()})});function _end(){stream.writable=false;end.call(stream);if(!stream.readable&&stream.autoDestroy)stream.destroy()}stream.end=function(data){if(ended)return;ended=true;if(arguments.length)stream.write(data);_end();return stream};stream.destroy=function(){if(destroyed)return;destroyed=true;ended=true;buffer.length=0;stream.writable=stream.readable=false;stream.emit("close");return stream};stream.pause=function(){if(stream.paused)return;stream.paused=true;return stream};stream.resume=function(){if(stream.paused){stream.paused=false;stream.emit("resume")}drain();if(!stream.paused)stream.emit("drain");return stream};return stream}}).call(this,require("_process"))},{_process:130,stream:142}],174:[function(require,module,exports){(function(global){!function(global){"use strict";var hasOwn=Object.prototype.hasOwnProperty;var undefined;var iteratorSymbol=typeof Symbol==="function"&&Symbol.iterator||"@@iterator";var inModule=typeof module==="object";var runtime=global.regeneratorRuntime;if(runtime){if(inModule){module.exports=runtime}return}runtime=global.regeneratorRuntime=inModule?module.exports:{};function wrap(innerFn,outerFn,self,tryList){return new Generator(innerFn,outerFn,self||null,tryList||[])}runtime.wrap=wrap;function tryCatch(fn,obj,arg){try{return{type:"normal",arg:fn.call(obj,arg)}}catch(err){return{type:"throw",arg:err}}}var GenStateSuspendedStart="suspendedStart";var GenStateSuspendedYield="suspendedYield";var GenStateExecuting="executing";var GenStateCompleted="completed";var ContinueSentinel={};function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var Gp=GeneratorFunctionPrototype.prototype=Generator.prototype;GeneratorFunction.prototype=Gp.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunction.displayName="GeneratorFunction";runtime.isGeneratorFunction=function(genFun){var ctor=typeof genFun==="function"&&genFun.constructor;return ctor?ctor===GeneratorFunction||(ctor.displayName||ctor.name)==="GeneratorFunction":false};runtime.mark=function(genFun){genFun.__proto__=GeneratorFunctionPrototype;genFun.prototype=Object.create(Gp);return genFun};runtime.async=function(innerFn,outerFn,self,tryList){return new Promise(function(resolve,reject){var generator=wrap(innerFn,outerFn,self,tryList);var callNext=step.bind(generator.next);var callThrow=step.bind(generator["throw"]);function step(arg){var record=tryCatch(this,null,arg);if(record.type==="throw"){reject(record.arg);return}var info=record.arg;if(info.done){resolve(info.value)}else{Promise.resolve(info.value).then(callNext,callThrow)}}callNext()})};function Generator(innerFn,outerFn,self,tryList){var generator=outerFn?Object.create(outerFn.prototype):this;var context=new Context(tryList);var state=GenStateSuspendedStart;function invoke(method,arg){if(state===GenStateExecuting){throw new Error("Generator is already running")}if(state===GenStateCompleted){return doneResult()
}while(true){var delegate=context.delegate;if(delegate){var record=tryCatch(delegate.iterator[method],delegate.iterator,arg);if(record.type==="throw"){context.delegate=null;method="throw";arg=record.arg;continue}method="next";arg=undefined;var info=record.arg;if(info.done){context[delegate.resultName]=info.value;context.next=delegate.nextLoc}else{state=GenStateSuspendedYield;return info}context.delegate=null}if(method==="next"){if(state===GenStateSuspendedStart&&typeof arg!=="undefined"){throw new TypeError("attempt to send "+JSON.stringify(arg)+" to newborn generator")}if(state===GenStateSuspendedYield){context.sent=arg}else{delete context.sent}}else if(method==="throw"){if(state===GenStateSuspendedStart){state=GenStateCompleted;throw arg}if(context.dispatchException(arg)){method="next";arg=undefined}}else if(method==="return"){context.abrupt("return",arg)}state=GenStateExecuting;var record=tryCatch(innerFn,self,context);if(record.type==="normal"){state=context.done?GenStateCompleted:GenStateSuspendedYield;var info={value:record.arg,done:context.done};if(record.arg===ContinueSentinel){if(context.delegate&&method==="next"){arg=undefined}}else{return info}}else if(record.type==="throw"){state=GenStateCompleted;if(method==="next"){context.dispatchException(record.arg)}else{arg=record.arg}}}}generator.next=invoke.bind(generator,"next");generator["throw"]=invoke.bind(generator,"throw");generator["return"]=invoke.bind(generator,"return");return generator}Gp[iteratorSymbol]=function(){return this};Gp.toString=function(){return"[object Generator]"};function pushTryEntry(triple){var entry={tryLoc:triple[0]};if(1 in triple){entry.catchLoc=triple[1]}if(2 in triple){entry.finallyLoc=triple[2]}this.tryEntries.push(entry)}function resetTryEntry(entry,i){var record=entry.completion||{};record.type=i===0?"normal":"return";delete record.arg;entry.completion=record}function Context(tryList){this.tryEntries=[{tryLoc:"root"}];tryList.forEach(pushTryEntry,this);this.reset()}runtime.keys=function(object){var keys=[];for(var key in object){keys.push(key)}keys.reverse();return function next(){while(keys.length){var key=keys.pop();if(key in object){next.value=key;next.done=false;return next}}next.done=true;return next}};function values(iterable){if(iterable){var iteratorMethod=iterable[iteratorSymbol];if(iteratorMethod){return iteratorMethod.call(iterable)}if(typeof iterable.next==="function"){return iterable}if(!isNaN(iterable.length)){var i=-1,next=function next(){while(++i<iterable.length){if(hasOwn.call(iterable,i)){next.value=iterable[i];next.done=false;return next}}next.value=undefined;next.done=true;return next};return next.next=next}}return{next:doneResult}}runtime.values=values;function doneResult(){return{value:undefined,done:true}}Context.prototype={constructor:Context,reset:function(){this.prev=0;this.next=0;this.sent=undefined;this.done=false;this.delegate=null;this.tryEntries.forEach(resetTryEntry);for(var tempIndex=0,tempName;hasOwn.call(this,tempName="t"+tempIndex)||tempIndex<20;++tempIndex){this[tempName]=null}},stop:function(){this.done=true;var rootEntry=this.tryEntries[0];var rootRecord=rootEntry.completion;if(rootRecord.type==="throw"){throw rootRecord.arg}return this.rval},dispatchException:function(exception){if(this.done){throw exception}var context=this;function handle(loc,caught){record.type="throw";record.arg=exception;context.next=loc;return!!caught}for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];var record=entry.completion;if(entry.tryLoc==="root"){return handle("end")}if(entry.tryLoc<=this.prev){var hasCatch=hasOwn.call(entry,"catchLoc");var hasFinally=hasOwn.call(entry,"finallyLoc");if(hasCatch&&hasFinally){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}else if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else if(hasCatch){if(this.prev<entry.catchLoc){return handle(entry.catchLoc,true)}}else if(hasFinally){if(this.prev<entry.finallyLoc){return handle(entry.finallyLoc)}}else{throw new Error("try statement without catch or finally")}}}},_findFinallyEntry:function(finallyLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc<=this.prev&&hasOwn.call(entry,"finallyLoc")&&(entry.finallyLoc===finallyLoc||this.prev<entry.finallyLoc)){return entry}}},abrupt:function(type,arg){var entry=this._findFinallyEntry();var record=entry?entry.completion:{};record.type=type;record.arg=arg;if(entry){this.next=entry.finallyLoc}else{this.complete(record)}return ContinueSentinel},complete:function(record){if(record.type==="throw"){throw record.arg}if(record.type==="break"||record.type==="continue"){this.next=record.arg}else if(record.type==="return"){this.rval=record.arg;this.next="end"}return ContinueSentinel},finish:function(finallyLoc){var entry=this._findFinallyEntry(finallyLoc);return this.complete(entry.completion)},"catch":function(tryLoc){for(var i=this.tryEntries.length-1;i>=0;--i){var entry=this.tryEntries[i];if(entry.tryLoc===tryLoc){var record=entry.completion;if(record.type==="throw"){var thrown=record.arg;resetTryEntry(entry,i)}return thrown}}throw new Error("illegal catch attempt")},delegateYield:function(iterable,resultName,nextLoc){this.delegate={iterator:values(iterable),resultName:resultName,nextLoc:nextLoc};return ContinueSentinel}}}(typeof global==="object"?global:typeof window==="object"?window:this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],175:[function(require,module,exports){var regenerate=require("regenerate");exports.REGULAR={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,65535),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,65535),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,65535)};exports.UNICODE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)};exports.UNICODE_IGNORE_CASE={d:regenerate().addRange(48,57),D:regenerate().addRange(0,47).addRange(58,1114111),s:regenerate(32,160,5760,6158,8239,8287,12288,65279).addRange(9,13).addRange(8192,8202).addRange(8232,8233),S:regenerate().addRange(0,8).addRange(14,31).addRange(33,159).addRange(161,5759).addRange(5761,6157).addRange(6159,8191).addRange(8203,8231).addRange(8234,8238).addRange(8240,8286).addRange(8288,12287).addRange(12289,65278).addRange(65280,1114111),w:regenerate(95,383,8490).addRange(48,57).addRange(65,90).addRange(97,122),W:regenerate(75,83,96).addRange(0,47).addRange(58,64).addRange(91,94).addRange(123,1114111)}},{regenerate:177}],176:[function(require,module,exports){module.exports={75:8490,83:383,107:8490,115:383,181:924,197:8491,383:83,452:453,453:452,455:456,456:455,458:459,459:458,497:498,498:497,837:8126,914:976,917:1013,920:1012,921:8126,922:1008,924:181,928:982,929:1009,931:962,934:981,937:8486,962:931,976:914,977:1012,981:934,982:928,1008:922,1009:929,1012:[920,977],1013:917,7776:7835,7835:7776,8126:[837,921],8486:937,8490:75,8491:197,66560:66600,66561:66601,66562:66602,66563:66603,66564:66604,66565:66605,66566:66606,66567:66607,66568:66608,66569:66609,66570:66610,66571:66611,66572:66612,66573:66613,66574:66614,66575:66615,66576:66616,66577:66617,66578:66618,66579:66619,66580:66620,66581:66621,66582:66622,66583:66623,66584:66624,66585:66625,66586:66626,66587:66627,66588:66628,66589:66629,66590:66630,66591:66631,66592:66632,66593:66633,66594:66634,66595:66635,66596:66636,66597:66637,66598:66638,66599:66639,66600:66560,66601:66561,66602:66562,66603:66563,66604:66564,66605:66565,66606:66566,66607:66567,66608:66568,66609:66569,66610:66570,66611:66571,66612:66572,66613:66573,66614:66574,66615:66575,66616:66576,66617:66577,66618:66578,66619:66579,66620:66580,66621:66581,66622:66582,66623:66583,66624:66584,66625:66585,66626:66586,66627:66587,66628:66588,66629:66589,66630:66590,66631:66591,66632:66592,66633:66593,66634:66594,66635:66595,66636:66596,66637:66597,66638:66598,66639:66599,71840:71872,71841:71873,71842:71874,71843:71875,71844:71876,71845:71877,71846:71878,71847:71879,71848:71880,71849:71881,71850:71882,71851:71883,71852:71884,71853:71885,71854:71886,71855:71887,71856:71888,71857:71889,71858:71890,71859:71891,71860:71892,71861:71893,71862:71894,71863:71895,71864:71896,71865:71897,71866:71898,71867:71899,71868:71900,71869:71901,71870:71902,71871:71903,71872:71840,71873:71841,71874:71842,71875:71843,71876:71844,71877:71845,71878:71846,71879:71847,71880:71848,71881:71849,71882:71850,71883:71851,71884:71852,71885:71853,71886:71854,71887:71855,71888:71856,71889:71857,71890:71858,71891:71859,71892:71860,71893:71861,71894:71862,71895:71863,71896:71864,71897:71865,71898:71866,71899:71867,71900:71868,71901:71869,71902:71870,71903:71871}},{}],177:[function(require,module,exports){(function(global){(function(root){var freeExports=typeof exports=="object"&&exports;var freeModule=typeof module=="object"&&module&&module.exports==freeExports&&module;var freeGlobal=typeof global=="object"&&global;if(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal){root=freeGlobal}var ERRORS={rangeOrder:"A range’s `stop` value must be greater than or equal "+"to the `start` value.",codePointRange:"Invalid code point value. Code points range from "+"U+000000 to U+10FFFF."};var HIGH_SURROGATE_MIN=55296;var HIGH_SURROGATE_MAX=56319;var LOW_SURROGATE_MIN=56320;var LOW_SURROGATE_MAX=57343;var regexNull=/\\x00([^0123456789]|$)/g;var object={};var hasOwnProperty=object.hasOwnProperty;var extend=function(destination,source){var key;for(key in source){if(hasOwnProperty.call(source,key)){destination[key]=source[key]}}return destination};var forEach=function(array,callback){var index=-1;var length=array.length;while(++index<length){callback(array[index],index)}};var toString=object.toString;var isArray=function(value){return toString.call(value)=="[object Array]"};var isNumber=function(value){return typeof value=="number"||toString.call(value)=="[object Number]"};var zeroes="0000";var pad=function(number,totalCharacters){var string=String(number);return string.length<totalCharacters?(zeroes+string).slice(-totalCharacters):string};var hex=function(number){return Number(number).toString(16).toUpperCase()};var slice=[].slice;var dataFromCodePoints=function(codePoints){var index=-1;var length=codePoints.length;var max=length-1;var result=[];var isStart=true;var tmp;var previous=0;while(++index<length){tmp=codePoints[index];if(isStart){result.push(tmp);previous=tmp;isStart=false}else{if(tmp==previous+1){if(index!=max){previous=tmp;continue}else{isStart=true;result.push(tmp+1)}}else{result.push(previous+1,tmp);previous=tmp}}}if(!isStart){result.push(tmp+1)}return result};var dataRemove=function(data,codePoint){var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){if(codePoint==start){if(end==start+1){data.splice(index,2);return data}else{data[index]=codePoint+1;return data}}else if(codePoint==end-1){data[index+1]=codePoint;return data}else{data.splice(index,2,start,codePoint,codePoint+1,end);return data}}index+=2}return data};var dataRemoveRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}var index=0;var start;var end;while(index<data.length){start=data[index];end=data[index+1]-1;if(start>rangeEnd){return data}if(rangeStart<=start&&rangeEnd>=end){data.splice(index,2);continue}if(rangeStart>=start&&rangeEnd<end){if(rangeStart==start){data[index]=rangeEnd+1;data[index+1]=end+1;return data}data.splice(index,2,start,rangeStart,rangeEnd+1,end+1);return data}if(rangeStart>=start&&rangeStart<=end){data[index+1]=rangeStart}else if(rangeEnd>=start&&rangeEnd<=end){data[index]=rangeEnd+1;return data}index+=2}return data};var dataAdd=function(data,codePoint){var index=0;var start;var end;var lastIndex=null;var length=data.length;if(codePoint<0||codePoint>1114111){throw RangeError(ERRORS.codePointRange)}while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return data}if(codePoint==start-1){data[index]=codePoint;return data}if(start>codePoint){data.splice(lastIndex!=null?lastIndex+2:0,0,codePoint,codePoint+1);return data}if(codePoint==end){if(codePoint+1==data[index+2]){data.splice(index,4,start,data[index+3]);return data}data[index+1]=codePoint+1;return data}lastIndex=index;index+=2}data.push(codePoint,codePoint+1);return data};var dataAddData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataAdd(data,start)}else{data=dataAddRange(data,start,end)}index+=2}return data};var dataRemoveData=function(dataA,dataB){var index=0;var start;var end;var data=dataA.slice();var length=dataB.length;while(index<length){start=dataB[index];end=dataB[index+1]-1;if(start==end){data=dataRemove(data,start)}else{data=dataRemoveRange(data,start,end)}index+=2}return data};var dataAddRange=function(data,rangeStart,rangeEnd){if(rangeEnd<rangeStart){throw Error(ERRORS.rangeOrder)}if(rangeStart<0||rangeStart>1114111||rangeEnd<0||rangeEnd>1114111){throw RangeError(ERRORS.codePointRange)}var index=0;var start;var end;var added=false;var length=data.length;while(index<length){start=data[index];end=data[index+1];if(added){if(start==rangeEnd+1){data.splice(index-1,2);return data}if(start>rangeEnd){return data}if(start>=rangeStart&&start<=rangeEnd){if(end>rangeStart&&end-1<=rangeEnd){data.splice(index,2);index-=2}else{data.splice(index-1,2);index-=2}}}else if(start==rangeEnd+1){data[index]=rangeStart;return data}else if(start>rangeEnd){data.splice(index,0,rangeStart,rangeEnd+1);return data}else if(rangeStart>=start&&rangeStart<end&&rangeEnd+1<=end){return data}else if(rangeStart>=start&&rangeStart<end||end==rangeStart){data[index+1]=rangeEnd+1;added=true}else if(rangeStart<=start&&rangeEnd+1>=end){data[index]=rangeStart;data[index+1]=rangeEnd+1;added=true}index+=2}if(!added){data.push(rangeStart,rangeEnd+1)}return data};var dataContains=function(data,codePoint){var index=0;var length=data.length;var start=data[index];var end=data[length-1];if(length>=2){if(codePoint<start||codePoint>end){return false}}while(index<length){start=data[index];end=data[index+1];if(codePoint>=start&&codePoint<end){return true}index+=2}return false};var dataIntersection=function(data,codePoints){var index=0;var length=codePoints.length;var codePoint;var result=[];while(index<length){codePoint=codePoints[index];if(dataContains(data,codePoint)){result.push(codePoint)}++index}return dataFromCodePoints(result)};var dataIsEmpty=function(data){return!data.length};var dataIsSingleton=function(data){return data.length==2&&data[0]+1==data[1]};var dataToArray=function(data){var index=0;var start;var end;var result=[];var length=data.length;while(index<length){start=data[index];end=data[index+1];while(start<end){result.push(start);++start}index+=2}return result};var floor=Math.floor;var highSurrogate=function(codePoint){return parseInt(floor((codePoint-65536)/1024)+HIGH_SURROGATE_MIN,10)};var lowSurrogate=function(codePoint){return parseInt((codePoint-65536)%1024+LOW_SURROGATE_MIN,10)};var stringFromCharCode=String.fromCharCode;var codePointToString=function(codePoint){var string;if(codePoint==9){string="\\t"}else if(codePoint==10){string="\\n"}else if(codePoint==12){string="\\f"}else if(codePoint==13){string="\\r"}else if(codePoint==92){string="\\\\"}else if(codePoint==36||codePoint>=40&&codePoint<=43||codePoint==45||codePoint==46||codePoint==63||codePoint>=91&&codePoint<=94||codePoint>=123&&codePoint<=125){string="\\"+stringFromCharCode(codePoint)}else if(codePoint>=32&&codePoint<=126){string=stringFromCharCode(codePoint)}else if(codePoint<=255){string="\\x"+pad(hex(codePoint),2)}else{string="\\u"+pad(hex(codePoint),4)}return string};var symbolToCodePoint=function(symbol){var length=symbol.length;var first=symbol.charCodeAt(0);var second;if(first>=HIGH_SURROGATE_MIN&&first<=HIGH_SURROGATE_MAX&&length>1){second=symbol.charCodeAt(1);return(first-HIGH_SURROGATE_MIN)*1024+second-LOW_SURROGATE_MIN+65536}return first};var createBMPCharacterClasses=function(data){var result="";var index=0;var start;var end;var length=data.length;if(dataIsSingleton(data)){return codePointToString(data[0])}while(index<length){start=data[index];end=data[index+1]-1;if(start==end){result+=codePointToString(start)}else if(start+1==end){result+=codePointToString(start)+codePointToString(end)}else{result+=codePointToString(start)+"-"+codePointToString(end)}index+=2}return"["+result+"]"};var splitAtBMP=function(data){var loneHighSurrogates=[];var loneLowSurrogates=[];var bmp=[];var astral=[];var index=0;var start;var end;var length=data.length;while(index<length){start=data[index];end=data[index+1]-1;if(start<HIGH_SURROGATE_MIN){if(end<HIGH_SURROGATE_MIN){bmp.push(start,end+1)}if(end>=HIGH_SURROGATE_MIN&&end<=HIGH_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN);loneHighSurrogates.push(HIGH_SURROGATE_MIN,end+1)}if(end>=LOW_SURROGATE_MIN&&end<=LOW_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1);loneLowSurrogates.push(LOW_SURROGATE_MIN,end+1)}if(end>LOW_SURROGATE_MAX){bmp.push(start,HIGH_SURROGATE_MIN);loneHighSurrogates.push(HIGH_SURROGATE_MIN,HIGH_SURROGATE_MAX+1);loneLowSurrogates.push(LOW_SURROGATE_MIN,LOW_SURROGATE_MAX+1);if(end<=65535){bmp.push(LOW_SURROGATE_MAX+1,end+1)}else{bmp.push(LOW_SURROGATE_MAX+1,65535+1);astral.push(65535+1,end+1)}}}else if(start>=HIGH_SURROGATE_MIN&&start<=HIGH_SURROGATE_MAX){if(end>=HIGH_SURROGATE_MIN&&end<=HIGH_SURROGATE_MAX){loneHighSurrogates.push(start,end+1)}if(end>=LOW_SURROGATE_MIN&&end<=LOW_SURROGATE_MAX){loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);loneLowSurrogates.push(LOW_SURROGATE_MIN,end+1)}if(end>LOW_SURROGATE_MAX){loneHighSurrogates.push(start,HIGH_SURROGATE_MAX+1);loneLowSurrogates.push(LOW_SURROGATE_MIN,LOW_SURROGATE_MAX+1);if(end<=65535){bmp.push(LOW_SURROGATE_MAX+1,end+1)}else{bmp.push(LOW_SURROGATE_MAX+1,65535+1);astral.push(65535+1,end+1)}}}else if(start>=LOW_SURROGATE_MIN&&start<=LOW_SURROGATE_MAX){if(end>=LOW_SURROGATE_MIN&&end<=LOW_SURROGATE_MAX){loneLowSurrogates.push(start,end+1)}if(end>LOW_SURROGATE_MAX){loneLowSurrogates.push(start,LOW_SURROGATE_MAX+1);if(end<=65535){bmp.push(LOW_SURROGATE_MAX+1,end+1)}else{bmp.push(LOW_SURROGATE_MAX+1,65535+1);astral.push(65535+1,end+1)}}}else if(start>LOW_SURROGATE_MAX&&start<=65535){if(end<=65535){bmp.push(start,end+1)}else{bmp.push(start,65535+1);astral.push(65535+1,end+1)}}else{astral.push(start,end+1)}index+=2}return{loneHighSurrogates:loneHighSurrogates,loneLowSurrogates:loneLowSurrogates,bmp:bmp,astral:astral}};var optimizeSurrogateMappings=function(surrogateMappings){var result=[];var tmpLow=[];var addLow=false;var mapping;var nextMapping;var highSurrogates;var lowSurrogates;var nextHighSurrogates;var nextLowSurrogates;var index=-1;var length=surrogateMappings.length;while(++index<length){mapping=surrogateMappings[index];nextMapping=surrogateMappings[index+1];if(!nextMapping){result.push(mapping);continue}highSurrogates=mapping[0];lowSurrogates=mapping[1];nextHighSurrogates=nextMapping[0];nextLowSurrogates=nextMapping[1];tmpLow=lowSurrogates;while(nextHighSurrogates&&highSurrogates[0]==nextHighSurrogates[0]&&highSurrogates[1]==nextHighSurrogates[1]){if(dataIsSingleton(nextLowSurrogates)){tmpLow=dataAdd(tmpLow,nextLowSurrogates[0])}else{tmpLow=dataAddRange(tmpLow,nextLowSurrogates[0],nextLowSurrogates[1]-1)}++index;mapping=surrogateMappings[index];highSurrogates=mapping[0];lowSurrogates=mapping[1];nextMapping=surrogateMappings[index+1];nextHighSurrogates=nextMapping&&nextMapping[0];nextLowSurrogates=nextMapping&&nextMapping[1];addLow=true}result.push([highSurrogates,addLow?tmpLow:lowSurrogates]);addLow=false}return optimizeByLowSurrogates(result)};var optimizeByLowSurrogates=function(surrogateMappings){if(surrogateMappings.length==1){return surrogateMappings}var index=-1;var innerIndex=-1;while(++index<surrogateMappings.length){var mapping=surrogateMappings[index];var lowSurrogates=mapping[1];var lowSurrogateStart=lowSurrogates[0];var lowSurrogateEnd=lowSurrogates[1];innerIndex=index;while(++innerIndex<surrogateMappings.length){var otherMapping=surrogateMappings[innerIndex];var otherLowSurrogates=otherMapping[1];var otherLowSurrogateStart=otherLowSurrogates[0];var otherLowSurrogateEnd=otherLowSurrogates[1];if(lowSurrogateStart==otherLowSurrogateStart&&lowSurrogateEnd==otherLowSurrogateEnd){if(dataIsSingleton(otherMapping[0])){mapping[0]=dataAdd(mapping[0],otherMapping[0][0])}else{mapping[0]=dataAddRange(mapping[0],otherMapping[0][0],otherMapping[0][1]-1)}surrogateMappings.splice(innerIndex,1);--innerIndex}}}return surrogateMappings};var surrogateSet=function(data){if(!data.length){return[]}var index=0;var start;var end;var startHigh;var startLow;var prevStartHigh=0;var prevEndHigh=0;var tmpLow=[];var endHigh;var endLow;var surrogateMappings=[];var length=data.length;var dataHigh=[];while(index<length){start=data[index];end=data[index+1]-1;startHigh=highSurrogate(start);startLow=lowSurrogate(start);endHigh=highSurrogate(end);endLow=lowSurrogate(end);var startsWithLowestLowSurrogate=startLow==LOW_SURROGATE_MIN;var endsWithHighestLowSurrogate=endLow==LOW_SURROGATE_MAX;var complete=false;if(startHigh==endHigh||startsWithLowestLowSurrogate&&endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh,endHigh+1],[startLow,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh,startHigh+1],[startLow,LOW_SURROGATE_MAX+1]])}if(!complete&&startHigh+1<endHigh){if(endsWithHighestLowSurrogate){surrogateMappings.push([[startHigh+1,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]]);complete=true}else{surrogateMappings.push([[startHigh+1,endHigh],[LOW_SURROGATE_MIN,LOW_SURROGATE_MAX+1]])}}if(!complete){surrogateMappings.push([[endHigh,endHigh+1],[LOW_SURROGATE_MIN,endLow+1]])}prevStartHigh=startHigh;prevEndHigh=endHigh;index+=2}return optimizeSurrogateMappings(surrogateMappings)};var createSurrogateCharacterClasses=function(surrogateMappings){var result=[];forEach(surrogateMappings,function(surrogateMapping){var highSurrogates=surrogateMapping[0];var lowSurrogates=surrogateMapping[1];result.push(createBMPCharacterClasses(highSurrogates)+createBMPCharacterClasses(lowSurrogates))});return result.join("|")};var createCharacterClassesFromData=function(data,bmpOnly){var result=[];var parts=splitAtBMP(data);var loneHighSurrogates=parts.loneHighSurrogates;var loneLowSurrogates=parts.loneLowSurrogates;var bmp=parts.bmp;var astral=parts.astral;var hasAstral=!dataIsEmpty(parts.astral);var hasLoneHighSurrogates=!dataIsEmpty(loneHighSurrogates);var hasLoneLowSurrogates=!dataIsEmpty(loneLowSurrogates);var surrogateMappings=surrogateSet(astral);if(bmpOnly){bmp=dataAddData(bmp,loneHighSurrogates);hasLoneHighSurrogates=false;bmp=dataAddData(bmp,loneLowSurrogates);hasLoneLowSurrogates=false}if(!dataIsEmpty(bmp)){result.push(createBMPCharacterClasses(bmp))}if(surrogateMappings.length){result.push(createSurrogateCharacterClasses(surrogateMappings))}if(hasLoneHighSurrogates){result.push(createBMPCharacterClasses(loneHighSurrogates)+"(?![\\uDC00-\\uDFFF])")}if(hasLoneLowSurrogates){result.push("(?:[^\\uD800-\\uDBFF]|^)"+createBMPCharacterClasses(loneLowSurrogates))}return result.join("|")};var regenerate=function(value){if(arguments.length>1){value=slice.call(arguments)}if(this instanceof regenerate){this.data=[];return value?this.add(value):this}return(new regenerate).add(value)};regenerate.version="1.2.0";var proto=regenerate.prototype;extend(proto,{add:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataAddData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.add(item)});return $this}$this.data=dataAdd($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},remove:function(value){var $this=this;if(value==null){return $this}if(value instanceof regenerate){$this.data=dataRemoveData($this.data,value.data);return $this}if(arguments.length>1){value=slice.call(arguments)}if(isArray(value)){forEach(value,function(item){$this.remove(item)});return $this}$this.data=dataRemove($this.data,isNumber(value)?value:symbolToCodePoint(value));return $this},addRange:function(start,end){var $this=this;$this.data=dataAddRange($this.data,isNumber(start)?start:symbolToCodePoint(start),isNumber(end)?end:symbolToCodePoint(end));return $this},removeRange:function(start,end){var $this=this;var startCodePoint=isNumber(start)?start:symbolToCodePoint(start);var endCodePoint=isNumber(end)?end:symbolToCodePoint(end);$this.data=dataRemoveRange($this.data,startCodePoint,endCodePoint);return $this},intersection:function(argument){var $this=this;var array=argument instanceof regenerate?dataToArray(argument.data):argument;$this.data=dataIntersection($this.data,array);return $this},contains:function(codePoint){return dataContains(this.data,isNumber(codePoint)?codePoint:symbolToCodePoint(codePoint))},clone:function(){var set=new regenerate;set.data=this.data.slice(0);return set},toString:function(options){var result=createCharacterClassesFromData(this.data,options?options.bmpOnly:false);return result.replace(regexNull,"\\0$1")},toRegExp:function(flags){return RegExp(this.toString(),flags||"")},valueOf:function(){return dataToArray(this.data)}});proto.toArray=proto.valueOf;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return regenerate})}else if(freeExports&&!freeExports.nodeType){if(freeModule){freeModule.exports=regenerate}else{freeExports.regenerate=regenerate}}else{root.regenerate=regenerate}})(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],178:[function(require,module,exports){(function(global){(function(){"use strict";var objectTypes={"function":true,object:true};var root=objectTypes[typeof window]&&window||this;var oldRoot=root;var freeExports=objectTypes[typeof exports]&&exports;var freeModule=objectTypes[typeof module]&&module&&!module.nodeType&&module;var freeGlobal=freeExports&&freeModule&&typeof global=="object"&&global;if(freeGlobal&&(freeGlobal.global===freeGlobal||freeGlobal.window===freeGlobal||freeGlobal.self===freeGlobal)){root=freeGlobal}var stringFromCharCode=String.fromCharCode;var floor=Math.floor;function fromCodePoint(){var MAX_SIZE=16384;var codeUnits=[];var highSurrogate;var lowSurrogate;var index=-1;var length=arguments.length;if(!length){return""}var result="";while(++index<length){var codePoint=Number(arguments[index]);if(!isFinite(codePoint)||codePoint<0||codePoint>1114111||floor(codePoint)!=codePoint){throw RangeError("Invalid code point: "+codePoint)}if(codePoint<=65535){codeUnits.push(codePoint)}else{codePoint-=65536;highSurrogate=(codePoint>>10)+55296;lowSurrogate=codePoint%1024+56320;codeUnits.push(highSurrogate,lowSurrogate)}if(index+1==length||codeUnits.length>MAX_SIZE){result+=stringFromCharCode.apply(null,codeUnits);codeUnits.length=0}}return result}function assertType(type,expected){if(expected.indexOf("|")==-1){if(type==expected){return}throw Error("Invalid node type: "+type)}expected=assertType.hasOwnProperty(expected)?assertType[expected]:assertType[expected]=RegExp("^(?:"+expected+")$");if(expected.test(type)){return}throw Error("Invalid node type: "+type)}function generate(node){var type=node.type;if(generate.hasOwnProperty(type)&&typeof generate[type]=="function"){return generate[type](node)}throw Error("Invalid node type: "+type)}function generateAlternative(node){assertType(node.type,"alternative");var terms=node.body,length=terms?terms.length:0;if(length==1){return generateTerm(terms[0])}else{var i=-1,result="";while(++i<length){result+=generateTerm(terms[i])}return result}}function generateAnchor(node){assertType(node.type,"anchor");switch(node.kind){case"start":return"^";case"end":return"$";case"boundary":return"\\b";case"not-boundary":return"\\B";default:throw Error("Invalid assertion")}}function generateAtom(node){assertType(node.type,"anchor|characterClass|characterClassEscape|dot|group|reference|value");return generate(node)}function generateCharacterClass(node){assertType(node.type,"characterClass");var classRanges=node.body,length=classRanges?classRanges.length:0;var i=-1,result="[";if(node.negative){result+="^"}while(++i<length){result+=generateClassAtom(classRanges[i])}result+="]";return result}function generateCharacterClassEscape(node){assertType(node.type,"characterClassEscape");return"\\"+node.value}function generateCharacterClassRange(node){assertType(node.type,"characterClassRange");var min=node.min,max=node.max;if(min.type=="characterClassRange"||max.type=="characterClassRange"){throw Error("Invalid character class range")}return generateClassAtom(min)+"-"+generateClassAtom(max)}function generateClassAtom(node){assertType(node.type,"anchor|characterClassEscape|characterClassRange|dot|value");return generate(node)}function generateDisjunction(node){assertType(node.type,"disjunction");var body=node.body,length=body?body.length:0;if(length==0){throw Error("No body")}else if(length==1){return generate(body[0])}else{var i=-1,result="";while(++i<length){if(i!=0){result+="|"}result+=generate(body[i])}return result}}function generateDot(node){assertType(node.type,"dot");return"."}function generateGroup(node){assertType(node.type,"group");var result="(";switch(node.behavior){case"normal":break;case"ignore":result+="?:";break;case"lookahead":result+="?=";break;case"negativeLookahead":result+="?!";break;default:throw Error("Invalid behaviour: "+node.behaviour)}var body=node.body,length=body?body.length:0;if(length==1){result+=generate(body[0])}else{var i=-1;while(++i<length){result+=generate(body[i])}}result+=")";return result}function generateQuantifier(node){assertType(node.type,"quantifier");var quantifier="",min=node.min,max=node.max;switch(max){case undefined:case null:switch(min){case 0:quantifier="*";break;case 1:quantifier="+";break;default:quantifier="{"+min+",}";break}break;default:if(min==max){quantifier="{"+min+"}"}else if(min==0&&max==1){quantifier="?"}else{quantifier="{"+min+","+max+"}"}break}if(!node.greedy){quantifier+="?"}return generateAtom(node.body[0])+quantifier}function generateReference(node){assertType(node.type,"reference");return"\\"+node.matchIndex}function generateTerm(node){assertType(node.type,"anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value");return generate(node)}function generateValue(node){assertType(node.type,"value");var kind=node.kind,codePoint=node.codePoint;switch(kind){case"controlLetter":return"\\c"+fromCodePoint(codePoint+64);case"hexadecimalEscape":return"\\x"+("00"+codePoint.toString(16).toUpperCase()).slice(-2);case"identifier":return"\\"+fromCodePoint(codePoint);case"null":return"\\"+codePoint;case"octal":return"\\"+codePoint.toString(8);case"singleEscape":switch(codePoint){case 8:return"\\b";case 9:return"\\t";
case 10:return"\\n";case 11:return"\\v";case 12:return"\\f";case 13:return"\\r";default:throw Error("Invalid codepoint: "+codePoint)}case"symbol":return fromCodePoint(codePoint);case"unicodeEscape":return"\\u"+("0000"+codePoint.toString(16).toUpperCase()).slice(-4);case"unicodeCodePointEscape":return"\\u{"+codePoint.toString(16).toUpperCase()+"}";default:throw Error("Unsupported node kind: "+kind)}}generate.alternative=generateAlternative;generate.anchor=generateAnchor;generate.characterClass=generateCharacterClass;generate.characterClassEscape=generateCharacterClassEscape;generate.characterClassRange=generateCharacterClassRange;generate.disjunction=generateDisjunction;generate.dot=generateDot;generate.group=generateGroup;generate.quantifier=generateQuantifier;generate.reference=generateReference;generate.value=generateValue;if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){define(function(){return{generate:generate}})}else if(freeExports&&freeModule){freeExports.generate=generate}else{root.regjsgen={generate:generate}}}).call(this)}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],179:[function(require,module,exports){(function(){function parse(str,flags){var hasUnicodeFlag=(flags||"").indexOf("u")!==-1;var pos=0;var closedCaptureCounter=0;function addRaw(node){node.raw=str.substring(node.range[0],node.range[1]);return node}function updateRawStart(node,start){node.range[0]=start;return addRaw(node)}function createAnchor(kind,rawLength){return addRaw({type:"anchor",kind:kind,range:[pos-rawLength,pos]})}function createValue(kind,codePoint,from,to){return addRaw({type:"value",kind:kind,codePoint:codePoint,range:[from,to]})}function createEscaped(kind,codePoint,value,fromOffset){fromOffset=fromOffset||0;return createValue(kind,codePoint,pos-(value.length+fromOffset),pos)}function createCharacter(matches){var _char=matches[0];var first=_char.charCodeAt(0);if(hasUnicodeFlag){var second;if(_char.length===1&&first>=55296&&first<=56319){second=lookahead().charCodeAt(0);if(second>=56320&&second<=57343){pos++;return createValue("symbol",(first-55296)*1024+second-56320+65536,pos-2,pos)}}}return createValue("symbol",first,pos-1,pos)}function createDisjunction(alternatives,from,to){return addRaw({type:"disjunction",body:alternatives,range:[from,to]})}function createDot(){return addRaw({type:"dot",range:[pos-1,pos]})}function createCharacterClassEscape(value){return addRaw({type:"characterClassEscape",value:value,range:[pos-2,pos]})}function createReference(matchIndex){return addRaw({type:"reference",matchIndex:parseInt(matchIndex,10),range:[pos-1-matchIndex.length,pos]})}function createGroup(behavior,disjunction,from,to){return addRaw({type:"group",behavior:behavior,body:disjunction,range:[from,to]})}function createQuantifier(min,max,from,to){if(to==null){from=pos-1;to=pos}return addRaw({type:"quantifier",min:min,max:max,greedy:true,body:null,range:[from,to]})}function createAlternative(terms,from,to){return addRaw({type:"alternative",body:terms,range:[from,to]})}function createCharacterClass(classRanges,negative,from,to){return addRaw({type:"characterClass",body:classRanges,negative:negative,range:[from,to]})}function createClassRange(min,max,from,to){if(min.codePoint>max.codePoint){throw SyntaxError("invalid range in character class")}return addRaw({type:"characterClassRange",min:min,max:max,range:[from,to]})}function flattenBody(body){if(body.type==="alternative"){return body.body}else{return[body]}}function isEmpty(obj){return obj.type==="empty"}function incr(amount){amount=amount||1;var res=str.substring(pos,pos+amount);pos+=amount||1;return res}function skip(value){if(!match(value)){throw SyntaxError("character: "+value)}}function match(value){if(str.indexOf(value,pos)===pos){return incr(value.length)}}function lookahead(){return str[pos]}function current(value){return str.indexOf(value,pos)===pos}function next(value){return str[pos+1]===value}function matchReg(regExp){var subStr=str.substring(pos);var res=subStr.match(regExp);if(res){res.range=[];res.range[0]=pos;incr(res[0].length);res.range[1]=pos}return res}function parseDisjunction(){var res=[],from=pos;res.push(parseAlternative());while(match("|")){res.push(parseAlternative())}if(res.length===1){return res[0]}return createDisjunction(res,from,pos)}function parseAlternative(){var res=[],from=pos;var term;while(term=parseTerm()){res.push(term)}if(res.length===1){return res[0]}return createAlternative(res,from,pos)}function parseTerm(){if(pos>=str.length||current("|")||current(")")){return null}var anchor=parseAnchor();if(anchor){return anchor}var atom=parseAtom();if(!atom){throw SyntaxError("Expected atom")}var quantifier=parseQuantifier()||false;if(quantifier){quantifier.body=flattenBody(atom);updateRawStart(quantifier,atom.range[0]);return quantifier}return atom}function parseGroup(matchA,typeA,matchB,typeB){var type=null,from=pos;if(match(matchA)){type=typeA}else if(match(matchB)){type=typeB}else{return false}var body=parseDisjunction();if(!body){throw SyntaxError("Expected disjunction")}skip(")");var group=createGroup(type,flattenBody(body),from,pos);if(type=="normal"){closedCaptureCounter++}return group}function parseAnchor(){var res,from=pos;if(match("^")){return createAnchor("start",1)}else if(match("$")){return createAnchor("end",1)}else if(match("\\b")){return createAnchor("boundary",2)}else if(match("\\B")){return createAnchor("not-boundary",2)}else{return parseGroup("(?=","lookahead","(?!","negativeLookahead")}}function parseQuantifier(){var res;var quantifier;var min,max;if(match("*")){quantifier=createQuantifier(0)}else if(match("+")){quantifier=createQuantifier(1)}else if(match("?")){quantifier=createQuantifier(0,1)}else if(res=matchReg(/^\{([0-9]+)\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,min,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),\}/)){min=parseInt(res[1],10);quantifier=createQuantifier(min,undefined,res.range[0],res.range[1])}else if(res=matchReg(/^\{([0-9]+),([0-9]+)\}/)){min=parseInt(res[1],10);max=parseInt(res[2],10);if(min>max){throw SyntaxError("numbers out of order in {} quantifier")}quantifier=createQuantifier(min,max,res.range[0],res.range[1])}if(quantifier){if(match("?")){quantifier.greedy=false;quantifier.range[1]+=1}}return quantifier}function parseAtom(){var res;if(res=matchReg(/^[^^$\\.*+?(){[|]/)){return createCharacter(res)}else if(match(".")){return createDot()}else if(match("\\")){res=parseAtomEscape();if(!res){throw SyntaxError("atomEscape")}return res}else if(res=parseCharacterClass()){return res}else{return parseGroup("(?:","ignore","(","normal")}}function parseUnicodeSurrogatePairEscape(firstEscape){if(hasUnicodeFlag){var first,second;if(firstEscape.kind=="unicodeEscape"&&(first=firstEscape.codePoint)>=55296&&first<=56319&¤t("\\")&&next("u")){var prevPos=pos;pos++;var secondEscape=parseClassEscape();if(secondEscape.kind=="unicodeEscape"&&(second=secondEscape.codePoint)>=56320&&second<=57343){firstEscape.range[1]=secondEscape.range[1];firstEscape.codePoint=(first-55296)*1024+second-56320+65536;firstEscape.type="value";firstEscape.kind="unicodeCodePointEscape";addRaw(firstEscape)}else{pos=prevPos}}}return firstEscape}function parseClassEscape(){return parseAtomEscape(true)}function parseAtomEscape(insideCharacterClass){var res;res=parseDecimalEscape();if(res){return res}if(insideCharacterClass){if(match("b")){return createEscaped("singleEscape",8,"\\b")}else if(match("B")){throw SyntaxError("\\B not possible inside of CharacterClass")}}res=parseCharacterEscape();return res}function parseDecimalEscape(){var res,match;if(res=matchReg(/^(?!0)\d+/)){match=res[0];var refIdx=parseInt(res[0],10);if(refIdx<=closedCaptureCounter){return createReference(res[0])}else{incr(-res[0].length);if(res=matchReg(/^[0-7]{1,3}/)){return createEscaped("octal",parseInt(res[0],8),res[0],1)}else{res=createCharacter(matchReg(/^[89]/));return updateRawStart(res,res.range[0]-1)}}}else if(res=matchReg(/^[0-7]{1,3}/)){match=res[0];if(/^0{1,3}$/.test(match)){return createEscaped("null",0,"0",match.length+1)}else{return createEscaped("octal",parseInt(match,8),match,1)}}else if(res=matchReg(/^[dDsSwW]/)){return createCharacterClassEscape(res[0])}return false}function parseCharacterEscape(){var res;if(res=matchReg(/^[fnrtv]/)){var codePoint=0;switch(res[0]){case"t":codePoint=9;break;case"n":codePoint=10;break;case"v":codePoint=11;break;case"f":codePoint=12;break;case"r":codePoint=13;break}return createEscaped("singleEscape",codePoint,"\\"+res[0])}else if(res=matchReg(/^c([a-zA-Z])/)){return createEscaped("controlLetter",res[1].charCodeAt(0)%32,res[1],2)}else if(res=matchReg(/^x([0-9a-fA-F]{2})/)){return createEscaped("hexadecimalEscape",parseInt(res[1],16),res[1],2)}else if(res=matchReg(/^u([0-9a-fA-F]{4})/)){return parseUnicodeSurrogatePairEscape(createEscaped("unicodeEscape",parseInt(res[1],16),res[1],2))}else if(hasUnicodeFlag&&(res=matchReg(/^u\{([0-9a-fA-F]{1,})\}/))){return createEscaped("unicodeCodePointEscape",parseInt(res[1],16),res[1],4)}else{return parseIdentityEscape()}}function isIdentifierPart(ch){var NonAsciiIdentifierPart=new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԯԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠ-ࢲࣤ-ॣ०-९ॱ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఀ-ఃఅ-ఌఎ-ఐఒ-నప-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಁ-ಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲഁ-ഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟ෦-෯ෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤞᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧ᪰-᪽ᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶ᳸᳹ᴀ-᷵᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚝꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꧠ-ꧾꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︭︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]");return ch===36||ch===95||ch>=65&&ch<=90||ch>=97&&ch<=122||ch>=48&&ch<=57||ch===92||ch>=128&&NonAsciiIdentifierPart.test(String.fromCharCode(ch))}function parseIdentityEscape(){var ZWJ="";var ZWNJ="";var res;var tmp;if(!isIdentifierPart(lookahead())){tmp=incr();return createEscaped("identifier",tmp.charCodeAt(0),tmp,1)}if(match(ZWJ)){return createEscaped("identifier",8204,ZWJ)}else if(match(ZWNJ)){return createEscaped("identifier",8205,ZWNJ)}return null}function parseCharacterClass(){var res,from=pos;if(res=matchReg(/^\[\^/)){res=parseClassRanges();skip("]");return createCharacterClass(res,true,from,pos)}else if(match("[")){res=parseClassRanges();skip("]");return createCharacterClass(res,false,from,pos)}return null}function parseClassRanges(){var res;if(current("]")){return[]}else{res=parseNonemptyClassRanges();if(!res){throw SyntaxError("nonEmptyClassRanges")}return res}}function parseHelperClassRanges(atom){var from,to,res;if(current("-")&&!next("]")){skip("-");res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}to=pos;var classRanges=parseClassRanges();if(!classRanges){throw SyntaxError("classRanges")}from=atom.range[0];if(classRanges.type==="empty"){return[createClassRange(atom,res,from,to)]}return[createClassRange(atom,res,from,to)].concat(classRanges)}res=parseNonemptyClassRangesNoDash();if(!res){throw SyntaxError("nonEmptyClassRangesNoDash")}return[atom].concat(res)}function parseNonemptyClassRanges(){var atom=parseClassAtom();if(!atom){throw SyntaxError("classAtom")}if(current("]")){return[atom]}return parseHelperClassRanges(atom)}function parseNonemptyClassRangesNoDash(){var res=parseClassAtom();if(!res){throw SyntaxError("classAtom")}if(current("]")){return res}return parseHelperClassRanges(res)}function parseClassAtom(){if(match("-")){return createCharacter("-")}else{return parseClassAtomNoDash()}}function parseClassAtomNoDash(){var res;if(res=matchReg(/^[^\\\]-]/)){return createCharacter(res[0])}else if(match("\\")){res=parseClassEscape();if(!res){throw SyntaxError("classEscape")}return parseUnicodeSurrogatePairEscape(res)}}str=String(str);if(str===""){str="(?:)"}var result=parseDisjunction();if(result.range[1]!==str.length){throw SyntaxError("Could not parse entire input - got stuck: "+str)}return result}var regjsparser={parse:parse};if(typeof module!=="undefined"&&module.exports){module.exports=regjsparser}else{window.regjsparser=regjsparser}})()},{}],180:[function(require,module,exports){var generate=require("regjsgen").generate;var parse=require("regjsparser").parse;var regenerate=require("regenerate");var iuMappings=require("./data/iu-mappings.json");var ESCAPE_SETS=require("./data/character-class-escape-sets.js");function getCharacterClassEscapeSet(character){if(unicode){if(ignoreCase){return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]}return ESCAPE_SETS.UNICODE[character]}return ESCAPE_SETS.REGULAR[character]}var object={};var hasOwnProperty=object.hasOwnProperty;function has(object,property){return hasOwnProperty.call(object,property)}var UNICODE_SET=regenerate().addRange(0,1114111);var BMP_SET=regenerate().addRange(0,65535);var DOT_SET_UNICODE=UNICODE_SET.clone().remove(10,13,8232,8233);var DOT_SET=DOT_SET_UNICODE.clone().intersection(BMP_SET);regenerate.prototype.iuAddRange=function(min,max){var $this=this;do{var folded=caseFold(min);if(folded){$this.add(folded)}}while(++min<=max);return $this};function assign(target,source){for(var key in source){target[key]=source[key]}}function update(item,pattern){var tree=parse(pattern,"");switch(tree.type){case"characterClass":case"group":case"value":break;default:tree=wrap(tree,pattern)}assign(item,tree)}function wrap(tree,pattern){return{type:"group",behavior:"ignore",body:[tree],raw:"(?:"+pattern+")"}}function caseFold(codePoint){return has(iuMappings,codePoint)?iuMappings[codePoint]:false}var ignoreCase=false;var unicode=false;function processCharacterClass(characterClassItem){var set=regenerate();var body=characterClassItem.body.forEach(function(item){switch(item.type){case"value":set.add(item.codePoint);if(ignoreCase&&unicode){var folded=caseFold(item.codePoint);if(folded){set.add(folded)}}break;case"characterClassRange":var min=item.min.codePoint;var max=item.max.codePoint;set.addRange(min,max);if(ignoreCase&&unicode){set.iuAddRange(min,max)}break;case"characterClassEscape":set.add(getCharacterClassEscapeSet(item.value));break;default:throw Error("Unknown term type: "+item.type)}});if(characterClassItem.negative){set=(unicode?UNICODE_SET:BMP_SET).clone().remove(set)}update(characterClassItem,set.toString());return characterClassItem}function processTerm(item){switch(item.type){case"dot":update(item,(unicode?DOT_SET_UNICODE:DOT_SET).toString());break;case"characterClass":item=processCharacterClass(item);break;case"characterClassEscape":update(item,getCharacterClassEscapeSet(item.value).toString());break;case"alternative":case"disjunction":case"group":case"quantifier":item.body=item.body.map(processTerm);break;case"value":var codePoint=item.codePoint;var set=regenerate(codePoint);if(ignoreCase&&unicode){var folded=caseFold(codePoint);if(folded){set.add(folded)}}update(item,set.toString());break;case"anchor":case"empty":case"group":case"reference":break;default:throw Error("Unknown term type: "+item.type)}return item}module.exports=function(pattern,flags){var tree=parse(pattern,flags);ignoreCase=flags?flags.indexOf("i")>-1:false;unicode=flags?flags.indexOf("u")>-1:false;assign(tree,processTerm(tree));return generate(tree)}},{"./data/character-class-escape-sets.js":175,"./data/iu-mappings.json":176,regenerate:177,regjsgen:178,regjsparser:179}],181:[function(require,module,exports){exports.SourceMapGenerator=require("./source-map/source-map-generator").SourceMapGenerator;exports.SourceMapConsumer=require("./source-map/source-map-consumer").SourceMapConsumer;exports.SourceNode=require("./source-map/source-node").SourceNode},{"./source-map/source-map-consumer":187,"./source-map/source-map-generator":188,"./source-map/source-node":189}],182:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");function ArraySet(){this._array=[];this._set={}}ArraySet.fromArray=function ArraySet_fromArray(aArray,aAllowDuplicates){var set=new ArraySet;for(var i=0,len=aArray.length;i<len;i++){set.add(aArray[i],aAllowDuplicates)}return set};ArraySet.prototype.add=function ArraySet_add(aStr,aAllowDuplicates){var isDuplicate=this.has(aStr);var idx=this._array.length;if(!isDuplicate||aAllowDuplicates){this._array.push(aStr)}if(!isDuplicate){this._set[util.toSetString(aStr)]=idx}};ArraySet.prototype.has=function ArraySet_has(aStr){return Object.prototype.hasOwnProperty.call(this._set,util.toSetString(aStr))};ArraySet.prototype.indexOf=function ArraySet_indexOf(aStr){if(this.has(aStr)){return this._set[util.toSetString(aStr)]}throw new Error('"'+aStr+'" is not in the set.')};ArraySet.prototype.at=function ArraySet_at(aIdx){if(aIdx>=0&&aIdx<this._array.length){return this._array[aIdx]}throw new Error("No element indexed by "+aIdx)};ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()};exports.ArraySet=ArraySet})},{"./util":190,amdefine:191}],183:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64=require("./base64");var VLQ_BASE_SHIFT=5;var VLQ_BASE=1<<VLQ_BASE_SHIFT;var VLQ_BASE_MASK=VLQ_BASE-1;var VLQ_CONTINUATION_BIT=VLQ_BASE;function toVLQSigned(aValue){return aValue<0?(-aValue<<1)+1:(aValue<<1)+0}function fromVLQSigned(aValue){var isNegative=(aValue&1)===1;var shifted=aValue>>1;return isNegative?-shifted:shifted}exports.encode=function base64VLQ_encode(aValue){var encoded="";var digit;var vlq=toVLQSigned(aValue);do{digit=vlq&VLQ_BASE_MASK;vlq>>>=VLQ_BASE_SHIFT;if(vlq>0){digit|=VLQ_CONTINUATION_BIT}encoded+=base64.encode(digit)}while(vlq>0);return encoded};exports.decode=function base64VLQ_decode(aStr,aOutParam){var i=0;var strLen=aStr.length;var result=0;var shift=0;var continuation,digit;do{if(i>=strLen){throw new Error("Expected more digits in base 64 VLQ value.")}digit=base64.decode(aStr.charAt(i++));continuation=!!(digit&VLQ_CONTINUATION_BIT);digit&=VLQ_BASE_MASK;result=result+(digit<<shift);shift+=VLQ_BASE_SHIFT}while(continuation);aOutParam.value=fromVLQSigned(result);aOutParam.rest=aStr.slice(i)}})},{"./base64":184,amdefine:191}],184:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var charToIntMap={};var intToCharMap={};"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("").forEach(function(ch,index){charToIntMap[ch]=index;intToCharMap[index]=ch});exports.encode=function base64_encode(aNumber){if(aNumber in intToCharMap){return intToCharMap[aNumber]}throw new TypeError("Must be between 0 and 63: "+aNumber)};exports.decode=function base64_decode(aChar){if(aChar in charToIntMap){return charToIntMap[aChar]}throw new TypeError("Not a valid base 64 digit: "+aChar)}})},{amdefine:191}],185:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function recursiveSearch(aLow,aHigh,aNeedle,aHaystack,aCompare){var mid=Math.floor((aHigh-aLow)/2)+aLow;var cmp=aCompare(aNeedle,aHaystack[mid],true);if(cmp===0){return mid}else if(cmp>0){if(aHigh-mid>1){return recursiveSearch(mid,aHigh,aNeedle,aHaystack,aCompare)}return mid}else{if(mid-aLow>1){return recursiveSearch(aLow,mid,aNeedle,aHaystack,aCompare)}return aLow<0?-1:aLow}}exports.search=function search(aNeedle,aHaystack,aCompare){if(aHaystack.length===0){return-1}return recursiveSearch(-1,aHaystack.length,aNeedle,aHaystack,aCompare)}})},{amdefine:191}],186:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");function generatedPositionAfter(mappingA,mappingB){var lineA=mappingA.generatedLine;var lineB=mappingB.generatedLine;var columnA=mappingA.generatedColumn;var columnB=mappingB.generatedColumn;return lineB>lineA||lineB==lineA&&columnB>=columnA||util.compareByGeneratedPositions(mappingA,mappingB)<=0}function MappingList(){this._array=[];this._sorted=true;this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function MappingList_forEach(aCallback,aThisArg){this._array.forEach(aCallback,aThisArg)};MappingList.prototype.add=function MappingList_add(aMapping){var mapping;if(generatedPositionAfter(this._last,aMapping)){this._last=aMapping;this._array.push(aMapping)}else{this._sorted=false;this._array.push(aMapping)}};MappingList.prototype.toArray=function MappingList_toArray(){if(!this._sorted){this._array.sort(util.compareByGeneratedPositions);this._sorted=true}return this._array};exports.MappingList=MappingList})},{"./util":190,amdefine:191}],187:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var util=require("./util");var binarySearch=require("./binary-search");var ArraySet=require("./array-set").ArraySet;var base64VLQ=require("./base64-vlq");function SourceMapConsumer(aSourceMap){var sourceMap=aSourceMap;if(typeof aSourceMap==="string"){sourceMap=JSON.parse(aSourceMap.replace(/^\)\]\}'/,""))}var version=util.getArg(sourceMap,"version");var sources=util.getArg(sourceMap,"sources");var names=util.getArg(sourceMap,"names",[]);var sourceRoot=util.getArg(sourceMap,"sourceRoot",null);var sourcesContent=util.getArg(sourceMap,"sourcesContent",null);var mappings=util.getArg(sourceMap,"mappings");var file=util.getArg(sourceMap,"file",null);if(version!=this._version){throw new Error("Unsupported version: "+version)}sources=sources.map(util.normalize);this._names=ArraySet.fromArray(names,true);this._sources=ArraySet.fromArray(sources,true);this.sourceRoot=sourceRoot;this.sourcesContent=sourcesContent;this._mappings=mappings;this.file=file}SourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(aSourceMap){var smc=Object.create(SourceMapConsumer.prototype);smc._names=ArraySet.fromArray(aSourceMap._names.toArray(),true);smc._sources=ArraySet.fromArray(aSourceMap._sources.toArray(),true);smc.sourceRoot=aSourceMap._sourceRoot;smc.sourcesContent=aSourceMap._generateSourcesContent(smc._sources.toArray(),smc.sourceRoot);smc.file=aSourceMap._file;smc.__generatedMappings=aSourceMap._mappings.toArray().slice();smc.__originalMappings=aSourceMap._mappings.toArray().slice().sort(util.compareByOriginalPositions);return smc};SourceMapConsumer.prototype._version=3;Object.defineProperty(SourceMapConsumer.prototype,"sources",{get:function(){return this._sources.toArray().map(function(s){return this.sourceRoot!=null?util.join(this.sourceRoot,s):s},this)}});SourceMapConsumer.prototype.__generatedMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{get:function(){if(!this.__generatedMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__generatedMappings}});SourceMapConsumer.prototype.__originalMappings=null;Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{get:function(){if(!this.__originalMappings){this.__generatedMappings=[];this.__originalMappings=[];this._parseMappings(this._mappings,this.sourceRoot)}return this.__originalMappings}});SourceMapConsumer.prototype._nextCharIsMappingSeparator=function SourceMapConsumer_nextCharIsMappingSeparator(aStr){var c=aStr.charAt(0);return c===";"||c===","};SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(aStr,aSourceRoot){var generatedLine=1;var previousGeneratedColumn=0;var previousOriginalLine=0;var previousOriginalColumn=0;var previousSource=0;var previousName=0;var str=aStr;var temp={};var mapping;while(str.length>0){if(str.charAt(0)===";"){generatedLine++;str=str.slice(1);previousGeneratedColumn=0}else if(str.charAt(0)===","){str=str.slice(1)}else{mapping={};mapping.generatedLine=generatedLine;base64VLQ.decode(str,temp);mapping.generatedColumn=previousGeneratedColumn+temp.value;previousGeneratedColumn=mapping.generatedColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.source=this._sources.at(previousSource+temp.value);previousSource+=temp.value;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source, but no line and column")}base64VLQ.decode(str,temp);mapping.originalLine=previousOriginalLine+temp.value;previousOriginalLine=mapping.originalLine;mapping.originalLine+=1;str=temp.rest;if(str.length===0||this._nextCharIsMappingSeparator(str)){throw new Error("Found a source and line, but no column")}base64VLQ.decode(str,temp);mapping.originalColumn=previousOriginalColumn+temp.value;previousOriginalColumn=mapping.originalColumn;str=temp.rest;if(str.length>0&&!this._nextCharIsMappingSeparator(str)){base64VLQ.decode(str,temp);mapping.name=this._names.at(previousName+temp.value);previousName+=temp.value;str=temp.rest}}this.__generatedMappings.push(mapping);if(typeof mapping.originalLine==="number"){this.__originalMappings.push(mapping)}}}this.__generatedMappings.sort(util.compareByGeneratedPositions);this.__originalMappings.sort(util.compareByOriginalPositions)};SourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(aNeedle,aMappings,aLineName,aColumnName,aComparator){if(aNeedle[aLineName]<=0){throw new TypeError("Line must be greater than or equal to 1, got "+aNeedle[aLineName])}if(aNeedle[aColumnName]<0){throw new TypeError("Column must be greater than or equal to 0, got "+aNeedle[aColumnName])}return binarySearch.search(aNeedle,aMappings,aComparator)};SourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var index=0;index<this._generatedMappings.length;++index){var mapping=this._generatedMappings[index];if(index+1<this._generatedMappings.length){var nextMapping=this._generatedMappings[index+1];if(mapping.generatedLine===nextMapping.generatedLine){mapping.lastGeneratedColumn=nextMapping.generatedColumn-1;continue}}mapping.lastGeneratedColumn=Infinity}};SourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(aArgs){var needle={generatedLine:util.getArg(aArgs,"line"),generatedColumn:util.getArg(aArgs,"column")};var index=this._findMapping(needle,this._generatedMappings,"generatedLine","generatedColumn",util.compareByGeneratedPositions);if(index>=0){var mapping=this._generatedMappings[index];if(mapping.generatedLine===needle.generatedLine){var source=util.getArg(mapping,"source",null);if(source!=null&&this.sourceRoot!=null){source=util.join(this.sourceRoot,source)}return{source:source,line:util.getArg(mapping,"originalLine",null),column:util.getArg(mapping,"originalColumn",null),name:util.getArg(mapping,"name",null)}}}return{source:null,line:null,column:null,name:null}};SourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(aSource){if(!this.sourcesContent){return null}if(this.sourceRoot!=null){aSource=util.relative(this.sourceRoot,aSource)}if(this._sources.has(aSource)){return this.sourcesContent[this._sources.indexOf(aSource)]}var url;if(this.sourceRoot!=null&&(url=util.urlParse(this.sourceRoot))){var fileUriAbsPath=aSource.replace(/^file:\/\//,"");if(url.scheme=="file"&&this._sources.has(fileUriAbsPath)){return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]}if((!url.path||url.path=="/")&&this._sources.has("/"+aSource)){return this.sourcesContent[this._sources.indexOf("/"+aSource)]}}throw new Error('"'+aSource+'" is not in the SourceMap.')};SourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(aArgs){var needle={source:util.getArg(aArgs,"source"),originalLine:util.getArg(aArgs,"line"),originalColumn:util.getArg(aArgs,"column")};if(this.sourceRoot!=null){needle.source=util.relative(this.sourceRoot,needle.source)}var index=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions);if(index>=0){var mapping=this._originalMappings[index];return{line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null),lastColumn:util.getArg(mapping,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(aArgs){var needle={source:util.getArg(aArgs,"source"),originalLine:util.getArg(aArgs,"line"),originalColumn:Infinity};if(this.sourceRoot!=null){needle.source=util.relative(this.sourceRoot,needle.source)}var mappings=[];var index=this._findMapping(needle,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions);if(index>=0){var mapping=this._originalMappings[index];while(mapping&&mapping.originalLine===needle.originalLine){mappings.push({line:util.getArg(mapping,"generatedLine",null),column:util.getArg(mapping,"generatedColumn",null),lastColumn:util.getArg(mapping,"lastGeneratedColumn",null)});mapping=this._originalMappings[--index]}}return mappings.reverse()};SourceMapConsumer.GENERATED_ORDER=1;SourceMapConsumer.ORIGINAL_ORDER=2;SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(aCallback,aContext,aOrder){var context=aContext||null;var order=aOrder||SourceMapConsumer.GENERATED_ORDER;var mappings;switch(order){case SourceMapConsumer.GENERATED_ORDER:mappings=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:mappings=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var sourceRoot=this.sourceRoot;mappings.map(function(mapping){var source=mapping.source;if(source!=null&&sourceRoot!=null){source=util.join(sourceRoot,source)}return{source:source,generatedLine:mapping.generatedLine,generatedColumn:mapping.generatedColumn,originalLine:mapping.originalLine,originalColumn:mapping.originalColumn,name:mapping.name}}).forEach(aCallback,context)};exports.SourceMapConsumer=SourceMapConsumer})},{"./array-set":182,"./base64-vlq":183,"./binary-search":185,"./util":190,amdefine:191}],188:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var base64VLQ=require("./base64-vlq");var util=require("./util");var ArraySet=require("./array-set").ArraySet;var MappingList=require("./mapping-list").MappingList;function SourceMapGenerator(aArgs){if(!aArgs){aArgs={}}this._file=util.getArg(aArgs,"file",null);this._sourceRoot=util.getArg(aArgs,"sourceRoot",null);this._skipValidation=util.getArg(aArgs,"skipValidation",false);this._sources=new ArraySet;this._names=new ArraySet;this._mappings=new MappingList;this._sourcesContents=null}SourceMapGenerator.prototype._version=3;SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(aSourceMapConsumer){var sourceRoot=aSourceMapConsumer.sourceRoot;var generator=new SourceMapGenerator({file:aSourceMapConsumer.file,sourceRoot:sourceRoot});aSourceMapConsumer.eachMapping(function(mapping){var newMapping={generated:{line:mapping.generatedLine,column:mapping.generatedColumn}};if(mapping.source!=null){newMapping.source=mapping.source;if(sourceRoot!=null){newMapping.source=util.relative(sourceRoot,newMapping.source)}newMapping.original={line:mapping.originalLine,column:mapping.originalColumn};
if(mapping.name!=null){newMapping.name=mapping.name}}generator.addMapping(newMapping)});aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){generator.setSourceContent(sourceFile,content)}});return generator};SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(aArgs){var generated=util.getArg(aArgs,"generated");var original=util.getArg(aArgs,"original",null);var source=util.getArg(aArgs,"source",null);var name=util.getArg(aArgs,"name",null);if(!this._skipValidation){this._validateMapping(generated,original,source,name)}if(source!=null&&!this._sources.has(source)){this._sources.add(source)}if(name!=null&&!this._names.has(name)){this._names.add(name)}this._mappings.add({generatedLine:generated.line,generatedColumn:generated.column,originalLine:original!=null&&original.line,originalColumn:original!=null&&original.column,source:source,name:name})};SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(aSourceFile,aSourceContent){var source=aSourceFile;if(this._sourceRoot!=null){source=util.relative(this._sourceRoot,source)}if(aSourceContent!=null){if(!this._sourcesContents){this._sourcesContents={}}this._sourcesContents[util.toSetString(source)]=aSourceContent}else if(this._sourcesContents){delete this._sourcesContents[util.toSetString(source)];if(Object.keys(this._sourcesContents).length===0){this._sourcesContents=null}}};SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(aSourceMapConsumer,aSourceFile,aSourceMapPath){var sourceFile=aSourceFile;if(aSourceFile==null){if(aSourceMapConsumer.file==null){throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, "+'or the source map\'s "file" property. Both were omitted.')}sourceFile=aSourceMapConsumer.file}var sourceRoot=this._sourceRoot;if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}var newSources=new ArraySet;var newNames=new ArraySet;this._mappings.unsortedForEach(function(mapping){if(mapping.source===sourceFile&&mapping.originalLine!=null){var original=aSourceMapConsumer.originalPositionFor({line:mapping.originalLine,column:mapping.originalColumn});if(original.source!=null){mapping.source=original.source;if(aSourceMapPath!=null){mapping.source=util.join(aSourceMapPath,mapping.source)}if(sourceRoot!=null){mapping.source=util.relative(sourceRoot,mapping.source)}mapping.originalLine=original.line;mapping.originalColumn=original.column;if(original.name!=null){mapping.name=original.name}}}var source=mapping.source;if(source!=null&&!newSources.has(source)){newSources.add(source)}var name=mapping.name;if(name!=null&&!newNames.has(name)){newNames.add(name)}},this);this._sources=newSources;this._names=newNames;aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aSourceMapPath!=null){sourceFile=util.join(aSourceMapPath,sourceFile)}if(sourceRoot!=null){sourceFile=util.relative(sourceRoot,sourceFile)}this.setSourceContent(sourceFile,content)}},this)};SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(aGenerated,aOriginal,aSource,aName){if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aGenerated.line>0&&aGenerated.column>=0&&!aOriginal&&!aSource&&!aName){return}else if(aGenerated&&"line"in aGenerated&&"column"in aGenerated&&aOriginal&&"line"in aOriginal&&"column"in aOriginal&&aGenerated.line>0&&aGenerated.column>=0&&aOriginal.line>0&&aOriginal.column>=0&&aSource){return}else{throw new Error("Invalid mapping: "+JSON.stringify({generated:aGenerated,source:aSource,original:aOriginal,name:aName}))}};SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){var previousGeneratedColumn=0;var previousGeneratedLine=1;var previousOriginalColumn=0;var previousOriginalLine=0;var previousName=0;var previousSource=0;var result="";var mapping;var mappings=this._mappings.toArray();for(var i=0,len=mappings.length;i<len;i++){mapping=mappings[i];if(mapping.generatedLine!==previousGeneratedLine){previousGeneratedColumn=0;while(mapping.generatedLine!==previousGeneratedLine){result+=";";previousGeneratedLine++}}else{if(i>0){if(!util.compareByGeneratedPositions(mapping,mappings[i-1])){continue}result+=","}}result+=base64VLQ.encode(mapping.generatedColumn-previousGeneratedColumn);previousGeneratedColumn=mapping.generatedColumn;if(mapping.source!=null){result+=base64VLQ.encode(this._sources.indexOf(mapping.source)-previousSource);previousSource=this._sources.indexOf(mapping.source);result+=base64VLQ.encode(mapping.originalLine-1-previousOriginalLine);previousOriginalLine=mapping.originalLine-1;result+=base64VLQ.encode(mapping.originalColumn-previousOriginalColumn);previousOriginalColumn=mapping.originalColumn;if(mapping.name!=null){result+=base64VLQ.encode(this._names.indexOf(mapping.name)-previousName);previousName=this._names.indexOf(mapping.name)}}}return result};SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(aSources,aSourceRoot){return aSources.map(function(source){if(!this._sourcesContents){return null}if(aSourceRoot!=null){source=util.relative(aSourceRoot,source)}var key=util.toSetString(source);return Object.prototype.hasOwnProperty.call(this._sourcesContents,key)?this._sourcesContents[key]:null},this)};SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var map={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null){map.file=this._file}if(this._sourceRoot!=null){map.sourceRoot=this._sourceRoot}if(this._sourcesContents){map.sourcesContent=this._generateSourcesContent(map.sources,map.sourceRoot)}return map};SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this)};exports.SourceMapGenerator=SourceMapGenerator})},{"./array-set":182,"./base64-vlq":183,"./mapping-list":186,"./util":190,amdefine:191}],189:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){var SourceMapGenerator=require("./source-map-generator").SourceMapGenerator;var util=require("./util");var REGEX_NEWLINE=/(\r?\n)/;var NEWLINE_CODE=10;var isSourceNode="$$$isSourceNode$$$";function SourceNode(aLine,aColumn,aSource,aChunks,aName){this.children=[];this.sourceContents={};this.line=aLine==null?null:aLine;this.column=aColumn==null?null:aColumn;this.source=aSource==null?null:aSource;this.name=aName==null?null:aName;this[isSourceNode]=true;if(aChunks!=null)this.add(aChunks)}SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(aGeneratedCode,aSourceMapConsumer,aRelativePath){var node=new SourceNode;var remainingLines=aGeneratedCode.split(REGEX_NEWLINE);var shiftNextLine=function(){var lineContents=remainingLines.shift();var newLine=remainingLines.shift()||"";return lineContents+newLine};var lastGeneratedLine=1,lastGeneratedColumn=0;var lastMapping=null;aSourceMapConsumer.eachMapping(function(mapping){if(lastMapping!==null){if(lastGeneratedLine<mapping.generatedLine){var code="";addMappingWithCode(lastMapping,shiftNextLine());lastGeneratedLine++;lastGeneratedColumn=0}else{var nextLine=remainingLines[0];var code=nextLine.substr(0,mapping.generatedColumn-lastGeneratedColumn);remainingLines[0]=nextLine.substr(mapping.generatedColumn-lastGeneratedColumn);lastGeneratedColumn=mapping.generatedColumn;addMappingWithCode(lastMapping,code);lastMapping=mapping;return}}while(lastGeneratedLine<mapping.generatedLine){node.add(shiftNextLine());lastGeneratedLine++}if(lastGeneratedColumn<mapping.generatedColumn){var nextLine=remainingLines[0];node.add(nextLine.substr(0,mapping.generatedColumn));remainingLines[0]=nextLine.substr(mapping.generatedColumn);lastGeneratedColumn=mapping.generatedColumn}lastMapping=mapping},this);if(remainingLines.length>0){if(lastMapping){addMappingWithCode(lastMapping,shiftNextLine())}node.add(remainingLines.join(""))}aSourceMapConsumer.sources.forEach(function(sourceFile){var content=aSourceMapConsumer.sourceContentFor(sourceFile);if(content!=null){if(aRelativePath!=null){sourceFile=util.join(aRelativePath,sourceFile)}node.setSourceContent(sourceFile,content)}});return node;function addMappingWithCode(mapping,code){if(mapping===null||mapping.source===undefined){node.add(code)}else{var source=aRelativePath?util.join(aRelativePath,mapping.source):mapping.source;node.add(new SourceNode(mapping.originalLine,mapping.originalColumn,source,code,mapping.name))}}};SourceNode.prototype.add=function SourceNode_add(aChunk){if(Array.isArray(aChunk)){aChunk.forEach(function(chunk){this.add(chunk)},this)}else if(aChunk[isSourceNode]||typeof aChunk==="string"){if(aChunk){this.children.push(aChunk)}}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.prepend=function SourceNode_prepend(aChunk){if(Array.isArray(aChunk)){for(var i=aChunk.length-1;i>=0;i--){this.prepend(aChunk[i])}}else if(aChunk[isSourceNode]||typeof aChunk==="string"){this.children.unshift(aChunk)}else{throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+aChunk)}return this};SourceNode.prototype.walk=function SourceNode_walk(aFn){var chunk;for(var i=0,len=this.children.length;i<len;i++){chunk=this.children[i];if(chunk[isSourceNode]){chunk.walk(aFn)}else{if(chunk!==""){aFn(chunk,{source:this.source,line:this.line,column:this.column,name:this.name})}}}};SourceNode.prototype.join=function SourceNode_join(aSep){var newChildren;var i;var len=this.children.length;if(len>0){newChildren=[];for(i=0;i<len-1;i++){newChildren.push(this.children[i]);newChildren.push(aSep)}newChildren.push(this.children[i]);this.children=newChildren}return this};SourceNode.prototype.replaceRight=function SourceNode_replaceRight(aPattern,aReplacement){var lastChild=this.children[this.children.length-1];if(lastChild[isSourceNode]){lastChild.replaceRight(aPattern,aReplacement)}else if(typeof lastChild==="string"){this.children[this.children.length-1]=lastChild.replace(aPattern,aReplacement)}else{this.children.push("".replace(aPattern,aReplacement))}return this};SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(aSourceFile,aSourceContent){this.sourceContents[util.toSetString(aSourceFile)]=aSourceContent};SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(aFn){for(var i=0,len=this.children.length;i<len;i++){if(this.children[i][isSourceNode]){this.children[i].walkSourceContents(aFn)}}var sources=Object.keys(this.sourceContents);for(var i=0,len=sources.length;i<len;i++){aFn(util.fromSetString(sources[i]),this.sourceContents[sources[i]])}};SourceNode.prototype.toString=function SourceNode_toString(){var str="";this.walk(function(chunk){str+=chunk});return str};SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(aArgs){var generated={code:"",line:1,column:0};var map=new SourceMapGenerator(aArgs);var sourceMappingActive=false;var lastOriginalSource=null;var lastOriginalLine=null;var lastOriginalColumn=null;var lastOriginalName=null;this.walk(function(chunk,original){generated.code+=chunk;if(original.source!==null&&original.line!==null&&original.column!==null){if(lastOriginalSource!==original.source||lastOriginalLine!==original.line||lastOriginalColumn!==original.column||lastOriginalName!==original.name){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}lastOriginalSource=original.source;lastOriginalLine=original.line;lastOriginalColumn=original.column;lastOriginalName=original.name;sourceMappingActive=true}else if(sourceMappingActive){map.addMapping({generated:{line:generated.line,column:generated.column}});lastOriginalSource=null;sourceMappingActive=false}for(var idx=0,length=chunk.length;idx<length;idx++){if(chunk.charCodeAt(idx)===NEWLINE_CODE){generated.line++;generated.column=0;if(idx+1===length){lastOriginalSource=null;sourceMappingActive=false}else if(sourceMappingActive){map.addMapping({source:original.source,original:{line:original.line,column:original.column},generated:{line:generated.line,column:generated.column},name:original.name})}}else{generated.column++}}});this.walkSourceContents(function(sourceFile,sourceContent){map.setSourceContent(sourceFile,sourceContent)});return{code:generated.code,map:map}};exports.SourceNode=SourceNode})},{"./source-map-generator":188,"./util":190,amdefine:191}],190:[function(require,module,exports){if(typeof define!=="function"){var define=require("amdefine")(module,require)}define(function(require,exports,module){function getArg(aArgs,aName,aDefaultValue){if(aName in aArgs){return aArgs[aName]}else if(arguments.length===3){return aDefaultValue}else{throw new Error('"'+aName+'" is a required argument.')}}exports.getArg=getArg;var urlRegexp=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;var dataUrlRegexp=/^data:.+\,.+$/;function urlParse(aUrl){var match=aUrl.match(urlRegexp);if(!match){return null}return{scheme:match[1],auth:match[2],host:match[3],port:match[4],path:match[5]}}exports.urlParse=urlParse;function urlGenerate(aParsedUrl){var url="";if(aParsedUrl.scheme){url+=aParsedUrl.scheme+":"}url+="//";if(aParsedUrl.auth){url+=aParsedUrl.auth+"@"}if(aParsedUrl.host){url+=aParsedUrl.host}if(aParsedUrl.port){url+=":"+aParsedUrl.port}if(aParsedUrl.path){url+=aParsedUrl.path}return url}exports.urlGenerate=urlGenerate;function normalize(aPath){var path=aPath;var url=urlParse(aPath);if(url){if(!url.path){return aPath}path=url.path}var isAbsolute=path.charAt(0)==="/";var parts=path.split(/\/+/);for(var part,up=0,i=parts.length-1;i>=0;i--){part=parts[i];if(part==="."){parts.splice(i,1)}else if(part===".."){up++}else if(up>0){if(part===""){parts.splice(i+1,up);up=0}else{parts.splice(i,2);up--}}}path=parts.join("/");if(path===""){path=isAbsolute?"/":"."}if(url){url.path=path;return urlGenerate(url)}return path}exports.normalize=normalize;function join(aRoot,aPath){if(aRoot===""){aRoot="."}if(aPath===""){aPath="."}var aPathUrl=urlParse(aPath);var aRootUrl=urlParse(aRoot);if(aRootUrl){aRoot=aRootUrl.path||"/"}if(aPathUrl&&!aPathUrl.scheme){if(aRootUrl){aPathUrl.scheme=aRootUrl.scheme}return urlGenerate(aPathUrl)}if(aPathUrl||aPath.match(dataUrlRegexp)){return aPath}if(aRootUrl&&!aRootUrl.host&&!aRootUrl.path){aRootUrl.host=aPath;return urlGenerate(aRootUrl)}var joined=aPath.charAt(0)==="/"?aPath:normalize(aRoot.replace(/\/+$/,"")+"/"+aPath);if(aRootUrl){aRootUrl.path=joined;return urlGenerate(aRootUrl)}return joined}exports.join=join;function relative(aRoot,aPath){if(aRoot===""){aRoot="."}aRoot=aRoot.replace(/\/$/,"");var url=urlParse(aRoot);if(aPath.charAt(0)=="/"&&url&&url.path=="/"){return aPath.slice(1)}return aPath.indexOf(aRoot+"/")===0?aPath.substr(aRoot.length+1):aPath}exports.relative=relative;function toSetString(aStr){return"$"+aStr}exports.toSetString=toSetString;function fromSetString(aStr){return aStr.substr(1)}exports.fromSetString=fromSetString;function strcmp(aStr1,aStr2){var s1=aStr1||"";var s2=aStr2||"";return(s1>s2)-(s1<s2)}function compareByOriginalPositions(mappingA,mappingB,onlyCompareOriginal){var cmp;cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp||onlyCompareOriginal){return cmp}cmp=strcmp(mappingA.name,mappingB.name);if(cmp){return cmp}cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}return mappingA.generatedColumn-mappingB.generatedColumn}exports.compareByOriginalPositions=compareByOriginalPositions;function compareByGeneratedPositions(mappingA,mappingB,onlyCompareGenerated){var cmp;cmp=mappingA.generatedLine-mappingB.generatedLine;if(cmp){return cmp}cmp=mappingA.generatedColumn-mappingB.generatedColumn;if(cmp||onlyCompareGenerated){return cmp}cmp=strcmp(mappingA.source,mappingB.source);if(cmp){return cmp}cmp=mappingA.originalLine-mappingB.originalLine;if(cmp){return cmp}cmp=mappingA.originalColumn-mappingB.originalColumn;if(cmp){return cmp}return strcmp(mappingA.name,mappingB.name)}exports.compareByGeneratedPositions=compareByGeneratedPositions})},{amdefine:191}],191:[function(require,module,exports){(function(process,__filename){"use strict";function amdefine(module,requireFn){"use strict";var defineCache={},loaderCache={},alreadyCalled=false,path=require("path"),makeRequire,stringRequire;function trimDots(ary){var i,part;for(i=0;ary[i];i+=1){part=ary[i];if(part==="."){ary.splice(i,1);i-=1}else if(part===".."){if(i===1&&(ary[2]===".."||ary[0]==="..")){break}else if(i>0){ary.splice(i-1,2);i-=2}}}}function normalize(name,baseName){var baseParts;if(name&&name.charAt(0)==="."){if(baseName){baseParts=baseName.split("/");baseParts=baseParts.slice(0,baseParts.length-1);baseParts=baseParts.concat(name.split("/"));trimDots(baseParts);name=baseParts.join("/")}}return name}function makeNormalize(relName){return function(name){return normalize(name,relName)}}function makeLoad(id){function load(value){loaderCache[id]=value}load.fromText=function(id,text){throw new Error("amdefine does not implement load.fromText")};return load}makeRequire=function(systemRequire,exports,module,relId){function amdRequire(deps,callback){if(typeof deps==="string"){return stringRequire(systemRequire,exports,module,deps,relId)}else{deps=deps.map(function(depName){return stringRequire(systemRequire,exports,module,depName,relId)});process.nextTick(function(){callback.apply(null,deps)})}}amdRequire.toUrl=function(filePath){if(filePath.indexOf(".")===0){return normalize(filePath,path.dirname(module.filename))}else{return filePath}};return amdRequire};requireFn=requireFn||function req(){return module.require.apply(module,arguments)};function runFactory(id,deps,factory){var r,e,m,result;if(id){e=loaderCache[id]={};m={id:id,uri:__filename,exports:e};r=makeRequire(requireFn,e,m,id)}else{if(alreadyCalled){throw new Error("amdefine with no module ID cannot be called more than once per file.")}alreadyCalled=true;e=module.exports;m=module;r=makeRequire(requireFn,e,m,module.id)}if(deps){deps=deps.map(function(depName){return r(depName)})}if(typeof factory==="function"){result=factory.apply(m.exports,deps)}else{result=factory}if(result!==undefined){m.exports=result;if(id){loaderCache[id]=m.exports}}}stringRequire=function(systemRequire,exports,module,id,relId){var index=id.indexOf("!"),originalId=id,prefix,plugin;if(index===-1){id=normalize(id,relId);if(id==="require"){return makeRequire(systemRequire,exports,module,relId)}else if(id==="exports"){return exports}else if(id==="module"){return module}else if(loaderCache.hasOwnProperty(id)){return loaderCache[id]}else if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}else{if(systemRequire){return systemRequire(originalId)}else{throw new Error("No module with ID: "+id)}}}else{prefix=id.substring(0,index);id=id.substring(index+1,id.length);plugin=stringRequire(systemRequire,exports,module,prefix,relId);if(plugin.normalize){id=plugin.normalize(id,makeNormalize(relId))}else{id=normalize(id,relId)}if(loaderCache[id]){return loaderCache[id]}else{plugin.load(id,makeRequire(systemRequire,exports,module,relId),makeLoad(id),{});return loaderCache[id]}}};function define(id,deps,factory){if(Array.isArray(id)){factory=deps;deps=id;id=undefined}else if(typeof id!=="string"){factory=id;id=deps=undefined}if(deps&&!Array.isArray(deps)){factory=deps;deps=undefined}if(!deps){deps=["require","exports","module"]}if(id){defineCache[id]=[id,deps,factory]}else{runFactory(id,deps,factory)}}define.require=function(id){if(loaderCache[id]){return loaderCache[id]}if(defineCache[id]){runFactory.apply(null,defineCache[id]);return loaderCache[id]}};define.amd={};return define}module.exports=amdefine}).call(this,require("_process"),"/node_modules/source-map/node_modules/amdefine/amdefine.js")},{_process:130,path:129}],192:[function(require,module,exports){(function(process){"use strict";var argv=process.argv;module.exports=function(){if(argv.indexOf("--no-color")!==-1||argv.indexOf("--no-colors")!==-1||argv.indexOf("--color=false")!==-1){return false}if(argv.indexOf("--color")!==-1||argv.indexOf("--colors")!==-1||argv.indexOf("--color=true")!==-1||argv.indexOf("--color=always")!==-1){return true}if(process.stdout&&!process.stdout.isTTY){return false}if(process.platform==="win32"){return true}if("COLORTERM"in process.env){return true}if(process.env.TERM==="dumb"){return false}if(/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)){return true}return false}()}).call(this,require("_process"))},{_process:130}],193:[function(require,module,exports){module.exports={name:"6to5",description:"Turn ES6 code into readable vanilla ES5 with source maps",version:"3.0.1",author:"Sebastian McKenzie <sebmck@gmail.com>",homepage:"https://6to5.org/",repository:"6to5/6to5",preferGlobal:true,main:"lib/6to5/index.js",bin:{"6to5":"./bin/6to5/index.js","6to5-node":"./bin/6to5-node"},browser:{"./lib/6to5/index.js":"./lib/6to5/browser.js","./lib/6to5/register.js":"./lib/6to5/register-browser.js"},keywords:["harmony","classes","modules","let","const","var","es6","transpile","transpiler","6to5"],scripts:{bench:"make bench",test:"make test"},dependencies:{"acorn-6to5":"0.11.1-25","ast-types":"~0.6.1",chalk:"^0.5.1",chokidar:"0.12.6",commander:"2.6.0","core-js":"0.4.6","detect-indent":"^3.0.0",estraverse:"1.9.1",esutils:"1.1.6",esvalid:"1.1.0","fs-readdir-recursive":"0.1.0","js-tokenizer":"^1.3.3",lodash:"3.0.0","output-file-sync":"^1.1.0","private":"0.1.6","regenerator-6to5":"0.8.9-6",regexpu:"1.1.0",roadrunner:"1.0.4","source-map":"0.1.43","source-map-support":"0.2.9","supports-color":"^1.2.0"},devDependencies:{browserify:"8.1.1",chai:"1.10.0",istanbul:"0.3.5",jscs:"^1.10.0",jshint:"2.6.0","jshint-stylish":"1.0.0",matcha:"0.6.0",mocha:"2.1.0",rimraf:"2.2.8","uglify-js":"2.4.16"},optionalDependencies:{kexec:"1.0.0"}}},{}],194:[function(require,module,exports){module.exports={"abstract-expression-call":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceGet",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"abstract-expression-delete":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceDelete",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"abstract-expression-get":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceGet",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"abstract-expression-set":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"PROPERTY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"referenceSet",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"apply-constructor":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"args",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"create",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"args",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"object",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"||",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"result",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instance",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"array-comprehension-container":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ArrayExpression",start:null,end:null,loc:null,range:null,elements:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"array-from":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"from",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"array-push":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"push",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STATEMENT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"async-to-generator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"fn",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"fn",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Promise",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"reject",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callNext",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"bind",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callThrow",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"bind",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"gen",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"throw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"FunctionDeclaration",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arg",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"TryStatement",start:null,end:null,loc:null,range:null,block:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"info",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arg",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"info",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},handler:{type:"CatchClause",start:null,end:null,loc:null,range:null,param:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"error",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},guard:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"reject",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"error",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},guardedHandlers:[],finalizer:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"info",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Promise",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"resolve",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"then",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callNext",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callThrow",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"callNext",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},bind:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Function",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"bind",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},call:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CONTEXT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"class-super-constructor-call-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SUPER_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"class-super-constructor-call":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CLASS_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CLASS_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"corejs-iterator":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CORE_ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"$for",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getIterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"default-parameter":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VARIABLE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENT_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"DEFAULT_VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENT_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},defaults:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defaults",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"define-property":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperty",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"enumerable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"exports-assign":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"exports-default-assign":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VALUE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"exports-module-declaration":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__esModule",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"extends":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:1,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"<",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:false,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"source",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"key",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"for-of-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:null,update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"IS_ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:">=",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:false,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LOOP_OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"INDEX",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"for-of":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"OBJECT",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STEP_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:true,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"STEP_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ITERATOR_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},get:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getOwnPropertyDescriptor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getPrototypeOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"parent",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"property",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Literal",start:null,end:null,loc:null,range:null,value:"value",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},operator:"in",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"desc",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"get",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"undefined",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"getter",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"receiver",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"has-own":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},inherits:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:null,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ThrowStatement",start:null,end:null,loc:null,range:null,argument:{type:"NewExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"TypeError",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Literal",start:null,end:null,loc:null,range:null,value:"Super expression must either be null or a function, not ",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},operator:"+",right:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"create",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"enumerable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:false,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"writable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"configurable",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Literal",start:null,end:null,loc:null,range:null,value:true,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"subClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__proto__",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"superClass",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"interop-require-wildcard":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__esModule",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"default",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"interop-require":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"__esModule",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"default",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"let-scoping-return":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"RETURN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"object",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"RETURN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"v",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"object-without-properties":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ForInStatement",start:null,end:null,loc:null,range:null,left:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"keys",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"indexOf",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:">=",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:0,raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ContinueStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:true,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"hasOwnProperty",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"call",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ContinueStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"target",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"property-method-assignment-wrapper":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_ID",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},generator:false,expression:false,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"apply",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"ThisExpression",start:null,end:null,loc:null,range:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arguments",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"toString",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"WRAPPER_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"FUNCTION",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"prototype-identifier":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"CLASS_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"prototype-properties":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"staticProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"child",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"instanceProps",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"require-assign-key":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"VARIABLE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"require",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},require:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"require",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},rest:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LEN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY_LEN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"START",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"<",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"LEN",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:{type:"UpdateExpression",start:null,end:null,loc:null,range:null,operator:"++",prefix:false,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARRAY_KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"KEY",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"self-global":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"global",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"self",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"global",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},slice:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"prototype",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"slice",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"sliced-to-array":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"ArrayExpression",start:null,end:null,loc:null,range:null,elements:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ForStatement",start:null,end:null,loc:null,range:null,init:{type:"VariableDeclaration",start:null,end:null,loc:null,range:null,declarations:[{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:true,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"VariableDeclarator",start:null,end:null,loc:null,range:null,id:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},init:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],kind:"var",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},test:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"!",prefix:true,argument:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_iterator",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"next",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"done",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},update:null,body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"push",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_step",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"length",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"i",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BreakStatement",start:null,end:null,loc:null,range:null,label:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"_arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},system:{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"System",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"register",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_NAME",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"MODULE_DEPENDENCIES",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"EXPORT_IDENTIFIER",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"setters",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"SETTERS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"execute",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"EXECUTE",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"tagged-template-literal-loose":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"AssignmentExpression",start:null,end:null,loc:null,range:null,operator:"=",left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"tagged-template-literal":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"freeze",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"defineProperties",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"strings",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"ObjectExpression",start:null,end:null,loc:null,range:null,properties:[{type:"Property",start:null,end:null,loc:null,range:null,method:false,shorthand:false,computed:false,key:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"value",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},value:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Object",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"freeze",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"raw",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},kind:"init",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"test-exports":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"exports",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"test-module":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"module",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"!==",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"undefined",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"to-array":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"isArray",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},alternate:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Array",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"from",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"arr",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"typeof":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ReturnStatement",start:null,end:null,loc:null,range:null,argument:{type:"ConditionalExpression",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"constructor",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"Symbol",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"Literal",start:null,end:null,loc:null,range:null,value:"symbol",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},alternate:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"obj",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},"umd-runner-body":{type:"Program",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"FunctionExpression",start:null,end:null,loc:null,range:null,id:null,generator:false,expression:false,params:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],body:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"LogicalExpression",start:null,end:null,loc:null,range:null,left:{type:"BinaryExpression",start:null,end:null,loc:null,range:null,left:{type:"UnaryExpression",start:null,end:null,loc:null,range:null,operator:"typeof",prefix:true,argument:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"===",right:{type:"Literal",start:null,end:null,loc:null,range:null,value:"function",raw:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},operator:"&&",right:{type:"MemberExpression",start:null,end:null,loc:null,range:null,object:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},property:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"amd",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},computed:false,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"define",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"AMD_ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:{type:"IfStatement",start:null,end:null,loc:null,range:null,test:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"COMMON_TEST",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},consequent:{type:"BlockStatement",start:null,end:null,loc:null,range:null,body:[{type:"ExpressionStatement",start:null,end:null,loc:null,range:null,expression:{type:"CallExpression",start:null,end:null,loc:null,range:null,callee:{type:"Identifier",start:null,end:null,loc:null,range:null,name:"factory",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},arguments:[{type:"Identifier",start:null,end:null,loc:null,range:null,name:"COMMON_ARGUMENTS",_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},alternate:null,_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_scopeInfo:null,_declarations:null,extendedRange:null,tokens:null,raw:null},_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}],_declarations:null,extendedRange:null,_scopeInfo:null,tokens:null,raw:null}}
},{}]},{},[1])(1)}); | the-destro/cdnjs | ajax/libs/6to5/3.0.1/browser.js | JavaScript | mit | 866,847 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
<title>FixedColumns example - Basic initialisation</title>
<link rel="stylesheet" type="text/css" href="../../../media/css/jquery.dataTables.css">
<link rel="stylesheet" type="text/css" href="../css/dataTables.fixedColumns.css">
<link rel="stylesheet" type="text/css" href="../../../examples/resources/syntax/shCore.css">
<link rel="stylesheet" type="text/css" href="../../../examples/resources/demo.css">
<style type="text/css" class="init">
/* Ensure that the demo table scrolls */
th, td { white-space: nowrap; }
div.dataTables_wrapper {
width: 800px;
margin: 0 auto;
}
</style>
<script type="text/javascript" language="javascript" src="../../../media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="../../../media/js/jquery.dataTables.js"></script>
<script type="text/javascript" language="javascript" src="../js/dataTables.fixedColumns.js"></script>
<script type="text/javascript" language="javascript" src="../../../examples/resources/syntax/shCore.js"></script>
<script type="text/javascript" language="javascript" src="../../../examples/resources/demo.js"></script>
<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
var table = $('#example').DataTable( {
scrollY: "300px",
scrollX: true,
scrollCollapse: true,
paging: false
} );
new $.fn.dataTable.FixedColumns( table );
} );
</script>
</head>
<body class="dt-example">
<div class="container">
<section>
<h1>FixedColumns example <span>Basic initialisation</span></h1>
<div class="info">
<p>When displaying a table which scrolls along the x-axis, it can sometimes be useful to the end user
for the left most column to be fixed in place, if it shows grouping, index or similar information. This
is basically the same idea as 'freeze columns' in Excel. This can be achieved with the FixedColumns
plug-in for DataTables, as shown below.</p>
<p>Note that FixedColumns is suitable only for use with the scrolling features in <a href=
"http://datatables.net">DataTables</a>. If you want to achieve a similar effect without scrolling
enabled, please checkout <a href="http://datatables.net/plug-ins">FixedHeader</a>, also for
DataTables.</p>
<p>FixedColumns is initialised using the constructor <code>new $.fn.dataTable.FixedColumns();</code> -
shown below.</p>
</div>
<table id="example" class="stripe row-border order-column" cellspacing="0" width="100%">
<thead>
<tr>
<th>First name</th>
<th>Last name</th>
<th>Position</th>
<th>Office</th>
<th>Age</th>
<th>Start date</th>
<th>Salary</th>
<th>Extn.</th>
<th>E-mail</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tiger</td>
<td>Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
<td>5421</td>
<td>t.nixon@datatables.net</td>
</tr>
<tr>
<td>Garrett</td>
<td>Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
<td>8422</td>
<td>g.winters@datatables.net</td>
</tr>
<tr>
<td>Ashton</td>
<td>Cox</td>
<td>Junior Technical Author</td>
<td>San Francisco</td>
<td>66</td>
<td>2009/01/12</td>
<td>$86,000</td>
<td>1562</td>
<td>a.cox@datatables.net</td>
</tr>
<tr>
<td>Cedric</td>
<td>Kelly</td>
<td>Senior Javascript Developer</td>
<td>Edinburgh</td>
<td>22</td>
<td>2012/03/29</td>
<td>$433,060</td>
<td>6224</td>
<td>c.kelly@datatables.net</td>
</tr>
<tr>
<td>Airi</td>
<td>Satou</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>33</td>
<td>2008/11/28</td>
<td>$162,700</td>
<td>5407</td>
<td>a.satou@datatables.net</td>
</tr>
<tr>
<td>Brielle</td>
<td>Williamson</td>
<td>Integration Specialist</td>
<td>New York</td>
<td>61</td>
<td>2012/12/02</td>
<td>$372,000</td>
<td>4804</td>
<td>b.williamson@datatables.net</td>
</tr>
<tr>
<td>Herrod</td>
<td>Chandler</td>
<td>Sales Assistant</td>
<td>San Francisco</td>
<td>59</td>
<td>2012/08/06</td>
<td>$137,500</td>
<td>9608</td>
<td>h.chandler@datatables.net</td>
</tr>
<tr>
<td>Rhona</td>
<td>Davidson</td>
<td>Integration Specialist</td>
<td>Tokyo</td>
<td>55</td>
<td>2010/10/14</td>
<td>$327,900</td>
<td>6200</td>
<td>r.davidson@datatables.net</td>
</tr>
<tr>
<td>Colleen</td>
<td>Hurst</td>
<td>Javascript Developer</td>
<td>San Francisco</td>
<td>39</td>
<td>2009/09/15</td>
<td>$205,500</td>
<td>2360</td>
<td>c.hurst@datatables.net</td>
</tr>
<tr>
<td>Sonya</td>
<td>Frost</td>
<td>Software Engineer</td>
<td>Edinburgh</td>
<td>23</td>
<td>2008/12/13</td>
<td>$103,600</td>
<td>1667</td>
<td>s.frost@datatables.net</td>
</tr>
<tr>
<td>Jena</td>
<td>Gaines</td>
<td>Office Manager</td>
<td>London</td>
<td>30</td>
<td>2008/12/19</td>
<td>$90,560</td>
<td>3814</td>
<td>j.gaines@datatables.net</td>
</tr>
<tr>
<td>Quinn</td>
<td>Flynn</td>
<td>Support Lead</td>
<td>Edinburgh</td>
<td>22</td>
<td>2013/03/03</td>
<td>$342,000</td>
<td>9497</td>
<td>q.flynn@datatables.net</td>
</tr>
<tr>
<td>Charde</td>
<td>Marshall</td>
<td>Regional Director</td>
<td>San Francisco</td>
<td>36</td>
<td>2008/10/16</td>
<td>$470,600</td>
<td>6741</td>
<td>c.marshall@datatables.net</td>
</tr>
<tr>
<td>Haley</td>
<td>Kennedy</td>
<td>Senior Marketing Designer</td>
<td>London</td>
<td>43</td>
<td>2012/12/18</td>
<td>$313,500</td>
<td>3597</td>
<td>h.kennedy@datatables.net</td>
</tr>
<tr>
<td>Tatyana</td>
<td>Fitzpatrick</td>
<td>Regional Director</td>
<td>London</td>
<td>19</td>
<td>2010/03/17</td>
<td>$385,750</td>
<td>1965</td>
<td>t.fitzpatrick@datatables.net</td>
</tr>
<tr>
<td>Michael</td>
<td>Silva</td>
<td>Marketing Designer</td>
<td>London</td>
<td>66</td>
<td>2012/11/27</td>
<td>$198,500</td>
<td>1581</td>
<td>m.silva@datatables.net</td>
</tr>
<tr>
<td>Paul</td>
<td>Byrd</td>
<td>Chief Financial Officer (CFO)</td>
<td>New York</td>
<td>64</td>
<td>2010/06/09</td>
<td>$725,000</td>
<td>3059</td>
<td>p.byrd@datatables.net</td>
</tr>
<tr>
<td>Gloria</td>
<td>Little</td>
<td>Systems Administrator</td>
<td>New York</td>
<td>59</td>
<td>2009/04/10</td>
<td>$237,500</td>
<td>1721</td>
<td>g.little@datatables.net</td>
</tr>
<tr>
<td>Bradley</td>
<td>Greer</td>
<td>Software Engineer</td>
<td>London</td>
<td>41</td>
<td>2012/10/13</td>
<td>$132,000</td>
<td>2558</td>
<td>b.greer@datatables.net</td>
</tr>
<tr>
<td>Dai</td>
<td>Rios</td>
<td>Personnel Lead</td>
<td>Edinburgh</td>
<td>35</td>
<td>2012/09/26</td>
<td>$217,500</td>
<td>2290</td>
<td>d.rios@datatables.net</td>
</tr>
<tr>
<td>Jenette</td>
<td>Caldwell</td>
<td>Development Lead</td>
<td>New York</td>
<td>30</td>
<td>2011/09/03</td>
<td>$345,000</td>
<td>1937</td>
<td>j.caldwell@datatables.net</td>
</tr>
<tr>
<td>Yuri</td>
<td>Berry</td>
<td>Chief Marketing Officer (CMO)</td>
<td>New York</td>
<td>40</td>
<td>2009/06/25</td>
<td>$675,000</td>
<td>6154</td>
<td>y.berry@datatables.net</td>
</tr>
<tr>
<td>Caesar</td>
<td>Vance</td>
<td>Pre-Sales Support</td>
<td>New York</td>
<td>21</td>
<td>2011/12/12</td>
<td>$106,450</td>
<td>8330</td>
<td>c.vance@datatables.net</td>
</tr>
<tr>
<td>Doris</td>
<td>Wilder</td>
<td>Sales Assistant</td>
<td>Sidney</td>
<td>23</td>
<td>2010/09/20</td>
<td>$85,600</td>
<td>3023</td>
<td>d.wilder@datatables.net</td>
</tr>
<tr>
<td>Angelica</td>
<td>Ramos</td>
<td>Chief Executive Officer (CEO)</td>
<td>London</td>
<td>47</td>
<td>2009/10/09</td>
<td>$1,200,000</td>
<td>5797</td>
<td>a.ramos@datatables.net</td>
</tr>
<tr>
<td>Gavin</td>
<td>Joyce</td>
<td>Developer</td>
<td>Edinburgh</td>
<td>42</td>
<td>2010/12/22</td>
<td>$92,575</td>
<td>8822</td>
<td>g.joyce@datatables.net</td>
</tr>
<tr>
<td>Jennifer</td>
<td>Chang</td>
<td>Regional Director</td>
<td>Singapore</td>
<td>28</td>
<td>2010/11/14</td>
<td>$357,650</td>
<td>9239</td>
<td>j.chang@datatables.net</td>
</tr>
<tr>
<td>Brenden</td>
<td>Wagner</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>28</td>
<td>2011/06/07</td>
<td>$206,850</td>
<td>1314</td>
<td>b.wagner@datatables.net</td>
</tr>
<tr>
<td>Fiona</td>
<td>Green</td>
<td>Chief Operating Officer (COO)</td>
<td>San Francisco</td>
<td>48</td>
<td>2010/03/11</td>
<td>$850,000</td>
<td>2947</td>
<td>f.green@datatables.net</td>
</tr>
<tr>
<td>Shou</td>
<td>Itou</td>
<td>Regional Marketing</td>
<td>Tokyo</td>
<td>20</td>
<td>2011/08/14</td>
<td>$163,000</td>
<td>8899</td>
<td>s.itou@datatables.net</td>
</tr>
<tr>
<td>Michelle</td>
<td>House</td>
<td>Integration Specialist</td>
<td>Sidney</td>
<td>37</td>
<td>2011/06/02</td>
<td>$95,400</td>
<td>2769</td>
<td>m.house@datatables.net</td>
</tr>
<tr>
<td>Suki</td>
<td>Burks</td>
<td>Developer</td>
<td>London</td>
<td>53</td>
<td>2009/10/22</td>
<td>$114,500</td>
<td>6832</td>
<td>s.burks@datatables.net</td>
</tr>
<tr>
<td>Prescott</td>
<td>Bartlett</td>
<td>Technical Author</td>
<td>London</td>
<td>27</td>
<td>2011/05/07</td>
<td>$145,000</td>
<td>3606</td>
<td>p.bartlett@datatables.net</td>
</tr>
<tr>
<td>Gavin</td>
<td>Cortez</td>
<td>Team Leader</td>
<td>San Francisco</td>
<td>22</td>
<td>2008/10/26</td>
<td>$235,500</td>
<td>2860</td>
<td>g.cortez@datatables.net</td>
</tr>
<tr>
<td>Martena</td>
<td>Mccray</td>
<td>Post-Sales support</td>
<td>Edinburgh</td>
<td>46</td>
<td>2011/03/09</td>
<td>$324,050</td>
<td>8240</td>
<td>m.mccray@datatables.net</td>
</tr>
<tr>
<td>Unity</td>
<td>Butler</td>
<td>Marketing Designer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/12/09</td>
<td>$85,675</td>
<td>5384</td>
<td>u.butler@datatables.net</td>
</tr>
<tr>
<td>Howard</td>
<td>Hatfield</td>
<td>Office Manager</td>
<td>San Francisco</td>
<td>51</td>
<td>2008/12/16</td>
<td>$164,500</td>
<td>7031</td>
<td>h.hatfield@datatables.net</td>
</tr>
<tr>
<td>Hope</td>
<td>Fuentes</td>
<td>Secretary</td>
<td>San Francisco</td>
<td>41</td>
<td>2010/02/12</td>
<td>$109,850</td>
<td>6318</td>
<td>h.fuentes@datatables.net</td>
</tr>
<tr>
<td>Vivian</td>
<td>Harrell</td>
<td>Financial Controller</td>
<td>San Francisco</td>
<td>62</td>
<td>2009/02/14</td>
<td>$452,500</td>
<td>9422</td>
<td>v.harrell@datatables.net</td>
</tr>
<tr>
<td>Timothy</td>
<td>Mooney</td>
<td>Office Manager</td>
<td>London</td>
<td>37</td>
<td>2008/12/11</td>
<td>$136,200</td>
<td>7580</td>
<td>t.mooney@datatables.net</td>
</tr>
<tr>
<td>Jackson</td>
<td>Bradshaw</td>
<td>Director</td>
<td>New York</td>
<td>65</td>
<td>2008/09/26</td>
<td>$645,750</td>
<td>1042</td>
<td>j.bradshaw@datatables.net</td>
</tr>
<tr>
<td>Olivia</td>
<td>Liang</td>
<td>Support Engineer</td>
<td>Singapore</td>
<td>64</td>
<td>2011/02/03</td>
<td>$234,500</td>
<td>2120</td>
<td>o.liang@datatables.net</td>
</tr>
<tr>
<td>Bruno</td>
<td>Nash</td>
<td>Software Engineer</td>
<td>London</td>
<td>38</td>
<td>2011/05/03</td>
<td>$163,500</td>
<td>6222</td>
<td>b.nash@datatables.net</td>
</tr>
<tr>
<td>Sakura</td>
<td>Yamamoto</td>
<td>Support Engineer</td>
<td>Tokyo</td>
<td>37</td>
<td>2009/08/19</td>
<td>$139,575</td>
<td>9383</td>
<td>s.yamamoto@datatables.net</td>
</tr>
<tr>
<td>Thor</td>
<td>Walton</td>
<td>Developer</td>
<td>New York</td>
<td>61</td>
<td>2013/08/11</td>
<td>$98,540</td>
<td>8327</td>
<td>t.walton@datatables.net</td>
</tr>
<tr>
<td>Finn</td>
<td>Camacho</td>
<td>Support Engineer</td>
<td>San Francisco</td>
<td>47</td>
<td>2009/07/07</td>
<td>$87,500</td>
<td>2927</td>
<td>f.camacho@datatables.net</td>
</tr>
<tr>
<td>Serge</td>
<td>Baldwin</td>
<td>Data Coordinator</td>
<td>Singapore</td>
<td>64</td>
<td>2012/04/09</td>
<td>$138,575</td>
<td>8352</td>
<td>s.baldwin@datatables.net</td>
</tr>
<tr>
<td>Zenaida</td>
<td>Frank</td>
<td>Software Engineer</td>
<td>New York</td>
<td>63</td>
<td>2010/01/04</td>
<td>$125,250</td>
<td>7439</td>
<td>z.frank@datatables.net</td>
</tr>
<tr>
<td>Zorita</td>
<td>Serrano</td>
<td>Software Engineer</td>
<td>San Francisco</td>
<td>56</td>
<td>2012/06/01</td>
<td>$115,000</td>
<td>4389</td>
<td>z.serrano@datatables.net</td>
</tr>
<tr>
<td>Jennifer</td>
<td>Acosta</td>
<td>Junior Javascript Developer</td>
<td>Edinburgh</td>
<td>43</td>
<td>2013/02/01</td>
<td>$75,650</td>
<td>3431</td>
<td>j.acosta@datatables.net</td>
</tr>
<tr>
<td>Cara</td>
<td>Stevens</td>
<td>Sales Assistant</td>
<td>New York</td>
<td>46</td>
<td>2011/12/06</td>
<td>$145,600</td>
<td>3990</td>
<td>c.stevens@datatables.net</td>
</tr>
<tr>
<td>Hermione</td>
<td>Butler</td>
<td>Regional Director</td>
<td>London</td>
<td>47</td>
<td>2011/03/21</td>
<td>$356,250</td>
<td>1016</td>
<td>h.butler@datatables.net</td>
</tr>
<tr>
<td>Lael</td>
<td>Greer</td>
<td>Systems Administrator</td>
<td>London</td>
<td>21</td>
<td>2009/02/27</td>
<td>$103,500</td>
<td>6733</td>
<td>l.greer@datatables.net</td>
</tr>
<tr>
<td>Jonas</td>
<td>Alexander</td>
<td>Developer</td>
<td>San Francisco</td>
<td>30</td>
<td>2010/07/14</td>
<td>$86,500</td>
<td>8196</td>
<td>j.alexander@datatables.net</td>
</tr>
<tr>
<td>Shad</td>
<td>Decker</td>
<td>Regional Director</td>
<td>Edinburgh</td>
<td>51</td>
<td>2008/11/13</td>
<td>$183,000</td>
<td>6373</td>
<td>s.decker@datatables.net</td>
</tr>
<tr>
<td>Michael</td>
<td>Bruce</td>
<td>Javascript Developer</td>
<td>Singapore</td>
<td>29</td>
<td>2011/06/27</td>
<td>$183,000</td>
<td>5384</td>
<td>m.bruce@datatables.net</td>
</tr>
<tr>
<td>Donna</td>
<td>Snider</td>
<td>Customer Support</td>
<td>New York</td>
<td>27</td>
<td>2011/01/25</td>
<td>$112,000</td>
<td>4226</td>
<td>d.snider@datatables.net</td>
</tr>
</tbody>
</table>
<ul class="tabs">
<li class="active">Javascript</li>
<li>HTML</li>
<li>CSS</li>
<li>Ajax</li>
<li>Server-side script</li>
</ul>
<div class="tabs">
<div class="js">
<p>The Javascript shown below is used to initialise the table shown in this
example:</p><code class="multiline brush: js;">$(document).ready(function() {
var table = $('#example').DataTable( {
scrollY: "300px",
scrollX: true,
scrollCollapse: true,
paging: false
} );
new $.fn.dataTable.FixedColumns( table );
} );</code>
<p>In addition to the above code, the following Javascript library files are loaded for use in this
example:</p>
<ul>
<li><a href="../../../media/js/jquery.js">../../../media/js/jquery.js</a></li>
<li><a href=
"../../../media/js/jquery.dataTables.js">../../../media/js/jquery.dataTables.js</a></li>
<li><a href="../js/dataTables.fixedColumns.js">../js/dataTables.fixedColumns.js</a></li>
</ul>
</div>
<div class="table">
<p>The HTML shown below is the raw HTML table element, before it has been enhanced by
DataTables:</p>
</div>
<div class="css">
<div>
<p>This example uses a little bit of additional CSS beyond what is loaded from the library
files (below), in order to correctly display the table. The additional CSS used is shown
below:</p><code class="multiline brush: js;">/* Ensure that the demo table scrolls */
th, td { white-space: nowrap; }
div.dataTables_wrapper {
width: 800px;
margin: 0 auto;
}</code>
</div>
<p>The following CSS library files are loaded for use in this example to provide the styling of the
table:</p>
<ul>
<li><a href=
"../../../media/css/jquery.dataTables.css">../../../media/css/jquery.dataTables.css</a></li>
<li><a href="../css/dataTables.fixedColumns.css">../css/dataTables.fixedColumns.css</a></li>
</ul>
</div>
<div class="ajax">
<p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data
will update automatically as any additional data is loaded.</p>
</div>
<div class="php">
<p>The script used to perform the server-side processing for this table is shown below. Please note
that this is just an example script using PHP. Server-side processing scripts can be written in any
language, using <a href="//datatables.net/manual/server-side">the protocol described in the
DataTables documentation</a>.</p>
</div>
</div>
</section>
</div>
<section>
<div class="footer">
<div class="gradient"></div>
<div class="liner">
<h2>Other examples</h2>
<div class="toc">
<div class="toc-group">
<h3><a href="./index.html">Examples</a></h3>
<ul class="toc active">
<li><a href="./left_right_columns.html">Left and right fixed columns</a></li>
<li class="active"><a href="./simple.html">Basic initialisation</a></li>
<li><a href="./two_columns.html">Multiple fixed columns</a></li>
<li><a href="./right_column.html">Right column only</a></li>
<li><a href="./rowspan.html">Complex headers</a></li>
<li><a href="./colvis.html">ColVis integration</a></li>
<li><a href="./server-side-processing.html">Server-side processing</a></li>
<li><a href="./css_size.html">CSS row sizing</a></li>
<li><a href="./size_fixed.html">Assigned column width</a></li>
<li><a href="./size_fluid.html">Fluid column width</a></li>
<li><a href="./col_filter.html">Individual column filtering</a></li>
<li><a href="./bootstrap.html">Bootstrap</a></li>
<li><a href="./index_column.html">Index column</a></li>
</ul>
</div>
</div>
<div class="epilogue">
<p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full
information about its API properties and methods.<br>
Additionally, there are a wide range of <a href="http://www.datatables.net/extras">extras</a> and
<a href="http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of
DataTables.</p>
<p class="copyright">DataTables designed and created by <a href=
"http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2014<br>
DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
</div>
</div>
</div>
</section>
</body>
</html> | BabyChakraborty/FinalProject-Laravel5-Contactus-Module | public/assets/global/plugins/datatables/extensions/FixedColumns/examples/simple.html | HTML | mit | 21,751 |
<?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\Bundle\FrameworkBundle\Templating\Helper;
use Symfony\Component\Templating\Helper\Helper;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* RouterHelper manages links between pages in a template context.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class RouterHelper extends Helper
{
protected $generator;
/**
* Constructor.
*
* @param UrlGeneratorInterface $router A Router instance
*/
public function __construct(UrlGeneratorInterface $router)
{
$this->generator = $router;
}
/**
* Generates a URL from the given parameters.
*
* @param string $name The name of the route
* @param mixed $parameters An array of parameters
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
*
* @return string The generated URL
*
* @see UrlGeneratorInterface
*/
public function generate($name, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
{
return $this->generator->generate($name, $parameters, $referenceType);
}
/**
* Returns the canonical name of this helper.
*
* @return string The canonical name
*/
public function getName()
{
return 'router';
}
}
| andreymaznyak/ontologydatabase | vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php | PHP | mit | 1,615 |
<?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 Sensio\Bundle\GeneratorBundle\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\Question;
use Sensio\Bundle\GeneratorBundle\Command\Helper\QuestionHelper;
use Sensio\Bundle\GeneratorBundle\Generator\ControllerGenerator;
/**
* Generates controllers.
*
* @author Wouter J <wouter@wouterj.nl>
*/
class GenerateControllerCommand extends GeneratorCommand
{
/**
* @see Command
*/
public function configure()
{
$this
->setDefinition(array(
new InputOption('controller', '', InputOption::VALUE_REQUIRED, 'The name of the controller to create'),
new InputOption('route-format', '', InputOption::VALUE_REQUIRED, 'The format that is used for the routing (yml, xml, php, annotation)', 'annotation'),
new InputOption('template-format', '', InputOption::VALUE_REQUIRED, 'The format that is used for templating (twig, php)', 'twig'),
new InputOption('actions', '', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'The actions in the controller'),
))
->setDescription('Generates a controller')
->setHelp(<<<EOT
The <info>generate:controller</info> command helps you generates new controllers
inside bundles.
By default, the command interacts with the developer to tweak the generation.
Any passed option will be used as a default value for the interaction
(<comment>--bundle</comment> and <comment>--controller</comment> are the only
ones needed if you follow the conventions):
<info>php app/console generate:controller --controller=AcmeBlogBundle:Post</info>
If you want to disable any user interaction, use <comment>--no-interaction</comment>
but don't forget to pass all needed options:
<info>php app/console generate:controller --controller=AcmeBlogBundle:Post --no-interaction</info>
Every generated file is based on a template. There are default templates but they can
be overriden by placing custom templates in one of the following locations, by order of priority:
<info>BUNDLE_PATH/Resources/SensioGeneratorBundle/skeleton/controller
APP_PATH/Resources/SensioGeneratorBundle/skeleton/controller</info>
You can check https://github.com/sensio/SensioGeneratorBundle/tree/master/Resources/skeleton
in order to know the file structure of the skeleton
EOT
)
->setName('generate:controller')
;
}
public function execute(InputInterface $input, OutputInterface $output)
{
$questionHelper = $this->getQuestionHelper();
if ($input->isInteractive()) {
$question = new Question($questionHelper->getQuestion('Do you confirm generation', 'yes', '?'), true);
if (!$questionHelper->ask($input, $output, $question)) {
$output->writeln('<error>Command aborted</error>');
return 1;
}
}
if (null === $input->getOption('controller')) {
throw new \RuntimeException('The controller option must be provided.');
}
list($bundle, $controller) = $this->parseShortcutNotation($input->getOption('controller'));
if (is_string($bundle)) {
$bundle = Validators::validateBundleName($bundle);
try {
$bundle = $this->getContainer()->get('kernel')->getBundle($bundle);
} catch (\Exception $e) {
$output->writeln(sprintf('<bg=red>Bundle "%s" does not exist.</>', $bundle));
}
}
$questionHelper->writeSection($output, 'Controller generation');
$generator = $this->getGenerator($bundle);
$generator->generate($bundle, $controller, $input->getOption('route-format'), $input->getOption('template-format'), $this->parseActions($input->getOption('actions')));
$output->writeln('Generating the bundle code: <info>OK</info>');
$questionHelper->writeGeneratorSummary($output, array());
}
public function interact(InputInterface $input, OutputInterface $output)
{
$questionHelper = $this->getQuestionHelper();
$questionHelper->writeSection($output, 'Welcome to the Symfony2 controller generator');
// namespace
$output->writeln(array(
'',
'Every page, and even sections of a page, are rendered by a <comment>controller</comment>.',
'This command helps you generate them easily.',
'',
'First, you need to give the controller name you want to generate.',
'You must use the shortcut notation like <comment>AcmeBlogBundle:Post</comment>',
'',
));
while (true) {
$question = new Question($questionHelper->getQuestion('Controller name', $input->getOption('controller')), $input->getOption('controller'));
$question->setValidator(array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateControllerName'));
$controller = $questionHelper->ask($input, $output, $question);
list($bundle, $controller) = $this->parseShortcutNotation($controller);
try {
$b = $this->getContainer()->get('kernel')->getBundle($bundle);
if (!file_exists($b->getPath().'/Controller/'.$controller.'Controller.php')) {
break;
}
$output->writeln(sprintf('<bg=red>Controller "%s:%s" already exists.</>', $bundle, $controller));
} catch (\Exception $e) {
$output->writeln(sprintf('<bg=red>Bundle "%s" does not exist.</>', $bundle));
}
}
$input->setOption('controller', $bundle.':'.$controller);
// routing format
$defaultFormat = (null !== $input->getOption('route-format') ? $input->getOption('route-format') : 'annotation');
$output->writeln(array(
'',
'Determine the format to use for the routing.',
'',
));
$question = new Question($questionHelper->getQuestion('Routing format (php, xml, yml, annotation)', $defaultFormat), $defaultFormat);
$question->setValidator(array('Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateFormat'));
$routeFormat = $questionHelper->ask($input, $output, $question);
$input->setOption('route-format', $routeFormat);
// templating format
$validateTemplateFormat = function ($format) {
if (!in_array($format, array('twig', 'php'))) {
throw new \InvalidArgumentException(sprintf('The template format must be twig or php, "%s" given', $format));
}
return $format;
};
$defaultFormat = (null !== $input->getOption('template-format') ? $input->getOption('template-format') : 'twig');
$output->writeln(array(
'',
'Determine the format to use for templating.',
'',
));
$question = new Question($questionHelper->getQuestion('Template format (twig, php)', $defaultFormat), $defaultFormat);
$question->setValidator($validateTemplateFormat);
$templateFormat = $questionHelper->ask($input, $output, $question);
$input->setOption('template-format', $templateFormat);
// actions
$input->setOption('actions', $this->addActions($input, $output, $questionHelper));
// summary
$output->writeln(array(
'',
$this->getHelper('formatter')->formatBlock('Summary before generation', 'bg=blue;fg-white', true),
'',
sprintf('You are going to generate a "<info>%s:%s</info>" controller', $bundle, $controller),
sprintf('using the "<info>%s</info>" format for the routing and the "<info>%s</info>" format', $routeFormat, $templateFormat),
'for templating',
));
}
public function addActions(InputInterface $input, OutputInterface $output, QuestionHelper $questionHelper)
{
$output->writeln(array(
'',
'Instead of starting with a blank controller, you can add some actions now. An action',
'is a PHP function or method that executes, for example, when a given route is matched.',
'Actions should be suffixed by <comment>Action</comment>.',
'',
));
$templateNameValidator = function ($name) {
if ('default' == $name) {
return $name;
}
if (2 != substr_count($name, ':')) {
throw new \InvalidArgumentException(sprintf('Template name "%s" does not have 2 colons', $name));
}
return $name;
};
$actions = $this->parseActions($input->getOption('actions'));
while (true) {
// name
$output->writeln('');
$question = new Question($questionHelper->getQuestion('New action name (press <return> to stop adding actions)', null), null);
$question->setValidator(function ($name) use ($actions) {
if (null == $name) {
return $name;
}
if (isset($actions[$name])) {
throw new \InvalidArgumentException(sprintf('Action "%s" is already defined', $name));
}
if ('Action' != substr($name, -6)) {
throw new \InvalidArgumentException(sprintf('Name "%s" is not suffixed by Action', $name));
}
return $name;
});
$actionName = $questionHelper->ask($input, $output, $question);
if (!$actionName) {
break;
}
// route
$question = new Question($questionHelper->getQuestion('Action route', '/'.substr($actionName, 0, -6)), '/'.substr($actionName, 0, -6));
$route = $questionHelper->ask($input, $output, $question);
$placeholders = $this->getPlaceholdersFromRoute($route);
// template
$defaultTemplate = $input->getOption('controller').':'.substr($actionName, 0, -6).'.html.'.$input->getOption('template-format');
$question = new Question($questionHelper->getQuestion('Templatename (optional)', $defaultTemplate), 'default');
$template = $questionHelper->ask($input, $output, $question);
// adding action
$actions[$actionName] = array(
'name' => $actionName,
'route' => $route,
'placeholders' => $placeholders,
'template' => $template,
);
}
return $actions;
}
public function parseActions($actions)
{
if (is_array($actions)) {
return $actions;
}
$newActions = array();
foreach (explode(' ', $actions) as $action) {
$data = explode(':', $action);
// name
if (!isset($data[0])) {
throw new \InvalidArgumentException('An action must have a name');
}
$name = array_shift($data);
// route
$route = (isset($data[0]) && '' != $data[0]) ? array_shift($data) : '/'.substr($name, 0, -6);
if ($route) {
$placeholders = $this->getPlaceholdersFromRoute($route);
} else {
$placeholders = array();
}
// template
$template = (0 < count($data) && '' != $data[0]) ? implode(':', $data) : 'default';
$newActions[$name] = array(
'name' => $name,
'route' => $route,
'placeholders' => $placeholders,
'template' => $template,
);
}
return $newActions;
}
public function getPlaceholdersFromRoute($route)
{
preg_match_all('/{(.*?)}/', $route, $placeholders);
$placeholders = $placeholders[1];
return $placeholders;
}
public function parseShortcutNotation($shortcut)
{
$entity = str_replace('/', '\\', $shortcut);
if (false === $pos = strpos($entity, ':')) {
throw new \InvalidArgumentException(sprintf('The controller name must contain a : ("%s" given, expecting something like AcmeBlogBundle:Post)', $entity));
}
return array(substr($entity, 0, $pos), substr($entity, $pos + 1));
}
protected function createGenerator()
{
return new ControllerGenerator($this->getContainer()->get('filesystem'));
}
}
| boristheflako/pesunia | vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Command/GenerateControllerCommand.php | PHP | mit | 12,933 |
<?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\Bundle\FrameworkBundle\Templating\Helper;
use Symfony\Component\Templating\Helper\Helper;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
/**
* RouterHelper manages links between pages in a template context.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class RouterHelper extends Helper
{
protected $generator;
/**
* Constructor.
*
* @param UrlGeneratorInterface $router A Router instance
*/
public function __construct(UrlGeneratorInterface $router)
{
$this->generator = $router;
}
/**
* Generates a URL from the given parameters.
*
* @param string $name The name of the route
* @param mixed $parameters An array of parameters
* @param bool|string $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
*
* @return string The generated URL
*
* @see UrlGeneratorInterface
*/
public function generate($name, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
{
return $this->generator->generate($name, $parameters, $referenceType);
}
/**
* Returns the canonical name of this helper.
*
* @return string The canonical name
*/
public function getName()
{
return 'router';
}
}
| inpronet/s2-0714 | vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RouterHelper.php | PHP | mit | 1,615 |
<?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\EventDispatcher\Tests;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase
{
/* Some pseudo events */
const preFoo = 'pre.foo';
const postFoo = 'post.foo';
const preBar = 'pre.bar';
const postBar = 'post.bar';
/**
* @var EventDispatcher
*/
private $dispatcher;
private $listener;
protected function setUp()
{
$this->dispatcher = $this->createEventDispatcher();
$this->listener = new TestEventListener();
}
protected function tearDown()
{
$this->dispatcher = null;
$this->listener = null;
}
abstract protected function createEventDispatcher();
public function testInitialState()
{
$this->assertEquals(array(), $this->dispatcher->getListeners());
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
$this->assertFalse($this->dispatcher->hasListeners(self::postFoo));
}
public function testAddListener()
{
$this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo'));
$this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'));
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
$this->assertCount(1, $this->dispatcher->getListeners(self::preFoo));
$this->assertCount(1, $this->dispatcher->getListeners(self::postFoo));
$this->assertCount(2, $this->dispatcher->getListeners());
}
public function testGetListenersSortsByPriority()
{
$listener1 = new TestEventListener();
$listener2 = new TestEventListener();
$listener3 = new TestEventListener();
$listener1->name = '1';
$listener2->name = '2';
$listener3->name = '3';
$this->dispatcher->addListener('pre.foo', array($listener1, 'preFoo'), -10);
$this->dispatcher->addListener('pre.foo', array($listener2, 'preFoo'), 10);
$this->dispatcher->addListener('pre.foo', array($listener3, 'preFoo'));
$expected = array(
array($listener2, 'preFoo'),
array($listener3, 'preFoo'),
array($listener1, 'preFoo'),
);
$this->assertSame($expected, $this->dispatcher->getListeners('pre.foo'));
}
public function testGetAllListenersSortsByPriority()
{
$listener1 = new TestEventListener();
$listener2 = new TestEventListener();
$listener3 = new TestEventListener();
$listener4 = new TestEventListener();
$listener5 = new TestEventListener();
$listener6 = new TestEventListener();
$this->dispatcher->addListener('pre.foo', $listener1, -10);
$this->dispatcher->addListener('pre.foo', $listener2);
$this->dispatcher->addListener('pre.foo', $listener3, 10);
$this->dispatcher->addListener('post.foo', $listener4, -10);
$this->dispatcher->addListener('post.foo', $listener5);
$this->dispatcher->addListener('post.foo', $listener6, 10);
$expected = array(
'pre.foo' => array($listener3, $listener2, $listener1),
'post.foo' => array($listener6, $listener5, $listener4),
);
$this->assertSame($expected, $this->dispatcher->getListeners());
}
public function testGetListenerPriority()
{
$listener1 = new TestEventListener();
$listener2 = new TestEventListener();
$this->dispatcher->addListener('pre.foo', $listener1, -10);
$this->dispatcher->addListener('pre.foo', $listener2);
$this->assertSame(-10, $this->dispatcher->getListenerPriority('pre.foo', $listener1));
$this->assertSame(0, $this->dispatcher->getListenerPriority('pre.foo', $listener2));
$this->assertNull($this->dispatcher->getListenerPriority('pre.bar', $listener2));
$this->assertNull($this->dispatcher->getListenerPriority('pre.foo', function () {}));
}
public function testDispatch()
{
$this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo'));
$this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'));
$this->dispatcher->dispatch(self::preFoo);
$this->assertTrue($this->listener->preFooInvoked);
$this->assertFalse($this->listener->postFooInvoked);
$this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch('noevent'));
$this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch(self::preFoo));
$event = new Event();
$return = $this->dispatcher->dispatch(self::preFoo, $event);
$this->assertSame($event, $return);
}
public function testDispatchForClosure()
{
$invoked = 0;
$listener = function () use (&$invoked) {
++$invoked;
};
$this->dispatcher->addListener('pre.foo', $listener);
$this->dispatcher->addListener('post.foo', $listener);
$this->dispatcher->dispatch(self::preFoo);
$this->assertEquals(1, $invoked);
}
public function testStopEventPropagation()
{
$otherListener = new TestEventListener();
// postFoo() stops the propagation, so only one listener should
// be executed
// Manually set priority to enforce $this->listener to be called first
$this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'), 10);
$this->dispatcher->addListener('post.foo', array($otherListener, 'preFoo'));
$this->dispatcher->dispatch(self::postFoo);
$this->assertTrue($this->listener->postFooInvoked);
$this->assertFalse($otherListener->postFooInvoked);
}
public function testDispatchByPriority()
{
$invoked = array();
$listener1 = function () use (&$invoked) {
$invoked[] = '1';
};
$listener2 = function () use (&$invoked) {
$invoked[] = '2';
};
$listener3 = function () use (&$invoked) {
$invoked[] = '3';
};
$this->dispatcher->addListener('pre.foo', $listener1, -10);
$this->dispatcher->addListener('pre.foo', $listener2);
$this->dispatcher->addListener('pre.foo', $listener3, 10);
$this->dispatcher->dispatch(self::preFoo);
$this->assertEquals(array('3', '2', '1'), $invoked);
}
public function testRemoveListener()
{
$this->dispatcher->addListener('pre.bar', $this->listener);
$this->assertTrue($this->dispatcher->hasListeners(self::preBar));
$this->dispatcher->removeListener('pre.bar', $this->listener);
$this->assertFalse($this->dispatcher->hasListeners(self::preBar));
$this->dispatcher->removeListener('notExists', $this->listener);
}
public function testAddSubscriber()
{
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
}
public function testAddSubscriberWithPriorities()
{
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher->addSubscriber($eventSubscriber);
$eventSubscriber = new TestEventSubscriberWithPriorities();
$this->dispatcher->addSubscriber($eventSubscriber);
$listeners = $this->dispatcher->getListeners('pre.foo');
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertCount(2, $listeners);
$this->assertInstanceOf('Symfony\Component\EventDispatcher\Tests\TestEventSubscriberWithPriorities', $listeners[0][0]);
}
public function testAddSubscriberWithMultipleListeners()
{
$eventSubscriber = new TestEventSubscriberWithMultipleListeners();
$this->dispatcher->addSubscriber($eventSubscriber);
$listeners = $this->dispatcher->getListeners('pre.foo');
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertCount(2, $listeners);
$this->assertEquals('preFoo2', $listeners[0][1]);
}
public function testRemoveSubscriber()
{
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
$this->dispatcher->removeSubscriber($eventSubscriber);
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
$this->assertFalse($this->dispatcher->hasListeners(self::postFoo));
}
public function testRemoveSubscriberWithPriorities()
{
$eventSubscriber = new TestEventSubscriberWithPriorities();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->dispatcher->removeSubscriber($eventSubscriber);
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
}
public function testRemoveSubscriberWithMultipleListeners()
{
$eventSubscriber = new TestEventSubscriberWithMultipleListeners();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertCount(2, $this->dispatcher->getListeners(self::preFoo));
$this->dispatcher->removeSubscriber($eventSubscriber);
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
}
public function testEventReceivesTheDispatcherInstanceAsArgument()
{
$listener = new TestWithDispatcher();
$this->dispatcher->addListener('test', array($listener, 'foo'));
$this->assertNull($listener->name);
$this->assertNull($listener->dispatcher);
$this->dispatcher->dispatch('test');
$this->assertEquals('test', $listener->name);
$this->assertSame($this->dispatcher, $listener->dispatcher);
}
/**
* @see https://bugs.php.net/bug.php?id=62976
*
* This bug affects:
* - The PHP 5.3 branch for versions < 5.3.18
* - The PHP 5.4 branch for versions < 5.4.8
* - The PHP 5.5 branch is not affected
*/
public function testWorkaroundForPhpBug62976()
{
$dispatcher = $this->createEventDispatcher();
$dispatcher->addListener('bug.62976', new CallableClass());
$dispatcher->removeListener('bug.62976', function () {});
$this->assertTrue($dispatcher->hasListeners('bug.62976'));
}
public function testHasListenersWhenAddedCallbackListenerIsRemoved()
{
$listener = function () {};
$this->dispatcher->addListener('foo', $listener);
$this->dispatcher->removeListener('foo', $listener);
$this->assertFalse($this->dispatcher->hasListeners());
}
public function testGetListenersWhenAddedCallbackListenerIsRemoved()
{
$listener = function () {};
$this->dispatcher->addListener('foo', $listener);
$this->dispatcher->removeListener('foo', $listener);
$this->assertSame(array(), $this->dispatcher->getListeners());
}
public function testHasListenersWithoutEventsReturnsFalseAfterHasListenersWithEventHasBeenCalled()
{
$this->assertFalse($this->dispatcher->hasListeners('foo'));
$this->assertFalse($this->dispatcher->hasListeners());
}
}
class CallableClass
{
public function __invoke()
{
}
}
class TestEventListener
{
public $preFooInvoked = false;
public $postFooInvoked = false;
/* Listener methods */
public function preFoo(Event $e)
{
$this->preFooInvoked = true;
}
public function postFoo(Event $e)
{
$this->postFooInvoked = true;
$e->stopPropagation();
}
}
class TestWithDispatcher
{
public $name;
public $dispatcher;
public function foo(Event $e, $name, $dispatcher)
{
$this->name = $name;
$this->dispatcher = $dispatcher;
}
}
class TestEventSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array('pre.foo' => 'preFoo', 'post.foo' => 'postFoo');
}
}
class TestEventSubscriberWithPriorities implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array(
'pre.foo' => array('preFoo', 10),
'post.foo' => array('postFoo'),
);
}
}
class TestEventSubscriberWithMultipleListeners implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array('pre.foo' => array(
array('preFoo1'),
array('preFoo2', 10),
));
}
}
| PierreUX/Carnet_Symfony3 | vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/Tests/AbstractEventDispatcherTest.php | PHP | mit | 13,371 |
/*
TimelineJS - ver. 2.30.1 - 2014-04-07
Copyright (c) 2012-2013 Northwestern University
a project of the Northwestern University Knight Lab, originally created by Zach Wise
https://github.com/NUKnightLab/TimelineJS
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/* Chinese LANGUAGE
================================================== */typeof VMM!="undefined"&&(VMM.Language={lang:"zh-cn",api:{wikipedia:"zh"},date:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],month_abbr:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],day:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],day_abbr:["周日","周一","周二","周三","周四","周五","周六"]},dateformats:{year:"yyyy年",month_short:"mmm",month:"yyyy年 mmmm",full_short:"mmm d",full:"yyyy年mmmm d日",time_short:"HH:MM:ss",time_no_seconds_short:"HH:MM",time_no_seconds_small_date:"HH:MM'<br/><small>'yyyy年mmmm d日'</small>'",full_long:"dddd',' yyyy年 mmm d日'um' HH:MM",full_long_small_date:"HH:MM'<br/><small>'dddd',' yyyy年 mmm d日'</small>'"},messages:{loading_timeline:"加载时间线... ",return_to_title:"回到开头",expand_timeline:"伸展时间",contract_timeline:"缩短时间",wikipedia:"来自维基百科,自由的百科全书",loading_content:"正在加载内容",loading:"加载中"}}); | SaravananRajaraman/cdnjs | ajax/libs/timelinejs/2.30.1/js/locale/zh-cn.js | JavaScript | mit | 1,625 |
/*
IR_Black style (c) Vasily Mikhailitchenko <vaskas@programica.ru>
*/
pre code {
display: block; padding: 0.5em;
background: #000; color: #f8f8f8;
}
pre .shebang,
pre .comment,
pre .template_comment,
pre .javadoc {
color: #7c7c7c;
}
pre .keyword,
pre .tag,
pre .tex .command,
pre .request,
pre .status,
pre .clojure .attribute {
color: #96CBFE;
}
pre .sub .keyword,
pre .method,
pre .list .title,
pre .nginx .title {
color: #FFFFB6;
}
pre .string,
pre .tag .value,
pre .cdata,
pre .filter .argument,
pre .attr_selector,
pre .apache .cbracket,
pre .date {
color: #A8FF60;
}
pre .subst {
color: #DAEFA3;
}
pre .regexp {
color: #E9C062;
}
pre .title,
pre .sub .identifier,
pre .pi,
pre .decorator,
pre .tex .special,
pre .haskell .type,
pre .constant,
pre .smalltalk .class,
pre .javadoctag,
pre .yardoctag,
pre .phpdoc,
pre .nginx .built_in {
color: #FFFFB6;
}
pre .symbol,
pre .ruby .symbol .string,
pre .number,
pre .variable,
pre .vbscript,
pre .literal {
color: #C6C5FE;
}
pre .css .tag {
color: #96CBFE;
}
pre .css .rules .property,
pre .css .id {
color: #FFFFB6;
}
pre .css .class {
color: #FFF;
}
pre .hexcolor {
color: #C6C5FE;
}
pre .number {
color:#FF73FD;
}
pre .coffeescript .javascript,
pre .javascript .xml,
pre .tex .formula,
pre .xml .javascript,
pre .xml .vbscript,
pre .xml .css,
pre .xml .cdata {
opacity: 0.7;
}
| snorpey/cdnjs | ajax/libs/highlight.js/7.3/styles/ir_black.css | CSS | mit | 1,380 |
<?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\Security\Http\EntryPoint;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
/**
* BasicAuthenticationEntryPoint starts an HTTP Basic authentication.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class BasicAuthenticationEntryPoint implements AuthenticationEntryPointInterface
{
private $realmName;
public function __construct($realmName)
{
$this->realmName = $realmName;
}
/**
* {@inheritdoc}
*/
public function start(Request $request, AuthenticationException $authException = null)
{
$response = new Response();
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));
$response->setStatusCode(401);
return $response;
}
}
| salem-k/ionic-serveur | vendor/symfony/symfony/src/Symfony/Component/Security/Http/EntryPoint/BasicAuthenticationEntryPoint.php | PHP | mit | 1,136 |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.dialog.add("specialchar",function(i){var e,l=i.lang.specialchar,k=function(c){var b,c=c.data?c.data.getTarget():new CKEDITOR.dom.element(c);if("a"==c.getName()&&(b=c.getChild(0).getHtml()))c.removeClass("cke_light_background"),e.hide(),c=i.document.createElement("span"),c.setHtml(b),i.insertText(c.getText())},m=CKEDITOR.tools.addFunction(k),j,g=function(c,b){var a,b=b||c.data.getTarget();"span"==b.getName()&&(b=b.getParent());if("a"==b.getName()&&(a=b.getChild(0).getHtml())){j&&d(null,j);
var f=e.getContentElement("info","htmlPreview").getElement();e.getContentElement("info","charPreview").getElement().setHtml(a);f.setHtml(CKEDITOR.tools.htmlEncode(a));b.getParent().addClass("cke_light_background");j=b}},d=function(c,b){b=b||c.data.getTarget();"span"==b.getName()&&(b=b.getParent());"a"==b.getName()&&(e.getContentElement("info","charPreview").getElement().setHtml(" "),e.getContentElement("info","htmlPreview").getElement().setHtml(" "),b.getParent().removeClass("cke_light_background"),
j=void 0)},n=CKEDITOR.tools.addFunction(function(c){var c=new CKEDITOR.dom.event(c),b=c.getTarget(),a;a=c.getKeystroke();var f="rtl"==i.lang.dir;switch(a){case 38:if(a=b.getParent().getParent().getPrevious())a=a.getChild([b.getParent().getIndex(),0]),a.focus(),d(null,b),g(null,a);c.preventDefault();break;case 40:if(a=b.getParent().getParent().getNext())if((a=a.getChild([b.getParent().getIndex(),0]))&&1==a.type)a.focus(),d(null,b),g(null,a);c.preventDefault();break;case 32:k({data:c});c.preventDefault();
break;case f?37:39:if(a=b.getParent().getNext())a=a.getChild(0),1==a.type?(a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):d(null,b);else if(a=b.getParent().getParent().getNext())(a=a.getChild([0,0]))&&1==a.type?(a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):d(null,b);break;case f?39:37:(a=b.getParent().getPrevious())?(a=a.getChild(0),a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):(a=b.getParent().getParent().getPrevious())?(a=a.getLast().getChild(0),a.focus(),d(null,b),g(null,a),c.preventDefault(!0)):
d(null,b)}});return{title:l.title,minWidth:430,minHeight:280,buttons:[CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){for(var c=this.definition.charColumns,b=i.config.specialChars,a=CKEDITOR.tools.getNextId()+"_specialchar_table_label",f=['<table role="listbox" aria-labelledby="'+a+'" style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">'],d=0,g=b.length,h,e;d<g;){f.push('<tr role="presentation">');for(var j=0;j<c;j++,
d++){if(h=b[d]){h instanceof Array?(e=h[1],h=h[0]):(e=h.replace("&","").replace(";","").replace("#",""),e=l[e]||h);var k="cke_specialchar_label_"+d+"_"+CKEDITOR.tools.getNextNumber();f.push('<td class="cke_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(d+1)+'"',' aria-setsize="'+g+'"',' aria-labelledby="'+k+'"',' class="cke_specialchar" title="',CKEDITOR.tools.htmlEncode(e),'" onkeydown="CKEDITOR.tools.callFunction( '+n+
', event, this )" onclick="CKEDITOR.tools.callFunction('+m+', this); return false;" tabindex="-1"><span style="margin: 0 auto;cursor: inherit">'+h+'</span><span class="cke_voice_label" id="'+k+'">'+e+"</span></a>")}else f.push('<td class="cke_dark_background"> ');f.push("</td>")}f.push("</tr>")}f.push("</tbody></table>",'<span id="'+a+'" class="cke_voice_label">'+l.options+"</span>");this.getContentElement("info","charContainer").getElement().setHtml(f.join(""))},contents:[{id:"info",label:i.lang.common.generalTab,
title:i.lang.common.generalTab,padding:0,align:"top",elements:[{type:"hbox",align:"top",widths:["320px","90px"],children:[{type:"html",id:"charContainer",html:"",onMouseover:g,onMouseout:d,focus:function(){var c=this.getElement().getElementsByTag("a").getItem(0);setTimeout(function(){c.focus();g(null,c)},0)},onShow:function(){var c=this.getElement().getChild([0,0,0,0,0]);setTimeout(function(){c.focus();g(null,c)},0)},onLoad:function(c){e=c.sender}},{type:"hbox",align:"top",widths:["100%"],children:[{type:"vbox",
align:"top",children:[{type:"html",html:"<div></div>"},{type:"html",id:"charPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div> </div>"},{type:"html",id:"htmlPreview",className:"cke_dark_background",style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",
html:"<div> </div>"}]}]}]}]}]}}); | songecko/challenge | src/Gecko/BackendBundle/Resources/assets/js/plugins/ckeditor/plugins/specialchar/dialogs/specialchar.js | JavaScript | mit | 4,824 |
/* Horizontal Slider */
/* Use thumbUrl /build/slider/assets/skins/audio/thumb-x.png */
.yui3-skin-audio .yui3-slider-x .yui3-slider-rail,
.yui3-skin-audio .yui3-slider-x .yui3-slider-rail-cap-left,
.yui3-skin-audio .yui3-slider-x .yui3-slider-rail-cap-right {
background-image: url(rail-x.png);
background-repeat: repeat-x;
}
.yui3-skin-audio .yui3-slider-x .yui3-slider-rail {
height: 35px;
background-position: 0 7px;
}
.yui3-skin-audio .yui3-slider-x .yui3-slider-thumb {
height: 35px;
width: 19px;
}
.yui3-skin-audio .yui3-slider-x .yui3-slider-rail-cap-left {
background-position: 0 -20px;
height: 13px;
left: -5px;
width: 5px;
top: 7px;
}
.yui3-skin-audio .yui3-slider-x .yui3-slider-rail-cap-right {
background-position: 0 -40px;
height: 13px;
right: -5px;
width: 5px;
top: 7px;
}
.yui3-skin-audio .yui3-slider-x .yui3-slider-thumb-image {
left: 0;
top: -3px;
}
.yui3-skin-audio .yui3-slider-x .yui3-slider-thumb-shadow {
left: 0;
opacity: 0.15;
filter: alpha(opacity=15);
top: -43px;
}
/* Vertical Slider */
/* Use thumbUrl /build/slider/assets/skins/audio/thumb-y.png */
.yui3-skin-audio .yui3-slider-y .yui3-slider-rail,
.yui3-skin-audio .yui3-slider-y .yui3-slider-rail-cap-top,
.yui3-skin-audio .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-image: url(rail-y.png);
background-repeat: repeat-y;
}
.yui3-skin-audio .yui3-slider-y .yui3-slider-rail {
width: 35px;
background-position: 7px 0;
}
.yui3-skin-audio .yui3-slider-y .yui3-slider-thumb {
width: 35px;
height: 19px;
}
.yui3-skin-audio .yui3-slider-y .yui3-slider-rail-cap-top {
background-position: -20px 0;
width: 13px;
top: -5px;
height: 5px;
left: 7px;
}
.yui3-skin-audio .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-position: -40px 0;
width: 13px;
bottom: -5px;
height: 5px;
left: 7px;
}
.yui3-skin-audio .yui3-slider-y .yui3-slider-thumb-image {
left: -3px;
top: 0;
}
.yui3-skin-audio .yui3-slider-y .yui3-slider-thumb-shadow {
left: -43px;
opacity: 0.15;
filter: alpha(opacity=15);
top: 0;
}
| dannyxx001/cdnjs | ajax/libs/yui/3.4.0pr2/slider/assets/skins/audio/slider-skin.css | CSS | mit | 2,176 |
/* Horizontal Slider */
/* Use thumbUrl /build/slider/assets/skins/capsule/thumb-x.png */
/* Alternate thumbUrl /build/slider/assets/skins/capsule/thumb-x-line.png */
.yui3-skin-capsule .yui3-slider-x .yui3-slider-rail,
.yui3-skin-capsule .yui3-slider-x .yui3-slider-rail-cap-left,
.yui3-skin-capsule .yui3-slider-x .yui3-slider-rail-cap-right {
background-image: url(rail-x.png);
background-repeat: repeat-x;
background-repeat: repeat-x;
/* alternate: rail-x-dots.png */
/* alternate: rail-x-lines.png */
}
.yui3-skin-capsule .yui3-slider-x .yui3-slider-rail {
height: 25px;
}
.yui3-skin-capsule .yui3-slider-x .yui3-slider-thumb {
height: 30px;
width: 14px;
}
.yui3-skin-capsule .yui3-slider-x .yui3-slider-rail-cap-left {
background-position: 0 -20px;
height: 20px;
left: -2px;
width: 5px;
}
.yui3-skin-capsule .yui3-slider-x .yui3-slider-rail-cap-right {
background-position: 0 -40px;
height: 20px;
right: -2px;
width: 5px;
}
.yui3-skin-capsule .yui3-slider-x .yui3-slider-thumb-image {
left: 0;
top: -10px;
}
.yui3-skin-capsule .yui3-slider-x .yui3-slider-thumb-shadow {
left: 0;
opacity: 0.15;
filter: alpha(opacity=15);
top: -50px;
}
/* Vertical Slider */
/* Use thumbUrl /build/slider/assets/skins/capsule/thumb-y.png */
/* Alternate thumbUrl /build/slider/assets/skins/capsule/thumb-y-line.png */
.yui3-skin-capsule .yui3-slider-y .yui3-slider-rail,
.yui3-skin-capsule .yui3-slider-y .yui3-slider-rail-cap-top,
.yui3-skin-capsule .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-image: url(rail-y.png);
background-repeat: repeat-y;
background-repeat: repeat-y;
/* alternate: rail-y-dots.png */
/* alternate: rail-y-lines.png */
}
.yui3-skin-capsule .yui3-slider-y .yui3-slider-rail {
width: 25px;
}
.yui3-skin-capsule .yui3-slider-y .yui3-slider-thumb {
width: 30px;
height: 14px;
}
.yui3-skin-capsule .yui3-slider-y .yui3-slider-rail-cap-top {
background-position: -20px 0;
width: 20px;
top: -2px;
height: 5px;
}
.yui3-skin-capsule .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-position: -40px 0;
width: 20px;
bottom: -2px;
height: 5px;
}
.yui3-skin-capsule .yui3-slider-y .yui3-slider-thumb-image {
left: -10px;
top: 0;
}
.yui3-skin-capsule .yui3-slider-y .yui3-slider-thumb-shadow {
left: -50px;
opacity: 0.15;
filter: alpha(opacity=15);
top: 0;
}
| CrossEye/cdnjs | ajax/libs/yui/3.1.1/slider/assets/skins/capsule/slider-skin.css | CSS | mit | 2,466 |
/* Horizontal Slider */
/* Use thumbUrl /build/slider/assets/skins/round-dark/thumb-x.png */
/* Alternate thumbUrl /build/slider/assets/skins/round-dark/thumb-x-grip.png */
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-rail,
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-rail-cap-left,
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-rail-cap-right {
background-image: url(rail-x.png);
background-repeat: repeat-x;
}
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-rail {
height: 25px;
background-position: 0 3px;
}
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-thumb {
height: 26px;
width: 24px;
}
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-rail-cap-left {
background-position: 0 -17px;
height: 20px;
left: -2px;
width: 5px;
}
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-rail-cap-right {
background-position: 0 -37px;
height: 20px;
right: -2px;
width: 5px;
}
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-thumb-image {
left: 0;
top: -7px;
}
.yui3-skin-round-dark .yui3-slider-x .yui3-slider-thumb-shadow {
left: 0;
opacity: 0.15;
filter: alpha(opacity=15);
top: -47px;
}
/* Vertical Slider */
/* Use thumbUrl /build/slider/assets/skins/round-dark/thumb-y.png */
/* Alternate thumbUrl /build/slider/assets/skins/round-dark/thumb-y-grip.png */
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-rail,
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-rail-cap-top,
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-image: url(rail-y.png);
background-repeat: repeat-y;
}
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-rail {
width: 25px;
background-position: 3px 0;
}
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-thumb {
width: 26px;
height: 24px;
}
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-rail-cap-top {
background-position: -17px 0;
width: 20px;
top: -2px;
height: 5px;
}
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-rail-cap-bottom {
background-position: -37px 0;
width: 20px;
bottom: -2px;
height: 5px;
}
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-thumb-image {
top: 0;
left: -7px;
}
.yui3-skin-round-dark .yui3-slider-y .yui3-slider-thumb-shadow {
top: 0;
left: -47px;
opacity: 0.15;
filter: alpha(opacity=15);
}
| tjbp/cdnjs | ajax/libs/yui/3.3.0/slider/assets/skins/round-dark/slider-base-skin.css | CSS | mit | 2,378 |
webshims.validityMessages.el={typeMismatch:{email:"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03b4\u03b9\u03b5\u03cd\u03b8\u03c5\u03bd\u03c3\u03b7 email.",url:"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03ad\u03bd\u03b1 URL."},badInput:{number:"\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03c4\u03b9\u03bc\u03ae.",date:"\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03c4\u03b9\u03bc\u03ae.",time:"\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03c4\u03b9\u03bc\u03ae.",range:"\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03c4\u03b9\u03bc\u03ae.","datetime-local":"\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03c4\u03b9\u03bc\u03ae."},tooLong:"\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03c4\u03b9\u03bc\u03ae.",patternMismatch:"\u0391\u03bd\u03c4\u03b9\u03c3\u03c4\u03bf\u03b9\u03c7\u03af\u03c3\u03c4\u03b5 \u03c4\u03b7 \u03b6\u03b7\u03c4\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7 \u03bc\u03bf\u03c1\u03c6\u03ae. {%title}.",valueMissing:{defaultMessage:"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03c3\u03c5\u03bc\u03c0\u03bb\u03b7\u03c1\u03ce\u03c3\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c0\u03b5\u03b4\u03af\u03bf.",checkbox:"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ba\u03bf\u03c5\u03c4\u03af \u03b1\u03bd \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03c3\u03c5\u03bd\u03b5\u03c7\u03af\u03c3\u03b5\u03c4\u03b5.",select:"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03b1\u03bd\u03c4\u03b9\u03ba\u03b5\u03af\u03bc\u03b5\u03bd\u03bf \u03c3\u03c4\u03b7 \u03bb\u03af\u03c3\u03c4\u03b1.",radio:"\u0395\u03c0\u03b9\u03bb\u03ad\u03be\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b1 \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9."},rangeUnderflow:{defaultMessage:"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b5\u03b3\u03b1\u03bb\u03cd\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%min}.",date:"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b5\u03b3\u03b1\u03bb\u03cd\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%min}.",time:"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b5\u03b3\u03b1\u03bb\u03cd\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%min}.","datetime-local":"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b5\u03b3\u03b1\u03bb\u03cd\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%min}."},rangeOverflow:{defaultMessage:"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b9\u03ba\u03c1\u03cc\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%max}.",date:"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b9\u03ba\u03c1\u03cc\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%max}.",time:"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b9\u03ba\u03c1\u03cc\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%max}.","datetime-local":"\u0397 \u03c4\u03b9\u03bc\u03ae \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03bc\u03b9\u03ba\u03c1\u03cc\u03c4\u03b5\u03c1\u03b7 \u03ae \u03af\u03c3\u03b7 \u03c4\u03bf\u03c5 {%max}."},stepMismatch:"\u039c\u03b7 \u03ad\u03b3\u03ba\u03c5\u03c1\u03b7 \u03c4\u03b9\u03bc\u03ae."},webshims.formcfg.el={numberFormat:{".":".",",":","},numberSigns:".",dateSigns:"/",timeSigns:":. ",dFormat:"/",patterns:{d:"dd/mm/yy"},date:{closeText:"\u039a\u03bb\u03b5\u03af\u03c3\u03b9\u03bc\u03bf",prevText:"\u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf\u03c2",nextText:"\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf\u03c2",currentText:"\u03a4\u03c1\u03ad\u03c7\u03c9\u03bd \u039c\u03ae\u03bd\u03b1\u03c2",monthNames:["\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2","\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2","\u039c\u03ac\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2","\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2","\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2","\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2"],monthNamesShort:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03b9","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],dayNames:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],dayNamesShort:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],dayNamesMin:["\u039a\u03c5","\u0394\u03b5","\u03a4\u03c1","\u03a4\u03b5","\u03a0\u03b5","\u03a0\u03b1","\u03a3\u03b1"],weekHeader:"\u0395\u03b2\u03b4",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | raszi/cdnjs | ajax/libs/webshim/1.14.5-RC1/minified/shims/i18n/formcfg-el.js | JavaScript | mit | 6,102 |
webshims.validityMessages.lt={typeMismatch:{defaultMessage:"Pra\u0161om \u012fvesti teising\u0105 reik\u0161m\u0119.",email:"Pra\u0161om \u012fvesti el. pa\u0161to adres\u0105.",url:"Pra\u0161om \u012fvesti nuorod\u0105 (URL)."},badInput:{defaultMessage:"Pra\u0161om \u012fvesti teising\u0105 reik\u0161m\u0119.",number:"Pra\u0161om \u012fvesti skai\u010di\u0173.",date:"Pra\u0161om \u012fvesti dat\u0105.",time:"Pra\u0161om \u012fvesti laik\u0105.",range:"Neteisingas skai\u010di\u0173 r\u0117\u017eis.",month:"Pra\u0161om \u012fvesti m\u0117nes\u012f.","datetime-local":"Pra\u0161om \u012fvesti dat\u0105 ir laik\u0105."},rangeUnderflow:{defaultMessage:"Reik\u0161m\u0117 privalo b\u016bti didesn\u0117 arba lygi {%min}.",date:"Data turi b\u016bti ne ankstesn\u0117 negu {%min}.",time:"Laikas turi b\u016bti ne ankstesnis negu {%min}.","datetime-local":"Data ir laikas turi b\u016bti ne ankstesni negu {%min}.",month:"M\u0117nuo turi b\u016bti {%min} arba v\u0117lesnis."},rangeOverflow:{defaultMessage:"Reik\u0161m\u0117 privalo b\u016bti ma\u017eesn\u0117 arba lygi {%max}.",date:"Data turi b\u016bti ne v\u0117lesn\u0117 negu {%max}.",time:"Laikas turi b\u016bti ne v\u0117lesnis negu {%max}.","datetime-local":"Data ir laikas turi b\u016bti ne v\u0117lesni negu {%max}.",month:"M\u0117nuo turi b\u016bti {%max} arba ankstesnis."},stepMismatch:"Neteisinga reik\u0161m\u0117.",tooLong:"Pra\u0161om \u012fvesti ne daugiau negu {%maxlength} simboli\u0173. J\u016bs \u012fved\u0117te {%valueLen}.",patternMismatch:"Neteisinga lauko {%title} reik\u0161m\u0117.",valueMissing:{defaultMessage:"\u0160is laukas yra privalomas.",checkbox:"Pra\u0161ome pa\u017eym\u0117ti \u0161\u012f \u017eymim\u0105j\u012f laukel\u012f, jis yra privalomas.",select:"Pra\u0161om pasirinkti reik\u0161m\u0119 i\u0161 s\u0105ra\u0161o.",radio:"Pra\u0161om pasirinkti vien\u0105 i\u0161 reik\u0161mi\u0173."}},webshims.formcfg.lt={numberFormat:{".":".",",":","},numberSigns:".",dateSigns:".",timeSigns:":. ",dFormat:".",patterns:{d:"yy.mm.dd"},month:{currentText:"\u0161\u012f m\u0117nes\u012f"},date:{closeText:"U\u017edaryti",clear:"Tu\u0161tinti",prevText:"Atgal",nextText:"Kitas",currentText:"\u0160iandien",monthNames:["Sausis","Vasaris","Kovas","Balandis","Gegu\u017e\u0117","Bir\u017eelis","Liepa","Rugpj\u016btis","Rugs\u0117jis","Spalis","Lapkritis","Gruodis"],monthNamesShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gruo"],dayNames:["Sekmadienis","Pirmadienis","Antradienis","Tre\u010diadienis","Ketvirtadienis","Penktadienis","\u0160e\u0161tadienis"],dayNamesShort:["Sek","Pir","Ant","Tre","Ket","Pen","\u0160e\u0161"],dayNamesMin:["S","P","A","T","K","Pn","\u0160"],weekHeader:"Sav.",firstDay:1,isRTL:!1,showMonthAfterYear:!0,yearSuffix:""}},webshims.validityMessages["lt-LT"]=webshims.validityMessages.lt,webshims.formcfg["lt-LT"]=webshims.formcfg.lt; | callumacrae/cdnjs | ajax/libs/webshim/1.14.5-RC2/minified/shims/i18n/formcfg-lt.js | JavaScript | mit | 2,871 |
/*!
* anyjs micro ver 1.0.0 - any-micro.js
* (c) 2016, any-js - https://github.com/any-js/anyjs/ (Released under the MIT license)
*/
/**
* anyjs - any-micro.js
* (c) any-js - https://github.com/any-js/
* Released under the MIT license
*/
var $any = {};
(function(any){
'use strict';
any.define = {};
/**
* Private methods
*/
/**
* @ignore
*/
function trim(v){
return v.replace(/^(\s)+|(\s)+$/g, '');
}
/**
* @ignore
*/
function keys(nm){
return String(nm).split('.').map(trim);
}
/**
* @ignore
*/
function arrArg(vs){
if (vs != null){
if(!(vs instanceof Array)){
if (Object.prototype.toString.call(vs) === '[object Arguments]'){
vs = Array.prototype.slice.call(vs);
}else{
vs = [vs];
}
}
}else{
vs = [];
}
return vs;
}
/**
* @ignore
*/
function none(){
}
/**
* Manage "Profile", store and read options, merge default options.
*
* | Method | Default ver | Tiny ver | Micro ver |
* |:---|:---:|:---:|:---:|
* | All methods | Yes | Yes | Yes |
*
* @namespace $any.profile
* @see Profile
*
* @tutorial static-profile
* @tutorial demo-various
*
* @example
* example = $any.profile.create({a: 1, b: 2});
* example.setProfile('abc', {a: '1', b: '2'});
*
* opt = $any.profile.getProfile(example, 'abc'); //Get 'abc'
* opt = $any.profile.getProfile(example, null); //Get default
*/
any.profile = {};
/**
* Profile object by created $any.profile.
*
* | Method | Default ver | Tiny ver | Micro ver |
* |:---|:---:|:---:|:---:|
* | All methods | Yes | Yes | Yes |
*
* @class Profile
*
* @see $any.profile
* @tutorial static-profile
* @tutorial demo-various
*
* @example
* example = $any.profile.create({a: 1, b: 2});
* example.setProfile('abc', {a: '1', b: '2'});
*
* opt = $any.profile.getProfile(example, 'abc'); //Get 'abc'
* opt = $any.profile.getProfile(example, null); //Get default
*/
/**
* Create profile object.
* @function create
* @memberof $any.profile
*
* @param {assoc} defaults Default option.
* @returns {Profile}
*
* @see Profile
*
* @tutorial static-profile
*
* @example
* example = $any.profile.create({a: 1, b: 2});
*/
any.profile.create = function(defaults){
info('profile.create');
/**
* @ignore
*/
var pfl = {
define: {},
defaults: defaults,
profiles: {}
};
/**
* Set profile option.
* @memberof Profile
* @instance
* @function
* @name setProfile
*
* @param {string} name Profile name.
* @param {assoc} opt Profile's options.
*
* @see $any.profile.setProfile
*
* @tutorial static-profile
* @example
* example.setProfile('abc', {a: '1', b: '2'});
*/
pfl.setProfile = function(name, opt){
any.profile.setProfile(pfl, name, opt);
};
/**
* Get profile option.
* @memberof Profile
* @instance
* @function
* @name getProfile
*
* @param {assoc|string} opt Profile name or override options.
* @param {assoc} defaults Default options.
* @returns {assoc}
*
* @see $any.profile.getProfile
*
* @tutorial static-profile
* @example
* opts = example.getProfile('abc');
*/
pfl.getProfile = function(opt, defaults){
return any.profile.getProfile(pfl, opt, defaults);
};
return pfl;
};
/**
* Set profile option.
* @function setProfile
* @memberof $any.profile
*
* @param {object} scope Scope.
* @param {string} name Profile name.
* @param {assoc} opt Profile's options.
*
* @see Profile
*
* @tutorial static-profile
* @example
* $any.profile.setProfile(example, 'abc', {b: 3, c: 5}); //Set 'abc'
* $any.profile.setProfile(example, null, {b: 3, c: 5}); //Set default
*/
any.profile.setProfile = function(scope, name, opt){
info('profile.setProfile');
if (name == null || name === 'default'){
scope.defaults = scope.defaults || {};
ext(scope.defaults, opt);
}else{
scope.profiles[name] = ext(ext({}, scope.defaults, true), opt, true);
}
};
/**
* Get profile option.
* @function getProfile
* @memberof $any.profile
*
* @param {object} scope Scope.
* @param {string|assoc|array} opt Profile name or override options.
* @param {assoc} defaults Default options.
* @returns {assoc}
*
* @see Profile
*
* @tutorial static-profile
* @example
* opt = $any.profile.getProfile(example, 'abc'); //Get 'abc'
* opt = $any.profile.getProfile(example, null); //Get default
* opt = $any.profile.getProfile(example, ['abc', {a: 1000, y: 1000}]); //Get 'abc' and override option.
*/
any.profile.getProfile = function(scope, opt, defaults){
var pfs = scope.profiles;
defaults = defaults || {};
if (opt instanceof Array){
var nm = opt[0];
if (opt.length == 2 && typeof nm === 'string'){
if (pfs[nm] == null){
error('profile none', opt);
}
return ext(ext(defaults, pfs[nm], true), opt[1], true);
}else{
error('illegal format', opt);
}
} else if (opt instanceof Object){
return ext(ext(defaults, scope.defaults, true), opt, true);
} else if (opt == null || opt === 'default'){
return ext(defaults, scope.defaults, true);
} else if (typeof opt === 'string'){
if (pfs[opt] == null){
error('profile none', opt);
}
return ext(defaults, pfs[opt], true);
}
return opt;
};
/**
* any($any) static methods. Helper methods for data operation.
*
* | Method | Default ver | Tiny ver | Micro ver |
* |:---|:---:|:---:|:---:|
* | ready | - | Yes | - |
* | detectClick | Yes | - | - |
* | Others | Yes | Yes | Yes |
*
* @namespace $any
*
* @tutorial static-any
* @example
* //See tutorials.
*/
/**
* any($any) defines.
*
* @namespace $any.define
*/
/**
* $any.info mode
*
* | Value | Description |
* |:---|:---|
* | <code>0</code> | none |
* | <code>1</code> | info |
* | <code>2</code> | info+trace |
*
* @memberof $any.define
*
* @type {number}
* @default 0
* @see $any.info
* @see {@link $any.log}
*/
any.define.info = 0; //0:none, 1:info, 2:info+trace
/**
* @ignore
*/
function csOut(f, vs){
vs = arrArg(vs);
vs.unshift(console);
Function.prototype.call.apply(f, vs);
}
/**
* Output info.
* @function info
* @memberof $any
*
* @param {...*} v Arguments.
*
* @see $any.define.info
* @see {@link $any.log}
*
* @tutorial static-any
* @example
* $any.info(1, 2, 3);
*/
any.info = function(v){
switch (any.define.info){
case 1:
csOut(console.log, arguments);
break;
case 2:
csOut(console.log, arguments);
console.trace();
break;
default:
break;
}
};
/**
* $any.error mode
*
* | Value | Description |
* |:---|:---|
* | <code>0</code> | none |
* | <code>1</code> | error |
* | <code>2</code> | error+trace |
*
* @memberof $any.define
* @type {number}
* @default 1
*
* @see $any.error
* @see {@link $any.log}
*/
any.define.error = 1; //0:none, 1:error, 2:error+trace
/**
* If error occurs, throw error.
* @memberof $any.define
* @type {boolean}
* @default false
*
* @see $any.error
* @see {@link $any.log}
*/
any.define.throwError = false;
/**
* Check existence of selector's target. If none, error occurs.
* @memberof $any.define
* @type {boolean}
* @default false
* @see {@link $any.log}
*/
any.define.targetExist = false;
/**
* Output error.
* @function error
* @memberof $any
*
* @param {...*} v Arguments.
*
* @see $any.define.error
* @see {@link $any.log}
*
* @tutorial static-any
* @example
* $any.error(1, 2, 3);
*/
any.error = function(v){
switch (any.define.error){
case 1:
csOut(console.error, arguments);
break;
case 2:
csOut(console.error, arguments);
console.trace();
break;
default:
break;
}
if (any.define.throwError){
throw new Error(v);
}
};
/**
* @ignore
*/
function ext(v, s, deep){
if(!s){
return v;
}
for (var k in s){
if (s.hasOwnProperty(k)){
if (deep && s[k] instanceof Object && s[k].constructor === Object){
if (v[k] == null){
v[k] = {};
}
v[k] = ext(v[k], s[k], deep);
}else{
v[k] = s[k];
}
}
}
return v;
}
/**
* Extend values. Support deep-copy.
* @param {assoc|array|object} dest Destination. Override values by source.
* @param {assoc|array|object} src Source.
* @param {boolean} [deep=false] Is deep-copy.
* @returns {assoc|array|object}
*
* @example
* $.any.extend(dest, src);
* $.any.extend(dest, src, true);
* dest = $.any.extend(dest, src);
*/
any.extend = function(dest, src, deep){
return ext(dest, src, deep);
};
/**
* Get object keys.
* @function keys
* @memberof $any
*
* @param {assoc|array} vs Values.
* @return {array}
*
* @tutorial static-any
* @example
* ks = $any.keys([1, 2, 3, 4]);
* ks = $any.keys({a:1, b:2, c:3});
*/
any.keys = function(vs){
var ks = 0;
try {
ks = Object.keys(vs);
}catch(e){
ks = [];
if (vs){
any.each(vs, function(k, v){
ks.push(k);
});
}
}
return ks;
};
/**
* Get object length.
* @function size
* @memberof $any
*
* @param {assoc|array} vs Values.
* @return {number}
*
* @tutorial static-any
* @example
* n = $any.size({a:1, b:2, c:3});
*/
any.size = function(vs){
return any.keys(vs).length;
};
/**
* Check blank value.
* @function blank
* @memberof $any
* @param {*} v Value.
* @returns {boolean} <code>true</code> false, null, undefined, '' <code>false</code> 0, or other any data.
*
* @tutorial static-any
* @example
* r = $any.blank(v);
* if ($any.blank(v)){ ... }
*/
any.blank = function(v){
return (!v && v !== 0);
};
/**
* Clone object.
* @function clone
* @memberof $any
* @param {assoc|array} v Assoc or array value.
* @param {boolean} [isArr=false] If true, return value type is array.
* @returns {*}
*
* @tutorial static-any
* @example
* v = $any.clone({a:1, b:2, c:3});
* v = $any.clone([1, 2, 3, 4, 5], true);
*/
any.clone = function(v, isArr){
var bs = {};
if (isArr){
bs = [];
}
return ext(bs, v, true);
};
/**
* Simple object's loop.
* @function each
* @memberof $any
* @param {assoc|object} vs Assoc or object.
* @param {function} fn Function. <code>function(key, value){ }</code>
* @param {*} [ctx=null] this object
*
* @tutorial static-any
* @example
* $any.each({a:1, b:2, c:3}, function(k, v){
* console.log(k, v);
* });
* $any.each({a:1, b:2, c:3}, function(k, v){
* $(this).val(v);
* }, this);
*/
any.each = function(vs, fn, ctx){
for(var k in vs){
if (vs.hasOwnProperty(k)){
fn.call(ctx, k, vs[k]);
}
}
};
/**
* @ignore
*/
var gbs = {};
/**
* Bind function or value by name.
* @function global
* @memberof $any
*
* @param {string|null} name Name.
* @param {function|string|number|object} [v] Various value or function.
* @returns {*}
*
* @tutorial static-any
* @example
* fn = $any.global(null, function(v){ ... });
* fn(v);
* $any.global('abc', function(v){ ... });
* $any.global('abc')(v);
*/
any.global = function(name, v){
if (v === undefined){
if (gbs[name]){
return gbs[name];
}else{
error('none');
return none;
}
}
if (name === undefined){
name = null;
}
if (v !== null){
gbs[name] = v;
}else{
delete gbs[name];
return;
}
return gbs[name];
};
/**
* @ignore
*/
function gtRcs(ks, vs){
var v, k = ks.shift();
v = vs[k];
if (v == null){
return null;
}
if (ks[0] !== undefined){
return gtRcs(ks, v);
}
return v;
}
/**
* Get value from assoc.
*
* <b>name format</b> <code>a, a.b, a.b.c, a.0</code>
*
* @function get
* @memberof $any
* @param {assoc|array} vs Values object.
* @param {string} name Value name. Child name of assoc can be specified. - 'a.b.1'.
* @returns {*}
*
* @tutorial static-any
* @example
* v = $any.get(vs, 'a'); //assoc
* v = $any.get(vs, 'b.a'); //assoc
* v = $any.get(vs, 0); //array
* v = $any.get(vs, '0.0.0'); //array
*/
any.get = function(vs, name){
var ks = keys(name);
return gtRcs(ks, vs);
};
/**
* @ignore
*/
function stRcs(ks, vs, nm, v, eo){
var k = ks.shift();
if (ks[0] === undefined){
if (vs[k] == null || !eo){
vs[k] = v;
}
} else {
if (vs[k] == null){
vs[k] = {};
stRcs(ks, vs[k], nm, v, eo);
} else if (typeof vs[k] === 'object'){
stRcs(ks, vs[k], nm, v, eo);
} else {
error('not object', vs, nm);
}
}
}
/**
* Set value to assoc.
* @function set
* @memberof $any
* @param {assoc|array} vs Assoc.
* @param {string} name Value's name. Child name of assoc can be specified. - 'a.b.1'.
* @param {*|function} v Value or Function which change value.
* @param {boolean} [emptyOnly=false] Set value if empty.
*
* @tutorial static-any
* @example
* $any.set(vs, 'a', 123); //value
* $any.set(vs, 0, 123); //set to array
* $any.set(vs, 'b.a', 123); //assoc
* $any.set(vs, 'c.0', 123); //array
* $any.set(vs, 'd', function(v){ return v++; }); //using function
* $any.set(vs, 'e', 123, true); //empty only
*/
any.set = function(vs, name, v, emptyOnly){
if (typeof v === 'function'){
v = v(any.get(vs, name));
}
stRcs(keys(name), vs, name, v, emptyOnly);
return v;
};
/**
* Empty values.
* @function drop
* @memberof $any
* @param {assoc|array} vs Assoc.
*
* @tutorial static-any
* @example
* $any.drop(vs);
*/
any.drop = function(vs){
any.each(vs, function(k){
delete vs[k];
});
};
/**
* Data stored for $any.data. It is simple assoc.
* @memberof $any
* @type {assoc}
*
* @see $any.data
*
* @tutorial static-any
* @example
* $any.datas = {a:1, b:2, c:3};
*/
any.datas = {};
/**
* Get and Set global value - $any.datas.
*
* <b>Specification</b><br>
* Internal use: <code>$any.get</code> <code>$any.set</code>
*
* @function data
* @memberof $any
* @param {assoc|array|null} vs Data pool. If null, vs is $any.datas.
* @param {string} name Name.
* @param {*} [v] Value. For set.
* @param {boolean} [emptyOnly=false] Set value if empty. For set.
* @returns {*}
*
* @see $any.datas
* @see $any.get
* @see $any.set
*
* @tutorial static-any
* @example
* //Set
* $any.data(null, null, {a:1, b:2, c:3});
* $any.data(null, 'a', 1);
* $any.data(pool, 'b.b1', 1);
* v = $any.data(pool, 'c', function(v){ return v+1 });
*
* @example
* //Get
* vs = $any.data();
* v = $any.data(null, 'a');
* v = $any.data(pool, 'b.b1');
* v = $any.data(pool, 'c');
*/
any.data = function(vs, name, v, emptyOnly){
if (vs == null){
vs = any.datas;
}
//Get
if (v === undefined){
if (name == null){
return vs;
}
return any.get(vs, name);
}
//Set
if (any.blank(name)){
if (typeof v !== 'object'){
v = {};
}
any.drop(vs);
ext(vs, v, true);
return vs;
}
return any.set(vs, name, v, emptyOnly);
};
/**
* Convert to other structure values from original values by rule.
* @function filter
* @memberof $any
*
* @param {assoc|array} vs Original values.
* @param {assoc} [rule] Convert rule.<br><code>{<br>to: from, //from >> to<br>to: null, //Delete<br>to: {...} or [...], //cover by matrix<br>to: function(v, org, dest){return v;}, //Using function<br>'*': function(vs, r, rule){r.a = 1;} //Initialize<br>}</code>
* @param {assoc} [opt] Option.
* @param {boolean} [opt.reset=false] Determine to reset values. and use only specified values by rule.
* @param {boolean} [opt.replace=true] Determine to replace value. If 'fill' is false, the original value retain.
* @param {boolean} [opt.array=false] Determine return value type. Default type is assoc.
* @param {string} [opt.init='*'] Function name of initialize used by rule.
* @returns {assoc|array} New values converted by rule.
*
* @tutorial static-any
* @example
* rule = {
* a1: 'a', //a >> a1
* b1: 'b', //b >> b1
* c: null, //delete
* d: {1: 'london', 2: 'new york', 3: 'tokyo'}, //cover by matrix
* e: 'x' //none
* };
* vs = $any.filter(vs, rule);
*
* @example
* rule = {
* '*': function(vs, r){
* r.b = 4; //b
* },
* a1: function(v, vs, r){
* return vs.a+10;
* },
* a2: 'a' //a >> a2
* };
* vs = $any.filter(vs, rule, {reset: true});
*
* @example
* //Array
* rule = {
* '*': function(vs, r){
* r[5] = 101; //5
* r[6] = 102; //6
* },
* 7: 0, //0 >> 7
* 8: function(v, vs, r){
* return 103;
* }
* };
vs = $any.filter(vs, rule, {replace: false, array: true});
*/
any.filter = function(vs, rule, opt){
opt = ext({reset: false, replace: true, array: false, init: '*'}, opt);
var r = null, tvs = (opt.reset)?null:vs;
r = any.clone(tvs, opt.array);
if (typeof rule[opt.init] === 'function'){
var init = rule[opt.init];
delete rule[opt.init];
init(vs, r, rule);
}
any.each(rule, function(to, frm){
if (typeof frm !== 'function'){
if (frm == null){
delete r[to];
}else{
if (typeof frm !== 'object'){
r[to] = (vs[frm] !== undefined)?vs[frm]:null;
}else{
tvs = frm[vs[to]];
r[to] = (tvs == null)?null:tvs;
}
if (opt.replace && to != frm){
delete r[frm];
}
}
}else{
r[to] = frm(((vs[to] !== undefined)?vs[to]:null), vs, r);
}
});
return r;
};
/**
* Inject function to wrap function and run. Usecase: ex. initialization.
* @function inject
* @memberof $any
*
* @param {function} wrap Wrap function.<br><code>function(fn, vs...){ }</code>
* @param {function} inject Inject function. <br><code>function(vs...){ }</code>
* @returns {function}
*
* @tutorial static-any
* @tutorial demo-various
* @example
* $any.inject(function(fn, v){
* $('#target').clicked(function(){
* v = !v;
* fn(v);
* });
* }, function(v){
* $('#target-pane').viewing(v);
* })(false);
* @example
* $any.inject(function(fn, v, txt){
* $(this).clicked(function(){
* v = !v;
* fn(v, txt);
* });
* }, function(v, txt){
* $('#target').append(txt);
* $('#target-pane').viewing(v);
* })(false, '.');
*/
any.inject = function(wrap, inject){
return function(){
var v = arrArg(arguments);
v.unshift(inject);
wrap.apply(this, v);
return inject.apply(this, arguments);
};
};
/**
* Create auto-count function.
* @function counter
* @memberof $any
*
* @param {number|array} v Array or init number.
* @param {assoc} [opt] Option.
* @param {number} [opt.min=null] Min value.
* @param {number} [opt.max=null] Max value.
* @param {number} [opt.add=1] Additional value.
* @param {number} [opt.init=null] Initial value.
* @param {boolean} [opt.loop=false] Determine to loop.
* @returns {function}
*
* @tutorial static-any
* @example
* fn = $any.counter(['A', 'B', 'C', 'D', 'E']);
* fn = $any.counter(12);
* fn = $any.counter(20, {add: 3, max: 30});
* fn = $any.counter([1,2,3], {loop: true});
*/
any.counter = function(v, opt){
opt = ext({min: null, max: null, add: 1, init: null, loop: false}, opt);
var n = 0, min = opt.min, max = opt.max;
if (typeof v === 'number'){
n = v;
}else if (v instanceof Array){
if(opt.min == null){
min = 0;
}
if(opt.max == null){
max = v.length - 1;
}
}
if (opt.init != null){
n = opt.init;
}
n-= opt.add;
return function(init){
var t;
n = n + opt.add;
if (init != null){
n = v;
}
t = n - max;
if (max != null && t > 0){
if (opt.loop){
n = (min != null)?min:0;
n+= t - 1;
}else{
n = max;
}
}
t = n - min;
if (min != null && t < 0){
if (opt.loop){
n = max;
n+= t + 1;
}else{
n = min;
}
}
if (v instanceof Array){
return (v[n] !== undefined)?v[n]:null;
}
return n;
};
};
/**
* Calc crc16.
* @function crc
* @memberof $any
*
* @param {string} v String value
* @returns {number} Crc16 value
*
* @tutorial static-any
* @example
* num = $any.crc16(val);
*/
any.crc16 = function(v){
if (v == null){
return 0;
}
var crc = 0, i, j;
for(i=0; i < v.length; i++){
crc ^= v.charCodeAt(i);
for(j = 0; j < 8; j++){
crc = (crc & 1) ? (crc >> 1) ^ 0xa001 : (crc >> 1);
}
}
return crc;
};
/**
* Escape regex.
* @function escapeRegex
* @memberof $any
*
* @param {string} v String value.
* @returns {string}
*
* @tutorial static-any
* @example
* val = $any.escapeRegex(val);
*/
any.escapeRegex = function(v){
return v.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
};
/**
* any($any) static methods. Method for class operation.
*
* | Method | Default ver | Tiny ver | Micro ver |
* |:---|:---:|:---:|:---:|
* | All methods | Yes | Yes | Yes |
*
* @namespace $any@class
*
* @tutorial static-any-class
*
* @example
* var ACls = $any.makeClass(
* function(n){
* this.n = n;
* }, {
* output: function(){ alert(this.n); }
* }
* );
* var a = new ACls(1);
*
* $any.mixin(AClass, {xyz: function(){ ... }});
*
* $any.defineClass({
* 'StoneClass': function(make){ return make(function(){ ... }, { ... }); },
* 'Metal.IronClass': function(make){ return make(function(){ ... }, { ... }); }
* });
*
* Class = $any.getClass('Metal.IronClass');
*
* tree = $any.newClass('TreeClass');
*/
/**
* @ignore
*/
function clBind(C){
C.prototype.bind = function(fn){
try{
return fn.bind(this);
} catch (e){
}
var c = this;
return function(){
return fn.apply(c, arguments);
};
};
}
/**
* Create class and inherits class.
*
* <b>Specification</b><br>
*
* | | |
* |:---|:---|
* | <b>Build class</b> | Define constructor by function / Methods which added by 'prototype' |
* | <b>Extends class</b> | Both build-class and super-class's constructor / Override super-class methods by 'prototype' |
*
* @function makeClass
* @memberof $any@class
*
* @param {function} construct Class constructor and base structure.
* @param {function|functions} methods Class methods or Function space and class methods. Add methods by prototype.
* @param {function} [parent=null] If specified, extends super-class.
* @param {boolean} [bind=true] If true, Add <i>bind</i> method.
* @returns {object} Class. This is not instance.
*
* @tutorial static-any-class
* @example
* //Build class
* var ACls = $any.makeClass(
* function(n){
* this.n = n;
* }, {
* output: function(){ alert(this.n); }
* }
* );
* var a = new ACls(1);
*
* //Extends class
* var BCls = $any.makeClass(
* function(n){
* this.b = 5;
* }, {
* output: function(){ alert(this.n + this.b); }
* }, ACls
* );
* var b = new BCls(2);
*/
any.makeClass = function(construct, methods, parent, bind){
info('makeClass');
var C;
construct = construct || function(){};
if (parent){
C = function(){
parent.apply(this, arguments);
construct.apply(this, arguments);
};
try {
C.prototype = Object.create(parent.prototype);
}catch(e){
var P = function(){};
P.prototype = parent.prototype;
C.prototype = new P();
}
}else{
C = construct;
}
if (typeof methods === 'function'){
methods = methods();
}
for(var k in methods){
if (methods.hasOwnProperty(k)){
C.prototype[k] = methods[k];
}
}
if (bind !== false){
clBind(C);
}
return C;
};
/**
* Mixin of class by methods. Override methods by 'prototype'.
*
* @function mixin
* @memberof $any@class
*
* @param {Class} Class Class object.
* @param {functions} methods The added method.
* @returns {Class}
*
* @tutorial static-any-class
* @example
* $any.mixin(AClass, {xyz: function(){ ... }});
*/
any.mixin = function(Class, methods){
info('mixin');
for(var k in methods){
if (methods.hasOwnProperty(k)){
Class.prototype[k] = methods[k];
}
}
return Class;
};
/**
* @ignore
*/
var clDf = {};
/**
* Define class builder by function.
*
* @function defineClass
* @memberof $any@class
*
* @param {string|assoc<string, function>} name Class name. Namespace can be specified.
* @param {function} build Build function. <code>function(make){ ... }</code>
* @param {boolean} [once=false] Don't show error in duplication class-name.
*
* @see $any@class.makeClass
*
* @tutorial static-any-class
*
* @example
* $any.defineClass('StoneClass', function(){return $any.makeClass(function(){ ... }; });
* $any.defineClass('Material.natural.StoneClass', function(){ return $any.makeClass(function(){ ... }, { ... }); });
* $any.defineClass('StoneClass', function(make){ return make(function(){ ... }, { ... }); });
* $any.defineClass('Metal.IronClass', function(){return $any.makeClass(function(){ ... }; }, true);
* $any.defineClass({
* 'StoneClass': function(make){ return make(function(){ ... }, { ... }); },
* 'Metal.IronClass': function(make){ return make(function(){ ... }, { ... }); }
* });
*/
any.defineClass = function(name, build, once){
info('defineClass');
if (typeof name === 'string'){
var t = {};
t[name] = build;
name = t;
}
any.each(name, function(name, build){
if (!name || name.search(/^[a-z]+[\w\.]+[a-z0-9]+$/i) == -1){
console.error('class name error:' + name);
return;
}
if (clDf[name]){
if (!once){
console.error('already exist class:' + name);
}
return;
}
clDf[name] = build;
});
};
/**
* @ignore
*/
var clCls = {};
/**
* Get a class from defined classes.
* @function getClass
* @memberof $any@class
*
* @param {string} name Class name. Namespace can be specified.
* @param {boolean} [store=true] Store class object. In default(true), the second time later, not make.
* @return {Class} Class. This is not instance.
*
* @see $any@class.defineClass
* @see $any@class.makeClass
*
* @tutorial static-any-class
*
* @example
* Class = $any.getClass('StoneClass');
* Class = $any.getClass('Metal.IronClass');
* Class = $any.getClass('Material.natural.StoneClass', false);
*/
any.getClass = function(name, store){
info('getClass');
if (!clDf[name]){
console.error('class none:' + name);
return null;
}
if (clCls[name]){
return clCls[name];
}
var C = clDf[name](any.makeClass);
if (store !== false){
clCls[name] = C;
}
return C;
};
/**
* Create new instance with constructor arguments.
* @function newClass
* @memberof $any@class
*
* @param {string} name Class name. Namespace can be specified.
* @param {array} [vs] Constructor arguments.
* @return {object} Class instance.
*
* @see $any@class.defineClass
* @see $any@class.getClass
*
* @tutorial static-any-class
*
* @example
* tree = $any.newClass('TreeClass');
* stone = $any.newClass('Material.natural.StoneClass');
* silver = $any.newClass('Metal.SilverClass', [1, 2, 3]);
*/
any.newClass = function(name, vs){
info('newClass');
var C = any.getClass(name);
vs = vs || [];
vs.unshift(C);
/* jshint ignore:start */
return new (C.bind.apply(C, vs));
/* jshint ignore:end */
};
/**
* Console out defined classes.
* @function definedClasses
* @memberof $any@class
*
* @param {boolean} [store=false] Output stored class.
*
* @see $any@class.defineClass
*
* @tutorial static-any-class
*
* @example
* $any.definedClasses();
* $any.definedClasses(true);
*/
any.definedClasses = function(store){
info('definedClasses');
console.log('[Defined classes]');
any.each((store)?clCls:clDf, function(nm, cls){
console.log(nm, cls);
});
};
/**
* Provide log and debug helper methods.
*
* | Method | Default ver | Tiny ver | Micro ver |
* |:---|:---:|:---:|:---:|
* | events | Yes | - | - |
* | Others | Yes | Yes | Yes |
*
* @namespace $any.log
*
* @tutorial static-any
* @tutorial static-log
*/
any.log = {target: {scope: null, methods: null, elem: null}};
/**
* Set log behaviors. Set $any.define.info, $any.define.error.
* @function debug
* @memberof $any.log
*
* @param {integer} [info=null] $any.info mode. $any.define.info.
* @param {integer} [error=null] $any.error mode. $any.define.error.
* @param {boolean} [throwError=null] Throw error. $any.define.throwError.
* @param {boolean} [targetExist=null] Check existence of selector's target. $any.define.targetExist.
*
* @see $any.info
* @see $any.error
* @see $any.define.info
* @see $any.define.error
* @see $any.define.throwError
*
* @tutorial static-log
*
* @example
* $any.log.debug(0, 1); //On error
* $any.log.debug(0, 1, true); //On error and throw error
* $any.log.debug(0, 0); //Off error
* $any.log.debug(0, 2); //On error trace
* $any.log.debug(1); //On info
* $any.log.debug(1); //On info trace
* $any.log.debug(null, null, true); //Throw error
*/
any.log.debug = function(info, error, throwError, targetExist){
if (info != null){
any.define.info = info;
}
if (error != null){
any.define.error = error;
}
if (throwError != null){
any.define.throwError = throwError;
}
if (targetExist != null){
any.define.targetExist = targetExist;
}
};
/**
* Set limit target by method and element and scope.
* @function limit
* @memberof $any.log
*
* @param {string|array} method Method name.
* @param {Selector} [el] Element target. Enable log if the element has event element.
* @param {boolean} [scope] Scope target. Enable log only target scope.
*
* @see $any.info
* @see $any.error
* @see $any.define.info
* @see $any.define.error
*
* @tutorial static-log
*
* @example
* $any.log.limit('showing');
* $any.log.limit(['showing', 'hiding']);
* $any.log.limit(null, $('#target'));
* $any.log.limit(null, $('#parent'));
* $any.log.limit(null, null, 'ajax');
* $any.log.limit(null, null, 'view');
*/
any.log.limit = function(method, el, scope){
any.log.target.methods = (typeof method === 'string')?[method]:method;
if (el !== undefined){
any.log.target.elem = el;
}
if (scope !== undefined){
any.log.target.scope = scope;
}
};
var logOn = 1;
/**
* @ignore
*/
function logAny(nm, vs, error){
if (logOn <= 0 && !error){
return null;
}
if (any.log.target.scope && any.log.target.scope != nm){
return null;
}
vs = vs || [];
nm = (!error)?(nm || 'any.'):'';
var t;
if (any.log.target.elem){
t = vs[1];
if (isEl(t)){
if(!hasEl(any.log.target.elem, t)){
return null;
}
}
}
if (any.log.target.methods && any.log.target.methods.indexOf(vs[0]) == -1){
return null;
}
vs[0] = nm + ((vs[0] == null)?'*':vs[0]);
for (var i=vs.length;i>=0;i--){
if (vs[i] == undefined){
vs[i] = null;
}
}
return vs;
}
/**
* @ignore
*/
any.log.info = function(nm, vs){
if (any.define.info <= 0){
return;
}
vs = logAny(nm, vs, false);
if (vs){
any.info.apply(null, vs);
if (any.log.breakpoint){
any.log.breakpoint(nm, vs);
}
}
};
/**
* @ignore
*/
any.log.error = function(nm, vs){
if (any.define.error <= 0){
return;
}
vs = logAny(nm, vs, true);
if (vs){
any.error.apply(null, vs);
if (any.log.breakpoint){
any.log.breakpoint(vs);
}
}
};
/**
* Set break-point function.
* @memberof $any.log
* @type {function}
* @default null
*
* @see $any.log.info
* @see $any.log.error
*
* @tutorial static-log
*
* @example
* $any.log.breakpoint = function(){ ... };
*/
any.log.breakpoint = null;
any.log.suspend = function(){
nolog();
};
any.log.resume = function(){
relog();
};
/**
* @ignore
*/
function info(){
any.log.info(null, arguments);
}
/**
* @ignore
*/
function error(){
any.log.error(null, arguments);
}
/**
* @ignore
*/
function nolog(){
logOn--;
}
/**
* @ignore
*/
function relog(){
logOn++;
}
/**
* Assign values to template.
*
* | Method | Default ver | Tiny ver | Micro ver |
* |:---|:---:|:---:|:---:|
* | assign | Yes | Yes | Yes |
* | assigns | Yes | Yes | Yes |
* | make | Yes | - | - |
* | makes | Yes | - | - |
* | cover | Yes | - | - |
*
* @namespace $any.tpl
*
* @tutorial static-tpl
*
* @example
* v = {target: 'MnO2', Type: 'dry-cell'};
* src = 'The principal use for {target} is for {type} batteries.';
* html = $any.tpl.assign(src, v, {ignoreCase: true});
* //The principal use for MnO2 is for dry-cell batteries.
*
* vs = [{a: 'A1', b: 'B1'}, {a: 'A2', b: 'B2'}];
* src = '<li>{a}, {b}</li>';
* html = $any.tpl.assigns(src, vs);
*/
any.tpl = {define: {}};
/**
* Wrap side strings.
* @memberof $any.tpl
* @type {array}
* @default ['{', '}']
*
* @example
* $any.tpl.define.wraps = ['{', '}'];
* $any.tpl.define.wraps = ['{{', '}}'];
*/
any.tpl.define.wraps = ['{', '}'];
/**
* Determine to sort key of assoc by length.
* @memberof $any.tpl
* @type {boolean}
* @default true
* @example
* $any.tpl.define.sort = true;
*/
any.tpl.define.sort = true;
/**
* Assign values to template.
* @function assign
* @memberof $any.tpl
*
* @param {string} src Template source.
* @param {assoc|string|number} vs Assign values or sinple value.
* @param {assoc} opt Option
* @param {boolean} [opt.wrap=true] Determine to wrap.
* @param {boolean} [opt.ignoreCase=false] Determine to ignore case sensitive.
* @returns {string}
*
* @tutorial static-tpl
* @example
* v = {target: 'MnO2', Type: 'dry-cell'};
* src = 'The principal use for {target} is for {type} batteries.';
*
* html = $any.tpl.assign(src, v, {ignoreCase: true});
* //The principal use for MnO2 is for dry-cell batteries.
*
* html = $any.tpl.assign('{*}-pilot / {*}-trader', 'auto'); //auto-pilot / auto-trader
*/
any.tpl.assign = function(src, vs, opt){
info('tpl.assign');
opt = ext({wrap: true, ignoreCase: false}, opt);
var k, wp, rx, rgx = '', vz = {};
if (typeof vs === 'object'){
var v, ks = any.keys(vs);
if (any.tpl.define.sort){
ks.sort(function(a, b){
return b.length - a.length;
});
}
for (var i in ks){
if (ks.hasOwnProperty(i)){
k = ks[i];
v = vs[k];
if (opt.ignoreCase){
k = k.toLowerCase();
}
if (opt.wrap){
wp = any.tpl.define.wraps;
k = wp[0] + k + wp[1];
}
vz[k] = v;
k = any.escapeRegex(k);
rgx += k + '|';
}
}
rgx = rgx.slice(0, -1);
}else{
k = '*';
if (opt.wrap){
wp = any.tpl.define.wraps;
k = wp[0] + k + wp[1];
}
rgx = any.escapeRegex(k);
vz[k] = vs;
}
rgx = '(' + rgx + ')';
var o = 'g';
if (opt.ignoreCase){
o += 'i';
}
rx = new RegExp(rgx, o);
return src.replace(rx, function(key){
if (opt.ignoreCase){
key = key.toLowerCase();
}
return vz[key];
});
};
/**
* Assign multiple values.
* @function assigns
* @memberof $any.tpl
*
* @param {string} src Template source.
* @param {array} rows Multiple assign values.
* @param {assoc} [opt] $any.tpl.assign option.
* @returns {string}
*
* @see $any.tpl.assign
*
* @tutorial static-tpl
* @example
* vs = [{a: 'A1', b: 'B1'}, {a: 'A2', b: 'B2'}];
* src = '<li>{a}, {b}</li>';
* html = $any.tpl.assigns(src, vs);
* v = $any.tpl.assigns('<div>{*}</div>', ['Iron', 'Bronze']); //<div>Iron</div><div>Bronze</div>
*/
any.tpl.assigns = function(src, rows, opt){
info('tpl.assigns');
var r = '';
for(var i = 0; i < rows.length; i++){
r += any.tpl.assign(src, rows[i], opt);
}
return r;
};
/**
* Date data converter. Date source to Date value assoc, date string.
*
* | Method | Default ver | Tiny ver | Micro ver |
* |:---|:---:|:---:|:---:|
* | All methods | Yes | Yes | Yes |
*
* <b>Date format values</b><br>
*
* | Value | Description | Example |
* |:---|:---|:---|
* | y | Number of year | 2016 |
* | yy | 2digit year | "16" |
* | M | Number of month | 2 |
* | MM | 2digit month | "02" |
* | MMM | String month | "Feb" |
* | d | Number of date | 1 |
* | dd | 2digit date | "01" |
* | e | Number of day-of-week | 6 |
* | EEE | String day-of-week | "Sat" |
* | H | Number of 24hours | 5 |
* | HH | 2digit 24hours | "05" |
* | h | Number of 12hours | 5 |
* | hh | 2digit 12hours | "05" |
* | a | AM or PM | "AM" |
* | m | Number of min | 6 |
* | mm | 2digit min | "06" |
* | s | Number of sec | 8 |
* | ss | 2digit sec | "08" |
* | unixtm | Unixtime sec | 1272730884 |
* | unixms | Unixtime ms | 1272730884000 |
*
* @namespace $any.date
*
* @see $any.tpl
*
* @tutorial static-date
*
* @example
* dt = $any.date.get(); //Now
* dt = $any.date.get('2056-1-1 0:00'); //Date format string
* v = $any.date.format('yyyy-MM-dd HH:mm');
* v = $any.date.format('EEE, MMM d, yyyy', 'February 10, 2010 0:00');
*/
any.date = any.profile.create();
/**
* Months
* @memberof $any.date
* @type {array}
* @default ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
* @example
* $any.date.define.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
*/
any.date.define.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
/**
* Days
* @memberof $any.date
* @type {array}
* @default ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
* @example
* $any.date.define.days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
*/
any.date.define.days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
/**
* @ignore
*/
function dtP(dt){
if (!dt){
return new Date();
}else if (typeof dt === 'object'){
return dt;
}
if (String(dt).match(/^[\s\-]*[\d\s]+$/)){
dt = dt * 1000;
}else{
dt = dt.replace(/[\-\.]/g, '/');
if (!dt.match(/\d\s*\:\s*\d/)){
dt+= ' 0:00';
}
}
return new Date(dt);
}
/**
* @ignore
*/
function dtT(v){
return ('0' + v).slice(-2);
}
/**
* Get date value assoc.
* @function get
* @memberof $any.date
*
* @param {integer|Date|string} [date] Date source.Supporting various format.
* @param {boolean} [isError=true] Determine to occur error, failing to parse format.
* @returns {object}
*
* @tutorial static-date
* @example
* //Return object
* {
* y:2010, yyyy:"2010", yy:"10",
* M:5, MM:"05", MMM:"May",
* d:1, dd:"01", EEE:"Sat", e:6
* H:16, HH:"16", h:4, hh:"04", a:"PM"
* m:21, mm:"21"
* s:42, ss:"42"
* unixtm:1272730884, unixms:1272730884000
* }
* @example
* dt = $any.date.get(); //Now
* dt = $any.date.get('2056-1-1 0:00'); //Date format string
* dt = $any.date.get(1024100000); //Unix timestamp
* dt = $any.date.get(new Date('1893/01/01')); //Date object
*/
any.date.get = function(date, isError){
info('date.get');
var dt = dtP(date), v = {}, t;
if (!dt || isNaN(dt.getTime())){
if (isError !== false){
error('illegal format', date);
}
return null;
}
v.y = dt.getFullYear();
v.M = dt.getMonth() + 1;
v.d = dt.getDate();
v.H = dt.getHours();
v.m = dt.getMinutes();
v.s = dt.getSeconds();
v.e = dt.getDay();
v.yyyy = ('0' + v.y).slice(-4);
v.yy = dtT(v.y);
v.MM = dtT(v.M);
v.dd = dtT(v.d);
v.MMM = any.date.define.months[v.M - 1];
v.EEE = any.date.define.days[v.e];
v.a = (v.H < 12)?'AM':'PM';
v.HH = dtT(v.H);
v.h = v.H%12;
v.hh = dtT(v.h);
v.mm = dtT(v.m);
v.ss = dtT(v.s);
t = dt.getTime();
v.unixms = t; //milliseconds
v.unixtm = Math.floor(t/1000);
return v;
};
/**
* Return formated date time.
* @function format
* @memberof $any.date
*
* @param {integer|Date|string} [date] Date source.Supporting various format.
* @param {string} [format='EEE, MMM d, yyyy HH:mm'] Date format.
* @param {assoc} [opt] Option
* @param {string} [opt.error=true] Determine to occur error. - $any.date.get error
* @param {string} [opt.wrap=false] Determine to wrap each value.
* @returns {string}
*
* @tutorial static-date
* @example
* v = $any.date.format('yyyy-MM-dd HH:mm');
* v = $any.date.format('EEE, MMM d, yyyy', 'February 10, 2010 0:00');
* v = $any.date.format('EEE, MMM d, yyyy', '2063-2-30 0:00');
* v = $any.date.format('EEE, MMM, M/d, yyyy HH:mm', '1956.7.10 0:00');
* v = $any.date.format('EEE, MMM d, yyyy', 1131156102);
*/
any.date.format = function(format, date, opt){
info('date.format');
format = format || 'EEE, MMM d, yyyy HH:mm';
opt = ext({error: true, wrap: false}, opt);
var dt = any.date.get(date, opt.error);
if (!dt){
return '';
}
return any.tpl.assign(format, dt, {wrap: opt.wrap});
};
})($any);
| hare1039/cdnjs | ajax/libs/anyjs/1.0.0/any-micro.js | JavaScript | mit | 39,536 |
/*nlp_compromise 4.2.2 MIT*/
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.nlp_compromise=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(b,c,d){"use strict";function e(){this.plugin=function(a){a=a||{},g.isFunction(a)&&(a=a.call(this,this)),Object.keys(a).forEach(function(b){Object.keys(a[b]).forEach(function(c){h[b].fn[c]=a[b][c]})})},this.lexicon=function(){return b("./lexicon.js")},this.term=function(a){return new h.Term(a)},this.noun=function(a){return new h.Noun(a)},this.verb=function(a){return new h.Verb(a)},this.adjective=function(a){return new h.Adjective(a)},this.adverb=function(a){return new h.Adverb(a)},this.value=function(a){return new h.Value(a)},this.person=function(a){return new h.Person(a)},this.place=function(a){return new h.Place(a)},this.date=function(a){return new h.Date(a)},this.organization=function(a){return new h.Organization(a)},this.text=function(a,b){return new h.Text(a,b)},this.sentence=function(a,b){return new h.Sentence(a,b)},this.statement=function(a){return new h.Statement(a)},this.question=function(a){return new h.Question(a)}}var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},g=b("./fns.js"),h={Term:b("./term/term.js"),Text:b("./text/text.js"),Sentence:b("./sentence/sentence.js"),Statement:b("./sentence/statement/statement.js"),Question:b("./sentence/question/question.js"),Verb:b("./term/verb/verb.js"),Adjective:b("./term/adjective/adjective.js"),Adverb:b("./term/adverb/adverb.js"),Noun:b("./term/noun/noun.js"),Value:b("./term/noun/value/value.js"),Person:b("./term/noun/person/person.js"),Place:b("./term/noun/place/place.js"),Date:b("./term/noun/date/date.js"),Organization:b("./term/noun/organization/organization.js")},i=new e;("object"===("undefined"==typeof window?"undefined":f(window))||"function"==typeof DedicatedWorkerGlobalScope)&&(self.nlp_compromise=i),"undefined"!=typeof c&&c.exports&&(c.exports=i),"function"==typeof a&&a.amd&&a(i)},{"./fns.js":22,"./lexicon.js":23,"./sentence/question/question.js":43,"./sentence/sentence.js":44,"./sentence/statement/statement.js":45,"./term/adjective/adjective.js":47,"./term/adverb/adverb.js":52,"./term/noun/date/date.js":56,"./term/noun/noun.js":62,"./term/noun/organization/organization.js":64,"./term/noun/person/person.js":68,"./term/noun/place/place.js":70,"./term/noun/value/value.js":78,"./term/term.js":79,"./term/verb/verb.js":87,"./text/text.js":89}],2:[function(a,b,c){"use strict";var d=a("./honourifics"),e=["arc","al","exp","rd","st","dist","mt","fy","pd","pl","plz","tce","llb","md","bl","ma","ba","lit","ex","eg","ie","circa","ca","cca","vs","etc","esp","ft","bc","ad"];e=e.concat(d);var f=["dept","univ","assn","bros","inc","ltd","co","corp","yahoo","joomla","jeopardy"];e=e.concat(f);var g=["ala","ariz","ark","cal","calif","col","colo","conn","del","fed","fla","fl","ga","ida","ind","ia","la","kan","kans","ken","ky","la","md","mich","minn","mont","neb","nebr","nev","okla","penna","penn","pa","dak","tenn","tex","ut","vt","va","wash","wis","wisc","wy","wyo","usafa","alta","ont","que","sask","yuk","ave","blvd","cl","ct","cres","hwy"];e=e.concat(g);var h=["jan","feb","mar","apr","jun","jul","aug","sep","oct","nov","dec","sept","sep"];e=e.concat(h),b.exports={abbreviations:e,dates:h,orgs:f,places:g}},{"./honourifics":9}],3:[function(a,b,c){"use strict";var d=a("../fns"),e={erate:"degen,delib,desp,lit,mod",icial:"artif,benef,off,superf",ntial:"esse,influe,pote,substa",teful:"gra,ha,tas,was",stant:"con,di,in,resi",going:"easy,fore,on,out",hing:"astonis,das,far-reac,refres,scat,screec,self-loat,soot",eful:"car,grac,peac,sham,us,veng",ming:"alar,cal,glea,unassu,unbeco,upco",cial:"commer,cru,finan,ra,so,spe",tful:"deligh,doub,fre,righ,though,wis",ight:"overn,overwe,r,sl,upt",ated:"antiqu,intoxic,sophistic,unregul,unrel",rant:"aber,exube,flag,igno,vib",uent:"congr,fl,freq,subseq",rate:"accu,elabo,i,sepa",ific:"horr,scient,spec,terr",rary:"arbit,contempo,cont,tempo",ntic:"authe,fra,giga,roma",wing:"harro,kno,left-,right-",nant:"domi,malig,preg,reso",nent:"emi,immi,perma,promi",iant:"brill,def,g,luxur",ging:"dama,encoura,han,lon",iate:"appropr,immed,inappropr,intermed",rect:"cor,e,incor,indi",zing:"agoni,ama,appeti,free",ant:"abund,arrog,eleg,extravag,exult,hesit,irrelev,miscre,nonchal,obeis,observ,pl,pleas,redund,relev,reluct,signific,vac,verd",ing:"absorb,car,coo,liv,lov,ly,menac,perplex,shock,stand,surpris,tell,unappeal,unconvinc,unend,unsuspect,vex,want",ate:"adequ,delic,fortun,inadequ,inn,intim,legitim,priv,sed,ultim",ted:"expec,impor,limi,spiri,talen,tes,unexpec,unpreceden",ish:"dan,fool,hell,lout,self,snobb,squeam,styl",ary:"dre,legend,necess,prim,sc,second,w,we",ite:"el,favor,fin,oppos,pet,pol,recond,tr",ely:"hom,lik,liv,lon,lov,tim,unlik",ure:"fut,insec,miniat,obsc,premat,sec,s",tly:"cos,ghas,ghos,nigh,sain,sprigh,unsigh",dly:"cowar,cud,frien,frien,kin,ma",ble:"a,dou,hum,nim,no,proba",rly:"bu,disorde,elde,hou,neighbo,yea",ine:"div,femin,genu,mascul,prist,rout",ute:"absol,ac,c,m,resol",ped:"cram,pum,stereoty,stri,war",sed:"clo,disea,distres,unsupervi,u",lly:"chi,hi,jo,si,sme",per:"dap,impro,pro,su,up",ile:"fert,host,juven,mob,volat",led:"detai,disgrunt,fab,paralle,troub",ern:"east,north,south,st,west",ast:"e,l,p,steadf",ent:"abs,appar,b,pres",ged:"dama,deran,jag,rag",ded:"crow,guar,retar,undeci",est:"b,dishon,hon,quick",ial:"colon,impart,init,part",ter:"bet,lat,ou,ut",ond:"bey,bl,sec,vagab",ady:"he,re,sh,ste",eal:"ether,id,r,surr",ard:"abo,awkw,stand,straightforw",ior:"jun,pr,sen,super",ale:"fem,m,upsc,wholes",ed:"advanc,belov,concern,craz,determin,fix,hallow,hook,hurri,inbr,justifi,labor,learn,mix,nak,nuanc,sacr,subdu,unauthoriz,unpublish,unrecogniz,wick",ly:"dai,deep,earth,gris,heaven,low,meas,melancho,month,oi,on,prick,seem,s,ug,unru,week,wi,woman",al:"actu,coloss,glob,illeg,leg,leth,liter,loy,ov,riv,roy,univers,usu",dy:"baw,bloo,clou,gau,gid,han,mol,moo,stur,ti,tren,unti,unwiel",se:"adver,den,diver,fal,immen,inten,obe,perver,preci,profu",er:"clev,form,inn,oth,ov,she,slend,somb,togeth,und",id:"afra,hum,langu,plac,rab,sord,splend,stup,torp",re:"awa,bizar,di,enti,macab,me,seve,since,spa",en:"barr,brok,crav,op,sudd,unev,unwritt,wood",ic:"alcohol,didact,gener,hispan,organ,publ,symbol",ny:"ma,pho,pu,shi,skin,ti,za",st:"again,fir,mo,populi,raci,robu,uttermo",ne:"do,go,insa,obsce,picayu,sere",nd:"behi,bla,bli,profou,undergrou,wou",le:"midd,multip,sing,so,subt,who",pt:"abru,ade,a,bankru,corru,nondescri",ty:"faul,hef,lof,mea,sal,uppi",sy:"bu,chee,lou,no,ro",ct:"abstra,exa,imperfe,inta,perfe","in":"certa,highfalut,ma,tw,va",et:"discre,secr,sovi,ups,viol",me:"part-ti,pri,sa,supre,welco",cy:"boun,fan,i,jui,spi",ry:"fur,sor,tawd,wi,w",te:"comple,concre,obsole,remo",ld:"ba,bo,go,mi",an:"deadp,republic,t,urb",ll:"a,i,overa,sti",ay:"everyd,g,gr,ok",or:"indo,maj,min,outdo",my:"foa,gloo,roo,sli",ck:"ba,qua,si,sli",rt:"cove,expe,hu,ove",ul:"fo,gainf,helpf,painf"},f=["ablaze","above","adult","ahead","aloof","arab","asleep","average","awake","backwards","bad","blank","bogus","bottom","brisk","cagey","chief","civil","common","complex","cozy","crisp","deaf","devout","difficult","downtown","due","dumb","eerie","evil","excess","extra","fake","far","faux","fierce ","fit","foreign","fun","good","goofy","gratis","grey","groovy","gross","half","huge","humdrum","inside","kaput","lax","left","less","level","lewd","magenta","makeshift","mammoth","medium","moot","naive","nearby","next","nonstop","north","offbeat","ok","outside","overwrought","premium","pricey","pro","quaint","random","rear","rebel","ritzy","rough","savvy","sexy","shut","shy","sleek","smug","solemn","south","stark","superb","taboo","teenage","top","tranquil","ultra","understood","unfair","unknown","upbeat","upstairs","vanilla","various","widespread","woozy","wrong"];b.exports=d.expand_suffixes(f,e)},{"../fns":22}],4:[function(a,b,c){"use strict";b.exports=["absurd","aggressive","alert","alive","awesome","beautiful","big","bitter","black","blue","bored","boring","brash","brave","brief","bright","broad","brown","calm","charming","cheap","clean","cold","cool","cruel","cute","damp","deep","dear","dead","dark","dirty","drunk","dull","eager","efficient","even","faint","fair","fanc","fast","fat","feeble","few","fierce","fine","flat","forgetful","frail","full","gentle","glib","great","green","gruesome","handsome","hard","harsh","high","hollow","hot","impolite","innocent","keen","kind","lame","lean","light","little","loose","long","loud","low","lush","macho","mean","meek","mellow","mundane","near","neat","new","nice","normal","odd","old","pale","pink","plain","poor","proud","purple","quick","rare","rapid","red","rich","ripe","rotten","round","rude","sad","safe","scarce","scared","shallow","sharp","short","shrill","simple","slim","slow","small","smart","smooth","soft","sore","sour","square","stale","steep","stiff","straight","strange","strong","sweet","swift","tall","tame","tart","tender","tense","thick","thin","tight","tough","vague","vast","vulgar","warm","weak","wet","white","wide","wild","wise","young","yellow","easy","narrow","late","early","soon","close","empty","dry","windy","noisy","thirsty","hungry","fresh","quiet","clear","heavy","happy","funny","lucky","pretty","important","interesting","attractive","dangerous","intellegent","pure","orange","large","firm","grand","formal","raw","weird","glad","mad","strict","tired","solid","extreme","mature","true","free","curly","angry"].reduce(function(a,b){return a[b]="Adjective",a},{})},{}],5:[function(a,b,c){"use strict";var d=["january","february","april","june","july","august","september","october","november","december","jan","feb","mar","apr","jun","jul","aug","sep","oct","nov","dec","sept","sep"],e=["monday","tuesday","wednesday","thursday","friday","saturday","sunday","mon","tues","wed","thurs","fri","sat","sun"],f=["millisecond","second","minute","hour","morning","afternoon","evening","night","day","week","month","year","decade","century"],g=["yesterday","today","tomorrow"];b.exports={days:e,months:d,durations:f,relative:g}},{}],6:[function(a,b,c){"use strict";b.exports=["afghan","albanian","algerian","argentine","armenian","australian","aussie","austrian","bangladeshi","belgian","bolivian","bosnian","brazilian","bulgarian","cambodian","canadian","chilean","chinese","colombian","croat","cuban","czech","dominican","egyptian","british","estonian","ethiopian","finnish","french","gambian","georgian","german","greek","haitian","hungarian","indian","indonesian","iranian","iraqi","irish","israeli","italian","jamaican","japanese","jordanian","kenyan","korean","kuwaiti","latvian","lebanese","liberian","libyan","lithuanian","macedonian","malaysian","mexican","mongolian","moroccan","dutch","nicaraguan","nigerian","norwegian","omani","pakistani","palestinian","filipino","polish","portuguese","qatari","romanian","russian","rwandan","samoan","saudi","scottish","senegalese","serbian","singaporean","slovak","somali","sudanese","swedish","swiss","syrian","taiwanese","thai","tunisian","ugandan","ukrainian","american","hindi","spanish","venezuelan","vietnamese","welsh","african","european","asian","californian"]},{}],7:[function(a,b,c){"use strict";for(var d=a("./names/male"),e=a("./names/female"),f={},g=["casey","jamie","lee","jaime","jessie","morgan","rene","robin","devon","kerry","alexis","guadalupe","blair","kasey","jean","marion","aubrey","shelby","jan","shea","jade","kenyatta","kelsey","shay","lashawn","trinity","regan","jammie","cassidy","cheyenne","reagan","shiloh","marlo","andra","devan","rosario","lee"],h=0;h<d.length;h++)f[d[h]]="m";for(var h=0;h<e.length;h++)f[e[h]]="f";for(var h=0;h<g.length;h+=1)f[g[h]]="a";b.exports=f},{"./names/female":14,"./names/male":15}],8:[function(a,b,c){"use strict";var d={"new years eve":"december 31","new years":"january 1","new years day":"january 1",thanksgiving:"fourth thursday in november","christmas eve":"december 24",christmas:"december 24","christmas day":"december 24","saint patricks day":"march 17","st patricks day":"march 17","april fools":"april 1",halloween:"october 31",valentines:"february 14","valentines day":"february 14","martin luther king":"third monday in january","inauguration day":"january 20","washingtons birthday":"third monday in february","presidents day":"third monday in february","memorial day":"last monday in may","labor day":"first monday in september","columbus day":"second monday in october","veterans day":"november 11","labour day":"first monday in september","commonwealth day":"second monday in march","st andrews day":"november 30","saint andrews day":"november 30","may day":"may 1","russia day":"june 12","australia day":"january 26","boxing day":"december 26","queens birthday":"2nd monday in june","canada day":"july 1","victoria day":"may 24","canadian thanksgiving":"second monday in october","rememberance day":"november 11","august civic holiday":"first monday in august","natal day":"first monday in august","all saints day":"november 1","armistice day":"november 11","bastille day":"july 14","st stephens day":"december 26","saint stephens day":"december 26"},e={2015:{"chinese new year":"february 19",easter:"april 5","easter sunday":"april 5","easter monday":"april 6","good friday":"april 3","ascension day":"may 14",eid:"july 17","eid al-fitr":"july 17","eid al-adha":"september 24",ramadan:"june 6",ashura:"23 october",diwali:"11 november"},2016:{"chinese new year":"february 8",easter:"march 27","easter sunday":"march 27","easter monday":"march 28","good friday":"march 25","ascension day":"may 5",eid:"july 6","eid al-fitr":"july 6","eid al-adha":"september 11",ramadan:"may 27",diwali:"october 30"},2017:{"chinese new year":"28 january",easter:"april 16","easter sunday":"april 16","easter monday":"april 17","good friday":"april 14","ascension day":"may 25",eid:"july 25","eid al-fitr":"july 25",diwali:"october 21",ramadan:"may 27"}},f=(new Date).getFullYear(),g=Object.assign(d,e[f]||{});b.exports=g},{}],9:[function(a,b,c){"use strict";b.exports=["jr","mr","mrs","ms","dr","prof","sr","sen","corp","rep","gov","atty","supt","det","rev","col","gen","lt","cmdr","adm","capt","sgt","cpl","maj","miss","misses","mister","sir","esq","mstr","phd","adj","adv","asst","bldg","brig","comdr","hon","messrs","mlle","mme","op","ord","pvt","reps","res","sens","sfc","surg"]},{}],10:[function(a,b,c){"use strict";var d=[["child","_ren"],["person","people"],["leaf","leaves"],["database","_s"],["quiz","_zes"],["stomach","_s"],["sex","_es"],["move","_s"],["shoe","_s"],["goose","geese"],["phenomenon","phenomena"],["barracks","_"],["deer","_"],["syllabus","syllabi"],["index","indices"],["appendix","appendices"],["criterion","criteria"],["man","men"],["sex","_es"],["rodeo","_s"],["epoch","_s"],["zero","_s"],["avocado","_s"],["halo","_s"],["tornado","_s"],["tuxedo","_s"],["sombrero","_s"],["addendum","addenda"],["alga","_e"],["alumna","_e"],["alumnus","alumni"],["bacillus","bacilli"],["cactus","cacti"],["beau","_x"],["château","_x"],["chateau","_x"],["tableau","_x"],["corpus","corpora"],["curriculum","curricula"],["echo","_es"],["embargo","_es"],["foot","feet"],["genus","genera"],["hippopotamus","hippopotami"],["larva","_e"],["libretto","libretti"],["loaf","loaves"],["matrix","matrices"],["memorandum","memoranda"],["mosquito","_es"],["opus","opera"],["ovum","ova"],["ox","_en"],["radius","radii"],["referendum","referenda"],["thief","thieves"],["tooth","teeth"]];d=d.map(function(a){return a[1]=a[1].replace("_",a[0]),a}),b.exports=d},{}],11:[function(a,b,c){"use strict";var d={arise:{past:"arose",participle:"arisen"},babysit:{past:"babysat",actor:"babysitter"},be:{past:"was",present:"am",future:"will be",perfect:"have been",pluperfect:"had been",future_perfect:"will have been",actor:"",gerund:"am"},is:{past:"was",present:"is",future:"will be",perfect:"have been",pluperfect:"had been",future_perfect:"will have been",actor:"",gerund:"being"},beat:{gerund:"beating",actor:"beater"},begin:{gerund:"beginning",past:"began"},bet:{actor:"better"},bind:{past:"bound"},bite:{gerund:"biting",past:"bit"},bleed:{past:"bled"},"break":{past:"broke"},breed:{past:"bred"},bring:{past:"brought"},broadcast:{past:"broadcast"},build:{past:"built"},buy:{past:"bought"},"catch":{past:"caught"},choose:{gerund:"choosing",past:"chose"},cost:{past:"cost"},deal:{past:"dealt"},die:{past:"died",gerund:"dying"},dig:{gerund:"digging",past:"dug"},"do":{past:"did",present:"does"},draw:{past:"drew"},drink:{past:"drank"},drive:{gerund:"driving",past:"drove"},eat:{gerund:"eating",past:"ate",actor:"eater"},fall:{past:"fell"},feed:{past:"fed"},feel:{past:"felt",actor:"feeler"},fight:{past:"fought"},find:{past:"found"},fly:{past:"flew"},forbid:{past:"forbade"},forget:{gerund:"forgeting",past:"forgot"},forgive:{gerund:"forgiving",past:"forgave"},freeze:{gerund:"freezing",past:"froze"},get:{past:"got"},give:{gerund:"giving",past:"gave"},go:{past:"went",present:"goes"},hang:{past:"hung"},have:{gerund:"having",past:"had",present:"has"},hear:{past:"heard"},hide:{past:"hid"},hold:{past:"held"},hurt:{past:"hurt"},lay:{past:"laid"},lead:{past:"led"},leave:{past:"left"},lie:{gerund:"lying",past:"lay"},light:{past:"lit"},lose:{gerund:"losing",past:"lost"},make:{past:"made"},mean:{past:"meant"},meet:{gerund:"meeting",past:"met",actor:"meeter"},pay:{past:"paid"},read:{past:"read"},ring:{past:"rang"},rise:{past:"rose"},run:{gerund:"running",past:"ran"},say:{past:"said"},see:{past:"saw"},sell:{past:"sold"},shine:{past:"shone"},shoot:{past:"shot"},show:{past:"showed"},sing:{past:"sang"},sink:{past:"sank"},sit:{past:"sat"},slide:{past:"slid"},speak:{past:"spoke"},spin:{gerund:"spinning",past:"spun"},spread:{past:"spread"},stand:{past:"stood"},steal:{past:"stole",actor:"stealer"},stick:{past:"stuck"},sting:{past:"stung"},strike:{gerund:"striking",past:"struck"},swear:{past:"swore"},swim:{past:"swam"},swing:{past:"swung"},teach:{past:"taught",present:"teaches"},tear:{past:"tore"},tell:{past:"told"},think:{past:"thought"},understand:{past:"understood"},wake:{past:"woke"},wear:{past:"wore"},win:{gerund:"winning",past:"won"},withdraw:{past:"withdrew"},write:{gerund:"writing",past:"wrote"},tie:{gerund:"tying",past:"tied"},ski:{past:"skiied"},boil:{actor:"boiler"},miss:{present:"miss"},act:{actor:"actor"},compete:{gerund:"competing",past:"competed",actor:"competitor"},being:{gerund:"are",past:"were",present:"are"},imply:{past:"implied",present:"implies"},ice:{gerund:"icing",past:"iced"},develop:{past:"develop",actor:"developer"},wait:{gerund:"waiting",past:"waited",actor:"waiter"},aim:{actor:"aimer"},spill:{past:"spilt"},drop:{gerund:"dropping",past:"dropped"},log:{gerund:"logging",past:"logged"},rub:{gerund:"rubbing",past:"rubbed"},smash:{present:"smashes"},suit:{gerund:"suiting",past:"suited",actor:"suiter"}};b.exports=d},{}],12:[function(a,b,c){"use strict";for(var d={etc:"FW",ie:"FW",there:"NN",better:"JJR",earlier:"JJR",has:"VB",more:"RB",sounds:"VBZ"},e={CC:["yet","therefore","or","while","nor","whether","though","because","but","for","and","if","however","before","although","how","plus","versus","not"],VBD:["where'd","when'd","how'd","what'd","said","had","been","began","came","did","meant","went"],VBN:["given","known","shown","seen","born"],VBG:["going","being","according","resulting","developing","staining"],CP:["is","will be","are","was","were","am","isn't","ain't","aren't"],DT:["this","any","enough","each","whatever","every","which","these","another","plenty","whichever","neither","an","a","least","own","few","both","those","the","that","various","what","either","much","some","else","no","la","le","les","des","de","du","el"],IN:["until","onto","of","into","out","except","across","by","between","at","down","as","from","around","with","among","upon","amid","to","along","since","about","off","on","within","in","during","per","without","throughout","through","than","via","up","unlike","despite","below","unless","towards","besides","after","whereas","'o","amidst","amongst","apropos","atop","barring","chez","circa","mid","midst","notwithstanding","qua","sans","vis-a-vis","thru","till","versus","without","w/o","o'","a'"],MD:["can","may","could","might","will","ought to","would","must","shall","should","ought","shouldn't","wouldn't","couldn't","mustn't","shan't","shant","lets","who'd","let's"],PP:["mine","something","none","anything","anyone","theirs","himself","ours","his","my","their","yours","your","our","its","nothing","herself","hers","themselves","everything","myself","itself","her","who","whom","whose"],PRP:["it","they","i","them","you","she","me","he","him","ourselves","us","we","thou","il","elle","yourself","'em"],RB:["now","again","already","soon","directly","toward","forever","apart","instead","yes","alone","ago","indeed","ever","quite","perhaps","where","then","here","thus","very","often","once","never","why","when","away","always","sometimes","also","maybe","so","just","well","several","such","randomly","too","rather","abroad","almost","anyway","twice","aside","moreover","anymore","newly","damn","somewhat","somehow","meanwhile","hence","further","furthermore"],UH:["uhh","uh-oh","please","ugh","sheesh","eww","pff","voila","oy","eep","hurrah","yuck","ow","duh","oh","hmm","yeah","whoa","ooh","whee","ah","bah","gah","yaa","phew","gee","ahem","eek","meh","yahoo","oops","d'oh","psst","argh","grr","nah","shhh","whew","mmm","yay","uh-huh","boo","wow","nope"],NN:["president","dollar","student","patent","funding","morning","banking","ceiling","energy","secretary","purpose","friends","event"]},f=Object.keys(e),g=0;g<f.length;g++)for(var h=e[f[g]],i=0;i<h.length;i++)d[h[i]]=f[g];b.exports=d},{}],13:[function(a,b,c){"use strict";b.exports={"of course":"RB","at least":"RB","no longer":"RB","sort of":"RB","at first":"RB","once again":"RB","once more":"RB","up to":"RB","by now":"RB","all but":"RB","just about":"RB","on board":"JJ","a lot":"RB","by far":"RB","at best":"RB","at large":"RB","for good":"RB","vice versa":"JJ","en route":"JJ","for sure":"RB","upside down":"JJ","at most":"RB","per se":"RB","at worst":"RB","upwards of":"RB","en masse":"RB","point blank":"RB","up front":"JJ","in situ":"JJ","in vitro":"JJ","ad hoc":"JJ","de facto":"JJ","ad infinitum":"JJ","ad nauseam":"RB","for keeps":"JJ","a priori":"FW","et cetera":"FW","off guard":"JJ","spot on":"JJ","ipso facto":"JJ","not withstanding":"RB","de jure":"RB","a la":"IN","ad hominem":"NN","par excellence":"RB","de trop":"RB","a posteriori":"RB","fed up":"JJ","brand new":"JJ","old fashioned":"JJ","bona fide":"JJ","well off":"JJ","far off":"JJ","straight forward":"JJ","hard up":"JJ","sui generis":"JJ","en suite":"JJ","avant garde":"JJ","sans serif":"JJ","gung ho":"JJ","super duper":"JJ","new york":"NN","new england":"NN","new hampshire":"NN","new delhi":"NN","new jersey":"NN","new mexico":"NN","united states":"NN","united kingdom":"NN","great britain":"NN","head start":"NN"}},{}],14:[function(a,b,c){"use strict";var d=a("../../fns"),e=["abby","amy","autumn","bobbi","brooke","carol","cheryl","claire","cleo","consuelo","eleanor","eliza","erika","faye","fern","genevieve","gertrude","gladys","inez","ingrid","jenny","jo","joni","kathryn","kelli","kim","latoya","leigh","lupe","luz","lynn","mae","maude","mildred","miriam","naomi","nikki","olga","reba","robyn","rosalind","ruth","sheryl","socorro","sonja","staci","tanya","therese","toni","traci","vicki","vicky"],f={nette:"an,antoi,ja,jea,jean,ly",eline:"ad,ang,jacqu,mad",rlene:"a,cha,da,ma",stine:"chri,erne,ju,kri",tasha:"la,na,",andra:"alex,cass,s",helle:"mic,rac,roc",linda:"be,,me",stina:"chri,cri,kri",annie:",f,je",anne:",di,je,jo,le,mari,rox,sus,suz",elia:"am,ang,cec,c,corn,d,of,sh",llie:"ca,ke,li,mi,mo,ne,o,sa",anna:",de,di,jo,joh,sh",ette:"bernad,b,bridg,claud,paul,yv",ella:"d,,est,lu,marc,st",nnie:"bo,co,je,mi,wi",elle:"dani,est,gabri,isab,jan",icia:"al,fel,let,patr,tr",leen:"ai,cath,col,ei,kath",elma:",s,th,v",etta:",henri,lor,ros",anie:"j,mel,stef,steph",anda:"am,mir,w,yol",arla:"c,d,k,m",lena:"e,he,,magda",rina:"kat,ma,sab,t",isha:"al,ke,lat,tr",olly:"d,m,p",rice:"beat,cla,pat",ttie:"be,ma,ne",acie:"gr,st,tr",isty:"chr,kr,m",dith:"e,ju,mere",onya:"lat,s,t",onia:"ant,s,t",erri:"k,sh,t",lisa:"a,e,",rine:"cathe,katha,kathe",nita:"a,bo,jua",elyn:"ev,jacqu,joc",nine:"ja,jea,jean",nice:"ber,eu,ja",tney:"brit,cour,whi",ssie:"be,ca,e",beth:",elisa,eliza",ine:"carol,ela,franc,gerald,jasm,joseph,lorra,max,nad,paul",ana:"adri,,d,de,di,j,ju,l,sh,sus",rie:"car,che,lau,lo,ma,marjo,rosema,sher,vale",ina:"angel,carol,d,georg,g,josef,mart,n,t",ora:"c,deb,d,fl,len,l,n,",ara:"barb,c,cl,k,l,s,tam,t",ela:"ang,carm,gabri,graci,l,manu,pam",ica:"angel,er,jess,mon,patr,veron",nda:"bre,gle,luci,ly,rho,ro",ley:"ash,kel,kimber,les,shel,shir",eri:"ch,j,k,sh,t",ndy:"ci,ma,mi,sa,we",ene:"hel,imog,ir,jol,lor",ula:"e,l,pa,urs",ann:",jo,le,mary",ola:"le,l,,vi",nna:"do,gle,je,lado",nne:"adrie,cori,ly,yvo",lie:"ju,les,nata,rosa",ise:"den,el,elo,lou",die:"ad,gol,jo,sa",ena:"d,lor,r,she",ian:"jill,lill,mar,viv",lyn:"caro,gwendo,jac,mari",ssa:"aly,mari,meli,vane",thy:"ca,doro,dor,ka",tha:"ber,mar,saman,tabi",sie:"el,jo,ro,su",bel:"isa,ma,mari",via:"oli,sil,syl",tie:"chris,ka,kris",dra:"au,ken,son",ria:"glo,ma,victo",gie:"an,mag,mar",lly:"ke,sa,she",ila:"le,l,she",rna:"lo,my,ve",ole:"car,nich,nic",rma:"e,i,no",any:"beth,britt,tiff",ona:"le,m,ram",rta:"albe,ma,robe",en:"carm,dore,ell,gretch,gw,hel,kar,kirst,krist,laur,maure",ia:"cecil,claud,cynth,eugen,georg,jul,luc,lyd,marc,soph,virgin",le:"ade,camil,ceci,ga,gay,luci,lucil,mab,miche,myrt",ie:"bobb,debb,dix,eff,jack,lizz,mam,soph,tamm,vick",ra:"barb,deb,elvi,lau,may,my,pet,ve",er:"amb,est,esth,heath,jenif,jennif,summ",da:"a,ai,fre,frie,hil,i,matil",ce:"ali,canda,candi,constan,floren,gra,joy",ah:"beul,debor,hann,le,rebek,sar",sa:"el,lui,mari,ro,tere,there",ne:"daph,dia,ja,jay,laver,simo",el:"eth,laur,muri,racha,rach,raqu",is:"delor,dor,jan,lo,mav,phyll",et:"bridg,harri,jan,margar,margr",ta:"al,chris,kris,margari,ri",es:"agn,delor,dolor,franc,merced",an:"jo,meag,meg,megh,sus",cy:"lu,mar,nan,sta,tra","in":"caitl,er,kar,krist",ey:"audr,linds,stac,trac",ca:"bian,blan,francis,rebec",on:"alis,allis,shann,shar",il:"abiga,apr,ga,syb",ly:"bever,emi,kimber,li",ea:"andr,chels,doroth,l",ee:"aim,d,desir,ren",ma:"al,em,wil",di:"bran,hei,jo",va:"el,e,i",ue:"dominiq,moniq,s",ay:"f,k,linds",te:"celes,ka,margueri",ry:"ma,rosema,sher",na:"ed,shau,shaw",dy:"jo,ju,tru",ti:"chris,kris,pat",sy:"bet,dai,pat",ri:"ka,lo,sha",la:"kay,priscil,wil",al:"cryst,kryst,op",ll:"jewe,ji,ne"};e=d.expand_suffixes(e,f);var g={mar:"go,isol,itza,sha",tam:"i,ika,my",be:"atriz,cky,tty,ttye",pe:"arl,ggy,nny",pa:"ige,m,tty"};e=d.expand_prefixes(e,g),b.exports=e},{"../../fns":22}],15:[function(a,b,c){"use strict";var d=a("../../fns"),e=["adolfo","angelo","anthony","armand","arthur","august","bill","billy","bobby","bradford","bret","caleb","carroll","cliff","clifford","craig","curt","derek","doug","dwight","edmund","eli","elliot","enrique","erik","felipe","felix","francisco","frank","george","glenn","greg","gregg","hans","hugh","ira","irving","isaac","jim","kermit","kurt","leo","levi","lorenzo","lou","pablo","pat","percy","philip","phillip","rex","ricky","shaun","shawn","sterling","steve","tim","timothy","wilbur","williams","wm","woodrow"],f={rence:"cla,lau,law,te,ter",lbert:"a,de,e,gi,wi",ustin:"ag,a,d,j",berto:"al,gil,hum,ro",ester:"ch,l,sylv",onnie:"d,l,r",wayne:"de,d,",erick:",fred,rod",athan:"john,jon,n",elvin:",k,m",anuel:"em,emm,m",bert:",her,hu,nor,ro",rick:"der,fred,kend,pat,",land:"cleve,gar,le,ro",ando:"arm,fern,orl,rol",ardo:"edu,ger,leon,ric",lton:"a,car,e,mi",arry:"b,g,h,l",nton:"a,cli,qui",fred:"al,,wil",ance:"l,terr,v",mmie:"ji,sa,to",erry:"j,p,t",mond:"des,ed,ray",rman:"he,no,she",rvin:"e,i,ma",nald:"do,regi,ro",rett:"b,eve,gar",son:"harri,jack,ja,ma,nel,ty,wil",ell:"darn,darr,low,mitch,russ,terr,wend",ard:"bern,edw,ger,how,leon,rich,will",ian:"adr,br,christ,dam,fab,,jul",don:"bran,,el,gor,shel",ron:"aa,by,came,my,",ton:"bur,clay,clif,pres,wins",lan:"a,al,dy,har,no",rey:"ca,co,geoff,jeff",ent:"br,k,tr,vinc",ael:"ism,mich,raf,raph",mmy:"ji,sa,ti,to",mon:"da,ra,si,solo",las:"dal,doug,nicho,nico",vin:"al,cal,de,ke",nny:"be,da,joh,ke",ius:"cornel,dar,demetr,jul",ley:"brad,har,stan,wes",lio:"emi,ju,roge",ben:",reu,ru",ory:"c,greg,r",lie:"bil,char,wil",van:"e,i,",roy:"le,,t",all:"kend,marsh,rand",ary:"c,g,zach",ddy:"bu,fre,te",art:"b,stew,stu",iel:"dan,gabr,nathan",lin:"co,frank,mar",yle:"do,k,l",her:"christop,kristop,lut",oyd:"b,fl,ll",ren:"dar,lo,war",ter:"dex,pe,wal",arl:"c,e,k",ane:"d,du,sh",aul:"p,r,s",dan:"bren,,jor",nie:"ben,er,john",ine:"anto,bla,jerma",lph:"ra,rando,rudo",est:"earn,ern,forr",win:"dar,ed,er",is:"chr,curt,den,denn,ell,franc,lew,lou,lu,morr,ot,trav,will",er:"alexand,elm,grov,hom,jasp,javi,oliv,rodg,rog,spenc,tyl,xavi",an:"bry,de,esteb,eth,ju,log,rom,ry,se,st,steph",el:"ab,darr,fid,jo,lion,marc,mich,migu,no,russ,samu","in":"benjam,bra,dar,darr,efra,joaqu,mart,quent",ie:"arch,edd,frank,fredd,lou,regg,robb",en:"all,dami,gl,k,ow,steph,stev",ey:"dew,harv,jo,mick,rick,rodn,sidn",al:",h,jam,miche,ne,rand",on:"bry,j,jonath,le,marl,vern",or:"hect,juni,salvad,tayl,trev,vict",dy:"an,bra,co,gra,ran,ru",ce:"bru,bry,hora,mauri,roy,walla",il:"cec,em,ne,ph,virg",ar:"ces,edg,lam,om,osc",es:"andr,charl,jam,mil,mos",ro:"alejand,alva,artu,ped,rami",am:"abrah,ad,grah,s,willi",ck:"chu,domini,ja,ma,ni",io:"anton,gregor,ignac,mar,serg",ah:"elij,jeremi,mic,no",nt:"brya,cli,gra,lamo",re:"and,pier,salvato,theodo",ed:",jar,n,t",ld:"arno,gera,haro,jera",as:"eli,luc,thom,tom",os:"am,carl,marc,sant",ew:"andr,dr,math,matth",ke:"bla,ja,lu,mi",tt:"ellio,emme,ma,sco",ty:"mar,mon,rus,scot",th:"hea,kei,kenne,se",ay:"cl,j,murr,r",le:"da,mer,orvil",te:"mon,pe,vicen",us:"jes,marc,ruf",od:"elwo,jarr,r",ob:"b,jac,r",to:"beni,ernes,ot",ne:"euge,ge,tyro",go:"domin,hu,santia",de:"clau,cly,wa","do":"alfre,reynal,wilfre",rk:"cla,ki,ma",se:"cha,jes,jo",ry:"hen,jeffe,jeff",ic:"cedr,domin,er",ad:"br,ch,conr"};e=d.expand_suffixes(e,f);var g={jos:"eph,h,hua",ro:"cky,dolfo,osevelt,scoe,ss",je:"ff,remy,rome,ss",to:"by,dd,m,ny",da:"rryl,ryl,ve,vid",jo:"e,esph,hn,rge",ma:"lcolm,rc,rco,x",al:"ex,fonso,i,onzo",gu:"illermo,stavo,y"};e=d.expand_prefixes(e,g),b.exports=e},{"../../fns":22}],16:[function(a,b,c){"use strict";b.exports=["minus","zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety","hundred","thousand","million","billion","trillion","quadrillion","quintillion","sextillion","septillion","octillion","nonillion","decillion"]},{}],17:[function(a,b,c){"use strict";var d=["google","microsoft","walmart","exxonmobil","glencore","samsung","chevron","at&t","verizon","costco","nestlé","7-eleven","adidas","nike","acer","mcdonalds","mcdonald's","comcast","compaq","craigslist","cisco","disney","coca cola","dupont","ebay","facebook","fedex","kmart","kodak","monsanto","myspace","netflix","sony","telus","twitter","usps","ubs","ups","walgreens","youtube","yahoo!","yamaha"],e=["center","centre","memorial","school","university","bank","college","house","foundation","department","institute","club","co","sons"];b.exports={suffixes:e,organizations:d}},{}],18:[function(a,b,c){"use strict";var d=a("../term/verb/conjugate/conjugate.js"),e=["be onto","fall behind","fall through","fool with","get across","get along","get at","give way","hear from","hear of","lash into","make do","run across","set upon","take aback","keep from"],f={
away:"back","in":"out",on:"off",over:"under",together:"apart",up:"down"},g={away:"blow,bounce,bring,call,come,cut,drop,fire,get,give,go,keep,pass,put,run,send,shoot,switch,take,tie,throw","in":"bang,barge,bash,beat,block,book,box,break,bring,burn,butt,carve,cash,check,come,cross,drop,fall,fence,fill,give,grow,hand,hang,head,jack,keep,leave,let,lock,log,move,opt,pack,peel,pull,put,rain,reach,ring,rub,send,set,settle,shut,sign,smash,snow,strike,take,try,turn,type,warm,wave,wean,wear,wheel",on:"add,call,carry,catch,count,feed,get,give,go,grind,head,hold,keep,lay,log,pass,pop,power,put,send,show,snap,switch,take,tell,try,turn,wait",over:"come,go,look,read,run,talk",together:"come,pull,put",up:"add,back,beat,bend,blow,boil,bottle,break,bring,buckle,bundle,call,carve,clean,cut,dress,fill,flag,fold,get,give,grind,grow,hang,hold,keep,let,load,lock,look,man,mark,melt,move,pack,pin,pipe,plump,pop,power,pull,put,rub,scale,scrape,send,set,settle,shake,show,sit,slow,smash,square,stand,strike,take,tear,tie,turn,use,wash,wind"};Object.keys(g).forEach(function(a){g[a].split(",").forEach(function(b){e.push(b+" "+a),e.push(b+" "+f[a])})});var h={about:"bring,fool,gad,go,root",after:"go,look,take",ahead:"get,go,press",along:"bring,move",apart:"fall,take",around:"ask,boss,bring,call,come,fool,get,horse,joke,lie,mess,play",away:"back,carry,file,frighten,hide,wash",back:"fall,fight,hit,hold,look,pay,stand,think",by:"drop,get,go,stop,swear,swing,tick,zip",down:"bog,calm,fall,hand,hunker,jot,knock,lie,narrow,note,pat,pour,run,tone,trickle,wear","for":"fend,file,gun,hanker,root,shoot",forth:"bring,come",forward:"come,look","in":"cave,chip,hone,jump,key,pencil,plug,rein,shade,sleep,stop,suck,tie,trade,tuck,usher,weigh,zero",into:"look,run",it:"go,have",off:"auction,be,beat,blast,block,brush,burn,buzz,cast,cool,drop,end,face,fall,fend,frighten,goof,jack,kick,knock,laugh,level,live,make,mouth,nod,pair,pay,peel,read,reel,ring,rip,round,sail,shave,shoot,sleep,slice,split,square,stave,stop,storm,strike,tear,tee,tick,tip,top,walk,work,write",on:"bank,bargain,egg,frown,hit,latch,pile,prattle,press,spring,spur,tack,urge,yammer",out:"act,ask,back,bail,bear,black,blank,bleed,blow,blurt,branch,buy,cancel,cut,eat,edge,farm,figure,find,fill,find,fish,fizzle,flake,flame,flare,flesh,flip,geek,get,help,hide,hold,iron,knock,lash,level,listen,lose,luck,make,max,miss,nerd,pan,pass,pick,pig,point,print,psych,rat,read,rent,root,rule,run,scout,see,sell,shout,single,sit,smoke,sort,spell,splash,stamp,start,storm,straighten,suss,time,tire,top,trip,trot,wash,watch,weird,whip,wimp,wipe,work,zone,zonk",over:"bend,bubble,do,fall,get,gloss,hold,keel,mull,pore,sleep,spill,think,tide,tip",round:"get,go",through:"go,run",to:"keep,see",up:"act,beef,board,bone,boot,brighten,build,buy,catch,cheer,cook,end,eye,face,fatten,feel,fess,finish,fire,firm,flame,flare,free,freeze,freshen,fry,fuel,gang,gear,goof,hack,ham,heat,hit,hole,hush,jazz,juice,lap,light,lighten,line,link,listen,live,loosen,make,mash,measure,mess,mix,mock,mop,muddle,open,own,pair,patch,pick,prop,psych,read,rough,rustle,save,shack,sign,size,slice,slip,snap,sober,spark,split,spruce,stack,start,stay,stir,stitch,straighten,string,suck,suit,sum,team,tee,think,tidy,tighten,toss,trade,trip,type,vacuum,wait,wake,warm,weigh,whip,wire,wise,word,write,zip"};Object.keys(h).forEach(function(a){h[a].split(",").forEach(function(b){e.push(b+" "+a)})}),e=e.reduce(function(a,b){return a[b]="VBP",a},{});var i={present:"VB",past:"VBD",future:"VBF",gerund:"VBG",infinitive:"VBP"},j={},k=void 0,l=void 0,m=void 0,n=void 0;Object.keys(e).forEach(function(a){k=a.split(" "),l=k[0],m=k[1],void 0===j[l]&&(j[l]=d(l)),Object.keys(j[l]).forEach(function(a){n=j[l][a]+" "+m,i[a]&&(e[n]=i[a])})}),b.exports=e},{"../term/verb/conjugate/conjugate.js":80}],19:[function(a,b,c){"use strict";var d=a("../fns"),e=["usa","u.s.a.","ussr","brazil","bangladesh","mexico","vietnam","egypt","germany","turkey","france","united kingdom","italy","kenya","iraq","morocco","peru","yemen","mozambique","sri lanka","burkina faso","niger","netherlands","chile","malawi","ecuador","côte d'ivoire","mali","zimbabwe","chad","belgium","cuba","greece","haiti","burundi","hungary","sweden","honduras","israel","laos","el salvador","libya","nicaragua","denmark","congo-brazzaville","kuwait","moldova","panama","jamaica","lesotho","guinea-bissau","timor-leste","djibouti","fiji","comoros","solomon islands","luxembourg","suriname","cape verde","malta","bahamas"],f={istan:"pak,uzbek,afghan,tajik,turkmen",ublic:"czech rep,dominican rep,central african rep",uinea:"g,papua new g,equatorial g",land:"thai,po,switzer,fin,republic of ire,new zea,swazi,ice",ania:"tanz,rom,maurit,lithu,alb",rica:"ame,united states of ame,south af,costa ",mbia:"colo,za,ga",eria:"nig,alg,lib",nia:"arme,macedo,slove,esto",sia:"indone,rus,malay,tuni",ina:"ch,argent,bosnia and herzegov",tan:"kazakhs,kyrgyzs,bhu",ana:"gh,botsw,guy",bia:"saudi ara,ser,nami",lia:"austra,soma,mongo",rea:"south ko,north ko,erit",dan:"su,south su,jor",ria:"sy,aust,bulga",ia:"ind,ethiop,cambod,boliv,slovak,georg,croat,latv",an:"jap,ir,taiw,azerbaij,om",da:"ugan,cana,rwan",us:"belar,mauriti,cypr",al:"nep,seneg,portug","in":"spa,ben,bahra",go:"dr con,to,trinidad-toba",la:"venezue,ango,guatema",es:"united stat,philippin,united arab emirat",on:"camero,leban,gab",ar:"myanm,madagasc,qat",ay:"paragu,norw,urugu",ne:"ukrai,sierra leo,palesti"};e=d.expand_suffixes(e,f);var g=["guangzhou","ahmedabad","phoenix","jakarta","curitiba","moscow","tokyo","nagoya","kobe","mexico","cebu","ho chi minh","hanoi","giza","frankfurt","stuttgart","i̇zmir","paris","toulouse","nice","rome","palermo","genoa","cape town","port elizabeth","bogotá","medellín","seville","zaragoza","kiev","odessa","rosario","la plata","warsaw","kraków","łódź","wrocław","poznań","calgary","ottawa","sydney","perth","homs","iași","cluj-napoca","almaty","the hague","utrecht","phnom penh","antwerp","ghent","brussels","tunis","athens","thessaloniki","prague","brno","miskolc","stockholm","västerås","tegucigalpa","graz","innsbruck","abu dhabi","haifa","ashdod","dushanbe","niš","aqaba","aalborg","helsinki","espoo","vantaa","turku","košice","ashgabat","oslo","trondheim","auckland","tbilisi","zagreb","split","kuwait","montevideo","klaipėda","doha","skopje","riga","luxembourg","reykjavik"],h={burg:"saint peters,yekaterin,ham,til,gothen,salz",ton:"hous,edmon,welling,hamil",ion:"hauts-bassins reg,nord reg,herakl",ana:"hav,tir,ljublj",ara:"guadalaj,ank,timișo",an:"tehr,mil,durb,bus,tain,abidj,amm,yerev",ia:"philadelph,brasíl,alexandr,pretor,valenc,sof,nicos",on:"ly,lond,yang,inche,daeje,lisb",en:"shenzh,eindhov,pils,copenhag,berg",ng:"beiji,chittago,pyongya,kaohsiu,taichu","in":"tianj,berl,tur,dubl,duned",es:"los angel,nant,napl,buenos air,f",la:"pueb,mani,barranquil,kampa,guatema",or:"salvad,san salvad,ulan bat,marib",us:"damasc,pirae,aarh,vilni",as:"carac,patr,burg,kaun",va:"craio,petah tik,gene,bratisla",ai:"shangh,mumb,chenn,chiang m",ne:"colog,melbour,brisba,lausan",er:"manchest,vancouv,tangi",ka:"dha,osa,banja lu",ro:"rio de janei,sappo,cai",am:"birmingh,amsterd,rotterd",ur:"kuala lump,winterth,kópavog",ch:"muni,züri,christchur",na:"barcelo,vien,var",ma:"yokoha,li,pana",ul:"istanb,seo,kab",to:"toron,qui,por",iv:"khark,lv,tel av",sk:"dnipropetrov,gdań,min"};g=d.expand_suffixes(g,h);var i={"new ":"delhi,york,taipei",san:"a'a,tiago, josé",ta:"ipei,mpere,llinn,rtu",ba:"ngalore,ngkok,ku,sel",li:"verpool,ège,nz,massol",ma:"rseille,ndalay,drid,lmö",be:"rn,lgrade,irut",ka:"rachi,raj,ndy",da:"egu,kar,ugavpils",ch:"icago,arleroi,ișinău",co:"lombo,nstanța,rk",bu:"rsa,charest,dapest"};g=d.expand_prefixes(g,i),b.exports={countries:e,cities:g}},{"../fns":22}],20:[function(a,b,c){"use strict";b.exports=["aircraft","bass","bison","fowl","halibut","moose","salmon","spacecraft","tuna","trout","advice","information","knowledge","trouble","enjoyment","fun","recreation","relaxation","meat","rice","bread","cake","coffee","ice","water","oil","grass","hair","fruit","wildlife","equipment","machinery","furniture","mail","luggage","jewelry","clothing","money","mathematics","economics","physics","civics","ethics","gymnastics","mumps","measles","news","tennis","baggage","currency","soap","toothpaste","food","sugar","butter","flour","research","leather","wool","wood","coal","weather","homework","cotton","silk","patience","impatience","vinegar","art","beef","blood","cash","chaos","cheese","chewing","conduct","confusion","education","electricity","entertainment","fiction","forgiveness","gold","gossip","ground","happiness","history","honey","hospitality","importance","justice","laughter","leisure","lightning","literature","luck","melancholy","milk","mist","music","noise","oxygen","paper","pay","peace","peanut","pepper","petrol","plastic","pork","power","pressure","rain","recognition","sadness","safety","salt","sand","scenery","shopping","silver","snow","softness","space","speed","steam","sunshine","tea","thunder","time","traffic","trousers","violence","warmth","wine","steel","soccer","hockey","golf","fish","gum","liquid","series","sheep","species","fahrenheit","celcius","kelvin","hertz"]},{}],21:[function(a,b,c){"use strict";var d=a("../fns"),e={prove:"im,,ap,disap",serve:",de,ob,re",ress:"exp,p,prog,st,add,d",lect:"ref,se,neg,col,e",sist:"in,con,per,re,as",tain:"ob,con,main,s,re",mble:"rese,gru,asse,stu",ture:"frac,lec,tor,fea",port:"re,sup,ex,im",ate:"rel,oper,indic,cre,h,activ,estim,particip,d,anticip,evalu",use:"ca,,over,ref,acc,am,pa,ho",ive:"l,rece,d,arr,str,surv,thr,rel",are:"prep,c,comp,sh,st,decl,d,sc",ine:"exam,imag,determ,comb,l,decl,underm,def",nce:"annou,da,experie,influe,bou,convi,enha",ain:"tr,rem,expl,dr,compl,g,str",ent:"prev,repres,r,res,rel,inv",age:"dam,mess,man,encour,eng,discour",rge:"su,cha,eme,u,me",ise:"ra,exerc,prom,surpr,pra",ect:"susp,dir,exp,def,rej",ter:"en,mat,cen,ca,al",end:"t,dep,,ext,att",est:"t,sugg,prot,requ,r",ock:"kn,l,sh,bl,unl",nge:"cha,excha,ra,challe,plu",ase:"incre,decre,purch,b,ce",ish:"establ,publ,w,fin,distingu",mit:"per,ad,sub,li",ure:"fig,ens,end,meas",der:"won,consi,mur,wan",ave:"s,sh,w,cr",ire:"requ,des,h,ret",tch:"scra,swi,ma,stre",ack:"att,l,p,cr",ion:"ment,quest,funct,envis",ump:"j,l,p,d",ide:"dec,prov,gu,s",ush:"br,cr,p,r",eat:"def,h,tr,ch",ash:"sm,spl,w,fl",rry:"ca,ma,hu,wo",ear:"app,f,b,disapp",er:"answ,rememb,off,suff,cov,discov,diff,gath,deliv,both,empow,with",le:"fi,sett,hand,sca,whist,enab,smi,ming,ru,sprink,pi",st:"exi,foreca,ho,po,twi,tru,li,adju,boa,contra,boo",it:"vis,ed,depos,sp,awa,inhib,cred,benef,prohib,inhab",nt:"wa,hu,pri,poi,cou,accou,confro,warra,pai",ch:"laun,rea,approa,sear,tou,ar,enri,atta",ss:"discu,gue,ki,pa,proce,cro,glo,dismi",ll:"fi,pu,ki,ca,ro,sme,reca,insta",rn:"tu,lea,conce,retu,bu,ea,wa,gove",ce:"redu,produ,divor,fa,noti,pla,for,repla",te:"contribu,uni,tas,vo,no,constitu,ci",rt:"sta,comfo,exe,depa,asse,reso,conve",ck:"su,pi,che,ki,tri,wre",ct:"intera,restri,predi,attra,depi,condu",ke:"sta,li,bra,overta,smo,disli",se:"collap,suppo,clo,rever,po,sen",nd:"mi,surrou,dema,remi,expa,comma",ve:"achie,invol,remo,lo,belie,mo",rm:"fo,perfo,confi,confo,ha",or:"lab,mirr,fav,monit,hon",ue:"arg,contin,val,iss,purs",ow:"all,foll,sn,fl,borr",ay:"pl,st,betr,displ,portr",ze:"recogni,reali,snee,ga,emphasi",ip:"cl,d,gr,sl,sk",re:"igno,sto,interfe,sco",ng:"spri,ba,belo,cli",ew:"scr,vi,revi,ch",gh:"cou,lau,outwei,wei",ly:"app,supp,re,multip",ge:"jud,acknowled,dod,alle",en:"list,happ,threat,strength",ee:"fors,agr,disagr,guarant",et:"budg,regr,mark,targ",rd:"rega,gua,rewa,affo",am:"dre,j,sl,ro",ry:"va,t,c,bu"},f=["hope","thank","work","stop","control","join","enjoy","fail","aid","ask","talk","add","walk","describe","study","seem","occur","claim","fix","help","design","include","need","keep","assume","accept","do","look","die","seek","attempt","bomb","cook","copy","claw","doubt","drift","envy","fold","flood","focus","lift","link","load","loan","melt","overlap","rub","repair","sail","sleep","trade","trap","travel","tune","undergo","undo","uplift","yawn","plan","reveal","owe","sneak","drop","name","head","spoil","echo","deny","yield","reason","defy","applaud","risk","step","deem","embody","adopt","convey","pop","grab","revel","stem","mark","drag","pour","reckon","assign","rank","destroy","float","appeal","grasp","shout","overcome","relax","excel","plug","proclaim","ruin","abandon","overwhelm","wipe","added","took","goes","avoid"];b.exports=d.expand_suffixes(f,e)},{"../fns":22}],22:[function(a,b,c){"use strict";var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a};c.pluck=function(a,b){return a=a||[],a.map(function(a){return a[b]})},c.toObj=function(a){return a.reduce(function(a,b){return a[b]=!0,a},{})},c.flatten=function(a){var b=[];return a.forEach(function(a){b=b.concat(a)}),b},c.sameArr=function(a,b){if(("undefined"==typeof a?"undefined":d(a))!==("undefined"==typeof b?"undefined":d(b))||a.length!==b.length)return null;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0},c.compact=function(a){return a.filter(function(a){return void 0===a||null===a?!1:!0})},c.extend=function(a,b){return Object.keys(b).forEach(function(c){a[c]=b[c]}),a},c.last=function(a){return a.length<=0?null:a[a.length-1]},c.endsWith=function(a,b){return-1!==a.indexOf(b,a.length-b.length)},c.startsWith=function(a,b){return a&&a.length&&a.substr(0,1)===b?!0:!1},c.titlecase=function(a){return a?(a=a.toLowerCase(),a.charAt(0).toUpperCase()+a.slice(1)):""},c.isFunction=function(a){return"[object Function]"===Object.prototype.toString.call(a)},c.expand_suffixes=function(a,b){for(var c=Object.keys(b),d=c.length,e=0;d>e;e++)for(var f=b[c[e]].split(","),g=0;g<f.length;g++)a.push(f[g]+c[e]);return a},c.expand_prefixes=function(a,b){for(var c=Object.keys(b),d=c.length,e=0;d>e;e++)for(var f=b[c[e]].split(","),g=0;g<f.length;g++)a.push(c[e]+f[g]);return a}},{}],23:[function(a,b,c){"use strict";for(var d=a("./fns.js"),e=a("./term/verb/conjugate/conjugate.js"),f=a("./term/adjective/to_comparative.js"),g=a("./term/adjective/to_superlative.js"),h=a("./sentence/pos/parts_of_speech.js").tag_mapping,i={},j=function(a){for(var b=Object.keys(a),c=b.length,d=0;c>d;d++)i[b[d]]=a[b[d]]},k=function(a,b){for(var c=a.length,d=0;c>d;d++)i[a[d]]=b},l={infinitive:"Infinitive",present:"PresentTense",past:"PastTense",gerund:"Gerund",actor:"Actor",future:"FutureTense",pluperfect:"PluperfectTense",perfect:"PerfectTense",PerfectTense:"PerfectTense",PluperfectTense:"PluperfectTense",FutureTense:"FutureTense",PastTense:"PastTense",PresentTense:"PresentTense"},m=a("./data/irregular_verbs.js"),n=a("./data/verbs.js").concat(Object.keys(m)),o=function(a){var b=e(n[a]);Object.keys(b).forEach(function(a){a&&b[a]&&l[a]&&(i[b[a]]=l[a])})},p=0;p<n.length;p++)o(p);var q=a("./data/organizations.js");k(q.organizations,"Noun"),k(q.suffixes,"Noun");var r=a("./data/places.js");k(r.countries,"Place"),k(r.cities,"Place"),a("./data/adjectives.js").forEach(function(a){i[a]="Adjective",i[f(a)]="Comparative",i[g(a)]="Superlative"}),j(a("./data/convertables.js")),k(a("./data/abbreviations.js").abbreviations,"Abbreviation"),k(a("./data/demonyms.js"),"Adjective"),k(a("./data/honourifics.js"),"Honourific"),k(a("./data/uncountables.js"),"Noun");var s=a("./data/dates.js");k(s.days,"Date"),k(s.months,"Date"),k(s.durations,"Date"),k(s.relative,"Date"),k(a("./data/numbers.js"),"Value"),k(Object.keys(a("./data/firstnames.js")),"Person");var t=a("./data/irregular_nouns.js");k(d.pluck(t,0),"Noun"),k(d.pluck(t,1),"Plural"),j(a("./data/misc.js")),j(a("./data/multiples.js")),j(a("./data/phrasal_verbs.js")),Object.keys(a("./data/holidays.js")).forEach(function(a){i[a]="Date"}),delete i[!1],delete i[!0],delete i[void 0],delete i[null],delete i[""],Object.keys(i).forEach(function(a){!h[i[a]],i[a]=h[i[a]]||i[a]}),b.exports=i},{"./data/abbreviations.js":2,"./data/adjectives.js":3,"./data/convertables.js":4,"./data/dates.js":5,"./data/demonyms.js":6,"./data/firstnames.js":7,"./data/holidays.js":8,"./data/honourifics.js":9,"./data/irregular_nouns.js":10,"./data/irregular_verbs.js":11,"./data/misc.js":12,"./data/multiples.js":13,"./data/numbers.js":16,"./data/organizations.js":17,"./data/phrasal_verbs.js":18,"./data/places.js":19,"./data/uncountables.js":20,"./data/verbs.js":21,"./fns.js":22,"./sentence/pos/parts_of_speech.js":39,"./term/adjective/to_comparative.js":49,"./term/adjective/to_superlative.js":51,"./term/verb/conjugate/conjugate.js":80}],24:[function(a,b,c){"use strict";var d=a("./result"),e=a("./syntax_parse"),f=a("./match_term"),g=function(a,b,c){for(var d=[],e=0,g=0;g<b.length;g++){var h=a[e];if(!h)return null;if(""!==h.normal){if(f(h,b[g],c)){if(b[g].signals.trailing&&a[e+1])return null;if(b[g].signals.leading&&0!==e)return null;d.push(a[e]),e+=1}else if(b[g].signals.any_one)d.push(a[e]),e+=1;else if(!b[g].signals.optional)return null}else e+=1}return d},h=function(a,b,c){var f=[],h=e(b||"");if(h[0].signals.leading){var i=g(a,h,c)||[];return[new d(i||[])]}for(var j=a.length,k=0;j>k;k++){var l=a.slice(k,a.length),i=g(l,h,c);i&&f.push(new d(i))}return 0===f.length&&f.push(new d([])),f},i=function(a,b,c,d){var e=h(a,b,d);e.forEach(function(a){a.replace(c,d)})};b.exports={findAll:h,replaceAll:i}},{"./match_term":25,"./result":26,"./syntax_parse":27}],25:[function(a,b,c){"use strict";var d=a("../fns.js"),e=function(a,b){var c=b.signals;if(c.one_of){for(var e=b.term.split("|"),f=0;f<e.length;f++)if(e[f]===a.normal||e[f]===a.text)return!0;return!1}if(c.pos){var g=d.titlecase(b.term);return a.pos[g]?!0:!1}return c.alias?b.term===a.root()?!0:!1:b.term===a.normal||b.term===a.text?!0:!1};b.exports=e},{"../fns.js":22}],26:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("./match.js"),g=function(){function a(b){d(this,a),this.terms=b,this.found=this.terms.length>0}return e(a,[{key:"match",value:function(a,b){return f(this.terms,a,b)}},{key:"replace",value:function(a){for(var b=a.split(" "),c=0;c<this.terms.length;c++)if("$"!==b[c])if(b[c].match(/\$1/)){var d=b[1].replace(/\$1/,this.terms[c].text);this.terms[c].changeTo(d)}else this.terms[c].changeTo(b[c]||"")}},{key:"text",value:function(){return this.terms.reduce(function(a,b){return a.push(b.text),a},[]).join(" ")}},{key:"normal",value:function(){return this.terms.reduce(function(a,b){return a.push(b.normal),a},[]).join(" ")}}]),a}();b.exports=g},{"./match.js":24}],27:[function(a,b,c){"use strict";var d=a("../fns.js"),e=function(a,b){a=a||"",a=a.trim();var c={};return d.startsWith(a,"^")&&(a=a.substr(1,a.length),c.leading=!0),d.endsWith(a,"$")&&(a=a.replace(/\$$/,""),c.trailing=!0),d.endsWith(a,"?")&&(a=a.replace(/\?$/,""),c.optional=!0),d.startsWith(a,"[")&&d.endsWith(a,"]")&&(a=a.replace(/\]$/,""),a=a.replace(/^\[/,""),c.pos=!0),d.startsWith(a,"(")&&d.endsWith(a,")")&&(a=a.replace(/\)$/,""),a=a.replace(/^\(/,""),c.one_of=!0),d.startsWith(a,"~")&&d.endsWith(a,"~")&&(a=a.replace(/^\~/,""),a=a.replace(/\~$/,""),c.alias=!0),"."===a&&(c.any_one=!0),"*"===a&&(c.any_many=!0),{term:a,signals:c,i:b}},f=function(a){return a=a||"",a=a.replace(/ +/," "),a=a.trim(),a.split(" ").map(e)};b.exports=f},{"../fns.js":22}],28:[function(a,b,c){"use strict";var d={will:"ll",would:"d",have:"ve",are:"re",not:"t",is:"s"},e=function(a){for(var b=1;b<a.length;b++)d[a[b].normal]&&(a[b-1].expansion=a[b-1].text,a[b].expansion=a[b].text,"not"===a[b].normal&&(a[b-1].text+="n"),a[b-1].text+="'"+d[a[b].normal],a[b-1].rebuild(),a[b].text="",a[b].rebuild());return a};b.exports=e},{}],29:[function(a,b,c){"use strict";var d=function(a){for(var b=0;b<a.length;b++)a[b].expansion&&(a[b].text=a[b].expansion,a[b].rebuild());return a};b.exports=d},{}],30:[function(a,b,c){"use strict";var d=a("../pos/parts_of_speech"),e={ll:"will",d:"would",ve:"have",re:"are",m:"am"},f=function(a,b,c){a[b].expansion=a[b].text.replace(/'.*/,"");var e=new d.Verb("");return e.expansion=c,a.splice(b+1,0,e),a},g=function(a,b){var c={"don't":!0,"mustn't":!0};if(0===b&&!c[a[b].normal])return a;a[b].expansion=a[b].text.replace(/n'.*/,"");var e=new d.Term("");return e.expansion="not",a.splice(b+1,0,e),a},h=function(a,b){a[b].expansion=a[b].text.replace(/'s$/,"");var c=new d.Verb("");return c.expansion="is",a.splice(b+1,0,c),a},i=function(a){for(var b=0;b<a.length;b++)if(a[b].has_abbreviation()){var c=a[b].normal.split(/'/),d=c[0],i=c[1];if(e[i]){a=f(a,b,e[i]);continue}if("t"===i&&d.match(/n$/)){a=g(a,b);continue}if("s"===i){a=h(a,b);continue}}return a};b.exports=i},{"../pos/parts_of_speech":39}],31:[function(a,b,c){"use strict";var d=a("../fns.js"),e=a("./pos/parts_of_speech.js"),f=function(a){if(!a)return"";for(var b={everyone:"no one",everybody:"nobody",someone:"no one",somebody:"nobody",always:"never",is:"isn't",are:"aren't",was:"wasn't",will:"won't","didn't":"did","wouldn't":"would","couldn't":"could","shouldn't":"should","can't":"can","won't":"will","mustn't":"must","shan't":"shall",shant:"shall",did:"didn't",would:"wouldn't",could:"couldn't",should:"shouldn't",can:"can't",must:"mustn't"},c=0;c<a.terms.length;c++){var f=a.terms[c];if("ambiguous_contraction"===f.reason&&(f.text=f.normal),b[f.normal]&&(!a.terms[c+1]||"not"!==a.terms[c+1].normal))return f.text=b[f.normal],f.normal=b[f.normal],f.capitalised&&(f.text=d.titlecase(f.text)),a;if(f instanceof e.Verb)return f.isNegative()?(a.terms[c+1]&&"not"===a.terms[c+1].normal&&a.terms.splice(c+1,1),a):f.normal.match(/^will /i)?(f.text=f.text.replace(/^will /i,"won't "),f.normal=f.text,f.capitalised&&(f.text=d.titlecase(f.text)),a):f.pos.infinitive&&"future"!==f.conjugation()?(f.text="don't "+(f.conjugate().infinitive||f.text),f.normal=f.text.toLowerCase(),a):"gerund"===f.conjugation()?(f.text="not "+f.text,f.normal=f.text.toLowerCase(),a):"past"===f.tense?(f.text="didn't "+(f.analysis.conjugate().infinitive||f.text),f.normal=f.text.toLowerCase(),a):f.conjugations.present?(f.text="doesn't "+(f.conjugate().infinitive||f.text),f.normal=f.text.toLowerCase(),a):f.conjugations.future?("will"===f.normal?(f.normal="won't",f.text="won't"):(f.text=f.text.replace(/^will /i,"won't "),f.normal=f.normal.replace(/^will /i,"won't ")),f.capitalised&&(f.text=d.titlecase(f.text)),a):a}return a};b.exports=f},{"../fns.js":22,"./pos/parts_of_speech.js":39}],32:[function(a,b,c){"use strict";var d=function(a){for(var b=a.terms,c=0;c<b.length-2;c++)if(b[c].pos.Copula&&b[c+1].pos.Verb&&"by"===b[c+2].normal){if(b[c+1].pos.Gerund)continue;return!0}return!1};b.exports=d},{}],33:[function(a,b,c){"use strict";var d=a("./parts_of_speech"),e=function(a,b,c){var e=d.classMapping[b]||d.Term,f=a.expansion;return a=new e(a.text,b),a.reason=c,a.expansion=f,a};b.exports=e},{"./parts_of_speech":39}],34:[function(a,b,c){"use strict";var d=a("./assign"),e=function(a){a[0].is_acronym()&&(a[0]=d(a[0],"Noun","acronym"));for(var b=1;b<a.length;b++)(a[b].is_capital()||a[b].is_acronym())&&(a[b]=d(a[b],"Noun","capital_signal"));return a};b.exports=e},{"./assign":33}],35:[function(a,b,c){"use strict";var d=a("./parts_of_speech"),e=function(a,b,c){if(!a||!b||!c)return!1;for(var d=[{condition:a.pos.Noun&&"&"===b.text&&c.pos.Noun,result:"Person"},{condition:a.pos.Noun&&"N"===b.text&&c.pos.Noun,result:"Person"},{condition:a.pos.Date&&"the"===b.normal&&c.pos.Value,result:"Date"},{condition:a.is_capital()&&"of"===b.normal&&c.is_capital(),result:"Noun"},{condition:a.text.match(/^["']/)&&!b.text.match(/["']/)&&c.text.match(/["']$/),result:"Noun"},{condition:"will"===a.normal&&"have"===b.normal&&b.pos.Verb,result:"FutureTense"}],e=0;e<d.length;e++)if(d[e].condition)return d[e].result;return!1},f=function(a,b){if(!a||!b)return!1;for(var c=[{condition:a.pos.Person&&b.pos.Honourific||a.pos.Honourific&&b.pos.Person,result:"Person"},{condition:a.pos.Honourific&&b.is_capital(),result:"Person"},{condition:a.pos.Person&&b.is_capital(),result:"Person"},{condition:a.pos.Date&&b.pos.Value,result:"Date"},{condition:a.pos.Value&&b.pos.Noun,result:"Value"},{condition:a.is_capital()&&b.pos.Organization||b.is_capital()&&a.pos.Organization,result:"Organization"},{condition:a.text.match(/^["']/)&&b.text.match(/["']$/),result:"Noun"},{condition:"will"===a.normal&&b.pos.Verb,result:"PerfectTense"},{condition:a.normal.match(/^will ha(ve|d)$/)&&b.pos.Verb,result:"PluperfectTense"}],d=0;d<c.length;d++)if(c[d].condition)return c[d].result;return!1},g=function(a){for(var b=1;b<a.length;b++){var c=a[b-1],g=a[b],h=a[b+1],i=f(c,g);if(i){var j=d.classMapping[i]||d.Term;a[b]=new j(c.text+" "+g.text,i),a[b].reason="lumpedtwo("+a[b].reason+")",a[b-1]=null}else if(h&&(i=e(c,g,h))){var j=d.classMapping[i]||d.Term;a[b-1]=new j([c.text,g.text,h.text].join(" "),i),a[b-1].reason="lumpedThree("+a[b].reason+")",a[b]=null,a[b+1]=null}else;}return a=a.filter(function(a){return null!==a})};b.exports=g},{"./parts_of_speech":39}],36:[function(a,b,c){"use strict";b.exports=[{before:["Determiner","?"],after:["Determiner","Noun"]},{before:["Determiner","Adjective","Verb"],after:["Noun","Noun","Noun"]},{before:["Determiner","Adverb","Adjective","?"],after:["Determiner","Adverb","Adjective","Noun"]},{before:["Unknown","Determiner","Noun"],after:["Verb","Determiner","Noun"]},{before:["Posessive","Unknown"],after:["Posessive","Noun"]},{before:["Posessive","Verb"],after:["Posessive","Noun"]},{before:["Unknown","Posessive","Noun"],after:["Verb","Posessive","Noun"]},{before:["Copula","Unknown"],after:["Copula","Adjective"]},{before:["Copula","Adverb","?"],after:["Copula","Adverb","Adjective"]},{before:["Unknown","Preposition"],after:["Verb","Preposition"]},{before:["Adverb","Conjunction","Adverb"],after:["Adverb","Adverb","Adverb"]},{before:["Verb","Conjunction","Verb"],after:["Verb","Verb","Verb"]},{before:["Noun","Conjunction","Noun"],after:["Noun","Noun","Noun"]},{before:["Adjective","Conjunction","Adjective"],after:["Adjective","Adjective","Adjective"]},{before:["Unknown","Conjunction","Verb"],after:["Verb","Conjunction","Verb"]},{before:["Verb","Conjunction","Unknown"],after:["Verb","Conjunction","Verb"]},{before:["Noun","Adverb","Noun"],after:["Noun","Adverb","Verb"]},{before:["Unknown","Pronoun"],after:["Verb","Pronoun"]},{before:["Modal","Unknown"],after:["Modal","Verb"]},{before:["Modal","Adverb","?"],after:["Modal","Adverb","Verb"]},{before:["Modal","Value"],after:["Modal","Verb"]},{before:["Adverb","Value"],after:["Adverb","Verb"]}]},{}],37:[function(a,b,c){"use strict";var d=a("./assign"),e=function(a){for(var b={ok:!0,so:!0,please:!0,alright:!0,well:!0,now:!0},c=0;c<a.length&&!(c>3)&&b[a[c].normal];c++)a[c]=d(a[c],"Expression","interjection_fixes");return a};b.exports=e},{"./assign":33}],38:[function(a,b,c){"use strict";var d=a("../../lexicon.js"),e=a("./assign"),f=function(a,b){var c=b.lexicon||d;return a.map(function(a){if(void 0!==c[a.normal])return e(a,c[a.normal],"lexicon_pass");if(a.normal.match(/^(over|under|out|-|un|re|en).{4}/)){var b=a.normal.replace(/^(over|under|out|.*?-|un|re|en)/,"");return e(a,c[b],"lexicon_prefix")}if(a.has_abbreviation()){var b=a.normal.replace(/'.*/,"");return e(a,c[b],"lexicon_prefix")}if(a.normal.match(/-/)){var d=a.normal.split("-");if(c[d[0]])return e(a,c[d[0]],"lexicon_dash");if(c[d[1]])return e(a,c[d[1]],"lexicon_dash")}return a})};b.exports=f},{"../../lexicon.js":23,"./assign":33}],39:[function(a,b,c){"use strict";var d=a("../../term/term.js"),e=a("../../term/verb/verb.js"),f=a("../../term/adverb/adverb.js"),g=a("../../term/adjective/adjective.js"),h=a("../../term/noun/noun.js"),i=a("../../term/noun/person/person.js"),j=a("../../term/noun/place/place.js"),k=a("../../term/noun/organization/organization.js"),l=a("../../term/noun/value/value.js"),m=a("../../term/noun/date/date.js"),n={NNA:"Acronym",NNS:"Plural",NN:"Noun",NNO:"Posessive",CD:"Value",PP:"Posessive",PRP:"Pronoun",UH:"Expression",FW:"Expression",DT:"Determiner",CC:"Conjunction",IN:"Preposition",VB:"Verb",VBD:"PastTense",VBF:"FutureTense",VBP:"Infinitive",VBZ:"PresentTense",VBG:"Gerund",VBN:"Verb",CP:"Copula",MD:"Modal",JJ:"Adjective",JJR:"Comparative",JJS:"Superlative",RB:"Adverb"},o={Noun:h,Honourific:h,Acronym:h,Plural:h,Pronoun:h,Actor:h,Abbreviation:h,Verb:e,PresentTense:e,FutureTense:e,PastTense:e,Infinitive:e,PerfectTense:e,PluperfectTense:e,Gerund:e,Copula:e,Modal:e,Comparative:g,Superlative:g,Adjective:g,Determiner:d,Preposition:d,Expression:d,Conjunction:d,Posessive:d,Adverb:f,Value:l,Place:j,Person:i,Organization:k,Date:m};b.exports={tag_mapping:n,classMapping:o,Term:d,Date:m,Value:l,Verb:e,Person:i,Place:j,Organization:k,Adjective:g,Adverb:f,Noun:h}},{"../../term/adjective/adjective.js":47,"../../term/adverb/adverb.js":52,"../../term/noun/date/date.js":56,"../../term/noun/noun.js":62,"../../term/noun/organization/organization.js":64,"../../term/noun/person/person.js":68,"../../term/noun/place/place.js":70,"../../term/noun/value/value.js":78,"../../term/term.js":79,"../../term/verb/verb.js":87}],40:[function(a,b,c){"use strict";var d=["in","out","on","off","behind","way","with","of","do","away","across","ahead","back","over","under","together","apart","up","upon","aback","down","about","before","after","around","to","forth","round","through","along","onto"];d=d.reduce(function(a,b){return a[b]=!0,a},{});var e=function(a){for(var b=0;b<a.length-1;b++)if(a[b]&&a[b].pos.Verb&&d[a[b+1].normal]){if(a[b].pos.Copula)continue;a[b].text=a[b].text+" "+a[b+1].text,a[b].reason="phrasal("+a[b].reason+")",a[b+1]=null,a[b].rebuild()}return a=a.filter(function(a){return null!==a})};b.exports=e},{}],41:[function(a,b,c){"use strict";var d=a("./word_rules"),e=a("./grammar_rules"),f=a("./fancy_lumping"),g=a("./phrasal_verbs"),h=a("./interjection_fixes"),i=a("./lexicon_pass"),j=a("./capital_signals"),k=a("./parts_of_speech"),l=a("./assign"),m=function(a){for(var b=0;b<a.length;b++)if("?"===a[b].tag)for(var c=0;c<d.length;c++)if(a[b].normal.length>4&&a[b].normal.match(d[c].reg)){a[b]=l(a[b],d[c].pos,"rules_pass_"+c);break}return a},n=function(a,b){if(!a||!b)return!1;if(a.has_comma())return!1;var c={Expression:!0};return c[a.tag]||c[b.tag]?!1:a.expansion||b.expansion?!1:a.tag===b.tag?!0:!1},o=function(a){for(var b=[],c=null,d=0;d<a.length;d++){var e=a[d];n(c,e)?(b[b.length-1].text+=" "+e.text,b[b.length-1].normalize()):b.push(e),c=e}return b},p=function(a,b){if(a.length!==b.length)return!1;for(var c=0;c<b.length;c++)if(!a[c].pos[b[c]])return!1;return!0},q=function(a){for(var b=0;b<a.terms.length;b++)for(var c=0;c<e.length;c++){var d=e[c],f=a.terms.slice(b,b+d.before.length);if(p(f,d.before))for(var g=0;g<d.before.length;g++)a.terms[b+g]=l(a.terms[b+g],d.after[g],"grammar_rule "+g)}return a.terms},r=function(a){for(var b=0;b<a.length;b++)"?"===a[b].tag&&a[b].normal.match(/[a-z]/)&&(a[b]=l(a[b],"Noun","fallback"));return a},s=function(a){for(var b=0;b<a.length;b++){var c=a[b];c instanceof k.Noun&&(c.is_person()?a[b]=l(c,"Person","is_person"):c.is_place()?a[b]=l(c,"Place","is_place"):c.is_value()?a[b]=l(c,"Value","is_value"):c.is_date()?a[b]=l(c,"Date","is_date"):c.is_organization()&&(a[b]=l(c,"Organization","is_organization")))}return a},t=function(a,b){a.terms=j(a.terms),a.terms=i(a.terms,b),a.terms=m(a.terms),a.terms=h(a.terms);for(var c=0;1>c;c++)a.terms=q(a),a.terms=o(a.terms),a.terms=r(a.terms),a.terms=g(a.terms),a.terms=s(a.terms),a.terms=f(a.terms);return a.terms};b.exports=t},{"./assign":33,"./capital_signals":34,"./fancy_lumping":35,"./grammar_rules":36,"./interjection_fixes":37,"./lexicon_pass":38,"./parts_of_speech":39,"./phrasal_verbs":40,"./word_rules":42}],42:[function(a,b,c){"use strict";var d=a("./parts_of_speech.js").tag_mapping;b.exports=[[".[cts]hy$","JJ"],[".[st]ty$","JJ"],[".[lnr]ize$","VB"],[".[gk]y$","JJ"],[".fies$","VB"],[".some$","JJ"],[".[nrtumcd]al$","JJ"],[".que$","JJ"],[".[tnl]ary$","JJ"],[".[di]est$","JJS"],["^(un|de|re)\\-[a-z]..","VB"],[".lar$","JJ"],["[bszmp]{2}y","JJ"],[".zes$","VB"],[".[icldtgrv]ent$","JJ"],[".[rln]ates$","VBZ"],[".[oe]ry$","JJ"],["[rdntkdhs]ly$","RB"],[".[lsrnpb]ian$","JJ"],[".[^aeiou]ial$","JJ"],[".[^aeiou]eal$","JJ"],[".[vrl]id$","JJ"],[".[ilk]er$","JJR"],[".ike$","JJ"],[".ends$","VB"],[".wards$","RB"],[".rmy$","JJ"],[".rol$","NN"],[".tors$","NN"],[".azy$","JJ"],[".where$","RB"],[".ify$","VB"],[".bound$","JJ"],[".ens$","VB"],[".oid$","JJ"],[".vice$","NN"],[".rough$","JJ"],[".mum$","JJ"],[".teen(th)?$","CD"],[".oses$","VB"],[".ishes$","VB"],[".ects$","VB"],[".tieth$","CD"],[".ices$","NN"],[".bles$","VB"],[".pose$","VB"],[".ions$","NN"],[".ean$","JJ"],[".[ia]sed$","JJ"],[".tized$","VB"],[".llen$","JJ"],[".fore$","RB"],[".ances$","NN"],[".gate$","VB"],[".nes$","VB"],[".less$","RB"],[".ried$","JJ"],[".gone$","JJ"],[".made$","JJ"],[".[pdltrkvyns]ing$","JJ"],[".tions$","NN"],[".tures$","NN"],[".ous$","JJ"],[".ports$","NN"],[". so$","RB"],[".ints$","NN"],[".[gt]led$","JJ"],["[aeiou].*ist$","JJ"],[".lked$","VB"],[".fully$","RB"],[".*ould$","MD"],["^-?[0-9]+(.[0-9]+)?$","CD"],["[a-z]*\\-[a-z]*\\-","JJ"],["[a-z]'s$","NNO"],[".'n$","VB"],[".'re$","CP"],[".'ll$","MD"],[".'t$","VB"],[".tches$","VB"],["^https?:?//[a-z0-9]","NN"],["^www.[a-z0-9]","NN"],[".ize$","VB"],[".[^aeiou]ise$","VB"],[".[aeiou]te$","VB"],[".ea$","NN"],["[aeiou][pns]er$","NN"],[".ia$","NN"],[".sis$","NN"],[".[aeiou]na$","NN"],[".[^aeiou]ity$","NN"],[".[^aeiou]ium$","NN"],[".[^aeiou][ei]al$","JJ"],[".ffy$","JJ"],[".[^aeiou]ic$","JJ"],[".(gg|bb|zz)ly$","JJ"],[".[aeiou]my$","JJ"],[".[aeiou]ble$","JJ"],[".[^aeiou]ful$","JJ"],[".[^aeiou]ish$","JJ"],[".[^aeiou]ica$","NN"],["[aeiou][^aeiou]is$","NN"],["[^aeiou]ard$","NN"],["[^aeiou]ism$","NN"],[".[^aeiou]ity$","NN"],[".[^aeiou]ium$","NN"],[".[lstrn]us$","NN"],["..ic$","JJ"],["[aeiou][^aeiou]id$","JJ"],[".[^aeiou]ish$","JJ"],[".[^aeiou]ive$","JJ"],["[ea]{2}zy$","JJ"]].map(function(a){
return{reg:new RegExp(a[0],"i"),pos:d[a[1]]}})},{"./parts_of_speech.js":39}],43:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=a("../sentence.js"),h=function(a){function b(a,c){return d(this,b),e(this,Object.getPrototypeOf(b).call(this,a,c))}return f(b,a),b}(g);h.fn=h.prototype,b.exports=h},{"../sentence.js":44}],44:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("../term/term"),g=a("./pos/tagger"),h=a("./passive_voice"),i=a("./negate"),j={interpret:a("./contractions/interpret"),contract:a("./contractions/contract"),expand:a("./contractions/expand")},k=a("./tense"),l=a("../match/match"),m=function(){function a(b,c){d(this,a),this.str=b||"",c=c||{};var e=this,h=b.split(" ");this.terms=h.map(function(a){return new f(a)}),this.terms=g(this,c),this.terms=j.interpret(this.terms),this.contractions={expand:function(){return e.terms=j.expand(e.terms),e},contract:function(){return e.terms=j.contract(e.terms),e}}}return e(a,[{key:"addBefore",value:function(a,b){var c=new f(b);this.terms.splice(a,0,c)}},{key:"addAfter",value:function(a,b){var c=new f(b);this.terms.splice(a+1,0,c)}},{key:"match",value:function(a,b){return l.findAll(this.terms,a,b)}},{key:"replace",value:function(a,b,c){return l.replaceAll(this.terms,a,b,c),this}},{key:"terminator",value:function(){var a=[".","?","!"],b=this.str.slice(-1)||"";return-1!==a.indexOf(b)?b:"."}},{key:"tag",value:function(){return this.terms=g(this),this.terms}},{key:"sentence_type",value:function(){var a=this.terminator(),b={"?":"interrogative","!":"exclamative",".":"declarative"};return b[a]||"declarative"}},{key:"is_passive",value:function(){return h(this)}},{key:"negate",value:function(){return i(this),this}},{key:"text",value:function(){return this.terms.reduce(function(a,b){return b.text&&(""===a?a=b.text:a+=" "+b.text),a},"")}},{key:"normalized",value:function(){return this.terms.reduce(function(a,b){return b.text&&(a+=" "+b.normal),a},"")}},{key:"root",value:function(){return this.terms.reduce(function(a,b){return a+=" "+b.root},"").trim()}},{key:"tags",value:function(){return this.terms.map(function(a){return a.tag||"?"})}},{key:"people",value:function(){return this.terms.filter(function(a){return a.pos.Person})}},{key:"places",value:function(){return this.terms.filter(function(a){return a.pos.Place})}},{key:"dates",value:function(){return this.terms.filter(function(a){return a.pos.Date})}},{key:"organizations",value:function(){return this.terms.filter(function(a){return a.pos.Organization})}},{key:"values",value:function(){return this.terms.filter(function(a){return a.pos.Value})}},{key:"to_past",value:function(){return k(this,"past"),this}},{key:"to_present",value:function(){return k(this,"present"),this}},{key:"to_future",value:function(){return k(this,"future"),this}}]),a}();m.fn=m.prototype,b.exports=m},{"../match/match":24,"../term/term":79,"./contractions/contract":28,"./contractions/expand":29,"./contractions/interpret":30,"./negate":31,"./passive_voice":32,"./pos/tagger":41,"./tense":46}],45:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=a("../sentence.js"),h=function(a){function b(a,c){return d(this,b),e(this,Object.getPrototypeOf(b).call(this,a,c))}return f(b,a),b}(g);h.fn=h.prototype,b.exports=h},{"../sentence.js":44}],46:[function(a,b,c){"use strict";var d=a("./pos/parts_of_speech.js"),e=function(a,b){return"present"===b?a.to_present():"past"===b?a.to_past():"future"===b&&a.to_future(),a},f=function(a,b){return a.terms.forEach(function(a){a instanceof d.Verb&&e(a,b)}),a};b.exports=f},{"./pos/parts_of_speech.js":39}],47:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../term.js"),i=a("./to_comparative"),j=a("./to_superlative"),k=a("./to_adverb"),l=a("./to_noun"),m=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Adjective=!0,f}return f(b,a),g(b,[{key:"to_comparative",value:function(){return i(this.normal)}},{key:"to_superlative",value:function(){return j(this.normal)}},{key:"to_noun",value:function(){return l(this.normal)}},{key:"to_adverb",value:function(){return k(this.normal)}},{key:"conjugate",value:function(){return{comparative:i(this.normal),superlative:j(this.normal),adverb:k(this.normal),noun:l(this.normal)}}}]),b}(h);m.fn=m.prototype,b.exports=m},{"../term.js":79,"./to_adverb":48,"./to_comparative":49,"./to_noun":50,"./to_superlative":51}],48:[function(a,b,c){"use strict";var d=function(a){var b={idle:"idly","public":"publicly",vague:"vaguely",day:"daily",icy:"icily",single:"singly",female:"womanly",male:"manly",simple:"simply",whole:"wholly",special:"especially",straight:"straight",wrong:"wrong",fast:"fast",hard:"hard",late:"late",early:"early",well:"well",best:"best",latter:"latter",bad:"badly"},c={foreign:1,black:1,modern:1,next:1,difficult:1,degenerate:1,young:1,awake:1,back:1,blue:1,brown:1,orange:1,complex:1,cool:1,dirty:1,done:1,empty:1,fat:1,fertile:1,frozen:1,gold:1,grey:1,gray:1,green:1,medium:1,parallel:1,outdoor:1,unknown:1,undersized:1,used:1,welcome:1,yellow:1,white:1,fixed:1,mixed:1,"super":1,guilty:1,tiny:1,able:1,unable:1,same:1,adult:1},d=[{reg:/al$/i,repl:"ally"},{reg:/ly$/i,repl:"ly"},{reg:/(.{3})y$/i,repl:"$1ily"},{reg:/que$/i,repl:"quely"},{reg:/ue$/i,repl:"uly"},{reg:/ic$/i,repl:"ically"},{reg:/ble$/i,repl:"bly"},{reg:/l$/i,repl:"ly"}],e=[/airs$/,/ll$/,/ee.$/,/ile$/];if(c[a])return null;if(b[a])return b[a];if(a.length<=3)return null;for(var f=0;f<e.length;f++)if(a.match(e[f]))return null;for(var f=0;f<d.length;f++)if(a.match(d[f].reg))return a.replace(d[f].reg,d[f].repl);return a+"ly"};b.exports=d},{}],49:[function(a,b,c){"use strict";var d=a("../../data/convertables.js"),e=function(a){var b={grey:"greyer",gray:"grayer",green:"greener",yellow:"yellower",red:"redder",good:"better",well:"better",bad:"worse",sad:"sadder"},c={overweight:1,main:1,nearby:1,asleep:1,weekly:1,secret:1,certain:1},e=[{reg:/y$/i,repl:"ier"},{reg:/([aeiou])t$/i,repl:"$1tter"},{reg:/([aeou])de$/i,repl:"$1der"},{reg:/nge$/i,repl:"nger"}],f=[/ght$/,/nge$/,/ough$/,/ain$/,/uel$/,/[au]ll$/,/ow$/,/old$/,/oud$/,/e[ae]p$/],g=[/ary$/,/ous$/];if(c.hasOwnProperty(a))return null;for(var h=0;h<e.length;h++)if(a.match(e[h].reg))return a.replace(e[h].reg,e[h].repl);if(d.hasOwnProperty(a))return a.match(/e$/)?a+"r":a+"er";if(b.hasOwnProperty(a))return b[a];for(var h=0;h<g.length;h++)if(a.match(g[h]))return"more "+a;for(var h=0;h<f.length;h++)if(a.match(f[h]))return a+"er";return"more "+a};b.exports=e},{"../../data/convertables.js":4}],50:[function(a,b,c){"use strict";var d=function(a){var b={clean:"cleanliness",naivety:"naivety"};if(!a)return"";if(b.hasOwnProperty(a))return b[a];if(a.match(" "))return a;if(a.match(/w$/))return a;for(var c=[{reg:/y$/,repl:"iness"},{reg:/le$/,repl:"ility"},{reg:/ial$/,repl:"y"},{reg:/al$/,repl:"ality"},{reg:/ting$/,repl:"ting"},{reg:/ring$/,repl:"ring"},{reg:/bing$/,repl:"bingness"},{reg:/sing$/,repl:"se"},{reg:/ing$/,repl:"ment"},{reg:/ess$/,repl:"essness"},{reg:/ous$/,repl:"ousness"}],d=0;d<c.length;d++)if(a.match(c[d].reg))return a.replace(c[d].reg,c[d].repl);return a.match(/s$/)?a:a+"ness"};b.exports=d},{}],51:[function(a,b,c){"use strict";var d=a("../../data/convertables.js"),e=function(a){for(var b={nice:"nicest",late:"latest",hard:"hardest",inner:"innermost",outer:"outermost",far:"furthest",worse:"worst",bad:"worst",good:"best"},c={overweight:1,ready:1},e=[{reg:/y$/i,repl:"iest"},{reg:/([aeiou])t$/i,repl:"$1ttest"},{reg:/([aeou])de$/i,repl:"$1dest"},{reg:/nge$/i,repl:"ngest"}],f=[/ght$/,/nge$/,/ough$/,/ain$/,/uel$/,/[au]ll$/,/ow$/,/oud$/,/...p$/],g=[/ary$/],h=function(a){return a.match(/e$/)?a+"st":a+"est"},i=0;i<e.length;i++)if(a.match(e[i].reg))return a.replace(e[i].reg,e[i].repl);if(d.hasOwnProperty(a))return h(a);if(c.hasOwnProperty(a))return"most "+a;if(b.hasOwnProperty(a))return b[a];for(var i=0;i<g.length;i++)if(a.match(g[i]))return"most "+a;for(var i=0;i<f.length;i++)if(a.match(f[i]))return h(a);return"most "+a};b.exports=e},{"../../data/convertables.js":4}],52:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../term.js"),i=a("./to_adjective.js"),j=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Adverb=!0,f}return f(b,a),g(b,[{key:"to_adjective",value:function(){return i(this.normal)}}]),b}(h);j.fn=j.prototype,b.exports=j},{"../term.js":79,"./to_adjective.js":53}],53:[function(a,b,c){"use strict";var d=function(a){var b={idly:"idle",sporadically:"sporadic",basically:"basic",grammatically:"grammatical",alphabetically:"alphabetical",economically:"economical",conically:"conical",politically:"political",vertically:"vertical",practically:"practical",theoretically:"theoretical",critically:"critical",fantastically:"fantastic",mystically:"mystical",pornographically:"pornographic",fully:"full",jolly:"jolly",wholly:"whole"},c=[{reg:/bly$/i,repl:"ble"},{reg:/gically$/i,repl:"gical"},{reg:/([rsdh])ically$/i,repl:"$1ical"},{reg:/ically$/i,repl:"ic"},{reg:/uly$/i,repl:"ue"},{reg:/ily$/i,repl:"y"},{reg:/(.{3})ly$/i,repl:"$1"}];if(b.hasOwnProperty(a))return b[a];for(var d=0;d<c.length;d++)if(a.match(c[d].reg))return a.replace(c[d].reg,c[d].repl);return a};b.exports=d},{}],54:[function(a,b,c){"use strict";var d=function(a){return a.match(/([A-Z]\.)+[A-Z]?$/)?!0:a.match(/[A-Z]{3}$/)?!0:!1};b.exports=d},{}],55:[function(a,b,c){"use strict";var d=a("../is_acronym.js"),e={hour:"an",heir:"an",heirloom:"an",honest:"an",honour:"an",honor:"an",uber:"an"},f=function(a){if(!a)return null;var b={A:!0,E:!0,F:!0,H:!0,I:!0,L:!0,M:!0,N:!0,O:!0,R:!0,S:!0,X:!0},c=[/^onc?e/i,/^u[bcfhjkqrstn][aeiou]/i,/^eul/i];if(e.hasOwnProperty(a))return e[a];if(d(a)&&b.hasOwnProperty(a.substr(0,1)))return"an";for(var f=0;f<c.length;f++)if(a.match(c[f]))return"a";return a.match(/^[aeiou]/i)?"an":"a"};b.exports=f},{"../is_acronym.js":54}],56:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../noun.js"),i=a("./parse_date.js"),j=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Date=!0,f.data=i(f.text)||{},f}return f(b,a),g(b,[{key:"is_date",value:function(){var a=this.data;return null===a.month||null===a.day||null===a.year?!1:!0}},{key:"date",value:function(){if(this.is_date()===!1)return null;var a=new Date;return this.data.year&&a.setYear(this.data.year),null!==this.data.month&&a.setMonth(this.data.month),null!==this.data.day&&a.setDate(this.data.day),a}}]),b}(h);j.fn=j.prototype,b.exports=j},{"../noun.js":62,"./parse_date.js":59}],57:[function(a,b,c){"use strict";var d=a("../../../data/dates").months.concat(["march","may"]),e="("+d.join("|")+")",f="([0-9]{1,2})",g="'?([12][0-9]{3})",h=[{reg:e+" "+f+" "+g,order:["month","day","year"]},{reg:f+" of "+e+" "+g,order:["day","month","year"]},{reg:f+" of "+e,order:["day","month"]},{reg:e+" "+g,order:["month","year"]},{reg:e+" "+f,order:["month","day"]},{reg:f+" "+e,order:["month","day"]},{reg:""+e,order:["month"]},{reg:""+g,order:["year"]}].map(function(a){return a.reg=new RegExp("\\b"+a.reg+"\\b",""),a});b.exports=h},{"../../../data/dates":5}],58:[function(a,b,c){"use strict";var d=a("../../../data/dates"),e=d.months.concat(d.days),f="(\\b"+e.join("\\b|\\b")+"\\b)";f=new RegExp(f,"i");var g=/1?[0-9]:[0-9]{2}/,h=function(a){return a.match(f)||a.match(g)?!0:!1};b.exports=h},{"../../../data/dates":5}],59:[function(a,b,c){"use strict";var d=a("../value/to_number.js"),e=a("./date_rules.js"),f={year:function(a){var b=a.match(/[0-9]+/);return b=parseInt(b,10),!b||b>2900||0>b?null:b>100&&1e3>b?null:a.match(/[0-9] ?bc/i)?b*=-1:(100>b&&b>30&&(b+=1900),b)},month:function(a){var b={january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11,jan:0,feb:1,mar:2,apr:3,aug:7,sept:8,oct:9,nov:10,dec:11};return b[a]},day:function(a){var b=d(a)||parseInt(a,10);return 0>b||b>31?null:b}},g=function(a){a=a.toLowerCase(),a=a.replace(/([0-9]+)(nd|rd|th|st)/i,"$1");var b=a.split(" ").map(function(a){return a.match(/[0-9]/)?a:d(a)||a});return b.join(" ")},h=function(a){a=g(a);for(var b={year:null,month:null,day:null},c=0;c<e.length;c++)if(a.match(e[c].reg)){for(var d=a.match(e[c].reg),h=0;h<e[c].order.length;h++){var i=e[c].order[h];b[i]=f[i](d[h+1])}break}return b};b.exports=h},{"../value/to_number.js":76,"./date_rules.js":57}],60:[function(a,b,c){"use strict";var d=a("../../data/irregular_nouns"),e=[/(^v)ies$/i,/ises$/i,/ives$/i,/(antenn|formul|nebul|vertebr|vit)ae$/i,/(octop|vir|radi|nucle|fung|cact|stimul)i$/i,/(buffal|tomat|tornad)oes$/i,/(analy|ba|diagno|parenthe|progno|synop|the)ses$/i,/(vert|ind|cort)ices$/i,/(matr|append)ices$/i,/(x|ch|ss|sh|s|z|o)es$/i,/men$/i,/news$/i,/.tia$/i,/(^f)ves$/i,/(lr)ves$/i,/(^aeiouy|qu)ies$/i,/(m|l)ice$/i,/(cris|ax|test)es$/i,/(alias|status)es$/i,/ics$/i],f=[/(ax|test)is$/i,/(octop|vir|radi|nucle|fung|cact|stimul)us$/i,/(octop|vir)i$/i,/(rl)f$/i,/(alias|status)$/i,/(bu)s$/i,/(al|ad|at|er|et|ed|ad)o$/i,/(ti)um$/i,/(ti)a$/i,/sis$/i,/(?:(^f)fe|(lr)f)$/i,/hive$/i,/(^aeiouy|qu)y$/i,/(x|ch|ss|sh|z)$/i,/(matr|vert|ind|cort)(ix|ex)$/i,/(m|l)ouse$/i,/(m|l)ice$/i,/(antenn|formul|nebul|vertebr|vit)a$/i,/.sis$/i,/^(?!talis|.*hu)(.*)man$/i],g=function(a){a=(a||"").toLowerCase();var b=a.match(/([a-z]*) (of|in|by|for) [a-z]/);b&&b[1]&&(a=b[1]);for(var c=0;c<d.length;c++){if(d[c][1]===a)return!0;if(d[c][0]===a)return!1}for(var c=0;c<e.length;c++)if(a.match(e[c]))return!0;for(var c=0;c<f.length;c++)if(a.match(f[c]))return!1;return a.match(/s$/)&&!a.match(/ss$/)&&a.length>3?!0:!1};b.exports=g},{"../../data/irregular_nouns":10}],61:[function(a,b,c){"use strict";var d=a("../../data/uncountables.js"),e=d.reduce(function(a,b){return a[b]=!0,a},{}),f=function(a){return e[a]?!0:!1};b.exports=f},{"../../data/uncountables.js":20}],62:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../term.js"),i=a("./article.js"),j=a("./is_plural.js"),k=a("./place/is_place.js"),l=a("./person/is_person.js"),m=a("./pronoun.js"),n=a("./value/is_value.js"),o=a("./date/is_date.js"),p=a("./organization/is_organization.js"),q=a("./singularize.js"),r=a("./pluralize.js"),s=a("./is_uncountable.js"),t=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Noun=!0,c&&(f.pos[c]=!0),f.is_plural()&&(f.pos.Plural=!0),f}return f(b,a),g(b,[{key:"article",value:function(){return i(this.text)}},{key:"root",value:function(){return this.singularize()}},{key:"pronoun",value:function(){return this.is_organization()||this.is_place()||this.is_value()?"it":m(this.normal)}},{key:"is_plural",value:function(){return j(this.normal)}},{key:"is_uncountable",value:function(){return s(this.normal)}},{key:"pluralize",value:function(){return r(this.normal)}},{key:"singularize",value:function(){return q(this.normal)}},{key:"is_person",value:function(){return l(this.normal)}},{key:"is_organization",value:function(){return p(this.normal,this.text)}},{key:"is_date",value:function(){return o(this.normal)}},{key:"is_value",value:function(){return n(this.normal)}},{key:"is_place",value:function(){return k(this.normal)}}]),b}(h);t.fn=t.prototype,b.exports=t},{"../term.js":79,"./article.js":55,"./date/is_date.js":58,"./is_plural.js":60,"./is_uncountable.js":61,"./organization/is_organization.js":63,"./person/is_person.js":66,"./place/is_place.js":69,"./pluralize.js":71,"./pronoun.js":72,"./singularize.js":73,"./value/is_value.js":74}],63:[function(a,b,c){"use strict";var d=a("../../../data/abbreviations"),e=a("../../../data/organizations"),f=d.orgs.reduce(function(a,b){return a[b]=!0,a},{});e.suffixes.forEach(function(a){f[a]=!0});var g=e.organizations.reduce(function(a,b){return a[b]=!0,a},{}),h=function(a,b){if(b=b||"",g[a])return!0;if(b.length<=5&&null!==b.match(/^[A-Z][A-Z]+$/))return!0;if(b.length>=4&&null!==b.match(/^([A-Z]\.)*$/))return!0;if(a.match(/ & /))return!0;if(a.match(/..s of /))return!0;if(a.match(/[a-z]{3}\.(com|net|org|biz)/))return!0;var c=a.split(" "),d=c[c.length-1];return f[d]?!0:!1};b.exports=h},{"../../../data/abbreviations":2,"../../../data/organizations":17}],64:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=a("../noun.js"),h=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Organization=!0,f}return f(b,a),b}(g);h.fn=h.prototype,b.exports=h},{"../noun.js":62}],65:[function(a,b,c){"use strict";var d=a("../../../data/firstnames"),e=a("./parse_name.js"),f=function(a){if("he"===a)return"Male";if("she"===a)return"Female";var b=e(a),c=b.firstName;return c?"m"===d[c]?"Male":"f"===d[c]?"Female":a.match(/\b(mr|mister|sr|jr)\b/i)?"Male":a.match(/^(mrs|miss|ms|misses|mme|mlle)\.? /i)?"Female":c.match(/.(i|ee|[a|e]y|a)$/i)?"Female":c.match(/[ou]$/i)?"Male":c.match(/(nn|ll|tt)/i)?"Female":null:null};b.exports=f},{"../../../data/firstnames":7,"./parse_name.js":67}],66:[function(a,b,c){"use strict";var d=a("../../../data/firstnames"),e=a("../../../data/honourifics").reduce(function(a,b){return a[b]=!0,a},{}),f={he:!0,she:!0,i:!0,you:!0},g=function(a){if(f[a]||d[a])return!0;var b=a.split(" ");if(b.length>1){var c=b[0];if(e[c]||d[c])return!0}return!1};b.exports=g},{"../../../data/firstnames":7,"../../../data/honourifics":9}],67:[function(a,b,c){"use strict";var d=a("../../../data/firstnames"),e=a("../../../data/honourifics").reduce(function(a,b){return a[b]=!0,a},{}),f=function(a){var b=a.split(" "),c={honourific:null,firstName:null,middleName:null,lastName:null};if(e[b[0]]&&(c.honourific=b[0],b=b.slice(1,b.length)),e[b[b.length-1]]&&(c.honourific=b[b.length-1],b=b.slice(0,b.length-1)),d[b[0]])c.firstName=b[0],b=b.slice(1,b.length);else{if(1===b.length)return c;c.firstName=b[0],b=b.slice(1,b.length)}return b[b.length-1]&&(c.lastName=b[b.length-1],b=b.slice(0,b.length-1)),c.middleName=b.join(" "),c};b.exports=f},{"../../../data/firstnames":7,"../../../data/honourifics":9}],68:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../noun.js"),i=a("./gender.js"),j=a("./parse_name.js"),k=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Person=!0,f.honourific=null,f.firstName=null,f.middleName=null,f.lastName=null,f.parse(),f}return f(b,a),g(b,[{key:"root",value:function(){var a=(this.firstName||"")+" "+(this.lastName||"");return a.trim()}},{key:"parse",value:function(){var a=j(this.normal);this.honourific=a.honourific,this.firstName=a.firstName,this.middleName=a.middleName,this.lastName=a.lastName}},{key:"gender",value:function(){return i(this.normal)}}]),b}(h);k.fn=k.prototype,b.exports=k},{"../noun.js":62,"./gender.js":65,"./parse_name.js":67}],69:[function(a,b,c){"use strict";var d=a("../../../data/places"),e=a("../../../data/abbreviations"),f=d.countries.reduce(function(a,b){return a[b]=!0,a},{});d.cities.forEach(function(a){f[a]=!0}),e.places.forEach(function(a){f[a]=!0});var g=["west","east","nort","south","western","eastern","nortern","southern","city","town","county","state","province"].reduce(function(a,b){return a[b]=!0,a},{}),h=function(a){for(var b=a.split(),c=0;c<b.length;c++){if(f[b[c]])return!0;if(g[b[c]]&&!g[a])return!0}return!1};b.exports=h},{"../../../data/abbreviations":2,"../../../data/places":19}],70:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../noun.js"),i=a("../../../data/places.js"),j=a("../../../fns.js"),k=j.toObj(i.countries),l=j.toObj(i.cities),m=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Place=!0,f.title=null,f.city=null,f.region=null,f.country=null,f.parse(),f}return f(b,a),g(b,[{key:"root",value:function(){return this.title||this.normal}},{key:"parse",value:function(){var a=this.normal.split(" ");this.title=a[0];for(var b=0;b<a.length;b++){var c=a[b];l[c]?this.city=j.titlecase(c):k[c]?this.country=j.titlecase(c):null!==this.city?this.region=j.titlecase(c):this.title+=" "+c}}}]),b}(h);m.fn=m.prototype,b.exports=m},{"../../../data/places.js":19,"../../../fns.js":22,"../noun.js":62}],71:[function(a,b,c){"use strict";var d=a("./is_uncountable.js"),e=a("../../data/irregular_nouns.js"),f=a("./is_plural.js"),g=a("../../fns.js"),h=[[/(ax|test)is$/i,"$1es"],[/(octop|vir|radi|nucle|fung|cact|stimul)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/([rl])f$/i,"$1ves"],[/(alias|status)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/(al|ad|at|er|et|ed|ad)o$/i,"$1oes"],[/([ti])um$/i,"$1a"],[/([ti])a$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1ves"],[/(hive)$/i,"$1s"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(x|ch|ss|sh|s|z)$/i,"$1es"],[/(matr|vert|ind|cort)(ix|ex)$/i,"$1ices"],[/([m|l])ouse$/i,"$1ice"],[/([m|l])ice$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/^(oxen)$/i,"$1"],[/(quiz)$/i,"$1zes"],[/(antenn|formul|nebul|vertebr|vit)a$/i,"$1ae"],[/(sis)$/i,"ses"],[/^(?!talis|.*hu)(.*)man$/i,"$1men"],[/(.*)/i,"$1s"]].map(function(a){return{reg:a[0],repl:a[1]}}),i=function j(a){var b=a.toLowerCase();if(d(b))return a;if(f(b)===!0)return a;var c=e.filter(function(a){return a[0]===b});if(c[0])return g.titlecase(b)===a?g.titlecase(c[0][1]):c[0][1];if(a.match(/([a-z]*) (of|in|by|for) [a-z]/)){var i=(a.match(/^([a-z]*) (of|in|by|for) [a-z]/)||[])[1];if(i){var k=j(i);return k+a.replace(i,"")}}for(var l=0;l<h.length;l++)if(a.match(h[l].reg))return a.replace(h[l].reg,h[l].repl);return null};b.exports=i},{"../../data/irregular_nouns.js":10,"../../fns.js":22,"./is_plural.js":60,"./is_uncountable.js":61}],72:[function(a,b,c){"use strict";var d=a("./person/is_person.js"),e=a("./is_plural.js"),f=a("./person/gender.js"),g=function(a){if(d(a)){var b=f(a);return"Male"===b?"he":"Female"===b?"she":"they"}return e(a)?"they":"it"};b.exports=g},{"./is_plural.js":60,"./person/gender.js":65,"./person/is_person.js":66}],73:[function(a,b,c){"use strict";var d=a("./is_uncountable.js"),e=a("../../data/irregular_nouns.js"),f=a("./is_plural.js"),g=a("../../fns.js"),h=[[/([^v])ies$/i,"$1y"],[/ises$/i,"isis"],[/ives$/i,"ife"],[/(antenn|formul|nebul|vertebr|vit)ae$/i,"$1a"],[/(octop|vir|radi|nucle|fung|cact|stimul)(i)$/i,"$1us"],[/(buffal|tomat|tornad)(oes)$/i,"$1o"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i,"$1sis"],[/(vert|ind|cort)(ices)$/i,"$1ex"],[/(matr|append)(ices)$/i,"$1ix"],[/(x|ch|ss|sh|s|z|o)es$/i,"$1"],[/men$/i,"man"],[/(n)ews$/i,"$1ews"],[/([ti])a$/i,"$1um"],[/([^f])ves$/i,"$1fe"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(s)eries$/i,"$1eries"],[/(m)ovies$/i,"$1ovie"],[/([m|l])ice$/i,"$1ouse"],[/(cris|ax|test)es$/i,"$1is"],[/(alias|status)es$/i,"$1"],[/(ss)$/i,"$1"],[/(ics)$/i,"$1"],[/s$/i,""]].map(function(a){return{reg:a[0],repl:a[1]}}),i=function j(a){var b=a.toLowerCase();if(d(b))return a;if(f(b)===!1)return a;var c=e.filter(function(a){return a[1]===b});if(c[0])return g.titlecase(b)===a?g.titlecase(c[0][0]):c[0][0];if(a.match(/([a-z]*) (of|in|by|for) [a-z]/)){var i=a.match(/^([a-z]*) (of|in|by|for) [a-z]/);if(i&&i[1]){var k=j(i[1]);return k+a.replace(i[1],"")}}for(var l=0;l<h.length;l++)if(a.match(h[l].reg))return a.replace(h[l].reg,h[l].repl);return a};b.exports=i},{"../../data/irregular_nouns.js":10,"../../fns.js":22,"./is_plural.js":60,"./is_uncountable.js":61}],74:[function(a,b,c){"use strict";var d=a("./numbers"),e=a("../date/is_date"),f=function(a){var b=a.split(" ");if(e(a))return!1;for(var c=0;c<b.length;c++){var f=b[c];if(d.ones[f]||d.teens[f]||d.tens[f]||d.multiples[f]||d.prefixes[f])return!0;if(parseFloat(f))return!0}return!1};b.exports=f},{"../date/is_date":58,"./numbers":75}],75:[function(a,b,c){"use strict";var d={a:1,zero:0,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9},e={ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19},f={twenty:20,thirty:30,forty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90,twentieth:20,thirtieth:30,fourtieth:40,fiftieth:50,sixtieth:60,seventieth:70,eightieth:80,ninetieth:90},g={hundred:100,grand:1e3,thousand:1e3,million:1e6,billion:1e9,trillion:1e12,quadrillion:1e15,quintillion:1e18,sextillion:1e21,septillion:1e24,octillion:1e27,nonillion:1e30,decillion:1e33},h={yotta:1,zeta:1,peta:1,tera:1,giga:1,mega:1,kilo:1,hecto:1,deca:1,centi:1,centa:1,milli:1,micro:1,nano:1,pico:1,femto:1,atto:1,zepto:1,yokto:1,square:1,cubic:1,quartic:1};b.exports={ones:d,teens:e,tens:f,multiples:g,prefixes:h}},{}],76:[function(a,b,c){"use strict";var d=a("./numbers.js"),e=function(a){return a.match(/[:@]/)?!1:a.match(/[0-9][^0-9,\.][0-9]/)?!1:!0},f=function(a){if(null===a||void 0===a)return null;if("number"==typeof a)return a;if(e(a)!==!0)return null;if(a=a.replace(/[\$%\(\)~,]/g,""),a=a.trim(),a.match(/^[0-9\.\-]+$/))return parseFloat(a);var b=!1,c=!1,f=!1,g={},h=0,i=1;if(a=a.replace(/, ?/g,""),a=a.replace(/[$£€]/,""),a.match(/[0-9][\-:][0-9]/))return null;for(var j=[{reg:/^(minus|negative)[\s\-]/i,mult:-1},{reg:/^(a\s)?half[\s\-](of\s)?/i,mult:.5},{reg:/^(a\s)?quarter[\s\-]/i,mult:.25}],k=0;k<j.length;k++)if(a.match(j[k].reg)){i=j[k].mult,a=a.replace(j[k].reg,"");break}for(var l=a.toString().split(/[\s\-]+/),m=void 0,n=void 0,o=0,p=1,q=!1,k=0;k<l.length;k++)if(m=l[k],"and"!==m)if("point"!==m&&"decimal"!==m){
if(q){if(n=null,void 0!==d.ones[m]&&(n=d.ones[m]),void 0!==d.teens[m]&&(n=d.teens[m]),parseInt(m,10)===m&&(n=parseInt(m,10)),!n)return null;if(10>n){h+=n*p,p=.1*p,o=0;continue}if(100>n){h+=n*(.1*p),p=.01*p,o=0;continue}}if(m.match(/^[0-9\.]+$/))o+=parseFloat(m);else if(parseInt(m,10)!==m)if(void 0===d.ones[m])if(d.teens[m]){if(b)return null;if(c)return null;if(f)return null;c=!0,o+=d.teens[m]}else if(d.tens[m]){if(b)return null;if(c)return null;if(f)return null;f=!0,o+=d.tens[m]}else{if(!d.multiples[m])return null;if(g[m])return null;g[m]=!0,b=!1,c=!1,f=!1,0===o?(h=h||1,h*=d.multiples[m]):(o*=d.multiples[m],h+=o),o=0}else{if(b)return null;if(c)return null;b=!0,o+=d.ones[m]}else o+=parseInt(m,10)}else{if(q)return null;q=!0,h+=o,o=0,b=!1,p=.1}return o&&(h+=(o||1)*p),h*=i};b.exports=f},{"./numbers.js":75}],77:[function(a,b,c){"use strict";var d={Temperature:{"°C":"Celsius","°F":"Fahrenheit",K:"Kelvin","°Ré":"Reaumur","°N":"Newton","°Ra":"Rankine"},Volume:{"m³":"cubic meter","dm³":"cubic decimeter","cm³":"cubic centimeter",l:"liter",dl:"deciliter",cl:"centiliter",ml:"milliliter","in³":"cubic inch","ft³":"cubic foot","yd³":"cubic yard",gal:"gallon",bbl:"petroleum barrel",pt:"pint"},Distance:{km:"kilometer",m:"meter",dm:"decimeter",cm:"centimeter",mm:"millimeter",mi:"mile","in":"inch",ft:"foot",feet:"foot",yd:"yard"},Weight:{t:"tonne",kg:"kilogram",hg:"hectogram",g:"gram",dg:"decigram",cg:"centigram",mg:"milligram","µg":"microgram",carat:"carat",grain:"grain",oz:"ounce",lb:"pound",ton:"tonne",st:"stone"},Area:{"km²":"square kilometer","m²":"square meter","dm²":"square decimeter","cm²":"square centimeter","mm²":"square millimeter",ha:"hectare",ca:"centiare","mile²":"square mile","in²":"square inch","yd²":"square yard","ft²":"square foot",acre:"acre"},Frequency:{Hz:"hertz"},Speed:{"km/h":"kilometer per hour",kmph:"kilometer per hour",mps:"meter per second","m/s":"meter per second",mph:"mile per hour","mi/h":"mile per hour",knot:"knot"},Data:{b:"bit",B:"byte",KB:"kilobyte",Kb:"kilobyte",MB:"megabyte",Mb:"megabyte",GB:"gigabyte",Gb:"gigabyte",TB:"terabyte",Tb:"terabyte",PB:"petabyte",Pb:"petabyte",EB:"exabyte",Eb:"exabyte",ZB:"zettabyte",Zb:"zettabyte",YB:"yottabyte",Yb:"yottabyte"},Energy:{J:"joule",Pa:"pascal",bar:"bar",W:"watt",N:"newton",Wb:"weber",T:"tesla",H:"henry",C:"coulomb",V:"volt",F:"farad",S:"siemens",O:"ohm",lx:"lux",lm:"lumen"},Time:{year:"year",week:"week",day:"day",h:"hour",min:"minute",s:"second",ms:"millisecond","µs":"microsecond",nanosecond:"nanosecond",picosecond:"picosecond",femtosecond:"femtosecond",attosecond:"attosecond"},Money:{dollar:"currency",cent:"currency",penny:"currency",dime:"currency",dinar:"currency",euro:"currency",EU:"currency",lira:"currency",pound:"currency",GBP:"currency",pence:"currency",peso:"currency",sterling:"currency",rand:"currency",rouble:"currency",shekel:"currency",yen:"currency",yuan:"currency",franc:"currency",rupee:"currency",shilling:"currency",won:"currency",krona:"currency",dirham:"currency","€":"currency",$:"currency","¥":"currency","£":"currency",real:"currency",USD:"currency",AUD:"currency",CAD:"currency",BRL:"currency",EUR:"currency",CNY:"currency",EGP:"currency",MXN:"currency"}};b.exports=Object.keys(d).reduce(function(a,b){return Object.keys(d[b]).forEach(function(c){a[c]={name:d[b][c],category:b},a[d[b][c]]={name:d[b][c],category:b}}),a},{})},{}],78:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../noun.js"),i=a("./to_number.js"),j=a("./units.js"),k=a("./numbers.js"),l=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Value=!0,f.number=null,f.unit=null,f.unit_name=null,f.measurement=null,f.parse(),f}return f(b,a),g(b,[{key:"is_unit",value:function(a){return j[a]?!0:(a=a.toLowerCase(),k.prefixes[a]?!0:(a=a.replace(/s$/),j[a]?!0:!1))}},{key:"parse",value:function(){for(var a=this.text.toLowerCase().split(" "),b={minus:!0,point:!0},c="",d=0;d<a.length;d++){var e=a[d];k.ones[e]||k.teens[e]||k.tens[e]||k.multiples[e]||b[e]||e.match(/[0-9]/)?c+=" "+e:this.is_unit(e)&&(this.unit=e,j[e]&&(this.measurement=j[e].category,this.unit_name=j[e].name))}this.number=i(c)}}]),b}(h);l.fn=l.prototype,b.exports=l},{"../noun.js":62,"./numbers.js":75,"./to_number.js":76,"./units.js":77}],79:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("./is_acronym"),g=a("../match/match_term"),h=a("../match/syntax_parse"),i=function(){function a(b,c){d(this,a),(null===b||void 0===b)&&(b=""),b=b.toString(),this.text=b,this.normal="",this.expansion="",this.rebuild(),this.reason="";var e={Determiner:"Determiner",Conjunction:"Conjunction",Preposition:"Preposition",Posessive:"Posessive",Expression:"Expression"};this.pos={},this.tag=e[c]||"?",e[c]&&(this.pos[e[c]]=!0)}return e(a,[{key:"rebuild",value:function(){this.text=this.text||"",this.text=this.text.trim(),this.normal="",this.normalize()}},{key:"changeTo",value:function(a){this.text=a,this.rebuild()}},{key:"match",value:function(a,b){var c=h(a)[0];return g(this,c,b)}},{key:"root",value:function(){return this.normal}},{key:"has_comma",value:function(){return this.text.match(/,$/)?!0:!1}},{key:"has_abbreviation",value:function(){return this.text.match(/[a-z]'[a-z][a-z]?$/)?!0:!1}},{key:"is_capital",value:function(){return this.text.match(/[A-Z][a-z]/)?!0:!1}},{key:"is_acronym",value:function(){return f(this.text)}},{key:"normalize",value:function(){var a=this.text||"";return a=a.toLowerCase(),a=a.replace(/[,\.!:;\?\(\)]/,""),a=a.replace(/([a-z])\-([a-z])/,"$1 $2"),a=a.replace(/’/g,"'"),a=a.replace(/"/g,""),a=a.replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]+/g,"'"),a=a.replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]+/g,'"'),a.match(/[a-z0-9]/i)?(this.normal=a,this.normal):""}}]),a}();i.fn=i.prototype,b.exports=i},{"../match/match_term":25,"../match/syntax_parse":27,"./is_acronym":54}],80:[function(a,b,c){"use strict";var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},e=a("./to_actor"),f=a("./to_infinitive"),g=a("./from_infinitive"),h=a("../../../data/irregular_verbs"),i=a("./predict_form.js"),j=function(a,b){return a.infinitive?(a.gerund||(a.infinitive.match(/e$/)?a.gerund=a.infinitive.replace(/e$/,"ing"):a.gerund=a.infinitive+"ing"),void 0===a.actor&&(a.actor=e(a.infinitive)),a.present||(a.present=a.infinitive+"s"),a.past||(a.infinitive.match(/e$/)?a.past=a.infinitive+"d":a.past=a.infinitive+"ed"),b&&Object.keys(a).forEach(function(c){a[c]=b+a[c]}),a.future||(a.future="will "+a.infinitive),a.perfect||(a.perfect="have "+(a.participle||a.past)),a.pluperfect||(a.pluperfect="had "+a.past),a.future_perfect||(a.future_perfect="will have "+a.past),a):a},k=function l(a){if(void 0===a)return{};var b=new RegExp("^(.*?) (in|out|on|off|behind|way|with|of|do|away|across|ahead|back|over|under|together|apart|up|upon|aback|down|about|before|after|around|to|forth|round|through|along|onto)$","i");if(a.match(b)){var c=function(){var c=a.match(b,""),d=c[1],e=c[2],f=l(d);return Object.keys(f).forEach(function(a){f[a]&&(f[a]+=" "+e)}),{v:f}}();if("object"===("undefined"==typeof c?"undefined":d(c)))return c.v}a=a.replace(/^had /i,""),a=a.replace(/^have /i,""),a=a.replace(/^will have /i,""),a=a.replace(/^will /i,"");var e="",k=a.match(/^(over|under|re|anti|full)[- ]?([a-z]*)/i);k&&(e=k[1],a=k[2]);var m=i(a)||"infinitive",n=f(a,m)||"",o=h[a]||h[n]||{};o=Object.assign({},o);var p=g(n);return Object.keys(p).forEach(function(a){o[a]||(o[a]=p[a])}),j(o,e)};b.exports=k},{"../../../data/irregular_verbs":11,"./from_infinitive":81,"./predict_form.js":82,"./to_actor":84,"./to_infinitive":85}],81:[function(a,b,c){"use strict";var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a},e=[{reg:/(eave)$/i,repl:{pr:"$1s",pa:"$1d",gr:"eaving",ar:"$1r"}},{reg:/(end)$/i,repl:{pr:"$1s",pa:"ent",gr:"$1ing",ar:"$1er"}},{reg:/(ide)$/i,repl:{pr:"$1s",pa:"ode",gr:"iding",ar:"ider"}},{reg:/(ake)$/i,repl:{pr:"$1s",pa:"ook",gr:"aking",ar:"$1r"}},{reg:/(eed)$/i,repl:{pr:"$1s",pa:"$1ed",gr:"$1ing",ar:"$1er"}},{reg:/(e)(ep)$/i,repl:{pr:"$1$2s",pa:"$1pt",gr:"$1$2ing",ar:"$1$2er"}},{reg:/(a[tg]|i[zn]|ur|nc|gl|is)e$/i,repl:{pr:"$1es",pa:"$1ed",gr:"$1ing",prt:"$1en"}},{reg:/([i|f|rr])y$/i,repl:{pr:"$1ies",pa:"$1ied",gr:"$1ying"}},{reg:/([td]er)$/i,repl:{pr:"$1s",pa:"$1ed",gr:"$1ing"}},{reg:/([bd]l)e$/i,repl:{pr:"$1es",pa:"$1ed",gr:"$1ing"}},{reg:/(ish|tch|ess)$/i,repl:{pr:"$1es",pa:"$1ed",gr:"$1ing"}},{reg:/(ion|end|e[nc]t)$/i,repl:{pr:"$1s",pa:"$1ed",gr:"$1ing"}},{reg:/(om)e$/i,repl:{pr:"$1es",pa:"ame",gr:"$1ing"}},{reg:/([aeiu])([pt])$/i,repl:{pr:"$1$2s",pa:"$1$2",gr:"$1$2$2ing"}},{reg:/(er)$/i,repl:{pr:"$1s",pa:"$1ed",gr:"$1ing"}},{reg:/(en)$/i,repl:{pr:"$1s",pa:"$1ed",gr:"$1ing"}},{reg:/(..)(ow)$/i,repl:{pr:"$1$2s",pa:"$1ew",gr:"$1$2ing",prt:"$1$2n"}}],f={pr:"present",pa:"past",gr:"gerund",prt:"participle",ar:"actor"},g=function(a){var b={infinitive:a};if(!a||"string"!=typeof a)return b;for(var c=function(c){return a.match(e[c].reg)?(Object.keys(e[c].repl).forEach(function(d){b[f[d]]=a.replace(e[c].reg,e[c].repl[d])}),{v:b}):void 0},g=0;g<e.length;g++){var h=c(g);if("object"===("undefined"==typeof h?"undefined":d(h)))return h.v}return b};b.exports=g},{}],82:[function(a,b,c){"use strict";var d=a("../../../fns.js"),e=a("./suffix_rules"),f=a("../../../data/irregular_verbs"),g=Object.keys(f).reduce(function(a,b){return Object.keys(f[b]).forEach(function(c){a[f[b][c]]=c}),a},{}),h=function(a){if(f[a])return"infinitive";if(g[a])return g[a];if(a.match(/will ha(ve|d) [a-z]{2}/))return"future_perfect";if(a.match(/will [a-z]{2}/))return"future";if(a.match(/had [a-z]{2}/))return"pluperfect";if(a.match(/have [a-z]{2}/))return"perfect";if(a.match(/..erer$/))return"actor";if(a.match(/[^aeiou]ing$/))return"gerund";for(var b=Object.keys(e),c=0;c<b.length;c++)if(d.endsWith(a,b[c])&&b[c].length<a.length)return e[b[c]];return"infinitive"};b.exports=h},{"../../../data/irregular_verbs":11,"../../../fns.js":22,"./suffix_rules":83}],83:[function(a,b,c){"use strict";for(var d={gerund:[],infinitive:["ate","ize","tion","rify","then","ress","ify","age","nce","ect","ise","ine","ish","ace","ash","ure","tch","end","ack","and","ute","ade","ock","ite","ase","ose","use","ive","int","nge","lay","est","ain","ant","eed","er","le"],participle:["own","unk","ung","en"],past:["ed","lt","nt","pt","ew","ld"],present:["rks","cks","nks","ngs","mps","tes","zes","ers","les","acks","ends","ands","ocks","lays","eads","lls","els","ils","ows","nds","ays","ams","ars","ops","ffs","als","urs","lds","ews","ips","es","ts","ns","s"]},e={},f=Object.keys(d),g=f.length,h=0;g>h;h++)for(var i=d[f[h]].length,j=0;i>j;j++)e[d[f[h]][j]]=f[h];b.exports=e},{}],84:[function(a,b,c){"use strict";var d=function(a){a=a||"";var b={tie:"tier",dream:"dreamer",sail:"sailer",run:"runner",rub:"rubber",begin:"beginner",win:"winner",claim:"claimant",deal:"dealer",spin:"spinner"},c={aid:1,fail:1,appear:1,happen:1,seem:1,"try":1,say:1,marry:1,be:1,forbid:1,understand:1,bet:1},d=[{reg:/e$/i,repl:"er"},{reg:/([aeiou])([mlgp])$/i,repl:"$1$2$2er"},{reg:/([rlf])y$/i,repl:"$1ier"},{reg:/^(.?.[aeiou])t$/i,repl:"$1tter"}];if(c.hasOwnProperty(a))return null;if(b.hasOwnProperty(a))return b[a];for(var e=0;e<d.length;e++)if(a.match(d[e].reg))return a.replace(d[e].reg,d[e].repl);return a+"er"};b.exports=d},{}],85:[function(a,b,c){"use strict";var d=a("../../../data/irregular_verbs"),e=Object.keys(d).reduce(function(a,b){return Object.keys(d[b]).forEach(function(c){a[d[b][c]]=b}),a},{}),f={participle:[{reg:/own$/i,to:"ow"},{reg:/(.)un([g|k])$/i,to:"$1in$2"},{reg:/(..)en$/i,to:"$1e"}],actor:[{reg:/(er)er$/i,to:"$1"}],present:[{reg:/(ies)$/i,to:"y"},{reg:/(tch|sh)es$/i,to:"$1"},{reg:/(ss)es$/i,to:"$1"},{reg:/([tzlshicgrvdnkmu])es$/i,to:"$1e"},{reg:/(n[dtk]|c[kt]|[eo]n|i[nl]|er|a[ytrl])s$/i,to:"$1"},{reg:/(ow)s$/i,to:"$1"},{reg:/(op)s$/i,to:"$1"},{reg:/([eirs])ts$/i,to:"$1t"},{reg:/(ll)s$/i,to:"$1"},{reg:/(el)s$/i,to:"$1"},{reg:/(ip)es$/i,to:"$1e"},{reg:/ss$/i,to:"ss"},{reg:/s$/i,to:""}],gerund:[{reg:/pping$/i,to:"p"},{reg:/lling$/i,to:"ll"},{reg:/tting$/i,to:"t"},{reg:/ssing$/i,to:"ss"},{reg:/gging$/i,to:"g"},{reg:/([^aeiou])ying$/i,to:"$1y"},{reg:/(i.)ing$/i,to:"$1e"},{reg:/(u[rtcb]|[bdtpkg]l|n[cg]|a[gdkvtc]|[ua]s|[dr]g|yz|o[rlsp]|cre)ing$/i,to:"$1e"},{reg:/(ch|sh)ing$/i,to:"$1"},{reg:/(..)ing$/i,to:"$1"}],past:[{reg:/(ued)$/i,to:"ue"},{reg:/(e|i)lled$/i,to:"$1ll"},{reg:/(sh|ch)ed$/i,to:"$1"},{reg:/(tl|gl)ed$/i,to:"$1e"},{reg:/(ss)ed$/i,to:"$1"},{reg:/pped$/i,to:"p"},{reg:/tted$/i,to:"t"},{reg:/gged$/i,to:"g"},{reg:/(h|ion|n[dt]|ai.|[cs]t|pp|all|ss|tt|int|ail|ld|en|oo.|er|k|pp|w|ou.|rt|ght|rm)ed$/i,to:"$1"},{reg:/(..[^aeiou])ed$/i,to:"$1e"},{reg:/ied$/i,to:"y"},{reg:/(.o)ed$/i,to:"$1o"},{reg:/(.i)ed$/i,to:"$1"},{reg:/([rl])ew$/i,to:"$1ow"},{reg:/([pl])t$/i,to:"$1t"}]},g=function(a,b){if(e[a])return e[a];if("infinitive"===b)return a;for(var c=f[b]||[],d=0;d<c.length;d++)if(a.match(c[d].reg))return a.replace(c[d].reg,c[d].to);return a};b.exports=g},{"../../../data/irregular_verbs":11}],86:[function(a,b,c){"use strict";var d=function(a,b){var c={is:"isn't",are:"aren't",was:"wasn't",will:"won't",had:"hadn't",did:"didn't",would:"wouldn't",could:"couldn't",should:"shouldn't",can:"can't",must:"mustn't",have:"hasn't",does:"doesn't","didn't":"did","doesn't":"does","wouldn't":"would","couldn't":"could","shouldn't":"should","can't":"can","won't":"will","mustn't":"must","shan't":"shall",shant:"shall",not:"","don't":""};if(c[a.normal])return c[a.normal];var d=a.normal.split(" ");return d.length>1&&c[d[0]]?c[d[0]]+" "+d.slice(1,d.length).join(" "):(b=b||a.conjugation(),"PastTense"===b?"didn't "+a.conjugate().infinitive:"PresentTense"===b?"doesn't "+a.conjugate().infinitive:"Gerund"===b?"not "+a.text:"Actor"===b?"non-"+a.text:"Infinitive"===b?"not "+a.text:a.text)};b.exports=d},{}],87:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}var g=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),h=a("../term.js"),i=a("./conjugate/conjugate.js"),j=a("./negate.js"),k={infinitive:"Infinitive",present:"PresentTense",past:"PastTense",gerund:"Gerund",actor:"Actor",future:"FutureTense",pluperfect:"PluperfectTense",perfect:"PerfectTense",PerfectTense:"PerfectTense",PluperfectTense:"PluperfectTense",FutureTense:"FutureTense",PastTense:"PastTense",PresentTense:"PresentTense"},l=function(a){function b(a,c){d(this,b);var f=e(this,Object.getPrototypeOf(b).call(this,a));return f.tag=c,f.pos.Verb=!0,f.conjugations={},f.pos[c]=!0,c&&k[c]&&(f.conjugations[c]=f.normal),f}return f(b,a),g(b,[{key:"root",value:function(){return this.conjugate().infinitive}},{key:"conjugation",value:function(){this.conjugations=this.conjugate();for(var a=Object.keys(this.conjugations),b=0;b<a.length;b++)if(this.conjugations[a[b]]===this.normal)return k[a[b]];return k[predict(this.normal)]}},{key:"conjugate",value:function(){return this.conjugations=i(this.normal),this.conjugations}},{key:"to_past",value:function(){var a="past";return this.conjugations[a]||this.conjugate(this.normal),this.tag=k[a],this.changeTo(this.conjugations[a]),this.conjugations[a]}},{key:"to_present",value:function(){var a="present";return this.conjugations[a]||this.conjugate(this.normal),this.tag=k[a],this.changeTo(this.conjugations[a]),this.conjugations[a]}},{key:"to_future",value:function(){var a="future";return this.conjugations[a]||this.conjugate(this.normal),this.tag=k[a],this.changeTo(this.conjugations[a]),this.conjugations[a]}},{key:"isNegative",value:function(){var a=this.normal;return a.match(/(n't|\bnot\b)/)?!0:!1}},{key:"negate",value:function(a){return this.isNegative()?this.text:(this.changeTo(j(this,a)),this.text)}}]),b}(h);l.fn=l.prototype,b.exports=l},{"../term.js":79,"./conjugate/conjugate.js":80,"./negate.js":86}],88:[function(a,b,c){"use strict";var d=a("../data/abbreviations").abbreviations,e=function(a){for(var b=[],c=a.split(/(\S.+?[.\?!])(?=\s+|$|")/g),e=new RegExp("\\b("+d.join("|")+")[.!?] ?$","i"),f=new RegExp("[ |.][A-Z].?$","i"),g=new RegExp("\\.\\.\\.*$"),h=c.length,i=0;h>i;i++)c[i]&&(c[i]=c[i].replace(/^\s+|\s+$/g,""),c[i+1]&&(c[i].match(e)||c[i].match(f)||c[i].match(g))?c[i+1]=((c[i]||"")+" "+(c[i+1]||"")).replace(/ +/g," "):c[i]&&c[i].length>0&&(b.push(c[i]),c[i]=""));return 0===b.length?[a]:b};b.exports=e},{"../data/abbreviations":2}],89:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}var e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=a("./sentence_parser.js"),g=a("../sentence/sentence.js"),h=a("../sentence/question/question.js"),i=a("../sentence/statement/statement.js"),j=a("../fns.js"),k=function(){function a(b,c){d(this,a),c=c||{};var e=this;this.raw_text=b||"",this.sentences=f(b).map(function(a){var b=a.slice(-1);return"?"===b?new h(a,c):"."===b||"!"===b?new i(a,c):new g(a,c)}),this.contractions={expand:function(){return e.sentences.map(function(a){return a.contractions.expand()})},contract:function(){return e.sentences.map(function(a){return a.contractions.contract()})}}}return e(a,[{key:"text",value:function(){var a=this.sentences.map(function(a){return a.text()});return j.flatten(a).join(" ")}},{key:"normalized",value:function(){var a=this.sentences.map(function(a){return a.normalized()});return j.flatten(a).join(" ")}},{key:"root",value:function(){var a=this.sentences.map(function(a){return a.root()});return j.flatten(a).join(" ")}},{key:"terms",value:function(){var a=this.sentences.map(function(a){return a.terms});return j.flatten(a)}},{key:"tags",value:function(){return this.sentences.map(function(a){return a.tags()})}},{key:"match",value:function(a,b){for(var c=[],d=0;d<this.sentences.length;d++)c=c.concat(this.sentences[d].match(a,b));return c}},{key:"replace",value:function(a,b,c){for(var d=0;d<this.sentences.length;d++)this.sentences[d].replace(a,b,c);return this}},{key:"to_past",value:function(){return this.sentences.map(function(a){return a.to_past()})}},{key:"to_present",value:function(){return this.sentences.map(function(a){return a.to_present()})}},{key:"to_future",value:function(){return this.sentences.map(function(a){return a.to_future()})}},{key:"negate",value:function(){return this.sentences.map(function(a){return a.negate()})}},{key:"people",value:function(){for(var a=[],b=0;b<this.sentences.length;b++)a=a.concat(this.sentences[b].people());return a}},{key:"places",value:function(){for(var a=[],b=0;b<this.sentences.length;b++)a=a.concat(this.sentences[b].places());return a}},{key:"organizations",value:function(){for(var a=[],b=0;b<this.sentences.length;b++)a=a.concat(this.sentences[b].organizations());return a}},{key:"dates",value:function(){for(var a=[],b=0;b<this.sentences.length;b++)a=a.concat(this.sentences[b].dates());return a}},{key:"values",value:function(){for(var a=[],b=0;b<this.sentences.length;b++)a=a.concat(this.sentences[b].values());return a}}]),a}();k.fn=k.prototype,b.exports=k},{"../fns.js":22,"../sentence/question/question.js":43,"../sentence/sentence.js":44,"../sentence/statement/statement.js":45,"./sentence_parser.js":88}]},{},[1])(1)}); | tonytomov/cdnjs | ajax/libs/nlp_compromise/4.2.2/nlp_compromise.min.js | JavaScript | mit | 119,640 |
/*!
* ZUI - v1.2.0 - 2014-11-18
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2014 cnezsoft.com; Licensed MIT
*/
.datatable-head,
.datatable-rows {
display: table;
width: 100%;
table-layout: fixed;
}
.datatable {
margin-bottom: 20px;
}
.datatable > .datatable-head {
-webkit-transition: -webkit-box-shadow .2s;
-o-transition: box-shadow .2s;
transition: box-shadow .2s;
}
.datatable .table {
margin: 0;
table-layout: fixed;
}
.datatable .table > tbody > tr > td,
.datatable .table > thead > tr > th {
min-width: 20px;
}
.datatable .table > tbody > tr > td.check-btn,
.datatable .table > thead > tr > th.check-btn {
width: 30px;
color: #999;
text-align: center;
cursor: pointer;
}
.datatable .table > tbody > tr.hover > td.check-btn,
.datatable .table > tbody > tr.active > td.check-btn,
.datatable .table > thead > tr > th.check-btn:hover,
.datatable .table > tbody > tr > td.check-btn:hover,
.datatable .table > thead > tr > th.check-btn.checked,
.datatable .table > tbody > tr > td.check-btn.checked {
color: #4d4d4d;
}
.datatable .table > thead > tr > th.check-btn.checked > .icon-check-empty:before,
.datatable .table > tbody > tr > td.check-btn.checked > .icon-check-empty:before,
.datatable .table > tbody > tr.active > td.check-btn > .icon-check-empty:before {
content: "\e642";
}
.datatable .table > thead > tr > th.col-hover {
background-color: #e2e2e2;
}
.datatable .table > tbody > tr > td.col-hover,
.datatable .table > tbody > tr.hover > td {
background-color: #ebf2f9;
}
.datatable .table > tbody > tr.active.hover td {
background-color: #ffdfb2;
}
.datatable.head-fixed > .datatable-head {
position: fixed;
z-index: 10000;
-webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .15);
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .15);
}
.datatable.sortable .datatable-head-span .table > thead > tr > th {
overflow: hidden;
white-space: nowrap;
cursor: pointer;
}
.datatable.sortable .datatable-head-span .table > thead > tr > th.text-center {
padding-right: 0;
padding-left: 0;
}
.datatable.sortable .datatable-head-span .table > thead > tr > th:after {
display: inline-block;
margin-left: 5px;
font-family: ZenIcon;
font-size: 14px;
font-style: normal;
font-weight: normal;
font-variant: normal;
line-height: 1;
color: #808080;
text-transform: none;
content: "\e6bd";
speak: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.datatable.sortable .datatable-head-span .table > thead > tr > th.sort-down:after {
color: #145ccd;
content: "\e6b8";
}
.datatable.sortable .datatable-head-span .table > thead > tr > th.sort-up:after {
color: #145ccd;
content: "\e6b9";
}
.datatable.sortable .datatable-head-span .table > thead > tr > th.check-btn:after,
.datatable.sortable .datatable-head-span .table > thead > tr > th.sort-disabled:after {
display: none;
}
.datatable.sortable .datatable-head-span .table > thead > tr > th.sort-disabled {
cursor: default;
}
.datatable-wrapper {
position: relative;
}
.datatable-span {
display: table-cell;
vertical-align: top;
}
.datatable-span.flexarea {
overflow: hidden;
}
.datatable-span.flexarea.datatable-head-span.dragging {
cursor: move !important;
}
.datatable-span.flexarea .table {
position: relative;
top: 0;
left: 0;
}
.datatable-span.flexarea .scrolled-shadow {
position: absolute;
top: 0;
bottom: 0;
display: none;
width: 20px;
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, .15);
box-shadow: 0 0 10px rgba(0, 0, 0, .15);
opacity: 0;
-webkit-transition: all .5s cubic-bezier(.175, .885, .32, 1);
-o-transition: all .5s cubic-bezier(.175, .885, .32, 1);
transition: all .5s cubic-bezier(.175, .885, .32, 1);
}
.datatable-span.flexarea .scrolled-in-shadow {
left: -30px;
}
.datatable-span.flexarea .scrolled-out-shadow {
right: -30px;
}
.datatable > .scroll-wrapper {
position: relative;
width: 100%;
}
.datatable .scroll-slide {
position: absolute;
right: -1px;
bottom: 0;
left: -1px;
display: none;
height: 11px;
background: #e5e5e5;
background: rgba(128, 128, 128, .1);
border: 1px solid #e5e5e5;
border-bottom: none;
opacity: 0;
-webkit-transition: opacity .5s, background .3s;
-o-transition: opacity .5s, background .3s;
transition: opacity .5s, background .3s;
}
.datatable .scroll-slide > .bar {
position: absolute;
top: 0;
left: 0;
min-width: 50px;
height: 10px;
background-color: #a6a6a6;
}
.datatable .scroll-slide:hover > .bar {
background-color: #808080;
}
.datatable .scroll-slide.scroll-pos-out {
bottom: -14px;
height: 15px;
}
.datatable .scroll-slide.scroll-pos-out > .bar {
height: 14px;
}
.datatable.show-scroll-slide:hover .scroll-slide,
.datatable.show-scroll-slide.scrolling .scroll-slide,
.datatable.show-scroll-slide:hover .scrolled-shadow,
.datatable.show-scroll-slide.scrolling .scrolled-shadow {
opacity: 1;
}
.datatable.show-scroll-slide .scroll-slide,
.datatable.show-scroll-slide .scrolled-shadow {
display: block;
}
.datatable.show-scroll-slide.scrolled-in .scrolled-in-shadow {
left: -20px;
}
.datatable.show-scroll-slide.scrolled-out .scrolled-out-shadow {
right: -20px;
}
/*# sourceMappingURL=zui.datatable.css.map */
| Piicksarn/cdnjs | ajax/libs/zui/1.2.0/lib/datatable/zui.datatable.css | CSS | mit | 5,332 |
/*! jQuery Migrate v3.0.0-rc1 | (c) jQuery Foundation and other contributors | jquery.org/license */
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(a,b){"use strict";function c(c){var d=b.console;e[c]||(e[c]=!0,a.migrateWarnings.push(c),d&&d.warn&&!a.migrateMute&&(d.warn("JQMIGRATE: "+c),a.migrateTrace&&d.trace&&d.trace()))}function d(a,b,d,e){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return c(e),d}})}a.migrateVersion="3.0.0-rc1",function(){var c=b.console&&b.console.log&&function(){b.console.log.apply(b.console,arguments)},d=/^[12]\./;c&&(a&&!d.test(a.fn.jquery)||c("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),a.migrateWarnings&&c("JQMIGRATE: Migrate plugin loaded multiple times"),c("JQMIGRATE: Migrate is installed"+(a.migrateMute?"":" with logging active")+", version "+a.migrateVersion))}();var e={};a.migrateWarnings=[],void 0===a.migrateTrace&&(a.migrateTrace=!0),a.migrateReset=function(){e={},a.migrateWarnings.length=0},"BackCompat"===document.compatMode&&c("jQuery is not compatible with Quirks Mode");var f=a.fn.init,g=a.isNumeric,h=a.find,i=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,j=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g;a.fn.init=function(a){var b=Array.prototype.slice.call(arguments);return"string"==typeof a&&"#"===a&&(c("jQuery( '#' ) is not a valid selector"),b[0]=[]),f.apply(this,b)},a.fn.init.prototype=a.fn,a.find=function(a){var b=Array.prototype.slice.call(arguments);if("string"==typeof a&&i.test(a))try{document.querySelector(a)}catch(d){a=a.replace(j,function(a,b,c,d){return"["+b+c+'"'+d+'"]'});try{document.querySelector(a),c("Attribute selector with '#' must be quoted: "+b[0]),b[0]=a}catch(e){c("Attribute selector with '#' was not fixed: "+b[0])}}return h.apply(this,b)};var k;for(k in h)Object.prototype.hasOwnProperty.call(h,k)&&(a.find[k]=h[k]);a.fn.size=function(){return c("jQuery.fn.size() is deprecated; use the .length property"),this.length},a.parseJSON=function(){return c("jQuery.parseJSON is deprecated; use JSON.parse"),JSON.parse.apply(null,arguments)},a.isNumeric=function(b){function d(b){var c=b&&b.toString();return!a.isArray(b)&&c-parseFloat(c)+1>=0}var e=g(b),f=d(b);return e!==f&&c("jQuery.isNumeric() should not be called on constructed objects"),f},d(a,"unique",a.uniqueSort,"jQuery.unique is deprecated, use jQuery.uniqueSort"),d(a.expr,"filters",a.expr.pseudos,"jQuery.expr.filters is now jQuery.expr.pseudos"),d(a.expr,":",a.expr.pseudos,'jQuery.expr[":"] is now jQuery.expr.pseudos');var l=a.ajax;a.ajax=function(){var a=l.apply(this,arguments);return a.promise&&(d(a,"success",a.done,"jQXHR.success is deprecated and removed"),d(a,"error",a.fail,"jQXHR.error is deprecated and removed"),d(a,"complete",a.always,"jQXHR.complete is deprecated and removed")),a};var m=a.fn.removeAttr,n=a.fn.toggleClass,o=/\S+/g;a.fn.removeAttr=function(b){var d=this;return a.each(b.match(o),function(b,e){a.expr.match.bool.test(e)&&(c("jQuery.fn.removeAttr no longer sets boolean properties: "+e),d.prop(e,!1))}),m.apply(this,arguments)},a.fn.toggleClass=function(b){return void 0!==b&&"boolean"!=typeof b?n.apply(this,arguments):(c("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var c=this.getAttribute&&this.getAttribute("class")||"";c&&a.data(this,"__className__",c),this.setAttribute&&this.setAttribute("class",c||b===!1?"":a.data(this,"__className__")||"")}))};var p=!1;a.swap&&a.each(["height","width","reliableMarginRight"],function(b,c){var d=a.cssHooks[c]&&a.cssHooks[c].get;d&&(a.cssHooks[c].get=function(){var a;return p=!0,a=d.apply(this,arguments),p=!1,a})}),a.swap=function(a,b,d,e){var f,g,h={};p||c("jQuery.swap() is undocumented and deprecated");for(g in b)h[g]=a.style[g],a.style[g]=b[g];f=d.apply(a,e||[]);for(g in b)a.style[g]=h[g];return f};var q=a.data;a.data=function(b,d,e){var f;return d&&d!==a.camelCase(d)&&(f=a.hasData(b)&&q.call(this,b),f&&d in f)?(c("jQuery.data() always sets/gets camelCased names: "+d),arguments.length>2&&(f[d]=e),f[d]):q.apply(this,arguments)};var r=a.Tween.prototype.run;a.Tween.prototype.run=function(b){a.easing[this.easing].length>1&&(c('easing function "jQuery.easing.'+this.easing.toString()+'" should use only first argument'),a.easing[this.easing]=a.easing[this.easing].bind(a.easing,b,this.options.duration*b,0,1,this.options.duration)),r.apply(this,arguments)};var s=a.fn.load,t=a.event.fix;a.event.props=[],a.event.fixHooks={},a.event.fix=function(b){var d,e=b.type,f=this.fixHooks[e],g=a.event.props;if(g.length)for(c("jQuery.event.props are deprecated and removed: "+g.join());g.length;)a.event.addProp(g.pop());if(f&&!f._migrated_&&(f._migrated_=!0,c("jQuery.event.fixHooks are deprecated and removed: "+e),(g=f.props)&&g.length))for(;g.length;)a.event.addProp(g.pop());return d=t.call(this,b),f&&f.filter?f.filter(d,b):d},a.each(["load","unload","error"],function(b,d){a.fn[d]=function(){var a=Array.prototype.slice.call(arguments,0);return"load"===d&&"string"==typeof a[0]?s.apply(this,a):(c("jQuery.fn."+d+"() is deprecated"),a.splice(0,0,d),arguments.length?this.on.apply(this,a):(this.triggerHandler.apply(this,a),this))}}),a(function(){a(document).triggerHandler("ready")}),a.event.special.ready={setup:function(){this===document&&c("'ready' event is deprecated")}},a.fn.extend({bind:function(a,b,d){return c("jQuery.fn.bind() is deprecated"),this.on(a,null,b,d)},unbind:function(a,b){return c("jQuery.fn.unbind() is deprecated"),this.off(a,null,b)},delegate:function(a,b,d,e){return c("jQuery.fn.delegate() is deprecated"),this.on(b,a,d,e)},undelegate:function(a,b,d){return c("jQuery.fn.undelegate() is deprecated"),1===arguments.length?this.off(a,"**"):this.off(b,a||"**",d)}});var u=a.fn.offset;a.fn.offset=function(){var b,d=this[0],e={top:0,left:0};return d&&d.nodeType?(b=(d.ownerDocument||document).documentElement,a.contains(b,d)?u.apply(this,arguments):(c("jQuery.fn.offset() requires an element connected to a document"),e)):(c("jQuery.fn.offset() requires a valid DOM element"),e)};var v=a.param;a.param=function(b,d){var e=a.ajaxSettings&&a.ajaxSettings.traditional;return void 0===d&&e&&(c("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),d=e),v.call(this,b,d)};var w=a.fn.andSelf||a.fn.addBack;a.fn.andSelf=function(){return c("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)};var x=a.Deferred,y=[["resolve","done",a.Callbacks("once memory"),a.Callbacks("once memory"),"resolved"],["reject","fail",a.Callbacks("once memory"),a.Callbacks("once memory"),"rejected"],["notify","progress",a.Callbacks("memory"),a.Callbacks("memory")]];a.Deferred=function(b){var d=x(),e=d.promise();return d.pipe=e.pipe=function(){var b=arguments;return c("deferred.pipe() is deprecated"),a.Deferred(function(c){a.each(y,function(f,g){var h=a.isFunction(b[f])&&b[f];d[g[1]](function(){var b=h&&h.apply(this,arguments);b&&a.isFunction(b.promise)?b.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[g[0]+"With"](this===e?c.promise():this,h?[b]:arguments)})}),b=null}).promise()},b&&b.call(d,d),d}}(jQuery,window); | holtkamp/cdnjs | ajax/libs/jquery-migrate/3.0.0-rc1/jquery-migrate.min.js | JavaScript | mit | 7,091 |
<?php
declare(strict_types=1);
namespace Phpml;
use Phpml\Exception\SerializeException;
use Phpml\Exception\FileException;
class ModelManager
{
/**
* @param Estimator $estimator
* @param string $filepath
*
* @throws FileException
* @throws SerializeException
*/
public function saveToFile(Estimator $estimator, string $filepath)
{
if (!is_writable(dirname($filepath))) {
throw FileException::cantSaveFile(basename($filepath));
}
$serialized = serialize($estimator);
if (empty($serialized)) {
throw SerializeException::cantSerialize(gettype($estimator));
}
$result = file_put_contents($filepath, $serialized, LOCK_EX);
if ($result === false) {
throw FileException::cantSaveFile(basename($filepath));
}
}
/**
* @param string $filepath
*
* @return Estimator
*
* @throws FileException
* @throws SerializeException
*/
public function restoreFromFile(string $filepath) : Estimator
{
if (!file_exists($filepath) || !is_readable($filepath)) {
throw FileException::cantOpenFile(basename($filepath));
}
$object = unserialize(file_get_contents($filepath));
if ($object === false) {
throw SerializeException::cantUnserialize(basename($filepath));
}
return $object;
}
}
| sharktek-nathan/CISC-662-Term-Project | php-ml/src/Phpml/ModelManager.php | PHP | mit | 1,438 |
/*!
* Fine Uploader
*
* Copyright 2015, Widen Enterprises, Inc. info@fineuploader.com
*
* Version: 5.8.0-beta1
*
* Homepage: http://fineuploader.com
*
* Repository: git://github.com/FineUploader/fine-uploader.git
*
* Licensed only under the Widen Commercial License (http://fineuploader.com/licensing).
*/
!function(global){var qq=function(a){"use strict";return{hide:function(){return a.style.display="none",this},attach:function(b,c){return a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c),function(){qq(a).detach(b,c)}},detach:function(b,c){return a.removeEventListener?a.removeEventListener(b,c,!1):a.attachEvent&&a.detachEvent("on"+b,c),this},contains:function(b){return b?a===b?!0:a.contains?a.contains(b):!!(8&b.compareDocumentPosition(a)):!1},insertBefore:function(b){return b.parentNode.insertBefore(a,b),this},remove:function(){return a.parentNode.removeChild(a),this},css:function(b){if(null==a.style)throw new qq.Error("Can't apply style to node as it is not on the HTMLElement prototype chain!");return null!=b.opacity&&"string"!=typeof a.style.opacity&&"undefined"!=typeof a.filters&&(b.filter="alpha(opacity="+Math.round(100*b.opacity)+")"),qq.extend(a.style,b),this},hasClass:function(b,c){var d=new RegExp("(^| )"+b+"( |$)");return d.test(a.className)||!(!c||!d.test(a.parentNode.className))},addClass:function(b){return qq(a).hasClass(b)||(a.className+=" "+b),this},removeClass:function(b){var c=new RegExp("(^| )"+b+"( |$)");return a.className=a.className.replace(c," ").replace(/^\s+|\s+$/g,""),this},getByClass:function(b,c){var d,e=[];return c&&a.querySelector?a.querySelector("."+b):a.querySelectorAll?a.querySelectorAll("."+b):(d=a.getElementsByTagName("*"),qq.each(d,function(a,c){qq(c).hasClass(b)&&e.push(c)}),c?e[0]:e)},getFirstByClass:function(b){return qq(a).getByClass(b,!0)},children:function(){for(var b=[],c=a.firstChild;c;)1===c.nodeType&&b.push(c),c=c.nextSibling;return b},setText:function(b){return a.innerText=b,a.textContent=b,this},clearText:function(){return qq(a).setText("")},hasAttribute:function(b){var c;return a.hasAttribute?a.hasAttribute(b)?null==/^false$/i.exec(a.getAttribute(b)):!1:(c=a[b],void 0===c?!1:null==/^false$/i.exec(c))}}};!function(){"use strict";qq.canvasToBlob=function(a,b,c){return qq.dataUriToBlob(a.toDataURL(b,c))},qq.dataUriToBlob=function(a){var b,c,d,e,f=function(a,b){var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,d=c&&new c;return d?(d.append(a),d.getBlob(b)):new Blob([a],{type:b})};return c=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURI(a.split(",")[1]),e=a.split(",")[0].split(":")[1].split(";")[0],b=new ArrayBuffer(c.length),d=new Uint8Array(b),qq.each(c,function(a,b){d[a]=b.charCodeAt(0)}),f(b,e)},qq.log=function(a,b){window.console&&(b&&"info"!==b?window.console[b]?window.console[b](a):window.console.log("<"+b+"> "+a):window.console.log(a))},qq.isObject=function(a){return a&&!a.nodeType&&"[object Object]"===Object.prototype.toString.call(a)},qq.isFunction=function(a){return"function"==typeof a},qq.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)||a&&window.ArrayBuffer&&a.buffer&&a.buffer.constructor===ArrayBuffer},qq.isItemList=function(a){return"[object DataTransferItemList]"===Object.prototype.toString.call(a)},qq.isNodeList=function(a){return"[object NodeList]"===Object.prototype.toString.call(a)||a.item&&a.namedItem},qq.isString=function(a){return"[object String]"===Object.prototype.toString.call(a)},qq.trimStr=function(a){return String.prototype.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},qq.format=function(a){var b=Array.prototype.slice.call(arguments,1),c=a,d=c.indexOf("{}");return qq.each(b,function(a,b){var e=c.substring(0,d),f=c.substring(d+2);return c=e+b+f,d=c.indexOf("{}",d+b.length),0>d?!1:void 0}),c},qq.isFile=function(a){return window.File&&"[object File]"===Object.prototype.toString.call(a)},qq.isFileList=function(a){return window.FileList&&"[object FileList]"===Object.prototype.toString.call(a)},qq.isFileOrInput=function(a){return qq.isFile(a)||qq.isInput(a)},qq.isInput=function(a,b){var c=function(a){var c=a.toLowerCase();return b?"file"!==c:"file"===c};return window.HTMLInputElement&&"[object HTMLInputElement]"===Object.prototype.toString.call(a)&&a.type&&c(a.type)?!0:a.tagName&&"input"===a.tagName.toLowerCase()&&a.type&&c(a.type)?!0:!1},qq.isBlob=function(a){return window.Blob&&"[object Blob]"===Object.prototype.toString.call(a)?!0:void 0},qq.isXhrUploadSupported=function(){var a=document.createElement("input");return a.type="file",void 0!==a.multiple&&"undefined"!=typeof File&&"undefined"!=typeof FormData&&"undefined"!=typeof qq.createXhrInstance().upload},qq.createXhrInstance=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(a){return qq.log("Neither XHR or ActiveX are supported!","error"),null}},qq.isFolderDropSupported=function(a){return a.items&&a.items.length>0&&a.items[0].webkitGetAsEntry},qq.isFileChunkingSupported=function(){return!qq.androidStock()&&qq.isXhrUploadSupported()&&(void 0!==File.prototype.slice||void 0!==File.prototype.webkitSlice||void 0!==File.prototype.mozSlice)},qq.sliceBlob=function(a,b,c){var d=a.slice||a.mozSlice||a.webkitSlice;return d.call(a,b,c)},qq.arrayBufferToHex=function(a){var b="",c=new Uint8Array(a);return qq.each(c,function(a,c){var d=c.toString(16);d.length<2&&(d="0"+d),b+=d}),b},qq.readBlobToHex=function(a,b,c){var d=qq.sliceBlob(a,b,b+c),e=new FileReader,f=new qq.Promise;return e.onload=function(){f.success(qq.arrayBufferToHex(e.result))},e.onerror=f.failure,e.readAsArrayBuffer(d),f},qq.extend=function(a,b,c){return qq.each(b,function(b,d){c&&qq.isObject(d)?(void 0===a[b]&&(a[b]={}),qq.extend(a[b],d,!0)):a[b]=d}),a},qq.override=function(a,b){var c={},d=b(c);return qq.each(d,function(b,d){void 0!==a[b]&&(c[b]=a[b]),a[b]=d}),a},qq.indexOf=function(a,b,c){if(a.indexOf)return a.indexOf(b,c);c=c||0;var d=a.length;for(0>c&&(c+=d);d>c;c+=1)if(a.hasOwnProperty(c)&&a[c]===b)return c;return-1},qq.getUniqueId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=0|16*Math.random(),c="x"==a?b:8|3&b;return c.toString(16)})},qq.ie=function(){return-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Trident")},qq.ie7=function(){return-1!==navigator.userAgent.indexOf("MSIE 7")},qq.ie8=function(){return-1!==navigator.userAgent.indexOf("MSIE 8")},qq.ie10=function(){return-1!==navigator.userAgent.indexOf("MSIE 10")},qq.ie11=function(){return qq.ie()&&-1!==navigator.userAgent.indexOf("rv:11")},qq.edge=function(){return navigator.userAgent.indexOf("Edge")>=0},qq.safari=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Apple")},qq.chrome=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Google")},qq.opera=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Opera")},qq.firefox=function(){return!qq.edge()&&!qq.ie11()&&-1!==navigator.userAgent.indexOf("Mozilla")&&void 0!==navigator.vendor&&""===navigator.vendor},qq.windows=function(){return"Win32"===navigator.platform},qq.android=function(){return-1!==navigator.userAgent.toLowerCase().indexOf("android")},qq.androidStock=function(){return qq.android()&&navigator.userAgent.toLowerCase().indexOf("chrome")<0},qq.ios6=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 6_")},qq.ios7=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 7_")},qq.ios8=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_")},qq.ios800=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_0 ")},qq.ios=function(){return-1!==navigator.userAgent.indexOf("iPad")||-1!==navigator.userAgent.indexOf("iPod")||-1!==navigator.userAgent.indexOf("iPhone")},qq.iosChrome=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf("CriOS")},qq.iosSafari=function(){return qq.ios()&&!qq.iosChrome()&&-1!==navigator.userAgent.indexOf("Safari")},qq.iosSafariWebView=function(){return qq.ios()&&!qq.iosChrome()&&!qq.iosSafari()},qq.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},qq.toElement=function(){var a=document.createElement("div");return function(b){a.innerHTML=b;var c=a.firstChild;return a.removeChild(c),c}}(),qq.each=function(a,b){var c,d;if(a)if(window.Storage&&a.constructor===window.Storage)for(c=0;c<a.length&&(d=b(a.key(c),a.getItem(a.key(c))),d!==!1);c++);else if(qq.isArray(a)||qq.isItemList(a)||qq.isNodeList(a))for(c=0;c<a.length&&(d=b(c,a[c]),d!==!1);c++);else if(qq.isString(a))for(c=0;c<a.length&&(d=b(c,a.charAt(c)),d!==!1);c++);else for(c in a)if(Object.prototype.hasOwnProperty.call(a,c)&&(d=b(c,a[c]),d===!1))break},qq.bind=function(a,b){if(qq.isFunction(a)){var c=Array.prototype.slice.call(arguments,2);return function(){var d=qq.extend([],c);return arguments.length&&(d=d.concat(Array.prototype.slice.call(arguments))),a.apply(b,d)}}throw new Error("first parameter must be a function!")},qq.obj2url=function(a,b,c){var d=[],e="&",f=function(a,c){var e=b?/\[\]$/.test(b)?b:b+"["+c+"]":c;"undefined"!==e&&"undefined"!==c&&d.push("object"==typeof a?qq.obj2url(a,e,!0):"[object Function]"===Object.prototype.toString.call(a)?encodeURIComponent(e)+"="+encodeURIComponent(a()):encodeURIComponent(e)+"="+encodeURIComponent(a))};return!c&&b?(e=/\?/.test(b)?/\?$/.test(b)?"":"&":"?",d.push(b),d.push(qq.obj2url(a))):"[object Array]"===Object.prototype.toString.call(a)&&"undefined"!=typeof a?qq.each(a,function(a,b){f(b,a)}):"undefined"!=typeof a&&null!==a&&"object"==typeof a?qq.each(a,function(a,b){f(b,a)}):d.push(encodeURIComponent(b)+"="+encodeURIComponent(a)),b?d.join(e):d.join(e).replace(/^&/,"").replace(/%20/g,"+")},qq.obj2FormData=function(a,b,c){return b||(b=new FormData),qq.each(a,function(a,d){a=c?c+"["+a+"]":a,qq.isObject(d)?qq.obj2FormData(d,b,a):qq.isFunction(d)?b.append(a,d()):b.append(a,d)}),b},qq.obj2Inputs=function(a,b){var c;return b||(b=document.createElement("form")),qq.obj2FormData(a,{append:function(a,d){c=document.createElement("input"),c.setAttribute("name",a),c.setAttribute("value",d),b.appendChild(c)}}),b},qq.parseJson=function(json){return window.JSON&&qq.isFunction(JSON.parse)?JSON.parse(json):eval("("+json+")")},qq.getExtension=function(a){var b=a.lastIndexOf(".")+1;return b>0?a.substr(b,a.length-b):void 0},qq.getFilename=function(a){return qq.isInput(a)?a.value.replace(/.*(\/|\\)/,""):qq.isFile(a)&&null!==a.fileName&&void 0!==a.fileName?a.fileName:a.name},qq.DisposeSupport=function(){var a=[];return{dispose:function(){var b;do b=a.shift(),b&&b();while(b)},attach:function(){var a=arguments;this.addDisposer(qq(a[0]).attach.apply(this,Array.prototype.slice.call(arguments,1)))},addDisposer:function(b){a.push(b)}}}}(),function(){"use strict";qq.Error=function(a){this.message="[Fine Uploader "+qq.version+"] "+a},qq.Error.prototype=new Error}(),qq.version="5.8.0-beta1",qq.supportedFeatures=function(){"use strict";function a(){var a,b=!0;try{a=document.createElement("input"),a.type="file",qq(a).hide(),a.disabled&&(b=!1)}catch(c){b=!1}return b}function b(){return(qq.chrome()||qq.opera())&&void 0!==navigator.userAgent.match(/Chrome\/[2][1-9]|Chrome\/[3-9][0-9]/)}function c(){return(qq.chrome()||qq.opera())&&void 0!==navigator.userAgent.match(/Chrome\/[1][4-9]|Chrome\/[2-9][0-9]/)}function d(){if(window.XMLHttpRequest){var a=qq.createXhrInstance();return void 0!==a.withCredentials}return!1}function e(){return void 0!==window.XDomainRequest}function f(){return d()?!0:e()}function g(){return void 0!==document.createElement("input").webkitdirectory}function h(){try{return!!window.localStorage&&qq.isFunction(window.localStorage.setItem)}catch(a){return!1}}function i(){var a=document.createElement("span");return("draggable"in a||"ondragstart"in a&&"ondrop"in a)&&!qq.android()&&!qq.ios()}var j,k,l,m,n,o,p,q,r,s,t,u,v,w,x;return j=a(),m=j&&qq.isXhrUploadSupported(),k=m&&!qq.androidStock(),l=m&&i(),n=l&&b(),o=m&&qq.isFileChunkingSupported(),p=m&&o&&h(),q=m&&c(),r=j&&(void 0!==window.postMessage||m),t=d(),s=e(),u=f(),v=g(),w=m&&void 0!==window.FileReader,x=function(){return m?!qq.androidStock()&&!qq.iosChrome():!1}(),{ajaxUploading:m,blobUploading:k,canDetermineSize:m,chunking:o,deleteFileCors:u,deleteFileCorsXdr:s,deleteFileCorsXhr:t,dialogElement:!!window.HTMLDialogElement,fileDrop:l,folderDrop:n,folderSelection:v,imagePreviews:w,imageValidation:w,itemSizeValidation:m,pause:o,progressBar:x,resume:p,scaling:w&&k,tiffPreviews:qq.safari(),unlimitedScaledImageSize:!qq.ios(),uploading:j,uploadCors:r,uploadCustomHeaders:m,uploadNonMultipart:m,uploadViaPaste:q}}(),qq.isGenericPromise=function(a){"use strict";return!!(a&&a.then&&qq.isFunction(a.then))},qq.Promise=function(){"use strict";var a,b,c=[],d=[],e=[],f=0;qq.extend(this,{then:function(e,g){return 0===f?(e&&c.push(e),g&&d.push(g)):-1===f?g&&g.apply(null,b):e&&e.apply(null,a),this},done:function(c){return 0===f?e.push(c):c.apply(null,void 0===b?a:b),this},success:function(){return f=1,a=arguments,c.length&&qq.each(c,function(b,c){c.apply(null,a)}),e.length&&qq.each(e,function(b,c){c.apply(null,a)}),this},failure:function(){return f=-1,b=arguments,d.length&&qq.each(d,function(a,c){c.apply(null,b)}),e.length&&qq.each(e,function(a,c){c.apply(null,b)}),this}})},qq.BlobProxy=function(a,b){"use strict";qq.extend(this,{referenceBlob:a,create:function(){return b(a)}})},qq.UploadButton=function(a){"use strict";function b(){var a=document.createElement("input");return a.setAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME,d),a.setAttribute("title",g.title),e.setMultiple(g.multiple,a),g.folders&&qq.supportedFeatures.folderSelection&&a.setAttribute("webkitdirectory",""),g.acceptFiles&&a.setAttribute("accept",g.acceptFiles),a.setAttribute("type","file"),a.setAttribute("name",g.name),qq(a).css({position:"absolute",right:0,top:0,fontFamily:"Arial",fontSize:qq.ie()&&!qq.ie8()?"3500px":"118px",margin:0,padding:0,cursor:"pointer",opacity:0}),!qq.ie7()&&qq(a).css({height:"100%"}),g.element.appendChild(a),f.attach(a,"change",function(){g.onChange(a)}),f.attach(a,"mouseover",function(){qq(g.element).addClass(g.hoverClass)}),f.attach(a,"mouseout",function(){qq(g.element).removeClass(g.hoverClass)}),f.attach(a,"focus",function(){qq(g.element).addClass(g.focusClass)}),f.attach(a,"blur",function(){qq(g.element).removeClass(g.focusClass)}),a}var c,d,e=this,f=new qq.DisposeSupport,g={acceptFiles:null,element:null,focusClass:"qq-upload-button-focus",folders:!1,hoverClass:"qq-upload-button-hover",ios8BrowserCrashWorkaround:!1,multiple:!1,name:"qqfile",onChange:function(){},title:null};qq.extend(g,a),d=qq.getUniqueId(),qq(g.element).css({position:"relative",overflow:"hidden",direction:"ltr"}),qq.extend(this,{getInput:function(){return c},getButtonId:function(){return d},setMultiple:function(a,b){var c=b||this.getInput();g.ios8BrowserCrashWorkaround&&qq.ios8()&&(qq.iosChrome()||qq.iosSafariWebView())?c.setAttribute("multiple",""):a?c.setAttribute("multiple",""):c.removeAttribute("multiple")},setAcceptFiles:function(a){a!==g.acceptFiles&&c.setAttribute("accept",a)},reset:function(){c.parentNode&&qq(c).remove(),qq(g.element).removeClass(g.focusClass),c=null,c=b()}}),c=b()},qq.UploadButton.BUTTON_ID_ATTR_NAME="qq-button-id",qq.UploadData=function(a){"use strict";function b(a){if(qq.isArray(a)){var b=[];return qq.each(a,function(a,c){b.push(e[c])}),b}return e[a]}function c(a){if(qq.isArray(a)){var b=[];return qq.each(a,function(a,c){b.push(e[f[c]])}),b}return e[f[a]]}function d(a){var b=[],c=[].concat(a);return qq.each(c,function(a,c){var d=g[c];void 0!==d&&qq.each(d,function(a,c){b.push(e[c])})}),b}var e=[],f={},g={},h={},i={};qq.extend(this,{addFile:function(b){var c=b.status||qq.status.SUBMITTING,d=e.push({name:b.name,originalName:b.name,uuid:b.uuid,size:null==b.size?-1:b.size,status:c})-1;return b.batchId&&(e[d].batchId=b.batchId,void 0===i[b.batchId]&&(i[b.batchId]=[]),i[b.batchId].push(d)),b.proxyGroupId&&(e[d].proxyGroupId=b.proxyGroupId,void 0===h[b.proxyGroupId]&&(h[b.proxyGroupId]=[]),h[b.proxyGroupId].push(d)),e[d].id=d,f[b.uuid]=d,void 0===g[c]&&(g[c]=[]),g[c].push(d),a.onStatusChange(d,null,c),d},retrieve:function(a){return qq.isObject(a)&&e.length?void 0!==a.id?b(a.id):void 0!==a.uuid?c(a.uuid):a.status?d(a.status):void 0:qq.extend([],e,!0)},reset:function(){e=[],f={},g={},i={}},setStatus:function(b,c){var d=e[b].status,f=qq.indexOf(g[d],b);g[d].splice(f,1),e[b].status=c,void 0===g[c]&&(g[c]=[]),g[c].push(b),a.onStatusChange(b,d,c)},uuidChanged:function(a,b){var c=e[a].uuid;e[a].uuid=b,f[b]=a,delete f[c]},updateName:function(a,b){e[a].name=b},updateSize:function(a,b){e[a].size=b},setParentId:function(a,b){e[a].parentId=b},getIdsInProxyGroup:function(a){var b=e[a].proxyGroupId;return b?h[b]:[]},getIdsInBatch:function(a){var b=e[a].batchId;return i[b]}})},qq.status={SUBMITTING:"submitting",SUBMITTED:"submitted",REJECTED:"rejected",QUEUED:"queued",CANCELED:"canceled",PAUSED:"paused",UPLOADING:"uploading",UPLOAD_RETRYING:"retrying upload",UPLOAD_SUCCESSFUL:"upload successful",UPLOAD_FAILED:"upload failed",DELETE_FAILED:"delete failed",DELETING:"deleting",DELETED:"deleted"},function(){"use strict";qq.basePublicApi={addBlobs:function(a,b,c){this.addFiles(a,b,c)},addInitialFiles:function(a){var b=this;qq.each(a,function(a,c){b._addCannedFile(c)})},addFiles:function(a,b,c){this._maybeHandleIos8SafariWorkaround();var d=0===this._storedIds.length?qq.getUniqueId():this._currentBatchId,e=qq.bind(function(a){this._handleNewFile({blob:a,name:this._options.blobs.defaultName},d,l)},this),f=qq.bind(function(a){this._handleNewFile(a,d,l)},this),g=qq.bind(function(a){var b=qq.canvasToBlob(a);this._handleNewFile({blob:b,name:this._options.blobs.defaultName+".png"},d,l)},this),h=qq.bind(function(a){var b=a.quality&&a.quality/100,c=qq.canvasToBlob(a.canvas,a.type,b);this._handleNewFile({blob:c,name:a.name},d,l)},this),i=qq.bind(function(a){if(qq.isInput(a)&&qq.supportedFeatures.ajaxUploading){var b=Array.prototype.slice.call(a.files),c=this;qq.each(b,function(a,b){c._handleNewFile(b,d,l)})}else this._handleNewFile(a,d,l)},this),j=function(){qq.isFileList(a)&&(a=Array.prototype.slice.call(a)),a=[].concat(a)},k=this,l=[];this._currentBatchId=d,a&&(j(),qq.each(a,function(a,b){qq.isFileOrInput(b)?i(b):qq.isBlob(b)?e(b):qq.isObject(b)?b.blob&&b.name?f(b):b.canvas&&b.name&&h(b):b.tagName&&"canvas"===b.tagName.toLowerCase()?g(b):k.log(b+" is not a valid file container! Ignoring!","warn")}),this.log("Received "+l.length+" files."),this._prepareItemsForUpload(l,b,c))},cancel:function(a){this._handler.cancel(a)},cancelAll:function(){var a=[],b=this;qq.extend(a,this._storedIds),qq.each(a,function(a,c){b.cancel(c)}),this._handler.cancelAll()},clearStoredFiles:function(){this._storedIds=[]},continueUpload:function(a){var b=this._uploadData.retrieve({id:a});return qq.supportedFeatures.pause&&this._options.chunking.enabled?b.status===qq.status.PAUSED?(this.log(qq.format("Paused file ID {} ({}) will be continued. Not paused.",a,this.getName(a))),this._uploadFile(a),!0):(this.log(qq.format("Ignoring continue for file ID {} ({}). Not paused.",a,this.getName(a)),"error"),!1):!1},deleteFile:function(a){return this._onSubmitDelete(a)},doesExist:function(a){return this._handler.isValid(a)},drawThumbnail:function(a,b,c,d){var e,f,g=new qq.Promise;return this._imageGenerator?(e=this._thumbnailUrls[a],f={scale:c>0,maxSize:c>0?c:null},!d&&qq.supportedFeatures.imagePreviews&&(e=this.getFile(a)),null==e?g.failure({container:b,error:"File or URL not found."}):this._imageGenerator.generate(e,b,f).then(function(a){g.success(a)},function(a,b){g.failure({container:a,error:b||"Problem generating thumbnail"})})):g.failure({container:b,error:"Missing image generator module"}),g},getButton:function(a){return this._getButton(this._buttonIdsForFileIds[a])},getEndpoint:function(a){return this._endpointStore.get(a)},getFile:function(a){return this._handler.getFile(a)||null},getInProgress:function(){return this._uploadData.retrieve({status:[qq.status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED]}).length},getName:function(a){return this._uploadData.retrieve({id:a}).name},getParentId:function(a){var b=this.getUploads({id:a}),c=null;return b&&void 0!==b.parentId&&(c=b.parentId),c},getResumableFilesData:function(){return this._handler.getResumableFilesData()},getSize:function(a){return this._uploadData.retrieve({id:a}).size},getNetUploads:function(){return this._netUploaded},getRemainingAllowedItems:function(){var a=this._currentItemLimit;return a>0?a-this._netUploadedOrQueued:null},getUploads:function(a){return this._uploadData.retrieve(a)},getUuid:function(a){return this._uploadData.retrieve({id:a}).uuid},log:function(a,b){!this._options.debug||b&&"info"!==b?b&&"info"!==b&&qq.log("[Fine Uploader "+qq.version+"] "+a,b):qq.log("[Fine Uploader "+qq.version+"] "+a)},pauseUpload:function(a){var b=this._uploadData.retrieve({id:a});if(!qq.supportedFeatures.pause||!this._options.chunking.enabled)return!1;if(qq.indexOf([qq.status.UPLOADING,qq.status.UPLOAD_RETRYING],b.status)>=0){if(this._handler.pause(a))return this._uploadData.setStatus(a,qq.status.PAUSED),!0;this.log(qq.format("Unable to pause file ID {} ({}).",a,this.getName(a)),"error")}else this.log(qq.format("Ignoring pause for file ID {} ({}). Not in progress.",a,this.getName(a)),"error");return!1},reset:function(){this.log("Resetting uploader..."),this._handler.reset(),this._storedIds=[],this._autoRetries=[],this._retryTimeouts=[],this._preventRetries=[],this._thumbnailUrls=[],qq.each(this._buttons,function(a,b){b.reset()}),this._paramsStore.reset(),this._endpointStore.reset(),this._netUploadedOrQueued=0,this._netUploaded=0,this._uploadData.reset(),this._buttonIdsForFileIds=[],this._pasteHandler&&this._pasteHandler.reset(),this._options.session.refreshOnReset&&this._refreshSessionData(),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[],this._totalProgress&&this._totalProgress.reset()},retry:function(a){return this._manualRetry(a)},scaleImage:function(a,b){var c=this;return qq.Scaler.prototype.scaleImage(a,b,{log:qq.bind(c.log,c),getFile:qq.bind(c.getFile,c),uploadData:c._uploadData})},setCustomHeaders:function(a,b){this._customHeadersStore.set(a,b)},setDeleteFileCustomHeaders:function(a,b){this._deleteFileCustomHeadersStore.set(a,b)},setDeleteFileEndpoint:function(a,b){this._deleteFileEndpointStore.set(a,b)},setDeleteFileParams:function(a,b){this._deleteFileParamsStore.set(a,b)},setEndpoint:function(a,b){this._endpointStore.set(a,b)},setForm:function(a){this._updateFormSupportAndParams(a)},setItemLimit:function(a){this._currentItemLimit=a},setName:function(a,b){this._uploadData.updateName(a,b)},setParams:function(a,b){this._paramsStore.set(a,b)},setUuid:function(a,b){return this._uploadData.uuidChanged(a,b)},uploadStoredFiles:function(){0===this._storedIds.length?this._itemError("noFilesError"):this._uploadStoredFiles()}},qq.basePrivateApi={_addCannedFile:function(a){var b=this._uploadData.addFile({uuid:a.uuid,name:a.name,size:a.size,status:qq.status.UPLOAD_SUCCESSFUL});return a.deleteFileEndpoint&&this.setDeleteFileEndpoint(a.deleteFileEndpoint,b),a.deleteFileParams&&this.setDeleteFileParams(a.deleteFileParams,b),a.thumbnailUrl&&(this._thumbnailUrls[b]=a.thumbnailUrl),this._netUploaded++,this._netUploadedOrQueued++,b},_annotateWithButtonId:function(a,b){qq.isFile(a)&&(a.qqButtonId=this._getButtonId(b))},_batchError:function(a){this._options.callbacks.onError(null,null,a,void 0)},_createDeleteHandler:function(){var a=this;return new qq.DeleteFileAjaxRequester({method:this._options.deleteFile.method.toUpperCase(),maxConnections:this._options.maxConnections,uuidParamName:this._options.request.uuidName,customHeaders:this._deleteFileCustomHeadersStore,paramsStore:this._deleteFileParamsStore,endpointStore:this._deleteFileEndpointStore,cors:this._options.cors,log:qq.bind(a.log,a),onDelete:function(b){a._onDelete(b),a._options.callbacks.onDelete(b)},onDeleteComplete:function(b,c,d){a._onDeleteComplete(b,c,d),a._options.callbacks.onDeleteComplete(b,c,d)}})},_createPasteHandler:function(){var a=this;return new qq.PasteSupport({targetElement:this._options.paste.targetElement,callbacks:{log:qq.bind(a.log,a),pasteReceived:function(b){a._handleCheckedCallback({name:"onPasteReceived",callback:qq.bind(a._options.callbacks.onPasteReceived,a,b),onSuccess:qq.bind(a._handlePasteSuccess,a,b),identifier:"pasted image"})}}})},_createStore:function(a,b){var c={},d=a,e={},f=b,g=function(a){return qq.isObject(a)?qq.extend({},a):a},h=function(){return qq.isFunction(f)?f():f},i=function(a,b){f&&qq.isObject(b)&&qq.extend(b,h()),e[a]&&qq.extend(b,e[a])};return{set:function(a,b){null==b?(c={},d=g(a)):c[b]=g(a)},get:function(a){var b;return b=null!=a&&c[a]?c[a]:g(d),i(a,b),g(b)},addReadOnly:function(a,b){qq.isObject(c)&&(null===a?qq.isFunction(b)?f=b:(f=f||{},qq.extend(f,b)):(e[a]=e[a]||{},qq.extend(e[a],b)))},remove:function(a){return delete c[a]},reset:function(){c={},e={},d=a}}},_createUploadDataTracker:function(){var a=this;return new qq.UploadData({getName:function(b){return a.getName(b)},getUuid:function(b){return a.getUuid(b)},getSize:function(b){return a.getSize(b)},onStatusChange:function(b,c,d){a._onUploadStatusChange(b,c,d),a._options.callbacks.onStatusChange(b,c,d),a._maybeAllComplete(b,d),a._totalProgress&&setTimeout(function(){a._totalProgress.onStatusChange(b,c,d)},0)}})},_createUploadButton:function(a){function b(){return qq.supportedFeatures.ajaxUploading?d._options.workarounds.iosEmptyVideos&&qq.ios()&&!qq.ios6()&&d._isAllowedExtension(f,".mov")?!1:void 0===a.multiple?d._options.multiple:a.multiple:!1}var c,d=this,e=a.accept||this._options.validation.acceptFiles,f=a.allowedExtensions||this._options.validation.allowedExtensions;return c=new qq.UploadButton({acceptFiles:e,element:a.element,focusClass:this._options.classes.buttonFocus,folders:a.folders,hoverClass:this._options.classes.buttonHover,ios8BrowserCrashWorkaround:this._options.workarounds.ios8BrowserCrash,multiple:b(),name:this._options.request.inputName,onChange:function(a){d._onInputChange(a)},title:null==a.title?this._options.text.fileInputTitle:a.title}),this._disposeSupport.addDisposer(function(){c.dispose()}),d._buttons.push(c),c},_createUploadHandler:function(a,b){var c=this,d={},e={debug:this._options.debug,maxConnections:this._options.maxConnections,cors:this._options.cors,paramsStore:this._paramsStore,endpointStore:this._endpointStore,chunking:this._options.chunking,resume:this._options.resume,blobs:this._options.blobs,log:qq.bind(c.log,c),preventRetryParam:this._options.retry.preventRetryResponseProperty,onProgress:function(a,b,e,f){0>e||0>f||(d[a]?(d[a].loaded!==e||d[a].total!==f)&&(c._onProgress(a,b,e,f),c._options.callbacks.onProgress(a,b,e,f)):(c._onProgress(a,b,e,f),c._options.callbacks.onProgress(a,b,e,f)),d[a]={loaded:e,total:f})},onComplete:function(a,b,e,f){delete d[a];var g,h=c.getUploads({id:a}).status;h!==qq.status.UPLOAD_SUCCESSFUL&&h!==qq.status.UPLOAD_FAILED&&(g=c._onComplete(a,b,e,f),g instanceof qq.Promise?g.done(function(){c._options.callbacks.onComplete(a,b,e,f)}):c._options.callbacks.onComplete(a,b,e,f))},onCancel:function(a,b,d){var e=new qq.Promise;return c._handleCheckedCallback({name:"onCancel",callback:qq.bind(c._options.callbacks.onCancel,c,a,b),onFailure:e.failure,onSuccess:function(){d.then(function(){c._onCancel(a,b)}),e.success()},identifier:a}),e},onUploadPrep:qq.bind(this._onUploadPrep,this),onUpload:function(a,b){c._onUpload(a,b),c._options.callbacks.onUpload(a,b)},onUploadChunk:function(a,b,d){c._onUploadChunk(a,d),c._options.callbacks.onUploadChunk(a,b,d)},onUploadChunkSuccess:function(){c._options.callbacks.onUploadChunkSuccess.apply(c,arguments)},onResume:function(a,b,d){return c._options.callbacks.onResume(a,b,d)},onAutoRetry:function(){return c._onAutoRetry.apply(c,arguments)},onUuidChanged:function(a,b){c.log("Server requested UUID change from '"+c.getUuid(a)+"' to '"+b+"'"),c.setUuid(a,b)},getName:qq.bind(c.getName,c),getUuid:qq.bind(c.getUuid,c),getSize:qq.bind(c.getSize,c),setSize:qq.bind(c._setSize,c),getDataByUuid:function(a){return c.getUploads({uuid:a})},isQueued:function(a){var b=c.getUploads({id:a}).status;return b===qq.status.QUEUED||b===qq.status.SUBMITTED||b===qq.status.UPLOAD_RETRYING||b===qq.status.PAUSED},getIdsInProxyGroup:c._uploadData.getIdsInProxyGroup,getIdsInBatch:c._uploadData.getIdsInBatch};return qq.each(this._options.request,function(a,b){e[a]=b}),e.customHeaders=this._customHeadersStore,a&&qq.each(a,function(a,b){e[a]=b}),new qq.UploadHandlerController(e,b)},_fileOrBlobRejected:function(a){this._netUploadedOrQueued--,this._uploadData.setStatus(a,qq.status.REJECTED)},_formatSize:function(a){var b=-1;do a/=1e3,b++;while(a>999);return Math.max(a,.1).toFixed(1)+this._options.text.sizeSymbols[b]},_generateExtraButtonSpecs:function(){var a=this;this._extraButtonSpecs={},qq.each(this._options.extraButtons,function(b,c){var d=c.multiple,e=qq.extend({},a._options.validation,!0),f=qq.extend({},c);void 0===d&&(d=a._options.multiple),f.validation&&qq.extend(e,c.validation,!0),qq.extend(f,{multiple:d,validation:e},!0),a._initExtraButton(f)})},_getButton:function(a){var b=this._extraButtonSpecs[a];return b?b.element:a===this._defaultButtonId?this._options.button:void 0},_getButtonId:function(a){var b,c,d=a;if(d instanceof qq.BlobProxy&&(d=d.referenceBlob),d&&!qq.isBlob(d)){if(qq.isFile(d))return d.qqButtonId;if("input"===d.tagName.toLowerCase()&&"file"===d.type.toLowerCase())return d.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME);if(b=d.getElementsByTagName("input"),qq.each(b,function(a,b){return"file"===b.getAttribute("type")?(c=b,!1):void 0}),c)return c.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME)}},_getNotFinished:function(){return this._uploadData.retrieve({status:[qq.status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED,qq.status.SUBMITTING,qq.status.SUBMITTED,qq.status.PAUSED]}).length},_getValidationBase:function(a){var b=this._extraButtonSpecs[a];return b?b.validation:this._options.validation},_getValidationDescriptor:function(a){return a.file instanceof qq.BlobProxy?{name:qq.getFilename(a.file.referenceBlob),size:a.file.referenceBlob.size}:{name:this.getUploads({id:a.id}).name,size:this.getUploads({id:a.id}).size}},_getValidationDescriptors:function(a){var b=this,c=[];return qq.each(a,function(a,d){c.push(b._getValidationDescriptor(d))}),c},_handleCameraAccess:function(){if(this._options.camera.ios&&qq.ios()){var a="image/*;capture=camera",b=this._options.camera.button,c=b?this._getButtonId(b):this._defaultButtonId,d=this._options;c&&c!==this._defaultButtonId&&(d=this._extraButtonSpecs[c]),d.multiple=!1,null===d.validation.acceptFiles?d.validation.acceptFiles=a:d.validation.acceptFiles+=","+a,qq.each(this._buttons,function(a,b){return b.getButtonId()===c?(b.setMultiple(d.multiple),b.setAcceptFiles(d.acceptFiles),!1):void 0})}},_handleCheckedCallback:function(a){var b=this,c=a.callback();return qq.isGenericPromise(c)?(this.log(a.name+" - waiting for "+a.name+" promise to be fulfilled for "+a.identifier),c.then(function(c){b.log(a.name+" promise success for "+a.identifier),a.onSuccess(c)},function(){a.onFailure?(b.log(a.name+" promise failure for "+a.identifier),a.onFailure()):b.log(a.name+" promise failure for "+a.identifier)})):(c!==!1?a.onSuccess(c):a.onFailure?(this.log(a.name+" - return value was 'false' for "+a.identifier+". Invoking failure callback."),a.onFailure()):this.log(a.name+" - return value was 'false' for "+a.identifier+". Will not proceed."),c)},_handleNewFile:function(a,b,c){var d=this,e=qq.getUniqueId(),f=-1,g=qq.getFilename(a),h=a.blob||a,i=this._customNewFileHandler?this._customNewFileHandler:qq.bind(d._handleNewFileGeneric,d);!qq.isInput(h)&&h.size>=0&&(f=h.size),i(h,g,e,f,c,b,this._options.request.uuidName,{uploadData:d._uploadData,paramsStore:d._paramsStore,addFileToHandler:function(a,b){d._handler.add(a,b),d._netUploadedOrQueued++,d._trackButton(a)}})},_handleNewFileGeneric:function(a,b,c,d,e,f){var g=this._uploadData.addFile({uuid:c,name:b,size:d,batchId:f});this._handler.add(g,a),this._trackButton(g),this._netUploadedOrQueued++,e.push({id:g,file:a})},_handlePasteSuccess:function(a,b){var c=a.type.split("/")[1],d=b;
null==d&&(d=this._options.paste.defaultName),d+="."+c,this.addFiles({name:d,blob:a})},_initExtraButton:function(a){var b=this._createUploadButton({accept:a.validation.acceptFiles,allowedExtensions:a.validation.allowedExtensions,element:a.element,folders:a.folders,multiple:a.multiple,title:a.fileInputTitle});this._extraButtonSpecs[b.getButtonId()]=a},_initFormSupportAndParams:function(){this._formSupport=qq.FormSupport&&new qq.FormSupport(this._options.form,qq.bind(this.uploadStoredFiles,this),qq.bind(this.log,this)),this._formSupport&&this._formSupport.attachedToForm?(this._paramsStore=this._createStore(this._options.request.params,this._formSupport.getFormInputsAsObject),this._options.autoUpload=this._formSupport.newAutoUpload,this._formSupport.newEndpoint&&(this._options.request.endpoint=this._formSupport.newEndpoint)):this._paramsStore=this._createStore(this._options.request.params)},_isDeletePossible:function(){return qq.DeleteFileAjaxRequester&&this._options.deleteFile.enabled?this._options.cors.expected?qq.supportedFeatures.deleteFileCorsXhr?!0:qq.supportedFeatures.deleteFileCorsXdr&&this._options.cors.allowXdr?!0:!1:!0:!1},_isAllowedExtension:function(a,b){var c=!1;return a.length?(qq.each(a,function(a,d){if(qq.isString(d)){var e=new RegExp("\\."+d+"$","i");if(null!=b.match(e))return c=!0,!1}}),c):!0},_itemError:function(a,b,c){function d(a,b){g=g.replace(a,b)}var e,f,g=this._options.messages[a],h=[],i=[].concat(b),j=i[0],k=this._getButtonId(c),l=this._getValidationBase(k);return qq.each(l.allowedExtensions,function(a,b){qq.isString(b)&&h.push(b)}),e=h.join(", ").toLowerCase(),d("{file}",this._options.formatFileName(j)),d("{extensions}",e),d("{sizeLimit}",this._formatSize(l.sizeLimit)),d("{minSizeLimit}",this._formatSize(l.minSizeLimit)),f=g.match(/(\{\w+\})/g),null!==f&&qq.each(f,function(a,b){d(b,i[a])}),this._options.callbacks.onError(null,j,g,void 0),g},_manualRetry:function(a,b){return this._onBeforeManualRetry(a)?(this._netUploadedOrQueued++,this._uploadData.setStatus(a,qq.status.UPLOAD_RETRYING),b?b(a):this._handler.retry(a),!0):void 0},_maybeAllComplete:function(a,b){var c=this,d=this._getNotFinished();b===qq.status.UPLOAD_SUCCESSFUL?this._succeededSinceLastAllComplete.push(a):b===qq.status.UPLOAD_FAILED&&this._failedSinceLastAllComplete.push(a),0===d&&(this._succeededSinceLastAllComplete.length||this._failedSinceLastAllComplete.length)&&setTimeout(function(){c._onAllComplete(c._succeededSinceLastAllComplete,c._failedSinceLastAllComplete)},0)},_maybeHandleIos8SafariWorkaround:function(){var a=this;if(this._options.workarounds.ios8SafariUploads&&qq.ios800()&&qq.iosSafari())throw setTimeout(function(){window.alert(a._options.messages.unsupportedBrowserIos8Safari)},0),new qq.Error(this._options.messages.unsupportedBrowserIos8Safari)},_maybeParseAndSendUploadError:function(a,b,c,d){if(!c.success)if(d&&200!==d.status&&!c.error)this._options.callbacks.onError(a,b,"XHR returned response code "+d.status,d);else{var e=c.error?c.error:this._options.text.defaultResponseError;this._options.callbacks.onError(a,b,e,d)}},_maybeProcessNextItemAfterOnValidateCallback:function(a,b,c,d,e){var f=this;if(b.length>c)if(a||!this._options.validation.stopOnFirstInvalidFile)setTimeout(function(){var a=f._getValidationDescriptor(b[c]),g=f._getButtonId(b[c].file),h=f._getButton(g);f._handleCheckedCallback({name:"onValidate",callback:qq.bind(f._options.callbacks.onValidate,f,a,h),onSuccess:qq.bind(f._onValidateCallbackSuccess,f,b,c,d,e),onFailure:qq.bind(f._onValidateCallbackFailure,f,b,c,d,e),identifier:"Item '"+a.name+"', size: "+a.size})},0);else if(!a)for(;c<b.length;c++)f._fileOrBlobRejected(b[c].id)},_onAllComplete:function(a,b){this._totalProgress&&this._totalProgress.onAllComplete(a,b,this._preventRetries),this._options.callbacks.onAllComplete(qq.extend([],a),qq.extend([],b)),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[]},_onAutoRetry:function(a,b,c,d,e){var f=this;return f._preventRetries[a]=c[f._options.retry.preventRetryResponseProperty],f._shouldAutoRetry(a,b,c)?(f._maybeParseAndSendUploadError.apply(f,arguments),f._options.callbacks.onAutoRetry(a,b,f._autoRetries[a]),f._onBeforeAutoRetry(a,b),f._retryTimeouts[a]=setTimeout(function(){f.log("Retrying "+b+"..."),f._uploadData.setStatus(a,qq.status.UPLOAD_RETRYING),e?e(a):f._handler.retry(a)},1e3*f._options.retry.autoAttemptDelay),!0):void 0},_onBeforeAutoRetry:function(a,b){this.log("Waiting "+this._options.retry.autoAttemptDelay+" seconds before retrying "+b+"...")},_onBeforeManualRetry:function(a){var b,c=this._currentItemLimit;return this._preventRetries[a]?(this.log("Retries are forbidden for id "+a,"warn"),!1):this._handler.isValid(a)?(b=this.getName(a),this._options.callbacks.onManualRetry(a,b)===!1?!1:c>0&&this._netUploadedOrQueued+1>c?(this._itemError("retryFailTooManyItems"),!1):(this.log("Retrying upload for '"+b+"' (id: "+a+")..."),!0)):(this.log("'"+a+"' is not a valid file ID","error"),!1)},_onCancel:function(a){this._netUploadedOrQueued--,clearTimeout(this._retryTimeouts[a]);var b=qq.indexOf(this._storedIds,a);!this._options.autoUpload&&b>=0&&this._storedIds.splice(b,1),this._uploadData.setStatus(a,qq.status.CANCELED)},_onComplete:function(a,b,c,d){return c.success?(c.thumbnailUrl&&(this._thumbnailUrls[a]=c.thumbnailUrl),this._netUploaded++,this._uploadData.setStatus(a,qq.status.UPLOAD_SUCCESSFUL)):(this._netUploadedOrQueued--,this._uploadData.setStatus(a,qq.status.UPLOAD_FAILED),c[this._options.retry.preventRetryResponseProperty]===!0&&(this._preventRetries[a]=!0)),this._maybeParseAndSendUploadError(a,b,c,d),c.success?!0:!1},_onDelete:function(a){this._uploadData.setStatus(a,qq.status.DELETING)},_onDeleteComplete:function(a,b,c){var d=this.getName(a);c?(this._uploadData.setStatus(a,qq.status.DELETE_FAILED),this.log("Delete request for '"+d+"' has failed.","error"),void 0===b.withCredentials?this._options.callbacks.onError(a,d,"Delete request failed",b):this._options.callbacks.onError(a,d,"Delete request failed with response code "+b.status,b)):(this._netUploadedOrQueued--,this._netUploaded--,this._handler.expunge(a),this._uploadData.setStatus(a,qq.status.DELETED),this.log("Delete request for '"+d+"' has succeeded."))},_onInputChange:function(a){var b;if(qq.supportedFeatures.ajaxUploading){for(b=0;b<a.files.length;b++)this._annotateWithButtonId(a.files[b],a);this.addFiles(a.files)}else a.value.length>0&&this.addFiles(a);qq.each(this._buttons,function(a,b){b.reset()})},_onProgress:function(a,b,c,d){this._totalProgress&&this._totalProgress.onIndividualProgress(a,c,d)},_onSubmit:function(){},_onSubmitCallbackSuccess:function(a){this._onSubmit.apply(this,arguments),this._uploadData.setStatus(a,qq.status.SUBMITTED),this._onSubmitted.apply(this,arguments),this._options.autoUpload?(this._options.callbacks.onSubmitted.apply(this,arguments),this._uploadFile(a)):(this._storeForLater(a),this._options.callbacks.onSubmitted.apply(this,arguments))},_onSubmitDelete:function(a,b,c){var d,e=this.getUuid(a);return b&&(d=qq.bind(b,this,a,e,c)),this._isDeletePossible()?(this._handleCheckedCallback({name:"onSubmitDelete",callback:qq.bind(this._options.callbacks.onSubmitDelete,this,a),onSuccess:d||qq.bind(this._deleteHandler.sendDelete,this,a,e,c),identifier:a}),!0):(this.log("Delete request ignored for ID "+a+", delete feature is disabled or request not possible "+"due to CORS on a user agent that does not support pre-flighting.","warn"),!1)},_onSubmitted:function(){},_onTotalProgress:function(a,b){this._options.callbacks.onTotalProgress(a,b)},_onUploadPrep:function(){},_onUpload:function(a){this._uploadData.setStatus(a,qq.status.UPLOADING)},_onUploadChunk:function(){},_onUploadStatusChange:function(a,b,c){c===qq.status.PAUSED&&clearTimeout(this._retryTimeouts[a])},_onValidateBatchCallbackFailure:function(a){var b=this;qq.each(a,function(a,c){b._fileOrBlobRejected(c.id)})},_onValidateBatchCallbackSuccess:function(a,b,c,d,e){var f,g=this._currentItemLimit,h=this._netUploadedOrQueued;0===g||g>=h?b.length>0?this._handleCheckedCallback({name:"onValidate",callback:qq.bind(this._options.callbacks.onValidate,this,a[0],e),onSuccess:qq.bind(this._onValidateCallbackSuccess,this,b,0,c,d),onFailure:qq.bind(this._onValidateCallbackFailure,this,b,0,c,d),identifier:"Item '"+b[0].file.name+"', size: "+b[0].file.size}):this._itemError("noFilesError"):(this._onValidateBatchCallbackFailure(b),f=this._options.messages.tooManyItemsError.replace(/\{netItems\}/g,h).replace(/\{itemLimit\}/g,g),this._batchError(f))},_onValidateCallbackFailure:function(a,b,c,d){var e=b+1;this._fileOrBlobRejected(a[b].id,a[b].file.name),this._maybeProcessNextItemAfterOnValidateCallback(!1,a,e,c,d)},_onValidateCallbackSuccess:function(a,b,c,d){var e=this,f=b+1,g=this._getValidationDescriptor(a[b]);this._validateFileOrBlobData(a[b],g).then(function(){e._upload(a[b].id,c,d),e._maybeProcessNextItemAfterOnValidateCallback(!0,a,f,c,d)},function(){e._maybeProcessNextItemAfterOnValidateCallback(!1,a,f,c,d)})},_prepareItemsForUpload:function(a,b,c){if(0===a.length)return this._itemError("noFilesError"),void 0;var d=this._getValidationDescriptors(a),e=this._getButtonId(a[0].file),f=this._getButton(e);this._handleCheckedCallback({name:"onValidateBatch",callback:qq.bind(this._options.callbacks.onValidateBatch,this,d,f),onSuccess:qq.bind(this._onValidateBatchCallbackSuccess,this,d,a,b,c,f),onFailure:qq.bind(this._onValidateBatchCallbackFailure,this,a),identifier:"batch validation"})},_preventLeaveInProgress:function(){var a=this;this._disposeSupport.attach(window,"beforeunload",function(b){return a.getInProgress()?(b=b||window.event,b.returnValue=a._options.messages.onLeave,a._options.messages.onLeave):void 0})},_refreshSessionData:function(){var a=this,b=this._options.session;qq.Session&&null!=this._options.session.endpoint&&(this._session||(qq.extend(b,this._options.cors),b.log=qq.bind(this.log,this),b.addFileRecord=qq.bind(this._addCannedFile,this),this._session=new qq.Session(b)),setTimeout(function(){a._session.refresh().then(function(b,c){a._sessionRequestComplete(),a._options.callbacks.onSessionRequestComplete(b,!0,c)},function(b,c){a._options.callbacks.onSessionRequestComplete(b,!1,c)})},0))},_sessionRequestComplete:function(){},_setSize:function(a,b){this._uploadData.updateSize(a,b),this._totalProgress&&this._totalProgress.onNewSize(a)},_shouldAutoRetry:function(a){var b=this._uploadData.retrieve({id:a});return!this._preventRetries[a]&&this._options.retry.enableAuto&&b.status!==qq.status.PAUSED&&(void 0===this._autoRetries[a]&&(this._autoRetries[a]=0),this._autoRetries[a]<this._options.retry.maxAutoAttempts)?(this._autoRetries[a]+=1,!0):!1},_storeForLater:function(a){this._storedIds.push(a)},_trackButton:function(a){var b;b=qq.supportedFeatures.ajaxUploading?this._handler.getFile(a).qqButtonId:this._getButtonId(this._handler.getInput(a)),b&&(this._buttonIdsForFileIds[a]=b)},_updateFormSupportAndParams:function(a){this._options.form.element=a,this._formSupport=qq.FormSupport&&new qq.FormSupport(this._options.form,qq.bind(this.uploadStoredFiles,this),qq.bind(this.log,this)),this._formSupport&&this._formSupport.attachedToForm&&(this._paramsStore.addReadOnly(null,this._formSupport.getFormInputsAsObject),this._options.autoUpload=this._formSupport.newAutoUpload,this._formSupport.newEndpoint&&this.setEndpoint(this._formSupport.newEndpoint))},_upload:function(a,b,c){var d=this.getName(a);b&&this.setParams(b,a),c&&this.setEndpoint(c,a),this._handleCheckedCallback({name:"onSubmit",callback:qq.bind(this._options.callbacks.onSubmit,this,a,d),onSuccess:qq.bind(this._onSubmitCallbackSuccess,this,a,d),onFailure:qq.bind(this._fileOrBlobRejected,this,a,d),identifier:a})},_uploadFile:function(a){this._handler.upload(a)||this._uploadData.setStatus(a,qq.status.QUEUED)},_uploadStoredFiles:function(){for(var a,b,c=this;this._storedIds.length;)a=this._storedIds.shift(),this._uploadFile(a);b=this.getUploads({status:qq.status.SUBMITTING}).length,b&&(qq.log("Still waiting for "+b+" files to clear submit queue. Will re-parse stored IDs array shortly."),setTimeout(function(){c._uploadStoredFiles()},1e3))},_validateFileOrBlobData:function(a,b){var c=this,d=function(){return a.file instanceof qq.BlobProxy?a.file.referenceBlob:a.file}(),e=b.name,f=b.size,g=this._getButtonId(a.file),h=this._getValidationBase(g),i=new qq.Promise;return i.then(function(){},function(){c._fileOrBlobRejected(a.id,e)}),qq.isFileOrInput(d)&&!this._isAllowedExtension(h.allowedExtensions,e)?(this._itemError("typeError",e,d),i.failure()):0===f?(this._itemError("emptyError",e,d),i.failure()):f>0&&h.sizeLimit&&f>h.sizeLimit?(this._itemError("sizeError",e,d),i.failure()):f>0&&f<h.minSizeLimit?(this._itemError("minSizeError",e,d),i.failure()):(qq.ImageValidation&&qq.supportedFeatures.imagePreviews&&qq.isFile(d)?new qq.ImageValidation(d,qq.bind(c.log,c)).validate(h.image).then(i.success,function(a){c._itemError(a+"ImageError",e,d),i.failure()}):i.success(),i)},_wrapCallbacks:function(){var a,b,c;a=this,b=function(b,c,d){var e;try{return c.apply(a,d)}catch(f){e=f.message||f.toString(),a.log("Caught exception in '"+b+"' callback - "+e,"error")}};for(c in this._options.callbacks)!function(){var d,e;d=c,e=a._options.callbacks[d],a._options.callbacks[d]=function(){return b(d,e,arguments)}}()}}}(),function(){"use strict";qq.FineUploaderBasic=function(a){var b=this;this._options={debug:!1,button:null,multiple:!0,maxConnections:3,disableCancelForFormUploads:!1,autoUpload:!0,request:{customHeaders:{},endpoint:"/server/upload",filenameParam:"qqfilename",forceMultipart:!0,inputName:"qqfile",method:"POST",params:{},paramsInBody:!0,totalFileSizeName:"qqtotalfilesize",uuidName:"qquuid"},validation:{allowedExtensions:[],sizeLimit:0,minSizeLimit:0,itemLimit:0,stopOnFirstInvalidFile:!0,acceptFiles:null,image:{maxHeight:0,maxWidth:0,minHeight:0,minWidth:0}},callbacks:{onSubmit:function(){},onSubmitted:function(){},onComplete:function(){},onAllComplete:function(){},onCancel:function(){},onUpload:function(){},onUploadChunk:function(){},onUploadChunkSuccess:function(){},onResume:function(){},onProgress:function(){},onTotalProgress:function(){},onError:function(){},onAutoRetry:function(){},onManualRetry:function(){},onValidateBatch:function(){},onValidate:function(){},onSubmitDelete:function(){},onDelete:function(){},onDeleteComplete:function(){},onPasteReceived:function(){},onStatusChange:function(){},onSessionRequestComplete:function(){}},messages:{typeError:"{file} has an invalid extension. Valid extension(s): {extensions}.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",noFilesError:"No files to upload.",tooManyItemsError:"Too many items ({netItems}) would be uploaded. Item limit is {itemLimit}.",maxHeightImageError:"Image is too tall.",maxWidthImageError:"Image is too wide.",minHeightImageError:"Image is not tall enough.",minWidthImageError:"Image is not wide enough.",retryFailTooManyItems:"Retry failed - you have reached your file limit.",onLeave:"The files are being uploaded, if you leave now the upload will be canceled.",unsupportedBrowserIos8Safari:"Unrecoverable error - this browser does not permit file uploading of any kind due to serious bugs in iOS8 Safari. Please use iOS8 Chrome until Apple fixes these issues."},retry:{enableAuto:!1,maxAutoAttempts:3,autoAttemptDelay:5,preventRetryResponseProperty:"preventRetry"},classes:{buttonHover:"qq-upload-button-hover",buttonFocus:"qq-upload-button-focus"},chunking:{enabled:!1,concurrent:{enabled:!1},mandatory:!1,paramNames:{partIndex:"qqpartindex",partByteOffset:"qqpartbyteoffset",chunkSize:"qqchunksize",totalFileSize:"qqtotalfilesize",totalParts:"qqtotalparts"},partSize:2e6,success:{endpoint:null}},resume:{enabled:!1,recordsExpireIn:7,paramNames:{resuming:"qqresume"}},formatFileName:function(a){return a},text:{defaultResponseError:"Upload failure reason unknown",fileInputTitle:"file input",sizeSymbols:["kB","MB","GB","TB","PB","EB"]},deleteFile:{enabled:!1,method:"DELETE",endpoint:"/server/upload",customHeaders:{},params:{}},cors:{expected:!1,sendCredentials:!1,allowXdr:!1},blobs:{defaultName:"misc_data"},paste:{targetElement:null,defaultName:"pasted_image"},camera:{ios:!1,button:null},extraButtons:[],session:{endpoint:null,params:{},customHeaders:{},refreshOnReset:!0},form:{element:"qq-form",autoUpload:!1,interceptSubmit:!0},scaling:{sendOriginal:!0,orient:!0,defaultType:null,defaultQuality:80,failureText:"Failed to scale",includeExif:!1,sizes:[]},workarounds:{iosEmptyVideos:!0,ios8SafariUploads:!0,ios8BrowserCrash:!1}},qq.extend(this._options,a,!0),this._buttons=[],this._extraButtonSpecs={},this._buttonIdsForFileIds=[],this._wrapCallbacks(),this._disposeSupport=new qq.DisposeSupport,this._storedIds=[],this._autoRetries=[],this._retryTimeouts=[],this._preventRetries=[],this._thumbnailUrls=[],this._netUploadedOrQueued=0,this._netUploaded=0,this._uploadData=this._createUploadDataTracker(),this._initFormSupportAndParams(),this._customHeadersStore=this._createStore(this._options.request.customHeaders),this._deleteFileCustomHeadersStore=this._createStore(this._options.deleteFile.customHeaders),this._deleteFileParamsStore=this._createStore(this._options.deleteFile.params),this._endpointStore=this._createStore(this._options.request.endpoint),this._deleteFileEndpointStore=this._createStore(this._options.deleteFile.endpoint),this._handler=this._createUploadHandler(),this._deleteHandler=qq.DeleteFileAjaxRequester&&this._createDeleteHandler(),this._options.button&&(this._defaultButtonId=this._createUploadButton({element:this._options.button,title:this._options.text.fileInputTitle}).getButtonId()),this._generateExtraButtonSpecs(),this._handleCameraAccess(),this._options.paste.targetElement&&(qq.PasteSupport?this._pasteHandler=this._createPasteHandler():this.log("Paste support module not found","error")),this._preventLeaveInProgress(),this._imageGenerator=qq.ImageGenerator&&new qq.ImageGenerator(qq.bind(this.log,this)),this._refreshSessionData(),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[],this._scaler=qq.Scaler&&new qq.Scaler(this._options.scaling,qq.bind(this.log,this))||{},this._scaler.enabled&&(this._customNewFileHandler=qq.bind(this._scaler.handleNewFile,this._scaler)),qq.TotalProgress&&qq.supportedFeatures.progressBar&&(this._totalProgress=new qq.TotalProgress(qq.bind(this._onTotalProgress,this),function(a){var c=b._uploadData.retrieve({id:a});return c&&c.size||0})),this._currentItemLimit=this._options.validation.itemLimit},qq.FineUploaderBasic.prototype=qq.basePublicApi,qq.extend(qq.FineUploaderBasic.prototype,qq.basePrivateApi)}(),qq.AjaxRequester=function(a){"use strict";function b(){return qq.indexOf(["GET","POST","HEAD"],w.method)>=0}function c(){var a=!1;return qq.each(a,function(b,c){return qq.indexOf(["Accept","Accept-Language","Content-Language","Content-Type"],c)<0?(a=!0,!1):void 0}),a}function d(a){return w.cors.expected&&void 0===a.withCredentials}function e(){var a;return(window.XMLHttpRequest||window.ActiveXObject)&&(a=qq.createXhrInstance(),void 0===a.withCredentials&&(a=new XDomainRequest,a.onload=function(){},a.onerror=function(){},a.ontimeout=function(){},a.onprogress=function(){})),a}function f(a,b){var c=v[a].xhr;return c||(c=b?b:w.cors.expected?e():qq.createXhrInstance(),v[a].xhr=c),c}function g(a){var b,c=qq.indexOf(u,a),d=w.maxConnections;delete v[a],u.splice(c,1),u.length>=d&&d>c&&(b=u[d-1],j(b))}function h(a,b){var c=f(a),e=w.method,h=b===!0;g(a),h?s(e+" request for "+a+" has failed","error"):d(c)||q(c.status)||(h=!0,s(e+" request for "+a+" has failed - response code "+c.status,"error")),w.onComplete(a,c,h)}function i(a){var b,c=v[a].additionalParams,d=w.mandatedParams;return w.paramsStore.get&&(b=w.paramsStore.get(a)),c&&qq.each(c,function(a,c){b=b||{},b[a]=c}),d&&qq.each(d,function(a,c){b=b||{},b[a]=c}),b}function j(a,b){var c,e=f(a,b),g=w.method,h=i(a),j=v[a].payload;return w.onSend(a),c=k(a,h,v[a].additionalQueryParams),d(e)?(e.onload=n(a),e.onerror=o(a)):e.onreadystatechange=l(a),m(a),e.open(g,c,!0),w.cors.expected&&w.cors.sendCredentials&&!d(e)&&(e.withCredentials=!0),p(a),s("Sending "+g+" request for "+a),j?e.send(j):t||!h?e.send():h&&w.contentType&&w.contentType.toLowerCase().indexOf("application/x-www-form-urlencoded")>=0?e.send(qq.obj2url(h,"")):h&&w.contentType&&w.contentType.toLowerCase().indexOf("application/json")>=0?e.send(JSON.stringify(h)):e.send(h),e}function k(a,b,c){var d=w.endpointStore.get(a),e=v[a].addToPath;return void 0!=e&&(d+="/"+e),t&&b&&(d=qq.obj2url(b,d)),c&&(d=qq.obj2url(c,d)),d}function l(a){return function(){4===f(a).readyState&&h(a)}}function m(a){var b=w.onProgress;b&&(f(a).upload.onprogress=function(c){c.lengthComputable&&b(a,c.loaded,c.total)})}function n(a){return function(){h(a)}}function o(a){return function(){h(a,!0)}}function p(a){var e=f(a),g=w.customHeaders,h=v[a].additionalHeaders||{},i=w.method,j={};d(e)||(w.acceptHeader&&e.setRequestHeader("Accept",w.acceptHeader),w.allowXRequestedWithAndCacheControl&&(w.cors.expected&&b()&&!c(g)||(e.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.setRequestHeader("Cache-Control","no-cache"))),!w.contentType||"POST"!==i&&"PUT"!==i||e.setRequestHeader("Content-Type",w.contentType),qq.extend(j,qq.isFunction(g)?g(a):g),qq.extend(j,h),qq.each(j,function(a,b){e.setRequestHeader(a,b)}))}function q(a){return qq.indexOf(w.successfulResponseCodes[w.method],a)>=0}function r(a,b,c,d,e,f,g){v[a]={addToPath:c,additionalParams:d,additionalQueryParams:e,additionalHeaders:f,payload:g};var h=u.push(a);return h<=w.maxConnections?j(a,b):void 0}var s,t,u=[],v={},w={acceptHeader:null,validMethods:["PATCH","POST","PUT"],method:"POST",contentType:"application/x-www-form-urlencoded",maxConnections:3,customHeaders:{},endpointStore:{},paramsStore:{},mandatedParams:{},allowXRequestedWithAndCacheControl:!0,successfulResponseCodes:{DELETE:[200,202,204],PATCH:[200,201,202,203,204],POST:[200,201,202,203,204],PUT:[200,201,202,203,204],GET:[200]},cors:{expected:!1,sendCredentials:!1},log:function(){},onSend:function(){},onComplete:function(){},onProgress:null};if(qq.extend(w,a),s=w.log,qq.indexOf(w.validMethods,w.method)<0)throw new Error("'"+w.method+"' is not a supported method for this type of request!");t="GET"===w.method||"DELETE"===w.method,qq.extend(this,{initTransport:function(a){var b,c,d,e,f,g;return{withPath:function(a){return b=a,this},withParams:function(a){return c=a,this},withQueryParams:function(a){return g=a,this},withHeaders:function(a){return d=a,this},withPayload:function(a){return e=a,this},withCacheBuster:function(){return f=!0,this},send:function(h){return f&&qq.indexOf(["GET","DELETE"],w.method)>=0&&(c.qqtimestamp=(new Date).getTime()),r(a,h,b,c,g,d,e)}}},canceled:function(a){g(a)}})},qq.UploadHandler=function(a){"use strict";var b=a.proxy,c={},d=b.onCancel,e=b.getName;qq.extend(this,{add:function(a,b){c[a]=b,c[a].temp={}},cancel:function(a){var b=this,f=new qq.Promise,g=d(a,e(a),f);g.then(function(){b.isValid(a)&&(c[a].canceled=!0,b.expunge(a)),f.success()})},expunge:function(a){delete c[a]},getThirdPartyFileId:function(a){return c[a].key},isValid:function(a){return void 0!==c[a]},reset:function(){c={}},_getFileState:function(a){return c[a]},_setThirdPartyFileId:function(a,b){c[a].key=b},_wasCanceled:function(a){return!!c[a].canceled}})},qq.UploadHandlerController=function(a,b){"use strict";var c,d,e,f=this,g=!1,h=!1,i={paramsStore:{},maxConnections:3,chunking:{enabled:!1,multiple:{enabled:!1}},log:function(){},onProgress:function(){},onComplete:function(){},onCancel:function(){},onUploadPrep:function(){},onUpload:function(){},onUploadChunk:function(){},onUploadChunkSuccess:function(){},onAutoRetry:function(){},onResume:function(){},onUuidChanged:function(){},getName:function(){},setSize:function(){},isQueued:function(){},getIdsInProxyGroup:function(){},getIdsInBatch:function(){}},j={done:function(a,b,c,d){var f=e._getChunkData(a,b);e._getFileState(a).attemptingResume=!1,delete e._getFileState(a).temp.chunkProgress[b],e._getFileState(a).loaded+=f.size,i.onUploadChunkSuccess(a,e._getChunkDataForCallback(f),c,d)},finalize:function(a){var b=i.getSize(a),c=i.getName(a);d("All chunks have been uploaded for "+a+" - finalizing...."),e.finalizeChunks(a).then(function(f,g){d("Finalize successful for "+a);var h=m.normalizeResponse(f,!0);i.onProgress(a,c,b,b),e._maybeDeletePersistedChunkData(a),m.cleanup(a,h,g)},function(b,e){var f=m.normalizeResponse(b,!1);d("Problem finalizing chunks for file ID "+a+" - "+f.error,"error"),f.reset&&j.reset(a),i.onAutoRetry(a,c,f,e)||m.cleanup(a,f,e)})},hasMoreParts:function(a){return!!e._getFileState(a).chunking.remaining.length},nextPart:function(a){var b=e._getFileState(a).chunking.remaining.shift();return b>=e._getTotalChunks(a)&&(b=null),b},reset:function(a){d("Server or callback has ordered chunking effort to be restarted on next attempt for item ID "+a,"error"),e._maybeDeletePersistedChunkData(a),e.reevaluateChunking(a),e._getFileState(a).loaded=0},sendNext:function(a){var b=i.getSize(a),c=i.getName(a),f=j.nextPart(a),g=e._getChunkData(a,f),l=e._getFileState(a).attemptingResume,n=e._getFileState(a).chunking.inProgress||[];null==e._getFileState(a).loaded&&(e._getFileState(a).loaded=0),l&&i.onResume(a,c,g)===!1&&(j.reset(a),f=j.nextPart(a),g=e._getChunkData(a,f),l=!1),null==f&&0===n.length?j.finalize(a):(d(qq.format("Sending chunked upload request for item {}.{}, bytes {}-{} of {}.",a,f,g.start+1,g.end,b)),i.onUploadChunk(a,c,e._getChunkDataForCallback(g)),n.push(f),e._getFileState(a).chunking.inProgress=n,h&&k.open(a,f),h&&k.available()&&e._getFileState(a).chunking.remaining.length&&j.sendNext(a),e.uploadChunk(a,f,l).then(function(b,c){d("Chunked upload request succeeded for "+a+", chunk "+f),e.clearCachedChunk(a,f);var g=e._getFileState(a).chunking.inProgress||[],h=m.normalizeResponse(b,!0),i=qq.indexOf(g,f);d(qq.format("Chunk {} for file {} uploaded successfully.",f,a)),j.done(a,f,h,c),i>=0&&g.splice(i,1),e._maybePersistChunkedState(a),j.hasMoreParts(a)||0!==g.length?j.hasMoreParts(a)?j.sendNext(a):d(qq.format("File ID {} has no more chunks to send and these chunk indexes are still marked as in-progress: {}",a,JSON.stringify(g))):j.finalize(a)},function(b,g){d("Chunked upload request failed for "+a+", chunk "+f),e.clearCachedChunk(a,f);var l,n=m.normalizeResponse(b,!1);n.reset?j.reset(a):(l=qq.indexOf(e._getFileState(a).chunking.inProgress,f),l>=0&&(e._getFileState(a).chunking.inProgress.splice(l,1),e._getFileState(a).chunking.remaining.unshift(f))),e._getFileState(a).temp.ignoreFailure||(h&&(e._getFileState(a).temp.ignoreFailure=!0,d(qq.format("Going to attempt to abort these chunks: {}. These are currently in-progress: {}.",JSON.stringify(Object.keys(e._getXhrs(a))),JSON.stringify(e._getFileState(a).chunking.inProgress))),qq.each(e._getXhrs(a),function(b,c){d(qq.format("Attempting to abort file {}.{}. XHR readyState {}. ",a,b,c.readyState)),c.abort(),c._cancelled=!0}),e.moveInProgressToRemaining(a),k.free(a,!0)),i.onAutoRetry(a,c,n,g)||m.cleanup(a,n,g))}).done(function(){e.clearXhr(a,f)}))}},k={_open:[],_openChunks:{},_waiting:[],available:function(){var a=i.maxConnections,b=0,c=0;return qq.each(k._openChunks,function(a,d){b++,c+=d.length}),a-(k._open.length-b+c)},free:function(a,b){var c,f=!b,g=qq.indexOf(k._waiting,a),h=qq.indexOf(k._open,a);delete k._openChunks[a],m.getProxyOrBlob(a)instanceof qq.BlobProxy&&(d("Generated blob upload has ended for "+a+", disposing generated blob."),delete e._getFileState(a).file),g>=0?k._waiting.splice(g,1):f&&h>=0&&(k._open.splice(h,1),c=k._waiting.shift(),c>=0&&(k._open.push(c),m.start(c)))},getWaitingOrConnected:function(){var a=[];return qq.each(k._openChunks,function(b,c){c&&c.length&&a.push(parseInt(b))}),qq.each(k._open,function(b,c){k._openChunks[c]||a.push(parseInt(c))}),a=a.concat(k._waiting)},isUsingConnection:function(a){return qq.indexOf(k._open,a)>=0},open:function(a,b){return null==b&&k._waiting.push(a),k.available()?(null==b?(k._waiting.pop(),k._open.push(a)):function(){var c=k._openChunks[a]||[];c.push(b),k._openChunks[a]=c}(),!0):!1},reset:function(){k._waiting=[],k._open=[]}},l={send:function(a,b){e._getFileState(a).loaded=0,d("Sending simple upload request for "+a),e.uploadFile(a).then(function(c,e){d("Simple upload request succeeded for "+a);var f=m.normalizeResponse(c,!0),g=i.getSize(a);i.onProgress(a,b,g,g),m.maybeNewUuid(a,f),m.cleanup(a,f,e)},function(c,e){d("Simple upload request failed for "+a);var f=m.normalizeResponse(c,!1);i.onAutoRetry(a,b,f,e)||m.cleanup(a,f,e)})}},m={cancel:function(a){d("Cancelling "+a),i.paramsStore.remove(a),k.free(a)},cleanup:function(a,b,c){var d=i.getName(a);i.onComplete(a,d,b,c),e._getFileState(a)&&e._clearXhrs&&e._clearXhrs(a),k.free(a)},getProxyOrBlob:function(a){return e.getProxy&&e.getProxy(a)||e.getFile&&e.getFile(a)},initHandler:function(){var a=b?qq[b]:qq.traditional,c=qq.supportedFeatures.ajaxUploading?"Xhr":"Form";e=new a[c+"UploadHandler"](i,{getDataByUuid:i.getDataByUuid,getName:i.getName,getSize:i.getSize,getUuid:i.getUuid,log:d,onCancel:i.onCancel,onProgress:i.onProgress,onUuidChanged:i.onUuidChanged}),e._removeExpiredChunkingRecords&&e._removeExpiredChunkingRecords()},isDeferredEligibleForUpload:function(a){return i.isQueued(a)},maybeDefer:function(a,b){return b&&!e.getFile(a)&&b instanceof qq.BlobProxy?(i.onUploadPrep(a),d("Attempting to generate a blob on-demand for "+a),b.create().then(function(b){d("Generated an on-demand blob for "+a),e.updateBlob(a,b),i.setSize(a,b.size),e.reevaluateChunking(a),m.maybeSendDeferredFiles(a)},function(b){var e={};b&&(e.error=b),d(qq.format("Failed to generate blob for ID {}. Error message: {}.",a,b),"error"),i.onComplete(a,i.getName(a),qq.extend(e,c),null),m.maybeSendDeferredFiles(a),k.free(a)}),!1):m.maybeSendDeferredFiles(a)},maybeSendDeferredFiles:function(a){var b=i.getIdsInProxyGroup(a),c=!1;return b&&b.length?(d("Maybe ready to upload proxy group file "+a),qq.each(b,function(b,d){if(m.isDeferredEligibleForUpload(d)&&e.getFile(d))c=d===a,m.now(d);else if(m.isDeferredEligibleForUpload(d))return!1})):(c=!0,m.now(a)),c},maybeNewUuid:function(a,b){void 0!==b.newUuid&&i.onUuidChanged(a,b.newUuid)},normalizeResponse:function(a,b){var c=a;return qq.isObject(a)||(c={},qq.isString(a)&&!b&&(c.error=a)),c.success=b,c},now:function(a){var b=i.getName(a);if(!f.isValid(a))throw new qq.Error(a+" is not a valid file ID to upload!");i.onUpload(a,b),g&&e._shouldChunkThisFile(a)?j.sendNext(a):l.send(a,b)},start:function(a){var b=m.getProxyOrBlob(a);return b?m.maybeDefer(a,b):(m.now(a),!0)}};qq.extend(this,{add:function(){e.add.apply(this,arguments)},upload:function(a){return k.open(a)?m.start(a):!1},retry:function(a){return h&&(e._getFileState(a).temp.ignoreFailure=!1),k.isUsingConnection(a)?m.start(a):f.upload(a)},cancel:function(a){var b=e.cancel(a);qq.isGenericPromise(b)?b.then(function(){m.cancel(a)}):b!==!1&&m.cancel(a)},cancelAll:function(){var a,b=k.getWaitingOrConnected();if(b.length)for(a=b.length-1;a>=0;a--)f.cancel(b[a]);k.reset()},getFile:function(a){return e.getProxy&&e.getProxy(a)?e.getProxy(a).referenceBlob:e.getFile&&e.getFile(a)},isProxied:function(a){return!(!e.getProxy||!e.getProxy(a))},getInput:function(a){return e.getInput?e.getInput(a):void 0},reset:function(){d("Resetting upload handler"),f.cancelAll(),k.reset(),e.reset()},expunge:function(a){return f.isValid(a)?e.expunge(a):void 0},isValid:function(a){return e.isValid(a)},getResumableFilesData:function(){return e.getResumableFilesData?e.getResumableFilesData():[]},getThirdPartyFileId:function(a){return f.isValid(a)?e.getThirdPartyFileId(a):void 0},pause:function(a){return f.isResumable(a)&&e.pause&&f.isValid(a)&&e.pause(a)?(k.free(a),e.moveInProgressToRemaining(a),!0):!1},isResumable:function(a){return!!e.isResumable&&e.isResumable(a)}}),qq.extend(i,a),d=i.log,g=i.chunking.enabled&&qq.supportedFeatures.chunking,h=g&&i.chunking.concurrent.enabled,c=function(){var a={};
return a[i.preventRetryParam]=!0,a}(),m.initHandler()},qq.FormUploadHandler=function(a){"use strict";function b(a){delete k[a],m&&(clearTimeout(l[a]),delete l[a],q.stopReceivingMessages(a));var b=document.getElementById(g._getIframeName(a));b&&(b.setAttribute("src","javascript:false;"),qq(b).remove())}function c(a){return a.split("_")[0]}function d(a){var b=qq.toElement("<iframe src='javascript:false;' name='"+a+"' />");return b.setAttribute("id",a),b.style.display="none",document.body.appendChild(b),b}function e(a,b){var d=a.id,e=c(d),f=o(e);j[f]=b,k[e]=qq(a).attach("load",function(){g.getInput(e)&&(p("Received iframe load event for CORS upload request (iframe name "+d+")"),l[d]=setTimeout(function(){var a="No valid message received from loaded iframe for iframe name "+d;p(a,"error"),b({error:a})},1e3))}),q.receiveMessage(d,function(a){p("Received the following window message: '"+a+"'");var b,e=(c(d),g._parseJsonResponse(a)),f=e.uuid;f&&j[f]?(p("Handling response for iframe name "+d),clearTimeout(l[d]),delete l[d],g._detachLoadEvent(d),b=j[f],delete j[f],q.stopReceivingMessages(d),b(e)):f||p("'"+a+"' does not contain a UUID - ignoring.")})}var f=a.options,g=this,h=a.proxy,i=qq.getUniqueId(),j={},k={},l={},m=f.isCors,n=f.inputName,o=h.getUuid,p=h.log,q=new qq.WindowReceiveMessage({log:p});qq.extend(this,new qq.UploadHandler(a)),qq.override(this,function(a){return{add:function(b,c){a.add(b,{input:c}),c.setAttribute("name",n),c.parentNode&&qq(c).remove()},expunge:function(c){b(c),a.expunge(c)},isValid:function(b){return a.isValid(b)&&void 0!==g._getFileState(b).input}}}),qq.extend(this,{getInput:function(a){return g._getFileState(a).input},_attachLoadEvent:function(a,b){var c;m?e(a,b):k[a.id]=qq(a).attach("load",function(){if(p("Received response for "+a.id),a.parentNode){try{if(a.contentDocument&&a.contentDocument.body&&"false"==a.contentDocument.body.innerHTML)return}catch(d){p("Error when attempting to access iframe during handling of upload response ("+d.message+")","error"),c={success:!1}}b(c)}})},_createIframe:function(a){var b=g._getIframeName(a);return d(b)},_detachLoadEvent:function(a){void 0!==k[a]&&(k[a](),delete k[a])},_getIframeName:function(a){return a+"_"+i},_initFormForUpload:function(a){var b=a.method,c=a.endpoint,d=a.params,e=a.paramsInBody,f=a.targetName,g=qq.toElement("<form method='"+b+"' enctype='multipart/form-data'></form>"),h=c;return e?qq.obj2Inputs(d,g):h=qq.obj2url(d,c),g.setAttribute("action",h),g.setAttribute("target",f),g.style.display="none",document.body.appendChild(g),g},_parseJsonResponse:function(a){var b={};try{b=qq.parseJson(a)}catch(c){p("Error when attempting to parse iframe upload response ("+c.message+")","error")}return b}})},qq.XhrUploadHandler=function(a){"use strict";function b(a){qq.each(c._getXhrs(a),function(b,d){var e=c._getAjaxRequester(a,b);d.onreadystatechange=null,d.upload.onprogress=null,d.abort(),e&&e.canceled&&e.canceled(a)})}var c=this,d=a.options.namespace,e=a.proxy,f=a.options.chunking,g=a.options.resume,h=f&&a.options.chunking.enabled&&qq.supportedFeatures.chunking,i=g&&a.options.resume.enabled&&h&&qq.supportedFeatures.resume,j=e.getName,k=e.getSize,l=e.getUuid,m=e.getEndpoint,n=e.getDataByUuid,o=e.onUuidChanged,p=e.onProgress,q=e.log;qq.extend(this,new qq.UploadHandler(a)),qq.override(this,function(a){return{add:function(b,d){if(qq.isFile(d)||qq.isBlob(d))a.add(b,{file:d});else{if(!(d instanceof qq.BlobProxy))throw new Error("Passed obj is not a File, Blob, or proxy");a.add(b,{proxy:d})}c._initTempState(b),i&&c._maybePrepareForResume(b)},expunge:function(d){b(d),c._maybeDeletePersistedChunkData(d),c._clearXhrs(d),a.expunge(d)}}}),qq.extend(this,{clearCachedChunk:function(a,b){delete c._getFileState(a).temp.cachedChunks[b]},clearXhr:function(a,b){var d=c._getFileState(a).temp;d.xhrs&&delete d.xhrs[b],d.ajaxRequesters&&delete d.ajaxRequesters[b]},finalizeChunks:function(a,b){var d=c._getTotalChunks(a)-1,e=c._getXhr(a,d);return b?(new qq.Promise).success(b(e),e):(new qq.Promise).success({},e)},getFile:function(a){return c.isValid(a)&&c._getFileState(a).file},getProxy:function(a){return c.isValid(a)&&c._getFileState(a).proxy},getResumableFilesData:function(){var a=[];return c._iterateResumeRecords(function(b,d){c.moveInProgressToRemaining(null,d.chunking.inProgress,d.chunking.remaining);var e={name:d.name,remaining:d.chunking.remaining,size:d.size,uuid:d.uuid};d.key&&(e.key=d.key),a.push(e)}),a},isResumable:function(a){return!!f&&c.isValid(a)&&!c._getFileState(a).notResumable},moveInProgressToRemaining:function(a,b,d){var e=b||c._getFileState(a).chunking.inProgress,f=d||c._getFileState(a).chunking.remaining;e&&(q(qq.format("Moving these chunks from in-progress {}, to remaining.",JSON.stringify(e))),e.reverse(),qq.each(e,function(a,b){f.unshift(b)}),e.length=0)},pause:function(a){return c.isValid(a)?(q(qq.format("Aborting XHR upload for {} '{}' due to pause instruction.",a,j(a))),c._getFileState(a).paused=!0,b(a),!0):void 0},reevaluateChunking:function(a){if(f&&c.isValid(a)){var b,d,e=c._getFileState(a);if(delete e.chunking,e.chunking={},b=c._getTotalChunks(a),b>1||f.mandatory){for(e.chunking.enabled=!0,e.chunking.parts=b,e.chunking.remaining=[],d=0;b>d;d++)e.chunking.remaining.push(d);c._initTempState(a)}else e.chunking.enabled=!1}},updateBlob:function(a,b){c.isValid(a)&&(c._getFileState(a).file=b)},_clearXhrs:function(a){var b=c._getFileState(a).temp;qq.each(b.ajaxRequesters,function(a){delete b.ajaxRequesters[a]}),qq.each(b.xhrs,function(a){delete b.xhrs[a]})},_createXhr:function(a,b){return c._registerXhr(a,b,qq.createXhrInstance())},_getAjaxRequester:function(a,b){var d=null==b?-1:b;return c._getFileState(a).temp.ajaxRequesters[d]},_getChunkData:function(a,b){var d=f.partSize,e=k(a),g=c.getFile(a),h=d*b,i=h+d>=e?e:h+d,j=c._getTotalChunks(a),l=this._getFileState(a).temp.cachedChunks,m=l[b]||qq.sliceBlob(g,h,i);return l[b]=m,{part:b,start:h,end:i,count:j,blob:m,size:i-h}},_getChunkDataForCallback:function(a){return{partIndex:a.part,startByte:a.start+1,endByte:a.end,totalParts:a.count}},_getLocalStorageId:function(a){var b="5.0",c=j(a),e=k(a),g=f.partSize,h=m(a);return qq.format("qq{}resume{}-{}-{}-{}-{}",d,b,c,e,g,h)},_getMimeType:function(a){return c.getFile(a).type},_getPersistableData:function(a){return c._getFileState(a).chunking},_getTotalChunks:function(a){if(f){var b=k(a),c=f.partSize;return Math.ceil(b/c)}},_getXhr:function(a,b){var d=null==b?-1:b;return c._getFileState(a).temp.xhrs[d]},_getXhrs:function(a){return c._getFileState(a).temp.xhrs},_iterateResumeRecords:function(a){i&&qq.each(localStorage,function(b,c){if(0===b.indexOf(qq.format("qq{}resume",d))){var e=JSON.parse(c);a(b,e)}})},_initTempState:function(a){c._getFileState(a).temp={ajaxRequesters:{},chunkProgress:{},xhrs:{},cachedChunks:{}}},_markNotResumable:function(a){c._getFileState(a).notResumable=!0},_maybeDeletePersistedChunkData:function(a){var b;return i&&c.isResumable(a)&&(b=c._getLocalStorageId(a),b&&localStorage.getItem(b))?(localStorage.removeItem(b),!0):!1},_maybePrepareForResume:function(a){var b,d,e=c._getFileState(a);i&&void 0===e.key&&(b=c._getLocalStorageId(a),d=localStorage.getItem(b),d&&(d=JSON.parse(d),n(d.uuid)?c._markNotResumable(a):(q(qq.format("Identified file with ID {} and name of {} as resumable.",a,j(a))),o(a,d.uuid),e.key=d.key,e.chunking=d.chunking,e.loaded=d.loaded,e.attemptingResume=!0,c.moveInProgressToRemaining(a))))},_maybePersistChunkedState:function(a){var b,d,e=c._getFileState(a);if(i&&c.isResumable(a)){b=c._getLocalStorageId(a),d={name:j(a),size:k(a),uuid:l(a),key:e.key,chunking:e.chunking,loaded:e.loaded,lastUpdated:Date.now()};try{localStorage.setItem(b,JSON.stringify(d))}catch(f){q(qq.format("Unable to save resume data for '{}' due to error: '{}'.",a,f.toString()),"warn")}}},_registerProgressHandler:function(a,b,d){var e=c._getXhr(a,b),f=j(a),g={simple:function(b,c){var d=k(a);b===c?p(a,f,d,d):p(a,f,b>=d?d-1:b,d)},chunked:function(e,g){var h=c._getFileState(a).temp.chunkProgress,i=c._getFileState(a).loaded,j=e,l=g,m=k(a),n=j-(l-d),o=i;h[b]=n,qq.each(h,function(a,b){o+=b}),p(a,f,o,m)}};e.upload.onprogress=function(a){if(a.lengthComputable){var b=null==d?"simple":"chunked";g[b](a.loaded,a.total)}}},_registerXhr:function(a,b,d,e){var f=null==b?-1:b,g=c._getFileState(a).temp;return g.xhrs=g.xhrs||{},g.ajaxRequesters=g.ajaxRequesters||{},g.xhrs[f]=d,e&&(g.ajaxRequesters[f]=e),d},_removeExpiredChunkingRecords:function(){var a=g.recordsExpireIn;c._iterateResumeRecords(function(b,c){var d=new Date(c.lastUpdated);d.setDate(d.getDate()+a),d.getTime()<=Date.now()&&(q("Removing expired resume record with key "+b),localStorage.removeItem(b))})},_shouldChunkThisFile:function(a){var b=c._getFileState(a);return b.chunking||c.reevaluateChunking(a),b.chunking.enabled}})},qq.WindowReceiveMessage=function(a){"use strict";var b={log:function(){}},c={};qq.extend(b,a),qq.extend(this,{receiveMessage:function(a,b){var d=function(a){b(a.data)};window.postMessage?c[a]=qq(window).attach("message",d):log("iframe message passing not supported in this browser!","error")},stopReceivingMessages:function(a){if(window.postMessage){var b=c[a];b&&b()}}})},function(){"use strict";qq.uiPublicApi={addInitialFiles:function(){this._parent.prototype.addInitialFiles.apply(this,arguments),this._templating.addCacheToDom()},clearStoredFiles:function(){this._parent.prototype.clearStoredFiles.apply(this,arguments),this._templating.clearFiles()},addExtraDropzone:function(a){this._dnd&&this._dnd.setupExtraDropzone(a)},removeExtraDropzone:function(a){return this._dnd?this._dnd.removeDropzone(a):void 0},getItemByFileId:function(a){return this._templating.isHiddenForever(a)?void 0:this._templating.getFileContainer(a)},reset:function(){this._parent.prototype.reset.apply(this,arguments),this._templating.reset(),!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._dnd&&(this._dnd.dispose(),this._dnd=this._setupDragAndDrop()),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0,this._setupClickAndEditEventHandlers()},setName:function(a,b){var c=this._options.formatFileName(b);this._parent.prototype.setName.apply(this,arguments),this._templating.updateFilename(a,c)},pauseUpload:function(a){var b=this._parent.prototype.pauseUpload.apply(this,arguments);return b&&this._templating.uploadPaused(a),b},continueUpload:function(a){var b=this._parent.prototype.continueUpload.apply(this,arguments);return b&&this._templating.uploadContinued(a),b},getId:function(a){return this._templating.getFileId(a)},getDropTarget:function(a){var b=this.getFile(a);return b.qqDropTarget}},qq.uiPrivateApi={_getButton:function(a){var b=this._parent.prototype._getButton.apply(this,arguments);return b||a===this._defaultButtonId&&(b=this._templating.getButton()),b},_removeFileItem:function(a){this._templating.removeFile(a)},_setupClickAndEditEventHandlers:function(){this._fileButtonsClickHandler=qq.FileButtonsClickHandler&&this._bindFileButtonsClickEvent(),this._focusinEventSupported=!qq.firefox(),this._isEditFilenameEnabled()&&(this._filenameClickHandler=this._bindFilenameClickEvent(),this._filenameInputFocusInHandler=this._bindFilenameInputFocusInEvent(),this._filenameInputFocusHandler=this._bindFilenameInputFocusEvent())},_setupDragAndDrop:function(){var a=this,b=this._options.dragAndDrop.extraDropzones,c=this._templating,d=c.getDropZone();return d&&b.push(d),new qq.DragAndDrop({dropZoneElements:b,allowMultipleItems:this._options.multiple,classes:{dropActive:this._options.classes.dropActive},callbacks:{processingDroppedFiles:function(){c.showDropProcessing()},processingDroppedFilesComplete:function(b,d){c.hideDropProcessing(),qq.each(b,function(a,b){b.qqDropTarget=d}),b.length&&a.addFiles(b,null,null)},dropError:function(b,c){a._itemError(b,c)},dropLog:function(b,c){a.log(b,c)}}})},_bindFileButtonsClickEvent:function(){var a=this;return new qq.FileButtonsClickHandler({templating:this._templating,log:function(b,c){a.log(b,c)},onDeleteFile:function(b){a.deleteFile(b)},onCancel:function(b){a.cancel(b)},onRetry:function(b){a.retry(b)},onPause:function(b){a.pauseUpload(b)},onContinue:function(b){a.continueUpload(b)},onGetName:function(b){return a.getName(b)}})},_isEditFilenameEnabled:function(){return this._templating.isEditFilenamePossible()&&!this._options.autoUpload&&qq.FilenameClickHandler&&qq.FilenameInputFocusHandler&&qq.FilenameInputFocusHandler},_filenameEditHandler:function(){var a=this,b=this._templating;return{templating:b,log:function(b,c){a.log(b,c)},onGetUploadStatus:function(b){return a.getUploads({id:b}).status},onGetName:function(b){return a.getName(b)},onSetName:function(b,c){a.setName(b,c)},onEditingStatusChange:function(a,c){var d=qq(b.getEditInput(a)),e=qq(b.getFileContainer(a));c?(d.addClass("qq-editing"),b.hideFilename(a),b.hideEditIcon(a)):(d.removeClass("qq-editing"),b.showFilename(a),b.showEditIcon(a)),e.addClass("qq-temp").removeClass("qq-temp")}}},_onUploadStatusChange:function(a,b,c){this._parent.prototype._onUploadStatusChange.apply(this,arguments),this._isEditFilenameEnabled()&&this._templating.getFileContainer(a)&&c!==qq.status.SUBMITTED&&(this._templating.markFilenameEditable(a),this._templating.hideEditIcon(a)),c===qq.status.UPLOAD_RETRYING?(this._templating.hideRetry(a),this._templating.setStatusText(a),qq(this._templating.getFileContainer(a)).removeClass(this._classes.retrying)):c===qq.status.UPLOAD_FAILED&&this._templating.hidePause(a)},_bindFilenameInputFocusInEvent:function(){var a=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusInHandler(a)},_bindFilenameInputFocusEvent:function(){var a=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusHandler(a)},_bindFilenameClickEvent:function(){var a=qq.extend({},this._filenameEditHandler());return new qq.FilenameClickHandler(a)},_storeForLater:function(a){this._parent.prototype._storeForLater.apply(this,arguments),this._templating.hideSpinner(a)},_onAllComplete:function(){this._parent.prototype._onAllComplete.apply(this,arguments),this._templating.resetTotalProgress()},_onSubmit:function(a,b){var c=this.getFile(a);c&&c.qqPath&&this._options.dragAndDrop.reportDirectoryPaths&&this._paramsStore.addReadOnly(a,{qqpath:c.qqPath}),this._parent.prototype._onSubmit.apply(this,arguments),this._addToList(a,b)},_onSubmitted:function(a){this._isEditFilenameEnabled()&&(this._templating.markFilenameEditable(a),this._templating.showEditIcon(a),this._focusinEventSupported||this._filenameInputFocusHandler.addHandler(this._templating.getEditInput(a)))},_onProgress:function(a,b,c,d){this._parent.prototype._onProgress.apply(this,arguments),this._templating.updateProgress(a,c,d),100===Math.round(100*(c/d))?(this._templating.hideCancel(a),this._templating.hidePause(a),this._templating.hideProgress(a),this._templating.setStatusText(a,this._options.text.waitingForResponse),this._displayFileSize(a)):this._displayFileSize(a,c,d)},_onTotalProgress:function(a,b){this._parent.prototype._onTotalProgress.apply(this,arguments),this._templating.updateTotalProgress(a,b)},_onComplete:function(a,b,c){function d(b){g&&(f.setStatusText(a),qq(g).removeClass(h._classes.retrying),f.hideProgress(a),h.getUploads({id:a}).status!==qq.status.UPLOAD_FAILED&&f.hideCancel(a),f.hideSpinner(a),b.success?h._markFileAsSuccessful(a):(qq(g).addClass(h._classes.fail),f.showCancel(a),f.isRetryPossible()&&!h._preventRetries[a]&&(qq(g).addClass(h._classes.retryable),f.showRetry(a)),h._controlFailureTextDisplay(a,b)))}var e=this._parent.prototype._onComplete.apply(this,arguments),f=this._templating,g=f.getFileContainer(a),h=this;return e instanceof qq.Promise?e.done(function(a){d(a)}):d(c),e},_markFileAsSuccessful:function(a){var b=this._templating;this._isDeletePossible()&&b.showDeleteButton(a),qq(b.getFileContainer(a)).addClass(this._classes.success),this._maybeUpdateThumbnail(a)},_onUploadPrep:function(a){this._parent.prototype._onUploadPrep.apply(this,arguments),this._templating.showSpinner(a)},_onUpload:function(a){var b=this._parent.prototype._onUpload.apply(this,arguments);return this._templating.showSpinner(a),b},_onUploadChunk:function(a,b){this._parent.prototype._onUploadChunk.apply(this,arguments),b.partIndex>0&&this._handler.isResumable(a)&&this._templating.allowPause(a)},_onCancel:function(a){this._parent.prototype._onCancel.apply(this,arguments),this._removeFileItem(a),0===this._getNotFinished()&&this._templating.resetTotalProgress()},_onBeforeAutoRetry:function(a){var b,c,d;this._parent.prototype._onBeforeAutoRetry.apply(this,arguments),this._showCancelLink(a),this._options.retry.showAutoRetryNote&&(b=this._autoRetries[a],c=this._options.retry.maxAutoAttempts,d=this._options.retry.autoRetryNote.replace(/\{retryNum\}/g,b),d=d.replace(/\{maxAuto\}/g,c),this._templating.setStatusText(a,d),qq(this._templating.getFileContainer(a)).addClass(this._classes.retrying))},_onBeforeManualRetry:function(a){return this._parent.prototype._onBeforeManualRetry.apply(this,arguments)?(this._templating.resetProgress(a),qq(this._templating.getFileContainer(a)).removeClass(this._classes.fail),this._templating.setStatusText(a),this._templating.showSpinner(a),this._showCancelLink(a),!0):(qq(this._templating.getFileContainer(a)).addClass(this._classes.retryable),this._templating.showRetry(a),!1)},_onSubmitDelete:function(a){var b=qq.bind(this._onSubmitDeleteSuccess,this);this._parent.prototype._onSubmitDelete.call(this,a,b)},_onSubmitDeleteSuccess:function(){this._options.deleteFile.forceConfirm?this._showDeleteConfirm.apply(this,arguments):this._sendDeleteRequest.apply(this,arguments)},_onDeleteComplete:function(a,b,c){this._parent.prototype._onDeleteComplete.apply(this,arguments),this._templating.hideSpinner(a),c?(this._templating.setStatusText(a,this._options.deleteFile.deletingFailedText),this._templating.showDeleteButton(a)):this._removeFileItem(a)},_sendDeleteRequest:function(a){this._templating.hideDeleteButton(a),this._templating.showSpinner(a),this._templating.setStatusText(a,this._options.deleteFile.deletingStatusText),this._deleteHandler.sendDelete.apply(this,arguments)},_showDeleteConfirm:function(a){var b,c=this.getName(a),d=this._options.deleteFile.confirmMessage.replace(/\{filename\}/g,c),e=(this.getUuid(a),arguments),f=this;b=this._options.showConfirm(d),qq.isGenericPromise(b)?b.then(function(){f._sendDeleteRequest.apply(f,e)}):b!==!1&&f._sendDeleteRequest.apply(f,e)},_addToList:function(a,b,c){var d,e,f=0,g=this._handler.isProxied(a)&&this._options.scaling.hideScaled;this._options.display.prependFiles&&(this._totalFilesInBatch>1&&this._filesInBatchAddedToUi>0&&(f=this._filesInBatchAddedToUi-1),d={index:f}),c||(this._options.disableCancelForFormUploads&&!qq.supportedFeatures.ajaxUploading&&this._templating.disableCancel(),this._options.multiple||(e=this.getUploads({id:a}),this._handledProxyGroup=this._handledProxyGroup||e.proxyGroupId,e.proxyGroupId===this._handledProxyGroup&&e.proxyGroupId||(this._handler.cancelAll(),this._clearList(),this._handledProxyGroup=null))),c?(this._templating.addFileToCache(a,this._options.formatFileName(b),d,g),this._templating.updateThumbnail(a,this._thumbnailUrls[a],!0)):(this._templating.addFile(a,this._options.formatFileName(b),d,g),this._templating.generatePreview(a,this.getFile(a))),this._filesInBatchAddedToUi+=1,(c||this._options.display.fileSizeOnSubmit&&qq.supportedFeatures.ajaxUploading)&&this._displayFileSize(a)},_clearList:function(){this._templating.clearFiles(),this.clearStoredFiles()},_displayFileSize:function(a,b,c){var d=this.getSize(a),e=this._formatSize(d);d>=0&&(void 0!==b&&void 0!==c&&(e=this._formatProgress(b,c)),this._templating.updateSize(a,e))},_formatProgress:function(a,b){function c(a,b){d=d.replace(a,b)}var d=this._options.text.formatProgress;return c("{percent}",Math.round(100*(a/b))),c("{total_size}",this._formatSize(b)),d},_controlFailureTextDisplay:function(a,b){var c,d,e;c=this._options.failedUploadTextDisplay.mode,d=this._options.failedUploadTextDisplay.responseProperty,"custom"===c?(e=b[d],e||(e=this._options.text.failUpload),this._templating.setStatusText(a,e),this._options.failedUploadTextDisplay.enableTooltip&&this._showTooltip(a,e)):"default"===c?this._templating.setStatusText(a,this._options.text.failUpload):"none"!==c&&this.log("failedUploadTextDisplay.mode value of '"+c+"' is not valid","warn")},_showTooltip:function(a,b){this._templating.getFileContainer(a).title=b},_showCancelLink:function(a){(!this._options.disableCancelForFormUploads||qq.supportedFeatures.ajaxUploading)&&this._templating.showCancel(a)},_itemError:function(){var a=this._parent.prototype._itemError.apply(this,arguments);this._options.showMessage(a)},_batchError:function(a){this._parent.prototype._batchError.apply(this,arguments),this._options.showMessage(a)},_setupPastePrompt:function(){var a=this;this._options.callbacks.onPasteReceived=function(){var b=a._options.paste.namePromptMessage,c=a._options.paste.defaultName;return a._options.showPrompt(b,c)}},_fileOrBlobRejected:function(){this._totalFilesInBatch-=1,this._parent.prototype._fileOrBlobRejected.apply(this,arguments)},_prepareItemsForUpload:function(a){this._totalFilesInBatch=a.length,this._filesInBatchAddedToUi=0,this._parent.prototype._prepareItemsForUpload.apply(this,arguments)},_maybeUpdateThumbnail:function(a){var b=this._thumbnailUrls[a],c=this.getUploads({id:a}).status;c===qq.status.DELETED||!b&&!this._options.thumbnails.placeholders.waitUntilResponse&&qq.supportedFeatures.imagePreviews||this._templating.updateThumbnail(a,b)},_addCannedFile:function(){var a=this._parent.prototype._addCannedFile.apply(this,arguments);return this._addToList(a,this.getName(a),!0),this._templating.hideSpinner(a),this._templating.hideCancel(a),this._markFileAsSuccessful(a),a},_setSize:function(a,b){this._parent.prototype._setSize.apply(this,arguments),this._templating.updateSize(a,this._formatSize(b))},_sessionRequestComplete:function(){this._templating.addCacheToDom(),this._parent.prototype._sessionRequestComplete.apply(this,arguments)}}}(),qq.FineUploader=function(a,b){"use strict";var c=this;this._parent=b?qq[b].FineUploaderBasic:qq.FineUploaderBasic,this._parent.apply(this,arguments),qq.extend(this._options,{element:null,button:null,listElement:null,dragAndDrop:{extraDropzones:[],reportDirectoryPaths:!1},text:{formatProgress:"{percent}% of {total_size}",failUpload:"Upload failed",waitingForResponse:"Processing...",paused:"Paused"},template:"qq-template",classes:{retrying:"qq-upload-retrying",retryable:"qq-upload-retryable",success:"qq-upload-success",fail:"qq-upload-fail",editable:"qq-editable",hide:"qq-hide",dropActive:"qq-upload-drop-area-active"},failedUploadTextDisplay:{mode:"default",responseProperty:"error",enableTooltip:!0},messages:{tooManyFilesError:"You may only drop one file",unsupportedBrowser:"Unrecoverable error - this browser does not permit file uploading of any kind."},retry:{showAutoRetryNote:!0,autoRetryNote:"Retrying {retryNum}/{maxAuto}..."},deleteFile:{forceConfirm:!1,confirmMessage:"Are you sure you want to delete {filename}?",deletingStatusText:"Deleting...",deletingFailedText:"Delete failed"},display:{fileSizeOnSubmit:!1,prependFiles:!1},paste:{promptForName:!1,namePromptMessage:"Please name this image"},thumbnails:{maxCount:0,placeholders:{waitUntilResponse:!1,notAvailablePath:null,waitingPath:null},timeBetweenThumbs:750},scaling:{hideScaled:!1},showMessage:function(a){return c._templating.hasDialog("alert")?c._templating.showDialog("alert",a):(setTimeout(function(){window.alert(a)},0),void 0)},showConfirm:function(a){return c._templating.hasDialog("confirm")?c._templating.showDialog("confirm",a):window.confirm(a)},showPrompt:function(a,b){return c._templating.hasDialog("prompt")?c._templating.showDialog("prompt",a,b):window.prompt(a,b)}},!0),qq.extend(this._options,a,!0),this._templating=new qq.Templating({log:qq.bind(this.log,this),templateIdOrEl:this._options.template,containerEl:this._options.element,fileContainerEl:this._options.listElement,button:this._options.button,imageGenerator:this._imageGenerator,classes:{hide:this._options.classes.hide,editable:this._options.classes.editable},limits:{maxThumbs:this._options.thumbnails.maxCount,timeBetweenThumbs:this._options.thumbnails.timeBetweenThumbs},placeholders:{waitUntilUpdate:this._options.thumbnails.placeholders.waitUntilResponse,thumbnailNotAvailable:this._options.thumbnails.placeholders.notAvailablePath,waitingForThumbnail:this._options.thumbnails.placeholders.waitingPath},text:this._options.text}),this._options.workarounds.ios8SafariUploads&&qq.ios800()&&qq.iosSafari()?this._templating.renderFailure(this._options.messages.unsupportedBrowserIos8Safari):!qq.supportedFeatures.uploading||this._options.cors.expected&&!qq.supportedFeatures.uploadCors?this._templating.renderFailure(this._options.messages.unsupportedBrowser):(this._wrapCallbacks(),this._templating.render(),this._classes=this._options.classes,!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._setupClickAndEditEventHandlers(),qq.DragAndDrop&&qq.supportedFeatures.fileDrop&&(this._dnd=this._setupDragAndDrop()),this._options.paste.targetElement&&this._options.paste.promptForName&&(qq.PasteSupport?this._setupPastePrompt():this.log("Paste support module not found.","error")),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0)},qq.extend(qq.FineUploader.prototype,qq.basePublicApi),qq.extend(qq.FineUploader.prototype,qq.basePrivateApi),qq.extend(qq.FineUploader.prototype,qq.uiPublicApi),qq.extend(qq.FineUploader.prototype,qq.uiPrivateApi),qq.Templating=function(a){"use strict";var b,c,d,e,f,g,h,i,j="qq-file-id",k="qq-file-id-",l="qq-max-size",m="qq-server-scale",n="qq-hide-dropzone",o="qq-drop-area-text",p="qq-in-progress",q="qq-hidden-forever",r={content:document.createDocumentFragment(),map:{}},s=!1,t=0,u=!1,v=[],w=-1,x={log:null,limits:{maxThumbs:0,timeBetweenThumbs:750},templateIdOrEl:"qq-template",containerEl:null,fileContainerEl:null,button:null,imageGenerator:null,classes:{hide:"qq-hide",editable:"qq-editable"},placeholders:{waitUntilUpdate:!1,thumbnailNotAvailable:null,waitingForThumbnail:null},text:{paused:"Paused"}},y={button:"qq-upload-button-selector",alertDialog:"qq-alert-dialog-selector",dialogCancelButton:"qq-cancel-button-selector",confirmDialog:"qq-confirm-dialog-selector",dialogMessage:"qq-dialog-message-selector",dialogOkButton:"qq-ok-button-selector",promptDialog:"qq-prompt-dialog-selector",uploader:"qq-uploader-selector",drop:"qq-upload-drop-area-selector",list:"qq-upload-list-selector",progressBarContainer:"qq-progress-bar-container-selector",progressBar:"qq-progress-bar-selector",totalProgressBarContainer:"qq-total-progress-bar-container-selector",totalProgressBar:"qq-total-progress-bar-selector",file:"qq-upload-file-selector",spinner:"qq-upload-spinner-selector",size:"qq-upload-size-selector",cancel:"qq-upload-cancel-selector",pause:"qq-upload-pause-selector",continueButton:"qq-upload-continue-selector",deleteButton:"qq-upload-delete-selector",retry:"qq-upload-retry-selector",statusText:"qq-upload-status-text-selector",editFilenameInput:"qq-edit-filename-selector",editNameIcon:"qq-edit-filename-icon-selector",dropText:"qq-upload-drop-area-text-selector",dropProcessing:"qq-drop-processing-selector",dropProcessingSpinner:"qq-drop-processing-spinner-selector",thumbnail:"qq-thumbnail-selector"},z={},A=new qq.Promise,B=new qq.Promise,C=function(){var a=x.placeholders.thumbnailNotAvailable,c=x.placeholders.waitingForThumbnail,d={maxSize:w,scale:i};h&&(a?x.imageGenerator.generate(a,new Image,d).then(function(a){A.success(a)},function(){A.failure(),b("Problem loading 'not available' placeholder image at "+a,"error")}):A.failure(),c?x.imageGenerator.generate(c,new Image,d).then(function(a){B.success(a)},function(){B.failure(),b("Problem loading 'waiting for thumbnail' placeholder image at "+c,"error")}):B.failure())},D=function(a){var b=new qq.Promise;return B.then(function(c){W(c,a),a.src?b.success():(a.src=c.src,a.onload=function(){a.onload=null,bb(a),b.success()})},function(){V(a),b.success()}),b},E=function(a,c,d){var e=U(a);return b("Generating new thumbnail for "+a),c.qqThumbnailId=a,x.imageGenerator.generate(c,e,d).then(function(){t++,bb(e),z[a].success()},function(){z[a].failure(),x.placeholders.waitUntilUpdate||X(a,e)})},F=function(){if(v.length){u=!0;var a=v.shift();a.update?_(a):$(a)}else u=!1},G=function(a){return T(M(a),y.cancel)},H=function(a){return T(M(a),y.continueButton)},I=function(a){return T(f,y[a+"Dialog"])},J=function(a){return T(M(a),y.deleteButton)},K=function(){return T(f,y.dropProcessing)},L=function(a){return T(M(a),y.editNameIcon)},M=function(a){return r.map[a]||qq(g).getFirstByClass(k+a)},N=function(a){return T(M(a),y.file)},O=function(a){return T(M(a),y.pause)},P=function(a){return null==a?T(f,y.totalProgressBarContainer)||T(f,y.totalProgressBar):T(M(a),y.progressBarContainer)||T(M(a),y.progressBar)},Q=function(a){return T(M(a),y.retry)},R=function(a){return T(M(a),y.size)},S=function(a){return T(M(a),y.spinner)},T=function(a,b){return a&&qq(a).getFirstByClass(b)},U=function(a){return h&&T(M(a),y.thumbnail)},V=function(a){a&&qq(a).addClass(x.classes.hide)},W=function(a,b){var c=a.style.maxWidth,d=a.style.maxHeight;d&&c&&!b.style.maxWidth&&!b.style.maxHeight&&qq(b).css({maxWidth:c,maxHeight:d})},X=function(a,b){var c=z[a]||(new qq.Promise).failure(),d=new qq.Promise;return A.then(function(a){c.then(function(){d.success()},function(){W(a,b),b.onload=function(){b.onload=null,d.success()},b.src=a.src,bb(b)})}),d},Y=function(){var a,e,f,g,j,k,p,q,r,s,t;if(b("Parsing template"),null==x.templateIdOrEl)throw new Error("You MUST specify either a template element or ID!");if(qq.isString(x.templateIdOrEl)){if(a=document.getElementById(x.templateIdOrEl),null===a)throw new Error(qq.format("Cannot find template script at ID '{}'!",x.templateIdOrEl));e=a.innerHTML}else{if(void 0===x.templateIdOrEl.innerHTML)throw new Error("You have specified an invalid value for the template option! It must be an ID or an Element.");e=x.templateIdOrEl.innerHTML}if(e=qq.trimStr(e),g=document.createElement("div"),g.appendChild(qq.toElement(e)),t=qq(g).getFirstByClass(y.uploader),x.button&&(k=qq(g).getFirstByClass(y.button),k&&qq(k).remove()),qq.DragAndDrop&&qq.supportedFeatures.fileDrop||(r=qq(g).getFirstByClass(y.dropProcessing),r&&qq(r).remove()),p=qq(g).getFirstByClass(y.drop),p&&!qq.DragAndDrop&&(b("DnD module unavailable.","info"),qq(p).remove()),qq.supportedFeatures.fileDrop?qq(t).hasAttribute(o)&&p&&(s=qq(p).getFirstByClass(y.dropText),s&&qq(s).remove()):(t.removeAttribute(o),p&&qq(p).hasAttribute(n)&&qq(p).css({display:"none"})),q=qq(g).getFirstByClass(y.thumbnail),h?q&&(w=parseInt(q.getAttribute(l)),w=w>0?w:null,i=qq(q).hasAttribute(m)):q&&qq(q).remove(),h=h&&q,c=qq(g).getByClass(y.editFilenameInput).length>0,d=qq(g).getByClass(y.retry).length>0,f=qq(g).getFirstByClass(y.list),null==f)throw new Error("Could not find the file list container in the template!");return j=f.innerHTML,f.innerHTML="",g.getElementsByTagName("DIALOG").length&&document.createElement("dialog"),b("Template parsing complete"),{template:qq.trimStr(g.innerHTML),fileTemplate:qq.trimStr(j)}},Z=function(a,b,c){var d=c,e=d.firstChild;b>0&&(e=qq(d).children()[b].nextSibling),d.insertBefore(a,e)},$=function(a){var b=a.id,c=a.optFileOrBlob,d=c&&c.qqThumbnailId,e=U(b),f={maxSize:w,scale:!0,orient:!0};qq.supportedFeatures.imagePreviews?e?x.limits.maxThumbs&&x.limits.maxThumbs<=t?(X(b,e),F()):D(e).done(function(){z[b]=new qq.Promise,z[b].done(function(){setTimeout(F,x.limits.timeBetweenThumbs)}),null!=d?cb(b,d):E(b,c,f)}):F():e&&(D(e),F())},_=function(a){var b=a.id,c=a.thumbnailUrl,d=a.showWaitingImg,e=U(b),f={maxSize:w,scale:i};if(e)if(c){if(!(x.limits.maxThumbs&&x.limits.maxThumbs<=t))return d&&D(e),x.imageGenerator.generate(c,e,f).then(function(){bb(e),t++,setTimeout(F,x.limits.timeBetweenThumbs)
},function(){X(b,e),setTimeout(F,x.limits.timeBetweenThumbs)});X(b,e),F()}else X(b,e),F()},ab=function(a,b){var c=P(a),d=null==a?y.totalProgressBar:y.progressBar;c&&!qq(c).hasClass(d)&&(c=qq(c).getFirstByClass(d)),c&&(qq(c).css({width:b+"%"}),c.setAttribute("aria-valuenow",b))},bb=function(a){a&&qq(a).removeClass(x.classes.hide)},cb=function(a,c){var d=U(a),e=U(c);b(qq.format("ID {} is the same file as ID {}. Will use generated thumbnail from ID {} instead.",a,c,c)),z[c].then(function(){t++,z[a].success(),b(qq.format("Now using previously generated thumbnail created for ID {} on ID {}.",c,a)),d.src=e.src,bb(d)},function(){z[a].failure(),x.placeholders.waitUntilUpdate||X(a,d)})};qq.extend(x,a),b=x.log,qq.supportedFeatures.imagePreviews||(x.limits.timeBetweenThumbs=0,x.limits.maxThumbs=0),f=x.containerEl,h=void 0!==x.imageGenerator,e=Y(),C(),qq.extend(this,{render:function(){b("Rendering template in DOM."),t=0,f.innerHTML=e.template,V(K()),this.hideTotalProgress(),g=x.fileContainerEl||T(f,y.list),b("Template rendering complete")},renderFailure:function(a){var b=qq.toElement(a);f.innerHTML="",f.appendChild(b)},reset:function(){this.render()},clearFiles:function(){g.innerHTML=""},disableCancel:function(){s=!0},addFile:function(a,b,c,d,h){var i,l=qq.toElement(e.fileTemplate),m=T(l,y.file),n=T(f,y.uploader),p=h?r.content:g;h&&(r.map[a]=l),qq(l).addClass(k+a),n.removeAttribute(o),m&&(qq(m).setText(b),m.setAttribute("title",b)),l.setAttribute(j,a),c?Z(l,c.index,p):p.appendChild(l),d?(l.style.display="none",qq(l).addClass(q)):(V(P(a)),V(R(a)),V(J(a)),V(Q(a)),V(O(a)),V(H(a)),s&&this.hideCancel(a),i=U(a),i&&!i.src&&B.then(function(a){i.src=a.src,a.style.maxHeight&&a.style.maxWidth&&qq(i).css({maxHeight:a.style.maxHeight,maxWidth:a.style.maxWidth}),bb(i)}))},addFileToCache:function(a,b,c,d){this.addFile(a,b,c,d,!0)},addCacheToDom:function(){g.appendChild(r.content),r.content=document.createDocumentFragment(),r.map={}},removeFile:function(a){qq(M(a)).remove()},getFileId:function(a){var b=a;if(b){for(;null==b.getAttribute(j);)b=b.parentNode;return parseInt(b.getAttribute(j))}},getFileList:function(){return g},markFilenameEditable:function(a){var b=N(a);b&&qq(b).addClass(x.classes.editable)},updateFilename:function(a,b){var c=N(a);c&&(qq(c).setText(b),c.setAttribute("title",b))},hideFilename:function(a){V(N(a))},showFilename:function(a){bb(N(a))},isFileName:function(a){return qq(a).hasClass(y.file)},getButton:function(){return x.button||T(f,y.button)},hideDropProcessing:function(){V(K())},showDropProcessing:function(){bb(K())},getDropZone:function(){return T(f,y.drop)},isEditFilenamePossible:function(){return c},hideRetry:function(a){V(Q(a))},isRetryPossible:function(){return d},showRetry:function(a){bb(Q(a))},getFileContainer:function(a){return M(a)},showEditIcon:function(a){var b=L(a);b&&qq(b).addClass(x.classes.editable)},isHiddenForever:function(a){return qq(M(a)).hasClass(q)},hideEditIcon:function(a){var b=L(a);b&&qq(b).removeClass(x.classes.editable)},isEditIcon:function(a){return qq(a).hasClass(y.editNameIcon,!0)},getEditInput:function(a){return T(M(a),y.editFilenameInput)},isEditInput:function(a){return qq(a).hasClass(y.editFilenameInput,!0)},updateProgress:function(a,b,c){var d,e=P(a);e&&c>0&&(d=Math.round(100*(b/c)),100===d?V(e):bb(e),ab(a,d))},updateTotalProgress:function(a,b){this.updateProgress(null,a,b)},hideProgress:function(a){var b=P(a);b&&V(b)},hideTotalProgress:function(){this.hideProgress()},resetProgress:function(a){ab(a,0),this.hideTotalProgress(a)},resetTotalProgress:function(){this.resetProgress()},showCancel:function(a){if(!s){var b=G(a);b&&qq(b).removeClass(x.classes.hide)}},hideCancel:function(a){V(G(a))},isCancel:function(a){return qq(a).hasClass(y.cancel,!0)},allowPause:function(a){bb(O(a)),V(H(a))},uploadPaused:function(a){this.setStatusText(a,x.text.paused),this.allowContinueButton(a),V(S(a))},hidePause:function(a){V(O(a))},isPause:function(a){return qq(a).hasClass(y.pause,!0)},isContinueButton:function(a){return qq(a).hasClass(y.continueButton,!0)},allowContinueButton:function(a){bb(H(a)),V(O(a))},uploadContinued:function(a){this.setStatusText(a,""),this.allowPause(a),bb(S(a))},showDeleteButton:function(a){bb(J(a))},hideDeleteButton:function(a){V(J(a))},isDeleteButton:function(a){return qq(a).hasClass(y.deleteButton,!0)},isRetry:function(a){return qq(a).hasClass(y.retry,!0)},updateSize:function(a,b){var c=R(a);c&&(bb(c),qq(c).setText(b))},setStatusText:function(a,b){var c=T(M(a),y.statusText);c&&(null==b?qq(c).clearText():qq(c).setText(b))},hideSpinner:function(a){qq(M(a)).removeClass(p),V(S(a))},showSpinner:function(a){qq(M(a)).addClass(p),bb(S(a))},generatePreview:function(a,b){this.isHiddenForever(a)||(v.push({id:a,optFileOrBlob:b}),!u&&F())},updateThumbnail:function(a,b,c){this.isHiddenForever(a)||(v.push({update:!0,id:a,thumbnailUrl:b,showWaitingImg:c}),!u&&F())},hasDialog:function(a){return qq.supportedFeatures.dialogElement&&!!I(a)},showDialog:function(a,b,c){var d=I(a),e=T(d,y.dialogMessage),f=d.getElementsByTagName("INPUT")[0],g=T(d,y.dialogCancelButton),h=T(d,y.dialogOkButton),i=new qq.Promise,j=function(){g.removeEventListener("click",k),h&&h.removeEventListener("click",l),i.failure()},k=function(){g.removeEventListener("click",k),d.close()},l=function(){d.removeEventListener("close",j),h.removeEventListener("click",l),d.close(),i.success(f&&f.value)};return d.addEventListener("close",j),g.addEventListener("click",k),h&&h.addEventListener("click",l),f&&(f.value=c),e.textContent=b,d.showModal(),i}})},qq.traditional=qq.traditional||{},qq.traditional.FormUploadHandler=function(a,b){"use strict";function c(a,b){var c,d,f;try{d=b.contentDocument||b.contentWindow.document,f=d.body.innerHTML,h("converting iframe's innerHTML to JSON"),h("innerHTML = "+f),f&&f.match(/^<pre/i)&&(f=d.body.firstChild.firstChild.nodeValue),c=e._parseJsonResponse(f)}catch(g){h("Error when attempting to parse form upload response ("+g.message+")","error"),c={success:!1}}return c}function d(b,c){var d=a.paramsStore.get(b),h="get"===a.method.toLowerCase()?"GET":"POST",i=a.endpointStore.get(b),j=f(b);return d[a.uuidName]=g(b),d[a.filenameParam]=j,e._initFormForUpload({method:h,endpoint:i,params:d,paramsInBody:a.paramsInBody,targetName:c.name})}var e=this,f=b.getName,g=b.getUuid,h=b.log;this.uploadFile=function(b){var f,g=e.getInput(b),i=e._createIframe(b),j=new qq.Promise;return f=d(b,i),f.appendChild(g),e._attachLoadEvent(i,function(d){h("iframe loaded");var f=d?d:c(b,i);e._detachLoadEvent(b),a.cors.expected||qq(i).remove(),f.success?j.success(f):j.failure(f)}),h("Sending upload request for "+b),f.submit(),qq(f).remove(),j},qq.extend(this,new qq.FormUploadHandler({options:{isCors:a.cors.expected,inputName:a.inputName},proxy:{onCancel:a.onCancel,getName:f,getUuid:g,log:h}}))},qq.traditional=qq.traditional||{},qq.traditional.XhrUploadHandler=function(a,b){"use strict";var c=this,d=b.getName,e=b.getSize,f=b.getUuid,g=b.log,h=a.forceMultipart||a.paramsInBody,i=function(b,c,f){var g=e(b),i=d(b);c[a.chunking.paramNames.partIndex]=f.part,c[a.chunking.paramNames.partByteOffset]=f.start,c[a.chunking.paramNames.chunkSize]=f.size,c[a.chunking.paramNames.totalParts]=f.count,c[a.totalFileSizeName]=g,h&&(c[a.filenameParam]=i)},j=new qq.traditional.AllChunksDoneAjaxRequester({cors:a.cors,endpoint:a.chunking.success.endpoint,log:g}),k=function(a,b){var c=new qq.Promise;return b.onreadystatechange=function(){if(4===b.readyState){var d=n(a,b);d.success?c.success(d.response,b):c.failure(d.response,b)}},c},l=function(b){var g=a.paramsStore.get(b),h=d(b),i=e(b);return g[a.uuidName]=f(b),g[a.filenameParam]=h,g[a.totalFileSizeName]=i,g[a.chunking.paramNames.totalParts]=c._getTotalChunks(b),g},m=function(a,b){return qq.indexOf([200,201,202,203,204],a.status)<0||!b.success||b.reset},n=function(a,b){var c;return g("xhr - server response received for "+a),g("responseText = "+b.responseText),c=o(!0,b),{success:!m(b,c),response:c}},o=function(a,b){var c={};try{g(qq.format("Received response status {} with body: {}",b.status,b.responseText)),c=qq.parseJson(b.responseText)}catch(d){a&&g("Error when attempting to parse xhr response text ("+d.message+")","error")}return c},p=function(b){var d=new qq.Promise;return j.complete(b,c._createXhr(b),l(b),a.customHeaders.get(b)).then(function(a){d.success(o(!1,a),a)},function(a){d.failure(o(!1,a),a)}),d},q=function(b,c,g,i){var j=new FormData,k=a.method,l=a.endpointStore.get(i),m=d(i),n=e(i);return b[a.uuidName]=f(i),b[a.filenameParam]=m,h&&(b[a.totalFileSizeName]=n),a.paramsInBody||(h||(b[a.inputName]=m),l=qq.obj2url(b,l)),c.open(k,l,!0),a.cors.expected&&a.cors.sendCredentials&&(c.withCredentials=!0),h?(a.paramsInBody&&qq.obj2FormData(b,j),j.append(a.inputName,g),j):g},r=function(b,d){var e=a.customHeaders.get(b),f=c.getFile(b);d.setRequestHeader("Accept","application/json"),d.setRequestHeader("X-Requested-With","XMLHttpRequest"),d.setRequestHeader("Cache-Control","no-cache"),h||(d.setRequestHeader("Content-Type","application/octet-stream"),d.setRequestHeader("X-Mime-Type",f.type)),qq.each(e,function(a,b){d.setRequestHeader(a,b)})};qq.extend(this,{uploadChunk:function(b,d,f){var g,h,j,l=c._getChunkData(b,d),m=c._createXhr(b,d);return e(b),g=k(b,m),c._registerProgressHandler(b,d,l.size),j=a.paramsStore.get(b),i(b,j,l),f&&(j[a.resume.paramNames.resuming]=!0),h=q(j,m,l.blob,b),r(b,m),m.send(h),g},uploadFile:function(b){var d,e,f,g,h=c.getFile(b);return e=c._createXhr(b),c._registerProgressHandler(b),d=k(b,e),f=a.paramsStore.get(b),g=q(f,e,h,b),r(b,e),e.send(g),d}}),qq.extend(this,new qq.XhrUploadHandler({options:qq.extend({namespace:"traditional"},a),proxy:qq.extend({getEndpoint:a.endpointStore.get},b)})),qq.override(this,function(b){return{finalizeChunks:function(c){return a.chunking.success.endpoint?p(c):b.finalizeChunks(c,qq.bind(o,this,!0))}}})},qq.traditional.AllChunksDoneAjaxRequester=function(a){"use strict";var b,c="POST",d={cors:{allowXdr:!1,expected:!1,sendCredentials:!1},endpoint:null,log:function(){}},e={},f={get:function(){return d.endpoint}};qq.extend(d,a),b=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:[c],method:c,endpointStore:f,allowXRequestedWithAndCacheControl:!1,cors:d.cors,log:d.log,onComplete:function(a,b,c){var d=e[a];delete e[a],c?d.failure(b):d.success(b)}})),qq.extend(this,{complete:function(a,c,f,g){var h=new qq.Promise;return d.log("Submitting All Chunks Done request for "+a),e[a]=h,b.initTransport(a).withParams(f).withHeaders(g).send(c),h}})},qq.PasteSupport=function(a){"use strict";function b(a){return a.type&&0===a.type.indexOf("image/")}function c(){f=qq(e.targetElement).attach("paste",function(a){var c=a.clipboardData;c&&qq.each(c.items,function(a,c){if(b(c)){var d=c.getAsFile();e.callbacks.pasteReceived(d)}})})}function d(){f&&f()}var e,f;e={targetElement:null,callbacks:{log:function(){},pasteReceived:function(){}}},qq.extend(e,a),c(),qq.extend(this,{reset:function(){d()}})},qq.DragAndDrop=function(a){"use strict";function b(a,b){var c=Array.prototype.slice.call(a);j.callbacks.dropLog("Grabbed "+a.length+" dropped files."),b.dropDisabled(!1),j.callbacks.processingDroppedFilesComplete(c,b.getElement())}function c(a){var b=new qq.Promise;return a.isFile?a.file(function(c){var d=a.name,e=a.fullPath,f=e.indexOf(d);e=e.substr(0,f),"/"===e.charAt(0)&&(e=e.substr(1)),c.qqPath=e,n.push(c),b.success()},function(c){j.callbacks.dropLog("Problem parsing '"+a.fullPath+"'. FileError code "+c.code+".","error"),b.failure()}):a.isDirectory&&d(a).then(function(a){var d=a.length;qq.each(a,function(a,e){c(e).done(function(){d-=1,0===d&&b.success()})}),a.length||b.success()},function(c){j.callbacks.dropLog("Problem parsing '"+a.fullPath+"'. FileError code "+c.code+".","error"),b.failure()}),b}function d(a,b,c,e){var f=e||new qq.Promise,g=b||a.createReader();return g.readEntries(function(b){var e=c?c.concat(b):b;b.length?setTimeout(function(){d(a,g,e,f)},0):f.success(e)},f.failure),f}function e(a,b){var d=[],e=new qq.Promise;return j.callbacks.processingDroppedFiles(),b.dropDisabled(!0),a.files.length>1&&!j.allowMultipleItems?(j.callbacks.processingDroppedFilesComplete([]),j.callbacks.dropError("tooManyFilesError",""),b.dropDisabled(!1),e.failure()):(n=[],qq.isFolderDropSupported(a)?qq.each(a.items,function(a,b){var f=b.webkitGetAsEntry();f&&(f.isFile?n.push(b.getAsFile()):d.push(c(f).done(function(){d.pop(),0===d.length&&e.success()})))}):n=a.files,0===d.length&&e.success()),e}function f(a){var c=new qq.UploadDropZone({HIDE_ZONES_EVENT_NAME:k,element:a,onEnter:function(b){qq(a).addClass(j.classes.dropActive),b.stopPropagation()},onLeaveNotDescendants:function(){qq(a).removeClass(j.classes.dropActive)},onDrop:function(a){e(a.dataTransfer,c).then(function(){b(n,c)},function(){j.callbacks.dropLog("Drop event DataTransfer parsing failed. No files will be uploaded.","error")})}});return o.addDisposer(function(){c.dispose()}),qq(a).hasAttribute(l)&&qq(a).hide(),m.push(c),c}function g(a){var b;return qq.each(a.dataTransfer.types,function(a,c){return"Files"===c?(b=!0,!1):void 0}),b}function h(a){return qq.firefox()?!a.relatedTarget:qq.safari()?a.x<0||a.y<0:0===a.x&&0===a.y}function i(){var a=j.dropZoneElements,b=function(){setTimeout(function(){qq.each(a,function(a,b){qq(b).hasAttribute(l)&&qq(b).hide(),qq(b).removeClass(j.classes.dropActive)})},10)};qq.each(a,function(b,c){var d=f(c);a.length&&qq.supportedFeatures.fileDrop&&o.attach(document,"dragenter",function(b){!d.dropDisabled()&&g(b)&&qq.each(a,function(a,b){b instanceof HTMLElement&&qq(b).hasAttribute(l)&&qq(b).css({display:"block"})})})}),o.attach(document,"dragleave",function(a){h(a)&&b()}),o.attach(qq(document).children()[0],"mouseenter",function(){b()}),o.attach(document,"drop",function(a){a.preventDefault(),b()}),o.attach(document,k,b)}var j,k="qq-hidezones",l="qq-hide-dropzone",m=[],n=[],o=new qq.DisposeSupport;j={dropZoneElements:[],allowMultipleItems:!0,classes:{dropActive:null},callbacks:new qq.DragAndDrop.callbacks},qq.extend(j,a,!0),i(),qq.extend(this,{setupExtraDropzone:function(a){j.dropZoneElements.push(a),f(a)},removeDropzone:function(a){var b,c=j.dropZoneElements;for(b in c)if(c[b]===a)return c.splice(b,1)},dispose:function(){o.dispose(),qq.each(m,function(a,b){b.dispose()})}})},qq.DragAndDrop.callbacks=function(){"use strict";return{processingDroppedFiles:function(){},processingDroppedFilesComplete:function(){},dropError:function(a,b){qq.log("Drag & drop error code '"+a+" with these specifics: '"+b+"'","error")},dropLog:function(a,b){qq.log(a,b)}}},qq.UploadDropZone=function(a){"use strict";function b(){return qq.safari()||qq.firefox()&&qq.windows()}function c(){k||(b?l.attach(document,"dragover",function(a){a.preventDefault()}):l.attach(document,"dragover",function(a){a.dataTransfer&&(a.dataTransfer.dropEffect="none",a.preventDefault())}),k=!0)}function d(a){if(!qq.supportedFeatures.fileDrop)return!1;var b,c=a.dataTransfer,d=qq.safari();return b=qq.ie()&&qq.supportedFeatures.fileDrop?!0:"none"!==c.effectAllowed,c&&b&&(c.files||!d&&c.types.contains&&c.types.contains("Files"))}function e(a){return void 0!==a&&(j=a),j}function f(){function a(){b=document.createEvent("Event"),b.initEvent(h.HIDE_ZONES_EVENT_NAME,!0,!0)}var b;if(window.CustomEvent)try{b=new CustomEvent(h.HIDE_ZONES_EVENT_NAME)}catch(c){a()}else a();document.dispatchEvent(b)}function g(){l.attach(i,"dragover",function(a){if(d(a)){var b=qq.ie()&&qq.supportedFeatures.fileDrop?null:a.dataTransfer.effectAllowed;a.dataTransfer.dropEffect="move"===b||"linkMove"===b?"move":"copy",a.stopPropagation(),a.preventDefault()}}),l.attach(i,"dragenter",function(a){if(!e()){if(!d(a))return;h.onEnter(a)}}),l.attach(i,"dragleave",function(a){if(d(a)){h.onLeave(a);var b=document.elementFromPoint(a.clientX,a.clientY);qq(this).contains(b)||h.onLeaveNotDescendants(a)}}),l.attach(i,"drop",function(a){if(!e()){if(!d(a))return;a.preventDefault(),a.stopPropagation(),h.onDrop(a),f()}})}var h,i,j,k,l=new qq.DisposeSupport;h={element:null,onEnter:function(){},onLeave:function(){},onLeaveNotDescendants:function(){},onDrop:function(){}},qq.extend(h,a),i=h.element,c(),g(),qq.extend(this,{dropDisabled:function(a){return e(a)},dispose:function(){l.dispose()},getElement:function(){return i}})},qq.DeleteFileAjaxRequester=function(a){"use strict";function b(){return"POST"===d.method.toUpperCase()?{_method:"DELETE"}:{}}var c,d={method:"DELETE",uuidParamName:"qquuid",endpointStore:{},maxConnections:3,customHeaders:function(){return{}},paramsStore:{},cors:{expected:!1,sendCredentials:!1},log:function(){},onDelete:function(){},onDeleteComplete:function(){}};qq.extend(d,a),c=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["POST","DELETE"],method:d.method,endpointStore:d.endpointStore,paramsStore:d.paramsStore,mandatedParams:b(),maxConnections:d.maxConnections,customHeaders:function(a){return d.customHeaders.get(a)},log:d.log,onSend:d.onDelete,onComplete:d.onDeleteComplete,cors:d.cors})),qq.extend(this,{sendDelete:function(a,b,e){var f=e||{};d.log("Submitting delete file request for "+a),"DELETE"===d.method?c.initTransport(a).withPath(b).withParams(f).send():(f[d.uuidParamName]=b,c.initTransport(a).withParams(f).send())}})},function(){function a(a){var b,c=a.naturalWidth,d=a.naturalHeight,e=document.createElement("canvas");return c*d>1048576?(e.width=e.height=1,b=e.getContext("2d"),b.drawImage(a,-c+1,0),0===b.getImageData(0,0,1,1).data[3]):!1}function b(a,b,c){var d,e,f,g,h=document.createElement("canvas"),i=0,j=c,k=c;for(h.width=1,h.height=c,d=h.getContext("2d"),d.drawImage(a,0,0),e=d.getImageData(0,0,1,c).data;k>i;)f=e[4*(k-1)+3],0===f?j=k:i=k,k=j+i>>1;return g=k/c,0===g?1:g}function c(a,b,c){var d=document.createElement("canvas"),f=b.mime||"image/jpeg";return e(a,d,b,c),d.toDataURL(f,b.quality||.8)}function d(a){var b=5241e3;if(!qq.ios())throw new qq.Error("Downsampled dimensions can only be reliably calculated for iOS!");return a.origHeight*a.origWidth>b?{newHeight:Math.round(Math.sqrt(b*(a.origHeight/a.origWidth))),newWidth:Math.round(Math.sqrt(b*(a.origWidth/a.origHeight)))}:void 0}function e(c,e,g,h){var i,j=c.naturalWidth,k=c.naturalHeight,l=g.width,m=g.height,n=e.getContext("2d");n.save(),qq.supportedFeatures.unlimitedScaledImageSize||(i=d({origWidth:l,origHeight:m}),i&&(qq.log(qq.format("Had to reduce dimensions due to device limitations from {}w / {}h to {}w / {}h",l,m,i.newWidth,i.newHeight),"warn"),l=i.newWidth,m=i.newHeight)),f(e,l,m,g.orientation),qq.ios()?function(){a(c)&&(j/=2,k/=2);var d,e,f,g=1024,i=document.createElement("canvas"),o=h?b(c,j,k):1,p=Math.ceil(g*l/j),q=Math.ceil(g*m/k/o),r=0,s=0;for(i.width=i.height=g,d=i.getContext("2d");k>r;){for(e=0,f=0;j>e;)d.clearRect(0,0,g,g),d.drawImage(c,-e,-r),n.drawImage(i,0,0,g,g,f,s,p,q),e+=g,f+=p;r+=g,s+=q}n.restore(),i=d=null}():n.drawImage(c,0,0,l,m),e.qqImageRendered&&e.qqImageRendered()}function f(a,b,c,d){switch(d){case 5:case 6:case 7:case 8:a.width=c,a.height=b;break;default:a.width=b,a.height=c}var e=a.getContext("2d");switch(d){case 2:e.translate(b,0),e.scale(-1,1);break;case 3:e.translate(b,c),e.rotate(Math.PI);break;case 4:e.translate(0,c),e.scale(1,-1);break;case 5:e.rotate(.5*Math.PI),e.scale(1,-1);break;case 6:e.rotate(.5*Math.PI),e.translate(0,-c);break;case 7:e.rotate(.5*Math.PI),e.translate(b,-c),e.scale(-1,1);break;case 8:e.rotate(-.5*Math.PI),e.translate(-b,0)}}function g(a,b){var c=this;window.Blob&&a instanceof Blob&&function(){var b=new Image,d=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!d)throw Error("No createObjectURL function found to create blob url");b.src=d.createObjectURL(a),c.blob=a,a=b}(),a.naturalWidth||a.naturalHeight||(a.onload=function(){var a=c.imageLoadListeners;a&&(c.imageLoadListeners=null,setTimeout(function(){for(var b=0,c=a.length;c>b;b++)a[b]()},0))},a.onerror=b,this.imageLoadListeners=[]),this.srcImage=a}g.prototype.render=function(a,b){b=b||{};var d,f=this,g=this.srcImage.naturalWidth,h=this.srcImage.naturalHeight,i=b.width,j=b.height,k=b.maxWidth,l=b.maxHeight,m=!this.blob||"image/jpeg"===this.blob.type,n=a.tagName.toLowerCase();return this.imageLoadListeners?(this.imageLoadListeners.push(function(){f.render(a,b)}),void 0):(i&&!j?j=h*i/g<<0:j&&!i?i=g*j/h<<0:(i=g,j=h),k&&i>k&&(i=k,j=h*i/g<<0),l&&j>l&&(j=l,i=g*j/h<<0),d={width:i,height:j},qq.each(b,function(a,b){d[a]=b}),"img"===n?function(){var b=a.src;a.src=c(f.srcImage,d,m),b===a.src&&a.onload()}():"canvas"===n&&e(this.srcImage,a,d,m),"function"==typeof this.onrender&&this.onrender(a),void 0)},qq.MegaPixImage=g}(),qq.ImageGenerator=function(a){"use strict";function b(a){return"img"===a.tagName.toLowerCase()}function c(a){return"canvas"===a.tagName.toLowerCase()}function d(){return void 0!==(new Image).crossOrigin}function e(){var a=document.createElement("canvas");return a.getContext&&a.getContext("2d")}function f(a){var b=a.split("/"),c=b[b.length-1],d=qq.getExtension(c);switch(d=d&&d.toLowerCase()){case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"bmp":return"image/bmp";case"gif":return"image/gif";case"tiff":case"tif":return"image/tiff"}}function g(a){var b,c,d,e=document.createElement("a");return e.href=a,b=e.protocol,d=e.port,c=e.hostname,b.toLowerCase()!==window.location.protocol.toLowerCase()?!0:c.toLowerCase()!==window.location.hostname.toLowerCase()?!0:d===window.location.port||qq.ie()?!1:!0}function h(b,c){b.onload=function(){b.onload=null,b.onerror=null,c.success(b)},b.onerror=function(){b.onload=null,b.onerror=null,a("Problem drawing thumbnail!","error"),c.failure(b,"Problem drawing thumbnail!")}}function i(a,b){a.qqImageRendered=function(){b.success(a)}}function j(d,e){var f=b(d)||c(d);return b(d)?h(d,e):c(d)?i(d,e):(e.failure(d),a(qq.format("Element container of type {} is not supported!",d.tagName),"error")),f}function k(b,c,d){var e=new qq.Promise,f=new qq.Identify(b,a),g=d.maxSize,h=null==d.orient?!0:d.orient,i=function(){c.onerror=null,c.onload=null,a("Could not render preview, file may be too large!","error"),e.failure(c,"Browser cannot render image!")};return f.isPreviewable().then(function(d){var f={parse:function(){return(new qq.Promise).success()}},k=h?new qq.Exif(b,a):f,l=new qq.MegaPixImage(b,i);j(c,e)&&k.parse().then(function(a){var b=a&&a.Orientation;l.render(c,{maxWidth:g,maxHeight:g,orientation:b,mime:d})},function(b){a(qq.format("EXIF data could not be parsed ({}). Assuming orientation = 1.",b)),l.render(c,{maxWidth:g,maxHeight:g,mime:d})})},function(){a("Not previewable"),e.failure(c,"Not previewable")}),e}function l(a,b,c,d){var e=new Image,h=new qq.Promise;j(e,h),g(a)&&(e.crossOrigin="anonymous"),e.src=a,h.then(function(){j(b,c);var g=new qq.MegaPixImage(e);g.render(b,{maxWidth:d,maxHeight:d,mime:f(a)})},c.failure)}function m(a,b,c,d){j(b,c),qq(b).css({maxWidth:d+"px",maxHeight:d+"px"}),b.src=a}function n(a,f,h){var i=new qq.Promise,k=h.scale,n=k?h.maxSize:null;return k&&b(f)?e()?g(a)&&!d()?m(a,f,i,n):l(a,f,i,n):m(a,f,i,n):c(f)?l(a,f,i,n):j(f,i)&&(f.src=a),i}qq.extend(this,{generate:function(b,c,d){return qq.isString(b)?(a("Attempting to update thumbnail based on server response."),n(b,c,d||{})):(a("Attempting to draw client-side image preview."),k(b,c,d||{}))}})},qq.Exif=function(a,b){"use strict";function c(a){for(var b=0,c=0;a.length>0;)b+=parseInt(a.substring(0,2),16)*Math.pow(2,c),a=a.substring(2,a.length),c+=8;return b}function d(b,c){var e=b,f=c;return void 0===e&&(e=2,f=new qq.Promise),qq.readBlobToHex(a,e,4).then(function(a){var b,c=/^ffe([0-9])/.exec(a);c?"1"!==c[1]?(b=parseInt(a.slice(4,8),16),d(e+b+2,f)):f.success(e):f.failure("No EXIF header to be found!")}),f}function e(){var b=new qq.Promise;return qq.readBlobToHex(a,0,6).then(function(a){0!==a.indexOf("ffd8")?b.failure("Not a valid JPEG!"):d().then(function(a){b.success(a)},function(a){b.failure(a)})}),b}function f(b){var c=new qq.Promise;return qq.readBlobToHex(a,b+10,2).then(function(a){c.success("4949"===a)}),c}function g(b,d){var e=new qq.Promise;return qq.readBlobToHex(a,b+18,2).then(function(a){return d?e.success(c(a)):(e.success(parseInt(a,16)),void 0)}),e}function h(b,c){var d=b+20,e=12*c;return qq.readBlobToHex(a,d,e)}function i(a){for(var b=[],c=0;c+24<=a.length;)b.push(a.slice(c,c+24)),c+=24;return b}function j(a,b){var d=16,e=qq.extend([],k),f={};return qq.each(b,function(b,g){var h,i,j,k=g.slice(0,4),m=a?c(k):parseInt(k,16),n=e.indexOf(m);return n>=0&&(i=l[m].name,j=l[m].bytes,h=g.slice(d,d+2*j),f[i]=a?c(h):parseInt(h,16),e.splice(n,1)),0===e.length?!1:void 0}),f}var k=[274],l={274:{name:"Orientation",bytes:2}};qq.extend(this,{parse:function(){var c=new qq.Promise,d=function(a){b(qq.format("EXIF header parse failed: '{}' ",a)),c.failure(a)};return e().then(function(e){b(qq.format("Moving forward with EXIF header parsing for '{}'",void 0===a.name?"blob":a.name)),f(e).then(function(a){b(qq.format("EXIF Byte order is {} endian",a?"little":"big")),g(e,a).then(function(f){b(qq.format("Found {} APP1 directory entries",f)),h(e,f).then(function(d){var e=i(d),f=j(a,e);b("Successfully parsed some EXIF tags"),c.success(f)},d)},d)},d)},d),c}})},qq.Identify=function(a,b){"use strict";function c(a,b){var c=!1,d=[].concat(a);return qq.each(d,function(a,d){return 0===b.indexOf(d)?(c=!0,!1):void 0}),c}qq.extend(this,{isPreviewable:function(){var d=this,e=new qq.Promise,f=!1,g=void 0===a.name?"blob":a.name;return b(qq.format("Attempting to determine if {} can be rendered in this browser",g)),b("First pass: check type attribute of blob object."),this.isPreviewableSync()?(b("Second pass: check for magic bytes in file header."),qq.readBlobToHex(a,0,4).then(function(a){qq.each(d.PREVIEWABLE_MIME_TYPES,function(b,d){return c(d,a)?(("image/tiff"!==b||qq.supportedFeatures.tiffPreviews)&&(f=!0,e.success(b)),!1):void 0}),b(qq.format("'{}' is {} able to be rendered in this browser",g,f?"":"NOT")),f||e.failure()},function(){b("Error reading file w/ name '"+g+"'. Not able to be rendered in this browser."),e.failure()})):e.failure(),e},isPreviewableSync:function(){var c=a.type,d=qq.indexOf(Object.keys(this.PREVIEWABLE_MIME_TYPES),c)>=0,e=!1,f=void 0===a.name?"blob":a.name;return d&&(e="image/tiff"===c?qq.supportedFeatures.tiffPreviews:!0),!e&&b(f+" is not previewable in this browser per the blob's type attr"),e}})},qq.Identify.prototype.PREVIEWABLE_MIME_TYPES={"image/jpeg":"ffd8ff","image/gif":"474946","image/png":"89504e","image/bmp":"424d","image/tiff":["49492a00","4d4d002a"]},qq.ImageValidation=function(a,b){"use strict";function c(a){var b=!1;return qq.each(a,function(a,c){return c>0?(b=!0,!1):void 0}),b}function d(){var c=new qq.Promise;return new qq.Identify(a,b).isPreviewable().then(function(){var d=new Image,e=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;e?(d.onerror=function(){b("Cannot determine dimensions for image. May be too large.","error"),c.failure()},d.onload=function(){c.success({width:this.width,height:this.height})},d.src=e.createObjectURL(a)):(b("No createObjectURL function available to generate image URL!","error"),c.failure())},c.failure),c}function e(a,b){var c;return qq.each(a,function(a,d){if(d>0){var e=/(max|min)(Width|Height)/.exec(a),f=e[2].charAt(0).toLowerCase()+e[2].slice(1),g=b[f];switch(e[1]){case"min":if(d>g)return c=a,!1;break;case"max":if(g>d)return c=a,!1}}}),c}this.validate=function(a){var f=new qq.Promise;return b("Attempting to validate image."),c(a)?d().then(function(b){var c=e(a,b);c?f.failure(c):f.success()},f.success):f.success(),f}},qq.Session=function(a){"use strict";function b(a){return qq.isArray(a)?!0:(d.log("Session response is not an array.","error"),void 0)}function c(a,c,e,f){var g=!1;c=c&&b(a),c&&qq.each(a,function(a,b){if(null==b.uuid)g=!0,d.log(qq.format("Session response item {} did not include a valid UUID - ignoring.",a),"error");else if(null==b.name)g=!0,d.log(qq.format("Session response item {} did not include a valid name - ignoring.",a),"error");else try{return d.addFileRecord(b),!0}catch(c){g=!0,d.log(c.message,"error")}return!1}),f[c&&!g?"success":"failure"](a,e)}var d={endpoint:null,params:{},customHeaders:{},cors:{},addFileRecord:function(){},log:function(){}};qq.extend(d,a,!0),this.refresh=function(){var a=new qq.Promise,b=function(b,d,e){c(b,d,e,a)},e=qq.extend({},d),f=new qq.SessionAjaxRequester(qq.extend(e,{onComplete:b}));return f.queryServer(),a}},qq.SessionAjaxRequester=function(a){"use strict";function b(a,b,c){var e=null;if(null!=b.responseText)try{e=qq.parseJson(b.responseText)}catch(f){d.log("Problem parsing session response: "+f.message,"error"),c=!0}d.onComplete(e,!c,b)}var c,d={endpoint:null,customHeaders:{},params:{},cors:{expected:!1,sendCredentials:!1},onComplete:function(){},log:function(){}};qq.extend(d,a),c=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["GET"],method:"GET",endpointStore:{get:function(){return d.endpoint}},customHeaders:d.customHeaders,log:d.log,onComplete:b,cors:d.cors})),qq.extend(this,{queryServer:function(){var a=qq.extend({},d.params);d.log("Session query request."),c.initTransport("sessionRefresh").withParams(a).withCacheBuster().send()}})},qq.FormSupport=function(a,b,c){"use strict";function d(a){a.getAttribute("action")&&(h.newEndpoint=a.getAttribute("action"))}function e(a,b){return!a.checkValidity||a.checkValidity()?!0:(c("Form did not pass validation checks - will not upload.","error"),b(),void 0)}function f(a){var c=a.submit;qq(a).attach("submit",function(d){d=d||window.event,d.preventDefault?d.preventDefault():d.returnValue=!1,e(a,c)&&b()}),a.submit=function(){e(a,c)&&b()}}function g(a){return a&&(qq.isString(a)&&(a=document.getElementById(a)),a&&(c("Attaching to form element."),d(a),i&&f(a))),a}var h=this,i=a.interceptSubmit,j=a.element,k=a.autoUpload;qq.extend(this,{newEndpoint:null,newAutoUpload:k,attachedToForm:!1,getFormInputsAsObject:function(){return null==j?null:h._form2Obj(j)}}),j=g(j),this.attachedToForm=!!j},qq.extend(qq.FormSupport.prototype,{_form2Obj:function(a){"use strict";var b={},c=function(a){var b=["button","image","reset","submit"];return qq.indexOf(b,a.toLowerCase())<0},d=function(a){return qq.indexOf(["checkbox","radio"],a.toLowerCase())>=0},e=function(a){return d(a.type)&&!a.checked?!0:a.disabled&&"hidden"!==a.type.toLowerCase()},f=function(a){var b=null;return qq.each(qq(a).children(),function(a,c){return"option"===c.tagName.toLowerCase()&&c.selected?(b=c.value,!1):void 0}),b};return qq.each(a.elements,function(a,d){if(!qq.isInput(d,!0)&&"textarea"!==d.tagName.toLowerCase()||!c(d.type)||e(d)){if("select"===d.tagName.toLowerCase()&&!e(d)){var g=f(d);null!==g&&(b[d.name]=g)}}else b[d.name]=d.value}),b}}),qq.Scaler=function(a,b){"use strict";var c=a.sendOriginal,d=a.orient,e=a.defaultType,f=a.defaultQuality/100,g=a.failureText,h=a.includeExif,i=this._getSortedSizes(a.sizes);qq.extend(this,{enabled:qq.supportedFeatures.scaling&&i.length>0,getFileRecords:function(a,j,k){var l=this,m=[],n=k.blob?k.blob:k,o=new qq.Identify(n,b);return o.isPreviewableSync()?(qq.each(i,function(a,c){var i=l._determineOutputType({defaultType:e,requestedType:c.type,refType:n.type});m.push({uuid:qq.getUniqueId(),name:l._getName(j,{name:c.name,type:i,refType:n.type}),blob:new qq.BlobProxy(n,qq.bind(l._generateScaledImage,l,{maxSize:c.maxSize,orient:d,type:i,quality:f,failedText:g,includeExif:h,log:b}))})}),m.push({uuid:a,name:j,size:n.size,blob:c?n:null})):m.push({uuid:a,name:j,size:n.size,blob:n}),m},handleNewFile:function(a,b,c,d,e,f,g,h){var i=this,j=(a.qqButtonId||a.blob&&a.blob.qqButtonId,[]),k=null,l=h.addFileToHandler,m=h.uploadData,n=h.paramsStore,o=qq.getUniqueId();qq.each(i.getFileRecords(c,b,a),function(a,b){var c,d=b.size;b.blob instanceof qq.BlobProxy&&(d=-1),c=m.addFile({uuid:b.uuid,name:b.name,size:d,batchId:f,proxyGroupId:o}),b.blob instanceof qq.BlobProxy?j.push(c):k=c,b.blob?(l(c,b.blob),e.push({id:c,file:b.blob})):m.setStatus(c,qq.status.REJECTED)
}),null!==k&&(qq.each(j,function(a,b){var c={qqparentuuid:m.retrieve({id:k}).uuid,qqparentsize:m.retrieve({id:k}).size};c[g]=m.retrieve({id:b}).uuid,m.setParentId(b,k),n.addReadOnly(b,c)}),j.length&&function(){var a={};a[g]=m.retrieve({id:k}).uuid,n.addReadOnly(k,a)}())}})},qq.extend(qq.Scaler.prototype,{scaleImage:function(a,b,c){"use strict";if(!qq.supportedFeatures.scaling)throw new qq.Error("Scaling is not supported in this browser!");var d=new qq.Promise,e=c.log,f=c.getFile(a),g=c.uploadData.retrieve({id:a}),h=g&&g.name,i=g&&g.uuid,j={sendOriginal:!1,orient:b.orient,defaultType:b.type||null,defaultQuality:b.quality,failedToScaleText:"Unable to scale",sizes:[{name:"",maxSize:b.maxSize}]},k=new qq.Scaler(j,e);return qq.Scaler&&qq.supportedFeatures.imagePreviews&&f?qq.bind(function(){var b=k.getFileRecords(i,h,f)[0];b&&b.blob instanceof qq.BlobProxy?b.blob.create().then(d.success,d.failure):(e(a+" is not a scalable image!","error"),d.failure())},this)():(d.failure(),e("Could not generate requested scaled image for "+a+". "+"Scaling is either not possible in this browser, or the file could not be located.","error")),d},_determineOutputType:function(a){"use strict";var b=a.requestedType,c=a.defaultType,d=a.refType;return c||b?b?qq.indexOf(Object.keys(qq.Identify.prototype.PREVIEWABLE_MIME_TYPES),b)>=0?"image/tiff"===b?qq.supportedFeatures.tiffPreviews?b:c:b:c:c:"image/jpeg"!==d?"image/png":d},_getName:function(a,b){"use strict";var c=a.lastIndexOf("."),d=b.type||"image/png",e=b.refType,f="",g=qq.getExtension(a),h="";return b.name&&b.name.trim().length&&(h=" ("+b.name+")"),c>=0?(f=a.substr(0,c),e!==d&&(g=d.split("/")[1]),f+=h+"."+g):f=a+h,f},_getSortedSizes:function(a){"use strict";return a=qq.extend([],a),a.sort(function(a,b){return a.maxSize>b.maxSize?1:a.maxSize<b.maxSize?-1:0})},_generateScaledImage:function(a,b){"use strict";var c=this,d=a.log,e=a.maxSize,f=a.orient,g=a.type,h=a.quality,i=a.failedText,j=a.includeExif&&"image/jpeg"===b.type&&"image/jpeg"===g,k=new qq.Promise,l=new qq.ImageGenerator(d),m=document.createElement("canvas");return d("Attempting to generate scaled version for "+b.name),l.generate(b,m,{maxSize:e,orient:f}).then(function(){var a=m.toDataURL(g,h),e=function(){d("Success generating scaled version for "+b.name);var c=qq.dataUriToBlob(a);k.success(c)};j?c._insertExifHeader(b,a,d).then(function(b){a=b,e()},function(){d("Problem inserting EXIF header into scaled image. Using scaled image w/out EXIF data.","error"),e()}):e()},function(){d("Failed attempt to generate scaled version for "+b.name,"error"),k.failure(i)}),k},_insertExifHeader:function(a,b,c){"use strict";var d=new FileReader,e=new qq.Promise,f="";return d.onload=function(){f=d.result,e.success(qq.ExifRestorer.restore(f,b))},d.onerror=function(){c("Problem reading "+a.name+" during attempt to transfer EXIF data to scaled version.","error"),e.failure()},d.readAsDataURL(a),e},_dataUriToBlob:function(a){"use strict";var b,c,d,e;return b=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURI(a.split(",")[1]),c=a.split(",")[0].split(":")[1].split(";")[0],d=new ArrayBuffer(b.length),e=new Uint8Array(d),qq.each(b,function(a,b){e[a]=b.charCodeAt(0)}),this._createBlob(d,c)},_createBlob:function(a,b){"use strict";var c=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,d=c&&new c;return d?(d.append(a),d.getBlob(b)):new Blob([a],{type:b})}}),qq.ExifRestorer=function(){var a={};return a.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a.encode64=function(a){var b,c,d,e,f,g="",h="",i="",j=0;do b=a[j++],c=a[j++],h=a[j++],d=b>>2,e=(3&b)<<4|c>>4,f=(15&c)<<2|h>>6,i=63&h,isNaN(c)?f=i=64:isNaN(h)&&(i=64),g=g+this.KEY_STR.charAt(d)+this.KEY_STR.charAt(e)+this.KEY_STR.charAt(f)+this.KEY_STR.charAt(i),b=c=h="",d=e=f=i="";while(j<a.length);return g},a.restore=function(a,b){var c="data:image/jpeg;base64,";if(!a.match(c))return b;var d=this.decode64(a.replace(c,"")),e=this.slice2Segments(d),f=this.exifManipulation(b,e);return c+this.encode64(f)},a.exifManipulation=function(a,b){var c=this.getExifArray(b),d=this.insertExif(a,c),e=new Uint8Array(d);return e},a.getExifArray=function(a){for(var b,c=0;c<a.length;c++)if(b=a[c],255==b[0]&225==b[1])return b;return[]},a.insertExif=function(a,b){var c=a.replace("data:image/jpeg;base64,",""),d=this.decode64(c),e=d.indexOf(255,3),f=d.slice(0,e),g=d.slice(e),h=f;return h=h.concat(b),h=h.concat(g)},a.slice2Segments=function(a){for(var b=0,c=[];;){if(255==a[b]&218==a[b+1])break;if(255==a[b]&216==a[b+1])b+=2;else{var d=256*a[b+2]+a[b+3],e=b+d+2,f=a.slice(b,e);c.push(f),b=e}if(b>a.length)break}return c},a.decode64=function(a){var b,c,d,e,f,g="",h="",i=0,j=[],k=/[^A-Za-z0-9\+\/\=]/g;if(k.exec(a))throw new Error("There were invalid base64 characters in the input text. Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='");a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");do d=this.KEY_STR.indexOf(a.charAt(i++)),e=this.KEY_STR.indexOf(a.charAt(i++)),f=this.KEY_STR.indexOf(a.charAt(i++)),h=this.KEY_STR.indexOf(a.charAt(i++)),b=d<<2|e>>4,c=(15&e)<<4|f>>2,g=(3&f)<<6|h,j.push(b),64!=f&&j.push(c),64!=h&&j.push(g),b=c=g="",d=e=f=h="";while(i<a.length);return j},a}(),qq.TotalProgress=function(a,b){"use strict";var c={},d=0,e=0,f=-1,g=-1,h=function(b,c){(b!==f||c!==g)&&a(b,c),f=b,g=c},i=function(a,b){var c=!0;return qq.each(a,function(a,d){return qq.indexOf(b,d)>=0?(c=!1,!1):void 0}),c},j=function(a){m(a,-1,-1),delete c[a]},k=function(a,b,c){(0===b.length||i(b,c))&&(h(e,e),this.reset())},l=function(a){var d=b(a);d>0&&(m(a,0,d),c[a]={loaded:0,total:d})},m=function(a,b,f){var g=c[a]?c[a].loaded:0,i=c[a]?c[a].total:0;-1===b&&-1===f?(d-=g,e-=i):(b&&(d+=b-g),f&&(e+=f-i)),h(d,e)};qq.extend(this,{onAllComplete:k,onStatusChange:function(a,b,c){c===qq.status.CANCELED||c===qq.status.REJECTED?j(a):c===qq.status.SUBMITTING&&l(a)},onIndividualProgress:function(a,b,d){m(a,b,d),c[a]={loaded:b,total:d}},onNewSize:function(a){l(a)},reset:function(){c={},d=0,e=0}})},qq.UiEventHandler=function(a,b){"use strict";function c(a){d.attach(a,e.eventType,function(a){a=a||window.event;var b=a.target||a.srcElement;e.onHandled(b,a)})}var d=new qq.DisposeSupport,e={eventType:"click",attachTo:null,onHandled:function(){}};qq.extend(this,{addHandler:function(a){c(a)},dispose:function(){d.dispose()}}),qq.extend(b,{getFileIdFromItem:function(a){return a.qqFileId},getDisposeSupport:function(){return d}}),qq.extend(e,a),e.attachTo&&c(e.attachTo)},qq.FileButtonsClickHandler=function(a){"use strict";function b(a,b){qq.each(e,function(c,e){var f,g=c.charAt(0).toUpperCase()+c.slice(1);return d.templating["is"+g](a)?(f=d.templating.getFileId(a),qq.preventDefault(b),d.log(qq.format("Detected valid file button click event on file '{}', ID: {}.",d.onGetName(f),f)),e(f),!1):void 0})}var c={},d={templating:null,log:function(){},onDeleteFile:function(){},onCancel:function(){},onRetry:function(){},onPause:function(){},onContinue:function(){},onGetName:function(){}},e={cancel:function(a){d.onCancel(a)},retry:function(a){d.onRetry(a)},deleteButton:function(a){d.onDeleteFile(a)},pause:function(a){d.onPause(a)},continueButton:function(a){d.onContinue(a)}};qq.extend(d,a),d.eventType="click",d.onHandled=b,d.attachTo=d.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(d,c))},qq.FilenameClickHandler=function(a){"use strict";function b(a,b){if(d.templating.isFileName(a)||d.templating.isEditIcon(a)){var e=d.templating.getFileId(a),f=d.onGetUploadStatus(e);f===qq.status.SUBMITTED&&(d.log(qq.format("Detected valid filename click event on file '{}', ID: {}.",d.onGetName(e),e)),qq.preventDefault(b),c.handleFilenameEdit(e,a,!0))}}var c={},d={templating:null,log:function(){},classes:{file:"qq-upload-file",editNameIcon:"qq-edit-filename-icon"},onGetUploadStatus:function(){},onGetName:function(){}};qq.extend(d,a),d.eventType="click",d.onHandled=b,qq.extend(this,new qq.FilenameEditHandler(d,c))},qq.FilenameInputFocusInHandler=function(a,b){"use strict";function c(a){if(d.templating.isEditInput(a)){var c=d.templating.getFileId(a),e=d.onGetUploadStatus(c);e===qq.status.SUBMITTED&&(d.log(qq.format("Detected valid filename input focus event on file '{}', ID: {}.",d.onGetName(c),c)),b.handleFilenameEdit(c,a))}}var d={templating:null,onGetUploadStatus:function(){},log:function(){}};b||(b={}),d.eventType="focusin",d.onHandled=c,qq.extend(d,a),qq.extend(this,new qq.FilenameEditHandler(d,b))},qq.FilenameInputFocusHandler=function(a){"use strict";a.eventType="focus",a.attachTo=null,qq.extend(this,new qq.FilenameInputFocusInHandler(a,{}))},qq.FilenameEditHandler=function(a,b){"use strict";function c(a){var b=h.onGetName(a),c=b.lastIndexOf(".");return c>0&&(b=b.substr(0,c)),b}function d(a){var b=h.onGetName(a);return qq.getExtension(b)}function e(a,b){var c,e=a.value;void 0!==e&&qq.trimStr(e).length>0&&(c=d(b),void 0!==c&&(e=e+"."+c),h.onSetName(b,e)),h.onEditingStatusChange(b,!1)}function f(a,c){b.getDisposeSupport().attach(a,"blur",function(){e(a,c)})}function g(a,c){b.getDisposeSupport().attach(a,"keyup",function(b){var d=b.keyCode||b.which;13===d&&e(a,c)})}var h={templating:null,log:function(){},onGetUploadStatus:function(){},onGetName:function(){},onSetName:function(){},onEditingStatusChange:function(){}};qq.extend(h,a),h.attachTo=h.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(h,b)),qq.extend(b,{handleFilenameEdit:function(a,b,d){var e=h.templating.getEditInput(a);h.onEditingStatusChange(a,!0),e.value=c(a),d&&e.focus(),f(e,a),g(e,a)}})},function(a){"use strict";function b(a){var b=h(a||{}),d=c(b);return e(d),g(b,d),l}function c(a){var b=f("uploaderType"),c=f("endpointType");return b?(b=b.charAt(0).toUpperCase()+b.slice(1).toLowerCase(),c?new qq[c]["FineUploader"+b](a):new qq["FineUploader"+b](a)):c?new qq[c].FineUploader(a):new qq.FineUploader(a)}function d(a,b){var c=l.data("fineuploader");return b?(void 0===c&&(c={}),c[a]=b,l.data("fineuploader",c),void 0):void 0===c?null:c[a]}function e(a){return d("uploader",a)}function f(a,b){return d(a,b)}function g(b,c){var d=b.callbacks={};a.each(c._options.callbacks,function(b,c){var e,f;e=/^on(\w+)/.exec(b)[1],e=e.substring(0,1).toLowerCase()+e.substring(1),f=l,d[b]=function(){var b,d,g=Array.prototype.slice.call(arguments),h=[];a.each(g,function(a,b){h.push(k(b))}),b=c.apply(this,g);try{d=f.triggerHandler(e,h)}catch(i){qq.log("Caught error in Fine Uploader jQuery event handler: "+i.message,"error")}return null!=b?b:d}}),c._options.callbacks=d}function h(b,c){var d,e;return d=void 0===c?"basic"!==b.uploaderType?{element:l[0]}:{}:c,a.each(b,function(b,c){a.inArray(b,m)>=0?f(b,c):c instanceof a?d[b]=c[0]:a.isPlainObject(c)?(d[b]={},h(c,d[b])):a.isArray(c)?(e=[],a.each(c,function(b,c){var d={};c instanceof a?a.merge(e,c):a.isPlainObject(c)?(h(c,d),e.push(d)):e.push(c)}),d[b]=e):d[b]=c}),void 0===c?d:void 0}function i(b){return"string"===a.type(b)&&!b.match(/^_/)&&void 0!==e()[b]}function j(a){var b,c=[],d=Array.prototype.slice.call(arguments,1);return h(d,c),b=e()[a].apply(e(),c),k(b)}function k(b){var c=b;return null==b||"object"!=typeof b||1!==b.nodeType&&9!==b.nodeType||!b.cloneNode||(c=a(b)),c}var l,m=["uploaderType","endpointType"];a.fn.fineUploader=function(c){var d=this,f=arguments,g=[];return this.each(function(h,k){if(l=a(k),e()&&i(c)){if(g.push(j.apply(d,f)),1===d.length)return!1}else"object"!=typeof c&&c?a.error("Method "+c+" does not exist on jQuery.fineUploader"):b.apply(d,f)}),1===g.length?g[0]:g.length>1?g:this}}(jQuery),function(a){"use strict";function b(a){a||(a={}),a.dropZoneElements=[i];var b=f(a);return e(b),d(new qq.DragAndDrop(b)),i}function c(a,b){var c=i.data(j);return b?(void 0===c&&(c={}),c[a]=b,i.data(j,c),void 0):void 0===c?null:c[a]}function d(a){return c("dndInstance",a)}function e(b){var c=b.callbacks={};a.each(new qq.DragAndDrop.callbacks,function(a){var b,d=a;b=i,c[a]=function(){var a=Array.prototype.slice.call(arguments),c=b.triggerHandler(d,a);return c}})}function f(b,c){var d,e;return d=void 0===c?{}:c,a.each(b,function(b,c){c instanceof a?d[b]=c[0]:a.isPlainObject(c)?(d[b]={},f(c,d[b])):a.isArray(c)?(e=[],a.each(c,function(b,c){c instanceof a?a.merge(e,c):e.push(c)}),d[b]=e):d[b]=c}),void 0===c?d:void 0}function g(b){return"string"===a.type(b)&&"dispose"===b&&void 0!==d()[b]}function h(a){var b=[],c=Array.prototype.slice.call(arguments,1);return f(c,b),d()[a].apply(d(),b)}var i,j="fineUploaderDnd";a.fn.fineUploaderDnd=function(c){var e=this,f=arguments,j=[];return this.each(function(k,l){if(i=a(l),d()&&g(c)){if(j.push(h.apply(e,f)),1===e.length)return!1}else"object"!=typeof c&&c?a.error("Method "+c+" does not exist in Fine Uploader's DnD module."):b.apply(e,f)}),1===j.length?j[0]:j.length>1?j:this}}(jQuery),"function"==typeof define&&define.amd?define(function(){return qq}):"undefined"!=typeof module&&module.exports?module.exports=qq:global.qq=qq}(window);
/*! 2016-05-06 */
| brix/cdnjs | ajax/libs/file-uploader/5.8.0-beta1/jquery.fine-uploader/jquery.fine-uploader.min.js | JavaScript | mit | 141,577 |
/*!
* Riloadr.js 1.1.0 (c) 2012 Tubal Martin - MIT license
*/
!function(a){typeof define=="function"&&define.amd?define(["jquery"],a):window.Riloadr=a(jQuery)}(function(a){function Q(b){function Q(){Z(B,m,H),Z(B,n,I),K&&(P=B[v],Z(B,y,J))}function bb(){$(B,m,H),$(B,n,I),K&&$(B,y,J)}function cb(a,b){a[r]=c,a[q]=0,a[o]=db,a[p]=eb,a.src=T(a,i,N),M.splice(b,1)}function db(){var a=this;a[o]=a[p]=f,a[s]=a[s].replace(w,"$1$2"),o in b&&b[o][h](a)}function eb(){var a=this;E>0&&a[q]<E&&(a[q]++,a.src=T(a,i,N,c)),p in b&&b[p][h](a)}var g=this,i=b.base||k,j=b.breakpoints||Y('"breakpoints" not defined.'),t=b.name||"responsive",w=new RegExp("(^|\\s)"+t+"(\\s|$)"),x=b.defer&&b.defer.toLowerCase()||d,D=b.foldDistance||100,E=b[q]||0,F=b.root||f,G=x==="belowfold"&&!O,H=G&&V(function(){g[u]()},e),I=G&&W(function(){g[u]()},e),J=G&&W(function(){B[v]!==P&&(P=B[v],g[u]())},e),M=[],N;g[u]=function(b){X(function(d,e){if(!M[l]||b===c)G&&Q(),a("img."+t,F).each(function(a,b){b&&!b[r]&&M.push(b)});if(M[l]){e=0;while(d=M[e])d&&!d[r]&&(!G||G&&!U(d,D))&&(cb(d,e),e--),e++}G&&!M[l]&&bb(),d=f})},_(function(){z=a(B),A=C.body,F=F&&a("#"+F)||A,L=L||S(),N=R(j,L),!x||G?g[u]():ab(g[u])})}function R(a,b){var c=k,d=b,e=0,f,g,h,i,j;while(f=a[e]){g=f.name,h=f.minWidth,i=f.maxWidth,j=f.minDevicePixelRatio;if(b>0){if(h&&i&&b>=h&&b<=i||h&&!i&&b>=h||i&&!h&&b<=i)if(!j||j&&N>=j)c=g}else if(d<=0||h<d||i<d)d=h||i||d,c=g;e++}return c+k}function S(){var a=Math,b=[D.clientWidth,D.offsetWidth,A.clientWidth],c=a.ceil(M/N),d=b[l],e=0,f;for(;e<d;e++)isNaN(b[e])&&(b.splice(e,1),e--);return b[l]&&(f=a.max[i](a,b),isNaN(c)||(f=a.min(c,f))),f||c||0}function T(a,b,c,d){var e=(a.getAttribute("data-base")||b)+(a.getAttribute("data-src")||k);return d&&(e+=(I.test(e)?"&":"?")+"riloadrts="+(new Date).getTime()),e.replace(J,c)}function U(b,c){return z.height()+z.scrollTop()<=a(b).offset().top-c}function V(a,b){function j(){h=new Date,g=f,a[i](e,c)}var c,d,e,g,h=0;return function(){var f=new Date,k=b-(f-h);return c=arguments,e=this,k<=0?(h=f,d=a[i](e,c)):g||(g=setTimeout(j,k)),d}}function W(a,b,c){function j(){h=f,c||a[i](g,d)}var d,e,g,h;return function(){var f=c&&!h;return d=arguments,g=this,clearTimeout(h),h=setTimeout(j,b),f&&(e=a[i](g,d)),e}}function X(a){var b=Array[t].slice[h](arguments,1);setTimeout(function(){return a[i](f,b)},1)}function Y(a){throw new Error("Riloadr: "+a)}function Z(a,b,c){a[G](F+b,c,d)}function $(a,b,c){a[H](F+b,c,d)}function _(b){a(b)}function ab(a){if(C.readyState==="complete")a();else{var b=function(){$(B,g,b),a()};Z(B,g,b)}}"use strict";var b="on",c=!0,d=!1,e=250,f=null,g="load",h="call",i="apply",j="error",k="",l="length",m="scroll",n="resize",o=b+g,p=b+j,q="retries",r="riloaded",s="className",t="prototype",u="loadImages",v="orientation",w="EventListener",x="add"+w,y=v+"change",z,A,B=window,C=B.document,D=C.documentElement,E=x in C,F=E?k:b,G=E?x:"attachEvent",H=E?"remove"+w:"detachEvent",I=/\?/,J=/{breakpoint-name}/gi,K=v in B&&b+y in B,L,M=B.screen.width,N=B.devicePixelRatio||1,O=Object[t].toString[h](B.operamini)==="[object OperaMini]",P;return D[s]=D[s].replace(/(^|\s)no-js(\s|$)/,"$1$2"),Q.version="1.1.0",Q[t].riload=function(){this[u](c)},Q}); | seogi1004/cdnjs | ajax/libs/riloadr/1.1.0/riloadr.jquery.min.js | JavaScript | mit | 3,169 |
/**
* videojs-contrib-hls
* @version 3.0.3
* @copyright 2016 Brightcove, Inc
* @license Apache-2.0
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.videojsContribHls = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/**
* @file bin-utils.js
*/
/**
* convert a TimeRange to text
*
* @param {TimeRange} range the timerange to use for conversion
* @param {Number} i the iterator on the range to convert
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var textRange = function textRange(range, i) {
return range.start(i) + '-' + range.end(i);
};
/**
* format a number as hex string
*
* @param {Number} e The number
* @param {Number} i the iterator
*/
var formatHexString = function formatHexString(e, i) {
var value = e.toString(16);
return '00'.substring(0, 2 - value.length) + value + (i % 2 ? ' ' : '');
};
var formatAsciiString = function formatAsciiString(e) {
if (e >= 0x20 && e < 0x7e) {
return String.fromCharCode(e);
}
return '.';
};
/**
* utils to help dump binary data to the console
*/
var utils = {
hexDump: function hexDump(data) {
var bytes = Array.prototype.slice.call(data);
var step = 16;
var result = '';
var hex = undefined;
var ascii = undefined;
for (var j = 0; j < bytes.length / step; j++) {
hex = bytes.slice(j * step, j * step + step).map(formatHexString).join('');
ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join('');
result += hex + ' ' + ascii + '\n';
}
return result;
},
tagDump: function tagDump(tag) {
return utils.hexDump(tag.bytes);
},
textRanges: function textRanges(ranges) {
var result = '';
var i = undefined;
for (i = 0; i < ranges.length; i++) {
result += textRange(ranges, i) + ' ';
}
return result;
}
};
exports['default'] = utils;
module.exports = exports['default'];
},{}],2:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = {
GOAL_BUFFER_LENGTH: 30
};
module.exports = exports["default"];
},{}],3:[function(require,module,exports){
/**
* @file decrypter/aes.js
*
* This file contains an adaptation of the AES decryption algorithm
* from the Standford Javascript Cryptography Library. That work is
* covered by the following copyright and permissions notice:
*
* Copyright 2009-2010 Emily Stark, Mike Hamburg, Dan Boneh.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 <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.
*
* The views and conclusions contained in the software and documentation
* are those of the authors and should not be interpreted as representing
* official policies, either expressed or implied, of the authors.
*/
/**
* Expand the S-box tables.
*
* @private
*/
'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; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var precompute = function precompute() {
var tables = [[[], [], [], [], []], [[], [], [], [], []]];
var encTable = tables[0];
var decTable = tables[1];
var sbox = encTable[4];
var sboxInv = decTable[4];
var i = undefined;
var x = undefined;
var xInv = undefined;
var d = [];
var th = [];
var x2 = undefined;
var x4 = undefined;
var x8 = undefined;
var s = undefined;
var tEnc = undefined;
var tDec = undefined;
// Compute double and third tables
for (i = 0; i < 256; i++) {
th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;
}
for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
// Compute sbox
s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
s = s >> 8 ^ s & 255 ^ 99;
sbox[x] = s;
sboxInv[s] = x;
// Compute MixColumns
x8 = d[x4 = d[x2 = d[x]]];
tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;
tEnc = d[s] * 0x101 ^ s * 0x1010100;
for (i = 0; i < 4; i++) {
encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;
}
}
// Compactify. Considerable speedup on Firefox.
for (i = 0; i < 5; i++) {
encTable[i] = encTable[i].slice(0);
decTable[i] = decTable[i].slice(0);
}
return tables;
};
var aesTables = null;
/**
* Schedule out an AES key for both encryption and decryption. This
* is a low-level class. Use a cipher mode to do bulk encryption.
*
* @class AES
* @param key {Array} The key as an array of 4, 6 or 8 words.
*/
var AES = (function () {
function AES(key) {
_classCallCheck(this, AES);
/**
* The expanded S-box and inverse S-box tables. These will be computed
* on the client so that we don't have to send them down the wire.
*
* There are two tables, _tables[0] is for encryption and
* _tables[1] is for decryption.
*
* The first 4 sub-tables are the expanded S-box with MixColumns. The
* last (_tables[01][4]) is the S-box itself.
*
* @private
*/
// if we have yet to precompute the S-box tables
// do so now
if (!aesTables) {
aesTables = precompute();
}
// then make a copy of that object for use
this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];
var i = undefined;
var j = undefined;
var tmp = undefined;
var encKey = undefined;
var decKey = undefined;
var sbox = this._tables[0][4];
var decTable = this._tables[1];
var keyLen = key.length;
var rcon = 1;
if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
throw new Error('Invalid aes key size');
}
encKey = key.slice(0);
decKey = [];
this._key = [encKey, decKey];
// schedule encryption keys
for (i = keyLen; i < 4 * keyLen + 28; i++) {
tmp = encKey[i - 1];
// apply sbox
if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {
tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];
// shift rows and add rcon
if (i % keyLen === 0) {
tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;
rcon = rcon << 1 ^ (rcon >> 7) * 283;
}
}
encKey[i] = encKey[i - keyLen] ^ tmp;
}
// schedule decryption keys
for (j = 0; i; j++, i--) {
tmp = encKey[j & 3 ? i : i - 4];
if (i <= 4 || j < 4) {
decKey[j] = tmp;
} else {
decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];
}
}
}
/**
* Decrypt 16 bytes, specified as four 32-bit words.
*
* @param {Number} encrypted0 the first word to decrypt
* @param {Number} encrypted1 the second word to decrypt
* @param {Number} encrypted2 the third word to decrypt
* @param {Number} encrypted3 the fourth word to decrypt
* @param {Int32Array} out the array to write the decrypted words
* into
* @param {Number} offset the offset into the output array to start
* writing results
* @return {Array} The plaintext.
*/
_createClass(AES, [{
key: 'decrypt',
value: function decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {
var key = this._key[1];
// state variables a,b,c,d are loaded with pre-whitened data
var a = encrypted0 ^ key[0];
var b = encrypted3 ^ key[1];
var c = encrypted2 ^ key[2];
var d = encrypted1 ^ key[3];
var a2 = undefined;
var b2 = undefined;
var c2 = undefined;
// key.length === 2 ?
var nInnerRounds = key.length / 4 - 2;
var i = undefined;
var kIndex = 4;
var table = this._tables[1];
// load up the tables
var table0 = table[0];
var table1 = table[1];
var table2 = table[2];
var table3 = table[3];
var sbox = table[4];
// Inner rounds. Cribbed from OpenSSL.
for (i = 0; i < nInnerRounds; i++) {
a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d & 255] ^ key[kIndex];
b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];
c2 = table0[c >>> 24] ^ table1[d >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];
d = table0[d >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];
kIndex += 4;
a = a2;b = b2;c = c2;
}
// Last round.
for (i = 0; i < 4; i++) {
out[(3 & -i) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];
a2 = a;a = b;b = c;c = d;d = a2;
}
}
}]);
return AES;
})();
exports['default'] = AES;
module.exports = exports['default'];
},{}],4:[function(require,module,exports){
/**
* @file decrypter/async-stream.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _stream = require('../stream');
var _stream2 = _interopRequireDefault(_stream);
/**
* A wrapper around the Stream class to use setTiemout
* and run stream "jobs" Asynchronously
*
* @class AsyncStream
* @extends Stream
*/
var AsyncStream = (function (_Stream) {
_inherits(AsyncStream, _Stream);
function AsyncStream() {
_classCallCheck(this, AsyncStream);
_get(Object.getPrototypeOf(AsyncStream.prototype), 'constructor', this).call(this, _stream2['default']);
this.jobs = [];
this.delay = 1;
this.timeout_ = null;
}
/**
* process an async job
*
* @private
*/
_createClass(AsyncStream, [{
key: 'processJob_',
value: function processJob_() {
this.jobs.shift()();
if (this.jobs.length) {
this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
} else {
this.timeout_ = null;
}
}
/**
* push a job into the stream
*
* @param {Function} job the job to push into the stream
*/
}, {
key: 'push',
value: function push(job) {
this.jobs.push(job);
if (!this.timeout_) {
this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
}
}
}]);
return AsyncStream;
})(_stream2['default']);
exports['default'] = AsyncStream;
module.exports = exports['default'];
},{"../stream":19}],5:[function(require,module,exports){
/**
* @file decrypter/decrypter.js
*
* An asynchronous implementation of AES-128 CBC decryption with
* PKCS#7 padding.
*/
'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; }; })();
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 _aes = require('./aes');
var _aes2 = _interopRequireDefault(_aes);
var _asyncStream = require('./async-stream');
var _asyncStream2 = _interopRequireDefault(_asyncStream);
var _pkcs7 = require('pkcs7');
/**
* Convert network-order (big-endian) bytes into their little-endian
* representation.
*/
var ntoh = function ntoh(word) {
return word << 24 | (word & 0xff00) << 8 | (word & 0xff0000) >> 8 | word >>> 24;
};
/**
* Decrypt bytes using AES-128 with CBC and PKCS#7 padding.
*
* @param {Uint8Array} encrypted the encrypted bytes
* @param {Uint32Array} key the bytes of the decryption key
* @param {Uint32Array} initVector the initialization vector (IV) to
* use for the first round of CBC.
* @return {Uint8Array} the decrypted bytes
*
* @see http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
* @see http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_Block_Chaining_.28CBC.29
* @see https://tools.ietf.org/html/rfc2315
*/
var decrypt = function decrypt(encrypted, key, initVector) {
// word-level access to the encrypted bytes
var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);
var decipher = new _aes2['default'](Array.prototype.slice.call(key));
// byte and word-level access for the decrypted output
var decrypted = new Uint8Array(encrypted.byteLength);
var decrypted32 = new Int32Array(decrypted.buffer);
// temporary variables for working with the IV, encrypted, and
// decrypted data
var init0 = undefined;
var init1 = undefined;
var init2 = undefined;
var init3 = undefined;
var encrypted0 = undefined;
var encrypted1 = undefined;
var encrypted2 = undefined;
var encrypted3 = undefined;
// iteration variable
var wordIx = undefined;
// pull out the words of the IV to ensure we don't modify the
// passed-in reference and easier access
init0 = initVector[0];
init1 = initVector[1];
init2 = initVector[2];
init3 = initVector[3];
// decrypt four word sequences, applying cipher-block chaining (CBC)
// to each decrypted block
for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {
// convert big-endian (network order) words into little-endian
// (javascript order)
encrypted0 = ntoh(encrypted32[wordIx]);
encrypted1 = ntoh(encrypted32[wordIx + 1]);
encrypted2 = ntoh(encrypted32[wordIx + 2]);
encrypted3 = ntoh(encrypted32[wordIx + 3]);
// decrypt the block
decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);
// XOR with the IV, and restore network byte-order to obtain the
// plaintext
decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);
decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);
decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);
decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);
// setup the IV for the next round
init0 = encrypted0;
init1 = encrypted1;
init2 = encrypted2;
init3 = encrypted3;
}
return decrypted;
};
exports.decrypt = decrypt;
/**
* The `Decrypter` class that manages decryption of AES
* data through `AsyncStream` objects and the `decrypt`
* function
*
* @param {Uint8Array} encrypted the encrypted bytes
* @param {Uint32Array} key the bytes of the decryption key
* @param {Uint32Array} initVector the initialization vector (IV) to
* @param {Function} done the function to run when done
* @class Decrypter
*/
var Decrypter = (function () {
function Decrypter(encrypted, key, initVector, done) {
_classCallCheck(this, Decrypter);
var step = Decrypter.STEP;
var encrypted32 = new Int32Array(encrypted.buffer);
var decrypted = new Uint8Array(encrypted.byteLength);
var i = 0;
this.asyncStream_ = new _asyncStream2['default']();
// split up the encryption job and do the individual chunks asynchronously
this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));
for (i = step; i < encrypted32.length; i += step) {
initVector = new Uint32Array([ntoh(encrypted32[i - 4]), ntoh(encrypted32[i - 3]), ntoh(encrypted32[i - 2]), ntoh(encrypted32[i - 1])]);
this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i, i + step), key, initVector, decrypted));
}
// invoke the done() callback when everything is finished
this.asyncStream_.push(function () {
// remove pkcs#7 padding from the decrypted bytes
done(null, (0, _pkcs7.unpad)(decrypted));
});
}
/**
* a getter for step the maximum number of bytes to process at one time
*
* @return {Number} the value of step 32000
*/
_createClass(Decrypter, [{
key: 'decryptChunk_',
/**
* @private
*/
value: function decryptChunk_(encrypted, key, initVector, decrypted) {
return function () {
var bytes = decrypt(encrypted, key, initVector);
decrypted.set(bytes, encrypted.byteOffset);
};
}
}], [{
key: 'STEP',
get: function get() {
// 4 * 8000;
return 32000;
}
}]);
return Decrypter;
})();
exports.Decrypter = Decrypter;
exports['default'] = {
Decrypter: Decrypter,
decrypt: decrypt
};
},{"./aes":3,"./async-stream":4,"pkcs7":24}],6:[function(require,module,exports){
/**
* @file decrypter/index.js
*
* Index module to easily import the primary components of AES-128
* decryption. Like this:
*
* ```js
* import {Decrypter, decrypt, AsyncStream} from './src/decrypter';
* ```
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _decrypter = require('./decrypter');
var _asyncStream = require('./async-stream');
var _asyncStream2 = _interopRequireDefault(_asyncStream);
exports['default'] = {
decrypt: _decrypter.decrypt,
Decrypter: _decrypter.Decrypter,
AsyncStream: _asyncStream2['default']
};
module.exports = exports['default'];
},{"./async-stream":4,"./decrypter":5}],7:[function(require,module,exports){
(function (global){
/**
* @file hls-audio-track.js
*/
'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; }; })();
var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _playlistLoader = require('./playlist-loader');
var _playlistLoader2 = _interopRequireDefault(_playlistLoader);
/**
* HlsAudioTrack extends video.js audio tracks but adds HLS
* specific data storage such as playlist loaders, mediaGroups
* and default/autoselect
*
* @param {Object} options options to create HlsAudioTrack with
* @class HlsAudioTrack
* @extends AudioTrack
*/
var HlsAudioTrack = (function (_AudioTrack) {
_inherits(HlsAudioTrack, _AudioTrack);
function HlsAudioTrack(options) {
_classCallCheck(this, HlsAudioTrack);
_get(Object.getPrototypeOf(HlsAudioTrack.prototype), 'constructor', this).call(this, {
kind: options['default'] ? 'main' : 'alternative',
enabled: options['default'] || false,
language: options.language,
label: options.label
});
this.hls = options.hls;
this.autoselect = options.autoselect || false;
this['default'] = options['default'] || false;
this.withCredentials = options.withCredentials || false;
this.mediaGroups_ = [];
this.addLoader(options.mediaGroup, options.resolvedUri);
}
/**
* get a PlaylistLoader from this track given a mediaGroup name
*
* @param {String} mediaGroup the mediaGroup to get the loader for
* @return {PlaylistLoader|Null} the PlaylistLoader or null
*/
_createClass(HlsAudioTrack, [{
key: 'getLoader',
value: function getLoader(mediaGroup) {
for (var i = 0; i < this.mediaGroups_.length; i++) {
var mgl = this.mediaGroups_[i];
if (mgl.mediaGroup === mediaGroup) {
return mgl.loader;
}
}
}
/**
* add a PlaylistLoader given a mediaGroup, and a uri. for a combined track
* we store null for the playlistloader
*
* @param {String} mediaGroup the mediaGroup to get the loader for
* @param {String} uri the uri to get the audio track/mediaGroup from
*/
}, {
key: 'addLoader',
value: function addLoader(mediaGroup) {
var uri = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
var loader = null;
if (uri) {
// TODO: this should probably happen upstream in Master Playlist
// Controller when we can switch PlaylistLoader sources
// then we can just store the uri here instead
loader = new _playlistLoader2['default'](uri, this.hls, this.withCredentials);
}
this.mediaGroups_.push({ mediaGroup: mediaGroup, loader: loader });
}
/**
* remove a playlist loader from a track given the mediaGroup
*
* @param {String} mediaGroup the mediaGroup to remove
*/
}, {
key: 'removeLoader',
value: function removeLoader(mediaGroup) {
for (var i = 0; i < this.mediaGroups_.length; i++) {
var mgl = this.mediaGroups_[i];
if (mgl.mediaGroup === mediaGroup) {
if (mgl.loader) {
mgl.loader.dispose();
}
this.mediaGroups_.splice(i, 1);
return;
}
}
}
/**
* Dispose of this audio track and
* the playlist loader that it holds inside
*/
}, {
key: 'dispose',
value: function dispose() {
var i = this.mediaGroups_.length;
while (i--) {
this.removeLoader(this.mediaGroups_[i].mediaGroup);
}
}
}]);
return HlsAudioTrack;
})(_videoJs.AudioTrack);
exports['default'] = HlsAudioTrack;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./playlist-loader":13}],8:[function(require,module,exports){
/**
* @file m3u8/index.js
*
* Utilities for parsing M3U8 files. If the entire manifest is available,
* `Parser` will create an object representation with enough detail for managing
* playback. `ParseStream` and `LineStream` are lower-level parsing primitives
* that do not assume the entirety of the manifest is ready and expose a
* ReadableStream-like interface.
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _lineStream = require('./line-stream');
var _lineStream2 = _interopRequireDefault(_lineStream);
var _parseStream = require('./parse-stream');
var _parseStream2 = _interopRequireDefault(_parseStream);
var _parser = require('./parser');
var _parser2 = _interopRequireDefault(_parser);
exports['default'] = {
LineStream: _lineStream2['default'],
ParseStream: _parseStream2['default'],
Parser: _parser2['default']
};
module.exports = exports['default'];
},{"./line-stream":9,"./parse-stream":10,"./parser":11}],9:[function(require,module,exports){
/**
* @file m3u8/line-stream.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _stream = require('../stream');
var _stream2 = _interopRequireDefault(_stream);
/**
* A stream that buffers string input and generates a `data` event for each
* line.
*
* @class LineStream
* @extends Stream
*/
var LineStream = (function (_Stream) {
_inherits(LineStream, _Stream);
function LineStream() {
_classCallCheck(this, LineStream);
_get(Object.getPrototypeOf(LineStream.prototype), 'constructor', this).call(this);
this.buffer = '';
}
/**
* Add new data to be parsed.
*
* @param {String} data the text to process
*/
_createClass(LineStream, [{
key: 'push',
value: function push(data) {
var nextNewline = undefined;
this.buffer += data;
nextNewline = this.buffer.indexOf('\n');
for (; nextNewline > -1; nextNewline = this.buffer.indexOf('\n')) {
this.trigger('data', this.buffer.substring(0, nextNewline));
this.buffer = this.buffer.substring(nextNewline + 1);
}
}
}]);
return LineStream;
})(_stream2['default']);
exports['default'] = LineStream;
module.exports = exports['default'];
},{"../stream":19}],10:[function(require,module,exports){
/**
* @file m3u8/parse-stream.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _stream = require('../stream');
var _stream2 = _interopRequireDefault(_stream);
/**
* "forgiving" attribute list psuedo-grammar:
* attributes -> keyvalue (',' keyvalue)*
* keyvalue -> key '=' value
* key -> [^=]*
* value -> '"' [^"]* '"' | [^,]*
*/
var attributeSeparator = function attributeSeparator() {
var key = '[^=]*';
var value = '"[^"]*"|[^,]*';
var keyvalue = '(?:' + key + ')=(?:' + value + ')';
return new RegExp('(?:^|,)(' + keyvalue + ')');
};
/**
* Parse attributes from a line given the seperator
*
* @param {String} attributes the attibute line to parse
*/
var parseAttributes = function parseAttributes(attributes) {
// split the string using attributes as the separator
var attrs = attributes.split(attributeSeparator());
var i = attrs.length;
var result = {};
var attr = undefined;
while (i--) {
// filter out unmatched portions of the string
if (attrs[i] === '') {
continue;
}
// split the key and value
attr = /([^=]*)=(.*)/.exec(attrs[i]).slice(1);
// trim whitespace and remove optional quotes around the value
attr[0] = attr[0].replace(/^\s+|\s+$/g, '');
attr[1] = attr[1].replace(/^\s+|\s+$/g, '');
attr[1] = attr[1].replace(/^['"](.*)['"]$/g, '$1');
result[attr[0]] = attr[1];
}
return result;
};
/**
* A line-level M3U8 parser event stream. It expects to receive input one
* line at a time and performs a context-free parse of its contents. A stream
* interpretation of a manifest can be useful if the manifest is expected to
* be too large to fit comfortably into memory or the entirety of the input
* is not immediately available. Otherwise, it's probably much easier to work
* with a regular `Parser` object.
*
* Produces `data` events with an object that captures the parser's
* interpretation of the input. That object has a property `tag` that is one
* of `uri`, `comment`, or `tag`. URIs only have a single additional
* property, `line`, which captures the entirety of the input without
* interpretation. Comments similarly have a single additional property
* `text` which is the input without the leading `#`.
*
* Tags always have a property `tagType` which is the lower-cased version of
* the M3U8 directive without the `#EXT` or `#EXT-X-` prefix. For instance,
* `#EXT-X-MEDIA-SEQUENCE` becomes `media-sequence` when parsed. Unrecognized
* tags are given the tag type `unknown` and a single additional property
* `data` with the remainder of the input.
*
* @class ParseStream
* @extends Stream
*/
var ParseStream = (function (_Stream) {
_inherits(ParseStream, _Stream);
function ParseStream() {
_classCallCheck(this, ParseStream);
_get(Object.getPrototypeOf(ParseStream.prototype), 'constructor', this).call(this);
}
/**
* Parses an additional line of input.
*
* @param {String} line a single line of an M3U8 file to parse
*/
_createClass(ParseStream, [{
key: 'push',
value: function push(line) {
var match = undefined;
var event = undefined;
// strip whitespace
line = line.replace(/^[\u0000\s]+|[\u0000\s]+$/g, '');
if (line.length === 0) {
// ignore empty lines
return;
}
// URIs
if (line[0] !== '#') {
this.trigger('data', {
type: 'uri',
uri: line
});
return;
}
// Comments
if (line.indexOf('#EXT') !== 0) {
this.trigger('data', {
type: 'comment',
text: line.slice(1)
});
return;
}
// strip off any carriage returns here so the regex matching
// doesn't have to account for them.
line = line.replace('\r', '');
// Tags
match = /^#EXTM3U/.exec(line);
if (match) {
this.trigger('data', {
type: 'tag',
tagType: 'm3u'
});
return;
}
match = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'inf'
};
if (match[1]) {
event.duration = parseFloat(match[1]);
}
if (match[2]) {
event.title = match[2];
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'targetduration'
};
if (match[1]) {
event.duration = parseInt(match[1], 10);
}
this.trigger('data', event);
return;
}
match = /^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'totalduration'
};
if (match[1]) {
event.duration = parseInt(match[1], 10);
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'version'
};
if (match[1]) {
event.version = parseInt(match[1], 10);
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'media-sequence'
};
if (match[1]) {
event.number = parseInt(match[1], 10);
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'discontinuity-sequence'
};
if (match[1]) {
event.number = parseInt(match[1], 10);
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'playlist-type'
};
if (match[1]) {
event.playlistType = match[1];
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'byterange'
};
if (match[1]) {
event.length = parseInt(match[1], 10);
}
if (match[2]) {
event.offset = parseInt(match[2], 10);
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'allow-cache'
};
if (match[1]) {
event.allowed = !/NO/.test(match[1]);
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'stream-inf'
};
if (match[1]) {
event.attributes = parseAttributes(match[1]);
if (event.attributes.RESOLUTION) {
var split = event.attributes.RESOLUTION.split('x');
var resolution = {};
if (split[0]) {
resolution.width = parseInt(split[0], 10);
}
if (split[1]) {
resolution.height = parseInt(split[1], 10);
}
event.attributes.RESOLUTION = resolution;
}
if (event.attributes.BANDWIDTH) {
event.attributes.BANDWIDTH = parseInt(event.attributes.BANDWIDTH, 10);
}
if (event.attributes['PROGRAM-ID']) {
event.attributes['PROGRAM-ID'] = parseInt(event.attributes['PROGRAM-ID'], 10);
}
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-MEDIA:?(.*)$/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'media'
};
if (match[1]) {
event.attributes = parseAttributes(match[1]);
}
this.trigger('data', event);
return;
}
match = /^#EXT-X-ENDLIST/.exec(line);
if (match) {
this.trigger('data', {
type: 'tag',
tagType: 'endlist'
});
return;
}
match = /^#EXT-X-DISCONTINUITY/.exec(line);
if (match) {
this.trigger('data', {
type: 'tag',
tagType: 'discontinuity'
});
return;
}
match = /^#EXT-X-KEY:?(.*)$/.exec(line);
if (match) {
event = {
type: 'tag',
tagType: 'key'
};
if (match[1]) {
event.attributes = parseAttributes(match[1]);
// parse the IV string into a Uint32Array
if (event.attributes.IV) {
if (event.attributes.IV.substring(0, 2).toLowerCase() === '0x') {
event.attributes.IV = event.attributes.IV.substring(2);
}
event.attributes.IV = event.attributes.IV.match(/.{8}/g);
event.attributes.IV[0] = parseInt(event.attributes.IV[0], 16);
event.attributes.IV[1] = parseInt(event.attributes.IV[1], 16);
event.attributes.IV[2] = parseInt(event.attributes.IV[2], 16);
event.attributes.IV[3] = parseInt(event.attributes.IV[3], 16);
event.attributes.IV = new Uint32Array(event.attributes.IV);
}
}
this.trigger('data', event);
return;
}
// unknown tag type
this.trigger('data', {
type: 'tag',
data: line.slice(4, line.length)
});
}
}]);
return ParseStream;
})(_stream2['default']);
exports['default'] = ParseStream;
module.exports = exports['default'];
},{"../stream":19}],11:[function(require,module,exports){
(function (global){
/**
* @file m3u8/parser.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _stream = require('../stream');
var _stream2 = _interopRequireDefault(_stream);
var _lineStream = require('./line-stream');
var _lineStream2 = _interopRequireDefault(_lineStream);
var _parseStream = require('./parse-stream');
var _parseStream2 = _interopRequireDefault(_parseStream);
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
/**
* A parser for M3U8 files. The current interpretation of the input is
* exposed as a property `manifest` on parser objects. It's just two lines to
* create and parse a manifest once you have the contents available as a string:
*
* ```js
* var parser = new videojs.m3u8.Parser();
* parser.push(xhr.responseText);
* ```
*
* New input can later be applied to update the manifest object by calling
* `push` again.
*
* The parser attempts to create a usable manifest object even if the
* underlying input is somewhat nonsensical. It emits `info` and `warning`
* events during the parse if it encounters input that seems invalid or
* requires some property of the manifest object to be defaulted.
*
* @class Parser
* @extends Stream
*/
var Parser = (function (_Stream) {
_inherits(Parser, _Stream);
function Parser() {
_classCallCheck(this, Parser);
_get(Object.getPrototypeOf(Parser.prototype), 'constructor', this).call(this);
this.lineStream = new _lineStream2['default']();
this.parseStream = new _parseStream2['default']();
this.lineStream.pipe(this.parseStream);
/* eslint-disable consistent-this */
var self = this;
/* eslint-enable consistent-this */
var uris = [];
var currentUri = {};
var _key = undefined;
var noop = function noop() {};
var defaultMediaGroups = {
'AUDIO': {},
'VIDEO': {},
'CLOSED-CAPTIONS': {},
'SUBTITLES': {}
};
// group segments into numbered timelines delineated by discontinuities
var currentTimeline = 0;
// the manifest is empty until the parse stream begins delivering data
this.manifest = {
allowCache: true,
discontinuityStarts: []
};
// update the manifest with the m3u8 entry from the parse stream
this.parseStream.on('data', function (entry) {
var mediaGroup = undefined;
var rendition = undefined;
({
tag: function tag() {
// switch based on the tag type
(({
'allow-cache': function allowCache() {
this.manifest.allowCache = entry.allowed;
if (!('allowed' in entry)) {
this.trigger('info', {
message: 'defaulting allowCache to YES'
});
this.manifest.allowCache = true;
}
},
byterange: function byterange() {
var byterange = {};
if ('length' in entry) {
currentUri.byterange = byterange;
byterange.length = entry.length;
if (!('offset' in entry)) {
this.trigger('info', {
message: 'defaulting offset to zero'
});
entry.offset = 0;
}
}
if ('offset' in entry) {
currentUri.byterange = byterange;
byterange.offset = entry.offset;
}
},
endlist: function endlist() {
this.manifest.endList = true;
},
inf: function inf() {
if (!('mediaSequence' in this.manifest)) {
this.manifest.mediaSequence = 0;
this.trigger('info', {
message: 'defaulting media sequence to zero'
});
}
if (!('discontinuitySequence' in this.manifest)) {
this.manifest.discontinuitySequence = 0;
this.trigger('info', {
message: 'defaulting discontinuity sequence to zero'
});
}
if (entry.duration > 0) {
currentUri.duration = entry.duration;
}
if (entry.duration === 0) {
currentUri.duration = 0.01;
this.trigger('info', {
message: 'updating zero segment duration to a small value'
});
}
this.manifest.segments = uris;
},
key: function key() {
if (!entry.attributes) {
this.trigger('warn', {
message: 'ignoring key declaration without attribute list'
});
return;
}
// clear the active encryption key
if (entry.attributes.METHOD === 'NONE') {
_key = null;
return;
}
if (!entry.attributes.URI) {
this.trigger('warn', {
message: 'ignoring key declaration without URI'
});
return;
}
if (!entry.attributes.METHOD) {
this.trigger('warn', {
message: 'defaulting key method to AES-128'
});
}
// setup an encryption key for upcoming segments
_key = {
method: entry.attributes.METHOD || 'AES-128',
uri: entry.attributes.URI
};
if (typeof entry.attributes.IV !== 'undefined') {
_key.iv = entry.attributes.IV;
}
},
'media-sequence': function mediaSequence() {
if (!isFinite(entry.number)) {
this.trigger('warn', {
message: 'ignoring invalid media sequence: ' + entry.number
});
return;
}
this.manifest.mediaSequence = entry.number;
},
'discontinuity-sequence': function discontinuitySequence() {
if (!isFinite(entry.number)) {
this.trigger('warn', {
message: 'ignoring invalid discontinuity sequence: ' + entry.number
});
return;
}
this.manifest.discontinuitySequence = entry.number;
currentTimeline = entry.number;
},
'playlist-type': function playlistType() {
if (!/VOD|EVENT/.test(entry.playlistType)) {
this.trigger('warn', {
message: 'ignoring unknown playlist type: ' + entry.playlist
});
return;
}
this.manifest.playlistType = entry.playlistType;
},
'stream-inf': function streamInf() {
this.manifest.playlists = uris;
this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
if (!entry.attributes) {
this.trigger('warn', {
message: 'ignoring empty stream-inf attributes'
});
return;
}
if (!currentUri.attributes) {
currentUri.attributes = {};
}
currentUri.attributes = (0, _videoJs.mergeOptions)(currentUri.attributes, entry.attributes);
},
media: function media() {
this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
if (!(entry.attributes && entry.attributes.TYPE && entry.attributes['GROUP-ID'] && entry.attributes.NAME)) {
this.trigger('warn', {
message: 'ignoring incomplete or missing media group'
});
return;
}
// find the media group, creating defaults as necessary
var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];
mediaGroupType[entry.attributes['GROUP-ID']] = mediaGroupType[entry.attributes['GROUP-ID']] || {};
mediaGroup = mediaGroupType[entry.attributes['GROUP-ID']];
// collect the rendition metadata
rendition = {
'default': /yes/i.test(entry.attributes.DEFAULT)
};
if (rendition['default']) {
rendition.autoselect = true;
} else {
rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);
}
if (entry.attributes.LANGUAGE) {
rendition.language = entry.attributes.LANGUAGE;
}
if (entry.attributes.URI) {
rendition.uri = entry.attributes.URI;
}
// insert the new rendition
mediaGroup[entry.attributes.NAME] = rendition;
},
discontinuity: function discontinuity() {
currentTimeline += 1;
currentUri.discontinuity = true;
this.manifest.discontinuityStarts.push(uris.length);
},
targetduration: function targetduration() {
if (!isFinite(entry.duration) || entry.duration < 0) {
this.trigger('warn', {
message: 'ignoring invalid target duration: ' + entry.duration
});
return;
}
this.manifest.targetDuration = entry.duration;
},
totalduration: function totalduration() {
if (!isFinite(entry.duration) || entry.duration < 0) {
this.trigger('warn', {
message: 'ignoring invalid total duration: ' + entry.duration
});
return;
}
this.manifest.totalDuration = entry.duration;
}
})[entry.tagType] || noop).call(self);
},
uri: function uri() {
currentUri.uri = entry.uri;
uris.push(currentUri);
// if no explicit duration was declared, use the target duration
if (this.manifest.targetDuration && !('duration' in currentUri)) {
this.trigger('warn', {
message: 'defaulting segment duration to the target duration'
});
currentUri.duration = this.manifest.targetDuration;
}
// annotate with encryption information, if necessary
if (_key) {
currentUri.key = _key;
}
currentUri.timeline = currentTimeline;
// prepare for the next URI
currentUri = {};
},
comment: function comment() {
// comments are not important for playback
}
})[entry.type].call(self);
});
}
/**
* Parse the input string and update the manifest object.
*
* @param {String} chunk a potentially incomplete portion of the manifest
*/
_createClass(Parser, [{
key: 'push',
value: function push(chunk) {
this.lineStream.push(chunk);
}
/**
* Flush any remaining input. This can be handy if the last line of an M3U8
* manifest did not contain a trailing newline but the file has been
* completely received.
*/
}, {
key: 'end',
value: function end() {
// flush any buffered input
this.lineStream.push('\n');
}
}]);
return Parser;
})(_stream2['default']);
exports['default'] = Parser;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../stream":19,"./line-stream":9,"./parse-stream":10}],12:[function(require,module,exports){
(function (global){
/**
* @file master-playlist-controller.js
*/
'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; }; })();
var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { var object = _x2, property = _x3, receiver = _x4; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _playlistLoader = require('./playlist-loader');
var _playlistLoader2 = _interopRequireDefault(_playlistLoader);
var _segmentLoader = require('./segment-loader');
var _segmentLoader2 = _interopRequireDefault(_segmentLoader);
var _ranges = require('./ranges');
var _ranges2 = _interopRequireDefault(_ranges);
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var _hlsAudioTrack = require('./hls-audio-track');
var _hlsAudioTrack2 = _interopRequireDefault(_hlsAudioTrack);
// 5 minute blacklist
var BLACKLIST_DURATION = 5 * 60 * 1000;
var Hls = undefined;
var parseCodecs = function parseCodecs(codecs) {
var result = {
codecCount: 0,
videoCodec: null,
audioProfile: null
};
result.codecCount = codecs.split(',').length;
result.codecCount = result.codecCount || 2;
// parse the video codec but ignore the version
result.videoCodec = /(^|\s|,)+(avc1)[^ ,]*/i.exec(codecs);
result.videoCodec = result.videoCodec && result.videoCodec[2];
// parse the last field of the audio codec
result.audioProfile = /(^|\s|,)+mp4a.\d+\.(\d+)/i.exec(codecs);
result.audioProfile = result.audioProfile && result.audioProfile[2];
return result;
};
/**
* the master playlist controller controller all interactons
* between playlists and segmentloaders. At this time this mainly
* involves a master playlist and a series of audio playlists
* if they are available
*
* @class MasterPlaylistController
* @extends videojs.EventTarget
*/
var MasterPlaylistController = (function (_videojs$EventTarget) {
_inherits(MasterPlaylistController, _videojs$EventTarget);
function MasterPlaylistController(_ref) {
var _this = this;
var url = _ref.url;
var withCredentials = _ref.withCredentials;
var mode = _ref.mode;
var tech = _ref.tech;
var bandwidth = _ref.bandwidth;
var externHls = _ref.externHls;
_classCallCheck(this, MasterPlaylistController);
_get(Object.getPrototypeOf(MasterPlaylistController.prototype), 'constructor', this).call(this);
Hls = externHls;
this.withCredentials = withCredentials;
this.tech_ = tech;
this.hls_ = tech.hls;
this.mode_ = mode;
this.audioTracks_ = [];
this.mediaSource = new _videoJs2['default'].MediaSource({ mode: mode });
this.mediaSource.on('audioinfo', function (e) {
return _this.trigger(e);
});
// load the media source into the player
this.mediaSource.addEventListener('sourceopen', this.handleSourceOpen_.bind(this));
var segmentLoaderOptions = {
hls: this.hls_,
mediaSource: this.mediaSource,
currentTime: this.tech_.currentTime.bind(this.tech_),
withCredentials: this.withCredentials,
seekable: function seekable() {
return _this.seekable();
},
seeking: function seeking() {
return _this.tech_.seeking();
},
setCurrentTime: function setCurrentTime(a) {
return _this.tech_.setCurrentTime(a);
},
hasPlayed: function hasPlayed() {
return _this.tech_.played().length !== 0;
},
bandwidth: bandwidth
};
// combined audio/video or just video when alternate audio track is selected
this.mainSegmentLoader_ = new _segmentLoader2['default'](segmentLoaderOptions);
// alternate audio track
this.audioSegmentLoader_ = new _segmentLoader2['default'](segmentLoaderOptions);
if (!url) {
throw new Error('A non-empty playlist URL is required');
}
this.masterPlaylistLoader_ = new _playlistLoader2['default'](url, this.hls_, this.withCredentials);
this.masterPlaylistLoader_.on('loadedmetadata', function () {
var media = _this.masterPlaylistLoader_.media();
// if this isn't a live video and preload permits, start
// downloading segments
if (media.endList && _this.tech_.preload() !== 'none') {
_this.mainSegmentLoader_.playlist(media);
_this.mainSegmentLoader_.expired(_this.masterPlaylistLoader_.expired_);
_this.mainSegmentLoader_.load();
}
_this.setupSourceBuffer_();
_this.setupFirstPlay();
_this.useAudio();
});
this.masterPlaylistLoader_.on('loadedplaylist', function () {
var updatedPlaylist = _this.masterPlaylistLoader_.media();
var seekable = undefined;
if (!updatedPlaylist) {
// select the initial variant
_this.initialMedia_ = _this.selectPlaylist();
_this.masterPlaylistLoader_.media(_this.initialMedia_);
_this.fillAudioTracks_();
_this.trigger('selectedinitialmedia');
return;
}
_this.mainSegmentLoader_.playlist(updatedPlaylist);
_this.mainSegmentLoader_.expired(_this.masterPlaylistLoader_.expired_);
_this.updateDuration();
// update seekable
seekable = _this.seekable();
if (!updatedPlaylist.endList && seekable.length !== 0) {
_this.mediaSource.addSeekableRange_(seekable.start(0), seekable.end(0));
}
});
this.masterPlaylistLoader_.on('error', function () {
_this.blacklistCurrentPlaylist(_this.masterPlaylistLoader_.error);
});
this.masterPlaylistLoader_.on('mediachanging', function () {
_this.mainSegmentLoader_.pause();
});
this.masterPlaylistLoader_.on('mediachange', function () {
_this.mainSegmentLoader_.abort();
_this.mainSegmentLoader_.load();
_this.tech_.trigger({
type: 'mediachange',
bubbles: true
});
});
this.mainSegmentLoader_.on('progress', function () {
// figure out what stream the next segment should be downloaded from
// with the updated bandwidth information
_this.masterPlaylistLoader_.media(_this.selectPlaylist());
_this.trigger('progress');
});
this.mainSegmentLoader_.on('error', function () {
_this.blacklistCurrentPlaylist(_this.mainSegmentLoader_.error());
});
this.audioSegmentLoader_.on('error', function () {
_videoJs2['default'].log.warn('Problem encountered with the current alternate audio track' + '. Switching back to default.');
_this.audioSegmentLoader_.abort();
_this.audioPlaylistLoader_ = null;
_this.useAudio();
});
this.masterPlaylistLoader_.load();
}
/**
* fill our internal list of HlsAudioTracks with data from
* the master playlist or use a default
*
* @private
*/
_createClass(MasterPlaylistController, [{
key: 'fillAudioTracks_',
value: function fillAudioTracks_() {
var master = this.master();
var mediaGroups = master.mediaGroups || {};
// force a default if we have none or we are not
// in html5 mode (the only mode to support more than one
// audio track)
if (!mediaGroups || !mediaGroups.AUDIO || Object.keys(mediaGroups.AUDIO).length === 0 || this.mode_ !== 'html5') {
// "main" audio group, track name "default"
mediaGroups.AUDIO = { main: { 'default': { 'default': true } } };
}
var tracks = {};
for (var mediaGroup in mediaGroups.AUDIO) {
for (var label in mediaGroups.AUDIO[mediaGroup]) {
var properties = mediaGroups.AUDIO[mediaGroup][label];
// if the track already exists add a new "location"
// since tracks in different mediaGroups are actually the same
// track with different locations to download them from
if (tracks[label]) {
tracks[label].addLoader(mediaGroup, properties.resolvedUri);
continue;
}
var track = new _hlsAudioTrack2['default'](_videoJs2['default'].mergeOptions(properties, {
hls: this.hls_,
withCredentials: this.withCredential,
mediaGroup: mediaGroup,
label: label
}));
tracks[label] = track;
this.audioTracks_.push(track);
}
}
}
/**
* Call load on our SegmentLoaders
*/
}, {
key: 'load',
value: function load() {
this.mainSegmentLoader_.load();
if (this.audioPlaylistLoader_) {
this.audioSegmentLoader_.load();
}
}
/**
* Get the current active Media Group for Audio
* given the selected playlist and its attributes
*/
}, {
key: 'activeAudioGroup',
value: function activeAudioGroup() {
var media = this.masterPlaylistLoader_.media();
var mediaGroup = 'main';
if (media && media.attributes && media.attributes.AUDIO) {
mediaGroup = media.attributes.AUDIO;
}
return mediaGroup;
}
/**
* Use any audio track that we have, and start to load it
*/
}, {
key: 'useAudio',
value: function useAudio() {
var _this2 = this;
var track = undefined;
this.audioTracks_.forEach(function (t) {
if (!track && t.enabled) {
track = t;
}
});
// called too early or no track is enabled
if (!track) {
return;
}
// Pause any alternative audio
if (this.audioPlaylistLoader_) {
this.audioPlaylistLoader_.pause();
this.audioPlaylistLoader_ = null;
this.audioSegmentLoader_.pause();
}
// If the audio track for the active audio group has
// a playlist loader than it is an alterative audio track
// otherwise it is a part of the mainSegmenLoader
var loader = track.getLoader(this.activeAudioGroup());
if (!loader) {
this.mainSegmentLoader_.clearBuffer();
return;
}
// TODO: it may be better to create the playlist loader here
// when we can change an audioPlaylistLoaders src
this.audioPlaylistLoader_ = loader;
if (this.audioPlaylistLoader_.started) {
this.audioPlaylistLoader_.load();
this.audioSegmentLoader_.load();
this.audioSegmentLoader_.clearBuffer();
return;
}
this.audioPlaylistLoader_.on('loadedmetadata', function () {
/* eslint-disable no-shadow */
var media = _this2.audioPlaylistLoader_.media();
/* eslint-enable no-shadow */
_this2.audioSegmentLoader_.playlist(media);
_this2.addMimeType_(_this2.audioSegmentLoader_, 'mp4a.40.2', media);
// if the video is already playing, or if this isn't a live video and preload
// permits, start downloading segments
if (!_this2.tech_.paused() || media.endList && _this2.tech_.preload() !== 'none') {
_this2.audioSegmentLoader_.load();
}
if (!media.endList) {
// trigger the playlist loader to start "expired time"-tracking
_this2.audioPlaylistLoader_.trigger('firstplay');
}
});
this.audioPlaylistLoader_.on('loadedplaylist', function () {
var updatedPlaylist = undefined;
if (_this2.audioPlaylistLoader_) {
updatedPlaylist = _this2.audioPlaylistLoader_.media();
}
if (!updatedPlaylist) {
// only one playlist to select
_this2.audioPlaylistLoader_.media(_this2.audioPlaylistLoader_.playlists.master.playlists[0]);
return;
}
_this2.audioSegmentLoader_.playlist(updatedPlaylist);
});
this.audioPlaylistLoader_.on('error', function () {
_videoJs2['default'].log.warn('Problem encountered loading the alternate audio track' + '. Switching back to default.');
_this2.audioSegmentLoader_.abort();
_this2.audioPlaylistLoader_ = null;
_this2.useAudio();
});
this.audioSegmentLoader_.clearBuffer();
this.audioPlaylistLoader_.start();
}
/**
* Re-tune playback quality level for the current player
* conditions. This method may perform destructive actions, like
* removing already buffered content, to readjust the currently
* active playlist quickly.
*
* @private
*/
}, {
key: 'fastQualityChange_',
value: function fastQualityChange_() {
var media = this.selectPlaylist();
if (media !== this.masterPlaylistLoader_.media()) {
this.masterPlaylistLoader_.media(media);
this.mainSegmentLoader_.sourceUpdater_.remove(this.tech_.currentTime() + 5, Infinity);
}
}
/**
* Begin playback.
*/
}, {
key: 'play',
value: function play() {
if (this.setupFirstPlay()) {
return;
}
if (this.tech_.ended()) {
this.tech_.setCurrentTime(0);
}
this.load();
// if the viewer has paused and we fell out of the live window,
// seek forward to the earliest available position
if (this.tech_.duration() === Infinity) {
if (this.tech_.currentTime() < this.tech_.seekable().start(0)) {
return this.tech_.setCurrentTime(this.tech_.seekable().start(0));
}
}
}
/**
* Seek to the latest media position if this is a live video and the
* player and video are loaded and initialized.
*/
}, {
key: 'setupFirstPlay',
value: function setupFirstPlay() {
var seekable = undefined;
var media = this.masterPlaylistLoader_.media();
// check that everything is ready to begin buffering
// 1) the active media playlist is available
if (media &&
// 2) the video is a live stream
!media.endList &&
// 3) the player is not paused
!this.tech_.paused() &&
// 4) the player has not started playing
!this.hasPlayed_) {
this.load();
// trigger the playlist loader to start "expired time"-tracking
this.masterPlaylistLoader_.trigger('firstplay');
this.hasPlayed_ = true;
// seek to the latest media position for live videos
seekable = this.seekable();
if (seekable.length) {
this.tech_.setCurrentTime(seekable.end(0));
}
return true;
}
return false;
}
/**
* handle the sourceopen event on the MediaSource
*
* @private
*/
}, {
key: 'handleSourceOpen_',
value: function handleSourceOpen_() {
// Only attempt to create the source buffer if none already exist.
// handleSourceOpen is also called when we are "re-opening" a source buffer
// after `endOfStream` has been called (in response to a seek for instance)
this.setupSourceBuffer_();
// if autoplay is enabled, begin playback. This is duplicative of
// code in video.js but is required because play() must be invoked
// *after* the media source has opened.
if (this.tech_.autoplay()) {
this.tech_.play();
}
this.trigger('sourceopen');
}
/**
* Blacklists a playlist when an error occurs for a set amount of time
* making it unavailable for selection by the rendition selection algorithm
* and then forces a new playlist (rendition) selection.
*
* @param {Object=} error an optional error that may include the playlist
* to blacklist
*/
}, {
key: 'blacklistCurrentPlaylist',
value: function blacklistCurrentPlaylist() {
var error = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var currentPlaylist = undefined;
var nextPlaylist = undefined;
// If the `error` was generated by the playlist loader, it will contain
// the playlist we were trying to load (but failed) and that should be
// blacklisted instead of the currently selected playlist which is likely
// out-of-date in this scenario
currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();
// If there is no current playlist, then an error occurred while we were
// trying to load the master OR while we were disposing of the tech
if (!currentPlaylist) {
this.error = error;
return this.mediaSource.endOfStream('network');
}
// Blacklist this playlist
currentPlaylist.excludeUntil = Date.now() + BLACKLIST_DURATION;
// Select a new playlist
nextPlaylist = this.selectPlaylist();
if (nextPlaylist) {
_videoJs2['default'].log.warn('Problem encountered with the current ' + 'HLS playlist. Switching to another playlist.');
return this.masterPlaylistLoader_.media(nextPlaylist);
}
_videoJs2['default'].log.warn('Problem encountered with the current ' + 'HLS playlist. No suitable alternatives found.');
// We have no more playlists we can select so we must fail
this.error = error;
return this.mediaSource.endOfStream('network');
}
/**
* Pause all segment loaders
*/
}, {
key: 'pauseLoading',
value: function pauseLoading() {
this.mainSegmentLoader_.pause();
if (this.audioPlaylistLoader_) {
this.audioSegmentLoader_.pause();
}
}
/**
* set the current time on all segment loaders
*
* @param {TimeRange} currentTime the current time to set
* @return {TimeRange} the current time
*/
}, {
key: 'setCurrentTime',
value: function setCurrentTime(currentTime) {
var buffered = _ranges2['default'].findRange(this.tech_.buffered(), currentTime);
if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {
// return immediately if the metadata is not ready yet
return 0;
}
// it's clearly an edge-case but don't thrown an error if asked to
// seek within an empty playlist
if (!this.masterPlaylistLoader_.media().segments) {
return 0;
}
// if the seek location is already buffered, continue buffering as
// usual
if (buffered && buffered.length) {
return currentTime;
}
// cancel outstanding requests so we begin buffering at the new
// location
this.mainSegmentLoader_.abort();
if (this.audioPlaylistLoader_) {
this.audioSegmentLoader_.abort();
}
if (!this.tech_.paused()) {
this.mainSegmentLoader_.load();
if (this.audioPlaylistLoader_) {
this.audioSegmentLoader_.load();
}
}
}
/**
* get the current duration
*
* @return {TimeRange} the duration
*/
}, {
key: 'duration',
value: function duration() {
if (!this.masterPlaylistLoader_) {
return 0;
}
if (this.mediaSource) {
return this.mediaSource.duration;
}
return Hls.Playlist.duration(this.masterPlaylistLoader_.media());
}
/**
* check the seekable range
*
* @return {TimeRange} the seekable range
*/
}, {
key: 'seekable',
value: function seekable() {
var media = undefined;
var mainSeekable = undefined;
var audioSeekable = undefined;
if (!this.masterPlaylistLoader_) {
return _videoJs2['default'].createTimeRanges();
}
media = this.masterPlaylistLoader_.media();
if (!media) {
return _videoJs2['default'].createTimeRanges();
}
mainSeekable = Hls.Playlist.seekable(media, this.masterPlaylistLoader_.expired_);
if (mainSeekable.length === 0) {
return mainSeekable;
}
if (this.audioPlaylistLoader_) {
audioSeekable = Hls.Playlist.seekable(this.audioPlaylistLoader_.media(), this.audioPlaylistLoader_.expired_);
if (audioSeekable.length === 0) {
return audioSeekable;
}
}
if (!audioSeekable) {
// seekable has been calculated based on buffering video data so it
// can be returned directly
return mainSeekable;
}
return _videoJs2['default'].createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);
}
/**
* Update the player duration
*/
}, {
key: 'updateDuration',
value: function updateDuration() {
var _this3 = this;
var oldDuration = this.mediaSource.duration;
var newDuration = Hls.Playlist.duration(this.masterPlaylistLoader_.media());
var buffered = this.tech_.buffered();
var setDuration = function setDuration() {
_this3.mediaSource.duration = newDuration;
_this3.tech_.trigger('durationchange');
_this3.mediaSource.removeEventListener('sourceopen', setDuration);
};
if (buffered.length > 0) {
newDuration = Math.max(newDuration, buffered.end(buffered.length - 1));
}
// if the duration has changed, invalidate the cached value
if (oldDuration !== newDuration) {
// update the duration
if (this.mediaSource.readyState !== 'open') {
this.mediaSource.addEventListener('sourceopen', setDuration);
} else {
setDuration();
}
}
}
/**
* dispose of the MasterPlaylistController and everything
* that it controls
*/
}, {
key: 'dispose',
value: function dispose() {
this.masterPlaylistLoader_.dispose();
this.audioTracks_.forEach(function (track) {
track.dispose();
});
this.audioTracks_.length = 0;
this.mainSegmentLoader_.dispose();
this.audioSegmentLoader_.dispose();
}
/**
* return the master playlist object if we have one
*
* @return {Object} the master playlist object that we parsed
*/
}, {
key: 'master',
value: function master() {
return this.masterPlaylistLoader_.master;
}
/**
* return the currently selected playlist
*
* @return {Object} the currently selected playlist object that we parsed
*/
}, {
key: 'media',
value: function media() {
// playlist loader will not return media if it has not been fully loaded
return this.masterPlaylistLoader_.media() || this.initialMedia_;
}
/**
* setup our internal source buffers on our segment Loaders
*
* @private
*/
}, {
key: 'setupSourceBuffer_',
value: function setupSourceBuffer_() {
var media = this.masterPlaylistLoader_.media();
// wait until a media playlist is available and the Media Source is
// attached
if (!media || this.mediaSource.readyState !== 'open') {
return;
}
this.addMimeType_(this.mainSegmentLoader_, 'avc1.4d400d, mp4a.40.2', media);
// exclude any incompatible variant streams from future playlist
// selection
this.excludeIncompatibleVariants_(media);
}
/**
* add a time type to a segmentLoader
*
* @param {SegmentLoader} segmentLoader the segmentloader to work on
* @param {String} codecs to use by default
* @param {Object} the parsed media object
* @private
*/
}, {
key: 'addMimeType_',
value: function addMimeType_(segmentLoader, defaultCodecs, media) {
var mimeType = 'video/mp2t';
// if the codecs were explicitly specified, pass them along to the
// source buffer
if (media.attributes && media.attributes.CODECS) {
mimeType += '; codecs="' + media.attributes.CODECS + '"';
} else {
mimeType += '; codecs="' + defaultCodecs + '"';
}
segmentLoader.mimeType(mimeType);
}
/**
* Blacklist playlists that are known to be codec or
* stream-incompatible with the SourceBuffer configuration. For
* instance, Media Source Extensions would cause the video element to
* stall waiting for video data if you switched from a variant with
* video and audio to an audio-only one.
*
* @param {Object} media a media playlist compatible with the current
* set of SourceBuffers. Variants in the current master playlist that
* do not appear to have compatible codec or stream configurations
* will be excluded from the default playlist selection algorithm
* indefinitely.
* @private
*/
}, {
key: 'excludeIncompatibleVariants_',
value: function excludeIncompatibleVariants_(media) {
var master = this.masterPlaylistLoader_.master;
var codecCount = 2;
var videoCodec = null;
var audioProfile = null;
var codecs = undefined;
if (media.attributes && media.attributes.CODECS) {
codecs = parseCodecs(media.attributes.CODECS);
videoCodec = codecs.videoCodec;
audioProfile = codecs.audioProfile;
codecCount = codecs.codecCount;
}
master.playlists.forEach(function (variant) {
var variantCodecs = {
codecCount: 2,
videoCodec: null,
audioProfile: null
};
if (variant.attributes && variant.attributes.CODECS) {
variantCodecs = parseCodecs(variant.attributes.CODECS);
}
// if the streams differ in the presence or absence of audio or
// video, they are incompatible
if (variantCodecs.codecCount !== codecCount) {
variant.excludeUntil = Infinity;
}
// if h.264 is specified on the current playlist, some flavor of
// it must be specified on all compatible variants
if (variantCodecs.videoCodec !== videoCodec) {
variant.excludeUntil = Infinity;
}
// HE-AAC ("mp4a.40.5") is incompatible with all other versions of
// AAC audio in Chrome 46. Don't mix the two.
if (variantCodecs.audioProfile === '5' && audioProfile !== '5' || audioProfile === '5' && variantCodecs.audioProfile !== '5') {
variant.excludeUntil = Infinity;
}
});
}
}]);
return MasterPlaylistController;
})(_videoJs2['default'].EventTarget);
exports['default'] = MasterPlaylistController;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./hls-audio-track":7,"./playlist-loader":13,"./ranges":15,"./segment-loader":17}],13:[function(require,module,exports){
(function (global){
/**
* @file playlist-loader.js
*
* A state machine that manages the loading, caching, and updating of
* M3U8 playlists.
*
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _resolveUrl = require('./resolve-url');
var _resolveUrl2 = _interopRequireDefault(_resolveUrl);
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _stream = require('./stream');
var _stream2 = _interopRequireDefault(_stream);
var _m3u8 = require('./m3u8');
var _m3u82 = _interopRequireDefault(_m3u8);
/**
* Returns a new array of segments that is the result of merging
* properties from an older list of segments onto an updated
* list. No properties on the updated playlist will be overridden.
*
* @param {Array} original the outdated list of segments
* @param {Array} update the updated list of segments
* @param {Number=} offset the index of the first update
* segment in the original segment list. For non-live playlists,
* this should always be zero and does not need to be
* specified. For live playlists, it should be the difference
* between the media sequence numbers in the original and updated
* playlists.
* @return a list of merged segment objects
*/
var updateSegments = function updateSegments(original, update, offset) {
var result = update.slice();
var length = undefined;
var i = undefined;
offset = offset || 0;
length = Math.min(original.length, update.length + offset);
for (i = offset; i < length; i++) {
result[i - offset] = (0, _videoJs.mergeOptions)(original[i], result[i - offset]);
}
return result;
};
/**
* Returns a new master playlist that is the result of merging an
* updated media playlist into the original version. If the
* updated media playlist does not match any of the playlist
* entries in the original master playlist, null is returned.
*
* @param {Object} master a parsed master M3U8 object
* @param {Object} media a parsed media M3U8 object
* @return {Object} a new object that represents the original
* master playlist with the updated media playlist merged in, or
* null if the merge produced no change.
*/
var updateMaster = function updateMaster(master, media) {
var changed = false;
var result = (0, _videoJs.mergeOptions)(master, {});
var i = master.playlists.length;
var playlist = undefined;
var segment = undefined;
var j = undefined;
while (i--) {
playlist = result.playlists[i];
if (playlist.uri === media.uri) {
// consider the playlist unchanged if the number of segments
// are equal and the media sequence number is unchanged
if (playlist.segments && media.segments && playlist.segments.length === media.segments.length && playlist.mediaSequence === media.mediaSequence) {
continue;
}
result.playlists[i] = (0, _videoJs.mergeOptions)(playlist, media);
result.playlists[media.uri] = result.playlists[i];
// if the update could overlap existing segment information,
// merge the two lists
if (playlist.segments) {
result.playlists[i].segments = updateSegments(playlist.segments, media.segments, media.mediaSequence - playlist.mediaSequence);
}
// resolve any missing segment and key URIs
j = 0;
if (result.playlists[i].segments) {
j = result.playlists[i].segments.length;
}
while (j--) {
segment = result.playlists[i].segments[j];
if (!segment.resolvedUri) {
segment.resolvedUri = (0, _resolveUrl2['default'])(playlist.resolvedUri, segment.uri);
}
if (segment.key && !segment.key.resolvedUri) {
segment.key.resolvedUri = (0, _resolveUrl2['default'])(playlist.resolvedUri, segment.key.uri);
}
}
changed = true;
}
}
return changed ? result : null;
};
/**
* Load a playlist from a remote loacation
*
* @class PlaylistLoader
* @extends Stream
* @param {String} srcUrl the url to start with
* @param {Boolean} withCredentials the withCredentials xhr option
* @constructor
*/
var PlaylistLoader = function PlaylistLoader(srcUrl, hls, withCredentials) {
var _this = this;
/* eslint-disable consistent-this */
var loader = this;
/* eslint-enable consistent-this */
var dispose = undefined;
var mediaUpdateTimeout = undefined;
var request = undefined;
var playlistRequestError = undefined;
var haveMetadata = undefined;
PlaylistLoader.prototype.constructor.call(this);
this.hls_ = hls;
// a flag that disables "expired time"-tracking this setting has
// no effect when not playing a live stream
this.trackExpiredTime_ = false;
if (!srcUrl) {
throw new Error('A non-empty playlist URL is required');
}
playlistRequestError = function (xhr, url, startingState) {
loader.setBandwidth(request || xhr);
// any in-flight request is now finished
request = null;
if (startingState) {
loader.state = startingState;
}
loader.error = {
playlist: loader.master.playlists[url],
status: xhr.status,
message: 'HLS playlist request error at URL: ' + url,
responseText: xhr.responseText,
code: xhr.status >= 500 ? 4 : 2
};
loader.trigger('error');
};
// update the playlist loader's state in response to a new or
// updated playlist.
haveMetadata = function (xhr, url) {
var parser = undefined;
var refreshDelay = undefined;
var update = undefined;
loader.setBandwidth(request || xhr);
// any in-flight request is now finished
request = null;
loader.state = 'HAVE_METADATA';
parser = new _m3u82['default'].Parser();
parser.push(xhr.responseText);
parser.end();
parser.manifest.uri = url;
// merge this playlist into the master
update = updateMaster(loader.master, parser.manifest);
refreshDelay = (parser.manifest.targetDuration || 10) * 1000;
if (update) {
loader.master = update;
loader.updateMediaPlaylist_(parser.manifest);
} else {
// if the playlist is unchanged since the last reload,
// try again after half the target duration
refreshDelay /= 2;
}
// refresh live playlists after a target duration passes
if (!loader.media().endList) {
window.clearTimeout(mediaUpdateTimeout);
mediaUpdateTimeout = window.setTimeout(function () {
loader.trigger('mediaupdatetimeout');
}, refreshDelay);
}
loader.trigger('loadedplaylist');
};
// initialize the loader state
loader.state = 'HAVE_NOTHING';
// track the time that has expired from the live window
// this allows the seekable start range to be calculated even if
// all segments with timing information have expired
this.expired_ = 0;
// capture the prototype dispose function
dispose = this.dispose;
/**
* Abort any outstanding work and clean up.
*/
loader.dispose = function () {
loader.stopRequest();
window.clearTimeout(mediaUpdateTimeout);
dispose.call(this);
};
loader.stopRequest = function () {
if (request) {
var oldRequest = request;
request = null;
oldRequest.onreadystatechange = null;
oldRequest.abort();
}
};
/**
* When called without any arguments, returns the currently
* active media playlist. When called with a single argument,
* triggers the playlist loader to asynchronously switch to the
* specified media playlist. Calling this method while the
* loader is in the HAVE_NOTHING causes an error to be emitted
* but otherwise has no effect.
*
* @param {Object=} playlis tthe parsed media playlist
* object to switch to
* @return {Playlist} the current loaded media
*/
loader.media = function (playlist) {
var startingState = loader.state;
var mediaChange = undefined;
// getter
if (!playlist) {
return loader.media_;
}
// setter
if (loader.state === 'HAVE_NOTHING') {
throw new Error('Cannot switch media playlist from ' + loader.state);
}
// find the playlist object if the target playlist has been
// specified by URI
if (typeof playlist === 'string') {
if (!loader.master.playlists[playlist]) {
throw new Error('Unknown playlist URI: ' + playlist);
}
playlist = loader.master.playlists[playlist];
}
mediaChange = !loader.media_ || playlist.uri !== loader.media_.uri;
// switch to fully loaded playlists immediately
if (loader.master.playlists[playlist.uri].endList) {
// abort outstanding playlist requests
if (request) {
request.onreadystatechange = null;
request.abort();
request = null;
}
loader.state = 'HAVE_METADATA';
loader.media_ = playlist;
// trigger media change if the active media has been updated
if (mediaChange) {
loader.trigger('mediachanging');
loader.trigger('mediachange');
}
return;
}
// switching to the active playlist is a no-op
if (!mediaChange) {
return;
}
loader.state = 'SWITCHING_MEDIA';
// there is already an outstanding playlist request
if (request) {
if ((0, _resolveUrl2['default'])(loader.master.uri, playlist.uri) === request.url) {
// requesting to switch to the same playlist multiple times
// has no effect after the first
return;
}
request.onreadystatechange = null;
request.abort();
request = null;
}
// request the new playlist
if (this.media_) {
this.trigger('mediachanging');
}
request = this.hls_.xhr({
uri: (0, _resolveUrl2['default'])(loader.master.uri, playlist.uri),
withCredentials: withCredentials
}, function (error, req) {
// disposed
if (!request) {
return;
}
if (error) {
return playlistRequestError(request, playlist.uri, startingState);
}
haveMetadata(req, playlist.uri);
// fire loadedmetadata the first time a media playlist is loaded
if (startingState === 'HAVE_MASTER') {
loader.trigger('loadedmetadata');
} else {
loader.trigger('mediachange');
}
});
};
/**
* set the bandwidth on an xhr to the bandwidth on the playlist
*/
loader.setBandwidth = function (xhr) {
loader.bandwidth = xhr.bandwidth;
};
// In a live playlist, don't keep track of the expired time
// until HLS tells us that "first play" has commenced
loader.on('firstplay', function () {
this.trackExpiredTime_ = true;
});
// live playlist staleness timeout
loader.on('mediaupdatetimeout', function () {
if (loader.state !== 'HAVE_METADATA') {
// only refresh the media playlist if no other activity is going on
return;
}
loader.state = 'HAVE_CURRENT_METADATA';
request = this.hls_.xhr({
uri: (0, _resolveUrl2['default'])(loader.master.uri, loader.media().uri),
withCredentials: withCredentials
}, function (error, req) {
// disposed
if (!request) {
return;
}
if (error) {
return playlistRequestError(request, loader.media().uri);
}
haveMetadata(request, loader.media().uri);
});
});
/**
* pause loading of the playlist
*/
loader.pause = function () {
loader.stopRequest();
window.clearTimeout(mediaUpdateTimeout);
};
/**
* start loading of the playlist
*/
loader.load = function () {
if (loader.started) {
if (!loader.media().endList) {
loader.trigger('mediaupdatetimeout');
} else {
loader.trigger('loadedplaylist');
}
} else {
loader.start();
}
};
/**
* start loading of the playlist
*/
loader.start = function () {
loader.started = true;
// request the specified URL
request = _this.hls_.xhr({
uri: srcUrl,
withCredentials: withCredentials
}, function (error, req) {
var parser = undefined;
var playlist = undefined;
var i = undefined;
// disposed
if (!request) {
return;
}
// clear the loader's request reference
request = null;
if (error) {
loader.error = {
status: req.status,
message: 'HLS playlist request error at URL: ' + srcUrl,
responseText: req.responseText,
// MEDIA_ERR_NETWORK
code: 2
};
return loader.trigger('error');
}
parser = new _m3u82['default'].Parser();
parser.push(req.responseText);
parser.end();
loader.state = 'HAVE_MASTER';
parser.manifest.uri = srcUrl;
// loaded a master playlist
if (parser.manifest.playlists) {
loader.master = parser.manifest;
// setup by-URI lookups and resolve media playlist URIs
i = loader.master.playlists.length;
while (i--) {
playlist = loader.master.playlists[i];
loader.master.playlists[playlist.uri] = playlist;
playlist.resolvedUri = (0, _resolveUrl2['default'])(loader.master.uri, playlist.uri);
}
// resolve any media group URIs
for (var groupKey in loader.master.mediaGroups.AUDIO) {
for (var labelKey in loader.master.mediaGroups.AUDIO[groupKey]) {
var alternateAudio = loader.master.mediaGroups.AUDIO[groupKey][labelKey];
if (alternateAudio.uri) {
alternateAudio.resolvedUri = (0, _resolveUrl2['default'])(loader.master.uri, alternateAudio.uri);
}
}
}
loader.trigger('loadedplaylist');
if (!request) {
// no media playlist was specifically selected so start
// from the first listed one
loader.media(parser.manifest.playlists[0]);
}
return;
}
// loaded a media playlist
// infer a master playlist if none was previously requested
loader.master = {
uri: window.location.href,
playlists: [{
uri: srcUrl
}]
};
loader.master.playlists[srcUrl] = loader.master.playlists[0];
loader.master.playlists[0].resolvedUri = srcUrl;
haveMetadata(req, srcUrl);
return loader.trigger('loadedmetadata');
});
};
};
PlaylistLoader.prototype = new _stream2['default']();
/**
* Update the PlaylistLoader state to reflect the changes in an
* update to the current media playlist.
*
* @param {Object} update the updated media playlist object
*/
PlaylistLoader.prototype.updateMediaPlaylist_ = function (update) {
var outdated = undefined;
var i = undefined;
var segment = undefined;
outdated = this.media_;
this.media_ = this.master.playlists[update.uri];
if (!outdated) {
return;
}
// don't track expired time until this flag is truthy
if (!this.trackExpiredTime_) {
return;
}
// if the update was the result of a rendition switch do not
// attempt to calculate expired_ since media-sequences need not
// correlate between renditions/variants
if (update.uri !== outdated.uri) {
return;
}
// try using precise timing from first segment of the updated
// playlist
if (update.segments.length) {
if (typeof update.segments[0].start !== 'undefined') {
this.expired_ = update.segments[0].start;
return;
} else if (typeof update.segments[0].end !== 'undefined') {
this.expired_ = update.segments[0].end - update.segments[0].duration;
return;
}
}
// calculate expired by walking the outdated playlist
i = update.mediaSequence - outdated.mediaSequence - 1;
for (; i >= 0; i--) {
segment = outdated.segments[i];
if (!segment) {
// we missed information on this segment completely between
// playlist updates so we'll have to take an educated guess
// once we begin buffering again, any error we introduce can
// be corrected
this.expired_ += outdated.targetDuration || 10;
continue;
}
if (typeof segment.end !== 'undefined') {
this.expired_ = segment.end;
return;
}
if (typeof segment.start !== 'undefined') {
this.expired_ = segment.start + segment.duration;
return;
}
this.expired_ += segment.duration;
}
};
exports['default'] = PlaylistLoader;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./m3u8":8,"./resolve-url":16,"./stream":19}],14:[function(require,module,exports){
(function (global){
/**
* @file playlist.js
*
* Playlist related utilities.
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var Playlist = {
/**
* The number of segments that are unsafe to start playback at in
* a live stream. Changing this value can cause playback stalls.
* See HTTP Live Streaming, "Playing the Media Playlist File"
* https://tools.ietf.org/html/draft-pantos-http-live-streaming-18#section-6.3.3
*/
UNSAFE_LIVE_SEGMENTS: 3
};
/**
* walk backward until we find a duration we can use
* or return a failure
*
* @param {Playlist} playlist the playlist to walk through
* @param {Number} endSequence the mediaSequence to stop walking on
*/
var backwardDuration = function backwardDuration(playlist, endSequence) {
var result = 0;
var i = endSequence - playlist.mediaSequence;
// if a start time is available for segment immediately following
// the interval, use it
var segment = playlist.segments[i];
// Walk backward until we find the latest segment with timeline
// information that is earlier than endSequence
if (segment) {
if (typeof segment.start !== 'undefined') {
return { result: segment.start, precise: true };
}
if (typeof segment.end !== 'undefined') {
return {
result: segment.end - segment.duration,
precise: true
};
}
}
while (i--) {
segment = playlist.segments[i];
if (typeof segment.end !== 'undefined') {
return { result: result + segment.end, precise: true };
}
result += segment.duration;
if (typeof segment.start !== 'undefined') {
return { result: result + segment.start, precise: true };
}
}
return { result: result, precise: false };
};
/**
* walk forward until we find a duration we can use
* or return a failure
*
* @param {Playlist} playlist the playlist to walk through
* @param {Number} endSequence the mediaSequence to stop walking on
*/
var forwardDuration = function forwardDuration(playlist, endSequence) {
var result = 0;
var segment = undefined;
var i = endSequence - playlist.mediaSequence;
// Walk forward until we find the earliest segment with timeline
// information
for (; i < playlist.segments.length; i++) {
segment = playlist.segments[i];
if (typeof segment.start !== 'undefined') {
return {
result: segment.start - result,
precise: true
};
}
result += segment.duration;
if (typeof segment.end !== 'undefined') {
return {
result: segment.end - result,
precise: true
};
}
}
// indicate we didn't find a useful duration estimate
return { result: -1, precise: false };
};
/**
* Calculate the media duration from the segments associated with a
* playlist. The duration of a subinterval of the available segments
* may be calculated by specifying an end index.
*
* @param {Object} playlist a media playlist object
* @param {Number=} endSequence an exclusive upper boundary
* for the playlist. Defaults to playlist length.
* @param {Number} expired the amount of time that has dropped
* off the front of the playlist in a live scenario
* @return {Number} the duration between the first available segment
* and end index.
*/
var intervalDuration = function intervalDuration(playlist, endSequence, expired) {
var backward = undefined;
var forward = undefined;
if (typeof endSequence === 'undefined') {
endSequence = playlist.mediaSequence + playlist.segments.length;
}
if (endSequence < playlist.mediaSequence) {
return 0;
}
// do a backward walk to estimate the duration
backward = backwardDuration(playlist, endSequence);
if (backward.precise) {
// if we were able to base our duration estimate on timing
// information provided directly from the Media Source, return
// it
return backward.result;
}
// walk forward to see if a precise duration estimate can be made
// that way
forward = forwardDuration(playlist, endSequence);
if (forward.precise) {
// we found a segment that has been buffered and so it's
// position is known precisely
return forward.result;
}
// return the less-precise, playlist-based duration estimate
return backward.result + expired;
};
/**
* Calculates the duration of a playlist. If a start and end index
* are specified, the duration will be for the subset of the media
* timeline between those two indices. The total duration for live
* playlists is always Infinity.
*
* @param {Object} playlist a media playlist object
* @param {Number=} endSequence an exclusive upper
* boundary for the playlist. Defaults to the playlist media
* sequence number plus its length.
* @param {Number=} expired the amount of time that has
* dropped off the front of the playlist in a live scenario
* @return {Number} the duration between the start index and end
* index.
*/
var duration = function duration(playlist, endSequence, expired) {
if (!playlist) {
return 0;
}
if (typeof expired !== 'number') {
expired = 0;
}
// if a slice of the total duration is not requested, use
// playlist-level duration indicators when they're present
if (typeof endSequence === 'undefined') {
// if present, use the duration specified in the playlist
if (playlist.totalDuration) {
return playlist.totalDuration;
}
// duration should be Infinity for live playlists
if (!playlist.endList) {
return window.Infinity;
}
}
// calculate the total duration based on the segment durations
return intervalDuration(playlist, endSequence, expired);
};
exports.duration = duration;
/**
* Calculates the interval of time that is currently seekable in a
* playlist. The returned time ranges are relative to the earliest
* moment in the specified playlist that is still available. A full
* seekable implementation for live streams would need to offset
* these values by the duration of content that has expired from the
* stream.
*
* @param {Object} playlist a media playlist object
* @param {Number=} expired the amount of time that has
* dropped off the front of the playlist in a live scenario
* @return {TimeRanges} the periods of time that are valid targets
* for seeking
*/
var seekable = function seekable(playlist, expired) {
var start = undefined;
var end = undefined;
var endSequence = undefined;
if (typeof expired !== 'number') {
expired = 0;
}
// without segments, there are no seekable ranges
if (!playlist || !playlist.segments) {
return (0, _videoJs.createTimeRange)();
}
// when the playlist is complete, the entire duration is seekable
if (playlist.endList) {
return (0, _videoJs.createTimeRange)(0, duration(playlist));
}
// live playlists should not expose three segment durations worth
// of content from the end of the playlist
// https://tools.ietf.org/html/draft-pantos-http-live-streaming-16#section-6.3.3
start = intervalDuration(playlist, playlist.mediaSequence, expired);
endSequence = Math.max(0, playlist.segments.length - Playlist.UNSAFE_LIVE_SEGMENTS);
end = intervalDuration(playlist, playlist.mediaSequence + endSequence, expired);
return (0, _videoJs.createTimeRange)(start, end);
};
exports.seekable = seekable;
/**
* Determine the index of the segment that contains a specified
* playback position in a media playlist.
*
* @param {Object} playlist the media playlist to query
* @param {Number} time The number of seconds since the earliest
* possible position to determine the containing segment for
* @param {Number=} expired the duration of content, in
* seconds, that has been removed from this playlist because it
* expired
* @return {Number} The number of the media segment that contains
* that time position.
*/
var getMediaIndexForTime_ = function getMediaIndexForTime_(playlist, time, expired) {
var i = undefined;
var segment = undefined;
var originalTime = time;
var numSegments = playlist.segments.length;
var lastSegment = numSegments - 1;
var startIndex = undefined;
var endIndex = undefined;
var knownStart = undefined;
var knownEnd = undefined;
if (!playlist) {
return 0;
}
// when the requested position is earlier than the current set of
// segments, return the earliest segment index
if (time < 0) {
return 0;
}
expired = expired || 0;
// find segments with known timing information that bound the
// target time
for (i = 0; i < numSegments; i++) {
segment = playlist.segments[i];
if (segment.end) {
if (segment.end > time) {
knownEnd = segment.end;
endIndex = i;
break;
} else {
knownStart = segment.end;
startIndex = i + 1;
}
}
}
// time was equal to or past the end of the last segment in the playlist
if (startIndex === numSegments) {
return numSegments;
}
// use the bounds we just found and playlist information to
// estimate the segment that contains the time we are looking for
if (typeof startIndex !== 'undefined') {
// We have a known-start point that is before our desired time so
// walk from that point forwards
time = time - knownStart;
for (i = startIndex; i < (endIndex || numSegments); i++) {
segment = playlist.segments[i];
time -= segment.duration;
if (time < 0) {
return i;
}
}
if (i >= endIndex) {
// We haven't found a segment but we did hit a known end point
// so fallback to interpolating between the segment index
// based on the known span of the timeline we are dealing with
// and the number of segments inside that span
return startIndex + Math.floor((originalTime - knownStart) / (knownEnd - knownStart) * (endIndex - startIndex));
}
// We _still_ haven't found a segment so load the last one
return lastSegment;
} else if (typeof endIndex !== 'undefined') {
// We _only_ have a known-end point that is after our desired time so
// walk from that point backwards
time = knownEnd - time;
for (i = endIndex; i >= 0; i--) {
segment = playlist.segments[i];
time -= segment.duration;
if (time < 0) {
return i;
}
}
// We haven't found a segment so load the first one if time is zero
if (time === 0) {
return 0;
}
return -1;
}
// We known nothing so walk from the front of the playlist,
// subtracting durations until we find a segment that contains
// time and return it
time = time - expired;
if (time < 0) {
return -1;
}
for (i = 0; i < numSegments; i++) {
segment = playlist.segments[i];
time -= segment.duration;
if (time < 0) {
return i;
}
}
// We are out of possible candidates so load the last one...
// The last one is the least likely to overlap a buffer and therefore
// the one most likely to tell us something about the timeline
return lastSegment;
};
exports.getMediaIndexForTime_ = getMediaIndexForTime_;
Playlist.duration = duration;
Playlist.seekable = seekable;
Playlist.getMediaIndexForTime_ = getMediaIndexForTime_;
// exports
exports['default'] = Playlist;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],15:[function(require,module,exports){
(function (global){
/**
* ranges
*
* Utilities for working with TimeRanges.
*
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
// Fudge factor to account for TimeRanges rounding
var TIME_FUDGE_FACTOR = 1 / 30;
/**
* Clamps a value to within a range
* @param {Number} num - the value to clamp
* @param {Number} start - the start of the range to clamp within, inclusive
* @param {Number} end - the end of the range to clamp within, inclusive
* @return {Number}
*/
var clamp = function clamp(num, _ref) {
var _ref2 = _slicedToArray(_ref, 2);
var start = _ref2[0];
var end = _ref2[1];
return Math.min(Math.max(start, num), end);
};
var filterRanges = function filterRanges(timeRanges, predicate) {
var results = [];
var i = undefined;
if (timeRanges && timeRanges.length) {
// Search for ranges that match the predicate
for (i = 0; i < timeRanges.length; i++) {
if (predicate(timeRanges.start(i), timeRanges.end(i))) {
results.push([timeRanges.start(i), timeRanges.end(i)]);
}
}
}
return _videoJs2['default'].createTimeRanges(results);
};
/**
* Attempts to find the buffered TimeRange that contains the specified
* time.
* @param {TimeRanges} buffered - the TimeRanges object to query
* @param {number} time - the time to filter on.
* @returns {TimeRanges} a new TimeRanges object
*/
var findRange = function findRange(buffered, time) {
return filterRanges(buffered, function (start, end) {
return start - TIME_FUDGE_FACTOR <= time && end + TIME_FUDGE_FACTOR >= time;
});
};
/**
* Returns the TimeRanges that begin at or later than the specified
* time.
* @param {TimeRanges} timeRanges - the TimeRanges object to query
* @param {number} time - the time to filter on.
* @returns {TimeRanges} a new TimeRanges object.
*/
var findNextRange = function findNextRange(timeRanges, time) {
return filterRanges(timeRanges, function (start) {
return start - TIME_FUDGE_FACTOR >= time;
});
};
/**
* Search for a likely end time for the segment that was just appened
* based on the state of the `buffered` property before and after the
* append. If we fin only one such uncommon end-point return it.
* @param {TimeRanges} original - the buffered time ranges before the update
* @param {TimeRanges} update - the buffered time ranges after the update
* @returns {Number|null} the end time added between `original` and `update`,
* or null if one cannot be unambiguously determined.
*/
var findSoleUncommonTimeRangesEnd = function findSoleUncommonTimeRangesEnd(original, update) {
var i = undefined;
var start = undefined;
var end = undefined;
var result = [];
var edges = [];
// In order to qualify as a possible candidate, the end point must:
// 1) Not have already existed in the `original` ranges
// 2) Not result from the shrinking of a range that already existed
// in the `original` ranges
// 3) Not be contained inside of a range that existed in `original`
var overlapsCurrentEnd = function overlapsCurrentEnd(span) {
return span[0] <= end && span[1] >= end;
};
if (original) {
// Save all the edges in the `original` TimeRanges object
for (i = 0; i < original.length; i++) {
start = original.start(i);
end = original.end(i);
edges.push([start, end]);
}
}
if (update) {
// Save any end-points in `update` that are not in the `original`
// TimeRanges object
for (i = 0; i < update.length; i++) {
start = update.start(i);
end = update.end(i);
if (edges.some(overlapsCurrentEnd)) {
continue;
}
// at this point it must be a unique non-shrinking end edge
result.push(end);
}
}
// we err on the side of caution and return null if didn't find
// exactly *one* differing end edge in the search above
if (result.length !== 1) {
return null;
}
return result[0];
};
/**
* Calculate the intersection of two TimeRanges
* @param {TimeRanges} bufferA
* @param {TimeRanges} bufferB
* @returns {TimeRanges} The interesection of `bufferA` with `bufferB`
*/
var bufferIntersection = function bufferIntersection(bufferA, bufferB) {
var start = null;
var end = null;
var arity = 0;
var extents = [];
var ranges = [];
if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {
return _videoJs2['default'].createTimeRange();
}
// Handle the case where we have both buffers and create an
// intersection of the two
var count = bufferA.length;
// A) Gather up all start and end times
while (count--) {
extents.push({ time: bufferA.start(count), type: 'start' });
extents.push({ time: bufferA.end(count), type: 'end' });
}
count = bufferB.length;
while (count--) {
extents.push({ time: bufferB.start(count), type: 'start' });
extents.push({ time: bufferB.end(count), type: 'end' });
}
// B) Sort them by time
extents.sort(function (a, b) {
return a.time - b.time;
});
// C) Go along one by one incrementing arity for start and decrementing
// arity for ends
for (count = 0; count < extents.length; count++) {
if (extents[count].type === 'start') {
arity++;
// D) If arity is ever incremented to 2 we are entering an
// overlapping range
if (arity === 2) {
start = extents[count].time;
}
} else if (extents[count].type === 'end') {
arity--;
// E) If arity is ever decremented to 1 we leaving an
// overlapping range
if (arity === 1) {
end = extents[count].time;
}
}
// F) Record overlapping ranges
if (start !== null && end !== null) {
ranges.push([start, end]);
start = null;
end = null;
}
}
return _videoJs2['default'].createTimeRanges(ranges);
};
/**
* Calculates the percentage of `segmentRange` that overlaps the
* `buffered` time ranges.
* @param {TimeRanges} segmentRange - the time range that the segment
* covers adjusted according to currentTime
* @param {TimeRanges} referenceRange - the original time range that the
* segment covers
* @param {TimeRanges} buffered - the currently buffered time ranges
* @returns {Number} percent of the segment currently buffered
*/
var calculateBufferedPercent = function calculateBufferedPercent(segmentRange, referenceRange, buffered) {
var referenceDuration = referenceRange.end(0) - referenceRange.start(0);
var segmentDuration = segmentRange.end(0) - segmentRange.start(0);
var intersection = bufferIntersection(segmentRange, buffered);
var count = intersection.length;
while (count--) {
segmentDuration -= intersection.end(count) - intersection.start(count);
}
return (referenceDuration - segmentDuration) / referenceDuration * 100;
};
/**
* Return the amount of a segment specified by the mediaIndex overlaps
* the current buffered content.
*
* @param {Number} startOfSegment - the time where the segment begins
* @param {Number} segmentDuration - the duration of the segment in seconds
* @param {TimeRanges} buffered - the state of the buffer
* @returns {Number} percentage of the segment's time range that is
* already in `buffered`
*/
var getSegmentBufferedPercent = function getSegmentBufferedPercent(startOfSegment, segmentDuration, currentTime, buffered) {
var endOfSegment = startOfSegment + segmentDuration;
// The entire time range of the segment
var originalSegmentRange = _videoJs2['default'].createTimeRanges([[startOfSegment, endOfSegment]]);
// The adjusted segment time range that is setup such that it starts
// no earlier than currentTime
// Flash has no notion of a back-buffer so adjustedSegmentRange adjusts
// for that and the function will still return 100% if a only half of a
// segment is actually in the buffer as long as the currentTime is also
// half-way through the segment
var adjustedSegmentRange = _videoJs2['default'].createTimeRanges([[clamp(startOfSegment, [currentTime, endOfSegment]), endOfSegment]]);
// This condition happens when the currentTime is beyond the segment's
// end time
if (adjustedSegmentRange.start(0) === adjustedSegmentRange.end(0)) {
return 0;
}
var percent = calculateBufferedPercent(adjustedSegmentRange, originalSegmentRange, buffered);
// If the segment is reported as having a zero duration, return 0%
// since it is likely that we will need to fetch the segment
if (isNaN(percent) || percent === Infinity || percent === -Infinity) {
return 0;
}
return percent;
};
exports['default'] = {
findRange: findRange,
findNextRange: findNextRange,
findSoleUncommonTimeRangesEnd: findSoleUncommonTimeRangesEnd,
getSegmentBufferedPercent: getSegmentBufferedPercent,
TIME_FUDGE_FACTOR: TIME_FUDGE_FACTOR
};
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],16:[function(require,module,exports){
/**
* @file resolve-url.js
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _globalDocument = require('global/document');
var _globalDocument2 = _interopRequireDefault(_globalDocument);
/**
* Constructs a new URI by interpreting a path relative to another
* URI.
*
* @see http://stackoverflow.com/questions/470832/getting-an-absolute-url-from-a-relative-one-ie6-issue
* @param {String} basePath a relative or absolute URI
* @param {String} path a path part to combine with the base
* @return {String} a URI that is equivalent to composing `base`
* with `path`
*/
var resolveUrl = function resolveUrl(basePath, path) {
// use the base element to get the browser to handle URI resolution
var oldBase = _globalDocument2['default'].querySelector('base');
var docHead = _globalDocument2['default'].querySelector('head');
var a = _globalDocument2['default'].createElement('a');
var base = oldBase;
var oldHref = undefined;
var result = undefined;
// prep the document
if (oldBase) {
oldHref = oldBase.href;
} else {
base = docHead.appendChild(_globalDocument2['default'].createElement('base'));
}
base.href = basePath;
a.href = path;
result = a.href;
// clean up
if (oldBase) {
oldBase.href = oldHref;
} else {
docHead.removeChild(base);
}
return result;
};
exports['default'] = resolveUrl;
module.exports = exports['default'];
},{"global/document":22}],17:[function(require,module,exports){
(function (global){
/**
* @file segment-loader.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _ranges = require('./ranges');
var _ranges2 = _interopRequireDefault(_ranges);
var _playlist = require('./playlist');
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var _sourceUpdater = require('./source-updater');
var _sourceUpdater2 = _interopRequireDefault(_sourceUpdater);
var _decrypter = require('./decrypter');
var _config = require('./config');
var _config2 = _interopRequireDefault(_config);
// in ms
var CHECK_BUFFER_DELAY = 500;
/**
* Updates segment with information about its end-point in time and, optionally,
* the segment duration if we have enough information to determine a segment duration
* accurately.
*
* @param {Object} playlist a media playlist object
* @param {Number} segmentIndex the index of segment we last appended
* @param {Number} segmentEnd the known of the segment referenced by segmentIndex
*/
var updateSegmentMetadata = function updateSegmentMetadata(playlist, segmentIndex, segmentEnd) {
if (!playlist) {
return false;
}
var segment = playlist.segments[segmentIndex];
var previousSegment = playlist.segments[segmentIndex - 1];
if (segmentEnd && segment) {
segment.end = segmentEnd;
// fix up segment durations based on segment end data
if (!previousSegment) {
// first segment is always has a start time of 0 making its duration
// equal to the segment end
segment.duration = segment.end;
} else if (previousSegment.end) {
segment.duration = segment.end - previousSegment.end;
}
return true;
}
return false;
};
/**
* Determines if we should call endOfStream on the media source based
* on the state of the buffer or if appened segment was the final
* segment in the playlist.
*
* @param {Object} playlist a media playlist object
* @param {Object} mediaSource the MediaSource object
* @param {Number} segmentIndex the index of segment we last appended
* @param {Object} currentBuffered buffered region that currentTime resides in
* @returns {Boolean} do we need to call endOfStream on the MediaSource
*/
var detectEndOfStream = function detectEndOfStream(playlist, mediaSource, segmentIndex, currentBuffered) {
if (!playlist) {
return false;
}
var segments = playlist.segments;
// determine a few boolean values to help make the branch below easier
// to read
var appendedLastSegment = segmentIndex === segments.length - 1;
var bufferedToEnd = currentBuffered.length && segments[segments.length - 1].end <= currentBuffered.end(0);
// if we've buffered to the end of the video, we need to call endOfStream
// so that MediaSources can trigger the `ended` event when it runs out of
// buffered data instead of waiting for me
return playlist.endList && mediaSource.readyState === 'open' && (appendedLastSegment || bufferedToEnd);
};
/**
* Turns segment byterange into a string suitable for use in
* HTTP Range requests
*/
var byterangeStr = function byterangeStr(byterange) {
var byterangeStart = undefined;
var byterangeEnd = undefined;
// `byterangeEnd` is one less than `offset + length` because the HTTP range
// header uses inclusive ranges
byterangeEnd = byterange.offset + byterange.length - 1;
byterangeStart = byterange.offset;
return 'bytes=' + byterangeStart + '-' + byterangeEnd;
};
/**
* Defines headers for use in the xhr request for a particular segment.
*/
var segmentXhrHeaders = function segmentXhrHeaders(segment) {
var headers = {};
if ('byterange' in segment) {
headers.Range = byterangeStr(segment.byterange);
}
return headers;
};
/**
* An object that manages segment loading and appending.
*
* @class SegmentLoader
* @param {Object} options required and optional options
* @extends videojs.EventTarget
*/
var SegmentLoader = (function (_videojs$EventTarget) {
_inherits(SegmentLoader, _videojs$EventTarget);
function SegmentLoader(options) {
_classCallCheck(this, SegmentLoader);
_get(Object.getPrototypeOf(SegmentLoader.prototype), 'constructor', this).call(this);
var settings = undefined;
// check pre-conditions
if (!options) {
throw new TypeError('Initialization options are required');
}
if (typeof options.currentTime !== 'function') {
throw new TypeError('No currentTime getter specified');
}
if (!options.mediaSource) {
throw new TypeError('No MediaSource specified');
}
settings = _videoJs2['default'].mergeOptions(_videoJs2['default'].options.hls, options);
// public properties
this.state = 'INIT';
this.bandwidth = settings.bandwidth;
this.roundTrip = NaN;
this.bytesReceived = 0;
// private properties
this.hasPlayed_ = settings.hasPlayed;
this.currentTime_ = settings.currentTime;
this.seekable_ = settings.seekable;
this.seeking_ = settings.seeking;
this.setCurrentTime_ = settings.setCurrentTime;
this.mediaSource_ = settings.mediaSource;
this.withCredentials_ = settings.withCredentials;
this.checkBufferTimeout_ = null;
this.error_ = void 0;
this.expired_ = 0;
this.timeCorrection_ = 0;
this.currentTimeline_ = -1;
this.xhr_ = null;
this.pendingSegment_ = null;
this.sourceUpdater_ = null;
this.hls_ = settings.hls;
}
/**
* dispose of the SegmentLoader and reset to the default state
*/
_createClass(SegmentLoader, [{
key: 'dispose',
value: function dispose() {
this.state = 'DISPOSED';
this.abort_();
if (this.sourceUpdater_) {
this.sourceUpdater_.dispose();
}
}
/**
* abort anything that is currently doing on with the SegmentLoader
* and reset to a default state
*/
}, {
key: 'abort',
value: function abort() {
if (this.state !== 'WAITING') {
return;
}
this.abort_();
// don't wait for buffer check timeouts to begin fetching the
// next segment
if (!this.paused()) {
this.state = 'READY';
this.fillBuffer_();
}
}
/**
* set an error on the segment loader and null out any pending segements
*
* @param {Error} error the error to set on the SegmentLoader
* @return {Error} the error that was set or that is currently set
*/
}, {
key: 'error',
value: function error(_error) {
if (typeof _error !== 'undefined') {
this.error_ = _error;
}
this.pendingSegment_ = null;
return this.error_;
}
/**
* load a playlist and start to fill the buffer
*/
}, {
key: 'load',
value: function load() {
this.monitorBuffer_();
// if we don't have a playlist yet, keep waiting for one to be
// specified
if (!this.playlist_) {
return;
}
// if we're in the middle of processing a segment already, don't
// kick off an additional segment request
if (!this.sourceUpdater_ || this.state !== 'READY' && this.state !== 'INIT') {
return;
}
this.state = 'READY';
this.fillBuffer_();
}
/**
* set a playlist on the segment loader
*
* @param {PlaylistLoader} media the playlist to set on the segment loader
*/
}, {
key: 'playlist',
value: function playlist(media) {
this.playlist_ = media;
// if we were unpaused but waiting for a playlist, start
// buffering now
if (this.sourceUpdater_ && media && this.state === 'INIT' && !this.paused()) {
this.state = 'READY';
return this.fillBuffer_();
}
}
/**
* Prevent the loader from fetching additional segments. If there
* is a segment request outstanding, it will finish processing
* before the loader halts. A segment loader can be unpaused by
* calling load().
*/
}, {
key: 'pause',
value: function pause() {
if (this.checkBufferTimeout_) {
window.clearTimeout(this.checkBufferTimeout_);
this.checkBufferTimeout_ = null;
}
}
/**
* Returns whether the segment loader is fetching additional
* segments when given the opportunity. This property can be
* modified through calls to pause() and load().
*/
}, {
key: 'paused',
value: function paused() {
return this.checkBufferTimeout_ === null;
}
/**
* setter for expired time on the SegmentLoader
*
* @param {Number} expired the exired time to set
*/
}, {
key: 'expired',
value: function expired(_expired) {
this.expired_ = _expired;
}
/**
* create/set the following mimetype on the SourceBuffer through a
* SourceUpdater
*
* @param {String} mimeType the mime type string to use
*/
}, {
key: 'mimeType',
value: function mimeType(_mimeType) {
// TODO Allow source buffers to be re-created with different mime-types
if (!this.sourceUpdater_) {
this.sourceUpdater_ = new _sourceUpdater2['default'](this.mediaSource_, _mimeType);
this.clearBuffer();
// if we were unpaused but waiting for a sourceUpdater, start
// buffering now
if (this.playlist_ && this.state === 'INIT' && !this.paused()) {
this.state = 'READY';
return this.fillBuffer_();
}
}
}
/**
* asynchronously/recursively monitor the buffer
*
* @private
*/
}, {
key: 'monitorBuffer_',
value: function monitorBuffer_() {
if (this.state === 'READY') {
this.fillBuffer_();
}
if (this.checkBufferTimeout_) {
window.clearTimeout(this.checkBufferTimeout_);
}
this.checkBufferTimeout_ = window.setTimeout(this.monitorBuffer_.bind(this), CHECK_BUFFER_DELAY);
}
/**
* Determines what segment request should be made, given current
* playback state.
*
* @param {TimeRanges} buffered - the state of the buffer
* @param {Object} playlist - the playlist object to fetch segments from
* @param {Number} currentTime - the playback position in seconds
* @returns {Object} a segment info object that describes the
* request that should be made or null if no request is necessary
*/
}, {
key: 'checkBuffer_',
value: function checkBuffer_(buffered, playlist, currentTime) {
var currentBuffered = _ranges2['default'].findRange(buffered, currentTime);
// There are times when MSE reports the first segment as starting a
// little after 0-time so add a fudge factor to try and fix those cases
// or we end up fetching the same first segment over and over
if (currentBuffered.length === 0 && currentTime === 0) {
currentBuffered = _ranges2['default'].findRange(buffered, currentTime + _ranges2['default'].TIME_FUDGE_FACTOR);
}
var bufferedTime = undefined;
var currentBufferedEnd = undefined;
var timestampOffset = this.sourceUpdater_.timestampOffset();
var segment = undefined;
var mediaIndex = undefined;
if (!playlist.segments.length) {
return;
}
if (currentBuffered.length === 0) {
// find the segment containing currentTime
mediaIndex = (0, _playlist.getMediaIndexForTime_)(playlist, currentTime + this.timeCorrection_, this.expired_);
} else {
// find the segment adjacent to the end of the current
// buffered region
currentBufferedEnd = currentBuffered.end(0);
bufferedTime = Math.max(0, currentBufferedEnd - currentTime);
// if the video has not yet played only, and we already have
// one segment downloaded do nothing
if (!this.hasPlayed_() && bufferedTime >= 1) {
return null;
}
// if there is plenty of content buffered, and the video has
// been played before relax for awhile
if (this.hasPlayed_() && bufferedTime >= _config2['default'].GOAL_BUFFER_LENGTH) {
return null;
}
mediaIndex = (0, _playlist.getMediaIndexForTime_)(playlist, currentBufferedEnd + this.timeCorrection_, this.expired_);
}
if (mediaIndex < 0 || mediaIndex === playlist.segments.length) {
return null;
}
segment = playlist.segments[mediaIndex];
var startOfSegment = (0, _playlist.duration)(playlist, playlist.mediaSequence + mediaIndex, this.expired_);
// We will need to change timestampOffset of the sourceBuffer if either of
// the following conditions are true:
// - The segment.timeline !== this.currentTimeline
// (we are crossing a discontinuity somehow)
// - The "timestampOffset" for the start of this segment is less than
// the currently set timestampOffset
if (segment.timeline !== this.currentTimeline_ || startOfSegment < this.sourceUpdater_.timestampOffset()) {
timestampOffset = startOfSegment;
}
return {
// resolve the segment URL relative to the playlist
uri: segment.resolvedUri,
// the segment's mediaIndex at the time it was requested
mediaIndex: mediaIndex,
// the segment's playlist
playlist: playlist,
// unencrypted bytes of the segment
bytes: null,
// when a key is defined for this segment, the encrypted bytes
encryptedBytes: null,
// the state of the buffer before a segment is appended will be
// stored here so that the actual segment duration can be
// determined after it has been appended
buffered: null,
// The target timestampOffset for this segment when we append it
// to the source buffer
timestampOffset: timestampOffset,
// The timeline that the segment is in
timeline: segment.timeline,
// The expected duration of the segment in seconds
duration: segment.duration
};
}
/**
* abort all pending xhr requests and null any pending segements
*
* @private
*/
}, {
key: 'abort_',
value: function abort_() {
if (this.xhr_) {
this.xhr_.abort();
}
// clear out the segment being processed
this.pendingSegment_ = null;
}
/**
* fill the buffer with segements unless the
* sourceBuffers are currently updating
*
* @private
*/
}, {
key: 'fillBuffer_',
value: function fillBuffer_() {
if (this.sourceUpdater_.updating()) {
return;
}
// see if we need to begin loading immediately
var request = this.checkBuffer_(this.sourceUpdater_.buffered(), this.playlist_, this.currentTime_(), this.timestampOffset_);
if (!request) {
return;
}
if (request.mediaIndex === this.playlist_.segments.length - 1 && this.mediaSource_.readyState === 'ended' && !this.seeking_()) {
return;
}
var segment = this.playlist_.segments[request.mediaIndex];
var startOfSegment = (0, _playlist.duration)(this.playlist_, this.playlist_.mediaSequence + request.mediaIndex, this.expired_);
// Sanity check the segment-index determining logic by calcuating the
// percentage of the chosen segment that is buffered. If more than 90%
// of the segment is buffered then fetching it will likely not help in
// any way
var percentBuffered = _ranges2['default'].getSegmentBufferedPercent(startOfSegment, segment.duration, this.currentTime_(), this.sourceUpdater_.buffered());
if (percentBuffered >= 90) {
// Increment the timeCorrection_ variable to push the fetcher forward
// in time and hopefully skip any gaps or flaws in our understanding
// of the media
var correctionApplied = this.incrementTimeCorrection_(this.playlist_.targetDuration / 2, 1);
if (correctionApplied && !this.paused()) {
this.fillBuffer_();
}
return;
}
this.loadSegment_(request);
}
/**
* load a specific segment from a request into the buffer
*
* @private
*/
}, {
key: 'loadSegment_',
value: function loadSegment_(segmentInfo) {
var segment = undefined;
var requestTimeout = undefined;
var keyXhr = undefined;
var segmentXhr = undefined;
var seekable = this.seekable_();
var currentTime = this.currentTime_();
var removeToTime = 0;
// Chrome has a hard limit of 150mb of
// buffer and a very conservative "garbage collector"
// We manually clear out the old buffer to ensure
// we don't trigger the QuotaExceeded error
// on the source buffer during subsequent appends
// If we have a seekable range use that as the limit for what can be removed safely
// otherwise remove anything older than 1 minute before the current play head
if (seekable.length && seekable.start(0) > 0 && seekable.start(0) < currentTime) {
removeToTime = seekable.start(0);
} else {
removeToTime = currentTime - 60;
}
if (removeToTime > 0) {
this.sourceUpdater_.remove(0, removeToTime);
}
segment = segmentInfo.playlist.segments[segmentInfo.mediaIndex];
// Set xhr timeout to 150% of the segment duration to allow us
// some time to switch renditions in the event of a catastrophic
// decrease in network performance or a server issue.
requestTimeout = segment.duration * 1.5 * 1000;
if (segment.key) {
keyXhr = this.hls_.xhr({
uri: segment.key.resolvedUri,
responseType: 'arraybuffer',
withCredentials: this.withCredentials_,
timeout: requestTimeout
}, this.handleResponse_.bind(this));
}
this.pendingSegment_ = segmentInfo;
segmentXhr = this.hls_.xhr({
uri: segmentInfo.uri,
responseType: 'arraybuffer',
withCredentials: this.withCredentials_,
timeout: requestTimeout,
headers: segmentXhrHeaders(segment)
}, this.handleResponse_.bind(this));
this.xhr_ = {
keyXhr: keyXhr,
segmentXhr: segmentXhr,
abort: function abort() {
if (this.segmentXhr) {
// Prevent error handler from running.
this.segmentXhr.onreadystatechange = null;
this.segmentXhr.abort();
this.segmentXhr = null;
}
if (this.keyXhr) {
// Prevent error handler from running.
this.keyXhr.onreadystatechange = null;
this.keyXhr.abort();
this.keyXhr = null;
}
}
};
this.state = 'WAITING';
}
/**
* triggered when a segment response is received
*
* @private
*/
}, {
key: 'handleResponse_',
value: function handleResponse_(error, request) {
var segmentInfo = undefined;
var segment = undefined;
var keyXhrRequest = undefined;
var view = undefined;
// timeout of previously aborted request
if (!this.xhr_ || request !== this.xhr_.segmentXhr && request !== this.xhr_.keyXhr) {
return;
}
segmentInfo = this.pendingSegment_;
segment = segmentInfo.playlist.segments[segmentInfo.mediaIndex];
// if a request times out, reset bandwidth tracking
if (request.timedout) {
this.abort_();
this.bandwidth = 1;
this.roundTrip = NaN;
this.state = 'READY';
return this.trigger('progress');
}
// trigger an event for other errors
if (!request.aborted && error) {
// abort will clear xhr_
keyXhrRequest = this.xhr_.keyXhr;
this.abort_();
this.error({
status: request.status,
message: request === keyXhrRequest ? 'HLS key request error at URL: ' + segment.key.uri : 'HLS segment request error at URL: ' + segmentInfo.uri,
code: 2,
xhr: request
});
this.state = 'READY';
this.pause();
return this.trigger('error');
}
// stop processing if the request was aborted
if (!request.response) {
this.abort_();
return;
}
if (request === this.xhr_.segmentXhr) {
// the segment request is no longer outstanding
this.xhr_.segmentXhr = null;
// calculate the download bandwidth based on segment request
this.roundTrip = request.roundTripTime;
this.bandwidth = request.bandwidth;
this.bytesReceived += request.bytesReceived || 0;
if (segment.key) {
segmentInfo.encryptedBytes = new Uint8Array(request.response);
} else {
segmentInfo.bytes = new Uint8Array(request.response);
}
}
if (request === this.xhr_.keyXhr) {
keyXhrRequest = this.xhr_.segmentXhr;
// the key request is no longer outstanding
this.xhr_.keyXhr = null;
if (request.response.byteLength !== 16) {
this.abort_();
this.error({
status: request.status,
message: 'Invalid HLS key at URL: ' + segment.key.uri,
code: 2,
xhr: request
});
this.state = 'READY';
this.pause();
return this.trigger('error');
}
view = new DataView(request.response);
segment.key.bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);
// if the media sequence is greater than 2^32, the IV will be incorrect
// assuming 10s segments, that would be about 1300 years
segment.key.iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);
}
if (!this.xhr_.segmentXhr && !this.xhr_.keyXhr) {
this.xhr_ = null;
this.processResponse_();
}
}
/**
* clear anything that is currently in the buffer and throw it away
*/
}, {
key: 'clearBuffer',
value: function clearBuffer() {
if (this.sourceUpdater_ && this.sourceUpdater_.buffered().length) {
this.sourceUpdater_.remove(0, Infinity);
}
}
/**
* Decrypt the segment that is being loaded if necessary
*
* @private
*/
}, {
key: 'processResponse_',
value: function processResponse_() {
var segmentInfo = undefined;
var segment = undefined;
this.state = 'DECRYPTING';
segmentInfo = this.pendingSegment_;
segment = segmentInfo.playlist.segments[segmentInfo.mediaIndex];
if (segment.key) {
// this is an encrypted segment
// incrementally decrypt the segment
/* eslint-disable no-new, handle-callback-err */
new _decrypter.Decrypter(segmentInfo.encryptedBytes, segment.key.bytes, segment.key.iv, (function (err, bytes) {
// err always null
segmentInfo.bytes = bytes;
this.handleSegment_();
}).bind(this));
/* eslint-enable */
} else {
this.handleSegment_();
}
}
/**
* append a decrypted segement to the SourceBuffer through a SourceUpdater
*
* @private
*/
}, {
key: 'handleSegment_',
value: function handleSegment_() {
var segmentInfo = undefined;
this.state = 'APPENDING';
segmentInfo = this.pendingSegment_;
segmentInfo.buffered = this.sourceUpdater_.buffered();
this.currentTimeline_ = segmentInfo.timeline;
if (segmentInfo.timestampOffset !== this.sourceUpdater_.timestampOffset()) {
this.sourceUpdater_.timestampOffset(segmentInfo.timestampOffset);
}
this.sourceUpdater_.appendBuffer(segmentInfo.bytes, this.handleUpdateEnd_.bind(this));
}
/**
* callback to run when appendBuffer is finished. detects if we are
* in a good state to do things with the data we got, or if we need
* to wait for more
*
* @private
*/
}, {
key: 'handleUpdateEnd_',
value: function handleUpdateEnd_() {
var segmentInfo = this.pendingSegment_;
var currentTime = this.currentTime_();
this.pendingSegment_ = null;
// add segment metadata if it we have gained information during the
// last append
var timelineUpdated = this.updateTimeline_(segmentInfo);
this.trigger('progress');
var currentMediaIndex = segmentInfo.mediaIndex;
currentMediaIndex += segmentInfo.playlist.mediaSequence - this.playlist_.mediaSequence;
var currentBuffered = _ranges2['default'].findRange(this.sourceUpdater_.buffered(), currentTime);
// any time an update finishes and the last segment is in the
// buffer, end the stream. this ensures the "ended" event will
// fire if playback reaches that point.
var isEndOfStream = detectEndOfStream(segmentInfo.playlist, this.mediaSource_, currentMediaIndex, currentBuffered);
if (isEndOfStream) {
this.mediaSource_.endOfStream();
}
// when seeking to the beginning of the seekable range, it's
// possible that imprecise timing information may cause the seek to
// end up earlier than the start of the range
// in that case, seek again
var seekable = this.seekable_();
var next = _ranges2['default'].findNextRange(this.sourceUpdater_.buffered(), currentTime);
if (this.seeking_() && currentBuffered.length === 0) {
if (seekable.length && currentTime < seekable.start(0)) {
if (next.length) {
_videoJs2['default'].log('tried seeking to', currentTime, 'but that was too early, retrying at', next.start(0));
this.setCurrentTime_(next.start(0) + _ranges2['default'].TIME_FUDGE_FACTOR);
}
}
}
this.state = 'READY';
if (timelineUpdated) {
this.timeCorrection_ = 0;
if (!this.paused()) {
this.fillBuffer_();
}
return;
}
// the last segment append must have been entirely in the
// already buffered time ranges. adjust the timeCorrection
// offset to fetch forward until we find a segment that adds
// to the buffered time ranges and improves subsequent media
// index calculations.
var correctionApplied = this.incrementTimeCorrection_(segmentInfo.duration, 4);
if (correctionApplied && !this.paused()) {
this.fillBuffer_();
}
}
/**
* annotate the segment with any start and end time information
* added by the media processing
*
* @private
* @param {Object} segmentInfo annotate a segment with time info
*/
}, {
key: 'updateTimeline_',
value: function updateTimeline_(segmentInfo) {
var segment = undefined;
var segmentEnd = undefined;
var timelineUpdated = false;
var playlist = segmentInfo.playlist;
var currentMediaIndex = segmentInfo.mediaIndex;
currentMediaIndex += playlist.mediaSequence - this.playlist_.mediaSequence;
segment = playlist.segments[currentMediaIndex];
// Update segment meta-data (duration and end-point) based on timeline
if (segment && segmentInfo && segmentInfo.playlist.uri === this.playlist_.uri) {
segmentEnd = _ranges2['default'].findSoleUncommonTimeRangesEnd(segmentInfo.buffered, this.sourceUpdater_.buffered());
timelineUpdated = updateSegmentMetadata(playlist, currentMediaIndex, segmentEnd);
}
return timelineUpdated;
}
/**
* add a number of seconds to the currentTime when determining which
* segment to fetch in order to force the fetcher to advance in cases
* where it may get stuck on the same segment due to buffer gaps or
* missing segment annotation after a rendition switch (especially
* during a live stream)
*
* @private
* @param {Number} secondsToIncrement number of seconds to add to the
* timeCorrection_ variable
* @param {Number} maxSegmentsToWalk maximum number of times we allow this
* function to walk forward
*/
}, {
key: 'incrementTimeCorrection_',
value: function incrementTimeCorrection_(secondsToIncrement, maxSegmentsToWalk) {
// If we have already incremented timeCorrection_ beyond the limit,
// stop searching for a segment and reset timeCorrection_
if (this.timeCorrection_ >= this.playlist_.targetDuration * maxSegmentsToWalk) {
this.timeCorrection_ = 0;
return false;
}
this.timeCorrection_ += secondsToIncrement;
return true;
}
}]);
return SegmentLoader;
})(_videoJs2['default'].EventTarget);
exports['default'] = SegmentLoader;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./config":2,"./decrypter":6,"./playlist":14,"./ranges":15,"./source-updater":18}],18:[function(require,module,exports){
(function (global){
/**
* @file source-updater.js
*/
'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; }; })();
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 _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
/**
* A queue of callbacks to be serialized and applied when a
* MediaSource and its associated SourceBuffers are not in the
* updating state. It is used by the segment loader to update the
* underlying SourceBuffers when new data is loaded, for instance.
*
* @class SourceUpdater
* @param {MediaSource} mediaSource the MediaSource to create the
* SourceBuffer from
* @param {String} mimeType the desired MIME type of the underlying
* SourceBuffer
*/
var SourceUpdater = (function () {
function SourceUpdater(mediaSource, mimeType) {
var _this = this;
_classCallCheck(this, SourceUpdater);
var createSourceBuffer = function createSourceBuffer() {
_this.sourceBuffer_ = mediaSource.addSourceBuffer(mimeType);
// run completion handlers and process callbacks as updateend
// events fire
_this.sourceBuffer_.addEventListener('updateend', function () {
var pendingCallback = _this.pendingCallback_;
_this.pendingCallback_ = null;
if (pendingCallback) {
pendingCallback();
}
});
_this.sourceBuffer_.addEventListener('updateend', _this.runCallback_.bind(_this));
_this.runCallback_();
};
this.callbacks_ = [];
this.pendingCallback_ = null;
this.timestampOffset_ = 0;
this.mediaSource = mediaSource;
if (mediaSource.readyState === 'closed') {
mediaSource.addEventListener('sourceopen', createSourceBuffer);
} else {
createSourceBuffer();
}
}
/**
* Aborts the current segment and resets the segment parser.
*
* @param {Function} done function to call when done
* @see http://w3c.github.io/media-source/#widl-SourceBuffer-abort-void
*/
_createClass(SourceUpdater, [{
key: 'abort',
value: function abort(done) {
var _this2 = this;
this.queueCallback_(function () {
_this2.sourceBuffer_.abort();
}, done);
}
/**
* Queue an update to append an ArrayBuffer.
*
* @param {ArrayBuffer} bytes
* @param {Function} done the function to call when done
* @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data
*/
}, {
key: 'appendBuffer',
value: function appendBuffer(bytes, done) {
var _this3 = this;
this.queueCallback_(function () {
_this3.sourceBuffer_.appendBuffer(bytes);
}, done);
}
/**
* Indicates what TimeRanges are buffered in the managed SourceBuffer.
*
* @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-buffered
*/
}, {
key: 'buffered',
value: function buffered() {
if (!this.sourceBuffer_) {
return _videoJs2['default'].createTimeRanges();
}
return this.sourceBuffer_.buffered;
}
/**
* Queue an update to set the duration.
*
* @param {Double} duration what to set the duration to
* @see http://www.w3.org/TR/media-source/#widl-MediaSource-duration
*/
}, {
key: 'duration',
value: function duration(_duration) {
var _this4 = this;
this.queueCallback_(function () {
_this4.sourceBuffer_.duration = _duration;
});
}
/**
* Queue an update to remove a time range from the buffer.
*
* @param {Number} start where to start the removal
* @param {Number} end where to end the removal
* @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-remove-void-double-start-unrestricted-double-end
*/
}, {
key: 'remove',
value: function remove(start, end) {
var _this5 = this;
this.queueCallback_(function () {
_this5.sourceBuffer_.remove(start, end);
});
}
/**
* wether the underlying sourceBuffer is updating or not
*
* @return {Boolean} the updating status of the SourceBuffer
*/
}, {
key: 'updating',
value: function updating() {
return !this.sourceBuffer_ || this.sourceBuffer_.updating;
}
/**
* Set/get the timestampoffset on the SourceBuffer
*
* @return {Number} the timestamp offset
*/
}, {
key: 'timestampOffset',
value: function timestampOffset(offset) {
var _this6 = this;
if (typeof offset !== 'undefined') {
this.queueCallback_(function () {
_this6.sourceBuffer_.timestampOffset = offset;
});
this.timestampOffset_ = offset;
}
return this.timestampOffset_;
}
/**
* que a callback to run
*/
}, {
key: 'queueCallback_',
value: function queueCallback_(callback, done) {
this.callbacks_.push([callback.bind(this), done]);
this.runCallback_();
}
/**
* run a queued callback
*/
}, {
key: 'runCallback_',
value: function runCallback_() {
var callbacks = undefined;
if (this.sourceBuffer_ && !this.sourceBuffer_.updating && this.callbacks_.length) {
callbacks = this.callbacks_.shift();
this.pendingCallback_ = callbacks[1];
callbacks[0]();
}
}
/**
* dispose of the source updater and the underlying sourceBuffer
*/
}, {
key: 'dispose',
value: function dispose() {
if (this.sourceBuffer_ && this.mediaSource.readyState === 'open') {
this.sourceBuffer_.abort();
}
}
}]);
return SourceUpdater;
})();
exports['default'] = SourceUpdater;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],19:[function(require,module,exports){
/**
* @file stream.js
*/
/**
* A lightweight readable stream implemention that handles event dispatching.
*
* @class Stream
*/
'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; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
var Stream = (function () {
function Stream() {
_classCallCheck(this, Stream);
this.listeners = {};
}
/**
* Add a listener for a specified event type.
*
* @param {String} type the event name
* @param {Function} listener the callback to be invoked when an event of
* the specified type occurs
*/
_createClass(Stream, [{
key: 'on',
value: function on(type, listener) {
if (!this.listeners[type]) {
this.listeners[type] = [];
}
this.listeners[type].push(listener);
}
/**
* Remove a listener for a specified event type.
*
* @param {String} type the event name
* @param {Function} listener a function previously registered for this
* type of event through `on`
* @return {Boolean} if we could turn it off or not
*/
}, {
key: 'off',
value: function off(type, listener) {
var index = undefined;
if (!this.listeners[type]) {
return false;
}
index = this.listeners[type].indexOf(listener);
this.listeners[type].splice(index, 1);
return index > -1;
}
/**
* Trigger an event of the specified type on this stream. Any additional
* arguments to this function are passed as parameters to event listeners.
*
* @param {String} type the event name
*/
}, {
key: 'trigger',
value: function trigger(type) {
var callbacks = undefined;
var i = undefined;
var length = undefined;
var args = undefined;
callbacks = this.listeners[type];
if (!callbacks) {
return;
}
// Slicing the arguments on every invocation of this method
// can add a significant amount of overhead. Avoid the
// intermediate object creation for the common case of a
// single callback argument
if (arguments.length === 2) {
length = callbacks.length;
for (i = 0; i < length; ++i) {
callbacks[i].call(this, arguments[1]);
}
} else {
args = Array.prototype.slice.call(arguments, 1);
length = callbacks.length;
for (i = 0; i < length; ++i) {
callbacks[i].apply(this, args);
}
}
}
/**
* Destroys the stream and cleans up.
*/
}, {
key: 'dispose',
value: function dispose() {
this.listeners = {};
}
/**
* Forwards all `data` events on this stream to the destination stream. The
* destination stream should provide a method `push` to receive the data
* events as they arrive.
*
* @param {Stream} destination the stream that will receive all `data` events
* @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
*/
}, {
key: 'pipe',
value: function pipe(destination) {
this.on('data', function (data) {
destination.push(data);
});
}
}]);
return Stream;
})();
exports['default'] = Stream;
module.exports = exports['default'];
},{}],20:[function(require,module,exports){
(function (global){
/**
* @file xhr.js
*/
/**
* A wrapper for videojs.xhr that tracks bandwidth.
*
* @param {Object} options options for the XHR
* @param {Function} callback the callback to call when done
* @return {Request} the xhr request that is going to be made
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var xhrFactory = function xhrFactory() {
var xhr = function XhrFunction(options, callback) {
// Add a default timeout for all hls requests
options = (0, _videoJs.mergeOptions)({
timeout: 45e3
}, options);
// Allow an optional user-specified function to modify the option
// object before we construct the xhr request
if (XhrFunction.beforeRequest && typeof XhrFunction.beforeRequest === 'function') {
var newOptions = XhrFunction.beforeRequest(options);
if (newOptions) {
options = newOptions;
}
}
var request = (0, _videoJs.xhr)(options, function (error, response) {
if (!error && request.response) {
request.responseTime = new Date().getTime();
request.roundTripTime = request.responseTime - request.requestTime;
request.bytesReceived = request.response.byteLength || request.response.length;
if (!request.bandwidth) {
request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1000);
}
}
// videojs.xhr now uses a specific code
// on the error object to signal that a request has
// timed out errors of setting a boolean on the request object
if (error || request.timedout) {
request.timedout = request.timedout || error.code === 'ETIMEDOUT';
} else {
request.timedout = false;
}
// videojs.xhr no longer considers status codes outside of 200 and 0
// (for file uris) to be errors, but the old XHR did, so emulate that
// behavior. Status 206 may be used in response to byterange requests.
if (!error && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {
error = new Error('XHR Failed with a response of: ' + (request && (request.response || request.responseText)));
}
callback(error, request);
});
request.requestTime = new Date().getTime();
return request;
};
return xhr;
};
exports['default'] = xhrFactory;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],21:[function(require,module,exports){
},{}],22:[function(require,module,exports){
(function (global){
var topLevel = typeof global !== 'undefined' ? global :
typeof window !== 'undefined' ? window : {}
var minDoc = require('min-document');
if (typeof document !== 'undefined') {
module.exports = document;
} else {
var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];
if (!doccy) {
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;
}
module.exports = doccy;
}
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"min-document":21}],23:[function(require,module,exports){
/*
* pkcs7.pad
* https://github.com/brightcove/pkcs7
*
* Copyright (c) 2014 Brightcove
* Licensed under the apache2 license.
*/
'use strict';
var PADDING;
/**
* Returns a new Uint8Array that is padded with PKCS#7 padding.
* @param plaintext {Uint8Array} the input bytes before encryption
* @return {Uint8Array} the padded bytes
* @see http://tools.ietf.org/html/rfc5652
*/
module.exports = function pad(plaintext) {
var padding = PADDING[(plaintext.byteLength % 16) || 0],
result = new Uint8Array(plaintext.byteLength + padding.length);
result.set(plaintext);
result.set(padding, plaintext.byteLength);
return result;
};
// pre-define the padding values
PADDING = [
[16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16],
[15, 15, 15, 15,
15, 15, 15, 15,
15, 15, 15, 15,
15, 15, 15],
[14, 14, 14, 14,
14, 14, 14, 14,
14, 14, 14, 14,
14, 14],
[13, 13, 13, 13,
13, 13, 13, 13,
13, 13, 13, 13,
13],
[12, 12, 12, 12,
12, 12, 12, 12,
12, 12, 12, 12],
[11, 11, 11, 11,
11, 11, 11, 11,
11, 11, 11],
[10, 10, 10, 10,
10, 10, 10, 10,
10, 10],
[9, 9, 9, 9,
9, 9, 9, 9,
9],
[8, 8, 8, 8,
8, 8, 8, 8],
[7, 7, 7, 7,
7, 7, 7],
[6, 6, 6, 6,
6, 6],
[5, 5, 5, 5,
5],
[4, 4, 4, 4],
[3, 3, 3],
[2, 2],
[1]
];
},{}],24:[function(require,module,exports){
/*
* pkcs7
* https://github.com/brightcove/pkcs7
*
* Copyright (c) 2014 Brightcove
* Licensed under the apache2 license.
*/
'use strict';
exports.pad = require('./pad.js');
exports.unpad = require('./unpad.js');
},{"./pad.js":23,"./unpad.js":25}],25:[function(require,module,exports){
/*
* pkcs7.unpad
* https://github.com/brightcove/pkcs7
*
* Copyright (c) 2014 Brightcove
* Licensed under the apache2 license.
*/
'use strict';
/**
* Returns the subarray of a Uint8Array without PKCS#7 padding.
* @param padded {Uint8Array} unencrypted bytes that have been padded
* @return {Uint8Array} the unpadded bytes
* @see http://tools.ietf.org/html/rfc5652
*/
module.exports = function unpad(padded) {
return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
};
},{}],26:[function(require,module,exports){
(function (global){
/**
* @file add-text-track-data.js
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
/**
* Define properties on a cue for backwards compatability,
* but warn the user that the way that they are using it
* is depricated and will be removed at a later date.
*
* @param {Cue} cue the cue to add the properties on
* @private
*/
var deprecateOldCue = function deprecateOldCue(cue) {
Object.defineProperties(cue.frame, {
id: {
get: function get() {
_videoJs2['default'].log.warn('cue.frame.id is deprecated. Use cue.value.key instead.');
return cue.value.key;
}
},
value: {
get: function get() {
_videoJs2['default'].log.warn('cue.frame.value is deprecated. Use cue.value.data instead.');
return cue.value.data;
}
},
privateData: {
get: function get() {
_videoJs2['default'].log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.');
return cue.value.data;
}
}
});
};
/**
* Add text track data to a source handler given the captions and
* metadata from the buffer.
*
* @param {Object} sourceHandler the flash or virtual source buffer
* @param {Array} captionArray an array of caption data
* @param {Array} cue an array of meta data
* @private
*/
var addTextTrackData = function addTextTrackData(sourceHandler, captionArray, metadataArray) {
var Cue = window.WebKitDataCue || window.VTTCue;
if (captionArray) {
captionArray.forEach(function (caption) {
this.inbandTextTrack_.addCue(new Cue(caption.startTime + this.timestampOffset, caption.endTime + this.timestampOffset, caption.text));
}, sourceHandler);
}
if (metadataArray) {
metadataArray.forEach(function (metadata) {
var time = metadata.cueTime + this.timestampOffset;
metadata.frames.forEach(function (frame) {
var cue = new Cue(time, time, frame.value || frame.url || frame.data || '');
cue.frame = frame;
cue.value = frame;
deprecateOldCue(cue);
this.metadataTrack_.addCue(cue);
}, this);
}, sourceHandler);
}
};
exports['default'] = addTextTrackData;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],27:[function(require,module,exports){
/**
* @file codec-utils.js
*/
/**
* Check if a codec string refers to an audio codec.
*
* @param {String} codec codec string to check
* @return {Boolean} if this is an audio codec
* @private
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var isAudioCodec = function isAudioCodec(codec) {
return (/mp4a\.\d+.\d+/i.test(codec)
);
};
/**
* Check if a codec string refers to a video codec.
*
* @param {String} codec codec string to check
* @return {Boolean} if this is a video codec
* @private
*/
var isVideoCodec = function isVideoCodec(codec) {
return (/avc1\.[\da-f]+/i.test(codec)
);
};
/**
* Parse a content type header into a type and parameters
* object
*
* @param {String} type the content type header
* @return {Object} the parsed content-type
* @private
*/
var parseContentType = function parseContentType(type) {
var object = { type: '', parameters: {} };
var parameters = type.trim().split(';');
// first parameter should always be content-type
object.type = parameters.shift().trim();
parameters.forEach(function (parameter) {
var pair = parameter.trim().split('=');
if (pair.length > 1) {
var _name = pair[0].replace(/"/g, '').trim();
var value = pair[1].replace(/"/g, '').trim();
object.parameters[_name] = value;
}
});
return object;
};
exports['default'] = {
isAudioCodec: isAudioCodec,
parseContentType: parseContentType,
isVideoCodec: isVideoCodec
};
module.exports = exports['default'];
},{}],28:[function(require,module,exports){
/**
* @file create-text-tracks-if-necessary.js
*/
/**
* Create text tracks on video.js if they exist on a segment.
*
* @param {Object} sourceBuffer the VSB or FSB
* @param {Object} mediaSource the HTML or Flash media source
* @param {Object} segment the segment that may contain the text track
* @private
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var createTextTracksIfNecessary = function createTextTracksIfNecessary(sourceBuffer, mediaSource, segment) {
// create an in-band caption track if one is present in the segment
if (segment.captions && segment.captions.length && !sourceBuffer.inbandTextTrack_) {
sourceBuffer.inbandTextTrack_ = mediaSource.player_.addTextTrack('captions', 'cc1');
}
if (segment.metadata && segment.metadata.length && !sourceBuffer.metadataTrack_) {
sourceBuffer.metadataTrack_ = mediaSource.player_.addTextTrack('metadata', 'Timed Metadata');
sourceBuffer.metadataTrack_.inBandMetadataTrackDispatchType = segment.metadata.dispatchType;
}
};
exports['default'] = createTextTracksIfNecessary;
module.exports = exports['default'];
},{}],29:[function(require,module,exports){
/**
* @file flash-constants.js
*/
/**
* The maximum size in bytes for append operations to the video.js
* SWF. Calling through to Flash blocks and can be expensive so
* tuning this parameter may improve playback on slower
* systems. There are two factors to consider:
* - Each interaction with the SWF must be quick or you risk dropping
* video frames. To maintain 60fps for the rest of the page, each append
* must not take longer than 16ms. Given the likelihood that the page
* will be executing more javascript than just playback, you probably
* want to aim for less than 8ms. We aim for just 4ms.
* - Bigger appends significantly increase throughput. The total number of
* bytes over time delivered to the SWF must exceed the video bitrate or
* playback will stall.
*
* We adaptively tune the size of appends to give the best throughput
* possible given the performance of the system. To do that we try to append
* as much as possible in TIME_PER_TICK and while tuning the size of appends
* dynamically so that we only append about 4-times in that 4ms span.
*
* The reason we try to keep the number of appends around four is due to
* externalities such as Flash load and garbage collection that are highly
* variable and having 4 iterations allows us to exit the loop early if
* an iteration takes longer than expected.
*
* @private
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var flashConstants = {
TIME_BETWEEN_TICKS: Math.floor(1000 / 480),
TIME_PER_TICK: Math.floor(1000 / 240),
// 1kb
BYTES_PER_CHUNK: 1 * 1024,
MIN_CHUNK: 1024,
MAX_CHUNK: 1024 * 1024
};
exports["default"] = flashConstants;
module.exports = exports["default"];
},{}],30:[function(require,module,exports){
(function (global){
/**
* @file flash-media-source.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var _flashSourceBuffer = require('./flash-source-buffer');
var _flashSourceBuffer2 = _interopRequireDefault(_flashSourceBuffer);
var _flashConstants = require('./flash-constants');
var _flashConstants2 = _interopRequireDefault(_flashConstants);
var _codecUtils = require('./codec-utils');
/**
* A flash implmentation of HTML MediaSources and a polyfill
* for browsers that don't support native or HTML MediaSources..
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource
* @class FlashMediaSource
* @extends videojs.EventTarget
*/
var FlashMediaSource = (function (_videojs$EventTarget) {
_inherits(FlashMediaSource, _videojs$EventTarget);
function FlashMediaSource() {
var _this = this;
_classCallCheck(this, FlashMediaSource);
_get(Object.getPrototypeOf(FlashMediaSource.prototype), 'constructor', this).call(this);
this.sourceBuffers = [];
this.readyState = 'closed';
this.on(['sourceopen', 'webkitsourceopen'], function (event) {
// find the swf where we will push media data
_this.swfObj = document.getElementById(event.swfId);
_this.player_ = (0, _videoJs2['default'])(_this.swfObj.parentNode);
_this.tech_ = _this.swfObj.tech;
_this.readyState = 'open';
_this.tech_.on('seeking', function () {
var i = _this.sourceBuffers.length;
while (i--) {
_this.sourceBuffers[i].abort();
}
});
// trigger load events
if (_this.swfObj) {
_this.swfObj.vjs_load();
}
});
}
/**
* Set or return the presentation duration.
*
* @param {Double} value the duration of the media in seconds
* @param {Double} the current presentation duration
* @link http://www.w3.org/TR/media-source/#widl-MediaSource-duration
*/
/**
* We have this function so that the html and flash interfaces
* are the same.
*
* @private
*/
_createClass(FlashMediaSource, [{
key: 'addSeekableRange_',
value: function addSeekableRange_() {}
// intentional no-op
/**
* Create a new flash source buffer and add it to our flash media source.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer
* @param {String} type the content-type of the source
* @return {Object} the flash source buffer
*/
}, {
key: 'addSourceBuffer',
value: function addSourceBuffer(type) {
var parsedType = (0, _codecUtils.parseContentType)(type);
var sourceBuffer = undefined;
// if this is an FLV type, we'll push data to flash
if (parsedType.type === 'video/mp2t') {
// Flash source buffers
sourceBuffer = new _flashSourceBuffer2['default'](this);
} else {
throw new Error('NotSupportedError (Video.js)');
}
this.sourceBuffers.push(sourceBuffer);
return sourceBuffer;
}
/**
* Signals the end of the stream.
*
* @link https://w3c.github.io/media-source/#widl-MediaSource-endOfStream-void-EndOfStreamError-error
* @param {String=} error Signals that a playback error
* has occurred. If specified, it must be either "network" or
* "decode".
*/
}, {
key: 'endOfStream',
value: function endOfStream(error) {
if (error === 'network') {
// MEDIA_ERR_NETWORK
this.tech_.error(2);
} else if (error === 'decode') {
// MEDIA_ERR_DECODE
this.tech_.error(3);
}
if (this.readyState !== 'ended') {
this.readyState = 'ended';
this.swfObj.vjs_endOfStream();
}
}
}]);
return FlashMediaSource;
})(_videoJs2['default'].EventTarget);
exports['default'] = FlashMediaSource;
try {
Object.defineProperty(FlashMediaSource.prototype, 'duration', {
/**
* Return the presentation duration.
*
* @return {Double} the duration of the media in seconds
* @link http://www.w3.org/TR/media-source/#widl-MediaSource-duration
*/
get: function get() {
if (!this.swfObj) {
return NaN;
}
// get the current duration from the SWF
return this.swfObj.vjs_getProperty('duration');
},
/**
* Set the presentation duration.
*
* @param {Double} value the duration of the media in seconds
* @return {Double} the duration of the media in seconds
* @link http://www.w3.org/TR/media-source/#widl-MediaSource-duration
*/
set: function set(value) {
var i = undefined;
var oldDuration = this.swfObj.vjs_getProperty('duration');
this.swfObj.vjs_setProperty('duration', value);
if (value < oldDuration) {
// In MSE, this triggers the range removal algorithm which causes
// an update to occur
for (i = 0; i < this.sourceBuffers.length; i++) {
this.sourceBuffers[i].remove(value, oldDuration);
}
}
return value;
}
});
} catch (e) {
// IE8 throws if defineProperty is called on a non-DOM node. We
// don't support IE8 but we shouldn't throw an error if loaded
// there.
FlashMediaSource.prototype.duration = NaN;
}
for (var property in _flashConstants2['default']) {
FlashMediaSource[property] = _flashConstants2['default'][property];
}
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./codec-utils":27,"./flash-constants":29,"./flash-source-buffer":31}],31:[function(require,module,exports){
(function (global){
/**
* @file flash-source-buffer.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var _muxJsLibFlv = require('mux.js/lib/flv');
var _muxJsLibFlv2 = _interopRequireDefault(_muxJsLibFlv);
var _removeCuesFromTrack = require('./remove-cues-from-track');
var _removeCuesFromTrack2 = _interopRequireDefault(_removeCuesFromTrack);
var _createTextTracksIfNecessary = require('./create-text-tracks-if-necessary');
var _createTextTracksIfNecessary2 = _interopRequireDefault(_createTextTracksIfNecessary);
var _addTextTrackData = require('./add-text-track-data');
var _addTextTrackData2 = _interopRequireDefault(_addTextTrackData);
var _flashConstants = require('./flash-constants');
var _flashConstants2 = _interopRequireDefault(_flashConstants);
/**
* A wrapper around the setTimeout function that uses
* the flash constant time between ticks value.
*
* @param {Function} func the function callback to run
* @private
*/
var scheduleTick = function scheduleTick(func) {
// Chrome doesn't invoke requestAnimationFrame callbacks
// in background tabs, so use setTimeout.
window.setTimeout(func, _flashConstants2['default'].TIME_BETWEEN_TICKS);
};
/**
* Round a number to a specified number of places much like
* toFixed but return a number instead of a string representation.
*
* @param {Number} num A number
* @param {Number} places The number of decimal places which to
* round
* @private
*/
var toDecimalPlaces = function toDecimalPlaces(num, places) {
if (typeof places !== 'number' || places < 0) {
places = 0;
}
var scale = Math.pow(10, places);
return Math.round(num * scale) / scale;
};
/**
* A SourceBuffer implementation for Flash rather than HTML.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource
* @param {Object} mediaSource the flash media source
* @class FlashSourceBuffer
* @extends videojs.EventTarget
*/
var FlashSourceBuffer = (function (_videojs$EventTarget) {
_inherits(FlashSourceBuffer, _videojs$EventTarget);
function FlashSourceBuffer(mediaSource) {
var _this = this;
_classCallCheck(this, FlashSourceBuffer);
_get(Object.getPrototypeOf(FlashSourceBuffer.prototype), 'constructor', this).call(this);
var encodedHeader = undefined;
// Start off using the globally defined value but refine
// as we append data into flash
this.chunkSize_ = _flashConstants2['default'].BYTES_PER_CHUNK;
// byte arrays queued to be appended
this.buffer_ = [];
// the total number of queued bytes
this.bufferSize_ = 0;
// to be able to determine the correct position to seek to, we
// need to retain information about the mapping between the
// media timeline and PTS values
this.basePtsOffset_ = NaN;
this.mediaSource = mediaSource;
// indicates whether the asynchronous continuation of an operation
// is still being processed
// see https://w3c.github.io/media-source/#widl-SourceBuffer-updating
this.updating = false;
this.timestampOffset_ = 0;
// TS to FLV transmuxer
this.segmentParser_ = new _muxJsLibFlv2['default'].Transmuxer();
this.segmentParser_.on('data', this.receiveBuffer_.bind(this));
encodedHeader = window.btoa(String.fromCharCode.apply(null, Array.prototype.slice.call(this.segmentParser_.getFlvHeader())));
this.mediaSource.swfObj.vjs_appendBuffer(encodedHeader);
Object.defineProperty(this, 'timestampOffset', {
get: function get() {
return this.timestampOffset_;
},
set: function set(val) {
if (typeof val === 'number' && val >= 0) {
this.timestampOffset_ = val;
this.segmentParser_ = new _muxJsLibFlv2['default'].Transmuxer();
this.segmentParser_.on('data', this.receiveBuffer_.bind(this));
// We have to tell flash to expect a discontinuity
this.mediaSource.swfObj.vjs_discontinuity();
// the media <-> PTS mapping must be re-established after
// the discontinuity
this.basePtsOffset_ = NaN;
}
}
});
Object.defineProperty(this, 'buffered', {
get: function get() {
if (!this.mediaSource || !this.mediaSource.swfObj || !('vjs_getProperty' in this.mediaSource.swfObj)) {
return _videoJs2['default'].createTimeRange();
}
var buffered = this.mediaSource.swfObj.vjs_getProperty('buffered');
if (buffered && buffered.length) {
buffered[0][0] = toDecimalPlaces(buffered[0][0], 3);
buffered[0][1] = toDecimalPlaces(buffered[0][1], 3);
}
return _videoJs2['default'].createTimeRanges(buffered);
}
});
// On a seek we remove all text track data since flash has no concept
// of a buffered-range and everything else is reset on seek
this.mediaSource.player_.on('seeked', function () {
(0, _removeCuesFromTrack2['default'])(0, Infinity, _this.metadataTrack_);
(0, _removeCuesFromTrack2['default'])(0, Infinity, _this.inbandTextTrack_);
});
}
/**
* Append bytes to the sourcebuffers buffer, in this case we
* have to append it to swf object.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer
* @param {Array} bytes
*/
_createClass(FlashSourceBuffer, [{
key: 'appendBuffer',
value: function appendBuffer(bytes) {
var _this2 = this;
var error = undefined;
var chunk = 512 * 1024;
var i = 0;
if (this.updating) {
error = new Error('SourceBuffer.append() cannot be called ' + 'while an update is in progress');
error.name = 'InvalidStateError';
error.code = 11;
throw error;
}
this.updating = true;
this.mediaSource.readyState = 'open';
this.trigger({ type: 'update' });
// this is here to use recursion
var chunkInData = function chunkInData() {
_this2.segmentParser_.push(bytes.subarray(i, i + chunk));
i += chunk;
if (i < bytes.byteLength) {
scheduleTick(chunkInData);
} else {
scheduleTick(_this2.segmentParser_.flush.bind(_this2.segmentParser_));
}
};
chunkInData();
}
/**
* Reset the parser and remove any data queued to be sent to the SWF.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/abort
*/
}, {
key: 'abort',
value: function abort() {
this.buffer_ = [];
this.bufferSize_ = 0;
this.mediaSource.swfObj.vjs_abort();
// report any outstanding updates have ended
if (this.updating) {
this.updating = false;
this.trigger({ type: 'updateend' });
}
}
/**
* Flash cannot remove ranges already buffered in the NetStream
* but seeking clears the buffer entirely. For most purposes,
* having this operation act as a no-op is acceptable.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/remove
* @param {Double} start start of the section to remove
* @param {Double} end end of the section to remove
*/
}, {
key: 'remove',
value: function remove(start, end) {
(0, _removeCuesFromTrack2['default'])(start, end, this.metadataTrack_);
(0, _removeCuesFromTrack2['default'])(start, end, this.inbandTextTrack_);
this.trigger({ type: 'update' });
this.trigger({ type: 'updateend' });
}
/**
* Receive a buffer from the flv.
*
* @param {Object} segment
* @private
*/
}, {
key: 'receiveBuffer_',
value: function receiveBuffer_(segment) {
var _this3 = this;
// create an in-band caption track if one is present in the segment
(0, _createTextTracksIfNecessary2['default'])(this, this.mediaSource, segment);
(0, _addTextTrackData2['default'])(this, segment.captions, segment.metadata);
// Do this asynchronously since convertTagsToData_ can be time consuming
scheduleTick(function () {
var flvBytes = _this3.convertTagsToData_(segment);
if (_this3.buffer_.length === 0) {
scheduleTick(_this3.processBuffer_.bind(_this3));
}
if (flvBytes) {
_this3.buffer_.push(flvBytes);
_this3.bufferSize_ += flvBytes.byteLength;
}
});
}
/**
* Append a portion of the current buffer to the SWF.
*
* @private
*/
}, {
key: 'processBuffer_',
value: function processBuffer_() {
var chunk = undefined;
var i = undefined;
var length = undefined;
var binary = undefined;
var b64str = undefined;
var startByte = 0;
var appendIterations = 0;
var startTime = +new Date();
var appendTime = undefined;
if (!this.buffer_.length) {
if (this.updating !== false) {
this.updating = false;
this.trigger({ type: 'updateend' });
}
// do nothing if the buffer is empty
return;
}
do {
appendIterations++;
// concatenate appends up to the max append size
chunk = this.buffer_[0].subarray(startByte, startByte + this.chunkSize_);
// requeue any bytes that won't make it this round
if (chunk.byteLength < this.chunkSize_ || this.buffer_[0].byteLength === startByte + this.chunkSize_) {
startByte = 0;
this.buffer_.shift();
} else {
startByte += this.chunkSize_;
}
this.bufferSize_ -= chunk.byteLength;
// base64 encode the bytes
binary = '';
length = chunk.byteLength;
for (i = 0; i < length; i++) {
binary += String.fromCharCode(chunk[i]);
}
b64str = window.btoa(binary);
// bypass normal ExternalInterface calls and pass xml directly
// IE can be slow by default
this.mediaSource.swfObj.CallFunction('<invoke name="vjs_appendBuffer"' + 'returntype="javascript"><arguments><string>' + b64str + '</string></arguments></invoke>');
appendTime = new Date() - startTime;
} while (this.buffer_.length && appendTime < _flashConstants2['default'].TIME_PER_TICK);
if (this.buffer_.length && startByte) {
this.buffer_[0] = this.buffer_[0].subarray(startByte);
}
if (appendTime >= _flashConstants2['default'].TIME_PER_TICK) {
// We want to target 4 iterations per time-slot so that gives us
// room to adjust to changes in Flash load and other externalities
// such as garbage collection while still maximizing throughput
this.chunkSize_ = Math.floor(this.chunkSize_ * (appendIterations / 4));
}
// We also make sure that the chunk-size doesn't drop below 1KB or
// go above 1MB as a sanity check
this.chunkSize_ = Math.max(_flashConstants2['default'].MIN_CHUNK, Math.min(this.chunkSize_, _flashConstants2['default'].MAX_CHUNK));
// schedule another append if necessary
if (this.bufferSize_ !== 0) {
scheduleTick(this.processBuffer_.bind(this));
} else {
this.updating = false;
this.trigger({ type: 'updateend' });
}
}
/**
* Turns an array of flv tags into a Uint8Array representing the
* flv data. Also removes any tags that are before the current
* time so that playback begins at or slightly after the right
* place on a seek
*
* @private
* @param {Object} segmentData object of segment data
*/
}, {
key: 'convertTagsToData_',
value: function convertTagsToData_(segmentData) {
var segmentByteLength = 0;
var tech = this.mediaSource.tech_;
var targetPts = 0;
var i = undefined;
var j = undefined;
var segment = undefined;
var filteredTags = [];
var tags = this.getOrderedTags_(segmentData);
// Establish the media timeline to PTS translation if we don't
// have one already
if (isNaN(this.basePtsOffset_) && tags.length) {
this.basePtsOffset_ = tags[0].pts;
}
// Trim any tags that are before the end of the end of
// the current buffer
if (tech.buffered().length) {
targetPts = tech.buffered().end(0) - this.timestampOffset;
}
// Trim to currentTime if it's ahead of buffered or buffered doesn't exist
targetPts = Math.max(targetPts, tech.currentTime() - this.timestampOffset);
// PTS values are represented in milliseconds
targetPts *= 1e3;
targetPts += this.basePtsOffset_;
// skip tags with a presentation time less than the seek target
for (i = 0; i < tags.length; i++) {
if (tags[i].pts >= targetPts) {
filteredTags.push(tags[i]);
}
}
if (filteredTags.length === 0) {
return;
}
// concatenate the bytes into a single segment
for (i = 0; i < filteredTags.length; i++) {
segmentByteLength += filteredTags[i].bytes.byteLength;
}
segment = new Uint8Array(segmentByteLength);
for (i = 0, j = 0; i < filteredTags.length; i++) {
segment.set(filteredTags[i].bytes, j);
j += filteredTags[i].bytes.byteLength;
}
return segment;
}
/**
* Assemble the FLV tags in decoder order.
*
* @private
* @param {Object} segmentData object of segment data
*/
}, {
key: 'getOrderedTags_',
value: function getOrderedTags_(segmentData) {
var videoTags = segmentData.tags.videoTags;
var audioTags = segmentData.tags.audioTags;
var tag = undefined;
var tags = [];
while (videoTags.length || audioTags.length) {
if (!videoTags.length) {
// only audio tags remain
tag = audioTags.shift();
} else if (!audioTags.length) {
// only video tags remain
tag = videoTags.shift();
} else if (audioTags[0].dts < videoTags[0].dts) {
// audio should be decoded next
tag = audioTags.shift();
} else {
// video should be decoded next
tag = videoTags.shift();
}
tags.push(tag.finalize());
}
return tags;
}
}]);
return FlashSourceBuffer;
})(_videoJs2['default'].EventTarget);
exports['default'] = FlashSourceBuffer;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./add-text-track-data":26,"./create-text-tracks-if-necessary":28,"./flash-constants":29,"./remove-cues-from-track":33,"mux.js/lib/flv":41}],32:[function(require,module,exports){
(function (global){
/**
* @file html-media-source.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var _virtualSourceBuffer = require('./virtual-source-buffer');
var _virtualSourceBuffer2 = _interopRequireDefault(_virtualSourceBuffer);
var _codecUtils = require('./codec-utils');
/**
* Replace the old apple-style `avc1.<dd>.<dd>` codec string with the standard
* `avc1.<hhhhhh>`
*
* @param {Array} codecs an array of codec strings to fix
* @return {Array} the translated codec array
* @private
*/
var translateLegacyCodecs = function translateLegacyCodecs(codecs) {
return codecs.map(function (codec) {
return codec.replace(/avc1\.(\d+)\.(\d+)/i, function (orig, profile, avcLevel) {
var profileHex = ('00' + Number(profile).toString(16)).slice(-2);
var avcLevelHex = ('00' + Number(avcLevel).toString(16)).slice(-2);
return 'avc1.' + profileHex + '00' + avcLevelHex;
});
});
};
/**
* Our MediaSource implementation in HTML, mimics native
* MediaSource where/if possible.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource
* @class HtmlMediaSource
* @extends videojs.EventTarget
*/
var HtmlMediaSource = (function (_videojs$EventTarget) {
_inherits(HtmlMediaSource, _videojs$EventTarget);
function HtmlMediaSource() {
var _this = this;
_classCallCheck(this, HtmlMediaSource);
_get(Object.getPrototypeOf(HtmlMediaSource.prototype), 'constructor', this).call(this);
var property = undefined;
this.nativeMediaSource_ = new window.MediaSource();
// delegate to the native MediaSource's methods by default
for (property in this.nativeMediaSource_) {
if (!(property in HtmlMediaSource.prototype) && typeof this.nativeMediaSource_[property] === 'function') {
this[property] = this.nativeMediaSource_[property].bind(this.nativeMediaSource_);
}
}
// emulate `duration` and `seekable` until seeking can be
// handled uniformly for live streams
// see https://github.com/w3c/media-source/issues/5
this.duration_ = NaN;
Object.defineProperty(this, 'duration', {
get: function get() {
if (this.duration_ === Infinity) {
return this.duration_;
}
return this.nativeMediaSource_.duration;
},
set: function set(duration) {
this.duration_ = duration;
if (duration !== Infinity) {
this.nativeMediaSource_.duration = duration;
return;
}
}
});
Object.defineProperty(this, 'seekable', {
get: function get() {
if (this.duration_ === Infinity) {
return _videoJs2['default'].createTimeRanges([[0, this.nativeMediaSource_.duration]]);
}
return this.nativeMediaSource_.seekable;
}
});
Object.defineProperty(this, 'readyState', {
get: function get() {
return this.nativeMediaSource_.readyState;
}
});
Object.defineProperty(this, 'activeSourceBuffers', {
get: function get() {
return this.activeSourceBuffers_;
}
});
// the list of virtual and native SourceBuffers created by this
// MediaSource
this.sourceBuffers = [];
this.activeSourceBuffers_ = [];
/**
* update the list of active source buffers based upon various
* imformation from HLS and video.js
*
* @private
*/
this.updateActiveSourceBuffers_ = function () {
// Retain the reference but empty the array
_this.activeSourceBuffers_.length = 0;
// By default, the audio in the combined virtual source buffer is enabled
// and the audio-only source buffer (if it exists) is disabled.
var combined = false;
var audioOnly = true;
// TODO: maybe we can store the sourcebuffers on the track objects?
// safari may do something like this
for (var i = 0; i < _this.player_.audioTracks().length; i++) {
var track = _this.player_.audioTracks()[i];
if (track.enabled && track.kind !== 'main') {
// The enabled track is an alternate audio track so disable the audio in
// the combined source buffer and enable the audio-only source buffer.
combined = true;
audioOnly = false;
break;
}
}
// Since we currently support a max of two source buffers, add all of the source
// buffers (in order).
_this.sourceBuffers.forEach(function (sourceBuffer) {
/* eslinst-disable */
// TODO once codecs are required, we can switch to using the codecs to determine
// what stream is the video stream, rather than relying on videoTracks
/* eslinst-enable */
if (sourceBuffer.videoCodec_ && sourceBuffer.audioCodec_) {
// combined
sourceBuffer.audioDisabled_ = combined;
} else if (sourceBuffer.videoCodec_ && !sourceBuffer.audioCodec_) {
// If the "combined" source buffer is video only, then we do not want
// disable the audio-only source buffer (this is mostly for demuxed
// audio and video hls)
sourceBuffer.audioDisabled_ = true;
audioOnly = false;
} else if (!sourceBuffer.videoCodec_ && sourceBuffer.audioCodec_) {
// audio only
sourceBuffer.audioDisabled_ = audioOnly;
if (audioOnly) {
return;
}
}
_this.activeSourceBuffers_.push(sourceBuffer);
});
};
// Re-emit MediaSource events on the polyfill
['sourceopen', 'sourceclose', 'sourceended'].forEach(function (eventName) {
this.nativeMediaSource_.addEventListener(eventName, this.trigger.bind(this));
}, this);
// capture the associated player when the MediaSource is
// successfully attached
this.on('sourceopen', function (event) {
// Get the player this MediaSource is attached to
var video = document.querySelector('[src="' + _this.url_ + '"]');
if (!video) {
return;
}
_this.player_ = (0, _videoJs2['default'])(video.parentNode);
if (_this.player_.audioTracks && _this.player_.audioTracks()) {
_this.player_.audioTracks().on('change', _this.updateActiveSourceBuffers_);
_this.player_.audioTracks().on('addtrack', _this.updateActiveSourceBuffers_);
_this.player_.audioTracks().on('removetrack', _this.updateActiveSourceBuffers_);
}
});
// explicitly terminate any WebWorkers that were created
// by SourceHandlers
this.on('sourceclose', function (event) {
this.sourceBuffers.forEach(function (sourceBuffer) {
if (sourceBuffer.transmuxer_) {
sourceBuffer.transmuxer_.terminate();
}
});
this.sourceBuffers.length = 0;
if (!this.player_) {
return;
}
if (this.player_.audioTracks && this.player_.audioTracks()) {
this.player_.audioTracks().off('change', this.updateActiveSourceBuffers_);
this.player_.audioTracks().off('addtrack', this.updateActiveSourceBuffers_);
this.player_.audioTracks().off('removetrack', this.updateActiveSourceBuffers_);
}
});
}
/**
* Add a range that that can now be seeked to.
*
* @param {Double} start where to start the addition
* @param {Double} end where to end the addition
* @private
*/
_createClass(HtmlMediaSource, [{
key: 'addSeekableRange_',
value: function addSeekableRange_(start, end) {
var error = undefined;
if (this.duration !== Infinity) {
error = new Error('MediaSource.addSeekableRange() can only be invoked ' + 'when the duration is Infinity');
error.name = 'InvalidStateError';
error.code = 11;
throw error;
}
if (end > this.nativeMediaSource_.duration || isNaN(this.nativeMediaSource_.duration)) {
this.nativeMediaSource_.duration = end;
}
}
/**
* Add a source buffer to the media source.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer
* @param {String} type the content-type of the content
* @return {Object} the created source buffer
*/
}, {
key: 'addSourceBuffer',
value: function addSourceBuffer(type) {
var buffer = undefined;
var parsedType = (0, _codecUtils.parseContentType)(type);
// Create a VirtualSourceBuffer to transmux MPEG-2 transport
// stream segments into fragmented MP4s
if (parsedType.type === 'video/mp2t') {
var codecs = [];
if (parsedType.parameters && parsedType.parameters.codecs) {
codecs = parsedType.parameters.codecs.split(',');
codecs = translateLegacyCodecs(codecs);
codecs = codecs.filter(function (codec) {
return (0, _codecUtils.isAudioCodec)(codec) || (0, _codecUtils.isVideoCodec)(codec);
});
}
if (codecs.length === 0) {
codecs = ['avc1.4d400d', 'mp4a.40.2'];
}
buffer = new _virtualSourceBuffer2['default'](this, codecs);
if (this.sourceBuffers.length !== 0) {
// If another VirtualSourceBuffer already exists, then we are creating a
// SourceBuffer for an alternate audio track and therefore we know that
// the source has both an audio and video track.
// That means we should trigger the manual creation of the real
// SourceBuffers instead of waiting for the transmuxer to return data
this.sourceBuffers[0].createRealSourceBuffers_();
buffer.createRealSourceBuffers_();
// Automatically disable the audio on the first source buffer if
// a second source buffer is ever created
this.sourceBuffers[0].audioDisabled_ = true;
}
} else {
// delegate to the native implementation
buffer = this.nativeMediaSource_.addSourceBuffer(type);
}
this.sourceBuffers.push(buffer);
return buffer;
}
}]);
return HtmlMediaSource;
})(_videoJs2['default'].EventTarget);
exports['default'] = HtmlMediaSource;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./codec-utils":27,"./virtual-source-buffer":36}],33:[function(require,module,exports){
/**
* @file remove-cues-from-track.js
*/
/**
* Remove cues from a track on video.js.
*
* @param {Double} start start of where we should remove the cue
* @param {Double} end end of where the we should remove the cue
* @param {Object} track the text track to remove the cues from
* @private
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var removeCuesFromTrack = function removeCuesFromTrack(start, end, track) {
var i = undefined;
var cue = undefined;
if (!track) {
return;
}
i = track.cues.length;
while (i--) {
cue = track.cues[i];
// Remove any overlapping cue
if (cue.startTime <= end && cue.endTime >= start) {
track.removeCue(cue);
}
}
};
exports["default"] = removeCuesFromTrack;
module.exports = exports["default"];
},{}],34:[function(require,module,exports){
/**
* @file transmuxer-worker.js
*/
/**
* videojs-contrib-media-sources
*
* Copyright (c) 2015 Brightcove
* All rights reserved.
*
* Handles communication between the browser-world and the mux.js
* transmuxer running inside of a WebWorker by exposing a simple
* message-based interface to a Transmuxer object.
*/
'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; }; })();
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 _muxJsLibMp4 = require('mux.js/lib/mp4');
var _muxJsLibMp42 = _interopRequireDefault(_muxJsLibMp4);
/**
* Re-emits tranmsuxer events by converting them into messages to the
* world outside the worker.
*
* @param {Object} transmuxer the transmuxer to wire events on
* @private
*/
var wireTransmuxerEvents = function wireTransmuxerEvents(transmuxer) {
transmuxer.on('data', function (segment) {
// transfer ownership of the underlying ArrayBuffer
// instead of doing a copy to save memory
// ArrayBuffers are transferable but generic TypedArrays are not
// @link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Passing_data_by_transferring_ownership_(transferable_objects)
var typedArray = segment.data;
segment.data = typedArray.buffer;
postMessage({
action: 'data',
segment: segment,
byteOffset: typedArray.byteOffset,
byteLength: typedArray.byteLength
}, [segment.data]);
});
if (transmuxer.captionStream) {
transmuxer.captionStream.on('data', function (caption) {
postMessage({
action: 'caption',
data: caption
});
});
}
transmuxer.on('done', function (data) {
postMessage({ action: 'done' });
});
};
/**
* All incoming messages route through this hash. If no function exists
* to handle an incoming message, then we ignore the message.
*
* @class MessageHandlers
* @param {Object} options the options to initialize with
*/
var MessageHandlers = (function () {
function MessageHandlers(options) {
_classCallCheck(this, MessageHandlers);
this.options = options || {};
this.init();
}
/**
* Our web wroker interface so that things can talk to mux.js
* that will be running in a web worker. the scope is passed to this by
* webworkify.
*
* @param {Object} self the scope for the web worker
*/
/**
* initialize our web worker and wire all the events.
*/
_createClass(MessageHandlers, [{
key: 'init',
value: function init() {
if (this.transmuxer) {
this.transmuxer.dispose();
}
this.transmuxer = new _muxJsLibMp42['default'].Transmuxer(this.options);
wireTransmuxerEvents(this.transmuxer);
}
/**
* Adds data (a ts segment) to the start of the transmuxer pipeline for
* processing.
*
* @param {ArrayBuffer} data data to push into the muxer
*/
}, {
key: 'push',
value: function push(data) {
// Cast array buffer to correct type for transmuxer
var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
this.transmuxer.push(segment);
}
/**
* Recreate the transmuxer so that the next segment added via `push`
* start with a fresh transmuxer.
*/
}, {
key: 'reset',
value: function reset() {
this.init();
}
/**
* Set the value that will be used as the `baseMediaDecodeTime` time for the
* next segment pushed in. Subsequent segments will have their `baseMediaDecodeTime`
* set relative to the first based on the PTS values.
*
* @param {Object} data used to set the timestamp offset in the muxer
*/
}, {
key: 'setTimestampOffset',
value: function setTimestampOffset(data) {
var timestampOffset = data.timestampOffset || 0;
this.transmuxer.setBaseMediaDecodeTime(Math.round(timestampOffset * 90000));
}
/**
* Forces the pipeline to finish processing the last segment and emit it's
* results.
*
* @param {Object} data event data, not really used
*/
}, {
key: 'flush',
value: function flush(data) {
this.transmuxer.flush();
}
}]);
return MessageHandlers;
})();
var Worker = function Worker(self) {
self.onmessage = function (event) {
if (event.data.action === 'init' && event.data.options) {
this.messageHandlers = new MessageHandlers(event.data.options);
return;
}
if (!this.messageHandlers) {
this.messageHandlers = new MessageHandlers();
}
if (event.data && event.data.action && event.data.action !== 'init') {
if (this.messageHandlers[event.data.action]) {
this.messageHandlers[event.data.action](event.data);
}
}
};
};
exports['default'] = function (self) {
return new Worker(self);
};
module.exports = exports['default'];
},{"mux.js/lib/mp4":47}],35:[function(require,module,exports){
(function (global){
/**
* @file videojs-contrib-media-sources.js
*/
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _flashMediaSource = require('./flash-media-source');
var _flashMediaSource2 = _interopRequireDefault(_flashMediaSource);
var _htmlMediaSource = require('./html-media-source');
var _htmlMediaSource2 = _interopRequireDefault(_htmlMediaSource);
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var urlCount = 0;
// ------------
// Media Source
// ------------
var defaults = {
// how to determine the MediaSource implementation to use. There
// are three available modes:
// - auto: use native MediaSources where available and Flash
// everywhere else
// - html5: always use native MediaSources
// - flash: always use the Flash MediaSource polyfill
mode: 'auto'
};
// store references to the media sources so they can be connected
// to a video element (a swf object)
// TODO: can we store this somewhere local to this module?
_videoJs2['default'].mediaSources = {};
/**
* Provide a method for a swf object to notify JS that a
* media source is now open.
*
* @param {String} msObjectURL string referencing the MSE Object URL
* @param {String} swfId the swf id
*/
var open = function open(msObjectURL, swfId) {
var mediaSource = _videoJs2['default'].mediaSources[msObjectURL];
if (mediaSource) {
mediaSource.trigger({ type: 'sourceopen', swfId: swfId });
} else {
throw new Error('Media Source not found (Video.js)');
}
};
/**
* Check to see if the native MediaSource object exists and supports
* an MP4 container with both H.264 video and AAC-LC audio.
*
* @return {Boolean} if native media sources are supported
*/
var supportsNativeMediaSources = function supportsNativeMediaSources() {
return !!window.MediaSource && !!window.MediaSource.isTypeSupported && window.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"');
};
/**
* An emulation of the MediaSource API so that we can support
* native and non-native functionality such as flash and
* video/mp2t videos. returns an instance of HtmlMediaSource or
* FlashMediaSource depending on what is supported and what options
* are passed in.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/MediaSource
* @param {Object} options options to use during setup.
*/
var MediaSource = function MediaSource(options) {
var settings = _videoJs2['default'].mergeOptions(defaults, options);
this.MediaSource = {
open: open,
supportsNativeMediaSources: supportsNativeMediaSources
};
// determine whether HTML MediaSources should be used
if (settings.mode === 'html5' || settings.mode === 'auto' && supportsNativeMediaSources()) {
return new _htmlMediaSource2['default']();
}
// otherwise, emulate them through the SWF
return new _flashMediaSource2['default']();
};
exports.MediaSource = MediaSource;
MediaSource.open = open;
MediaSource.supportsNativeMediaSources = supportsNativeMediaSources;
/**
* A wrapper around the native URL for our MSE object
* implementation, this object is exposed under videojs.URL
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/URL/URL
*/
var URL = {
/**
* A wrapper around the native createObjectURL for our objects.
* This function maps a native or emulated mediaSource to a blob
* url so that it can be loaded into video.js
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
* @param {MediaSource} object the object to create a blob url to
*/
createObjectURL: function createObjectURL(object) {
var objectUrlPrefix = 'blob:vjs-media-source/';
var url = undefined;
// use the native MediaSource to generate an object URL
if (object instanceof _htmlMediaSource2['default']) {
url = window.URL.createObjectURL(object.nativeMediaSource_);
object.url_ = url;
return url;
}
// if the object isn't an emulated MediaSource, delegate to the
// native implementation
if (!(object instanceof _flashMediaSource2['default'])) {
url = window.URL.createObjectURL(object);
object.url_ = url;
return url;
}
// build a URL that can be used to map back to the emulated
// MediaSource
url = objectUrlPrefix + urlCount;
urlCount++;
// setup the mapping back to object
_videoJs2['default'].mediaSources[url] = object;
return url;
}
};
exports.URL = URL;
_videoJs2['default'].MediaSource = MediaSource;
_videoJs2['default'].URL = URL;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./flash-media-source":30,"./html-media-source":32}],36:[function(require,module,exports){
(function (global){
/**
* @file virtual-source-buffer.js
*/
'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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var _createTextTracksIfNecessary = require('./create-text-tracks-if-necessary');
var _createTextTracksIfNecessary2 = _interopRequireDefault(_createTextTracksIfNecessary);
var _removeCuesFromTrack = require('./remove-cues-from-track');
var _removeCuesFromTrack2 = _interopRequireDefault(_removeCuesFromTrack);
var _addTextTrackData = require('./add-text-track-data');
var _addTextTrackData2 = _interopRequireDefault(_addTextTrackData);
var _webworkify = require('webworkify');
var _webworkify2 = _interopRequireDefault(_webworkify);
var _transmuxerWorker = require('./transmuxer-worker');
var _transmuxerWorker2 = _interopRequireDefault(_transmuxerWorker);
var _codecUtils = require('./codec-utils');
/**
* VirtualSourceBuffers exist so that we can transmux non native formats
* into a native format, but keep the same api as a native source buffer.
* It creates a transmuxer, that works in its own thread (a web worker) and
* that transmuxer muxes the data into a native format. VirtualSourceBuffer will
* then send all of that data to the naive sourcebuffer so that it is
* indestinguishable from a natively supported format.
*
* @param {HtmlMediaSource} mediaSource the parent mediaSource
* @param {Array} codecs array of codecs that we will be dealing with
* @class VirtualSourceBuffer
* @extends video.js.EventTarget
*/
var VirtualSourceBuffer = (function (_videojs$EventTarget) {
_inherits(VirtualSourceBuffer, _videojs$EventTarget);
function VirtualSourceBuffer(mediaSource, codecs) {
var _this = this;
_classCallCheck(this, VirtualSourceBuffer);
_get(Object.getPrototypeOf(VirtualSourceBuffer.prototype), 'constructor', this).call(this, _videoJs2['default'].EventTarget);
this.timestampOffset_ = 0;
this.pendingBuffers_ = [];
this.bufferUpdating_ = false;
this.mediaSource_ = mediaSource;
this.codecs_ = codecs;
this.audioCodec_ = null;
this.videoCodec_ = null;
this.audioDisabled_ = false;
var options = {
remux: false
};
this.codecs_.forEach(function (codec) {
if ((0, _codecUtils.isAudioCodec)(codec)) {
_this.audioCodec_ = codec;
} else if ((0, _codecUtils.isVideoCodec)(codec)) {
_this.videoCodec_ = codec;
}
});
// append muxed segments to their respective native buffers as
// soon as they are available
this.transmuxer_ = (0, _webworkify2['default'])(_transmuxerWorker2['default']);
this.transmuxer_.postMessage({ action: 'init', options: options });
this.transmuxer_.onmessage = function (event) {
if (event.data.action === 'data') {
return _this.data_(event);
}
if (event.data.action === 'done') {
return _this.done_(event);
}
};
// this timestampOffset is a property with the side-effect of resetting
// baseMediaDecodeTime in the transmuxer on the setter
Object.defineProperty(this, 'timestampOffset', {
get: function get() {
return this.timestampOffset_;
},
set: function set(val) {
if (typeof val === 'number' && val >= 0) {
this.timestampOffset_ = val;
// We have to tell the transmuxer to set the baseMediaDecodeTime to
// the desired timestampOffset for the next segment
this.transmuxer_.postMessage({
action: 'setTimestampOffset',
timestampOffset: val
});
}
}
});
// setting the append window affects both source buffers
Object.defineProperty(this, 'appendWindowStart', {
get: function get() {
return (this.videoBuffer_ || this.audioBuffer_).appendWindowStart;
},
set: function set(start) {
if (this.videoBuffer_) {
this.videoBuffer_.appendWindowStart = start;
}
if (this.audioBuffer_) {
this.audioBuffer_.appendWindowStart = start;
}
}
});
// this buffer is "updating" if either of its native buffers are
Object.defineProperty(this, 'updating', {
get: function get() {
return !!(this.bufferUpdating_ || !this.audioDisabled_ && this.audioBuffer_ && this.audioBuffer_.updating || this.videoBuffer_ && this.videoBuffer_.updating);
}
});
// the buffered property is the intersection of the buffered
// ranges of the native source buffers
Object.defineProperty(this, 'buffered', {
get: function get() {
var start = null;
var end = null;
var arity = 0;
var extents = [];
var ranges = [];
if (!this.videoBuffer_ && (this.audioDisabled_ || !this.audioBuffer_)) {
return _videoJs2['default'].createTimeRange();
}
// Handle the case where we only have one buffer
if (!this.videoBuffer_) {
return this.audioBuffer_.buffered;
} else if (this.audioDisabled_ || !this.audioBuffer_) {
return this.videoBuffer_.buffered;
}
// Handle the case where there is no buffer data
if ((!this.videoBuffer_ || this.videoBuffer_.buffered.length === 0) && (!this.audioBuffer_ || this.audioBuffer_.buffered.length === 0)) {
return _videoJs2['default'].createTimeRange();
}
// Handle the case where we have both buffers and create an
// intersection of the two
var videoBuffered = this.videoBuffer_.buffered;
var audioBuffered = this.audioBuffer_.buffered;
var count = videoBuffered.length;
// A) Gather up all start and end times
while (count--) {
extents.push({ time: videoBuffered.start(count), type: 'start' });
extents.push({ time: videoBuffered.end(count), type: 'end' });
}
count = audioBuffered.length;
while (count--) {
extents.push({ time: audioBuffered.start(count), type: 'start' });
extents.push({ time: audioBuffered.end(count), type: 'end' });
}
// B) Sort them by time
extents.sort(function (a, b) {
return a.time - b.time;
});
// C) Go along one by one incrementing arity for start and decrementing
// arity for ends
for (count = 0; count < extents.length; count++) {
if (extents[count].type === 'start') {
arity++;
// D) If arity is ever incremented to 2 we are entering an
// overlapping range
if (arity === 2) {
start = extents[count].time;
}
} else if (extents[count].type === 'end') {
arity--;
// E) If arity is ever decremented to 1 we leaving an
// overlapping range
if (arity === 1) {
end = extents[count].time;
}
}
// F) Record overlapping ranges
if (start !== null && end !== null) {
ranges.push([start, end]);
start = null;
end = null;
}
}
return _videoJs2['default'].createTimeRanges(ranges);
}
});
}
/**
* When we get a data event from the transmuxer
* we call this function and handle the data that
* was sent to us
*
* @private
* @param {Event} event the data event from the transmuxer
*/
_createClass(VirtualSourceBuffer, [{
key: 'data_',
value: function data_(event) {
var segment = event.data.segment;
// Cast ArrayBuffer to TypedArray
segment.data = new Uint8Array(segment.data, event.data.byteOffset, event.data.byteLength);
(0, _createTextTracksIfNecessary2['default'])(this, this.mediaSource_, segment);
// Add the segments to the pendingBuffers array
this.pendingBuffers_.push(segment);
return;
}
/**
* When we get a done event from the transmuxer
* we call this function and we process all
* of the pending data that we have been saving in the
* data_ function
*
* @private
* @param {Event} event the done event from the transmuxer
*/
}, {
key: 'done_',
value: function done_(event) {
// All buffers should have been flushed from the muxer
// start processing anything we have received
this.processPendingSegments_();
return;
}
/**
* Create our internal native audio/video source buffers and add
* event handlers to them with the following conditions:
* 1. they do not already exist on the mediaSource
* 2. this VSB has a codec for them
*
* @private
*/
}, {
key: 'createRealSourceBuffers_',
value: function createRealSourceBuffers_() {
var _this2 = this;
var types = ['audio', 'video'];
types.forEach(function (type) {
// Don't create a SourceBuffer of this type if we don't have a
// codec for it
if (!_this2[type + 'Codec_']) {
return;
}
// Do nothing if a SourceBuffer of this type already exists
if (_this2[type + 'Buffer_']) {
return;
}
var buffer = null;
// If the mediasource already has a SourceBuffer for the codec
// use that
if (_this2.mediaSource_[type + 'Buffer_']) {
buffer = _this2.mediaSource_[type + 'Buffer_'];
} else {
buffer = _this2.mediaSource_.nativeMediaSource_.addSourceBuffer(type + '/mp4;codecs="' + _this2[type + 'Codec_'] + '"');
_this2.mediaSource_[type + 'Buffer_'] = buffer;
}
_this2[type + 'Buffer_'] = buffer;
// Wire up the events to the SourceBuffer
['update', 'updatestart', 'updateend'].forEach(function (event) {
buffer.addEventListener(event, function () {
// if audio is disabled
if (type === 'audio' && _this2.audioDisabled_) {
return;
}
var shouldTrigger = types.every(function (t) {
// skip checking audio's updating status if audio
// is not enabled
if (t === 'audio' && _this2.audioDisabled_) {
return true;
}
// if the other type if updating we don't trigger
if (type !== t && _this2[t + 'Buffer_'] && _this2[t + 'Buffer_'].updating) {
return false;
}
return true;
});
if (shouldTrigger) {
return _this2.trigger(event);
}
});
});
});
}
/**
* Emulate the native mediasource function, but our function will
* send all of the proposed segments to the transmuxer so that we
* can transmux them before we append them to our internal
* native source buffers in the correct format.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/appendBuffer
* @param {Uint8Array} segment the segment to append to the buffer
*/
}, {
key: 'appendBuffer',
value: function appendBuffer(segment) {
// Start the internal "updating" state
this.bufferUpdating_ = true;
this.transmuxer_.postMessage({
action: 'push',
// Send the typed-array of data as an ArrayBuffer so that
// it can be sent as a "Transferable" and avoid the costly
// memory copy
data: segment.buffer,
// To recreate the original typed-array, we need information
// about what portion of the ArrayBuffer it was a view into
byteOffset: segment.byteOffset,
byteLength: segment.byteLength
}, [segment.buffer]);
this.transmuxer_.postMessage({ action: 'flush' });
}
/**
* Emulate the native mediasource function and remove parts
* of the buffer from any of our internal buffers that exist
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/remove
* @param {Double} start position to start the remove at
* @param {Double} end position to end the remove at
*/
}, {
key: 'remove',
value: function remove(start, end) {
if (this.videoBuffer_) {
this.videoBuffer_.remove(start, end);
}
if (!this.audioDisabled_ && this.audioBuffer_) {
this.audioBuffer_.remove(start, end);
}
// Remove Metadata Cues (id3)
(0, _removeCuesFromTrack2['default'])(start, end, this.metadataTrack_);
// Remove Any Captions
(0, _removeCuesFromTrack2['default'])(start, end, this.inbandTextTrack_);
}
/**
* Process any segments that the muxer has output
* Concatenate segments together based on type and append them into
* their respective sourceBuffers
*
* @private
*/
}, {
key: 'processPendingSegments_',
value: function processPendingSegments_() {
var sortedSegments = {
video: {
segments: [],
bytes: 0
},
audio: {
segments: [],
bytes: 0
},
captions: [],
metadata: []
};
// Sort segments into separate video/audio arrays and
// keep track of their total byte lengths
sortedSegments = this.pendingBuffers_.reduce(function (segmentObj, segment) {
var type = segment.type;
var data = segment.data;
segmentObj[type].segments.push(data);
segmentObj[type].bytes += data.byteLength;
// Gather any captions into a single array
if (segment.captions) {
segmentObj.captions = segmentObj.captions.concat(segment.captions);
}
if (segment.info) {
segmentObj[type].info = segment.info;
}
// Gather any metadata into a single array
if (segment.metadata) {
segmentObj.metadata = segmentObj.metadata.concat(segment.metadata);
}
return segmentObj;
}, sortedSegments);
// Create the real source buffers if they don't exist by now since we
// finally are sure what tracks are contained in the source
if (!this.videoBuffer_ && !this.audioBuffer_) {
// Remove any codecs that may have been specified by default but
// are no longer applicable now
if (sortedSegments.video.bytes === 0) {
this.videoCodec_ = null;
}
if (sortedSegments.audio.bytes === 0) {
this.audioCodec_ = null;
}
this.createRealSourceBuffers_();
}
if (sortedSegments.audio.info) {
this.mediaSource_.trigger({ type: 'audioinfo', info: sortedSegments.audio.info });
}
if (sortedSegments.video.info) {
this.mediaSource_.trigger({ type: 'videoinfo', info: sortedSegments.video.info });
}
// Merge multiple video and audio segments into one and append
if (this.videoBuffer_) {
this.concatAndAppendSegments_(sortedSegments.video, this.videoBuffer_);
// TODO: are video tracks the only ones with text tracks?
(0, _addTextTrackData2['default'])(this, sortedSegments.captions, sortedSegments.metadata);
}
if (!this.audioDisabled_ && this.audioBuffer_) {
this.concatAndAppendSegments_(sortedSegments.audio, this.audioBuffer_);
}
this.pendingBuffers_.length = 0;
// We are no longer in the internal "updating" state
this.bufferUpdating_ = false;
}
/**
* Combine all segments into a single Uint8Array and then append them
* to the destination buffer
*
* @param {Object} segmentObj
* @param {SourceBuffer} destinationBuffer native source buffer to append data to
* @private
*/
}, {
key: 'concatAndAppendSegments_',
value: function concatAndAppendSegments_(segmentObj, destinationBuffer) {
var offset = 0;
var tempBuffer = undefined;
if (segmentObj.bytes) {
tempBuffer = new Uint8Array(segmentObj.bytes);
// Combine the individual segments into one large typed-array
segmentObj.segments.forEach(function (segment) {
tempBuffer.set(segment, offset);
offset += segment.byteLength;
});
destinationBuffer.appendBuffer(tempBuffer);
}
}
/**
* Emulate the native mediasource function. abort any soureBuffer
* actions and throw out any un-appended data.
*
* @link https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/abort
*/
}, {
key: 'abort',
value: function abort() {
if (this.videoBuffer_) {
this.videoBuffer_.abort();
}
if (this.audioBuffer_) {
this.audioBuffer_.abort();
}
if (this.transmuxer_) {
this.transmuxer_.postMessage({ action: 'reset' });
}
this.pendingBuffers_.length = 0;
this.bufferUpdating_ = false;
}
}]);
return VirtualSourceBuffer;
})(_videoJs2['default'].EventTarget);
exports['default'] = VirtualSourceBuffer;
module.exports = exports['default'];
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./add-text-track-data":26,"./codec-utils":27,"./create-text-tracks-if-necessary":28,"./remove-cues-from-track":33,"./transmuxer-worker":34,"webworkify":52}],37:[function(require,module,exports){
/**
* mux.js
*
* Copyright (c) 2016 Brightcove
* All rights reserved.
*
* A stream-based aac to mp4 converter. This utility can be used to
* deliver mp4s to a SourceBuffer on platforms that support native
* Media Source Extensions.
*/
'use strict';
var Stream = require('../utils/stream.js');
// Constants
var AacStream;
/**
* Splits an incoming stream of binary data into ADTS and ID3 Frames.
*/
AacStream = function() {
var
everything = new Uint8Array(),
receivedTimeStamp = false,
timeStamp = 0;
AacStream.prototype.init.call(this);
this.setTimestamp = function (timestamp) {
timeStamp = timestamp;
};
this.parseId3TagSize = function(header, byteIndex) {
var
returnSize = (header[byteIndex + 6] << 21) |
(header[byteIndex + 7] << 14) |
(header[byteIndex + 8] << 7) |
(header[byteIndex + 9]),
flags = header[byteIndex + 5],
footerPresent = (flags & 16) >> 4;
if (footerPresent) {
return returnSize + 20;
}
return returnSize + 10;
};
this.parseAdtsSize = function(header, byteIndex) {
var
lowThree = (header[byteIndex + 5] & 0xE0) >> 5,
middle = header[byteIndex + 4] << 3,
highTwo = header[byteIndex + 3] & 0x3 << 11;
return (highTwo | middle) | lowThree;
};
this.push = function(bytes) {
var
frameSize = 0,
byteIndex = 0,
bytesLeft,
chunk,
packet,
tempLength;
// If there are bytes remaining from the last segment, prepend them to the
// bytes that were pushed in
if (everything.length) {
tempLength = everything.length;
everything = new Uint8Array(bytes.byteLength + tempLength);
everything.set(everything.subarray(0, tempLength));
everything.set(bytes, tempLength);
} else {
everything = bytes;
}
while (everything.length - byteIndex >= 3) {
if ((everything[byteIndex] === 'I'.charCodeAt(0)) &&
(everything[byteIndex + 1] === 'D'.charCodeAt(0)) &&
(everything[byteIndex + 2] === '3'.charCodeAt(0))) {
// Exit early because we don't have enough to parse
// the ID3 tag header
if (everything.length - byteIndex < 10) {
break;
}
// check framesize
frameSize = this.parseId3TagSize(everything, byteIndex);
// Exit early if we don't have enough in the buffer
// to emit a full packet
if (frameSize > everything.length) {
break;
}
chunk = {
type: 'timed-metadata',
data: everything.subarray(byteIndex, byteIndex + frameSize)
};
this.trigger('data', chunk);
byteIndex += frameSize;
continue;
} else if ((everything[byteIndex] & 0xff === 0xff) &&
((everything[byteIndex + 1] & 0xf0) === 0xf0)) {
// Exit early because we don't have enough to parse
// the ADTS frame header
if (everything.length - byteIndex < 7) {
break;
}
frameSize = this.parseAdtsSize(everything, byteIndex);
// Exit early if we don't have enough in the buffer
// to emit a full packet
if (frameSize > everything.length) {
break;
}
packet = {
type: 'audio',
data: everything.subarray(byteIndex, byteIndex + frameSize),
pts: timeStamp,
dts: timeStamp,
};
this.trigger('data', packet);
byteIndex += frameSize;
continue;
}
byteIndex++;
}
bytesLeft = everything.length - byteIndex;
if (bytesLeft > 0) {
everything = everything.subarray(byteIndex);
} else {
everything = new Uint8Array();
}
};
};
AacStream.prototype = new Stream();
module.exports = AacStream;
},{"../utils/stream.js":51}],38:[function(require,module,exports){
'use strict';
var Stream = require('../utils/stream.js');
var AdtsStream;
var
ADTS_SAMPLING_FREQUENCIES = [
96000,
88200,
64000,
48000,
44100,
32000,
24000,
22050,
16000,
12000,
11025,
8000,
7350
];
/*
* Accepts a ElementaryStream and emits data events with parsed
* AAC Audio Frames of the individual packets. Input audio in ADTS
* format is unpacked and re-emitted as AAC frames.
*
* @see http://wiki.multimedia.cx/index.php?title=ADTS
* @see http://wiki.multimedia.cx/?title=Understanding_AAC
*/
AdtsStream = function() {
var self, buffer;
AdtsStream.prototype.init.call(this);
self = this;
this.push = function(packet) {
var
i = 0,
frameNum = 0,
frameLength,
protectionSkipBytes,
frameEnd,
oldBuffer,
numFrames,
sampleCount,
adtsFrameDuration;
if (packet.type !== 'audio') {
// ignore non-audio data
return;
}
// Prepend any data in the buffer to the input data so that we can parse
// aac frames the cross a PES packet boundary
if (buffer) {
oldBuffer = buffer;
buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);
buffer.set(oldBuffer);
buffer.set(packet.data, oldBuffer.byteLength);
} else {
buffer = packet.data;
}
// unpack any ADTS frames which have been fully received
// for details on the ADTS header, see http://wiki.multimedia.cx/index.php?title=ADTS
while (i + 5 < buffer.length) {
// Loook for the start of an ADTS header..
if (buffer[i] !== 0xFF || (buffer[i + 1] & 0xF6) !== 0xF0) {
// If a valid header was not found, jump one forward and attempt to
// find a valid ADTS header starting at the next byte
i++;
continue;
}
// The protection skip bit tells us if we have 2 bytes of CRC data at the
// end of the ADTS header
protectionSkipBytes = (~buffer[i + 1] & 0x01) * 2;
// Frame length is a 13 bit integer starting 16 bits from the
// end of the sync sequence
frameLength = ((buffer[i + 3] & 0x03) << 11) |
(buffer[i + 4] << 3) |
((buffer[i + 5] & 0xe0) >> 5);
sampleCount = ((buffer[i + 6] & 0x03) + 1) * 1024;
adtsFrameDuration = (sampleCount * 90000) /
ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2];
frameEnd = i + frameLength;
// If we don't have enough data to actually finish this ADTS frame, return
// and wait for more data
if (buffer.byteLength < frameEnd) {
return;
}
// Otherwise, deliver the complete AAC frame
this.trigger('data', {
pts: packet.pts + (frameNum * adtsFrameDuration),
dts: packet.dts + (frameNum * adtsFrameDuration),
sampleCount: sampleCount,
audioobjecttype: ((buffer[i + 2] >>> 6) & 0x03) + 1,
channelcount: ((buffer[i + 2] & 1) << 2) |
((buffer[i + 3] & 0xc0) >>> 6),
samplerate: ADTS_SAMPLING_FREQUENCIES[(buffer[i + 2] & 0x3c) >>> 2],
samplingfrequencyindex: (buffer[i + 2] & 0x3c) >>> 2,
// assume ISO/IEC 14496-12 AudioSampleEntry default of 16
samplesize: 16,
data: buffer.subarray(i + 7 + protectionSkipBytes, frameEnd)
});
// If the buffer is empty, clear it and return
if (buffer.byteLength === frameEnd) {
buffer = undefined;
return;
}
frameNum++;
// Remove the finished frame from the buffer and start the process again
buffer = buffer.subarray(frameEnd);
}
};
this.flush = function() {
this.trigger('done');
};
};
AdtsStream.prototype = new Stream();
module.exports = AdtsStream;
},{"../utils/stream.js":51}],39:[function(require,module,exports){
'use strict';
var Stream = require('../utils/stream.js');
var ExpGolomb = require('../utils/exp-golomb.js');
var H264Stream, NalByteStream;
/**
* Accepts a NAL unit byte stream and unpacks the embedded NAL units.
*/
NalByteStream = function() {
var
syncPoint = 0,
i,
buffer;
NalByteStream.prototype.init.call(this);
this.push = function(data) {
var swapBuffer;
if (!buffer) {
buffer = data.data;
} else {
swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);
swapBuffer.set(buffer);
swapBuffer.set(data.data, buffer.byteLength);
buffer = swapBuffer;
}
// Rec. ITU-T H.264, Annex B
// scan for NAL unit boundaries
// a match looks like this:
// 0 0 1 .. NAL .. 0 0 1
// ^ sync point ^ i
// or this:
// 0 0 1 .. NAL .. 0 0 0
// ^ sync point ^ i
// advance the sync point to a NAL start, if necessary
for (; syncPoint < buffer.byteLength - 3; syncPoint++) {
if (buffer[syncPoint + 2] === 1) {
// the sync point is properly aligned
i = syncPoint + 5;
break;
}
}
while (i < buffer.byteLength) {
// look at the current byte to determine if we've hit the end of
// a NAL unit boundary
switch (buffer[i]) {
case 0:
// skip past non-sync sequences
if (buffer[i - 1] !== 0) {
i += 2;
break;
} else if (buffer[i - 2] !== 0) {
i++;
break;
}
// deliver the NAL unit if it isn't empty
if (syncPoint + 3 !== i - 2) {
this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));
}
// drop trailing zeroes
do {
i++;
} while (buffer[i] !== 1 && i < buffer.length);
syncPoint = i - 2;
i += 3;
break;
case 1:
// skip past non-sync sequences
if (buffer[i - 1] !== 0 ||
buffer[i - 2] !== 0) {
i += 3;
break;
}
// deliver the NAL unit
this.trigger('data', buffer.subarray(syncPoint + 3, i - 2));
syncPoint = i - 2;
i += 3;
break;
default:
// the current byte isn't a one or zero, so it cannot be part
// of a sync sequence
i += 3;
break;
}
}
// filter out the NAL units that were delivered
buffer = buffer.subarray(syncPoint);
i -= syncPoint;
syncPoint = 0;
};
this.flush = function() {
// deliver the last buffered NAL unit
if (buffer && buffer.byteLength > 3) {
this.trigger('data', buffer.subarray(syncPoint + 3));
}
// reset the stream state
buffer = null;
syncPoint = 0;
this.trigger('done');
};
};
NalByteStream.prototype = new Stream();
/**
* Accepts input from a ElementaryStream and produces H.264 NAL unit data
* events.
*/
H264Stream = function() {
var
nalByteStream = new NalByteStream(),
self,
trackId,
currentPts,
currentDts,
discardEmulationPreventionBytes,
readSequenceParameterSet,
skipScalingList;
H264Stream.prototype.init.call(this);
self = this;
this.push = function(packet) {
if (packet.type !== 'video') {
return;
}
trackId = packet.trackId;
currentPts = packet.pts;
currentDts = packet.dts;
nalByteStream.push(packet);
};
nalByteStream.on('data', function(data) {
var
event = {
trackId: trackId,
pts: currentPts,
dts: currentDts,
data: data
};
switch (data[0] & 0x1f) {
case 0x05:
event.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr';
break;
case 0x06:
event.nalUnitType = 'sei_rbsp';
event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));
break;
case 0x07:
event.nalUnitType = 'seq_parameter_set_rbsp';
event.escapedRBSP = discardEmulationPreventionBytes(data.subarray(1));
event.config = readSequenceParameterSet(event.escapedRBSP);
break;
case 0x08:
event.nalUnitType = 'pic_parameter_set_rbsp';
break;
case 0x09:
event.nalUnitType = 'access_unit_delimiter_rbsp';
break;
default:
break;
}
self.trigger('data', event);
});
nalByteStream.on('done', function() {
self.trigger('done');
});
this.flush = function() {
nalByteStream.flush();
};
/**
* Advance the ExpGolomb decoder past a scaling list. The scaling
* list is optionally transmitted as part of a sequence parameter
* set and is not relevant to transmuxing.
* @param count {number} the number of entries in this scaling list
* @param expGolombDecoder {object} an ExpGolomb pointed to the
* start of a scaling list
* @see Recommendation ITU-T H.264, Section 7.3.2.1.1.1
*/
skipScalingList = function(count, expGolombDecoder) {
var
lastScale = 8,
nextScale = 8,
j,
deltaScale;
for (j = 0; j < count; j++) {
if (nextScale !== 0) {
deltaScale = expGolombDecoder.readExpGolomb();
nextScale = (lastScale + deltaScale + 256) % 256;
}
lastScale = (nextScale === 0) ? lastScale : nextScale;
}
};
/**
* Expunge any "Emulation Prevention" bytes from a "Raw Byte
* Sequence Payload"
* @param data {Uint8Array} the bytes of a RBSP from a NAL
* unit
* @return {Uint8Array} the RBSP without any Emulation
* Prevention Bytes
*/
discardEmulationPreventionBytes = function(data) {
var
length = data.byteLength,
emulationPreventionBytesPositions = [],
i = 1,
newLength, newData;
// Find all `Emulation Prevention Bytes`
while (i < length - 2) {
if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0x03) {
emulationPreventionBytesPositions.push(i + 2);
i += 2;
} else {
i++;
}
}
// If no Emulation Prevention Bytes were found just return the original
// array
if (emulationPreventionBytesPositions.length === 0) {
return data;
}
// Create a new array to hold the NAL unit data
newLength = length - emulationPreventionBytesPositions.length;
newData = new Uint8Array(newLength);
var sourceIndex = 0;
for (i = 0; i < newLength; sourceIndex++, i++) {
if (sourceIndex === emulationPreventionBytesPositions[0]) {
// Skip this byte
sourceIndex++;
// Remove this position index
emulationPreventionBytesPositions.shift();
}
newData[i] = data[sourceIndex];
}
return newData;
};
/**
* Read a sequence parameter set and return some interesting video
* properties. A sequence parameter set is the H264 metadata that
* describes the properties of upcoming video frames.
* @param data {Uint8Array} the bytes of a sequence parameter set
* @return {object} an object with configuration parsed from the
* sequence parameter set, including the dimensions of the
* associated video frames.
*/
readSequenceParameterSet = function(data) {
var
frameCropLeftOffset = 0,
frameCropRightOffset = 0,
frameCropTopOffset = 0,
frameCropBottomOffset = 0,
sarScale = 1,
expGolombDecoder, profileIdc, levelIdc, profileCompatibility,
chromaFormatIdc, picOrderCntType,
numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1,
picHeightInMapUnitsMinus1,
frameMbsOnlyFlag,
scalingListCount,
sarRatio,
aspectRatioIdc,
i;
expGolombDecoder = new ExpGolomb(data);
profileIdc = expGolombDecoder.readUnsignedByte(); // profile_idc
profileCompatibility = expGolombDecoder.readUnsignedByte(); // constraint_set[0-5]_flag
levelIdc = expGolombDecoder.readUnsignedByte(); // level_idc u(8)
expGolombDecoder.skipUnsignedExpGolomb(); // seq_parameter_set_id
// some profiles have more optional data we don't need
if (profileIdc === 100 ||
profileIdc === 110 ||
profileIdc === 122 ||
profileIdc === 244 ||
profileIdc === 44 ||
profileIdc === 83 ||
profileIdc === 86 ||
profileIdc === 118 ||
profileIdc === 128 ||
profileIdc === 138 ||
profileIdc === 139 ||
profileIdc === 134) {
chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();
if (chromaFormatIdc === 3) {
expGolombDecoder.skipBits(1); // separate_colour_plane_flag
}
expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_luma_minus8
expGolombDecoder.skipUnsignedExpGolomb(); // bit_depth_chroma_minus8
expGolombDecoder.skipBits(1); // qpprime_y_zero_transform_bypass_flag
if (expGolombDecoder.readBoolean()) { // seq_scaling_matrix_present_flag
scalingListCount = (chromaFormatIdc !== 3) ? 8 : 12;
for (i = 0; i < scalingListCount; i++) {
if (expGolombDecoder.readBoolean()) { // seq_scaling_list_present_flag[ i ]
if (i < 6) {
skipScalingList(16, expGolombDecoder);
} else {
skipScalingList(64, expGolombDecoder);
}
}
}
}
}
expGolombDecoder.skipUnsignedExpGolomb(); // log2_max_frame_num_minus4
picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();
if (picOrderCntType === 0) {
expGolombDecoder.readUnsignedExpGolomb(); //log2_max_pic_order_cnt_lsb_minus4
} else if (picOrderCntType === 1) {
expGolombDecoder.skipBits(1); // delta_pic_order_always_zero_flag
expGolombDecoder.skipExpGolomb(); // offset_for_non_ref_pic
expGolombDecoder.skipExpGolomb(); // offset_for_top_to_bottom_field
numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();
for(i = 0; i < numRefFramesInPicOrderCntCycle; i++) {
expGolombDecoder.skipExpGolomb(); // offset_for_ref_frame[ i ]
}
}
expGolombDecoder.skipUnsignedExpGolomb(); // max_num_ref_frames
expGolombDecoder.skipBits(1); // gaps_in_frame_num_value_allowed_flag
picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
frameMbsOnlyFlag = expGolombDecoder.readBits(1);
if (frameMbsOnlyFlag === 0) {
expGolombDecoder.skipBits(1); // mb_adaptive_frame_field_flag
}
expGolombDecoder.skipBits(1); // direct_8x8_inference_flag
if (expGolombDecoder.readBoolean()) { // frame_cropping_flag
frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();
frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();
frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();
frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();
}
if (expGolombDecoder.readBoolean()) {
// vui_parameters_present_flag
if (expGolombDecoder.readBoolean()) {
// aspect_ratio_info_present_flag
aspectRatioIdc = expGolombDecoder.readUnsignedByte();
switch (aspectRatioIdc) {
case 1: sarRatio = [1,1]; break;
case 2: sarRatio = [12,11]; break;
case 3: sarRatio = [10,11]; break;
case 4: sarRatio = [16,11]; break;
case 5: sarRatio = [40,33]; break;
case 6: sarRatio = [24,11]; break;
case 7: sarRatio = [20,11]; break;
case 8: sarRatio = [32,11]; break;
case 9: sarRatio = [80,33]; break;
case 10: sarRatio = [18,11]; break;
case 11: sarRatio = [15,11]; break;
case 12: sarRatio = [64,33]; break;
case 13: sarRatio = [160,99]; break;
case 14: sarRatio = [4,3]; break;
case 15: sarRatio = [3,2]; break;
case 16: sarRatio = [2,1]; break;
case 255: {
sarRatio = [expGolombDecoder.readUnsignedByte() << 8 |
expGolombDecoder.readUnsignedByte(),
expGolombDecoder.readUnsignedByte() << 8 |
expGolombDecoder.readUnsignedByte() ];
break;
}
}
if (sarRatio) {
sarScale = sarRatio[0] / sarRatio[1];
}
}
}
return {
profileIdc: profileIdc,
levelIdc: levelIdc,
profileCompatibility: profileCompatibility,
width: Math.ceil((((picWidthInMbsMinus1 + 1) * 16) - frameCropLeftOffset * 2 - frameCropRightOffset * 2) * sarScale),
height: ((2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16) - (frameCropTopOffset * 2) - (frameCropBottomOffset * 2)
};
};
};
H264Stream.prototype = new Stream();
module.exports = {
H264Stream: H264Stream,
NalByteStream: NalByteStream,
};
},{"../utils/exp-golomb.js":50,"../utils/stream.js":51}],40:[function(require,module,exports){
/**
* An object that stores the bytes of an FLV tag and methods for
* querying and manipulating that data.
* @see http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf
*/
'use strict';
var FlvTag;
// (type:uint, extraData:Boolean = false) extends ByteArray
FlvTag = function(type, extraData) {
var
// Counter if this is a metadata tag, nal start marker if this is a video
// tag. unused if this is an audio tag
adHoc = 0, // :uint
// The default size is 16kb but this is not enough to hold iframe
// data and the resizing algorithm costs a bit so we create a larger
// starting buffer for video tags
bufferStartSize = 16384,
// checks whether the FLV tag has enough capacity to accept the proposed
// write and re-allocates the internal buffers if necessary
prepareWrite = function(flv, count) {
var
bytes,
minLength = flv.position + count;
if (minLength < flv.bytes.byteLength) {
// there's enough capacity so do nothing
return;
}
// allocate a new buffer and copy over the data that will not be modified
bytes = new Uint8Array(minLength * 2);
bytes.set(flv.bytes.subarray(0, flv.position), 0);
flv.bytes = bytes;
flv.view = new DataView(flv.bytes.buffer);
},
// commonly used metadata properties
widthBytes = FlvTag.widthBytes || new Uint8Array('width'.length),
heightBytes = FlvTag.heightBytes || new Uint8Array('height'.length),
videocodecidBytes = FlvTag.videocodecidBytes || new Uint8Array('videocodecid'.length),
i;
if (!FlvTag.widthBytes) {
// calculating the bytes of common metadata names ahead of time makes the
// corresponding writes faster because we don't have to loop over the
// characters
// re-test with test/perf.html if you're planning on changing this
for (i = 0; i < 'width'.length; i++) {
widthBytes[i] = 'width'.charCodeAt(i);
}
for (i = 0; i < 'height'.length; i++) {
heightBytes[i] = 'height'.charCodeAt(i);
}
for (i = 0; i < 'videocodecid'.length; i++) {
videocodecidBytes[i] = 'videocodecid'.charCodeAt(i);
}
FlvTag.widthBytes = widthBytes;
FlvTag.heightBytes = heightBytes;
FlvTag.videocodecidBytes = videocodecidBytes;
}
this.keyFrame = false; // :Boolean
switch(type) {
case FlvTag.VIDEO_TAG:
this.length = 16;
// Start the buffer at 256k
bufferStartSize *= 6;
break;
case FlvTag.AUDIO_TAG:
this.length = 13;
this.keyFrame = true;
break;
case FlvTag.METADATA_TAG:
this.length = 29;
this.keyFrame = true;
break;
default:
throw("Error Unknown TagType");
}
this.bytes = new Uint8Array(bufferStartSize);
this.view = new DataView(this.bytes.buffer);
this.bytes[0] = type;
this.position = this.length;
this.keyFrame = extraData; // Defaults to false
// presentation timestamp
this.pts = 0;
// decoder timestamp
this.dts = 0;
// ByteArray#writeBytes(bytes:ByteArray, offset:uint = 0, length:uint = 0)
this.writeBytes = function(bytes, offset, length) {
var
start = offset || 0,
end;
length = length || bytes.byteLength;
end = start + length;
prepareWrite(this, length);
this.bytes.set(bytes.subarray(start, end), this.position);
this.position += length;
this.length = Math.max(this.length, this.position);
};
// ByteArray#writeByte(value:int):void
this.writeByte = function(byte) {
prepareWrite(this, 1);
this.bytes[this.position] = byte;
this.position++;
this.length = Math.max(this.length, this.position);
};
// ByteArray#writeShort(value:int):void
this.writeShort = function(short) {
prepareWrite(this, 2);
this.view.setUint16(this.position, short);
this.position += 2;
this.length = Math.max(this.length, this.position);
};
// Negative index into array
// (pos:uint):int
this.negIndex = function(pos) {
return this.bytes[this.length - pos];
};
// The functions below ONLY work when this[0] == VIDEO_TAG.
// We are not going to check for that because we dont want the overhead
// (nal:ByteArray = null):int
this.nalUnitSize = function() {
if (adHoc === 0) {
return 0;
}
return this.length - (adHoc + 4);
};
this.startNalUnit = function() {
// remember position and add 4 bytes
if (adHoc > 0) {
throw new Error("Attempted to create new NAL wihout closing the old one");
}
// reserve 4 bytes for nal unit size
adHoc = this.length;
this.length += 4;
this.position = this.length;
};
// (nal:ByteArray = null):void
this.endNalUnit = function(nalContainer) {
var
nalStart, // :uint
nalLength; // :uint
// Rewind to the marker and write the size
if (this.length === adHoc + 4) {
// we started a nal unit, but didnt write one, so roll back the 4 byte size value
this.length -= 4;
} else if (adHoc > 0) {
nalStart = adHoc + 4;
nalLength = this.length - nalStart;
this.position = adHoc;
this.view.setUint32(this.position, nalLength);
this.position = this.length;
if (nalContainer) {
// Add the tag to the NAL unit
nalContainer.push(this.bytes.subarray(nalStart, nalStart + nalLength));
}
}
adHoc = 0;
};
/**
* Write out a 64-bit floating point valued metadata property. This method is
* called frequently during a typical parse and needs to be fast.
*/
// (key:String, val:Number):void
this.writeMetaDataDouble = function(key, val) {
var i;
prepareWrite(this, 2 + key.length + 9);
// write size of property name
this.view.setUint16(this.position, key.length);
this.position += 2;
// this next part looks terrible but it improves parser throughput by
// 10kB/s in my testing
// write property name
if (key === 'width') {
this.bytes.set(widthBytes, this.position);
this.position += 5;
} else if (key === 'height') {
this.bytes.set(heightBytes, this.position);
this.position += 6;
} else if (key === 'videocodecid') {
this.bytes.set(videocodecidBytes, this.position);
this.position += 12;
} else {
for (i = 0; i < key.length; i++) {
this.bytes[this.position] = key.charCodeAt(i);
this.position++;
}
}
// skip null byte
this.position++;
// write property value
this.view.setFloat64(this.position, val);
this.position += 8;
// update flv tag length
this.length = Math.max(this.length, this.position);
++adHoc;
};
// (key:String, val:Boolean):void
this.writeMetaDataBoolean = function(key, val) {
var i;
prepareWrite(this, 2);
this.view.setUint16(this.position, key.length);
this.position += 2;
for (i = 0; i < key.length; i++) {
// if key.charCodeAt(i) >= 255, handle error
prepareWrite(this, 1);
this.bytes[this.position] = key.charCodeAt(i);
this.position++;
}
prepareWrite(this, 2);
this.view.setUint8(this.position, 0x01);
this.position++;
this.view.setUint8(this.position, val ? 0x01 : 0x00);
this.position++;
this.length = Math.max(this.length, this.position);
++adHoc;
};
// ():ByteArray
this.finalize = function() {
var
dtsDelta, // :int
len; // :int
switch(this.bytes[0]) {
// Video Data
case FlvTag.VIDEO_TAG:
this.bytes[11] = ((this.keyFrame || extraData) ? 0x10 : 0x20 ) | 0x07; // We only support AVC, 1 = key frame (for AVC, a seekable frame), 2 = inter frame (for AVC, a non-seekable frame)
this.bytes[12] = extraData ? 0x00 : 0x01;
dtsDelta = this.pts - this.dts;
this.bytes[13] = (dtsDelta & 0x00FF0000) >>> 16;
this.bytes[14] = (dtsDelta & 0x0000FF00) >>> 8;
this.bytes[15] = (dtsDelta & 0x000000FF) >>> 0;
break;
case FlvTag.AUDIO_TAG:
this.bytes[11] = 0xAF; // 44 kHz, 16-bit stereo
this.bytes[12] = extraData ? 0x00 : 0x01;
break;
case FlvTag.METADATA_TAG:
this.position = 11;
this.view.setUint8(this.position, 0x02); // String type
this.position++;
this.view.setUint16(this.position, 0x0A); // 10 Bytes
this.position += 2;
// set "onMetaData"
this.bytes.set([0x6f, 0x6e, 0x4d, 0x65,
0x74, 0x61, 0x44, 0x61,
0x74, 0x61], this.position);
this.position += 10;
this.bytes[this.position] = 0x08; // Array type
this.position++;
this.view.setUint32(this.position, adHoc);
this.position = this.length;
this.bytes.set([0, 0, 9], this.position);
this.position += 3; // End Data Tag
this.length = this.position;
break;
}
len = this.length - 11;
// write the DataSize field
this.bytes[ 1] = (len & 0x00FF0000) >>> 16;
this.bytes[ 2] = (len & 0x0000FF00) >>> 8;
this.bytes[ 3] = (len & 0x000000FF) >>> 0;
// write the Timestamp
this.bytes[ 4] = (this.dts & 0x00FF0000) >>> 16;
this.bytes[ 5] = (this.dts & 0x0000FF00) >>> 8;
this.bytes[ 6] = (this.dts & 0x000000FF) >>> 0;
this.bytes[ 7] = (this.dts & 0xFF000000) >>> 24;
// write the StreamID
this.bytes[ 8] = 0;
this.bytes[ 9] = 0;
this.bytes[10] = 0;
// Sometimes we're at the end of the view and have one slot to write a
// uint32, so, prepareWrite of count 4, since, view is uint8
prepareWrite(this, 4);
this.view.setUint32(this.length, this.length);
this.length += 4;
this.position += 4;
// trim down the byte buffer to what is actually being used
this.bytes = this.bytes.subarray(0, this.length);
this.frameTime = FlvTag.frameTime(this.bytes);
// if bytes.bytelength isn't equal to this.length, handle error
return this;
};
};
FlvTag.AUDIO_TAG = 0x08; // == 8, :uint
FlvTag.VIDEO_TAG = 0x09; // == 9, :uint
FlvTag.METADATA_TAG = 0x12; // == 18, :uint
// (tag:ByteArray):Boolean {
FlvTag.isAudioFrame = function(tag) {
return FlvTag.AUDIO_TAG === tag[0];
};
// (tag:ByteArray):Boolean {
FlvTag.isVideoFrame = function(tag) {
return FlvTag.VIDEO_TAG === tag[0];
};
// (tag:ByteArray):Boolean {
FlvTag.isMetaData = function(tag) {
return FlvTag.METADATA_TAG === tag[0];
};
// (tag:ByteArray):Boolean {
FlvTag.isKeyFrame = function(tag) {
if (FlvTag.isVideoFrame(tag)) {
return tag[11] === 0x17;
}
if (FlvTag.isAudioFrame(tag)) {
return true;
}
if (FlvTag.isMetaData(tag)) {
return true;
}
return false;
};
// (tag:ByteArray):uint {
FlvTag.frameTime = function(tag) {
var pts = tag[ 4] << 16; // :uint
pts |= tag[ 5] << 8;
pts |= tag[ 6] << 0;
pts |= tag[ 7] << 24;
return pts;
};
module.exports = FlvTag;
},{}],41:[function(require,module,exports){
module.exports = {
tag: require('./flv-tag'),
Transmuxer: require('./transmuxer')
};
},{"./flv-tag":40,"./transmuxer":42}],42:[function(require,module,exports){
'use strict';
var Stream = require('../utils/stream.js');
var FlvTag = require('./flv-tag.js');
var m2ts = require('../m2ts/m2ts.js');
var AdtsStream = require('../codecs/adts.js');
var H264Stream = require('../codecs/h264').H264Stream;
var
MetadataStream,
Transmuxer,
VideoSegmentStream,
AudioSegmentStream,
CoalesceStream,
collectTimelineInfo,
metaDataTag,
extraDataTag;
/**
* Store information about the start and end of the tracka and the
* duration for each frame/sample we process in order to calculate
* the baseMediaDecodeTime
*/
collectTimelineInfo = function (track, data) {
if (typeof data.pts === 'number') {
if (track.timelineStartInfo.pts === undefined) {
track.timelineStartInfo.pts = data.pts;
} else {
track.timelineStartInfo.pts =
Math.min(track.timelineStartInfo.pts, data.pts);
}
}
if (typeof data.dts === 'number') {
if (track.timelineStartInfo.dts === undefined) {
track.timelineStartInfo.dts = data.dts;
} else {
track.timelineStartInfo.dts =
Math.min(track.timelineStartInfo.dts, data.dts);
}
}
};
metaDataTag = function(track, pts) {
var
tag = new FlvTag(FlvTag.METADATA_TAG); // :FlvTag
tag.dts = pts;
tag.pts = pts;
tag.writeMetaDataDouble("videocodecid", 7);
tag.writeMetaDataDouble("width", track.width);
tag.writeMetaDataDouble("height", track.height);
return tag;
};
extraDataTag = function(track, pts) {
var
i,
tag = new FlvTag(FlvTag.VIDEO_TAG, true);
tag.dts = pts;
tag.pts = pts;
tag.writeByte(0x01);// version
tag.writeByte(track.profileIdc);// profile
tag.writeByte(track.profileCompatibility);// compatibility
tag.writeByte(track.levelIdc);// level
tag.writeByte(0xFC | 0x03); // reserved (6 bits), NULA length size - 1 (2 bits)
tag.writeByte(0xE0 | 0x01 ); // reserved (3 bits), num of SPS (5 bits)
tag.writeShort( track.sps[0].length ); // data of SPS
tag.writeBytes( track.sps[0] ); // SPS
tag.writeByte(track.pps.length); // num of PPS (will there ever be more that 1 PPS?)
for (i = 0 ; i < track.pps.length ; ++i) {
tag.writeShort(track.pps[i].length); // 2 bytes for length of PPS
tag.writeBytes(track.pps[i]); // data of PPS
}
return tag;
};
/**
* Constructs a single-track, media segment from AAC data
* events. The output of this stream can be fed to flash.
*/
AudioSegmentStream = function(track) {
var
adtsFrames = [],
adtsFramesLength = 0,
sequenceNumber = 0,
earliestAllowedDts = 0,
oldExtraData;
AudioSegmentStream.prototype.init.call(this);
this.push = function(data) {
collectTimelineInfo(track, data);
if (track && track.channelcount === undefined) {
track.audioobjecttype = data.audioobjecttype;
track.channelcount = data.channelcount;
track.samplerate = data.samplerate;
track.samplingfrequencyindex = data.samplingfrequencyindex;
track.samplesize = data.samplesize;
track.extraData = (track.audioobjecttype << 11) |
(track.samplingfrequencyindex << 7) |
(track.channelcount << 3);
}
data.pts = Math.round(data.pts / 90);
data.dts = Math.round(data.dts / 90);
// buffer audio data until end() is called
adtsFrames.push(data);
};
this.flush = function() {
var currentFrame, adtsFrame, deltaDts,lastMetaPts, tags = [];
// return early if no audio data has been observed
if (adtsFrames.length === 0) {
this.trigger('done');
return;
}
lastMetaPts = -Infinity;
while (adtsFrames.length) {
currentFrame = adtsFrames.shift();
// write out metadata tags every 1 second so that the decoder
// is re-initialized quickly after seeking into a different
// audio configuration
if (track.extraData !== oldExtraData || currentFrame.pts - lastMetaPts >= 1000) {
adtsFrame = new FlvTag(FlvTag.METADATA_TAG);
adtsFrame.pts = currentFrame.pts;
adtsFrame.dts = currentFrame.dts;
// AAC is always 10
adtsFrame.writeMetaDataDouble("audiocodecid", 10);
adtsFrame.writeMetaDataBoolean("stereo", 2 === track.channelcount);
adtsFrame.writeMetaDataDouble ("audiosamplerate", track.samplerate);
// Is AAC always 16 bit?
adtsFrame.writeMetaDataDouble ("audiosamplesize", 16);
tags.push(adtsFrame);
oldExtraData = track.extraData;
adtsFrame = new FlvTag(FlvTag.AUDIO_TAG, true);
// For audio, DTS is always the same as PTS. We want to set the DTS
// however so we can compare with video DTS to determine approximate
// packet order
adtsFrame.pts = currentFrame.pts;
adtsFrame.dts = currentFrame.dts;
adtsFrame.view.setUint16(adtsFrame.position, track.extraData);
adtsFrame.position += 2;
adtsFrame.length = Math.max(adtsFrame.length, adtsFrame.position);
tags.push(adtsFrame);
lastMetaPts = currentFrame.pts;
}
adtsFrame = new FlvTag(FlvTag.AUDIO_TAG);
adtsFrame.pts = currentFrame.pts;
adtsFrame.dts = currentFrame.dts;
adtsFrame.writeBytes(currentFrame.data);
tags.push(adtsFrame);
}
oldExtraData = null;
this.trigger('data', {track: track, tags: tags});
this.trigger('done');
};
};
AudioSegmentStream.prototype = new Stream();
/**
* Store FlvTags for the h264 stream
* @param track {object} track metadata configuration
*/
VideoSegmentStream = function(track) {
var
sequenceNumber = 0,
nalUnits = [],
nalUnitsLength = 0,
config,
h264Frame;
VideoSegmentStream.prototype.init.call(this);
this.finishFrame = function(tags, frame) {
if (!frame) {
return;
}
// Check if keyframe and the length of tags.
// This makes sure we write metadata on the first frame of a segment.
if (config && track && track.newMetadata &&
(frame.keyFrame || tags.length === 0)) {
// Push extra data on every IDR frame in case we did a stream change + seek
tags.push(metaDataTag(config, frame.pts));
tags.push(extraDataTag(track, frame.pts));
track.newMetadata = false;
}
frame.endNalUnit();
tags.push(frame);
};
this.push = function(data) {
collectTimelineInfo(track, data);
data.pts = Math.round(data.pts / 90);
data.dts = Math.round(data.dts / 90);
// buffer video until flush() is called
nalUnits.push(data);
};
this.flush = function() {
var
currentNal,
tags = [];
// Throw away nalUnits at the start of the byte stream until we find
// the first AUD
while (nalUnits.length) {
if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {
break;
}
nalUnits.shift();
}
// return early if no video data has been observed
if (nalUnits.length === 0) {
this.trigger('done');
return;
}
while (nalUnits.length) {
currentNal = nalUnits.shift();
// record the track config
if (currentNal.nalUnitType === 'seq_parameter_set_rbsp') {
track.newMetadata = true;
config = currentNal.config;
track.width = config.width;
track.height = config.height;
track.sps = [currentNal.data];
track.profileIdc = config.profileIdc;
track.levelIdc = config.levelIdc;
track.profileCompatibility = config.profileCompatibility;
h264Frame.endNalUnit();
} else if (currentNal.nalUnitType === 'pic_parameter_set_rbsp') {
track.newMetadata = true;
track.pps = [currentNal.data];
h264Frame.endNalUnit();
} else if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {
if (h264Frame) {
this.finishFrame(tags, h264Frame);
}
h264Frame = new FlvTag(FlvTag.VIDEO_TAG);
h264Frame.pts = currentNal.pts;
h264Frame.dts = currentNal.dts;
} else {
if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {
// the current sample is a key frame
h264Frame.keyFrame = true;
}
h264Frame.endNalUnit();
}
h264Frame.startNalUnit();
h264Frame.writeBytes(currentNal.data);
}
if (h264Frame) {
this.finishFrame(tags, h264Frame);
}
this.trigger('data', {track: track, tags: tags});
// Continue with the flush process now
this.trigger('done');
};
};
VideoSegmentStream.prototype = new Stream();
/**
* The final stage of the transmuxer that emits the flv tags
* for audio, video, and metadata. Also tranlates in time and
* outputs caption data and id3 cues.
*/
CoalesceStream = function(options) {
// Number of Tracks per output segment
// If greater than 1, we combine multiple
// tracks into a single segment
this.numberOfTracks = 0;
this.metadataStream = options.metadataStream;
this.videoTags = [];
this.audioTags = [];
this.videoTrack = null;
this.audioTrack = null;
this.pendingCaptions = [];
this.pendingMetadata = [];
this.pendingTracks = 0;
CoalesceStream.prototype.init.call(this);
// Take output from multiple
this.push = function(output) {
// buffer incoming captions until the associated video segment
// finishes
if (output.text) {
return this.pendingCaptions.push(output);
}
// buffer incoming id3 tags until the final flush
if (output.frames) {
return this.pendingMetadata.push(output);
}
if (output.track.type === 'video') {
this.videoTrack = output.track;
this.videoTags = output.tags;
this.pendingTracks++;
}
if (output.track.type === 'audio') {
this.audioTrack = output.track;
this.audioTags = output.tags;
this.pendingTracks++;
}
};
};
CoalesceStream.prototype = new Stream();
CoalesceStream.prototype.flush = function() {
var
id3,
caption,
i,
timelineStartPts,
event = {
tags: {},
captions: [],
metadata: []
};
if (this.pendingTracks < this.numberOfTracks) {
return;
}
if (this.videoTrack) {
timelineStartPts = this.videoTrack.timelineStartInfo.pts;
} else if (this.audioTrack) {
timelineStartPts = this.audioTrack.timelineStartInfo.pts;
}
event.tags.videoTags = this.videoTags;
event.tags.audioTags = this.audioTags;
// Translate caption PTS times into second offsets into the
// video timeline for the segment
for (i = 0; i < this.pendingCaptions.length; i++) {
caption = this.pendingCaptions[i];
caption.startTime = caption.startPts - timelineStartPts;
caption.startTime /= 90e3;
caption.endTime = caption.endPts - timelineStartPts;
caption.endTime /= 90e3;
event.captions.push(caption);
}
// Translate ID3 frame PTS times into second offsets into the
// video timeline for the segment
for (i = 0; i < this.pendingMetadata.length; i++) {
id3 = this.pendingMetadata[i];
id3.cueTime = id3.pts - timelineStartPts;
id3.cueTime /= 90e3;
event.metadata.push(id3);
}
// We add this to every single emitted segment even though we only need
// it for the first
event.metadata.dispatchType = this.metadataStream.dispatchType;
// Reset stream state
this.videoTrack = null;
this.audioTrack = null;
this.videoTags = [];
this.audioTags = [];
this.pendingCaptions.length = 0;
this.pendingMetadata.length = 0;
this.pendingTracks = 0;
// Emit the final segment
this.trigger('data', event);
this.trigger('done');
};
/**
* An object that incrementally transmuxes MPEG2 Trasport Stream
* chunks into an FLV.
*/
Transmuxer = function(options) {
var
self = this,
videoTrack,
audioTrack,
packetStream, parseStream, elementaryStream,
adtsStream, h264Stream,
videoSegmentStream, audioSegmentStream, captionStream,
coalesceStream;
Transmuxer.prototype.init.call(this);
options = options || {};
// expose the metadata stream
this.metadataStream = new m2ts.MetadataStream();
options.metadataStream = this.metadataStream;
// set up the parsing pipeline
packetStream = new m2ts.TransportPacketStream();
parseStream = new m2ts.TransportParseStream();
elementaryStream = new m2ts.ElementaryStream();
adtsStream = new AdtsStream();
h264Stream = new H264Stream();
coalesceStream = new CoalesceStream(options);
// disassemble MPEG2-TS packets into elementary streams
packetStream
.pipe(parseStream)
.pipe(elementaryStream);
// !!THIS ORDER IS IMPORTANT!!
// demux the streams
elementaryStream
.pipe(h264Stream);
elementaryStream
.pipe(adtsStream);
elementaryStream
.pipe(this.metadataStream)
.pipe(coalesceStream);
// if CEA-708 parsing is available, hook up a caption stream
captionStream = new m2ts.CaptionStream();
h264Stream.pipe(captionStream)
.pipe(coalesceStream);
// hook up the segment streams once track metadata is delivered
elementaryStream.on('data', function(data) {
var i, videoTrack, audioTrack;
if (data.type === 'metadata') {
i = data.tracks.length;
// scan the tracks listed in the metadata
while (i--) {
if (data.tracks[i].type === 'video') {
videoTrack = data.tracks[i];
} else if (data.tracks[i].type === 'audio') {
audioTrack = data.tracks[i];
}
}
// hook up the video segment stream to the first track with h264 data
if (videoTrack && !videoSegmentStream) {
coalesceStream.numberOfTracks++;
videoSegmentStream = new VideoSegmentStream(videoTrack);
// Set up the final part of the video pipeline
h264Stream
.pipe(videoSegmentStream)
.pipe(coalesceStream);
}
if (audioTrack && !audioSegmentStream) {
// hook up the audio segment stream to the first track with aac data
coalesceStream.numberOfTracks++;
audioSegmentStream = new AudioSegmentStream(audioTrack);
// Set up the final part of the audio pipeline
adtsStream
.pipe(audioSegmentStream)
.pipe(coalesceStream);
}
}
});
// feed incoming data to the front of the parsing pipeline
this.push = function(data) {
packetStream.push(data);
};
// flush any buffered data
this.flush = function() {
// Start at the top of the pipeline and flush all pending work
packetStream.flush();
};
// Re-emit any data coming from the coalesce stream to the outside world
coalesceStream.on('data', function (event) {
self.trigger('data', event);
});
// Let the consumer know we have finished flushing the entire pipeline
coalesceStream.on('done', function () {
self.trigger('done');
});
// For information on the FLV format, see
// http://download.macromedia.com/f4v/video_file_format_spec_v10_1.pdf.
// Technically, this function returns the header and a metadata FLV tag
// if duration is greater than zero
// duration in seconds
// @return {object} the bytes of the FLV header as a Uint8Array
this.getFlvHeader = function(duration, audio, video) { // :ByteArray {
var
headBytes = new Uint8Array(3 + 1 + 1 + 4),
head = new DataView(headBytes.buffer),
metadata,
result,
metadataLength;
// default arguments
duration = duration || 0;
audio = audio === undefined? true : audio;
video = video === undefined? true : video;
// signature
head.setUint8(0, 0x46); // 'F'
head.setUint8(1, 0x4c); // 'L'
head.setUint8(2, 0x56); // 'V'
// version
head.setUint8(3, 0x01);
// flags
head.setUint8(4, (audio ? 0x04 : 0x00) | (video ? 0x01 : 0x00));
// data offset, should be 9 for FLV v1
head.setUint32(5, headBytes.byteLength);
// init the first FLV tag
if (duration <= 0) {
// no duration available so just write the first field of the first
// FLV tag
result = new Uint8Array(headBytes.byteLength + 4);
result.set(headBytes);
result.set([0, 0, 0, 0], headBytes.byteLength);
return result;
}
// write out the duration metadata tag
metadata = new FlvTag(FlvTag.METADATA_TAG);
metadata.pts = metadata.dts = 0;
metadata.writeMetaDataDouble("duration", duration);
metadataLength = metadata.finalize().length;
result = new Uint8Array(headBytes.byteLength + metadataLength);
result.set(headBytes);
result.set(head.byteLength, metadataLength);
return result;
};
};
Transmuxer.prototype = new Stream();
// forward compatibility
module.exports = Transmuxer;
},{"../codecs/adts.js":38,"../codecs/h264":39,"../m2ts/m2ts.js":44,"../utils/stream.js":51,"./flv-tag.js":40}],43:[function(require,module,exports){
/**
* mux.js
*
* Copyright (c) 2015 Brightcove
* All rights reserved.
*
* Reads in-band caption information from a video elementary
* stream. Captions must follow the CEA-708 standard for injection
* into an MPEG-2 transport streams.
* @see https://en.wikipedia.org/wiki/CEA-708
*/
'use strict';
// -----------------
// Link To Transport
// -----------------
// Supplemental enhancement information (SEI) NAL units have a
// payload type field to indicate how they are to be
// interpreted. CEAS-708 caption content is always transmitted with
// payload type 0x04.
var USER_DATA_REGISTERED_ITU_T_T35 = 4,
RBSP_TRAILING_BITS = 128,
Stream = require('../utils/stream');
/**
* Parse a supplemental enhancement information (SEI) NAL unit.
* Stops parsing once a message of type ITU T T35 has been found.
*
* @param bytes {Uint8Array} the bytes of a SEI NAL unit
* @return {object} the parsed SEI payload
* @see Rec. ITU-T H.264, 7.3.2.3.1
*/
var parseSei = function(bytes) {
var
i = 0,
result = {
payloadType: -1,
payloadSize: 0,
},
payloadType = 0,
payloadSize = 0;
// go through the sei_rbsp parsing each each individual sei_message
while (i < bytes.byteLength) {
// stop once we have hit the end of the sei_rbsp
if (bytes[i] === RBSP_TRAILING_BITS) {
break;
}
// Parse payload type
while (bytes[i] === 0xFF) {
payloadType += 255;
i++;
}
payloadType += bytes[i++];
// Parse payload size
while (bytes[i] === 0xFF) {
payloadSize += 255;
i++;
}
payloadSize += bytes[i++];
// this sei_message is a 608/708 caption so save it and break
// there can only ever be one caption message in a frame's sei
if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {
result.payloadType = payloadType;
result.payloadSize = payloadSize;
result.payload = bytes.subarray(i, i + payloadSize);
break;
}
// skip the payload and parse the next message
i += payloadSize;
payloadType = 0;
payloadSize = 0;
}
return result;
};
// see ANSI/SCTE 128-1 (2013), section 8.1
var parseUserData = function(sei) {
// itu_t_t35_contry_code must be 181 (United States) for
// captions
if (sei.payload[0] !== 181) {
return null;
}
// itu_t_t35_provider_code should be 49 (ATSC) for captions
if (((sei.payload[1] << 8) | sei.payload[2]) !== 49) {
return null;
}
// the user_identifier should be "GA94" to indicate ATSC1 data
if (String.fromCharCode(sei.payload[3],
sei.payload[4],
sei.payload[5],
sei.payload[6]) !== 'GA94') {
return null;
}
// finally, user_data_type_code should be 0x03 for caption data
if (sei.payload[7] !== 0x03) {
return null;
}
// return the user_data_type_structure and strip the trailing
// marker bits
return sei.payload.subarray(8, sei.payload.length - 1);
};
// see CEA-708-D, section 4.4
var parseCaptionPackets = function(pts, userData) {
var results = [], i, count, offset, data;
// if this is just filler, return immediately
if (!(userData[0] & 0x40)) {
return results;
}
// parse out the cc_data_1 and cc_data_2 fields
count = userData[0] & 0x1f;
for (i = 0; i < count; i++) {
offset = i * 3;
data = {
type: userData[offset + 2] & 0x03,
pts: pts
};
// capture cc data when cc_valid is 1
if (userData[offset + 2] & 0x04) {
data.ccData = (userData[offset + 3] << 8) | userData[offset + 4];
results.push(data);
}
}
return results;
};
var CaptionStream = function() {
var self = this;
CaptionStream.prototype.init.call(this);
this.captionPackets_ = [];
this.field1_ = new Cea608Stream();
// forward data and done events from field1_ to this CaptionStream
this.field1_.on('data', this.trigger.bind(this, 'data'));
this.field1_.on('done', this.trigger.bind(this, 'done'));
};
CaptionStream.prototype = new Stream();
CaptionStream.prototype.push = function(event) {
var sei, userData, captionPackets;
// only examine SEI NALs
if (event.nalUnitType !== 'sei_rbsp') {
return;
}
// parse the sei
sei = parseSei(event.escapedRBSP);
// ignore everything but user_data_registered_itu_t_t35
if (sei.payloadType !== USER_DATA_REGISTERED_ITU_T_T35) {
return;
}
// parse out the user data payload
userData = parseUserData(sei);
// ignore unrecognized userData
if (!userData) {
return;
}
// parse out CC data packets and save them for later
this.captionPackets_ = this.captionPackets_.concat(parseCaptionPackets(event.pts, userData));
};
CaptionStream.prototype.flush = function () {
// make sure we actually parsed captions before proceeding
if (!this.captionPackets_.length) {
this.field1_.flush();
return;
}
// sort caption byte-pairs based on their PTS values
this.captionPackets_.sort(function(a, b) {
return a.pts - b.pts;
});
// Push each caption into Cea608Stream
this.captionPackets_.forEach(this.field1_.push, this.field1_);
this.captionPackets_.length = 0;
this.field1_.flush();
return;
};
// ----------------------
// Session to Application
// ----------------------
var BASIC_CHARACTER_TRANSLATION = {
0x2a: 0xe1,
0x5c: 0xe9,
0x5e: 0xed,
0x5f: 0xf3,
0x60: 0xfa,
0x7b: 0xe7,
0x7c: 0xf7,
0x7d: 0xd1,
0x7e: 0xf1,
0x7f: 0x2588
};
var getCharFromCode = function(code) {
if(code === null) {
return '';
}
code = BASIC_CHARACTER_TRANSLATION[code] || code;
return String.fromCharCode(code);
};
// Constants for the byte codes recognized by Cea608Stream. This
// list is not exhaustive. For a more comprehensive listing and
// semantics see
// http://www.gpo.gov/fdsys/pkg/CFR-2010-title47-vol1/pdf/CFR-2010-title47-vol1-sec15-119.pdf
var PADDING = 0x0000,
// Pop-on Mode
RESUME_CAPTION_LOADING = 0x1420,
END_OF_CAPTION = 0x142f,
// Roll-up Mode
ROLL_UP_2_ROWS = 0x1425,
ROLL_UP_3_ROWS = 0x1426,
ROLL_UP_4_ROWS = 0x1427,
RESUME_DIRECT_CAPTIONING = 0x1429,
CARRIAGE_RETURN = 0x142d,
// Erasure
BACKSPACE = 0x1421,
ERASE_DISPLAYED_MEMORY = 0x142c,
ERASE_NON_DISPLAYED_MEMORY = 0x142e;
// the index of the last row in a CEA-608 display buffer
var BOTTOM_ROW = 14;
// CEA-608 captions are rendered onto a 34x15 matrix of character
// cells. The "bottom" row is the last element in the outer array.
var createDisplayBuffer = function() {
var result = [], i = BOTTOM_ROW + 1;
while (i--) {
result.push('');
}
return result;
};
var Cea608Stream = function() {
Cea608Stream.prototype.init.call(this);
this.mode_ = 'popOn';
// When in roll-up mode, the index of the last row that will
// actually display captions. If a caption is shifted to a row
// with a lower index than this, it is cleared from the display
// buffer
this.topRow_ = 0;
this.startPts_ = 0;
this.displayed_ = createDisplayBuffer();
this.nonDisplayed_ = createDisplayBuffer();
this.lastControlCode_ = null;
this.push = function(packet) {
// Ignore other channels
if (packet.type !== 0) {
return;
}
var data, swap, char0, char1;
// remove the parity bits
data = packet.ccData & 0x7f7f;
// ignore duplicate control codes
if (data === this.lastControlCode_) {
this.lastControlCode_ = null;
return;
}
// Store control codes
if ((data & 0xf000) === 0x1000) {
this.lastControlCode_ = data;
} else {
this.lastControlCode_ = null;
}
switch (data) {
case PADDING:
break;
case RESUME_CAPTION_LOADING:
this.mode_ = 'popOn';
break;
case END_OF_CAPTION:
// if a caption was being displayed, it's gone now
this.flushDisplayed(packet.pts);
// flip memory
swap = this.displayed_;
this.displayed_ = this.nonDisplayed_;
this.nonDisplayed_ = swap;
// start measuring the time to display the caption
this.startPts_ = packet.pts;
break;
case ROLL_UP_2_ROWS:
this.topRow_ = BOTTOM_ROW - 1;
this.mode_ = 'rollUp';
break;
case ROLL_UP_3_ROWS:
this.topRow_ = BOTTOM_ROW - 2;
this.mode_ = 'rollUp';
break;
case ROLL_UP_4_ROWS:
this.topRow_ = BOTTOM_ROW - 3;
this.mode_ = 'rollUp';
break;
case CARRIAGE_RETURN:
this.flushDisplayed(packet.pts);
this.shiftRowsUp_();
this.startPts_ = packet.pts;
break;
case BACKSPACE:
if (this.mode_ === 'popOn') {
this.nonDisplayed_[BOTTOM_ROW] = this.nonDisplayed_[BOTTOM_ROW].slice(0, -1);
} else {
this.displayed_[BOTTOM_ROW] = this.displayed_[BOTTOM_ROW].slice(0, -1);
}
break;
case ERASE_DISPLAYED_MEMORY:
this.flushDisplayed(packet.pts);
this.displayed_ = createDisplayBuffer();
break;
case ERASE_NON_DISPLAYED_MEMORY:
this.nonDisplayed_ = createDisplayBuffer();
break;
default:
char0 = data >>> 8;
char1 = data & 0xff;
// Look for a Channel 1 Preamble Address Code
if (char0 >= 0x10 && char0 <= 0x17 &&
char1 >= 0x40 && char1 <= 0x7F &&
(char0 !== 0x10 || char1 < 0x60)) {
// Follow Safari's lead and replace the PAC with a space
char0 = 0x20;
// we only want one space so make the second character null
// which will get become '' in getCharFromCode
char1 = null;
}
// Look for special character sets
if ((char0 === 0x11 || char0 === 0x19) &&
(char1 >= 0x30 && char1 <= 0x3F)) {
// Put in eigth note and space
char0 = 0x266A;
char1 = '';
}
// ignore unsupported control codes
if ((char0 & 0xf0) === 0x10) {
return;
}
// character handling is dependent on the current mode
this[this.mode_](packet.pts, char0, char1);
break;
}
};
};
Cea608Stream.prototype = new Stream();
// Trigger a cue point that captures the current state of the
// display buffer
Cea608Stream.prototype.flushDisplayed = function(pts) {
var content = this.displayed_
// remove spaces from the start and end of the string
.map(function(row) { return row.trim(); })
// remove empty rows
.filter(function(row) { return row.length; })
// combine all text rows to display in one cue
.join('\n');
if (content.length) {
this.trigger('data', {
startPts: this.startPts_,
endPts: pts,
text: content
});
}
};
// Mode Implementations
Cea608Stream.prototype.popOn = function(pts, char0, char1) {
var baseRow = this.nonDisplayed_[BOTTOM_ROW];
// buffer characters
baseRow += getCharFromCode(char0);
baseRow += getCharFromCode(char1);
this.nonDisplayed_[BOTTOM_ROW] = baseRow;
};
Cea608Stream.prototype.rollUp = function(pts, char0, char1) {
var baseRow = this.displayed_[BOTTOM_ROW];
if (baseRow === '') {
// we're starting to buffer new display input, so flush out the
// current display
this.flushDisplayed(pts);
this.startPts_ = pts;
}
baseRow += getCharFromCode(char0);
baseRow += getCharFromCode(char1);
this.displayed_[BOTTOM_ROW] = baseRow;
};
Cea608Stream.prototype.shiftRowsUp_ = function() {
var i;
// clear out inactive rows
for (i = 0; i < this.topRow_; i++) {
this.displayed_[i] = '';
}
// shift displayed rows up
for (i = this.topRow_; i < BOTTOM_ROW; i++) {
this.displayed_[i] = this.displayed_[i + 1];
}
// clear out the bottom row
this.displayed_[BOTTOM_ROW] = '';
};
// exports
module.exports = {
CaptionStream: CaptionStream,
Cea608Stream: Cea608Stream,
};
},{"../utils/stream":51}],44:[function(require,module,exports){
/**
* mux.js
*
* Copyright (c) 2015 Brightcove
* All rights reserved.
*
* A stream-based mp2t to mp4 converter. This utility can be used to
* deliver mp4s to a SourceBuffer on platforms that support native
* Media Source Extensions.
*/
'use strict';
var Stream = require('../utils/stream.js'),
CaptionStream = require('./caption-stream'),
StreamTypes = require('./stream-types');
var Stream = require('../utils/stream.js');
var m2tsStreamTypes = require('./stream-types.js');
// object types
var
TransportPacketStream, TransportParseStream, ElementaryStream,
AacStream, H264Stream, NalByteStream;
// constants
var
MP2T_PACKET_LENGTH = 188, // bytes
SYNC_BYTE = 0x47,
/**
* Splits an incoming stream of binary data into MPEG-2 Transport
* Stream packets.
*/
TransportPacketStream = function() {
var
buffer = new Uint8Array(MP2T_PACKET_LENGTH),
bytesInBuffer = 0;
TransportPacketStream.prototype.init.call(this);
// Deliver new bytes to the stream.
this.push = function(bytes) {
var
i = 0,
startIndex = 0,
endIndex = MP2T_PACKET_LENGTH,
everything;
// If there are bytes remaining from the last segment, prepend them to the
// bytes that were pushed in
if (bytesInBuffer) {
everything = new Uint8Array(bytes.byteLength + bytesInBuffer);
everything.set(buffer.subarray(0, bytesInBuffer));
everything.set(bytes, bytesInBuffer);
bytesInBuffer = 0;
} else {
everything = bytes;
}
// While we have enough data for a packet
while (endIndex < everything.byteLength) {
// Look for a pair of start and end sync bytes in the data..
if (everything[startIndex] === SYNC_BYTE && everything[endIndex] === SYNC_BYTE) {
// We found a packet so emit it and jump one whole packet forward in
// the stream
this.trigger('data', everything.subarray(startIndex, endIndex));
startIndex += MP2T_PACKET_LENGTH;
endIndex += MP2T_PACKET_LENGTH;
continue;
}
// If we get here, we have somehow become de-synchronized and we need to step
// forward one byte at a time until we find a pair of sync bytes that denote
// a packet
startIndex++;
endIndex++;
}
// If there was some data left over at the end of the segment that couldn't
// possibly be a whole packet, keep it because it might be the start of a packet
// that continues in the next segment
if (startIndex < everything.byteLength) {
buffer.set(everything.subarray(startIndex), 0);
bytesInBuffer = everything.byteLength - startIndex;
}
};
this.flush = function () {
// If the buffer contains a whole packet when we are being flushed, emit it
// and empty the buffer. Otherwise hold onto the data because it may be
// important for decoding the next segment
if (bytesInBuffer === MP2T_PACKET_LENGTH && buffer[0] === SYNC_BYTE) {
this.trigger('data', buffer);
bytesInBuffer = 0;
}
this.trigger('done');
};
};
TransportPacketStream.prototype = new Stream();
/**
* Accepts an MP2T TransportPacketStream and emits data events with parsed
* forms of the individual transport stream packets.
*/
TransportParseStream = function() {
var parsePsi, parsePat, parsePmt, parsePes, self;
TransportParseStream.prototype.init.call(this);
self = this;
this.packetsWaitingForPmt = [];
this.programMapTable = undefined;
parsePsi = function(payload, psi) {
var offset = 0;
// PSI packets may be split into multiple sections and those
// sections may be split into multiple packets. If a PSI
// section starts in this packet, the payload_unit_start_indicator
// will be true and the first byte of the payload will indicate
// the offset from the current position to the start of the
// section.
if (psi.payloadUnitStartIndicator) {
offset += payload[offset] + 1;
}
if (psi.type === 'pat') {
parsePat(payload.subarray(offset), psi);
} else {
parsePmt(payload.subarray(offset), psi);
}
};
parsePat = function(payload, pat) {
pat.section_number = payload[7];
pat.last_section_number = payload[8];
// skip the PSI header and parse the first PMT entry
self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];
pat.pmtPid = self.pmtPid;
};
/**
* Parse out the relevant fields of a Program Map Table (PMT).
* @param payload {Uint8Array} the PMT-specific portion of an MP2T
* packet. The first byte in this array should be the table_id
* field.
* @param pmt {object} the object that should be decorated with
* fields parsed from the PMT.
*/
parsePmt = function(payload, pmt) {
var sectionLength, tableEnd, programInfoLength, offset;
// PMTs can be sent ahead of the time when they should actually
// take effect. We don't believe this should ever be the case
// for HLS but we'll ignore "forward" PMT declarations if we see
// them. Future PMT declarations have the current_next_indicator
// set to zero.
if (!(payload[5] & 0x01)) {
return;
}
// overwrite any existing program map table
self.programMapTable = {};
// the mapping table ends at the end of the current section
sectionLength = (payload[1] & 0x0f) << 8 | payload[2];
tableEnd = 3 + sectionLength - 4;
// to determine where the table is, we have to figure out how
// long the program info descriptors are
programInfoLength = (payload[10] & 0x0f) << 8 | payload[11];
// advance the offset to the first entry in the mapping table
offset = 12 + programInfoLength;
while (offset < tableEnd) {
// add an entry that maps the elementary_pid to the stream_type
self.programMapTable[(payload[offset + 1] & 0x1F) << 8 | payload[offset + 2]] = payload[offset];
// move to the next table entry
// skip past the elementary stream descriptors, if present
offset += ((payload[offset + 3] & 0x0F) << 8 | payload[offset + 4]) + 5;
}
// record the map on the packet as well
pmt.programMapTable = self.programMapTable;
// if there are any packets waiting for a PMT to be found, process them now
while (self.packetsWaitingForPmt.length) {
self.processPes_.apply(self, self.packetsWaitingForPmt.shift());
}
};
/**
* Deliver a new MP2T packet to the stream.
*/
this.push = function(packet) {
var
result = {},
offset = 4;
result.payloadUnitStartIndicator = !!(packet[1] & 0x40);
// pid is a 13-bit field starting at the last bit of packet[1]
result.pid = packet[1] & 0x1f;
result.pid <<= 8;
result.pid |= packet[2];
// if an adaption field is present, its length is specified by the
// fifth byte of the TS packet header. The adaptation field is
// used to add stuffing to PES packets that don't fill a complete
// TS packet, and to specify some forms of timing and control data
// that we do not currently use.
if (((packet[3] & 0x30) >>> 4) > 0x01) {
offset += packet[offset] + 1;
}
// parse the rest of the packet based on the type
if (result.pid === 0) {
result.type = 'pat';
parsePsi(packet.subarray(offset), result);
this.trigger('data', result);
} else if (result.pid === this.pmtPid) {
result.type = 'pmt';
parsePsi(packet.subarray(offset), result);
this.trigger('data', result);
} else if (this.programMapTable === undefined) {
// When we have not seen a PMT yet, defer further processing of
// PES packets until one has been parsed
this.packetsWaitingForPmt.push([packet, offset, result]);
} else {
this.processPes_(packet, offset, result);
}
};
this.processPes_ = function (packet, offset, result) {
result.streamType = this.programMapTable[result.pid];
result.type = 'pes';
result.data = packet.subarray(offset);
this.trigger('data', result);
};
};
TransportParseStream.prototype = new Stream();
TransportParseStream.STREAM_TYPES = {
h264: 0x1b,
adts: 0x0f
};
/**
* Reconsistutes program elementary stream (PES) packets from parsed
* transport stream packets. That is, if you pipe an
* mp2t.TransportParseStream into a mp2t.ElementaryStream, the output
* events will be events which capture the bytes for individual PES
* packets plus relevant metadata that has been extracted from the
* container.
*/
ElementaryStream = function() {
var
// PES packet fragments
video = {
data: [],
size: 0
},
audio = {
data: [],
size: 0
},
timedMetadata = {
data: [],
size: 0
},
parsePes = function(payload, pes) {
var ptsDtsFlags;
// find out if this packets starts a new keyframe
pes.dataAlignmentIndicator = (payload[6] & 0x04) !== 0;
// PES packets may be annotated with a PTS value, or a PTS value
// and a DTS value. Determine what combination of values is
// available to work with.
ptsDtsFlags = payload[7];
// PTS and DTS are normally stored as a 33-bit number. Javascript
// performs all bitwise operations on 32-bit integers but javascript
// supports a much greater range (52-bits) of integer using standard
// mathematical operations.
// We construct a 31-bit value using bitwise operators over the 31
// most significant bits and then multiply by 4 (equal to a left-shift
// of 2) before we add the final 2 least significant bits of the
// timestamp (equal to an OR.)
if (ptsDtsFlags & 0xC0) {
// the PTS and DTS are not written out directly. For information
// on how they are encoded, see
// http://dvd.sourceforge.net/dvdinfo/pes-hdr.html
pes.pts = (payload[9] & 0x0E) << 27
| (payload[10] & 0xFF) << 20
| (payload[11] & 0xFE) << 12
| (payload[12] & 0xFF) << 5
| (payload[13] & 0xFE) >>> 3;
pes.pts *= 4; // Left shift by 2
pes.pts += (payload[13] & 0x06) >>> 1; // OR by the two LSBs
pes.dts = pes.pts;
if (ptsDtsFlags & 0x40) {
pes.dts = (payload[14] & 0x0E ) << 27
| (payload[15] & 0xFF ) << 20
| (payload[16] & 0xFE ) << 12
| (payload[17] & 0xFF ) << 5
| (payload[18] & 0xFE ) >>> 3;
pes.dts *= 4; // Left shift by 2
pes.dts += (payload[18] & 0x06) >>> 1; // OR by the two LSBs
}
}
// the data section starts immediately after the PES header.
// pes_header_data_length specifies the number of header bytes
// that follow the last byte of the field.
pes.data = payload.subarray(9 + payload[8]);
},
flushStream = function(stream, type) {
var
packetData = new Uint8Array(stream.size),
event = {
type: type
},
i = 0,
fragment;
// do nothing if there is no buffered data
if (!stream.data.length) {
return;
}
event.trackId = stream.data[0].pid;
// reassemble the packet
while (stream.data.length) {
fragment = stream.data.shift();
packetData.set(fragment.data, i);
i += fragment.data.byteLength;
}
// parse assembled packet's PES header
parsePes(packetData, event);
stream.size = 0;
self.trigger('data', event);
},
self;
ElementaryStream.prototype.init.call(this);
self = this;
this.push = function(data) {
({
pat: function() {
// we have to wait for the PMT to arrive as well before we
// have any meaningful metadata
},
pes: function() {
var stream, streamType;
switch (data.streamType) {
case StreamTypes.H264_STREAM_TYPE:
case m2tsStreamTypes.H264_STREAM_TYPE:
stream = video;
streamType = 'video';
break;
case StreamTypes.ADTS_STREAM_TYPE:
stream = audio;
streamType = 'audio';
break;
case StreamTypes.METADATA_STREAM_TYPE:
stream = timedMetadata;
streamType = 'timed-metadata';
break;
default:
// ignore unknown stream types
return;
}
// if a new packet is starting, we can flush the completed
// packet
if (data.payloadUnitStartIndicator) {
flushStream(stream, streamType);
}
// buffer this fragment until we are sure we've received the
// complete payload
stream.data.push(data);
stream.size += data.data.byteLength;
},
pmt: function() {
var
event = {
type: 'metadata',
tracks: []
},
programMapTable = data.programMapTable,
k,
track;
// translate streams to tracks
for (k in programMapTable) {
if (programMapTable.hasOwnProperty(k)) {
track = {
timelineStartInfo: {
baseMediaDecodeTime: 0
}
};
track.id = +k;
if (programMapTable[k] === m2tsStreamTypes.H264_STREAM_TYPE) {
track.codec = 'avc';
track.type = 'video';
} else if (programMapTable[k] === m2tsStreamTypes.ADTS_STREAM_TYPE) {
track.codec = 'adts';
track.type = 'audio';
}
event.tracks.push(track);
}
}
self.trigger('data', event);
}
})[data.type]();
};
/**
* Flush any remaining input. Video PES packets may be of variable
* length. Normally, the start of a new video packet can trigger the
* finalization of the previous packet. That is not possible if no
* more video is forthcoming, however. In that case, some other
* mechanism (like the end of the file) has to be employed. When it is
* clear that no additional data is forthcoming, calling this method
* will flush the buffered packets.
*/
this.flush = function() {
// !!THIS ORDER IS IMPORTANT!!
// video first then audio
flushStream(video, 'video');
flushStream(audio, 'audio');
flushStream(timedMetadata, 'timed-metadata');
this.trigger('done');
};
};
ElementaryStream.prototype = new Stream();
var m2ts = {
PAT_PID: 0x0000,
MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH,
TransportPacketStream: TransportPacketStream,
TransportParseStream: TransportParseStream,
ElementaryStream: ElementaryStream,
CaptionStream: CaptionStream.CaptionStream,
Cea608Stream: CaptionStream.Cea608Stream,
MetadataStream: require('./metadata-stream'),
};
for (var type in StreamTypes) {
if (StreamTypes.hasOwnProperty(type)) {
m2ts[type] = StreamTypes[type];
}
}
module.exports = m2ts;
},{"../utils/stream.js":51,"./caption-stream":43,"./metadata-stream":45,"./stream-types":46,"./stream-types.js":46}],45:[function(require,module,exports){
/**
* Accepts program elementary stream (PES) data events and parses out
* ID3 metadata from them, if present.
* @see http://id3.org/id3v2.3.0
*/
'use strict';
var
Stream = require('../utils/stream'),
StreamTypes = require('./stream-types'),
// return a percent-encoded representation of the specified byte range
// @see http://en.wikipedia.org/wiki/Percent-encoding
percentEncode = function(bytes, start, end) {
var i, result = '';
for (i = start; i < end; i++) {
result += '%' + ('00' + bytes[i].toString(16)).slice(-2);
}
return result;
},
// return the string representation of the specified byte range,
// interpreted as UTf-8.
parseUtf8 = function(bytes, start, end) {
return decodeURIComponent(percentEncode(bytes, start, end));
},
// return the string representation of the specified byte range,
// interpreted as ISO-8859-1.
parseIso88591 = function(bytes, start, end) {
return unescape(percentEncode(bytes, start, end)); // jshint ignore:line
},
parseSyncSafeInteger = function (data) {
return (data[0] << 21) |
(data[1] << 14) |
(data[2] << 7) |
(data[3]);
},
tagParsers = {
'TXXX': function(tag) {
var i;
if (tag.data[0] !== 3) {
// ignore frames with unrecognized character encodings
return;
}
for (i = 1; i < tag.data.length; i++) {
if (tag.data[i] === 0) {
// parse the text fields
tag.description = parseUtf8(tag.data, 1, i);
// do not include the null terminator in the tag value
tag.value = parseUtf8(tag.data, i + 1, tag.data.length - 1);
break;
}
}
tag.data = tag.value;
},
'WXXX': function(tag) {
var i;
if (tag.data[0] !== 3) {
// ignore frames with unrecognized character encodings
return;
}
for (i = 1; i < tag.data.length; i++) {
if (tag.data[i] === 0) {
// parse the description and URL fields
tag.description = parseUtf8(tag.data, 1, i);
tag.url = parseUtf8(tag.data, i + 1, tag.data.length);
break;
}
}
},
'PRIV': function(tag) {
var i;
for (i = 0; i < tag.data.length; i++) {
if (tag.data[i] === 0) {
// parse the description and URL fields
tag.owner = parseIso88591(tag.data, 0, i);
break;
}
}
tag.privateData = tag.data.subarray(i + 1);
tag.data = tag.privateData;
}
},
MetadataStream;
MetadataStream = function(options) {
var
settings = {
debug: !!(options && options.debug),
// the bytes of the program-level descriptor field in MP2T
// see ISO/IEC 13818-1:2013 (E), section 2.6 "Program and
// program element descriptors"
descriptor: options && options.descriptor
},
// the total size in bytes of the ID3 tag being parsed
tagSize = 0,
// tag data that is not complete enough to be parsed
buffer = [],
// the total number of bytes currently in the buffer
bufferSize = 0,
i;
MetadataStream.prototype.init.call(this);
// calculate the text track in-band metadata track dispatch type
// https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track
this.dispatchType = StreamTypes.METADATA_STREAM_TYPE.toString(16);
if (settings.descriptor) {
for (i = 0; i < settings.descriptor.length; i++) {
this.dispatchType += ('00' + settings.descriptor[i].toString(16)).slice(-2);
}
}
this.push = function(chunk) {
var tag, frameStart, frameSize, frame, i, frameHeader;
if (chunk.type !== 'timed-metadata') {
return;
}
// if data_alignment_indicator is set in the PES header,
// we must have the start of a new ID3 tag. Assume anything
// remaining in the buffer was malformed and throw it out
if (chunk.dataAlignmentIndicator) {
bufferSize = 0;
buffer.length = 0;
}
// ignore events that don't look like ID3 data
if (buffer.length === 0 &&
(chunk.data.length < 10 ||
chunk.data[0] !== 'I'.charCodeAt(0) ||
chunk.data[1] !== 'D'.charCodeAt(0) ||
chunk.data[2] !== '3'.charCodeAt(0))) {
if (settings.debug) {
console.log('Skipping unrecognized metadata packet');
}
return;
}
// add this chunk to the data we've collected so far
buffer.push(chunk);
bufferSize += chunk.data.byteLength;
// grab the size of the entire frame from the ID3 header
if (buffer.length === 1) {
// the frame size is transmitted as a 28-bit integer in the
// last four bytes of the ID3 header.
// The most significant bit of each byte is dropped and the
// results concatenated to recover the actual value.
tagSize = parseSyncSafeInteger(chunk.data.subarray(6, 10));
// ID3 reports the tag size excluding the header but it's more
// convenient for our comparisons to include it
tagSize += 10;
}
// if the entire frame has not arrived, wait for more data
if (bufferSize < tagSize) {
return;
}
// collect the entire frame so it can be parsed
tag = {
data: new Uint8Array(tagSize),
frames: [],
pts: buffer[0].pts,
dts: buffer[0].dts
};
for (i = 0; i < tagSize;) {
tag.data.set(buffer[0].data.subarray(0, tagSize - i), i);
i += buffer[0].data.byteLength;
bufferSize -= buffer[0].data.byteLength;
buffer.shift();
}
// find the start of the first frame and the end of the tag
frameStart = 10;
if (tag.data[5] & 0x40) {
// advance the frame start past the extended header
frameStart += 4; // header size field
frameStart += parseSyncSafeInteger(tag.data.subarray(10, 14));
// clip any padding off the end
tagSize -= parseSyncSafeInteger(tag.data.subarray(16, 20));
}
// parse one or more ID3 frames
// http://id3.org/id3v2.3.0#ID3v2_frame_overview
do {
// determine the number of bytes in this frame
frameSize = parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));
if (frameSize < 1) {
return console.log('Malformed ID3 frame encountered. Skipping metadata parsing.');
}
frameHeader = String.fromCharCode(tag.data[frameStart],
tag.data[frameStart + 1],
tag.data[frameStart + 2],
tag.data[frameStart + 3]);
frame = {
id: frameHeader,
data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)
};
frame.key = frame.id;
if (tagParsers[frame.id]) {
tagParsers[frame.id](frame);
if (frame.owner === 'com.apple.streaming.transportStreamTimestamp') {
var
d = frame.data,
size = ((d[3] & 0x01) << 30) |
(d[4] << 22) |
(d[5] << 14) |
(d[6] << 6) |
(d[7] >>> 2);
size *= 4;
size += d[7] & 0x03;
frame.timeStamp = size;
this.trigger('timestamp', frame);
}
}
tag.frames.push(frame);
frameStart += 10; // advance past the frame header
frameStart += frameSize; // advance past the frame body
} while (frameStart < tagSize);
this.trigger('data', tag);
};
};
MetadataStream.prototype = new Stream();
module.exports = MetadataStream;
},{"../utils/stream":51,"./stream-types":46}],46:[function(require,module,exports){
'use strict';
module.exports = {
H264_STREAM_TYPE: 0x1B,
ADTS_STREAM_TYPE: 0x0F,
METADATA_STREAM_TYPE: 0x15
};
},{}],47:[function(require,module,exports){
module.exports = {
generator: require('./mp4-generator'),
Transmuxer: require('./transmuxer').Transmuxer,
AudioSegmentStream: require('./transmuxer').AudioSegmentStream,
VideoSegmentStream: require('./transmuxer').VideoSegmentStream
};
},{"./mp4-generator":48,"./transmuxer":49}],48:[function(require,module,exports){
/**
* mux.js
*
* Copyright (c) 2015 Brightcove
* All rights reserved.
*
* Functions that generate fragmented MP4s suitable for use with Media
* Source Extensions.
*/
'use strict';
var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak,
tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, styp, traf, trex, trun,
types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR,
AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;
// pre-calculate constants
(function() {
var i;
types = {
avc1: [], // codingname
avcC: [],
btrt: [],
dinf: [],
dref: [],
esds: [],
ftyp: [],
hdlr: [],
mdat: [],
mdhd: [],
mdia: [],
mfhd: [],
minf: [],
moof: [],
moov: [],
mp4a: [], // codingname
mvex: [],
mvhd: [],
sdtp: [],
smhd: [],
stbl: [],
stco: [],
stsc: [],
stsd: [],
stsz: [],
stts: [],
styp: [],
tfdt: [],
tfhd: [],
traf: [],
trak: [],
trun: [],
trex: [],
tkhd: [],
vmhd: []
};
// In environments where Uint8Array is undefined (e.g., IE8), skip set up so that we
// don't throw an error
if (typeof Uint8Array === 'undefined') {
return;
}
for (i in types) {
if (types.hasOwnProperty(i)) {
types[i] = [
i.charCodeAt(0),
i.charCodeAt(1),
i.charCodeAt(2),
i.charCodeAt(3)
];
}
}
MAJOR_BRAND = new Uint8Array([
'i'.charCodeAt(0),
's'.charCodeAt(0),
'o'.charCodeAt(0),
'm'.charCodeAt(0)
]);
AVC1_BRAND = new Uint8Array([
'a'.charCodeAt(0),
'v'.charCodeAt(0),
'c'.charCodeAt(0),
'1'.charCodeAt(0)
]);
MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);
VIDEO_HDLR = new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x00, // pre_defined
0x76, 0x69, 0x64, 0x65, // handler_type: 'vide'
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00, // reserved
0x56, 0x69, 0x64, 0x65,
0x6f, 0x48, 0x61, 0x6e,
0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'VideoHandler'
]);
AUDIO_HDLR = new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x00, // pre_defined
0x73, 0x6f, 0x75, 0x6e, // handler_type: 'soun'
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00, // reserved
0x53, 0x6f, 0x75, 0x6e,
0x64, 0x48, 0x61, 0x6e,
0x64, 0x6c, 0x65, 0x72, 0x00 // name: 'SoundHandler'
]);
HDLR_TYPES = {
"video":VIDEO_HDLR,
"audio": AUDIO_HDLR
};
DREF = new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x01, // entry_count
0x00, 0x00, 0x00, 0x0c, // entry_size
0x75, 0x72, 0x6c, 0x20, // 'url' type
0x00, // version 0
0x00, 0x00, 0x01 // entry_flags
]);
SMHD = new Uint8Array([
0x00, // version
0x00, 0x00, 0x00, // flags
0x00, 0x00, // balance, 0 means centered
0x00, 0x00 // reserved
]);
STCO = new Uint8Array([
0x00, // version
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x00 // entry_count
]);
STSC = STCO;
STSZ = new Uint8Array([
0x00, // version
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x00, // sample_size
0x00, 0x00, 0x00, 0x00, // sample_count
]);
STTS = STCO;
VMHD = new Uint8Array([
0x00, // version
0x00, 0x00, 0x01, // flags
0x00, 0x00, // graphicsmode
0x00, 0x00,
0x00, 0x00,
0x00, 0x00 // opcolor
]);
})();
box = function(type) {
var
payload = [],
size = 0,
i,
result,
view;
for (i = 1; i < arguments.length; i++) {
payload.push(arguments[i]);
}
i = payload.length;
// calculate the total size we need to allocate
while (i--) {
size += payload[i].byteLength;
}
result = new Uint8Array(size + 8);
view = new DataView(result.buffer, result.byteOffset, result.byteLength);
view.setUint32(0, result.byteLength);
result.set(type, 4);
// copy the payload into the result
for (i = 0, size = 8; i < payload.length; i++) {
result.set(payload[i], size);
size += payload[i].byteLength;
}
return result;
};
dinf = function() {
return box(types.dinf, box(types.dref, DREF));
};
esds = function(track) {
return box(types.esds, new Uint8Array([
0x00, // version
0x00, 0x00, 0x00, // flags
// ES_Descriptor
0x03, // tag, ES_DescrTag
0x19, // length
0x00, 0x00, // ES_ID
0x00, // streamDependenceFlag, URL_flag, reserved, streamPriority
// DecoderConfigDescriptor
0x04, // tag, DecoderConfigDescrTag
0x11, // length
0x40, // object type
0x15, // streamType
0x00, 0x06, 0x00, // bufferSizeDB
0x00, 0x00, 0xda, 0xc0, // maxBitrate
0x00, 0x00, 0xda, 0xc0, // avgBitrate
// DecoderSpecificInfo
0x05, // tag, DecoderSpecificInfoTag
0x02, // length
// ISO/IEC 14496-3, AudioSpecificConfig
// for samplingFrequencyIndex see ISO/IEC 13818-7:2006, 8.1.3.2.2, Table 35
(track.audioobjecttype << 3) | (track.samplingfrequencyindex >>> 1),
(track.samplingfrequencyindex << 7) | (track.channelcount << 3),
0x06, 0x01, 0x02 // GASpecificConfig
]));
};
ftyp = function() {
return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);
};
hdlr = function(type) {
return box(types.hdlr, HDLR_TYPES[type]);
};
mdat = function(data) {
return box(types.mdat, data);
};
mdhd = function(track) {
var result = new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x02, // creation_time
0x00, 0x00, 0x00, 0x03, // modification_time
0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 "ticks" per second
(track.duration >>> 24) & 0xFF,
(track.duration >>> 16) & 0xFF,
(track.duration >>> 8) & 0xFF,
track.duration & 0xFF, // duration
0x55, 0xc4, // 'und' language (undetermined)
0x00, 0x00
]);
// Use the sample rate from the track metadata, when it is
// defined. The sample rate can be parsed out of an ADTS header, for
// instance.
if (track.samplerate) {
result[12] = (track.samplerate >>> 24) & 0xFF;
result[13] = (track.samplerate >>> 16) & 0xFF;
result[14] = (track.samplerate >>> 8) & 0xFF;
result[15] = (track.samplerate) & 0xFF;
}
return box(types.mdhd, result);
};
mdia = function(track) {
return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));
};
mfhd = function(sequenceNumber) {
return box(types.mfhd, new Uint8Array([
0x00,
0x00, 0x00, 0x00, // flags
(sequenceNumber & 0xFF000000) >> 24,
(sequenceNumber & 0xFF0000) >> 16,
(sequenceNumber & 0xFF00) >> 8,
sequenceNumber & 0xFF, // sequence_number
]));
};
minf = function(track) {
return box(types.minf,
track.type === 'video' ? box(types.vmhd, VMHD) : box(types.smhd, SMHD),
dinf(),
stbl(track));
};
moof = function(sequenceNumber, tracks) {
var
trackFragments = [],
i = tracks.length;
// build traf boxes for each track fragment
while (i--) {
trackFragments[i] = traf(tracks[i]);
}
return box.apply(null, [
types.moof,
mfhd(sequenceNumber)
].concat(trackFragments));
};
/**
* Returns a movie box.
* @param tracks {array} the tracks associated with this movie
* @see ISO/IEC 14496-12:2012(E), section 8.2.1
*/
moov = function(tracks) {
var
i = tracks.length,
boxes = [];
while (i--) {
boxes[i] = trak(tracks[i]);
}
return box.apply(null, [types.moov, mvhd(0xffffffff)].concat(boxes).concat(mvex(tracks)));
};
mvex = function(tracks) {
var
i = tracks.length,
boxes = [];
while (i--) {
boxes[i] = trex(tracks[i]);
}
return box.apply(null, [types.mvex].concat(boxes));
};
mvhd = function(duration) {
var
bytes = new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x01, // creation_time
0x00, 0x00, 0x00, 0x02, // modification_time
0x00, 0x01, 0x5f, 0x90, // timescale, 90,000 "ticks" per second
(duration & 0xFF000000) >> 24,
(duration & 0xFF0000) >> 16,
(duration & 0xFF00) >> 8,
duration & 0xFF, // duration
0x00, 0x01, 0x00, 0x00, // 1.0 rate
0x01, 0x00, // 1.0 volume
0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, // pre_defined
0xff, 0xff, 0xff, 0xff // next_track_ID
]);
return box(types.mvhd, bytes);
};
sdtp = function(track) {
var
samples = track.samples || [],
bytes = new Uint8Array(4 + samples.length),
flags,
i;
// leave the full box header (4 bytes) all zero
// write the sample table
for (i = 0; i < samples.length; i++) {
flags = samples[i].flags;
bytes[i + 4] = (flags.dependsOn << 4) |
(flags.isDependedOn << 2) |
(flags.hasRedundancy);
}
return box(types.sdtp,
bytes);
};
stbl = function(track) {
return box(types.stbl,
stsd(track),
box(types.stts, STTS),
box(types.stsc, STSC),
box(types.stsz, STSZ),
box(types.stco, STCO));
};
(function() {
var videoSample, audioSample;
stsd = function(track) {
return box(types.stsd, new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
0x00, 0x00, 0x00, 0x01
]), track.type === 'video' ? videoSample(track) : audioSample(track));
};
videoSample = function(track) {
var
sps = track.sps || [],
pps = track.pps || [],
sequenceParameterSets = [],
pictureParameterSets = [],
i;
// assemble the SPSs
for (i = 0; i < sps.length; i++) {
sequenceParameterSets.push((sps[i].byteLength & 0xFF00) >>> 8);
sequenceParameterSets.push((sps[i].byteLength & 0xFF)); // sequenceParameterSetLength
sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); // SPS
}
// assemble the PPSs
for (i = 0; i < pps.length; i++) {
pictureParameterSets.push((pps[i].byteLength & 0xFF00) >>> 8);
pictureParameterSets.push((pps[i].byteLength & 0xFF));
pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i]));
}
return box(types.avc1, new Uint8Array([
0x00, 0x00, 0x00,
0x00, 0x00, 0x00, // reserved
0x00, 0x01, // data_reference_index
0x00, 0x00, // pre_defined
0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, // pre_defined
(track.width & 0xff00) >> 8,
track.width & 0xff, // width
(track.height & 0xff00) >> 8,
track.height & 0xff, // height
0x00, 0x48, 0x00, 0x00, // horizresolution
0x00, 0x48, 0x00, 0x00, // vertresolution
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x01, // frame_count
0x13,
0x76, 0x69, 0x64, 0x65,
0x6f, 0x6a, 0x73, 0x2d,
0x63, 0x6f, 0x6e, 0x74,
0x72, 0x69, 0x62, 0x2d,
0x68, 0x6c, 0x73, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, // compressorname
0x00, 0x18, // depth = 24
0x11, 0x11 // pre_defined = -1
]), box(types.avcC, new Uint8Array([
0x01, // configurationVersion
track.profileIdc, // AVCProfileIndication
track.profileCompatibility, // profile_compatibility
track.levelIdc, // AVCLevelIndication
0xff // lengthSizeMinusOne, hard-coded to 4 bytes
].concat([
sps.length // numOfSequenceParameterSets
]).concat(sequenceParameterSets).concat([
pps.length // numOfPictureParameterSets
]).concat(pictureParameterSets))), // "PPS"
box(types.btrt, new Uint8Array([
0x00, 0x1c, 0x9c, 0x80, // bufferSizeDB
0x00, 0x2d, 0xc6, 0xc0, // maxBitrate
0x00, 0x2d, 0xc6, 0xc0
])) // avgBitrate
);
};
audioSample = function(track) {
return box(types.mp4a, new Uint8Array([
// SampleEntry, ISO/IEC 14496-12
0x00, 0x00, 0x00,
0x00, 0x00, 0x00, // reserved
0x00, 0x01, // data_reference_index
// AudioSampleEntry, ISO/IEC 14496-12
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x00, 0x00, 0x00, // reserved
(track.channelcount & 0xff00) >> 8,
(track.channelcount & 0xff), // channelcount
(track.samplesize & 0xff00) >> 8,
(track.samplesize & 0xff), // samplesize
0x00, 0x00, // pre_defined
0x00, 0x00, // reserved
(track.samplerate & 0xff00) >> 8,
(track.samplerate & 0xff),
0x00, 0x00 // samplerate, 16.16
// MP4AudioSampleEntry, ISO/IEC 14496-14
]), esds(track));
};
})();
styp = function() {
return box(types.styp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND);
};
tkhd = function(track) {
var result = new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x07, // flags
0x00, 0x00, 0x00, 0x00, // creation_time
0x00, 0x00, 0x00, 0x00, // modification_time
(track.id & 0xFF000000) >> 24,
(track.id & 0xFF0000) >> 16,
(track.id & 0xFF00) >> 8,
track.id & 0xFF, // track_ID
0x00, 0x00, 0x00, 0x00, // reserved
(track.duration & 0xFF000000) >> 24,
(track.duration & 0xFF0000) >> 16,
(track.duration & 0xFF00) >> 8,
track.duration & 0xFF, // duration
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, // reserved
0x00, 0x00, // layer
0x00, 0x00, // alternate_group
0x01, 0x00, // non-audio track volume
0x00, 0x00, // reserved
0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, // transformation: unity matrix
(track.width & 0xFF00) >> 8,
track.width & 0xFF,
0x00, 0x00, // width
(track.height & 0xFF00) >> 8,
track.height & 0xFF,
0x00, 0x00 // height
]);
return box(types.tkhd, result);
};
/**
* Generate a track fragment (traf) box. A traf box collects metadata
* about tracks in a movie fragment (moof) box.
*/
traf = function(track) {
var trackFragmentHeader, trackFragmentDecodeTime,
trackFragmentRun, sampleDependencyTable, dataOffset;
trackFragmentHeader = box(types.tfhd, new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x3a, // flags
(track.id & 0xFF000000) >> 24,
(track.id & 0xFF0000) >> 16,
(track.id & 0xFF00) >> 8,
(track.id & 0xFF), // track_ID
0x00, 0x00, 0x00, 0x01, // sample_description_index
0x00, 0x00, 0x00, 0x00, // default_sample_duration
0x00, 0x00, 0x00, 0x00, // default_sample_size
0x00, 0x00, 0x00, 0x00 // default_sample_flags
]));
trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
// baseMediaDecodeTime
(track.baseMediaDecodeTime >>> 24) & 0xFF,
(track.baseMediaDecodeTime >>> 16) & 0xFF,
(track.baseMediaDecodeTime >>> 8) & 0xFF,
track.baseMediaDecodeTime & 0xFF
]));
// the data offset specifies the number of bytes from the start of
// the containing moof to the first payload byte of the associated
// mdat
dataOffset = (32 + // tfhd
16 + // tfdt
8 + // traf header
16 + // mfhd
8 + // moof header
8); // mdat header
// audio tracks require less metadata
if (track.type === 'audio') {
trackFragmentRun = trun(track, dataOffset);
return box(types.traf,
trackFragmentHeader,
trackFragmentDecodeTime,
trackFragmentRun);
}
// video tracks should contain an independent and disposable samples
// box (sdtp)
// generate one and adjust offsets to match
sampleDependencyTable = sdtp(track);
trackFragmentRun = trun(track,
sampleDependencyTable.length + dataOffset);
return box(types.traf,
trackFragmentHeader,
trackFragmentDecodeTime,
trackFragmentRun,
sampleDependencyTable);
};
/**
* Generate a track box.
* @param track {object} a track definition
* @return {Uint8Array} the track box
*/
trak = function(track) {
track.duration = track.duration || 0xffffffff;
return box(types.trak,
tkhd(track),
mdia(track));
};
trex = function(track) {
var result = new Uint8Array([
0x00, // version 0
0x00, 0x00, 0x00, // flags
(track.id & 0xFF000000) >> 24,
(track.id & 0xFF0000) >> 16,
(track.id & 0xFF00) >> 8,
(track.id & 0xFF), // track_ID
0x00, 0x00, 0x00, 0x01, // default_sample_description_index
0x00, 0x00, 0x00, 0x00, // default_sample_duration
0x00, 0x00, 0x00, 0x00, // default_sample_size
0x00, 0x01, 0x00, 0x01 // default_sample_flags
]);
// the last two bytes of default_sample_flags is the sample
// degradation priority, a hint about the importance of this sample
// relative to others. Lower the degradation priority for all sample
// types other than video.
if (track.type !== 'video') {
result[result.length - 1] = 0x00;
}
return box(types.trex, result);
};
(function() {
var audioTrun, videoTrun, trunHeader;
// This method assumes all samples are uniform. That is, if a
// duration is present for the first sample, it will be present for
// all subsequent samples.
// see ISO/IEC 14496-12:2012, Section 8.8.8.1
trunHeader = function(samples, offset) {
var durationPresent = 0, sizePresent = 0,
flagsPresent = 0, compositionTimeOffset = 0;
// trun flag constants
if (samples.length) {
if (samples[0].duration !== undefined) {
durationPresent = 0x1;
}
if (samples[0].size !== undefined) {
sizePresent = 0x2;
}
if (samples[0].flags !== undefined) {
flagsPresent = 0x4;
}
if (samples[0].compositionTimeOffset !== undefined) {
compositionTimeOffset = 0x8;
}
}
return [
0x00, // version 0
0x00,
durationPresent | sizePresent | flagsPresent | compositionTimeOffset,
0x01, // flags
(samples.length & 0xFF000000) >>> 24,
(samples.length & 0xFF0000) >>> 16,
(samples.length & 0xFF00) >>> 8,
samples.length & 0xFF, // sample_count
(offset & 0xFF000000) >>> 24,
(offset & 0xFF0000) >>> 16,
(offset & 0xFF00) >>> 8,
offset & 0xFF // data_offset
];
};
videoTrun = function(track, offset) {
var bytes, samples, sample, i;
samples = track.samples || [];
offset += 8 + 12 + (16 * samples.length);
bytes = trunHeader(samples, offset);
for (i = 0; i < samples.length; i++) {
sample = samples[i];
bytes = bytes.concat([
(sample.duration & 0xFF000000) >>> 24,
(sample.duration & 0xFF0000) >>> 16,
(sample.duration & 0xFF00) >>> 8,
sample.duration & 0xFF, // sample_duration
(sample.size & 0xFF000000) >>> 24,
(sample.size & 0xFF0000) >>> 16,
(sample.size & 0xFF00) >>> 8,
sample.size & 0xFF, // sample_size
(sample.flags.isLeading << 2) | sample.flags.dependsOn,
(sample.flags.isDependedOn << 6) |
(sample.flags.hasRedundancy << 4) |
(sample.flags.paddingValue << 1) |
sample.flags.isNonSyncSample,
sample.flags.degradationPriority & 0xF0 << 8,
sample.flags.degradationPriority & 0x0F, // sample_flags
(sample.compositionTimeOffset & 0xFF000000) >>> 24,
(sample.compositionTimeOffset & 0xFF0000) >>> 16,
(sample.compositionTimeOffset & 0xFF00) >>> 8,
sample.compositionTimeOffset & 0xFF // sample_composition_time_offset
]);
}
return box(types.trun, new Uint8Array(bytes));
};
audioTrun = function(track, offset) {
var bytes, samples, sample, i;
samples = track.samples || [];
offset += 8 + 12 + (8 * samples.length);
bytes = trunHeader(samples, offset);
for (i = 0; i < samples.length; i++) {
sample = samples[i];
bytes = bytes.concat([
(sample.duration & 0xFF000000) >>> 24,
(sample.duration & 0xFF0000) >>> 16,
(sample.duration & 0xFF00) >>> 8,
sample.duration & 0xFF, // sample_duration
(sample.size & 0xFF000000) >>> 24,
(sample.size & 0xFF0000) >>> 16,
(sample.size & 0xFF00) >>> 8,
sample.size & 0xFF]); // sample_size
}
return box(types.trun, new Uint8Array(bytes));
};
trun = function(track, offset) {
if (track.type === 'audio') {
return audioTrun(track, offset);
} else {
return videoTrun(track, offset);
}
};
})();
module.exports = {
ftyp: ftyp,
mdat: mdat,
moof: moof,
moov: moov,
initSegment: function(tracks) {
var
fileType = ftyp(),
movie = moov(tracks),
result;
result = new Uint8Array(fileType.byteLength + movie.byteLength);
result.set(fileType);
result.set(movie, fileType.byteLength);
return result;
}
};
},{}],49:[function(require,module,exports){
/**
* mux.js
*
* Copyright (c) 2015 Brightcove
* All rights reserved.
*
* A stream-based mp2t to mp4 converter. This utility can be used to
* deliver mp4s to a SourceBuffer on platforms that support native
* Media Source Extensions.
*/
'use strict';
var Stream = require('../utils/stream.js');
var mp4 = require('./mp4-generator.js');
var m2ts = require('../m2ts/m2ts.js');
var AdtsStream = require('../codecs/adts.js');
var H264Stream = require('../codecs/h264').H264Stream;
var AacStream = require('../aac');
// constants
var AUDIO_PROPERTIES = [
'audioobjecttype',
'channelcount',
'samplerate',
'samplingfrequencyindex',
'samplesize'
];
var VIDEO_PROPERTIES = [
'width',
'height',
'profileIdc',
'levelIdc',
'profileCompatibility',
];
// object types
var VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;
// Helper functions
var
createDefaultSample,
isLikelyAacData,
collectDtsInfo,
clearDtsInfo,
calculateTrackBaseMediaDecodeTime,
arrayEquals,
sumFrameByteLengths;
/**
* Default sample object
* see ISO/IEC 14496-12:2012, section 8.6.4.3
*/
createDefaultSample = function () {
return {
size: 0,
flags: {
isLeading: 0,
dependsOn: 1,
isDependedOn: 0,
hasRedundancy: 0,
degradationPriority: 0
}
};
};
isLikelyAacData = function (data) {
if ((data[0] === 'I'.charCodeAt(0)) &&
(data[1] === 'D'.charCodeAt(0)) &&
(data[2] === '3'.charCodeAt(0))) {
return true;
}
return false;
};
/**
* Compare two arrays (even typed) for same-ness
*/
arrayEquals = function(a, b) {
var
i;
if (a.length !== b.length) {
return false;
}
// compare the value of each element in the array
for (i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
};
/**
* Sum the `byteLength` properties of the data in each AAC frame
*/
sumFrameByteLengths = function(array) {
var
i,
currentObj,
sum = 0;
// sum the byteLength's all each nal unit in the frame
for (i = 0; i < array.length; i++) {
currentObj = array[i];
sum += currentObj.data.byteLength;
}
return sum;
};
/**
* Constructs a single-track, ISO BMFF media segment from AAC data
* events. The output of this stream can be fed to a SourceBuffer
* configured with a suitable initialization segment.
*/
AudioSegmentStream = function(track) {
var
adtsFrames = [],
sequenceNumber = 0,
earliestAllowedDts = 0;
AudioSegmentStream.prototype.init.call(this);
this.push = function(data) {
collectDtsInfo(track, data);
if (track) {
AUDIO_PROPERTIES.forEach(function(prop) {
track[prop] = data[prop];
});
}
// buffer audio data until end() is called
adtsFrames.push(data);
};
this.setEarliestDts = function(earliestDts) {
earliestAllowedDts = earliestDts - track.timelineStartInfo.baseMediaDecodeTime;
};
this.flush = function() {
var
frames,
moof,
mdat,
boxes;
// return early if no audio data has been observed
if (adtsFrames.length === 0) {
this.trigger('done', 'AudioSegmentStream');
return;
}
frames = this.trimAdtsFramesByEarliestDts_(adtsFrames);
// we have to build the index from byte locations to
// samples (that is, adts frames) in the audio data
track.samples = this.generateSampleTable_(frames);
// concatenate the audio data to constuct the mdat
mdat = mp4.mdat(this.concatenateFrameData_(frames));
adtsFrames = [];
calculateTrackBaseMediaDecodeTime(track);
moof = mp4.moof(sequenceNumber, [track]);
boxes = new Uint8Array(moof.byteLength + mdat.byteLength);
// bump the sequence number for next time
sequenceNumber++;
boxes.set(moof);
boxes.set(mdat, moof.byteLength);
clearDtsInfo(track);
this.trigger('data', {track: track, boxes: boxes});
this.trigger('done', 'AudioSegmentStream');
};
// If the audio segment extends before the earliest allowed dts
// value, remove AAC frames until starts at or after the earliest
// allowed DTS so that we don't end up with a negative baseMedia-
// DecodeTime for the audio track
this.trimAdtsFramesByEarliestDts_ = function(adtsFrames) {
if (track.minSegmentDts >= earliestAllowedDts) {
return adtsFrames;
}
// We will need to recalculate the earliest segment Dts
track.minSegmentDts = Infinity;
return adtsFrames.filter(function(currentFrame) {
// If this is an allowed frame, keep it and record it's Dts
if (currentFrame.dts >= earliestAllowedDts) {
track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);
track.minSegmentPts = track.minSegmentDts;
return true;
}
// Otherwise, discard it
return false;
});
};
// generate the track's raw mdat data from an array of frames
this.generateSampleTable_ = function(frames) {
var
i,
currentFrame,
samples = [];
for (i = 0; i < frames.length; i++) {
currentFrame = frames[i];
samples.push({
size: currentFrame.data.byteLength,
duration: 1024 // For AAC audio, all samples contain 1024 samples
});
}
return samples;
};
// generate the track's sample table from an array of frames
this.concatenateFrameData_ = function(frames) {
var
i,
currentFrame,
dataOffset = 0,
data = new Uint8Array(sumFrameByteLengths(frames));
for (i = 0; i < frames.length; i++) {
currentFrame = frames[i];
data.set(currentFrame.data, dataOffset);
dataOffset += currentFrame.data.byteLength;
}
return data;
};
};
AudioSegmentStream.prototype = new Stream();
/**
* Constructs a single-track, ISO BMFF media segment from H264 data
* events. The output of this stream can be fed to a SourceBuffer
* configured with a suitable initialization segment.
* @param track {object} track metadata configuration
*/
VideoSegmentStream = function(track) {
var
sequenceNumber = 0,
nalUnits = [],
config,
pps;
VideoSegmentStream.prototype.init.call(this);
delete track.minPTS;
this.gopCache_ = [];
this.push = function(nalUnit) {
collectDtsInfo(track, nalUnit);
// record the track config
if (nalUnit.nalUnitType === 'seq_parameter_set_rbsp' && !config) {
config = nalUnit.config;
track.sps = [nalUnit.data];
VIDEO_PROPERTIES.forEach(function(prop) {
track[prop] = config[prop];
}, this);
}
if (nalUnit.nalUnitType === 'pic_parameter_set_rbsp' &&
!pps) {
pps = nalUnit.data;
track.pps = [nalUnit.data];
}
// buffer video until flush() is called
nalUnits.push(nalUnit);
};
this.flush = function() {
var
frames,
gopForFusion,
gops,
moof,
mdat,
boxes;
// Throw away nalUnits at the start of the byte stream until
// we find the first AUD
while (nalUnits.length) {
if (nalUnits[0].nalUnitType === 'access_unit_delimiter_rbsp') {
break;
}
nalUnits.shift();
}
// Return early if no video data has been observed
if (nalUnits.length === 0) {
this.resetStream_();
this.trigger('done', 'VideoSegmentStream');
return;
}
// Organize the raw nal-units into arrays that represent
// higher-level constructs such as frames and gops
// (group-of-pictures)
frames = this.groupNalsIntoFrames_(nalUnits);
gops = this.groupFramesIntoGops_(frames);
// If the first frame of this fragment is not a keyframe we have
// a problem since MSE (on Chrome) requires a leading keyframe.
//
// We have two approaches to repairing this situation:
// 1) GOP-FUSION:
// This is where we keep track of the GOPS (group-of-pictures)
// from previous fragments and attempt to find one that we can
// prepend to the current fragment in order to create a valid
// fragment.
// 2) KEYFRAME-PULLING:
// Here we search for the first keyframe in the fragment and
// throw away all the frames between the start of the fragment
// and that keyframe. We then extend the duration and pull the
// PTS of the keyframe forward so that it covers the time range
// of the frames that were disposed of.
//
// #1 is far prefereable over #2 which can cause "stuttering" but
// requires more things to be just right.
if (!gops[0][0].keyFrame) {
// Search for a gop for fusion from our gopCache
gopForFusion = this.getGopForFusion_(nalUnits[0], track);
if (gopForFusion) {
gops.unshift(gopForFusion);
// Adjust Gops' metadata to account for the inclusion of the
// new gop at the beginning
gops.byteLength += gopForFusion.byteLength;
gops.nalCount += gopForFusion.nalCount;
gops.pts = gopForFusion.pts;
gops.dts = gopForFusion.dts;
gops.duration += gopForFusion.duration;
} else {
// If we didn't find a candidate gop fall back to keyrame-pulling
gops = this.extendFirstKeyFrame_(gops);
}
}
collectDtsInfo(track, gops);
// First, we have to build the index from byte locations to
// samples (that is, frames) in the video data
track.samples = this.generateSampleTable_(gops);
// Concatenate the video data and construct the mdat
mdat = mp4.mdat(this.concatenateNalData_(gops));
// save all the nals in the last GOP into the gop cache
this.gopCache_.unshift({
gop: gops.pop(),
pps: track.pps,
sps: track.sps
});
// Keep a maximum of 6 GOPs in the cache
this.gopCache_.length = Math.min(6, this.gopCache_.length);
// Clear nalUnits
nalUnits = [];
calculateTrackBaseMediaDecodeTime(track);
this.trigger('timelineStartInfo', track.timelineStartInfo);
moof = mp4.moof(sequenceNumber, [track]);
// it would be great to allocate this array up front instead of
// throwing away hundreds of media segment fragments
boxes = new Uint8Array(moof.byteLength + mdat.byteLength);
// Bump the sequence number for next time
sequenceNumber++;
boxes.set(moof);
boxes.set(mdat, moof.byteLength);
this.trigger('data', {track: track, boxes: boxes});
this.resetStream_();
// Continue with the flush process now
this.trigger('done', 'VideoSegmentStream');
};
this.resetStream_ = function() {
clearDtsInfo(track);
// reset config and pps because they may differ across segments
// for instance, when we are rendition switching
config = undefined;
pps = undefined;
};
// Search for a candidate Gop for gop-fusion from the gop cache and
// return it or return null if no good candidate was found
this.getGopForFusion_ = function (nalUnit) {
var
halfSecond = 45000, // Half-a-second in a 90khz clock
allowableOverlap = 10000, // About 3 frames @ 30fps
nearestDistance = Infinity,
dtsDistance,
nearestGopObj,
currentGop,
currentGopObj,
i;
// Search for the GOP nearest to the beginning of this nal unit
for (i = 0; i < this.gopCache_.length; i++) {
currentGopObj = this.gopCache_[i];
currentGop = currentGopObj.gop;
// Reject Gops with different SPS or PPS
if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) ||
!(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {
continue;
}
// Reject Gops that would require a negative baseMediaDecodeTime
if (currentGop.dts < track.timelineStartInfo.dts) {
continue;
}
// The distance between the end of the gop and the start of the nalUnit
dtsDistance = (nalUnit.dts - currentGop.dts) - currentGop.duration;
// Only consider GOPS that start before the nal unit and end within
// a half-second of the nal unit
if (dtsDistance >= -allowableOverlap &&
dtsDistance <= halfSecond) {
// Always use the closest GOP we found if there is more than
// one candidate
if (!nearestGopObj ||
nearestDistance > dtsDistance) {
nearestGopObj = currentGopObj;
nearestDistance = dtsDistance;
}
}
}
if (nearestGopObj) {
return nearestGopObj.gop;
}
return null;
};
this.extendFirstKeyFrame_ = function(gops) {
var
h, i,
currentGop,
newGops;
if (!gops[0][0].keyFrame) {
// Remove the first GOP
currentGop = gops.shift();
gops.byteLength -= currentGop.byteLength;
gops.nalCount -= currentGop.nalCount;
// Extend the first frame of what is now the
// first gop to cover the time period of the
// frames we just removed
gops[0][0].dts = currentGop.dts;
gops[0][0].pts = currentGop.pts;
gops[0][0].duration += currentGop.duration;
}
return gops;
};
// Convert an array of nal units into an array of frames with each frame being
// composed of the nal units that make up that frame
// Also keep track of cummulative data about the frame from the nal units such
// as the frame duration, starting pts, etc.
this.groupNalsIntoFrames_ = function(nalUnits) {
var
i,
currentNal,
startPts,
startDts,
currentFrame = [],
frames = [];
currentFrame.byteLength = 0;
for (i = 0; i < nalUnits.length; i++) {
currentNal = nalUnits[i];
// Split on 'aud'-type nal units
if (currentNal.nalUnitType === 'access_unit_delimiter_rbsp') {
// Since the very first nal unit is expected to be an AUD
// only push to the frames array when currentFrame is not empty
if (currentFrame.length) {
currentFrame.duration = currentNal.dts - currentFrame.dts;
frames.push(currentFrame);
}
currentFrame = [currentNal];
currentFrame.byteLength = currentNal.data.byteLength;
currentFrame.pts = currentNal.pts;
currentFrame.dts = currentNal.dts;
} else {
// Specifically flag key frames for ease of use later
if (currentNal.nalUnitType === 'slice_layer_without_partitioning_rbsp_idr') {
currentFrame.keyFrame = true;
}
currentFrame.duration = currentNal.dts - currentFrame.dts;
currentFrame.byteLength += currentNal.data.byteLength;
currentFrame.push(currentNal);
}
}
// For the last frame, use the duration of the previous frame if we
// have nothing better to go on
if (frames.length &&
(!currentFrame.duration ||
currentFrame.duration <= 0)) {
currentFrame.duration = frames[frames.length - 1].duration;
}
// Push the final frame
frames.push(currentFrame);
return frames;
};
// Convert an array of frames into an array of Gop with each Gop being composed
// of the frames that make up that Gop
// Also keep track of cummulative data about the Gop from the frames such as the
// Gop duration, starting pts, etc.
this.groupFramesIntoGops_ = function(frames) {
var
i,
currentFrame,
currentGop = [],
gops = [];
// We must pre-set some of the values on the Gop since we
// keep running totals of these values
currentGop.byteLength = 0;
currentGop.nalCount = 0;
currentGop.duration = 0;
currentGop.pts = frames[0].pts;
currentGop.dts = frames[0].dts;
// store some metadata about all the Gops
gops.byteLength = 0;
gops.nalCount = 0;
gops.duration = 0;
gops.pts = frames[0].pts;
gops.dts = frames[0].dts;
for (i = 0; i < frames.length; i++) {
currentFrame = frames[i];
if (currentFrame.keyFrame) {
// Since the very first frame is expected to be an keyframe
// only push to the gops array when currentGop is not empty
if (currentGop.length) {
gops.push(currentGop);
gops.byteLength += currentGop.byteLength;
gops.nalCount += currentGop.nalCount;
gops.duration += currentGop.duration;
}
currentGop = [currentFrame];
currentGop.nalCount = currentFrame.length;
currentGop.byteLength = currentFrame.byteLength;
currentGop.pts = currentFrame.pts;
currentGop.dts = currentFrame.dts;
currentGop.duration = currentFrame.duration;
} else {
currentGop.duration += currentFrame.duration;
currentGop.nalCount += currentFrame.length;
currentGop.byteLength += currentFrame.byteLength;
currentGop.push(currentFrame);
}
}
if (gops.length && currentGop.duration <= 0) {
currentGop.duration = gops[gops.length - 1].duration;
}
gops.byteLength += currentGop.byteLength;
gops.nalCount += currentGop.nalCount;
gops.duration += currentGop.duration;
// push the final Gop
gops.push(currentGop);
return gops;
};
// generate the track's sample table from an array of gops
this.generateSampleTable_ = function(gops, baseDataOffset) {
var
h, i,
sample,
currentGop,
currentFrame,
currentSample,
dataOffset = baseDataOffset || 0,
samples = [];
for (h = 0; h < gops.length; h++) {
currentGop = gops[h];
for (i = 0; i < currentGop.length; i++) {
currentFrame = currentGop[i];
sample = createDefaultSample();
sample.dataOffset = dataOffset;
sample.compositionTimeOffset = currentFrame.pts - currentFrame.dts;
sample.duration = currentFrame.duration;
sample.size = 4 * currentFrame.length; // Space for nal unit size
sample.size += currentFrame.byteLength;
if (currentFrame.keyFrame) {
sample.flags.dependsOn = 2;
}
dataOffset += sample.size;
samples.push(sample);
}
}
return samples;
};
// generate the track's raw mdat data from an array of gops
this.concatenateNalData_ = function (gops) {
var
h, i, j,
currentGop,
currentFrame,
currentNal,
dataOffset = 0,
nalsByteLength = gops.byteLength,
numberOfNals = gops.nalCount,
totalByteLength = nalsByteLength + 4 * numberOfNals,
data = new Uint8Array(totalByteLength),
view = new DataView(data.buffer);
// For each Gop..
for (h = 0; h < gops.length; h++) {
currentGop = gops[h];
// For each Frame..
for (i = 0; i < currentGop.length; i++) {
currentFrame = currentGop[i];
// For each NAL..
for (j = 0; j < currentFrame.length; j++) {
currentNal = currentFrame[j];
view.setUint32(dataOffset, currentNal.data.byteLength);
dataOffset += 4;
data.set(currentNal.data, dataOffset);
dataOffset += currentNal.data.byteLength;
}
}
}
return data;
};
};
VideoSegmentStream.prototype = new Stream();
/**
* Store information about the start and end of the track and the
* duration for each frame/sample we process in order to calculate
* the baseMediaDecodeTime
*/
collectDtsInfo = function (track, data) {
if (typeof data.pts === 'number') {
if (track.timelineStartInfo.pts === undefined) {
track.timelineStartInfo.pts = data.pts;
}
if (track.minSegmentPts === undefined) {
track.minSegmentPts = data.pts;
} else {
track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);
}
if (track.maxSegmentPts === undefined) {
track.maxSegmentPts = data.pts;
} else {
track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);
}
}
if (typeof data.dts === 'number') {
if (track.timelineStartInfo.dts === undefined) {
track.timelineStartInfo.dts = data.dts;
}
if (track.minSegmentDts === undefined) {
track.minSegmentDts = data.dts;
} else {
track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);
}
if (track.maxSegmentDts === undefined) {
track.maxSegmentDts = data.dts;
} else {
track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);
}
}
};
/**
* Clear values used to calculate the baseMediaDecodeTime between
* tracks
*/
clearDtsInfo = function (track) {
delete track.minSegmentDts;
delete track.maxSegmentDts;
delete track.minSegmentPts;
delete track.maxSegmentPts;
};
/**
* Calculate the track's baseMediaDecodeTime based on the earliest
* DTS the transmuxer has ever seen and the minimum DTS for the
* current track
*/
calculateTrackBaseMediaDecodeTime = function (track) {
var
oneSecondInPTS = 90000, // 90kHz clock
scale,
// Calculate the distance, in time, that this segment starts from the start
// of the timeline (earliest time seen since the transmuxer initialized)
timeSinceStartOfTimeline = track.minSegmentDts - track.timelineStartInfo.dts,
// Calculate the first sample's effective compositionTimeOffset
firstSampleCompositionOffset = track.minSegmentPts - track.minSegmentDts;
// track.timelineStartInfo.baseMediaDecodeTime is the location, in time, where
// we want the start of the first segment to be placed
track.baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;
// Add to that the distance this segment is from the very first
track.baseMediaDecodeTime += timeSinceStartOfTimeline;
// Subtract this segment's "compositionTimeOffset" so that the first frame of
// this segment is displayed exactly at the `baseMediaDecodeTime` or at the
// end of the previous segment
track.baseMediaDecodeTime -= firstSampleCompositionOffset;
// baseMediaDecodeTime must not become negative
track.baseMediaDecodeTime = Math.max(0, track.baseMediaDecodeTime);
if (track.type === 'audio') {
// Audio has a different clock equal to the sampling_rate so we need to
// scale the PTS values into the clock rate of the track
scale = track.samplerate / oneSecondInPTS;
track.baseMediaDecodeTime *= scale;
track.baseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime);
}
};
/**
* A Stream that can combine multiple streams (ie. audio & video)
* into a single output segment for MSE. Also supports audio-only
* and video-only streams.
*/
CoalesceStream = function(options, metadataStream) {
// Number of Tracks per output segment
// If greater than 1, we combine multiple
// tracks into a single segment
this.numberOfTracks = 0;
this.metadataStream = metadataStream;
if (typeof options.remux !== 'undefined') {
this.remuxTracks = !!options.remux;
} else {
this.remuxTracks = true;
}
this.pendingTracks = [];
this.videoTrack = null;
this.pendingBoxes = [];
this.pendingCaptions = [];
this.pendingMetadata = [];
this.pendingBytes = 0;
this.emittedTracks = 0;
CoalesceStream.prototype.init.call(this);
// Take output from multiple
this.push = function(output) {
// buffer incoming captions until the associated video segment
// finishes
if (output.text) {
return this.pendingCaptions.push(output);
}
// buffer incoming id3 tags until the final flush
if (output.frames) {
return this.pendingMetadata.push(output);
}
// Add this track to the list of pending tracks and store
// important information required for the construction of
// the final segment
this.pendingTracks.push(output.track);
this.pendingBoxes.push(output.boxes);
this.pendingBytes += output.boxes.byteLength;
if (output.track.type === 'video') {
this.videoTrack = output.track;
}
if (output.track.type === 'audio') {
this.audioTrack = output.track;
}
};
};
CoalesceStream.prototype = new Stream();
CoalesceStream.prototype.flush = function(flushSource) {
var
offset = 0,
event = {
captions: [],
metadata: [],
info: {}
},
caption,
id3,
initSegment,
timelineStartPts = 0,
i;
if (this.pendingTracks.length < this.numberOfTracks) {
if (flushSource !== 'VideoSegmentStream' &&
flushSource !== 'AudioSegmentStream') {
// Return because we haven't received a flush from a data-generating
// portion of the segment (meaning that we have only recieved meta-data
// or captions.)
return;
} else if (this.remuxTracks) {
// Return until we have enough tracks from the pipeline to remux (if we
// are remuxing audio and video into a single MP4)
return;
} else if (this.pendingTracks.length === 0) {
// In the case where we receive a flush without any data having been
// received we consider it an emitted track for the purposes of coalescing
// `done` events.
// We do this for the case where there is an audio and video track in the
// segment but no audio data. (seen in several playlists with alternate
// audio tracks and no audio present in the main TS segments.)
this.emittedTracks++;
if (this.emittedTracks >= this.numberOfTracks) {
this.trigger('done');
this.emittedTracks = 0;
}
return;
}
}
if (this.videoTrack) {
timelineStartPts = this.videoTrack.timelineStartInfo.pts;
VIDEO_PROPERTIES.forEach(function(prop) {
event.info[prop] = this.videoTrack[prop];
}, this);
} else if (this.audioTrack) {
timelineStartPts = this.audioTrack.timelineStartInfo.pts;
AUDIO_PROPERTIES.forEach(function(prop) {
event.info[prop] = this.audioTrack[prop];
}, this);
}
if (this.pendingTracks.length === 1) {
event.type = this.pendingTracks[0].type;
} else {
event.type = 'combined';
}
this.emittedTracks += this.pendingTracks.length;
initSegment = mp4.initSegment(this.pendingTracks);
// Create a new typed array large enough to hold the init
// segment and all tracks
event.data = new Uint8Array(initSegment.byteLength +
this.pendingBytes);
// Create an init segment containing a moov
// and track definitions
event.data.set(initSegment);
offset += initSegment.byteLength;
// Append each moof+mdat (one per track) after the init segment
for (i = 0; i < this.pendingBoxes.length; i++) {
event.data.set(this.pendingBoxes[i], offset);
offset += this.pendingBoxes[i].byteLength;
}
// Translate caption PTS times into second offsets into the
// video timeline for the segment
for (i = 0; i < this.pendingCaptions.length; i++) {
caption = this.pendingCaptions[i];
caption.startTime = (caption.startPts - timelineStartPts);
caption.startTime /= 90e3;
caption.endTime = (caption.endPts - timelineStartPts);
caption.endTime /= 90e3;
event.captions.push(caption);
}
// Translate ID3 frame PTS times into second offsets into the
// video timeline for the segment
for (i = 0; i < this.pendingMetadata.length; i++) {
id3 = this.pendingMetadata[i];
id3.cueTime = (id3.pts - timelineStartPts);
id3.cueTime /= 90e3;
event.metadata.push(id3);
}
// We add this to every single emitted segment even though we only need
// it for the first
event.metadata.dispatchType = this.metadataStream.dispatchType;
// Reset stream state
this.pendingTracks.length = 0;
this.videoTrack = null;
this.pendingBoxes.length = 0;
this.pendingCaptions.length = 0;
this.pendingBytes = 0;
this.pendingMetadata.length = 0;
// Emit the built segment
this.trigger('data', event);
// Only emit `done` if all tracks have been flushed and emitted
if (this.emittedTracks >= this.numberOfTracks) {
this.trigger('done');
this.emittedTracks = 0;
}
};
/**
* A Stream that expects MP2T binary data as input and produces
* corresponding media segments, suitable for use with Media Source
* Extension (MSE) implementations that support the ISO BMFF byte
* stream format, like Chrome.
*/
Transmuxer = function(options) {
var
self = this,
hasFlushed = true,
videoTrack,
audioTrack;
Transmuxer.prototype.init.call(this);
options = options || {};
this.baseMediaDecodeTime = options.baseMediaDecodeTime || 0;
this.transmuxPipeline_ = {};
this.setupAacPipeline = function() {
var pipeline = {};
this.transmuxPipeline_ = pipeline;
pipeline.type = 'aac';
pipeline.metadataStream = new m2ts.MetadataStream();
// set up the parsing pipeline
pipeline.aacStream = new AacStream();
pipeline.adtsStream = new AdtsStream();
pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);
pipeline.headOfPipeline = pipeline.aacStream;
pipeline.aacStream.pipe(pipeline.adtsStream);
pipeline.aacStream.pipe(pipeline.metadataStream);
pipeline.metadataStream.pipe(pipeline.coalesceStream);
pipeline.metadataStream.on('timestamp', function(frame) {
pipeline.aacStream.setTimestamp(frame.timeStamp);
});
pipeline.aacStream.on('data', function(data) {
var i;
if (data.type === 'timed-metadata' && !pipeline.audioSegmentStream) {
audioTrack = audioTrack || {
timelineStartInfo: {
baseMediaDecodeTime: self.baseMediaDecodeTime
},
codec: 'adts',
type: 'audio'
};
// hook up the audio segment stream to the first track with aac data
pipeline.coalesceStream.numberOfTracks++;
pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack);
// Set up the final part of the audio pipeline
pipeline.adtsStream
.pipe(pipeline.audioSegmentStream)
.pipe(pipeline.coalesceStream);
}
});
// Re-emit any data coming from the coalesce stream to the outside world
pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));
// Let the consumer know we have finished flushing the entire pipeline
pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));
};
this.setupTsPipeline = function() {
var pipeline = {};
this.transmuxPipeline_ = pipeline;
pipeline.type = 'ts';
pipeline.metadataStream = new m2ts.MetadataStream();
// set up the parsing pipeline
pipeline.packetStream = new m2ts.TransportPacketStream();
pipeline.parseStream = new m2ts.TransportParseStream();
pipeline.elementaryStream = new m2ts.ElementaryStream();
pipeline.adtsStream = new AdtsStream();
pipeline.h264Stream = new H264Stream();
pipeline.captionStream = new m2ts.CaptionStream();
pipeline.coalesceStream = new CoalesceStream(options, pipeline.metadataStream);
pipeline.headOfPipeline = pipeline.packetStream;
// disassemble MPEG2-TS packets into elementary streams
pipeline.packetStream
.pipe(pipeline.parseStream)
.pipe(pipeline.elementaryStream);
// !!THIS ORDER IS IMPORTANT!!
// demux the streams
pipeline.elementaryStream
.pipe(pipeline.h264Stream);
pipeline.elementaryStream
.pipe(pipeline.adtsStream);
pipeline.elementaryStream
.pipe(pipeline.metadataStream)
.pipe(pipeline.coalesceStream);
// Hook up CEA-608/708 caption stream
pipeline.h264Stream.pipe(pipeline.captionStream)
.pipe(pipeline.coalesceStream);
pipeline.elementaryStream.on('data', function(data) {
var i;
if (data.type === 'metadata') {
i = data.tracks.length;
// scan the tracks listed in the metadata
while (i--) {
if (!videoTrack && data.tracks[i].type === 'video') {
videoTrack = data.tracks[i];
videoTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;
} else if (!audioTrack && data.tracks[i].type === 'audio') {
audioTrack = data.tracks[i];
audioTrack.timelineStartInfo.baseMediaDecodeTime = self.baseMediaDecodeTime;
}
}
// hook up the video segment stream to the first track with h264 data
if (videoTrack && !pipeline.videoSegmentStream) {
pipeline.coalesceStream.numberOfTracks++;
pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack);
pipeline.videoSegmentStream.on('timelineStartInfo', function(timelineStartInfo){
// When video emits timelineStartInfo data after a flush, we forward that
// info to the AudioSegmentStream, if it exists, because video timeline
// data takes precedence.
if (audioTrack) {
audioTrack.timelineStartInfo = timelineStartInfo;
// On the first segment we trim AAC frames that exist before the
// very earliest DTS we have seen in video because Chrome will
// interpret any video track with a baseMediaDecodeTime that is
// non-zero as a gap.
pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts);
}
});
// Set up the final part of the video pipeline
pipeline.h264Stream
.pipe(pipeline.videoSegmentStream)
.pipe(pipeline.coalesceStream);
}
if (audioTrack && !pipeline.audioSegmentStream) {
// hook up the audio segment stream to the first track with aac data
pipeline.coalesceStream.numberOfTracks++;
pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack);
// Set up the final part of the audio pipeline
pipeline.adtsStream
.pipe(pipeline.audioSegmentStream)
.pipe(pipeline.coalesceStream);
}
}
});
// Re-emit any data coming from the coalesce stream to the outside world
pipeline.coalesceStream.on('data', this.trigger.bind(this, 'data'));
// Let the consumer know we have finished flushing the entire pipeline
pipeline.coalesceStream.on('done', this.trigger.bind(this, 'done'));
};
// hook up the segment streams once track metadata is delivered
this.setBaseMediaDecodeTime = function (baseMediaDecodeTime) {
var pipeline = this.transmuxPipeline_;
this.baseMediaDecodeTime = baseMediaDecodeTime;
if (audioTrack) {
audioTrack.timelineStartInfo.dts = undefined;
audioTrack.timelineStartInfo.pts = undefined;
clearDtsInfo(audioTrack);
audioTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;
}
if (videoTrack) {
if (pipeline.videoSegmentStream) {
pipeline.videoSegmentStream.gopCache_ = [];
}
videoTrack.timelineStartInfo.dts = undefined;
videoTrack.timelineStartInfo.pts = undefined;
clearDtsInfo(videoTrack);
videoTrack.timelineStartInfo.baseMediaDecodeTime = baseMediaDecodeTime;
}
};
// feed incoming data to the front of the parsing pipeline
this.push = function(data) {
if (hasFlushed) {
var isAac = isLikelyAacData(data);
if (isAac && this.transmuxPipeline_.type !== 'aac') {
this.setupAacPipeline();
} else if (!isAac && this.transmuxPipeline_.type !== 'ts') {
this.setupTsPipeline();
}
hasFlushed = false;
}
this.transmuxPipeline_.headOfPipeline.push(data);
};
// flush any buffered data
this.flush = function() {
hasFlushed = true;
// Start at the top of the pipeline and flush all pending work
this.transmuxPipeline_.headOfPipeline.flush();
};
};
Transmuxer.prototype = new Stream();
module.exports = {
Transmuxer: Transmuxer,
VideoSegmentStream: VideoSegmentStream,
AudioSegmentStream: AudioSegmentStream,
AUDIO_PROPERTIES: AUDIO_PROPERTIES,
VIDEO_PROPERTIES: VIDEO_PROPERTIES
};
},{"../aac":37,"../codecs/adts.js":38,"../codecs/h264":39,"../m2ts/m2ts.js":44,"../utils/stream.js":51,"./mp4-generator.js":48}],50:[function(require,module,exports){
'use strict';
var ExpGolomb;
/**
* Parser for exponential Golomb codes, a variable-bitwidth number encoding
* scheme used by h264.
*/
ExpGolomb = function(workingData) {
var
// the number of bytes left to examine in workingData
workingBytesAvailable = workingData.byteLength,
// the current word being examined
workingWord = 0, // :uint
// the number of bits left to examine in the current word
workingBitsAvailable = 0; // :uint;
// ():uint
this.length = function() {
return (8 * workingBytesAvailable);
};
// ():uint
this.bitsAvailable = function() {
return (8 * workingBytesAvailable) + workingBitsAvailable;
};
// ():void
this.loadWord = function() {
var
position = workingData.byteLength - workingBytesAvailable,
workingBytes = new Uint8Array(4),
availableBytes = Math.min(4, workingBytesAvailable);
if (availableBytes === 0) {
throw new Error('no bytes available');
}
workingBytes.set(workingData.subarray(position,
position + availableBytes));
workingWord = new DataView(workingBytes.buffer).getUint32(0);
// track the amount of workingData that has been processed
workingBitsAvailable = availableBytes * 8;
workingBytesAvailable -= availableBytes;
};
// (count:int):void
this.skipBits = function(count) {
var skipBytes; // :int
if (workingBitsAvailable > count) {
workingWord <<= count;
workingBitsAvailable -= count;
} else {
count -= workingBitsAvailable;
skipBytes = Math.floor(count / 8);
count -= (skipBytes * 8);
workingBytesAvailable -= skipBytes;
this.loadWord();
workingWord <<= count;
workingBitsAvailable -= count;
}
};
// (size:int):uint
this.readBits = function(size) {
var
bits = Math.min(workingBitsAvailable, size), // :uint
valu = workingWord >>> (32 - bits); // :uint
// if size > 31, handle error
workingBitsAvailable -= bits;
if (workingBitsAvailable > 0) {
workingWord <<= bits;
} else if (workingBytesAvailable > 0) {
this.loadWord();
}
bits = size - bits;
if (bits > 0) {
return valu << bits | this.readBits(bits);
} else {
return valu;
}
};
// ():uint
this.skipLeadingZeros = function() {
var leadingZeroCount; // :uint
for (leadingZeroCount = 0 ; leadingZeroCount < workingBitsAvailable ; ++leadingZeroCount) {
if (0 !== (workingWord & (0x80000000 >>> leadingZeroCount))) {
// the first bit of working word is 1
workingWord <<= leadingZeroCount;
workingBitsAvailable -= leadingZeroCount;
return leadingZeroCount;
}
}
// we exhausted workingWord and still have not found a 1
this.loadWord();
return leadingZeroCount + this.skipLeadingZeros();
};
// ():void
this.skipUnsignedExpGolomb = function() {
this.skipBits(1 + this.skipLeadingZeros());
};
// ():void
this.skipExpGolomb = function() {
this.skipBits(1 + this.skipLeadingZeros());
};
// ():uint
this.readUnsignedExpGolomb = function() {
var clz = this.skipLeadingZeros(); // :uint
return this.readBits(clz + 1) - 1;
};
// ():int
this.readExpGolomb = function() {
var valu = this.readUnsignedExpGolomb(); // :int
if (0x01 & valu) {
// the number is odd if the low order bit is set
return (1 + valu) >>> 1; // add 1 to make it even, and divide by 2
} else {
return -1 * (valu >>> 1); // divide by two then make it negative
}
};
// Some convenience functions
// :Boolean
this.readBoolean = function() {
return 1 === this.readBits(1);
};
// ():int
this.readUnsignedByte = function() {
return this.readBits(8);
};
this.loadWord();
};
module.exports = ExpGolomb;
},{}],51:[function(require,module,exports){
/**
* mux.js
*
* Copyright (c) 2014 Brightcove
* All rights reserved.
*
* A lightweight readable stream implemention that handles event dispatching.
* Objects that inherit from streams should call init in their constructors.
*/
'use strict';
var Stream = function() {
this.init = function() {
var listeners = {};
/**
* Add a listener for a specified event type.
* @param type {string} the event name
* @param listener {function} the callback to be invoked when an event of
* the specified type occurs
*/
this.on = function(type, listener) {
if (!listeners[type]) {
listeners[type] = [];
}
listeners[type].push(listener);
};
/**
* Remove a listener for a specified event type.
* @param type {string} the event name
* @param listener {function} a function previously registered for this
* type of event through `on`
*/
this.off = function(type, listener) {
var index;
if (!listeners[type]) {
return false;
}
index = listeners[type].indexOf(listener);
listeners[type].splice(index, 1);
return index > -1;
};
/**
* Trigger an event of the specified type on this stream. Any additional
* arguments to this function are passed as parameters to event listeners.
* @param type {string} the event name
*/
this.trigger = function(type) {
var callbacks, i, length, args;
callbacks = listeners[type];
if (!callbacks) {
return;
}
// Slicing the arguments on every invocation of this method
// can add a significant amount of overhead. Avoid the
// intermediate object creation for the common case of a
// single callback argument
if (arguments.length === 2) {
length = callbacks.length;
for (i = 0; i < length; ++i) {
callbacks[i].call(this, arguments[1]);
}
} else {
args = [];
i = arguments.length;
for (i = 1; i < arguments.length; ++i) {
args.push(arguments[i]);
}
length = callbacks.length;
for (i = 0; i < length; ++i) {
callbacks[i].apply(this, args);
}
}
};
/**
* Destroys the stream and cleans up.
*/
this.dispose = function() {
listeners = {};
};
};
};
/**
* Forwards all `data` events on this stream to the destination stream. The
* destination stream should provide a method `push` to receive the data
* events as they arrive.
* @param destination {stream} the stream that will receive all `data` events
* @param autoFlush {boolean} if false, we will not call `flush` on the destination
* when the current stream emits a 'done' event
* @see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options
*/
Stream.prototype.pipe = function(destination) {
this.on('data', function(data) {
destination.push(data);
});
this.on('done', function(flushSource) {
destination.flush(flushSource);
});
return destination;
};
// Default stream functions that are expected to be overridden to perform
// actual work. These are provided by the prototype as a sort of no-op
// implementation so that we don't have to check for their existence in the
// `pipe` function above.
Stream.prototype.push = function(data) {
this.trigger('data', data);
};
Stream.prototype.flush = function(flushSource) {
this.trigger('done', flushSource);
};
module.exports = Stream;
},{}],52:[function(require,module,exports){
var bundleFn = arguments[3];
var sources = arguments[4];
var cache = arguments[5];
var stringify = JSON.stringify;
module.exports = function (fn) {
var keys = [];
var wkey;
var cacheKeys = Object.keys(cache);
for (var i = 0, l = cacheKeys.length; i < l; i++) {
var key = cacheKeys[i];
if (cache[key].exports === fn) {
wkey = key;
break;
}
}
if (!wkey) {
wkey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
var wcache = {};
for (var i = 0, l = cacheKeys.length; i < l; i++) {
var key = cacheKeys[i];
wcache[key] = key;
}
sources[wkey] = [
Function(['require','module','exports'], '(' + fn + ')(self)'),
wcache
];
}
var skey = Math.floor(Math.pow(16, 8) * Math.random()).toString(16);
var scache = {}; scache[wkey] = wkey;
sources[skey] = [
Function(['require'],'require(' + stringify(wkey) + ')(self)'),
scache
];
var src = '(' + bundleFn + ')({'
+ Object.keys(sources).map(function (key) {
return stringify(key) + ':['
+ sources[key][0]
+ ',' + stringify(sources[key][1]) + ']'
;
}).join(',')
+ '},{},[' + stringify(skey) + '])'
;
var URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
return new Worker(URL.createObjectURL(
new Blob([src], { type: 'text/javascript' })
));
};
},{}],53:[function(require,module,exports){
(function (global){
/**
* @file videojs-contrib-hls.js
*
* The main file for the HLS project.
* License: https://github.com/videojs/videojs-contrib-hls/blob/master/LICENSE
*/
'use strict';
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; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
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'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _globalDocument = require('global/document');
var _globalDocument2 = _interopRequireDefault(_globalDocument);
var _playlistLoader = require('./playlist-loader');
var _playlistLoader2 = _interopRequireDefault(_playlistLoader);
var _playlist = require('./playlist');
var _playlist2 = _interopRequireDefault(_playlist);
var _xhr = require('./xhr');
var _xhr2 = _interopRequireDefault(_xhr);
var _decrypter = require('./decrypter');
var _binUtils = require('./bin-utils');
var _binUtils2 = _interopRequireDefault(_binUtils);
var _videojsContribMediaSources = require('videojs-contrib-media-sources');
var _m3u8 = require('./m3u8');
var _m3u82 = _interopRequireDefault(_m3u8);
var _videoJs = (typeof window !== "undefined" ? window['videojs'] : typeof global !== "undefined" ? global['videojs'] : null);
var _videoJs2 = _interopRequireDefault(_videoJs);
var _masterPlaylistController = require('./master-playlist-controller');
var _masterPlaylistController2 = _interopRequireDefault(_masterPlaylistController);
var _config = require('./config');
var _config2 = _interopRequireDefault(_config);
/**
* determine if an object a is differnt from
* and object b. both only having one dimensional
* properties
*
* @param {Object} a object one
* @param {Object} b object two
* @return {Boolean} if the object has changed or not
*/
var objectChanged = function objectChanged(a, b) {
if (typeof a !== typeof b) {
return true;
}
// if we have a different number of elements
// something has changed
if (Object.keys(a).length !== Object.keys(b).length) {
return true;
}
for (var prop in a) {
if (!b[prop] || a[prop] !== b[prop]) {
return true;
}
}
return false;
};
var Hls = {
PlaylistLoader: _playlistLoader2['default'],
Playlist: _playlist2['default'],
Decrypter: _decrypter.Decrypter,
AsyncStream: _decrypter.AsyncStream,
decrypt: _decrypter.decrypt,
utils: _binUtils2['default'],
xhr: (0, _xhr2['default'])()
};
Object.defineProperty(Hls, 'GOAL_BUFFER_LENGTH', {
get: function get() {
_videoJs2['default'].log.warn('using Hls.GOAL_BUFFER_LENGTH is UNSAFE be sure ' + 'you know what you are doing');
return _config2['default'].GOAL_BUFFER_LENGTH;
},
set: function set(v) {
_videoJs2['default'].log.warn('using Hls.GOAL_BUFFER_LENGTH is UNSAFE be sure ' + 'you know what you are doing');
if (typeof v !== 'number' || v <= 0) {
_videoJs2['default'].log.warn('value passed to Hls.GOAL_BUFFER_LENGTH ' + 'must be a number and greater than 0');
return;
}
_config2['default'].GOAL_BUFFER_LENGTH = v;
}
});
// A fudge factor to apply to advertised playlist bitrates to account for
// temporary flucations in client bandwidth
var BANDWIDTH_VARIANCE = 1.2;
/**
* Returns the CSS value for the specified property on an element
* using `getComputedStyle`. Firefox has a long-standing issue where
* getComputedStyle() may return null when running in an iframe with
* `display: none`.
*
* @see https://bugzilla.mozilla.org/show_bug.cgi?id=548397
* @param {HTMLElement} el the htmlelement to work on
* @param {string} the proprety to get the style for
*/
var safeGetComputedStyle = function safeGetComputedStyle(el, property) {
var result = undefined;
if (!el) {
return '';
}
result = getComputedStyle(el);
if (!result) {
return '';
}
return result[property];
};
/**
* Chooses the appropriate media playlist based on the current
* bandwidth estimate and the player size.
*
* @return {Playlist} the highest bitrate playlist less than the currently detected
* bandwidth, accounting for some amount of bandwidth variance
*/
Hls.STANDARD_PLAYLIST_SELECTOR = function () {
var effectiveBitrate = undefined;
var sortedPlaylists = this.playlists.master.playlists.slice();
var bandwidthPlaylists = [];
var now = +new Date();
var i = undefined;
var variant = undefined;
var bandwidthBestVariant = undefined;
var resolutionPlusOne = undefined;
var resolutionPlusOneAttribute = undefined;
var resolutionBestVariant = undefined;
var width = undefined;
var height = undefined;
sortedPlaylists.sort(Hls.comparePlaylistBandwidth);
// filter out any playlists that have been excluded due to
// incompatible configurations or playback errors
sortedPlaylists = sortedPlaylists.filter(function (localVariant) {
if (typeof localVariant.excludeUntil !== 'undefined') {
return now >= localVariant.excludeUntil;
}
return true;
});
// filter out any variant that has greater effective bitrate
// than the current estimated bandwidth
i = sortedPlaylists.length;
while (i--) {
variant = sortedPlaylists[i];
// ignore playlists without bandwidth information
if (!variant.attributes || !variant.attributes.BANDWIDTH) {
continue;
}
effectiveBitrate = variant.attributes.BANDWIDTH * BANDWIDTH_VARIANCE;
if (effectiveBitrate < this.bandwidth) {
bandwidthPlaylists.push(variant);
// since the playlists are sorted in ascending order by
// bandwidth, the first viable variant is the best
if (!bandwidthBestVariant) {
bandwidthBestVariant = variant;
}
}
}
i = bandwidthPlaylists.length;
// sort variants by resolution
bandwidthPlaylists.sort(Hls.comparePlaylistResolution);
// forget our old variant from above,
// or we might choose that in high-bandwidth scenarios
// (this could be the lowest bitrate rendition as we go through all of them above)
variant = null;
width = parseInt(safeGetComputedStyle(this.tech_.el(), 'width'), 10);
height = parseInt(safeGetComputedStyle(this.tech_.el(), 'height'), 10);
// iterate through the bandwidth-filtered playlists and find
// best rendition by player dimension
while (i--) {
variant = bandwidthPlaylists[i];
// ignore playlists without resolution information
if (!variant.attributes || !variant.attributes.RESOLUTION || !variant.attributes.RESOLUTION.width || !variant.attributes.RESOLUTION.height) {
continue;
}
// since the playlists are sorted, the first variant that has
// dimensions less than or equal to the player size is the best
var variantResolution = variant.attributes.RESOLUTION;
if (variantResolution.width === width && variantResolution.height === height) {
// if we have the exact resolution as the player use it
resolutionPlusOne = null;
resolutionBestVariant = variant;
break;
} else if (variantResolution.width < width && variantResolution.height < height) {
// if both dimensions are less than the player use the
// previous (next-largest) variant
break;
} else if (!resolutionPlusOne || variantResolution.width < resolutionPlusOneAttribute.width && variantResolution.height < resolutionPlusOneAttribute.height) {
// If we still haven't found a good match keep a
// reference to the previous variant for the next loop
// iteration
// By only saving variants if they are smaller than the
// previously saved variant, we ensure that we also pick
// the highest bandwidth variant that is just-larger-than
// the video player
resolutionPlusOne = variant;
resolutionPlusOneAttribute = resolutionPlusOne.attributes.RESOLUTION;
}
}
// fallback chain of variants
return resolutionPlusOne || resolutionBestVariant || bandwidthBestVariant || sortedPlaylists[0];
};
// HLS is a source handler, not a tech. Make sure attempts to use it
// as one do not cause exceptions.
Hls.canPlaySource = function () {
return _videoJs2['default'].log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\'s techOrder.');
};
/**
* Whether the browser has built-in HLS support.
*/
Hls.supportsNativeHls = (function () {
var video = _globalDocument2['default'].createElement('video');
// native HLS is definitely not supported if HTML5 video isn't
if (!_videoJs2['default'].getComponent('Html5').isSupported()) {
return false;
}
// HLS manifests can go by many mime-types
var canPlay = [
// Apple santioned
'application/vnd.apple.mpegurl',
// Apple sanctioned for backwards compatibility
'audio/mpegurl',
// Very common
'audio/x-mpegurl',
// Very common
'application/x-mpegurl',
// Included for completeness
'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'];
return canPlay.some(function (canItPlay) {
return (/maybe|probably/i.test(video.canPlayType(canItPlay))
);
});
})();
/**
* HLS is a source handler, not a tech. Make sure attempts to use it
* as one do not cause exceptions.
*/
Hls.isSupported = function () {
return _videoJs2['default'].log.warn('HLS is no longer a tech. Please remove it from ' + 'your player\'s techOrder.');
};
var Component = _videoJs2['default'].getComponent('Component');
/**
* The Hls Handler object, where we orchestrate all of the parts
* of HLS to interact with video.js
*
* @class HlsHandler
* @extends videojs.Component
* @param {Object} source the soruce object
* @param {Tech} tech the parent tech object
* @param {Object} options optional and required options
*/
var HlsHandler = (function (_Component) {
_inherits(HlsHandler, _Component);
function HlsHandler(source, tech, options) {
var _this = this;
_classCallCheck(this, HlsHandler);
_get(Object.getPrototypeOf(HlsHandler.prototype), 'constructor', this).call(this, tech);
// tech.player() is deprecated but setup a reference to HLS for
// backwards-compatibility
if (tech.options_ && tech.options_.playerId) {
var _player = (0, _videoJs2['default'])(tech.options_.playerId);
if (!_player.hasOwnProperty('hls')) {
Object.defineProperty(_player, 'hls', {
get: function get() {
_videoJs2['default'].log.warn('player.hls is deprecated. Use player.tech.hls instead.');
return _this;
}
});
}
}
this.tech_ = tech;
this.source_ = source;
// handle global & Source Handler level options
this.options_ = _videoJs2['default'].mergeOptions(_videoJs2['default'].options.hls || {}, options.hls);
this.setOptions_();
this.bytesReceived = 0;
// listen for fullscreenchange events for this player so that we
// can adjust our quality selection quickly
this.on(_globalDocument2['default'], ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], function (event) {
var fullscreenElement = _globalDocument2['default'].fullscreenElement || _globalDocument2['default'].webkitFullscreenElement || _globalDocument2['default'].mozFullScreenElement || _globalDocument2['default'].msFullscreenElement;
if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {
_this.masterPlaylistController_.fastQualityChange_();
}
});
this.on(this.tech_, 'seeking', function () {
this.setCurrentTime(this.tech_.currentTime());
});
this.on(this.tech_, 'error', function () {
if (this.masterPlaylistController_) {
this.masterPlaylistController_.pauseLoading();
}
});
this.audioTrackChange_ = function () {
_this.masterPlaylistController_.useAudio();
};
this.on(this.tech_, 'play', this.play);
}
/**
* The Source Handler object, which informs video.js what additional
* MIME types are supported and sets up playback. It is registered
* automatically to the appropriate tech based on the capabilities of
* the browser it is running in. It is not necessary to use or modify
* this object in normal usage.
*/
_createClass(HlsHandler, [{
key: 'setOptions_',
value: function setOptions_() {
var _this2 = this;
// defaults
this.options_.withCredentials = this.options_.withCredentials || false;
// start playlist selection at a reasonable bandwidth for
// broadband internet
// 0.5 MB/s
this.options_.bandwidth = this.options_.bandwidth || 4194304;
// grab options passed to player.src
['withCredentials', 'bandwidth'].forEach(function (option) {
if (typeof _this2.source_[option] !== 'undefined') {
_this2.options_[option] = _this2.source_[option];
}
});
this.bandwidth = this.options_.bandwidth;
}
/**
* called when player.src gets called, handle a new source
*
* @param {Object} src the source object to handle
*/
}, {
key: 'src',
value: function src(_src) {
var _this3 = this;
// do nothing if the src is falsey
if (!_src) {
return;
}
this.setOptions_();
// add master playlist controller options
this.options_.url = this.source_.src;
this.options_.tech = this.tech_;
this.options_.externHls = Hls;
this.masterPlaylistController_ = new _masterPlaylistController2['default'](this.options_);
// `this` in selectPlaylist should be the HlsHandler for backwards
// compatibility with < v2
this.masterPlaylistController_.selectPlaylist = Hls.STANDARD_PLAYLIST_SELECTOR.bind(this);
// re-expose some internal objects for backwards compatibility with < v2
this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;
this.mediaSource = this.masterPlaylistController_.mediaSource;
// Proxy assignment of some properties to the master playlist
// controller. Using a custom property for backwards compatibility
// with < v2
Object.defineProperties(this, {
selectPlaylist: {
get: function get() {
return this.masterPlaylistController_.selectPlaylist;
},
set: function set(selectPlaylist) {
this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);
}
},
bandwidth: {
get: function get() {
return this.masterPlaylistController_.mainSegmentLoader_.bandwidth;
},
set: function set(bandwidth) {
this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth;
}
}
});
this.tech_.one('canplay', this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));
this.masterPlaylistController_.on('sourceopen', function () {
_this3.tech_.audioTracks().addEventListener('change', _this3.audioTrackChange_);
});
this.masterPlaylistController_.on('audioinfo', function (e) {
if (!_videoJs2['default'].browser.IS_FIREFOX || !_this3.audioInfo_ || !objectChanged(_this3.audioInfo_, e.info)) {
_this3.audioInfo_ = e.info;
return;
}
var error = 'had different audio properties (channels, sample rate, etc.) ' + 'or changed in some other way. This behavior is currently ' + 'unsupported in Firefox due to an issue: \n\n' + 'https://bugzilla.mozilla.org/show_bug.cgi?id=1247138\n\n';
var enabledTrack = undefined;
var defaultTrack = undefined;
_this3.masterPlaylistController_.audioTracks_.forEach(function (t) {
if (!defaultTrack && t['default']) {
defaultTrack = t;
}
if (!enabledTrack && t.enabled) {
enabledTrack = t;
}
});
// they did not switch audiotracks
// blacklist the current playlist
if (!enabledTrack.getLoader(_this3.activeAudioGroup_())) {
error = 'The rendition that we tried to switch to ' + error + 'Unfortunately that means we will have to blacklist ' + 'the current playlist and switch to another. Sorry!';
_this3.masterPlaylistController_.blacklistCurrentPlaylist();
} else {
error = 'The audio track \'' + enabledTrack.label + '\' that we tried to ' + ('switch to ' + error + ' Unfortunately this means we will have to ') + ('return you to the main track \'' + defaultTrack.label + '\'. Sorry!');
defaultTrack.enabled = true;
_this3.tech_.audioTracks().removeTrack(enabledTrack);
}
_videoJs2['default'].log.warn(error);
_this3.masterPlaylistController_.useAudio();
});
this.masterPlaylistController_.on('selectedinitialmedia', function () {
// clear current audioTracks
_this3.tech_.clearTracks('audio');
_this3.masterPlaylistController_.audioTracks_.forEach(function (track) {
_this3.tech_.audioTracks().addTrack(track);
});
});
// the bandwidth of the primary segment loader is our best
// estimate of overall bandwidth
this.on(this.masterPlaylistController_, 'progress', function () {
this.bandwidth = this.masterPlaylistController_.mainSegmentLoader_.bandwidth;
this.tech_.trigger('progress');
});
// do nothing if the tech has been disposed already
// this can occur if someone sets the src in player.ready(), for instance
if (!this.tech_.el()) {
return;
}
this.tech_.src(_videoJs2['default'].URL.createObjectURL(this.masterPlaylistController_.mediaSource));
}
/**
* a helper for grabbing the active audio group from MasterPlaylistController
*
* @private
*/
}, {
key: 'activeAudioGroup_',
value: function activeAudioGroup_() {
return this.masterPlaylistController_.activeAudioGroup();
}
/**
* Begin playing the video.
*/
}, {
key: 'play',
value: function play() {
this.masterPlaylistController_.play();
}
/**
* a wrapper around the function in MasterPlaylistController
*/
}, {
key: 'setCurrentTime',
value: function setCurrentTime(currentTime) {
this.masterPlaylistController_.setCurrentTime(currentTime);
}
/**
* a wrapper around the function in MasterPlaylistController
*/
}, {
key: 'duration',
value: function duration() {
return this.masterPlaylistController_.duration();
}
/**
* a wrapper around the function in MasterPlaylistController
*/
}, {
key: 'seekable',
value: function seekable() {
return this.masterPlaylistController_.seekable();
}
/**
* Abort all outstanding work and cleanup.
*/
}, {
key: 'dispose',
value: function dispose() {
if (this.masterPlaylistController_) {
this.masterPlaylistController_.dispose();
}
this.tech_.audioTracks().removeEventListener('change', this.audioTrackChange_);
_get(Object.getPrototypeOf(HlsHandler.prototype), 'dispose', this).call(this);
}
}]);
return HlsHandler;
})(Component);
var HlsSourceHandler = function HlsSourceHandler(mode) {
return {
canHandleSource: function canHandleSource(srcObj) {
// this forces video.js to skip this tech/mode if its not the one we have been
// overriden to use, by returing that we cannot handle the source.
if (_videoJs2['default'].options.hls && _videoJs2['default'].options.hls.mode && _videoJs2['default'].options.hls.mode !== mode) {
return false;
}
return HlsSourceHandler.canPlayType(srcObj.type);
},
handleSource: function handleSource(source, tech, options) {
if (mode === 'flash') {
// We need to trigger this asynchronously to give others the chance
// to bind to the event when a source is set at player creation
tech.setTimeout(function () {
tech.trigger('loadstart');
}, 1);
}
var settings = _videoJs2['default'].mergeOptions(options, { hls: { mode: mode } });
tech.hls = new HlsHandler(source, tech, settings);
tech.hls.xhr = (0, _xhr2['default'])();
// Use a global `before` function if specified on videojs.Hls.xhr
// but still allow for a per-player override
if (_videoJs2['default'].Hls.xhr.beforeRequest) {
tech.hls.xhr.beforeRequest = _videoJs2['default'].Hls.xhr.beforeRequest;
}
tech.hls.src(source.src);
return tech.hls;
},
canPlayType: function canPlayType(type) {
if (HlsSourceHandler.canPlayType(type)) {
return 'maybe';
}
return '';
}
};
};
/**
* A comparator function to sort two playlist object by bandwidth.
*
* @param {Object} left a media playlist object
* @param {Object} right a media playlist object
* @return {Number} Greater than zero if the bandwidth attribute of
* left is greater than the corresponding attribute of right. Less
* than zero if the bandwidth of right is greater than left and
* exactly zero if the two are equal.
*/
Hls.comparePlaylistBandwidth = function (left, right) {
var leftBandwidth = undefined;
var rightBandwidth = undefined;
if (left.attributes && left.attributes.BANDWIDTH) {
leftBandwidth = left.attributes.BANDWIDTH;
}
leftBandwidth = leftBandwidth || window.Number.MAX_VALUE;
if (right.attributes && right.attributes.BANDWIDTH) {
rightBandwidth = right.attributes.BANDWIDTH;
}
rightBandwidth = rightBandwidth || window.Number.MAX_VALUE;
return leftBandwidth - rightBandwidth;
};
/**
* A comparator function to sort two playlist object by resolution (width).
* @param {Object} left a media playlist object
* @param {Object} right a media playlist object
* @return {Number} Greater than zero if the resolution.width attribute of
* left is greater than the corresponding attribute of right. Less
* than zero if the resolution.width of right is greater than left and
* exactly zero if the two are equal.
*/
Hls.comparePlaylistResolution = function (left, right) {
var leftWidth = undefined;
var rightWidth = undefined;
if (left.attributes && left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {
leftWidth = left.attributes.RESOLUTION.width;
}
leftWidth = leftWidth || window.Number.MAX_VALUE;
if (right.attributes && right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {
rightWidth = right.attributes.RESOLUTION.width;
}
rightWidth = rightWidth || window.Number.MAX_VALUE;
// NOTE - Fallback to bandwidth sort as appropriate in cases where multiple renditions
// have the same media dimensions/ resolution
if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {
return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;
}
return leftWidth - rightWidth;
};
HlsSourceHandler.canPlayType = function (type) {
var mpegurlRE = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;
// favor native HLS support if it's available
if (Hls.supportsNativeHls) {
return false;
}
return mpegurlRE.test(type);
};
if (typeof _videoJs2['default'].MediaSource === 'undefined' || typeof _videoJs2['default'].URL === 'undefined') {
_videoJs2['default'].MediaSource = _videojsContribMediaSources.MediaSource;
_videoJs2['default'].URL = _videojsContribMediaSources.URL;
}
// register source handlers with the appropriate techs
if (_videojsContribMediaSources.MediaSource.supportsNativeMediaSources()) {
_videoJs2['default'].getComponent('Html5').registerSourceHandler(HlsSourceHandler('html5'));
}
if (window.Uint8Array) {
_videoJs2['default'].getComponent('Flash').registerSourceHandler(HlsSourceHandler('flash'));
}
_videoJs2['default'].HlsHandler = HlsHandler;
_videoJs2['default'].HlsSourceHandler = HlsSourceHandler;
_videoJs2['default'].Hls = Hls;
_videoJs2['default'].m3u8 = _m3u82['default'];
_videoJs2['default'].registerComponent('Hls', Hls);
_videoJs2['default'].options.hls = _videoJs2['default'].options.hls || {};
module.exports = {
Hls: Hls,
HlsHandler: HlsHandler,
HlsSourceHandler: HlsSourceHandler
};
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./bin-utils":1,"./config":2,"./decrypter":6,"./m3u8":8,"./master-playlist-controller":12,"./playlist":14,"./playlist-loader":13,"./xhr":20,"global/document":22,"videojs-contrib-media-sources":35}]},{},[53])(53)
}); | pvnr0082t/cdnjs | ajax/libs/videojs-contrib-hls/3.0.3/videojs-contrib-hls.js | JavaScript | mit | 425,301 |
// https://github.com/Gillardo/bootstrap-ui-datetime-picker
// Version: 2.2.0
// Released: 2016-01-28
angular.module('ui.bootstrap.datetimepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.position'])
.constant('uiDatetimePickerConfig', {
dateFormat: 'yyyy-MM-dd HH:mm',
defaultTime: '00:00:00',
html5Types: {
date: 'yyyy-MM-dd',
'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',
'month': 'yyyy-MM'
},
enableDate: true,
enableTime: true,
buttonBar: {
show: true,
now: {
show: true,
text: 'Now'
},
today: {
show: true,
text: 'Today'
},
clear: {
show: true,
text: 'Clear'
},
date: {
show: true,
text: 'Date'
},
time: {
show: true,
text: 'Time'
},
close: {
show: true,
text: 'Close'
}
},
closeOnDateSelection: true,
appendToBody: false,
altInputFormats: [],
ngModelOptions: { }
})
.controller('DateTimePickerController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$document', '$timeout', '$uibPosition', 'dateFilter', 'uibDateParser', 'uiDatetimePickerConfig', '$rootScope',
function (scope, element, attrs, $compile, $parse, $document, $timeout, $uibPosition, dateFilter, uibDateParser, uiDatetimePickerConfig, $rootScope) {
var dateFormat = uiDatetimePickerConfig.dateFormat,
ngModel, ngModelOptions, $popup, cache = {}, watchListeners = [],
closeOnDateSelection = angular.isDefined(attrs.closeOnDateSelection) ? scope.$parent.$eval(attrs.closeOnDateSelection) : uiDatetimePickerConfig.closeOnDateSelection,
appendToBody = angular.isDefined(attrs.datepickerAppendToBody) ? scope.$parent.$eval(attrs.datepickerAppendToBody) : uiDatetimePickerConfig.appendToBody,
altInputFormats = angular.isDefined(attrs.altInputFormats) ? scope.$parent.$eval(attrs.altInputFormats) : uiDatetimePickerConfig.altInputFormats;
this.init = function(_ngModel) {
ngModel = _ngModel;
ngModelOptions = ngModel.$options || uiDatetimePickerConfig.ngModelOptions;
scope.watchData = {};
scope.buttonBar = angular.isDefined(attrs.buttonBar) ? scope.$parent.$eval(attrs.buttonBar) : uiDatetimePickerConfig.buttonBar;
// determine which pickers should be available. Defaults to date and time
scope.enableDate = angular.isDefined(scope.enableDate) ? scope.enableDate : uiDatetimePickerConfig.enableDate;
scope.enableTime = angular.isDefined(scope.enableTime) ? scope.enableTime : uiDatetimePickerConfig.enableTime;
// default picker view
scope.showPicker = scope.enableDate ? 'date' : 'time';
var isHtml5DateInput = false;
if (uiDatetimePickerConfig.html5Types[attrs.type]) {
dateFormat = uiDatetimePickerConfig.html5Types[attrs.type];
isHtml5DateInput = true;
} else {
dateFormat = attrs.datepickerPopup || uiDatetimePickerConfig.dateFormat;
attrs.$observe('datetimePicker', function(value) {
var newDateFormat = value || uiDatetimePickerConfig.dateFormat;
if (newDateFormat !== dateFormat) {
dateFormat = newDateFormat;
ngModel.$modelValue = null;
if (!dateFormat) {
throw new Error('datetimePicker must have a date format specified.');
}
}
});
}
// popup element used to display calendar
var popupEl = angular.element('' +
'<div date-picker-wrap>' +
'<div uib-datepicker></div>' +
'</div>' +
'<div time-picker-wrap>' +
'<div uib-timepicker style="margin:0 auto"></div>' +
'</div>');
scope.ngModelOptions = angular.copy(ngModelOptions);
scope.ngModelOptions.timezone = null;
// get attributes from directive
popupEl.attr({
'ng-model': 'date',
'ng-model-options': 'ngModelOptions',
'ng-change': 'dateSelection(date)'
});
// datepicker element
var datepickerEl = angular.element(popupEl.children()[0]);
if (isHtml5DateInput) {
if (attrs.type === 'month') {
datepickerEl.attr('datepicker-mode', '"month"');
datepickerEl.attr('min-mode', 'month');
}
}
if (attrs.datepickerOptions) {
var options = scope.$parent.$eval(attrs.datepickerOptions);
if (options && options.initDate) {
scope.initDate = dateParser.fromTimezone(options.initDate, ngModelOptions.timezone);
datepickerEl.attr('init-date', 'initDate');
delete options.initDate;
}
angular.forEach(options, function (value, option) {
datepickerEl.attr(cameltoDash(option), value);
});
}
// set datepickerMode to day by default as need to create watch
// else disabled cannot pass in mode
if (!angular.isDefined(attrs['datepickerMode'])) {
attrs['datepickerMode'] = 'day';
}
if (attrs.dateDisabled) {
datepickerEl.attr('date-disabled', 'dateDisabled({ date: date, mode: mode })');
}
angular.forEach(['formatDay', 'formatMonth', 'formatYear', 'formatDayHeader', 'formatDayTitle', 'formatMonthTitle', 'showWeeks', 'startingDay', 'yearRows', 'yearColumns'], function(key) {
if (angular.isDefined(attrs[key])) {
datepickerEl.attr(cameltoDash(key), attrs[key]);
}
});
if (attrs.customClass) {
datepickerEl.attr('custom-class', 'customClass({ date: date, mode: mode })');
}
angular.forEach(['minMode', 'maxMode', 'datepickerMode', 'shortcutPropagation'], function(key) {
if (attrs[key]) {
var getAttribute = $parse(attrs[key]);
watchListeners.push(scope.$parent.$watch(getAttribute, function(value) {
scope.watchData[key] = value;
}));
datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
// Propagate changes from datepicker to outside
if (key === 'datepickerMode') {
var setAttribute = getAttribute.assign;
watchListeners.push(scope.$watch('watchData.' + key, function(value, oldvalue) {
if (angular.isFunction(setAttribute) && value !== oldvalue) {
setAttribute(scope.$parent, value);
}
}));
}
}
});
// timepicker element
var timepickerEl = angular.element(popupEl.children()[1]);
if (attrs.timepickerOptions) {
var options = scope.$parent.$eval(attrs.timepickerOptions);
angular.forEach(options, function (value, option) {
scope.watchData[option] = value;
timepickerEl.attr(cameltoDash(option), 'watchData.' + option);
});
}
// watch attrs - NOTE: minDate and maxDate are used with datePicker and timePicker. By using the minDate and maxDate
// with the timePicker, you can dynamically set the min and max time values. This cannot be done using the min and max values
// with the timePickerOptions
angular.forEach(['minDate', 'maxDate', 'initDate'], function(key) {
if (attrs[key]) {
var getAttribute = $parse(attrs[key]);
watchListeners.push(scope.$parent.$watch(getAttribute, function(value) {
scope.watchData[key] = value;
}));
datepickerEl.attr(cameltoDash(key), 'watchData.' + key);
if (key == 'minDate') {
timepickerEl.attr('min', 'watchData.minDate');
} else if (key == 'maxDate')
timepickerEl.attr('max', 'watchData.maxDate');
}
});
// do not check showWeeks attr, as should be used via datePickerOptions
if (!isHtml5DateInput) {
// Internal API to maintain the correct ng-invalid-[key] class
ngModel.$$parserName = 'datetime';
ngModel.$validators.datetime = validator;
ngModel.$parsers.unshift(parseDate);
ngModel.$formatters.push(function(value) {
if (ngModel.$isEmpty(value)) {
scope.date = value;
return value;
}
scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone);;
dateFormat = dateFormat.replace(/M!/, 'MM')
.replace(/d!/, 'dd');
return dateFilter(scope.date, dateFormat);
});
} else {
ngModel.$formatters.push(function(value) {
scope.date = uibDateParser.fromTimezone(value, ngModelOptions.timezone);;
return value;
});
}
// Detect changes in the view from the text box
ngModel.$viewChangeListeners.push(function() {
scope.date = parseDateString(ngModel.$viewValue);
});
element.bind('keydown', inputKeydownBind);
$popup = $compile(popupEl)(scope);
// Prevent jQuery cache memory leak (template is now redundant after linking)
popupEl.remove();
if (appendToBody) {
$document.find('body').append($popup);
} else {
element.after($popup);
}
};
// get text
scope.getText = function (key) {
return scope.buttonBar[key].text || uiDatetimePickerConfig.buttonBar[key].text;
};
// determine if button is to be shown or not
scope.doShow = function(key) {
if (angular.isDefined(scope.buttonBar[key].show))
return scope.buttonBar[key].show;
else
return uiDatetimePickerConfig.buttonBar[key].show;
};
// Inner change
scope.dateSelection = function (dt) {
// check if timePicker is being shown and merge dates, so that the date
// part is never changed, only the time
if (scope.enableTime && scope.showPicker === 'time') {
// only proceed if dt is a date
if (dt || dt != null) {
// check if our scope.date is null, and if so, set to todays date
if (!angular.isDefined(scope.date) || scope.date == null) {
scope.date = new Date();
}
// dt will not be undefined if the now or today button is pressed
if (dt && dt != null) {
// get the existing date and update the time
var date = new Date(scope.date);
date.setHours(dt.getHours());
date.setMinutes(dt.getMinutes());
date.setSeconds(dt.getSeconds());
date.setMilliseconds(dt.getMilliseconds());
dt = date;
}
}
}
if (angular.isDefined(dt)) {
if (!scope.date) {
var defaultTime = angular.isDefined(attrs.defaultTime) ? attrs.defaultTime : uiDatetimePickerConfig.defaultTime;
var t = new Date('2001-01-01 ' + defaultTime);
if (!isNaN(t)) {
dt.setHours(t.getHours());
dt.setMinutes(t.getMinutes());
dt.setSeconds(t.getSeconds());
dt.setMilliseconds(t.getMilliseconds());
}
}
scope.date = dt;
}
var date = scope.date ? dateFilter(scope.date, dateFormat, ngModelOptions.timezone) : null;
element.val(date);
ngModel.$setViewValue(date);
if (closeOnDateSelection) {
// do not close when using timePicker as make impossible to choose a time
if (scope.showPicker != 'time' && date != null) {
// if time is enabled, swap to timePicker
if (scope.enableTime) {
// need to delay this, else timePicker never shown
$timeout(function() {
scope.showPicker = 'time';
}, 0);
} else {
scope.close(false);
}
}
}
};
scope.keydown = function(evt) {
if (evt.which === 27) {
scope.close(false);
element[0].focus();
}
};
scope.$watch('isOpen', function (value) {
scope.dropdownStyle = {
display: value ? 'block' : 'none'
};
if (value) {
cache['openDate'] = scope.date;
var position = appendToBody ? $uibPosition.offset(element) : $uibPosition.position(element);
if (appendToBody) {
scope.dropdownStyle.top = (position.top + element.prop('offsetHeight')) +'px';
} else {
scope.dropdownStyle.top = undefined;
}
scope.dropdownStyle.left = position.left + 'px';
$timeout(function() {
scope.$broadcast('uib:datepicker.focus');
$document.bind('click', documentClickBind);
}, 0, false);
} else {
$document.unbind('click', documentClickBind);
}
});
scope.isDisabled = function(date) {
if (date === 'today' || date === 'now') {
date = new Date();
}
return scope.watchData.minDate && scope.compare(date, scope.watchData.minDate) < 0 ||
scope.watchData.maxDate && scope.compare(date, scope.watchData.maxDate) > 0;
};
scope.compare = function(date1, date2) {
return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
};
scope.select = function (opt) {
var date = null;
var isNow = opt === 'now';
if (opt === 'today' || opt == 'now') {
var now = new Date();
if (angular.isDate(scope.date)) {
date = new Date(scope.date);
date.setFullYear(now.getFullYear(), now.getMonth(), now.getDate());
date.setHours(now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
} else {
date = now;
}
}
scope.dateSelection(date);
if (opt == 'clear')
scope.close();
};
scope.close = function (closePressed) {
scope.isOpen = false;
// if enableDate and enableTime are true, reopen the picker in date mode first
if (scope.enableDate && scope.enableTime)
scope.showPicker = 'date';
// if a on-close-fn has been defined, lets call it
// we only call this if closePressed is defined!
if (angular.isDefined(closePressed))
scope.whenClosed({ args: {closePressed: closePressed, openDate: cache['openDate'] || null, closeDate: scope.date } });
element[0].focus();
};
scope.changePicker = function (evt, picker) {
evt.preventDefault();
evt.stopPropagation();
scope.showPicker = picker;
};
scope.$on('$destroy', function () {
if (scope.isOpen === true) {
if (!$rootScope.$$phase) {
scope.$apply(function() {
scope.close();
});
}
}
watchListeners.forEach(function(a) { a(); });
$popup.remove();
element.unbind('keydown', inputKeydownBind);
$document.unbind('click', documentClickBind);
});
function documentClickBind(evt) {
var popup = $popup[0];
var dpContainsTarget = element[0].contains(evt.target);
// The popup node may not be an element node
// In some browsers (IE only) element nodes have the 'contains' function
var popupContainsTarget = popup.contains !== undefined && popup.contains(evt.target);
if (scope.isOpen && !(dpContainsTarget || popupContainsTarget)) {
scope.$apply(function() {
scope.close(false);
});
}
}
function inputKeydownBind (evt) {
if (evt.which === 27 && scope.isOpen) {
evt.preventDefault();
evt.stopPropagation();
scope.$apply(function() {
scope.close(false);
});
element[0].focus();
} else if (evt.which === 40 && !scope.isOpen) {
evt.preventDefault();
evt.stopPropagation();
scope.$apply(function() {
scope.isOpen = true;
});
}
}
function cameltoDash(string) {
return string.replace(/([A-Z])/g, function ($1) { return '-' + $1.toLowerCase(); });
}
function parseDateString(viewValue) {
var date = uibDateParser.parse(viewValue, dateFormat, scope.date);
if (isNaN(date)) {
for (var i = 0; i < altInputFormats.length; i++) {
date = uibDateParser.parse(viewValue, altInputFormats[i], scope.date);
if (!isNaN(date)) {
return date;
}
}
}
return date;
}
function parseDate(viewValue) {
if (angular.isNumber(viewValue)) {
// presumably timestamp to date object
viewValue = new Date(viewValue);
}
if (!viewValue) {
return null;
} else if (angular.isDate(viewValue) && !isNaN(viewValue)) {
return viewValue;
} else if (angular.isString(viewValue)) {
var date = parseDateString(viewValue);
if (!isNaN(date)) {
return uibDateParser.toTimezone(date, ngModelOptions.timezone);
}
return undefined;
} else {
return undefined;
}
}
function validator(modelValue, viewValue) {
var value = modelValue || viewValue;
if (!(attrs.ngRequired || attrs.required) && !value) {
return true;
}
if (angular.isNumber(value)) {
value = new Date(value);
}
if (!value) {
return true;
} else if (angular.isDate(value) && !isNaN(value)) {
return true;
} else if (angular.isDate(new Date(value)) && !isNaN(new Date(value).valueOf())) {
return true;
} else if (angular.isString(value)) {
return !isNaN(parseDateString(viewValue));
} else {
return false;
}
}
}])
.directive('datetimePicker', function () {
return {
restrict: 'A',
require: ['ngModel', 'datetimePicker'],
controller: 'DateTimePickerController',
scope: {
isOpen: '=?',
enableDate: '=?',
enableTime: '=?',
dateDisabled: '&',
customClass: '&',
whenClosed: '&'
},
link: function (scope, element, attrs, ctrls) {
var ngModel = ctrls[0],
ctrl = ctrls[1];
ctrl.init(ngModel);
}
};
})
.directive('datePickerWrap', function () {
return {
restrict: 'EA',
replace: true,
transclude: true,
templateUrl: 'template/date-picker.html'
};
})
.directive('timePickerWrap', function () {
return {
restrict: 'EA',
replace: true,
transclude: true,
templateUrl: 'template/time-picker.html'
};
});
angular.module('ui.bootstrap.datetimepicker').run(['$templateCache', function($templateCache) {
'use strict';
$templateCache.put('template/date-picker.html',
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=date-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('today') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('today')\" ng-click=\"select('today')\" ng-disabled=\"isDisabled('today')\">{{ getText('today') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('time') && enableTime) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('time') && enableTime\" ng-click=\"changePicker($event, 'time')\">{{ getText('time')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span></li></ul>"
);
$templateCache.put('template/time-picker.html',
"<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'time'\" ng-style=dropdownStyle style=left:inherit ng-keydown=keydown($event) ng-click=$event.stopPropagation()><li style=\"padding:0 5px 5px 5px\" class=time-picker-menu><div ng-transclude></div></li><li style=padding:5px ng-if=buttonBar.show><span class=\"btn-group pull-left\" style=margin-right:10px ng-if=\"doShow('now') || doShow('clear')\"><button type=button class=\"btn btn-sm btn-info\" ng-if=\"doShow('now')\" ng-click=\"select('now')\" ng-disabled=\"isDisabled('now')\">{{ getText('now') }}</button> <button type=button class=\"btn btn-sm btn-danger\" ng-if=\"doShow('clear')\" ng-click=\"select('clear')\">{{ getText('clear') }}</button></span> <span class=\"btn-group pull-right\" ng-if=\"(doShow('date') && enableDate) || doShow('close')\"><button type=button class=\"btn btn-sm btn-default\" ng-if=\"doShow('date') && enableDate\" ng-click=\"changePicker($event, 'date')\">{{ getText('date')}}</button> <button type=button class=\"btn btn-sm btn-success\" ng-if=\"doShow('close')\" ng-click=close(true)>{{ getText('close') }}</button></span></li></ul>"
);
}]);
| iwdmb/cdnjs | ajax/libs/bootstrap-ui-datetime-picker/2.2.0/datetime-picker.js | JavaScript | mit | 25,969 |
<?php
/*
* This file is part of the FOSRestBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\RestBundle\Tests\Request;
use FOS\RestBundle\Controller\Annotations\NamePrefix;
use FOS\RestBundle\Controller\Annotations\QueryParam;
use FOS\RestBundle\Request\ParamReader;
/**
* QueryParamReader test.
*
* @author Alexander <iam.asm89@gmail.com>
*/
class ParamReaderTest extends \PHPUnit_Framework_TestCase
{
private $paramReader;
/**
* Test setup.
*/
public function setup()
{
$annotationReader = $this->getMock('Doctrine\Common\Annotations\Reader');
$methodAnnotations = array();
$foo = new QueryParam();
$foo->name = 'foo';
$foo->requirements = '\d+';
$foo->description = 'The foo';
$methodAnnotations[] = $foo;
$bar = new QueryParam();
$bar->name = 'bar';
$bar->requirements = '\d+';
$bar->description = 'The bar';
$methodAnnotations[] = $bar;
$methodAnnotations[] = new NamePrefix(array());
$annotationReader
->expects($this->any())
->method('getMethodAnnotations')
->will($this->returnValue($methodAnnotations));
$classAnnotations = array();
$baz = new QueryParam();
$baz->name = 'baz';
$baz->requirements = '\d+';
$baz->description = 'The baz';
$classAnnotations[] = $baz;
$mikz = new QueryParam();
$mikz->name = 'mikz';
$mikz->requirements = '\d+';
$mikz->description = 'The real mikz';
$classAnnotations[] = $mikz;
$not = new NamePrefix(array());
$classAnnotations[] = $not;
$annotationReader
->expects($this->any())
->method('getClassAnnotations')
->will($this->returnValue($classAnnotations));
$this->paramReader = new ParamReader($annotationReader);
}
/**
* Test that only QueryParam annotations are returned.
*/
public function testReadsOnlyParamAnnotations()
{
$annotations = $this->paramReader->read(new \ReflectionClass(__CLASS__), 'setup');
$this->assertCount(4, $annotations);
foreach ($annotations as $name => $annotation) {
$this->assertThat($annotation, $this->isInstanceOf('FOS\RestBundle\Controller\Annotations\Param'));
$this->assertEquals($annotation->name, $name);
}
}
/**
* @expectedException InvalidArgumentException
* @expectedExceptionMessage Class 'FOS\RestBundle\Tests\Request\ParamReaderTest' has no method 'foo' method.
*/
public function testExceptionOnNonExistingMethod()
{
$this->paramReader->read(new \ReflectionClass(__CLASS__), 'foo');
}
}
| IUQOL/Capacitation | vendor/friendsofsymfony/rest-bundle/FOS/RestBundle/Tests/Request/ParamReaderTest.php | PHP | mit | 2,951 |
/*! JointJS v0.9.7-rappid.4 - JavaScript diagramming library 2016-05-24
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
joint.shapes.chess={},joint.shapes.chess.KingWhite=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="fill:none; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"><path d="M 22.5,11.63 L 22.5,6" style="fill:none; stroke:#000000; stroke-linejoin:miter;" /> <path d="M 20,8 L 25,8" style="fill:none; stroke:#000000; stroke-linejoin:miter;" /> <path d="M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25" style="fill:#ffffff; stroke:#000000; stroke-linecap:butt; stroke-linejoin:miter;" /> <path d="M 11.5,37 C 17,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 19,16 9.5,13 6.5,19.5 C 3.5,25.5 11.5,29.5 11.5,29.5 L 11.5,37 z " style="fill:#ffffff; stroke:#000000;" /> <path d="M 11.5,30 C 17,27 27,27 32.5,30" style="fill:none; stroke:#000000;" /> <path d="M 11.5,33.5 C 17,30.5 27,30.5 32.5,33.5" style="fill:none; stroke:#000000;" /> <path d="M 11.5,37 C 17,34 27,34 32.5,37" style="fill:none; stroke:#000000;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.KingWhite",size:{width:42,height:38}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.KingBlack=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="fill:none; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <path d="M 22.5,11.63 L 22.5,6" style="fill:none; stroke:#000000; stroke-linejoin:miter;" id="path6570" /> <path d="M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25" style="fill:#000000;fill-opacity:1; stroke-linecap:butt; stroke-linejoin:miter;" /> <path d="M 11.5,37 C 17,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 19,16 9.5,13 6.5,19.5 C 3.5,25.5 11.5,29.5 11.5,29.5 L 11.5,37 z " style="fill:#000000; stroke:#000000;" /> <path d="M 20,8 L 25,8" style="fill:none; stroke:#000000; stroke-linejoin:miter;" /> <path d="M 32,29.5 C 32,29.5 40.5,25.5 38.03,19.85 C 34.15,14 25,18 22.5,24.5 L 22.51,26.6 L 22.5,24.5 C 20,18 9.906,14 6.997,19.85 C 4.5,25.5 11.85,28.85 11.85,28.85" style="fill:none; stroke:#ffffff;" /> <path d="M 11.5,30 C 17,27 27,27 32.5,30 M 11.5,33.5 C 17,30.5 27,30.5 32.5,33.5 M 11.5,37 C 17,34 27,34 32.5,37" style="fill:none; stroke:#ffffff;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.KingBlack",size:{width:42,height:38}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.QueenWhite=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:#ffffff; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <path d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z" transform="translate(-1,-1)" /> <path d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z" transform="translate(15.5,-5.5)" /> <path d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z" transform="translate(32,-1)" /> <path d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z" transform="translate(7,-4.5)" /> <path d="M 9 13 A 2 2 0 1 1 5,13 A 2 2 0 1 1 9 13 z" transform="translate(24,-4)" /> <path d="M 9,26 C 17.5,24.5 30,24.5 36,26 L 38,14 L 31,25 L 31,11 L 25.5,24.5 L 22.5,9.5 L 19.5,24.5 L 14,10.5 L 14,25 L 7,14 L 9,26 z " style="stroke-linecap:butt;" /> <path d="M 9,26 C 9,28 10.5,28 11.5,30 C 12.5,31.5 12.5,31 12,33.5 C 10.5,34.5 10.5,36 10.5,36 C 9,37.5 11,38.5 11,38.5 C 17.5,39.5 27.5,39.5 34,38.5 C 34,38.5 35.5,37.5 34,36 C 34,36 34.5,34.5 33,33.5 C 32.5,31 32.5,31.5 33.5,30 C 34.5,28 36,28 36,26 C 27.5,24.5 17.5,24.5 9,26 z " style="stroke-linecap:butt;" /> <path d="M 11.5,30 C 15,29 30,29 33.5,30" style="fill:none;" /> <path d="M 12,33.5 C 18,32.5 27,32.5 33,33.5" style="fill:none;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.QueenWhite",size:{width:42,height:38}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.QueenBlack=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:#000000; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <g style="fill:#000000; stroke:none;"> <circle cx="6" cy="12" r="2.75" /> <circle cx="14" cy="9" r="2.75" /> <circle cx="22.5" cy="8" r="2.75" /> <circle cx="31" cy="9" r="2.75" /> <circle cx="39" cy="12" r="2.75" /> </g> <path d="M 9,26 C 17.5,24.5 30,24.5 36,26 L 38.5,13.5 L 31,25 L 30.7,10.9 L 25.5,24.5 L 22.5,10 L 19.5,24.5 L 14.3,10.9 L 14,25 L 6.5,13.5 L 9,26 z" style="stroke-linecap:butt; stroke:#000000;" /> <path d="M 9,26 C 9,28 10.5,28 11.5,30 C 12.5,31.5 12.5,31 12,33.5 C 10.5,34.5 10.5,36 10.5,36 C 9,37.5 11,38.5 11,38.5 C 17.5,39.5 27.5,39.5 34,38.5 C 34,38.5 35.5,37.5 34,36 C 34,36 34.5,34.5 33,33.5 C 32.5,31 32.5,31.5 33.5,30 C 34.5,28 36,28 36,26 C 27.5,24.5 17.5,24.5 9,26 z" style="stroke-linecap:butt;" /> <path d="M 11,38.5 A 35,35 1 0 0 34,38.5" style="fill:none; stroke:#000000; stroke-linecap:butt;" /> <path d="M 11,29 A 35,35 1 0 1 34,29" style="fill:none; stroke:#ffffff;" /> <path d="M 12.5,31.5 L 32.5,31.5" style="fill:none; stroke:#ffffff;" /> <path d="M 11.5,34.5 A 35,35 1 0 0 33.5,34.5" style="fill:none; stroke:#ffffff;" /> <path d="M 10.5,37.5 A 35,35 1 0 0 34.5,37.5" style="fill:none; stroke:#ffffff;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.QueenBlack",size:{width:42,height:38}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.RookWhite=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:#ffffff; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <path d="M 9,39 L 36,39 L 36,36 L 9,36 L 9,39 z " style="stroke-linecap:butt;" /> <path d="M 12,36 L 12,32 L 33,32 L 33,36 L 12,36 z " style="stroke-linecap:butt;" /> <path d="M 11,14 L 11,9 L 15,9 L 15,11 L 20,11 L 20,9 L 25,9 L 25,11 L 30,11 L 30,9 L 34,9 L 34,14" style="stroke-linecap:butt;" /> <path d="M 34,14 L 31,17 L 14,17 L 11,14" /> <path d="M 31,17 L 31,29.5 L 14,29.5 L 14,17" style="stroke-linecap:butt; stroke-linejoin:miter;" /> <path d="M 31,29.5 L 32.5,32 L 12.5,32 L 14,29.5" /> <path d="M 11,14 L 34,14" style="fill:none; stroke:#000000; stroke-linejoin:miter;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.RookWhite",size:{width:32,height:34}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.RookBlack=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:#000000; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <path d="M 9,39 L 36,39 L 36,36 L 9,36 L 9,39 z " style="stroke-linecap:butt;" /> <path d="M 12.5,32 L 14,29.5 L 31,29.5 L 32.5,32 L 12.5,32 z " style="stroke-linecap:butt;" /> <path d="M 12,36 L 12,32 L 33,32 L 33,36 L 12,36 z " style="stroke-linecap:butt;" /> <path d="M 14,29.5 L 14,16.5 L 31,16.5 L 31,29.5 L 14,29.5 z " style="stroke-linecap:butt;stroke-linejoin:miter;" /> <path d="M 14,16.5 L 11,14 L 34,14 L 31,16.5 L 14,16.5 z " style="stroke-linecap:butt;" /> <path d="M 11,14 L 11,9 L 15,9 L 15,11 L 20,11 L 20,9 L 25,9 L 25,11 L 30,11 L 30,9 L 34,9 L 34,14 L 11,14 z " style="stroke-linecap:butt;" /> <path d="M 12,35.5 L 33,35.5 L 33,35.5" style="fill:none; stroke:#ffffff; stroke-width:1; stroke-linejoin:miter;" /> <path d="M 13,31.5 L 32,31.5" style="fill:none; stroke:#ffffff; stroke-width:1; stroke-linejoin:miter;" /> <path d="M 14,29.5 L 31,29.5" style="fill:none; stroke:#ffffff; stroke-width:1; stroke-linejoin:miter;" /> <path d="M 14,16.5 L 31,16.5" style="fill:none; stroke:#ffffff; stroke-width:1; stroke-linejoin:miter;" /> <path d="M 11,14 L 34,14" style="fill:none; stroke:#ffffff; stroke-width:1; stroke-linejoin:miter;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.RookBlack",size:{width:32,height:34}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.BishopWhite=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:none; fill-rule:evenodd; fill-opacity:1; stroke:#000000; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <g style="fill:#ffffff; stroke:#000000; stroke-linecap:butt;"> <path d="M 9,36 C 12.39,35.03 19.11,36.43 22.5,34 C 25.89,36.43 32.61,35.03 36,36 C 36,36 37.65,36.54 39,38 C 38.32,38.97 37.35,38.99 36,38.5 C 32.61,37.53 25.89,38.96 22.5,37.5 C 19.11,38.96 12.39,37.53 9,38.5 C 7.646,38.99 6.677,38.97 6,38 C 7.354,36.06 9,36 9,36 z" /> <path d="M 15,32 C 17.5,34.5 27.5,34.5 30,32 C 30.5,30.5 30,30 30,30 C 30,27.5 27.5,26 27.5,26 C 33,24.5 33.5,14.5 22.5,10.5 C 11.5,14.5 12,24.5 17.5,26 C 17.5,26 15,27.5 15,30 C 15,30 14.5,30.5 15,32 z" /> <path d="M 25 8 A 2.5 2.5 0 1 1 20,8 A 2.5 2.5 0 1 1 25 8 z" /> </g> <path d="M 17.5,26 L 27.5,26 M 15,30 L 30,30 M 22.5,15.5 L 22.5,20.5 M 20,18 L 25,18" style="fill:none; stroke:#000000; stroke-linejoin:miter;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.BishopWhite",size:{width:38,height:38}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.BishopBlack=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:none; fill-rule:evenodd; fill-opacity:1; stroke:#000000; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <g style="fill:#000000; stroke:#000000; stroke-linecap:butt;"> <path d="M 9,36 C 12.39,35.03 19.11,36.43 22.5,34 C 25.89,36.43 32.61,35.03 36,36 C 36,36 37.65,36.54 39,38 C 38.32,38.97 37.35,38.99 36,38.5 C 32.61,37.53 25.89,38.96 22.5,37.5 C 19.11,38.96 12.39,37.53 9,38.5 C 7.646,38.99 6.677,38.97 6,38 C 7.354,36.06 9,36 9,36 z" /> <path d="M 15,32 C 17.5,34.5 27.5,34.5 30,32 C 30.5,30.5 30,30 30,30 C 30,27.5 27.5,26 27.5,26 C 33,24.5 33.5,14.5 22.5,10.5 C 11.5,14.5 12,24.5 17.5,26 C 17.5,26 15,27.5 15,30 C 15,30 14.5,30.5 15,32 z" /> <path d="M 25 8 A 2.5 2.5 0 1 1 20,8 A 2.5 2.5 0 1 1 25 8 z" /> </g> <path d="M 17.5,26 L 27.5,26 M 15,30 L 30,30 M 22.5,15.5 L 22.5,20.5 M 20,18 L 25,18" style="fill:none; stroke:#ffffff; stroke-linejoin:miter;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.BishopBlack",size:{width:38,height:38}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.KnightWhite=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:none; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <path d="M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18" style="fill:#ffffff; stroke:#000000;" /> <path d="M 24,18 C 24.38,20.91 18.45,25.37 16,27 C 13,29 13.18,31.34 11,31 C 9.958,30.06 12.41,27.96 11,28 C 10,28 11.19,29.23 10,30 C 9,30 5.997,31 6,26 C 6,24 12,14 12,14 C 12,14 13.89,12.1 14,10.5 C 13.27,9.506 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.28,8.008 21,7 C 22,7 22,10 22,10" style="fill:#ffffff; stroke:#000000;" /> <path d="M 9.5 25.5 A 0.5 0.5 0 1 1 8.5,25.5 A 0.5 0.5 0 1 1 9.5 25.5 z" style="fill:#000000; stroke:#000000;" /> <path d="M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z" transform="matrix(0.866,0.5,-0.5,0.866,9.693,-5.173)" style="fill:#000000; stroke:#000000;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.KnightWhite",size:{width:38,height:37}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.KnightBlack=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><g style="opacity:1; fill:none; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;"> <path d="M 22,10 C 32.5,11 38.5,18 38,39 L 15,39 C 15,30 25,32.5 23,18" style="fill:#000000; stroke:#000000;" /> <path d="M 24,18 C 24.38,20.91 18.45,25.37 16,27 C 13,29 13.18,31.34 11,31 C 9.958,30.06 12.41,27.96 11,28 C 10,28 11.19,29.23 10,30 C 9,30 5.997,31 6,26 C 6,24 12,14 12,14 C 12,14 13.89,12.1 14,10.5 C 13.27,9.506 13.5,8.5 13.5,7.5 C 14.5,6.5 16.5,10 16.5,10 L 18.5,10 C 18.5,10 19.28,8.008 21,7 C 22,7 22,10 22,10" style="fill:#000000; stroke:#000000;" /> <path d="M 9.5 25.5 A 0.5 0.5 0 1 1 8.5,25.5 A 0.5 0.5 0 1 1 9.5 25.5 z" style="fill:#ffffff; stroke:#ffffff;" /> <path d="M 15 15.5 A 0.5 1.5 0 1 1 14,15.5 A 0.5 1.5 0 1 1 15 15.5 z" transform="matrix(0.866,0.5,-0.5,0.866,9.693,-5.173)" style="fill:#ffffff; stroke:#ffffff;" /> <path d="M 24.55,10.4 L 24.1,11.85 L 24.6,12 C 27.75,13 30.25,14.49 32.5,18.75 C 34.75,23.01 35.75,29.06 35.25,39 L 35.2,39.5 L 37.45,39.5 L 37.5,39 C 38,28.94 36.62,22.15 34.25,17.66 C 31.88,13.17 28.46,11.02 25.06,10.5 L 24.55,10.4 z " style="fill:#ffffff; stroke:none;" /> </g></g></g>',defaults:joint.util.deepSupplement({type:"chess.KnightBlack",size:{width:38,height:37}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.PawnWhite=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><path d="M 22,9 C 19.79,9 18,10.79 18,13 C 18,13.89 18.29,14.71 18.78,15.38 C 16.83,16.5 15.5,18.59 15.5,21 C 15.5,23.03 16.44,24.84 17.91,26.03 C 14.91,27.09 10.5,31.58 10.5,39.5 L 33.5,39.5 C 33.5,31.58 29.09,27.09 26.09,26.03 C 27.56,24.84 28.5,23.03 28.5,21 C 28.5,18.59 27.17,16.5 25.22,15.38 C 25.71,14.71 26,13.89 26,13 C 26,10.79 24.21,9 22,9 z " style="opacity:1; fill:#ffffff; fill-opacity:1; fill-rule:nonzero; stroke:#000000; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;" /></g></g>',defaults:joint.util.deepSupplement({type:"chess.PawnWhite",size:{width:28,height:33}},joint.shapes.basic.Generic.prototype.defaults)}),joint.shapes.chess.PawnBlack=joint.shapes.basic.Generic.extend({markup:'<g class="rotatable"><g class="scalable"><path d="M 22,9 C 19.79,9 18,10.79 18,13 C 18,13.89 18.29,14.71 18.78,15.38 C 16.83,16.5 15.5,18.59 15.5,21 C 15.5,23.03 16.44,24.84 17.91,26.03 C 14.91,27.09 10.5,31.58 10.5,39.5 L 33.5,39.5 C 33.5,31.58 29.09,27.09 26.09,26.03 C 27.56,24.84 28.5,23.03 28.5,21 C 28.5,18.59 27.17,16.5 25.22,15.38 C 25.71,14.71 26,13.89 26,13 C 26,10.79 24.21,9 22,9 z " style="opacity:1; fill:#000000; fill-opacity:1; fill-rule:nonzero; stroke:#000000; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:miter; stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;" /></g></g>',defaults:joint.util.deepSupplement({type:"chess.PawnBlack",size:{width:28,height:33}},joint.shapes.basic.Generic.prototype.defaults)}); | kennynaoh/cdnjs | ajax/libs/jointjs/0.9.7-rappid.6/joint.shapes.chess.min.js | JavaScript | mit | 16,720 |
/**
* ag-grid - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
* @version v4.2.2
* @link http://www.ag-grid.com/
* @license MIT
*/
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 __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
var utils_1 = require("../utils");
var columnGroup_1 = require("../entities/columnGroup");
var column_1 = require("../entities/column");
var gridOptionsWrapper_1 = require("../gridOptionsWrapper");
var expressionService_1 = require("../expressionService");
var balancedColumnTreeBuilder_1 = require("./balancedColumnTreeBuilder");
var displayedGroupCreator_1 = require("./displayedGroupCreator");
var autoWidthCalculator_1 = require("../rendering/autoWidthCalculator");
var eventService_1 = require("../eventService");
var columnUtils_1 = require("./columnUtils");
var logger_1 = require("../logger");
var events_1 = require("../events");
var columnChangeEvent_1 = require("../columnChangeEvent");
var originalColumnGroup_1 = require("../entities/originalColumnGroup");
var groupInstanceIdCreator_1 = require("./groupInstanceIdCreator");
var functions_1 = require("../functions");
var context_1 = require("../context/context");
var gridPanel_1 = require("../gridPanel/gridPanel");
var pivotService_1 = require("./pivotService");
var ColumnApi = (function () {
function ColumnApi() {
}
ColumnApi.prototype.sizeColumnsToFit = function (gridWidth) { this._columnController.sizeColumnsToFit(gridWidth); };
ColumnApi.prototype.setColumnGroupOpened = function (group, newValue, instanceId) { this._columnController.setColumnGroupOpened(group, newValue, instanceId); };
ColumnApi.prototype.getColumnGroup = function (name, instanceId) { return this._columnController.getColumnGroup(name, instanceId); };
ColumnApi.prototype.getDisplayNameForCol = function (column) { return this._columnController.getDisplayNameForCol(column); };
ColumnApi.prototype.getColumn = function (key) { return this._columnController.getOriginalColumn(key); };
ColumnApi.prototype.setColumnState = function (columnState) { return this._columnController.setColumnState(columnState); };
ColumnApi.prototype.getColumnState = function () { return this._columnController.getColumnState(); };
ColumnApi.prototype.resetColumnState = function () { this._columnController.resetColumnState(); };
ColumnApi.prototype.isPinning = function () { return this._columnController.isPinningLeft() || this._columnController.isPinningRight(); };
ColumnApi.prototype.isPinningLeft = function () { return this._columnController.isPinningLeft(); };
ColumnApi.prototype.isPinningRight = function () { return this._columnController.isPinningRight(); };
ColumnApi.prototype.getDisplayedColAfter = function (col) { return this._columnController.getDisplayedColAfter(col); };
ColumnApi.prototype.getDisplayedColBefore = function (col) { return this._columnController.getDisplayedColBefore(col); };
ColumnApi.prototype.setColumnVisible = function (key, visible) { this._columnController.setColumnVisible(key, visible); };
ColumnApi.prototype.setColumnsVisible = function (keys, visible) { this._columnController.setColumnsVisible(keys, visible); };
ColumnApi.prototype.setColumnPinned = function (key, pinned) { this._columnController.setColumnPinned(key, pinned); };
ColumnApi.prototype.setColumnsPinned = function (keys, pinned) { this._columnController.setColumnsPinned(keys, pinned); };
ColumnApi.prototype.getAllColumns = function () { return this._columnController.getAllOriginalColumns(); };
ColumnApi.prototype.getDisplayedLeftColumns = function () { return this._columnController.getDisplayedLeftColumns(); };
ColumnApi.prototype.getDisplayedCenterColumns = function () { return this._columnController.getDisplayedCenterColumns(); };
ColumnApi.prototype.getDisplayedRightColumns = function () { return this._columnController.getDisplayedRightColumns(); };
ColumnApi.prototype.getAllDisplayedColumns = function () { return this._columnController.getAllDisplayedColumns(); };
ColumnApi.prototype.getRowGroupColumns = function () { return this._columnController.getRowGroupColumns(); };
ColumnApi.prototype.getValueColumns = function () { return this._columnController.getValueColumns(); };
ColumnApi.prototype.moveColumn = function (fromIndex, toIndex) { this._columnController.moveColumnByIndex(fromIndex, toIndex); };
ColumnApi.prototype.moveRowGroupColumn = function (fromIndex, toIndex) { this._columnController.moveRowGroupColumn(fromIndex, toIndex); };
ColumnApi.prototype.setColumnAggFunction = function (column, aggFunc) { this._columnController.setColumnAggFunction(column, aggFunc); };
ColumnApi.prototype.setColumnWidth = function (key, newWidth, finished) {
if (finished === void 0) { finished = true; }
this._columnController.setColumnWidth(key, newWidth, finished);
};
ColumnApi.prototype.removeValueColumn = function (column) { this._columnController.removeValueColumn(column); };
ColumnApi.prototype.addValueColumn = function (column) { this._columnController.addValueColumn(column); };
ColumnApi.prototype.setRowGroupColumns = function (colKeys) { this._columnController.setRowGroupColumns(colKeys); };
ColumnApi.prototype.removeRowGroupColumn = function (colKey) { this._columnController.removeRowGroupColumn(colKey); };
ColumnApi.prototype.removeRowGroupColumns = function (colKeys) { this._columnController.removeRowGroupColumns(colKeys); };
ColumnApi.prototype.addRowGroupColumn = function (colKey) { this._columnController.addRowGroupColumn(colKey); };
ColumnApi.prototype.addRowGroupColumns = function (colKeys) { this._columnController.addRowGroupColumns(colKeys); };
ColumnApi.prototype.setPivotColumns = function (colKeys) { this._columnController.setPivotColumns(colKeys); };
ColumnApi.prototype.removePivotColumn = function (colKey) { this._columnController.removePivotColumn(colKey); };
ColumnApi.prototype.removePivotColumns = function (colKeys) { this._columnController.removePivotColumns(colKeys); };
ColumnApi.prototype.addPivotColumn = function (colKey) { this._columnController.addPivotColumn(colKey); };
ColumnApi.prototype.addPivotColumns = function (colKeys) { this._columnController.addPivotColumns(colKeys); };
ColumnApi.prototype.getLeftDisplayedColumnGroups = function () { return this._columnController.getLeftDisplayedColumnGroups(); };
ColumnApi.prototype.getCenterDisplayedColumnGroups = function () { return this._columnController.getCenterDisplayedColumnGroups(); };
ColumnApi.prototype.getRightDisplayedColumnGroups = function () { return this._columnController.getRightDisplayedColumnGroups(); };
ColumnApi.prototype.getAllDisplayedColumnGroups = function () { return this._columnController.getAllDisplayedColumnGroups(); };
ColumnApi.prototype.autoSizeColumn = function (key) { return this._columnController.autoSizeColumn(key); };
ColumnApi.prototype.autoSizeColumns = function (keys) { return this._columnController.autoSizeColumns(keys); };
ColumnApi.prototype.columnGroupOpened = function (group, newValue) {
console.error('ag-Grid: columnGroupOpened no longer exists, use setColumnGroupOpened');
this.setColumnGroupOpened(group, newValue);
};
ColumnApi.prototype.hideColumns = function (colIds, hide) {
console.error('ag-Grid: hideColumns is deprecated, use setColumnsVisible');
this._columnController.setColumnsVisible(colIds, !hide);
};
ColumnApi.prototype.hideColumn = function (colId, hide) {
console.error('ag-Grid: hideColumn is deprecated, use setColumnVisible');
this._columnController.setColumnVisible(colId, !hide);
};
ColumnApi.prototype.setState = function (columnState) {
console.error('ag-Grid: setState is deprecated, use setColumnState');
return this.setColumnState(columnState);
};
ColumnApi.prototype.getState = function () {
console.error('ag-Grid: hideColumn is getState, use getColumnState');
return this.getColumnState();
};
ColumnApi.prototype.resetState = function () {
console.error('ag-Grid: hideColumn is resetState, use resetColumnState');
this.resetColumnState();
};
__decorate([
context_1.Autowired('columnController'),
__metadata('design:type', ColumnController)
], ColumnApi.prototype, "_columnController", void 0);
ColumnApi = __decorate([
context_1.Bean('columnApi'),
__metadata('design:paramtypes', [])
], ColumnApi);
return ColumnApi;
})();
exports.ColumnApi = ColumnApi;
var ColumnController = (function () {
function ColumnController() {
// header row count, based on user provided columns
this.originalHeaderRowCount = 0;
// header row count, either above, or based on pivoting if we are pivoting
this.gridHeaderRowCount = 0;
// these are the lists used by the rowRenderer to render nodes. almost the leaf nodes of the above
// displayed trees, however it also takes into account if the groups are open or not.
this.displayedLeftColumns = [];
this.displayedRightColumns = [];
this.displayedCenterColumns = [];
this.ready = false;
}
ColumnController.prototype.init = function () {
if (this.gridOptionsWrapper.getColumnDefs()) {
this.setColumnDefs(this.gridOptionsWrapper.getColumnDefs());
}
// this.eventService.addEventListener(Events.EVENT_PIVOT_VALUE_CHANGED, this.onPivotValueChanged.bind(this));
};
ColumnController.prototype.isReduce = function () {
return this.pivotColumns.length > 0;
};
ColumnController.prototype.setBeans = function (loggerFactory) {
this.logger = loggerFactory.create('ColumnController');
};
ColumnController.prototype.setFirstRightAndLastLeftPinned = function () {
var lastLeft = this.displayedLeftColumns ? this.displayedLeftColumns[this.displayedLeftColumns.length - 1] : null;
var firstRight = this.displayedRightColumns ? this.displayedRightColumns[0] : null;
this.originalColumns.forEach(function (column) {
column.setLastLeftPinned(column === lastLeft);
column.setFirstRightPinned(column === firstRight);
});
};
ColumnController.prototype.autoSizeColumns = function (keys) {
var _this = this;
this.actionOnColumns(keys, function (column) {
var requiredWidth = _this.autoWidthCalculator.getPreferredWidthForColumn(column);
if (requiredWidth > 0) {
var newWidth = _this.normaliseColumnWidth(column, requiredWidth);
column.setActualWidth(newWidth);
}
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_RESIZED).withFinished(true);
});
};
ColumnController.prototype.autoSizeColumn = function (key) {
this.autoSizeColumns([key]);
};
ColumnController.prototype.autoSizeAllColumns = function () {
var allDisplayedColumns = this.getAllDisplayedColumns();
this.autoSizeColumns(allDisplayedColumns);
};
ColumnController.prototype.getColumnsFromTree = function (rootColumns) {
var result = [];
recursiveFindColumns(rootColumns);
return result;
function recursiveFindColumns(childColumns) {
for (var i = 0; i < childColumns.length; i++) {
var child = childColumns[i];
if (child instanceof column_1.Column) {
result.push(child);
}
else if (child instanceof originalColumnGroup_1.OriginalColumnGroup) {
recursiveFindColumns(child.getChildren());
}
}
}
};
ColumnController.prototype.getAllDisplayedColumnGroups = function () {
if (this.displayedLeftColumnTree && this.displayedRightColumnTree && this.displayedCentreColumnTree) {
return this.displayedLeftColumnTree
.concat(this.displayedCentreColumnTree)
.concat(this.displayedRightColumnTree);
}
else {
return null;
}
};
ColumnController.prototype.getOriginalColumnTree = function () {
return this.originalBalancedTree;
};
// + gridPanel -> for resizing the body and setting top margin
ColumnController.prototype.getHeaderRowCount = function () {
return this.gridHeaderRowCount;
};
// + headerRenderer -> setting pinned body width
ColumnController.prototype.getLeftDisplayedColumnGroups = function () {
return this.displayedLeftColumnTree;
};
// + headerRenderer -> setting pinned body width
ColumnController.prototype.getRightDisplayedColumnGroups = function () {
return this.displayedRightColumnTree;
};
// + headerRenderer -> setting pinned body width
ColumnController.prototype.getCenterDisplayedColumnGroups = function () {
return this.displayedCentreColumnTree;
};
ColumnController.prototype.getDisplayedColumnGroups = function (type) {
switch (type) {
case column_1.Column.PINNED_LEFT: return this.getLeftDisplayedColumnGroups();
case column_1.Column.PINNED_RIGHT: return this.getRightDisplayedColumnGroups();
default: return this.getCenterDisplayedColumnGroups();
}
};
// gridPanel -> ensureColumnVisible
ColumnController.prototype.isColumnDisplayed = function (column) {
return this.getAllDisplayedColumns().indexOf(column) >= 0;
};
// + csvCreator
ColumnController.prototype.getAllDisplayedColumns = function () {
// order we add the arrays together is important, so the result
// has the columns left to right, as they appear on the screen.
return this.displayedLeftColumns
.concat(this.displayedCenterColumns)
.concat(this.displayedRightColumns);
};
// used by:
// + angularGrid -> setting pinned body width
// todo: this needs to be cached
ColumnController.prototype.getPinnedLeftContainerWidth = function () {
return this.getWithOfColsInList(this.displayedLeftColumns);
};
// todo: this needs to be cached
ColumnController.prototype.getPinnedRightContainerWidth = function () {
return this.getWithOfColsInList(this.displayedRightColumns);
};
ColumnController.prototype.addRowGroupColumns = function (keys) {
var _this = this;
keys.forEach(function (key) {
var column = _this.getOriginalColumn(key);
if (column) {
_this.rowGroupColumns.push(column);
}
});
// because we could be taking out columns, the displayed
// columns may differ, so need to work out all the columns again.
// this is why why don't use 'actionOnColumns', as we need to do
// this before we fire the event
this.updateModel();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, event);
};
ColumnController.prototype.setRowGroupColumns = function (keys) {
this.rowGroupColumns.length = 0;
this.addRowGroupColumns(keys);
};
ColumnController.prototype.addRowGroupColumn = function (key) {
this.addRowGroupColumns([key]);
};
ColumnController.prototype.removeRowGroupColumns = function (keys) {
var _this = this;
keys.forEach(function (key) {
var column = _this.getOriginalColumn(key);
if (column) {
utils_1.Utils.removeFromArray(_this.rowGroupColumns, column);
}
});
this.updateModel();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, event);
};
ColumnController.prototype.removeRowGroupColumn = function (key) {
this.removeRowGroupColumns([key]);
};
ColumnController.prototype.addPivotColumns = function (keys) {
var _this = this;
keys.forEach(function (key) {
var column = _this.getOriginalColumn(key);
if (column) {
_this.pivotColumns.push(column);
}
});
// as with changing rowGroupColumn, changing the pivot totally changes
// the columns that are displayed, so we don't use 'actionOnColumns', as
// we need to do this before we fire the event
this.updateModel();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, event);
};
ColumnController.prototype.setPivotColumns = function (keys) {
this.pivotColumns.length = 0;
this.addPivotColumns(keys);
};
ColumnController.prototype.addPivotColumn = function (key) {
this.addPivotColumns([key]);
};
ColumnController.prototype.removePivotColumns = function (keys) {
var _this = this;
keys.forEach(function (key) {
var column = _this.getOriginalColumn(key);
if (column) {
utils_1.Utils.removeFromArray(_this.pivotColumns, column);
}
});
this.updateModel();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_PIVOT_CHANGED, event);
};
ColumnController.prototype.removePivotColumn = function (key) {
this.removePivotColumns([key]);
};
ColumnController.prototype.addValueColumn = function (column) {
if (this.originalColumns.indexOf(column) < 0) {
console.warn('not a valid column: ' + column);
return;
}
if (this.valueColumns.indexOf(column) >= 0) {
console.warn('column is already a value column');
return;
}
if (!column.getAggFunc()) {
column.setAggFunc(column_1.Column.AGG_SUM);
}
this.valueColumns.push(column);
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, event);
};
ColumnController.prototype.removeValueColumn = function (column) {
if (this.valueColumns.indexOf(column) < 0) {
console.warn('column not a value');
return;
}
utils_1.Utils.removeFromArray(this.valueColumns, column);
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, event);
};
// returns the width we can set to this col, taking into consideration min and max widths
ColumnController.prototype.normaliseColumnWidth = function (column, newWidth) {
if (newWidth < column.getMinWidth()) {
newWidth = column.getMinWidth();
}
if (column.isGreaterThanMax(newWidth)) {
newWidth = column.getMaxWidth();
}
return newWidth;
};
ColumnController.prototype.setColumnWidth = function (key, newWidth, finished) {
var column = this.getOriginalColumn(key);
if (!column) {
return;
}
newWidth = this.normaliseColumnWidth(column, newWidth);
var widthChanged = column.getActualWidth() !== newWidth;
if (widthChanged) {
column.setActualWidth(newWidth);
this.setLeftValues();
}
// check for change first, to avoid unnecessary firing of events
// however we always fire 'finished' events. this is important
// when groups are resized, as if the group is changing slowly,
// eg 1 pixel at a time, then each change will fire change events
// in all the columns in the group, but only one with get the pixel.
if (finished || widthChanged) {
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_RESIZED).withColumn(column).withFinished(finished);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_RESIZED, event);
}
};
ColumnController.prototype.setColumnAggFunction = function (column, aggFunc) {
column.setAggFunc(aggFunc);
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_VALUE_CHANGED, event);
};
ColumnController.prototype.moveRowGroupColumn = function (fromIndex, toIndex) {
var column = this.rowGroupColumns[fromIndex];
this.rowGroupColumns.splice(fromIndex, 1);
this.rowGroupColumns.splice(toIndex, 0, column);
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, event);
};
ColumnController.prototype.moveColumns = function (columnsToMoveKeys, toIndex) {
if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) {
console.warn('ag-Grid: tried to insert columns in invalid location, toIndex = ' + toIndex);
console.warn('ag-Grid: remember that you should not count the moving columns when calculating the new index');
return;
}
// we want to pull all the columns out first and put them into an ordered list
var columnsToMove = this.getGridColumns(columnsToMoveKeys);
var failedRules = !this.doesMovePassRules(columnsToMove, toIndex);
if (failedRules) {
return;
}
this.gridPanel.turnOnAnimationForABit();
utils_1.Utils.moveInArray(this.gridColumns, columnsToMove, toIndex);
this.updateModel();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_MOVED)
.withToIndex(toIndex)
.withColumns(columnsToMove);
if (columnsToMove.length === 1) {
event.withColumn(columnsToMove[0]);
}
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_MOVED, event);
};
ColumnController.prototype.doesMovePassRules = function (columnsToMove, toIndex) {
var allColumnsCopy = this.gridColumns.slice();
utils_1.Utils.moveInArray(allColumnsCopy, columnsToMove, toIndex);
// look for broken groups, ie stray columns from groups that should be married
for (var index = 0; index < (allColumnsCopy.length - 1); index++) {
var thisColumn = allColumnsCopy[index];
var nextColumn = allColumnsCopy[index + 1];
// skip hidden columns
if (!nextColumn.isVisible()) {
continue;
}
var thisPath = this.columnUtils.getOriginalPathForColumn(thisColumn, this.gridBalancedTree);
var nextPath = this.columnUtils.getOriginalPathForColumn(nextColumn, this.gridBalancedTree);
if (!nextPath || !thisPath) {
console.log('next path is missing');
}
// start at the top of the path and work down
for (var dept = 0; dept < thisPath.length; dept++) {
var thisOriginalGroup = thisPath[dept];
var nextOriginalGroup = nextPath[dept];
var lastColInGroup = thisOriginalGroup !== nextOriginalGroup;
// a runaway is a column from this group that left the group, and the group has it's children marked as married
var colGroupDef = thisOriginalGroup.getColGroupDef();
var marryChildren = colGroupDef && colGroupDef.marryChildren;
var needToCheckForRunaways = lastColInGroup && marryChildren;
if (needToCheckForRunaways) {
for (var tailIndex = index + 1; tailIndex < allColumnsCopy.length; tailIndex++) {
var tailColumn = allColumnsCopy[tailIndex];
var tailPath = this.columnUtils.getOriginalPathForColumn(tailColumn, this.gridBalancedTree);
var tailOriginalGroup = tailPath[dept];
if (tailOriginalGroup === thisOriginalGroup) {
return false;
}
}
}
}
}
return true;
};
ColumnController.prototype.moveColumn = function (key, toIndex) {
this.moveColumns([key], toIndex);
};
ColumnController.prototype.moveColumnByIndex = function (fromIndex, toIndex) {
var column = this.originalColumns[fromIndex];
this.moveColumn(column, toIndex);
};
// used by:
// + angularGrid -> for setting body width
// + rowController -> setting main row widths (when inserting and resizing)
// need to cache this
ColumnController.prototype.getBodyContainerWidth = function () {
var result = this.getWithOfColsInList(this.displayedCenterColumns);
return result;
};
// + rowController
ColumnController.prototype.getValueColumns = function () {
return this.valueColumns ? this.valueColumns : [];
};
// + rowController
ColumnController.prototype.getPivotColumns = function () {
return this.pivotColumns ? this.pivotColumns : [];
};
// + toolPanel
ColumnController.prototype.getRowGroupColumns = function () {
return this.rowGroupColumns ? this.rowGroupColumns : [];
};
ColumnController.prototype.isColumnRowGrouped = function (column) {
return this.rowGroupColumns.indexOf(column) >= 0;
};
ColumnController.prototype.isColumnPivoted = function (column) {
return this.pivotColumns.indexOf(column) >= 0;
};
// + rowController -> while inserting rows
ColumnController.prototype.getDisplayedCenterColumns = function () {
return this.displayedCenterColumns.slice(0);
};
// + rowController -> while inserting rows
ColumnController.prototype.getDisplayedLeftColumns = function () {
return this.displayedLeftColumns.slice(0);
};
ColumnController.prototype.getDisplayedRightColumns = function () {
return this.displayedRightColumns.slice(0);
};
ColumnController.prototype.getDisplayedColumns = function (type) {
switch (type) {
case column_1.Column.PINNED_LEFT: return this.getDisplayedLeftColumns();
case column_1.Column.PINNED_RIGHT: return this.getDisplayedRightColumns();
default: return this.getDisplayedCenterColumns();
}
};
// used by:
// + inMemoryRowController -> sorting, building quick filter text
// + headerRenderer -> sorting (clearing icon)
ColumnController.prototype.getAllOriginalColumns = function () {
return this.originalColumns;
};
// + moveColumnController
ColumnController.prototype.getAllGridColumns = function () {
return this.gridColumns;
};
ColumnController.prototype.isEmpty = function () {
return utils_1.Utils.missingOrEmpty(this.originalColumns);
};
ColumnController.prototype.isRowGroupEmpty = function () {
return utils_1.Utils.missingOrEmpty(this.rowGroupColumns);
};
ColumnController.prototype.setColumnVisible = function (key, visible) {
this.setColumnsVisible([key], visible);
};
ColumnController.prototype.setColumnsVisible = function (keys, visible) {
this.gridPanel.turnOnAnimationForABit();
this.actionOnColumns(keys, function (column) {
column.setVisible(visible);
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_VISIBLE).withVisible(visible);
});
};
ColumnController.prototype.setColumnPinned = function (key, pinned) {
this.setColumnsPinned([key], pinned);
};
ColumnController.prototype.setColumnsPinned = function (keys, pinned) {
this.gridPanel.turnOnAnimationForABit();
var actualPinned;
if (pinned === true || pinned === column_1.Column.PINNED_LEFT) {
actualPinned = column_1.Column.PINNED_LEFT;
}
else if (pinned === column_1.Column.PINNED_RIGHT) {
actualPinned = column_1.Column.PINNED_RIGHT;
}
else {
actualPinned = null;
}
this.actionOnColumns(keys, function (column) {
column.setPinned(actualPinned);
}, function () {
return new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_PINNED).withPinned(actualPinned);
});
};
// does an action on a set of columns. provides common functionality for looking up the
// columns based on key, getting a list of effected columns, and then updated the event
// with either one column (if it was just one col) or a list of columns
// used by: autoResize, setVisible, setPinned
ColumnController.prototype.actionOnColumns = function (keys, action, createEvent) {
var _this = this;
if (!keys || keys.length === 0) {
return;
}
var updatedColumns = [];
keys.forEach(function (key) {
var column = _this.getGridColumn(key);
if (!column) {
return;
}
action(column);
updatedColumns.push(column);
});
if (updatedColumns.length === 0) {
return;
}
this.updateModel();
var event = createEvent();
event.withColumns(updatedColumns);
if (updatedColumns.length === 1) {
event.withColumn(updatedColumns[0]);
}
this.eventService.dispatchEvent(event.getType(), event);
};
ColumnController.prototype.getDisplayedColBefore = function (col) {
var allDisplayedColumns = this.getAllDisplayedColumns();
var oldIndex = allDisplayedColumns.indexOf(col);
if (oldIndex > 0) {
return allDisplayedColumns[oldIndex - 1];
}
else {
return null;
}
};
// used by:
// + rowRenderer -> for navigation
ColumnController.prototype.getDisplayedColAfter = function (col) {
var allDisplayedColumns = this.getAllDisplayedColumns();
var oldIndex = allDisplayedColumns.indexOf(col);
if (oldIndex < (allDisplayedColumns.length - 1)) {
return allDisplayedColumns[oldIndex + 1];
}
else {
return null;
}
};
ColumnController.prototype.isPinningLeft = function () {
return this.displayedLeftColumns.length > 0;
};
ColumnController.prototype.isPinningRight = function () {
return this.displayedRightColumns.length > 0;
};
ColumnController.prototype.getAllColumnsIncludingAuto = function () {
var result = this.originalColumns.slice(0);
if (this.groupAutoColumnActive) {
result.push(this.groupAutoColumn);
}
return result;
};
ColumnController.prototype.getColumnState = function () {
if (!this.gridColumns || this.gridColumns.length < 0) {
return [];
}
var result = [];
for (var i = 0; i < this.gridColumns.length; i++) {
var column = this.gridColumns[i];
var rowGroupIndex = this.rowGroupColumns.indexOf(column);
var resultItem = {
colId: column.getColId(),
hide: !column.isVisible(),
aggFunc: column.getAggFunc() ? column.getAggFunc() : null,
width: column.getActualWidth(),
pinned: column.getPinned(),
rowGroupIndex: rowGroupIndex >= 0 ? rowGroupIndex : null
};
result.push(resultItem);
}
return result;
};
ColumnController.prototype.resetColumnState = function () {
// we can't use 'allColumns' as the order might of messed up, so get the original ordered list
var originalColumns = this.getColumnsFromTree(this.originalBalancedTree);
var state = [];
if (originalColumns) {
originalColumns.forEach(function (column) {
state.push({
colId: column.getColId(),
aggFunc: column.getColDef().aggFunc,
hide: column.getColDef().hide,
pinned: column.getColDef().pinned,
rowGroupIndex: column.getColDef().rowGroupIndex,
width: column.getColDef().width
});
});
}
this.setColumnState(state);
};
ColumnController.prototype.setColumnState = function (columnState) {
var _this = this;
var oldColumnList = this.originalColumns;
this.originalColumns = [];
this.rowGroupColumns = [];
this.valueColumns = [];
var success = true;
if (columnState) {
columnState.forEach(function (stateItem) {
var oldColumn = utils_1.Utils.find(oldColumnList, 'colId', stateItem.colId);
if (!oldColumn) {
console.warn('ag-grid: column ' + stateItem.colId + ' not found');
success = false;
return;
}
// following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true
oldColumn.setVisible(!stateItem.hide);
// sets pinned to 'left' or 'right'
oldColumn.setPinned(stateItem.pinned);
// if width provided and valid, use it, otherwise stick with the old width
if (stateItem.width >= _this.gridOptionsWrapper.getMinColWidth()) {
oldColumn.setActualWidth(stateItem.width);
}
// accept agg func only if valid
var aggFuncValid = [column_1.Column.AGG_MIN, column_1.Column.AGG_MAX, column_1.Column.AGG_SUM, column_1.Column.AGG_FIRST, column_1.Column.AGG_LAST].indexOf(stateItem.aggFunc) >= 0;
if (aggFuncValid) {
oldColumn.setAggFunc(stateItem.aggFunc);
_this.valueColumns.push(oldColumn);
}
else {
oldColumn.setAggFunc(null);
}
// if rowGroup
if (typeof stateItem.rowGroupIndex === 'number' && stateItem.rowGroupIndex >= 0) {
_this.rowGroupColumns.push(oldColumn);
}
_this.originalColumns.push(oldColumn);
oldColumnList.splice(oldColumnList.indexOf(oldColumn), 1);
});
}
// anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden
oldColumnList.forEach(function (oldColumn) {
oldColumn.setVisible(false);
oldColumn.setAggFunc(null);
oldColumn.setPinned(null);
_this.originalColumns.push(oldColumn);
});
// sort the row group columns
this.rowGroupColumns.sort(function (colA, colB) {
var rowGroupIndexA = -1;
var rowGroupIndexB = -1;
for (var i = 0; i < columnState.length; i++) {
var state = columnState[i];
if (state.colId === colA.getColId()) {
rowGroupIndexA = state.rowGroupIndex;
}
if (state.colId === colB.getColId()) {
rowGroupIndexB = state.rowGroupIndex;
}
}
return rowGroupIndexA - rowGroupIndexB;
});
this.setupGridColumns();
this.updateModel();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, event);
return success;
};
ColumnController.prototype.getGridColumns = function (keys) {
return this.getColumns(keys, this.getGridColumn.bind(this));
};
ColumnController.prototype.getColumns = function (keys, columnLookupCallback) {
var foundColumns = [];
if (keys) {
keys.forEach(function (key) {
var column = columnLookupCallback(key);
if (column) {
foundColumns.push(column);
}
});
}
return foundColumns;
};
// used by growGroupPanel
ColumnController.prototype.getColumnWithValidation = function (key) {
var column = this.getOriginalColumn(key);
if (!column) {
console.warn('ag-Grid: could not find column ' + column);
}
return column;
};
ColumnController.prototype.getOriginalColumn = function (key) {
return this.getColumn(key, this.originalColumns);
};
ColumnController.prototype.getGridColumn = function (key) {
return this.getColumn(key, this.gridColumns);
};
ColumnController.prototype.getColumn = function (key, columnList) {
if (!key) {
return null;
}
for (var i = 0; i < columnList.length; i++) {
if (colMatches(columnList[i])) {
return columnList[i];
}
}
if (this.groupAutoColumnActive && colMatches(this.groupAutoColumn)) {
return this.groupAutoColumn;
}
function colMatches(column) {
var columnMatches = column === key;
var colDefMatches = column.getColDef() === key;
var idMatches = column.getColId() === key;
return columnMatches || colDefMatches || idMatches;
}
return null;
};
ColumnController.prototype.getDisplayNameForCol = function (column) {
var colDef = column.colDef;
var headerValueGetter = colDef.headerValueGetter;
if (headerValueGetter) {
var params = {
colDef: colDef,
api: this.gridOptionsWrapper.getApi(),
context: this.gridOptionsWrapper.getContext()
};
if (typeof headerValueGetter === 'function') {
// valueGetter is a function, so just call it
return headerValueGetter(params);
}
else if (typeof headerValueGetter === 'string') {
// valueGetter is an expression, so execute the expression
return this.expressionService.evaluate(headerValueGetter, params);
}
else {
console.warn('ag-grid: headerValueGetter must be a function or a string');
}
}
else if (colDef.displayName) {
console.warn("ag-grid: Found displayName " + colDef.displayName + ", please use headerName instead, displayName is deprecated.");
return colDef.displayName;
}
else {
return colDef.headerName;
}
};
// returns the group with matching colId and instanceId. If instanceId is missing,
// matches only on the colId.
ColumnController.prototype.getColumnGroup = function (colId, instanceId) {
if (!colId) {
return null;
}
if (colId instanceof columnGroup_1.ColumnGroup) {
return colId;
}
var allColumnGroups = this.getAllDisplayedColumnGroups();
var checkInstanceId = typeof instanceId === 'number';
var result = null;
this.columnUtils.deptFirstAllColumnTreeSearch(allColumnGroups, function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var columnGroup = child;
var matched;
if (checkInstanceId) {
matched = colId === columnGroup.getGroupId() && instanceId === columnGroup.getInstanceId();
}
else {
matched = colId === columnGroup.getGroupId();
}
if (matched) {
result = columnGroup;
}
}
});
return result;
};
ColumnController.prototype.getColumnDept = function () {
var dept = 0;
getDept(this.getAllDisplayedColumnGroups(), 1);
return dept;
function getDept(children, currentDept) {
if (dept < currentDept) {
dept = currentDept;
}
if (dept > currentDept) {
return;
}
children.forEach(function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var columnGroup = child;
getDept(columnGroup.getChildren(), currentDept + 1);
}
});
}
};
ColumnController.prototype.setColumnDefs = function (columnDefs) {
var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(columnDefs);
this.originalBalancedTree = balancedTreeResult.balancedTree;
this.originalHeaderRowCount = balancedTreeResult.treeDept + 1;
this.originalColumns = this.getColumnsFromTree(this.originalBalancedTree);
this.extractRowGroupColumns();
this.extractPivotColumns();
this.createValueColumns();
this.setupGridColumns();
this.updateModel();
this.ready = true;
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, event);
this.eventService.dispatchEvent(events_1.Events.EVENT_NEW_COLUMNS_LOADED);
};
ColumnController.prototype.isReady = function () {
return this.ready;
};
ColumnController.prototype.extractRowGroupColumns = function () {
var _this = this;
this.rowGroupColumns = [];
// pull out the columns
this.originalColumns.forEach(function (column) {
if (typeof column.getColDef().rowGroupIndex === 'number') {
_this.rowGroupColumns.push(column);
}
});
// then sort them
this.rowGroupColumns.sort(function (colA, colB) {
return colA.getColDef().rowGroupIndex - colB.getColDef().rowGroupIndex;
});
};
ColumnController.prototype.extractPivotColumns = function () {
var _this = this;
this.pivotColumns = [];
// pull out the columns
this.originalColumns.forEach(function (column) {
if (typeof column.getColDef().pivotIndex === 'number') {
_this.pivotColumns.push(column);
}
});
// then sort them
this.pivotColumns.sort(function (colA, colB) {
return colA.getColDef().pivotIndex - colB.getColDef().pivotIndex;
});
};
// called by headerRenderer - when a header is opened or closed
ColumnController.prototype.setColumnGroupOpened = function (passedGroup, newValue, instanceId) {
var groupToUse = this.getColumnGroup(passedGroup, instanceId);
if (!groupToUse) {
return;
}
this.logger.log('columnGroupOpened(' + groupToUse.getGroupId() + ',' + newValue + ')');
groupToUse.setExpanded(newValue);
this.gridPanel.turnOnAnimationForABit();
this.updateGroupsAndDisplayedColumns();
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_GROUP_OPENED).withColumnGroup(groupToUse);
this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_GROUP_OPENED, event);
};
// used by updateModel
ColumnController.prototype.getColumnGroupState = function () {
var groupState = {};
this.columnUtils.deptFirstDisplayedColumnTreeSearch(this.getAllDisplayedColumnGroups(), function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var columnGroup = child;
var key = columnGroup.getGroupId();
// if more than one instance of the group, we only record the state of the first item
if (!groupState.hasOwnProperty(key)) {
groupState[key] = columnGroup.isExpanded();
}
}
});
return groupState;
};
// used by updateModel
ColumnController.prototype.setColumnGroupState = function (groupState) {
this.columnUtils.deptFirstDisplayedColumnTreeSearch(this.getAllDisplayedColumnGroups(), function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var columnGroup = child;
var key = columnGroup.getGroupId();
var shouldExpandGroup = groupState[key] === true && columnGroup.isExpandable();
if (shouldExpandGroup) {
columnGroup.setExpanded(true);
}
}
});
};
ColumnController.prototype.updateModel = function () {
// save opened / closed state
var oldGroupState = this.getColumnGroupState();
this.createGroupAutoColumn();
var visibleColumns = utils_1.Utils.filter(this.gridColumns, function (column) { return column.isVisible(); });
if (this.groupAutoColumnActive) {
visibleColumns.unshift(this.groupAutoColumn);
}
this.buildAllGroups(visibleColumns);
// restore opened / closed state
this.setColumnGroupState(oldGroupState);
// this is also called when a group is opened or closed
this.updateGroupsAndDisplayedColumns();
this.setFirstRightAndLastLeftPinned();
};
ColumnController.prototype.onPivotValueChanged = function () {
// if we are pivoting, then we need to re-work the pivot columns
this.setupGridColumns();
this.updateModel();
// this.eventService.dispatchEvent(Events.EVENT_PIVOT_VALUE_CHANGED);
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_PIVOT_VALUE_CHANGED);
this.eventService.dispatchEvent(events_1.Events.EVENT_PIVOT_VALUE_CHANGED, event);
};
ColumnController.prototype.setupGridColumns = function () {
var doingPivot = this.pivotColumns.length > 0;
if (doingPivot) {
var pivotColumnGroupDefs = this.pivotService.getPivotColumnGroupDefs();
var balancedTreeResult = this.balancedColumnTreeBuilder.createBalancedColumnGroups(pivotColumnGroupDefs);
this.gridBalancedTree = balancedTreeResult.balancedTree;
this.gridHeaderRowCount = balancedTreeResult.treeDept + 1;
this.gridColumns = this.getColumnsFromTree(this.gridBalancedTree);
}
else {
this.gridBalancedTree = this.originalBalancedTree.slice();
this.gridHeaderRowCount = this.originalHeaderRowCount;
this.gridColumns = this.originalColumns.slice();
}
};
ColumnController.prototype.updateGroupsAndDisplayedColumns = function () {
this.updateGroups();
this.updateDisplayedColumnsFromGroups();
};
ColumnController.prototype.updateDisplayedColumnsFromGroups = function () {
this.addToDisplayedColumns(this.displayedLeftColumnTree, this.displayedLeftColumns);
this.addToDisplayedColumns(this.displayedRightColumnTree, this.displayedRightColumns);
this.addToDisplayedColumns(this.displayedCentreColumnTree, this.displayedCenterColumns);
this.setLeftValues();
};
// sets the left pixel position of each column
ColumnController.prototype.setLeftValues = function () {
// go through each list of displayed columns
var allColumns = this.originalColumns.slice(0);
[this.displayedLeftColumns, this.displayedRightColumns, this.displayedCenterColumns].forEach(function (columns) {
var left = 0;
columns.forEach(function (column) {
column.setLeft(left);
left += column.getActualWidth();
utils_1.Utils.removeFromArray(allColumns, column);
});
});
// items left in allColumns are columns not displayed, so remove the left position. this is
// important for the rows, as if a col is made visible, then taken out, then made visible again,
// we don't want the animation of the cell floating in from the old position, whatever that was.
allColumns.forEach(function (column) {
column.setLeft(null);
});
};
ColumnController.prototype.addToDisplayedColumns = function (displayedColumnTree, displayedColumns) {
displayedColumns.length = 0;
this.columnUtils.deptFirstDisplayedColumnTreeSearch(displayedColumnTree, function (child) {
if (child instanceof column_1.Column) {
displayedColumns.push(child);
}
});
};
// called from api
ColumnController.prototype.sizeColumnsToFit = function (gridWidth) {
var _this = this;
// avoid divide by zero
var allDisplayedColumns = this.getAllDisplayedColumns();
if (gridWidth <= 0 || allDisplayedColumns.length === 0) {
return;
}
var colsToNotSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) {
return column.getColDef().suppressSizeToFit === true;
});
var colsToSpread = utils_1.Utils.filter(allDisplayedColumns, function (column) {
return column.getColDef().suppressSizeToFit !== true;
});
// make a copy of the cols that are going to be resized
var colsToFireEventFor = colsToSpread.slice(0);
var finishedResizing = false;
while (!finishedResizing) {
finishedResizing = true;
var availablePixels = gridWidth - getTotalWidth(colsToNotSpread);
if (availablePixels <= 0) {
// no width, set everything to minimum
colsToSpread.forEach(function (column) {
column.setMinimum();
});
}
else {
var scale = availablePixels / getTotalWidth(colsToSpread);
// we set the pixels for the last col based on what's left, as otherwise
// we could be a pixel or two short or extra because of rounding errors.
var pixelsForLastCol = availablePixels;
// backwards through loop, as we are removing items as we go
for (var i = colsToSpread.length - 1; i >= 0; i--) {
var column = colsToSpread[i];
var newWidth = Math.round(column.getActualWidth() * scale);
if (newWidth < column.getMinWidth()) {
column.setMinimum();
moveToNotSpread(column);
finishedResizing = false;
}
else if (column.isGreaterThanMax(newWidth)) {
column.setActualWidth(column.getMaxWidth());
moveToNotSpread(column);
finishedResizing = false;
}
else {
var onLastCol = i === 0;
if (onLastCol) {
column.setActualWidth(pixelsForLastCol);
}
else {
pixelsForLastCol -= newWidth;
column.setActualWidth(newWidth);
}
}
}
}
}
this.setLeftValues();
// widths set, refresh the gui
colsToFireEventFor.forEach(function (column) {
var event = new columnChangeEvent_1.ColumnChangeEvent(events_1.Events.EVENT_COLUMN_RESIZED).withColumn(column);
_this.eventService.dispatchEvent(events_1.Events.EVENT_COLUMN_RESIZED, event);
});
function moveToNotSpread(column) {
utils_1.Utils.removeFromArray(colsToSpread, column);
colsToNotSpread.push(column);
}
function getTotalWidth(columns) {
var result = 0;
for (var i = 0; i < columns.length; i++) {
result += columns[i].getActualWidth();
}
return result;
}
};
ColumnController.prototype.buildAllGroups = function (visibleColumns) {
var leftVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
return column.getPinned() === 'left';
});
var rightVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
return column.getPinned() === 'right';
});
var centerVisibleColumns = utils_1.Utils.filter(visibleColumns, function (column) {
return column.getPinned() !== 'left' && column.getPinned() !== 'right';
});
var groupInstanceIdCreator = new groupInstanceIdCreator_1.GroupInstanceIdCreator();
this.displayedLeftColumnTree = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator);
this.displayedRightColumnTree = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator);
this.displayedCentreColumnTree = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, this.gridBalancedTree, groupInstanceIdCreator);
};
ColumnController.prototype.updateGroups = function () {
var allGroups = this.getAllDisplayedColumnGroups();
this.columnUtils.deptFirstAllColumnTreeSearch(allGroups, function (child) {
if (child instanceof columnGroup_1.ColumnGroup) {
var group = child;
group.calculateDisplayedColumns();
}
});
};
ColumnController.prototype.createGroupAutoColumn = function () {
// see if we need to insert the default grouping column
var needAGroupColumn = this.rowGroupColumns.length > 0
&& !this.gridOptionsWrapper.isGroupSuppressAutoColumn()
&& !this.gridOptionsWrapper.isGroupUseEntireRow()
&& !this.gridOptionsWrapper.isGroupSuppressRow();
this.groupAutoColumnActive = needAGroupColumn;
// lazy create group auto-column
if (needAGroupColumn && !this.groupAutoColumn) {
// if one provided by user, use it, otherwise create one
var autoColDef = this.gridOptionsWrapper.getGroupColumnDef();
if (!autoColDef) {
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
autoColDef = {
headerName: localeTextFunc('group', 'Group'),
comparator: functions_1.defaultGroupComparator,
valueGetter: function (params) {
if (params.node.group) {
return params.node.key;
}
else if (params.data && params.colDef.field) {
return params.data[params.colDef.field];
}
else {
return null;
}
},
suppressAggregation: true,
suppressRowGroup: true,
cellRenderer: 'group'
};
}
// we never allow moving the group column
autoColDef.suppressMovable = true;
var colId = 'ag-Grid-AutoColumn';
this.groupAutoColumn = new column_1.Column(autoColDef, colId);
this.context.wireBean(this.groupAutoColumn);
}
};
ColumnController.prototype.createValueColumns = function () {
this.valueColumns = [];
// override with columns that have the aggFunc specified explicitly
for (var i = 0; i < this.originalColumns.length; i++) {
var column = this.originalColumns[i];
if (column.getColDef().aggFunc) {
column.setAggFunc(column.getColDef().aggFunc);
this.valueColumns.push(column);
}
}
};
ColumnController.prototype.getWithOfColsInList = function (columnList) {
var result = 0;
for (var i = 0; i < columnList.length; i++) {
result += columnList[i].getActualWidth();
}
return result;
};
__decorate([
context_1.Autowired('gridOptionsWrapper'),
__metadata('design:type', gridOptionsWrapper_1.GridOptionsWrapper)
], ColumnController.prototype, "gridOptionsWrapper", void 0);
__decorate([
context_1.Autowired('expressionService'),
__metadata('design:type', expressionService_1.ExpressionService)
], ColumnController.prototype, "expressionService", void 0);
__decorate([
context_1.Autowired('balancedColumnTreeBuilder'),
__metadata('design:type', balancedColumnTreeBuilder_1.BalancedColumnTreeBuilder)
], ColumnController.prototype, "balancedColumnTreeBuilder", void 0);
__decorate([
context_1.Autowired('displayedGroupCreator'),
__metadata('design:type', displayedGroupCreator_1.DisplayedGroupCreator)
], ColumnController.prototype, "displayedGroupCreator", void 0);
__decorate([
context_1.Autowired('autoWidthCalculator'),
__metadata('design:type', autoWidthCalculator_1.AutoWidthCalculator)
], ColumnController.prototype, "autoWidthCalculator", void 0);
__decorate([
context_1.Autowired('eventService'),
__metadata('design:type', eventService_1.EventService)
], ColumnController.prototype, "eventService", void 0);
__decorate([
context_1.Autowired('columnUtils'),
__metadata('design:type', columnUtils_1.ColumnUtils)
], ColumnController.prototype, "columnUtils", void 0);
__decorate([
context_1.Autowired('gridPanel'),
__metadata('design:type', gridPanel_1.GridPanel)
], ColumnController.prototype, "gridPanel", void 0);
__decorate([
context_1.Autowired('context'),
__metadata('design:type', context_1.Context)
], ColumnController.prototype, "context", void 0);
__decorate([
context_1.Autowired('pivotService'),
__metadata('design:type', pivotService_1.PivotService)
], ColumnController.prototype, "pivotService", void 0);
__decorate([
context_1.PostConstruct,
__metadata('design:type', Function),
__metadata('design:paramtypes', []),
__metadata('design:returntype', void 0)
], ColumnController.prototype, "init", null);
__decorate([
__param(0, context_1.Qualifier('loggerFactory')),
__metadata('design:type', Function),
__metadata('design:paramtypes', [logger_1.LoggerFactory]),
__metadata('design:returntype', void 0)
], ColumnController.prototype, "setBeans", null);
ColumnController = __decorate([
context_1.Bean('columnController'),
__metadata('design:paramtypes', [])
], ColumnController);
return ColumnController;
})();
exports.ColumnController = ColumnController;
| kiwi89/cdnjs | ajax/libs/ag-grid/4.2.3/lib/columnController/columnController.js | JavaScript | mit | 60,587 |
/**
* backend session service for backend session
*/
var utils = require('../../util/utils');
var EXPORTED_FIELDS = ['id', 'frontendId', 'uid', 'settings'];
/**
* Service that maintains backend sessions and the communication with frontend
* servers.
*
* BackendSessionService would be created in each server process and maintains
* backend sessions for current process and communicates with the relative
* frontend servers.
*
* BackendSessionService instance could be accessed by
* `app.get('backendSessionService')` or app.backendSessionService.
*
* @class
* @constructor
*/
var BackendSessionService = function(app) {
this.app = app;
};
module.exports = BackendSessionService;
BackendSessionService.prototype.create = function(opts) {
if(!opts) {
throw new Error('opts should not be empty.');
}
return new BackendSession(opts, this);
};
/**
* Get backend session by frontend server id and session id.
*
* @param {String} frontendId frontend server id that session attached
* @param {String} sid session id
* @param {Function} cb callback function. args: cb(err, BackendSession)
*
* @memberOf BackendSessionService
*/
BackendSessionService.prototype.get = function(frontendId, sid, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'getBackendSessionBySid';
var args = [sid];
rpcInvoke(this.app, frontendId, namespace, service, method,
args, BackendSessionCB.bind(null, this, cb));
};
/**
* Get backend sessions by frontend server id and user id.
*
* @param {String} frontendId frontend server id that session attached
* @param {String} uid user id binded with the session
* @param {Function} cb callback function. args: cb(err, BackendSessions)
*
* @memberOf BackendSessionService
*/
BackendSessionService.prototype.getByUid = function(frontendId, uid, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'getBackendSessionsByUid';
var args = [uid];
rpcInvoke(this.app, frontendId, namespace, service, method,
args, BackendSessionCB.bind(null, this, cb));
};
/**
* Kick a session by session id.
*
* @param {String} frontendId cooperating frontend server id
* @param {Number} sid session id
* @param {Function} cb callback function
*
* @memberOf BackendSessionService
*/
BackendSessionService.prototype.kickBySid = function(frontendId, sid, reason, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'kickBySid';
var args = [sid];
if(typeof reason === 'function') {
cb = reason;
}else{
args.push(reason);
}
rpcInvoke(this.app, frontendId, namespace, service, method, args, cb);
};
/**
* Kick sessions by user id.
*
* @param {String} frontendId cooperating frontend server id
* @param {Number|String} uid user id
* @param {String} reason kick reason
* @param {Function} cb callback function
*
* @memberOf BackendSessionService
*/
BackendSessionService.prototype.kickByUid = function(frontendId, uid, reason, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'kickByUid';
var args = [uid];
if(typeof reason === 'function') {
cb = reason;
}else{
args.push(reason);
}
rpcInvoke(this.app, frontendId, namespace, service, method, args, cb);
};
/**
* Bind the session with the specified user id. It would finally invoke the
* the sessionService.bind in the cooperating frontend server.
*
* @param {String} frontendId cooperating frontend server id
* @param {Number} sid session id
* @param {String} uid user id
* @param {Function} cb callback function
*
* @memberOf BackendSessionService
* @api private
*/
BackendSessionService.prototype.bind = function(frontendId, sid, uid, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'bind';
var args = [sid, uid];
rpcInvoke(this.app, frontendId, namespace, service, method, args, cb);
};
/**
* Unbind the session with the specified user id. It would finally invoke the
* the sessionService.unbind in the cooperating frontend server.
*
* @param {String} frontendId cooperating frontend server id
* @param {Number} sid session id
* @param {String} uid user id
* @param {Function} cb callback function
*
* @memberOf BackendSessionService
* @api private
*/
BackendSessionService.prototype.unbind = function(frontendId, sid, uid, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'unbind';
var args = [sid, uid];
rpcInvoke(this.app, frontendId, namespace, service, method, args, cb);
};
/**
* Push the specified customized change to the frontend internal session.
*
* @param {String} frontendId cooperating frontend server id
* @param {Number} sid session id
* @param {String} key key in session that should be push
* @param {Object} value value in session, primitive js object
* @param {Function} cb callback function
*
* @memberOf BackendSessionService
* @api private
*/
BackendSessionService.prototype.push = function(frontendId, sid, key, value, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'push';
var args = [sid, key, value];
rpcInvoke(this.app, frontendId, namespace, service, method, args, cb);
};
/**
* Push all the customized changes to the frontend internal session.
*
* @param {String} frontendId cooperating frontend server id
* @param {Number} sid session id
* @param {Object} settings key/values in session that should be push
* @param {Function} cb callback function
*
* @memberOf BackendSessionService
* @api private
*/
BackendSessionService.prototype.pushAll = function(frontendId, sid, settings, cb) {
var namespace = 'sys';
var service = 'sessionRemote';
var method = 'pushAll';
var args = [sid, settings];
rpcInvoke(this.app, frontendId, namespace, service, method, args, cb);
};
var rpcInvoke = function(app, sid, namespace, service, method, args, cb) {
app.rpcInvoke(sid, {namespace: namespace, service: service, method: method, args: args}, cb);
};
/**
* BackendSession is the proxy for the frontend internal session passed to handlers and
* it helps to keep the key/value pairs for the server locally.
* Internal session locates in frontend server and should not be accessed directly.
*
* The mainly operation on backend session should be read and any changes happen in backend
* session is local and would be discarded in next request. You have to push the
* changes to the frontend manually if necessary. Any push would overwrite the last push
* of the same key silently and the changes would be saw in next request.
* And you have to make sure the transaction outside if you would push the session
* concurrently in different processes.
*
* See the api below for more details.
*
* @class
* @constructor
*/
var BackendSession = function(opts, service) {
for(var f in opts) {
this[f] = opts[f];
}
this.__sessionService__ = service;
};
/**
* Bind current session with the user id. It would push the uid to frontend
* server and bind uid to the frontend internal session.
*
* @param {Number|String} uid user id
* @param {Function} cb callback function
*
* @memberOf BackendSession
*/
BackendSession.prototype.bind = function(uid, cb) {
var self = this;
this.__sessionService__.bind(this.frontendId, this.id, uid, function(err) {
if(!err) {
self.uid = uid;
}
utils.invokeCallback(cb, err);
});
};
/**
* Unbind current session with the user id. It would push the uid to frontend
* server and unbind uid from the frontend internal session.
*
* @param {Number|String} uid user id
* @param {Function} cb callback function
*
* @memberOf BackendSession
*/
BackendSession.prototype.unbind = function(uid, cb) {
var self = this;
this.__sessionService__.unbind(this.frontendId, this.id, uid, function(err) {
if(!err) {
self.uid = null;
}
utils.invokeCallback(cb, err);
});
};
/**
* Set the key/value into backend session.
*
* @param {String} key key
* @param {Object} value value
*/
BackendSession.prototype.set = function(key, value) {
this.settings[key] = value;
};
/**
* Get the value from backend session by key.
*
* @param {String} key key
* @return {Object} value
*/
BackendSession.prototype.get = function(key) {
return this.settings[key];
};
/**
* Push the key/value in backend session to the front internal session.
*
* @param {String} key key
* @param {Function} cb callback function
*/
BackendSession.prototype.push = function(key, cb) {
this.__sessionService__.push(this.frontendId, this.id, key, this.get(key), cb);
};
/**
* Push all the key/values in backend session to the frontend internal session.
*
* @param {Function} cb callback function
*/
BackendSession.prototype.pushAll = function(cb) {
this.__sessionService__.pushAll(this.frontendId, this.id, this.settings, cb);
};
/**
* Export the key/values for serialization.
*
* @api private
*/
BackendSession.prototype.export = function() {
var res = {};
EXPORTED_FIELDS.forEach(function(field) {
res[field] = this[field];
});
return res;
};
var BackendSessionCB = function(service, cb, err, sinfo) {
if(err) {
utils.invokeCallback(cb, err);
return;
}
if(!sinfo) {
utils.invokeCallback(cb);
return;
}
var sessions = [];
if(Array.isArray(sinfo)){
// #getByUid
for(var i = 0,k = sinfo.length;i<k;i++){
sessions.push(service.create(sinfo[i]));
}
}
else{
// #get
sessions = service.create(sinfo);
}
utils.invokeCallback(cb, null, sessions);
};
| ljhsai/pomelo | lib/common/service/backendSessionService.js | JavaScript | mit | 9,855 |
'use strict';
angular.module('highcharts-ng', [])
.directive('highchart', function () {
function prependMethod(obj, method, func) {
var original = obj[method];
obj[method] = function () {
var args = Array.prototype.slice.call(arguments);
func.apply(this, args);
if(original) {
return original.apply(this, args);
} else {
return;
}
};
}
function deepExtend(destination, source) {
for (var property in source) {
if (source[property] && source[property].constructor &&
source[property].constructor === Object) {
destination[property] = destination[property] || {};
deepExtend(destination[property], source[property]);
} else {
destination[property] = source[property];
}
}
return destination;
}
var seriesId = 0;
var ensureIds = function (series) {
series.forEach(function (s) {
if (!angular.isDefined(s.id)) {
s.id = "series-" + seriesId++;
}
});
}
var defaultOptions = {
chart: {
events: {}
},
title: {},
series: [],
navigator: {enabled: false}
}
var getMergedOptions = function (scope, element, config) {
var mergedOptions = {}
if (config.options) {
mergedOptions = deepExtend(defaultOptions, config.options);
} else {
mergedOptions = defaultOptions;
}
mergedOptions.chart.renderTo = element[0];
if(config.xAxis) {
prependMethod(mergedOptions.chart.events, 'selection', function(e){
var thisChart = this;
if(e.xAxis) {
scope.$apply(function () {
scope.config.xAxis.currentMin = e.xAxis[0].min;
scope.config.xAxis.currentMax = e.xAxis[0].max;
});
} else {
//handle reset button - zoom out to all
scope.$apply(function () {
scope.config.xAxis.currentMin = thisChart.xAxis[0].dataMin;
scope.config.xAxis.currentMax = thisChart.xAxis[0].dataMax;
});
}
});
prependMethod(mergedOptions.chart.events, 'addSeries', function(e){
scope.config.xAxis.currentMin = this.xAxis[0].min || scope.config.xAxis.currentMin;
scope.config.xAxis.currentMax = this.xAxis[0].max || scope.config.xAxis.currentMax;
});
}
if(config.xAxis) {
mergedOptions.xAxis = angular.copy(config.xAxis)
}
if(config.title) {
mergedOptions.title = config.title
}
return mergedOptions
}
var updateZoom = function (axis, modelAxis) {
var extremes = axis.getExtremes();
if(modelAxis.currentMin !== extremes.dataMin || modelAxis.currentMax !== extremes.dataMax) {
axis.setExtremes(modelAxis.currentMin, modelAxis.currentMax, false);
}
}
var processExtremes = function(chart, axis) {
if(axis.currentMin || axis.currentMax) {
chart.xAxis[0].setExtremes(axis.currentMin, axis.currentMax, true);
}
}
var processSeries = function(chart, series) {
var ids = []
if(series) {
ensureIds(series);
//Find series to add or update
series.forEach(function (s) {
ids.push(s.id)
var chartSeries = chart.get(s.id);
if (chartSeries) {
chartSeries.update(angular.copy(s), false);
} else {
chart.addSeries(angular.copy(s), false)
}
});
}
//Now remove any missing series
for(var i = chart.series.length - 1; i >= 0; i--) {
var s = chart.series[i];
if (ids.indexOf(s.options.id) < 0) {
s.remove(false);
}
};
}
var initialiseChart = function(scope, element, config) {
config || (config = {});
var mergedOptions = getMergedOptions(scope, element, config);
var chart = config.useHighStocks ? new Highcharts.StockChart(mergedOptions) : new Highcharts.Chart(mergedOptions);
if(config.xAxis) {
processExtremes(chart, config.xAxis);
}
processSeries(chart, config.series);
if(config.loading) {
chart.showLoading()
}
chart.redraw();
return chart;
}
return {
restrict: 'EAC',
replace: true,
template: '<div></div>',
scope: {
config: '='
},
link: function (scope, element, attrs) {
var chart = initialiseChart(scope, element, scope.config);
scope.$watch("config.series", function (newSeries, oldSeries) {
//do nothing when called on registration
if (newSeries === oldSeries) return;
processSeries(chart, newSeries);
chart.redraw();
}, true);
scope.$watch("config.title", function (newTitle) {
chart.setTitle(newTitle, true);
}, true);
scope.$watch("config.loading", function (loading) {
if(loading) {
chart.showLoading()
} else {
chart.hideLoading()
}
});
scope.$watch("config.useHighStocks", function (useHighStocks) {
chart.destroy();
chart = initialiseChart(scope, element, scope.config);
});
scope.$watch("config.xAxis", function (newAxes, oldAxes) {
if (newAxes === oldAxes) return;
if(newAxes) {
chart.xAxis[0].update(newAxes);
updateZoom(chart.xAxis[0], angular.copy(newAxes));
chart.redraw();
}
}, true);
scope.$watch("config.options", function (newOptions, oldOptions, scope) {
//do nothing when called on registration
if (newOptions === oldOptions) return;
chart.destroy();
chart = initialiseChart(scope, element, scope.config);
}, true);
}
}
});
| seogi1004/cdnjs | ajax/libs/highcharts-ng/0.0.2/highcharts-ng.js | JavaScript | mit | 5,927 |
<?php
namespace Doctrine\Tests\Common\Cache;
use Doctrine\Common\Cache\MemcacheCache;
use Memcache;
/**
* @requires extension memcache
*/
class MemcacheCacheTest extends CacheTest
{
private $memcache;
protected function setUp()
{
$this->memcache = new Memcache();
if (@$this->memcache->connect('localhost', 11211) === false) {
unset($this->memcache);
$this->markTestSkipped('Cannot connect to Memcache.');
}
}
protected function tearDown()
{
if ($this->memcache instanceof Memcache) {
$this->memcache->flush();
}
}
/**
* {@inheritdoc}
*
* Memcache does not support " " and null byte as key so we remove them from the tests.
*/
public function provideCacheIds()
{
$ids = parent::provideCacheIds();
unset($ids[21], $ids[22]);
return $ids;
}
public function testGetMemcacheReturnsInstanceOfMemcache()
{
$this->assertInstanceOf('Memcache', $this->_getCacheDriver()->getMemcache());
}
/**
* {@inheritDoc}
*/
protected function _getCacheDriver()
{
$driver = new MemcacheCache();
$driver->setMemcache($this->memcache);
return $driver;
}
}
| stoyanovmiroslav/Tech-Module-SoftUni | Software Technologies/Software Technologies Exams/Rider/PHP-Skeleton/vendor/doctrine/cache/tests/Doctrine/Tests/Common/Cache/MemcacheCacheTest.php | PHP | mit | 1,278 |
/**
* Backbone-tastypie.js 0.2
* (c) 2011 Paul Uithol
*
* Backbone-tastypie may be freely distributed under the MIT license.
* Add or override Backbone.js functionality, for compatibility with django-tastypie.
* Depends on Backbone (and thus on Underscore as well): https://github.com/documentcloud/backbone.
*/
(function( undefined ) {
"use strict";
// Backbone and underscore noConflict support. Save local reference to _ and Backbone objects.
var _, Backbone;
// CommonJS shim
if ( typeof window === 'undefined' ) {
_ = require( 'underscore' );
Backbone = require( 'backbone' );
}
else {
_ = window._;
Backbone = window.Backbone;
}
Backbone.Tastypie = {
doGetOnEmptyPostResponse: true,
doGetOnEmptyPutResponse: false,
apiKey: {
username: '',
key: ''
},
csrfToken: ''
};
/**
* Override Backbone's sync function, to do a GET upon receiving a HTTP CREATED.
* This requires 2 requests to do a create, so you may want to use some other method in production.
* Modified from http://joshbohde.com/blog/backbonejs-and-django
*/
Backbone.oldSync = Backbone.sync;
Backbone.sync = function( method, model, options ) {
var headers = {};
if ( Backbone.Tastypie.apiKey && Backbone.Tastypie.apiKey.username ) {
headers[ 'Authorization' ] = 'ApiKey ' + Backbone.Tastypie.apiKey.username + ':' + Backbone.Tastypie.apiKey.key;
}
if ( Backbone.Tastypie.csrfToken ) {
headers[ 'X-CSRFToken' ] = Backbone.Tastypie.csrfToken;
}
// Keep `headers` for a potential second request
headers = _.extend( headers, options.headers );
options.headers = headers;
if ( ( method === 'create' && Backbone.Tastypie.doGetOnEmptyPostResponse ) ||
( method === 'update' && Backbone.Tastypie.doGetOnEmptyPutResponse ) ) {
var dfd = new $.Deferred();
// Set up 'success' handling
var success = options.success;
dfd.done( function( resp, textStatus, xhr ) {
_.isFunction( success ) && success( resp );
});
options.success = function( resp, textStatus, xhr ) {
// If create is successful but doesn't return a response, fire an extra GET.
// Otherwise, resolve the deferred (which triggers the original 'success' callbacks).
if ( !resp && ( xhr.status === 201 || xhr.status === 202 || xhr.status === 204 ) ) { // 201 CREATED, 202 ACCEPTED or 204 NO CONTENT; response null or empty.
var location = xhr.getResponseHeader( 'Location' ) || model.url();
return Backbone.ajax({
url: location,
headers: headers,
success: dfd.resolve,
error: dfd.reject
});
}
else {
return dfd.resolveWith( options.context || options, [ resp, textStatus, xhr ] );
}
};
// Set up 'error' handling
var error = options.error;
dfd.fail( function( xhr, textStatus, errorThrown ) {
_.isFunction( error ) && error( xhr.responseText );
});
options.error = function( xhr, textStatus, errorText ) {
dfd.rejectWith( options.context || options, [ xhr, textStatus, xhr.responseText ] );
};
// Create the request, and make it accessibly by assigning it to the 'request' property on the deferred
dfd.request = Backbone.oldSync( method, model, options );
return dfd;
}
return Backbone.oldSync( method, model, options );
};
Backbone.Model.prototype.idAttribute = 'resource_uri';
Backbone.Model.prototype.url = function() {
// Use the 'resource_uri' if possible
var url = this.get( 'resource_uri' );
// If there's no idAttribute, use the 'urlRoot'. Fallback to try to have the collection construct a url.
// Explicitly add the 'id' attribute if the model has one.
if ( !url ) {
url = _.isFunction( this.urlRoot ) ? this.urlRoot() : this.urlRoot;
url = url || this.collection && ( _.isFunction( this.collection.url ) ? this.collection.url() : this.collection.url );
if ( url && this.has( 'id' ) ) {
url = addSlash( url ) + this.get( 'id' );
}
}
url = url && addSlash( url );
return url || null;
};
/**
* Return the first entry in 'data.objects' if it exists and is an array, or else just plain 'data'.
*/
Backbone.Model.prototype.parse = function( data ) {
return data && data.objects && ( _.isArray( data.objects ) ? data.objects[ 0 ] : data.objects ) || data;
};
/**
* Return 'data.objects' if it exists.
* If present, the 'data.meta' object is assigned to the 'collection.meta' var.
*/
Backbone.Collection.prototype.parse = function( data ) {
if ( data && data.meta ) {
this.meta = data.meta;
}
return data && data.objects || data;
};
Backbone.Collection.prototype.url = function( models ) {
var url = _.isFunction( this.urlRoot ) ? this.urlRoot() : this.urlRoot;
// If the collection doesn't specify an url, try to obtain one from a model in the collection
if ( !url ) {
var model = models && models.length && models[ 0 ];
url = model && ( _.isFunction( model.urlRoot ) ? model.urlRoot() : model.urlRoot );
}
url = url && addSlash( url );
// Build a url to retrieve a set of models. This assume the last part of each model's idAttribute
// (set to 'resource_uri') contains the model's id.
if ( models && models.length ) {
var ids = _.map( models, function( model ) {
var parts = _.compact( model.url().split( '/' ) );
return parts[ parts.length - 1 ];
});
url += 'set/' + ids.join( ';' ) + '/';
}
return url || null;
};
var addSlash = function( str ) {
return str + ( ( str.length > 0 && str.charAt( str.length - 1 ) === '/' ) ? '' : '/' );
};
})();
| mkoryak/cdnjs | ajax/libs/backbone-tastypie/0.2/backbone-tastypie.js | JavaScript | mit | 5,518 |
/*
* jQuery XDomainRequest Transport Plugin 1.1.3
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Based on Julian Aubourg's ajaxHooks xdr.js:
* https://github.com/jaubourg/ajaxHooks/
*/
/*jslint unparam: true */
/*global define, window, XDomainRequest */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
if (window.XDomainRequest && !$.support.cors) {
$.ajaxTransport(function (s) {
if (s.crossDomain && s.async) {
if (s.timeout) {
s.xdrTimeout = s.timeout;
delete s.timeout;
}
var xdr;
return {
send: function (headers, completeCallback) {
var addParamChar = /\?/.test(s.url) ? '&' : '?';
function callback(status, statusText, responses, responseHeaders) {
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
xdr = null;
completeCallback(status, statusText, responses, responseHeaders);
}
xdr = new XDomainRequest();
// XDomainRequest only supports GET and POST:
if (s.type === 'DELETE') {
s.url = s.url + addParamChar + '_method=DELETE';
s.type = 'POST';
} else if (s.type === 'PUT') {
s.url = s.url + addParamChar + '_method=PUT';
s.type = 'POST';
} else if (s.type === 'PATCH') {
s.url = s.url + addParamChar + '_method=PATCH';
s.type = 'POST';
}
xdr.open(s.type, s.url);
xdr.onload = function () {
callback(
200,
'OK',
{text: xdr.responseText},
'Content-Type: ' + xdr.contentType
);
};
xdr.onerror = function () {
callback(404, 'Not Found');
};
if (s.xdrTimeout) {
xdr.ontimeout = function () {
callback(0, 'timeout');
};
xdr.timeout = s.xdrTimeout;
}
xdr.send((s.hasContent && s.data) || null);
},
abort: function () {
if (xdr) {
xdr.onerror = $.noop();
xdr.abort();
}
}
};
}
});
}
}));
| evilangelmd/jsdelivr | files/jquery.fileupload/8.5.0/js/cors/jquery.xdr-transport.js | JavaScript | mit | 3,330 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.