text
stringlengths
2
1.05M
/* * Copyright (c) 2013 - present Adobe Systems Incorporated. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ /*jslint vars: true, plusplus: true, devel: true, browser: true, nomen: true, regexp: true, indent: 4, maxerr: 50 */ /*global define, $, brackets, PathUtils */ /** * Functions for working with extension packages */ define(function (require, exports, module) { "use strict"; var AppInit = require("utils/AppInit"), FileSystem = require("filesystem/FileSystem"), FileUtils = require("file/FileUtils"), StringUtils = require("utils/StringUtils"), Strings = require("strings"), ExtensionLoader = require("utils/ExtensionLoader"), NodeConnection = require("utils/NodeConnection"), PreferencesManager = require("preferences/PreferencesManager"); PreferencesManager.definePreference("proxy", "string", undefined, { description: Strings.DESCRIPTION_PROXY }); var Errors = { ERROR_LOADING: "ERROR_LOADING", MALFORMED_URL: "MALFORMED_URL", UNSUPPORTED_PROTOCOL: "UNSUPPORTED_PROTOCOL" }; var InstallationStatuses = { FAILED: "FAILED", INSTALLED: "INSTALLED", ALREADY_INSTALLED: "ALREADY_INSTALLED", SAME_VERSION: "SAME_VERSION", OLDER_VERSION: "OLDER_VERSION", NEEDS_UPDATE: "NEEDS_UPDATE", DISABLED: "DISABLED" }; /** * @private * @type {NodeConnection} * Connects to ExtensionManagerDomain */ var _nodeConnection; /** * @private * @type {jQuery.Deferred.<NodeConnection>} * A deferred which is resolved with a NodeConnection or rejected if * we are unable to connect to Node. */ var _nodeConnectionDeferred = $.Deferred(); /** * @type {number} Used to generate unique download ids */ var _uniqueId = 0; function _extensionManagerCall(callback) { if (_nodeConnection.domains.extensionManager) { return callback(_nodeConnection.domains.extensionManager); } else { return new $.Deferred().reject("extensionManager domain is undefined").promise(); } } /** * TODO: can this go away now that we never call it directly? * * Validates the package at the given path. The actual validation is * handled by the Node server. * * The promise is resolved with an object: * { errors: Array.<{string}>, metadata: { name:string, version:string, ... } } * metadata is pulled straight from package.json and will be undefined * if there are errors or null if the extension did not include package.json. * * @param {string} Absolute path to the package zip file * @param {{requirePackageJSON: ?boolean}} validation options * @return {$.Promise} A promise that is resolved with information about the package */ function validate(path, options) { return _extensionManagerCall(function (extensionManager) { var d = new $.Deferred(); extensionManager.validate(path, options) .done(function (result) { d.resolve({ errors: result.errors, metadata: result.metadata }); }) .fail(function (error) { d.reject(error); }); return d.promise(); }); } /** * Validates and installs the package at the given path. Validation and * installation is handled by the Node process. * * The extension will be installed into the user's extensions directory. * If the user already has the extension installed, it will instead go * into their disabled extensions directory. * * The promise is resolved with an object: * { errors: Array.<{string}>, metadata: { name:string, version:string, ... }, * disabledReason:string, installedTo:string, commonPrefix:string } * metadata is pulled straight from package.json and is likely to be undefined * if there are errors. It is null if there was no package.json. * * disabledReason is either null or the reason the extension was installed disabled. * * @param {string} path Absolute path to the package zip file * @param {?string} nameHint Hint for the extension folder's name (used in favor of * path's filename if present, and if no package metadata present). * @param {?boolean} _doUpdate private argument used to signal an update * @return {$.Promise} A promise that is resolved with information about the package * (which may include errors, in which case the extension was disabled), or * rejected with an error object. */ function install(path, nameHint, _doUpdate) { return _extensionManagerCall(function (extensionManager) { var d = new $.Deferred(), destinationDirectory = ExtensionLoader.getUserExtensionPath(), disabledDirectory = destinationDirectory.replace(/\/user$/, "/disabled"), systemDirectory = FileUtils.getNativeBracketsDirectoryPath() + "/extensions/default/"; var operation = _doUpdate ? "update" : "install"; extensionManager[operation](path, destinationDirectory, { disabledDirectory: disabledDirectory, systemExtensionDirectory: systemDirectory, apiVersion: brackets.metadata.apiVersion, nameHint: nameHint }) .done(function (result) { result.keepFile = false; if (result.installationStatus !== InstallationStatuses.INSTALLED || _doUpdate) { d.resolve(result); } else { // This was a new extension and everything looked fine. // We load it into Brackets right away. ExtensionLoader.loadExtension(result.name, { // On Windows, it looks like Node converts Unix-y paths to backslashy paths. // We need to convert them back. baseUrl: FileUtils.convertWindowsPathToUnixPath(result.installedTo) }, "main").then(function () { d.resolve(result); }, function () { d.reject(Errors.ERROR_LOADING); }); } }) .fail(function (error) { d.reject(error); }); return d.promise(); }); } /** * Special case handling to make the common case of downloading from GitHub easier; modifies 'urlInfo' as * needed. Converts a bare GitHub repo URL to the corresponding master ZIP URL; or if given a direct * master ZIP URL already, sets a nicer download filename (both cases use the repo name). * * @param {{url:string, parsed:Array.<string>, filenameHint:string}} urlInfo */ function githubURLFilter(urlInfo) { if (urlInfo.parsed.hostname === "github.com" || urlInfo.parsed.hostname === "www.github.com") { // Is it a URL to the root of a repo? (/user/repo) var match = /^\/[^\/?]+\/([^\/?]+)(\/?)$/.exec(urlInfo.parsed.pathname); if (match) { if (!match[2]) { urlInfo.url += "/"; } urlInfo.url += "archive/master.zip"; urlInfo.filenameHint = match[1] + ".zip"; } else { // Is it a URL directly to the repo's 'master.zip'? (/user/repo/archive/master.zip) match = /^\/[^\/?]+\/([^\/?]+)\/archive\/master.zip$/.exec(urlInfo.parsed.pathname); if (match) { urlInfo.filenameHint = match[1] + ".zip"; } } } } /** * Downloads from the given URL to a temporary location. On success, resolves with the path of the * downloaded file (typically in a temp folder) and a hint for the real filename. On failure, rejects * with an error object. * * @param {string} url URL of the file to be downloaded * @param {number} downloadId Unique number to identify this request * @return {$.Promise} */ function download(url, downloadId) { return _extensionManagerCall(function (extensionManager) { var d = new $.Deferred(); // Validate URL // TODO: PathUtils fails to parse URLs that are missing the protocol part (e.g. starts immediately with "www...") var parsed = PathUtils.parseUrl(url); if (!parsed.hostname) { // means PathUtils failed to parse at all d.reject(Errors.MALFORMED_URL); return d.promise(); } if (parsed.protocol !== "http:" && parsed.protocol !== "https:") { d.reject(Errors.UNSUPPORTED_PROTOCOL); return d.promise(); } var urlInfo = { url: url, parsed: parsed, filenameHint: parsed.filename }; githubURLFilter(urlInfo); // Decide download destination var filename = urlInfo.filenameHint; filename = filename.replace(/[^a-zA-Z0-9_\- \(\)\.]/g, "_"); // make sure it's a valid filename if (!filename) { // in case of URL ending in "/" filename = "extension.zip"; } // Download the bits (using Node since brackets-shell doesn't support binary file IO) var r = extensionManager.downloadFile(downloadId, urlInfo.url, PreferencesManager.get("proxy")); r.done(function (result) { d.resolve({ localPath: FileUtils.convertWindowsPathToUnixPath(result), filenameHint: urlInfo.filenameHint }); }).fail(function (err) { d.reject(err); }); return d.promise(); }); } /** * Attempts to synchronously cancel the given pending download. This may not be possible, e.g. * if the download has already finished. * * @param {number} downloadId Identifier previously passed to download() */ function cancelDownload(downloadId) { return _extensionManagerCall(function (extensionManager) { return extensionManager.abortDownload(downloadId); }); } /** * On success, resolves with an extension metadata object; at that point, the extension has already * started running in Brackets. On failure (including validation errors), rejects with an error object. * * An error object consists of either a string error code OR an array where the first entry is the error * code and the remaining entries are further info. The error code string is one of either * ExtensionsDomain.Errors or Package.Errors. Use formatError() to convert an error object to a friendly, * localized error message. * * @param {string} path Absolute path to the package zip file * @param {?string} filenameHint Hint for the extension folder's name (used in favor of * path's filename if present, and if no package metadata present). * @return {$.Promise} A promise that is rejected if there are errors during * install or the extension is disabled. */ function installFromPath(path, filenameHint) { var d = new $.Deferred(); install(path, filenameHint) .done(function (result) { result.keepFile = true; var installationStatus = result.installationStatus; if (installationStatus === InstallationStatuses.ALREADY_INSTALLED || installationStatus === InstallationStatuses.NEEDS_UPDATE || installationStatus === InstallationStatuses.SAME_VERSION || installationStatus === InstallationStatuses.OLDER_VERSION) { d.resolve(result); } else { if (result.errors && result.errors.length > 0) { // Validation errors - for now, only return the first one d.reject(result.errors[0]); } else if (result.disabledReason) { // Extension valid but left disabled (wrong API version, extension name collision, etc.) d.reject(result.disabledReason); } else { // Success! Extension is now running in Brackets d.resolve(result); } } }) .fail(function (err) { d.reject(err); }); return d.promise(); } /** * On success, resolves with an extension metadata object; at that point, the extension has already * started running in Brackets. On failure (including validation errors), rejects with an error object. * * An error object consists of either a string error code OR an array where the first entry is the error * code and the remaining entries are further info. The error code string is one of either * ExtensionsDomain.Errors or Package.Errors. Use formatError() to convert an error object to a friendly, * localized error message. * * The returned cancel() function will *attempt* to cancel installation, but it is not guaranteed to * succeed. If cancel() succeeds, the Promise is rejected with a CANCELED error code. If we're unable * to cancel, the Promise is resolved or rejected normally, as if cancel() had never been called. * * @return {{promise: $.Promise, cancel: function():boolean}} */ function installFromURL(url) { var STATE_DOWNLOADING = 1, STATE_INSTALLING = 2, STATE_SUCCEEDED = 3, STATE_FAILED = 4; var d = new $.Deferred(); var state = STATE_DOWNLOADING; var downloadId = (_uniqueId++); download(url, downloadId) .done(function (downloadResult) { state = STATE_INSTALLING; installFromPath(downloadResult.localPath, downloadResult.filenameHint) .done(function (result) { var installationStatus = result.installationStatus; state = STATE_SUCCEEDED; result.localPath = downloadResult.localPath; result.keepFile = false; if (installationStatus === InstallationStatuses.INSTALLED) { // Delete temp file FileSystem.getFileForPath(downloadResult.localPath).unlink(); } d.resolve(result); }) .fail(function (err) { // File IO errors, internal error in install()/validate(), or extension startup crashed state = STATE_FAILED; FileSystem.getFileForPath(downloadResult.localPath).unlink(); d.reject(err); // TODO: needs to be err.message ? }); }) .fail(function (err) { // Download error (the Node-side download code cleans up any partial ZIP file) state = STATE_FAILED; d.reject(err); }); return { promise: d.promise(), cancel: function () { if (state === STATE_DOWNLOADING) { // This will trigger download()'s fail() handler with CANCELED as the err code cancelDownload(downloadId); } // Else it's too late to cancel; we'll continue on through the done() chain and emit // a success result (calling done() handlers) if all else goes well. } }; } /** * Converts an error object as returned by install(), installFromPath() or * installFromURL() into a flattened, localized string. * * @param {string|Array.<string>} error * @return {string} */ function formatError(error) { function localize(key) { if (Strings[key]) { return Strings[key]; } console.log("Unknown installation error", key); return Strings.UNKNOWN_ERROR; } if (Array.isArray(error)) { error[0] = localize(error[0]); return StringUtils.format.apply(window, error); } else { return localize(error); } } /** * Removes the extension at the given path. * * @param {string} path The absolute path to the extension to remove. * @return {$.Promise} A promise that's resolved when the extension is removed, or * rejected if there was an error. */ function remove(path) { return _extensionManagerCall(function (extensionManager) { return extensionManager.remove(path); }); } /** * Disables the extension at the given path. * * @param {string} path The absolute path to the extension to disable. * @return {$.Promise} A promise that's resolved when the extenion is disabled, or * rejected if there was an error. */ function disable(path) { var result = new $.Deferred(), file = FileSystem.getFileForPath(path + "/.disabled"); file.write("", function (err) { if (err) { result.reject(err); } else { result.resolve(); } }); return result.promise(); } /** * Enables the extension at the given path. * * @param {string} path The absolute path to the extension to enable. * @return {$.Promise} A promise that's resolved when the extenion is enable, or * rejected if there was an error. */ function enable(path) { var result = new $.Deferred(), file = FileSystem.getFileForPath(path + "/.disabled"); file.unlink(function (err) { if (err) { result.reject(err); return; } ExtensionLoader.loadExtension(FileUtils.getBaseName(path), { baseUrl: path }, "main") .done(result.resolve) .fail(result.reject); }); return result.promise(); } /** * Install an extension update located at path. * This assumes that the installation was previously attempted * and an installationStatus of "ALREADY_INSTALLED", "NEEDS_UPDATE", "SAME_VERSION", * or "OLDER_VERSION" was the result. * * This workflow ensures that there should not generally be validation errors * because the first pass at installation the extension looked at the metadata * and installed packages. * * @param {string} path to package file * @param {?string} nameHint Hint for the extension folder's name (used in favor of * path's filename if present, and if no package metadata present). * @return {$.Promise} A promise that is resolved when the extension is successfully * installed or rejected if there is a problem. */ function installUpdate(path, nameHint) { var d = new $.Deferred(); install(path, nameHint, true) .done(function (result) { if (result.installationStatus !== InstallationStatuses.INSTALLED) { d.reject(result.errors); } else { d.resolve(result); } }) .fail(function (error) { d.reject(error); }); return d.promise(); } /** * Allows access to the deferred that manages the node connection. This * is *only* for unit tests. Messing with this not in testing will * potentially break everything. * * @private * @return {jQuery.Deferred} The deferred that manages the node connection */ function _getNodeConnectionDeferred() { return _nodeConnectionDeferred; } // Initializes node connection // TODO: duplicates code from StaticServer // TODO: can this be done lazily? AppInit.appReady(function () { _nodeConnection = new NodeConnection(); _nodeConnection.connect(true).then(function () { var domainPath = FileUtils.getNativeBracketsDirectoryPath() + "/" + FileUtils.getNativeModuleDirectoryPath(module) + "/node/ExtensionManagerDomain"; _nodeConnection.loadDomains(domainPath, true) .then( function () { _nodeConnectionDeferred.resolve(); }, function () { // Failed to connect console.error("[Extensions] Failed to connect to node", arguments); _nodeConnectionDeferred.reject(); } ); }); }); // For unit tests only exports._getNodeConnectionDeferred = _getNodeConnectionDeferred; exports.installFromURL = installFromURL; exports.installFromPath = installFromPath; exports.validate = validate; exports.install = install; exports.remove = remove; exports.disable = disable; exports.enable = enable; exports.installUpdate = installUpdate; exports.formatError = formatError; exports.InstallationStatuses = InstallationStatuses; });
/* scales.js * In this file we define data as objects to populate the SCIM & PAIQI, scales * created by George Marzloff | george@marzloffmedia.com */ // FIM // Based on https://www.cms.gov/Medicare/Medicare-Fee-for-Service-Payment/InpatientRehabFacPPS/downloads/irfpai-manualint.pdf // SCIM // Based on http://sci2.rickhanseninstitute.org/images/sci2/SCIM/toolkit/SCIM_Clinical_Form.pdf //PAIQI // https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/IRF-Quality-Reporting/Downloads/DRAFT-IRF-PAI-FOR-OCT-2016.pdf var FIM_Scale = function () { this.name = "FIM Instrument"; this.dressingChoices = [ new Choice("Complete Independence - safely dresses & undresses self obtaining clothes from drawers/closets, managing bra, front garment, zippers, buttons, snaps, dons prosthesis/orthosis.",7), new Choice("Modified Independence - requires special adaptive closure such as a Velcro fastener or assisitve device, or takes more than a reasonable amount of time.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (application of orthoses or assistive/adaptive devices, setting out clothes",5), new Choice("Minimal Contact Assistance - performs 75% or more of dressing tasks.",4), new Choice("Moderate Assistance - performs 50%-74% of dressing tasks.",3), new Choice("Maximal Assistance - performs 25-49% of dressing tasks.",2), new Choice("Total Assistance - performs <25% of dressing tasks",1), new Choice("Activity Does Not Occur - enter code 0 only for the admission assessment. The patient does not dress self and is not dressed by a helper.",0) ]; this.questions = [new Question( "39A. Eating (using suitable utensils to bring food to the mouth and the ability to chew and swallow the food once the meal is presented).", [ new Choice("Complete Independence - eats from a dish while managing variety of food consistencies, and drinks from a cup/glass with meal presented on table/tray. Opens containers, butters bread, cuts meat, pours liquids, uses a spoon or fork to bring food to mouth where it is chewed and swallowed.",7), new Choice("Modified Independence - requires an adaptive or assistive device e.g. long straw spork or rocking knife, requires more than a reasonable time to eat, or requires modified food consistency. If s/he uses PPN/PEG, s/he self-feeds.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (application of orthoses or assistive/adaptive devices) or another person is required to open containers, butter bread, cut meat, or pour liquids.",5), new Choice("Minimal Contact Assistance - performs 75% or more of eating tasks.",4), new Choice("Moderate Assistance - performs 50%-74% of eating tasks.",3), new Choice("Maximal Assistance - performs 25-49% of eating tasks.",2), new Choice("Total Assistance - performs <25% of eating tasks or fed via PPN/PEG and does not self-administer",1), new Choice("Activity Does Not Occur - enter code 0 only for the admission assessment. The patient does not eat and does not receive PPN/PEG feeds during the entire assessment time frame.",0) ], "Self-Care"), new Question( "39B. Grooming (oral care, hair grooming, washing their hands face and either shaving their face or applying makeup).", [ new Choice("Complete Independence - cleans teeth/dentures, combs/brushes hair, washes hands, face and either shaves the face or applies make-up. activity is performed safely.",7), new Choice("Modified Independence - requires specialized equipment (including prosthesis or orthosis) to groom or takes more than a reasonable time, or there are safety considerations.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (application of orthoses or assistive/adaptive devices, setting out grooming equipment or initial preparation such as applying toothpaste or opening make-up containers",5), new Choice("Minimal Contact Assistance - performs 75% or more of grooming tasks.",4), new Choice("Moderate Assistance - performs 50%-74% of grooming tasks.",3), new Choice("Maximal Assistance - performs 25-49% of grooming tasks.",2), new Choice("Total Assistance - performs <25% of grooming tasks",1), new Choice("Activity Does Not Occur - enter code 0 only for the admission assessment. The patient does not groom and is not groomed by a helper.",0) ], "Self-Care"), new Question( "39C. Bathing (washing, rinsing and drying body from neck down in either tub/shower/sponge bath. Performs activity safely).", [ new Choice("Complete Independence - safely bathes (washes, rinses and dries) the body.",7), new Choice("Modified Independence - requires specialized equipment (including prosthesis or orthosis) to bathe or takes more than a reasonable time, or there are safety considerations.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (application of orthoses or assistive/adaptive devices, setting out bathing equipment or initial preparation of water and washing materials",5), new Choice("Minimal Contact Assistance - performs 75% or more of bathing tasks.",4), new Choice("Moderate Assistance - performs 50%-74% of bathing tasks.",3), new Choice("Maximal Assistance - performs 25-49% of bathing tasks.",2), new Choice("Total Assistance - performs <25% of bathing tasks",1), new Choice("Activity Does Not Occur - enter code 0 only for the admission assessment. The patient does not bathe self and is not bathed by a helper.",0) ], "Self-Care"), new Question( "39D. Dressing - Upper (safely dressing and applying/removing prosthesis/orthosis).", this.dressingChoices, "Self-Care"), new Question( "39E. Dressing - Lower (safely dressing and applying/removing prosthesis/orthosis).", this.dressingChoices, "Self-Care"), new Question( "39F. Toileting (safely maintaining perineal hygiene and adjusting clothing before and after using a toilet, commode, bedpan, or urinal.)", [ new Choice("Complete Independence - safely cleanses self after voiding and bowel movements, safely adjusts clothing before/after using toilet commode, bedpan or urinal",7), new Choice("Modified Independence - requires specialized equipment (including prosthesis or orthosis) during toileting or takes more than a reasonable time, or there are safety considerations.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (application of adaptive devices or opening packages",5), new Choice("Minimal Contact Assistance - performs 75% or more of toileting tasks.",4), new Choice("Moderate Assistance - performs 50%-74% of toileting tasks.",3), new Choice("Maximal Assistance - performs 25-49% of toileting tasks.",2), new Choice("Total Assistance - performs <25% of toileting tasks",1), new Choice("Activity Does Not Occur - enter code 0 only for the admission assessment. The patient or helper does not perform toileting tasks.",0) ], "Self-Care"), new Question( "39G. Bladder Management (safe use of equipment or agents)", [ new Choice("Complete Independence - controls bladder completely and intentionally without equipment or devices and is never incontinent",7), new Choice("Modified Independence - requires urinal, bedpan, catheter, absorbent pad, diaper, urinary collecting device or diversion, or uses meds for control. " + "If cath, pt cleans, sterilizes and sets up equipment for irrigation without assistance. If device used, (s)he assembles/applies external catheter "+ "with drainage bags or an ileal appliance without help. also empties, puts on, removes, cleans leg bag or ileal bag. Has no accidents. ",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (placing or emptying) equipment to maintain satisfactory voiding pattern or external device in the past 3 days.",5), new Choice("Minimal Contact Assistance - to maintain external device, and performs >75% of bladder tasks in past 3 days.",4), new Choice("Moderate Assistance - to maintain external device, and performs 50-74% of bladder tasks in past 3 days.",3), new Choice("Maximal Assistance - performs 25-49% of bladder management tasks.",2), new Choice("Total Assistance - performs <25% of bladder management tasks",1) ], "Self-Care"), new Question( "39H. Bowel Management (safe use of equipment or agents)", [ new Choice("Complete Independence - controls bowel completely and intentionally without equipment or devices and is never incontinent",7), new Choice("Modified Independence - requires bedpad, dig stim, stool softener, suppositories, laxatives, enemas or other meds on a regular basis. Never incontinent.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup of equipment to maintain satisfactory excretory pattern or ostomy in the past 3 days.",5), new Choice("Minimal Contact Assistance - to maintain satisfactory excretory pattern by suppositories, enemas or an external device, performs >75% tasks in past 3 days.",4), new Choice("Moderate Assistance - to maintain satisfactory excretory pattern by suppositories, enemas or an external device, and performs 50-74% of tasks in past 3 days.",3), new Choice("Maximal Assistance - performs 25-49% of bowel management tasks in past 3 days.",2), new Choice("Total Assistance - performs <25% of bowel management tasks in past 3 days",1) ], "Self-Care"), new Question( "39I. Transfers: Bed, Chair, Wheelchair (includes all aspects transferring to/from items, or sit-to-stand if patient is ambulatory)", [ new Choice("Complete Independence - if walking - safely sits/stands from regular chair. if in wheelchair, aproaches bed/chair, locks brakes, lifts foot rests, removes arm rest, standing pivots or sliding transfer w/o board and returns.",7), new Choice("Modified Independence - requires adaptive or assistive device such as a sliding board, lift, grab bars, or special seat/chair/brace/crutches, or it takes a long time, or is done unsafely.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (positioning sliding board, moving foot rests, etc)",5), new Choice("Minimal Contact Assistance - requires no more help than touching and performs >75% transferring tasks",4), new Choice("Moderate Assistance - requires more help than touching and performs 50-74% transferring tasks",3), new Choice("Maximal Assistance - performs 25-49% of transferring tasks.",2), new Choice("Total Assistance - performs <25% of transferring tasks",1) ], "Mobility"), new Question( "39J. Transfers: Toilet (includes all aspects transferring to/from items, or sit-to-stand if patient is ambulatory)", [ new Choice("Complete Independence - if walking - safely sits/stands from standard toilet. if in wheelchair, approaches toilet, locks brakes, lifts foot rests, removes arm rest, standing pivots or sliding transfer w/o board and returns.",7), new Choice("Modified Independence - requires adaptive or assistive device such as a sliding board, lift, grab bars, or special seat, or it takes a long time, or is done unsafely.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (positioning sliding board, moving foot rests, etc)",5), new Choice("Minimal Contact Assistance - requires no more help than touching and performs >75% transferring tasks",4), new Choice("Moderate Assistance - requires more help than touching and performs 50-74% transferring tasks",3), new Choice("Maximal Assistance - performs 25-49% of transferring tasks.",2), new Choice("Total Assistance - performs <25% of transferring tasks",1), new Choice("Activity Does Not Occur - only for admission, and patient or helper does not transfer to toilet (e.g. bedpan or urinal use only)",1) ], "Mobility"), new Question( "39K. Transfers: Tub (getting into and out of tub safely)", [ new Choice("Complete Independence - if walking - safely approaches tub, gets into and out of it. if in wheelchair, approaches tub, locks brakes, lifts foot rests, removes arm rest, standing pivots or sliding transfer w/o board and returns.",7), new Choice("Modified Independence - requires adaptive or assistive device such as a sliding board, lift, grab bars, or special seat, or it takes a long time, or is done unsafely.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (positioning sliding board, moving foot rests, etc)",5), new Choice("Minimal Contact Assistance - requires no more help than touching and performs >75% transferring tasks",4), new Choice("Moderate Assistance - requires more help than touching and performs 50-74% transferring tasks",3), new Choice("Maximal Assistance - performs 25-49% of transferring tasks.",2), new Choice("Total Assistance - performs <25% of transferring tasks",1), new Choice("Activity Does Not Occur - patient or helper does not transfer to tub",1) ], "Mobility"), new Question( "39L. Transfers: Shower (getting into and out of shower safely)", [ new Choice("Complete Independence - if walking - safely approaches shower stall, gets into and out of it. if in wheelchair, approaches shower stall, locks brakes, lifts foot rests, removes arm rest, standing pivots or sliding transfer w/o board and returns.",7), new Choice("Modified Independence - requires adaptive or assistive device such as a sliding board, lift, grab bars, or special seat, or it takes a long time, or is done unsafely.",6), new Choice("Supervision or Setup - requires supervision (standing by, cuing or coaxing) or setup (positioning sliding board, moving foot rests, etc)",5), new Choice("Minimal Contact Assistance - requires no more help than touching and performs >75% transferring tasks",4), new Choice("Moderate Assistance - requires more help than touching and performs 50-74% transferring tasks",3), new Choice("Maximal Assistance - performs 25-49% of transferring tasks.",2), new Choice("Total Assistance - performs <25% of transferring tasks",1), new Choice("Activity Does Not Occur - patient or helper does not transfer in/out of shower",1) ], "Mobility"), new Question( "39K. Locomotion: Walk (safely walking on level surface once in a standing position)", [ new Choice("Complete Independence - safely walks minimum of 150 feet without assistive devices.",7), new Choice("Modified Independence - walks min 150 ft, but uses brace (orthosis) or prosthesis, adaptive shoes, cane crutches, or walkerette, or is done slowly, or unsafely",6), new Choice("Exception (Household Locomotion) - walks 50-150 ft independently with/without device. done slowly or unsafely",5), new Choice("Supervision - requires standby supervision, cuing, coaxing to min 150ft",5), new Choice("Minimal Contact Assistance - performs >75% walking effort to go minimum of 150ft",4), new Choice("Moderate Assistance - performs 50-74% to go minimum 150ft",3), new Choice("Maximal Assistance - performs 25-49% of walking effort to go minimum 50 ft, requires 1 person assist.",2), new Choice("Total Assistance - performs <25% of walking effort or requires two person assist, or walks to less than 50 ft",1), new Choice("Activity Does Not Occur - patient does not walk, only used for admission",1) ], "Mobility"), new Question( "39L. Locomotion: Wheelchair (safely won a level surface, once in a seated position)", [ new Choice("Do not use if patient uses a wheelchair.",7), new Choice("Modified Independence - operates manual/motorized wheelchair independently for 150+ ft, turns around, maneuvers chair to a table, bed toilet, negotiates 3% grade, maneuvers on rugs and over door sills.",6), new Choice("Exception (Household Locomotion) - operates a manual or motorized wheelchair independently only short distances",5), new Choice("Supervision - requires standby supervision, cuing, coaxing to min 150ft",5), new Choice("Minimal Contact Assistance - performs >75% walking effort to go minimum of 150ft",4), new Choice("Moderate Assistance - performs 50-74% to go minimum 150ft",3), new Choice("Maximal Assistance - performs 25-49% of walking effort to go minimum 50 ft, requires 1 person assist.",2), new Choice("Total Assistance - performs <25% of walking effort or requires two person assist, or walks to less than 50 ft",1), new Choice("Activity Does Not Occur - patient does not use a wheelchair or not pushed in a wheelchair by helper. only used for admission",1) ], "Mobility"), new Question( "39M. Locomotion: Stairs", [ new Choice("Independence - Safely goes up and down at least 1 flight of stairs without depending on handrail or support",7), new Choice("Modified Independence - Goes up and down at least 1 flight of stairs but requires side support, handrail, cane or portable supports, or takes long time, or safety issue",6), new Choice("Exception (Household Ambulation) - Goes up/down 4-6 stairs independently w or w/o device. takes long time or safety issue", 5), new Choice("Minimal Contact Assistance - patient performs >75% effort to go up and down one flight of stairs",4), new Choice("Moderate Assistance - patient performs 50-74% effort to go up and down one flight of stairs",3), new Choice("Maximal Assistance - patient performs 25-49% effort to go up and down 4-6 stairs, requires 1-person assistance",2), new Choice("Total Assistance - patient performs <25% of effort or requires 2-person assist or goes up/down <4 stairs",1), new Choice("Activity does not occur (does not go up/down stairs or helper does not carry subject up/down stairs.",0) ], "Mobility"), new Question( "39N. Comprehension", [ new Choice("Complete Independence - understands complex or abstract directions and coversation, and understands either spoken or written language (not necessarily English)",7), new Choice("Modified Independence - understands readily or with only mild difficulty complex or abstract directions and conversation. does not require prompting, though s/he may require hearing/visual aid or other assistive device or extra time.",6), new Choice("Standby Prompting - understands directions and conversation about basic daily needs >90% of the time, requires prompting (slowed speech, use of repetition, stressing particular words/phrases, pauses, visual or gestural cues <10% time",5), new Choice("Minimal Prompting - understands directions and conversation about daily neesd 75-90% of the time",4), new Choice("Moderate Prompting - understands directions and conversation about basic daily needs 50-74% of the time",3), new Choice("Maximal Prompting - understands directions and conversation about basic daily needs 25-49% of the time. understands only simple commonly used spoken expressions (hello, how are you) or gestures (waving good-bye). requires prompting >1/2 the time",2), new Choice("Total Assistance - understands directions and conversation about basic daily needs <25% of the time or does not understand simple commonly used spoken expressions (hello, how are you) or gestures (waving good-bye) or does not respond appropriately despite prompting",1) ], "Cognition"), new Question( "39O. Expression", [ new Choice("Complete Independence - Expresses complex or abstract ideas clearly and fluently (not necessarily in English)",7), new Choice("Modified Independence - usually expresses complex or abstract ideas clearly or with mild difficulty. no prompting needed but may require augmentative communication system.",6), new Choice("Standby Prompting - expresses basic daily needs and ideas >90% of the time. requires prompting <10% of time to be understood.",5), new Choice("Minimal Prompting - expresses basic daily needs and ideas 75-90% of the time.",4), new Choice("Moderate Prompting - expresses basic daily needs and ideas 50-74% of the time.",3), new Choice("Maximal Prompting - expresses basic daily needs and ideas 25-49% of the time. uses single words or gestures and needs prompting >50% time",2), new Choice("Total Assistance - expresses basic daily needs <25% of the time, or does not express basic daily needs appropriately despite prompting.",1) ], "Cognition"), new Question( "39P. Social Interaction", [ new Choice("Complete Independence - interacts appropriately with staff, other patients and family members, no medication for control.",7), new Choice("Modified Independence - usually interacts appropriately with staff, other patients and family members, rarely loses control. does not require supervision but may require more reasonable amonut of time to adjust to social situations or medication for control.",6), new Choice("Supervision - requires supervision only under stressful or unfamiliar conditions < 10% time. may require encouragement to initiate participation.",5), new Choice("Minimal Direction - interacts appropriately 75-90% of the time.",4), new Choice("Moderate Direction - interacts appropriately 50-74% of the time.",3), new Choice("Maximal Direction - interacts appropriately 25-49% of the time, but may need restraint due to socially inappropriate behaviors.",2), new Choice("Total Assistance - interacts appropriately <25% of time and may need restraint due to socially inappropriate behaviors",1) ], "Cognition"), new Question( "39Q. Problem Solving", [ new Choice("Complete Independence - consistently recognizes problems when present, makes appropriate decisions, initiates and carries out sequence of steps to solve complex problems until the task is completed, and self-corrects if errors are made.",7), new Choice("Modified Independence - usually recognizes present probme, with only mild difficulty makes appropriate decisions, initiates and carries out sequence of steps to solve complex problems, or requires more than a reasonable time to make appropriate decisions or complex probmlems.",6), new Choice("Supervision - requires supervision (E.g. cuing or coaxing) to solve less routine problems only under stressful or unfamiliar conditions but <10% of the time",5), new Choice("Minimal Direction - solves routine problems 75-90% of the time",4), new Choice("Moderate Direction - solves routine problems 50-74% of the time",3), new Choice("Maximal Direction - solves routine problems 25-49% of the time. needs direction more than half time to initiate, plan, or complete simple daily activities and may need restraint for safety.",2), new Choice("Total Assistance - solves routine problems <25% of the time. needs direction nearly all the time, or does not effectively solve problems, and may require constant 1-to-1 direction to complete simple daily tasks. may need safety restraint.",1) ], "Cognition"), new Question( "39R. Memory", [ new Choice("Complete Independence - recognizes people frequently encountered, remembers daily routines, and executes requests of others without need for repetition",7), new Choice("Modified Independence - appears to have only mild difficulty recognizing people frequently encountered, remembering daily routines, and responding to requests of others. May use self-initiated or environmental cues, prompts or aids.",6), new Choice("Supervision - requires prompting (cuing, repetition, reminders) only under stressful or unfamiliar conditions, but no more than 10% of the time",5), new Choice("Minimal Prompting - recognizes 75-90% of the time",4), new Choice("Moderate Prompting - recognizes 50-74% of the time",3), new Choice("Maximal Prompting - recognizes 25-49% of the time, needs prompting more than half the time",2), new Choice("Total Assistance - recognizes <25% of the time, or does not effectively recognize and remember",1) ], "Cognition") ]; this.userScores = Array(this.questions.length).fill(7); // initializes array to keep track of score for each question. 26 total questions } var SCIM_Scale = function () { this.name = "Spinal Cord Independence Measure"; this.mobilityChoices = [ new Choice("Requires total assistance", 0), new Choice("Needs electric wheelchair or partial assistance to operate manual wheelchair", 1), new Choice("Moves independently in manual wheelchair", 2), new Choice("Requires supervision while walking (with or without devices)", 3), new Choice("Walks with a walking frame or crutches (swing)", 4), new Choice("Walks with crutches or two canes (reciprocal walking)", 5), new Choice("Walks with one cane", 6), new Choice("Needs leg orthosis only", 7), new Choice("Walks without walking aids", 8) ]; this.questions = [ new Question( "1. Feeding (cutting, opening containers, pouring, bringing food to mouth, holding cup with fluid)", [ new Choice("Needs parenteral, gastrostomy or fully assisted oral feeding", 0), new Choice("Needs partial assistance for eating and/or drinking, or for wearing adaptive devices", 1), new Choice("Eats independently; needs adaptive devices or assistance only for cutting food and/or pouring and/or opening containers", 2), new Choice("Eats and drinks independently; does not require assistance or adaptive device", 3) ], "Self-Care"), new Question( "2A. Bathing Upper Body (soaping, washing, drying body and head, manipulating water tap)", [ new Choice("Requires total assistance", 0), new Choice("Requires partial assistance", 1), new Choice("Washes independently with adaptive devices or in a specific setting (e.g., bars, chair", 2), new Choice("Washes independently; does not require adaptive devices or specific setting", 3) ], "Self-Care"), new Question( "2B. Bathing Lower Body (soaping, washing, drying, manipulating water tap)", [ new Choice("Requires total assistance", 0), new Choice("Requires partial assistance", 1), new Choice("Washes independently with adaptive devices or in a specific setting (e.g., bars, chair", 2), new Choice("Washes independently; does not require adaptive devices or specific setting", 3) ], "Self-Care"), new Question( "3A. Dressing Upper Body (clothes, shoes, permanent orthoses; dressing, wearing, undressing)", [ new Choice("Requires total assistance", 0), new Choice("Requires partial assistance with clothes without buttons, zippers or laces (cwobzl)", 1), new Choice("Independent with cwobzl; requires adaptive devices and/or specific settings (adss)", 2), new Choice("Independent with cwobzl; does not require adss; needs assistance or adss only for bzl.", 3), new Choice("Dresses (any clothes) independently; does not require adaptive devices or specific setting", 4) ], "Self-Care"), new Question( "3B. Dressing Lower Body (clothes, shoes, permanent orthoses; dressing, wearing, undressing)", [ new Choice("Requires total assistance", 0), new Choice("Requires partial assistance with clothes without buttons, zippers or laces (cwobzl)", 1), new Choice("Independent with cwobzl; requires adaptive devices and/or specific settings (adss)", 2), new Choice("Independent with (cwobzl) without adss; needs assistance or adss only for bzl.", 3), new Choice("Dresses (any clothes) independently; does not require adaptive devices or specific setting", 4) ], "Self-Care"), new Question( "4. Grooming (washing hands and face, brushing teeth, combing hair, shaving, applying makeup)", [ new Choice("Requires total assistance", 0), new Choice("Requires partial assistance", 1), new Choice("Grooms independently with adaptive devices", 2), new Choice("Grooms independently without adaptive devices", 3) ], "Self-Care"), new Question( "5. Respiration", [ new Choice("Requires tracheal tube (TT) and permanent or intermittent assisted ventilation (IAV)", 0), new Choice("Breathes independently with TT; requires oxygen, much assistance in coughing or TT management", 2), new Choice("Breathes independently with TT; requires little assistance in coughing or TT management", 4), new Choice("Breathes independently without TT; requires oxygen, much assistance in coughing, a mask (e.g., peep) or IAV (bipap)", 6), new Choice("Breathes independently without TT; requires little assistance or stimulation for coughing", 8), new Choice("Breathes independently without assistance or device", 10), ], "Respiration and Sphincter Management"), new Question( "6. Sphincter Management - Bladder", [ new Choice("Indwelling catheter", 0), new Choice("Residual urine volume (RUV) > 100cc; no regular catheterization or assisted intermittent catheterization", 3), new Choice("RUV < 100cc or intermittent self-catheterization; needs assistance for applying drainage instrument", 6), new Choice("Intermittent self-catheterization; uses external drainage instrument; does not need assistance for applying", 9), new Choice("Intermittent self-catheterization; continent between catheterizations; does not use external drainage instrument", 11), new Choice("RUV &lt;100cc; needs only external urine drainage; no assistance is required for drainage", 13), new Choice("RUV &lt;100cc; continent; does not use external drainage instrument", 15), ], "Respiration and Sphincter Management"), new Question( "7. Sphincter Management - Bowel", [ new Choice("Irregular timing or very low frequency (less than once in 3 days) of bowel movements", 0), new Choice("Regular timing, but requires assistance (e.g., for applying suppository); rare accidents (less than twice a month)", 5), new Choice("Regular bowel movements, without assistance; rare accidents (less than twice a month)", 8), new Choice("Regular bowel movements, without assistance; no accidents", 10) ], "Respiration and Sphincter Management"), new Question( "8. Use of Toilet (perineal hygiene, adjustment of clothes before/after, use of napkins or diapers)", [ new Choice("Requires total assistance", 0), new Choice("Requires partial assistance; does not clean self", 1), new Choice("Requires partial assistance; cleans self independently", 2), new Choice("Uses toilet independently in all tasks but needs adaptive devices or special setting (e.g., bars)", 4), new Choice("Uses toilet independently; does not require adaptive devices or special setting", 5) ], "Respiration and Sphincter Management"), new Question( "9. Mobility in Bed and Action to Prevent Pressure Sores", [ new Choice("Needs assistance in all activities: turning upper body in bed, turning lower body in bed, sitting up in bed, doing push-ups in wheelchair, with or without adaptive devices, but not with electric aids", 0), new Choice("Performs one of the activities without assistance", 2), new Choice("Performs two or three of the activities without assistance", 4), new Choice("Performs all the bed mobility and pressure release activities independently", 6) ], "Mobility (room and toilet)"), new Question( "10. Transfers: bed-wheelchair (locking wheelchair, lifting footrests, removing and adjusting arm rests, transferring, lifting feet)", [ new Choice("Requires total assistance", 0), new Choice("Needs partial assistance and/or supervision, and/or adaptive devices (e.g., sliding board)", 1), new Choice("Independent (or does not require wheelchair)", 2) ], "Mobility (room and toilet)"), new Question( "11. Transfers: wheelchair-toilet-tub (if uses toilet wheelchair: transfers to and from; if uses regular wheelchair: locking wheelchair, lifting footrests, removing and adjusting armrests, transferring, lifting feet)", [ new Choice("Requires total assistance", 0), new Choice("Needs partial assistance and/or supervision, and/or adaptive devices (e.g., grab-bars)", 1), new Choice("Independent (or does not require wheelchair)", 2) ], "Mobility (room and toilet)"), new Question( "12. Mobility Indoors", this.mobilityChoices, "Mobility (indoors and outdoors)"), new Question( "13. Mobility for Moderate Distances (10-100 meters)", this.mobilityChoices, "Mobility (indoors and outdoors)"), new Question( "14. Mobility Outdoors (more than 100 meters)", this.mobilityChoices, "Mobility (indoors and outdoors)"), new Question( "15. Stair Management", [ new Choice("Unable to ascend or descend stairs", 0), new Choice("Ascends and descends at least 3 steps with support or supervision of another person", 1), new Choice("Ascends and descends at least 3 steps with support of handrail and/or crutch or cane", 2), new Choice("Ascends and descends at least 3 steps without any support or supervision", 3) ], "Mobility (indoors and outdoors)"), new Question( "16. Transfers - wheelchair-car (approach car, lock w/c, remove arm and footrests, transfers to/from car, brings w/c in/out of car)", [ new Choice("Requires total assistance", 0), new Choice("Needs partial assistance and/or supervision and/or adaptive devices", 1), new Choice("Transfers independent; does not require adaptive devices (or does not require wheelchair)", 2) ], "Mobility (indoors and outdoors)"), new Question( "17. Transfers - ground-wheelchair", [ new Choice("Requires total assistance", 0), new Choice("Transfers independent with or without adaptive devices (or does not require wheelchair)", 1) ], "Mobility (indoors and outdoors)") ]; this.userScores = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; // initializes array to keep track of score for each question. 19 total questions this.sendReportByEmail = function(){ var bodyText = ""; for(i=0; i< this.questions.length; i++){ var q = this.questions[i]; var choice = q.choiceFromScore(this.userScores[i]); bodyText += q.title + "\n" + "(" + choice.value + ") " + choice.description + "\n\n"; } prepareEmailandSend({ id_text: $$('#case_id').val(), reportTitle: "SCIM III Report", assessmentType: $$('input[name="timePoint"]:checked').val(), totalScore: $$('#scimScore span').html(), bodyText: bodyText }); }; } var Question = function(title,choices,category){ this.title = title; this.choices = choices; this.category = category; }; Question.prototype.choiceFromScore = function(score){ if(score != null){ for(k=0; k<this.choices.length; k++){ var c = this.choices[k]; if(c.value == score){ return c; } } }else{ return {description: "error: score is null.", value: null}; } }; var Choice = function(desc,value){ this.description = desc; this.value = value; }; // ******************* ****************** ******************* ******************* ******************* // ******************* ****************** ******************* ******************* ******************* // CMS PAI QI Assessment Class // Reference: https://www.cms.gov/Medicare/Quality-Initiatives-Patient-Assessment-Instruments/IRF-Quality-Reporting/Downloads/DRAFT-IRF-PAI-FOR-OCT-2016.pdf var PAIQI_Scale = function () { this.categories = [ { name: "Self-care", items: [ new Activity("A. Eating", "The ability to use suitable utensils to bring food to the mouth and swallow food once the meal is presented on a table/tray. Includes modified food consistency."), new Activity("B. Oral hygiene", "The ability to use suitable items to clean teeth. [Dentures (if applicable): The ability to remove and replace dentures from and to the mouth, and manage equipment for soaking and rinsing them.]"), new Activity("C. Toileting hygiene", "The ability to maintain perineal hygiene, adjust clothes before and after using the toilet, commode, bedpan or urinal. If managing an ostomy, include wiping the opening but not managing equipment. "), new Activity("E. Shower/bathe self", "The ability to bathe self in shower or tub, including washing, rinsing, and drying self. Does not include transferring in/out of tub/shower."), new Activity("F. Upper body dressing", " The ability to put on and remove shirt or pajama top; includes buttoning, if applicable."), new Activity("G. Lower body dressing", "The ability to dress and undress below the waist, including fasteners; does not include footwear."), new Activity("H. Putting on/taking off footwear", "The ability to put on and take off socks and shoes or other footwear that is appropriate for safe mobility.") ] }, { name: "Mobility", items: [ new Activity("A. Roll left and right", "The ability to roll from lying on back to left and right side, and return to lying on back."), new Activity("B. Sit to lying", "The ability to move from sitting on side of bed to lying flat on the bed."), new Activity("C. Lying to sitting on side of bed", "The ability to safely move from lying on the back to sitting on the side of the bed with feet flat on the floor, and with no back support."), new Activity("D. Sit to stand", "The ability to safely come to a standing position from sitting in a chair or on the side of the bed."), new Activity("E. Chair/bed-to-chair transfer", "The ability to safely transfer to and from a bed to a chair (or wheelchair)."), new Activity("F. Toilet transfer", "The ability to safely get on and off a toilet or commode."), new Activity("G. Car transfer", "The ability to transfer in and out of a car or van on the passenger side. Does not include the ability to open/close door or fasten seat belt."), new Activity("I. Walk 10 feet", "Once standing, the ability to walk at least 10 feet in a room, corridor or similar space."), new Activity("J. Walk 50 feet with two turns", "Once standing, the ability to walk at least 50 feet and make two turns. "), new Activity("K. Walk 150 feet", "Once standing, the ability to walk at least 150 feet in a corridor or similar space."), new Activity("L. Walking 10 feet on uneven surfaces", "The ability to walk 10 feet on uneven or sloping surfaces, such as grass or gravel."), new Activity("M. 1 step (curb)", "The ability to step over a curb or up and down one step"), new Activity("N. 4 steps", "The ability to go up and down four steps with or without a rail."), new Activity("O. 12 steps", "The ability to go up and down 12 steps with or without a rail."), new Activity("P. Picking up object", "The ability to bend/stoop from a standing position to pick up a small object, such as a spoon, from the floor."), new Activity("R. Wheel 50 feet with two turns", "Once seated in wheelchair/scooter, the ability to wheel at least 50 feet and make two turns."), new Activity("S. Wheel 150 feet", "Once seated in wheelchair/scooter, the ability to wheel at least 150 feet in a corridor or similar space.") ] } ]; this.choices = [ new Choice("Independent - Patient completes the activity by him/herself with no assistance from a helper.",6), new Choice("Setup or clean-up assistance - Helper sets up or cleans up; patient completes activity. Helper assists only prior to or following the activity.",5), new Choice("Supervision or touching assistance - Helper provides verbal cues or touching/steadying assistance as patient completes activity. Assistance may be provided throughout the activity or intermittently.",4), new Choice("Partial/moderate assistance - Helper does less than half the effort. Helper lifts, holds or supports trunk or limbs, but provides less than half the effort.",3), new Choice("Substantial/maximal assistance - Helper does more than half the effort. Helper lifts or holds trunk or limbs and provides more than half the effort.",2), new Choice("Dependent - Helper does ALL of the effort to complete activity. Or, requires 2-person assistance to complete",1) ]; const self = this; // cache workaround for 'this' scope conflict this.totalItems = function(){ var n = 0; for(i=0;i<self.categories.length;i++){ for(j=0;j<self.categories[i].items.length;j++){ n++; } } return n; }(); // initializes array to keep track of score for each question. this.userScores = []; for(i=0;i<this.totalItems;i++){ this.userScores[i] = 6; } this.sendReportByEmail = function(){ var bodyText = ""; var totalItemCounter = 0; for(i=0; i<this.categories.length; i++){ bodyText += this.categories[i].name + "\n\n"; for(j=0;j<this.categories[i].items.length;j++){ var activity = this.categories[i].items[j]; var choice = activity.choiceFromScore(this.userScores[totalItemCounter],this.choices); bodyText += activity.title + "\n" + "(" + choice.value + ") " + choice.description + "\n\n"; totalItemCounter++; } } prepareEmailandSend({ id_text: $$('#case_id').val(), reportTitle: "PAI QI Report", assessmentType: $$('input[name="timePoint"]:checked').val(), totalScore: $$('#paiqiScore span').html(), bodyText: bodyText }); }; }; var Activity = function(title,description){ this.title = title; this.description = description; }; Activity.prototype.choiceFromScore = function(score,choices){ if(score != null){ for(k=0; k<choices.length; k++){ var c = choices[k]; if(c.value == score){ return c; } } }else{ return {description: "error: score is null.", value: null}; } }; // Generic Email function used for all scales. // Receives expected data points as a params object function prepareEmailandSend(params) { // replaces any undefined values with empty strings var data = { id_text: params.id_text || "", reportTitle: params.reportTitle || "", assessmentType: params.assessmentType || "", totalScore: params.totalScore || "", bodyText: params.bodyText || "" }; var now = new Date(); var timestampString = (now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear(); var subj = data.id_text + " " + data.reportTitle; var reportText = data.reportTitle + "\nDate: " + timestampString + "\n" + "Case ID: " + data.id_text + "\n" + "Assessment Type: " + data.assessmentType + "\n" + "Total Score: " + data.totalScore + "\n\n"; reportText += data.bodyText; location.href = 'mailto:?&subject=' + encodeURIComponent(subj) + '&body='+ encodeURIComponent(reportText); }
// @flow import { mergeStyles } from 'wix-rich-content-common'; import styles from '../statics/styles/video-viewer.scss'; export const containerClassName /*: ClassNameStrategy*/ = theme => { const mergedStyles = mergeStyles({ styles, theme }); return mergedStyles.video_container; };
import React, { Component } from 'react' import { connect } from 'react-redux' import { Button, Col, Row } from 'antd'; /**Components */ import Listar from './Listar' import CrearEditar from './CrearEditar' /* Helpers */ import { pushPath } from 'helpers/helpers' import { pathnames as utilPathnames } from '../../utils/keys' /* Styles */ if (__DEVCLIENT__) { require('./style.scss') } let paramsId = '' class Index extends React.Component { constructor(props) { super(props) this.state = { child: null } } componentWillMount() { if (this.props) { if (this.props.params && this.props.params.id) paramsId = this.props.params.id } } componentWillReceiveProps(nextProps, nextState) { /** * Verificamos que haya un cambio de usuario, usualmente sucede cuando se ingresa a la * pagina por primera vez. */ if (this.props.user && this.props.user != nextProps.user) { this.renderChild(nextProps.location.pathname, nextProps.user.token) } /** * Verificamos que haya un cambio de ruta para renderizar el child */ if (this.props.location != nextProps.location) { this.renderChild(nextProps.location.pathname) } } componentWillUpdate() { //Actualiza el parameto id, esto para saber que id se esta modificando paramsId = this.props.params.id } render() { return ( <Row> {this.state.child} </Row>) } renderChild = (pathname, userToken) => { //Verificamos la ecistencia del Token para realizar peticiones desde los subComponentes const token = userToken || this.props.user && this.props.user.token ? this.props.user.token : null switch (pathname) { case utilPathnames.PATH_VOTANTES_AGREGAR: this.setState({ child: <CrearEditar userToken={token} /> }) break; case utilPathnames.PATH_VOTANTES_ACTUALIZAR + '/' + paramsId: this.setState({ child: <CrearEditar votanteId={paramsId} userToken={token} /> }) break default: this.setState({ child: <Listar /> }) break } } } function mapStateToProps(state) { return { user: state.user.data } } export default connect(mapStateToProps)(Index)
var assert = require('assert'); var battle; describe('Desolate Land', function () { afterEach(function () { battle.destroy(); }); it('should activate the Desolate Land weather upon switch-in', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [{species: "Abra", ability: 'magicguard', moves: ['teleport']}]); assert.ok(battle.isWeather('desolateland')); }); it('should increase the base power of Fire-type attacks by 50%', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [{species: "Charizard", ability: 'blaze', moves: ['firepledge']}]); battle.commitDecisions(); var move = Tools.getMove('firepledge'); var basePower = battle.runEvent('BasePower', battle.p2.active[0], battle.p1.active[0], move, move.basePower, true); assert.strictEqual(basePower, battle.modify(move.basePower, 1.5)); }); it('should cause Water-type attacks to fail', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [{species: "Blastoise", ability: 'torrent', moves: ['surf']}]); battle.commitDecisions(); assert.strictEqual(battle.p1.active[0].hp, battle.p1.active[0].maxhp); }); it('should not cause Water-type Status moves to fail', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [{species: "Blastoise", ability: 'torrent', moves: ['soak']}]); battle.commitDecisions(); assert.strictEqual(battle.p1.active[0].typesData.length, 1); assert.strictEqual(battle.p1.active[0].typesData[0].type, 'Water'); }); it('should prevent moves and abilities from setting the weather to Sunny Day, Rain Dance, Sandstorm, or Hail', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [ {species: "Abra", ability: 'magicguard', moves: ['teleport']}, {species: "Kyogre", ability: 'drizzle', moves: ['raindance']}, {species: "Groudon", ability: 'drought', moves: ['sunnyday']}, {species: "Tyranitar", ability: 'sandstream', moves: ['sandstorm']}, {species: "Abomasnow", ability: 'snowwarning', moves: ['hail']} ]); for (var i = 2; i <= 5; i++) { battle.choose('p1', 'switch ' + i); battle.commitDecisions(); assert.ok(battle.isWeather('desolateland')); battle.commitDecisions(); assert.ok(battle.isWeather('desolateland')); } }); it('should be treated as Sunny Day for any forme, move or ability that requires it', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand', 'solarbeam']}]); battle.join('p2', 'Guest 2', 1, [ {species: "Castform", ability: 'forecast', moves: ['weatherball']}, {species: "Cherrim", ability: 'flowergift', moves: ['growth']}, {species: "Charizard", ability: 'solarpower', moves: ['roost']}, {species: "Venusaur", ability: 'chlorophyll', moves: ['growth']}, {species: "Toxicroak", ability: 'dryskin', moves: ['bulkup']} ]); battle.test = true; battle.p1.active[0].damage = function () { if (battle.activeMove.id === 'weatherball') { assert.strictEqual(battle.activeMove.type, 'Fire'); } return BattleEngine.BattlePokemon.prototype.damage.apply(this, arguments); }; battle.commitDecisions(); assert.strictEqual(battle.p2.active[0].template.speciesid, 'castformsunny'); battle.choose('p2', 'switch 2'); battle.commitDecisions(); assert.strictEqual(battle.p2.active[0].template.speciesid, 'cherrimsunshine'); battle.choose('p2', 'switch 3'); battle.commitDecisions(); assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); battle.choose('p1', 'move 2'); battle.choose('p2', 'switch 4'); assert.strictEqual(battle.p2.active[0].getStat('spe'), 2 * battle.p2.active[0].stats['spe']); assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); battle.choose('p2', 'switch 5'); battle.commitDecisions(); assert.notStrictEqual(battle.p2.active[0].hp, battle.p2.active[0].maxhp); }); it('should cause the Desolate Land weather to fade if it switches out and no other Desolate Land Pokemon are active', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [ {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, {species: "Ho-Oh", ability: 'pressure', moves: ['roost']} ]); battle.join('p2', 'Guest 2', 1, [{species: "Lugia", ability: 'pressure', moves: ['roost']}]); battle.choose('p1', 'switch 2'); battle.commitDecisions(); assert.ok(battle.isWeather('')); }); it('should not cause the Desolate Land weather to fade if it switches out and another Desolate Land Pokemon is active', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [ {species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}, {species: "Ho-Oh", ability: 'pressure', moves: ['roost']} ]); battle.join('p2', 'Guest 2', 1, [{species: "Groudon", ability: 'desolateland', moves: ['bulkup']}]); battle.choose('p1', 'switch 2'); battle.commitDecisions(); assert.ok(battle.isWeather('desolateland')); }); it('should cause the Desolate Land weather to fade if its ability is suppressed and no other Desolate Land Pokemon are active', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [{species: "Lugia", ability: 'pressure', moves: ['gastroacid']}]); battle.commitDecisions(); assert.ok(battle.isWeather('')); }); it('should not cause the Desolate Land weather to fade if its ability is suppressed and another Desolate Land Pokemon is active', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [{species: "Groudon", ability: 'desolateland', moves: ['gastroacid']}]); battle.commitDecisions(); assert.ok(battle.isWeather('desolateland')); }); it('should cause the Desolate Land weather to fade if its ability is changed and no other Desolate Land Pokemon are active', function () { battle = BattleEngine.Battle.construct(); battle.join('p1', 'Guest 1', 1, [{species: "Groudon", ability: 'desolateland', moves: ['helpinghand']}]); battle.join('p2', 'Guest 2', 1, [{species: "Lugia", ability: 'pressure', moves: ['entrainment']}]); battle.commitDecisions(); assert.ok(battle.isWeather('')); }); });
(window.webpackJsonp=window.webpackJsonp||[]).push([[129],{1576:function(t,e,a){"use strict";a.r(e);var n=a(24),r=a.n(n),o=a(25),c=a.n(o),u=a(26),l=a.n(u),i=a(27),s=a.n(i),f=a(16),d=a.n(f),m=a(0),p=a.n(m),v=a(854),h=a(855),b=a(702),y=a(703),g=a(207),E=a(1031);function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,n=d()(t);if(e){var r=d()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return s()(this,a)}}var k=function(t){l()(a,t);var e=R(a);function a(t){var n;return r()(this,a),(n=e.call(this,t)).state={chartData:[],amountOfDataPoints:[],code:""},n}return c()(a,[{key:"componentDidMount",value:function(){var t=this;g.a.getChartData(this.props.id).then((function(e){for(var a=0,n=0;n<e.data.length;n++)a+=parseInt(e.data[n].count);t.setState({chartData:e.data,amountOfDataPoints:a,code:e.code})}))}},{key:"renderChartsData",value:function(){var t=[],e=this.state.chartData,a=void 0===e?[]:e,n=a.map((function(t){return t.name})),r=a.map((function(t){return t.count}));return t.data={labels:n,datasets:[{data:r,backgroundColor:["rgba(48, 129, 95, 0.8)","rgba(39, 174, 96, 0.8)","rgba(41, 128, 185, 0.8)","rgba(142, 68, 173, 0.8)","rgba(203, 185, 86, 0.8)","rgba(230, 74, 74, 0.8)"],hoverBackgroundColor:["rgba(48, 129, 95,1)","rgba(39, 174, 96, 1)","rgba(41, 128, 185, 1)","rgba(142, 68, 173, 1)","rgba(203, 185, 86, 1)","rgba(230, 74, 74, 1)"]}]},t.options={legend:{display:!0,position:"right"},maintainAspectRatio:!1,responsive:!0,tooltips:{mode:"label",callbacks:{label:function(t,e){var a=e.datasets[t.datasetIndex],n=a._meta[Object.keys(a._meta)[0]].total,r=a.data[t.index];return r+" ("+parseFloat((r/n*100).toFixed(1))+"%)"},title:function(t,e){return e.labels[t[0].index]}}},tooltipTemplate:"'<%=label%>: <%= numeral(value).format('($00[.]00)') %> - <%= numeral(circumference / 6.283).format('(0[.][00]%)') %>'"},t}},{key:"render",value:function(){var t=this.renderChartsData(),e=t.data,a=t.options,n=this.state.amountOfDataPoints;return p.a.createElement("div",null,p.a.createElement("h4",null,"Deelnemers status in project ",this.state.code),p.a.createElement("div",null,0===n?p.a.createElement("span",null,"Geen deelnemers gevonden."):p.a.createElement(E.Pie,{data:e,options:a,width:250,height:250})))}}]),a}(m.Component);function D(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,n=d()(t);if(e){var r=d()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return s()(this,a)}}var x=function(t){l()(a,t);var e=D(a);function a(t){var n;return r()(this,a),(n=e.call(this,t)).state={chartData:[],amountOfDataPoints:[],code:""},n}return c()(a,[{key:"componentDidMount",value:function(){var t=this;g.a.getChartContactStatusData(this.props.id).then((function(e){for(var a=0,n=0;n<e.data.length;n++)a+=parseInt(e.data[n].count);t.setState({chartData:e.data,amountOfDataPoints:a,code:e.code})}))}},{key:"renderChartsData",value:function(){var t=[],e=this.state.chartData,a=void 0===e?[]:e,n=a.map((function(t){return t.name})),r=a.map((function(t){return t.count}));return t.data={labels:n,datasets:[{data:r,backgroundColor:["rgba(48, 129, 95, 0.8)","rgba(39, 174, 96, 0.8)","rgba(41, 128, 185, 0.8)","rgba(142, 68, 173, 0.8)","rgba(203, 185, 86, 0.8)","rgba(230, 74, 74, 0.8)"],hoverBackgroundColor:["rgba(48, 129, 95,1)","rgba(39, 174, 96, 1)","rgba(41, 128, 185, 1)","rgba(142, 68, 173, 1)","rgba(203, 185, 86, 1)","rgba(230, 74, 74, 1)"]}]},t.options={legend:{display:!0,position:"right"},maintainAspectRatio:!1,responsive:!0,tooltips:{mode:"label",callbacks:{label:function(t,e){var a=e.datasets[t.datasetIndex],n=a._meta[Object.keys(a._meta)[0]].total,r=a.data[t.index];return r+" ("+parseFloat((r/n*100).toFixed(1))+"%)"},title:function(t,e){return e.labels[t[0].index]}}},tooltipTemplate:"'<%=label%>: <%= numeral(value).format('($00[.]00)') %> - <%= numeral(circumference / 6.283).format('(0[.][00]%)') %>'"},t}},{key:"render",value:function(){var t=this.renderChartsData(),e=t.data,a=t.options,n=this.state.amountOfDataPoints;return p.a.createElement("div",null,p.a.createElement("h4",null,"Deelnemers contact status in project ",this.state.code),p.a.createElement("div",null,0===n?p.a.createElement("span",null,"Geen contacten gevonden."):p.a.createElement(E.Pie,{data:e,options:a,width:250,height:250})))}}]),a}(m.Component);function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,n=d()(t);if(e){var r=d()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return s()(this,a)}}var C=function(t){l()(a,t);var e=P(a);function a(t){var n;return r()(this,a),(n=e.call(this,t)).state={chartData:[],amountOfDataPoints:[],code:""},n}return c()(a,[{key:"componentDidMount",value:function(){var t=this;g.a.getChartParticipationsData(this.props.id).then((function(e){for(var a=0,n=0;n<e.data.length;n++)a+=parseInt(e.data[n].count);t.setState({chartData:e.data,amountOfDataPoints:a,code:e.code})}))}},{key:"renderChartsData",value:function(){var t=[],e=this.state.chartData,a=void 0===e?[]:e,n=a.map((function(t){return t.name})),r=a.map((function(t){return t.count}));return t.data={labels:n,datasets:[{data:r,backgroundColor:["rgba(48, 129, 95, 0.8)","rgba(39, 174, 96, 0.8)","rgba(41, 128, 185, 0.8)","rgba(142, 68, 173, 0.8)","rgba(203, 185, 86, 0.8)","rgba(230, 74, 74, 0.8)"],hoverBackgroundColor:["rgba(48, 129, 95,1)","rgba(39, 174, 96, 1)","rgba(41, 128, 185, 1)","rgba(142, 68, 173, 1)","rgba(203, 185, 86, 1)","rgba(230, 74, 74, 1)"]}]},t.options={legend:{display:!0,position:"right"},maintainAspectRatio:!1,responsive:!0,tooltips:{mode:"label",callbacks:{label:function(t,e){var a=e.datasets[t.datasetIndex],n=a._meta[Object.keys(a._meta)[0]].total,r=a.data[t.index];return r+" ("+parseFloat((r/n*100).toFixed(1))+"%)"},title:function(t,e){return e.labels[t[0].index]}}},tooltipTemplate:"'<%=label%>: <%= numeral(value).format('($00[.]00)') %> - <%= numeral(circumference / 6.283).format('(0[.][00]%)') %>'"},t}},{key:"render",value:function(){var t=this.renderChartsData(),e=t.data,a=t.options,n=this.state.amountOfDataPoints;return p.a.createElement("div",null,p.a.createElement("h4",null,"Deelnames status in project ",this.state.code),p.a.createElement("div",null,0===n?p.a.createElement("span",null,"Geen deelnames gevonden."):p.a.createElement(E.Pie,{data:e,options:a,width:250,height:250})))}}]),a}(m.Component);function N(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,n=d()(t);if(e){var r=d()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return s()(this,a)}}var O=function(t){l()(a,t);var e=N(a);function a(t){var n;return r()(this,a),(n=e.call(this,t)).state={activeProjectsIds:[]},n}return c()(a,[{key:"componentWillMount",value:function(){var t=this;g.a.getActive().then((function(e){t.setState({activeProjectsIds:e})}))}},{key:"render",value:function(){var t=this.state.activeProjectsIds;return p.a.createElement("div",{className:"row"},t.map((function(t){return p.a.createElement("div",null,p.a.createElement("div",{className:"col-md-4"},p.a.createElement(b.a,null,p.a.createElement(y.a,null,p.a.createElement(k,{id:t})))),p.a.createElement("div",{className:"col-md-4"},p.a.createElement(b.a,null,p.a.createElement(y.a,null,p.a.createElement(C,{id:t})))),p.a.createElement("div",{className:"col-md-4"},p.a.createElement(b.a,null,p.a.createElement(y.a,null,p.a.createElement(x,{id:t})))))})))}}]),a}(m.Component);function B(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,n=d()(t);if(e){var r=d()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return s()(this,a)}}var M=function(t){l()(a,t);var e=B(a);function a(t){return r()(this,a),e.call(this,t)}return c()(a,[{key:"render",value:function(){return p.a.createElement("div",null,p.a.createElement("div",{className:"row"},p.a.createElement(v.a,{size:"col-xs-2"}),p.a.createElement(h.a,{size:"col-xs-2"})),p.a.createElement(O,null))}}]),a}(m.Component);e.default=M},702:function(t,e,a){"use strict";var n=a(0),r=a.n(n),o=a(8),c=a.n(o),u=function(t){var e=t.children,a=t.className,n=t.onMouseEnter,o=t.onMouseLeave;return r.a.createElement("div",{className:"panel panel-default ".concat(a),onMouseEnter:n,onMouseLeave:o},e)};u.defaultProps={className:"",onMouseEnter:function(){},onMouseLeave:function(){}},u.propTypes={className:c.a.string,onMouseEnter:c.a.func,onMouseLeave:c.a.func},e.a=u},703:function(t,e,a){"use strict";var n=a(0),r=a.n(n),o=a(8),c=a.n(o),u=function(t){var e=t.className,a=t.children;return r.a.createElement("div",{className:"panel-body ".concat(e)},a)};u.defaultProps={className:""},u.propTypes={className:c.a.string},e.a=u},854:function(t,e,a){"use strict";var n=a(24),r=a.n(n),o=a(25),c=a.n(o),u=a(26),l=a.n(u),i=a(27),s=a.n(i),f=a(16),d=a.n(f),m=a(0),p=a.n(m),v=a(4),h=a(151);function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,n=d()(t);if(e){var r=d()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return s()(this,a)}}var y=function(t){l()(a,t);var e=b(a);function a(t){var n;return r()(this,a),(n=e.call(this,t)).state={amountOpenEmails:"-"},n}return c()(a,[{key:"componentWillMount",value:function(){var t=this;h.a.getAmountOpen().then((function(e){t.setState({amountOpenEmails:e})}))}},{key:"render",value:function(){return p.a.createElement("div",{className:this.props.size,onClick:function(){return v.f.push("/emails/inbox/eigen")}},p.a.createElement("div",{className:"panel panel-default",id:"dashboardbutton-1"},p.a.createElement("div",{className:"panel-body"},p.a.createElement("h4",{className:"text-center text-bold"},"E-MAIL"),p.a.createElement("h4",{className:"text-center text-bold"},this.state.amountOpenEmails))))}}]),a}(m.Component);e.a=y},855:function(t,e,a){"use strict";var n=a(24),r=a.n(n),o=a(25),c=a.n(o),u=a(26),l=a.n(u),i=a(27),s=a.n(i),f=a(16),d=a.n(f),m=a(0),p=a.n(m),v=a(4),h=a(109);function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var a,n=d()(t);if(e){var r=d()(this).constructor;a=Reflect.construct(n,arguments,r)}else a=n.apply(this,arguments);return s()(this,a)}}var y=function(t){l()(a,t);var e=b(a);function a(t){var n;return r()(this,a),(n=e.call(this,t)).state={amountActiveTasks:"-"},n}return c()(a,[{key:"componentWillMount",value:function(){var t=this;h.a.getAmountActive().then((function(e){t.setState({amountActiveTasks:e})}))}},{key:"render",value:function(){return p.a.createElement("div",{className:this.props.size,onClick:function(){return v.f.push("/taken/eigen")}},p.a.createElement("div",{className:"panel panel-default",id:"dashboardbutton-4"},p.a.createElement("div",{className:"panel-body"},p.a.createElement("h4",{className:"text-center text-bold"},"OPEN TAKEN"),p.a.createElement("h4",{className:"text-center text-bold"},this.state.amountActiveTasks))))}}]),a}(m.Component);e.a=y}}]);
/** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ import { Injectable } from '@angular/core'; import { ReplaySubject, Subject } from 'rxjs'; export class NzRadioService { constructor() { this.selected$ = new ReplaySubject(1); this.touched$ = new Subject(); this.disabled$ = new ReplaySubject(1); this.name$ = new ReplaySubject(1); } touch() { this.touched$.next(); } select(value) { this.selected$.next(value); } setDisabled(value) { this.disabled$.next(value); } setName(value) { this.name$.next(value); } } NzRadioService.decorators = [ { type: Injectable } ]; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaW8uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2NvbXBvbmVudHMvcmFkaW8vcmFkaW8uc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFFSCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzNDLE9BQU8sRUFBRSxhQUFhLEVBQUUsT0FBTyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBSzlDLE1BQU0sT0FBTyxjQUFjO0lBRDNCO1FBRUUsY0FBUyxHQUFHLElBQUksYUFBYSxDQUFZLENBQUMsQ0FBQyxDQUFDO1FBQzVDLGFBQVEsR0FBRyxJQUFJLE9BQU8sRUFBUSxDQUFDO1FBQy9CLGNBQVMsR0FBRyxJQUFJLGFBQWEsQ0FBVSxDQUFDLENBQUMsQ0FBQztRQUMxQyxVQUFLLEdBQUcsSUFBSSxhQUFhLENBQVMsQ0FBQyxDQUFDLENBQUM7SUFhdkMsQ0FBQztJQVpDLEtBQUs7UUFDSCxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksRUFBRSxDQUFDO0lBQ3ZCLENBQUM7SUFDRCxNQUFNLENBQUMsS0FBZ0I7UUFDckIsSUFBSSxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDN0IsQ0FBQztJQUNELFdBQVcsQ0FBQyxLQUFjO1FBQ3hCLElBQUksQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQzdCLENBQUM7SUFDRCxPQUFPLENBQUMsS0FBYTtRQUNuQixJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQztJQUN6QixDQUFDOzs7WUFqQkYsVUFBVSIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9naXRodWIuY29tL05HLVpPUlJPL25nLXpvcnJvLWFudGQvYmxvYi9tYXN0ZXIvTElDRU5TRVxuICovXG5cbmltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7IFJlcGxheVN1YmplY3QsIFN1YmplY3QgfSBmcm9tICdyeGpzJztcblxuaW1wb3J0IHsgTnpTYWZlQW55IH0gZnJvbSAnbmctem9ycm8tYW50ZC9jb3JlL3R5cGVzJztcblxuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIE56UmFkaW9TZXJ2aWNlIHtcbiAgc2VsZWN0ZWQkID0gbmV3IFJlcGxheVN1YmplY3Q8TnpTYWZlQW55PigxKTtcbiAgdG91Y2hlZCQgPSBuZXcgU3ViamVjdDx2b2lkPigpO1xuICBkaXNhYmxlZCQgPSBuZXcgUmVwbGF5U3ViamVjdDxib29sZWFuPigxKTtcbiAgbmFtZSQgPSBuZXcgUmVwbGF5U3ViamVjdDxzdHJpbmc+KDEpO1xuICB0b3VjaCgpOiB2b2lkIHtcbiAgICB0aGlzLnRvdWNoZWQkLm5leHQoKTtcbiAgfVxuICBzZWxlY3QodmFsdWU6IE56U2FmZUFueSk6IHZvaWQge1xuICAgIHRoaXMuc2VsZWN0ZWQkLm5leHQodmFsdWUpO1xuICB9XG4gIHNldERpc2FibGVkKHZhbHVlOiBib29sZWFuKTogdm9pZCB7XG4gICAgdGhpcy5kaXNhYmxlZCQubmV4dCh2YWx1ZSk7XG4gIH1cbiAgc2V0TmFtZSh2YWx1ZTogc3RyaW5nKTogdm9pZCB7XG4gICAgdGhpcy5uYW1lJC5uZXh0KHZhbHVlKTtcbiAgfVxufVxuIl19
module.exports = { //单行最大长度 printWidth: 120, //tab键的缩进 tabWidth: 4, //使用单引号而非双引号 singleQuote: true, //末尾分号 semi: true, //添加es5中被支持的尾逗号 trailingComma: 'es5', //在对象字面量声明所使用的的花括号后({)和前(})输出空格 bracketSpacing: true, //在多行JSX元素最后一行的末尾添加 > 而使 > 单独一行(不适用于自闭和元素) jsxBracketSameLine: true, //为单行箭头函数的参数添加圆括号 arrowParens: 'always', parser: 'typescript', };
(function(){ var iframe = document.createElement('iframe'); iframe.src = chrome.extension.getURL('rate.html'); iframe.id = 'effective'; iframe.style.zIndex = '9999999'; iframe.style.width = '395px'; iframe.style.height = '230px'; iframe.style.top = '20px'; iframe.style.right = '30px'; iframe.style.position = 'fixed'; iframe.style.border = '3px solid black'; document.body.appendChild(iframe); })();
'use strict'; var app = angular.module('appJeBouquine', ['ngRoute','ngStorage','ngAnimate','angucomplete-alt', 'toaster']);
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you 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 React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import { groupBy, take, get as getField } from 'lodash'; import { EuiFlyout, EuiFlyoutBody, EuiFlyoutFooter, EuiFlyoutHeader, EuiButtonEmpty, EuiButton, EuiText, EuiTitle, EuiForm, EuiFormRow, EuiSwitch, EuiFilePicker, EuiInMemoryTable, EuiSelect, EuiFlexGroup, EuiFlexItem, EuiLoadingKibana, EuiCallOut, EuiSpacer, EuiLink, } from '@elastic/eui'; import { importFile } from '../../../../lib/import_file'; import { resolveSavedObjects, resolveSavedSearches, resolveIndexPatternConflicts, saveObjects, } from '../../../../lib/resolve_saved_objects'; import { INCLUDED_TYPES } from '../../objects_table'; export class Flyout extends Component { static propTypes = { close: PropTypes.func.isRequired, done: PropTypes.func.isRequired, services: PropTypes.array.isRequired, newIndexPatternUrl: PropTypes.string.isRequired, indexPatterns: PropTypes.object.isRequired, }; constructor(props) { super(props); this.state = { conflictedIndexPatterns: undefined, conflictedSavedObjectsLinkedToSavedSearches: undefined, conflictedSearchDocs: undefined, conflicts: undefined, error: undefined, file: undefined, importCount: 0, indexPatterns: undefined, isOverwriteAllChecked: true, isLoading: false, loadingMessage: undefined, wasImportSuccessful: false, }; } componentDidMount() { this.fetchIndexPatterns(); } fetchIndexPatterns = async () => { const indexPatterns = await this.props.indexPatterns.getFields([ 'id', 'title', ]); this.setState({ indexPatterns }); }; changeOverwriteAll = () => { this.setState(state => ({ isOverwriteAllChecked: !state.isOverwriteAllChecked, })); }; setImportFile = ([file]) => { this.setState({ file }); }; import = async () => { const { services, indexPatterns } = this.props; const { file, isOverwriteAllChecked } = this.state; this.setState({ isLoading: true, error: undefined }); let contents; try { contents = await importFile(file); } catch (e) { this.setState({ isLoading: false, error: 'The file could not be processed.', }); return; } if (!Array.isArray(contents)) { this.setState({ isLoading: false, error: 'Saved objects file format is invalid and cannot be imported.', }); return; } contents = contents.filter(content => INCLUDED_TYPES.includes(content._type) ).map(doc => ({ ...doc, // The server assumes that documents with no migrationVersion are up to date. // That assumption enables Kibana and other API consumers to not have to build // up migrationVersion prior to creating new objects. But it means that imports // need to set migrationVersion to something other than undefined, so that imported // docs are not seen as automatically up-to-date. _migrationVersion: doc._migrationVersion || {}, })); const { conflictedIndexPatterns, conflictedSavedObjectsLinkedToSavedSearches, conflictedSearchDocs, importedObjectCount, failedImports, } = await resolveSavedObjects( contents, isOverwriteAllChecked, services, indexPatterns ); const byId = groupBy(conflictedIndexPatterns, ({ obj }) => obj.searchSource.getOwnField('index') ); const conflicts = Object.entries(byId).reduce( (accum, [existingIndexPatternId, list]) => { accum.push({ existingIndexPatternId, newIndexPatternId: undefined, list: list.map(({ doc }) => ({ id: existingIndexPatternId, type: doc._type, name: doc._source.title, })), }); return accum; }, [] ); this.setState({ conflictedIndexPatterns, conflictedSavedObjectsLinkedToSavedSearches, conflictedSearchDocs, failedImports, conflicts, importCount: importedObjectCount, isLoading: false, wasImportSuccessful: conflicts.length === 0, }); }; get hasConflicts() { return this.state.conflicts && this.state.conflicts.length > 0; } get resolutions() { return this.state.conflicts.reduce( (accum, { existingIndexPatternId, newIndexPatternId }) => { if (newIndexPatternId) { accum.push({ oldId: existingIndexPatternId, newId: newIndexPatternId, }); } return accum; }, [] ); } confirmImport = async () => { const { conflictedIndexPatterns, isOverwriteAllChecked, conflictedSavedObjectsLinkedToSavedSearches, conflictedSearchDocs, failedImports } = this.state; const { services, indexPatterns } = this.props; this.setState({ error: undefined, isLoading: true, loadingMessage: undefined, }); let importCount = this.state.importCount; if (this.hasConflicts) { try { const resolutions = this.resolutions; // Do not Promise.all these calls as the order matters this.setState({ loadingMessage: 'Resolving conflicts...' }); if (resolutions.length) { importCount += await resolveIndexPatternConflicts( resolutions, conflictedIndexPatterns, isOverwriteAllChecked ); } this.setState({ loadingMessage: 'Saving conflicts...' }); importCount += await saveObjects( conflictedSavedObjectsLinkedToSavedSearches, isOverwriteAllChecked ); this.setState({ loadingMessage: 'Ensure saved searches are linked properly...', }); importCount += await resolveSavedSearches( conflictedSearchDocs, services, indexPatterns, isOverwriteAllChecked ); this.setState({ loadingMessage: 'Retrying failed objects...', }); importCount += await saveObjects( failedImports.map(({ obj }) => obj), isOverwriteAllChecked ); } catch (e) { this.setState({ error: e.message, isLoading: false, loadingMessage: undefined, }); return; } } this.setState({ isLoading: false, wasImportSuccessful: true, importCount }); }; onIndexChanged = (id, e) => { const value = e.target.value; this.setState(state => { const conflictIndex = state.conflicts.findIndex( conflict => conflict.existingIndexPatternId === id ); if (conflictIndex === -1) { return state; } return { conflicts: [ ...state.conflicts.slice(0, conflictIndex), { ...state.conflicts[conflictIndex], newIndexPatternId: value, }, ...state.conflicts.slice(conflictIndex + 1), ], }; }); }; renderConflicts() { const { conflicts } = this.state; if (!conflicts) { return null; } const columns = [ { field: 'existingIndexPatternId', name: 'ID', description: `ID of the index pattern`, sortable: true, }, { field: 'list', name: 'Count', description: `How many affected objects`, render: list => { return <Fragment>{list.length}</Fragment>; }, }, { field: 'list', name: 'Sample of affected objects', description: `Sample of affected objects`, render: list => { return ( <ul style={{ listStyle: 'none' }}> {take(list, 3).map((obj, key) => <li key={key}>{obj.name}</li>)} </ul> ); }, }, { field: 'existingIndexPatternId', name: 'New index pattern', render: id => { const options = this.state.indexPatterns.map(indexPattern => ({ text: indexPattern.get('title'), value: indexPattern.id, ['data-test-subj']: `indexPatternOption-${indexPattern.get('title')}`, })); options.unshift({ text: '-- Skip Import --', value: '', }); return ( <EuiSelect data-test-subj={`managementChangeIndexSelection-${id}`} onChange={e => this.onIndexChanged(id, e)} options={options} /> ); }, }, ]; const pagination = { pageSizeOptions: [5, 10, 25], }; return ( <EuiInMemoryTable items={conflicts} columns={columns} pagination={pagination} /> ); } renderError() { const { error } = this.state; if (!error) { return null; } return ( <Fragment> <EuiCallOut title="Sorry, there was an error" color="danger" iconType="cross" > <p>{error}</p> </EuiCallOut> <EuiSpacer size="s" /> </Fragment> ); } renderBody() { const { isLoading, loadingMessage, isOverwriteAllChecked, wasImportSuccessful, importCount, failedImports = [], } = this.state; if (isLoading) { return ( <EuiFlexGroup justifyContent="spaceAround"> <EuiFlexItem grow={false}> <EuiLoadingKibana size="xl" /> <EuiSpacer size="m" /> <EuiText> <p>{loadingMessage}</p> </EuiText> </EuiFlexItem> </EuiFlexGroup> ); } if (failedImports.length && !this.hasConflicts) { return ( <EuiCallOut title="Import failed" color="warning" iconType="help" > <p> Failed to import {failedImports.length} of {importCount + failedImports.length} objects. </p> <p> {failedImports.map(({ error }) => getField(error, 'body.message', error.message || '')).join(' ')} </p> </EuiCallOut> ); } if (wasImportSuccessful) { if (importCount === 0) { return ( <EuiCallOut data-test-subj="importSavedObjectsSuccessNoneImported" title="No objects imported" color="primary" /> ); } return ( <EuiCallOut data-test-subj="importSavedObjectsSuccess" title="Import successful" color="success" iconType="check" > <p>Successfully imported {importCount} objects.</p> </EuiCallOut> ); } if (this.hasConflicts) { return this.renderConflicts(); } return ( <EuiForm> <EuiFormRow label="Please select a JSON file to import"> <EuiFilePicker initialPromptText="Import" onChange={this.setImportFile} /> </EuiFormRow> <EuiFormRow> <EuiSwitch name="overwriteAll" label="Automatically overwrite all saved objects?" data-test-subj="importSavedObjectsOverwriteToggle" checked={isOverwriteAllChecked} onChange={this.changeOverwriteAll} /> </EuiFormRow> </EuiForm> ); } renderFooter() { const { isLoading, wasImportSuccessful } = this.state; const { done, close } = this.props; let confirmButton; if (wasImportSuccessful) { confirmButton = ( <EuiButton onClick={done} size="s" fill data-test-subj="importSavedObjectsDoneBtn" > Done </EuiButton> ); } else if (this.hasConflicts) { confirmButton = ( <EuiButton onClick={this.confirmImport} size="s" fill isLoading={isLoading} data-test-subj="importSavedObjectsConfirmBtn" > Confirm all changes </EuiButton> ); } else { confirmButton = ( <EuiButton onClick={this.import} size="s" fill isLoading={isLoading} data-test-subj="importSavedObjectsImportBtn" > Import </EuiButton> ); } return ( <EuiFlexGroup justifyContent="spaceBetween"> <EuiFlexItem grow={false}> <EuiButtonEmpty onClick={close} size="s"> Cancel </EuiButtonEmpty> </EuiFlexItem> <EuiFlexItem grow={false}>{confirmButton}</EuiFlexItem> </EuiFlexGroup> ); } renderSubheader() { if ( !this.hasConflicts || this.state.isLoading || this.state.wasImportSuccessful ) { return null; } return ( <Fragment> <EuiSpacer size="s" /> <EuiCallOut title="Index Pattern Conflicts" color="warning" iconType="help" > <p> The following saved objects use index patterns that do not exist. Please select the index patterns you&apos;d like re-associated with them. You can{' '} { <EuiLink href={this.props.newIndexPatternUrl}> create a new index pattern </EuiLink> }{' '} if necessary. </p> </EuiCallOut> </Fragment> ); } render() { const { close } = this.props; return ( <EuiFlyout onClose={close} size="s"> <EuiFlyoutHeader> <EuiTitle> <h2>Import saved objects</h2> </EuiTitle> {this.renderSubheader()} </EuiFlyoutHeader> <EuiFlyoutBody> {this.renderError()} {this.renderBody()} </EuiFlyoutBody> <EuiFlyoutFooter>{this.renderFooter()}</EuiFlyoutFooter> </EuiFlyout> ); } }
import React from "react" import Layout from "../../layout/page-container.js" import AboutMe from "./content/about-me.js" import data from "../../api.json"; const AboutMePage = (props) => ( <Layout> AboutMe <AboutMe data={data} /> </Layout> ) export default AboutMePage
function editStatesModal($id) { url = "getInfosStatesModal.html"; // on declare un formulaire var form = { id: $id }; //on post var state = send_post(form, url); $('#id_state').val(state.id_state); $('#new_name_state').val(state.name_state); }
import { request } from './request' export function getCategoryDatas() { return request({ url: '/category' }) } export function getCategoryGoods(type, page) { return request({ url: '/home/data', params: { type, page } }) }
this.wc=this.wc||{},this.wc.wcBlocksData=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=160)}({1:function(e,t){!function(){e.exports=this.wp.i18n}()},10:function(e,t){!function(){e.exports=this.wp.data}()},12:function(e,t){!function(){e.exports=this.wp.apiFetch}()},13:function(e,t,r){"use strict";r.d(t,"c",(function(){return o})),r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return c}));var n=r(1),o="wc/store/cart",a={code:"cart_api_error",message:Object(n.__)("Unable to get cart data from the API.",'woocommerce'),data:{status:500}},c="wc-blocks_cart_update_timestamp"},14:function(e,t,r){var n=r(25),o=r(26),a=r(21),c=r(27);e.exports=function(e,t){return n(e)||o(e,t)||a(e,t)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},142:function(e,t){!function(){e.exports=this.wp.notices}()},143:function(e,t,r){var n=r(22);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},144:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},145:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},146:function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(o.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(o.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(147),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(38))},147:function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,o,a,c,i,u=1,s={},f=!1,l=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(c="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(c)&&h(+t.data.slice(c.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),n=function(t){e.postMessage(c+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){h(e.data)},n=function(e){a.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(o=l.documentElement,n=function(e){var t=l.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(h,0,e)},p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var o={callback:e,args:t};return s[u]=o,n(u),u++},p.clearImmediate=d}function d(e){delete s[e]}function h(e){if(f)setTimeout(h,0,e);else{var t=s[e];if(t){f=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(38),r(30))},160:function(e,t,r){"use strict";r.r(t),r.d(t,"SCHEMA_STORE_KEY",(function(){return K})),r.d(t,"COLLECTIONS_STORE_KEY",(function(){return De})),r.d(t,"CART_STORE_KEY",(function(){return Rt})),r.d(t,"QUERY_STATE_STORE_KEY",(function(){return Kt})),r.d(t,"API_BLOCK_NAMESPACE",(function(){return P}));var n={};r.r(n),r.d(n,"getRoute",(function(){return _})),r.d(n,"getRoutes",(function(){return w}));var o={};r.r(o),r.d(o,"receiveRoutes",(function(){return S}));var a={};r.r(a),r.d(a,"getRoute",(function(){return k})),r.d(a,"getRoutes",(function(){return R}));var c={};r.r(c),r.d(c,"getCollection",(function(){return J})),r.d(c,"getCollectionError",(function(){return W})),r.d(c,"getCollectionHeader",(function(){return $})),r.d(c,"getCollectionLastModified",(function(){return X}));var i={};r.r(i),r.d(i,"receiveCollection",(function(){return ee})),r.d(i,"receiveCollectionError",(function(){return te})),r.d(i,"receiveLastModified",(function(){return re}));var u={};r.r(u),r.d(u,"getCollection",(function(){return Te})),r.d(u,"getCollectionHeader",(function(){return Pe}));var s={};r.r(s),r.d(s,"getCartData",(function(){return Ae})),r.d(s,"getCartTotals",(function(){return Me})),r.d(s,"getCartMeta",(function(){return Ne})),r.d(s,"getCartErrors",(function(){return Le})),r.d(s,"isApplyingCoupon",(function(){return Fe})),r.d(s,"isCartDataStale",(function(){return Ue})),r.d(s,"getCouponBeingApplied",(function(){return Ve})),r.d(s,"isRemovingCoupon",(function(){return Ke})),r.d(s,"getCouponBeingRemoved",(function(){return Qe})),r.d(s,"getCartItem",(function(){return He})),r.d(s,"isItemPendingQuantity",(function(){return Ge})),r.d(s,"isItemPendingDelete",(function(){return Ye})),r.d(s,"isCustomerDataUpdating",(function(){return qe})),r.d(s,"isShippingRateBeingSelected",(function(){return Be}));var f={};r.r(f),r.d(f,"receiveCart",(function(){return rt})),r.d(f,"receiveError",(function(){return nt})),r.d(f,"receiveApplyingCoupon",(function(){return ot})),r.d(f,"receiveRemovingCoupon",(function(){return at})),r.d(f,"receiveCartItem",(function(){return ct})),r.d(f,"itemIsPendingQuantity",(function(){return it})),r.d(f,"itemIsPendingDelete",(function(){return ut})),r.d(f,"setIsCartDataStale",(function(){return st})),r.d(f,"updatingCustomerData",(function(){return ft})),r.d(f,"shippingRatesBeingSelected",(function(){return lt})),r.d(f,"updateCartFragments",(function(){return pt})),r.d(f,"applyExtensionCartUpdate",(function(){return dt})),r.d(f,"applyCoupon",(function(){return ht})),r.d(f,"removeCoupon",(function(){return mt})),r.d(f,"addItemToCart",(function(){return vt})),r.d(f,"removeItemFromCart",(function(){return yt})),r.d(f,"changeCartItemQuantity",(function(){return bt})),r.d(f,"selectShippingRate",(function(){return gt})),r.d(f,"updateCustomerData",(function(){return Ot}));var l={};r.r(l),r.d(l,"getCartData",(function(){return wt})),r.d(l,"getCartTotals",(function(){return Et}));var p={};r.r(p),r.d(p,"getValueForQueryKey",(function(){return Mt})),r.d(p,"getValueForQueryContext",(function(){return Nt}));var d={};r.r(d),r.d(d,"setQueryValue",(function(){return Lt})),r.d(d,"setValueForQueryContext",(function(){return Ft})),r(142);var h=r(10),m=r(8),v="wc/store/schema",y=r(14),b=r.n(y),g=r(29),O=r.n(g),x=r(1),_=Object(h.createRegistrySelector)((function(e){return function(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=e(v).hasFinishedResolution("getRoutes",[r]),c="";if((t=t.routes)[r]?t[r][n]||(c=Object(x.sprintf)("There is no route for the given resource name (%s) in the store",n)):c=Object(x.sprintf)("There is no route for the given namespace (%s) in the store",r),""!==c){if(a)throw new Error(c);return""}var i=E(t[r][n],o);if(""===i&&a)throw new Error(Object(x.sprintf)("While there is a route for the given namespace (%1$s) and resource name (%2$s), there is no route utilizing the number of ids you included in the select arguments. The available routes are: (%3$s)",r,n,JSON.stringify(t[r][n])));return i}})),w=Object(h.createRegistrySelector)((function(e){return function(t,r){var n=e(v).hasFinishedResolution("getRoutes",[r]),o=t.routes[r];if(!o){if(n)throw new Error(Object(x.sprintf)("There is no route for the given namespace (%s) in the store",r));return[]}var a=[];for(var c in o)a=[].concat(O()(a),O()(Object.keys(o[c])));return a}})),E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=(e=Object.entries(e)).find((function(e){var r=b()(e,2)[1];return t.length===r.length})),n=r||[],o=b()(n,2),a=o[0],c=o[1];return a?0===t.length?a:T(a,c,t):""},T=function(e,t,r){return t.forEach((function(t,n){e=e.replace("{".concat(t,"}"),r[n])})),e},P="wc/blocks";function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P;return{type:"RECEIVE_MODEL_ROUTES",routes:e,namespace:t}}var j=r(3),C=r.n(j),I=C.a.mark(k),D=C.a.mark(R);function k(e){return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(m.select)(v,"getRoutes",e);case 2:case"end":return t.stop()}}),I)}function R(e){var t,r;return C.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Object(m.apiFetch)({path:e});case 2:return t=n.sent,r=t&&t.routes?Object.keys(t.routes):[],n.next=6,S(r,e);case 6:case"end":return n.stop()}}),D)}var A=function(e,t){return(t=t.replace("".concat(e,"/"),"")).replace(/\/\(\?P\<[a-z_]*\>\[\\*[a-z]\]\+\)/g,"")},M=function(e){var t=e.match(/\<[a-z_]*\>/g);return Array.isArray(t)&&0!==t.length?t.map((function(e){return e.replace(/<|>/g,"")})):[]},N=function(e,t){return Array.isArray(t)&&0!==t.length?(t.forEach((function(t){var r="\\(\\?P<".concat(t,">.*?\\)");e=e.replace(new RegExp(r),"{".concat(t,"}"))})),e):e},L=r(4);function F(e,t){return Object(L.has)(e,t)}function U(e,t,r){return Object(L.setWith)(Object(L.clone)(e),t,r,L.clone)}var V=Object(h.combineReducers)({routes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.routes,o=t.namespace;return"RECEIVE_MODEL_ROUTES"===r&&n.forEach((function(t){var r=A(o,t);if(r&&r!==o){var n=M(t),a=N(t,n);F(e,[o,r,a])||(e=U(e,[o,r,a],n))}})),e}});Object(h.registerStore)(v,{reducer:V,actions:o,controls:m.controls,selectors:n,resolvers:a});var K=v,Q=r(2),H=r.n(Q),G="wc/store/collections",Y=[],q=r(31),B=function(e){var t=e.state,r=e.namespace,n=e.resourceName,o=e.query,a=e.ids,c=e.type,i=void 0===c?"items":c,u=e.fallback,s=void 0===u?Y:u;return F(t,[r,n,a=JSON.stringify(a),o=null!==o?Object(q.addQueryArgs)("",o):"",i])?t[r][n][a][o][i]:s},z=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Y;return B({state:e,namespace:t,resourceName:r,query:n,ids:o,type:"headers",fallback:void 0})},J=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Y;return B({state:e,namespace:t,resourceName:r,query:n,ids:o})},W=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Y;return B({state:e,namespace:t,resourceName:r,query:n,ids:o,type:"error",fallback:null})},$=function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Y,c=z(e,r,n,o,a);return c&&c.get?c.has(t)?c.get(t):void 0:null},X=function(e){return e.lastModified||0},Z=window.Headers||null;function ee(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{items:[],headers:Z},a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return{type:a?"RESET_COLLECTION":"RECEIVE_COLLECTION",namespace:e,resourceName:t,queryString:r,ids:n,response:o}}function te(e,t,r,n,o){return{type:"ERROR",namespace:e,resourceName:t,queryString:r,ids:n,response:{items:[],headers:Z,error:o}}}function re(e){return{type:"RECEIVE_LAST_MODIFIED",timestamp:e}}Z=Z?new Z:{get:function(){},has:function(){}};var ne=r(28),oe=r.n(ne),ae=r(12),ce=r.n(ae),ie=r(41),ue=r.n(ie),se=r(6),fe=r(7),le=r.n(fe);function pe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function de(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(r),!0).forEach((function(t){H()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var he=function(e){return{type:"API_FETCH_WITH_HEADERS",options:e}},me={},ve={code:"invalid_json",message:Object(x.__)("The response is not a valid JSON response.",'woocommerce')},ye=function(e){ce.a.setNonce&&"function"==typeof ce.a.setNonce?ce.a.setNonce(e):console.error('The monkey patched function on APIFetch, "setNonce", is not present, likely another plugin or some other code has removed this augmentation')},be=new ue.a((function(e){return ce()({path:"/wc/store/batch",method:"POST",data:{requests:e.map((function(e){return de(de({},e),{},{body:null==e?void 0:e.data})}))}}).then((function(t){return function(e){if("object"!==le()(e)||null===e||!e.hasOwnProperty("responses"))throw new Error("Response not valid")}(t),e.map((function(e,r){return t.responses[r]||me}))}))}),{batchScheduleFn:function(e){return setTimeout(e,300)},cache:!1,maxBatchSize:25}),ge=function(){var e=oe()(C.a.mark((function e(t){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,be.load(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),Oe={API_FETCH_WITH_HEADERS:function(e){var t=e.options;return new Promise((function(e,r){!t.method||"GET"===t.method||Object(se.isWpVersion)("5.6","<")?ce()(de(de({},t),{},{parse:!1})).then((function(t){t.json().then((function(r){e({response:r,headers:t.headers}),ye(t.headers)})).catch((function(){r(ve)}))})).catch((function(e){ye(e.headers),"function"==typeof e.json?e.json().then((function(e){r(e)})).catch((function(){r(ve)})):r(e.message)})):ge(t).then((function(t){throw function(e){if("object"!==le()(e)||null===e||!e.hasOwnProperty("body")||!e.hasOwnProperty("headers"))throw new Error("Response not valid")}(t),t.status>=200&&t.status<300&&(e({response:t.body,headers:t.headers}),ye(t.headers)),t})).catch((function(e){e.headers&&ye(e.headers),e.body?r(e.body):r()}))}))}},xe=C.a.mark(Ee),_e=C.a.mark(Te),we=C.a.mark(Pe);function Ee(e){var t;return C.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Object(m.select)(G,"getCollectionLastModified");case 2:if(t=r.sent){r.next=8;break}return r.next=6,Object(m.dispatch)(G,"receiveLastModified",e);case 6:r.next=13;break;case 8:if(!(e>t)){r.next=13;break}return r.next=11,Object(m.dispatch)(G,"invalidateResolutionForStore");case 11:return r.next=13,Object(m.dispatch)(G,"receiveLastModified",e);case 13:case"end":return r.stop()}}),xe)}function Te(e,t,r,n){var o,a,c,i,u,s;return C.a.wrap((function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,Object(m.select)(v,"getRoute",e,t,n);case 2:if(o=f.sent,a=Object(q.addQueryArgs)("",r),o){f.next=8;break}return f.next=7,ee(e,t,a,n);case 7:return f.abrupt("return");case 8:return f.prev=8,f.next=11,he({path:o+a});case 11:if(c=f.sent,i=c.response,u=void 0===i?Y:i,!((s=c.headers)&&s.get&&s.has("last-modified"))){f.next=18;break}return f.next=18,Ee(parseInt(s.get("last-modified"),10));case 18:return f.next=20,ee(e,t,a,n,{items:u,headers:s});case 20:f.next=26;break;case 22:return f.prev=22,f.t0=f.catch(8),f.next=26,te(e,t,a,n,f.t0);case 26:case"end":return f.stop()}}),_e,null,[[8,22]])}function Pe(e,t,r,n,o){var a;return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=[t,r,n,o].filter((function(e){return void 0!==e})),e.next=3,m.select.apply(void 0,[G,"getCollection"].concat(O()(a)));case 3:case"end":return e.stop()}}),we)}function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){H()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ce(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(r),!0).forEach((function(t){H()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(h.registerStore)(G,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("RECEIVE_LAST_MODIFIED"===t.type)return t.timestamp===e.lastModified?e:je(je({},e),{},{lastModified:t.timestamp});if("INVALIDATE_RESOLUTION_FOR_STORE"===t.type)return{};var r=t.type,n=t.namespace,o=t.resourceName,a=t.queryString,c=t.response,i=t.ids?JSON.stringify(t.ids):"[]";switch(r){case"RECEIVE_COLLECTION":if(F(e,[n,o,i,a]))return e;e=U(e,[n,o,i,a],c);break;case"RESET_COLLECTION":case"ERROR":e=U(e,[n,o,i,a],c)}return e},actions:i,controls:Ie(Ie({},m.controls),Oe),selectors:c,resolvers:u});var De=G,ke=r(13),Re={cartItemsPendingQuantity:[],cartItemsPendingDelete:[],cartData:{coupons:[],shippingRates:[],shippingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},billingAddress:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:"",email:""},items:[],itemsCount:0,itemsWeight:0,needsShipping:!0,needsPayment:!1,hasCalculatedShipping:!0,fees:[],totals:{currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"",currency_suffix:"",total_items:"0",total_items_tax:"0",total_fees:"0",total_fees_tax:"0",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_price:"0",total_tax:"0",tax_lines:[]},errors:[],paymentRequirements:[],extensions:{}},metaData:{updatingCustomerData:!1,updatingSelectedRate:!1,applyingCoupon:"",removingCoupon:"",isCartDataStale:!1},errors:[]},Ae=function(e){return e.cartData},Me=function(e){return e.cartData.totals||Re.cartData.totals},Ne=function(e){return e.metaData||Re.metaData},Le=function(e){return e.errors||[]},Fe=function(e){return!!e.metaData.applyingCoupon},Ue=function(e){return e.metaData.isCartDataStale},Ve=function(e){return e.metaData.applyingCoupon||""},Ke=function(e){return!!e.metaData.removingCoupon},Qe=function(e){return e.metaData.removingCoupon||""},He=function(e,t){return e.cartData.items.find((function(e){return e.key===t}))},Ge=function(e,t){return e.cartItemsPendingQuantity.includes(t)},Ye=function(e,t){return e.cartItemsPendingDelete.includes(t)},qe=function(e){return!!e.metaData.updatingCustomerData},Be=function(e){return!!e.metaData.updatingSelectedRate},ze=C.a.mark(dt),Je=C.a.mark(ht),We=C.a.mark(mt),$e=C.a.mark(vt),Xe=C.a.mark(yt),Ze=C.a.mark(bt),et=C.a.mark(gt),tt=C.a.mark(Ot),rt=function(e){return{type:"RECEIVE_CART",response:Object(L.mapKeys)(e,(function(e,t){return Object(L.camelCase)(t)}))}},nt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:t?"REPLACE_ERRORS":"RECEIVE_ERROR",error:e}},ot=function(e){return{type:"APPLYING_COUPON",couponCode:e}},at=function(e){return{type:"REMOVING_COUPON",couponCode:e}},ct=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return{type:"RECEIVE_CART_ITEM",cartItem:e}},it=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"ITEM_PENDING_QUANTITY",cartItemKey:e,isPendingQuantity:t}},ut=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return{type:"RECEIVE_REMOVED_ITEM",cartItemKey:e,isPendingDelete:t}},st=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"SET_IS_CART_DATA_STALE",isCartDataStale:e}},ft=function(e){return{type:"UPDATING_CUSTOMER_DATA",isResolving:e}},lt=function(e){return{type:"UPDATING_SELECTED_SHIPPING_RATE",isResolving:e}},pt=function(){return{type:"UPDATE_LEGACY_CART_FRAGMENTS"}};function dt(e){var t,r,n;return C.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,he({path:"/wc/store/cart/extensions",method:"POST",data:{namespace:e.namespace,data:e.data},cache:"no-store"});case 3:return t=o.sent,r=t.response,o.next=7,rt(r);case 7:return o.next=9,pt();case 9:return o.abrupt("return",r);case 12:return o.prev=12,o.t0=o.catch(0),o.next=16,nt(o.t0);case 16:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=19;break}return o.next=19,rt(o.t0.data.cart);case 19:throw o.t0;case 20:case"end":return o.stop()}}),ze,null,[[0,12]])}function ht(e){var t,r,n;return C.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ot(e);case 2:return o.prev=2,o.next=5,he({path:"/wc/store/cart/apply-coupon",method:"POST",data:{code:e},cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,rt(r);case 9:return o.next=11,ot("");case 11:return o.next=13,pt();case 13:o.next=25;break;case 15:return o.prev=15,o.t0=o.catch(2),o.next=19,nt(o.t0);case 19:return o.next=21,ot("");case 21:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=24;break}return o.next=24,rt(o.t0.data.cart);case 24:throw o.t0;case 25:return o.abrupt("return",!0);case 26:case"end":return o.stop()}}),Je,null,[[2,15]])}function mt(e){var t,r,n;return C.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,at(e);case 2:return o.prev=2,o.next=5,he({path:"/wc/store/cart/remove-coupon",method:"POST",data:{code:e},cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,rt(r);case 9:return o.next=11,at("");case 11:return o.next=13,pt();case 13:o.next=25;break;case 15:return o.prev=15,o.t0=o.catch(2),o.next=19,nt(o.t0);case 19:return o.next=21,at("");case 21:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=24;break}return o.next=24,rt(o.t0.data.cart);case 24:throw o.t0;case 25:return o.abrupt("return",!0);case 26:case"end":return o.stop()}}),We,null,[[2,15]])}function vt(e){var t,r,n,o,a=arguments;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=a.length>1&&void 0!==a[1]?a[1]:1,c.prev=1,c.next=4,he({path:"/wc/store/cart/add-item",method:"POST",data:{id:e,quantity:t},cache:"no-store"});case 4:return r=c.sent,n=r.response,c.next=8,rt(n);case 8:return c.next=10,pt();case 10:c.next=20;break;case 12:return c.prev=12,c.t0=c.catch(1),c.next=16,nt(c.t0);case 16:if(null===(o=c.t0.data)||void 0===o||!o.cart){c.next=19;break}return c.next=19,rt(c.t0.data.cart);case 19:throw c.t0;case 20:case"end":return c.stop()}}),$e,null,[[1,12]])}function yt(e){var t,r,n;return C.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ut(e);case 2:return o.prev=2,o.next=5,he({path:"/wc/store/cart/remove-item",data:{key:e},method:"POST",cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,rt(r);case 9:return o.next=11,pt();case 11:o.next=20;break;case 13:return o.prev=13,o.t0=o.catch(2),o.next=17,nt(o.t0);case 17:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=20;break}return o.next=20,rt(o.t0.data.cart);case 20:return o.next=22,ut(e,!1);case 22:case"end":return o.stop()}}),Xe,null,[[2,13]])}function bt(e,t){var r,n,o,a;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,Object(m.select)(ke.c,"getCartItem",e);case 2:return r=c.sent,c.next=5,it(e);case 5:if((null==r?void 0:r.quantity)!==t){c.next=7;break}return c.abrupt("return");case 7:return c.prev=7,c.next=10,he({path:"/wc/store/cart/update-item",method:"POST",data:{key:e,quantity:t},cache:"no-store"});case 10:return n=c.sent,o=n.response,c.next=14,rt(o);case 14:return c.next=16,pt();case 16:c.next=25;break;case 18:return c.prev=18,c.t0=c.catch(7),c.next=22,nt(c.t0);case 22:if(null===(a=c.t0.data)||void 0===a||!a.cart){c.next=25;break}return c.next=25,rt(c.t0.data.cart);case 25:return c.next=27,it(e,!1);case 27:case"end":return c.stop()}}),Ze,null,[[7,18]])}function gt(e){var t,r,n,o,a=arguments;return C.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return t=a.length>1&&void 0!==a[1]?a[1]:0,c.prev=1,c.next=4,lt(!0);case 4:return c.next=6,he({path:"/wc/store/cart/select-shipping-rate",method:"POST",data:{package_id:t,rate_id:e},cache:"no-store"});case 6:return r=c.sent,n=r.response,c.next=10,rt(n);case 10:c.next=22;break;case 12:return c.prev=12,c.t0=c.catch(1),c.next=16,nt(c.t0);case 16:return c.next=18,lt(!1);case 18:if(null===(o=c.t0.data)||void 0===o||!o.cart){c.next=21;break}return c.next=21,rt(c.t0.data.cart);case 21:throw c.t0;case 22:return c.next=24,lt(!1);case 24:return c.abrupt("return",!0);case 25:case"end":return c.stop()}}),et,null,[[1,12]])}function Ot(e){var t,r,n;return C.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,ft(!0);case 2:return o.prev=2,o.next=5,he({path:"/wc/store/cart/update-customer",method:"POST",data:e,cache:"no-store"});case 5:return t=o.sent,r=t.response,o.next=9,rt(r);case 9:o.next=21;break;case 11:return o.prev=11,o.t0=o.catch(2),o.next=15,nt(o.t0);case 15:return o.next=17,ft(!1);case 17:if(null===(n=o.t0.data)||void 0===n||!n.cart){o.next=20;break}return o.next=20,rt(o.t0.data.cart);case 20:throw o.t0;case 21:return o.next=23,ft(!1);case 23:return o.abrupt("return",!0);case 24:case"end":return o.stop()}}),tt,null,[[2,11]])}var xt=C.a.mark(wt),_t=C.a.mark(Et);function wt(){var e;return C.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(m.apiFetch)({path:"/wc/store/cart",method:"GET",cache:"no-store"});case 2:if(e=t.sent){t.next=7;break}return t.next=6,nt(ke.a);case 6:return t.abrupt("return");case 7:return t.next=9,rt(e);case 9:case"end":return t.stop()}}),xt)}function Et(){return C.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(m.select)(ke.c,"getCartData");case 2:case"end":return e.stop()}}),_t)}function Tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tt(Object(r),!0).forEach((function(t){H()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var St,jt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_CART_ITEM":return e.map((function(e){var r;return e.key===(null===(r=t.cartItem)||void 0===r?void 0:r.key)?t.cartItem:e}))}return e},Ct=window.Event||null,It={UPDATE_LEGACY_CART_FRAGMENTS:function(){St&&clearTimeout(St),St=setTimeout((function(){!function(e,t){var r=t.bubbles,n=void 0!==r&&r,o=t.cancelable,a=void 0!==o&&o,c=t.element;if(c||(c=document.body),"function"==typeof Ct){var i=new Ct(e,{bubbles:n,cancelable:a});c.dispatchEvent(i)}else{var u=document.createEvent("Event");u.initEvent(e,n,a),c.dispatchEvent(u)}}("wc_fragment_refresh",{bubbles:!0,cancelable:!0})}),50)}};function Dt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function kt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(r),!0).forEach((function(t){H()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Dt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(h.registerStore)(ke.c,{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Re,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_ERROR":t.error&&(e=Pt(Pt({},e),{},{errors:e.errors.concat(t.error)}));break;case"REPLACE_ERRORS":t.error&&(e=Pt(Pt({},e),{},{errors:[t.error]}));break;case"RECEIVE_CART":t.response&&(e=Pt(Pt({},e),{},{errors:[],cartData:t.response}));break;case"APPLYING_COUPON":(t.couponCode||""===t.couponCode)&&(e=Pt(Pt({},e),{},{metaData:Pt(Pt({},e.metaData),{},{applyingCoupon:t.couponCode})}));break;case"REMOVING_COUPON":(t.couponCode||""===t.couponCode)&&(e=Pt(Pt({},e),{},{metaData:Pt(Pt({},e.metaData),{},{removingCoupon:t.couponCode})}));break;case"ITEM_PENDING_QUANTITY":var r=e.cartItemsPendingQuantity.filter((function(e){return e!==t.cartItemKey}));t.isPendingQuantity&&t.cartItemKey&&r.push(t.cartItemKey),e=Pt(Pt({},e),{},{cartItemsPendingQuantity:r});break;case"RECEIVE_REMOVED_ITEM":var n=e.cartItemsPendingDelete.filter((function(e){return e!==t.cartItemKey}));t.isPendingDelete&&t.cartItemKey&&n.push(t.cartItemKey),e=Pt(Pt({},e),{},{cartItemsPendingDelete:n});break;case"RECEIVE_CART_ITEM":e=Pt(Pt({},e),{},{errors:[],cartData:Pt(Pt({},e.cartData),{},{items:jt(e.cartData.items,t)})});break;case"UPDATING_CUSTOMER_DATA":e=Pt(Pt({},e),{},{metaData:Pt(Pt({},e.metaData),{},{updatingCustomerData:!!t.isResolving})});break;case"UPDATING_SELECTED_SHIPPING_RATE":e=Pt(Pt({},e),{},{metaData:Pt(Pt({},e.metaData),{},{updatingSelectedRate:!!t.isResolving})});break;case"SET_IS_CART_DATA_STALE":e=Pt(Pt({},e),{},{metaData:Pt(Pt({},e.metaData),{},{isCartDataStale:t.isCartDataStale})})}return e},actions:f,controls:kt(kt(kt({},m.controls),Oe),It),selectors:s,resolvers:l});var Rt=ke.c,At=function(e,t){return void 0===e[t]?null:e[t]},Mt=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=At(e,t);return null===o?n:void 0!==(o=JSON.parse(o))[r]?o[r]:n},Nt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=At(e,t);return null===n?r:JSON.parse(n)},Lt=function(e,t,r){return{type:"SET_QUERY_KEY_VALUE",context:e,queryKey:t,value:r}},Ft=function(e,t){return{type:"SET_QUERY_CONTEXT_VALUE",context:e,value:t}};function Ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ut(Object(r),!0).forEach((function(t){H()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(h.registerStore)("wc/store/query-state",{reducer:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0,n=r.type,o=r.context,a=r.queryKey,c=r.value,i=At(t,o);switch(n){case"SET_QUERY_KEY_VALUE":var u=null!==i?JSON.parse(i):{};u[a]=c,i!==(e=JSON.stringify(u))&&(t=Vt(Vt({},t),{},H()({},o,e)));break;case"SET_QUERY_CONTEXT_VALUE":i!==(e=JSON.stringify(c))&&(t=Vt(Vt({},t),{},H()({},o,e)))}return t},actions:d,selectors:p});var Kt="wc/store/query-state"},2:function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},21:function(e,t,r){var n=r(22);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},26:function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],_n=!0,c=!1;try{for(r=r.call(e);!(_n=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);_n=!0);}catch(e){c=!0,o=e}finally{try{_n||null==r.return||r.return()}finally{if(c)throw o}}return a}},e.exports.default=e.exports,e.exports.__esModule=!0},27:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},28:function(e,t){function r(e,t,r,n,o,a,c){try{var i=e[a](c),u=i.value}catch(e){return void r(e)}i.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(o,a){var c=e.apply(t,n);function i(e){r(c,o,a,i,u,"next",e)}function u(e){r(c,o,a,i,u,"throw",e)}i(void 0)}))}},e.exports.default=e.exports,e.exports.__esModule=!0},29:function(e,t,r){var n=r(143),o=r(144),a=r(21),c=r(145);e.exports=function(e){return n(e)||o(e)||a(e)||c()},e.exports.default=e.exports,e.exports.__esModule=!0},3:function(e,t){!function(){e.exports=this.regeneratorRuntime}()},30:function(e,t){var r,n,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function i(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:c}catch(e){n=c}}();var u,s=[],f=!1,l=-1;function p(){f&&u&&(f=!1,u.length?s=u.concat(s):l=-1,s.length&&d())}function d(){if(!f){var e=i(p);f=!0;for(var t=s.length;t;){for(u=s,s=[];++l<t;)u&&u[l].run();l=-1,t=s.length}u=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===c||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];s.push(new h(e,t)),1!==s.length||f||i(d)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},31:function(e,t){!function(){e.exports=this.wp.url}()},38:function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},4:function(e,t){!function(){e.exports=this.lodash}()},41:function(e,t,r){"use strict";(function(t,r){var n,o=function(){function e(e,t){if("function"!=typeof e)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but got: "+e+".");this._batchLoadFn=e,this._maxBatchSize=function(e){if(e&&!1===e.batch)return 1;var t=e&&e.maxBatchSize;if(void 0===t)return 1/0;if("number"!=typeof t||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}(t),this._batchScheduleFn=function(e){var t=e&&e.batchScheduleFn;if(void 0===t)return a;if("function"!=typeof t)throw new TypeError("batchScheduleFn must be a function: "+t);return t}(t),this._cacheKeyFn=function(e){var t=e&&e.cacheKeyFn;if(void 0===t)return function(e){return e};if("function"!=typeof t)throw new TypeError("cacheKeyFn must be a function: "+t);return t}(t),this._cacheMap=function(e){if(e&&!1===e.cache)return null;var t=e&&e.cacheMap;if(void 0===t)return new Map;if(null!==t){var r=["get","set","delete","clear"].filter((function(e){return t&&"function"!=typeof t[e]}));if(0!==r.length)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}(t),this._batch=null}var t=e.prototype;return t.load=function(e){if(null==e)throw new TypeError("The loader.load() function must be called with a value,but got: "+String(e)+".");var t=function(e){var t=e._batch;if(null!==t&&!t.hasDispatched&&t.keys.length<e._maxBatchSize&&(!t.cacheHits||t.cacheHits.length<e._maxBatchSize))return t;var r={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=r,e._batchScheduleFn((function(){return function(e,t){if(t.hasDispatched=!0,0!==t.keys.length){var r=e._batchLoadFn(t.keys);if(!r||"function"!=typeof r.then)return c(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise: "+String(r)+"."));r.then((function(e){if(!u(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array: "+String(e)+".");if(e.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys.\n\nKeys:\n"+String(t.keys)+"\n\nValues:\n"+String(e));i(t);for(var r=0;r<t.callbacks.length;r++){var n=e[r];n instanceof Error?t.callbacks[r].reject(n):t.callbacks[r].resolve(n)}})).catch((function(r){return c(e,t,r)}))}else i(t)}(e,r)})),r}(this),r=this._cacheMap,n=this._cacheKeyFn(e);if(r){var o=r.get(n);if(o){var a=t.cacheHits||(t.cacheHits=[]);return new Promise((function(e){a.push((function(){return e(o)}))}))}}t.keys.push(e);var s=new Promise((function(e,r){t.callbacks.push({resolve:e,reject:r})}));return r&&r.set(n,s),s},t.loadMany=function(e){if(!u(e))throw new TypeError("The loader.loadMany() function must be called with Array<key> but got: "+e+".");for(var t=[],r=0;r<e.length;r++)t.push(this.load(e[r]).catch((function(e){return e})));return Promise.all(t)},t.clear=function(e){var t=this._cacheMap;if(t){var r=this._cacheKeyFn(e);t.delete(r)}return this},t.clearAll=function(){var e=this._cacheMap;return e&&e.clear(),this},t.prime=function(e,t){var r=this._cacheMap;if(r){var n,o=this._cacheKeyFn(e);void 0===r.get(o)&&(t instanceof Error?(n=Promise.reject(t)).catch((function(){})):n=Promise.resolve(t),r.set(o,n))}return this},e}(),a="object"==typeof t&&"function"==typeof t.nextTick?function(e){n||(n=Promise.resolve()),n.then((function(){return t.nextTick(e)}))}:r||setTimeout;function c(e,t,r){i(t);for(var n=0;n<t.keys.length;n++)e.clear(t.keys[n]),t.callbacks[n].reject(r)}function i(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function u(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length&&(0===e.length||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}e.exports=o}).call(this,r(30),r(146).setImmediate)},6:function(e,t){!function(){e.exports=this.wc.wcSettings}()},7:function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},8:function(e,t){!function(){e.exports=this.wp.dataControls}()}});
Package.describe({ name: 'praneybehl:react-conditionals', version: '0.1.5', summary: 'React component for easy conditional logic packaged for Meteor', git: 'https://github.com/praneybehl/meteor-react-conditionals', documentation: 'README.md' }); Package.onUse(function(api) { api.versionsFrom('1.2.1'); api.use('ecmascript'); api.use('react@0.1.13'); api.use('cosmos:browserify@0.8.3', 'client'); api.addFiles('package.browserify.js', 'client'); api.addFiles('package.browserify.options.json', 'client'); api.export('Conditional'); }); Npm.depends({ "react-conditional-component": "0.1.5", "exposify": "0.5.0" });
import { NavigationContainer } from '@react-navigation/native'; import { createStackNavigator } from '@react-navigation/stack'; import React from 'react'; import { SafeAreaProvider } from 'react-native-safe-area-context'; import { connect } from '../../../base/redux'; import { DialInSummary } from '../../../invite'; import { rootNavigationRef } from '../rootNavigationContainerRef'; import { screen } from '../routes'; import { dialInSummaryScreenOptions, drawerNavigatorScreenOptions, navigationContainerTheme } from '../screenOptions'; import ConnectingPage from './ConnectingPage'; import ConferenceNavigationContainer from './conference/components/ConferenceNavigationContainer'; import WelcomePageNavigationContainer from './welcome/components/WelcomePageNavigationContainer'; import { isWelcomePageAppEnabled } from './welcome/functions'; const RootStack = createStackNavigator(); type Props = { /** * Is welcome page available? */ isWelcomePageAvailable: boolean } const RootNavigationContainer = ({ isWelcomePageAvailable }: Props) => { const initialRouteName = isWelcomePageAvailable ? screen.root : screen.connecting; return ( <SafeAreaProvider> <NavigationContainer independent = { true } ref = { rootNavigationRef } theme = { navigationContainerTheme }> <RootStack.Navigator initialRouteName = { initialRouteName }> { isWelcomePageAvailable && <RootStack.Screen component = { WelcomePageNavigationContainer } name = { screen.root } options = { drawerNavigatorScreenOptions } /> } <RootStack.Screen component = { ConnectingPage } name = { screen.connecting } options = {{ gestureEnabled: false, headerShown: false }} /> <RootStack.Screen component = { DialInSummary } name = { screen.dialInSummary } options = { dialInSummaryScreenOptions } /> <RootStack.Screen component = { ConferenceNavigationContainer } name = { screen.conference.root } options = {{ gestureEnabled: false, headerShown: false }} /> </RootStack.Navigator> </NavigationContainer> </SafeAreaProvider> ); }; /** * Maps part of the Redux store to the props of this component. * * @param {Object} state - The Redux state. * @returns {Props} */ function mapStateToProps(state: Object) { return { isWelcomePageAvailable: isWelcomePageAppEnabled(state) }; } export default connect(mapStateToProps)(RootNavigationContainer);
const BaseModel = require(`../BaseModel`); /** * NetworkCountQuery class */ class NetworkCountQuery extends BaseModel { /** * Creates new NetworkCountQuery model * @param {object} options - model options object * @param {string} options.name - Filter by device type name * @param {string} options.namePattern - Filter by device type name pattern. In pattern wildcards '%' and '_' can be used */ constructor({ name, namePattern } = {}) { super(); this.name = name; this.namePattern = namePattern; } get name() { return this._name; } set name(value) { this._name = value; } get namePattern() { return this._namePattern; } set namePattern(value) { this._namePattern = value; } /** * Returns instance as a plain JS object * @returns {Object} */ toObject() { return { name: this.name, namePattern: this.namePattern } } } module.exports = NetworkCountQuery;
'use strict'; module.exports = { type: 'error', error: { line: 2, column: 1, message: 'Unexpected end of file. The decorator operator \'@\' at 1:1 should be followed by a name (read/write).', }, };
/************************************************************* * * MathJax/jax/output/HTML-CSS/fonts/TeX/Main/Bold/Latin1Supplement.js * * Copyright (c) 2009-2012 Design Science, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ MathJax.Hub.Insert( MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['MathJax_Main-bold'], { 0xA0: [0,0,250,0,0], // NO-BREAK SPACE 0xA8: [695,-535,575,96,478], // DIAERESIS 0xAC: [371,-61,767,64,702], // NOT SIGN 0xAF: [607,-540,575,80,494], // MACRON 0xB0: [702,-536,575,160,414], // DEGREE SIGN 0xB1: [728,35,894,64,829], // PLUS-MINUS SIGN 0xB4: [706,-503,575,236,460], // ACUTE ACCENT 0xD7: [530,28,894,168,726], // MULTIPLICATION SIGN 0xF7: [597,96,894,64,828] // DIVISION SIGN } ); MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir + "/Main/Bold/Latin1Supplement.js");
// @flow import { compose } from 'redux'; import { connect } from 'react-redux'; import { RegisterTeiDataEntryComponent } from './RegisterTeiDataEntry.component'; import { withErrorMessageHandler } from '../../../../../HOC/withErrorMessageHandler'; const mapStateToProps = (state: ReduxState) => ({ showDataEntry: state.newRelationshipRegisterTei.orgUnit, error: state.newRelationshipRegisterTei.dataEntryError, programId: state.newRelationshipRegisterTei.programId, }); const mapDispatchToProps = () => ({}); export const RegisterTeiDataEntry = compose( // $FlowFixMe[missing-annot] automated comment connect(mapStateToProps, mapDispatchToProps), withErrorMessageHandler(), )(RegisterTeiDataEntryComponent);
import { createSlice } from '@reduxjs/toolkit'; const localStorageKey = 'CurrentUser'; const buildUser = (data) => { const { AccessToken, AccessTokenExpiration, RefreshToken, UserID, Administrator } = data; if (UserID != null && AccessToken != null && AccessTokenExpiration != null && RefreshToken != null && Administrator != null) { return { UserID, AccessToken, AccessTokenExpiration, RefreshToken, Administrator }; } return null; }; export const authSlice = createSlice({ name: 'auth', initialState: { user: null, userBadgeName: null, userBadgeAvatarSrc: null, }, reducers: { initialize: state => { let storageItem = localStorage.getItem(localStorageKey); try { let parsedStorageItem = JSON.parse(storageItem); const user = buildUser(parsedStorageItem); state.user = user; } catch { } }, authorize: (state, action) => { const user = buildUser(action.payload); if (user != null) { state.user = user; localStorage.setItem(localStorageKey, JSON.stringify(user)); } }, logout: state => { state.user = null; state.userBadgeName = null; state.userBadgeAvatarSrc = null; localStorage.removeItem(localStorageKey); }, saveBadgeData: (state, action) => { state.userBadgeName = action.payload.userBadgeName; state.userBadgeAvatarSrc = action.payload.userBadgeAvatarSrc?.replace('/images/','/thumbnails/'); } } }); export const { initialize, authorize, logout, saveBadgeData } = authSlice.actions; export const selectUser = state => state.authenticator.user; export const selectUserBadgeName = state => state.authenticator.userBadgeName; export const selectUserBadgeAvatarSrc = state => state.authenticator.userBadgeAvatarSrc; export default authSlice.reducer;
/*************************** [bundle] ****************************/ // Original file:./examples/svg.html /*****************************************************************/ window.__etcpack__bundleSrc__['43']=function(){ var __etcpack__scope_bundle__={}; var __etcpack__scope_args__; __etcpack__scope_bundle__.default= "<!DOCTYPE html>\r\n<html lang=\"zh-cn\">\r\n\r\n<head>\r\n <meta charset=\"UTF-8\">\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <title>HTML / 标签 / SVG</title>\r\n <script src='https://cdn.jsdelivr.net/npm/@hai2007/tool@0'></script>\r\n <style>\r\n svg {\r\n width: 300px;\r\n height: 300px;\r\n }\r\n </style>\r\n</head>\r\n\r\n<body>\r\n <svg>\r\n <circle cx=\"150\" cy=\"150\" r=\"100\" fill=\"red\" />\r\n </svg>\r\n\r\n</body>\r\n\r\n</html>\r\n" return __etcpack__scope_bundle__; }
import React from 'react' import SvgIcon from '@material-ui/core/SvgIcon' function Broken (props) { return ( <SvgIcon {...props}> <path d="M12.604 15.233l-3.5 3.44L11.473 21H5c-1.102 0-2-.9-2-2V5c0-1.1.899-2 2-2h6.05L9.105 4.914l3.5 3.44-3.5 3.44 3.5 3.44zM19 3c1.1 0 2 .9 2 2v14c0 1.1-.9 2-2 2h-4.675l-2.367-2.327 3.5-3.44-3.5-3.44 3.5-3.439-3.5-3.44L13.905 3H19z" /> </SvgIcon> ) } export { Broken }
/** * @class draw2d.shape.icon.Package * See the example: * * @example preview small frame * * var icon = new draw2d.shape.icon.Package(); * * canvas.add(icon,50,10); * * @inheritable * @author Andreas Herz * @extends draw2d.shape.icon.Icon */ import draw2d from '../../packages'; draw2d.shape.icon.Package = draw2d.shape.icon.Icon.extend({ NAME : "draw2d.shape.icon.Package", /** * * @constructor * Creates a new icon element which are not assigned to any canvas. * * @param {Object} attr the configuration of the shape */ init: function(attr, setter, getter ) { this._super(extend({width:50,height:50},attr), setter, getter); }, /** * @private * @returns */ createSet: function() { return this.canvas.paper.path("M17.078,22.004l-1.758-4.129l-2.007,4.752l-7.519-3.289l0.174,3.905l9.437,4.374l10.909-5.365l-0.149-4.989L17.078,22.004zM29.454,6.619L18.521,3.383l-3.006,2.671l-3.091-2.359L1.546,8.199l3.795,3.048l-3.433,5.302l10.879,4.757l2.53-5.998l2.257,5.308l11.393-5.942l-3.105-4.709L29.454,6.619zM15.277,14.579l-9.059-3.83l9.275-4.101l9.608,3.255L15.277,14.579z"); } });
import React from "react" import { Link } from "gatsby" import styled from "styled-components" import { ThemeToggler } from "gatsby-plugin-dark-mode" const Navbar = () => { return ( <Wrapper> <div className="navbar"> <div className="full-width"> <ul className="nav-links"> <li> <Link to="/"> <h2>JP-EN Visual Dictionary</h2> </Link> </li> <li> <div> <a href="https://jpenphrase.netlify.app" target="_blank"> Phrasebook </a> <ThemeToggler> {({ theme, toggleTheme }) => ( <label> <input className="toggle" type="checkbox" onChange={e => toggleTheme(e.target.checked ? "dark" : "light") } checked={theme === "dark"} />{" "} Dark </label> )} </ThemeToggler> </div> </li> </ul> </div> </div> </Wrapper> ) } const Wrapper = styled.nav` .nav-links { padding-top: 1rem; margin: 0; display: flex; list-style: none; justify-content: space-between; } .toggle { margin-left: 1rem; } ` export default Navbar
// @flow import Scanner from "./scanner"; import Token from "./token"; export default function scanNumericLiteral (scanner: Scanner): ?Token { if (!/[0-9]/.test(scanner.char)) { return; } const token = new Token(Token.NumericLiteral, scanner.char); token.configure(scanner); if (/[0-9.]/.test(scanner.peek())) { // $FlowIssue for (const char of scanner) { token.value += char; if (!/[0-9.]/.test(scanner.peek())) { break; } } } return token; }
import { ABC, LETTER_WIDTH, LETTER_HEIGHT } from './serift'; const STRING_LENGTH = 8; export default function convertText2Smiles(text = '', bgSymbol = '🤘', textSymbol = '💀', strLength = STRING_LENGTH) { if (!text.length) return text; function getLetter(symb, lineIndex) { let letter; const POSITION = lineIndex * LETTER_WIDTH; switch (symb) { case "'": case '"': letter = ABC.quote; break; default: letter = ABC[symb]; } if (!letter) { letter = ABC[' ']; } return letter.slice(POSITION, POSITION + (LETTER_WIDTH - 1)); } function generateLine(str, result = '', secondLine = false) { let currentResult = result; const currentString = str.slice(0, strLength); const surplusString = str.slice(strLength); for (let lineIndex = secondLine ? 1 : 0; lineIndex < LETTER_HEIGHT; lineIndex += 1) { for (let letterIndex = 0; letterIndex < currentString.length; letterIndex += 1) { const letter = currentString[letterIndex]; currentResult += getLetter(letter, lineIndex); } currentResult += `${bgSymbol}\n`; } if (surplusString.length > 0) { return generateLine(surplusString, currentResult, true); } return currentResult; } return generateLine(text.toLowerCase()).replace(/\./g, bgSymbol).replace(/\*/g, textSymbol); }
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ import React from 'react'; import { SummaryStatus } from '../../summary_status'; import { formatMetric } from '../../../lib/format_number'; import { injectI18n } from '@kbn/i18n/react'; function StatusUI({ stat, formattedLeader, oldestStat, intl }) { const { follower_index: followerIndex, shard_id: shardId, operations_written: operationsReceived, failed_read_requests: failedFetches } = stat; const { operations_written: oldestOperationsReceived, failed_read_requests: oldestFailedFetches } = oldestStat; const metrics = [ { label: intl.formatMessage({ id: 'xpack.monitoring.elasticsearch.ccrShard.status.followerIndexLabel', defaultMessage: 'Follower Index', }), value: followerIndex, dataTestSubj: 'followerIndex' }, { label: intl.formatMessage({ id: 'xpack.monitoring.elasticsearch.ccrShard.status.shardIdLabel', defaultMessage: 'Shard Id', }), value: shardId, dataTestSubj: 'shardId' }, { label: intl.formatMessage({ id: 'xpack.monitoring.elasticsearch.ccrShard.status.leaderIndexLabel', defaultMessage: 'Leader Index', }), value: formattedLeader, dataTestSubj: 'leaderIndex' }, { label: intl.formatMessage({ id: 'xpack.monitoring.elasticsearch.ccrShard.status.opsSyncedLabel', defaultMessage: 'Ops Synced', }), value: formatMetric(operationsReceived - oldestOperationsReceived, 'int_commas'), dataTestSubj: 'operationsReceived' }, { label: intl.formatMessage({ id: 'xpack.monitoring.elasticsearch.ccrShard.status.failedFetchesLabel', defaultMessage: 'Failed Fetches', }), value: formatMetric(failedFetches - oldestFailedFetches, 'int_commas'), dataTestSubj: 'failedFetches' }, ]; return ( <SummaryStatus metrics={metrics} data-test-subj="ccrDetailStatus" /> ); } export const Status = injectI18n(StatusUI);
import React from "react"; import Status from "components/views/Status"; import { Container } from "helpers/reactstrap"; const ShipStatus = props => { return ( <Container fluid style={{ paddingTop: "100px" }}> <Status {...props} clientObj={{}} viewscreen /> </Container> ); }; export default ShipStatus;
/** * jscolor, JavaScript Color Picker * * @version 1.4.1 * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html * @author Jan Odvarko, http://odvarko.cz * @created 2008-06-15 * @updated 2013-04-08 * @link http://jscolor.com */ var jscolor = { dir : '', // location of jscolor directory (leave empty to autodetect) bindClass : 'color', // class name binding : true, // automatic binding via <input class="..."> preloading : true, // use image preloading? install : function() { jscolor.addEvent(window, 'load', jscolor.init); }, init : function() { if(jscolor.binding) { jscolor.bind(); } if(jscolor.preloading) { jscolor.preload(); } }, getDir : function() { if(!jscolor.dir) { var detected = jscolor.detectDir(); jscolor.dir = detected!==false ? detected : 'jscolor/'; } return jscolor.dir; }, detectDir : function() { var base = location.href; var e = document.getElementsByTagName('base'); for(var i=0; i<e.length; i+=1) { if(e[i].href) { base = e[i].href; } } var e = document.getElementsByTagName('script'); for(var i=0; i<e.length; i+=1) { if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) { var src = new jscolor.URI(e[i].src); var srcAbs = src.toAbsolute(base); srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename srcAbs.query = null; srcAbs.fragment = null; return srcAbs.toString(); } } return false; }, bind : function() { var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i'); var e = document.getElementsByTagName('input'); for(var i=0; i<e.length; i+=1) { var m; if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) { var prop = {}; if(m[3]) { try { prop = (new Function ('return (' + m[3] + ')'))(); } catch(eInvalidProp) {} } e[i].color = new jscolor.color(e[i], prop); } } }, preload : function() { for(var fn in jscolor.imgRequire) { if(jscolor.imgRequire.hasOwnProperty(fn)) { jscolor.loadImage(fn); } } }, images : { pad : [ 181, 101 ], sld : [ 16, 101 ], cross : [ 15, 15 ], arrow : [ 7, 11 ] }, imgRequire : {}, imgLoaded : {}, requireImage : function(filename) { jscolor.imgRequire[filename] = true; }, loadImage : function(filename) { if(!jscolor.imgLoaded[filename]) { jscolor.imgLoaded[filename] = new Image(); jscolor.imgLoaded[filename].src = jscolor.getDir()+filename; } }, fetchElement : function(mixed) { return typeof mixed === 'string' ? document.getElementById(mixed) : mixed; }, addEvent : function(el, evnt, func) { if(el.addEventListener) { el.addEventListener(evnt, func, false); } else if(el.attachEvent) { el.attachEvent('on'+evnt, func); } }, fireEvent : function(el, evnt) { if(!el) { return; } if(document.createEvent) { var ev = document.createEvent('HTMLEvents'); ev.initEvent(evnt, true, true); el.dispatchEvent(ev); } else if(document.createEventObject) { var ev = document.createEventObject(); el.fireEvent('on'+evnt, ev); } else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5) el['on'+evnt](); } }, getElementPos : function(e) { var e1=e, e2=e; var x=0, y=0; if(e1.offsetParent) { do { x += e1.offsetLeft; y += e1.offsetTop; } while(e1 = e1.offsetParent); } while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') { x -= e2.scrollLeft; y -= e2.scrollTop; } return [x, y]; }, getElementSize : function(e) { return [e.offsetWidth, e.offsetHeight]; }, getRelMousePos : function(e) { var x = 0, y = 0; if (!e) { e = window.event; } if (typeof e.offsetX === 'number') { x = e.offsetX; y = e.offsetY; } else if (typeof e.layerX === 'number') { x = e.layerX; y = e.layerY; } return { x: x, y: y }; }, getViewPos : function() { if(typeof window.pageYOffset === 'number') { return [window.pageXOffset, window.pageYOffset]; } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) { return [document.body.scrollLeft, document.body.scrollTop]; } else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { return [document.documentElement.scrollLeft, document.documentElement.scrollTop]; } else { return [0, 0]; } }, getViewSize : function() { if(typeof window.innerWidth === 'number') { return [window.innerWidth, window.innerHeight]; } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) { return [document.body.clientWidth, document.body.clientHeight]; } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { return [document.documentElement.clientWidth, document.documentElement.clientHeight]; } else { return [0, 0]; } }, URI : function(uri) { // See RFC3986 this.scheme = null; this.authority = null; this.path = ''; this.query = null; this.fragment = null; this.parse = function(uri) { var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/); this.scheme = m[3] ? m[2] : null; this.authority = m[5] ? m[6] : null; this.path = m[7]; this.query = m[9] ? m[10] : null; this.fragment = m[12] ? m[13] : null; return this; }; this.toString = function() { var result = ''; if(this.scheme !== null) { result = result + this.scheme + ':'; } if(this.authority !== null) { result = result + '//' + this.authority; } if(this.path !== null) { result = result + this.path; } if(this.query !== null) { result = result + '?' + this.query; } if(this.fragment !== null) { result = result + '#' + this.fragment; } return result; }; this.toAbsolute = function(base) { var base = new jscolor.URI(base); var r = this; var t = new jscolor.URI; if(base.scheme === null) { return false; } if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) { r.scheme = null; } if(r.scheme !== null) { t.scheme = r.scheme; t.authority = r.authority; t.path = removeDotSegments(r.path); t.query = r.query; } else { if(r.authority !== null) { t.authority = r.authority; t.path = removeDotSegments(r.path); t.query = r.query; } else { if(r.path === '') { t.path = base.path; if(r.query !== null) { t.query = r.query; } else { t.query = base.query; } } else { if(r.path.substr(0,1) === '/') { t.path = removeDotSegments(r.path); } else { if(base.authority !== null && base.path === '') { t.path = '/'+r.path; } else { t.path = base.path.replace(/[^\/]+$/,'')+r.path; } t.path = removeDotSegments(t.path); } t.query = r.query; } t.authority = base.authority; } t.scheme = base.scheme; } t.fragment = r.fragment; return t; }; function removeDotSegments(path) { var out = ''; while(path) { if(path.substr(0,3)==='../' || path.substr(0,2)==='./') { path = path.replace(/^\.+/,'').substr(1); } else if(path.substr(0,3)==='/./' || path==='/.') { path = '/'+path.substr(3); } else if(path.substr(0,4)==='/../' || path==='/..') { path = '/'+path.substr(4); out = out.replace(/\/?[^\/]*$/, ''); } else if(path==='.' || path==='..') { path = ''; } else { var rm = path.match(/^\/?[^\/]*/)[0]; path = path.substr(rm.length); out = out + rm; } } return out; } if(uri) { this.parse(uri); } }, // // Usage example: // var myColor = new jscolor.color(myInputElement) // color : function(target, prop) { this.required = true; // refuse empty values? this.adjust = true; // adjust value to uniform notation? this.hash = false; // prefix color with # symbol? this.caps = true; // uppercase? this.slider = true; // show the value/saturation slider? this.valueElement = target; // value holder this.styleElement = target; // where to reflect current color this.onImmediateChange = null; // onchange callback (can be either string or function) this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1 this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1 this.minH = 0; // read-only 0-6 this.maxH = 6; // read-only 0-6 this.minS = 0; // read-only 0-1 this.maxS = 1; // read-only 0-1 this.minV = 0; // read-only 0-1 this.maxV = 1; // read-only 0-1 this.pickerOnfocus = true; // display picker on focus? this.pickerMode = 'HSV'; // HSV | HVS this.pickerPosition = 'bottom'; // left | right | top | bottom this.pickerSmartPosition = true; // automatically adjust picker position when necessary this.pickerButtonHeight = 20; // px this.pickerClosable = false; this.pickerCloseText = 'Close'; this.pickerButtonColor = 'ButtonText'; // px this.pickerFace = 10; // px this.pickerFaceColor = 'ThreeDFace'; // CSS color this.pickerBorder = 1; // px this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color this.pickerInset = 1; // px this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color this.pickerZIndex = 10000; for(var p in prop) { if(prop.hasOwnProperty(p)) { this[p] = prop[p]; } } this.hidePicker = function() { if(isPickerOwner()) { removePicker(); } }; this.showPicker = function() { if(!isPickerOwner()) { var tp = jscolor.getElementPos(target); // target pos var ts = jscolor.getElementSize(target); // target size var vp = jscolor.getViewPos(); // view pos var vs = jscolor.getViewSize(); // view size var ps = getPickerDims(this); // picker size var a, b, c; switch(this.pickerPosition.toLowerCase()) { case 'left': a=1; b=0; c=-1; break; case 'right':a=1; b=0; c=1; break; case 'top': a=0; b=1; c=-1; break; default: a=0; b=1; c=1; break; } var l = (ts[b]+ps[b])/2; // picker pos if (!this.pickerSmartPosition) { var pp = [ tp[a], tp[b]+ts[b]-l+l*c ]; } else { var pp = [ -vp[a]+tp[a]+ps[a] > vs[a] ? (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) : tp[a], -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ? (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) : (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c) ]; } drawPicker(pp[a], pp[b]); } }; this.importColor = function() { if(!valueElement) { this.exportColor(); } else { if(!this.adjust) { if(!this.fromString(valueElement.value, leaveValue)) { styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage; styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; styleElement.style.color = styleElement.jscStyle.color; this.exportColor(leaveValue | leaveStyle); } } else if(!this.required && /^\s*$/.test(valueElement.value)) { valueElement.value = ''; styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage; styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor; styleElement.style.color = styleElement.jscStyle.color; this.exportColor(leaveValue | leaveStyle); } else if(this.fromString(valueElement.value)) { // OK } else { this.exportColor(); } } }; this.exportColor = function(flags) { if(!(flags & leaveValue) && valueElement) { var value = this.toString(); if(this.caps) { value = value.toUpperCase(); } if(this.hash) { value = '#'+value; } valueElement.value = value; } if(!(flags & leaveStyle) && styleElement) { styleElement.style.backgroundImage = "none"; styleElement.style.backgroundColor = '#'+this.toString(); styleElement.style.color = 0.213 * this.rgb[0] + 0.715 * this.rgb[1] + 0.072 * this.rgb[2] < 0.5 ? '#FFF' : '#000'; } if(!(flags & leavePad) && isPickerOwner()) { redrawPad(); } if(!(flags & leaveSld) && isPickerOwner()) { redrawSld(); } }; this.fromHSV = function(h, s, v, flags) { // null = don't change if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); } if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); } if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); } this.rgb = HSV_RGB( h===null ? this.hsv[0] : (this.hsv[0]=h), s===null ? this.hsv[1] : (this.hsv[1]=s), v===null ? this.hsv[2] : (this.hsv[2]=v) ); this.exportColor(flags); }; this.fromRGB = function(r, g, b, flags) { // null = don't change if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); } if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); } if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); } var hsv = RGB_HSV( r===null ? this.rgb[0] : r, g===null ? this.rgb[1] : g, b===null ? this.rgb[2] : b ); if(hsv[0] !== null) { this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0])); } if(hsv[2] !== 0) { this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1])); } this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2])); // update RGB according to final HSV, as some values might be trimmed var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]); this.rgb[0] = rgb[0]; this.rgb[1] = rgb[1]; this.rgb[2] = rgb[2]; this.exportColor(flags); }; this.fromString = function(hex, flags) { var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i); if(!m) { return false; } else { if(m[1].length === 6) { // 6-char notation this.fromRGB( parseInt(m[1].substr(0,2),16) / 255, parseInt(m[1].substr(2,2),16) / 255, parseInt(m[1].substr(4,2),16) / 255, flags ); } else { // 3-char notation this.fromRGB( parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255, parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255, parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255, flags ); } return true; } }; this.toString = function() { return ( (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) + (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) + (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1) ); }; function RGB_HSV(r, g, b) { var n = Math.min(Math.min(r,g),b); var v = Math.max(Math.max(r,g),b); var m = v - n; if(m === 0) { return [ null, 0, v ]; } var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m); return [ h===6?0:h, m/v, v ]; } function HSV_RGB(h, s, v) { if(h === null) { return [ v, v, v ]; } var i = Math.floor(h); var f = i%2 ? h-i : 1-(h-i); var m = v * (1 - s); var n = v * (1 - s*f); switch(i) { case 6: case 0: return [v,n,m]; case 1: return [n,v,m]; case 2: return [m,v,n]; case 3: return [m,n,v]; case 4: return [n,m,v]; case 5: return [v,m,n]; } } function removePicker() { delete jscolor.picker.owner; document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB); } function drawPicker(x, y) { if(!jscolor.picker) { jscolor.picker = { box : document.createElement('div'), boxB : document.createElement('div'), pad : document.createElement('div'), padB : document.createElement('div'), padM : document.createElement('div'), sld : document.createElement('div'), sldB : document.createElement('div'), sldM : document.createElement('div'), btn : document.createElement('div'), btnS : document.createElement('span'), btnT : document.createTextNode(THIS.pickerCloseText) }; for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) { var seg = document.createElement('div'); seg.style.height = segSize+'px'; seg.style.fontSize = '1px'; seg.style.lineHeight = '0'; jscolor.picker.sld.appendChild(seg); } jscolor.picker.sldB.appendChild(jscolor.picker.sld); jscolor.picker.box.appendChild(jscolor.picker.sldB); jscolor.picker.box.appendChild(jscolor.picker.sldM); jscolor.picker.padB.appendChild(jscolor.picker.pad); jscolor.picker.box.appendChild(jscolor.picker.padB); jscolor.picker.box.appendChild(jscolor.picker.padM); jscolor.picker.btnS.appendChild(jscolor.picker.btnT); jscolor.picker.btn.appendChild(jscolor.picker.btnS); jscolor.picker.box.appendChild(jscolor.picker.btn); jscolor.picker.boxB.appendChild(jscolor.picker.box); } var p = jscolor.picker; // controls interaction p.box.onmouseup = p.box.onmouseout = function() { target.focus(); }; p.box.onmousedown = function() { abortBlur=true; }; p.box.onmousemove = function(e) { if (holdPad || holdSld) { holdPad && setPad(e); holdSld && setSld(e); if (document.selection) { document.selection.empty(); } else if (window.getSelection) { window.getSelection().removeAllRanges(); } dispatchImmediateChange(); } }; if('ontouchstart' in window) { // if touch device p.box.addEventListener('touchmove', function(e) { var event={ 'offsetX': e.touches[0].pageX-touchOffset.X, 'offsetY': e.touches[0].pageY-touchOffset.Y }; if (holdPad || holdSld) { holdPad && setPad(event); holdSld && setSld(event); dispatchImmediateChange(); } e.stopPropagation(); // prevent move "view" on broswer e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events) }, false); } p.padM.onmouseup = p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } }; p.padM.onmousedown = function(e) { // if the slider is at the bottom, move it up switch(modeID) { case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break; case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break; } holdSld=false; holdPad=true; setPad(e); dispatchImmediateChange(); }; if('ontouchstart' in window) { p.padM.addEventListener('touchstart', function(e) { touchOffset={ 'X': e.target.offsetParent.offsetLeft, 'Y': e.target.offsetParent.offsetTop }; this.onmousedown({ 'offsetX':e.touches[0].pageX-touchOffset.X, 'offsetY':e.touches[0].pageY-touchOffset.Y }); }); } p.sldM.onmouseup = p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } }; p.sldM.onmousedown = function(e) { holdPad=false; holdSld=true; setSld(e); dispatchImmediateChange(); }; if('ontouchstart' in window) { p.sldM.addEventListener('touchstart', function(e) { touchOffset={ 'X': e.target.offsetParent.offsetLeft, 'Y': e.target.offsetParent.offsetTop }; this.onmousedown({ 'offsetX':e.touches[0].pageX-touchOffset.X, 'offsetY':e.touches[0].pageY-touchOffset.Y }); }); } // picker var dims = getPickerDims(THIS); p.box.style.width = dims[0] + 'px'; p.box.style.height = dims[1] + 'px'; // picker border p.boxB.style.position = 'absolute'; p.boxB.style.clear = 'both'; p.boxB.style.left = x+'px'; p.boxB.style.top = y+'px'; p.boxB.style.zIndex = THIS.pickerZIndex; p.boxB.style.border = THIS.pickerBorder+'px solid'; p.boxB.style.borderColor = THIS.pickerBorderColor; p.boxB.style.background = THIS.pickerFaceColor; // pad image p.pad.style.width = jscolor.images.pad[0]+'px'; p.pad.style.height = jscolor.images.pad[1]+'px'; // pad border p.padB.style.position = 'absolute'; p.padB.style.left = THIS.pickerFace+'px'; p.padB.style.top = THIS.pickerFace+'px'; p.padB.style.border = THIS.pickerInset+'px solid'; p.padB.style.borderColor = THIS.pickerInsetColor; // pad mouse area p.padM.style.position = 'absolute'; p.padM.style.left = '0'; p.padM.style.top = '0'; p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px'; p.padM.style.height = p.box.style.height; p.padM.style.cursor = 'crosshair'; // slider image p.sld.style.overflow = 'hidden'; p.sld.style.width = jscolor.images.sld[0]+'px'; p.sld.style.height = jscolor.images.sld[1]+'px'; // slider border p.sldB.style.display = THIS.slider ? 'block' : 'none'; p.sldB.style.position = 'absolute'; p.sldB.style.right = THIS.pickerFace+'px'; p.sldB.style.top = THIS.pickerFace+'px'; p.sldB.style.border = THIS.pickerInset+'px solid'; p.sldB.style.borderColor = THIS.pickerInsetColor; // slider mouse area p.sldM.style.display = THIS.slider ? 'block' : 'none'; p.sldM.style.position = 'absolute'; p.sldM.style.right = '0'; p.sldM.style.top = '0'; p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px'; p.sldM.style.height = p.box.style.height; try { p.sldM.style.cursor = 'pointer'; } catch(eOldIE) { p.sldM.style.cursor = 'hand'; } // "close" button function setBtnBorder() { var insetColors = THIS.pickerInsetColor.split(/\s+/); var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1]; p.btn.style.borderColor = pickerOutsetColor; } p.btn.style.display = THIS.pickerClosable ? 'block' : 'none'; p.btn.style.position = 'absolute'; p.btn.style.left = THIS.pickerFace + 'px'; p.btn.style.bottom = THIS.pickerFace + 'px'; p.btn.style.padding = '0 15px'; p.btn.style.height = '18px'; p.btn.style.border = THIS.pickerInset + 'px solid'; setBtnBorder(); p.btn.style.color = THIS.pickerButtonColor; p.btn.style.font = '12px sans-serif'; p.btn.style.textAlign = 'center'; try { p.btn.style.cursor = 'pointer'; } catch(eOldIE) { p.btn.style.cursor = 'hand'; } p.btn.onmousedown = function () { THIS.hidePicker(); }; p.btnS.style.lineHeight = p.btn.style.height; // load images in optimal order switch(modeID) { case 0: var padImg = 'hs.png'; break; case 1: var padImg = 'hv.png'; break; } p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')"; p.padM.style.backgroundRepeat = "no-repeat"; p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')"; p.sldM.style.backgroundRepeat = "no-repeat"; p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')"; p.pad.style.backgroundRepeat = "no-repeat"; p.pad.style.backgroundPosition = "0 0"; // place pointers redrawPad(); redrawSld(); jscolor.picker.owner = THIS; document.getElementsByTagName('body')[0].appendChild(p.boxB); } function getPickerDims(o) { var dims = [ 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] + (o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0), o.pickerClosable ? 4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight : 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1] ]; return dims; } function redrawPad() { // redraw the pad pointer switch(modeID) { case 0: var yComponent = 1; break; case 1: var yComponent = 2; break; } var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1)); var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1)); jscolor.picker.padM.style.backgroundPosition = (THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px'; // redraw the slider image var seg = jscolor.picker.sld.childNodes; switch(modeID) { case 0: var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1); for(var i=0; i<seg.length; i+=1) { seg[i].style.backgroundColor = 'rgb('+ (rgb[0]*(1-i/seg.length)*100)+'%,'+ (rgb[1]*(1-i/seg.length)*100)+'%,'+ (rgb[2]*(1-i/seg.length)*100)+'%)'; } break; case 1: var rgb, s, c = [ THIS.hsv[2], 0, 0 ]; var i = Math.floor(THIS.hsv[0]); var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i); switch(i) { case 6: case 0: rgb=[0,1,2]; break; case 1: rgb=[1,0,2]; break; case 2: rgb=[2,0,1]; break; case 3: rgb=[2,1,0]; break; case 4: rgb=[1,2,0]; break; case 5: rgb=[0,2,1]; break; } for(var i=0; i<seg.length; i+=1) { s = 1 - 1/(seg.length-1)*i; c[1] = c[0] * (1 - s*f); c[2] = c[0] * (1 - s); seg[i].style.backgroundColor = 'rgb('+ (c[rgb[0]]*100)+'%,'+ (c[rgb[1]]*100)+'%,'+ (c[rgb[2]]*100)+'%)'; } break; } } function redrawSld() { // redraw the slider pointer switch(modeID) { case 0: var yComponent = 2; break; case 1: var yComponent = 1; break; } var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1)); jscolor.picker.sldM.style.backgroundPosition = '0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px'; } function isPickerOwner() { return jscolor.picker && jscolor.picker.owner === THIS; } function blurTarget() { if(valueElement === target) { THIS.importColor(); } if(THIS.pickerOnfocus) { THIS.hidePicker(); } } function blurValue() { if(valueElement !== target) { THIS.importColor(); } } function setPad(e) { var mpos = jscolor.getRelMousePos(e); var x = mpos.x - THIS.pickerFace - THIS.pickerInset; var y = mpos.y - THIS.pickerFace - THIS.pickerInset; switch(modeID) { case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break; case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break; } } function setSld(e) { var mpos = jscolor.getRelMousePos(e); var y = mpos.y - THIS.pickerFace - THIS.pickerInset; switch(modeID) { case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break; case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break; } } function dispatchImmediateChange() { if (THIS.onImmediateChange) { var callback; if (typeof THIS.onImmediateChange === 'string') { callback = new Function (THIS.onImmediateChange); } else { callback = THIS.onImmediateChange; } callback.call(THIS); } } var THIS = this; var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0; var abortBlur = false; var valueElement = jscolor.fetchElement(this.valueElement), styleElement = jscolor.fetchElement(this.styleElement); var holdPad = false, holdSld = false, touchOffset = {}; var leaveValue = 1<<0, leaveStyle = 1<<1, leavePad = 1<<2, leaveSld = 1<<3; // target jscolor.addEvent(target, 'focus', function() { if(THIS.pickerOnfocus) { THIS.showPicker(); } }); jscolor.addEvent(target, 'blur', function() { if(!abortBlur) { window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0); } else { abortBlur = false; } }); // valueElement if(valueElement) { var updateField = function() { THIS.fromString(valueElement.value, leaveValue); dispatchImmediateChange(); }; jscolor.addEvent(valueElement, 'keyup', updateField); jscolor.addEvent(valueElement, 'input', updateField); jscolor.addEvent(valueElement, 'blur', blurValue); valueElement.setAttribute('autocomplete', 'off'); } // styleElement if(styleElement) { styleElement.jscStyle = { backgroundImage : styleElement.style.backgroundImage, backgroundColor : styleElement.style.backgroundColor, color : styleElement.style.color }; } // require images switch(modeID) { case 0: jscolor.requireImage('hs.png'); break; case 1: jscolor.requireImage('hv.png'); break; } jscolor.requireImage('cross.gif'); jscolor.requireImage('arrow.gif'); this.importColor(); } }; jscolor.install();
const config = { siteTitle: "Morangcode", // Site title. siteTitleShort: "Morangcode", // Short site title for homescreen (PWA). Preferably should be under 12 characters to prevent truncation. siteTitleAlt: "Brian Morang'a", // Alternative site title for SEO. siteLogo: "/logos/logo-1024.png", // Logo used for SEO and manifest. siteUrl: "https://morangcode.com", // Domain of your website without pathPrefix. pathPrefix: "", // Prefixes all links. For cases when deployed to example.github.io/gatsby-advanced-starter/. siteDescription: "Weekly blogs on algorithms, system design, DevOps, data structures, and developer's journey to becoming a worldclass backend developer", // Website description used for RSS feeds/meta description tag. siteRss: "/rss.xml", // Path to the RSS file. siteFBAppID: "", // FB Application ID for using app insights dateFromFormat: "YYYY-MM-DD", // Date format used in the frontmatter. dateFormat: "DD/MM/YYYY", // Date format for display. userName: "Brian Morang'a", // Username to display in the author segment. userEmail: "brian@morangcode.com", // Email used for RSS feed's author segment userLocation: "North Pole, Earth", // User location to display in the author segment. copyright: "© 2021. Brian Morang'a.", // Copyright string for the footer of the website and RSS feed. themeColor: "#071E3D", // Used for setting manifest and progress theme colors. backgroundColor: "#071E3D", // Used for setting manifest background color. }; // Validate // Make sure pathPrefix is empty if not needed if (config.pathPrefix === "/") { config.pathPrefix = ""; } else { // Make sure pathPrefix only contains the first forward slash config.pathPrefix = `/${config.pathPrefix.replace(/^\/|\/$/g, "")}`; } // Make sure siteUrl doesn't have an ending forward slash if (config.siteUrl.substr(-1) === "/") config.siteUrl = config.siteUrl.slice(0, -1); // Make sure siteRss has a starting forward slash // if (config.siteRss && config.siteRss[0] !== "/") // config.siteRss = `/${config.siteRss}`; module.exports = config;
import React from "react"; import "./Header.css"; import punkLogo from "../assets/header/cryptopunk-logo.png"; import searchIcon from "../assets/header/search.png"; import themeSwitchIcon from "../assets/header/theme-switch.png"; const Header = () => { return ( <div className="header"> <div className="logoContainer"> <img src={punkLogo} className="punkLogo" alt="Crypto Punk Logo" /> </div> <div className="searchBar"> <div className="searchIconContainer"> <img src={searchIcon} className="searchIcon" alt="" /> </div> <input type="text" className="searchInput" placeholder="Collection, Item, or User..." /> </div> <div className="headerItems"> <a href="."> <p>Drops</p> </a> <a href="."> <p>Marketplace</p> </a> <a href="."> <p>Create</p> </a> </div> <div className="headerActions"> <div className="themeSwitchContainer"> <img src={themeSwitchIcon} alt="Switch Theme" /> </div> </div> <div className="loginButton">GET IN</div> </div> ); }; export default Header;
import {html, PolymerElement} from '@polymer/polymer/polymer-element.js'; /** * `bar-chart` * A barchart visualisation * * @customElement * @polymer * @demo demo/index.html */ class BarChart extends PolymerElement { static get template() { return html` <style> :host { display: block; } </style> <h2>Hello [[prop1]]!</h2> `; } static get properties() { return { prop1: { type: String, value: 'bar-chart', }, }; } } window.customElements.define('bar-chart', BarChart);
var summarizeTopLevel = require('./summarizeTopLevel') var formatSequence = require('sequence-formatter') var uriToMeta = require('../uriToMeta') var URI = require('sboljs').URI var Sequence = require('sboljs/lib/Sequence') function summarizeSequence (sequence, req, sbol, remote, graphUri) { if (sequence instanceof URI) { return uriToMeta(sequence) } if (!(sequence instanceof Sequence)) { return uriToMeta(sequence.uri) } var encodingUri = sequence.encoding + '' var encoding = mapEncoding(encodingUri) || encodingUri var elements = sequence.elements var summary = { type: encoding, length: sequence.elements.length, lengthUnits: lengthUnits(encoding), encoding: sequence.encoding.toString(), elements: elements, formatted: formatSequence(elements), blastUrl: encoding === 'http://www.chem.qmul.ac.uk/iupac/AminoAcid/' ? 'http://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastp&PAGE_TYPE=BlastSearch&LINK_LOC=blasthome' : 'http://blast.ncbi.nlm.nih.gov/Blast.cgi?PROGRAM=blastn&PAGE_TYPE=BlastSearch&LINK_LOC=blasthome' } return Object.assign(summary, summarizeTopLevel(sequence, req, sbol, remote, graphUri)) } function mapEncoding (encoding) { return ({ 'http://www.chem.qmul.ac.uk/iupac/AminoAcid/': 'AminoAcid', 'http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html': 'NucleicAcid', 'http://dx.doi.org/10.1021/bi00822a023': 'NucleicAcid' })[encoding] } function lengthUnits (encoding) { return ({ 'AminoAcid': 'aa', 'NucleicAcid': 'bp' })[encoding] } module.exports = summarizeSequence
import {defaults, forOwn, includes, isEmpty, map, mapValues, omit, omitBy, snakeCase, values} from 'lodash'; import Promise from './Promise.js'; import promiseWrap from 'promise-chains'; import util from 'util'; import * as requestHandler from './request_handler.js'; import {HTTP_VERBS, KINDS, MAX_LISTING_ITEMS, MODULE_NAME, USER_KEYS, SUBREDDIT_KEYS, VERSION} from './constants.js'; import * as errors from './errors.js'; import { addEmptyRepliesListing, addFullnamePrefix, addSnakeCaseShadowProps, defineInspectFunc, handleJsonErrors, isBrowser, requiredArg } from './helpers.js'; import createConfig from './create_config.js'; import * as objects from './objects/index.js'; const api_type = 'json'; /** The class for a snoowrap requester. * A requester is the base object that is used to fetch content from reddit. Each requester contains a single set of OAuth tokens. If constructed with a refresh token, a requester will be able to repeatedly generate access tokens as necessary, without any further user intervention. After making at least one request, a requester will have the `access_token` property, which specifies the access token currently in use. It will also have a few additional properties such as `scope` (an array of scope strings) and `ratelimitRemaining` (the number of requests remaining for the current 10-minute interval, in compliance with reddit's [API rules](https://github.com/reddit/reddit/wiki/API).) These properties primarily exist for internal use, but they are exposed since they are useful externally as well. */ const snoowrap = class snoowrap { /** * @summary Constructs a new requester. * @desc You should use the snoowrap constructor if you are able to authorize a reddit account in advance (e.g. for a Node.js script that always uses the same account). If you aren't able to authorize in advance (e.g. acting through an arbitrary user's account while running snoowrap in a browser), then you should use {@link snoowrap.getAuthUrl} and {@link snoowrap.fromAuthCode} instead. * * To edit snoowrap specific settings, see {@link snoowrap#config}. * * snoowrap supports several different options for pre-existing authentication: * 1. *Refresh token*: To authenticate with a refresh token, pass an object with the properties `userAgent`, `clientId`, `clientSecret`, and `refreshToken` to the snoowrap constructor. You will need to get the refresh token from reddit beforehand. A script to automatically generate refresh tokens for you can be found [here](https://github.com/not-an-aardvark/reddit-oauth-helper). * 1. *Username/password*: To authenticate with a username and password, pass an object with the properties `userAgent`, `clientId`, `clientSecret`, `username`, and `password` to the snoowrap constructor. Note that username/password authentication is only possible for `script`-type apps. * 1. *Access token*: To authenticate with an access token, pass an object with the properties `userAgent` and `accessToken` to the snoowrap constructor. Note that all access tokens expire one hour after being generated, so this method is not recommended for long-term use. * @param {object} options An object containing authentication options. This should always have the property `userAgent`. It must also contain some combination of credentials (see above) * @param {string} options.userAgent A unique description of what your app does. This argument is not necessary when snoowrap is running in a browser. * @param {string} [options.clientId] The client ID of your app (assigned by reddit) * @param {string} [options.clientSecret] The client secret of your app (assigned by reddit). If you are using a refresh token with an installed app (which does not have a client secret), pass an empty string as your `clientSecret`. * @param {string} [options.username] The username of the account to access * @param {string} [options.password] The password of the account to access * @param {string} [options.refreshToken] A refresh token for your app * @param {string} [options.accessToken] An access token for your app */ constructor ({ // The function signature for the constructor is a bit large due to the snake_case aliases. Essentially, it accepts an // object with properties {userAgent, clientId, clientSecret, refreshToken, accessToken, username, password}. // Additionally, if snake_case properties are provided and camelCase properties are not (e.g. `user_agent` is provided but // `userAgent` is not), then the `userAgent` identifier gets set to the provided `user_agent` property. This is needed for // backwards compatibility; snoowrap previously only accepted snake_case props, but now it also accepts camelCase props. user_agent, userAgent = user_agent, client_id, clientId = client_id, client_secret, clientSecret = client_secret, refresh_token, refreshToken = refresh_token, access_token, accessToken = access_token, username, password } = {}) { if (!userAgent && !isBrowser) { return requiredArg('userAgent'); } if ((!accessToken || typeof accessToken !== 'string') && (clientId === undefined || clientSecret === undefined || typeof refreshToken !== 'string') && (clientId === undefined || clientSecret === undefined || username === undefined || password === undefined) ) { throw new errors.NoCredentialsError(); } if (isBrowser) { this.userAgent = global.navigator.userAgent; } defaults(this, {userAgent, clientId, clientSecret, refreshToken, accessToken, username, password}, { clientId: null, clientSecret: null, refreshToken: null, accessToken: null, username: null, password: null, ratelimitRemaining: null, ratelimitExpiration: null, tokenExpiration: null, scope: null, _config: createConfig(), _nextRequestTimestamp: -Infinity }); addSnakeCaseShadowProps(this); } /** * @summary Gets an authorization URL, which allows a user to authorize access to their account * @desc This create a URL where a user can authorize an app to act through their account. If the user visits the returned URL in a web browser, they will see a page that looks like [this](https://i.gyazo.com/0325534f38b78c1dbd4c84d690dda6c2.png). If the user clicks "Allow", they will be redirected to your `redirectUri`, with a `code` querystring parameter containing an * *authorization code*. If this code is passed to {@link snoowrap.fromAuthCode}, you can create a requester to make requests on behalf of the user. * * The main use-case here is for running snoowrap in a browser. You can generate a URL, send the user there, and then continue after the user authenticates on reddit and is redirected back. * * @param {object} options * @param {string} options.clientId The client ID of your app (assigned by reddit). If your code is running clientside in a browser, using an "Installed" app type is recommended. * @param {string[]} options.scope An array of scopes (permissions on the user's account) to request on the authentication page. A list of possible scopes can be found [here](https://www.reddit.com/api/v1/scopes). You can also get them on-the-fly with {@link snoowrap#getOauthScopeList}. * @param {string} options.redirectUri The URL where the user should be redirected after authenticating. This **must** be the same as the redirect URI that is configured for the reddit app. (If there is a mismatch, the returned URL will display an error page instead of an authentication form.) * @param {boolean} [options.permanent=true] If `true`, the app will have indefinite access to the user's account. If `false`, access to the user's account will expire after 1 hour. * @param {string} [options.state] A string that can be used to verify a user after they are redirected back to the site. When the user is redirected from reddit, to the redirect URI after authenticating, the resulting URI will have this same `state` value in the querystring. (See [here](http://www.twobotechnologies.com/blog/2014/02/importance-of-state-in-oauth2.html) for more information on how to use the `state` value.) * @param {string} [options.endpointDomain='reddit.com'] The endpoint domain for the URL. If the user is authenticating on reddit.com (as opposed to some other site with a reddit-like API), you can omit this value. * @returns {string} A URL where the user can authenticate with the given options * @example * * var authenticationUrl = snoowrap.getAuthUrl({ * clientId: 'foobarbazquuux', * scope: ['identity', 'wikiread', 'wikiedit'], * redirectUri: 'https://example.com/reddit_callback', * permanent: false, * state: 'fe211bebc52eb3da9bef8db6e63104d3' // a random string, this could be validated when the user is redirected back * }); * // --> 'https://www.reddit.com/api/v1/authorize?client_id=foobarbaz&response_type=code&state= ...' * * window.location.href = authenticationUrl; // send the user to the authentication url */ static getAuthUrl ({ clientId = requiredArg('clientId'), scope = requiredArg('scope'), redirectUri = requiredArg('redirectUri'), permanent = true, state = '_', endpointDomain = 'reddit.com' }) { if (!(Array.isArray(scope) && scope.length && scope.every(scopeValue => scopeValue && typeof scopeValue === 'string'))) { throw new TypeError('Missing `scope` argument; a non-empty list of OAuth scopes must be provided'); } return ` https://www.${endpointDomain}/api/v1/authorize? client_id=${encodeURIComponent(clientId)} &response_type=code &state=${encodeURIComponent(state)} &redirect_uri=${encodeURIComponent(redirectUri)} &duration=${permanent ? 'permanent' : 'temporary'} &scope=${encodeURIComponent(scope.join(' '))} `.replace(/\s/g, ''); } /** * @summary Creates a snoowrap requester from an authorization code. * @desc An authorization code is the `code` value that appears in the querystring after a user authenticates with reddit and is redirected. For more information, see {@link snoowrap.getAuthUrl}. * * The main use-case for this function is for running snoowrap in a browser. You can generate a URL with {@link snoowrap.getAuthUrl} and send the user to that URL, and then use this function to create a requester when the user is redirected back with an authorization code. * @param {object} options * @param {string} options.code The authorization code * @param {string} options.userAgent A unique description of what your app does. This argument is not necessary when snoowrap is running in a browser. * @param {string} options.clientId The client ID of your app (assigned by reddit). If your code is running clientside in a browser, using an "Installed" app type is recommended. * @param {string} [options.clientSecret] The client secret of your app. If your app has the "Installed" app type, omit this parameter. * @param {string} options.redirectUri The redirect URI that is configured for the reddit app. * @param {string} [options.endpointDomain='reddit.com'] The endpoint domain that the returned requester should be configured to use. If the user is authenticating on reddit.com (as opposed to some other site with a reddit-like API), you can omit this value. * @returns {Promise<snoowrap>} A Promise that fulfills with a `snoowrap` instance * @example * * // Get the `code` querystring param (assuming the user was redirected from reddit) * var code = new URL(window.location.href).searchParams.get('code'); * * snoowrap.fromAuthCode({ * code: code, * userAgent: 'My app', * clientId: 'foobarbazquuux', * redirectUri: 'example.com' * }).then(r => { * // Now we have a requester that can access reddit through the user's account * return r.getHot().then(posts => { * // do something with posts from the front page * }); * }) */ static fromAuthCode ({ code = requiredArg('code'), userAgent = isBrowser ? global.navigator.userAgent : requiredArg('userAgent'), clientId = requiredArg('clientId'), clientSecret, redirectUri = requiredArg('redirectUri'), endpointDomain = 'reddit.com' }) { return this.prototype.credentialedClientRequest.call({ userAgent, clientId, clientSecret, // Use `this.prototype.rawRequest` function to allow for custom `rawRequest` method usage in subclasses. rawRequest: this.prototype.rawRequest }, { method: 'post', baseUrl: `https://www.${endpointDomain}/`, uri: 'api/v1/access_token', form: {grant_type: 'authorization_code', code, redirect_uri: redirectUri} }).then(response => { if (response.error) { throw new errors.RequestError(`API Error: ${response.error} - ${response.error_description}`); } // Use `new this` instead of `new snoowrap` to ensure that subclass instances can be returned const requester = new this({userAgent, clientId, clientSecret, ...response}); requester.config({endpointDomain}); return requester; }); } /** * @summary Returns the grant types available for app-only authentication * @desc Per the Reddit API OAuth docs, there are two different grant types depending on whether the app is an installed client * or a confidential client such as a web app or string. This getter returns the possible values for the "grant_type" field * in application-only auth. * @returns {object} The enumeration of possible grant_type values */ static get grantType () { return { CLIENT_CREDENTIALS: 'client_credentials', INSTALLED_CLIENT: 'https://oauth.reddit.com/grants/installed_client' }; } /** * @summary Creates a snoowrap requester from a "user-less" Authorization token * @desc In some cases, 3rd party app clients may wish to make API requests without a user context. App clients can request * a "user-less" Authorization token via either the standard client_credentials grant, or the reddit specific * extension to this grant, https://oauth.reddit.com/grants/installed_client. Which grant type an app uses depends on * the app-type and its use case. * @param {object} options * @param {string} options.userAgent A unique description of what your app does. This argument is not necessary when snoowrap is running in a browser. * @param {string} options.clientId The client ID of your app (assigned by reddit). If your code is running clientside in a * browser, using an "Installed" app type is recommended. * @param {string} [options.clientSecret] The client secret of your app. Only required for "client_credentials" grant type. * @param {string} [options.deviceId] A unique, per-device ID generated by your client. Only required * for "Installed" grant type, needs to be between 20-30 characters long. From the reddit docs: "reddit *may* choose to use * this ID to generate aggregate data about user counts. Clients that wish to remain anonymous should use the value * DO_NOT_TRACK_THIS_DEVICE." * @param {string} [options.grantType=snoowrap.grantType.INSTALLED_CLIENT] The type of "user-less" * token to use {@link snoowrap.grantType} * @param {boolean} [options.permanent=true] If `true`, the app will have indefinite access. If `false`, access will expire after 1 hour. * @param {string} [options.endpointDomain='reddit.com'] The endpoint domain that the returned requester should be configured to use. If the user is authenticating on reddit.com (as opposed to some other site with a reddit-like API), you can omit this value. * @returns {Promise<snoowrap>} A Promise that fulfills with a `snoowrap` instance * @example * * snoowrap.fromApplicationOnlyAuth({ * userAgent: 'My app', * clientId: 'foobarbazquuux', * deviceId: 'unique id between 20-30 chars', * grantType: snoowrap.grantType.INSTALLED_CLIENT * }).then(r => { * // Now we have a requester that can access reddit through a "user-less" Auth token * return r.getHot().then(posts => { * // do something with posts from the front page * }); * }) * * snoowrap.fromApplicationOnlyAuth({ * userAgent: 'My app', * clientId: 'foobarbazquuux', * clientSecret: 'your web app secret', * grantType: snoowrap.grantType.CLIENT_CREDENTIALS * }).then(r => { * // Now we have a requester that can access reddit through a "user-less" Auth token * return r.getHot().then(posts => { * // do something with posts from the front page * }); * }) */ static fromApplicationOnlyAuth ({ userAgent = isBrowser ? global.navigator.userAgent : requiredArg('userAgent'), clientId = requiredArg('clientId'), clientSecret, deviceId, grantType = snoowrap.grantType.INSTALLED_CLIENT, permanent = true, endpointDomain = 'reddit.com' }) { return this.prototype.credentialedClientRequest.call({ clientId, clientSecret, // Use `this.prototype.rawRequest` function to allow for custom `rawRequest` method usage in subclasses. rawRequest: this.prototype.rawRequest }, { method: 'post', baseUrl: `https://www.${endpointDomain}/`, uri: 'api/v1/access_token', form: {grant_type: grantType, device_id: deviceId, duration: permanent ? 'permanent' : 'temporary'} }).then(response => { if (response.error) { throw new errors.RequestError(`API Error: ${response.error} - ${response.error_description}`); } // Use `new this` instead of `new snoowrap` to ensure that subclass instances can be returned const requester = new this({userAgent, clientId, clientSecret, ...response}); requester.config({endpointDomain}); return requester; }); } _newObject (objectType, content, _hasFetched = false) { return Array.isArray(content) ? content : new snoowrap.objects[objectType](content, this, _hasFetched); } /** * @summary Retrieves or modifies the configuration options for this snoowrap instance. * @param {object} [options] A map of `{[config property name]: value}`. Note that any omitted config properties will simply retain whatever value they had previously. (In other words, if you only want to change one property, you only need to put that one property in this parameter. To get the current configuration without modifying anything, simply omit this parameter.) * @param {string} [options.endpointDomain='reddit.com'] The endpoint where requests should be sent * @param {Number} [options.requestDelay=0] A minimum delay, in milliseconds, to enforce between API calls. If multiple api calls are requested during this timespan, they will be queued and sent one at a time. Setting this to more than 1000 will ensure that reddit's ratelimit is never reached, but it will make things run slower than necessary if only a few requests are being sent. If this is set to zero, snoowrap will not enforce any delay between individual requests. However, it will still refuse to continue if reddit's enforced ratelimit (600 requests per 10 minutes) is exceeded. * @param {Number} [options.requestTimeout=30000] A timeout for all OAuth requests, in milliseconds. If the reddit server fails to return a response within this amount of time, the Promise will be rejected with a timeout error. * @param {boolean} [options.continueAfterRatelimitError=false] Determines whether snoowrap should queue API calls if reddit's ratelimit is exceeded. If set to `true` when the ratelimit is exceeded, snoowrap will queue all further requests, and will attempt to send them again after the current ratelimit period expires (which happens every 10 minutes). If set to `false`, snoowrap will simply throw an error when reddit's ratelimit is exceeded. * @param {Number[]} [options.retryErrorCodes=[502, 503, 504, 522]] If reddit responds to an idempotent request with one of these error codes, snoowrap will retry the request, up to a maximum of `max_retry_attempts` requests in total. (These errors usually indicate that there was an temporary issue on reddit's end, and retrying the request has a decent chance of success.) This behavior can be disabled by simply setting this property to an empty array. * @param {Number} [options.maxRetryAttempts=3] See `retryErrorCodes`. * @param {boolean} [options.warnings=true] snoowrap may occasionally log warnings, such as deprecation notices, to the console. These can be disabled by setting this to `false`. * @param {boolean} [options.debug=false] If set to true, snoowrap will print out potentially-useful information for debugging purposes as it runs. * @param {boolean} [options.proxies=true] Setting this to `false` disables snoowrap's method-chaining feature. This causes the syntax for using snoowrap to become a bit heavier, but allows for consistency between environments that support the ES6 `Proxy` object and environments that don't. This option is a no-op in environments that don't support the `Proxy` object, since method chaining is always disabled in those environments. Note, changing this setting must be done before making any requests. * @returns {object} An updated Object containing all of the configuration values * @example * * r.config({requestDelay: 1000, warnings: false}); * // sets the request delay to 1000 milliseconds, and suppresses warnings. */ config (options = {}) { const invalidKey = Object.keys(options).find(key => !(key in this._config)); if (invalidKey) { throw new TypeError(`Invalid config option '${invalidKey}'`); } return Object.assign(this._config, options); } _warn (...args) { if (this._config.warnings) { console.warn('[warning]', ...args); // eslint-disable-line no-console } } _debug (...args) { if (this._config.debug) { console.log('[debug]', ...args); // eslint-disable-line no-console } } get _promiseWrap () { return this._config.proxies ? promiseWrap : identity; } /** * @summary Gets information on a reddit user with a given name. * @param {string} name - The user's username * @returns {RedditUser} An unfetched RedditUser object for the requested user * @example * * r.getUser('not_an_aardvark') * // => RedditUser { name: 'not_an_aardvark' } * r.getUser('not_an_aardvark').link_karma.then(console.log) * // => 6 */ getUser (name) { return this._newObject('RedditUser', {name: (name + '').replace(/^\/?u\//, '')}); } /** * @summary Gets information on a comment with a given id. * @param {string} commentId - The base36 id of the comment * @returns {Comment} An unfetched Comment object for the requested comment * @example * * r.getComment('c0b6xx0') * // => Comment { name: 't1_c0b6xx0' } * r.getComment('c0b6xx0').author.name.then(console.log) * // => 'Kharos' */ getComment (commentId) { return this._newObject('Comment', {name: addFullnamePrefix(commentId, 't1_')}); } /** * @summary Gets information on a given subreddit. * @param {string} displayName - The name of the subreddit (e.g. 'AskReddit') * @returns {Subreddit} An unfetched Subreddit object for the requested subreddit * @example * * r.getSubreddit('AskReddit') * // => Subreddit { display_name: 'AskReddit' } * r.getSubreddit('AskReddit').created_utc.then(console.log) * // => 1201233135 */ getSubreddit (displayName) { return this._newObject('Subreddit', {display_name: displayName.replace(/^\/?r\//, '')}); } /** * @summary Gets information on a given submission. * @param {string} submissionId - The base36 id of the submission * @returns {Submission} An unfetched Submission object for the requested submission * @example * * r.getSubmission('2np694') * // => Submission { name: 't3_2np694' } * r.getSubmission('2np694').title.then(console.log) * // => 'What tasty food would be distusting if eaten over rice?' */ getSubmission (submissionId) { return this._newObject('Submission', {name: addFullnamePrefix(submissionId, 't3_')}); } /** * @summary Gets a private message by ID. * @param {string} messageId The base36 ID of the message * @returns {PrivateMessage} An unfetched PrivateMessage object for the requested message * @example * * r.getMessage('51shnw') * // => PrivateMessage { name: 't4_51shnw' } * r.getMessage('51shnw').subject.then(console.log) * // => 'Example' * // See here for a screenshot of the PM in question https://i.gyazo.com/24f3b97e55b6ff8e3a74cb026a58b167.png */ getMessage (messageId) { return this._newObject('PrivateMessage', {name: addFullnamePrefix(messageId, 't4_')}); } /** * Gets a livethread by ID. * @param {string} threadId The base36 ID of the livethread * @returns {LiveThread} An unfetched LiveThread object * @example * * r.getLivethread('whrdxo8dg9n0') * // => LiveThread { id: 'whrdxo8dg9n0' } * r.getLivethread('whrdxo8dg9n0').nsfw.then(console.log) * // => false */ getLivethread (threadId) { return this._newObject('LiveThread', {id: addFullnamePrefix(threadId, 'LiveUpdateEvent_').slice(16)}); } /** * @summary Gets information on the requester's own user profile. * @returns {RedditUser} A RedditUser object corresponding to the requester's profile * @example * * r.getMe().then(console.log); * // => RedditUser { is_employee: false, has_mail: false, name: 'snoowrap_testing', ... } */ getMe () { return this._get({uri: 'api/v1/me'}).then(result => { this._ownUserInfo = this._newObject('RedditUser', result, true); return this._ownUserInfo; }); } _getMyName () { return Promise.resolve(this._ownUserInfo ? this._ownUserInfo.name : this.getMe().get('name')); } /** * @summary Gets a distribution of the requester's own karma distribution by subreddit. * @returns {Promise} A Promise for an object with karma information * @example * * r.getKarma().then(console.log) * // => [ * // { sr: Subreddit { display_name: 'redditdev' }, comment_karma: 16, link_karma: 1 }, * // { sr: Subreddit { display_name: 'programming' }, comment_karma: 2, link_karma: 1 }, * // ... * // ] */ getKarma () { return this._get({uri: 'api/v1/me/karma'}); } /** * @summary Gets information on the user's current preferences. * @returns {Promise} A promise for an object containing the user's current preferences * @example * * r.getPreferences().then(console.log) * // => { default_theme_sr: null, threaded_messages: true, hide_downs: false, ... } */ getPreferences () { return this._get({uri: 'api/v1/me/prefs'}); } /** * @summary Updates the user's current preferences. * @param {object} updatedPreferences An object of the form {[some preference name]: 'some value', ...}. Any preference * not included in this object will simply retain its current value. * @returns {Promise} A Promise that fulfills when the request is complete * @example * * r.updatePreferences({threaded_messages: false, hide_downs: true}) * // => { default_theme_sr: null, threaded_messages: false,hide_downs: true, ... } * // (preferences updated on reddit) */ updatePreferences (updatedPreferences) { return this._patch({uri: 'api/v1/me/prefs', body: updatedPreferences}); } /** * @summary Gets the currently-authenticated user's trophies. * @returns {Promise} A TrophyList containing the user's trophies * @example * * r.getMyTrophies().then(console.log) * // => TrophyList { trophies: [ * // Trophy { icon_70: 'https://s3.amazonaws.com/redditstatic/award/verified_email-70.png', * // description: null, * // url: null, * // icon_40: 'https://s3.amazonaws.com/redditstatic/award/verified_email-40.png', * // award_id: 'o', * // id: '16fn29', * // name: 'Verified Email' * // } * // ] } */ getMyTrophies () { return this._get({uri: 'api/v1/me/trophies'}); } /** * @summary Gets the list of the currently-authenticated user's friends. * @returns {Promise} A Promise that resolves with a list of friends * @example * * r.getFriends().then(console.log) * // => [ [ RedditUser { date: 1457927963, name: 'not_an_aardvark', id: 't2_k83md' } ], [] ] */ getFriends () { return this._get({uri: 'prefs/friends'}); } /** * @summary Gets the list of people that the currently-authenticated user has blocked. * @returns {Promise} A Promise that resolves with a list of blocked users * @example * * r.getBlockedUsers().then(console.log) * // => [ RedditUser { date: 1457928120, name: 'actually_an_aardvark', id: 't2_q3519' } ] */ getBlockedUsers () { return this._get({uri: 'prefs/blocked'}); } /** * @summary Determines whether the currently-authenticated user needs to fill out a captcha in order to submit content. * @returns {Promise} A Promise that resolves with a boolean value * @example * * r.checkCaptchaRequirement().then(console.log) * // => false */ checkCaptchaRequirement () { return this._get({uri: 'api/needs_captcha'}); } /** * @summary Gets the identifier (a hex string) for a new captcha image. * @returns {Promise} A Promise that resolves with a string * @example * * r.getNewCaptchaIdentifier().then(console.log) * // => 'o5M18uy4mk0IW4hs0fu2GNPdXb1Dxe9d' */ getNewCaptchaIdentifier () { return this._post({uri: 'api/new_captcha', form: {api_type}}).then(res => res.json.data.iden); } /** * @summary Gets an image for a given captcha identifier. * @param {string} identifier The captcha identifier. * @returns {Promise} A string containing raw image data in PNG format * @example * * r.getCaptchaImage('o5M18uy4mk0IW4hs0fu2GNPdXb1Dxe9d').then(console.log) // => (A long, incoherent string representing the image in PNG format) */ getCaptchaImage (identifier) { return this._get({uri: `captcha/${identifier}`}); } /** * @summary Gets an array of categories that items can be saved in. (Requires reddit gold) * @returns {Promise} An array of categories * @example * * r.getSavedCategories().then(console.log) * // => [ { category: 'cute cat pictures' }, { category: 'interesting articles' } ] */ getSavedCategories () { return this._get({uri: 'api/saved_categories'}).get('categories'); } /** * @summary Marks a list of submissions as 'visited'. * @desc **Note**: This endpoint only works if the authenticated user is subscribed to reddit gold. * @param {Submission[]} links A list of Submission objects to mark * @returns {Promise} A Promise that fulfills when the request is complete * @example * * var submissions = [r.getSubmission('4a9u54'), r.getSubmission('4a95nb')] * r.markAsVisited(submissions) * // (the links will now appear purple on reddit) */ markAsVisited (links) { return this._post({uri: 'api/store_visits', links: map(links, 'name').join(',')}); } _submit ({ captcha_response, captchaResponse = captcha_response, captcha_iden, captchaIden = captcha_iden, kind, resubmit = true, send_replies = true, sendReplies = send_replies, crosspost_fullname, text, title, url, subreddit_name, subredditName = subreddit_name }) { return this._post({ uri: 'api/submit', form: { api_type, captcha: captchaResponse, iden: captchaIden, sendreplies: sendReplies, sr: subredditName, kind, resubmit, crosspost_fullname, text, title, url } }).tap(handleJsonErrors(this)).then(result => this.getSubmission(result.json.data.id)); } /** * @summary Creates a new selfpost on the given subreddit. * @param {object} options An object containing details about the submission * @param {string} options.subredditName The name of the subreddit that the post should be submitted to * @param {string} options.title The title of the submission * @param {string} [options.text] The selftext of the submission * @param {boolean} [options.sendReplies=true] Determines whether inbox replies should be enabled for this submission * @param {string} [options.captchaIden] A captcha identifier. This is only necessary if the authenticated account requires a captcha to submit posts and comments. * @param {string} [options.captchaResponse] The response to the captcha with the given identifier * @returns {Promise} The newly-created Submission object * @example * * r.submitSelfpost({ * subredditName: 'snoowrap_testing', * title: 'This is a selfpost', * text: 'This is the text body of the selfpost' * }).then(console.log) * // => Submission { name: 't3_4abmsz' } * // (new selfpost created on reddit) */ submitSelfpost (options) { return this._submit({...options, kind: 'self'}); } /** * @summary Creates a new link submission on the given subreddit. * @param {object} options An object containing details about the submission * @param {string} options.subredditName The name of the subreddit that the post should be submitted to * @param {string} options.title The title of the submission * @param {string} options.url The url that the link submission should point to * @param {boolean} [options.sendReplies=true] Determines whether inbox replies should be enabled for this submission * @param {boolean} [options.resubmit=true] If this is false and same link has already been submitted to this subreddit in the past, reddit will return an error. This could be used to avoid accidental reposts. * @param {string} [options.captchaIden] A captcha identifier. This is only necessary if the authenticated account requires a captcha to submit posts and comments. * @param {string} [options.captchaResponse] The response to the captcha with the given identifier * @returns {Promise} The newly-created Submission object * @example * * r.submitLink({ * subredditName: 'snoowrap_testing', * title: 'I found a cool website!', * url: 'https://google.com' * }).then(console.log) * // => Submission { name: 't3_4abnfe' } * // (new linkpost created on reddit) */ submitLink (options) { return this._submit({...options, kind: 'link'}); } /** * @summary Creates a new crosspost submission on the given subreddit * @desc **NOTE**: To create a crosspost, the authenticated account must be subscribed to the subreddit where * the crosspost is being submitted, and that subreddit be configured to allow crossposts. * @param {object} options An object containing details about the submission * @param {string} options.subredditName The name of the subreddit that the crosspost should be submitted to * @param {string} options.title The title of the crosspost * @param {(string|Submission)} options.originalPost A Submission object or a post ID for the original post which is being crossposted * @param {boolean} [options.sendReplies=true] Determines whether inbox replies should be enabled for this submission * @param {boolean} [options.resubmit=true] If this is false and same link has already been submitted to this subreddit in the past, reddit will return an error. This could be used to avoid accidental reposts. * @returns {Promise} The newly-created Submission object * @example * * await r.submitCrosspost({ title: 'I found an interesting post', originalPost: '6vths0', subredditName: 'snoowrap' }) */ submitCrosspost (options) { return this._submit({ ...options, kind: 'crosspost', crosspost_fullname: options.originalPost instanceof snoowrap.objects.Submission ? options.originalPost.name : addFullnamePrefix(options.originalPost, 't3_') }); } _getSortedFrontpage (sortType, subredditName, options = {}) { // Handle things properly if only a time parameter is provided but not the subreddit name let opts = options; let subName = subredditName; if (typeof subredditName === 'object' && isEmpty(omitBy(opts, option => option === undefined))) { /* In this case, "subredditName" ends up referring to the second argument, which is not actually a name since the user decided to omit that parameter. */ opts = subredditName; subName = undefined; } const parsedOptions = omit({...opts, t: opts.time || opts.t}, 'time'); return this._getListing({uri: (subName ? `r/${subName}/` : '') + sortType, qs: parsedOptions}); } /** * @summary Gets a Listing of hot posts. * @param {string} [subredditName] The subreddit to get posts from. If not provided, posts are fetched from the front page of reddit. * @param {object} [options={}] Options for the resulting Listing * @returns {Promise} A Listing containing the retrieved submissions * @example * * r.getHot().then(console.log) * // => Listing [ * // Submission { domain: 'imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'pics' }, ... }, * // Submission { domain: 'i.imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'funny' }, ... }, * // ... * // ] * * r.getHot('gifs').then(console.log) * // => Listing [ * // Submission { domain: 'i.imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'gifs' }, ... }, * // Submission { domain: 'i.imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'gifs' }, ... }, * // ... * // ] * * r.getHot('redditdev', {limit: 1}).then(console.log) * // => Listing [ // Submission { domain: 'self.redditdev', banned_by: null, subreddit: Subreddit { display_name: 'redditdev' }, ...} * // ] */ getHot (subredditName, options) { return this._getSortedFrontpage('hot', subredditName, options); } /** * @summary Gets a Listing of best posts. * @param {object} [options={}] Options for the resulting Listing * @returns {Promise<Listing>} A Listing containing the retrieved submissions * @example * * r.getBest().then(console.log) * // => Listing [ * // Submission { domain: 'imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'pics' }, ... }, * // Submission { domain: 'i.imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'funny' }, ... }, * // ... * // ] * * r.getBest({limit: 1}).then(console.log) * // => Listing [ // Submission { domain: 'self.redditdev', banned_by: null, subreddit: Subreddit { display_name: 'redditdev' }, ...} * // ] */ getBest (options) { return this._getSortedFrontpage('best', undefined, options); } /** * @summary Gets a Listing of new posts. * @param {string} [subredditName] The subreddit to get posts from. If not provided, posts are fetched from the front page of reddit. * @param {object} [options={}] Options for the resulting Listing * @returns {Promise} A Listing containing the retrieved submissions * @example * * r.getNew().then(console.log) * // => Listing [ * // Submission { domain: 'self.Jokes', banned_by: null, subreddit: Subreddit { display_name: 'Jokes' }, ... }, * // Submission { domain: 'self.AskReddit', banned_by: null, subreddit: Subreddit { display_name: 'AskReddit' }, ... }, * // ... * // ] * */ getNew (subredditName, options) { return this._getSortedFrontpage('new', subredditName, options); } /** * @summary Gets a Listing of new comments. * @param {string} [subredditName] The subreddit to get comments from. If not provided, posts are fetched from the front page of reddit. * @param {object} [options={}] Options for the resulting Listing * @returns {Promise} A Listing containing the retrieved comments * @example * * r.getNewComments().then(console.log) * // => Listing [ * // Comment { link_title: 'What amazing book should be made into a movie, but hasn\'t been yet?', ... } * // Comment { link_title: 'How far back in time could you go and still understand English?', ... } * // ] */ getNewComments (subredditName, options) { return this._getSortedFrontpage('comments', subredditName, options); } /** * @summary Get list of content by IDs. Returns a listing of the requested content. * @param {Array<string|Submission|Comment>} ids An array of content IDs. Can include the id itself, or a Submission or Comment object. can get a post and a comment * @returns {Promise<Listing<Submission|Comment>>} A listing of content requested, can be any class fetchable by API. e.g. Comment, Submission * @example * * r.getContentByIds(['t3_9l9vof','t3_9la341']).then(console.log); * // => Listing [ * // Submission { approved_at_utc: null, ... } * // Submission { approved_at_utc: null, ... } * // ] * * r.getContentByIds([r.getSubmission('9l9vof'), r.getSubmission('9la341')]).then(console.log); * // => Listing [ * // Submission { approved_at_utc: null, ... } * // Submission { approved_at_utc: null, ... } * // ] */ getContentByIds (ids) { if (!Array.isArray(ids)) { throw new TypeError('Invalid argument: Argument needs to be an array.'); } const prefixedIds = ids.map(id => { if (id instanceof snoowrap.objects.Submission || id instanceof snoowrap.objects.Comment) { return id.name; } else if (typeof id === 'string') { if (!/t(1|3)_/g.test(ids)) { throw new TypeError('Invalid argument: Ids need to include Submission or Comment prefix, e.g. t1_, t3_.'); } return id; } throw new TypeError('Id must be either a string, Submission, or Comment.'); }); return this._get({uri: '/api/info', method: 'get', qs: {id: prefixedIds.join(',')}}); } /** * @summary Gets a single random Submission. * @desc **Note**: This function will not work when snoowrap is running in a browser, because the reddit server sends a redirect which cannot be followed by a CORS request. * @param {string} [subredditName] The subreddit to get the random submission. If not provided, the post is fetched from the front page of reddit. * @returns {Promise} The retrieved Submission object * @example * * r.getRandomSubmission('aww').then(console.log) * // => Submission { domain: 'i.imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'aww' }, ... } */ getRandomSubmission (subredditName) { return this._get({uri: `${subredditName ? `r/${subredditName}/` : ''}random`}); } /** * @summary Gets a Listing of top posts. * @param {string} [subredditName] The subreddit to get posts from. If not provided, posts are fetched from the front page of reddit. * @param {object} [options={}] Options for the resulting Listing * @param {string} [options.time] Describes the timespan that posts should be retrieved from. Should be one of `hour, day, week, month, year, all` * @returns {Promise} A Listing containing the retrieved submissions * @example * * r.getTop({time: 'all', limit: 2}).then(console.log) * // => Listing [ * // Submission { domain: 'self.AskReddit', banned_by: null, subreddit: Subreddit { display_name: 'AskReddit' }, ... }, * // Submission { domain: 'imgur.com', banned_by: null, subreddit: Subreddit { display_name: 'funny' }, ... } * // ] * * r.getTop('AskReddit').then(console.log) * // => Listing [ * // Submission { domain: 'self.AskReddit', banned_by: null, subreddit: Subreddit { display_name: 'AskReddit' }, ... }, * // Submission { domain: 'self.AskReddit', banned_by: null, subreddit: Subreddit { display_name: 'AskReddit' }, ... }, * // Submission { domain: 'self.AskReddit', banned_by: null, subreddit: Subreddit { display_name: 'AskReddit' }, ... }, * // ... * // ] */ getTop (subredditName, options) { return this._getSortedFrontpage('top', subredditName, options); } /** * @summary Gets a Listing of controversial posts. * @param {string} [subredditName] The subreddit to get posts from. If not provided, posts are fetched from the front page of reddit. * @param {object} [options={}] Options for the resulting Listing * @param {string} [options.time] Describes the timespan that posts should be retrieved from. Should be one of `hour, day, week, month, year, all` * @returns {Promise} A Listing containing the retrieved submissions * @example * * r.getControversial('technology').then(console.log) * // => Listing [ * // Submission { domain: 'thenextweb.com', banned_by: null, subreddit: Subreddit { display_name: 'technology' }, ... }, * // Submission { domain: 'pcmag.com', banned_by: null, subreddit: Subreddit { display_name: 'technology' }, ... } * // ] */ getControversial (subredditName, options) { return this._getSortedFrontpage('controversial', subredditName, options); } /** * @summary Gets a Listing of controversial posts. * @param {string} [subredditName] The subreddit to get posts from. If not provided, posts are fetched from the front page of reddit. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing the retrieved submissions * @example * * r.getRising('technology').then(console.log) * // => Listing [ * // Submission { domain: 'thenextweb.com', banned_by: null, subreddit: Subreddit { display_name: 'technology' }, ... }, * // Submission { domain: 'pcmag.com', banned_by: null, subreddit: Subreddit { display_name: 'technology' }, ... } * // ] */ getRising (subredditName, options) { return this._getSortedFrontpage('rising', subredditName, options); } /** * @summary Gets the authenticated user's unread messages. * @param {object} [options={}] Options for the resulting Listing * @returns {Promise} A Listing containing unread items in the user's inbox * @example * * r.getUnreadMessages().then(console.log) * // => Listing [ * // PrivateMessage { body: 'hi!', was_comment: false, first_message: null, ... }, * // Comment { body: 'this is a reply', link_title: 'Yay, a selfpost!', was_comment: true, ... } * // ] */ getUnreadMessages (options = {}) { return this._getListing({uri: 'message/unread', qs: options}); } /** * @summary Gets the items in the authenticated user's inbox. * @param {object} [options={}] Filter options. Can also contain options for the resulting Listing. * @param {string} [options.filter] A filter for the inbox items. If provided, it should be one of `unread`, (unread items), `messages` (i.e. PMs), `comments` (comment replies), `selfreply` (selfpost replies), or `mentions` (username mentions). * @returns {Promise} A Listing containing items in the user's inbox * @example * * r.getInbox().then(console.log) * // => Listing [ * // PrivateMessage { body: 'hi!', was_comment: false, first_message: null, ... }, * // Comment { body: 'this is a reply', link_title: 'Yay, a selfpost!', was_comment: true, ... } * // ] */ getInbox ({filter, ...options} = {}) { return this._getListing({uri: `message/${filter || 'inbox'}`, qs: options}); } /** * @summary Gets the authenticated user's modmail. * @param {object} [options={}] Options for the resulting Listing * @returns {Promise} A Listing of the user's modmail * @example * * r.getModmail({limit: 2}).then(console.log) * // => Listing [ * // PrivateMessage { body: '/u/not_an_aardvark has accepted an invitation to become moderator ... ', ... }, * // PrivateMessage { body: '/u/not_an_aardvark has been invited by /u/actually_an_aardvark to ...', ... } * // ] */ getModmail (options = {}) { return this._getListing({uri: 'message/moderator', qs: options}); } /** * @summary Gets a list of ModmailConversations from the authenticated user's subreddits. * @param {object} [options] Options for the resulting Listing * @returns {Promise<Listing<ModmailConversation>>} A Listing containing Subreddits * @example * * r.getNewModmailConversations({limit: 2}).then(console.log) * // => Listing [ * // ModmailConversation { messages: [...], objIds: [...], subject: 'test subject', ... }, * // ModmailConversation { messages: [...], objIds: [...], subject: 'test subject', ... } * // ] */ getNewModmailConversations (options = {}) { return this._getListing({ uri: 'api/mod/conversations', qs: options, _name: 'ModmailConversation', _transform: response => { response.after = null; response.before = null; response.children = []; for (const conversation of response.conversationIds) { response.conversations[conversation].participant = this._newObject('ModmailConversationAuthor', { ...response.conversations[conversation].participant }); const conversationObjects = objects.ModmailConversation._getConversationObjects( response.conversations[conversation], response ); const data = { ...conversationObjects, ...response.conversations[conversation] }; response.children.push(this._newObject('ModmailConversation', data)); } return this._newObject('Listing', response); } }); } /** * @summary Create a new modmail discussion between moderators * @param {object} options * @param {string} options.body Body of the discussion * @param {string} options.subject Title or subject * @param {string} options.srName Subreddit name without fullname * @returns {Promise<ModmailConversation>} the created ModmailConversation * @example * * r.createModeratorDiscussion({ * body: 'test body', * subject: 'test subject', * srName: 'AskReddit' * }).then(console.log) * // ModmailConversation { messages: [...], objIds: [...], subject: 'test subject', ... } */ createModmailDiscussion ({ body, subject, srName }) { const parsedFromSr = srName.replace(/^\/?r\//, ''); // Convert '/r/subreddit_name' to 'subreddit_name' // _newObject ignores most of the response, no practical way to parse the returned content yet return this._post({ uri: 'api/mod/conversations', form: { body, subject, srName: parsedFromSr } }).then(res => this._newObject('ModmailConversation', {id: res.conversation.id})); } /** * @summary Get a ModmailConversation by its id * @param {string} id of the ModmailConversation * @returns {Promise<ModmailConversation>} the requested ModmailConversation * @example * * r.getNewModmailConversation('75hxt').then(console.log) * // ModmailConversation { messages: [...], objIds: [...], ... } */ getNewModmailConversation (id) { return this._newObject('ModmailConversation', {id}); } /** * @summary Marks all conversations in array as read. * @param {ModmailConversation[]} conversations to mark as read * @example * * r.markNewModmailConversationsAsRead(['pics', 'sweden']) */ markNewModmailConversationsAsRead (conversations) { const conversationIds = conversations.map(message => addFullnamePrefix(message, '')); return this._post({uri: 'api/mod/conversations/read', form: {conversationIds: conversationIds.join(',')}}); } /** * @summary Marks all conversations in array as unread. * @param {ModmailConversation[]} conversations to mark as unread * @example * * r.markNewModmailConversationsAsUnread(['pics', 'sweden']) */ markNewModmailConversationsAsUnread (conversations) { const conversationIds = conversations.map(message => addFullnamePrefix(message, '')); return this._post({uri: 'api/mod/conversations/unread', form: {conversationIds: conversationIds.join(',')}}); } /** * @summary Gets all moderated subreddits that have new Modmail activated * @returns {Promise<Listing<Subreddit>>} a Listing of ModmailConversations marked as read * @example * * r.getNewModmailSubreddits().then(console.log) * // => Listing [ * // Subreddit { display_name: 'tipofmytongue', ... }, * // Subreddit { display_name: 'EarthPorn', ... }, * // ] */ getNewModmailSubreddits () { return this._get({uri: 'api/mod/conversations/subreddits'}).then(response => { return Object.values(response.subreddits).map(s => { return this._newObject('Subreddit', s); }); }); } /** * @summary Represents the unread count in a {@link ModmailConversation}. Each of these properties * correspond to the amount of unread conversations of that type. * @typedef {Object} UnreadCount * @property {number} highlighted * @property {number} notifications * @property {number} archived * @property {number} new * @property {number} inprogress * @property {number} mod */ /** * @summary Retrieves an object of unread Modmail conversations for each state. * @returns {UnreadCount} unreadCount * @example * * r.getUnreadNewModmailConversationsCount().then(console.log) * // => { * // highlighted: 1, * // notifications: 0, * // archived: 0, * // new: 2, * // inprogress: 5, * // mod: 1, * // } */ getUnreadNewModmailConversationsCount () { return this._get({uri: 'api/mod/conversations/unread/count'}); } /** * @summary Mark Modmail conversations as read given the subreddit(s) and state. * @param {Subreddit[]|String[]} subreddits * @param {('new'|'inprogress'|'mod'|'notifications'|'archived'|'highlighted'|'all')} state selected state to mark as read * @returns {Promise<Listing<ModmailConversation>>} a Listing of ModmailConversations marked as read * @example * * r.bulkReadNewModmail(['AskReddit'], 'all').then(console.log) * // => Listing [ * // ModmailConversation { id: '75hxt' }, * // ModmailConversation { id: '75hxg' } * // ] * * r.bulkReadNewModmail([r.getSubreddit('AskReddit')], 'all').then(console.log) * // => Listing [ * // ModmailConversation { id: '75hxt' }, * // ModmailConversation { id: '75hxg' } * // ] */ bulkReadNewModmail (subreddits, state) { const subredditNames = subreddits.map(s => typeof s === 'string' ? s.replace(/^\/?r\//, '') : s.display_name); return this._post({uri: 'api/mod/conversations/bulk/read', form: { entity: subredditNames.join(','), state }}).then(res => { return this._newObject('Listing', { after: null, before: null, children: res.conversation_ids.map(id => { return this._newObject('ModmailConversation', {id}); }) }); }); } /** * @summary Gets the user's sent messages. * @param {object} [options={}] options for the resulting Listing * @returns {Promise} A Listing of the user's sent messages * @example * * r.getSentMessages().then(console.log) * // => Listing [ * // PrivateMessage { body: 'you have been added as an approved submitter to ...', ... }, * // PrivateMessage { body: 'you have been banned from posting to ...' ... } * // ] */ getSentMessages (options = {}) { return this._getListing({uri: 'message/sent', qs: options}); } /** * @summary Marks all of the given messages as read. * @param {PrivateMessage[]|String[]} messages An Array of PrivateMessage or Comment objects. Can also contain strings representing message or comment IDs. If strings are provided, they are assumed to represent PrivateMessages unless a fullname prefix such as `t1_` is specified. * @returns {Promise} A Promise that fulfills when the request is complete * @example * * r.markMessagesAsRead(['51shsd', '51shxv']) * * // To reference a comment by ID, be sure to use the `t1_` prefix, otherwise snoowrap will be unable to distinguish the * // comment ID from a PrivateMessage ID. * r.markMessagesAsRead(['t5_51shsd', 't1_d3zhb5k']) * * // Alternatively, just pass in a comment object directly. * r.markMessagesAsRead([r.getMessage('51shsd'), r.getComment('d3zhb5k')]) */ markMessagesAsRead (messages) { const messageIds = messages.map(message => addFullnamePrefix(message, 't4_')); return this._post({uri: 'api/read_message', form: {id: messageIds.join(',')}}); } /** * @summary Marks all of the given messages as unread. * @param {PrivateMessage[]|String[]} messages An Array of PrivateMessage or Comment objects. Can also contain strings representing message IDs. If strings are provided, they are assumed to represent PrivateMessages unless a fullname prefix such as `t1_` is included. * @returns {Promise} A Promise that fulfills when the request is complete * @example * * r.markMessagesAsUnread(['51shsd', '51shxv']) * * // To reference a comment by ID, be sure to use the `t1_` prefix, otherwise snoowrap will be unable to distinguish the * // comment ID from a PrivateMessage ID. * r.markMessagesAsUnread(['t5_51shsd', 't1_d3zhb5k']) * * // Alternatively, just pass in a comment object directly. * r.markMessagesAsRead([r.getMessage('51shsd'), r.getComment('d3zhb5k')]) */ markMessagesAsUnread (messages) { const messageIds = messages.map(message => addFullnamePrefix(message, 't4_')); return this._post({uri: 'api/unread_message', form: {id: messageIds.join(',')}}); } /** * @summary Marks all of the user's messages as read. * @desc **Note:** The reddit.com site imposes a ratelimit of approximately 1 request every 10 minutes on this endpoint. Further requests will cause the API to return a 429 error. * @returns {Promise} A Promise that resolves when the request is complete * @example * * r.readAllMessages().then(function () { * r.getUnreadMessages().then(console.log) * }) * // => Listing [] * // (messages marked as 'read' on reddit) */ readAllMessages () { return this._post({uri: 'api/read_all_messages'}); } /** * @summary Composes a new private message. * @param {object} options * @param {RedditUser|Subreddit|string} options.to The recipient of the message. * @param {string} options.subject The message subject (100 characters max) * @param {string} options.text The body of the message, in raw markdown text * @param {Subreddit|string} [options.fromSubreddit] If provided, the message is sent as a modmail from the specified subreddit. * @param {string} [options.captchaIden] A captcha identifier. This is only necessary if the authenticated account requires a captcha to submit posts and comments. * @param {string} [options.captchaResponse] The response to the captcha with the given identifier * @returns {Promise} A Promise that fulfills when the request is complete * @example * * r.composeMessage({ * to: 'actually_an_aardvark', * subject: "Hi, how's it going?", * text: 'Long time no see' * }) * // (message created on reddit) */ composeMessage ({ captcha, from_subreddit, fromSubreddit = from_subreddit, captcha_iden, captchaIden = captcha_iden, subject, text, to }) { let parsedTo = to; let parsedFromSr = fromSubreddit; if (to instanceof snoowrap.objects.RedditUser) { parsedTo = to.name; } else if (to instanceof snoowrap.objects.Subreddit) { parsedTo = `/r/${to.display_name}`; } if (fromSubreddit instanceof snoowrap.objects.Subreddit) { parsedFromSr = fromSubreddit.display_name; } else if (typeof fromSubreddit === 'string') { parsedFromSr = fromSubreddit.replace(/^\/?r\//, ''); // Convert '/r/subreddit_name' to 'subreddit_name' } return this._post({ uri: 'api/compose', form: { api_type, captcha, iden: captchaIden, from_sr: parsedFromSr, subject, text, to: parsedTo } }).tap(handleJsonErrors(this)).return({}); } /** * @summary Gets a list of all oauth scopes supported by the reddit API. * @desc **Note**: This lists every single oauth scope. To get the scope of this requester, use the `scope` property instead. * @returns {Promise} An object containing oauth scopes. * @example * * r.getOauthScopeList().then(console.log) * // => { * // creddits: { * // description: 'Spend my reddit gold creddits on giving gold to other users.', * // id: 'creddits', * // name: 'Spend reddit gold creddits' * // }, * // modcontributors: { * // description: 'Add/remove users to approved submitter lists and ban/unban or mute/unmute users from ...', * // id: 'modcontributors', * // name: 'Approve submitters and ban users' * // }, * // ... * // } */ getOauthScopeList () { return this._get({uri: 'api/v1/scopes'}); } /** * @summary Conducts a search of reddit submissions. * @param {object} options Search options. Can also contain options for the resulting Listing. * @param {string} options.query The search query * @param {string} [options.time] Describes the timespan that posts should be retrieved from. One of `hour, day, week, month, year, all` * @param {Subreddit|string} [options.subreddit] The subreddit to conduct the search on. * @param {boolean} [options.restrictSr=true] Restricts search results to the given subreddit * @param {string} [options.sort] Determines how the results should be sorted. One of `relevance, hot, top, new, comments` * @param {string} [options.syntax='plain'] Specifies a syntax for the search. One of `cloudsearch, lucene, plain` * @returns {Promise} A Listing containing the search results. * @example * * r.search({ * query: 'Cute kittens', * subreddit: 'aww', * sort: 'top' * }).then(console.log) * // => Listing [ * // Submission { domain: 'i.imgur.com', banned_by: null, ... }, * // Submission { domain: 'imgur.com', banned_by: null, ... }, * // ... * // ] */ search (options) { if (options.subreddit instanceof snoowrap.objects.Subreddit) { options.subreddit = options.subreddit.display_name; } defaults(options, {restrictSr: true, syntax: 'plain'}); const parsedQuery = omit( {...options, t: options.time, q: options.query, restrict_sr: options.restrictSr}, ['time', 'query'] ); return this._getListing({uri: `${options.subreddit ? `r/${options.subreddit}/` : ''}search`, qs: parsedQuery}); } /** * @summary Searches for subreddits given a query. * @param {object} options * @param {string} options.query A search query (50 characters max) * @param {boolean} [options.exact=false] Determines whether the results shouldbe limited to exact matches. * @param {boolean} [options.includeNsfw=true] Determines whether the results should include NSFW subreddits. * @returns {Promise} An Array containing subreddit names * @example * * r.searchSubredditNames({query: 'programming'}).then(console.log) * // => [ * // 'programming', * // 'programmingcirclejerk', * // 'programminghorror', * // ... * // ] */ searchSubredditNames ({exact = false, include_nsfw = true, includeNsfw = include_nsfw, query}) { return this._post({uri: 'api/search_reddit_names', qs: {exact, include_over_18: includeNsfw, query}}).get('names'); } _createOrEditSubreddit ({ allow_images = true, allow_top = true, captcha, captcha_iden, collapse_deleted_comments = false, comment_score_hide_mins = 0, description, exclude_banned_modqueue = false, 'header-title': header_title, hide_ads = false, lang = 'en', link_type = 'any', name, over_18 = false, public_description, public_traffic = false, show_media = false, show_media_preview = true, spam_comments = 'high', spam_links = 'high', spam_selfposts = 'high', spoilers_enabled = false, sr, submit_link_label = '', submit_text_label = '', submit_text = '', suggested_comment_sort = 'confidence', title, type = 'public', wiki_edit_age, wiki_edit_karma, wikimode = 'modonly' }) { return this._post({ uri: 'api/site_admin', form: { allow_images, allow_top, api_type, captcha, collapse_deleted_comments, comment_score_hide_mins, description, exclude_banned_modqueue, 'header-title': header_title, hide_ads, iden: captcha_iden, lang, link_type, name, over_18, public_description, public_traffic, show_media, show_media_preview, spam_comments, spam_links, spam_selfposts, spoilers_enabled, sr, submit_link_label, submit_text, submit_text_label, suggested_comment_sort, title, type, wiki_edit_age, wiki_edit_karma, wikimode } }).then(handleJsonErrors(this.getSubreddit(name || sr))); } /** * @summary Creates a new subreddit. * @param {object} options * @param {string} options.name The name of the new subreddit * @param {string} options.title The text that should appear in the header of the subreddit * @param {string} options.public_description The text that appears with this subreddit on the search page, or on the blocked-access page if this subreddit is private. (500 characters max) * @param {string} options.description The sidebar text for the subreddit. (5120 characters max) * @param {string} [options.submit_text=''] The text to show below the submission page (1024 characters max) * @param {boolean} [options.hide_ads=false] Determines whether ads should be hidden on this subreddit. (This is only allowed for gold-only subreddits.) * @param {string} [options.lang='en'] The language of the subreddit (represented as an IETF language tag) * @param {string} [options.type='public'] Determines who should be able to access the subreddit. This should be one of `public, private, restricted, gold_restricted, gold_only, archived, employees_only`. * @param {string} [options.link_type='any'] Determines what types of submissions are allowed on the subreddit. This should be one of `any, link, self`. * @param {string} [options.submit_link_label=undefined] Custom text to display on the button that submits a link. If this is omitted, the default text will be displayed. * @param {string} [options.submit_text_label=undefined] Custom text to display on the button that submits a selfpost. If this is omitted, the default text will be displayed. * @param {string} [options.wikimode='modonly'] Determines who can edit wiki pages on the subreddit. This should be one of `modonly, anyone, disabled`. * @param {number} [options.wiki_edit_karma=0] The minimum amount of subreddit karma needed for someone to edit this subreddit's wiki. (This is only relevant if `options.wikimode` is set to `anyone`.) * @param {number} [options.wiki_edit_age=0] The minimum account age (in days) needed for someone to edit this subreddit's wiki. (This is only relevant if `options.wikimode` is set to `anyone`.) * @param {string} [options.spam_links='high'] The spam filter strength for links on this subreddit. This should be one of `low, high, all`. * @param {string} [options.spam_selfposts='high'] The spam filter strength for selfposts on this subreddit. This should be one of `low, high, all`. * @param {string} [options.spam_comments='high'] The spam filter strength for comments on this subreddit. This should be one of `low, high, all`. * @param {boolean} [options.over_18=false] Determines whether this subreddit should be classified as NSFW * @param {boolean} [options.allow_top=true] Determines whether the new subreddit should be able to appear in /r/all and trending subreddits * @param {boolean} [options.show_media=false] Determines whether image thumbnails should be enabled on this subreddit * @param {boolean} [options.show_media_preview=true] Determines whether media previews should be expanded by default on this subreddit * @param {boolean} [options.allow_images=true] Determines whether image uploads and links to image hosting sites should be enabled on this subreddit * @param {boolean} [options.exclude_banned_modqueue=false] Determines whether posts by site-wide banned users should be excluded from the modqueue. * @param {boolean} [options.public_traffic=false] Determines whether the /about/traffic page for this subreddit should be viewable by anyone. * @param {boolean} [options.collapse_deleted_comments=false] Determines whether deleted and removed comments should be collapsed by default * @param {string} [options.suggested_comment_sort=undefined] The suggested comment sort for the subreddit. This should be one of `confidence, top, new, controversial, old, random, qa`.If left blank, there will be no suggested sort, which means that users will see the sort method that is set in their own preferences (usually `confidence`.) * @param {boolean} [options.spoilers_enabled=false] Determines whether users can mark their posts as spoilers * @returns {Promise} A Promise for the newly-created subreddit object. * @example * * r.createSubreddit({ * name: 'snoowrap_testing2', * title: 'snoowrap testing: the sequel', * public_description: 'thanks for reading the snoowrap docs!', * description: 'This text will go on the sidebar', * type: 'private' * }).then(console.log) * // => Subreddit { display_name: 'snoowrap_testing2' } * // (/r/snoowrap_testing2 created on reddit) */ createSubreddit (options) { return this._createOrEditSubreddit(options); } /** * @summary Searches subreddits by topic. * @param {object} options * @param {string} options.query The search query. (50 characters max) * @returns {Promise} An Array of subreddit objects corresponding to the search results * @deprecated Reddit no longer provides the corresponding API endpoint. * @example * * r.searchSubredditTopics({query: 'movies'}).then(console.log) * // => [ * // Subreddit { display_name: 'tipofmytongue' }, * // Subreddit { display_name: 'remove' }, * // Subreddit { display_name: 'horror' }, * // ... * // ] */ searchSubredditTopics ({query}) { return this._get({uri: 'api/subreddits_by_topic', qs: {query}}).map(result => this.getSubreddit(result.name)); } /** * @summary Gets a list of subreddits that the currently-authenticated user is subscribed to. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing Subreddits * @example * * r.getSubscriptions({limit: 2}).then(console.log) * // => Listing [ * // Subreddit { * // display_name: 'gadgets', * // title: 'reddit gadget guide', * // ... * // }, * // Subreddit { * // display_name: 'sports', * // title: 'the sportspage of the Internet', * // ... * // } * // ] */ getSubscriptions (options) { return this._getListing({uri: 'subreddits/mine/subscriber', qs: options}); } /** * @summary Gets a list of subreddits in which the currently-authenticated user is an approved submitter. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing Subreddits * @example * * r.getContributorSubreddits().then(console.log) * // => Listing [ * // Subreddit { * // display_name: 'snoowrap_testing', * // title: 'snoowrap', * // ... * // } * // ] * */ getContributorSubreddits (options) { return this._getListing({uri: 'subreddits/mine/contributor', qs: options}); } /** * @summary Gets a list of subreddits in which the currently-authenticated user is a moderator. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing Subreddits * @example * * r.getModeratedSubreddits().then(console.log) * // => Listing [ * // Subreddit { * // display_name: 'snoowrap_testing', * // title: 'snoowrap', * // ... * // } * // ] */ getModeratedSubreddits (options) { return this._getListing({uri: 'subreddits/mine/moderator', qs: options}); } /** * @summary Searches subreddits by title and description. * @param {object} options Options for the search. May also contain Listing parameters. * @param {string} options.query The search query * @returns {Promise} A Listing containing Subreddits * @example * * r.searchSubreddits({query: 'cookies'}).then(console.log) * // => Listing [ Subreddit { ... }, Subreddit { ... }, ...] */ searchSubreddits (options) { options.q = options.query; return this._getListing({uri: 'subreddits/search', qs: omit(options, 'query')}); } /** * @summary Gets a list of subreddits, arranged by popularity. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing Subreddits * @example * * r.getPopularSubreddits().then(console.log) * // => Listing [ Subreddit { ... }, Subreddit { ... }, ...] */ getPopularSubreddits (options) { return this._getListing({uri: 'subreddits/popular', qs: options}); } /** * @summary Gets a list of subreddits, arranged by age. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing Subreddits * @example * * r.getNewSubreddits().then(console.log) * // => Listing [ Subreddit { ... }, Subreddit { ... }, ...] */ getNewSubreddits (options) { return this._getListing({uri: 'subreddits/new', qs: options}); } /** * @summary Gets a list of gold-exclusive subreddits. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing Subreddits * @example * * r.getGoldSubreddits().then(console.log) * // => Listing [ Subreddit { ... }, Subreddit { ... }, ...] */ getGoldSubreddits (options) { return this._getListing({uri: 'subreddits/gold', qs: options}); } /** * @summary Gets a list of default subreddits. * @param {object} [options] Options for the resulting Listing * @returns {Promise} A Listing containing Subreddits * @example * * r.getDefaultSubreddits().then(console.log) * // => Listing [ Subreddit { ... }, Subreddit { ... }, ...] */ getDefaultSubreddits (options) { return this._getListing({uri: 'subreddits/default', qs: options}); } /** * @summary Checks whether a given username is available for registration * @desc **Note:** This function will not work when snoowrap is running in a browser, due to an issue with reddit's CORS settings. * @param {string} name The username in question * @returns {Promise} A Promise that fulfills with a Boolean (`true` or `false`) * @example * * r.checkUsernameAvailability('not_an_aardvark').then(console.log) * // => false * r.checkUsernameAvailability('eqwZAr9qunx7IHqzWVeF').then(console.log) * // => true */ checkUsernameAvailability (name) { // The oauth endpoint listed in reddit's documentation doesn't actually work, so just send an unauthenticated request. return this.unauthenticatedRequest({uri: 'api/username_available.json', qs: {user: name}}); } /** * @summary Creates a new LiveThread. * @param {object} options * @param {string} options.title The title of the livethread (100 characters max) * @param {string} [options.description] A descriptions of the thread. 120 characters max * @param {string} [options.resources] Information and useful links related to the thread. 120 characters max * @param {boolean} [options.nsfw=false] Determines whether the thread is Not Safe For Work * @returns {Promise} A Promise that fulfills with the new LiveThread when the request is complete * @example * * r.createLivethread({title: 'My livethread'}).then(console.log) * // => LiveThread { id: 'wpimncm1f01j' } */ createLivethread ({title, description, resources, nsfw = false}) { return this._post({ uri: 'api/live/create', form: {api_type, description, nsfw, resources, title} }).tap(handleJsonErrors(this)).then(result => this.getLivethread(result.json.data.id)); } /** * @summary Gets the "happening now" LiveThread, if it exists * @desc This is the LiveThread that is occasionally linked at the top of reddit.com, relating to current events. * @returns {Promise} A Promise that fulfills with the "happening now" LiveThread if it exists, or rejects with a 404 error otherwise. * @example r.getCurrentEventsLivethread().then(thread => thread.stream.on('update', console.log)) */ getStickiedLivethread () { return this._get({uri: 'api/live/happening_now'}); } /** * @summary Gets the user's own multireddits. * @returns {Promise} A Promise for an Array containing the requester's MultiReddits. * @example * * r.getMyMultireddits().then(console.log) * => [ MultiReddit { ... }, MultiReddit { ... }, ... ] */ getMyMultireddits () { return this._get({uri: 'api/multi/mine', qs: {expand_srs: true}}); } /** * @summary Creates a new multireddit. * @param {object} options * @param {string} options.name The name of the new multireddit. 50 characters max * @param {string} options.description A description for the new multireddit, in markdown. * @param {Array} options.subreddits An Array of Subreddit objects (or subreddit names) that this multireddit should compose of * @param {string} [options.visibility='private'] The multireddit's visibility setting. One of `private`, `public`, `hidden`. * @param {string} [options.icon_name=''] One of `art and design`, `ask`, `books`, `business`, `cars`, `comics`, `cute animals`, `diy`, `entertainment`, `food and drink`, `funny`, `games`, `grooming`, `health`, `life advice`, `military`, `models pinup`, `music`, `news`, `philosophy`, `pictures and gifs`, `science`, `shopping`, `sports`, `style`, `tech`, `travel`, `unusual stories`, `video`, `None` * @param {string} [options.key_color='#000000'] A six-digit RGB hex color, preceded by '#' * @param {string} [options.weighting_scheme='classic'] One of `classic`, `fresh` * @returns {Promise} A Promise for the newly-created MultiReddit object * @example * * r.createMultireddit({ * name: 'myMulti', * description: 'An example multireddit', * subreddits: ['snoowrap', 'snoowrap_testing'] * }).then(console.log) * => MultiReddit { display_name: 'myMulti', ... } */ createMultireddit ({ name, description, subreddits, visibility = 'private', icon_name = '', key_color = '#000000', weighting_scheme = 'classic' }) { return this._post({ uri: 'api/multi', form: { model: JSON.stringify({ display_name: name, description_md: description, icon_name, key_color, subreddits: subreddits.map(sub => ({name: typeof sub === 'string' ? sub : sub.display_name})), visibility, weighting_scheme }) } }); } _revokeToken (token) { return this.credentialedClientRequest({uri: 'api/v1/revoke_token', form: {token}, method: 'post'}); } /** * @summary Invalidates the current access token. * @returns {Promise} A Promise that fulfills when this request is complete * @desc **Note**: This can only be used if the current requester was supplied with a `client_id` and `client_secret`. If the current requester was supplied with a refresh token, it will automatically create a new access token if any more requests are made after this one. * @example r.revokeAccessToken(); */ revokeAccessToken () { return this._revokeToken(this.accessToken).then(() => { this.accessToken = null; this.tokenExpiration = null; }); } /** * @summary Invalidates the current refresh token. * @returns {Promise} A Promise that fulfills when this request is complete * @desc **Note**: This can only be used if the current requester was supplied with a `client_id` and `client_secret`. All access tokens generated by this refresh token will also be invalidated. This effectively de-authenticates the requester and prevents it from making any more valid requests. This should only be used in a few cases, e.g. if this token has been accidentally leaked to a third party. * @example r.revokeRefreshToken(); */ revokeRefreshToken () { return this._revokeToken(this.refreshToken).then(() => { this.refreshToken = null; this.accessToken = null; // Revoking a refresh token also revokes any associated access tokens. this.tokenExpiration = null; }); } _selectFlair ({flair_template_id, link, name, text, subredditName}) { if (!flair_template_id) { throw new errors.InvalidMethodCallError('No flair template ID provided'); } return Promise.resolve(subredditName).then(subName => { return this._post({uri: `r/${subName}/api/selectflair`, form: {api_type, flair_template_id, link, name, text}}); }); } _assignFlair ({css_class, cssClass = css_class, link, name, text, subreddit_name, subredditName = subreddit_name}) { return this._promiseWrap(Promise.resolve(subredditName).then(displayName => { return this._post({uri: `r/${displayName}/api/flair`, form: {api_type, name, text, link, css_class: cssClass}}); })); } _populate (responseTree) { if (typeof responseTree === 'object' && responseTree !== null) { // Map {kind: 't2', data: {name: 'some_username', ... }} to a RedditUser (e.g.) with the same properties if (Object.keys(responseTree).length === 2 && responseTree.kind && responseTree.data) { return this._newObject(KINDS[responseTree.kind] || 'RedditContent', this._populate(responseTree.data), true); } const result = (Array.isArray(responseTree) ? map : mapValues)(responseTree, (value, key) => { // Maps {author: 'some_username'} to {author: RedditUser { name: 'some_username' } } if (value !== null && USER_KEYS.has(key)) { return this._newObject('RedditUser', {name: value}); } if (value !== null && SUBREDDIT_KEYS.has(key)) { return this._newObject('Subreddit', {display_name: value}); } return this._populate(value); }); if (result.length === 2 && result[0] instanceof snoowrap.objects.Listing && result[0][0] instanceof snoowrap.objects.Submission && result[1] instanceof snoowrap.objects.Listing) { if (result[1]._more && !result[1]._more.link_id) { result[1]._more.link_id = result[0][0].name; } result[0][0].comments = result[1]; return result[0][0]; } return result; } return responseTree; } _getListing ({uri, qs = {}, ...options}) { /* When the response type is expected to be a Listing, add a `count` parameter with a very high number. This ensures that reddit returns a `before` property in the resulting Listing to enable pagination. (Aside from the additional parameter, this function is equivalent to snoowrap.prototype._get) */ const mergedQuery = {count: 9999, ...qs}; return qs.limit || !isEmpty(options) ? this._newObject('Listing', {_query: mergedQuery, _uri: uri, ...options}).fetchMore(qs.limit || MAX_LISTING_ITEMS) /* This second case is used as a fallback in case the endpoint unexpectedly ends up returning something other than a Listing (e.g. Submission#getRelated, which used to return a Listing but no longer does due to upstream reddit API changes), in which case using fetch_more() as above will throw an error. This fallback only works if there are no other meta-properties provided for the Listing, such as _transform. If there are other meta-properties, the function will still end up throwing an error, but there's not really any good way to handle it (predicting upstream changes can only go so far). More importantly, in the limited cases where it's used, the fallback should have no effect on the returned results */ : this._get({uri, qs: mergedQuery}).then(listing => { if (Array.isArray(listing)) { listing.filter(item => item.constructor._name === 'Comment').forEach(addEmptyRepliesListing); } return listing; }); } /** * @summary In browsers, restores the `window.snoowrap` property to whatever it was before this instance of snoowrap was loaded. This is a no-op in Node. * @returns This instance of the snoowrap constructor * @example var snoowrap = window.snoowrap.noConflict(); */ static noConflict () { if (isBrowser) { global[MODULE_NAME] = this._previousSnoowrap; } return this; } }; function identity (value) { return value; } defineInspectFunc(snoowrap.prototype, function () { // Hide confidential information (tokens, client IDs, etc.), as well as private properties, from the console.log output. const keysForHiddenValues = ['clientSecret', 'refreshToken', 'accessToken', 'password']; const formatted = mapValues(omitBy(this, (value, key) => typeof key === 'string' && key.startsWith('_')), (value, key) => { return includes(keysForHiddenValues, key) ? value && '(redacted)' : value; }); return `${MODULE_NAME} ${util.inspect(formatted)}`; }); const classFuncDescriptors = {configurable: true, writable: true}; /* Add the request_handler functions (oauth_request, credentialed_client_request, etc.) to the snoowrap prototype. Use Object.defineProperties to ensure that the properties are non-enumerable. */ Object.defineProperties(snoowrap.prototype, mapValues(requestHandler, func => ({value: func, ...classFuncDescriptors}))); HTTP_VERBS.forEach(method => { /* Define method shortcuts for each of the HTTP verbs. i.e. `snoowrap.prototype._post` is the same as `oauth_request` except that the HTTP method defaults to `post`, and the result is promise-wrapped. Use Object.defineProperty to ensure that the properties are non-enumerable. */ Object.defineProperty(snoowrap.prototype, `_${method}`, { value (options) { return this._promiseWrap(this.oauthRequest({...options, method})); }, ...classFuncDescriptors }); }); /* `objects` will be an object containing getters for each content type, due to the way objects are exported from objects/index.js. To unwrap these getters into direct properties, use lodash.mapValues with an identity function. */ snoowrap.objects = mapValues(objects, value => value); forOwn(KINDS, value => { snoowrap.objects[value] = snoowrap.objects[value] || class extends objects.RedditContent { }; Object.defineProperty(snoowrap.objects[value], '_name', {value, configurable: true}); }); // Alias all functions on snoowrap's prototype and snoowrap's object prototypes in snake_case. values(snoowrap.objects).concat(snoowrap).map(func => func.prototype).forEach(funcProto => { Object.getOwnPropertyNames(funcProto) .filter(name => !name.startsWith('_') && name !== snakeCase(name) && typeof funcProto[name] === 'function') .forEach(name => Object.defineProperty(funcProto, snakeCase(name), {value: funcProto[name], ...classFuncDescriptors})); }); snoowrap.errors = errors; snoowrap.version = VERSION; if (!module.parent && isBrowser) { // check if the code is being run in a browser through browserify, etc. snoowrap._previousSnoowrap = global[MODULE_NAME]; global[MODULE_NAME] = snoowrap; } module.exports = snoowrap;
/*global CompilerContext, Handlebars, shouldThrow */ var Exception = Handlebars.Exception; describe('strict', function() { describe('strict mode', function() { it('should error on missing property lookup', function() { shouldThrow(function() { var template = CompilerContext.compile('{{hello}}', {strict: true}); template({}); }, Exception, /"hello" not defined in/); }); it('should error on missing child', function() { var template = CompilerContext.compile('{{hello.bar}}', {strict: true}); equals(template({hello: {bar: 'foo'}}), 'foo'); shouldThrow(function() { template({hello: {}}); }, Exception, /"bar" not defined in/); }); it('should handle explicit undefined', function() { var template = CompilerContext.compile('{{hello.bar}}', {strict: true}); equals(template({hello: {bar: undefined}}), ''); }); it('should error on missing property lookup in known helpers mode', function() { shouldThrow(function() { var template = CompilerContext.compile('{{hello}}', {strict: true, knownHelpersOnly: true}); template({}); }, Exception, /"hello" not defined in/); }); it('should error on missing context', function() { shouldThrow(function() { var template = CompilerContext.compile('{{hello}}', {strict: true}); template(); }, Error); }); it('should error on missing data lookup', function() { var template = CompilerContext.compile('{{@hello}}', {strict: true}); equals(template(undefined, {data: {hello: 'foo'}}), 'foo'); shouldThrow(function() { template(); }, Error); }); it('should not run helperMissing for helper calls', function() { shouldThrow(function() { var template = CompilerContext.compile('{{hello foo}}', {strict: true}); template({foo: true}); }, Exception, /"hello" not defined in/); shouldThrow(function() { var template = CompilerContext.compile('{{#hello foo}}{{/hello}}', {strict: true}); template({foo: true}); }, Exception, /"hello" not defined in/); }); it('should throw on ambiguous blocks', function() { shouldThrow(function() { var template = CompilerContext.compile('{{#hello}}{{/hello}}', {strict: true}); template({}); }, Exception, /"hello" not defined in/); shouldThrow(function() { var template = CompilerContext.compile('{{^hello}}{{/hello}}', {strict: true}); template({}); }, Exception, /"hello" not defined in/); shouldThrow(function() { var template = CompilerContext.compile('{{#hello.bar}}{{/hello.bar}}', {strict: true}); template({hello: {}}); }, Exception, /"bar" not defined in/); }); }); describe('assume objects', function() { it('should ignore missing property', function() { var template = CompilerContext.compile('{{hello}}', {assumeObjects: true}); equal(template({}), ''); }); it('should ignore missing child', function() { var template = CompilerContext.compile('{{hello.bar}}', {assumeObjects: true}); equal(template({hello: {}}), ''); }); it('should error on missing object', function() { shouldThrow(function() { var template = CompilerContext.compile('{{hello.bar}}', {assumeObjects: true}); template({}); }, Error); }); it('should error on missing context', function() { shouldThrow(function() { var template = CompilerContext.compile('{{hello}}', {assumeObjects: true}); template(); }, Error); }); it('should error on missing data lookup', function() { shouldThrow(function() { var template = CompilerContext.compile('{{@hello.bar}}', {assumeObjects: true}); template(); }, Error); }); it('should execute blockHelperMissing', function() { var template = CompilerContext.compile('{{^hello}}foo{{/hello}}', {assumeObjects: true}); equals(template({}), 'foo'); }); }); });
/* @flow */ import React from 'react'; import Icon from 'mineral-ui/Icon'; type Props = { size?: string | 'small' | 'medium' | 'large', color?: string, rtl?: boolean, title?: string }; /* eslint-disable prettier/prettier */ export default function IconCenterFocusStrong(props: Props) { const iconProps = { rtl: false, ...props }; return ( <Icon {...iconProps}> <g> <path d="M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-7 7H3v4c0 1.1.9 2 2 2h4v-2H5v-4zM5 5h4V3H5c-1.1 0-2 .9-2 2v4h2V5zm14-2h-4v2h4v4h2V5c0-1.1-.9-2-2-2zm0 16h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4z"/> </g> </Icon> ); } IconCenterFocusStrong.displayName = 'IconCenterFocusStrong'; IconCenterFocusStrong.category = 'image';
var Alloy = require('/alloy'), _ = require('/alloy/underscore')._, TAP = Ti.App.Properties; function S4() { return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1); } function guid() { return S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4(); } function Sync(method, model, opts) { var prefix = model.config.adapter.collection_name ? model.config.adapter.collection_name : 'default'; var regex = new RegExp('^(' + prefix + ')\\-(.+)$'); var resp = null; if (method === 'read') { if (model instanceof Backbone.Collection) { var list = []; _.each(TAP.listProperties(), function (prop) { var match = prop.match(regex); if (match !== null) { list.push(TAP.getObject(prop)); } }); resp = list; } else { var obj = TAP.getObject(prefix + '-' + model.id); model.set(obj); resp = model.toJSON(); } } else if (method === 'create' || method === 'update') { if (!model.id) { model.id = guid(); model.set(model.idAttribute, model.id); } TAP.setObject(prefix + '-' + model.id, model.toJSON() || {}); resp = model.toJSON(); } else if (method === 'delete') { TAP.removeProperty(prefix + '-' + model.id); model.clear(); resp = model.toJSON(); } if (resp) { if (_.isFunction(opts.success)) { opts.success(resp); } if (method === 'read') { model.trigger('fetch'); } } else { if (_.isFunction(opts.error)) { opts.error(resp); } } } module.exports.sync = Sync; module.exports.beforeModelCreate = function (config) { config = config || {}; config.columns = config.columns || {}; config.defaults = config.defaults || {}; if (typeof config.columns.id === 'undefined' || config.columns.id === null) { config.columns.id = 'String'; } return config; };
function fillCircle(imageData, xp ,yp, radius, col) { var xoff = 0; var yoff = radius; var balance = -radius; while (xoff <= yoff) { var p0 = xp - xoff; var p1 = xp - yoff; var w0 = xoff + xoff; var w1 = yoff + yoff; imageData = horizontalLine(imageData, p0, yp + yoff, w0, col); imageData = horizontalLine(imageData, p0, yp - yoff, w0, col); imageData = horizontalLine(imageData, p1, yp + xoff, w1, col); imageData = horizontalLine(imageData, p1, yp - xoff, w1, col); if ((balance += xoff++ + xoff)>= 0) { balance -= --yoff + yoff; } } return imageData; } function horizontalLine(imageData, xp, yp, w, col) { for (var i = 0; i < w; i++){ setColorAt(imageData, xp + i, yp, col); } return imageData; } function drawLine(x0, y0, x1, y1, lcolor, thickness) { var tempCanvas = context.getImageData(0, 0, canvas.width, canvas.height); var imageData = tempCanvas.data; var color = hexToRgbA(lcolor); console.log('color: ' + color); imageData = fillCircle(imageData, x0, y0, Math.floor(thickness/2), color); imageData = fillCircle(imageData, x1, y1, Math.floor(thickness/2), color); var dx = Math.abs(x0-x1); var dy = Math.abs(y0-y1); if (dx>dy) { for (var i = 0; i < thickness/2; i++) { imageData = drawSingleLine(imageData, x0, y0+i, x1, y1+i, color); } for (var i = 0; i < thickness/2; i++) { imageData = drawSingleLine(imageData, x0, y0-i, x1, y1-i, color); } } else { for (var i = 0; i < thickness/2; i++) { imageData = drawSingleLine(imageData, x0+i, y0, x1+i, y1, color); } for (var i = 0; i < thickness/2; i++) { imageData = drawSingleLine(imageData, x0-i, y0, x1-i, y1, color); } } tempCanvas.data = imageData; context.putImageData(tempCanvas, 0, 0); } function drawSingleLine(imageData, x0, y0, x1, y1, color) { { var dx = Math.abs(x1-x0), sx = x0<x1 ? 1 : -1; var dy = -Math.abs(y1-y0), sy = y0<y1 ? 1 : -1; var err = dx+dy, e2; /* error value e_xy */ while (1) { setColorAt(imageData, x0, y0, color); if (x0===x1 && y0===y1) break; e2 = 2*err; if (e2 > dy) { err += dy; x0 += sx; } /* e_xy+e_x > 0 */ if (e2 < dx) { err += dx; y0 += sy; } /* e_xy+e_y < 0 */ } } return imageData; } class vec2 { constructor(x, y) { this.x = x; this.y = y; } } function floodFill(x, y, fillColor) { var queue = []; context.fillStyle = "rgba("+fillColor[0]+","+fillColor[1]+","+fillColor[2]+","+fillColor[3]+")"; queue.push(new vec2(x, y)); var origColor = context.getImageData(queue[0].x, queue[0].y, 1, 1).data; if (!compareColors(origColor, fillColor)) { var tempCanvas = context.getImageData(0, 0, canvas.width, canvas.height); var imageData = tempCanvas.data; while (queue.length > 0) { var curr = queue.pop(); var currColor = getColorAt(imageData, curr.x, curr.y); if (compareColors(currColor, origColor)) { setColorAt(imageData, curr.x, curr.y, fillColor); if (compareColors(getColorAt(imageData, curr.x+1, curr.y), origColor)) { queue.push(new vec2(curr.x+1, curr.y)); } if (compareColors(getColorAt(imageData, curr.x, curr.y+1), origColor)) { queue.push(new vec2(curr.x, curr.y+1)); } if (compareColors(getColorAt(imageData, curr.x-1, curr.y), origColor)) { queue.push(new vec2(curr.x-1, curr.y)); } if (compareColors(getColorAt(imageData, curr.x, curr.y-1), origColor)) { queue.push(new vec2(curr.x, curr.y-1)); } } } tempCanvas.data = imageData; context.putImageData(tempCanvas, 0, 0); } } function setColorAt(imgDat, x, y, color) { var offset = (x*4)+((y*canvas.width)*4); imgDat[offset+0] = color[0]; imgDat[offset+1] = color[1]; imgDat[offset+2] = color[2]; imgDat[offset+3] = color[3]; } function getColorAt(imgDat, x, y) { var toReturn = []; var offset = (x*4)+((y*canvas.width)*4); toReturn[0] = imgDat[offset+0]; toReturn[1] = imgDat[offset+1]; toReturn[2] = imgDat[offset+2]; toReturn[3] = imgDat[offset+3]; return toReturn; } function compareColors(first, second) { if (first[0] === second[0] && first[1] === second[1] && first[2] === second[2] && first[3] === second[3]) { return true; } return false; } function hexToRgbA(hex) { var c; if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)){ c= hex.substring(1).split(''); if(c.length== 3){ c= [c[0], c[0], c[1], c[1], c[2], c[2]]; } c= '0x'+c.join(''); var toReturn = []; toReturn[0] = (c>>16)&255; toReturn[1] = (c>>8)&255; toReturn[2] = c&255; toReturn[3] = 255; return toReturn; } throw new Error('Bad Hex'); }
YMaps.Hotspots.Loader.onLoad("heroes-307-184-9",{"objects":[{"data":{"name":"\u041a\u0435\u0440\u0447\u044c","Point":{"pos":"36.464342 45.30667"},"style":"#hero"},"base":new YMaps.GeoPoint(36.464342,45.30667),"geometry":[[-10,-5,10,33]]}]});
import { r as registerInstance, h, H as Host } from './index-ec84eadc.js'; const DataValue = class { constructor(hostRef) { registerInstance(this, hostRef); } render() { return (h(Host, { class: "bal-data-value" }, h("slot", null))); } }; export { DataValue as bal_data_value };
export function isRequired(report, schema, json) { // eslint-disable-line import/prefer-default-export const originalPath = report.path; if (Array.isArray(schema.required)) { schema.required.forEach(prop => { const hasValue = json[prop]; if (!hasValue) { report.path = [prop]; // eslint-disable-line no-param-reassign report.addCustomError('IS_REQUIRED', 'Field is required', [prop], null, schema.description); } }); } report.path = originalPath; // eslint-disable-line no-param-reassign }
window.onload=function(){ id=$("#id").html(); $("#agree").click(function(){ window.location.href="/index.php/Index/sx/sx_hkHandle?id=" + id + "&option=1" }) $("#disagree").click(function(){ window.location.href="/index.php/Index/sx/sx_hkHandle?id=" + id + "&option=0" }) }
/** * The MIT License (MIT) * Copyright (c) 2016, Jeff Jenkins. */ const Constants = require('../constants/Constants'); const RequestAPI = require('./Api'); var _pendingRequests = {}; const API_URL = '/api/articles'; function makeUrl(part) { return API_URL + part; } //API calls var ArticleApi = { getEntityListData: function(count, skip, tag) { const url = makeUrl(''); const key = Constants.GET_ALL_ARTICLES_DATA; const params = {count: count, skip:skip, tag:tag}; RequestAPI.abortPendingRequests(key, _pendingRequests); RequestAPI.dispatch(Constants.PENDING, params); _pendingRequests[key] = RequestAPI.get(url, params).end( RequestAPI.makeResponseCallback(key, params) ); }, getEntityDataById: function(id) { if (!id){ return false;}else{ const url = makeUrl("/"+id); const key = Constants.GET_ARTICLE_DATA; const params = {}; const data = {_id:id} RequestAPI.abortPendingRequests(key, _pendingRequests); RequestAPI.dispatch(Constants.PENDING, params); _pendingRequests[key] = RequestAPI.get(url, params).end( RequestAPI.makeResponseCallback(key, params, data) ); } }, postEntityData: function(data) { const url = makeUrl(''); const key = Constants.POST_ARTICLE_DATA; const params = data; RequestAPI.abortPendingRequests(key, _pendingRequests); RequestAPI.dispatch(Constants.PENDING, params); _pendingRequests[key] = RequestAPI.post(url, params).end( RequestAPI.makeResponseCallback(key, params) ); }, deleteEntityData: function(id) { const url = makeUrl("/"+id); const key = Constants.DELETE_ARTICLE; const params = {}; RequestAPI.abortPendingRequests(key, _pendingRequests); RequestAPI.dispatch(Constants.PENDING, params); _pendingRequests[key] = RequestAPI.del(url, params).end( RequestAPI.makeResponseCallback(key, params) ); }, putEntityData: function(id, data) { const url = makeUrl('/'+id); const key = Constants.POST_ARTICLE_DATA; const params = data; RequestAPI.abortPendingRequests(key, _pendingRequests); RequestAPI.dispatch(Constants.PENDING, params); _pendingRequests[key] = RequestAPI.put(url, params).end( RequestAPI.makeResponseCallback(key, params) ); }, postEntityCommentData: function(id, data) { const url = makeUrl('/'+id+'/comments'); const key = Constants.POST_ARTICLE_COMMENT_DATA; const params = data; RequestAPI.abortPendingRequests(key, _pendingRequests); RequestAPI.dispatch(Constants.PENDING, params); _pendingRequests[key] = RequestAPI.post(url, params).end( RequestAPI.makeResponseCallback(key, params) ); }, deleteEntityCommentData: function(id, commentId) { const url = makeUrl('/'+ id +'/comments/'+ commentId); const key = Constants.DELETE_ARTICLE_COMMENT_DATA; const params = {}; RequestAPI.abortPendingRequests(key, _pendingRequests); RequestAPI.dispatch(Constants.PENDING, params); _pendingRequests[key] = RequestAPI.del(url, params).end( RequestAPI.makeResponseCallback(key, params) ); } }; module.exports = ArticleApi;
Chart.defaults.global = { animation: true, animationSteps: 60, animationEasing: "easeOutIn", showScale: true, scaleOverride: false, scaleSteps: null, scaleStepWidth: null, scaleStartValue: null, scaleLineColor: "#eeeeee", scaleLineWidth: 1, scaleShowLabels: true, scaleLabel: "<%=value%>", scaleIntegersOnly: true, scaleBeginAtZero: false, scaleFontSize: 12, scaleFontStyle: "normal", scaleFontColor: "#717171", responsive: true, maintainAspectRatio: true, showTooltips: true, multiTooltipTemplate: "<%= value %>", tooltipFillColor: "#333333", tooltipEvents: ["mousemove", "touchstart", "touchmove"], tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>", tooltipFontSize: 14, tooltipFontStyle: "normal", tooltipFontColor: "#fff", tooltipTitleFontSize: 16, TitleFontStyle : "Raleway", tooltipTitleFontStyle: "bold", tooltipTitleFontColor: "#ffffff", tooltipYPadding: 10, tooltipXPadding: 10, tooltipCaretSize: 8, tooltipCornerRadius: 6, tooltipXOffset: 5, onAnimationProgress: function() {}, onAnimationComplete: function() {} }; var barData = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [{ label: "My First dataset", fillColor: "rgba(36, 105, 92, 0.4)", strokeColor: vihoAdminConfig.primary, highlightFill: "rgba(36, 105, 92, 0.6)", highlightStroke: vihoAdminConfig.primary, data: [35, 59, 80, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(186, 137, 93, 0.4)", strokeColor: vihoAdminConfig.secondary, highlightFill: "rgba(186, 137, 93, 0.6)", highlightStroke: vihoAdminConfig.secondary, data: [28, 48, 40, 19, 86, 27, 90] }] }; var barOptions = { scaleBeginAtZero: true, scaleShowGridLines: true, scaleGridLineColor: "rgba(0,0,0,0.1)", scaleGridLineWidth: 1, scaleShowHorizontalLines: true, scaleShowVerticalLines: true, barShowStroke: true, barStrokeWidth: 2, barValueSpacing: 5, barDatasetSpacing: 1, }; var barCtx = document.getElementById("myBarGraph").getContext("2d"); var myBarChart = new Chart(barCtx).Bar(barData, barOptions); var polarData = [ { value: 300, color: vihoAdminConfig.primary, highlight: "rgba(36, 105, 92, 1)", label: "Yellow" }, { value: 50, color: vihoAdminConfig.secondary, highlight: "rgba(186, 137, 93, 1)", label: "Sky" }, { value: 100, color: "#222222", highlight: "rgba(34,34,34,1)", label: "Black" }, { value: 40, color: "#717171", highlight: "rgba(113, 113, 113, 1)", label: "Grey" }, { value: 120, color: "#e2c636", highlight: "#616774", label: "Dark Grey" } ]; var polarOptions = { scaleShowLabelBackdrop: true, scaleBackdropColor: "rgba(255,255,255,0.75)", scaleBeginAtZero: true, scaleBackdropPaddingY: 2, scaleBackdropPaddingX: 2, scaleShowLine: true, segmentShowStroke: true, segmentStrokeColor: "#fff", segmentStrokeWidth: 2, animationSteps: 100, animationEasing: "easeOutBounce", animateRotate: true, animateScale: false, legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>" }; var polarCtx = document.getElementById("myPolarGraph").getContext("2d"); var myPolarChart = new Chart(polarCtx).PolarArea(polarData, polarOptions); var lineGraphData = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [{ label: "My First dataset", fillColor: "rgba(36, 105, 92, 0.5)", strokeColor: vihoAdminConfig.primary, pointColor: vihoAdminConfig.primary, pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "#000", data: [10, 59, 80, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(186, 137, 93, 0.3)", strokeColor: vihoAdminConfig.secondary, pointColor: vihoAdminConfig.secondary, pointStrokeColor: "#fff", pointHighlightFill: "#000", pointHighlightStroke: "rgba(30, 166, 236, 1)", data: [28, 48, 40, 19, 86, 27, 90] }] }; var lineGraphOptions = { scaleShowGridLines: true, scaleGridLineColor: "rgba(0,0,0,.05)", scaleGridLineWidth: 1, scaleShowHorizontalLines: true, scaleShowVerticalLines: true, bezierCurve: true, bezierCurveTension: 0.4, pointDot: true, pointDotRadius: 4, pointDotStrokeWidth: 1, pointHitDetectionRadius: 20, datasetStroke: true, datasetStrokeWidth: 2, datasetFill: true, legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>" }; var lineCtx = document.getElementById("myGraph").getContext("2d"); var myLineCharts = new Chart(lineCtx).Line(lineGraphData, lineGraphOptions); var radarData = { labels: ["Ford", "Chevy", "Toyota", "Honda", "Mazda"], datasets: [{ label: "My First dataset", fillColor: "rgba(36, 105, 92, 0.4)", strokeColor: vihoAdminConfig.primary, pointColor: vihoAdminConfig.primary, pointStrokeColor: vihoAdminConfig.primary, pointHighlightFill: vihoAdminConfig.primary, pointHighlightStroke: "rgba(68, 102, 242, 0.4)", data: [12, 3, 5, 18, 7] }] }; var radarOptions = { scaleShowGridLines: true, scaleGridLineColor: "rgba(0,0,0,.2)", scaleGridLineWidth: 1, scaleShowHorizontalLines: true, scaleShowVerticalLines: true, bezierCurve: true, bezierCurveTension: 0.4, pointDot: true, pointDotRadius: 3, pointDotStrokeWidth: 1, pointHitDetectionRadius: 20, datasetStroke: true, datasetStrokeWidth: 2, datasetFill: true, legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>" }; var radarCtx = document.getElementById("myRadarGraph").getContext("2d"); var myRadarChart = new Chart(radarCtx).Radar(radarData, radarOptions); var pieData = [ { value: 300, color: vihoAdminConfig.primary, highlight: vihoAdminConfig.primary, label: "Primary" }, { value: 50, color: vihoAdminConfig.secondary, highlight: vihoAdminConfig.secondary, label: "Secondary" }, { value: 100, color: "#d22d3d", highlight: "#d22d3d", label: "Danger" } ]; var pieOptions = { segmentShowStroke: true, segmentStrokeColor: "#fff", segmentStrokeWidth: 2, percentageInnerCutout: 0, animationSteps: 100, animationEasing: "easeOutBounce", animateRotate: true, animateScale: false, legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>" }; var doughnutData = [ { value: 300, color: vihoAdminConfig.primary, highlight: vihoAdminConfig.primary, label: "Primary" }, { value: 50, color: vihoAdminConfig.secondary, highlight: vihoAdminConfig.secondary, label: "Secondary" }, { value: 100, color: "#222222", highlight: "#222222", label: "Success" } ]; var doughnutOptions = { segmentShowStroke: true, segmentStrokeColor: "#fff", segmentStrokeWidth: 2, percentageInnerCutout: 50, animationSteps: 100, animationEasing: "easeOutBounce", animateRotate: true, animateScale: false, legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillColor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>" }; var doughnutCtx = document.getElementById("myDoughnutGraph").getContext("2d"); var myDoughnutChart = new Chart(doughnutCtx).Doughnut(doughnutData, doughnutOptions); var myLineChart = { labels: ["","10", "20", "30", "40", "50", "60", "70", "80"], datasets: [{ fillColor: "rgba(113, 113, 113, 0.2)", strokeColor: "#717171", pointColor: "#717171", data: [10, 20, 40, 30, 0, 20, 10, 30, 10] },{ fillColor: "rgba(186, 137, 93, 0.2)", strokeColor: vihoAdminConfig.secondary, pointColor: vihoAdminConfig.secondary, data: [20, 40, 10, 20, 40, 30, 40, 10, 20] }, { fillColor: "rgb(36, 105, 92, 0.2)", strokeColor: vihoAdminConfig.primary, pointColor: vihoAdminConfig.primary, data: [60, 10, 40, 30, 80, 30, 20, 90, 0] }] } var ctx = document.getElementById("myLineCharts").getContext("2d"); var LineChartDemo = new Chart(ctx).Line(myLineChart, { pointDotRadius: 2, pointDotStrokeWidth: 5, pointDotStrokeColor: "#ffffff", bezierCurve: false, scaleShowVerticalLines: false, scaleGridLineColor: "#eeeeee" });
import React from 'react' import { graphql, useStaticQuery } from 'gatsby' import { Link } from 'gatsby' const query = graphql` { allMdx { distinct(field: frontmatter___category) } } ` const Categories = () => { const {allMdx:{distinct}} = useStaticQuery(query) return ( <ul className="categories"> {distinct.map((category,index)=> { return ( <li key={index}> <Link to={`/${category}`} className="category"> {category} </Link> </li> ) })} </ul> ) } export default Categories
import React from "react"; import { Link, graphql } from "gatsby"; import Img from "gatsby-image"; import Layout from "../components/NavLayout/index"; export const query = graphql` query PostingTemplate($id: Int!) { strapiPosting(strapiId: { eq: $id }) { title description media { childImageSharp { fluid(maxWidth: 960) { ...GatsbyImageSharpFluid } } } } } `; const ArticleTemplate = ({ data }) => ( <Layout> <h1>{data.strapiPosting.title}</h1> <Img fluid={data.strapiPosting.media.childImageSharp.fluid} /> <p>{data.strapiPosting.description}</p> </Layout> ); export default ArticleTemplate;
#!/usr/bin/env node let args = require("args"); args .command("list", "List all bounded contexts for current application") ; const flags = args.parse(process.argv); if( args.sub.length == 0 ) args.showHelp();
/** * Copyright 2016 The AMP HTML Authors. 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. */ /** * @typedef {{ * prefetch: (string|undefined), * preconnect: (string|undefined), * renderStartImplemented: (boolean|undefined), * clientIdScope: (string|undefined), * clientIdCookieName: (string|undefined), * consentHandlingOverride: (boolean|undefined), * remoteHTMLDisabled: (boolean|undefined), * fullWidthHeightRatio: (number|undefined), * mcFullWidthHeightRatio: (number|undefined), * }} */ let AdNetworkConfigDef; /** * The config of each ad network. * Please keep the list alphabetic order. * * yourNetworkName: { // This is the "type" attribute of <amp-ad> * * // List of URLs for prefetch * prefetch: string|array * * // List of hosts for preconnect * preconnect: string|array * * // The scope used to provide CIDs to ads * clientIdScope: string * * // The cookie name to store the CID. In absence, `clientIdScope` is used. * clientIdCookieName: string * * // If the ad network is willing to override the consent handling, which * // by default is blocking ad load until the consent is accepted. * consentHandlingOverride: boolean * * // Whether render-start API has been implemented * // We highly recommend all networks to implement the API, * // see details in the README.md * renderStartImplemented: boolean * * // The width / height ratio for full width ad units. * // If absent, it means the network does not support full width ad units. * // Example value: 1.2 * fullWidthHeightRatio: number * * // The width / height ratio for matched content full width ad units. * // If absent, it means the network does not support matched content full * // width ad unit. * // Example value: 0.27 * mcFullWidthHeightRatio: number * } * * @const {!Object<string, !AdNetworkConfigDef>}} */ export const adConfig = { '_ping_': { renderStartImplemented: true, clientIdScope: '_PING_', consentHandlingOverride: true, }, '24smi': { prefetch: 'https://jsn.24smi.net/smi.js', preconnect: 'https://data.24smi.net', }, 'a8': { prefetch: 'https://statics.a8.net/amp/ad.js', renderStartImplemented: true, }, 'a9': { prefetch: 'https://z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US', }, 'accesstrade': { prefetch: 'https://h.accesstrade.net/js/amp/amp.js', }, 'adagio': { prefetch: 'https://js-ssl.neodatagroup.com/adagio_amp.js', preconnect: [ 'https://ad-aws-it.neodatagroup.com', 'https://tracker.neodatagroup.com', ], renderStartImplemented: true, }, 'adblade': { prefetch: 'https://web.adblade.com/js/ads/async/show.js', preconnect: [ 'https://staticd.cdn.adblade.com', 'https://static.adblade.com', ], renderStartImplemented: true, }, 'adbutler': { prefetch: 'https://servedbyadbutler.com/app.js', }, 'adform': {}, 'adfox': { prefetch: 'https://yastatic.net/pcode/adfox/loader.js', renderStartImplemented: true, }, 'adgeneration': { prefetch: 'https://i.socdm.com/sdk/js/adg-script-loader.js', }, 'adhese': { renderStartImplemented: true, }, 'adincube': { renderStartImplemented: true, }, 'adition': {}, 'adman': {}, 'admanmedia': { renderStartImplemented: true, }, 'admixer': { renderStartImplemented: true, preconnect: [ 'https://inv-nets.admixer.net', 'https://cdn.admixer.net', ], }, 'adocean': {}, 'adpicker': { renderStartImplemented: true, }, 'adplugg': { prefetch: 'https://www.adplugg.com/serve/js/ad.js', renderStartImplemented: true, }, 'adreactor': {}, 'adsense': { prefetch: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', preconnect: 'https://googleads.g.doubleclick.net', clientIdScope: 'AMP_ECID_GOOGLE', clientIdCookieName: '_ga', remoteHTMLDisabled: true, masterFrameAccessibleType: 'google_network', fullWidthHeightRatio: 1.2, mcFullWidthHeightRatio: 0.27, consentHandlingOverride: true, }, 'adsnative': { prefetch: 'https://static.adsnative.com/static/js/render.v1.js', preconnect: 'https://api.adsnative.com', }, 'adspeed': { preconnect: 'https://g.adspeed.net', renderStartImplemented: true, }, 'adspirit': {}, 'adstir': { prefetch: 'https://js.ad-stir.com/js/adstir_async.js', preconnect: 'https://ad.ad-stir.com', }, 'adtech': { prefetch: 'https://s.aolcdn.com/os/ads/adsWrapper3.js', preconnect: [ 'https://mads.at.atwola.com', 'https://aka-cdn.adtechus.com', ], }, 'adthrive': { prefetch: [ 'https://www.googletagservices.com/tag/js/gpt.js', ], preconnect: [ 'https://partner.googleadservices.com', 'https://securepubads.g.doubleclick.net', 'https://tpc.googlesyndication.com', ], renderStartImplemented: true, }, 'adunity': { preconnect: [ 'https://content.adunity.com', ], renderStartImplemented: true, }, 'aduptech': { prefetch: 'https://s.d.adup-tech.com/jsapi', preconnect: [ 'https://d.adup-tech.com', 'https://m.adup-tech.com', ], renderStartImplemented: true, }, 'adventive': { preconnect: [ 'https://ads.adventive.com', 'https://amp.adventivedev.com', ], renderStartImplemented: true, }, 'adverline': { prefetch: 'https://ads.adverline.com/richmedias/amp.js', preconnect: [ 'https://adnext.fr', ], renderStartImplemented: true, }, 'adverticum': {}, 'advertserve': { renderStartImplemented: true, }, 'adyoulike': { consentHandlingOverride: true, prefetch: 'https://pixels.omnitagjs.com/amp.js', renderStartImplemented: true, }, 'adzerk': {}, 'affiliateb': { prefetch: 'https://track.affiliate-b.com/amp/a.js', renderStartImplemented: true, }, 'aja': { renderStartImplemented: true, prefetch: 'https://cdn.as.amanad.adtdp.com/sdk/asot-v2.js', }, 'appvador': { prefetch: [ 'https://cdn.apvdr.com/js/VastAdUnit.min.js', 'https://cdn.apvdr.com/js/VideoAd.min.js', 'https://cdn.apvdr.com/js/VideoAd3PAS.min.js', 'https://cdn.apvdr.com/js/VideoAdAutoPlay.min.js', 'https://cdn.apvdr.com/js/VideoAdNative.min.js', ], renderStartImplemented: true, }, 'amoad': { prefetch: [ 'https://j.amoad.com/js/a.js', 'https://j.amoad.com/js/n.js', ], preconnect: [ 'https://d.amoad.com', 'https://i.amoad.com', 'https://m.amoad.com', 'https://v.amoad.com', ], }, 'appnexus': { prefetch: 'https://acdn.adnxs.com/ast/ast.js', preconnect: 'https://ib.adnxs.com', renderStartImplemented: true, }, 'atomx': { prefetch: 'https://s.ato.mx/p.js', }, 'beopinion': { prefetch: 'https://widget.beopinion.com/sdk.js', preconnect: [ 'https://t.beopinion.com', 'https://s.beopinion.com', 'https://data.beopinion.com', ], renderStartImplemented: true, }, 'bidtellect': {}, 'brainy': {}, 'bringhub': { renderStartImplemented: true, preconnect: [ 'https://static.bh-cdn.com', 'https://core-api.bringhub.io', ], }, 'broadstreetads': { prefetch: 'https://cdn.broadstreetads.com/init-2.min.js', }, 'caajainfeed': { prefetch: [ 'https://cdn.amanad.adtdp.com/sdk/ajaamp.js', ], preconnect: [ 'https://ad.amanad.adtdp.com', ], }, 'capirs': { renderStartImplemented: true, }, 'caprofitx': { prefetch: [ 'https://cdn.caprofitx.com/pfx.min.js', 'https://cdn.caprofitx.com/tags/amp/profitx_amp.js', ], preconnect: 'https://ad.caprofitx.adtdp.com', }, 'cedato': { renderStartImplemented: true, }, 'chargeads': {}, 'colombia': { prefetch: 'https://static.clmbtech.com/ad/commons/js/colombia-amp.js', }, 'connatix': { renderStartImplemented: true, }, 'contentad': {}, 'criteo': { prefetch: 'https://static.criteo.net/js/ld/publishertag.js', preconnect: 'https://cas.criteo.com', }, 'csa': { prefetch: 'https://www.google.com/adsense/search/ads.js', }, 'dable': { preconnect: [ 'https://static.dable.io', 'https://api.dable.io', 'https://images.dable.io', ], renderStartImplemented: true, }, 'directadvert': { renderStartImplemented: true, }, 'distroscale': { preconnect: [ 'https://c.jsrdn.com', 'https://s.jsrdn.com', 'https://i.jsrdn.com', ], renderStartImplemented: true, }, 'dotandads': { prefetch: 'https://amp.ad.dotandad.com/dotandadsAmp.js', preconnect: 'https://bal.ad.dotandad.com', }, 'eadv': { renderStartImplemented: true, clientIdScope: 'AMP_ECID_EADV', prefetch: [ 'https://www.eadv.it/track/esr.min.js', 'https://www.eadv.it/track/ead.min.js', ], }, 'eas': { prefetch: 'https://amp.emediate.eu/amp.v0.js', renderStartImplemented: true, }, 'engageya': {}, 'epeex': {}, 'eplanning': { prefetch: 'https://us.img.e-planning.net/layers/epl-amp.js', }, 'ezoic': { prefetch: [ 'https://www.googletagservices.com/tag/js/gpt.js', 'https://g.ezoic.net/ezoic/ampad.js', ], clientIdScope: 'AMP_ECID_EZOIC', consentHandlingOverride: true, }, 'f1e': { prefetch: 'https://img.ak.impact-ad.jp/util/f1e_amp.min.js', }, 'f1h': { preconnect: 'https://img.ak.impact-ad.jp', renderStartImplemented: true, }, 'fake': {}, 'felmat': { prefetch: 'https://t.felmat.net/js/fmamp.js', renderStartImplemented: true, }, 'flite': {}, 'fluct': { preconnect: [ 'https://cdn-fluct.sh.adingo.jp', 'https://s.sh.adingo.jp', 'https://i.adingo.jp', ], }, 'freewheel': { prefetch: 'https://cdn.stickyadstv.com/prime-time/fw-amp.min.js', renderStartImplemented: true, }, 'fusion': { prefetch: 'https://assets.adtomafusion.net/fusion/latest/fusion-amp.min.js', }, 'genieessp': { prefetch: 'https://js.gsspcln.jp/l/amp.js', }, 'giraff': { renderStartImplemented: true, }, 'gmossp': { prefetch: 'https://cdn.gmossp-sp.jp/ads/amp.js', }, 'gumgum': { prefetch: 'https://g2.gumgum.com/javascripts/ad.js', renderStartImplemented: true, }, 'holder': { prefetch: 'https://i.holder.com.ua/js2/holder/ajax/ampv1.js', preconnect: 'https://h.holder.com.ua', renderStartImplemented: true, }, 'ibillboard': {}, 'imedia': { prefetch: 'https://i.imedia.cz/js/im3.js', renderStartImplemented: true, }, 'imobile': { prefetch: 'https://spamp.i-mobile.co.jp/script/amp.js', preconnect: 'https://spad.i-mobile.co.jp', }, 'imonomy': { renderStartImplemented: true, }, 'improvedigital': {}, 'industrybrains': { prefetch: 'https://web.industrybrains.com/js/ads/async/show.js', preconnect: [ 'https://staticd.cdn.industrybrains.com', 'https://static.industrybrains.com', ], renderStartImplemented: true, }, 'inmobi': { prefetch: 'https://cf.cdn.inmobi.com/ad/inmobi.secure.js', renderStartImplemented: true, }, 'innity': { prefetch: 'https://cdn.innity.net/admanager.js', preconnect: 'https://as.innity.com', renderStartImplemented: true, }, 'ix': { prefetch: [ 'https://js-sec.indexww.com/apl/amp.js', ], preconnect: 'https://as-sec.casalemedia.com', renderStartImplemented: true, }, 'kargo': {}, 'kiosked': { renderStartImplemented: true, }, 'kixer': { prefetch: 'https://cdn.kixer.com/ad/load.js', renderStartImplemented: true, }, 'kuadio': {}, 'ligatus': { prefetch: 'https://ssl.ligatus.com/render/ligrend.js', renderStartImplemented: true, }, 'lockerdome': { prefetch: 'https://cdn2.lockerdomecdn.com/_js/amp.js', renderStartImplemented: true, }, 'loka': { prefetch: 'https://loka-cdn.akamaized.net/scene/amp.js', preconnect: [ 'https://scene-front.lokaplatform.com', 'https://loka-materials.akamaized.net', ], renderStartImplemented: true, }, 'mads': { prefetch: 'https://eu2.madsone.com/js/tags.js', }, 'mantis-display': { prefetch: 'https://assets.mantisadnetwork.com/mantodea.min.js', preconnect: [ 'https://mantodea.mantisadnetwork.com', 'https://res.cloudinary.com', 'https://resize.mantisadnetwork.com', ], }, 'mantis-recommend': { prefetch: 'https://assets.mantisadnetwork.com/recommend.min.js', preconnect: [ 'https://mantodea.mantisadnetwork.com', 'https://resize.mantisadnetwork.com', ], }, 'mediaimpact': { prefetch: 'https://ec-ns.sascdn.com/diff/251/pages/amp_default.js', preconnect: [ 'https://ww251.smartadserver.com', 'https://static.sascdn.com/', ], renderStartImplemented: true, }, 'medianet': { preconnect: 'https://contextual.media.net', renderStartImplemented: true, }, 'mediavine': { prefetch: 'https://amp.mediavine.com/wrapper.min.js', preconnect: [ 'https://partner.googleadservices.com', 'https://securepubads.g.doubleclick.net', 'https://tpc.googlesyndication.com', ], renderStartImplemented: true, consentHandlingOverride: true, }, 'medyanet': { renderStartImplemented: true, }, 'meg': { renderStartImplemented: true, }, 'microad': { prefetch: 'https://j.microad.net/js/camp.js', preconnect: [ 'https://s-rtb.send.microad.jp', 'https://s-rtb.send.microadinc.com', 'https://cache.send.microad.jp', 'https://cache.send.microadinc.com', 'https://deb.send.microad.jp', ], }, 'miximedia': { renderStartImplemented: true, }, 'mixpo': { prefetch: 'https://cdn.mixpo.com/js/loader.js', preconnect: [ 'https://player1.mixpo.com', 'https://player2.mixpo.com', ], }, 'monetizer101': { renderStartImplemented: true, }, 'mytarget': { prefetch: 'https://ad.mail.ru/static/ads-async.js', renderStartImplemented: true, }, 'mywidget': { preconnect: 'https://likemore-fe.go.mail.ru', prefetch: 'https://likemore-go.imgsmail.ru/widget_amp.js', renderStartImplemented: true, }, 'nativo': { prefetch: 'https://s.ntv.io/serve/load.js', }, 'navegg': { renderStartImplemented: true, }, 'nend': { prefetch: 'https://js1.nend.net/js/amp.js', preconnect: [ 'https://output.nend.net', 'https://img1.nend.net', ], }, 'netletix': { preconnect: [ 'https://call.netzathleten-media.de', ], renderStartImplemented: true, }, 'noddus': { prefetch: 'https://noddus.com/amp_loader.js', renderStartImplemented: true, }, 'nokta': { prefetch: 'https://static.virgul.com/theme/mockups/noktaamp/ampjs.js', renderStartImplemented: true, }, 'onead': { prefetch: 'https://ad-specs.guoshipartners.com/static/js/onead-amp.min.js', renderStartImplemented: true, }, 'openadstream': {}, 'openx': { prefetch: 'https://www.googletagservices.com/tag/js/gpt.js', preconnect: [ 'https://partner.googleadservices.com', 'https://securepubads.g.doubleclick.net', 'https://tpc.googlesyndication.com', ], renderStartImplemented: true, }, 'outbrain': { renderStartImplemented: true, prefetch: 'https://widgets.outbrain.com/widgetAMP/outbrainAMP.min.js', preconnect: [ 'https://odb.outbrain.com', ], consentHandlingOverride: true, }, 'pixels': { prefetch: 'https://cdn.adsfactor.net/amp/pixels-amp.min.js', clientIdCookieName: '__AF', renderStartImplemented: true, }, 'plista': {}, 'polymorphicads': { prefetch: 'https://www.polymorphicads.jp/js/amp.js', preconnect: [ 'https://img.polymorphicads.jp', 'https://ad.polymorphicads.jp', ], renderStartImplemented: true, }, 'popin': { renderStartImplemented: true, }, 'postquare': {}, 'pressboard': { renderStartImplemented: true, }, 'pubexchange': {}, 'pubguru': { renderStartImplemented: true, }, 'pubmatic': { prefetch: 'https://ads.pubmatic.com/AdServer/js/amp.js', }, 'pubmine': { prefetch: [ 'https://s.pubmine.com/head.js', 'https://s.pubmine.com/showad.js', ], preconnect: 'https://delivery.g.switchadhub.com', renderStartImplemented: true, }, 'pulsepoint': { prefetch: 'https://ads.contextweb.com/TagPublish/getjs.static.js', preconnect: 'https://tag.contextweb.com', }, 'purch': { prefetch: 'https://ramp.purch.com/serve/creative_amp.js', renderStartImplemented: true, }, 'quoraad': { prefetch: 'https://a.quora.com/amp_ad.js', preconnect: 'https://ampad.quora.com', renderStartImplemented: true, }, 'realclick': { renderStartImplemented: true, }, 'recomad': { renderStartImplemented: true, }, 'relap': { renderStartImplemented: true, }, 'revcontent': { prefetch: 'https://labs-cdn.revcontent.com/build/amphtml/revcontent.amp.min.js', preconnect: [ 'https://trends.revcontent.com', 'https://cdn.revcontent.com', 'https://img.revcontent.com', ], renderStartImplemented: true, }, 'revjet': { prefetch: 'https://cdn.revjet.com/~cdn/JS/03/amp.js', renderStartImplemented: true, }, 'rfp': { prefetch: 'https://js.rfp.fout.jp/rfp-amp.js', preconnect: 'https://ad.rfp.fout.jp', renderStartImplemented: true, }, 'rubicon': {}, 'runative': { prefetch: 'https://cdn.run-syndicate.com/sdk/v1/n.js', renderStartImplemented: true, }, 'sekindo': { renderStartImplemented: true, }, 'sharethrough': { renderStartImplemented: true, }, 'sklik': { prefetch: 'https://c.imedia.cz/js/amp.js', }, 'slimcutmedia': { preconnect: [ 'https://sb.freeskreen.com', 'https://static.freeskreen.com', 'https://video.freeskreen.com', ], renderStartImplemented: true, }, 'smartadserver': { prefetch: 'https://ec-ns.sascdn.com/diff/js/amp.v0.js', preconnect: 'https://static.sascdn.com', renderStartImplemented: true, }, 'smartclip': { prefetch: 'https://cdn.smartclip.net/amp/amp.v0.js', preconnect: 'https://des.smartclip.net', renderStartImplemented: true, }, 'smi2': { renderStartImplemented: true, }, 'sogouad': { prefetch: 'https://theta.sogoucdn.com/wap/js/aw.js', renderStartImplemented: true, }, 'sortable': { prefetch: 'https://www.googletagservices.com/tag/js/gpt.js', preconnect: [ 'https://tags-cdn.deployads.com', 'https://partner.googleadservices.com', 'https://securepubads.g.doubleclick.net', 'https://tpc.googlesyndication.com', ], renderStartImplemented: true, }, 'sovrn': { prefetch: 'https://ap.lijit.com/www/sovrn_amp/sovrn_ads.js', }, 'spotx': { preconnect: 'https://js.spotx.tv', renderStartImplemented: true, }, 'sunmedia': { prefetch: 'https://vod.addevweb.com/sunmedia/amp/ads/sunmedia.js', preconnect: 'https://static.addevweb.com', renderStartImplemented: true, }, 'swoop': { prefetch: 'https://www.swoop-amp.com/amp.js', preconnect: [ 'https://www.swpsvc.com', 'https://client.swpcld.com', ], renderStartImplemented: true, }, 'taboola': {}, 'teads': { prefetch: 'https://a.teads.tv/media/format/v3/teads-format.min.js', preconnect: [ 'https://cdn2.teads.tv', 'https://t.teads.tv', 'https://r.teads.tv', ], consentHandlingOverride: true, }, 'triplelift': {}, 'trugaze': { clientIdScope: '__tg_amp', renderStartImplemented: true, }, 'uas': { prefetch: 'https://ads.pubmatic.com/AdServer/js/phoenix.js', }, 'uzou': { preconnect: [ 'https://speee-ad.akamaized.net', ], renderStartImplemented: true, }, 'unruly': { prefetch: 'https://video.unrulymedia.com/native/native-loader.js', renderStartImplemented: true, }, 'valuecommerce': { prefetch: 'https://amp.valuecommerce.com/amp_bridge.js', preconnect: [ 'https://ad.jp.ap.valuecommerce.com', 'https://ad.omks.valuecommerce.com', ], renderStartImplemented: true, }, 'videointelligence': { preconnect: 'https://s.vi-serve.com', renderStartImplemented: true, }, 'videonow': { renderStartImplemented: true, }, 'viralize': { renderStartImplemented: true, }, 'vmfive': { prefetch: 'https://man.vm5apis.com/dist/adn-web-sdk.js', preconnect: [ 'https://vawpro.vm5apis.com', 'https://vahfront.vm5apis.com', ], renderStartImplemented: true, }, 'webediads': { prefetch: 'https://eu1.wbdds.com/amp.min.js', preconnect: [ 'https://goutee.top', 'https://mediaathay.org.uk', ], renderStartImplemented: true, }, 'weborama-display': { prefetch: [ 'https://cstatic.weborama.fr/js/advertiserv2/adperf_launch_1.0.0_scrambled.js', 'https://cstatic.weborama.fr/js/advertiserv2/adperf_core_1.0.0_scrambled.js', ], }, 'widespace': {}, 'wisteria': { renderStartImplemented: true, }, 'wpmedia': { prefetch: 'https://std.wpcdn.pl/wpjslib/wpjslib-amp.js', preconnect: [ 'https://www.wp.pl', 'https://v.wpimg.pl', ], renderStartImplemented: true, }, 'xlift': { prefetch: 'https://cdn.x-lift.jp/resources/common/xlift_amp.js', renderStartImplemented: true, }, 'yahoo': { prefetch: 'https://s.yimg.com/os/ampad/display.js', preconnect: 'https://us.adserver.yahoo.com', }, 'yahoojp': { prefetch: [ 'https://s.yimg.jp/images/listing/tool/yads/ydn/amp/amp.js', 'https://yads.c.yimg.jp/js/yads.js', ], preconnect: 'https://yads.yahoo.co.jp', }, 'yandex': { prefetch: 'https://yastatic.net/partner-code/loaders/context_amp.js', renderStartImplemented: true, }, 'yengo': { renderStartImplemented: true, }, 'yieldbot': { prefetch: [ 'https://cdn.yldbt.com/js/yieldbot.intent.amp.js', 'https://msg.yldbt.com/js/ybmsg.html', ], preconnect: 'https://i.yldbt.com', }, 'yieldmo': { prefetch: 'https://static.yieldmo.com/ym.1.js', preconnect: [ 'https://s.yieldmo.com', 'https://ads.yieldmo.com', ], renderStartImplemented: true, }, 'yieldone': { prefetch: 'https://img.ak.impact-ad.jp/ic/pone/commonjs/yone-amp.js', }, 'yieldpro': { preconnect: 'https://creatives.yieldpro.eu', renderStartImplemented: true, }, 'zedo': { prefetch: 'https://ss3.zedo.com/gecko/tag/Gecko.amp.min.js', renderStartImplemented: true, }, 'zen': { prefetch: 'https://zen.yandex.ru/widget-loader', preconnect: [ 'https://yastatic.net/', ], renderStartImplemented: true, }, 'zergnet': {}, 'zucks': { preconnect: [ 'https://j.zucks.net.zimg.jp', 'https://sh.zucks.net', 'https://k.zucks.net', 'https://static.zucks.net.zimg.jp', ], }, 'baidu': { prefetch: 'https://dup.baidustatic.com/js/dm.js', renderStartImplemented: true, }, };
import Radio from './src/radio'; export default Radio;
var app=angular.module("CloudScript",["ngAnimate","firebase","ngRoute","ngCookies"]);
/* PRACTICALSERIES (c) 2017 ******************************************************************************* Title : LOCAL SCROLL - JQUERY 09-01-SCROLL.JS ******************************************************************************* PRACTICALSERIES: Practical Series of Publications by Michael Gledhill Published in the United Kingdom Email: mg@practicalseries.com Web: https://practicalseries.com ------------------------------------------------------------------------------- DETAILS LOCAL SCROLL FUNCTIONS jQuery is using the latest version from the GoogleAPIs library. This script applies the scroll to a point within the page (scrollTop) functionality for the current page. ------------------------------------------------------------------------------- NAMING CONVENTIONS Each <section> of the site has a waypoint (WP) reference number that identifies the start of each section. These are id attributes and have the format: #js--ccssii where: cc - chapter number ss - subsection number ii - inline section number The six digit number is unique to each section, i.e. section 2.1.3 would have waypoint reference js--020103 The trigger class used in the <a> element to trigger the scroll to the waypoint has the name .js-sc-000000 where the six digit number matches the waypoint number of the section that is to be scrolled to. The scrollTop function has an offset of -60px to ensure the title is visible below the fixed navigation bar. ------------------------------------------------------------------------------- MODIFICATION HISTORY: This is a complete summary of all software modifications. Date Issue Author Reason for Modification ------------------------------------------------------------------------------- 09 May 2019 R01 M. Gledhill First release (all files updated) 27 Mar 2019 P14 M. Gledhill Published 25 Mar 2019 d-P13.00.04h M. Gledhill Sections updated 31 May 2017 P10 M. Gledhill Migration to Git VCS FIRST PUBLISHED COMMIT Based on PS(LIVE-non VCS) P06.02 - .aside-revision class name change (.aside-right-rev) ---------------------------------------------------------------------------- */ /* **************************************************************************** WAIT FOR PAGE TO LOAD **************************************************************************** No jQuery actions take place until the webpage has loaded, all JQuery code is contained within the .ready(function()). ************************************************************************* */ $(document).ready(function() { /* START OF PAGE READY FUNCTION */ /* **************************************************************************** REVISION **************************************************************************** */ $('.aside-right-rev').append ( "<p>scroll.js&nbsp;&mdash;&nbsp;R01</p>" /* LOCAL JS REVISION NUMBER */ ); /* **************************************************************************** SCROLL TO SECTION **************************************************************************** This holds several scrollTop functions that scroll from the TOC to the specified section. There is one click function per <a> within the TOC. ************************************************************************* */ /* --------------------------------------------------------------------------- SCROLL TO TOP The offset is set to .to -80 - e.g. $('.js--sc-000000').click(function () { $('html, body').animate({scrollTop: $('#js--000000').offset().top -80}, 1000); }); ------------------------------------------------------------------------- */ $('.js--sc-000000').click(function () { /* START of scroll function */ $('html, body').animate({scrollTop: $('#js--000000').offset().top -80}, 1000); }); /* END of scroll function */ /* --------------------------------------------------------------------------- SCROLL TO CHAPTER (Non heading level after TOC) The offset is set to .to -10 - e.g. $('.js--sc-NN0000').click(function () { $('html, body').animate({scrollTop: $('#js--NN0000').offset().top -10}, 1000); }); ------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- SCROLL TO - SECTIONS & SUBSECTIONS The offset is set to .to -20 - e.g. $('.js--sc-NN0100').click(function () { $('html, body').animate({scrollTop: $('#js--NN0100').offset().top -20}, 1000); }); ------------------------------------------------------------------------- */ $('.js--sc-090100').click(function () { /* START of scroll function */ $('html, body').animate({scrollTop: $('#js--090100').offset().top -20}, 250); }); /* END of scroll function */ $('.js--sc-090101').click(function () { /* START of scroll function */ $('html, body').animate({scrollTop: $('#js--090101').offset().top -20}, 1000); }); /* END of scroll function */ $('.js--sc-090102').click(function () { /* START of scroll function */ $('html, body').animate({scrollTop: $('#js--090102').offset().top -20}, 1000); }); /* END of scroll function */ $('.js--sc-090103').click(function () { /* START of scroll function */ $('html, body').animate({scrollTop: $('#js--090103').offset().top -20}, 1000); }); /* END of scroll function */ /* --------------------------------------------------------------------------- SCROLL TO - NON-STANDARD (INLINE) SECTIONS The offset is set to .to -120 - e.g. $('.js--sc-nn0101a').click(function () { $('html, body').animate({scrollTop: $('#js--nn0101a').offset().top -120}, 1000); }); ------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- SCROLL TO - CROSS REFERENCES For figures, the offset is set to .to -80 - e.g. $('.js--sc-fNN-01').click(function () { $('html, body').animate({scrollTop: $('#js--fNN-01').offset().top -80}, 1000); }); For tables, the offset is set to .to -60 - e.g. $('.js--sc-tNN-01').click(function () { $('html, body').animate({scrollTop: $('#js--tNN-01').offset().top -60}, 1000); }); For codefragments, the offset is set to .to -120 - e.g. $('.js--sc-cNN-01').click(function () { $('html, body').animate({scrollTop: $('#js--cNN-01').offset().top -120}, 1000); }); For equations, the offset is set to .to -80 - e.g. $('.js--sc-eNN-01').click(function () { $('html, body').animate({scrollTop: $('#js--eNN-01').offset().top -80}, 1000); }); For footnotes, the offset is set to .to -60 - e.g. $('.js--sc-fnNN').click(function () { $('html, body').animate({scrollTop: $('#js--fnNN').offset().top -80}, 1000); }); ------------------------------------------------------------------------- */ $('.js--sc-f08-03').click(function () { $('html, body').animate({scrollTop: $('#js--f08-03').offset().top -80}, 1000); }); $('.js--sc-f08-04').click(function () { $('html, body').animate({scrollTop: $('#js--f08-04').offset().top -80}, 1000); }); $('.js--sc-f08-05').click(function () { $('html, body').animate({scrollTop: $('#js--f08-05').offset().top -80}, 1000); }); $('.js--sc-f08-06').click(function () { $('html, body').animate({scrollTop: $('#js--f08-06').offset().top -80}, 1000); }); }); /* END OF PAGE READY FUNCTION */
// Based on Zeptos touch.js // https://raw.github.com/madrobby/zepto/master/src/touch.js // Zepto.js may be freely distributed under the MIT license. ;(function($){ if ($.fn.swipeLeft) { return; } var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, longTapDelay = 750, gesture; function swipeDirection(x1, x2, y1, y2) { return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down'); } function longTap() { longTapTimeout = null; if (touch.last) { touch.el.trigger('longTap'); touch = {}; } } function cancelLongTap() { if (longTapTimeout) clearTimeout(longTapTimeout); longTapTimeout = null; } function cancelAll() { if (touchTimeout) clearTimeout(touchTimeout); if (tapTimeout) clearTimeout(tapTimeout); if (swipeTimeout) clearTimeout(swipeTimeout); if (longTapTimeout) clearTimeout(longTapTimeout); touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null; touch = {}; } function isPrimaryTouch(event){ return event.pointerType == event.MSPOINTER_TYPE_TOUCH && event.isPrimary; } $(function(){ var now, delta, deltaX = 0, deltaY = 0, firstTouch; if ('MSGesture' in window) { gesture = new MSGesture(); gesture.target = document.body; } $(document) .on('MSGestureEnd gestureend', function(e){ var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null; if (swipeDirectionFromVelocity) { touch.el.trigger('swipe'); touch.el.trigger('swipe'+ swipeDirectionFromVelocity); } }) // MSPointerDown: for IE10 // pointerdown: for IE11 .on('touchstart MSPointerDown pointerdown', function(e){ if(e.type == 'MSPointerDown' && !isPrimaryTouch(e.originalEvent)) return; firstTouch = (e.type == 'MSPointerDown' || e.type == 'pointerdown') ? e : e.originalEvent.touches[0]; now = Date.now(); delta = now - (touch.last || now); touch.el = $('tagName' in firstTouch.target ? firstTouch.target : firstTouch.target.parentNode); if(touchTimeout) clearTimeout(touchTimeout); touch.x1 = firstTouch.pageX; touch.y1 = firstTouch.pageY; if (delta > 0 && delta <= 250) touch.isDoubleTap = true; touch.last = now; longTapTimeout = setTimeout(longTap, longTapDelay); // adds the current touch contact for IE gesture recognition if (gesture && ( e.type == 'MSPointerDown' || e.type == 'pointerdown' || e.type == 'touchstart' ) ) { gesture.addPointer(e.originalEvent.pointerId); } }) // MSPointerMove: for IE10 // pointermove: for IE11 .on('touchmove MSPointerMove pointermove', function(e){ if (e.type == 'MSPointerMove' && !isPrimaryTouch(e.originalEvent)) return; firstTouch = (e.type == 'MSPointerMove' || e.type == 'pointermove') ? e : e.originalEvent.touches[0]; cancelLongTap(); touch.x2 = firstTouch.pageX; touch.y2 = firstTouch.pageY; deltaX += Math.abs(touch.x1 - touch.x2); deltaY += Math.abs(touch.y1 - touch.y2); }) // MSPointerUp: for IE10 // pointerup: for IE11 .on('touchend MSPointerUp pointerup', function(e){ if (e.type == 'MSPointerUp' && !isPrimaryTouch(e.originalEvent)) return; cancelLongTap(); // swipe if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){ swipeTimeout = setTimeout(function() { touch.el.trigger('swipe'); touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))); touch = {}; }, 0); // normal tap } else if ('last' in touch) { // don't fire tap when delta position changed by more than 30 pixels, // for instance when moving to a point and back to origin if (isNaN(deltaX) || (deltaX < 30 && deltaY < 30)) { // delay by one tick so we can cancel the 'tap' event if 'scroll' fires // ('tap' fires before 'scroll') tapTimeout = setTimeout(function() { // trigger universal 'tap' with the option to cancelTouch() // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) var event = $.Event('tap'); event.cancelTouch = cancelAll; touch.el.trigger(event); // trigger double tap immediately if (touch.isDoubleTap) { touch.el.trigger('doubleTap'); touch = {}; } // trigger single tap after 250ms of inactivity else { touchTimeout = setTimeout(function(){ touchTimeout = null; touch.el.trigger('singleTap'); touch = {}; }, 250); } }, 0); } else { touch = {}; } deltaX = deltaY = 0; } }) // when the browser window loses focus, // for example when a modal dialog is shown, // cancel all ongoing events .on('touchcancel MSPointerCancel', cancelAll); // scrolling the window indicates intention of the user // to scroll, not tap or swipe, so cancel all ongoing events $(window).on('scroll', cancelAll); }); ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){ $.fn[eventName] = function(callback){ return $(this).on(eventName, callback); }; }); })(jQuery);
'use strict'; var mongoose = require('mongoose'); var GalleryImage = require('./model'); var mw = { formatQuery: require('warepot/format-query'), paginate: require('warepot/paginate') }; module.exports = { create: function (req, res, next) { GalleryImage.create(req.body, function (err, galleryImage) { if (err) return next(err); res.status(201).json(galleryImage); }); }, find: function (req, res, next) { var page = Math.max(0, req.query.page) || 0; var perPage = Math.max(0, req.query.limit) || res.locals.perPage; var queryDocument = _.omit(req.query, 'limit', 'sort', 'page'); if (!req.user) queryDocument.datePublished = { $ne: null }; var query = GalleryImage.find(queryDocument, null, { sort: req.query.sort || '-dateCreated', lean: true }); if (perPage) query.limit(perPage).skip(perPage * page); query.exec(function (err, galleryImages) { res.locals.galleryImages = galleryImages; next(err); }); }, findById: function (req, res, next) { if (req.params.id === 'new') return next(); GalleryImage.findById(req.params.id).lean().exec(function (err, galleryImage) { if (err) return next(err); res.locals.galleryImage = galleryImage; next(); }); }, formatQuery: mw.formatQuery([ 'sort', 'limit', 'page' ]), getAll: function (req, res, next) { GalleryImage.find().sort('-uploadDate').lean().exec(function (err, galleryImages) { if (err) return next(err); res.locals.galleryImages = galleryImages; next(); }); }, getPublished: function (req, res, next) { GalleryImage.find({ datePublished: { $ne: null } }).sort('-datePublished').lean().exec(function (err, galleryImages) { if (err) return next(err); res.locals.galleryImages = galleryImages; next(); }); }, paginate: mw.paginate(GalleryImage, 20), patch: function (req, res, next) { var query = {}; query[mongoose.Types.ObjectId.isValid(req.params.id) ? '_id' : '_hid'] = req.params.id; GalleryImage.findOne(query, function (err, galleryImage) { delete req.body._id; delete req.body.__v; _.extend(galleryImage, req.body); return galleryImage.save(function (err) { if (err) return next(err); return res.status(200).json(galleryImage); }); }); }, put: function (req, res, next) { var query = {}; query[mongoose.Types.ObjectId.isValid(req.params.id) ? '_id' : '_hid'] = req.params.id; GalleryImage.findOne(query, function (err, galleryImage) { _.difference(_.keys(galleryImage.toObject()), _.keys(req.body)).forEach(function (key) { galleryImage[key] = undefined; }); _.extend(galleryImage, _.omit(req.body, '_id', '__v')); return galleryImage.save(function (err) { if (err) return next(err); return res.status(200).json(galleryImage); }); }); }, remove: function (req, res, next) { return GalleryImage.findById(req.params.id, function (err, galleryImage) { if (err) return next(err); return galleryImage.remove(function (err) { if (err) return next(err); return res.sendStatus(200); }); }); }, };
import adapter from '@sveltejs/adapter-static'; import preprocess from 'svelte-preprocess'; /** @type {import('@sveltejs/kit').Config} */ const config = { // Consult https://github.com/sveltejs/svelte-preprocess // for more information about preprocessors preprocess: [ preprocess({ postcss: true }) ], kit: { adapter: adapter({ pages: 'build', assets: 'build', fallback: 'app.html' }), ssr: false, // hydrate the <div id="svelte"> element in src/app.html target: '#svelte' } }; export default config;
export { BaseAnchor } from './src/components/BaseAnchor/BaseAnchor.esm.js'; export { getButtonCss } from './src/theme/styles/button.esm.js'; export { Button, getButtonStyles } from './src/components/Button/Button.esm.js'; export { AnchorButton } from './src/components/AnchorButton/AnchorButton.esm.js'; export { Announcement } from './src/components/Announcement/Announcement.esm.js'; export { fontSizes, fontWeights, fonts, letterSpacings, lineHeights, radii, shadows, transition } from './node_modules/gatsby-design-tokens/dist/index.esm.esm.js'; export { default as colors } from './src/theme/colors.esm.js'; export { default as Avatar } from './src/components/Avatar/Avatar.esm.js'; export { default as AvatarsGroup } from './src/components/Avatar/AvatarsGroup.esm.js'; export { LinkButton } from './src/components/LinkButton/LinkButton.esm.js'; export { BaseNavigation, BaseNavigationAnchorButton, BaseNavigationDropdown, BaseNavigationDropdownItem, BaseNavigationDropdownToggle, BaseNavigationHamburgerIcon, BaseNavigationItemAnchor, BaseNavigationItemLink, BaseNavigationLinkButton, BaseNavigationList, BaseNavigationListItem, BaseNavigationNav, useBaseNavigationContext } from './src/components/BaseNavigation/BaseNavigation.esm.js'; export { Badge } from './src/components/Badge/Badge.esm.js'; export { Link } from './src/components/Link/Link.esm.js'; export { default as BaseChip } from './src/components/Chip/BaseChip.esm.js'; export { default as Chip } from './src/components/Chip/Chip.esm.js'; export { default as CopyButton } from './src/components/CopyButton/CopyButton.esm.js'; export { default as DecorativeDots } from './src/components/DecorativeDots/DecorativeDots.esm.js'; export { Heading } from './src/components/Heading/Heading.esm.js'; export { default as BlogIcon } from './src/components/icons/BlogIcon.esm.js'; export { default as CheckIcon } from './src/components/icons/CheckIcon.esm.js'; export { default as PortfolioIcon } from './src/components/icons/PortfolioIcon.esm.js'; export { default as EcommerceIcon } from './src/components/icons/EcommerceIcon.esm.js'; export { default as CheckCircleIcon } from './src/components/icons/CheckCircleIcon.esm.js'; export { default as EllipsisIcon } from './src/components/icons/EllipsisIcon.esm.js'; export { default as InProgressIcon } from './src/components/icons/InProgressIcon.esm.js'; export { default as CloseCircleIcon } from './src/components/icons/CloseCircleIcon.esm.js'; export { default as SuccessIcon } from './src/components/icons/SuccessIcon.esm.js'; export { default as GeneralIcon } from './src/components/icons/GeneralIcon.esm.js'; export { default as ReportsIcon } from './src/components/icons/ReportsIcon.esm.js'; export { default as SkullIcon } from './src/components/icons/SkullIcon.esm.js'; export { default as BuildsIcon } from './src/components/icons/BuildsIcon.esm.js'; export { default as IntegrationsIcon } from './src/components/icons/IntegrationsIcon.esm.js'; export { default as zIndices } from './src/theme/zIndices.esm.js'; export { default as space } from './src/theme/space.esm.js'; export { default as breakpoints } from './src/theme/breakpoints.esm.js'; export { getTheme } from './src/theme/index.esm.js'; export { default as ThemeProvider, useTheme } from './src/components/ThemeProvider/ThemeProvider.esm.js'; export { default as FreePlanIcon } from './src/components/icons/FreePlanIcon.esm.js'; export { default as ProfessionalPlanIcon } from './src/components/icons/ProfessionalPlanIcon.esm.js'; export { default as BusinessPlanIcon } from './src/components/icons/BusinessPlanIcon.esm.js'; export { default as EnterprisePlanIcon } from './src/components/icons/EnterprisePlanIcon.esm.js'; export { default as Notification } from './src/components/Notification/Notification.esm.js'; export { hexToRGB, hexToRGBA } from './src/utils/helpers/hexToRgb.esm.js'; export { Navigation } from './src/components/Navigation/Navigation.esm.js'; export { Modal } from './src/components/Modal/Modal.esm.js'; export { ModalCard } from './src/components/Modal/ModalCard.esm.js'; export { ModalPanel } from './src/components/Modal/ModalPanel.esm.js'; export { ModalFullScreen } from './src/components/Modal/ModalFullScreen.esm.js'; export { StyledModal, StyledModalActions, StyledModalBody, StyledModalCloseButton, StyledModalHeader, useStyledModalContext } from './src/components/Modal/StyledModal.esm.js'; export { StickyLipShadow, StickyObservedContainer, StickyObserver, StickyObserverProvider, StickyObserverSentinel, useStickyObserver } from './src/components/StickyObserver/StickyObserver.esm.js'; export { StyledPanel, StyledPanelActions, StyledPanelBodySection, StyledPanelCloseButton, StyledPanelHeader } from './src/components/Modal/StyledPanel.esm.js'; export { default as dimensions } from './src/theme/dimensions.esm.js'; export { useShowErrorAlert, useShowErrorToast, useShowSuccessToast, useShowToast, useToastActions } from './src/components/Toast/hooks.esm.js'; export { ToastConsumer, ToastProvider } from './src/components/Toast/ToastProvider.esm.js'; export { default as Text } from './src/components/Text/Text.esm.js'; export { default as ToggleCheckbox } from './src/components/Toggle/ToggleCheckbox.esm.js'; export { default as ToggleSwitch } from './src/components/Toggle/ToggleSwitch.esm.js'; export { default as Breadcrumb } from './src/components/Breadcrumb/Breadcrumb.esm.js'; export { default as Tooltip } from './src/components/Tooltip/Tooltip.esm.js'; export { default as SidebarNav } from './src/components/SidebarNav/SidebarNav.esm.js'; export { Combobox, ComboboxInput, ComboboxList, ComboboxOption, ComboboxOptionText, ComboboxPopover, useComboboxContext } from './src/components/Combobox/Combobox.esm.js'; export { FormFieldContainer, useFormFieldContainerProps, useStyledFieldError, useStyledFieldHint, useStyledFieldLabel } from './src/components/form/components/FormField.esm.js'; export { getErrorId, getHintId } from './src/components/form-skeletons/utils/index.esm.js'; export { FormFieldSkeleton, FormFieldSkeletonError, FormFieldSkeletonHint, FormFieldSkeletonLabel, useFormFieldSkeleton } from './src/components/form-skeletons/components/FormFieldSkeleton.esm.js'; export { InputFieldSkeleton, InputFieldSkeletonControl, InputFieldSkeletonError, InputFieldSkeletonHint, InputFieldSkeletonLabel } from './src/components/form-skeletons/components/InputFieldSkeleton.esm.js'; export { InputField, InputFieldControl, InputFieldError, InputFieldHint, InputFieldLabel } from './src/components/form/components/InputField.esm.js'; export { InputFieldBlock } from './src/components/form/components/InputFieldBlock.esm.js'; export { useConnectedField } from './src/components/form/hooks/useConnectedField.esm.js'; export { InputConnectedField } from './src/components/form/components/InputConnectedField.esm.js'; export { TextAreaFieldSkeleton, TextAreaFieldSkeletonControl, TextAreaFieldSkeletonError, TextAreaFieldSkeletonHint, TextAreaFieldSkeletonLabel } from './src/components/form-skeletons/components/TextAreaFieldSkeleton.esm.js'; export { TextAreaField, TextAreaFieldControl, TextAreaFieldError, TextAreaFieldHint, TextAreaFieldLabel } from './src/components/form/components/TextAreaField.esm.js'; export { TextAreaFieldBlock } from './src/components/form/components/TextAreaFieldBlock.esm.js'; export { TextAreaConnectedField } from './src/components/form/components/TextAreaConnectedField.esm.js'; export { SelectFieldSkeleton, SelectFieldSkeletonControl, SelectFieldSkeletonError, SelectFieldSkeletonHint, SelectFieldSkeletonLabel } from './src/components/form-skeletons/components/SelectFieldSkeleton.esm.js'; export { SelectField, SelectFieldControl, SelectFieldError, SelectFieldHint, SelectFieldLabel } from './src/components/form/components/SelectField.esm.js'; export { SelectFieldBlock } from './src/components/form/components/SelectFieldBlock.esm.js'; export { SelectConnectedField } from './src/components/form/components/SelectConnectedField.esm.js'; export { CheckboxFieldSkeleton, CheckboxFieldSkeletonControl, CheckboxFieldSkeletonError, CheckboxFieldSkeletonHint, CheckboxFieldSkeletonLabel } from './src/components/form-skeletons/components/CheckboxFieldSkeleton.esm.js'; export { CheckboxField, CheckboxFieldControl, CheckboxFieldError, CheckboxFieldHint, CheckboxFieldLabel, CheckboxFieldWrapper, styledCheckboxCss } from './src/components/form/components/CheckboxField.esm.js'; export { CheckboxFieldBlock } from './src/components/form/components/CheckboxFieldBlock.esm.js'; export { CheckboxConnectedField } from './src/components/form/components/CheckboxConnectedField.esm.js'; export { CheckboxGroupFieldSkeleton, CheckboxGroupFieldSkeletonError, CheckboxGroupFieldSkeletonHint, CheckboxGroupFieldSkeletonLabel, CheckboxGroupFieldSkeletonOption, CheckboxGroupFieldSkeletonOptionLabel } from './src/components/form-skeletons/components/CheckboxGroupFieldSkeleton.esm.js'; export { CheckboxGroupField, CheckboxGroupFieldError, CheckboxGroupFieldHint, CheckboxGroupFieldLabel, CheckboxGroupFieldOption, CheckboxGroupFieldOptionItem, CheckboxGroupFieldOptionLabel, CheckboxGroupFieldOptionWrapper, CheckboxGroupFieldOptions } from './src/components/form/components/CheckboxGroupField.esm.js'; export { CheckboxGroupFieldBlock } from './src/components/form/components/CheckboxGroupFieldBlock.esm.js'; export { CheckboxGroupConnectedField } from './src/components/form/components/CheckboxGroupConnectedField.esm.js'; export { RadioButtonFieldSkeleton, RadioButtonFieldSkeletonError, RadioButtonFieldSkeletonHint, RadioButtonFieldSkeletonLabel, RadioButtonFieldSkeletonOption, RadioButtonFieldSkeletonOptionLabel } from './src/components/form-skeletons/components/RadioButtonFieldSkeleton.esm.js'; export { RadioButtonField, RadioButtonFieldError, RadioButtonFieldHint, RadioButtonFieldLabel, RadioButtonFieldOption, RadioButtonFieldOptionItem, RadioButtonFieldOptionLabel, RadioButtonFieldOptionWrapper, RadioButtonFieldOptions } from './src/components/form/components/RadioButtonField.esm.js'; export { RadioButtonFieldBlock } from './src/components/form/components/RadioButtonFieldBlock.esm.js'; export { RadioButtonConnectedField } from './src/components/form/components/RadioButtonConnectedField.esm.js'; export { ConcealedValue } from './src/components/ConcealedValue/ConcealedValue.esm.js'; export { DropdownMenu, DropdownMenuButton, DropdownMenuButtonStyled, DropdownMenuItem, DropdownMenuItems, DropdownMenuLink, DropdownMenuPopover, useDropdownMenuContext } from './src/components/DropdownMenu/DropdownMenu.esm.js'; export { StepIndicator } from './src/components/StepIndicator/StepIndicator.esm.js'; export { StepIndicatorStep } from './src/components/StepIndicator/StepIndicatorStep.esm.js'; export { DensityProvider, useDensity } from './src/components/DensityProvider/DensityProvider.esm.js'; export { Spacer } from './src/components/Spacer/Spacer.esm.js'; export { ProgressBar } from './src/components/ProgressBar/ProgressBar.esm.js'; export { PlanIndicator } from './src/components/PlanIndicator/PlanIndicator.esm.js'; export { getStackStyles } from './src/components/stack/stack.esm.js'; export { getClusterStyles } from './src/components/cluster/cluster.esm.js'; export { NumberBadge } from './src/components/NumberBadge/NumberBadge.esm.js'; export { TabsKeyboardActivation } from './node_modules/@reach/tabs/dist/tabs.esm.esm.js'; export { tabsStyles } from './src/components/Tabs/Tabs.styles.esm.js'; export { Tab, TabList, TabPanel, TabPanels, Tabs, useTabsContext } from './src/components/Tabs/Tabs.esm.js'; //# sourceMappingURL=index.esm.js.map
import curry from 'ramda/src/curry'; import placeholder from 'ramda/src/__'; function forOwn(obj, fn) { for (const key in obj) { if (obj.hasOwnProperty(key)) { fn(obj[key], key); } } } function isArrayLike(value) { return value && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && value.length % 1 === 0; } const OWNER_ID_TAG = '@@_______immutableOpsOwnerID'; function fastArrayCopy(arr) { const copied = new Array(arr.length); for (let i = 0; i < arr.length; i++) { copied[i] = arr[i]; } return copied; } export function canMutate(obj, ownerID) { if (!ownerID) return false; return obj[OWNER_ID_TAG] === ownerID; } const newOwnerID = typeof Symbol === 'function' ? () => Symbol('ownerID') : () => ({}); export const getBatchToken = newOwnerID; function addOwnerID(obj, ownerID) { Object.defineProperty(obj, OWNER_ID_TAG, { value: ownerID, configurable: true, enumerable: false, }); return obj; } function prepareNewObject(instance, ownerID) { if (ownerID) { addOwnerID(instance, ownerID); } return instance; } function forceArray(arg) { if (!(arg instanceof Array)) { return [arg]; } return arg; } const PATH_SEPARATOR = '.'; function normalizePath(pathArg) { if (typeof pathArg === 'string') { if (pathArg.indexOf(PATH_SEPARATOR) === -1) { return [pathArg]; } return pathArg.split(PATH_SEPARATOR); } return pathArg; } function mutableSet(key, value, obj) { obj[key] = value; return obj; } function mutableSetIn(_pathArg, value, obj) { const originalPathArg = normalizePath(_pathArg); const pathLen = originalPathArg.length; let done = false; let idx = 0; let acc = obj; let curr = originalPathArg[idx]; while (!done) { if (idx === pathLen - 1) { acc[curr] = value; done = true; } else { const currType = typeof acc[curr]; if (currType === 'undefined') { const newObj = {}; prepareNewObject(newObj, null); acc[curr] = newObj; } else if (currType !== 'object') { const pathRepr = `${originalPathArg[idx - 1]}.${curr}`; throw new Error( `A non-object value was encountered when traversing setIn path at ${pathRepr}.`, ); } acc = acc[curr]; idx++; curr = originalPathArg[idx]; } } return obj; } function valueInPath(_pathArg, obj) { const pathArg = normalizePath(_pathArg); let acc = obj; for (let i = 0; i < pathArg.length; i++) { const curr = pathArg[i]; const currRef = acc[curr]; if (i === pathArg.length - 1) { return currRef; } if (typeof currRef === 'object') { acc = currRef; } else { return undefined; } } } function immutableSetIn(ownerID, _pathArg, value, obj) { const pathArg = normalizePath(_pathArg); const currentValue = valueInPath(pathArg, obj); if (value === currentValue) return obj; const pathLen = pathArg.length; let acc; if (canMutate(obj, ownerID)) { acc = obj; } else { acc = Object.assign(prepareNewObject({}, ownerID), obj); } const rootObj = acc; pathArg.forEach((curr, idx) => { if (idx === pathLen - 1) { acc[curr] = value; return; } const currRef = acc[curr]; const currType = typeof currRef; if (currType === 'object') { if (canMutate(currRef, ownerID)) { acc = currRef; } else { const newObj = prepareNewObject({}, ownerID); acc[curr] = Object.assign(newObj, currRef); acc = newObj; } return; } if (currType === 'undefined') { const newObj = prepareNewObject({}, ownerID); acc[curr] = newObj; acc = newObj; return; } const pathRepr = `${pathArg[idx - 1]}.${curr}`; throw new Error(`A non-object value was encountered when traversing setIn path at ${pathRepr}.`); }); return rootObj; } function mutableMerge(isDeep, _mergeObjs, baseObj) { const mergeObjs = forceArray(_mergeObjs); if (isDeep) { mergeObjs.forEach(mergeObj => { forOwn(mergeObj, (value, key) => { if (isDeep && baseObj.hasOwnProperty(key)) { let assignValue; if (typeof value === 'object') { assignValue = mutableMerge(isDeep, [value], baseObj[key]); } else { assignValue = value; } baseObj[key] = assignValue; } else { baseObj[key] = value; } }); }); } else { Object.assign(baseObj, ...mergeObjs); } return baseObj; } const mutableShallowMerge = mutableMerge.bind(null, false); const mutableDeepMerge = mutableMerge.bind(null, true); function mutableOmit(_keys, obj) { const keys = forceArray(_keys); keys.forEach(key => { delete obj[key]; }); return obj; } function _shouldMergeKey(obj, other, key) { return obj[key] !== other[key]; } function immutableMerge(isDeep, ownerID, _mergeObjs, obj) { if (canMutate(obj, ownerID)) return mutableMerge(isDeep, _mergeObjs, obj); const mergeObjs = forceArray(_mergeObjs); let hasChanges = false; let nextObject = obj; const willChange = () => { if (!hasChanges) { hasChanges = true; nextObject = Object.assign({}, obj); prepareNewObject(nextObject, ownerID); } }; mergeObjs.forEach(mergeObj => { forOwn(mergeObj, (mergeValue, key) => { if (isDeep && obj.hasOwnProperty(key)) { const currentValue = nextObject[key]; if (typeof mergeValue === 'object' && !(mergeValue instanceof Array)) { if (_shouldMergeKey(nextObject, mergeObj, key)) { const recursiveMergeResult = immutableMerge(isDeep, ownerID, mergeValue, currentValue); if (recursiveMergeResult !== currentValue) { willChange(); nextObject[key] = recursiveMergeResult; } } return true; // continue forOwn } } if (_shouldMergeKey(nextObject, mergeObj, key)) { willChange(); nextObject[key] = mergeValue; } }); }); return nextObject; } const immutableDeepMerge = immutableMerge.bind(null, true); const immutableShallowMerge = immutableMerge.bind(null, false); function immutableArrSet(ownerID, index, value, arr) { if (canMutate(arr, ownerID)) return mutableSet(index, value, arr); if (arr[index] === value) return arr; const newArr = fastArrayCopy(arr); newArr[index] = value; prepareNewObject(newArr, ownerID); return newArr; } function immutableSet(ownerID, key, value, obj) { if (isArrayLike(obj)) return immutableArrSet(ownerID, key, value, obj); if (canMutate(obj, ownerID)) return mutableSet(key, value, obj); if (obj[key] === value) return obj; const newObj = Object.assign({}, obj); prepareNewObject(newObj, ownerID); newObj[key] = value; return newObj; } function immutableOmit(ownerID, _keys, obj) { if (canMutate(obj, ownerID)) return mutableOmit(_keys, obj); const keys = forceArray(_keys); const keysInObj = keys.filter(key => obj.hasOwnProperty(key)); // None of the keys were in the object, so we can return `obj`. if (keysInObj.length === 0) return obj; const newObj = Object.assign({}, obj); keysInObj.forEach(key => { delete newObj[key]; }); prepareNewObject(newObj, ownerID); return newObj; } function mutableArrPush(_vals, arr) { const vals = forceArray(_vals); arr.push(...vals); return arr; } function mutableArrFilter(func, arr) { let currIndex = 0; let originalIndex = 0; while (currIndex < arr.length) { const item = arr[currIndex]; if (!func(item, originalIndex)) { arr.splice(currIndex, 1); } else { currIndex++; } originalIndex++; } return arr; } function mutableArrSplice(index, deleteCount, _vals, arr) { const vals = forceArray(_vals); arr.splice(index, deleteCount, ...vals); return arr; } function mutableArrInsert(index, _vals, arr) { return mutableArrSplice(index, 0, _vals, arr); } function immutableArrSplice(ownerID, index, deleteCount, _vals, arr) { if (canMutate(arr, ownerID)) return mutableArrSplice(index, deleteCount, _vals, arr); const vals = forceArray(_vals); const newArr = arr.slice(); prepareNewObject(newArr, ownerID); newArr.splice(index, deleteCount, ...vals); return newArr; } function immutableArrInsert(ownerID, index, _vals, arr) { if (canMutate(arr, ownerID)) return mutableArrInsert(index, _vals, arr); return immutableArrSplice(ownerID, index, 0, _vals, arr); } function immutableArrPush(ownerID, vals, arr) { return immutableArrInsert(ownerID, arr.length, vals, arr); } function immutableArrFilter(ownerID, func, arr) { if (canMutate(arr, ownerID)) return mutableArrFilter(func, arr); const newArr = arr.filter(func); if (newArr.length === arr.length) return arr; prepareNewObject(newArr, ownerID); return newArr; } const immutableOperations = { // object operations merge: immutableShallowMerge, deepMerge: immutableDeepMerge, omit: immutableOmit, setIn: immutableSetIn, // array operations insert: immutableArrInsert, push: immutableArrPush, filter: immutableArrFilter, splice: immutableArrSplice, // both set: immutableSet, }; const mutableOperations = { // object operations merge: mutableShallowMerge, deepMerge: mutableDeepMerge, omit: mutableOmit, setIn: mutableSetIn, // array operations insert: mutableArrInsert, push: mutableArrPush, filter: mutableArrFilter, splice: mutableArrSplice, // both set: mutableSet, }; export function getImmutableOps() { const immutableOps = Object.assign({}, immutableOperations); forOwn(immutableOps, (value, key) => { immutableOps[key] = curry(value.bind(null, null)); }); const mutableOps = Object.assign({}, mutableOperations); forOwn(mutableOps, (value, key) => { mutableOps[key] = curry(value); }); const batchOps = Object.assign({}, immutableOperations); forOwn(batchOps, (value, key) => { batchOps[key] = curry(value); }); function batched(_token, _fn) { let token; let fn; if (typeof _token === 'function') { fn = _token; token = getBatchToken(); } else { token = _token; fn = _fn; } const immutableOpsBoundToToken = Object.assign({}, immutableOperations); forOwn(immutableOpsBoundToToken, (value, key) => { immutableOpsBoundToToken[key] = curry(value.bind(null, token)); }); return fn(immutableOpsBoundToToken); } return Object.assign(immutableOps, { mutable: mutableOps, batch: batchOps, batched, __: placeholder, getBatchToken, }); } export const ops = getImmutableOps(); export default ops;
if (typeof exports === 'object') { var assert = require('assert'); var alasql = require('..'); } describe('Test 123 - SHOW DATABASES, TABLES, COLUMNS, INDEX, CREATE TABLE', function () { it('1. SHOW DATABASES', function (done) { alasql('create database test123a'); alasql('create database test123b'); alasql('use test123a'); var res = alasql('show databases'); assert(res.length >= 3); assert( res.filter(function (r) { return r.databaseid == 'test123a' || r.databaseid == 'test123b'; }).length == 2 ); var res = alasql('show databases like "123%"'); assert(res.length == 2); done(); }); it('2. SHOW TABLES', function (done) { alasql('create table one (a int, b int, c string)'); alasql('create table two (b int)'); alasql('create table three (c int)'); var res = alasql('show tables'); assert(res.length == 3); alasql('use test123b'); alasql('create table four (a int, b int, c int, d int)'); var res = alasql('show tables from test123a'); assert(res.length == 3); alasql('use test123a'); var res = alasql('show tables from test123a like "t%"'); assert(res.length == 2); done(); }); it('3. SHOW COLUMNS', function (done) { var res = alasql('show columns from one'); assert(res.length == 3); var res = alasql('show columns from four from test123b '); assert(res.length == 4); done(); }); it('4. SHOW CREATE TABLE', function (done) { var res = alasql('show create table one'); assert(res == 'CREATE TABLE one (a INT, b INT, c STRING)'); var res = alasql('show create table four from test123b'); assert(res == 'CREATE TABLE four (a INT, b INT, c INT, d INT)'); done(); }); it('5. SHOW INDEX', function (done) { alasql('insert into one values (1,1,1), (2,2,2), (4,4,4), (5,5,5), (6,6,6)'); alasql('insert into two values (1),(2),(3),(6)'); var res = alasql('show index from one'); // console.log(res); var res = alasql('select * from one join two using b'); // console.log(res); var res = alasql('show index from one'); // console.log(res); alasql('create index twob on two(b)'); var res = alasql('show index from two'); // console.log(res); alasql('create unique index onea on one(a)'); var res = alasql('show index from one'); // console.log(res); assert(false); done(); }); it('99.Clear database', function (done) { alasql('drop database test123a'); alasql('drop database test123b'); done(); }); });
//app.js var ut=require("utils/util.js"); App({ onLaunch: function () { //调用事先声明的方法 //输出当前时间 // console.log(ut.formatTime(new Date())) // console.log(ut.rand(1,10)) // 展示本地存储能力 var logs = wx.getStorageSync('logs') || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) // 登录 wx.login({ success: res => { // 发送 res.code 到后台换取 openId, sessionKey, unionId } }) // 获取用户信息 wx.getSetting({ success: res => { if (res.authSetting['scope.userInfo']) { // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框 wx.getUserInfo({ success: res => { // 可以将 res 发送给后台解码出 unionId this.globalData.userInfo = res.userInfo // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回 // 所以此处加入 callback 以防止这种情况 if (this.userInfoReadyCallback) { this.userInfoReadyCallback(res) } } }) } } }) }, globalData: { userInfo: null, abc:"你好!" } })
/** Jquery Data Filter JS - @version 1.0.7 - @url https://github.com/godoyrw/jquery-data-filter **/ !function(a){a.fn.filterData=function(t,i,n){var r=this;return void 0===i?r.filter(function(){return void 0!==a(this).data(t)}):void 0===n?r.filter(function(){return a(this).data(t)===i}):(r.filter(function(){return a(this).data(t)===i}).data(t,n),a(this).filterData(t,n))}}(jQuery);
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_autorenew = void 0; var ic_autorenew = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z" } }] }; exports.ic_autorenew = ic_autorenew;
var React = require('react'); var multiLangData = { "motocal": { "en": "motocal / Granblue Fantasy ATK Calculator", "ja": "元カレ計算機(グラブル攻撃力計算機)", "zh": "前男友计算器(碧蓝幻想攻击力计算器)", }, "応援テキスト": { "en": "Kanpa to Me", "ja": "製作者を応援する", "zh": "支持制作者", }, "メイン装備yes": { "en": "main", "ja": "メイン武器である", "zh": "是主手武器", }, "メイン装備no": { "en": "not main", "ja": "メイン武器ではない", "zh": "不是主手武器", }, "グラフ": { "en": "Graph", "ja": "グラフ", "zh": "图表", }, "使い方": { "en": "Manual(JP)", "ja": "使い方", "zh": "使用方法(日语)", }, "ジータ": { "en": "Player", "ja": "ジータ", "zh": "主角", }, "召喚石": { "en": "Summon", "ja": "召喚石", "zh": "召唤石", }, "キャラ": { "en": "Chara", "ja": "キャラ", "zh": "角色", }, "武器": { "en": "WPN", "ja": "武器", "zh": "武器", }, "武器(タブ)": { "en": "Weapon", "ja": "武器", "zh": "武器", }, "保存": { "en": "Save", "ja": "保存", "zh": "保存", }, "データ名": { "en": "Data Name", "ja": "データ名", "zh": "数据名", }, "ブラウザデータリスト": { "en": "Browser Data List", "ja": "ブラウザに保存されたデータ", "zh": "保存在浏览器中的数据", }, "ブラウザデータ読込": { "en": "Load", "ja": "読込", "zh": "读取", }, "ブラウザに保存": { "en": "Save", "ja": "保存", "zh": "保存", }, "データ移行": { "en": "Export/Import", "ja": "データ移行", "zh": "导入/导出", }, "移行データ出力": { "en": "Export", "ja": "データ出力", "zh": "数据导出", }, "移行データ入力": { "en": "Import", "ja": "データ入力", "zh": "数据导入", }, "ダウンロード": { "en": "Download", "ja": "ダウンロード", "zh": "下载", }, "アップロード": { "en": "Upload", "ja": "アップロード", "zh": "上传", }, "なし": { "en": "No job", "ja": "なし", "zh": "无职业", }, "無し": { "en": "none", "ja": "無し", "zh": "无", }, "火": { "en": "Fire", "ja": "火", "zh": "火", }, "風": { "en": "Wind", "ja": "風", "zh": "风", }, "土": { "en": "Earth", "ja": "土", "zh": "土", }, "水": { "en": "Water", "ja": "水", "zh": "水", }, "光": { "en": "Light", "ja": "光", "zh": "光", }, "闇": { "en": "Dark", "ja": "闇", "zh": "暗", }, "光/火": { "en": "Light/Fire", "ja": "光/火", "zh": "光/火", }, "光/闇": { "en": "Light/Dark", "ja": "光/闇", "zh": "光/暗", }, "闇/土": { "en": "Dark/Earth", "ja": "闇/土", "zh": "暗/土", }, "闇/水": { "en": "Dark/Water", "ja": "闇/水", "zh": "暗/水", }, "闇/火": { "en": "Dark/Fire", "ja": "闇/火", "zh": "暗/火", }, "火/水": { "en": "Fire/Water", "ja": "火/水", "zh": "火/水", }, "水/光": { "en": "Water/Light", "ja": "水/光", "zh": "水/光", }, "風/土": { "en": "Wind/Earth", "ja": "風/土", "zh": "风/土", }, "風/光": { "en": "Wind/Light", "ja": "風/光", "zh": "风/光", }, "風/火": { "en": "Wind/Fire", "ja": "風/火", "zh": "风/火", }, "土/光": { "en": "Earth/Light", "ja": "土/光", "zh": "土/光", }, "全属性": { "en": "All", "ja": "全属性", "zh": "全属性", }, "無": { "en": "Non", "ja": "無", "zh": "无", }, "無(技巧あり)": { "en": "Non (but Crit.)", "ja": "無(技巧あり)", "zh": "无 (有技巧)", }, "バフ": { "en": "Buff", "ja": "バフ", "zh": "Buff", }, "通常バフ": { "en": "ATK Buff", "ja": "攻撃バフ", "zh": "通常Buff", }, "通常バフ説明": { "en": "ATK Buff. ", "ja": "攻撃(攻刃)バフ。レイジIII(30%)、レイジIV(40%)など。", "zh": "通常攻刃Buff", }, "属性バフ": { "en": "Element Buff", "ja": "属性バフ", "zh": "属性Buff", }, "属性バフ説明": { "en": "Element Buff. Ultima Weapon(30%) etc.", "ja": "属性枠のバフ。オメガ武器(30%)など", "zh": "属性Buff", }, "その他バフ": { "en": "Other Buff", "ja": "別枠バフ", "zh": "其他Buff", }, "その他バフ説明": { "en": "Other Buff(GW Buff etc.)", "ja": "別枠乗算のバフ。騎空艇効果(10%)、騎空団炉サポ効果(10%)、副団アビ(5%)、攻撃アビ(20%)など。", "zh": "独立乘算Buff", }, "その他バフ2": { "en": "Other Buff II", "ja": "別枠バフ2", "zh": "其他Buff2", }, "その他バフ2説明": { "en": "Other Buff II", "ja": "別枠乗算のバフ(もし別枠バフが2つ以上ある場合用)", "zh": "独立乘算Buff(独立Buff有2个以上时用)", }, "HPバフ": { "en": "HP Buff", "ja": "HPバフ", "zh": "HP Buff", }, "HPバフ説明": { "en": "HP Buff(GW Buff etc.)", "ja": "HP上昇のバフ。副団長アビ(10%)、防衛アビ(20%)など。", "zh": "HP上升Buff(古战场等计算用)", }, "DAバフ": { "en": "DA Buff", "ja": "DAバフ", "zh": "DA Buff", }, "DAバフ説明": { "en": "Double Attack Buff for Party. The value will be added to Character's base double attack ratio. Four-Sky Blade(30%), Love Eternal(35%), Ultima Weapon(20%) etc.", "ja": "DA率が上がります。各キャラの基礎DA率に加算されます。四天刃(30%)、エタラブ(35%)、オメガ武器(20%)など。", "zh": "DA率上升。加在每个角色的基础DA率上。", }, "TAバフ": { "en": "TA Buff", "ja": "TAバフ", "zh": "TA Buff", }, "TAバフ説明": { "en": "Triple Attack Buff for Party. The value will be added to Character's base triple attack ratio. Four-Sky Blade(30%), Love Eternal(35%) etc.", "ja": "TA率が上がります。各キャラの基礎TA率に加算されます。四天刃(30%)、エタラブ(35%)など。", "zh": "TA率上升。加在每个角色的基础DA率上。", }, "追加ダメージ": { "en": "Bonus DMG", //a.k.a: additionalDamage "ja": "追加ダメージ", "zh": "追加伤害", }, "追加ダメージバフ": { "en": "Bonus DMG Buff", //a.k.a: additionalDamageBuff "ja": "追撃バフ", "zh": "追加伤害Buff", }, "追加ダメージバフ説明": { "en": "Bonus Damage will be added to \"Expected Turn Damage\". Chaser of Warlock(20%), Parazonium(15%) etc.", "ja": "通常攻撃に割合分の追加ダメージを上乗せします。予想ターン毎ダメージの算出に使用されます。ウォーロックのチェイサー(20%)、パラゾ(15%)など。", "zh": "视作追加伤害,额外加在伤害上。用在预想DPT的计算中。", }, "与ダメージ上昇": { "en": "Damage UP ", "ja": "与ダメージ上昇", "zh": "造成伤害上升", }, "個別バフ": { "en": "Indiv Buff", //a.k.a: Personal buff "ja": "個別バフ", "zh": "个别Buff", }, "残HP割合": { "en": "Remain HP Ratio", "ja": "残りHP割合", "zh": "剩余HP比例", }, "残りHP": { "en": "Remain HP", "ja": "残りHP", "zh": "剩余HP", }, "残HP割合説明(ジータのみ)": { "en": "Remain HP Ratio of the Player. Use \"Remain HP Ratio\" form in Buff for Party if you want to set the remain HP ratio of all member.", "ja": "ジータさんの残りHP割合です。パーティ全体の残りHP割合を一括で指定したい場合は、\"パーティ全体への効果\"側で\”残HP割合\"を指定して下さい。", "zh": "主角的剩余HP比例。要同时指定全队的剩余HP比例的时候,请指定\"对全队的效果\"中的\"剩余HP比例\"。 ", }, "残HP割合説明": { "en": "Remain HP Ratio of all members. (If chara's HP ratio is inputted, lower value is adopted for calculation.)", "ja": "パーティ全体の残りHP割合です。(キャラ個別の値が入力されている場合、より低い方を採用します)", "zh": "全队的剩余HP比例。(角色个别的值也有输入的话适用更低的)", }, "奥義ゲージ上昇量": { "en": "Charge Bar Buff", //a.k.a: ougiGageBuff "ja": "奥義ゲージ\n上昇量", "zh": "奥义槽上升量", }, "奥義ゲージ上昇率アップ": { "en": "Charge Bar\nSpeed UP", "ja": "奥義ゲージ\n上昇量", "zh": "奥义槽上升量上升", }, "奥義ゲージ上昇率アップ説明": { "en": "Used on the expected turn damage calculation.", "ja": "攻撃回数に応じた奥義ゲージ上昇量に影響します。予想ターン毎ダメージの算出に使用されます。", "zh": "影响奥义槽上升量。在预想DPT计算中有用到。", }, "チェインダメージアップ": { "en": "Chain Damage UP", //a.k.a: chainDamageUP "ja": "チェインダメージUP", "zh": "チェイン义伤害上升", }, "ダメージ上限アップ": { "en": "DMG Cap", //a.k.a: damagelimit "ja": "ダメージ上限", "zh": "伤害上限上升", }, "ダメージ上限アップ説明": { "en": "It is used to calc the normal attack damage. Unlike the game specification, C.A. Damage Cap does not go up.", "ja": "通常攻撃ダメージの算出に使用されます。グラブルの仕様とは異なり奥義ダメージ上限は上がりません。", "zh": "通常攻击伤害的计算中有用到。", }, "チェインダメージ上限アップ": { "en": "Chain Damage Cap", //a.k.a: chainDamageLimit "ja": "チェインダメージ上限UP", "zh": "链义伤害上限上升", }, "奥義ダメージ上限アップ": { "en": "C.A. DMG Cap", //a.k.a: ougiDamageLimit "ja": "奥義ダメージ\n上限", "zh": "奥义伤害上限上升", }, "チェインダメージ上限アップ": { "en": "Chain Damage Cap", //a.k.a: chainDamageLimit "ja": "チェインダメージ上限UP", "zh": "链义伤害上限上升", }, "奥義ダメージ上限アップ説明": { "en": "It is used to calc the Ougi damage.", "ja": "奥義ダメージの算出に使用されます。", "zh": "奥义伤害的计算中有用到。", }, "奥義ゲージ上昇奥義": { "en": "Charge Boost C.A.", "ja": "奥義ゲージ上昇奥義", "zh": "Charge Boost C.A.", }, "奥義ゲージ上昇奥義説明": { "en": "Decrease the maximum Charge Bar value by the effect size. Unsigned Kaneshige(10%) etc.", "ja": "奥義ゲージ最大値を効果分マイナスします(奥義ゲージ上昇率バフも加味)。無銘金重(10%)など", "zh": "Decrease the maximum Charge Bar value by the effect size. Unsigned Kaneshige(10%) etc.", }, "Advanced": { "en": "Advanced Settings", "ja": "より細かい設定", "zh": "高级设置", }, "Advanced 説明": { "en": "For people willing to calculate more particularly.", "ja": "もっともっと詳しく計算したい方向けの項目です。", "zh": "适合想要进行更加详细的计算的人。", }, "敵防御固有値": { "en": "Enemy's defense", "ja": "敵防御固有値", "zh": "敌人的防御值", }, "敵防御固有値説明": { "en": "Select enemy's defense value.\nIt affects damage calculations.", "ja": "想定される敵の防御固有値を設定します。\n単攻撃ダメージ、奥義ダメージ、\n 予想ターン毎ダメージの計算に影響します。\n (単攻撃ダメージに減衰補正がかかる(44万超え) \n ような攻撃力でない限り、編成の順位自体は変化しないと思われます。)", "zh": "设定假想敌的防御值。\n影响攻击伤害、奥义伤害、预想DPT。", }, "防御デバフ合計": { "en": "DEF debuff", "ja": "防御デバフ", "zh": "DEF debuff", }, "防御デバフ合計説明": { "en": "Set sums of defense debuff values.The normal lower limit is 50%. Forfeit category is 60%.", "ja": "防御デバフの合計をパーセントで設定。通常の下限が50%。喪失枠を付与すると60%になります。", "zh": "Set sums of defense debuff values.The normal lower limit is 50%. Forfeit category is 60%.", }, "ジータさん基礎DA率説明": { "en": "Input base double attack ratio of player.\nIt will be automatically changed when \"Job\" is changed.", "ja": "ジータさんの基礎DA率を設定します。\nジョブを変更すると自動的に切り替わります。", "zh": "设定主角的基础DA率。\n随着职业变更会自动切换。", }, "奥義倍率": { "en": "C.A. Multiplier", //a.k.a: ougiRatio "ja": "奥義倍率", "zh": "奥义倍率", }, "ジータさん基礎TA率説明": { "en": "Input base double attack ratio of player.\nIt will be automatically changed when \"Job\" is changed.", "ja": "ジータさんの基礎TA率を設定します。\nジョブを変更すると自動的に切り替わります。", "zh": "设定主角的基础TA率。\n随着职业变更会自动切换。", }, "ジータさん奥義倍率説明": { "en": "Input C.A. ratio of player.\nIt affects calculation of C.A. Damage and Expected Turn Damage.", "ja": "ジータさんの奥義倍率を設定します。\n奥義ダメージ、予想ターン毎ダメージの計算に影響します。", "zh": "设定主角的奥义倍率。\n影响奥义伤害和预测DPT。", }, "確保HP": { "en": "Minimum\nPlayer HP", "ja": "確保したい\nジータさんHP", "zh": "希望确保的主角HP量", }, "確保HP説明": { "en": "Input minimum HP of player.\nWeapon arrangement which HP gets lower than this value will be omitted.", "ja": "暴君・守護など混みの最終HPの最低ラインを設定できます。\nこれを下回った編成は表示されません。\n(初期値は0です) ジータさんのHPベースです。", "zh": "设定暴君・守护之类武器放入后最终HP的最低值。\n不会显示比这个值更低的编成。\n(初始值为0)以主角的HP作为基准。", }, "プロフィールタイトル": { "en": "Player Infomation", "ja": "ジータさん情報 (*: 推奨入力項目)", "zh": "主角情报(*: 推荐输入)", }, "ランク": { "en": "Rank", "ja": "ランク", "zh": "Rank", }, "ランク説明": { "en": "Base ATK and HP are based on this value.", "ja": "基礎攻撃力、基礎HPなどはランクに従って自動で計算されます", "zh": "基础攻击力、基础HP等会跟着Rank自动计算出。", }, "ジータさん性別": { "en": "Player's Sex", "ja": "ジータさん\n性別", "zh": "主角的性別", }, "ジョブ": { "en": "Classes", //a.k.a: job "ja": "ジョブ", "zh": "职业", }, "ジョブ説明": { "en": "Classes bonuses and Specialty weapons bonuses are automatically inclueded in calculation. Select \"none\" if you want no bonuses and Specialty weapons.", "ja": "ジョブごとのボーナス等は自動で反映されます。得意武器補正などを反映したくない場合\"なし\"を選択して下さい。", "zh": "不同职业的Bonus会自动反映。不想让得意武器补正之类反映出的话请选择\"无\"。", }, "攻撃ボーナス": { "en": "ATK Bonus", "ja": "攻撃ボーナス", "zh": "攻击Bonus", }, "HPボーナス": { "en": "HP Bonus", "ja": "HPボーナス", "zh": "HP Bonus", }, "攻刃ボーナス": { "en": "Might Bonus", "ja": "攻刃ボーナス", "zh": "攻刃Bonus", }, "守護ボーナス": { "en": "Aegis Bonus", "ja": "守護ボーナス", "zh": "守护Bonus", }, "ジータさんリミットボーナス": { "en": "Player's Extended Mastery", "ja": "ジータさんリミットボーナス", "zh": "Player's Extended Mastery", }, "ジータさんリミットボーナス説明": { "en": "Enter the Extended Mastery for each Class.", "ja": "ジョブごとのリミットボーナス(LB)を入力して下さい。", "zh": "Enter the Extended Mastery for each Class.", }, "味方全体のHP": { "en": "Total Party HP", "ja": "味方全体HP", "zh": "己方全体HP LB", }, "LB 攻撃力": { "en": "ATK ", "ja": "攻撃力", "zh": "攻击力", }, "LB HP": { "en": "HP", "ja": "HP", "zh": "HP", }, "得意武器攻撃1": { "en": "Specialty WPN I\n", "ja": "得意武器攻撃I", "zh": "武器LB 1", }, "得意武器攻撃2": { "en": "Specialty WPN II\n", "ja": "得意武器攻撃II", "zh": "武器LB 2", }, "得意武器攻撃の説明": { "en": "Specialty WPN Ⅱ (Over ★4) is calculated as 6%, 8%, 10% on the assumption that Ⅰ is all mastered.", "ja": "得意武器IIのLB(★4以上)は、Iをすべてマスター済みという前提で各6%, 8%, 10%として計算します。", "zh": "得意武器II的LB(★4以上)在I全部取得的前提下按6%, 8%, 10%计算。", }, "LB DA": { "en": "DA", "ja": "DA", "zh": "DA", }, "LB DAの説明": { "en": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", "ja": "II以降はIを★3まで取得していること前提です。", "zh": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", }, "LB TA": { "en": "TA", "ja": "TA", "zh": "TA", }, "LB TAの説明": { "en": "TA", "ja": "TA", "zh": "TA", }, "LB ダメージ上限UP": { "en": "DMG Cap", "ja": "ダメージ上限UP", "zh": "DMG Cap", }, "LB ダメージ上限UPの説明": { "en": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", "ja": "II以降はIを★3まで取得していること前提です。", "zh": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", }, "LB 奥義": { "en": "C.A. DMG", "ja": "奥義ダメージ", "zh": "C.A. DMG", }, "LB 奥義の説明": { "en": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", "ja": "II以降はIを★3まで取得していること前提です。", "zh": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", }, "LB 属性攻撃": { "en": "Element ATK", "ja": "属性攻撃", "zh": "Element ATK", }, "LB 属性攻撃の説明": { "en": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", "ja": "II以降はIを★3まで取得していること前提です。", "zh": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", }, "LB チェンバ": { "en": "Chain Burst DMG", "ja": "チェンバ", "zh": "Chain Burst DMG", }, "LB チェンバの説明": { "en": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", "ja": "II以降はIを★3まで取得していること前提です。", "zh": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", }, "LB チェンバ上限": { "en": "Chain Burst DMG Cap", "ja": "チェンバ上限", "zh": "Chain Burst DMG Cap", }, "LB チェンバ上限の説明": { "en": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", "ja": "II以降はIを★3まで取得していること前提です。", "zh": "It is assumed that Ⅰ has been acquired to ★3 since Ⅱ.", }, "LB クリティカル": { "en": "Critical", "ja": "クリティカル", "zh": "Critical", }, "LB クリティカルの説明": { "en": "", "ja": "発生率と倍率共にの%", "zh": "", }, "その他ジータさんLB": { "en": "Other Perk", "ja": "他LB", "zh": "Other Perk", }, "ジータさんマスターボーナス": { "en": "Player's Master Bonuses", "ja": "ジータさんマスターボーナス", "zh": "主角的职业满级Bonu", }, "ジータさんマスターボーナス説明": { "en": "Enter the total value of Master Bonuses to be acquired when you make Class Lv20.\n(GBF Party screen > Classes > Bonuses tab)", "ja": "ジョブLv20になると取得するマスターボーナスの合計値を入力して下さい\n(グラブル編成画面>ジョブ詳細>ボーナスタブ)", "zh": "Enter the total value of Master Bonuses to be acquired when you make Class Lv20.\n(GBF Party screen > Classes > Bonuses tab)", }, "マスボATK": { "en": "ATK", "ja": "攻撃力", "zh": "攻击力", }, "マスボATK説明": { "en": "The value of Job Master bonus \"ATK+○○%\"", "ja": "ジョブマスターボーナスの\"攻撃力+○○%\"の値です\n(各ジョブごとのボーナスとは別です)", "zh": "职业满级Bonus中\"攻击力+○○%\"中的值\n(和各职业的Bonus是独立的)", }, "マスボHP": { "en": "HP", "ja": "HP", "zh": "HP", }, "マスボHP説明": { "en": "The value of Job Master bonus \"HP+○○%\"", "ja": "ジョブマスターボーナスの\"HP+○○%\"の値です\n(各ジョブごとのボーナスとは別です)", "zh": "职业满级Bonus中\"HP+○○%\"中的值\n(和各职业的Bonus是独立的)", }, "マスボDA": { "en": "DA", "ja": "DA", "zh": "DA", }, "マスボDA説明": { "en": "The value of Job Master bonus \"DA+○○%\"", "ja": "ジョブマスターボーナスの\"DA+○○%\"の値です\n(各ジョブごとのボーナスとは別です)", "zh": "职业满级Bonus中\"DA+○○%\"中的值\n(和各职业的Bonus是独立的)", }, "マスボTA": { "en": "TA", "ja": "TA", "zh": "TA", }, "マスボTA説明": { "en": "The value of Job Master bonus \"TA+○○%\"", "ja": "ジョブマスターボーナスの\"TA+○○%\"の値です\n(各ジョブごとのボーナスとは別です)", "zh": "职业满级Bonus中\"TA+○○%\"中的值\n(和各职业的Bonus是独立的)", }, "マスボダメ上限": { "en": "DMG Cap", "ja": "ダメージ上限", "zh": "DMG Cap", }, "マスボダメ上限説明": { "en": "The value of Job Master bonus \"DMG Cap+○○%\"", "ja": "ジョブマスターボーナスの\"ダメージ上限+○○%\"の値です\n(各ジョブごとのボーナスとは別です)", "zh": "职业满级Bonus中\"DMG Cap+○○%\"中的值\n(和各职业的Bonus是独立的)", }, "ジータさん属性": { "en": "Player's Element", "ja": "ジータさん\n属性", "zh": "主角的属性", }, "敵の属性": { "en": "Enemy's Element", "ja": "敵の属性", "zh": "敌人的属性", }, "敵の属性説明": { "en": "Element Correlation is automatically judged.", "ja": "有利/非有利/不利は、敵の属性に従って自動で判定されます。", "zh": "有利/非有利/不利会随着敌人的属性自动判定出。", }, "基礎DA率": { "en": "Base DA", "ja": "基礎DA率", "zh": "基础DA率", }, "基礎TA率": { "en": "Base TA", "ja": "基礎TA率", "zh": "基础TA率", }, "パーティバフタイトル": { "en": "Buff for Party (Percentage)", "ja": "パーティ全体へのバフ等 (%表記)", "zh": "全队Buff (百分比)", }, "パーティバフ説明": { "en": "Input buffs for a party.", "ja": "パーティメンバ全体にかかるバフ等の情報を入力してください", "zh": "输入全队Buff", }, "保存済みリスト名説明": { "en": "Input the name of the saved grid.", "ja": "保存した編成の名前を設定できます", "zh": "设定保存到编成的名字", }, "チェイン数": { "en": "Chain Burst\nNumber", "ja": "チェイン数", "zh": "Chain数", }, "チェイン数説明": { "en": "Input the number of C.A. Chain. (1~4)", "ja": "チェイン数を指定してください(チェインバーストボーナスの係数が変化します)\n チェイン数1 → 0倍\n 2 → 1.25倍\n 3 → 1.33…倍\n 4 → 1.5倍", "zh": "设定Chain数(Chain Burst的系数会变化)", }, "ジータさんのみ": { "en": "(Player only)", "ja": "(ジータさんのみ)", "zh": "(主角限定)", }, "ジータさん": { "en": "Player", "ja": "ジータさん", "zh": "主角", }, "銃": { "en": "Gun", "ja": "銃", "zh": "铳", }, "刀": { "en": "Katana", "ja": "刀", "zh": "刀", }, "斧": { "en": "Axe", "ja": "斧", "zh": "斧", }, "弓": { "en": "Bow", "ja": "弓", "zh": "弓", }, "剣": { "en": "Sword", "ja": "剣", "zh": "剑", }, "短剣": { "en": "Dagger", "ja": "短剣", "zh": "短剑", }, "格闘": { "en": "Melee", //a.k.a: Fist "ja": "格闘", "zh": "格斗", }, "槍": { "en": "Spear", "ja": "槍", "zh": "枪", }, "楽器": { "en": "Music", "ja": "楽器", "zh": "乐器", }, "杖": { "en": "Staff", "ja": "杖", "zh": "杖", }, "得意": { "en": "Specialty", //a.k.a: Favorite "ja": "得意", "zh": "得意", }, "ベルセルク": { "en": "Berserker", "ja": "ベルセルク", "zh": "Berserker", }, "セージ": { "en": "Sage", "ja": "セージ", "zh": "Sage", }, "スパルタ": { "en": "Spartan", "ja": "スパルタ", "zh": "Spartan", }, "ウォーロック": { "en": "Warlock", "ja": "ウォーロック", "zh": "Warlock", }, "カオスルーダー": { "en": "Chaos lewder", "ja": "カオスルーダー", "zh": "Chaos Lewder", }, "義賊": { "en": "Bandit Tycoon", "ja": "義賊", "zh": "义贼", }, "レスラー": { "en": "Luchador", "ja": "レスラー", "zh": "Luchador", }, "ハウンドドッグ": { "en": "Nighthound", "ja": "ハウンドドッグ", "zh": "Nighthound", }, "アプサラス(槍)": { "en": "Apsaras (Spear)", "ja": "アプサラス(槍)", "zh": "Apsaras (枪)", }, "アプサラス(斧)": { "en": "Apsaras (Axe)", "ja": "アプサラス(斧)", "zh": "Apsaras (斧)", }, "エリュシオン": { "en": "Elysian", "ja": "エリュシオン", "zh": "Elysian", }, "グラディエーター": { "en": "Gladiator", "ja": "グラディエーター", "zh": "Gladiator", }, "クリュサオル": { "en": "Chrysaor", "ja": "クリュサオル", "zh": "Chrysaor", }, "クリュサオル(二刀)": { "en": "Chrysaor(Dual)", "ja": "クリュサオル(二刀)", "zh": "Chrysaor(Dual)", }, "ザ・グローリー": { "en": "Glorybringer", "ja": "ザ・グローリー", "zh": "Glorybringer", }, "魔法戦士": { "en": "Runeslayer", "ja": "魔法戦士", "zh": "魔法戦士", }, "剣豪": { "en": "Kengo", "ja": "剣豪", "zh": "剑豪", }, "ドクター": { "en": "Doctor", "ja": "ドクター", "zh": "ドクター", }, "黒猫道士": { "en": "Nekomancer", "ja": "黒猫道士", "zh": "黑猫道士", }, "アルケミスト": { "en": "Alchemist", "ja": "アルケミスト", "zh": "炼金术师", }, "忍者": { "en": "Ninja", "ja": "忍者", "zh": "忍者", }, "侍": { "en": "Samurai", "ja": "侍", "zh": "侍", }, "剣聖": { "en": "Sword Master", "ja": "剣聖", "zh": "剑圣", }, "ガンスリンガー": { "en": "Gunslinger", "ja": "ガンスリンガー", "zh": "Gunslinger", }, "賢者": { "en": "Mystic", "ja": "賢者", "zh": "贤者", }, "アサシン": { "en": "Assassin", "ja": "アサシン", "zh": "刺客", }, "ドラムマスター": { "en": "Drum Master", "ja": "ドラムマスター", "zh": "Drum Master", }, "ダンサー": { "en": "Dancer", "ja": "ダンサー", "zh": "Dancer", }, "メカニック": { "en": "Mechanic", "ja": "メカニック", "zh": "Mechanic", }, "ウェポンマスター": { "en": "Weapon Master", "ja": "ウェポンマスター", "zh": "Weapon Master", }, "ホーリーセイバー": { "en": "Holy Saber", "ja": "ホーリーセイバー", "zh": "Holy Saber", }, "ダークフェンサー": { "en": "Dark Fencer", "ja": "ダークフェンサー", "zh": "Dark Fencer", }, "ビショップ": { "en": "Bishop", "ja": "ビショップ", "zh": "Bishop", }, "ハーミット": { "en": "Hermit", "ja": "ハーミット", "zh": "Hermit", }, "ホークアイ": { "en": "Hawkeye", "ja": "ホークアイ", "zh": "Hawkeye", }, "オーガ": { "en": "Ogre", "ja": "オーガ", "zh": "Ogre", }, "サイドワインダー": { "en": "Sidewinder", "ja": "サイドワインダー", "zh": "Sidewinder", }, "スーパースター": { "en": "Superstar", "ja": "スーパースター", "zh": "Superstar", }, "ヴァルキュリア": { "en": "Valkyrie", "ja": "ヴァルキュリア", "zh": "Valkyrie", }, "攻撃": { "en": "Attack", "ja": "攻撃", "zh": "攻击", }, "バランス": { "en": "Balance", "ja": "バランス", "zh": "平衡", }, "防御": { "en": "Defense", "ja": "防御", "zh": "防御", }, "特殊": { "en": "Special", "ja": "特殊", "zh": "特殊", }, "回復": { "en": "Heal", "ja": "回復", "zh": "回复", }, "タイプ": { "en": "Type", "ja": "タイプ", "zh": "类型", }, "攻撃力": { "en": "ATK", "ja": "攻撃力", "zh": "攻击力", }, "攻撃力(二手技巧無し)": { "en": "Pure ATK", "ja": "攻撃力(二手技巧無し)", "zh": "攻击力(不考虑连击和技巧)", }, "戦力": { "en": "ATK+HP", "ja": "戦力", "zh": "战力", }, "連撃率": { "en": "DA/TA Ratio", "ja": "連撃率", "zh": "连击率", }, "期待攻撃回数": { "en": "Exp. Attack Freq.", "ja": "期待攻撃回数\n(期待攻撃力)", "zh": "攻击次数期望", }, "技巧期待攻撃力": { "en": "ATK with Critical", "ja": "技巧期待攻撃力", "zh": "考虑技巧的攻击力期望", }, "技巧期待値": { "en": "Exp. Critical Ratio", "ja": "技巧期待値\n(減衰補正後)", "zh": "技巧期望\n(考虑上限)", }, "残HP": { "en": "Remain HP", "ja": "残HP", "zh": "剩余HP", }, "パーティ平均攻撃力": { "en": "Party-Averaged Pure ATK", "ja": "パーティ平均攻撃力(二手技巧無し)", "zh": "全队平均攻击力(不考虑连击技巧)", }, "技巧平均攻撃力": { "en": "Party-Averaged ATK with Critical", "ja": "技巧平均攻撃力", "zh": "全队平均攻击力(考虑连击技巧)", }, "総合*回数*技巧": { "en": "PureATK*Crit.*Freq.", "ja": "総合*回数*技巧", "zh": "综合攻击力*攻击次数*技巧", }, "総回技": { "en": "PCF value", "ja": "総回技", "zh": "期望伤害(考虑连击技巧)", }, "総回技の平均": { "en": "Averaged PCF value", "ja": "総回技の平均", "zh": "平均期望伤害(考虑连击技巧)", }, "単攻撃ダメージ(技巧連撃無)": { "en": "Single Attack Damage", "ja": "単攻撃ダメージ(技巧連撃無)", "zh": "单次攻击伤害(不考虑连击技巧)", }, "単攻撃ダメージ(技巧有)": { "en": "Single Attack Damage\n(w/ Critical)", "ja": "単攻撃ダメージ(技巧有)", "zh": "单次攻击伤害(考虑技巧)", }, "単攻撃ダメージ(連撃有)": { "en": "Single Attack Damage\n(w/ Multiple)", "ja": "単攻撃ダメージ(連撃有)", "zh": "单词攻击伤害(考虑连击)", }, "単攻撃ダメージ(技巧連撃有)": { "en": "Single Attack Damage\n(w/ Crit. and Multi.)", "ja": "単攻撃ダメージ(技巧連撃有)", "zh": "单次攻击伤害(考虑连击技巧)", }, "ターン毎の奥義ゲージ上昇量": { "en": "Charge Bar Rise per Turn", "ja": "ターン毎の\n奥義ゲージ上昇量", "zh": "每回合奥义槽上升量", }, "奥義ダメージUP": { "en": "C.A. DMG", //a.k.a: ougiDamage "ja": "奥義ダメージUP", "zh": "奥义伤害", }, "チェインバースト": { "en": "Chain Burst", "ja": "チェインバースト", "zh": "Chain Burst", }, "予想ターン毎ダメージ": { "en": "Exp. Damage per Turn", //a.k.a: expectedCycleDamagePerTurn "ja": "予想ターンダメージ", "zh": "期望DPT", }, "パーティ平均予想ターン毎ダメージ": { "en": "Party-Averaged Exp. Turn Damage", "ja": "ターン毎ダメージの\nパーティ平均", "zh": "期望DPT/人", }, "技巧倍率": { "en": "Critical Ratio", "ja": "技巧倍率", "zh": "技巧倍率", }, "倍": { "en": "x", "ja": "倍", "zh": "倍", }, "発生確率": { "en": "Probability", "ja": "発生確率", "zh": "发生概率", }, "標準偏差": { "en": "SD", "ja": "標準偏差", "zh": "标准差", }, "四人合計値": { "en": "x4", "ja": "x四人", "zh": "x四人", }, "スキル合計": { "en": "Skill Amount", "ja": "スキル合計", "zh": "技能合计", }, "弱体耐性率": { "en": "Debuff Resistance", "ja": "弱体耐性率", "zh": "弱体耐性率", }, "有利": { "en": "Advantage", "ja": "有利", "zh": "有利", }, "非有利": { "en": "Non-advantage", "ja": "非有利", "zh": "非有利", }, "不利": { "en": "Weak", "ja": "不利", "zh": "不利", }, "背水グラフ": { "en": "Open Enmity Graph", "ja": "背水渾身グラフを開く", "zh": "打开背水浑身图表", }, "背水渾身グラフ": { "en": "Enmity Graph", "ja": "背水渾身グラフ", "zh": "背水浑身图表", }, "実際のHPで表示": { "en": "Based on real HP", "ja": "実際のHPで表示", "zh": "显示实际HP", }, "HP割合で表示": { "en": "Based on remain HP ratio", "ja": "HP割合で表示", "zh": "显示HP比例", }, "初期攻撃力推移グラフを開く": { "en": "Open Initial Attack Variation Graph", "ja": "初期攻撃力推移グラフを開く", "zh": "打开初始攻击变化图表", }, "初期攻撃力推移グラフ": { "en": "Initial Attack Variation Graph", "ja": "初期攻撃力推移グラフ", "zh": "初始攻击变化图表", }, "ダメージシミュレータを開く": { "en": "Open Damage Simulator", "ja": "ダメージシミュレータを開く", "zh": "打开伤害模拟器", }, "ダメージシミュレータ": { "en": "Damage Simulator", "ja": "ダメージシミュレータ", "zh": "伤害模拟器", }, "結果": { "en": "Result", "ja": "結果", "zh": "结果", }, "マグナ": { "en": "Magna", "ja": "マグナ", "zh": "方阵", }, "属性": { "en": "Element ", "ja": "属性", "zh": "属性", }, "EX": { "en": "EX", "ja": "EX", "zh": "EX", }, "EX背水": { "en": "EX Enmity", "ja": "EX背水", "zh": "EX背水", }, "属性攻": { "en": "Element ", "ja": "属性攻", "zh": "属性攻击", }, "属性(種族数)": { "en": "Element(Tesuka) ", "ja": "属性(種族数)", "zh": "属性(种族数)", }, "属性(経過ターン)": { "en": "Element(Sesuransu) ", "ja": "属性(経過ターン)", "zh": "属性(经过回合)", }, "神石系": { "en": "Primal", "ja": "神石系", "zh": "神石系", }, "蘭子": { "en": "Ranko ", "ja": "蘭子", "zh": "兰子", }, "キャラ攻": { "en": "Chara", "ja": "キャラ攻", "zh": "角色攻击", }, "属性攻+キャラ攻": { "en": "Odin(Element+Chara)", "ja": "属性攻+キャラ攻", "zh": "属性攻击+角色攻击", }, "優先項目": { "en": "Sort Key", "ja": "優先項目", "zh": "优先项目", }, "表示項目": { "en": "Display Key", "ja": "表示項目", "zh": "显示项目", }, "順位": { "en": "Rank", "ja": "順位", "zh": "顺序", }, "操作": { "en": "Option", "ja": "操作", "zh": "操作", }, "HP増加": { "en": "Health ", "ja": "HP増加", "zh": "HP增加", }, "通常攻刃": { "en": "Normal Might ", "ja": "通常攻刃", "zh": "通常攻刃", }, "通常背水": { "en": "Normal Enmity ", "ja": "通常背水", "zh": "通常背水", }, "通常渾身": { "en": "Normal Stamina ", "ja": "通常渾身", "zh": "通常浑身", }, "マグナ背水": { "en": "Magna Enmity ", "ja": "マグナ背水", "zh": "方阵背水", }, "マグナ渾身": { "en": "Magna Stamina ", "ja": "マグナ渾身", "zh": "方针浑身", }, "通常進境(大)(最大時)": { "en": "Normal Element ATK L", "ja": "通常進境(大)(最大時)", "zh": "通常属性攻击力(大)", }, "マグナ進境(大)(最大時)": { "en": "Magna Element ATK L", "ja": "マグナ進境(大)(最大時)", "zh": "方阵属性攻击力(大)", }, "アンノウン": { "en": "Unknown ", "ja": "アンノウン", "zh": "UNK", }, "アンノウン背水": { "en": "Unknown Enmity ", "ja": "アンノウン背水", "zh": "UNK背水", }, "キャラ背水": { "en": "Chara Enmity ", "ja": "キャラ背水", "zh": "角色背水", }, "攻撃力減少(特殊)": { "en": "ATK Debuff (special) ", "ja": "攻撃力減少(特殊)", "zh": "攻击力減少(特殊)", }, "DA上昇(通常)": { "en": "DA up (normal) ", "ja": "DA上昇(通常)", "zh": "DA上升(通常)", }, "DA上昇(マグナ)": { "en": "DA up (magna) ", "ja": "DA上昇(マグナ)", "zh": "DA上升(方针)", }, "DA上昇(EX)": { "en": "DA up (EX) ", "ja": "DA上昇(EX)", "zh": "DA上升(EX)", }, "DA上昇(バハ)": { "en": "DA up (bahamut) ", "ja": "DA上昇(バハ)", "zh": "DA上升(巴哈)", }, "DA上昇(コスモス)": { "en": "DA up (cosmos) ", "ja": "DA上昇(コスモス)", "zh": "DA上升(Cosmos)", }, "DA上昇(その他)": { "en": "DA up (other) ", "ja": "DA上昇(その他)", "zh": "DA上升(其他)", }, "TA上昇(通常)": { "en": "TA up (normal) ", "ja": "TA上昇(通常)", "zh": "TA上升(通常)", }, "TA上昇(マグナ)": { "en": "TA up (magna) ", "ja": "TA上昇(マグナ)", "zh": "TA上升(方阵)", }, "TA上昇(バハ)": { "en": "TA up (bahamut) ", "ja": "TA上昇(バハ)", "zh": "TA上升(巴哈)", }, "TA上昇(その他)": { "en": "TA up (other) ", "ja": "TA上昇(その他)", "zh": "TA上升(其他)", }, "グラフに加える": { "en": "Add to \ngraphs", "ja": "グラフに\n加える", "zh": "加入图表", }, "本": { "en": "", "ja": "", "zh": "", }, "結果を更新": { "en": "Update Results", "ja": "結果を更新", "zh": "更新结果", }, "自動更新: ON": { "en": "Auto Update: ON", "ja": "自動更新: ON", "zh": "自动更新: ON", }, "自動更新: OFF": { "en": "Auto Update: OFF", "ja": "自動更新: OFF", "zh": "自动更新: OFF", }, "属性一括変更": { "en": "Change All Element", "ja": "属性一括変更", "zh": "所有属性一起更改", }, "自分の石": { "en": "Player Summon", "ja": "自石の加護", "zh": "自己的召唤石", }, "フレの石": { "en": "Friend Summon", "ja": "フレ石の加護", "zh": "好友的召唤石", }, "合計攻撃力": { "en": "Total ATK", "ja": "合計攻撃力", "zh": "合计攻击力", }, "合計HP": { "en": "Total HP", "ja": "合計HP", "zh": "合计HP", }, "HP加護": { "en": "Health UP", "ja": "HP加護", "zh": "HP加护", }, "DA加護": { "en": "Double Attack", "ja": "DA加護", "zh": "DA加护", }, "DA加護の説明": { "en": "Halluel and Malluel(5~10%)etc.", "ja": "ハーマー(5~10%)など", "zh": "Halluel and Malluel(5~10%)etc.", }, "TA加護": { "en": "Triple Attack", "ja": "TA加護", "zh": "TA加护", }, "奥義ダメージアップ": { "en": "C.A. Damage UP", //a.k.a: OugiDamageUP "ja": "奥義ダメージUP", "zh": "奥义伤害上升", }, "与ダメージ加護": { "en": "Boost Damage", //a.k.a: tenshiDamageUP "ja": "与ダメ加護", "zh": "Boost Damage", }, "与ダメージ加護説明": { "en": "Boosts final damage. Arcarum summons(SR3~5%, SSR7~10%) etc.", "ja": "最終的な与ダメージが上昇します。アーカルム石(SR3~5%, SSR7~10%)など", "zh": "Boosts final damage. Arcarum summons(SR3~5%, SSR7~10%) etc.", }, "ダメージ上限加護": { "en": "Damage cap", //a.k.a: damageLimit "ja": "ダメージ上限加護", "zh": "Damage cap", }, "ダメージ上限加護説明": { "en": "Increases the damage cap. Primarch summons(5~10%) etc.", "ja": "ダメージ上限に加算されます。天司石(5~10%)など", "zh": "Increases the damage cap. Primarch summons(5~10%) etc.", }, "奥義ダメージ": { "en": "C.A. Damage", //a.k.a: ougiDamage "ja": "奥義ダメージ", "zh": "奥義ダメージ", }, "内容を消去": { "en": "Delete", "ja": "内容を消去", "zh": "删除内容", }, "コピー": { "en": "Copy", "ja": "コピー", "zh": "复制", }, "下にコピー": { "en": "Copy", "ja": "下にコピー", "zh": "向下复制", }, "追加": { "en": "Add", "ja": "追加", "zh": "追加", }, "削除": { "en": "Remove", "ja": "削除", "zh": "删除", }, "追加しました": { "en": "Added!", "ja": "追加しました。", "zh": "追加成功。", }, "キャラがいっぱい": { "en": "Chara list is full.", "ja": "キャラがいっぱいです。", "zh": "角色满了。", }, "キャラテンプレート": { "en": "Open Character Template", "ja": "キャラテンプレートを開く", "zh": "打开角色列表。", }, "キャラ名": { "en": "Name", "ja": "キャラ名", "zh": "角色名", }, "平均に": { "en": "Average", "ja": "平均に", "zh": "平均", }, "含める": { "en": "Include", "ja": "含める", "zh": "包含在平均计算中?" , }, "種族": { "en": "Race", "ja": "種族", "zh": "种族", }, "性別": { "en": "Sex", "ja": "性別", "zh": "性別", }, "得意武器": { "en": "Specialty weapons", "ja": "得意武器", "zh": "得意武器", }, "素の攻撃力": { "en": "Raw ATK", "ja": "素の攻撃力", "zh": "基本攻击力", }, "素のHP": { "en": "Raw HP", "ja": "素のHP", "zh": "基本HP", }, "サポアビ": { "en": "Support Abi.", "ja": "サポアビ", "zh": "被动技能", }, "属性攻撃力": { "en": "Element ATK", "ja": "属性攻撃力", "zh": "属性攻击力", }, "クリティカル": { "en": "Critical", "ja": "クリティカル", "zh": "暴击", }, "前へ": { "en": "Front", "ja": "前へ", "zh": "向前", }, "後へ": { "en": "Back", "ja": "後へ", "zh": "向后", }, "武器テンプレート": { "en": "Open Weapon Template", "ja": "武器テンプレートを開く", "zh": "打开武器列表", }, "武器名": { "en": "Name", "ja": "武器名", "zh": "武器名", }, "スキル": { "en": "Skill", "ja": "スキル", "zh": "技能", }, "種類": { "en": "Type", "ja": "種類", "zh": "种类", }, "最小本数": { "en": "Minimum", "ja": "最小本数", "zh": "最少数量", }, "最大本数": { "en": "Maximum", "ja": "最大本数", "zh": "最多数量", }, "何本追加": { "en": "How many?", "ja": "何本追加しますか?", "zh": "添加多少把?", }, "サーバに保存": { "en": "Save to Server", "ja": "サーバに保存\n(短縮URLを取得)", "zh": "保存到服务器", }, // For constant conversion "人間": { "en": "Human", "ja": "人間", "zh": "人类", }, "エルーン": { "en": "Erune", "ja": "エルーン", "zh": "Erune", }, "ドラフ": { "en": "Draph", //a.k.a: Doraf "ja": "ドラフ", "zh": "Draph", }, "ハーヴィン": { "en": "Harvin", //a.k.a: Havin "ja": "ハーヴィン", "zh": "Harvin", }, "星晶獣": { "en": "Seisho", "ja": "星晶獣", "zh": "星晶兽", }, "種族不明": { "en": "Unknown", "ja": "種族不明", "zh": "种族不明", }, "男": { "en": "Male", "ja": "男", "zh": "男", }, "女": { "en": "Female", "ja": "女", "zh": "女", }, "不詳": { "en": "Other", "ja": "不詳", "zh": "不詳", }, // sort keys "攻撃力(二手技巧無し,ジータさんのみ)": { "en": "Pure ATK, Player only", "ja": "攻撃力(二手技巧無し,ジータさんのみ)", "zh": "攻击力(不考虑连击技巧,只有主角)", }, "パーティ平均攻撃力(二手技巧無し)": { "en": "Party-Averaged Pure ATK", "ja": "平均攻撃力(二手技巧無し)", "zh": "平均攻击力(不考虑连击技巧)", }, "ジータさんHP": { "en": "Player HP", "ja": "ジータさんHP", "zh": "主角HP", }, "技巧期待値(ジータさんのみ)": { "en": "Exp. Critical Ratio (Player only)", "ja": "技巧期待値(ジータさんのみ)", "zh": "技巧期望(只考虑主角)", }, "技巧期待値(ジータさんのみ)": { "en": "Exp. Critical Ratio (Player only)", "ja": "技巧期待値(ジータさんのみ)", "zh": "技巧期望(只考虑主角)", }, "技巧期待平均攻撃力": { "en": "Party-Averaged ATK with Critical", "ja": "技巧期待平均攻撃力", "zh": "平均期望攻击力(含技巧)", }, "総合攻撃*期待回数*技巧期待値(ジータさんのみ)": { "en": "PureATK*Crit.*Freq. (Player only)", "ja": "総合攻撃*期待回数*技巧期待値(ジータさんのみ)", "zh": "综合攻击力*期望次数*技巧期望(只考虑主角)", }, "総回技のパーティ平均値": { "en": "Averaged PCF value", "ja": "総回技のパーティ平均値", "zh": "综合期望全队平均值", }, "予想ターン毎ダメージ(ジータさんのみ)": { "en": "Exp. Damage per Turn (Player only)", "ja": "予想ターンダメージ(ジータさんのみ)", "zh": "预测DPT(只考虑主角)", }, "予想ターン毎ダメージのパーティ平均値": { "en": "Party-Averaged Exp. Turn Damage", "ja": "予想ターン毎ダメージのパーティ平均値", "zh": "预测DPT(全队平均值)", }, // "予想ダメージ経時的な": { // "en": "Party-Averaged Exp. Over Time", // "ja": "予想ダメージ経時的な", // "zh": "预测DPS(全队平均值)", // }, "予想ダメージ(ジータさんのみ)": { "en": "Exp. Damage (Player only)", "ja": "予想ダメージ(ジータさんのみ)", "zh": "预测伤害(只考虑主角)", }, "予想ダメージのパーティ平均値": { "en": "Party-Averaged Exp. Damage", "ja": "予想ダメージのパーティ平均値", "zh": "预测伤害(全队平均值", }, "予想ダメージ平均の積分値": { "en": "Integration of Party-Averaged Exp. Turn Damage", "ja": "予想ダメージ平均の積分値", "zh": "预测伤害平均积分值", }, "奥義+チェンバダメージ": { "en": "C.A.+Chain Damage", "ja": "奥義+チェンバダメージ", "zh": "C.A.+Chain Damage", }, "★1": { "en": "★1", "ja": "★1", "zh": "★1", }, "★2": { "en": "★2", "ja": "★2", "zh": "★2", }, "★3": { "en": "★3", "ja": "★3", "zh": "★3", }, "★4": { "en": "★4", "ja": "★4", "zh": "★4", }, "★5": { "en": "★5", "ja": "★5", "zh": "★5", }, "★6": { "en": "★6", "ja": "★6", "zh": "★6", }, "★7": { "en": "★7", "ja": "★7", "zh": "★7", }, "★8": { "en": "★8", "ja": "★8", "zh": "★8", }, "★9": { "en": "★9", "ja": "★9", "zh": "★9", }, "★10": { "en": "★10", "ja": "★10", "zh": "★10", }, "★11": { "en": "★11", "ja": "★11", "zh": "★11", }, "★12": { "en": "★12", "ja": "★12", "zh": "★12", }, "表示項目切替": { "en": "Select Display Elements", "ja": "表示する項目を選択してください", "zh": "请选择要显示的项目", }, "攻撃力・HP・連撃率": { "en": "ATK/HP/etcs", "ja": "攻撃力・HP・連撃率", "zh": "攻击力・HP・连击率", }, "パーティ平均攻撃力": { "en": "Party-Averaged ATK", "ja": "パーティ平均攻撃力", "zh": "全队平均攻击力", }, "予測ダメージ": { "en": "Expected Damages", "ja": "予測ダメージ", "zh": "预测伤害", }, "キャラ情報・スキル合計値": { "en": "Chara Data, Skill Amount", "ja": "キャラ情報・スキル合計値", "zh": "角色情报・技能合计值", }, // Skill name "通常攻刃(小)": { "en": "Normal Might (S)", "ja": "通常攻刃(小)", "zh": "通常攻刃(小)", }, "通常攻刃(中)": { "en": "Normal Might (M)", "ja": "通常攻刃(中)", "zh": "通常攻刃(中)", }, "通常攻刃(大)": { "en": "Normal Might (L)", "ja": "通常攻刃(大)", "zh": "通常攻刃(大)", }, "通常攻刃II": { "en": "Normal Might (LL)", "ja": "通常攻刃II", "zh": "通常攻刃II", }, "通常攻刃III": { "en": "Normal Might (LLL)", "ja": "通常攻刃III", "zh": "通常攻刃III", }, "通常楚歌": { "en": "Normal Betrayal", "ja": "通常楚歌(永続)", "zh": "通常楚歌", }, "通常暴君": { "en": "Normal Tyranny", "ja": "通常暴君", "zh": "通常暴君", }, "通常暴君II": { "en": "Normal Tyranny II", "ja": "通常暴君II", "zh": "通常暴君II", }, "通常背水(小)": { "en": "Normal Enmity (S)", "ja": "通常背水(小)", "zh": "通常背水(小)", }, "通常背水(中)": { "en": "Normal Enmity (M)", "ja": "通常背水(中)", "zh": "通常背水(中)", }, "通常背水(大)": { "en": "Normal Enmity (L)", "ja": "通常背水(大)", "zh": "通常背水(大)", }, "通常渾身(中)": { "en": "Normal Stamina (M)", "ja": "通常渾身(中)", "zh": "通常渾身(中)", }, "通常渾身(大)": { "en": "Normal Stamina (L)", "ja": "通常渾身(大)", "zh": "通常渾身(大)", }, "通常二手(小)": { "en": "Normal Dual Edge (S)", "ja": "通常二手(小)", "zh": "通常二手(小)", }, "通常二手(中)": { "en": "Normal Dual Edge (M)", "ja": "通常二手(中)", "zh": "通常二手(中)", }, "通常二手(大)": { "en": "Normal Dual Edge (L)", "ja": "通常二手(大)", "zh": "通常二手(大)", }, "通常三手(小)": { "en": "Normal Trium (S)", "ja": "通常三手(小)", "zh": "通常三手(小)", }, "通常三手(中)": { "en": "Normal Trium (M)", "ja": "通常三手(中)", "zh": "通常三手(中)", }, "通常三手(大)": { "en": "Normal Trium (L)", "ja": "通常三手(大)", "zh": "通常三手(大)", }, "通常克己(小)": { "en": "Normal Restraint (S)", "ja": "通常克己(小)", "zh": "通常克己(小)", }, "通常克己(中)": { "en": "Normal Restraint (M)", "ja": "通常克己(中)", "zh": "通常克己(中)", }, "通常神威(小)": { "en": "Normal Majesty (S)", "ja": "通常神威(小)", "zh": "通常神威(小)", }, "通常神威(中)": { "en": "Normal Majesty (M)", "ja": "通常神威(中)", "zh": "通常神威(中)", }, "通常神威(大)": { "en": "Normal Majesty (L)", "ja": "通常神威(大)", "zh": "通常神威(大)", }, "通常括目": { "en": "Normal Heed", "ja": "通常括目", "zh": "通常括目", }, "通常羅刹": { "en": "Normal Haunt", "ja": "通常羅刹", "zh": "通常罗刹", }, "通常無双(中)": { "en": "Normal Primacy (M)", "ja": "通常無双(中)", "zh": "通常无双(中)", }, "通常無双II": { "en": "Normal Primacy II", "ja": "通常無双II", "zh": "通常无双II", }, "通常刃界(小)": { "en": "Normal Bladeshield (S)", "ja": "通常刃界(小)", "zh": "通常刃界(小)", }, "通常乱舞(小)": { "en": "Normal Fandango (S)", "ja": "通常乱舞(小)", "zh": "通常乱舞(小)", }, "通常秘奥(小)": { "en": "Normal Mystery (S)", "ja": "通常秘奥(小)", "zh": "通常秘奥(小)", }, "通常秘奥(中)": { "en": "Normal Mystery (M)", "ja": "通常秘奥(中)", "zh": "通常秘奥(中)", }, "通常秘奥(大)": { "en": "Normal Mystery (L)", "ja": "通常秘奥(大)", "zh": "通常秘奥(大)", }, "通常必殺(中)": { "en": "Normal Sentence (M)", "ja": "通常必殺(中)", "zh": "通常必杀(中)", }, "通常必殺(大)": { "en": "Normal Sentence (L)", "ja": "通常必殺(大)", "zh": "通常必杀(大)", }, "通常英傑(大)": { "en": "Normal Glory (L)", "ja": "通常英傑(大)", "zh": "通常英傑(大)", }, "通常恩寵(中)": { "en": "Normal Grace (M)", "ja": "通常恩寵(中)", "zh": "通常恩寵(中)", }, "通常本質(中)": { "en": "Normal Essence (M)", "ja": "通常本質(中)", "zh": "通常本質(中)", }, "通常庇護(小)": { "en": "Normal Refuge (S)", "ja": "通常庇護(小)", "zh": "通常庇護(小)", }, "先制": { "en": "Preemptive", "ja": "先制(永続)", "zh": "先制", }, "マグナ攻刃": { "en": "Magna Might I", "ja": "マグナ攻刃", "zh": "方阵攻刃", }, "マグナ攻刃II": { "en": "Magna Might II", "ja": "マグナ攻刃II", "zh": "方阵攻刃II", }, "マグナ楚歌": { "en": "Magna Betrayal", "ja": "マグナ楚歌(永続)", "zh": "方阵楚歌", }, "マグナ背水(小)": { "en": "Magna Enmity (S)", "ja": "マグナ背水(小)", "zh": "方阵背水(小)", }, "マグナ背水(中)": { "en": "Magna Enmity (M)", "ja": "マグナ背水(中)", "zh": "方阵背水(中)", }, "マグナ背水(大)": { "en": "Magna Enmity (L)", "ja": "マグナ背水(大)", "zh": "方阵背水(大)", }, "マグナ渾身(中)": { "en": "Magna Stamina (M)", "ja": "マグナ渾身(中)", "zh": "方阵浑身(中)", }, "マグナ渾身(大)": { "en": "Magna Stamina (L)", "ja": "マグナ渾身(大)", "zh": "方阵浑身(大)", }, "マグナ破壊(小)": { "en": "Magna Devastation (S)", "ja": "マグナ破壊(小)", "zh": "方阵破坏(小", }, "マグナ三手(小)": { "en": "Magna Trium (S)", "ja": "マグナ三手(小)", "zh": "方阵三手(小)", }, "マグナ三手(中)": { "en": "Magna Trium (M)", "ja": "マグナ三手(中)", "zh": "方阵三手(中)", }, "マグナ三手(大)": { "en": "Magna Trium (L)", "ja": "マグナ三手(大)", "zh": "方阵三手(大)", }, "マグナ克己(中)": { "en": "Magna Restraint (M)", "ja": "マグナ克己(中)", "zh": "方阵克己(中)", }, "マグナ神威(小)": { "en": "Magna Majesty (S)", "ja": "マグナ神威(小)", "zh": "方阵神威(小)", }, "マグナ神威(中)": { "en": "Magna Majesty (M)", "ja": "マグナ神威(中)", "zh": "方阵神威(中)", }, "マグナ神威(大)": { "en": "Magna Majesty (L)", "ja": "マグナ神威(大)", "zh": "方阵神威(大)", }, "マグナ暴君": { "en": "Magna Tyranny", "ja": "マグナ暴君", "zh": "方阵暴君", }, "マグナ括目": { "en": "Magna Heed", "ja": "マグナ括目", "zh": "方阵括目", }, "マグナ羅刹": { "en": "Magna Haunt", "ja": "マグナ羅刹", "zh": "方阵罗刹", }, "マグナ無双(中)": { "en": "Magna Primacy (M)", "ja": "マグナ無双(中)", "zh": "方阵无双(中)", }, "マグナ乱舞(中)": { "en": "Magna Fandango (M)", "ja": "マグナ乱舞(中)", "zh": "方阵乱舞(中)", }, "マグナ軍神(小)": { "en": "Magna Heroism (S)", "ja": "マグナ軍神(小)", "zh": "方阵军神(小)", }, "マグナ必殺(中)": { "en": "Magna Sentence (M)", "ja": "マグナ必殺(中)", "zh": "方阵必杀(中)", }, "マグナ拳武(大)": { "en": "Magna Fist (L)", "ja": "マグナ拳武(大)", "zh": "方阵拳武(大)", }, "マグナ杖術(大)": { "en": "Magna Wand (L)", "ja": "マグナ杖術(大)", "zh": "方阵杖術(大)", }, "マグナ本質(中)": { "en": "Magna Essence (M)", "ja": "マグナ星晶(中)", "zh": "方阵本質(中)", }, "アンノウンATK・I": { "en": "Unknown ATK I", "ja": "アンノウンATK・I", "zh": "UNK攻刃I", }, "アンノウンATK・II": { "en": "Unknown ATK II", "ja": "アンノウンATK・II", "zh": "UNK攻刃II", }, "EX背水(中)": { "en": "EX Enmity (M)", "ja": "EX背水(中)", "zh": "EX背水(中)", }, "EX攻刃(小)": { "en": "EX Might (S)", "ja": "EX攻刃(小)", "zh": "EX攻刃(小)", }, "EX攻刃(中)": { "en": "EX Might (M)", "ja": "EX攻刃(中)", "zh": "EX攻刃(中)", }, "EX攻刃(大)": { "en": "EX Might (L)", "ja": "EX攻刃(大)", "zh": "EX攻刃(大)", }, "EX攻刃(特大)": { "en": "EX Might (LL)", "ja": "EX攻刃(特大)", "zh": "EX攻刃(特大)", }, "EX攻刃+守護(中)": { "en": "EX Might and Aegis (M)", "ja": "EX攻刃+守護(中)", "zh": "EX攻刃+守护(中)", }, "通常守護(小)": { "en": "Normal Aegis (S)", "ja": "通常守護(小)", "zh": "通常守护(小)", }, "通常守護(中)": { "en": "Normal Aegis (M)", "ja": "通常守護(中)", "zh": "通常守护(中)", }, "通常守護(大)": { "en": "Normal Aegis (L)", "ja": "通常守護(大)", "zh": "通常守护(大)", }, "通常守護II": { "en": "Normal Aegis (LL)", "ja": "通常守護II", "zh": "通常守护II", }, "マグナ守護(小)": { "en": "Magna Aegis (S)", "ja": "マグナ守護(小)", "zh": "方阵守护(小)", }, "マグナ守護(中)": { "en": "Magna Aegis I (M)", "ja": "マグナ守護(中)", "zh": "方阵守护(中)", }, "マグナ守護(大)": { "en": "Magna Aegis II (L)", "ja": "マグナ守護(大)", "zh": "方阵守护(大)", }, "アンノウン・VIT I(小)": { "en": "Unknown VIT I (S)", "ja": "アンノウン・VIT I(小)", "zh": "UNK守护(小)", }, "アンノウン・VIT I(中)": { "en": "Unknown VIT I (M)", "ja": "アンノウン・VIT I(中)", "zh": "UNK守护(中)", }, "アンノウン・VIT II(大)": { "en": "Unknown VIT II (L)", "ja": "アンノウン・VIT II(大)", "zh": "UNK守护(大)", }, "ミフネ流・極意": { "en": "Mifune Style, Zen Impact", "ja": "ミフネ流・極意", "zh": "ミフネ流・極意", }, "ミフネ流・双星": { "en": "Mifune Style, Binary Star", "ja": "ミフネ流・双星", "zh": "ミフネ流・双星", }, "紅蓮の呪印・弐": { "en": "Inferno's Second Insignia", "ja": "紅蓮の呪印・弐", "zh": "红莲的咒印・叁", }, "霧氷の追牙・肆": { "en": "Hoarfrost's Fourth Pursuit", "ja": "霧氷の追牙・肆", "zh": "雾冰的追牙・肆", }, "乱気の疾駆・壱": { "en": "Ventosus's First Dash", "ja": "乱気の疾駆・壱", "zh": "Ventosus's First Dash", }, "貫きの牙": { "en": "Piercing Fang", "ja": "貫きの牙", "zh": "貫きの牙", }, "貫きの牙(メイン装備時)": { "en": "Piercing Fang (main)", "ja": "貫きの牙(メイン装備時)", "zh": "貫きの牙(主手装备时)", }, "鷲王の結界": { "en": "Royal Wing Barrier", "ja": "鷲王の結界", "zh": "鷲王の結界", }, "舞姫の演武": { "en": "Dancer's Discipline", "ja": "舞姫の演武", "zh": "舞姫の演武", }, "胡蝶の剣舞": { "en": "Fluttering Slash", "ja": "胡蝶の剣舞", "zh": "舞姫の演武", }, "変幻自在の剣技": { "en": "Phantasmagoric Fencer", "ja": "変幻自在の剣技", "zh": "変幻自在の剣技", }, "通常技巧(小)": { "en": "Normal Verity (S)", "ja": "通常技巧(小)", "zh": "通常技巧(小)", }, "通常技巧(中)": { "en": "Normal Verity (M)", "ja": "通常技巧(中)", "zh": "通常技巧(中)", }, "通常技巧(大)": { "en": "Normal Verity (L)", "ja": "通常技巧(大)", "zh": "通常技巧(大)", }, "マグナ技巧(小)": { "en": "Magna Verity (S)", "ja": "マグナ技巧(小)", "zh": "方阵技巧(小)", }, "マグナ技巧(中)": { "en": "Magna Verity (M)", "ja": "マグナ技巧(中)", "zh": "方阵技巧(中)", }, "マグナ技巧(大)": { "en": "Magna Verity (L)", "ja": "マグナ技巧(大)", "zh": "方阵技巧(大)", }, "通常刹那(小)": { "en": "Normal Celere (S)", "ja": "通常刹那(小)", "zh": "通常刹那(小)", }, "通常刹那(中)": { "en": "Normal Celere (M)", "ja": "通常刹那(中)", "zh": "通常刹那(中)", }, "マグナ刹那(小)": { "en": "Magna Celere (S)", "ja": "マグナ刹那(小)", "zh": "マグナ刹那(小)", }, "マグナ刹那(中)": { "en": "Magna Celere (M)", "ja": "マグナ刹那(中)", "zh": "マグナ刹那(中)", }, "コスモス剣": { "en": "Cosmos Sword", "ja": "コスモス剣", "zh": "Cosmos剑", }, "コスモス短剣": { "en": "Cosmos Dagger", "ja": "コスモス短剣", "zh": "Cosmos短剑", }, "コスモス槍": { "en": "Cosmos Spear", "ja": "コスモス槍", "zh": "Cosmos枪", }, "コスモス斧": { "en": "Cosmos Axe", "ja": "コスモス斧", "zh": "Cosmos斧", }, "コスモス杖": { "en": "Cosmos Staff", "ja": "コスモス杖", "zh": "Cosmos杖", }, "コスモス銃": { "en": "Cosmos Gun", "ja": "コスモス銃", "zh": "Cosmos铳", }, "コスモス拳": { "en": "Cosmos Fist", "ja": "コスモス拳", "zh": "Cosmos拳", }, "コスモス弓": { "en": "Cosmos Bow", "ja": "コスモス弓", "zh": "Cosmos弓", }, "コスモス刀": { "en": "Cosmos Katana", "ja": "コスモス刀", "zh": "Cosmos刀", }, "コスモス楽器": { "en": "Cosmos Harp", "ja": "コスモス楽器", "zh": "Cosmos乐器", }, "コスモスAT": { "en": "Cosmos ATK", "ja": "コスモスAT", "zh": "Cosmos AT", }, "コスモスDF": { "en": "Cosmos DF", "ja": "コスモスDF", "zh": "Cosmos DF", }, "コスモスBL": { "en": "Cosmos BL", "ja": "コスモスBL", "zh": "Cosmos BL", }, "コスモスPC": { "en": "Cosmos PC", "ja": "コスモスPC", "zh": "Cosmos PC", }, "バハ攻-短剣": { "en": "Bahamut Dagger", "ja": "バハ攻-短剣", "zh": "巴哈攻刃-短剑", }, "バハ攻-斧": { "en": "Bahamut Axe", "ja": "バハ攻-斧", "zh": "巴哈攻刃-斧", }, "バハ攻-槍": { "en": "Bahamut Spear", "ja": "バハ攻-槍", "zh": "巴哈攻刃-枪", }, "バハ攻-銃": { "en": "Bahamut Gun", "ja": "バハ攻-銃", "zh": "巴哈攻刃-铳", }, "バハ攻HP-剣": { "en": "Bahamut Sword", "ja": "バハ攻-剣", "zh": "巴哈攻刃-剑", }, "バハ攻HP-杖": { "en": "Bahamut Staff", "ja": "バハ攻HP-杖", "zh": "巴哈攻刃-杖", }, "バハHP-格闘": { "en": "Bahamut Fist", "ja": "バハHP-格闘", "zh": "巴哈守护-拳", }, "バハHP-刀": { "en": "Bahamut Sword", "ja": "バハHP-刀", "zh": "巴哈守护-刀", }, "バハHP-弓": { "en": "Bahamut Bow", "ja": "バハHP-弓", "zh": "巴哈守护-弓", }, "バハHP-楽器": { "en": "Bahamut Harp", "ja": "バハHP-楽器", "zh": "巴哈守护-乐器", }, "バハフツ-短剣": { "en": "Bahamut Coda Dagger", "ja": "バハフツ-短剣", "zh": "紫化巴哈-短剑", }, "バハフツ-斧": { "en": "Bahamut Coda Axe", "ja": "バハフツ-斧", "zh": "紫化巴哈-斧", }, "バハフツ-槍": { "en": "Bahamut Coda Spear", "ja": "バハフツ-槍", "zh": "紫化巴哈-枪", }, "バハフツ-銃": { "en": "Bahamut Coda Gun", "ja": "バハフツ-銃", "zh": "紫化巴哈-铳", }, "バハフツ-剣": { "en": "Bahamut Coda Sword", "ja": "バハフツ-剣", "zh": "紫化巴哈-剑", }, "バハフツ-杖": { "en": "Bahamut Coda Staff", "ja": "バハフツ-杖", "zh": "紫化巴哈-杖", }, "バハフツHP-格闘": { "en": "Bahamut Coda Fist", "ja": "バハフツHP-格闘", "zh": "紫化巴哈-格斗", }, "バハフツHP-刀": { "en": "Bahamut Coda Katana", "ja": "バハフツHP-刀", "zh": "紫化巴哈-刀", }, "バハフツHP-弓": { "en": "Bahamut Coda Bow", "ja": "バハフツHP-弓", "zh": "紫化巴哈-弓", }, "バハフツHP-楽器": { "en": "Bahamut Coda Harp", "ja": "バハフツHP-楽器", "zh": "紫化巴哈-乐器", }, "オメガ-未強化": { "en": "Ultima (Raw)", "ja": "オメガ-未強化", "zh": "Omega-未强化", }, "オメガ-戦意": { "en": "Ultima (Will)", "ja": "オメガ-戦意(通常攻刃10%UP)", "zh": "Omega-战意", }, "オメガ-闘争": { "en": "Ultima (Strife)", "ja": "オメガ-闘争(DATA20%UP)", "zh": "Omega-斗争", }, "オメガ-生命": { "en": "Ultima (Vitality)", "ja": "オメガ-生命(HP10%UP)", "zh": "Omega-生命", }, "オメガ-強壮": { "en": "Ultima (Strength)", "ja": "オメガ-強壮(渾身(大))", "zh": "Omega-强壮", }, "オメガ-激情": { "en": "Ultima (Zeal)", "ja": "オメガ-激情(背水(大))", "zh": "Omega-激情", }, "オメガ-勇気": { "en": "Ultima (Courage)", "ja": "オメガ-勇気(クリティカルUP(発動率10%,倍率50%))", "zh": "Omega-勇气", }, "ガフスキー[α]": { "en": "Gauph Key α", "ja": "ガフスキー[α](通常上限10%UP)", "zh": "1技能插件[α]", }, "ガフスキー[β]": { "en": "Gauph Key β", "ja": "ガフスキー[β](アビ上限50%UP)", "zh": "1技能插件[β]", }, "ガフスキー[γ]": { "en": "Gauph Key γ", "ja": "ガフスキー[γ](奥義上限15%UP)", "zh": "1技能插件[γ]", }, "ガフスキー[Δ]": { "en": "Gauph Key Δ", "ja": "ガフスキー[Δ](CB上限50%UP)", "zh": "1技能插件[Δ]", }, "アーカーシャ-斧": { "en": "Akasha (Axe)", "ja": "アーカーシャ-斧", "zh": "アーカーシャ-斧", }, "アーカーシャ-剣": { "en": "Akasha (Sword)", "ja": "アーカーシャ-剣", "zh": "アーカーシャ-剣", }, "アーカーシャ-弓": { "en": "Akasha (Bow)", "ja": "アーカーシャ-弓", "zh": "アーカーシャ-弓", }, "アーカーシャ-杖": { "en": "Akasha (Staff)", "ja": "アーカーシャ-杖", "zh": "アーカーシャ-杖", }, "アーカーシャ-槍": { "en": "Akasha (Spear)", "ja": "アーカーシャ-槍", "zh": "アーカーシャ-槍", }, "ペンデュラム[α]": { "en": "Pendulum Key α", "ja": "ペンデュラム[α](通常上限10%UP)", "zh": "ペンデュラム[α](通常上限10%UP)", }, "ペンデュラム[β]": { "en": "Pendulum Key β", "ja": "ペンデュラム[β](アビ上限50%UP)", "zh": "ペンデュラム[β](アビ上限50%UP)", }, "ペンデュラム[γ]": { "en": "Pendulum Key γ", "ja": "ペンデュラム[γ](奥義上限15%UP)", "zh": "ペンデュラム[γ](奥義上限15%UP)", }, "ペンデュラム[Δ]": { "en": "Pendulum Key Δ", "ja": "ペンデュラム[Δ](CB上限50%UP)", "zh": "ペンデュラム[Δ](CB上限50%UP)", }, "天司の祝福": { "en": "Angel's Blessing", "ja": "天司の祝福", "zh": "天司的祝福", }, "天司の祝福II": { "en": "Angel's Blessing II", "ja": "天司の祝福II", "zh": "天司的祝福II", }, "天司の祝福III": { "en": "Angel's Blessing III", "ja": "天司の祝福III", "zh": "天司的祝福III", }, "通常上限UP(2.5%)": { "en": "Damage Cap UP(2.5%)", "ja": "通常上限UP(2.5%)", "zh": "通常上限UP(2.5%)", }, "通常上限UP(7.0%)": { "en": "Damage Cap UP(7.0%)", "ja": "通常上限UP(7.0%)", "zh": "通常上限UP(7.0%)", }, "通常上限UP(10%)": { "en": "Damage Cap UP(10%)", //a.k.a:damageLimit "ja": "通常上限UP(10%)", "zh": "通常上限UP(10%)", }, "奥義上限UP(10%)": { "en": "C.A. Cap UP(10%)", //a.k.a:ougiDamageLimit "ja": "奥義上限UP(10%)", "zh": "奥义上限UP(10%)", }, "黄龍槍 (メイン装備時)": { "en": "Huanglong spear (main)", "ja": "黄龍槍 (メイン装備時)", "zh": "Huanglong spear (main)", }, "奥義上限UP(イクシード)": { "en": "C.A. Cap UP (Exceed)", //a.k.a:ougiDamageLimitByExceed "ja": "奥義上限UP(イクシード)", "zh": "奥义上限UP(Exceed)", }, "チェインフォース": { "en": "Chain Force", "ja": "チェインフォース", "zh": "チェインフォース", }, // Extended skills "通常渾身(大)(神石加護無効)": { "en": "Normal Stamina (L) (No Summon Aura)", "ja": "通常渾身(大)(神石加護無効)", "zh": "通常浑身(大)(不受加护影响)", }, "[ジータのみ] 通常枠DATA 5%": { "en": "[DjeetaOnly] Normal DA/TA 5%", "ja": "[ジータのみ] 通常枠DATA 5%", "zh": "[只限主角] 通常DATA 5%", }, "[ジータのみ] 通常枠DATA 10%": { "en": "[DjeetaOnly] Normal DA/TA 10%", "ja": "[ジータのみ] 通常枠DATA 10%", "zh": "[只限主角] 通常DATA 10%", }, "[ジータのみ] 通常枠DATA 15%": { "en": "[DjeetaOnly] Normal DA/TA 15%", "ja": "[ジータのみ] 通常枠DATA 15%", "zh": "[只限主角] 通常DATA 15%", }, "[ジータのみ] 通常枠DATA 20%": { "en": "[DjeetaOnly] Normal DA/TA 20%", "ja": "[ジータのみ] 通常枠DATA 20%", "zh": "[只限主角] 通常DATA 20%", }, "[ジータのみ] 通常枠DATA 25%": { "en": "[DjeetaOnly] Normal DA/TA 25%", "ja": "[ジータのみ] 通常枠DATA 25%", "zh": "[只限主角] 通常DATA 25%", }, "[ジータのみ] 通常枠DATA 30%": { "en": "[DjeetaOnly] Normal DA/TA 30%", "ja": "[ジータのみ] 通常枠DATA 30%", "zh": "[只限主角] 通常DATA 30%", }, // For templates "王道: 竜巻の技巧": { "en": "Normal Verity (M)", "ja": "王道: 竜巻の技巧", "zh": "王道: 龙卷的技巧", }, "王道: 火の守護": { "en": "Normal Aegis (M)", "ja": "王道: 火の守護", "zh": "王道: 火的守護", }, "王道: 大地の技巧": { "en": "Normal Verity (M)", "ja": "王道: 大地の技巧", "zh": "王道: 大地的技巧", }, "王道: 水の二手": { "en": "Normal Duel Edge (M)", "ja": "王道: 水の二手", "zh": "王道: 水的二手", }, "邪道: 通常上限UP(7.0%)": { "en": "Damage Cap UP(7.0%)", "ja": "邪道: 通常上限UP(7.0%)", "zh": "邪道: 通常上限UP(7.0%)", }, "敵防御10.0": { "en": "10.0 (General)", "ja": "10.0 (一般的な敵)", "zh": "10.0 (一般的敌人)", }, "敵防御10.5": { "en": "10.5 (Ul Baha N)", "ja": "10.5 (アルバハN)", "zh": "10.5 (Ul Baha N)", }, "敵防御11.0": { "en": "11.0 (GW Nightmare/Ul Baha HL/Proto Baha N)", "ja": "11.0 (通常古戦場HELL/アルバハHL/プロバハN)", "zh": "11.0 (GW Nightmare/Ul Baha HL/Proto Baha N)", }, "敵防御12.0": { "en": "12.0 (Omega II(Light&Dark)/Omega HL/Huanglong&Qilin HL)", "ja": "12.0 (マグナⅡ光闇/マグナHL/黄龍・黒麒麟HL)", "zh": "12.0 (Omega II(Light&Dark)/Omega HL/Huanglong&Qilin HL)", }, "敵防御13.0": { "en": "13.0 (Omega II(4 Elements))", "ja": "13.0 (マグナⅡ4属性)", "zh": "13.0 (Omega II(4 Elements))", }, "敵防御14.0": { "en": "14.0 (Freyr)", "ja": "14.0 (フレイ)", "zh": "14.0 (Freyr)", }, "敵防御15.0": { "en": "15.0 (Malice/Akasha/Lucilius N)", "ja": "15.0 (マリス/アーカーシャ/ルシファーN)", "zh": "15.0 (Malice/Akasha/Lucilius N)", }, "敵防御20.0": { "en": "20.0 (Proto Baha HL/Lucilius H)", "ja": "20.0 (プロトバハムートHL/ルシファーH)", "zh": "20.0 (Proto Baha HL/Lucilius H)", }, // chart sort key "ジータさん残りHP": { "en": "Player Remain HP", "ja": "ジータさん残りHP", "zh": "主角剩余HP", }, "まとめて比較": { "en": "Compare All", "ja": "まとめて比較", "zh": "全部一起比较", }, "保存された編成を編集": { "en": "Edit Saved Weapon Setups", "ja": "保存された編成を編集", "zh": "编辑已保存的编成", }, "保存された編成を削除": { "en": "Delete All Saved Setups", "ja": "保存された編成を全て削除", "zh": "删除全部已保存的编成", }, "保存済みの編成": { "en": "Saved Weapon Setups", "ja": "保存済みの編成", "zh": "已保存的编成", }, // send request "追加要望を送る": { "en": "Send new template request", "ja": "追加要望を送る", "zh": "发送新的追加请求", }, "追加要望を送る": { "en": "Send new template request", "ja": "追加要望を送る", "zh": "发送新的追加请求", }, "キャラ追加要望": { "en": "New character template request", "ja": "キャラ追加要望", "zh": "角色追加请求", }, "武器追加要望": { "en": "New weapon template request", "ja": "武器追加要望", "zh": "武器追加请求", }, "要望種別": { "en": "Request type", "ja": "要望種別", "zh": "请求类型", }, "名": { "en": "name ", "ja": "名", "zh": "名字", }, "メッセージ": { "en": "Message ", "ja": "詳細", "zh": "内容", }, "あなたのお名前": { "en": "Your name (optional) ", "ja": "あなたのお名前(任意)", "zh": "你的名字 (任意)", }, "送信": { "en": "SUBMIT", "ja": "送信", "zh": "发送", }, "送信成功": { "en": "Your request was sent!", "ja": "要望を送信しました!", "zh": "发送成功!", }, "要望送信メッセージ": { "en": "Send a comment to github motocal Issue.", "ja": "github/motocalのIssueに要望コメントを送信します.", "zh": "将请求发送到github/motocal的Issue", }, // Simulator Infomation "パーティ全体": { "en": "Settings for all alies", "ja": "パーティ全体設定", "zh": "全队设定", }, "通常攻撃": { "en": "Attack", "ja": "通常攻撃", "zh": "通常攻击", }, "奥義": { "en": "C.A.", "ja": "奥義", "zh": "奥义", }, "奥義(ダメージ無し)": { "en": "C.A. w/o damage", "ja": "奥義(ダメージ無し)", "zh": "奥义(无伤害)", }, "ターン数": { "en": "Turn length", "ja": "ターン数", "zh": "回合数", }, "ターン": { "en": "Turn", "ja": "ターン", "zh": "回合", }, "バフテンプレート": { "en": "Open Buff Templates", "ja": "バフテンプレートを開く", "zh": "打开Buff列表", }, "バフテンプレート説明": { "en": "Drag and drop these buttons into a turn.", "ja": "追加したいターンにバフボタンをドラッグアンドドロップしてください.", "zh": "请把Buff按钮拖到想要追加的回合上。", }, "シミュレータ-上にコピー": { "en": "Copy all settings to the upper row.", "ja": "上の行にバフ設定をコピーします.", "zh": "把Buff设定复制到上面一行。", }, "シミュレータ-下にコピー": { "en": "Copy all settings to the lower row.", "ja": "下の行にバフ設定をコピーします.", "zh": "把Buff设定复制到下面一行。", }, // Buff template "レイジIII": { "en": "Rage III", "ja": "レイジIII", "zh": "Rage III", }, "レイジIV": { "en": "Rage IV", "ja": "レイジIV", "zh": "Rage IV", }, "ランページ": { "en": "Rampage", "ja": "ランページ", "zh": "Rampage", }, "四天刃バフ": { "en": "Four-Sky Blade Buff", "ja": "四天刃バフ", "zh": "四天刃Buff", }, "属性バフ(30%)": { "en": "Element Buff (30%)", "ja": "属性バフ(30%)", "zh": "属性バフ(30%)", }, "コルワ1アビフィル10": { "en": "Korwa Abi1 Fill 10", "ja": "コルワ1アビフィル10", "zh": "コルワ1技能10纺丝", }, "コルワ2アビフィル10": { "en": "Korwa Abi2 Fill 10", "ja": "コルワ2アビフィル10", "zh": "コルワ2技能10纺丝", }, "SOG 楽器なし": { "en": "Sky Realm Song w/o Harp", "ja": "ソング・オブ・グランデ 楽器なし", "zh": "Sky Realm Song 无乐器", }, "SOG 楽器あり": { "en": "Sky Realm Song with Harp", "ja": "ソング・オブ・グランデ 楽器あり", "zh": "Sky Realm Song 装备乐器", }, "コール・オブ・アビス 楽器あり": { "en": "Call of the Abyss with Harp", "ja": "コール・オブ・アビス 楽器あり", "zh": "Call of the Abyss 装备乐器", }, "天眼陣(3T)": { "en": "Omnipotent Eye (3T)", "ja": "天眼陣(3T)", "zh": "天眼阵(3T)", }, "他心陣と奥義": { "en": "Splitting Spirit and C.A.", "ja": "他心陣と奥義", "zh": "他心阵和奥义", }, // Notice "オメガウェポン注記": { "en": "Gauph Key of Strength is not implemented yet.", "ja": "ガフスキー強壮(渾身)は未実装です.", "zh": "Omega武器1技能的强壮(浑身)还没有实装。", }, "天司武器注記": { "en": "If you added Angel's weapon in your grid, set the sort key to that based on \'Damage\'.", "ja": "天司武器入りで計算する場合、優先項目をダメージベースのものに設定してください.", "zh": "把天司武器加入计算的时候,请选择基于伤害的优先项目。", }, "広告": { "en": "Ad.", "ja": "広告", "zh": "广告", }, "入力例:": { "en": "Input Example:", "ja": "入力例:", "zh": "入力例:", }, "不具合報告・ご要望:": { "en": "Bug Report/Request:", "ja": "不具合報告・ご要望:", "zh": "不具合報告・要望:", }, "開発者募集:": { "en": "Recruiting Developers:\n", "ja": "開発者募集:", "zh": "開発者募集:", }, "更新履歴": { "en": "Changelog", "ja": "更新履歴", "zh": "更新履歴", }, "次の{step}件を表示": { "en": "Show next {step} logs", "ja": "次の{step}件を表示", "zh": "Show next {step} logs", }, "notice-20170114-1": { "en": "2017/01/14: English Support (partly).", "ja": "2017/01/14: 英語対応", "zh": "2017/01/14: 英语支持", }, "notice-20170116-1": { "en": "2017/01/16: Fixed HP calculation process missed including Job HP bonus and Health Bonus.", "ja": "2017/01/16: ジョブのHPボーナスと守護ボーナスを計算に入れ忘れていたのを修正", "zh": "2017/01/16: 修正了职业的HP和守护Bonus被遗忘的问题", }, "notice-20170116-2": { "en": "2017/01/16: Fixed a bug that \"Character Favorite Weapon\" also affect their HP.", "ja": "2017/01/16: キャラの得意武器補正がHPにも乗っていたのを修正", "zh": "2017/01/16: 修正了得意武器也会影响HP的问题", }, "notice-20170118-1": { "en": "2017/01/18: Added some advertisements to make myself motivate.", "ja": "2017/01/18: 開発意欲を出すため広告を追加.", "zh": "2017/01/18: 为了开发动力增加了广告。", }, "notice-20170121-1": { "en": "2017/01/21: Fixed a bug that \"Inferno's Seconda Insignia\" is not affected by Agnis.", "ja": "2017/01/21: 紅蓮の呪印・弐にアグニス石が影響するように戻した.", "zh": "2017/01/21: 修正了红莲的咒印・叁不受阿格尼斯加护的问题。", }, "notice-20170121-2": { "en": "2017/01/21: Implemennted Zaruhamerina Enmity.", "ja": "2017/01/21: ザルハメリナ背水の実装.", "zh": "2017/01/21: ザルハメリナ背水(被动技能)实装。", }, "notice-20170121-3": { "en": "2017/01/21: Display Health Bonus amount in skill amount info.", "ja": "2017/01/21: 守護ボーナス分がスキル情報として表示されるようにした。", "zh": "2017/01/21: 守护Bonus部分现在也作为技能情报显示。", }, "notice-20170121-4": { "en": "2017/01/21: Added Zenith Perk for Party HP Bonus", "ja": "2017/01/21: パーティHPボーナスのゼニス入力欄を追加", "zh": "2017/01/21: 增加了全队HP LB的输入栏。", }, "notice-20170121-5": { "en": "2017/01/21: Added Send new tempalte request button.", "ja": "2017/01/21: テンプレート追加要望ボタンを追加.", "zh": "2017/01/21: 添加了列表追加请求按钮。", }, "notice-20170122-1": { "en": "2017/01/22: Fixed a bug that some weapon which have element changes cannot add. / Added new weapons", "ja": "2017/01/22: 属性変更武器が追加できなくなっていた不具合を修正 / 武器追加", "zh": "2017/01/22: 修正了无法增加改变属性武器的Bug / 追加新武器", }, "notice-20170122-2": { "en": "2017/01/22: Fixed invalid Open Enmity-Graph call if character length > 3.", "ja": "2017/01/22: キャラ数が4人以上の場合に背水グラフが開けなくなっていた不具合を修正", "zh": "2017/01/22: 修正了角色数4人以上时无法打开背水图表的问题。", }, "notice-20170123-1": { "en": "2017/01/23: Added new templates. / Changed the standard sortkey.", "ja": "2017/01/23: 新規キャラと武器追加 / 標準のソートキーを変更", "zh": "2017/01/23: 添加新角色与新武器 / 改变了标准sort key", }, "notice-20170129-1": { "en": "2017/01/29: Implemented personal buff inputs. (and tweaked character tab style.) / Additional Damage buff gets displayed in skill information.", "ja": "2017/01/29: キャラ個別バフ欄の追加 (キャラ欄の見た目調整) / 追加ダメージバフがスキル情報に表示されるように修正.", "zh": "2017/01/29: 添加了角色个别的Buff栏(角色栏的UI调整) / 追加伤害Buff现在也作为技能情报显示了", }, "notice-20170202-1": { "en": "2017/02/02: Added new two weapons.", "ja": "2017/02/02: カースドブレイドとマシンボウ追加.", "zh": "2017/02/02: 添加了两把新武器。", }, "notice-20170204-1": { "en": "2017/02/04: Added Rosamia.", "ja": "2017/02/04: ロザミア(SSR)が抜けていたので追加.", "zh": "2017/02/04: 添加了ロザミア(SSR)", }, "notice-20170204-2": { "en": "2017/02/04: Weapons which have element variation become displayed regardless of the filter element.", "ja": "2017/02/04: 属性変更武器が、属性フィルターに関わらず表示されるようにした.", "zh": "2017/02/04: 变更属性武器现在无论选择了哪个属性都会显示。", }, "notice-20170208-1": { "en": "2017/02/08: Implemented \"Enmity Graph based on real HP\" / Changed input behavior, open templates when a user begins name input.", "ja": "2017/02/08: 実HPベースの背水グラフ表示を実装 / 武器とキャラの名前が空欄の時に入力を開始するとテンプレートが自動的に開かれるようにした.", "zh": "2017/02/08: 实装了基于实际HP的背水图表 / 现在武器和角色名字为空,输入开始就会自动打开列表。", }, "notice-20170212-1": { "en": "2017/02/12: Fixed a bug that cannot open enmity graph if there is only one summon setup.", "ja": "2017/02/12: 召喚石組み合わせが1組のみの場合に背水グラフが開けないバグを修正.", "zh": "2017/02/12: 修正了召唤石只有1组时打不开背水图表的Bug。", }, "notice-20170212-2": { "en": "2017/02/12: Added coco&mimi Lv150.", "ja": "2017/02/12: ココミミとペルソスの最終上限解放ステータスを追加. (スキル対応はまだ).", "zh": "2017/02/12: 增加了可可&米米的最终上限解放数值。", }, "notice-20170212-3": { "en": "2017/02/12: Added Job Masterpieces tempalte.", "ja": "2017/02/12: 属性変更後のジョブマスターピースのテンプレートを追加.", "zh": "2017/02/12: 增加了改变属性后的英雄武器。", }, "notice-20170216-1": { "en": "2017/02/16: Addded Xeno Ifrit Axes.", "ja": "2017/02/16: ゼノイフリート斧とEX特大の計算を追加 / ジョブの守護ボーナスの計算タイミングがおかしいのを修正.", "zh": "2017/02/16: 增加了火六道斧与EX特大的计算 / 修正了职业守护Bonus计算的问题", }, "notice-20170217-1": { "en": "17/02/2017: Currently, there is a invalid data loading bug when you load the setup from a browser. When it happened, change an value in Profile Tab. It will fix the result.", "ja": "2017/02/17: 現在、ブラウザ保存したデータ読み込み時にプロフィール欄が正しく読み込まれない場合があるようです. その場合、プロフィール欄の入力値をどこでもいいので適当に変更すると正しい計算結果になるはずです.", "zh": "2017/02/17: 现在读取浏览器保存的数据时可能资料栏无法正确读取。如果遇到这种情况,重新输入资料栏的任意栏应该就会解决。", }, "notice-20170218-1": { "en": "18/02/2017: Added charas and weapons, apsaras.", "ja": "2017/02/18: 武器とキャラ追加 / アプサラス追加.", "zh": "2017/02/18: 增加新武器/新角色/新职业", }, "notice-20170218-2": { "en": "18/02/2017: Added English Name of Romeo, Yngwei, Yuisis, Rastina and Implemented English name searching for these charas.", "ja": "2017/02/18: ロミオ、イングヴェイ、ユイシス、ラスティナの連撃率更新 / 英語名表示と英語名検索を実装.", "zh": "2017/02/18: 更新了一部分角色的连击率 / 增加了英语名字和英语名搜索", }, "notice-20170302-1": { "en": "02/03/2017: Display chara elements and enemy's element in result tab. Do not display Exp. Critical Ratio in number when djeeta's element is Non-advantage.", "ja": "2017/03/02: キャラ属性と敵属性を結果欄に表示するように変更 / 非有利の時は技巧期待値を数値で表示しないように変更", "zh": "2017/03/02: 现在角色属性与敌人属性会显示在结果栏中 / 非有利的时候不再表示技巧的期望值。", }, "notice-20170305-1": { "en": "05/03/2017: Disabled swipe tab switching. Modified the graph add bution.", "ja": "2017/03/05: スワイプによるタブ移動を無効化. グラフ追加ボタンを元に戻した.", "zh": "2017/03/05: 拖动不再能移动栏。 修改了追加图表按钮。", }, "notice-20170305-2": { "en": "05/03/2017: Added new weapons.", "ja": "2017/03/05: 4凸ブリューナク追加. スキル「貫きの牙」追加. ブリューナク追加時にメイン装備かどうかの切り替えができるようにした.", "zh": "2017/03/05: 增加了4突武器ブリューナク和技能。", }, "notice-20170306-1": { "en": "06/03/2017: Implemented piram's 2nd skill.", "ja": "2017/03/06: 4凸ピラムのスキル「鷲王の結界」実装. 効果量はジータのみDA+13%(SLv15の時)で、SLv14以下は適当に0.5%ごと減少にしています.", "zh": "2017/03/06: 增加了4突武器ピラム的技能「鷲王の結界」。", }, "notice-20170308-1": { "en": "08/03/2017: Changed the maximum rank to 200.", "ja": "2017/03/08: ランクの上限値を200に変更.", "zh": "2017/03/08: Rank上限变为200。", }, "notice-20170310-1": { "en": "10/03/2017: Implemented new \"Damage UP\" skill (Angel's blessing).", "ja": "2017/03/10: 天司の祝福スキルを実装. 与ダメージ上昇を計算できるようにした. (スキル情報にも表示されます)", "zh": "2017/03/10: 增加了天司的祝福技能。(效果显示在技能情报中)", }, "notice-20170311-1": { "en": "11/03/2017: Added new weapons.", "ja": "2017/03/11: 新武器などを追加", "zh": "2017/03/11: 增加了新武器。", }, "notice-20170312-1": { "en": "12/03/2017: Modified Enmity (M) and Enmity (L) values.", "ja": "2017/03/12: 背水(中)と背水(大)の効果量を微修正.", "zh": "2017/03/12: 微调了背水(中)和背水(大)的效果量", }, "notice-20170312-2": { "en": "12/03/2017: Separated \"Single Attack Damage\" columns and added new sort keys.", "ja": "2017/03/12: \"単攻撃ダメージ\"を4つに分類し、ソートキーを追加.", "zh": "2017/03/12: 将单次攻击伤害分成4类,增加了新的sort key。", }, "notice-20170315-1": { "en": "15/03/2017: Implemented Critical UP support abilities.", "ja": "2017/03/15: キャラサポアビのクリティカル計算を実装", "zh": "2017/03/15: 增加了角色被动技能的暴击率计算。", }, "notice-20170317-1": { "en": "17/03/2017: Implemented Angel's blessing II. / Added Seraphim weapon (SSR) templates", "ja": "2017/03/17: 天司の祝福II(与ダメージアップ20%)を実装. / 天司武器SSRを追加.", "zh": "2017/03/17: 实装了SSR天司武器及技能天司的祝福II(伤害增加20%)", }, "notice-20170328-1": { "en": "28/03/2017: Fixed problems on data loading from browser.", "ja": "2017/03/28: ブラウザデータロード時に正しく読み込まれないことがあるバグを修正.", "zh": "2017/03/28: 修正了浏览器数据无法正确读取的Bug。", }, "notice-20170329-1": { "en": "29/03/2017: Fixed bugs.", "ja": "2017/03/29: 霧氷の追牙に神石効果が乗らない不具合を修正 / 天司スキルが非有利の場合でも計算されてしまう不具合を修正.", "zh": "2017/03/29: 修正了雾冰的追牙(玄武壳拳)不受加护影响的Bug / 天司技能非有利也会计算的Bug。", }, "notice-20170329-3": { "en": "29/03/2017: Fixed invalid loading if the weapon or summon number is not matched their default number. / Fixed that the server save function was corrupted.", "ja": "2017/03/29: 武器数と召喚石組数が変更されたデータが読み込まれた際に表示がおかしくなるバグを修正 / サーバーに保存機能が動いていなかったバグを修正.", "zh": "2017/03/29: 修正了读取改变了武器数和召唤石的组数的数据时的一个Bug。", }, "notice-20170331-1": { "en": "31/03/2017: Fixed values of normal and magna criticals (M). / Added Elysian. / Improved buff input interfaces.", "ja": "2017/03/31: 技巧(中)の効果量修正 / エリュシオン追加 / バフ入力欄の利便性向上.", "zh": "2017/03/31: 修正了技巧(中)的效果量 / 追加了新职业Elysian / 改进了Buff输入栏。", }, "notice-20170409-1": { "en": "09/04/2017: Improved An Interface of Damage Simulator. / Implemented name editing of saved grids.", "ja": "2017/04/09: ダメージシミュレータのインターフェースの改善 / 保存した編成の名前を編集できるようにした.", "zh": "2017/04/09: 伤害模拟器UI改进 / 现在可以自己编辑保存的编成名了。", }, "notice-20170410-1": { "en": "10/04/2017: Added a new skill Normal Tyranny II and Implemented the additional skill selection for Four beast weapons.", "ja": "2017/04/09: 通常暴君IIを追加 / 新四象武器選択時に追加スキルを追加するか選択可能に.", "zh": "2017/04/09: 增加了通常暴君II / 选择新四象武器时可以选择追加技能了。", }, "notice-20170414-1": { "en": "14/04/2017: Added a skill Normal Aegis (LL).", "ja": "2017/04/14: 通常守護IIを追加.", "zh": "2017/04/14: 增加了通常守护II。", }, "notice-20170415-1": { "en": "15/04/2017: Partly added English Templates! Thanks theorycrafting guys.", "ja": "2017/04/15: 武器とキャラテンプレートの一部を英語化.", "zh": "2017/04/15: 武器和角色列表一部分英化。", }, "notice-20170501-1": { "en": "01/05/2017: Added new weapons and skills.", "ja": "2017/05/01: 武器追加、通常攻刃IIIと通常三手(小)[未検証]を追加.", "zh": "2017/05/01: 增加新武器 / 增加新技能 通常攻刃III和通常三手(小)", }, "notice-20170516-1": { "en": "16/05/2017: Fixed the invalid value of Health Bonus by Majesty skills.", "ja": "2017/05/16: 神威スキルのHP上昇量が通常守護のものとなっていたので修正.", "zh": "2017/05/16: 修正了神威技能有误的HP上升量。", }, "notice-20170517-1": { "en": "17/05/2017: Implemented Chain Burst calculation.", "ja": "2017/05/17: チェインバーストダメージの計算を実装.", "zh": "2017/05/17: 实装了Chain Burst伤害的计算。", }, "notice-20170525-1": { "en": "25/05/2017: Implemented Damage Limit UP calculation.", "ja": "2017/05/25: ダメージ上限UPの計算を実装.", "zh": "2017/05/25: 实装了伤害上限上升的计算。", }, "notice-20170531-1": { "en": "31/05/2017: Fixed an invalid status of Murgles / Modified the skill amount of Andalis 4* damage limit up to 7%.", "ja": "2017/05/31: ミュルグレス4凸の武器ステータスが+99のものになっていたので修正 / アンダリス4凸の上限UP効果を7%に.", "zh": "2017/05/31: 修正了4突武器ミュルグレス不正确的数值 / 4突武器アンダリス的伤害上限效果修正为7%。", }, "notice-20170617-1": { "en": "17/06/2017: Fixed Base ATK and HP calculation above Rank 175.", "ja": "2017/06/17: Rank175以上の基礎攻撃力/HP計算式を修正.", "zh": "2017/06/17: 修正了Rank175以上的基础HP/HP公式。", }, "notice-20170704-1": { "en": "04/07/2017: Added new weapons. Implemented 'Non' element type. Implemented critical ratio array displaying.", "ja": "2017/07/04: 武器追加. 無属性と無属性(技巧あり)を実装. 技巧倍率毎の発生確率表示を実装.", "zh": "2017/07/04: 增加新武器。 实装了无属性和无属性(考虑技巧)的计算。实装了显示每个技巧倍率的发生概率。", }, "notice-20170725-1": { "en": "25/07/2017: Added new weapons. Implemented Ougi Damage Limit UP calculation. Added Primacy skill.", "ja": "2017/07/25: 武器追加. 奥義上限UP計算の実装. 無双スキルと奥義上限UPと舞姫の演武の実装.", "zh": "2017/07/25: 增加新武器。 实装了奥义上限上升的计算。 实装了新技能。", }, "notice-20170802-1": { "en": "02/08/2017: Changed damage calculation ceiling timing to match the value shown in GBF game.", "ja": "2017/08/02: ダメージ計算の切り上げタイミングの調整(ゲーム内予測ダメージと一致するようになりました)", "zh": "2017/08/02: 调整了伤害计算时取整的时机(和游戏内预测伤害一致了)。", }, "notice-20170805-1": { "en": "05/08/2017: Implemented Ultima Weapons.", "ja": "2017/08/05: オメガウェポンスキルを実装.", "zh": "2017/08/05: 实装了Omega武器的技能。", }, "notice-20170817-1": { "en": "17/08/2017: Implemented Rose weapons II. Added new charas. Implemented 'Primal' race.", "ja": "2017/08/17: EX攻刃守護(中)を実装. ローズ武器2を追加. 水着キャラ追加. 種族: 星晶獣を追加.", "zh": "2017/08/17: 增加了EX攻刃守护(中)。增加了蔷薇武器2。增加了泳装角色。增加了星晶兽种族。", }, "notice-20170819-1": { "en": "19/08/2017: Fixed some character data without favorite weapons. Applied new Ougi Damage Limitation Range. Fixed stopping bug when the ChainBurst Number was changed.", "ja": "2017/08/19: 得意武器が抜けていたキャラを修正. 新奥義上限を適用. チェインバースト数を弄ると計算が止まる不具合を修正.", "zh": "2017/08/19: 修正了部分角色没有的义务切断问题。奥义上限适用调整后的数值。修正了修改Chain Burst数会停止计算的Bug。", }, "notice-20170907-1": { "en": "07/09/2017: Added new weapons and characters.", "ja": "2017/09/07: 武器とキャラ追加.", "zh": "2017/09/07: 增加新武器和新角色。", }, "notice-20171011-1": { "en": "11/10/2017: Added new weapons and characters.", "ja": "2017/10/11: 武器とキャラ追加.", "zh": "2017/09/07: 增加新武器和新角色。", }, "notice-20171011-2": { "en": "11/10/2017: Implemented second `other buff` input forms.", "ja": "2017/10/11: 2つ目の`その他バフ`を入力する欄を追加.", "zh": "2017/10/11: 增加了第二个其他Buff的支持。", }, "notice-20171117-1": { "en": "17/11/2017: Added the new skill 'Normal Celere (S)' / Added new weapons and charas.", "ja": "2017/11/17: 通常刹那(小)追加 / キャラと武器追加.", "zh": "2017/11/17: 添加了新技能 通常刹那(小) / 添加了新角色和新武器", }, "notice-20171211-1": { "en": "11/12/2017: Added new weapons.", "ja": "2017/12/11: 武器追加.", "zh": "2017/12/11: 添加了新武器。", }, "notice-20171229-1": { "en": "29/12/2017: Implemented Chara Limit Bonus Calculation and Ultima (Zeal) skill.", "ja": "2017/12/29: キャラLBの計算を実装 / オメガ激情の計算を実装.", "zh": "2017/12/29: 实装了角色LB的计算 / 实装了Omega激情的计算", }, "notice-20180102-1": { "en": "02/01/2018: Implemented Fandango skill.", "ja": "2018/01/02: 乱舞(小)の計算を実装 / ダメージ上限上昇が奥義ダメージ上限へ影響していなかった不具合を修正.", "zh": "2018/01/02: 乱舞(小)计算实装 / 修正了伤害上限上升不会影响奥义伤害上限的Bug。", }, "notice-20180205-1": { "en": "05/02/2018: Implemented Stamina (M).", "ja": "2018/02/05: 渾身(中)の計算を実装 / 武器テンプレート追加.", "zh": "2018/02/05: 浑身(中)计算实装 / 武器列表追加", }, "notice-20180311-1": { "en": "11/03/2018: Implemented Magna Stamina (M), Ultima Strength, and added new magna II Weapons.", "ja": "2018/03/11: 方陣渾身(中)、オメガ強壮の計算を実装 / マグナII武器テンプレート追加(スキルは未対応).", "zh": "2018/03/11: 方阵浑身(中)、Omega强壮的计算实装 / 方阵2武器的列表追加(无技能)", }, "notice-20190310-1": { "en": "10/03/2019: Add 3rd support ability slot and Gladiator Class and character and weapons.", "ja": "2019/03/10: 3番目のサポアビ欄実装。クリュサオル追加。最終十天等一部キャラに奥義上限を引き上げるサポアビ追加。他キャラ・武器追加。", "zh": "2019/03/10: Add 3rd support ability slot and Gladiator Class and character and weapons.", }, "notice-20190414-1": { "en": "14/04/2019: Add Opus weapons and 3rd skill slot.", "ja": "2019/04/14: 終末武器追加。3番目のスキル欄追加(過去の編成データが読み込めなくなっています(現在修正済))", "zh": "2019/04/14: Add Opus weapons and 3rd skill slot.", }, "notice-20190414-2": { "en": "14/04/2019: Fix the skill effect amount.", "ja": "2019/04/14: 二手三手技巧軍神スキル効果量修正。", "zh": "2019/04/14: Fix the skill effect amount.", }, "notice-20190424-1": { "en": "24/04/2019: Separate enemy defense value and debuff fields.", "ja": "2019/04/24: デバフ量項目実装。", "zh": "2019/04/24: Separate enemy defense value and debuff fields", }, "notice-20190424-2": { "en": "24/04/2019: Add character and weapons.", "ja": "2019/04/24: 天司武器4凸追加。他キャラ・武器追加。", "zh": "2019/04/24: Add character and weapons.", }, "notice-20190426-1": { "en": "26/04/2019: Add the total of Magna/Normal/Exceed ougi damage limits is 60%.", "ja": "2019/04/26: 方陣+通常+イクシードの合算枠上限を60%に設定。他奥義上限枠見直し。", "zh": "2019/04/26: Add the total of Magna/Normal/Exceed ougi damage limits is 60%.", }, "notice-20190427-1": { "en": "27/04/2019: Implement Boost damage aura. Add [4凸]Ichigo Hitofuri. Fix Character base DATA. Others, fine-tuned.", "ja": "2019/04/27: 与ダメージ加護実装。[4凸]一期一振追加。キャラ基礎連撃修正。その他微調整。", "zh": "2019/04/27: Implement Boost damage aura. Add [4凸]Ichigo Hitofuri. Fix Character base DATA. Others, fine-tuned.", }, "notice-20190428-1": { "en": "28/04/2019: Implement a damage limit aura. Add Master Bonuses.", "ja": "2019/04/28: ダメージ上限加護実装。マスボ追加。最終ソーンの奥義をサポアビとして実装(今の所手動で選択する必要があります)。", "zh": "2019/04/28: Implement a damage limit aura. Add Master Bonuses.", }, "notice-20190430-1": { "en": "30/04/2019: Add Player's Extended Mastery. Improved Save data compatibility.", "ja": "2019/04/30: ジータLB追加。編成データの互換性強化。", "zh": "2019/04/30: Add Player's Extended Mastery. Improved Save data compatibility.", }, "notice-20190501-1": { "en": "01/05/2019: Add huanglong spear skill2. Fix Eahta's support ability and Belltower Skill.", "ja": "2019/05/01: 黄龍槍メイン装備時スキル追加。最終オクトーサポアビ修正。ベルタワースキル修正。", "zh": "2019/05/01: Add huanglong spear skill2. Fix Eahta's support ability and Belltower Skill.", }, "notice-20190511-1": { "en": "11/05/2019: Add characters and weapons and chara's default ougi ratio.", "ja": "2019/05/11: キャラ・武器追加。キャラのデフォルト奥義倍率追加。", "zh": "2019/05/11: Add characters and weapons and chara's default ougi ratio.", }, }; // Language settings module.exports.getLocale = function () { var lang = ( (window.navigator.languages && window.navigator.languages[0]) || window.navigator.language || window.navigator.userLanguage || window.navigator.browserLanguage); if (lang == "ja-jp" || lang == "ja-JP") lang = "ja"; if (lang == "zh-cn" || lang == "zh-CN") lang = "zh"; if (lang != "ja" && lang != "zh") lang = "en"; return lang; }; module.exports.translate = function (key, locale) { try { if (key == undefined || key == "") return ""; if (locale != "ja" && locale != "en" && locale != "zh") return multiLangData[key]["ja"]; return multiLangData[key][locale]; } catch (e) { console.error("Error! Key " + key + "for language " + locale + " not found") } };
const assert = require('assert'); const videoUrlLink = require('..'); describe('videoUrlLink.twitter', () => { const urls = [ 'https://twitter.com/taylorswift13/status/1121935013484867585', 'https://twitter.com/blakelively/status/1045768952872398848' ] urls.forEach(function (url) { it('twitter.getInfo ' + url, (done) => { videoUrlLink.twitter.getInfo(url, { }, (error, info) => { console.log(info); done(error); }); }); }); });
import Link from "next/link"; import { useRouter } from "next/router"; export default function ProjectFeed({ projects }) { return projects ? projects.map((project) => <ProjectItem project={project} />) : null; } function ProjectItem({ project }) { const router = useRouter(); return ( <> <h1>{project}</h1> <button type="button" onClick={() => { router.push({ pathname: "/projects/[id]/tickets", query: { id: project }, }); }} > Test{" "} </button> </> ); }
const got = require('@/utils/got'); const cheerio = require('cheerio'); module.exports = async (ctx) => { const rootUrl = 'https://www.cgtn.com/'; const response = await got({ method: 'get', url: rootUrl, }); const $ = cheerio.load(response.data); const list = $('.titleArea') .map((_, item) => { item = $(item); const a = item.find('a'); return { title: a.text(), link: a.attr('href'), pubDate: new Date(parseInt(a.attr('data-time'))).toUTCString(), }; }) .get(); const items = await Promise.all( list.map((item) => ctx.cache.tryGet(item.link, async () => { const detailResponse = await got({ method: 'get', url: item.link, }); const content = cheerio.load(detailResponse.data); item.description = content('#cmsMainContent').html(); return item; }) ) ); ctx.state.data = { title: "CGTN - Editors' Pick", link: rootUrl, item: items, }; };
'use strict'; System.register(['./events', '../common/util', '../common/decorators'], function (_export, _context) { "use strict"; var getEventOption, Util, delayed, _dec, _desc, _value, _class, firstValue, WidgetBase; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object['define' + 'Property'](target, property, desc); desc = null; } return desc; } return { setters: [function (_events) { getEventOption = _events.getEventOption; }, function (_commonUtil) { Util = _commonUtil.Util; }, function (_commonDecorators) { delayed = _commonDecorators.delayed; }], execute: function () { firstValue = {}; _export('WidgetBase', WidgetBase = (_dec = delayed(), (_class = function () { function WidgetBase() { _classCallCheck(this, WidgetBase); } WidgetBase.prototype.createWidget = function createWidget(option) { var _this = this; this.allOption = this.getWidgetOptions(option.element); if (!this.ejOptions && !this.isEditor) { this.createTwoWays(); } this.eWidget = this.widget = jQuery($(option.element))[this.controlName](this.allOption).data(this.controlName); if (this.templateProcessor) { this.templateProcessor.initWidgetDependancies(); } if (this.isEditor) { this.widget.model._change = function (evt) { if ('eValue' in _this) { _this[_this.util.getBindablePropertyName('value')] = evt.value; } }; } }; WidgetBase.prototype.bind = function bind(ctx, overrideCtx) { this.parentCtx = overrideCtx; if (this.widget && this.widget.element && this.isEditor) { this.widget.option('value', this.eValue === undefined ? null : this.eValue); } }; WidgetBase.prototype.createTwoWays = function createTwoWays() { var model = this.allOption; var twoWays = this.twoWays; var len = twoWays.length; for (var i = 0; i < len; i++) { var prop = twoWays[i]; ej.createObject(prop, this.addTwoways(prop), model); } }; WidgetBase.prototype.addTwoways = function addTwoways(prop) { var model = this; var value = firstValue; return function (newVal, isApp) { if (value === firstValue) { var viewModelProp = model.util.getBindablePropertyName(prop); value = model[viewModelProp]; if (value === undefined) { value = this.defaults[prop]; } return value; } if (newVal === undefined) { return value; } if (value === newVal) { return null; } value = newVal; if (!isApp && model.util.hasValue(newVal)) { var _viewModelProp = model.util.getBindablePropertyName(prop); model[_viewModelProp] = newVal; } return null; }; }; WidgetBase.prototype.getWidgetOptions = function getWidgetOptions(element) { var propOptions = void 0; if (this.ejOptions) { propOptions = this.ejOptions; } else { propOptions = this.util.getOptions(this, this.controlProperties); } var eventOption = getEventOption(element); if (this.hasChildProperty) { this.getChildProperties(propOptions); } return Object.assign({}, propOptions, eventOption); }; WidgetBase.prototype.getChildProperties = function getChildProperties(options) { var PropertyName = this.childPropertyName; var childCollection = this[PropertyName]; var len = childCollection.length; if (len) { options[PropertyName] = []; var childProperties = childCollection[0].controlProperties; for (var i = 0; i < len; i++) { options[PropertyName].push(this.util.getOptions(childCollection[i], childProperties)); } } }; WidgetBase.prototype.attached = function attached() { if (this.templateProcessor) { this[this.childPropertyName].forEach(function (template) { return template.setTemplates(); }); } this.util = new Util(); this.createWidget({ element: this.element }); }; WidgetBase.prototype.unsubscribe = function unsubscribe() { if (this.subscription) { this.subscription.dispose(); this.subscription = null; } }; WidgetBase.prototype.unbind = function unbind() { this.unsubscribe(); }; WidgetBase.prototype.propertyChanged = function propertyChanged(property, newValue, oldValue) { var _this2 = this; if (this.widget) { var modelValue = void 0; var prop = this.util.getControlPropertyName(this, property); this.unsubscribe(); if (this.arrayObserver) { this.arrayObserver.forEach(function (arrayProp) { if (_this2[arrayProp] instanceof Array) { _this2.subscription = _this2.bindingInstance.collectionObserver(_this2[arrayProp]).subscribe(function (e) { _this2.update(e); }); } }); } if (prop) { if (prop === 'widget') { return; } else if (prop !== 'options') { modelValue = this.widget.model[prop]; var isTwoway = typeof modelValue === 'function'; if (isTwoway) { modelValue = modelValue(); } if (modelValue !== newValue) { if (isTwoway) { newValue = this.addTwoways(prop); } this.widget.option(prop, newValue); } } else { this.widget.option(newValue); } } } }; WidgetBase.prototype.update = function update(e) { var _this3 = this; var modelValue = void 0; var newVal = void 0; if (e.length) { this.arrayObserver.forEach(function (arrayProp) { if (_this3[arrayProp] instanceof Array) { var prop = _this3.util.getControlPropertyName(_this3, arrayProp); modelValue = _this3.widget.model[prop]; if (typeof modelValue === 'function') { modelValue = modelValue(); newVal = modelValue; newVal = _this3.addTwoways(prop); _this3.widget.option(prop, newVal); } else { _this3.widget.option(prop, modelValue); } } }); } }; WidgetBase.prototype.detached = function detached() { if (this.templateProcessor) { this.templateProcessor.clearTempalte(); } if (this.widget) { this.widget.destroy(); } }; return WidgetBase; }(), (_applyDecoratedDescriptor(_class.prototype, 'attached', [_dec], Object.getOwnPropertyDescriptor(_class.prototype, 'attached'), _class.prototype)), _class))); _export('WidgetBase', WidgetBase); } }; }); //# sourceMappingURL=../dist/dev/common/widget-base.js.map
/*! jQuery UI - v1.11.4 - 2015-03-11 * http://jqueryui.com * Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ (function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)})(function(e){function t(t,s){var n,a,o,r=t.nodeName.toLowerCase();return"area"===r?(n=t.parentNode,a=n.name,t.href&&a&&"map"===n.nodeName.toLowerCase()?(o=e("img[usemap='#"+a+"']")[0],!!o&&i(o)):!1):(/^(input|select|textarea|button|object)$/.test(r)?!t.disabled:"a"===r?t.href||s:s)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}function s(e){for(var t,i;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=a(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",o)}function o(){e.datepicker._isDisabledDatepicker(v.inline?v.dpDiv.parent()[0]:v.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function r(t,i){e.extend(t,i);for(var s in i)null==i[s]&&(t[s]=i[s]);return t}function h(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),s="absolute"===i,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var t=e(this);return s&&"static"===t.css("position")?!1:n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&a.length?a:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var s=e.attr(i,"tabindex"),n=isNaN(s);return(n||s>=0)&&t(i,!n)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function s(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,s(this,t)+"px")})},e.fn["outer"+i]=function(t,n){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,s(this,t,!0,n)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,s,n=e(this[0]);n.length&&n[0]!==document;){if(i=n.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0}}),e.ui.plugin={add:function(t,i,s){var n,a=e.ui[t].prototype;for(n in s)a.plugins[n]=a.plugins[n]||[],a.plugins[n].push([i,s[n]])},call:function(e,t,i,s){var n,a=e.plugins[t];if(a&&(s||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(n=0;a.length>n;n++)e.options[a[n][0]]&&a[n][1].apply(e.element,i)}};var l=0,u=Array.prototype.slice;e.cleanData=function(t){return function(i){var s,n,a;for(a=0;null!=(n=i[a]);a++)try{s=e._data(n,"events"),s&&s.remove&&e(n).triggerHandler("remove")}catch(o){}t(i)}}(e.cleanData),e.widget=function(t,i,s){var n,a,o,r,h={},l=t.split(".")[0];return t=t.split(".")[1],n=l+"-"+t,s||(s=i,i=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[l]=e[l]||{},a=e[l][t],o=e[l][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new o(e,t)},e.extend(o,a,{version:s.version,_proto:e.extend({},s),_childConstructors:[]}),r=new i,r.options=e.widget.extend({},r.options),e.each(s,function(t,s){return e.isFunction(s)?(h[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},n=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=n,t=s.apply(this,arguments),this._super=i,this._superApply=a,t}}(),void 0):(h[t]=s,void 0)}),o.prototype=e.widget.extend(r,{widgetEventPrefix:a?r.widgetEventPrefix||t:t},h,{constructor:o,namespace:l,widgetName:t,widgetFullName:n}),a?(e.each(a._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,s,n=u.call(arguments,1),a=0,o=n.length;o>a;a++)for(i in n[a])s=n[a][i],n[a].hasOwnProperty(i)&&void 0!==s&&(t[i]=e.isPlainObject(s)?e.isPlainObject(t[i])?e.widget.extend({},t[i],s):e.widget.extend({},s):s);return t},e.widget.bridge=function(t,i){var s=i.prototype.widgetFullName||t;e.fn[t]=function(n){var a="string"==typeof n,o=u.call(arguments,1),r=this;return a?this.each(function(){var i,a=e.data(this,s);return"instance"===n?(r=a,!1):a?e.isFunction(a[n])&&"_"!==n.charAt(0)?(i=a[n].apply(a,o),i!==a&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+n+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+n+"'")}):(o.length&&(n=e.widget.extend.apply(null,[n].concat(o))),this.each(function(){var t=e.data(this,s);t?(t.option(n||{}),t._init&&t._init()):e.data(this,s,new i(n,this))})),r}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var d=!1;e(document).mouseup(function(){d=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!d){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),d=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),d=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function s(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),a=s.children()[0];return e("body").append(s),t=a.offsetWidth,s.css("overflow","scroll"),i=a.offsetWidth,t===i&&(i=s[0].clientWidth),s.remove(),n=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),s=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),n="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth,a="scroll"===s||"auto"===s&&t.height<t.element[0].scrollHeight;return{width:a?e.position.scrollbarWidth():0,height:n?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),s=e.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:s,isDocument:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s||n?i.width():i.outerWidth(),height:s||n?i.height():i.outerHeight()}}},e.fn.position=function(n){if(!n||!n.of)return f.apply(this,arguments);n=e.extend({},n);var p,m,g,v,y,b,_=e(n.of),x=e.position.getWithinInfo(n.within),w=e.position.getScrollInfo(x),k=(n.collision||"flip").split(" "),T={};return b=s(_),_[0].preventDefault&&(n.at="left top"),m=b.width,g=b.height,v=b.offset,y=e.extend({},v),e.each(["my","at"],function(){var e,t,i=(n[this]||"").split(" ");1===i.length&&(i=l.test(i[0])?i.concat(["center"]):u.test(i[0])?["center"].concat(i):["center","center"]),i[0]=l.test(i[0])?i[0]:"center",i[1]=u.test(i[1])?i[1]:"center",e=d.exec(i[0]),t=d.exec(i[1]),T[this]=[e?e[0]:0,t?t[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===k.length&&(k[1]=k[0]),"right"===n.at[0]?y.left+=m:"center"===n.at[0]&&(y.left+=m/2),"bottom"===n.at[1]?y.top+=g:"center"===n.at[1]&&(y.top+=g/2),p=t(T.at,m,g),y.left+=p[0],y.top+=p[1],this.each(function(){var s,l,u=e(this),d=u.outerWidth(),c=u.outerHeight(),f=i(this,"marginLeft"),b=i(this,"marginTop"),D=d+f+i(this,"marginRight")+w.width,S=c+b+i(this,"marginBottom")+w.height,M=e.extend({},y),C=t(T.my,u.outerWidth(),u.outerHeight());"right"===n.my[0]?M.left-=d:"center"===n.my[0]&&(M.left-=d/2),"bottom"===n.my[1]?M.top-=c:"center"===n.my[1]&&(M.top-=c/2),M.left+=C[0],M.top+=C[1],a||(M.left=h(M.left),M.top=h(M.top)),s={marginLeft:f,marginTop:b},e.each(["left","top"],function(t,i){e.ui.position[k[t]]&&e.ui.position[k[t]][i](M,{targetWidth:m,targetHeight:g,elemWidth:d,elemHeight:c,collisionPosition:s,collisionWidth:D,collisionHeight:S,offset:[p[0]+C[0],p[1]+C[1]],my:n.my,at:n.at,within:x,elem:u})}),n.using&&(l=function(e){var t=v.left-M.left,i=t+m-d,s=v.top-M.top,a=s+g-c,h={target:{element:_,left:v.left,top:v.top,width:m,height:g},element:{element:u,left:M.left,top:M.top,width:d,height:c},horizontal:0>i?"left":t>0?"right":"center",vertical:0>a?"top":s>0?"bottom":"middle"};d>m&&m>r(t+i)&&(h.horizontal="center"),c>g&&g>r(s+a)&&(h.vertical="middle"),h.important=o(r(t),r(i))>o(r(s),r(a))?"horizontal":"vertical",n.using.call(this,e,h)}),u.offset(e.extend(M,{using:l}))})},e.ui.position={fit:{left:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=e.left-t.collisionPosition.marginLeft,h=n-r,l=r+t.collisionWidth-a-n;t.collisionWidth>a?h>0&&0>=l?(i=e.left+h+t.collisionWidth-a-n,e.left+=h-i):e.left=l>0&&0>=h?n:h>l?n+a-t.collisionWidth:n:h>0?e.left+=h:l>0?e.left-=l:e.left=o(e.left-r,e.left)},top:function(e,t){var i,s=t.within,n=s.isWindow?s.scrollTop:s.offset.top,a=t.within.height,r=e.top-t.collisionPosition.marginTop,h=n-r,l=r+t.collisionHeight-a-n;t.collisionHeight>a?h>0&&0>=l?(i=e.top+h+t.collisionHeight-a-n,e.top+=h-i):e.top=l>0&&0>=h?n:h>l?n+a-t.collisionHeight:n:h>0?e.top+=h:l>0?e.top-=l:e.top=o(e.top-r,e.top)}},flip:{left:function(e,t){var i,s,n=t.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=e.left-t.collisionPosition.marginLeft,u=l-h,d=l+t.collisionWidth-o-h,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];0>u?(i=e.left+c+p+f+t.collisionWidth-o-a,(0>i||r(u)>i)&&(e.left+=c+p+f)):d>0&&(s=e.left-t.collisionPosition.marginLeft+c+p+f-h,(s>0||d>r(s))&&(e.left+=c+p+f))},top:function(e,t){var i,s,n=t.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=e.top-t.collisionPosition.marginTop,u=l-h,d=l+t.collisionHeight-o-h,c="top"===t.my[1],p=c?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];0>u?(s=e.top+p+f+m+t.collisionHeight-o-a,(0>s||r(u)>s)&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-h,(i>0||d>r(i))&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,s,n,o,r=document.getElementsByTagName("body")[0],h=document.createElement("div");t=document.createElement(r?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},r&&e.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)t.style[o]=s[o];t.appendChild(h),i=r||document.documentElement,i.insertBefore(t,i.firstChild),h.style.cssText="position: absolute; left: 10.7432222px;",n=e(h).offset().left,a=n>10&&11>n,t.innerHTML="",i.removeChild(t)}()}(),e.ui.position,e.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)),void 0)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,s=this.headers.length,n=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),s=t.next(),n=s.uniqueId().attr("id");t.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(t=n.height(),this.element.siblings(":visible").each(function(){var i=e(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===s&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?e():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?e():n,newPanel:r};t.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",t,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?e():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,s=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,t):(s.hide(),i.show(),this._toggleComplete(t)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var s,n,a,o=this,r=0,h=e.css("box-sizing"),l=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},d=l&&u.down||u,c=function(){o._toggleComplete(i)};return"number"==typeof d&&(a=d),"string"==typeof d&&(n=d),n=n||d.easing||u.easing,a=a||d.duration||u.duration,t.length?e.length?(s=e.show().outerHeight(),t.animate(this.hideProps,{duration:a,easing:n,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:a,easing:n,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==o.options.heightStyle&&(i.now=Math.round(s-t.outerHeight()-r),r=0)}}),void 0):t.animate(this.hideProps,a,n,c):e.animate(this.showProps,a,n,c)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target);!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&e(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.currentTarget); i.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){var i,s,n,a,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,s=this.previousFilter||"",n=String.fromCharCode(t.keyCode),a=!1,clearTimeout(this.filterTimer),n===s?a=!0:n=s+n,i=this._filterMenuItems(n),i=a&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(t.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(t,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var t,i,s=this,n=this.options.icons.submenu,a=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),a.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.parent(),s=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);i.attr("aria-haspopup","true").prepend(s),t.attr("aria-labelledby",i.attr("id"))}),t=a.add(this.element),i=t.find(this.options.items),i.not(".ui-menu-item").each(function(){var t=e(this);s._isDivider(t)&&t.addClass("ui-widget-content ui-menu-divider")}),i.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var i,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),s=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,n=t.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=t.outerHeight(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(t),this.activeMenu=s},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var s;this.active&&(s="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[t]()),this.focus(i,s)},nextPage:function(t){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),0>i.offset().top-s-n}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-s+n>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(e.trim(e(this).text()))})}}),e.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return t=!0,s=!0,i=!0,void 0;t=!1,s=!1,i=!1;var a=e.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",n);break;case a.UP:t=!0,this._keyEvent("previous",n);break;case a.DOWN:t=!0,this._keyEvent("next",n);break;case a.ENTER:this.menu.active&&(t=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=e.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(e){return s?(s=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(s){s.target===t.element[0]||s.target===i||e.contains(i,s.target)||t.close()})})},menufocus:function(t,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:n})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&e.trim(s).length&&(this.liveRegion.children().hide(),e("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,s=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,s){s(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,n){s.xhr&&s.xhr.abort(),s.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){n(e)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),s=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!i&&!s)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var s=this;e.each(i,function(e,i){s._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").text(i.label).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var s=RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return s.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}}),e.ui.autocomplete;var c,p="ui-button ui-widget ui-state-default ui-corner-all",f="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",m=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},g=function(t){var i=t.name,s=t.form,n=e([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?e(s).find("[name='"+i+"'][type=radio]"):e("[name='"+i+"'][type=radio]",t.ownerDocument).filter(function(){return!this.form})),n};e.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,m),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,i=this.options,s="checkbox"===this.type||"radio"===this.type,n=s?"":"ui-state-active";null===i.label&&(i.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(p).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){i.disabled||this===c&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){i.disabled||e(this).removeClass(n)}).bind("click"+this.eventNamespace,function(e){i.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),s&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return i.disabled?!1:void 0}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(i.disabled)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var s=t.element[0];g(s).not(s).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return i.disabled?!1:(e(this).addClass("ui-state-active"),c=this,t.document.one("mouseup",function(){c=null}),void 0)}).bind("mouseup"+this.eventNamespace,function(){return i.disabled?!1:(e(this).removeClass("ui-state-active"),void 0)}).bind("keydown"+this.eventNamespace,function(t){return i.disabled?!1:((t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active"),void 0)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",i.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(p+" ui-state-active "+f).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){return this._super(e,t),"disabled"===e?(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")),void 0):(this._resetButton(),void 0)},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?g(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),void 0;var t=this.buttonElement.removeClass(f),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction"),i=this.element.find(this.options.items),s=i.filter(":ui-button");i.not(":ui-button").button(),s.button("refresh"),this.buttons=i.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.11.4"}});var v;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var s,n,a;s=t.nodeName.toLowerCase(),n="div"===s||"span"===s,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),n),a.settings=e.extend({},i||{}),"input"===s?this._connectDatepicker(t,a):n&&this._inlineDatepicker(t,a)},_newInst:function(t,i){var s=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?a(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var s=e(t);i.append=e([]),i.trigger=e([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var s,n,a,o=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[r?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&t.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:n,title:n}):n)),t[r?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,s,n,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,s=0,n=0;e.length>n;n++)e[n].length>i&&(i=e[n].length,s=n);return s},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var s=e(t);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,s,n,a){var o,h,l,u,d,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),c=this._dialogInst=this._newInst(this._dialogInput,!1),c.settings={},e.data(this._dialogInput[0],"datepicker",c)),r(c.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+u,l/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,s=e(t),n=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),v===n&&(v=null))},_enableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,s,n=e(t),a=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,s){var n,a,o,h,l=this._getInst(t);return 2===arguments.length&&"string"==typeof i?"defaults"===i?e.extend({},e.datepicker._defaults):l?"all"===i?e.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),a=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),r(l.settings,n),null!==o&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,o)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),l),this._autoSize(l),this._setDate(l,a),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,s,n,a=e.datepicker._getInst(t.target),o=!0,r=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return n=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),n[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,n[0]),i=e.datepicker._get(a,"onSelect"),i?(s=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,r?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,s,n=e.datepicker._getInst(t.target); return e.datepicker._get(n,"constrainInput")?(i=e.datepicker._possibleChars(e.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(t){var i,s=e.datepicker._getInst(t.target);if(s.input.val()!==s.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,e.datepicker._getFormatConfig(s)),i&&(e.datepicker._setDateFromField(s),e.datepicker._updateAlternate(s),e.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,h,l,u;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},a!==!1&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return o|="fixed"===e(this).css("position"),!o}),h={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),h=e.datepicker._checkOffset(i,h,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),u=e.datepicker._get(i,"duration"),i.dpDiv.css("z-index",s(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),u):i.dpDiv[l||"show"](l?u:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,v=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,s=this._getNumberOfMonths(t),n=s[1],a=17,r=t.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&t.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),t.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,s){var n=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,r=t.input?t.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:e(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?n-o:0,i.left-=s&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=s&&i.top===t.input.offset().top+r?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+r):0),i},_findPos:function(t){for(var i,s=this._getInst(t),n=this._get(s,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[n?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,s,n,a,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[i]||e.effects[i])?o.dpDiv.hide(i,e.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),s=e.datepicker._getInst(i[0]);(i[0].id!==e.datepicker._mainDivId&&0===i.parents("#"+e.datepicker._mainDivId).length&&!i.hasClass(e.datepicker.markerClassName)&&!i.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||i.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==s)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,s){var n=e(t),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(t){var i,s=e(t),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(t,i,s){var n=e(t),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(t,i,s,n){var a,o=e(t);e(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var s,n=e(t),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,s,n,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),s=this._getDate(t),n=this.formatDate(i,s,this._getFormatConfig(t)),e(a).each(function(){e(this).val(n)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,s){if(null==t||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,a,o,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,c=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,b=!1,_=function(e){var i=t.length>n+1&&t.charAt(n+1)===e;return i&&n++,i},x=function(e){var t=_(e),s="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,n="y"===e?s:1,a=RegExp("^\\d{"+n+","+s+"}"),o=i.substring(h).match(a);if(!o)throw"Missing number at position "+h;return h+=o[0].length,parseInt(o[0],10)},w=function(t,s,n){var a=-1,o=e.map(_(t)?n:s,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var s=t[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(a=t[0],h+=s.length,!1):void 0}),-1!==a)return a+1;throw"Unknown name at position "+h},k=function(){if(i.charAt(h)!==t.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;t.length>n;n++)if(b)"'"!==t.charAt(n)||_("'")?k():b=!1;else switch(t.charAt(n)){case"d":v=x("d");break;case"D":w("D",d,c);break;case"o":y=x("o");break;case"m":g=x("m");break;case"M":g=w("M",p,f);break;case"y":m=x("y");break;case"@":r=new Date(x("@")),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),m=r.getFullYear(),g=r.getMonth()+1,v=r.getDate();break;case"'":_("'")?k():b=!0;break;default:k()}if(i.length>h&&(o=i.substr(h),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),a>=v)break;g++,v-=a}if(r=this._daylightSavingAdjust(new Date(m,g-1,v)),r.getFullYear()!==m||r.getMonth()+1!==g||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,i){if(!t)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(t){var i=e.length>s+1&&e.charAt(s+1)===t;return i&&s++,i},l=function(e,t,i){var s=""+t;if(h(e))for(;i>s.length;)s="0"+s;return s},u=function(e,t,i,s){return h(e)?s[t]:i[t]},d="",c=!1;if(t)for(s=0;e.length>s;s++)if(c)"'"!==e.charAt(s)||h("'")?d+=e.charAt(s):c=!1;else switch(e.charAt(s)){case"d":d+=l("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),n,a);break;case"o":d+=l("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=l("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,r);break;case"y":d+=h("y")?t.getFullYear():(10>t.getYear()%100?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":h("'")?d+="'":c=!0;break;default:d+=e.charAt(s)}return d},_possibleChars:function(e){var t,i="",s=!1,n=function(i){var s=e.length>t+1&&e.charAt(t+1)===i;return s&&t++,s};for(t=0;e.length>t;t++)if(s)"'"!==e.charAt(t)||n("'")?i+=e.charAt(t):s=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),s=e.lastVal=e.input?e.input.val():null,n=this._getDefaultDate(e),a=n,o=this._getFormatConfig(e);try{a=this.parseDate(i,s,o)||n}catch(r){s=t?"":s}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=s?a.getDate():0,e.currentMonth=s?a.getMonth():0,e.currentYear=s?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,s){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},a=function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,a=n.getFullYear(),o=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o));break;case"y":case"Y":a+=parseInt(l[1],10),r=Math.min(r,e.datepicker._getDaysInMonth(a,o))}l=h.exec(i)}return new Date(a,o,r)},o=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return o=o&&"Invalid Date"==""+o?s:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var s=!t,n=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),n===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(s?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),s="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(s,-i,"M")},next:function(){e.datepicker._adjustDate(s,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(s)},selectDay:function(){return e.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(s,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,s,n,a,o,r,h,l,u,d,c,p,f,m,g,v,y,b,_,x,w,k,T,D,S,M,C,N,A,P,I,H,z,F,E,O,j,W,L=new Date,R=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),Y=this._get(e,"isRTL"),B=this._get(e,"showButtonPanel"),J=this._get(e,"hideIfNoPrevNext"),q=this._get(e,"navigationAsDateFormat"),K=this._getNumberOfMonths(e),V=this._get(e,"showCurrentAtPos"),U=this._get(e,"stepMonths"),Q=1!==K[0]||1!==K[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),$=this._getMinMaxDate(e,"max"),Z=e.drawMonth-V,et=e.drawYear;if(0>Z&&(Z+=12,et--),$)for(t=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-K[0]*K[1]+1,$.getDate())),t=X&&X>t?X:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,i=this._get(e,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z-U,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(e,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z+U,1)),this._getFormatConfig(e)):n,a=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:R,o=q?this.formatDate(o,r,this._getFormatConfig(e)):o,h=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(Y?"":h)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),c=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),_="",w=0;K[0]>w;w++){for(k="",this.maxRows=4,T=0;K[1]>T;T++){if(D=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),S=" ui-corner-all",M="",Q){if(M+="<div class='ui-datepicker-group",K[1]>1)switch(T){case 0:M+=" ui-datepicker-group-first",S=" ui-corner-"+(Y?"right":"left");break;case K[1]-1:M+=" ui-datepicker-group-last",S=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",S=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===w?Y?a:s:"")+(/all|right/.test(S)&&0===w?Y?s:a:"")+this._generateMonthYearHeader(e,Z,et,X,$,w>0||T>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",C=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+u)%7,C+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+c[N]+"'>"+p[N]+"</span></th>";for(M+=C+"</tr></thead><tbody>",A=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,A)),P=(this._getFirstDayOfMonth(et,Z)-u+7)%7,I=Math.ceil((P+A)/7),H=Q?this.maxRows>I?this.maxRows:I:I,this.maxRows=H,z=this._daylightSavingAdjust(new Date(et,Z,1-P)),F=0;H>F;F++){for(M+="<tr>",E=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(z)+"</td>":"",x=0;7>x;x++)O=g?g.apply(e.input?e.input[0]:null,[z]):[!0,""],j=z.getMonth()!==Z,W=j&&!y||!O[0]||X&&X>z||$&&z>$,E+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(j?" ui-datepicker-other-month":"")+(z.getTime()===D.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===z.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(W?" "+this._unselectableClass+" ui-state-disabled":"")+(j&&!v?"":" "+O[1]+(z.getTime()===G.getTime()?" "+this._currentClass:"")+(z.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(j&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(W?"":" data-handler='selectDay' data-event='click' data-month='"+z.getMonth()+"' data-year='"+z.getFullYear()+"'")+">"+(j&&!v?"&#xa0;":W?"<span class='ui-state-default'>"+z.getDate()+"</span>":"<a class='ui-state-default"+(z.getTime()===R.getTime()?" ui-state-highlight":"")+(z.getTime()===G.getTime()?" ui-state-active":"")+(j?" ui-priority-secondary":"")+"' href='#'>"+z.getDate()+"</a>")+"</td>",z.setDate(z.getDate()+1),z=this._daylightSavingAdjust(z);M+=E+"</tr>"}Z++,Z>11&&(Z=0,et++),M+="</tbody></table>"+(Q?"</div>"+(K[0]>0&&T===K[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=M}_+=k}return _+=l,e._keyEvent=!1,_},_generateMonthYearHeader:function(e,t,i,s,n,a,o,r){var h,l,u,d,c,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",_="";if(a||!g)_+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,_+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;12>u;u++)(!h||u>=s.getMonth())&&(!l||n.getMonth()>=u)&&(_+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+r[u]+"</option>");_+="</select>"}if(y||(b+=_+(!a&&g&&v?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!a&&g&&v?"":"&#xa0;")+_),b+="</div>"},_adjustInstDate:function(e,t,i){var s=e.drawYear+("Y"===i?t:0),n=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(s,n))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(s,n,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),n=i&&i>t?i:t;return s&&n>s?s:n},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,s){var n=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,s+(0>t?t:n[0]*n[1]),1));return 0>t&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,s,n=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,r=null,h=this._get(e,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),o=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||t.getTime()>=n.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!r||r>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,s){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var n=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(s,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),n,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.11.4",e.datepicker,e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0) },_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY<n.scrollSensitivity?o.scrollTop=a=o.scrollTop+n.scrollSpeed:t.pageY-s.overflowOffset.top<n.scrollSensitivity&&(o.scrollTop=a=o.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+o.offsetWidth-t.pageX<n.scrollSensitivity?o.scrollLeft=a=o.scrollLeft+n.scrollSpeed:t.pageX-s.overflowOffset.left<n.scrollSensitivity&&(o.scrollLeft=a=o.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(r).scrollTop()<n.scrollSensitivity?a=e(r).scrollTop(e(r).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(r).scrollTop())<n.scrollSensitivity&&(a=e(r).scrollTop(e(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(r).scrollLeft()<n.scrollSensitivity?a=e(r).scrollLeft(e(r).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(r).scrollLeft())<n.scrollSensitivity&&(a=e(r).scrollLeft(e(r).scrollLeft()+n.scrollSpeed)))),a!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(s,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,s){var n=s.options;s.snapElements=[],e(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var t=e(this),i=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,s){var n,a,o,r,h,l,u,d,c,p,f=s.options,m=f.snapTolerance,g=i.offset.left,v=g+s.helperProportions.width,y=i.offset.top,b=y+s.helperProportions.height;for(c=s.snapElements.length-1;c>=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return t[s]>0?!0:(t[s]=1,n=t[s]>0,t[s]=0,n)},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var i,s,n,a=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),a.containment&&(i+=e(a.containment).scrollLeft()||0,s+=e(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===n?this.axis+"-resize":n),o.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,s,n=this.originalMousePosition,a=this.axis,o=t.pageX-n.left||0,r=t.pageY-n.top||0,h=this._change[a];return this._updatePrevProperties(),h?(i=h.apply(this,[t,o,r]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,s,n,a,o=this.options;a={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=a.minHeight*this.aspectRatio,s=a.minWidth/this.aspectRatio,i=a.maxHeight*this.aspectRatio,n=a.maxWidth/this.aspectRatio,t>a.minWidth&&(a.minWidth=t),s>a.minHeight&&(a.minHeight=s),a.maxWidth>i&&(a.maxWidth=i),a.maxHeight>n&&(a.maxHeight=n)),this._vBoundaries=a},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,s=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===s&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===s&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,s=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,n=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,a=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,l=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return a&&(e.width=t.minWidth),o&&(e.height=t.minHeight),s&&(e.width=t.maxWidth),n&&(e.height=t.maxHeight),a&&l&&(e.left=r-t.minWidth),s&&l&&(e.left=r-t.maxWidth),o&&u&&(e.top=h-t.minHeight),n&&u&&(e.top=h-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],s=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],n=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)i[t]=parseInt(s[t],10)||0,i[t]+=parseInt(n[t],10)||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,s,n,a,o,r,h=e(this).resizable("instance"),l=h.options,u=h.element,d=l.containment,c=d instanceof e?d.get(0):/parent/.test(d)?u.parent().get(0):d;c&&(h.containerElement=e(c),/document/.test(d)||d===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,s){i[e]=h._num(t.css("padding"+s))}),h.containerOffset=t.offset(),h.containerPosition=t.position(),h.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,a=h.containerSize.width,o=h._hasScroll(c,"left")?c.scrollWidth:a,r=h._hasScroll(c)?c.scrollHeight:n,h.parentData={element:c,left:s.left,top:s.top,width:o,height:r}))},resize:function(t){var i,s,n,a,o=e(this).resizable("instance"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},c=o.containerElement,p=!0;c[0]!==document&&/static/.test(c.css("position"))&&(d=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?h.top:0),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),i=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-d.left:o.offset.left-h.left)),s=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-d.top:o.offset.top-h.top)),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),i=t.options;e(i.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})},resize:function(t,i){var s=e(this).resizable("instance"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0};e(n.alsoResize).each(function(){var t=e(this),s=e(this).data("ui-resizable-alsoresize"),n={},a=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(a,function(e,t){var i=(s[t]||0)+(r[t]||0);i&&i>=0&&(n[t]=i||null)}),t.css(n)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),s=i.options,n=i.size,a=i.originalSize,o=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,u=h[1]||1,d=Math.round((n.width-a.width)/l)*l,c=Math.round((n.height-a.height)/u)*u,p=a.width+d,f=a.height+c,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,v=s.minWidth&&s.minWidth>p,y=s.minHeight&&s.minHeight>f;s.grid=h,v&&(p+=l),y&&(f+=u),m&&(p-=l),g&&(f-=u),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=o.top-c):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=o.left-d):((0>=f-u||0>=p-l)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=o.top-c):(f=u-t.height,i.size.height=f,i.position.top=o.top+a.height-f),p-l>0?(i.size.width=p,i.position.left=o.left-d):(p=l-t.width,i.size.width=p,i.position.left=o.left+a.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;0>i&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",t)!==!1){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&e(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",t)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),a=Math.max.apply(null,n);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),s=!0),s&&!i&&this._trigger("focus",t),s},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement,i=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);i||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0; if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");t.target!==n[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==s[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){n.focus()}),t.preventDefault()):(this._delay(function(){s.focus()}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),void 0):(e.each(i,function(i,s){var n,a;s=e.isFunction(s)?{click:s,text:i}:s,s=e.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(t.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,e("<button></button>",s).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,t(n))},drag:function(e,s){i._trigger("drag",e,t(s))},stop:function(n,a){var o=a.offset.left-i.document.scrollLeft(),r=a.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(r>=0?"+":"")+r,of:i.window},e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,t(n))},resize:function(e,s){i._trigger("resize",e,t(s))},stop:function(n,a){var o=i.uiDialog.offset(),r=o.left-i.document.scrollLeft(),h=o.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,t(a))}}).css("position",a)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(s=!0),e in i.resizableRelatedOptions&&(n[e]=t)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,t){var i,s,n=this.uiDialog;"dialogClass"===e&&n.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=n.is(":data(ui-draggable)"),i&&!t&&n.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=n.is(":data(ui-resizable)"),s&&!t&&n.resizable("destroy"),s&&"string"==typeof t&&n.resizable("option","handles",t),s||t===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),e=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),t=Math.max(0,s.minHeight-e),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-e):"none","auto"===s.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}}),e.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(s)?s:function(e){return e.is(s)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var s=e.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(){function e(e,t,i){return e>=t&&t+i>e}return function(t,i,s,n){if(!i.offset)return!1;var a=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=a+t.helperProportions.width,h=o+t.helperProportions.height,l=i.offset.left,u=i.offset.top,d=l+i.proportions().width,c=u+i.proportions().height;switch(s){case"fit":return a>=l&&d>=r&&o>=u&&c>=h;case"intersect":return a+t.helperProportions.width/2>l&&d>r-t.helperProportions.width/2&&o+t.helperProportions.height/2>u&&c>h-t.helperProportions.height/2;case"pointer":return e(n.pageY,u,i.proportions().height)&&e(n.pageX,l,i.proportions().width);case"touch":return(o>=u&&c>=o||h>=u&&c>=h||u>o&&h>c)&&(a>=l&&d>=a||r>=l&&d>=r||l>a&&r>d);default:return!1}}}(),e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions().height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions({width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight}))}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance,i),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===n}),a.length&&(s=e(a[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},e.ui.droppable;var y="ui-effects-",b=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var s=d[t.type]||{};return null==e?i||!t.def?null:t.def:(e=s.floor?~~e:parseFloat(e),isNaN(e)?t.def:s.mod?(e+s.mod)%s.mod:0>e?0:e>s.max?s.max:e)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(e,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[u[l].cache]=o[u[l].cache],n=s._rgba=o._rgba,!1):t}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),s):a[i]}function n(e,t,i){return i=(i+1)%1,1>6*i?e+6*(t-e)*i:1>2*i?t:2>3*i?e+6*(t-e)*(2/3-i):e}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,s,n){return new e.Color.fn.parse(t,i,s,n)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},d={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},p=e("<p>")[0],f=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(n,o,r,h){if(n===t)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=e(n).css(o),o=t);var d=this,c=e.type(n),p=this._rgba=[];return o!==t&&(n=[n,o,r,h],c="array"),"string"===c?this.parse(s(n)||a._default):"array"===c?(f(u.rgba.props,function(e,t){p[t.idx]=i(n[t.idx],t)}),this):"object"===c?(n instanceof l?f(u,function(e,t){n[t.cache]&&(d[t.cache]=n[t.cache].slice())}):f(u,function(t,s){var a=s.cache;f(s.props,function(e,t){if(!d[a]&&s.to){if("alpha"===e||null==n[e])return;d[a]=s.to(d._rgba)}d[a][t.idx]=i(n[e],t,!0)}),d[a]&&0>e.inArray(null,d[a].slice(0,3))&&(d[a][3]=1,s.from&&(d._rgba=s.from(d[a])))}),this):t},is:function(e){var i=l(e),s=!0,n=this;return f(u,function(e,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(e,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:t})),s}),s},_space:function(){var e=[],t=this;return f(u,function(i,s){t[s.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var s=l(e),n=s._space(),a=u[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(e,n){var a=n.idx,o=r[a],l=s[a],u=d[n.type]||{};null!==l&&(null===o?h[a]=l:(u.mod&&(l-o>u.mod/2?o+=u.mod:o-l>u.mod/2&&(o-=u.mod)),h[a]=i((l-o)*t+o,n)))}),this[n](h)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(t)._rgba;return l(e.map(i,function(e,t){return(1-s)*n[t]+s*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),s=i.pop();return t&&i.push(~~(255*s)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,u.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,s=e[0]/255,n=e[1]/255,a=e[2]/255,o=e[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,u=r+h,d=.5*u;return t=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=d?l/u:l/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},u.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],s=e[2],a=e[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,t+1/3)),Math.round(255*n(r,o,t)),Math.round(255*n(r,o,t-1/3)),a]},f(u,function(s,n){var a=n.props,o=n.cache,h=n.to,u=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===t)return this[o].slice();var n,r=e.type(s),d="array"===r||"object"===r?s:arguments,c=this[o].slice();return f(a,function(e,t){var s=d["object"===r?e:t.idx];null==s&&(s=c[t.idx]),c[t.idx]=i(s,t)}),u?(n=l(u(c)),n[o]=c,n):l(c)},f(a,function(t,i){l.fn[t]||(l.fn[t]=function(n){var a,o=e.type(n),h="alpha"===t?this._hsla?"hsla":"rgba":s,l=this[h](),u=l[i.idx];return"undefined"===o?u:("function"===o&&(n=n.call(this,u),o=e.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=u+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(t){var i=t.split(" ");f(i,function(t,i){e.cssHooks[i]={set:function(t,n){var a,o,r="";if("transparent"!==n&&("string"!==e.type(n)||(a=s(n)))){if(n=l(a||n),!c.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===r||"transparent"===r)&&o&&o.style;)try{r=e.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{t.style[i]=n}catch(h){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return f(["Top","Right","Bottom","Left"],function(i,s){t["border"+s+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(b),function(){function t(t){var i,s,n=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[e.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function i(t,i){var s,a,o={};for(s in i)a=i[s],t[s]!==a&&(n[s]||(e.fx.step[s]||!isNaN(parseFloat(a)))&&(o[s]=a));return o}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(b.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(n,a,o,r){var h=e.speed(a,o,r);return this.queue(function(){var a,o=e(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var i=e(this);return{el:i,start:t(this)}}),a=function(){e.each(s,function(e,t){n[t]&&o[t+"Class"](n[t])})},a(),l=l.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var t=this,i=e.Deferred(),s=e.extend({},h,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,s),i.promise()}),e.when.apply(e,l.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),h.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,s,n,a){return s?e.effects.animateClass.call(this,{add:i},s,n,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,s,n,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},s,n,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,s,n,a,o){return"boolean"==typeof s||void 0===s?n?e.effects.animateClass.call(this,s?{add:i}:{remove:i},n,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},s,n,a)}}(e.fn.toggleClass),switchClass:function(t,i,s,n,a){return e.effects.animateClass.call(this,{add:i,remove:t},s,n,a)}})}(),function(){function t(t,i,s,n){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(n=s,s=i,i={}),e.isFunction(s)&&(n=s,s=null),i&&e.extend(t,i),s=s||i.duration,t.duration=e.fx.off?0:"number"==typeof s?s:s in e.fx.speeds?e.fx.speeds[s]:e.fx.speeds._default,t.complete=n||i.complete,t}function i(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}e.extend(e.effects,{version:"1.11.4",save:function(e,t){for(var i=0;t.length>i;i++)null!==t[i]&&e.data(y+t[i],e[0].style[t[i]])},restore:function(e,t){var i,s;for(s=0;t.length>s;s++)null!==t[s]&&(i=e.data(y+t[s]),void 0===i&&(i=""),e.css(t[s],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,s;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=e[1]/t.width}return{x:s,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},s=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return t.wrap(s),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),s=t.parent(),"static"===t.css("position")?(s.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,s){i[s]=t.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(n),s.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,s,n){return n=n||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(n[0]),e.isFunction(t)&&t()}var n=e(this),a=s.complete,r=s.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),i()):o.call(n[0],s,i)}var s=t.apply(this,arguments),n=s.mode,a=s.queue,o=e.effects.effect[s.effect];return e.fx.off||!o?n?this[n](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):a===!1?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(e.fn.show),hide:function(e){return function(s){if(i(s))return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(e.fn.hide),toggle:function(e){return function(s){if(i(s)||"boolean"==typeof s)return e.apply(this,arguments);var n=t.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),s=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(s=[parseFloat(i),t])}),s}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;((t=Math.pow(2,--i))-1)/11>e;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?i(2*e)/2:1-i(-2*e+2)/2}})}(),e.effects,e.effects.effect.blind=function(t,i){var s,n,a,o=e(this),r=/up|down|vertical/,h=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(o,t.mode||"hide"),d=t.direction||"up",c=r.test(d),p=c?"height":"width",f=c?"top":"left",m=h.test(d),g={},v="show"===u;o.parent().is(".ui-effects-wrapper")?e.effects.save(o.parent(),l):e.effects.save(o,l),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n=s[p](),a=parseFloat(s.css(f))||0,g[p]=v?n:0,m||(o.css(c?"bottom":"right",0).css(c?"top":"left","auto").css({position:"absolute"}),g[f]=v?a:n+a),v&&(s.css(p,0),m||s.css(f,a+n)),s.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&o.hide(),e.effects.restore(o,l),e.effects.removeWrapper(o),i()}})},e.effects.effect.bounce=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"effect"),l="hide"===h,u="show"===h,d=t.direction||"up",c=t.distance,p=t.times||5,f=2*p+(u||l?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,b=o.queue(),_=b.length;for((u||l)&&r.push("opacity"),e.effects.save(o,r),o.show(),e.effects.createWrapper(o),c||(c=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-c:2*c).animate(a,m,g)),l&&(c/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g).animate(a,m,g),c=l?2*c:c/2;l&&(n={opacity:0},n[v]=(y?"-=":"+=")+c,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}),_>1&&b.splice.apply(b,[1,0].concat(b.splice(_,f+1))),o.dequeue()},e.effects.effect.clip=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","height","width"],h=e.effects.setMode(o,t.mode||"hide"),l="show"===h,u=t.direction||"vertical",d="vertical"===u,c=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,r),o.show(),s=e.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[c](),l&&(n.css(c,0),n.css(p,a/2)),f[c]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){l||o.hide(),e.effects.restore(o,r),e.effects.removeWrapper(o),i()}})},e.effects.effect.drop=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(n,t.mode||"hide"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h?"pos":"neg",d={opacity:r?1:0};e.effects.save(n,a),n.show(),e.effects.createWrapper(n),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===u?-s:s),d[l]=(r?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.explode=function(t,i){function s(){b.push(this),b.length===d*c&&n()}function n(){p.css({visibility:"visible"}),e(b).remove(),m||p.hide(),i()}var a,o,r,h,l,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/c),y=Math.ceil(p.outerHeight()/d),b=[];for(a=0;d>a;a++)for(h=g.top+a*y,u=a-(d-1)/2,o=0;c>o;o++)r=g.left+o*v,l=o-(c-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:r+(m?l*v:0),top:h+(m?u*y:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,s)},e.effects.effect.fade=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:t.duration,easing:t.easing,complete:i})},e.effects.effect.fold=function(t,i){var s,n,a=e(this),o=["position","top","bottom","left","right","height","width"],r=e.effects.setMode(a,t.mode||"hide"),h="show"===r,l="hide"===r,u=t.size||15,d=/([0-9]+)%/.exec(u),c=!!t.horizFirst,p=h!==c,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),s=e.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],d&&(u=parseInt(d[1],10)/100*n[l?0:1]),h&&s.css(c?{height:0,width:u}:{height:u,width:0}),g[f[0]]=h?n[0]:u,v[f[1]]=h?n[1]:0,s.animate(g,m,t.easing).animate(v,m,t.easing,function(){l&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})},e.effects.effect.highlight=function(t,i){var s=e(this),n=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(s,t.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&s.hide(),e.effects.restore(s,n),i()}})},e.effects.effect.size=function(t,i){var s,n,a,o=e(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],c=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||b,o.to=t.from||s):(o.from=t.from||("show"===p?b:s),o.to=t.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,a.from.x,o.from),o.to=e.effects.setTransition(o,c,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(y=y.concat(u).concat(l),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=e.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(d=d.concat(["marginTop","marginBottom"]).concat(u),c=c.concat(["marginLeft","marginRight"]),l=r.concat(d).concat(c),o.find("*[width]").each(function(){var i=e(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()}; f&&e.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,c,a.from.x,i.from),i.to=e.effects.setTransition(i,c,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var s=parseInt(i,10),n=e?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),e.effects.removeWrapper(o),i()}})},e.effects.effect.scale=function(t,i){var s=e(this),n=e.extend(!0,{},t),a=e.effects.setMode(s,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),r=t.direction||"both",h=t.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},u={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*u.y,width:l.width*u.x,outerHeight:l.outerHeight*u.y,outerWidth:l.outerWidth*u.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},e.effects.effect.puff=function(t,i){var s=e(this),n=e.effects.setMode(s,t.mode||"hide"),a="hide"===n,o=parseInt(t.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(t)},e.effects.effect.pulsate=function(t,i){var s,n=e(this),a=e.effects.setMode(n,t.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(t.times||5)+(h?1:0),u=t.duration/l,d=0,c=n.queue(),p=c.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),d=1),s=1;l>s;s++)n.animate({opacity:d},u,t.easing),d=1-d;n.animate({opacity:d},u,t.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&c.splice.apply(c,[1,0].concat(c.splice(p,l+1))),n.dequeue()},e.effects.effect.shake=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(n,t.mode||"effect"),r=t.direction||"left",h=t.distance||20,l=t.times||3,u=2*l+1,d=Math.round(t.duration/u),c="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),y=v.length;for(e.effects.save(n,a),n.show(),e.effects.createWrapper(n),f[c]=(p?"-=":"+=")+h,m[c]=(p?"+=":"-=")+2*h,g[c]=(p?"-=":"+=")+2*h,n.animate(f,d,t.easing),s=1;l>s;s++)n.animate(m,d,t.easing).animate(g,d,t.easing);n.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),n.dequeue()},e.effects.effect.slide=function(t,i){var s,n=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(n,t.mode||"show"),r="show"===o,h=t.direction||"left",l="up"===h||"down"===h?"top":"left",u="up"===h||"left"===h,d={};e.effects.save(n,a),n.show(),s=t.distance||n["top"===l?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,u?isNaN(s)?"-"+s:-s:s),d[l]=(r?u?"+=":"-=":u?"-=":"+=")+s,n.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&n.hide(),e.effects.restore(n,a),e.effects.removeWrapper(n),i()}})},e.effects.effect.transfer=function(t,i){var s=e(this),n=e(t.to),a="fixed"===n.css("position"),o=e("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),u={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},d=s.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-r,left:d.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),i()})},e.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var t=this;this.label=e("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),e("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=e("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t.menuItems||t._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var s=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&s.index!==t.focusIndex&&(t._trigger("focus",e,{item:s}),t.isOpen||t._select(s,e)),t.focusIndex=s.index,t.button.attr("aria-activedescendant",t.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(t,i){var s=this,n="";e.each(i,function(i,a){a.optgroup!==n&&(e("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(a.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:a.optgroup}).appendTo(t),n=a.optgroup),s._renderItemData(t,a)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var s=e("<li>");return i.disabled&&s.addClass("ui-state-disabled"),this._setText(s,i.label),s.appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex):(i=this.menuItems.eq(this.element[0].selectedIndex),n+=":not(.ui-state-disabled)"),s="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0),s.length&&this.menuInstance.focus(t,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(t){var i=[];t.each(function(t,s){var n=e(s),a=n.parent("optgroup");i.push({element:n,index:t,value:n.val(),label:n.text(),optgroup:a.attr("label")||"",disabled:a.prop("disabled")||n.prop("disabled")})}),this.items=i},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}}),e.widget("ui.slider",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),t=n.length;i>t;t++)o.push(a);this.handles=n.add(e(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,a,o,r,h,l,u=this,d=this.options;return d.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(s-u.values(t));(n>i||n===i&&(t===u._lastChangedValue||u.values(t)===d.min))&&(n=i,a=e(this),o=t)}),r=this._start(t,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-h.left-a.width()/2,top:t.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,s,n,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/t,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(t?0:1),2===this.options.values.length&&this.options.range===!0&&(0===t&&i>s||1===t&&s>i)&&(i=s),i!==this.values(t)&&(n=this.values(),n[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:n}),s=this.values(t?0:1),a!==!1&&this.values(t,i))):i!==this.value()&&(a=this._trigger("slide",e,{handle:this.handles[t],value:i}),a!==!1&&this.value(i))},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,i){var s,n,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var s,n=0;switch("range"===t&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(n=this.options.values.length),"disabled"===t&&this.element.toggleClass("ui-state-disabled",!!i),this._super(t,i),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,s;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,s=e-i;return 2*Math.abs(i)>=t&&(s+=i>0?t:-t),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step,s=Math.floor(+(e-t).toFixed(this._precision())/i)*i;e=s+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:r.animate}))),t=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(t){var i,s,n,a,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),i=this._start(t,o),i===!1))return}switch(a=this.options.step,s=n=this.options.values&&this.options.values.length?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+a);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-a)}this._slide(t,o,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&t+i>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),e.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,a.widgetName+"-item")===a?(s=e(this),!1):void 0}),e.data(t.target,a.widgetName+"-item")===a&&(s=e(t.target)),s?!this.options.handle||i||(e(this.options.handle,s).find("*").addBack().each(function(){this===t.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",t,this._uiHash(this)); return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!e.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&s.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!s.length&&t.key&&s.push(t.key+"="),s.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),s=[];return t=t||{},i.each(function(){s.push(e(t.item||this).attr(t.attribute||"id")||"")}),s},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=e.left,o=a+e.width,r=e.top,h=r+e.height,l=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||s+l>r&&h>s+l,c="y"===this.options.axis||t+u>a&&o>t+u,p=d&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=t&&i,n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return s?this.floating?a&&"right"===a||"down"===n?2:1:n&&("down"===n?2:1):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&t||"up"===s&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){r.push(this)}var s,n,a,o,r=[],h=[],l=this._connectWith();if(l&&t)for(s=l.length-1;s>=0;s--)for(a=e(l[s],this.document[0]),n=a.length-1;n>=0;n--)o=e.data(a[n],this.widgetFullName),o&&o!==this&&!o.options.disabled&&h.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(h.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;t.length>i;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=e(c[i],this.document[0]),s=n.length-1;s>=0;s--)a=e.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],r=d[i][0],s=0,l=r.length;l>s;s++)h=e(r[s]),h.data(this.widgetName+"-item",o),u.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?e(this.options.toleranceElement,s.item):s.item,t||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,s=t.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=t.currentItem[0].nodeName.toLowerCase(),n=e("<"+s+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===s?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(n)):"tr"===s?t._createTrPlaceholder(t.currentItem,n):"img"===s&&n.attr("src",t.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(e,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(s.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),s.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var s=this;t.children().each(function(){e("<td>&#160;</td>",s.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,s,n,a,o,r,h,l,u,d,c=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,a=null,u=c.floating||this._isFloating(this.currentItem),o=u?"left":"top",r=u?"width":"height",d=u?"clientX":"clientY",s=this.items.length-1;s>=0;s--)e.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[o],l=!1,t[d]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(t[d]-h)&&(n=Math.abs(t[d]-h),a=this.items[s],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;a?this._rearrange(t,a,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(t=e(n.containment)[0],i=e(n.containment).offset(),s="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(t){var i,s,n=this.options,a=t.pageX,o=t.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(e,t,i,s){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(e,t){function i(e,t,i){return function(s){i._trigger(e,s,t._uiHash(t))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)t||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(s=0;n.length>s;s++)n[s].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,s){var n=i.attr(s);void 0!==n&&n.length&&(t[s]=n)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,s=e.ui.keyCode;switch(t.keyCode){case s.UP:return this._repeat(null,1,t),!0;case s.DOWN:return this._repeat(null,-1,t),!0;case s.PAGE_UP:return this._repeat(null,i.page,t),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,s=this.options;return t=null!==s.min?s.min:0,i=e-t,i=Math.round(i/s.step)*s.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==s.max&&e>s.max?s.max:null!==s.min&&s.min>e?s.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,this.element.val(this._format(i)),void 0}("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:h(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&(i=this._parse(e),null!==i&&(t||(i=this._adjustValue(i)),e=this._format(i))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:h(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:h(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:h(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:h(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(h(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,s;t=t.cloneNode(!1),i=t.href.replace(e,""),s=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return t.hash.length>1&&i===s}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===t&&(s&&this.tabs.each(function(i,n){return e(n).attr("aria-controls")===s?(t=i,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=i?!1:0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:s++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:n=!1,s--;break;case e.ui.keyCode.END:s=this.anchors.length-1;break;case e.ui.keyCode.HOME:s=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function s(){return t>n&&(t=0),0>t&&(t=n),t}for(var n=this.tabs.length-1;-1!==e.inArray(s(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):"disabled"===e?(this._setupDisabled(t),void 0):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,s=this.anchors,n=this.panels; this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,s){var n,a,o,r=e(s).uniqueId().attr("id"),h=e(s).closest("li"),l=h.attr("aria-controls");t._isLocal(s)?(n=s.hash,o=n.substring(1),a=t.element.find(t._sanitizeSelector(n))):(o=h.attr("aria-controls")||e({}).uniqueId()[0].id,n="#"+o,a=t.element.find(n),a.length||(a=t._createPanel(o),a.insertAfter(t.panels[i-1]||t.tablist)),a.attr("aria-live","polite")),a.length&&(t.panels=t.panels.add(a)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":o,"aria-labelledby":r}),a.attr("aria-labelledby",r)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,s=0;i=this.tabs[s];s++)t===!0||-1!==e.inArray(s,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,s=this.element.parent();"fill"===t?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),s=t.css("position");"absolute"!==s&&"fixed"!==s&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,s=this.active,n=e(t.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?e():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):e(),u={oldTab:s,oldPanel:l,newTab:r?e():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),l.length||h.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function s(){a.running=!1,a._trigger("activate",t,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,s=this._findActive(t);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var s=this,n=this.tabs.eq(t),a=n.find(".ui-tabs-anchor"),o=this._getPanelForTab(n),r={tab:n,panel:o},h=function(e,t){"abort"===t&&s.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===s.xhr&&delete s.xhr};this._isLocal(a[0])||(this.xhr=e.ajax(this._ajaxSettings(a,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){o.html(e),s._trigger("load",i,r),h(n,t)},1)}).fail(function(e,t){setTimeout(function(){h(e,t)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,a){return n._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},s))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),e.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var s=(t.attr("aria-describedby")||"").split(/\s+/);s.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(s.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),s=(t.attr("aria-describedby")||"").split(/\s+/),n=e.inArray(i,s);-1!==n&&s.splice(n,1),t.removeData("ui-tooltip-id"),s=e.trim(s.join(" ")),s?t.attr("aria-describedby",s):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(t,i){var s=this;return"disabled"===t?(this[i?"_disable":"_enable"](),this.options[t]=i,void 0):(this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){s._updateContent(t.element)}),void 0)},_disable:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur");n.target=n.currentTarget=s.element[0],t.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,s=e(t?t.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&s.parents().each(function(){var t,s=e(this);s.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(t,s),this._updateContent(s,t))},_updateContent:function(e,t){var i,s=this.options.content,n=this,a=t?t.type:null;return"string"==typeof s?this._open(t,e,s):(i=s.call(e[0],function(i){n._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=a),this._open(t,e,i))})}),i&&this._open(t,e,i),void 0)},_open:function(t,i,s){function n(e){l.of=e,o.is(":hidden")||o.position(l)}var a,o,r,h,l=e.extend({},this.options.position);if(s){if(a=this._find(i))return a.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),a=this._tooltip(i),o=a.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),s.clone?(h=s.clone(),h.removeAttr("id").find("[id]").removeAttr("id")):h=s,e("<div>").html(h).appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:n}),n(t)):o.position(e.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){o.is(":visible")&&(n(l.of),clearInterval(r))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,i){var s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var s=e.Event(t);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(s.mouseleave="close"),t&&"focusin"!==t.type||(s.focusout="close"),this._on(!0,i,s)},close:function(t){var i,s=this,n=e(t?t.currentTarget:this.element),a=this._find(n);return a?(i=a.tooltip,a.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),a.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(e(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete s.parents[t]}),a.closing=!0,this._trigger("close",t,{tooltip:i}),a.hiding||(a.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var i=e("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),s=i.uniqueId().attr("id");return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,s){var n=e.Event("blur"),a=s.element;n.target=n.currentTarget=a[0],t.close(n,!0),e("#"+i).remove(),a.data("ui-tooltip-title")&&(a.attr("title")||a.attr("title",a.data("ui-tooltip-title")),a.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})});
var mongoose = require('mongoose') const UserSchema = new mongoose.Schema({ _id:mongoose.Schema.Types.ObjectId, firstName: { type: String, }, lastName: { type: String, }, Email: { type: String, }, Password: { type: String, }, Mobile: { type: String, }, Address: { type: String, }, accessToken: { type: String, }, UsersCreatedDate: { type : Date, default: Date.now } }) const Users = mongoose.model('tbl_users', UserSchema) module.exports = Users;
define({"topics" : [{"title":"Cloudera Manager Installation","shortdesc":"\n <p class=\"shortdesc\"></p>\n ","href":"datacollector\/UserGuide\/Administration\/Administration_title.html#concept_gxn_whv_l2b","attributes": {"data-id":"concept_gxn_whv_l2b",},"menu": {"hasChildren":false,},"tocID":"concept_gxn_whv_l2b-d46e121349","topics":[]},{"title":"Other Installation Types","shortdesc":"\n <p class=\"shortdesc\"></p>\n ","href":"datacollector\/UserGuide\/Administration\/Administration_title.html#concept_csv_kkv_l2b","attributes": {"data-id":"concept_csv_kkv_l2b",},"menu": {"hasChildren":false,},"tocID":"concept_csv_kkv_l2b-d46e121454","topics":[]}]});
module.exports={title:"GOV.UK",slug:"gov-dot-uk",svg:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GOV.UK icon</title><path d="M2.4 13.031c.261-.64-.04-1.374-.682-1.638-.631-.262-1.362.049-1.623.688-.266.637.038 1.363.668 1.623.632.267 1.368-.037 1.623-.673m.858-3.244c.256-.636-.045-1.37-.691-1.639-.631-.258-1.367.053-1.639.687-.27.638.03 1.369.662 1.629.646.266 1.367-.039 1.639-.677m1.218-1.095c.645.264 1.367-.041 1.637-.675.256-.639-.045-1.375-.676-1.639-.632-.26-1.368.049-1.639.686-.271.638.046 1.367.678 1.626m3.156 1.053c.646.256 1.368-.045 1.64-.676.255-.646-.046-1.383-.691-1.639-.634-.271-1.37.046-1.626.676-.27.632.045 1.368.677 1.625M21.6 13.006c.271.631.993.933 1.639.661.632-.27.933-.992.661-1.639-.271-.646-1.008-.947-1.639-.676-.646.256-.945.992-.676 1.639m.752-2.57c.631-.257.931-.993.676-1.64-.271-.632-1.008-.946-1.639-.677-.646.271-.947.992-.676 1.639.256.632.993.933 1.624.678m-2.78-1.729c.631-.26.932-.992.672-1.631-.27-.646-1.001-.947-1.639-.686-.632.271-.937.992-.67 1.639.27.631 1.007.932 1.638.676m-3.412.858c.631-.271.932-1.007.677-1.639-.271-.646-.993-.947-1.64-.691-.631.271-.932 1.008-.661 1.639.271.632.993.932 1.64.662M9.425 4.935l.093 2.399 1.752-.923c.035.039.079.078.12.107-.181.718-.621 1.914-.896 2.575-.335.812.051 1.744.862 2.078.812.331 1.747-.06 2.083-.872.241-.57.121-1.188-.24-1.623-.391-.678-.781-1.533-.992-2.195.061-.045.105-.105.15-.15l1.895.977.09-2.39-1.969.632c-.016-.031-.031-.061-.045-.075l.766-2.181-2.33-.074.707 2.148c-.061.031-.105.076-.15.137l-1.896-.57zm11.896 9.109c.16.883.188 1.284-.015 1.859-.285-.286-.54-.807-.749-1.594l-.872 2.79c.52-.346.915-.565 1.364-.571-.815 1.713-1.819 2.146-2.461 2.021-.787-.158-1.15-.867-1.012-1.466.175-.842 1.052-1.052 1.448-.067.792-1.566-.52-2.078-1.368-1.624 1.313-1.28 1.468-2.426.426-3.836-1.464 1.106-1.49 2.21-.851 3.772-.842-.985-2.18-.466-1.713 1.113.627-.949 1.432-.346 1.298.565-.109.796-1.163 1.413-2.461 1.292-1.864-.165-1.954-1.457-1.983-2.525.451-.074 1.277.361 1.983 1.354l.286-2.962c-.767.782-1.474.946-2.24.962.271-.781 1.459-2.09 1.459-2.09l-3.729-.045s1.188 1.323 1.443 2.119c-.768-.014-1.459-.164-2.225-.961l.255 2.961c.706-.991 1.534-1.412 1.984-1.338-.045 1.053-.15 2.346-2.015 2.511-1.293.105-2.345-.526-2.449-1.323-.121-.901.691-1.503 1.307-.541.481-1.578-.856-2.104-1.699-1.127.662-1.564.647-2.676-.811-3.789-1.053 1.398-.902 2.541.405 3.85-.842-.467-2.165.029-1.383 1.607.405-.992 1.278-.766 1.458.076.12.601-.24 1.308-1.021 1.457-.646.121-1.639-.315-2.451-2.044.451.016.842.241 1.354.587l-.859-2.783c-.209.781-.48 1.295-.766 1.578-.186-.57-.166-.977.014-1.859l-1.803.613c.922 1.264 1.857 3.021 2.59 6.104 2.275-.376 6.157-.603 8.509-.603 2.345.015 6.229.285 8.494.691.767-3.081 1.713-4.825 2.646-6.073l-1.773-.646-.014-.015z"/></svg>',get path(){return this.svg.match(/<path\s+d="([^"]*)/)[1]},source:"https://github.com/alphagov/design-assets/tree/master/Icons",hex:"005EA5",guidelines:void 0,license:void 0};
import { getDb } from '../db/utils'; import { sql } from '../sql-string'; /** * @typedef {'sweet' | 'spicy' | 'sour' | 'salty' | 'bitter'} ProductFlavorName */ /** * @typedef ProductFlavorFilter * @property {ProductFlavorName} flavorName the name of the flavor * @property {1|2|3|4|5} level the flavor level (1-5) * @property {'less-than'|'greater-than'} type the "direction" of the filter * @export */ /** * @typedef ProductCollectionFilter * @property {'needs-reorder'|'discontinued'} inventory * @property {string[]} requiredTags * @property {ProductFlavorFilter[]} flavor * @description Filtering options that may be used to customize * the query for selecting a collection of Products */ /** * @typedef ProductCollectionOptions * @property {Partial<ProductCollectionFilter>} filter filtering options, which can be used to select a subset of Products * @description Options that may be used to customize queries for collections of Products */ /** * Columns to select for the `getAllProducts` query */ const ALL_PRODUCT_COLUMNS = ['*']; /** * Retrieve a collection of all Product records from the database * @param {Partial<ProductCollectionOptions>} opts options that may be used to customize the query * @returns {Promise<Product[]>} the products */ export async function getAllProducts(opts = {}) { /* getAllProducts(); getAllProducts({ filter: {inventory: 'discontinued' } }); getAllProducts({ filter: {inventory: 'needs-reorder' } }); */ const db = await getDb(); let whereClause = ''; if (opts.filter && opts.filter.inventory) { switch (opts.filter.inventory) { case 'discontinued': whereClause = `WHERE discontinued = 1`; break; case 'needs-reorder': whereClause = `WHERE discontinued = 0 AND ((unitsinstock + unitsonorder) < reorderlevel)`; } } return await db.all(sql` SELECT ${ALL_PRODUCT_COLUMNS.join(',')} FROM Product`); } /** * Retrieve a single product record from the database by id * @param {number | string} id Product id * @returns {Promise<Product>} the product */ export async function getProduct(id) { const db = await getDb(); return await db.get( sql` SELECT ${ALL_PRODUCT_COLUMNS.join(',')} FROM Product WHERE id = $1`, id ); } /** * Update the properties of a Product * @param {number | string} id Product id * @param {Partial<Product>} data Product data * @returns {Promise<Product>} the product */ export async function updateProduct(id, data) { throw new Error('Not yet implemented'); } /** * Create a new Product * @param {Pick<Product,| 'productname'| 'supplierid'| 'categoryid' | 'quantityperunit'| 'unitprice'| 'unitsinstock'| 'unitsonorder'| 'reorderlevel'| 'discontinued'>} p Product data * @returns {Promise<{ id: number | string }>} newly created product id */ export async function createProduct(p) { let db = await getDb(); let result = await db.run( sql` INSERT INTO Product (productname, supplierid, categoryid, quantityperunit, unitprice, unitsinstock, unitsonorder, reorderlevel, discontinued) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)`, p.productname, p.supplierid, p.categoryid, p.quantityperunit, p.unitprice, p.unitsinstock, p.unitsonorder, p.reorderlevel, p.discontinued ); if (!result) { throw new Error('No "last inserted id" returned from SQL insertion!'); } return { id: result.lastID }; } /** * Delete a Product from the database * @param {string | number} id Product id * @returns {Promise<void>} */ export async function deleteProduct(id) { const db = await getDb(); await db.run(sql`DELETE FROM Product WHERE id=$1;`, id); } /** * Get a Product's history of pricing changes * @param {string} id Product id * @returns {Promise<ProductPriceInfo[]>} Pricing history info */ export async function getProductPricingHistory(id) { return []; }
import React, {useState, useEffect} from "react"; import requests from "../../requests"; import CommentDialogButton from "./CommentDialog"; import './Post.css' import {utcToLocal} from "../../date" import EditPost from './EditPostDialog'; import { Alert, Avatar, Button, ListItem, ListItemAvatar, ListItemText, ListItemSecondaryAction, ImageListItem, TextField, } from "@mui/material"; import ReactMarkdown from 'react-markdown' import ThumbUp from '@mui/icons-material/ThumbUp' import Send from '@mui/icons-material/Send' import ShareIcon from '@mui/icons-material/Share'; import EditIcon from '@mui/icons-material/Edit'; import DeleteIcon from '@mui/icons-material/Delete'; import { ClassNames } from "@emotion/react"; import { Link } from 'react-router-dom'; import { getAuthHeaderForNode } from "../../util"; // assuming props contains all the post attributes export default function Post(props) { const [message, setMessage] = useState({}); const [commentText, setCommentText] = useState("") const [liked, setLiked] = useState(false) const like = async () => { // send POST request to authors/{authorId}/inbox/ with a like try { const data = { summary: `${props.currentUser.displayName} likes your post.`, type: "Like", author: props.currentUser.id, object: `${props.post.id}` } // prevents sending a like twice when liking your own post if (props.currentUser.id != props.post.author.id){ const url = `${props.post.author.id}/inbox/`; const response = await requests.post(url, data, getAuthHeaderForNode(url), {withCredentials: true}); } // change summary of like, to send like to your own inbox data.summary = `You liked ${props.post.author.displayName}'s post.` sendToSelf(data); setLiked(true) } catch (e) { console.log(e) setMessage({message: "Failed to send like.", severity: "error"}); } } const share = async () => { try { // if post is public, send to followers if (props.isPublic) { // add type to data props.post.type = 'post' sendToFollowers(props.post); // if post is private, make a copy then send to followers } else { const url = props.currentUser.id + "/posts/"; const response = await requests.post(url, { title: props.post.title, author: props.currentUser.id, contentType: props.post.contentType, content: props.post.content, description: props.post.description, visibility: props.post.visibility, unlisted: props.post.unlisted, categories: props.post.categories, viewableBy: '', }, getAuthHeaderForNode(url)); response.data.type = 'post' sendToSelf(response.data) sendToFollowers(response.data); } setMessage({message: "Shared post to followers.", severity: "success"}); } catch(e) { setMessage({message: "Failed to share post.", severity: "error"}); } } const sendToFollowers = async (my_post) => { // Get Followers const response = await requests.get( `${props.currentUser.id}/followers/` ); const followerList = response.data.items; // For each follower: send post to inbox for (let index = 0; index < followerList.length; ++index) { const follower = followerList[index]; const url = `${follower.id}/inbox/`; await requests.post( url, my_post, getAuthHeaderForNode(url), {withCredentials:true}); } }; // send a like or comment notification to your own inbox const sendToSelf = async (my_item) => { const url = `${props.currentUser.id}/inbox/`; const response_self = await requests.post( url, my_item, getAuthHeaderForNode(url), {withCredentials:true}); }; const deletePost = async () => { if (window.confirm("Do you really want to delete this post?")) { // Send DELETE request to authors/{AUTHOR_ID}/posts/{POST_ID} // let authorID = props.post.author.id; let postID = props.post.id; let url = `${postID}/`; const response = await requests.delete(url); window.location.reload(); } } useEffect(() => { setLiked(props.likedByCurrent); }, []) return ( <ListItem class="post"> <ListItemText id="title" primaryTypographyProps={{fontSize: '30px'}} primary={props.post.title} /> <div class="avatar"> <ListItemAvatar> <Avatar alt="" src={`${props.post.author.profileImage}`} /> </ListItemAvatar> <ListItemText id="author" primary={props.post.author.displayName} secondary={utcToLocal(props.post.published)} /> </div> {props.post.contentType == "text/markdown" && <ReactMarkdown> {props.post.content} </ReactMarkdown>} {(props.post.contentType == "text/plain") && <ListItemText primary={props.post.content} />} {(props.post.contentType == "application/base64" || props.post.contentType == "image/png;base64" || props.post.contentType == "image/jpeg;base64") && <ImageListItem children={<img src={props.post.content}></img>} />} {props.post.contentType == "text/markdown" && <ReactMarkdown> {props.post.description} </ReactMarkdown>} {props.post.contentType != "text/markdown" && <ListItemText id="description" primary={props.post.description} />} <hr/> <div id="comment-like-section"> {liked ? (<Button disabled variant="contained"> Liked </Button>) : (<Button id="like-button" variant="contained" color="success" startIcon={<ThumbUp />} onClick={like}> Like </Button>)} <span id="comment-section"> <CommentDialogButton current_author = {props.currentUser.id} post_id = {props.post.id} author_id = {props.post.author}/> </span> <span id="share-section"> <Button variant="contained" startIcon={<ShareIcon />} onClick={share}> Share </Button> </span> <div id="edit-section" hidden={props.post.author.id === props.currentUser.id ? false : true}> <EditPost current_author = {props.currentUser.id} post = {props.post}/> </div> <div id="delete-section" hidden={props.post.author.id === props.currentUser.id ? false : true}> <Button variant="contained" color="error" startIcon={<DeleteIcon/>} onClick={deletePost} > Delete </Button> </div> {message.message && ( <Alert severity={message.severity}> {message.message} </Alert> )} </div> <ListItemText id="post-id" secondary={<p>Post Id: <a href={props.post.id}>{props.post.id}</a></p>} /> </ListItem> ); }
/** * @generated * Copyright 2004-present Facebook. All Rights Reserved. * **/ /** * @flow */ /* eslint-disable */ 'use strict'; /*:: import type { ReaderFragment } from 'relay-runtime'; type EquipmentBreadcrumbs_equipment$ref = any; export type FutureState = "INSTALL" | "REMOVE" | "%future added value"; export type PropertyKind = "bool" | "date" | "datetime_local" | "email" | "enum" | "float" | "gps_location" | "int" | "node" | "range" | "string" | "%future added value"; export type WorkOrderStatus = "BLOCKED" | "CANCELED" | "CLOSED" | "DONE" | "IN_PROGRESS" | "PENDING" | "PLANNED" | "SUBMITTED" | "SUSPENDED" | "%future added value"; import type { FragmentReference } from "relay-runtime"; declare export opaque type PowerSearchLinksResultsTable_links$ref: FragmentReference; declare export opaque type PowerSearchLinksResultsTable_links$fragmentType: PowerSearchLinksResultsTable_links$ref; export type PowerSearchLinksResultsTable_links = $ReadOnlyArray<{| +id: string, +futureState: ?FutureState, +ports: $ReadOnlyArray<?{| +id: string, +definition: {| +id: string, +name: string, +visibleLabel: ?string, +portType: ?{| +linkPropertyTypes: $ReadOnlyArray<?{| +id: string, +name: string, +type: PropertyKind, +nodeType: ?string, +index: ?number, +stringValue: ?string, +intValue: ?number, +booleanValue: ?boolean, +floatValue: ?number, +latitudeValue: ?number, +longitudeValue: ?number, +rangeFromValue: ?number, +rangeToValue: ?number, +isEditable: ?boolean, +isInstanceProperty: ?boolean, +isMandatory: ?boolean, +category: ?string, +isDeleted: ?boolean, |}> |}, |}, +parentEquipment: {| +id: string, +name: string, +futureState: ?FutureState, +equipmentType: {| +id: string, +name: string, +portDefinitions: $ReadOnlyArray<?{| +id: string, +name: string, +visibleLabel: ?string, +bandwidth: ?string, +portType: ?{| +id: string, +name: string, |}, |}>, |}, +$fragmentRefs: EquipmentBreadcrumbs_equipment$ref, |}, |}>, +properties: $ReadOnlyArray<?{| +id: string, +stringValue: ?string, +intValue: ?number, +floatValue: ?number, +booleanValue: ?boolean, +latitudeValue: ?number, +longitudeValue: ?number, +rangeFromValue: ?number, +rangeToValue: ?number, +propertyType: {| +id: string, +name: string, +type: PropertyKind, +nodeType: ?string, +isEditable: ?boolean, +isInstanceProperty: ?boolean, +stringValue: ?string, +intValue: ?number, +floatValue: ?number, +booleanValue: ?boolean, +latitudeValue: ?number, +longitudeValue: ?number, +rangeFromValue: ?number, +rangeToValue: ?number, |}, |}>, +workOrder: ?{| +id: string, +status: WorkOrderStatus, |}, +services: $ReadOnlyArray<?{| +id: string, +name: string, |}>, +$refType: PowerSearchLinksResultsTable_links$ref, |}>; export type PowerSearchLinksResultsTable_links$data = PowerSearchLinksResultsTable_links; export type PowerSearchLinksResultsTable_links$key = $ReadOnlyArray<{ +$data?: PowerSearchLinksResultsTable_links$data, +$fragmentRefs: PowerSearchLinksResultsTable_links$ref, ... }>; */ const node/*: ReaderFragment*/ = (function(){ var v0 = { "alias": null, "args": null, "kind": "ScalarField", "name": "id", "storageKey": null }, v1 = { "alias": null, "args": null, "kind": "ScalarField", "name": "futureState", "storageKey": null }, v2 = { "alias": null, "args": null, "kind": "ScalarField", "name": "name", "storageKey": null }, v3 = { "alias": null, "args": null, "kind": "ScalarField", "name": "visibleLabel", "storageKey": null }, v4 = { "alias": null, "args": null, "kind": "ScalarField", "name": "type", "storageKey": null }, v5 = { "alias": null, "args": null, "kind": "ScalarField", "name": "nodeType", "storageKey": null }, v6 = { "alias": null, "args": null, "kind": "ScalarField", "name": "stringValue", "storageKey": null }, v7 = { "alias": null, "args": null, "kind": "ScalarField", "name": "intValue", "storageKey": null }, v8 = { "alias": null, "args": null, "kind": "ScalarField", "name": "booleanValue", "storageKey": null }, v9 = { "alias": null, "args": null, "kind": "ScalarField", "name": "floatValue", "storageKey": null }, v10 = { "alias": null, "args": null, "kind": "ScalarField", "name": "latitudeValue", "storageKey": null }, v11 = { "alias": null, "args": null, "kind": "ScalarField", "name": "longitudeValue", "storageKey": null }, v12 = { "alias": null, "args": null, "kind": "ScalarField", "name": "rangeFromValue", "storageKey": null }, v13 = { "alias": null, "args": null, "kind": "ScalarField", "name": "rangeToValue", "storageKey": null }, v14 = { "alias": null, "args": null, "kind": "ScalarField", "name": "isEditable", "storageKey": null }, v15 = { "alias": null, "args": null, "kind": "ScalarField", "name": "isInstanceProperty", "storageKey": null }, v16 = [ (v0/*: any*/), (v2/*: any*/) ]; return { "argumentDefinitions": [], "kind": "Fragment", "metadata": { "plural": true }, "name": "PowerSearchLinksResultsTable_links", "selections": [ (v0/*: any*/), (v1/*: any*/), { "alias": null, "args": null, "concreteType": "EquipmentPort", "kind": "LinkedField", "name": "ports", "plural": true, "selections": [ (v0/*: any*/), { "alias": null, "args": null, "concreteType": "EquipmentPortDefinition", "kind": "LinkedField", "name": "definition", "plural": false, "selections": [ (v0/*: any*/), (v2/*: any*/), (v3/*: any*/), { "alias": null, "args": null, "concreteType": "EquipmentPortType", "kind": "LinkedField", "name": "portType", "plural": false, "selections": [ { "alias": null, "args": null, "concreteType": "PropertyType", "kind": "LinkedField", "name": "linkPropertyTypes", "plural": true, "selections": [ (v0/*: any*/), (v2/*: any*/), (v4/*: any*/), (v5/*: any*/), { "alias": null, "args": null, "kind": "ScalarField", "name": "index", "storageKey": null }, (v6/*: any*/), (v7/*: any*/), (v8/*: any*/), (v9/*: any*/), (v10/*: any*/), (v11/*: any*/), (v12/*: any*/), (v13/*: any*/), (v14/*: any*/), (v15/*: any*/), { "alias": null, "args": null, "kind": "ScalarField", "name": "isMandatory", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", "name": "category", "storageKey": null }, { "alias": null, "args": null, "kind": "ScalarField", "name": "isDeleted", "storageKey": null } ], "storageKey": null } ], "storageKey": null } ], "storageKey": null }, { "alias": null, "args": null, "concreteType": "Equipment", "kind": "LinkedField", "name": "parentEquipment", "plural": false, "selections": [ (v0/*: any*/), (v2/*: any*/), (v1/*: any*/), { "alias": null, "args": null, "concreteType": "EquipmentType", "kind": "LinkedField", "name": "equipmentType", "plural": false, "selections": [ (v0/*: any*/), (v2/*: any*/), { "alias": null, "args": null, "concreteType": "EquipmentPortDefinition", "kind": "LinkedField", "name": "portDefinitions", "plural": true, "selections": [ (v0/*: any*/), (v2/*: any*/), (v3/*: any*/), { "alias": null, "args": null, "kind": "ScalarField", "name": "bandwidth", "storageKey": null }, { "alias": null, "args": null, "concreteType": "EquipmentPortType", "kind": "LinkedField", "name": "portType", "plural": false, "selections": (v16/*: any*/), "storageKey": null } ], "storageKey": null } ], "storageKey": null }, { "args": null, "kind": "FragmentSpread", "name": "EquipmentBreadcrumbs_equipment" } ], "storageKey": null } ], "storageKey": null }, { "alias": null, "args": null, "concreteType": "Property", "kind": "LinkedField", "name": "properties", "plural": true, "selections": [ (v0/*: any*/), (v6/*: any*/), (v7/*: any*/), (v9/*: any*/), (v8/*: any*/), (v10/*: any*/), (v11/*: any*/), (v12/*: any*/), (v13/*: any*/), { "alias": null, "args": null, "concreteType": "PropertyType", "kind": "LinkedField", "name": "propertyType", "plural": false, "selections": [ (v0/*: any*/), (v2/*: any*/), (v4/*: any*/), (v5/*: any*/), (v14/*: any*/), (v15/*: any*/), (v6/*: any*/), (v7/*: any*/), (v9/*: any*/), (v8/*: any*/), (v10/*: any*/), (v11/*: any*/), (v12/*: any*/), (v13/*: any*/) ], "storageKey": null } ], "storageKey": null }, { "alias": null, "args": null, "concreteType": "WorkOrder", "kind": "LinkedField", "name": "workOrder", "plural": false, "selections": [ (v0/*: any*/), { "alias": null, "args": null, "kind": "ScalarField", "name": "status", "storageKey": null } ], "storageKey": null }, { "alias": null, "args": null, "concreteType": "Service", "kind": "LinkedField", "name": "services", "plural": true, "selections": (v16/*: any*/), "storageKey": null } ], "type": "Link", "abstractKey": null }; })(); // prettier-ignore (node/*: any*/).hash = 'a8e04e91f3b3dad4b69b5fc1ded6abce'; module.exports = node;
const { User } = require('../models'); // import user model const getAll = async () => { const result = await User.find({}); return result; }; const getOne = async ({ id, email, username }) => { const result = await User.findOne({ $or: [{ _id: id }, { email }, { username }], }); return result; }; const create = async (data) => { const result = await User.create(data); return result; }; const authenticate = async ({ username, email, password }) => { const user = await User.findOne({ $or: [{ username }, { email }], }); if (!user) { return null; } const isValid = await user.isCorrectPassword(password); return isValid ? user.toJSON() : null; }; // save a book to a user's `savedBooks` field by adding it to the set // (to prevent duplicates) const saveBook = async ({ userId, ...book }) => { const updatedUser = await User.findOneAndUpdate( { _id: userId }, { $addToSet: { savedBooks: book } }, { new: true, runValidators: true }, ); return updatedUser; }; // remove a book from `savedBooks` const deleteBook = async ({ userId, bookId }) => { const updatedUser = User.findOneAndUpdate( { _id: userId }, { $pull: { savedBooks: { bookId: bookId } } }, { new: true }, ); return updatedUser; }; module.exports = { getAll, getOne, create, authenticate, saveBook, deleteBook, };
/* External dependencies */ import React, { Fragment } from "react"; import styled from "styled-components"; import PropTypes from "prop-types"; import { __ } from "@wordpress/i18n"; /* Internal dependencies */ import FacebookAuthorName from "./FacebookAuthorName"; const FacebookSiteAndAuthorNamesWrapper = styled.p` color: #606770; flex-shrink: 0; font-size: 12px; line-height: 20px; overflow: hidden; padding: 0; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; margin: 0; position: ${ props => props.mode === "landscape" ? "relative" : "static" }; `; const FacebookSiteAndAuthorNamesSeparator = styled.span` padding-left: 5px; padding-right: 5px; `; const FacebookSiteUrl = styled.span` color: #606770; font-size: 12px; line-height: 11px; text-transform: uppercase; overflow: hidden; `; /** * Renders a FacebookAuthorName component with accompanying elements. * * @param {string} authorName The author's name. * * @returns {React.Element} The rendered element. */ function renderFacebookAuthorName( authorName ) { /* Translators: the context is: SITE | By AUTHOR */ const by = __( "By", "yoast-components" ); return ( <Fragment> <FacebookSiteAndAuthorNamesSeparator>|</FacebookSiteAndAuthorNamesSeparator> { by } &nbsp; <FacebookAuthorName authorName={ authorName } /> </Fragment> ); } /** * Renders a FacebookSiteAndAuthorNames component. * * @param {object} props The props. * * @returns {React.Element} The rendered element. */ const FacebookSiteAndAuthorNames = ( props ) => { const hasAuthorName = props.authorName.length > 0; return ( <Fragment> <FacebookSiteAndAuthorNamesWrapper aria-hidden="true"> <FacebookSiteUrl>{ props.siteUrl }</FacebookSiteUrl> { hasAuthorName && renderFacebookAuthorName( props.authorName ) } </FacebookSiteAndAuthorNamesWrapper> </Fragment> ); }; FacebookSiteAndAuthorNames.propTypes = { siteUrl: PropTypes.string.isRequired, authorName: PropTypes.string, }; FacebookSiteAndAuthorNames.defaultProps = { authorName: "", }; export default FacebookSiteAndAuthorNames;
// Old contents of reducers.js import { SORT_BY_ENGLISH, HIDE_DUPLICATES } from "./actions"; // Small program, and each action operates directly on the same slice of state, so no need to create // seperate reducers and use combineReducers let reducer = (state, action) => { if (action.type === SORT_BY_ENGLISH) { let { words } = state; // Use slice() to create a copy of words and then sort the new array by comparing the english entries using localeCompare() // ToDo: add check for falsey values for english entries - right now we're assuming each entry has a valid string in .english return { words: words.slice().sort((a,b) => a.english.localeCompare(b.english))}; }; if (action.type === HIDE_DUPLICATES) { let { words } = state; // Duplicates are defined as having the .french strings exactly equal // Use .map to map the current array objects to an array of just the french strings // Then use .filter and .indexOf to see if the current object's .french string exists in the array created by .map // This will find the index of the first occurance of that string in the array. If the index is not the same as the index of // the current obj, then the string already exists and false is returned and the entry is not added to the new state. return { words: words.filter((obj, pos, arr) => { return (arr.map(mapObj => mapObj.french).indexOf(obj.french) === pos) })}; }; // return current state by default return state; }; export default reducer; // Here's a function to removeDuplicates based on a certain property // This could be used in the reducer to hide duplicates based on other keys // function removeDuplicates(myArr, prop) { // return myArr.filter((obj, pos, arr) => { // return arr.map(mapObj => mapObj[prop]).indexOf(obj[prop]) === pos; // }); // } // let newWords = removeDuplicates(words, "french"); // console.log(newWords); // NOTE: Don't use an Array.from(new Set(...)) to remove duplicates because putting the .french strings into the set sorts them automatically return words.filter(word => { const textMatch = book.title.toLowerCase().includes(text.toLowerCase()) || book.description.toLowerCase().includes(text.toLowerCase()); const startYearMatch = typeof startYear !== 'number' || startYear <= book.published; const endYearMatch = typeof endYear !== 'number' || book.published <= endYear; if (showDuplicates) { } else { } }).sort((word1, word2) => { if (sortKey === 'english') { return word1.english.localeCompare(word2.english, 'en', {sensitivity: 'variant'}); } else if (sortKey === 'french') { return word1.french.localeCompare(word2.french, 'fr', {sensitivity: 'variant'}); } else { // sortKey === '' return false; } }); // // Every time the state changes, run getVisibleWords // const unsubscribe = store.subscribe(() => { // const state = store.getState(); // // console.log('In subscribe'); // // console.log(state.words); // // console.log(state.filters); // const visibleWords = getVisibleWords(state.words, state.filters); // console.log(visibleWords); // }); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Web Developer Test</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <!-- <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> --> </head> <body> <div class="wrapper"> <div id="content"></div> </div> <script src="js/app.js"></script> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> --> <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> --> <!-- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> --> </body> </html> let path = require("path"); let webpack = require("webpack"); module.exports = { entry: { app: ["./src/entry.jsx"] }, devtool: "inline-source-map", devServer: { contentBase: path.resolve(__dirname, "dist/"), hot: true, inline: true, }, module: { loaders: [ { test: /.jsx?$/, loader: "babel-loader", exclude: /node_modules/, query: { presets: ["es2015", "react"], plugins: ["transform-object-rest-spread", "@babel/plugin-proposal-class-properties"] } } ] }, output: { path: path.resolve(__dirname, "dist/js/"), publicPath: "/js/", filename: "app.js" }, resolve: { alias: {}, extensions: [ "", ".js", ".jsx", ".json" ] }, plugins: [ new webpack.HotModuleReplacementPlugin(), ] }; { "name": "web-developer-test", "version": "1.0.0", "scripts": { "server": "webpack-dev-server" }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.5.5", "babel": "^6.5.2", "babel-cli": "^6.18.0", "babel-core": "^6.26.3", "babel-loader": "^6.2.8", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-es2015": "^6.18.0", "babel-preset-react": "^6.16.0", "eslint": "^3.11.1", "eslint-plugin-react": "^6.7.1", "webpack": "^4.39.2", "webpack-dev-server": "^3.8.0" }, "dependencies": { "react": "^15.4.1", "react-dom": "^15.4.1", "react-redux": "^4.4.6", "redux": "^3.6.0", "redux-logger": "^2.7.4" } }
const uid = require('uid-safe').sync; const config = require('config'); const getLanguage = require('./getLanguage'); const logger = require('./bunyan'); function generateId() { return uid(24); } exports.createSessionId = function createSessionId(req, res) { const id = generateId(); const expires = new Date(Date.now() + config.get('sessionInfo.expiryPeriod')); logger.info('Session ID and Expiry generated'); res.cookie('sessionId', id, { httpOnly: true, secure: config.get('cookieOptions.secure'), sameSite: true, expires, }); res.cookie('exp', expires.toUTCString(), { httpOnly: true, secure: config.get('cookieOptions.secure'), sameSite: true, expires: 0, }); res.locals.exp = expires.toUTCString(); res.locals.lang = getLanguage(req.language); return id; };
import * as React from "react"; import Svg, { Path } from "react-native-svg"; function SvgNpmjsLine(props) { return ( <Svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}> <Path fill="none" d="M0 0h24v24H0z" /> <Path d="M20 3a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1h16zm-1 2H5v14h14V5zm-2 2v10h-2.5V9.5H12V17H7V7h10z" /> </Svg> ); } export default SvgNpmjsLine;
var NISLFuzzingFunc = function() { this.isOpen ? this.close() : this.open(); }; NISLFuzzingFunc();
/* eslint-env mocha */ import should from 'should'; import { openDb, closeDb } from '../../lib/db.js'; import config from '../test-config.js'; import { importGtfs, getDb } from '../../index.js'; describe('getDb():', () => { before(async () => { await openDb(config); await importGtfs(config); }); after(async () => { await closeDb(); }); it('should allow raw db queries: calendar_dates', async () => { const serviceIds = ['CT-16APR-Caltrain-Weekday-01']; const db = getDb(); const results = await db.all( `SELECT * FROM calendar_dates WHERE exception_type = 1 AND service_id NOT IN (${serviceIds .map((serviceId) => `'${serviceId}'`) .join(', ')})` ); should.exists(results); results.should.have.length(4); }); it('should allow raw db queries: trips', async () => { // Find all trips between two stop ids const startStopId = '70261'; const endStopId = '70131'; const db = getDb(); const results = await db.all( 'SELECT * from trips where trips.trip_id IN (SELECT start_stop_times.trip_id FROM stop_times as start_stop_times WHERE stop_id = ? AND start_stop_times.stop_sequence < (SELECT end_stop_times.stop_sequence FROM stop_times as end_stop_times WHERE end_stop_times.stop_sequence > start_stop_times.stop_sequence AND end_stop_times.trip_id = start_stop_times.trip_id AND end_stop_times.stop_id = ? ))', [startStopId, endStopId] ); should.exists(results); results.should.have.length(62); }); });
mergeInto(LibraryManager.library, { // Test asynchronously calling a function on the main thread. report_result__proxy: 'async', report_result__sig: 'viii', report_result: function(param1, param2, param3) { if (ENVIRONMENT_IS_WORKER) { console.error('This function should be getting called on the main thread!'); } console.log('got ' + param1 + ' ' + param2 + ' ' + param3); __ReportResult(param1 + param2 * param3, 0); } });
import React from "react"; import { serializeAPIMessageToPrompts } from "utilities/apiSerializers"; test("serializes API response", () => { const testPrompt = { prompt: "Today, I went on an adventure to a new country", text_0: " that I've never been to. I went to a place called… I met a guy named Carlos. And I'm not", text_1: ". I was given a new car. I was given a new car and…irst car that I drove was a Ford Mustang. I drove", text_2: " and I got to meet a lot of people. I had the chan… was very happy to meet them. I was very happy to", text_3: ". And the adventure was the same as any adventure … different. It was something that I never thought" }; const result = serializeAPIMessageToPrompts({ message: testPrompt }); expect(result.length).toEqual(4); // added a space to make it print prettier expect(result).toEqual([ testPrompt.text_0 + " ", testPrompt.text_1 + " ", testPrompt.text_2 + " ", testPrompt.text_3 + " " ]); });
module.exports = require('./config/' + (process.env.NODE_ENV || 'development'));
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ //----------------------------------------------------------------------------- var BUGNUMBER = 375715; var summary = 'Do not assert: (c2 <= cs->length) && (c1 <= c2)'; var actual = ''; var expect = ''; //----------------------------------------------------------------------------- test(); //----------------------------------------------------------------------------- function test() { enterFunc ('test'); printBugNumber(BUGNUMBER); printStatus (summary); /[_-t]/i.exec(""); reportCompare(expect, actual, summary + '/[_-t]/i.exec("")'); exitFunc ('test'); }
/* * Copyright (c) 2015-present, Vitaly Tomilov * * See the LICENSE file at the top-level directory of this distribution * for licensing information. * * Removal or modification of this copyright notice is prohibited. */ const {InnerState} = require(`../inner-state`); const {assertOptions} = require(`assert-options`); const npm = { os: require(`os`), utils: require(`../utils`), formatting: require(`../formatting`), patterns: require(`../patterns`) }; /** * * @class helpers.Column * @description * * Read-only structure with details for a single column. Used primarily by {@link helpers.ColumnSet ColumnSet}. * * The class parses details into a template, to be used for query generation. * * @param {string|helpers.ColumnConfig} col * Column details, depending on the type. * * When it is a string, it is expected to contain a name for both the column and the source property, assuming that the two are the same. * The name must adhere to JavaScript syntax for variable names. The name can be appended with any format modifier as supported by * {@link formatting.format as.format} (`^`, `~`, `#`, `:csv`, `:list`, `:json`, `:alias`, `:name`, `:raw`, `:value`), which is then removed from the name and put * into property `mod`. If the name starts with `?`, it is removed, while setting flag `cnd` = `true`. * * If the string doesn't adhere to the above requirements, the method will throw {@link external:TypeError TypeError} = `Invalid column syntax`. * * When `col` is a simple {@link helpers.ColumnConfig ColumnConfig}-like object, it is used as an input configurator to set all the properties * of the class. * * @property {string} name * Destination column name + source property name (if `prop` is skipped). The name must adhere to JavaScript syntax for variables, * unless `prop` is specified, in which case `name` represents only the column name, and therefore can be any non-empty string. * * @property {string} [prop] * Source property name, if different from the column's name. It must adhere to JavaScript syntax for variables. * * It is ignored when it is the same as `name`. * * @property {string} [mod] * Formatting modifier, as supported by method {@link formatting.format as.format}: `^`, `~`, `#`, `:csv`, `:list`, `:json`, `:alias`, `:name`, `:raw`, `:value`. * * @property {string} [cast] * Server-side type casting, without `::` in front. * * @property {boolean} [cnd] * Conditional column flag. * * Used by methods {@link helpers.update update} and {@link helpers.sets sets}, ignored by methods {@link helpers.insert insert} and * {@link helpers.values values}. It indicates that the column is reserved for a `WHERE` condition, not to be set or updated. * * It can be set from a string initialization, by adding `?` in front of the name. * * @property {*} [def] * Default value for the property, to be used only when the source object doesn't have the property. * It is ignored when property `init` is set. * * @property {helpers.initCB} [init] * Override callback for the value. * * @property {helpers.skipCB} [skip] * An override for skipping columns dynamically. * * Used by methods {@link helpers.update update} (for a single object) and {@link helpers.sets sets}, ignored by methods * {@link helpers.insert insert} and {@link helpers.values values}. * * It is also ignored when conditional flag `cnd` is set. * * @returns {helpers.Column} * * @see * {@link helpers.ColumnConfig ColumnConfig}, * {@link helpers.Column#castText castText}, * {@link helpers.Column#escapedName escapedName}, * {@link helpers.Column#variable variable} * * @example * * const pgp = require('pg-promise')({ * capSQL: true // if you want all generated SQL capitalized * }); * * const Column = pgp.helpers.Column; * * // creating a column from just a name: * const col1 = new Column('colName'); * console.log(col1); * //=> * // Column { * // name: "colName" * // } * * // creating a column from a name + modifier: * const col2 = new Column('colName:csv'); * console.log(col2); * //=> * // Column { * // name: "colName" * // mod: ":csv" * // } * * // creating a column from a configurator: * const col3 = new Column({ * name: 'colName', // required * prop: 'propName', // optional * mod: '^', // optional * def: 123 // optional * }); * console.log(col3); * //=> * // Column { * // name: "colName" * // prop: "propName" * // mod: "^" * // def: 123 * // } * */ class Column extends InnerState { constructor(col) { super(); if (typeof col === `string`) { const info = parseColumn(col); this.name = info.name; if (`mod` in info) { this.mod = info.mod; } if (`cnd` in info) { this.cnd = info.cnd; } } else { col = assertOptions(col, [`name`, `prop`, `mod`, `cast`, `cnd`, `def`, `init`, `skip`]); if (`name` in col) { if (!npm.utils.isText(col.name)) { throw new TypeError(`Invalid 'name' value: ${npm.utils.toJson(col.name)}. A non-empty string was expected.`); } if (npm.utils.isNull(col.prop) && !isValidVariable(col.name)) { throw new TypeError(`Invalid 'name' syntax: ${npm.utils.toJson(col.name)}.`); } this.name = col.name; // column name + property name (if 'prop' isn't specified) if (!npm.utils.isNull(col.prop)) { if (!npm.utils.isText(col.prop)) { throw new TypeError(`Invalid 'prop' value: ${npm.utils.toJson(col.prop)}. A non-empty string was expected.`); } if (!isValidVariable(col.prop)) { throw new TypeError(`Invalid 'prop' syntax: ${npm.utils.toJson(col.prop)}.`); } if (col.prop !== col.name) { // optional property name, if different from the column's name; this.prop = col.prop; } } if (!npm.utils.isNull(col.mod)) { if (typeof col.mod !== `string` || !isValidMod(col.mod)) { throw new TypeError(`Invalid 'mod' value: ${npm.utils.toJson(col.mod)}.`); } this.mod = col.mod; // optional format modifier; } if (!npm.utils.isNull(col.cast)) { this.cast = parseCast(col.cast); // optional SQL type casting } if (`cnd` in col) { this.cnd = !!col.cnd; } if (`def` in col) { this.def = col.def; // optional default } if (typeof col.init === `function`) { this.init = col.init; // optional value override (overrides 'def' also) } if (typeof col.skip === `function`) { this.skip = col.skip; } } else { throw new TypeError(`Invalid column details.`); } } const variable = `\${` + (this.prop || this.name) + (this.mod || ``) + `}`; const castText = this.cast ? (`::` + this.cast) : ``; const escapedName = npm.formatting.as.name(this.name); this.extendState({variable, castText, escapedName}); Object.freeze(this); } /** * @name helpers.Column#variable * @type string * @readonly * @description * Full-syntax formatting variable, ready for direct use in query templates. * * @example * * const cs = new pgp.helpers.ColumnSet([ * 'id', * 'coordinate:json', * { * name: 'places', * mod: ':csv', * cast: 'int[]' * } * ]); * * // cs.columns[0].variable = ${id} * // cs.columns[1].variable = ${coordinate:json} * // cs.columns[2].variable = ${places:csv}::int[] */ get variable() { return this._inner.variable; } /** * @name helpers.Column#castText * @type string * @readonly * @description * Full-syntax sql type casting, if there is any, or else an empty string. */ get castText() { return this._inner.castText; } /** * @name helpers.Column#escapedName * @type string * @readonly * @description * Escaped name of the column, ready to be injected into queries directly. * */ get escapedName() { return this._inner.escapedName; } } function parseCast(name) { if (typeof name === `string`) { const s = name.replace(/^[:\s]*|\s*$/g, ``); if (s) { return s; } } throw new TypeError(`Invalid 'cast' value: ${npm.utils.toJson(name)}.`); } function parseColumn(name) { const m = name.match(npm.patterns.validColumn); if (m && m[0] === name) { const res = {}; if (name[0] === `?`) { res.cnd = true; name = name.substr(1); } const mod = name.match(npm.patterns.hasValidModifier); if (mod) { res.name = name.substr(0, mod.index); res.mod = mod[0]; } else { res.name = name; } return res; } throw new TypeError(`Invalid column syntax: ${npm.utils.toJson(name)}.`); } function isValidMod(mod) { return npm.patterns.validModifiers.indexOf(mod) !== -1; } function isValidVariable(name) { const m = name.match(npm.patterns.validVariable); return !!m && m[0] === name; } /** * @method helpers.Column#toString * @description * Creates a well-formatted multi-line string that represents the object. * * It is called automatically when writing the object into the console. * * @param {number} [level=0] * Nested output level, to provide visual offset. * * @returns {string} */ Column.prototype.toString = function (level) { level = level > 0 ? parseInt(level) : 0; const gap0 = npm.utils.messageGap(level), gap1 = npm.utils.messageGap(level + 1), lines = [ gap0 + `Column {`, gap1 + `name: ` + npm.utils.toJson(this.name) ]; if (`prop` in this) { lines.push(gap1 + `prop: ` + npm.utils.toJson(this.prop)); } if (`mod` in this) { lines.push(gap1 + `mod: ` + npm.utils.toJson(this.mod)); } if (`cast` in this) { lines.push(gap1 + `cast: ` + npm.utils.toJson(this.cast)); } if (`cnd` in this) { lines.push(gap1 + `cnd: ` + npm.utils.toJson(this.cnd)); } if (`def` in this) { lines.push(gap1 + `def: ` + npm.utils.toJson(this.def)); } if (`init` in this) { lines.push(gap1 + `init: [Function]`); } if (`skip` in this) { lines.push(gap1 + `skip: [Function]`); } lines.push(gap0 + `}`); return lines.join(npm.os.EOL); }; npm.utils.addInspection(Column, function () { return this.toString(); }); /** * @typedef helpers.ColumnConfig * @description * A simple structure with column details, to be passed into the {@link helpers.Column Column} constructor for initialization. * * @property {string} name * Destination column name + source property name (if `prop` is skipped). The name must adhere to JavaScript syntax for variables, * unless `prop` is specified, in which case `name` represents only the column name, and therefore can be any non-empty string. * * @property {string} [prop] * Source property name, if different from the column's name. It must adhere to JavaScript syntax for variables. * * It is ignored when it is the same as `name`. * * @property {string} [mod] * Formatting modifier, as supported by method {@link formatting.format as.format}: `^`, `~`, `#`, `:csv`, `:list`, `:json`, `:alias`, `:name`, `:raw`, `:value`. * * @property {string} [cast] * Server-side type casting. Leading `::` is allowed, but not needed (automatically removed when specified). * * @property {boolean} [cnd] * Conditional column flag. * * Used by methods {@link helpers.update update} and {@link helpers.sets sets}, ignored by methods {@link helpers.insert insert} and * {@link helpers.values values}. It indicates that the column is reserved for a `WHERE` condition, not to be set or updated. * * It can be set from a string initialization, by adding `?` in front of the name. * * @property {*} [def] * Default value for the property, to be used only when the source object doesn't have the property. * It is ignored when property `init` is set. * * @property {helpers.initCB} [init] * Override callback for the value. * * @property {helpers.skipCB} [skip] * An override for skipping columns dynamically. * * Used by methods {@link helpers.update update} (for a single object) and {@link helpers.sets sets}, ignored by methods * {@link helpers.insert insert} and {@link helpers.values values}. * * It is also ignored when conditional flag `cnd` is set. * */ /** * @callback helpers.initCB * @description * A callback function type used by parameter `init` within {@link helpers.ColumnConfig ColumnConfig}. * * It works as an override for the corresponding property value in the `source` object. * * The function is called with `this` set to the `source` object. * * @param {*} col * Column-to-property descriptor. * * @param {object} col.source * The source object, equals to `this` that's passed into the function. * * @param {string} col.name * Resolved name of the property within the `source` object, i.e. the value of `name` when `prop` is not used * for the column, or the value of `prop` when it is specified. * * @param {*} col.value * * Property value, set to one of the following: * * - Value of the property within the `source` object (`value` = `source[name]`), if the property exists * - If the property doesn't exist and `def` is set in the column, then `value` is set to the value of `def` * - If the property doesn't exist and `def` is not set in the column, then `value` is set to `undefined` * * @param {boolean} col.exists * Indicates whether the property exists in the `source` object (`exists = name in source`). * * @returns {*} * The new value to be used for the corresponding column. */ /** * @callback helpers.skipCB * @description * A callback function type used by parameter `skip` within {@link helpers.ColumnConfig ColumnConfig}. * * It is to dynamically determine when the property with specified `name` in the `source` object is to be skipped. * * The function is called with `this` set to the `source` object. * * @param {*} col * Column-to-property descriptor. * * @param {object} col.source * The source object, equals to `this` that's passed into the function. * * @param {string} col.name * Resolved name of the property within the `source` object, i.e. the value of `name` when `prop` is not used * for the column, or the value of `prop` when it is specified. * * @param {*} col.value * * Property value, set to one of the following: * * - Value of the property within the `source` object (`value` = `source[name]`), if the property exists * - If the property doesn't exist and `def` is set in the column, then `value` is set to the value of `def` * - If the property doesn't exist and `def` is not set in the column, then `value` is set to `undefined` * * @param {boolean} col.exists * Indicates whether the property exists in the `source` object (`exists = name in source`). * * @returns {boolean} * A truthy value that indicates whether the column is to be skipped. * */ module.exports = {Column};
/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'language', 'zh', { button: '設定語言', remove: '移除語言' } );
/** * Created by jjimenez on 1/26/15. */ var config = { ctx: null, canvasWidth: 200, canvasHeight: 200, circleX: 100, circleY: 100, circleRadius: 90, transparency: 0.75, pulseCount: 0, arcCount: 0, baseColor: "white", timerColors: [ "blue", "yellow", "green", "purple"], pulseColor: "#ffefdb", randomColor: function () { return '#' + Math.floor(Math.random() * 16777215).toString(16); }, drawCircle: function (ctx, centerX, centerY, radius, fillStyle) { var saveStyle = ctx.fillStyle; ctx.fillStyle = fillStyle; ctx.beginPath(); ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); ctx.fill(); ctx.fillStyle = saveStyle; }, alternateCircle: function (ctx,colors, idx) { config.drawCircle(ctx, config.circleX, config.circleY, config.circleRadius, colors[idx]); }, drawArc: function (ctx) { var saveStyle = ctx.fillStyle; var quarter = Math.floor(config.arcCount / 10); var startAngle = 20 * Math.PI / 40 * quarter; var endAngle = 2 * Math.PI / 40 * config.arcCount; config.ctx.fillStyle = config.timerColors[quarter]; ctx.beginPath(); ctx.arc(config.circleX, config.circleY, config.circleRadius, startAngle, endAngle, false); ctx.fill(); ctx.fillStyle = saveStyle; }, pulseCircle: function() { if (config.pulseCount < 20){ config.pulseCount++; config.alternateCircle(config.ctx,[config.baseColor, config.pulseColor], config.pulseCount % 2); setTimeout(config.pulseCircle, 100); } else { config.pulseCount = 0; config.clearCanvas(); } }, clearCanvas: function () { config.ctx.clearRect ( 0 , 0 , config.canvasWidth, config.canvasHeight ); }, drawNextSegment: function () { if (config.arcCount < 40) { config.arcCount++; config.drawArc(config.ctx); setTimeout(config.drawNextSegment, 3000); } else { config.arcCount = 0; config.clearCanvas(); } }, startTimer: function () { setTimeout(config.startTimer, 2.05*60*1000); config.pulseCircle(); config.drawNextSegment(); }, showWeather: function () { $('weather a').src = "http://weathersticker.wunderground.com/weathersticker/cgi-bin/banner/ban/wxBanner?bannertype=wu_clean2day_cond&airportcode=KIOW&ForcedCity=Iowa City&ForcedState=IA&zip=52245&language=EN"; }, showNews: function () { $('#news').rssfeed('https://news.google.com/news?output=rss',{limit:20, header: false, ssl: true, linktarget: "_blank"}, function(e) { $(e).find('div.rssBody').vTicker({ showItems: 2}); }); }, showOthers: function() { config.showWeather(); config.showNews(); setTimeout(config.showOthers, 20*60*1000); } }; $(document).ready(function () { config.ctx = $("#myCanvas").get()[0].getContext("2d"); config.clearCanvas(); config.ctx.globalAlpha = config.transparency; // sets the transparency level of the drawings. config.startTimer(); config.showOthers(); });
// Karma configuration // Generated on Sat Aug 24 2019 15:20:59 GMT+1000 (Australian Eastern Standard Time) console.log('KARMA CONFIG : ' + process.env.MODE); const inBrowser = (process.env.MODE && process.env.MODE === 'browser'); module.exports = function(config) { const browsers = (inBrowser) ? [ 'Chrome' ] : [ 'ChromeHeadless' ]; config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine', 'esm'], esm: { // if you are using 'bare module imports' you will need this option nodeResolve: true, // set compatibility mode to all compatibility: 'none', coverage: true }, // list of files / patterns to load in the browser files: [ { pattern: 'compiled/spec/unit/**/*.spec.js', type: 'module'} ], // list of files / patterns to exclude exclude: [ ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { // source files, that you wanna generate coverage for // do not include tests or libraries // (these files will be instrumented by Istanbul) // 'compiled/src/**/*.js': ['coverage'] }, plugins: [ require.resolve('@open-wc/karma-esm'), require.resolve('karma-jasmine'), require.resolve('karma-chrome-launcher'), // require.resolve('karma-coverage'), require.resolve('karma-coverage-istanbul-reporter') ], // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: [ 'dots', // 'coverage' 'coverage-istanbul' ], // // optionally, configure the reporter // coverageReporter: { // dir: require('path').join(__dirname, 'spec', 'coverage'), // includeAllSources: true, // reporters: [ // // reporters not supporting the `file` property // { type: 'html', subdir: 'report-html' }, // // { type: 'lcov', subdir: 'report-lcov' }, // // reporters supporting the `file` property, use `subdir` to directly // // output them in the `dir` directory // // { type: 'cobertura', subdir: '.', file: 'cobertura.txt' }, // // { type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' }, // // { type: 'teamcity', subdir: '.', file: 'teamcity.txt' }, // // { type: 'text', subdir: '.', file: 'text.txt' }, // { type: 'text-summary', subdir: '.', file: 'text-summary.txt' } // ] // }, coverageIstanbulReporter: { dir: require('path').join(__dirname, 'spec', 'coverage'), reports: ['html', 'text-summary', 'json'], // combineBrowserReports: true, // skipFilesWithNoCoverage: false, thresholds: { statements: 80, lines: 80, branches: 80, functions: 80 }, // instrumentation: { // all: true, // include: [ // require('path').join(__dirname, 'compiled', 'src', '**', '*.js') // ], // } }, // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: browsers, customLaunchers: { MyChromeHeadless: { base: 'ChromeHeadless', flags: ['--no-sandbox'] } }, // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false, // Concurrency level // how many browser should be started simultaneous concurrency: Infinity }); }
import React from "react" import IconComponent from "../components/Icon" export default function ProjectCard(props) { const techIcons = props.technologies.map((tech, index) => { console.log(tech) return <IconComponent name={tech} key={index} /> }) return ( <div className="project-card"> <h2>{props.name}</h2> <a href={props.liveLink} target="__blank"> <img alt="thumbnail of project" src={props.thumbnail} /> </a> {console.log(props.thumbnail)} <p>{props.desc}</p> <div className="project-links"> <a className="button" target="__blank" href={props.github}> <IconComponent className="link-icon" name={"github"} /> Github </a> <a className="button" target="__blank" href={props.liveLink}> <div className="code-icon">{"</>"}</div> Live </a> </div> <div className="technology"> <h3>Technologies Used</h3> <div className="technologies">{techIcons}</div> </div> </div> ) }
// all the validators for the question should be added in response_validators . e.g., if there is a validator // for question of type MCQ, then it should be added as response_validators['MCQ'] = function() { return true;}; var response_validators = {}; //Response clearer is a dictionary which contains the response clearer for the questions. //Every question type being implemented can define its response_clearer if there is anything //special required to clear the response in the form. //Note: This JS function will be triggered when the student presses the 'Clear Response' button //on a particular question. The response clearer should be added as response_clearer['MCQ'] = function (qid) { //Somehow clear the form for the question with given qid //}; var gform; var response_clearer = {}; /** * Add the response_clearer for the MCQ type question. **/ response_clearer['MCQ'] = function (qid) { var form = $("#form-question-" + qid); form.find("input").attr({'checked': false}); gform =form; }; /** * Add the response_clearer for the TFQ type question. **/ response_clearer['TFQ'] = function (qid) { var form = $('#form-question-' + qid); form.find('input').attr({'checked': false}); }; /** Currently there are no special validator and clearer**/
'use strict'; /** * SUMMARY_START [default] * @project: GFS2_Master * @copyright: liningftp@qq.com * @name: lauchOrder * @desc: master request chunkserver * @file: /daemon/lauchOrder.js * @author: admin * SUMMARY_END */ // REQUIRE_START [default] // START const {comm, log, clog, jsonlog, jsons} = require('../../base'); const { chunkdataTool, file2chunkTool, namespaceTool, waitleaseTool, serverdataTool } = require('../metadata'); // END // REQUIRE_END // PUBLIC_METHOD_START [setNewChunk] /** * set new chunk to metadata and persist data * @file2chunkData {JSON} map data of filePath to chunkName, @example {"/usr/data/001":["aabbccdd"], "/usr/data/002":["eeffgghh"]} * @chunkData {JSON} base info of all chunk on local, @example {} * @filePath {String} file path of system, @example "/usr/data/001" * @chunkName {String} name of chunk, @example "aabbccdd" * @serverList {Array} all server of chunk, @example ["127.0.0.1:3001", "127.0.0.1:3002", "127.0.0.1:3003"] * @primary {String} primary of chunkserver, @example "127.0.0.1:3001" * @version {Number} version number, @example 1 * @replicaCount {Number} count of relipcas, @example 3 * @timestamp {Number} time stamp, @example 1602252811319 */ exports.setNewChunk = function( file2chunkData, chunkData, filePath, chunkName, serverList, primary, version, replicaCount, timestamp ){ // START log.args( Error(), arguments ); file2chunkTool.add( file2chunkData, filePath, chunkName ); chunkdataTool.add( chunkData, chunkName, version, replicaCount, serverList, timestamp ); chunkdataTool.setPrimary( chunkData, chunkName, primary, timestamp ); chunkdataTool.setVersion( chunkData, chunkName, version ); log.info( Error(), 'end' ); // END }; // PUBLIC_METHOD_END [setNewChunk] // PUBLIC_METHOD_START [grantLease] /** * grant lease to primary * @waitleaseData {JSON} waitting for chunkserver confirm lease, @example {} * @chunkName {String} name of chunk, @example "ad4e67f0b01f550d9e9c33e548ce971b2e2112ae3c695af3b01ba3639268375b" * @serverList {Array} all server of chunk, @example ["127.0.0.1:3001", "127.0.0.1:3002", "127.0.0.1:3003"] * @primary {String} primary of chunkserver, @example "127.0.0.1:3001" * @version {Number} version number, @example 1 * @timestamp {Number} time stamp, @example 1606639653647 * @isNew {Number} if chunk is new then will be created, @example 0 * @return {JSON} return value, @example {"code":0, "msg":""} */ exports.grantLease = async function( waitleaseData, chunkName, serverList, primary, version, timestamp, isNew ){ // START log.args( Error(), arguments ); waitleaseTool.clear(waitleaseData, timestamp); return new Promise( async (resolve, reject) => { if( waitleaseTool.has(waitleaseData, chunkName) ){ waitleaseTool.add(waitleaseData, chunkName, { 'resolve': resolve }, timestamp); } else{ waitleaseTool.add(waitleaseData, chunkName, { 'resolve': resolve, 'isRunner': 1 }, timestamp); let result = {}, bigData; isNew = isNew || 0; let [host, port] = primary.split(':'); serverList = serverList.filter( item => item != primary); // SOCKET_API OPEN [GFS2_Chunkserver.handler.recvLease] {tabCount=3} /* receive lease of Master grant to primary */ /* @return {Array} Return value [{"code":0}] */ [result, bigData] = await comm.clientRequest(host, port, comm.encodeMessageData({ "method": "recvLease", "chunkName": chunkName, "version": version, "primary": primary, "serverList": serverList, "isNew": isNew, }) ); // SOCKET_API CLOSE let list = waitleaseTool.get(waitleaseData, chunkName); for(const item of list){ let _result = {'code': 0}; if(item.isRunner){ _result.isRunner = 1; } log.info( Error(), jsons(_result) ); item.resolve(_result); } waitleaseTool.delete(waitleaseData, chunkName); } }); // END }; // PUBLIC_METHOD_END [grantLease] // PUBLIC_METHOD_START [revokeLease] /** * revoke lease of primary to run snapshot * @chunkData {JSON} base info of all chunk on local, @example {"aabbccdd":[1,20,3,"127.0.0.1:3001,1600247712022","127.0.0.1:3002,1600247712022","127.0.0.1:3003,1600247712022,P"]} * @chunkName {String} name of chunk, @example "aabbccdd" * @return {JSON} return value, @example {"code":0, "msg":""} */ exports.revokeLease = async function( chunkData, chunkName ){ // START // revokeLease // END }; // PUBLIC_METHOD_END [revokeLease]
"use strict"; var _sum = require("./math/sum"); var _sum2 = _interopRequireDefault(_sum); var _sqr = require("./math/sqr"); var _sqr2 = _interopRequireDefault(_sqr); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var data = [1, 2, 3, 4, 5]; var sumSqr = function sumSqr(arr) { var sqrs = arr.map(function (item) { return (0, _sqr2.default)(item); }); return (0, _sum2.default)(sqrs); }; console.log(sumSqr(data));
import React, { useReducer } from "react"; export default (reducer, actions, defaultValue) => { const Context = React.createContext(); const Provider = ({ children }) => { const [state, dispatch] = useReducer(reducer, defaultValue); const boundActions = {}; for (let key in actions) { boundActions[key] = actions[key](dispatch); } return ( <Context.Provider value={{ state, ...boundActions }}> {children} </Context.Provider> ); }; return { Context, Provider }; };
/*! { "name": "dataset API", "caniuse": "dataset", "property": "dataset", "tags": ["dom"], "authors": ["@phiggins42"] } !*/ define(['Modernizr', 'createElement'], function( Modernizr, createElement ) { // dataset API for data-* attributes Modernizr.addTest('dataset', function() { var n = createElement("div"); n.setAttribute("data-a-b", "c"); return !!(n.dataset && n.dataset.aB === "c"); }); });
(function e(t,n){if(typeof exports==="object"&&typeof module==="object")module.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof exports==="object")exports["SwupFadeTheme"]=n();else t["SwupFadeTheme"]=n()})(window,function(){return function(e){var t={};function n(o){if(t[o]){return t[o].exports}var r=t[o]={i:o,l:false,exports:{}};e[o].call(r.exports,r,r.exports,n);r.l=true;return r.exports}n.m=e;n.c=t;n.d=function(e,t,o){if(!n.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:o})}};n.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};n.t=function(e,t){if(t&1)e=n(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var o=Object.create(null);n.r(o);Object.defineProperty(o,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o};n.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};n.d(t,"a",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p="";return n(n.s=0)}([function(e,t,n){"use strict";var o=n(1);var r=i(o);function i(e){return e&&e.__esModule?e:{default:e}}e.exports=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n){if(Object.prototype.hasOwnProperty.call(n,o)){e[o]=n[o]}}}return e};var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(e,o.key,o)}}return function(t,n,o){if(n)e(t.prototype,n);if(o)e(t,o);return t}}();var i=n(2);var a=l(i);var u=n(3);var s=l(u);function l(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function f(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function p(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var d=function(e){p(t,e);function t(e){c(this,t);var n=f(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n.name="FadeTheme";var r={mainElement:"#swup"};n.options=o({},r,e);return n}r(t,[{key:"mount",value:function e(){this.applyStyles(s.default);this.addClassName(this.options.mainElement,"main")}}]);return t}(a.default);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||false;o.configurable=true;if("value"in o)o.writable=true;Object.defineProperty(e,o.key,o)}}return function(t,n,o){if(n)e(t.prototype,n);if(o)e(t,o);return t}}();function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var i=function(){function e(){var t=this;r(this,e);this._addedStyleElements=[];this._addedHTMLContent=[];this._classNameAddedToElements=[];this._addClassNameToElement=function(){t._classNameAddedToElements.forEach(function(e){var t=Array.prototype.slice.call(document.querySelectorAll(e.selector));t.forEach(function(t){t.classList.add("swup-transition-"+e.name)})})};this.isSwupPlugin=true}o(e,[{key:"_beforeMount",value:function e(){this._originalAnimationSelectorOption=String(this.swup.options.animationSelector);this.swup.options.animationSelector='[class*="swup-transition-"]';this.swup.on("contentReplaced",this._addClassNameToElement)}},{key:"_afterUnmount",value:function e(){this.swup.options.animationSelector=this._originalAnimationSelectorOption;this._addedStyleElements.forEach(function(e){e.outerHTML="";e=null});this._addedHTMLContent.forEach(function(e){e.outerHTML="";e=null});this._classNameAddedToElements.forEach(function(e){var t=Array.prototype.slice.call(document.querySelectorAll(e.selector));t.forEach(function(e){e.className.split(" ").forEach(function(t){if(new RegExp("^swup-transition-").test(t)){e.classList.remove(t)}})})});this.swup.off("contentReplaced",this._addClassNameToElement)}},{key:"mount",value:function e(){}},{key:"unmount",value:function e(){}},{key:"applyStyles",value:function e(t){var n=document.head;var o=document.createElement("style");o.setAttribute("data-swup-theme","");o.appendChild(document.createTextNode(t));this._addedStyleElements.push(o);n.prepend(o)}},{key:"applyHTML",value:function e(t){var n=document.createElement("div");n.innerHTML=t;this._addedHTMLContent.push(n);document.body.appendChild(n)}},{key:"addClassName",value:function e(t,n){this._classNameAddedToElements.push({selector:t,name:n});this._addClassNameToElement()}}]);return e}();t.default=i},function(e,t,n){t=e.exports=n(4)(false);t.push([e.i,".swup-transition-main {\n opacity: 1;\n transition: opacity .4s;\n}\n\nhtml.is-animating .swup-transition-main {\n opacity: 0;\n}",""])},function(e,t,n){"use strict";e.exports=function(e){var t=[];t.toString=function t(){return this.map(function(t){var n=o(t,e);if(t[2]){return"@media "+t[2]+"{"+n+"}"}else{return n}}).join("")};t.i=function(e,n){if(typeof e==="string"){e=[[null,e,""]]}var o={};for(var r=0;r<this.length;r++){var i=this[r][0];if(i!=null){o[i]=true}}for(r=0;r<e.length;r++){var a=e[r];if(a[0]==null||!o[a[0]]){if(n&&!a[2]){a[2]=n}else if(n){a[2]="("+a[2]+") and ("+n+")"}t.push(a)}}};return t};function o(e,t){var n=e[1]||"";var o=e[3];if(!o){return n}if(t&&typeof btoa==="function"){var i=r(o);var a=o.sources.map(function(e){return"/*# sourceURL="+o.sourceRoot+e+" */"});return[n].concat(a).concat([i]).join("\n")}return[n].join("\n")}function r(e){var t=btoa(unescape(encodeURIComponent(JSON.stringify(e))));var n="sourceMappingURL=data:application/json;charset=utf-8;base64,"+t;return"/*# "+n+" */"}}])});
require('dotenv').config() var app = require('./app'); var port = process.env.PORT; var server = app.listen(port, function() { console.log('Express server listening on port ' + port); });
function pressHomeTab() { var table = document.getElementById('HomeTab'); if (table != null) { for (var i = 0; i < table.rows.length; i++) { for (var j = 0; j < table.rows[i].cells.length; j++) table.rows[i].cells[j].onclick = function () { switchView(this.textContent); }; } } } function switchView(tab){ switch (tab) { case "Snake": window.location = 'Snake/snakegame.html'; break case "Home": window.location = 'index.html'; break } }
export const state = () => ({ eventLog: { level: '', logtype: '', node: '', event: '', sortBy: 'TimeStr', sortDesc: false, page: 1, itemsPerPage: 15, }, syslog: { pri: '', host: '', tag: '', msg: '', sortBy: 'TimeStr', sortDesc: false, page: 1, itemsPerPage: 15, }, netflow: { src: '', dst: '', prot: '', tcpflag: '', sortBy: 'TimeStr', sortDesc: false, page: 1, itemsPerPage: 15, }, trapLog: { src: '', traptype: '', varbind: '', level: '', sortBy: 'TimeStr', sortDesc: false, page: 1, itemsPerPage: 15, }, arpLog: { state: '', ip: '', mac: '', vendor: '', oldmac: '', oldvendor: '', sortBy: 'TimeStr', sortDesc: false, page: 1, itemsPerPage: 15, }, }) export const mutations = { setEventLog(state, c) { state.eventLog = c }, setSyslog(state, c) { state.syslog = c }, setNetFlow(state, c) { state.netflow = c }, setTrapLog(state, c) { state.trapLog = c }, setArpLog(state, c) { state.arpLog = c }, }
/*! * Datepicker for Bootstrap v1.5.1 (https://github.com/eternicode/bootstrap-datepicker) * * Copyright 2012 Stefan Petre * Improvements by Andrew Rowls * Licensed under the Apache License v2.0 (https://www.apache.org/licenses/LICENSE-2.0) */(function(factory){ if (typeof define === "function" && define.amd) { define(["jquery"], factory); } else if (typeof exports === 'object') { factory(require('jquery')); } else { factory(jQuery); } }(function($, undefined){ function UTCDate(){ return new Date(Date.UTC.apply(Date, arguments)); } function UTCToday(){ var today = new Date(); return UTCDate(today.getFullYear(), today.getMonth(), today.getDate()); } function isUTCEquals(date1, date2) { return ( date1.getUTCFullYear() === date2.getUTCFullYear() && date1.getUTCMonth() === date2.getUTCMonth() && date1.getUTCDate() === date2.getUTCDate() ); } function alias(method){ return function(){ return this[method].apply(this, arguments); }; } function isValidDate(d) { return d && !isNaN(d.getTime()); } var DateArray = (function(){ var extras = { get: function(i){ return this.slice(i)[0]; }, contains: function(d){ // Array.indexOf is not cross-browser; // $.inArray doesn't work with Dates var val = d && d.valueOf(); for (var i=0, l=this.length; i < l; i++) if (this[i].valueOf() === val) return i; return -1; }, remove: function(i){ this.splice(i,1); }, replace: function(new_array){ if (!new_array) return; if (!$.isArray(new_array)) new_array = [new_array]; this.clear(); this.push.apply(this, new_array); }, clear: function(){ this.length = 0; }, copy: function(){ var a = new DateArray(); a.replace(this); return a; } }; return function(){ var a = []; a.push.apply(a, arguments); $.extend(a, extras); return a; }; })(); // Picker object var Datepicker = function(element, options){ $(element).data('datepicker', this); this._process_options(options); this.dates = new DateArray(); this.viewDate = this.o.defaultViewDate; this.focusDate = null; this.element = $(element); this.isInline = false; this.isInput = this.element.is('input'); this.component = this.element.hasClass('date') ? this.element.find('.add-on, .input-group-addon, .btn') : false; this.hasInput = this.component && this.element.find('input').length; if (this.component && this.component.length === 0) this.component = false; this.picker = $(DPGlobal.template); this._buildEvents(); this._attachEvents(); if (this.isInline){ this.picker.addClass('datepicker-inline').appendTo(this.element); } else { this.picker.addClass('datepicker-dropdown dropdown-menu'); } if (this.o.rtl){ this.picker.addClass('datepicker-rtl'); } this.viewMode = this.o.startView; if (this.o.calendarWeeks) this.picker.find('thead .datepicker-title, tfoot .today, tfoot .clear') .attr('colspan', function(i, val){ return parseInt(val) + 1; }); this._allow_update = false; this.setStartDate(this._o.startDate); this.setEndDate(this._o.endDate); this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled); this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted); this.setDatesDisabled(this.o.datesDisabled); this.fillDow(); this.fillMonths(); this._allow_update = true; this.update(); this.showMode(); if (this.isInline){ this.show(); } }; Datepicker.prototype = { constructor: Datepicker, _process_options: function(opts){ // Store raw options for reference this._o = $.extend({}, this._o, opts); // Processed options var o = this.o = $.extend({}, this._o); // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" var lang = o.language; if (!dates[lang]){ lang = lang.split('-')[0]; if (!dates[lang]) lang = defaults.language; } o.language = lang; switch (o.startView){ case 2: case 'decade': o.startView = 2; break; case 1: case 'year': o.startView = 1; break; default: o.startView = 0; } switch (o.minViewMode){ case 1: case 'months': o.minViewMode = 1; break; case 2: case 'years': o.minViewMode = 2; break; default: o.minViewMode = 0; } switch (o.maxViewMode) { case 0: case 'days': o.maxViewMode = 0; break; case 1: case 'months': o.maxViewMode = 1; break; default: o.maxViewMode = 2; } o.startView = Math.min(o.startView, o.maxViewMode); o.startView = Math.max(o.startView, o.minViewMode); // true, false, or Number > 0 if (o.multidate !== true){ o.multidate = Number(o.multidate) || false; if (o.multidate !== false) o.multidate = Math.max(0, o.multidate); } o.multidateSeparator = String(o.multidateSeparator); o.weekStart %= 7; o.weekEnd = (o.weekStart + 6) % 7; var format = DPGlobal.parseFormat(o.format); if (o.startDate !== -Infinity){ if (!!o.startDate){ if (o.startDate instanceof Date) o.startDate = this._local_to_utc(this._zero_time(o.startDate)); else o.startDate = DPGlobal.parseDate(o.startDate, format, o.language); } else { o.startDate = -Infinity; } } if (o.endDate !== Infinity){ if (!!o.endDate){ if (o.endDate instanceof Date) o.endDate = this._local_to_utc(this._zero_time(o.endDate)); else o.endDate = DPGlobal.parseDate(o.endDate, format, o.language); } else { o.endDate = Infinity; } } o.daysOfWeekDisabled = o.daysOfWeekDisabled||[]; if (!$.isArray(o.daysOfWeekDisabled)) o.daysOfWeekDisabled = o.daysOfWeekDisabled.split(/[,\s]*/); o.daysOfWeekDisabled = $.map(o.daysOfWeekDisabled, function(d){ return parseInt(d, 10); }); o.daysOfWeekHighlighted = o.daysOfWeekHighlighted||[]; if (!$.isArray(o.daysOfWeekHighlighted)) o.daysOfWeekHighlighted = o.daysOfWeekHighlighted.split(/[,\s]*/); o.daysOfWeekHighlighted = $.map(o.daysOfWeekHighlighted, function(d){ return parseInt(d, 10); }); o.datesDisabled = o.datesDisabled||[]; if (!$.isArray(o.datesDisabled)) { var datesDisabled = []; datesDisabled.push(DPGlobal.parseDate(o.datesDisabled, format, o.language)); o.datesDisabled = datesDisabled; } o.datesDisabled = $.map(o.datesDisabled,function(d){ return DPGlobal.parseDate(d, format, o.language); }); var plc = String(o.orientation).toLowerCase().split(/\s+/g), _plc = o.orientation.toLowerCase(); plc = $.grep(plc, function(word){ return /^auto|left|right|top|bottom$/.test(word); }); o.orientation = {x: 'auto', y: 'auto'}; if (!_plc || _plc === 'auto') ; // no action else if (plc.length === 1){ switch (plc[0]){ case 'top': case 'bottom': o.orientation.y = plc[0]; break; case 'left': case 'right': o.orientation.x = plc[0]; break; } } else { _plc = $.grep(plc, function(word){ return /^left|right$/.test(word); }); o.orientation.x = _plc[0] || 'auto'; _plc = $.grep(plc, function(word){ return /^top|bottom$/.test(word); }); o.orientation.y = _plc[0] || 'auto'; } if (o.defaultViewDate) { var year = o.defaultViewDate.year || new Date().getFullYear(); var month = o.defaultViewDate.month || 0; var day = o.defaultViewDate.day || 1; o.defaultViewDate = UTCDate(year, month, day); } else { o.defaultViewDate = UTCToday(); } }, _events: [], _secondaryEvents: [], _applyEvents: function(evs){ for (var i=0, el, ch, ev; i < evs.length; i++){ el = evs[i][0]; if (evs[i].length === 2){ ch = undefined; ev = evs[i][1]; } else if (evs[i].length === 3){ ch = evs[i][1]; ev = evs[i][2]; } el.on(ev, ch); } }, _unapplyEvents: function(evs){ for (var i=0, el, ev, ch; i < evs.length; i++){ el = evs[i][0]; if (evs[i].length === 2){ ch = undefined; ev = evs[i][1]; } else if (evs[i].length === 3){ ch = evs[i][1]; ev = evs[i][2]; } el.off(ev, ch); } }, _buildEvents: function(){ var events = { keyup: $.proxy(function(e){ if ($.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) === -1) this.update(); }, this), keydown: $.proxy(this.keydown, this), paste: $.proxy(this.paste, this) }; if (this.o.showOnFocus === true) { events.focus = $.proxy(this.show, this); } if (this.isInput) { // single input this._events = [ [this.element, events] ]; } else if (this.component && this.hasInput) { // component: input + button this._events = [ // For components that are not readonly, allow keyboard nav [this.element.find('input'), events], [this.component, { click: $.proxy(this.show, this) }] ]; } else if (this.element.is('div')){ // inline datepicker this.isInline = true; } else { this._events = [ [this.element, { click: $.proxy(this.show, this) }] ]; } this._events.push( // Component: listen for blur on element descendants [this.element, '*', { blur: $.proxy(function(e){ this._focused_from = e.target; }, this) }], // Input: listen for blur on element [this.element, { blur: $.proxy(function(e){ this._focused_from = e.target; }, this) }] ); if (this.o.immediateUpdates) { // Trigger input updates immediately on changed year/month this._events.push([this.element, { 'changeYear changeMonth': $.proxy(function(e){ this.update(e.date); }, this) }]); } this._secondaryEvents = [ [this.picker, { click: $.proxy(this.click, this) }], [$(window), { resize: $.proxy(this.place, this) }], [$(document), { mousedown: $.proxy(function(e){ // Clicked outside the datepicker, hide it if (!( this.element.is(e.target) || this.element.find(e.target).length || this.picker.is(e.target) || this.picker.find(e.target).length || this.picker.hasClass('datepicker-inline') )){ this.hide(); } }, this) }] ]; }, _attachEvents: function(){ this._detachEvents(); this._applyEvents(this._events); }, _detachEvents: function(){ this._unapplyEvents(this._events); }, _attachSecondaryEvents: function(){ this._detachSecondaryEvents(); this._applyEvents(this._secondaryEvents); }, _detachSecondaryEvents: function(){ this._unapplyEvents(this._secondaryEvents); }, _trigger: function(event, altdate){ var date = altdate || this.dates.get(-1), local_date = this._utc_to_local(date); this.element.trigger({ type: event, date: local_date, dates: $.map(this.dates, this._utc_to_local), format: $.proxy(function(ix, format){ if (arguments.length === 0){ ix = this.dates.length - 1; format = this.o.format; } else if (typeof ix === 'string'){ format = ix; ix = this.dates.length - 1; } format = format || this.o.format; var date = this.dates.get(ix); return DPGlobal.formatDate(date, format, this.o.language); }, this) }); }, show: function(){ var element = this.component ? this.element.find('input') : this.element; if (element.attr('readonly') && this.o.enableOnReadonly === false) return; if (!this.isInline) this.picker.appendTo(this.o.container); this.place(); this.picker.show(); this._attachSecondaryEvents(); this._trigger('show'); if ((window.navigator.msMaxTouchPoints || 'ontouchstart' in document) && this.o.disableTouchKeyboard) { $(this.element).blur(); } return this; }, hide: function(){ if (this.isInline) return this; if (!this.picker.is(':visible')) return this; this.focusDate = null; this.picker.hide().detach(); this._detachSecondaryEvents(); this.viewMode = this.o.startView; this.showMode(); if ( this.o.forceParse && ( this.isInput && this.element.val() || this.hasInput && this.element.find('input').val() ) ) this.setValue(); this._trigger('hide'); return this; }, remove: function(){ this.hide(); this._detachEvents(); this._detachSecondaryEvents(); this.picker.remove(); delete this.element.data().datepicker; if (!this.isInput){ delete this.element.data().date; } return this; }, paste: function(evt){ var dateString; if (evt.originalEvent.clipboardData && evt.originalEvent.clipboardData.types && $.inArray('text/plain', evt.originalEvent.clipboardData.types) !== -1) { dateString = evt.originalEvent.clipboardData.getData('text/plain'); } else if (window.clipboardData) { dateString = window.clipboardData.getData('Text'); } else { return; } this.setDate(dateString); this.update(); evt.preventDefault(); }, _utc_to_local: function(utc){ return utc && new Date(utc.getTime() + (utc.getTimezoneOffset()*60000)); }, _local_to_utc: function(local){ return local && new Date(local.getTime() - (local.getTimezoneOffset()*60000)); }, _zero_time: function(local){ return local && new Date(local.getFullYear(), local.getMonth(), local.getDate()); }, _zero_utc_time: function(utc){ return utc && new Date(Date.UTC(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate())); }, getDates: function(){ return $.map(this.dates, this._utc_to_local); }, getUTCDates: function(){ return $.map(this.dates, function(d){ return new Date(d); }); }, getDate: function(){ return this._utc_to_local(this.getUTCDate()); }, getUTCDate: function(){ var selected_date = this.dates.get(-1); if (typeof selected_date !== 'undefined') { return new Date(selected_date); } else { return null; } }, clearDates: function(){ var element; if (this.isInput) { element = this.element; } else if (this.component) { element = this.element.find('input'); } if (element) { element.val(''); } this.update(); this._trigger('changeDate'); if (this.o.autoclose) { this.hide(); } }, setDates: function(){ var args = $.isArray(arguments[0]) ? arguments[0] : arguments; this.update.apply(this, args); this._trigger('changeDate'); this.setValue(); return this; }, setUTCDates: function(){ var args = $.isArray(arguments[0]) ? arguments[0] : arguments; this.update.apply(this, $.map(args, this._utc_to_local)); this._trigger('changeDate'); this.setValue(); return this; }, setDate: alias('setDates'), setUTCDate: alias('setUTCDates'), setValue: function(){ var formatted = this.getFormattedDate(); if (!this.isInput){ if (this.component){ this.element.find('input').val(formatted); } } else { this.element.val(formatted); } return this; }, getFormattedDate: function(format){ if (format === undefined) format = this.o.format; var lang = this.o.language; return $.map(this.dates, function(d){ return DPGlobal.formatDate(d, format, lang); }).join(this.o.multidateSeparator); }, setStartDate: function(startDate){ this._process_options({startDate: startDate}); this.update(); this.updateNavArrows(); return this; }, setEndDate: function(endDate){ this._process_options({endDate: endDate}); this.update(); this.updateNavArrows(); return this; }, setDaysOfWeekDisabled: function(daysOfWeekDisabled){ this._process_options({daysOfWeekDisabled: daysOfWeekDisabled}); this.update(); this.updateNavArrows(); return this; }, setDaysOfWeekHighlighted: function(daysOfWeekHighlighted){ this._process_options({daysOfWeekHighlighted: daysOfWeekHighlighted}); this.update(); return this; }, setDatesDisabled: function(datesDisabled){ this._process_options({datesDisabled: datesDisabled}); this.update(); this.updateNavArrows(); }, place: function(){ if (this.isInline) return this; var calendarWidth = this.picker.outerWidth(), calendarHeight = this.picker.outerHeight(), visualPadding = 10, container = $(this.o.container), windowWidth = container.width(), scrollTop = this.o.container === 'body' ? $(document).scrollTop() : container.scrollTop(), appendOffset = container.offset(); var parentsZindex = []; this.element.parents().each(function(){ var itemZIndex = $(this).css('z-index'); if (itemZIndex !== 'auto' && itemZIndex !== 0) parentsZindex.push(parseInt(itemZIndex)); }); var zIndex = Math.max.apply(Math, parentsZindex) + this.o.zIndexOffset; var offset = this.component ? this.component.parent().offset() : this.element.offset(); var height = this.component ? this.component.outerHeight(true) : this.element.outerHeight(false); var width = this.component ? this.component.outerWidth(true) : this.element.outerWidth(false); var left = offset.left - appendOffset.left, top = offset.top - appendOffset.top; if (this.o.container !== 'body') { top += scrollTop; } this.picker.removeClass( 'datepicker-orient-top datepicker-orient-bottom '+ 'datepicker-orient-right datepicker-orient-left' ); if (this.o.orientation.x !== 'auto'){ this.picker.addClass('datepicker-orient-' + this.o.orientation.x); if (this.o.orientation.x === 'right') left -= calendarWidth - width; } // auto x orientation is best-placement: if it crosses a window // edge, fudge it sideways else { if (offset.left < 0) { // component is outside the window on the left side. Move it into visible range this.picker.addClass('datepicker-orient-left'); left -= offset.left - visualPadding; } else if (left + calendarWidth > windowWidth) { // the calendar passes the widow right edge. Align it to component right side this.picker.addClass('datepicker-orient-right'); left += width - calendarWidth; } else { // Default to left this.picker.addClass('datepicker-orient-left'); } } // auto y orientation is best-situation: top or bottom, no fudging, // decision based on which shows more of the calendar var yorient = this.o.orientation.y, top_overflow; if (yorient === 'auto'){ top_overflow = -scrollTop + top - calendarHeight; yorient = top_overflow < 0 ? 'bottom' : 'top'; } this.picker.addClass('datepicker-orient-' + yorient); if (yorient === 'top') top -= calendarHeight + parseInt(this.picker.css('padding-top')); else top += height; if (this.o.rtl) { var right = windowWidth - (left + width); this.picker.css({ top: top, right: right, zIndex: zIndex }); } else { this.picker.css({ top: top, left: left, zIndex: zIndex }); } return this; }, _allow_update: true, update: function(){ if (!this._allow_update) return this; var oldDates = this.dates.copy(), dates = [], fromArgs = false; if (arguments.length){ $.each(arguments, $.proxy(function(i, date){ if (date instanceof Date) date = this._local_to_utc(date); dates.push(date); }, this)); fromArgs = true; } else { dates = this.isInput ? this.element.val() : this.element.data('date') || this.element.find('input').val(); if (dates && this.o.multidate) dates = dates.split(this.o.multidateSeparator); else dates = [dates]; delete this.element.data().date; } dates = $.map(dates, $.proxy(function(date){ return DPGlobal.parseDate(date, this.o.format, this.o.language); }, this)); dates = $.grep(dates, $.proxy(function(date){ return ( !this.dateWithinRange(date) || !date ); }, this), true); this.dates.replace(dates); if (this.dates.length) this.viewDate = new Date(this.dates.get(-1)); else if (this.viewDate < this.o.startDate) this.viewDate = new Date(this.o.startDate); else if (this.viewDate > this.o.endDate) this.viewDate = new Date(this.o.endDate); else this.viewDate = this.o.defaultViewDate; if (fromArgs){ // setting date by clicking this.setValue(); } else if (dates.length){ // setting date by typing if (String(oldDates) !== String(this.dates)) this._trigger('changeDate'); } if (!this.dates.length && oldDates.length) this._trigger('clearDate'); this.fill(); this.element.change(); return this; }, fillDow: function(){ var dowCnt = this.o.weekStart, html = '<tr>'; if (this.o.calendarWeeks){ this.picker.find('.datepicker-days .datepicker-switch') .attr('colspan', function(i, val){ return parseInt(val) + 1; }); html += '<th class="cw">&#160;</th>'; } while (dowCnt < this.o.weekStart + 7){ html += '<th class="dow">'+dates[this.o.language].daysMin[(dowCnt++)%7]+'</th>'; } html += '</tr>'; this.picker.find('.datepicker-days thead').append(html); }, fillMonths: function(){ var html = '', i = 0; while (i < 12){ html += '<span class="month">'+dates[this.o.language].monthsShort[i++]+'</span>'; } this.picker.find('.datepicker-months td').html(html); }, setRange: function(range){ if (!range || !range.length) delete this.range; else this.range = $.map(range, function(d){ return d.valueOf(); }); this.fill(); }, getClassNames: function(date){ var cls = [], year = this.viewDate.getUTCFullYear(), month = this.viewDate.getUTCMonth(), today = new Date(); if (date.getUTCFullYear() < year || (date.getUTCFullYear() === year && date.getUTCMonth() < month)){ cls.push('old'); } else if (date.getUTCFullYear() > year || (date.getUTCFullYear() === year && date.getUTCMonth() > month)){ cls.push('new'); } if (this.focusDate && date.valueOf() === this.focusDate.valueOf()) cls.push('focused'); // Compare internal UTC date with local today, not UTC today if (this.o.todayHighlight && date.getUTCFullYear() === today.getFullYear() && date.getUTCMonth() === today.getMonth() && date.getUTCDate() === today.getDate()){ cls.push('today'); } if (this.dates.contains(date) !== -1) cls.push('active'); if (!this.dateWithinRange(date) || this.dateIsDisabled(date)){ cls.push('disabled'); } if ($.inArray(date.getUTCDay(), this.o.daysOfWeekHighlighted) !== -1){ cls.push('highlighted'); } if (this.range){ if (date > this.range[0] && date < this.range[this.range.length-1]){ cls.push('range'); } if ($.inArray(date.valueOf(), this.range) !== -1){ cls.push('selected'); } if (date.valueOf() === this.range[0]){ cls.push('range-start'); } if (date.valueOf() === this.range[this.range.length-1]){ cls.push('range-end'); } } return cls; }, fill: function(){ var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(), startYear = this.o.startDate !== -Infinity ? this.o.startDate.getUTCFullYear() : -Infinity, startMonth = this.o.startDate !== -Infinity ? this.o.startDate.getUTCMonth() : -Infinity, endYear = this.o.endDate !== Infinity ? this.o.endDate.getUTCFullYear() : Infinity, endMonth = this.o.endDate !== Infinity ? this.o.endDate.getUTCMonth() : Infinity, todaytxt = dates[this.o.language].today || dates['en'].today || '', cleartxt = dates[this.o.language].clear || dates['en'].clear || '', titleFormat = dates[this.o.language].titleFormat || dates['en'].titleFormat, tooltip; if (isNaN(year) || isNaN(month)) return; this.picker.find('.datepicker-days thead .datepicker-switch') .text(DPGlobal.formatDate(new UTCDate(year, month), titleFormat, this.o.language)); this.picker.find('tfoot .today') .text(todaytxt) .toggle(this.o.todayBtn !== false); this.picker.find('tfoot .clear') .text(cleartxt) .toggle(this.o.clearBtn !== false); this.picker.find('thead .datepicker-title') .text(this.o.title) .toggle(this.o.title !== ''); this.updateNavArrows(); this.fillMonths(); var prevMonth = UTCDate(year, month-1, 28), day = DPGlobal.getDaysInMonth(prevMonth.getUTCFullYear(), prevMonth.getUTCMonth()); prevMonth.setUTCDate(day); prevMonth.setUTCDate(day - (prevMonth.getUTCDay() - this.o.weekStart + 7)%7); var nextMonth = new Date(prevMonth); if (prevMonth.getUTCFullYear() < 100){ nextMonth.setUTCFullYear(prevMonth.getUTCFullYear()); } nextMonth.setUTCDate(nextMonth.getUTCDate() + 42); nextMonth = nextMonth.valueOf(); var html = []; var clsName; while (prevMonth.valueOf() < nextMonth){ if (prevMonth.getUTCDay() === this.o.weekStart){ html.push('<tr>'); if (this.o.calendarWeeks){ // ISO 8601: First week contains first thursday. // ISO also states week starts on Monday, but we can be more abstract here. var // Start of current week: based on weekstart/current date ws = new Date(+prevMonth + (this.o.weekStart - prevMonth.getUTCDay() - 7) % 7 * 864e5), // Thursday of this week th = new Date(Number(ws) + (7 + 4 - ws.getUTCDay()) % 7 * 864e5), // First Thursday of year, year from thursday yth = new Date(Number(yth = UTCDate(th.getUTCFullYear(), 0, 1)) + (7 + 4 - yth.getUTCDay())%7*864e5), // Calendar week: ms between thursdays, div ms per day, div 7 days calWeek = (th - yth) / 864e5 / 7 + 1; html.push('<td class="cw">'+ calWeek +'</td>'); } } clsName = this.getClassNames(prevMonth); clsName.push('day'); if (this.o.beforeShowDay !== $.noop){ var before = this.o.beforeShowDay(this._utc_to_local(prevMonth)); if (before === undefined) before = {}; else if (typeof(before) === 'boolean') before = {enabled: before}; else if (typeof(before) === 'string') before = {classes: before}; if (before.enabled === false) clsName.push('disabled'); if (before.classes) clsName = clsName.concat(before.classes.split(/\s+/)); if (before.tooltip) tooltip = before.tooltip; } clsName = $.unique(clsName); html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>'); tooltip = null; if (prevMonth.getUTCDay() === this.o.weekEnd){ html.push('</tr>'); } prevMonth.setUTCDate(prevMonth.getUTCDate()+1); } this.picker.find('.datepicker-days tbody').empty().append(html.join('')); var monthsTitle = dates[this.o.language].monthsTitle || dates['en'].monthsTitle || 'Months'; var months = this.picker.find('.datepicker-months') .find('.datepicker-switch') .text(this.o.maxViewMode < 2 ? monthsTitle : year) .end() .find('span').removeClass('active'); $.each(this.dates, function(i, d){ if (d.getUTCFullYear() === year) months.eq(d.getUTCMonth()).addClass('active'); }); if (year < startYear || year > endYear){ months.addClass('disabled'); } if (year === startYear){ months.slice(0, startMonth).addClass('disabled'); } if (year === endYear){ months.slice(endMonth+1).addClass('disabled'); } if (this.o.beforeShowMonth !== $.noop){ var that = this; $.each(months, function(i, month){ if (!$(month).hasClass('disabled')) { var moDate = new Date(year, i, 1); var before = that.o.beforeShowMonth(moDate); if (before === false) $(month).addClass('disabled'); } }); } html = ''; year = parseInt(year/10, 10) * 10; var yearCont = this.picker.find('.datepicker-years') .find('.datepicker-switch') .text(year + '-' + (year + 9)) .end() .find('td'); year -= 1; var years = $.map(this.dates, function(d){ return d.getUTCFullYear(); }), classes; for (var i = -1; i < 11; i++){ classes = ['year']; tooltip = null; if (i === -1) classes.push('old'); else if (i === 10) classes.push('new'); if ($.inArray(year, years) !== -1) classes.push('active'); if (year < startYear || year > endYear) classes.push('disabled'); if (this.o.beforeShowYear !== $.noop) { var yrBefore = this.o.beforeShowYear(new Date(year, 0, 1)); if (yrBefore === undefined) yrBefore = {}; else if (typeof(yrBefore) === 'boolean') yrBefore = {enabled: yrBefore}; else if (typeof(yrBefore) === 'string') yrBefore = {classes: yrBefore}; if (yrBefore.enabled === false) classes.push('disabled'); if (yrBefore.classes) classes = classes.concat(yrBefore.classes.split(/\s+/)); if (yrBefore.tooltip) tooltip = yrBefore.tooltip; } html += '<span class="' + classes.join(' ') + '"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>' + year + '</span>'; year += 1; } yearCont.html(html); }, updateNavArrows: function(){ if (!this._allow_update) return; var d = new Date(this.viewDate), year = d.getUTCFullYear(), month = d.getUTCMonth(); switch (this.viewMode){ case 0: if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() && month <= this.o.startDate.getUTCMonth()){ this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() && month >= this.o.endDate.getUTCMonth()){ this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; case 1: case 2: if (this.o.startDate !== -Infinity && year <= this.o.startDate.getUTCFullYear() || this.o.maxViewMode < 2){ this.picker.find('.prev').css({visibility: 'hidden'}); } else { this.picker.find('.prev').css({visibility: 'visible'}); } if (this.o.endDate !== Infinity && year >= this.o.endDate.getUTCFullYear() || this.o.maxViewMode < 2){ this.picker.find('.next').css({visibility: 'hidden'}); } else { this.picker.find('.next').css({visibility: 'visible'}); } break; } }, click: function(e){ e.preventDefault(); e.stopPropagation(); var target = $(e.target).closest('span, td, th'), year, month, day; if (target.length === 1){ switch (target[0].nodeName.toLowerCase()){ case 'th': switch (target[0].className){ case 'datepicker-switch': this.showMode(1); break; case 'prev': case 'next': var dir = DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1); switch (this.viewMode){ case 0: this.viewDate = this.moveMonth(this.viewDate, dir); this._trigger('changeMonth', this.viewDate); break; case 1: case 2: this.viewDate = this.moveYear(this.viewDate, dir); if (this.viewMode === 1) this._trigger('changeYear', this.viewDate); break; } this.fill(); break; case 'today': this.showMode(-2); var which = this.o.todayBtn === 'linked' ? null : 'view'; this._setDate(UTCToday(), which); break; case 'clear': this.clearDates(); break; } break; case 'span': if (!target.hasClass('disabled')){ this.viewDate.setUTCDate(1); if (target.hasClass('month')){ day = 1; month = target.parent().find('span').index(target); year = this.viewDate.getUTCFullYear(); this.viewDate.setUTCMonth(month); this._trigger('changeMonth', this.viewDate); if (this.o.minViewMode === 1){ this._setDate(UTCDate(year, month, day)); this.showMode(); } else { this.showMode(-1); } } else { day = 1; month = 0; year = parseInt(target.text(), 10)||0; this.viewDate.setUTCFullYear(year); this._trigger('changeYear', this.viewDate); if (this.o.minViewMode === 2){ this._setDate(UTCDate(year, month, day)); } this.showMode(-1); } this.fill(); } break; case 'td': if (target.hasClass('day') && !target.hasClass('disabled')){ day = parseInt(target.text(), 10)||1; year = this.viewDate.getUTCFullYear(); month = this.viewDate.getUTCMonth(); if (target.hasClass('old')){ if (month === 0){ month = 11; year -= 1; } else { month -= 1; } } else if (target.hasClass('new')){ if (month === 11){ month = 0; year += 1; } else { month += 1; } } this._setDate(UTCDate(year, month, day)); } break; } } if (this.picker.is(':visible') && this._focused_from){ $(this._focused_from).focus(); } delete this._focused_from; }, _toggle_multidate: function(date){ var ix = this.dates.contains(date); if (!date){ this.dates.clear(); } if (ix !== -1){ if (this.o.multidate === true || this.o.multidate > 1 || this.o.toggleActive){ this.dates.remove(ix); } } else if (this.o.multidate === false) { this.dates.clear(); this.dates.push(date); } else { this.dates.push(date); } if (typeof this.o.multidate === 'number') while (this.dates.length > this.o.multidate) this.dates.remove(0); }, _setDate: function(date, which){ if (!which || which === 'date') this._toggle_multidate(date && new Date(date)); if (!which || which === 'view') this.viewDate = date && new Date(date); this.fill(); this.setValue(); if (!which || which !== 'view') { this._trigger('changeDate'); } var element; if (this.isInput){ element = this.element; } else if (this.component){ element = this.element.find('input'); } if (element){ element.change(); } if (this.o.autoclose && (!which || which === 'date')){ this.hide(); } }, moveDay: function(date, dir){ var newDate = new Date(date); newDate.setUTCDate(date.getUTCDate() + dir); return newDate; }, moveWeek: function(date, dir){ return this.moveDay(date, dir * 7); }, moveMonth: function(date, dir){ if (!isValidDate(date)) return this.o.defaultViewDate; if (!dir) return date; var new_date = new Date(date.valueOf()), day = new_date.getUTCDate(), month = new_date.getUTCMonth(), mag = Math.abs(dir), new_month, test; dir = dir > 0 ? 1 : -1; if (mag === 1){ test = dir === -1 // If going back one month, make sure month is not current month // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02) ? function(){ return new_date.getUTCMonth() === month; } // If going forward one month, make sure month is as expected // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02) : function(){ return new_date.getUTCMonth() !== new_month; }; new_month = month + dir; new_date.setUTCMonth(new_month); // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11 if (new_month < 0 || new_month > 11) new_month = (new_month + 12) % 12; } else { // For magnitudes >1, move one month at a time... for (var i=0; i < mag; i++) // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)... new_date = this.moveMonth(new_date, dir); // ...then reset the day, keeping it in the new month new_month = new_date.getUTCMonth(); new_date.setUTCDate(day); test = function(){ return new_month !== new_date.getUTCMonth(); }; } // Common date-resetting loop -- if date is beyond end of month, make it // end of month while (test()){ new_date.setUTCDate(--day); new_date.setUTCMonth(new_month); } return new_date; }, moveYear: function(date, dir){ return this.moveMonth(date, dir*12); }, moveAvailableDate: function(date, dir, fn){ do { date = this[fn](date, dir); if (!this.dateWithinRange(date)) return false; fn = 'moveDay'; } while (this.dateIsDisabled(date)); return date; }, weekOfDateIsDisabled: function(date){ return $.inArray(date.getUTCDay(), this.o.daysOfWeekDisabled) !== -1; }, dateIsDisabled: function(date){ return ( this.weekOfDateIsDisabled(date) || $.grep(this.o.datesDisabled, function(d){ return isUTCEquals(date, d); }).length > 0 ); }, dateWithinRange: function(date){ return date >= this.o.startDate && date <= this.o.endDate; }, keydown: function(e){ if (!this.picker.is(':visible')){ if (e.keyCode === 40 || e.keyCode === 27) { // allow down to re-show picker this.show(); e.stopPropagation(); } return; } var dateChanged = false, dir, newViewDate, focusDate = this.focusDate || this.viewDate; switch (e.keyCode){ case 27: // escape if (this.focusDate){ this.focusDate = null; this.viewDate = this.dates.get(-1) || this.viewDate; this.fill(); } else this.hide(); e.preventDefault(); e.stopPropagation(); break; case 37: // left case 38: // up case 39: // right case 40: // down if (!this.o.keyboardNavigation || this.o.daysOfWeekDisabled.length === 7) break; dir = e.keyCode === 37 || e.keyCode === 38 ? -1 : 1; if (e.ctrlKey){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveYear'); if (newViewDate) this._trigger('changeYear', this.viewDate); } else if (e.shiftKey){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveMonth'); if (newViewDate) this._trigger('changeMonth', this.viewDate); } else if (e.keyCode === 37 || e.keyCode === 39){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveDay'); } else if (!this.weekOfDateIsDisabled(focusDate)){ newViewDate = this.moveAvailableDate(focusDate, dir, 'moveWeek'); } if (newViewDate){ this.focusDate = this.viewDate = newViewDate; this.setValue(); this.fill(); e.preventDefault(); } break; case 13: // enter if (!this.o.forceParse) break; focusDate = this.focusDate || this.dates.get(-1) || this.viewDate; if (this.o.keyboardNavigation) { this._toggle_multidate(focusDate); dateChanged = true; } this.focusDate = null; this.viewDate = this.dates.get(-1) || this.viewDate; this.setValue(); this.fill(); if (this.picker.is(':visible')){ e.preventDefault(); e.stopPropagation(); if (this.o.autoclose) this.hide(); } break; case 9: // tab this.focusDate = null; this.viewDate = this.dates.get(-1) || this.viewDate; this.fill(); this.hide(); break; } if (dateChanged){ if (this.dates.length) this._trigger('changeDate'); else this._trigger('clearDate'); var element; if (this.isInput){ element = this.element; } else if (this.component){ element = this.element.find('input'); } if (element){ element.change(); } } }, showMode: function(dir){ if (dir){ this.viewMode = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, this.viewMode + dir)); } this.picker .children('div') .hide() .filter('.datepicker-' + DPGlobal.modes[this.viewMode].clsName) .show(); this.updateNavArrows(); } }; var DateRangePicker = function(element, options){ $(element).data('datepicker', this); this.element = $(element); this.inputs = $.map(options.inputs, function(i){ return i.jquery ? i[0] : i; }); delete options.inputs; datepickerPlugin.call($(this.inputs), options) .on('changeDate', $.proxy(this.dateUpdated, this)); this.pickers = $.map(this.inputs, function(i){ return $(i).data('datepicker'); }); this.updateDates(); }; DateRangePicker.prototype = { updateDates: function(){ this.dates = $.map(this.pickers, function(i){ return i.getUTCDate(); }); this.updateRanges(); }, updateRanges: function(){ var range = $.map(this.dates, function(d){ return d.valueOf(); }); $.each(this.pickers, function(i, p){ p.setRange(range); }); }, dateUpdated: function(e){ // `this.updating` is a workaround for preventing infinite recursion // between `changeDate` triggering and `setUTCDate` calling. Until // there is a better mechanism. if (this.updating) return; this.updating = true; var dp = $(e.target).data('datepicker'); if (typeof(dp) === "undefined") { return; } var new_date = dp.getUTCDate(), i = $.inArray(e.target, this.inputs), j = i - 1, k = i + 1, l = this.inputs.length; if (i === -1) return; $.each(this.pickers, function(i, p){ if (!p.getUTCDate()) p.setUTCDate(new_date); }); if (new_date < this.dates[j]){ // Date being moved earlier/left while (j >= 0 && new_date < this.dates[j]){ this.pickers[j--].setUTCDate(new_date); } } else if (new_date > this.dates[k]){ // Date being moved later/right while (k < l && new_date > this.dates[k]){ this.pickers[k++].setUTCDate(new_date); } } this.updateDates(); delete this.updating; }, remove: function(){ $.map(this.pickers, function(p){ p.remove(); }); delete this.element.data().datepicker; } }; function opts_from_el(el, prefix){ // Derive options from element data-attrs var data = $(el).data(), out = {}, inkey, replace = new RegExp('^' + prefix.toLowerCase() + '([A-Z])'); prefix = new RegExp('^' + prefix.toLowerCase()); function re_lower(_,a){ return a.toLowerCase(); } for (var key in data) if (prefix.test(key)){ inkey = key.replace(replace, re_lower); out[inkey] = data[key]; } return out; } function opts_from_locale(lang){ // Derive options from locale plugins var out = {}; // Check if "de-DE" style date is available, if not language should // fallback to 2 letter code eg "de" if (!dates[lang]){ lang = lang.split('-')[0]; if (!dates[lang]) return; } var d = dates[lang]; $.each(locale_opts, function(i,k){ if (k in d) out[k] = d[k]; }); return out; } var old = $.fn.datepicker; var datepickerPlugin = function(option){ var args = Array.apply(null, arguments); args.shift(); var internal_return; this.each(function(){ var $this = $(this), data = $this.data('datepicker'), options = typeof option === 'object' && option; if (!data){ var elopts = opts_from_el(this, 'date'), // Preliminary otions xopts = $.extend({}, defaults, elopts, options), locopts = opts_from_locale(xopts.language), // Options priority: js args, data-attrs, locales, defaults opts = $.extend({}, defaults, locopts, elopts, options); if ($this.hasClass('input-daterange') || opts.inputs){ $.extend(opts, { inputs: opts.inputs || $this.find('input').toArray() }); data = new DateRangePicker(this, opts); } else { data = new Datepicker(this, opts); } $this.data('datepicker', data); } if (typeof option === 'string' && typeof data[option] === 'function'){ internal_return = data[option].apply(data, args); } }); if ( internal_return === undefined || internal_return instanceof Datepicker || internal_return instanceof DateRangePicker ) return this; if (this.length > 1) throw new Error('Using only allowed for the collection of a single element (' + option + ' function)'); else return internal_return; }; $.fn.datepicker = datepickerPlugin; var defaults = $.fn.datepicker.defaults = { autoclose: false, beforeShowDay: $.noop, beforeShowMonth: $.noop, beforeShowYear: $.noop, calendarWeeks: false, clearBtn: false, toggleActive: false, daysOfWeekDisabled: [], daysOfWeekHighlighted: [], datesDisabled: [], endDate: Infinity, forceParse: true, format: 'mm/dd/yyyy', keyboardNavigation: true, language: 'en', minViewMode: 0, maxViewMode: 2, multidate: false, multidateSeparator: ',', orientation: "auto", rtl: false, startDate: -Infinity, startView: 0, todayBtn: false, todayHighlight: false, weekStart: 0, disableTouchKeyboard: false, enableOnReadonly: true, showOnFocus: true, zIndexOffset: 10, container: 'body', immediateUpdates: false, title: '' }; var locale_opts = $.fn.datepicker.locale_opts = [ 'format', 'rtl', 'weekStart' ]; $.fn.datepicker.Constructor = Datepicker; var dates = $.fn.datepicker.dates = { en: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", clear: "Clear", titleFormat: "MM yyyy" } }; var DPGlobal = { modes: [ { clsName: 'days', navFnc: 'Month', navStep: 1 }, { clsName: 'months', navFnc: 'FullYear', navStep: 1 }, { clsName: 'years', navFnc: 'FullYear', navStep: 10 }], isLeapYear: function(year){ return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0)); }, getDaysInMonth: function(year, month){ return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; }, validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, parseFormat: function(format){ if (typeof format.toValue === 'function' && typeof format.toDisplay === 'function') return format; // IE treats \0 as a string end in inputs (truncating the value), // so it's a bad format delimiter, anyway var separators = format.replace(this.validParts, '\0').split('\0'), parts = format.match(this.validParts); if (!separators || !separators.length || !parts || parts.length === 0){ throw new Error("Invalid date format."); } return {separators: separators, parts: parts}; }, parseDate: function(date, format, language){ if (!date) return undefined; if (date instanceof Date) return date; if (typeof format === 'string') format = DPGlobal.parseFormat(format); if (format.toValue) return format.toValue(date, format, language); var part_re = /([\-+]\d+)([dmwy])/, parts = date.match(/([\-+]\d+)([dmwy])/g), fn_map = { d: 'moveDay', m: 'moveMonth', w: 'moveWeek', y: 'moveYear' }, part, dir, i, fn; if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)){ date = new Date(); for (i=0; i < parts.length; i++){ part = part_re.exec(parts[i]); dir = parseInt(part[1]); fn = fn_map[part[2]]; date = Datepicker.prototype[fn](date, dir); } return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()); } parts = date && date.match(this.nonpunctuation) || []; date = new Date(); var parsed = {}, setters_order = ['yyyy', 'yy', 'M', 'MM', 'm', 'mm', 'd', 'dd'], setters_map = { yyyy: function(d,v){ return d.setUTCFullYear(v); }, yy: function(d,v){ return d.setUTCFullYear(2000+v); }, m: function(d,v){ if (isNaN(d)) return d; v -= 1; while (v < 0) v += 12; v %= 12; d.setUTCMonth(v); while (d.getUTCMonth() !== v) d.setUTCDate(d.getUTCDate()-1); return d; }, d: function(d,v){ return d.setUTCDate(v); } }, val, filtered; setters_map['M'] = setters_map['MM'] = setters_map['mm'] = setters_map['m']; setters_map['dd'] = setters_map['d']; date = UTCToday(); var fparts = format.parts.slice(); // Remove noop parts if (parts.length !== fparts.length){ fparts = $(fparts).filter(function(i,p){ return $.inArray(p, setters_order) !== -1; }).toArray(); } // Process remainder function match_part(){ var m = this.slice(0, parts[i].length), p = parts[i].slice(0, m.length); return m.toLowerCase() === p.toLowerCase(); } if (parts.length === fparts.length){ var cnt; for (i=0, cnt = fparts.length; i < cnt; i++){ val = parseInt(parts[i], 10); part = fparts[i]; if (isNaN(val)){ switch (part){ case 'MM': filtered = $(dates[language].months).filter(match_part); val = $.inArray(filtered[0], dates[language].months) + 1; break; case 'M': filtered = $(dates[language].monthsShort).filter(match_part); val = $.inArray(filtered[0], dates[language].monthsShort) + 1; break; } } parsed[part] = val; } var _date, s; for (i=0; i < setters_order.length; i++){ s = setters_order[i]; if (s in parsed && !isNaN(parsed[s])){ _date = new Date(date); setters_map[s](_date, parsed[s]); if (!isNaN(_date)) date = _date; } } } return date; }, formatDate: function(date, format, language){ if (!date) return ''; if (typeof format === 'string') format = DPGlobal.parseFormat(format); if (format.toDisplay) return format.toDisplay(date, format, language); var val = { d: date.getUTCDate(), D: dates[language].daysShort[date.getUTCDay()], DD: dates[language].days[date.getUTCDay()], m: date.getUTCMonth() + 1, M: dates[language].monthsShort[date.getUTCMonth()], MM: dates[language].months[date.getUTCMonth()], yy: date.getUTCFullYear().toString().substring(2), yyyy: date.getUTCFullYear() }; val.dd = (val.d < 10 ? '0' : '') + val.d; val.mm = (val.m < 10 ? '0' : '') + val.m; date = []; var seps = $.extend([], format.separators); for (var i=0, cnt = format.parts.length; i <= cnt; i++){ if (seps.length) date.push(seps.shift()); date.push(val[format.parts[i]]); } return date.join(''); }, headTemplate: '<thead>'+ '<tr>'+ '<th colspan="7" class="datepicker-title"></th>'+ '</tr>'+ '<tr>'+ '<th class="prev"><i class="fa fa-angle-left"></i></th>'+ '<th colspan="5" class="datepicker-switch"></th>'+ '<th class="next"><i class="fa fa-angle-right"></i></th>'+ '</tr>'+ '</thead>', contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', footTemplate: '<tfoot>'+ '<tr>'+ '<th colspan="7" class="today"></th>'+ '</tr>'+ '<tr>'+ '<th colspan="7" class="clear"></th>'+ '</tr>'+ '</tfoot>' }; DPGlobal.template = '<div class="datepicker">'+ '<div class="datepicker-days">'+ '<table class=" table-condensed">'+ DPGlobal.headTemplate+ '<tbody></tbody>'+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-months">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '<div class="datepicker-years">'+ '<table class="table-condensed">'+ DPGlobal.headTemplate+ DPGlobal.contTemplate+ DPGlobal.footTemplate+ '</table>'+ '</div>'+ '</div>'; $.fn.datepicker.DPGlobal = DPGlobal; /* DATEPICKER NO CONFLICT * =================== */ $.fn.datepicker.noConflict = function(){ $.fn.datepicker = old; return this; }; /* DATEPICKER VERSION * =================== */ $.fn.datepicker.version = '1.5.1'; /* DATEPICKER DATA-API * ================== */ $(document).on( 'focus.datepicker.data-api click.datepicker.data-api', '[data-provide="datepicker"]', function(e){ var $this = $(this); if ($this.data('datepicker')) return; e.preventDefault(); // component click requires us to explicitly show it datepickerPlugin.call($this, 'show'); } ); $(function(){ datepickerPlugin.call($('[data-provide="datepicker-inline"]')); }); }));