Skip to content

Instantly share code, notes, and snippets.

@Shugabuga
Last active November 15, 2021 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shugabuga/f3dbfbbe9ea670480d140fe415696ac0 to your computer and use it in GitHub Desktop.
Save Shugabuga/f3dbfbbe9ea670480d140fe415696ac0 to your computer and use it in GitHub Desktop.
A BetterDiscord plugin for Shuga stickers.
/**
* @name EmoteReplacer
* @authorId 68834122860077056
* @version 1.11.2.1
* @website https://github.com/Yentis/betterdiscord-emotereplacer
* @source https://raw.githubusercontent.com/Yentis/betterdiscord-emotereplacer/master/EmoteReplacer.plugin.js
*/
module.exports = (() => {
const config = {
info: {
name: 'EmoteReplacer',
authors: [{
name: 'Yentis',
discord_id: '68834122860077056',
github_username: 'Yentis',
twitter_username: 'yentis178'
}, {
name: 'Shuga',
discord_id: '567168355421913095',
github_username: 'Shuga',
twitter_username: 'HeyItsShuga'
}],
version: '1.11.2.1',
description: 'Check for known emote names and replace them with an embedded image of the emote. Also supports modifiers similar to BetterDiscord\'s emotes. Standard emotes: https://yentis.github.io/emotes/, https://sticker.shuga.co/',
github: 'https://github.com/Yentis/betterdiscord-emotereplacer',
github_raw: 'https://raw.githubusercontent.com/Yentis/betterdiscord-emotereplacer/master/EmoteReplacer.plugin.js'
},
changelog: [{
title: 'Shuga Sticker Pack Support!',
type: 'fixed',
items: [
'Emotes now contact the Shuga Sticker Pack API.',
]
},{
title: 'Fixed',
type: 'fixed',
items: [
'----------1.11.2----------',
'Plugin not starting',
'----------1.11.0----------',
'Animated emotes being posted as PNGs instead of GIFs',
'Emotes disabled due to expired server boost could not be used'
]
}, {
title: 'Improved',
type: 'improved',
items: [
'----------1.11.0----------',
'Disable plugin in channels where images cannot be sent'
]
}, {
title: 'Added',
type: 'added',
items: [
'----------1.11.0----------',
'Modifier autocomplete window now has usage info'
]
}],
defaultConfig: [{
id: 'emoteSize',
value: 48
}, {
id: 'autocompleteEmoteSize',
value: 15
}, {
id: 'autocompleteItems',
value: 10
}, {
id: 'customEmotes',
value: {}
}, {
id: 'requirePrefix',
value: true
}, {
id: 'prefix',
value: ';'
}, {
id: 'resizeMethod',
value: 'smallest'
}]
};
if (!window.ZeresPluginLibrary) {
return class {
constructor() { this._config = config; }
getName() { return config.info.name; }
getAuthor() { return config.info.authors.map(a => a.name).join(', '); }
getDescription() { return config.info.description; }
getVersion() { return config.info.version; }
load() {
BdApi.showConfirmationModal(
'Library Missing',
`The library plugin needed for ${config.info.name} is missing. Please click Download Now to install it.`,
{
confirmText: 'Download Now',
cancelText: 'Cancel',
onConfirm: () => {
require('request').get('https://rauenzi.github.io/BDPluginLibrary/release/0PluginLibrary.plugin.js', async (err, _response, body) => {
if (err) {
return require('electron').shell.openExternal('https://betterdiscord.net/ghdl?url=https://raw.githubusercontent.com/rauenzi/BDPluginLibrary/master/release/0PluginLibrary.plugin.js');
}
await new Promise(r => require('fs').writeFile(require('path').join(BdApi.Plugins.folder, '0PluginLibrary.plugin.js'), body, r));
});
}
});
}
start() { }
stop() { }
}
}
const [Plugin, Api] = ZeresPluginLibrary.buildPlugin(config);
const { DiscordSelectors, Logger, Patcher, Settings, PluginUtilities } = Api;
const Buffer = require('buffer').Buffer;
const Uploader = BdApi.findModuleByProps('instantBatchUpload');
const ChannelStore = BdApi.findModuleByProps('getChannel', 'hasChannel');
const SelectedChannelStore = BdApi.findModuleByProps('getChannelId', 'getVoiceChannelId');
const Dispatcher = BdApi.findModuleByProps('dispatch', 'dirtyDispatch');
const Permissions = BdApi.findModuleByProps('getChannelPermissions');
const DiscordPermissions = BdApi.findModuleByProps('Permissions', 'ActivityTypes', 'StatusTypes').Permissions;
const baseGifsicleUrl = 'https://raw.githubusercontent.com/imagemin/gifsicle-bin/v4.0.1/vendor/';
return class EmoteReplacer extends Plugin {
DiscordClassModules = {};
listeners = [];
cached = {};
draft = '';
modifiers = [];
emoteNames = null;
canAttach = false;
onMessagesLoaded = null;
onChannelSelect = null;
constructor() {
super();
const Autocomplete = BdApi.findModuleByProps('autocomplete', 'autocompleteInner', 'autocompleteRowVertical');
const autocompleteAttached = BdApi.findModuleByProps('autocomplete', 'autocompleteAttached')
const Wrapper = BdApi.findModuleByProps('wrapper', 'base')
const Size = BdApi.findModuleByProps('size12')
this.DiscordClassModules = {
Autocomplete: {
...Autocomplete,
autocomplete: [
autocompleteAttached?.autocomplete,
autocompleteAttached?.autocompleteAttached,
Autocomplete?.autocomplete
].join(' ')
},
Wrapper,
Size
};
window.EmoteReplacer = {};
}
async onStart() {
Patcher.instead(
BdApi.findModuleByProps('sendMessage'),
'sendMessage',
(_, args, original) => this.onSendMessage(args, original)
);
Patcher.before(
BdApi.findModuleByProps('changeDraft'),
'changeDraft',
(_, args) => this.onChangeDraft(args)
);
Patcher.instead(
BdApi.findModuleByProps('deletePendingReply'),
'deletePendingReply',
(_, args, original) => this.onDeletePendingReply(args, original)
);
Patcher.after(
BdApi.findModuleByProps('getDisambiguatedEmojiContext'),
'search',
(_, _2, original) => this.onEmojiSearch(original)
);
const userId = await this.getUserId();
this.initChannelSubscription(userId);
this.enableLockedEmojis();
await BdApi.linkJS('pica', '//cdn.jsdelivr.net/gh/yentis/betterdiscord-emotereplacer@058ee1d1d00933e2a55545e9830d67549a8e354a/pica.js');
this.injectGifUtils();
Promise.all([
this.getEmoteNames(),
this.getModifiers()
]).then(results => {
this.setEmoteNames(results[0]);
this.modifiers = results[1];
if (this.getTextAreaField()) {
this.addListeners();
}
}).catch(err => Logger.warn('Failed to get emote names and/or modifiers', err));
const https = require('https');
const fs = require('fs');
const binFilename = process.platform === 'win32' ? 'gifsicle.exe' : 'gifsicle';
const gifsiclePath = BdApi.Plugins.folder + '/' + binFilename;
let gifsicleUrl;
switch (process.platform) {
case 'darwin':
gifsicleUrl = `${baseGifsicleUrl}macos/${binFilename}`;
break;
case 'linux':
case 'freebsd':
if (this.arch(fs) === 'x64') {
gifsicleUrl = `${baseGifsicleUrl}${process.platform}/x64/${binFilename}`;
} else {
gifsicleUrl = `${baseGifsicleUrl}${process.platform}/x86/${binFilename}`;
}
break;
case 'win32':
if (this.arch(fs) === 'x64') {
gifsicleUrl = `${baseGifsicleUrl}win/x64/${binFilename}`;
} else {
gifsicleUrl = `${baseGifsicleUrl}win/x86/${binFilename}`;
}
break;
default:
return;
}
this.gifsicle = gifsiclePath;
if (!fs.existsSync(gifsiclePath)) {
const file = fs.createWriteStream(gifsiclePath);
https.get(gifsicleUrl, (response) => {
response.pipe(file);
file.on('finish', () => {
file.close();
fs.chmodSync(gifsiclePath, '0777');
});
}).on('error', (err) => {
fs.unlink(gifsiclePath);
Logger.warn('Failed to get Gifsicle', err);
});
}
}
// https://github.com/feross/arch
arch(fs) {
// The running binary is 64-bit, so the OS is clearly 64-bit.
if (process.arch === 'x64') return 'x64'
// On Windows, the most reliable way to detect a 64-bit OS from within a 32-bit
// app is based on the presence of a WOW64 file: %SystemRoot%\SysNative.
// See: https://twitter.com/feross/status/776949077208510464
if (process.platform === 'win32') {
let useEnv = false
try {
useEnv = !!(process.env.SystemRoot && fs.statSync(process.env.SystemRoot))
} catch (err) {}
const sysRoot = useEnv ? process.env.SystemRoot : 'C:\\Windows'
// If %SystemRoot%\SysNative exists, we are in a WOW64 FS Redirected application.
let isWOW64 = false
try {
isWOW64 = !!fs.statSync(require('path').join(sysRoot, 'sysnative'))
} catch (err) {}
return isWOW64 ? 'x64' : 'x86'
}
// On Linux, use the `getconf` command to get the architecture.
if (process.platform === 'linux') {
const output = require('child_process').execSync('getconf LONG_BIT', { encoding: 'utf8' })
return output === '64\n' ? 'x64' : 'x86'
}
// If none of the above, assume the architecture is 32-bit.
return 'x86'
}
onStop() {
Patcher.unpatchAll();
if (this.onMessagesLoaded) {
Dispatcher.unsubscribe('LOAD_MESSAGES_SUCCESS', this.onMessagesLoaded);
this.onMessagesLoaded = null;
}
if (this.onChannelSelect) {
Dispatcher.unsubscribe('CHANNEL_SELECT', this.onChannelSelect);
this.onChannelSelect = null;
}
this.removeListeners();
BdApi.unlinkJS('pica');
window.EmoteReplacer = undefined;
this.draft = null;
this.cached = null;
this.emoteNames = null;
this.modifiers = null;
this.pendingUpload = null;
this.canAttach = false;
}
async onSendMessage(args, callDefault) {
const message = args[1];
if (!message) return callDefault(...args);
try {
const discordEmotes = this.getTargetEmoteFromMessage(message);
let content = message.content;
let foundEmote = this.getTextPos(content, { ...this.emoteNames, ...discordEmotes });
if (!foundEmote) return callDefault(...args);
if (!this.canAttach) {
BdApi.showToast('This channel does not allow sending images!', { type: 'error' });
return callDefault(...args);
}
content = content.substring(0, foundEmote.pos) + content.substring(foundEmote.pos + foundEmote.nameAndCommand.length);
content.trim();
foundEmote.content = content;
this.pendingUpload = true;
try {
this.pendingUpload = this.fetchBlobAndUpload(foundEmote);
await this.pendingUpload;
return;
} catch (error) {
BdApi.showToast(error.message || error, { type: 'error' });
if (content === '') return;
message.content = content;
} finally {
this.pendingUpload = null;
}
return callDefault(...args);
} catch (err) {
Logger.warn('Error in onSendMessage', err);
}
}
getTargetEmoteFromMessage(message) {
let emoji;
let validEmoji = false;
if (message.invalidEmojis?.length > 0) {
const count = message.invalidEmojis.length;
emoji = message.invalidEmojis[count - 1];
} else if (message.validNonShortcutEmojis?.length > 0) {
const count = message.validNonShortcutEmojis.length;
emoji = message.validNonShortcutEmojis[count - 1];
// Ignore built-in emotes
if (emoji.managed) return {};
validEmoji = emoji.available;
} else return {};
const emojiName = emoji.originalName || emoji.name;
const allNamesString = emoji.allNamesString.replace(emoji.name, emojiName);
const emojiText = `<${emoji.animated ? 'a' : ''}${allNamesString}${emoji.id}>`;
const result = {};
result[emojiText] = {
name: emojiName,
url: emoji.url.split('?')[0]
};
const foundEmote = this.getTextPos(message.content, result);
if (!foundEmote) return {};
// Only parse valid emojis if they contain commands
if (validEmoji && foundEmote.commands.length === 0) return {};
return result;
}
onChangeDraft(args) {
if (!this.canAttach) return;
const draft = args[1];
if (draft === undefined) return;
this.draft = draft;
try {
const { draft: lastText } = this.cached;
// If an emote match is impossible, don't override default behavior.
// This allows other completion types (like usernames or channels) to work as usual.
if (!this.shouldCompleteEmote(draft) && !this.shouldCompleteCommand(draft)) {
this.destroyCompletions();
return;
}
if (lastText !== draft) {
this.renderCompletions();
}
} catch (err) {
Logger.warn('Error in onChangeDraft', err);
}
}
async onDeletePendingReply(args, callDefault) {
try {
// Prevent Discord from deleting the pending reply until our emote has been uploaded
if (this.pendingUpload) await this.pendingUpload;
callDefault(...args);
} catch (err) {
Logger.warn('Error in onDeletePendingReply', err);
}
}
onEmojiSearch(result) {
if (!this.canAttach) return;
result.unlocked.push(...result.locked);
result.locked = [];
}
getUserId() {
return new Promise((resolve) => {
const getCurrentUser = BdApi.findModuleByProps('getCurrentUser').getCurrentUser;
let user = getCurrentUser();
if (user) {
const userId = user.id;
this.setCanAttach(SelectedChannelStore.getChannelId(), userId);
resolve(userId);
return;
}
// Not fully booted yet, wait for channel messages to load
this.onMessagesLoaded = (data) => {
user = getCurrentUser();
const userId = user.id;
this.setCanAttach(data.channelId, userId);
if (this.onMessagesLoaded) {
Dispatcher.unsubscribe('LOAD_MESSAGES_SUCCESS', this.onMessagesLoaded);
this.onMessagesLoaded = null;
}
resolve(userId);
};
Dispatcher.subscribe('LOAD_MESSAGES_SUCCESS', this.onMessagesLoaded);
});
}
initChannelSubscription(userId) {
this.onChannelSelect = (data) => {
this.setCanAttach(data.channelId, userId);
};
Dispatcher.subscribe('CHANNEL_SELECT', this.onChannelSelect);
}
setCanAttach(channelId, userId) {
if (!channelId) {
this.canAttach = true;
return;
}
const channel = ChannelStore.getChannel(channelId);
if (!channel?.guild_id) {
this.canAttach = true;
return;
}
this.canAttach = Permissions.can(DiscordPermissions.ATTACH_FILES, channel, userId);
}
enableLockedEmojis() {
const EmojiDisabledReasons = BdApi.findModuleByProps('EmojiDisabledReasons').EmojiDisabledReasons;
const EmojiStore = BdApi.findModuleByProps('getEmojiUnavailableReason');
Patcher.after(
EmojiStore,
'getEmojiUnavailableReason',
(_, _2, result) => {
if (
(result === EmojiDisabledReasons.PREMIUM_LOCKED ||
result === EmojiDisabledReasons.GUILD_SUBSCRIPTION_UNAVAILABLE) &&
this.canAttach
) { result = null; }
return result;
}
);
Patcher.after(
EmojiStore,
'isEmojiDisabled',
(_, args) => {
let reason = EmojiStore.getEmojiUnavailableReason({
emoji: args[0],
channel: args[1],
intention: args[2]
});
return reason !== null;
}
);
}
observer(e) {
if (!e.addedNodes.length || !(e.addedNodes[0] instanceof Element)) return;
let elem = e.addedNodes[0];
if (elem.querySelector(DiscordSelectors.Textarea.textArea)) {
this.addListeners();
}
}
onSwitch() {
this.destroyCompletions();
}
getSettingsPanel() {
const settings = [];
this.pushRegularSettings(settings);
let emoteName;
const emoteNameTextbox = new Settings.Textbox(
null,
'Emote name',
null,
(val) => { emoteName = val; }
);
let imageUrl;
const imageUrlTextbox = new Settings.Textbox(
null,
'Image URL (must end with .gif or .png, 128px recommended)',
null,
(val) => { imageUrl = val; }
);
const addButton = document.createElement('button');
addButton.type = 'button';
addButton.classList.add('bd-button');
addButton.textContent = 'Add';
const addSettingField = new Settings.SettingField(null, null, null, addButton);
const customEmotesContainer = document.createElement('div');
const addListener = {
element: addButton, name: 'click', callback: (_e) => {
if (!emoteName) {
BdApi.showToast('No emote name entered!', { type: 'error' });
return;
}
if (!imageUrl) {
BdApi.showToast('No image URL entered!', { type: 'error' });
return;
}
if (!imageUrl.endsWith('.gif') && !imageUrl.endsWith('.png')) {
BdApi.showToast('Image URL must end with .gif or .png!', { type: 'error' });
return;
}
if (this.emoteNames[this.getPrefixedName(emoteName)]) {
BdApi.showToast('Emote name already exists!', { type: 'error' });
return;
}
this.settings.customEmotes[emoteName] = imageUrl;
this.emoteNames[this.getPrefixedName(emoteName)] = imageUrl;
emoteNameTextbox.getElement().querySelector('input').value = '';
imageUrlTextbox.getElement().querySelector('input').value = '';
PluginUtilities.saveSettings(this.getName(), this.settings);
BdApi.showToast(`Emote ${emoteName} has been saved!`, { type: 'success' });
customEmotesContainer.append(this.createCustomEmoteContainer(emoteName, customEmotesContainer));
}
};
addButton.addEventListener(addListener.name, addListener.callback);
this.listeners.push(addListener);
Object.keys(this.settings.customEmotes).forEach((key) => {
customEmotesContainer.append(this.createCustomEmoteContainer(key, customEmotesContainer));
});
const customEmoteGroup = new Settings.SettingGroup('Custom emotes');
customEmoteGroup.append(emoteNameTextbox, imageUrlTextbox, addSettingField, customEmotesContainer);
settings.push(customEmoteGroup);
const refreshButton = document.createElement('button');
refreshButton.type = 'button';
refreshButton.classList.add('bd-button');
refreshButton.textContent = 'Refresh emote list';
const refreshSettingField = new Settings.SettingField(null, null, null, refreshButton);
const refreshListener = { element: refreshButton, name: 'click', callback: (_e) => { this.onRefreshClick() } };
refreshButton.addEventListener(refreshListener.name, refreshListener.callback);
this.listeners.push(refreshListener);
settings.push(refreshSettingField);
return Settings.SettingPanel
.build((_) => PluginUtilities.saveSettings(this.getName(), this.settings), ...settings);
}
pushRegularSettings(settings) {
settings.push(new Settings.Slider(
'Emote Size',
'The size of emotes. (default 48)',
32,
128,
this.settings.emoteSize,
(val) => { this.settings.emoteSize = Math.round(val); },
{ units: 'px', markers: [32, 48, 64, 96, 128] }
));
settings.push(new Settings.Slider(
'Autocomplete Emote Size',
'The size of emotes in the autocomplete window. (default 15)',
15,
64,
this.settings.autocompleteEmoteSize,
(val) => { this.settings.autocompleteEmoteSize = Math.round(val); },
{ units: 'px', markers: [15, 32, 48, 64] }
));
settings.push(new Settings.Slider(
'Autocomplete Items',
'The amount of emotes shown in the autocomplete window. (default 10)',
1,
25,
this.settings.autocompleteItems,
(val) => { this.settings.autocompleteItems = Math.round(val); },
{ units: ' items', markers: [1, 5, 10, 15, 20, 25] }
));
settings.push(new Settings.Switch(
'Require prefix',
'If this is enabled, the autocomplete list will not be shown unless the prefix is also typed.',
this.settings.requirePrefix,
(checked) => { this.settings.requirePrefix = checked; }
));
settings.push(new Settings.Textbox(
'Prefix',
'The prefix to check against for the above setting. It is recommended to use a single character not in use by other chat functionality, other prefixes may cause issues.',
this.settings.prefix,
_.debounce((val) => {
if (val === this.settings.prefix) return;
const previousPrefix = this.settings.prefix;
this.settings.prefix = val;
PluginUtilities.saveSettings(this.getName(), this.settings);
const previousEmoteNames = Object.assign({}, this.emoteNames);
this.emoteNames = {};
Object.keys(previousEmoteNames).forEach((emoteName) => {
const prefixedName = this.getPrefixedName(emoteName.replace(previousPrefix, ''));
this.emoteNames[prefixedName] = previousEmoteNames[emoteName];
});
}, 2000)
));
settings.push(new Settings.Dropdown(
'Resize Method',
'How emotes will be scaled down to fit your selected emote size',
this.settings.resizeMethod,
[ {
label: 'Scale down smallest side',
value: 'smallest'
}, {
label: 'Scale down largest side',
value: 'largest'
} ],
(val) => { this.settings.resizeMethod = val; }
));
}
shouldCompleteEmote(input) {
const prefix = this.settings.requirePrefix ? this.escapeRegExp(this.settings.prefix) : '';
return new RegExp("(?:^|\\s)" + prefix + "\\w{2,}$").test(input);
}
getRegexCommand() {
const prefix = this.settings.requirePrefix ? this.escapeRegExp(this.settings.prefix) : '';
return new RegExp("((?<!\\/)(?:" + prefix + "|<)[\\w:>]*\\.)([\\w\\.-]*)$");
}
shouldCompleteCommand(input) {
return this.getRegexCommand().test(input);
}
createCustomEmoteContainer(emoteName, container) {
const customEmoteContainer = document.createElement('div');
customEmoteContainer.style.display = 'flex';
const containerImage = document.createElement('img');
containerImage.src = this.settings.customEmotes[emoteName];
containerImage.alt = emoteName;
containerImage.title = emoteName;
containerImage.style.minWidth = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
containerImage.style.minHeight = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
containerImage.style.width = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
containerImage.style.height = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
containerImage.style.marginRight = '0.5rem';
customEmoteContainer.append(containerImage);
const deleteButton = document.createElement('button');
deleteButton.type = 'button';
deleteButton.classList.add('bd-button', 'bd-button-danger');
deleteButton.innerHTML = '<svg class="" fill="#FFFFFF" viewBox="0 0 24 24" style="width: 20px; height: 20px;"><path fill="none" d="M0 0h24v24H0V0z"></path><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"></path><path fill="none" d="M0 0h24v24H0z"></path></svg>';
customEmoteContainer.append(deleteButton);
const deleteListener = {
element: deleteButton, name: 'click', callback: (_e) => {
delete this.settings.customEmotes[emoteName];
delete this.emoteNames[this.getPrefixedName(emoteName)];
PluginUtilities.saveSettings(this.getName(), this.settings);
BdApi.showToast(`Emote ${emoteName} has been deleted!`, { type: 'success' });
container.querySelector(`#${emoteName}`).remove();
}
};
deleteButton.addEventListener(deleteListener.name, deleteListener.callback);
this.listeners.push(deleteListener);
const existingEmote = new Settings.SettingField(emoteName, this.settings.customEmotes[emoteName], null, customEmoteContainer, { noteOnTop: true });
existingEmote.getElement().id = emoteName;
return existingEmote.getElement();
}
getPrefixedName(name) {
if (name.toLowerCase().startsWith(this.settings.prefix)) {
name = name.replace(this.settings.prefix, '');
}
return `${this.settings.prefix}${name}`
}
getTextAreaContainer = () => {
return document.querySelector(DiscordSelectors.Textarea.channelTextArea);
}
getTextAreaField = () => {
return document.querySelector(DiscordSelectors.Textarea.textArea);
}
renderCompletions = _.debounce(() => {
const channelTextArea = this.getTextAreaContainer();
const oldAutoComplete = channelTextArea.querySelectorAll(`.${this.getName()}`);
const isEmote = this.shouldCompleteEmote(this.draft);
for (const autoComplete of oldAutoComplete) {
autoComplete.remove();
}
if ((!this.shouldCompleteEmote(this.draft) && !this.shouldCompleteCommand(this.draft)) || !this.prepareCompletions()) {
return;
}
const { completions, matchText, selectedIndex, windowOffset: firstIndex } = this.cached;
const matchList = completions.slice(firstIndex, firstIndex + Math.round(this.settings.autocompleteItems));
const autocompleteDiv = document.createElement('div');
this.addClasses(autocompleteDiv, this.DiscordClassModules.Autocomplete.autocomplete, this.getName());
const autocompleteListener = { element: autocompleteDiv, name: 'wheel', callback: (e) => { this.scrollCompletions(e, { locked: true }) } }
autocompleteDiv.addEventListener(autocompleteListener.name, autocompleteListener.callback);
this.listeners.push(autocompleteListener);
channelTextArea.append(autocompleteDiv);
const autocompleteInnerDiv = document.createElement('div');
this.addClasses(autocompleteInnerDiv, this.DiscordClassModules.Autocomplete.autocompleteInner);
autocompleteDiv.append(autocompleteInnerDiv);
const titleRow = document.createElement('div');
this.addClasses(titleRow, this.DiscordClassModules.Autocomplete.autocompleteRowVertical);
autocompleteInnerDiv.append(titleRow);
const selector = document.createElement('div');
this.addClasses(selector, this.DiscordClassModules.Autocomplete.base);
titleRow.append(selector);
const contentTitle = document.createElement('h3');
this.addClasses(contentTitle, this.DiscordClassModules.Autocomplete.contentTitle, this.DiscordClassModules.Wrapper.base, this.DiscordClassModules.Size.size12);
contentTitle.innerText = isEmote ? 'Emoji matching ' : 'Commands ';
selector.append(contentTitle);
const matchTextElement = document.createElement('strong');
matchTextElement.textContent = matchText;
contentTitle.append(matchTextElement);
for (let i = 0; i < matchList.length; i++) {
const name = matchList[i][0];
const data = matchList[i][1];
const emoteRow = document.createElement('div');
this.addClasses(emoteRow, this.DiscordClassModules.Autocomplete.autocompleteRowVertical, this.DiscordClassModules.Autocomplete.autocompleteRowVerticalSmall);
const mouseEnterListener = {
element: emoteRow, name: 'mouseenter', callback: (_e) => {
this.cached.selectedIndex = i + firstIndex;
for (const child of titleRow.parentElement.children) {
for (const nestedChild of child.children) {
this.removeClasses(nestedChild, this.DiscordClassModules.Autocomplete.selected);
this.addClasses(nestedChild, this.DiscordClassModules.Autocomplete.base, this.DiscordClassModules.Autocomplete.selectable);
}
}
this.addClasses(emoteSelector, this.DiscordClassModules.Autocomplete.selected);
}
};
emoteRow.addEventListener(mouseEnterListener.name, mouseEnterListener.callback);
this.listeners.push(mouseEnterListener);
const mouseDownListener = {
element: emoteRow, name: 'mousedown', callback: (e) => {
// Prevent loss of focus
e.preventDefault();
this.cached.selectedIndex = i + firstIndex;
this.insertSelectedCompletion();
}
}
emoteRow.addEventListener(mouseDownListener.name, mouseDownListener.callback);
this.listeners.push(mouseDownListener);
autocompleteInnerDiv.append(emoteRow);
const emoteSelector = document.createElement('div');
this.addClasses(emoteSelector, this.DiscordClassModules.Autocomplete.base, this.DiscordClassModules.Autocomplete.selectable);
emoteRow.append(emoteSelector);
if (i + firstIndex === selectedIndex) {
this.addClasses(emoteSelector, this.DiscordClassModules.Autocomplete.selected);
}
const emoteContainer = document.createElement('div');
this.addClasses(emoteContainer, this.DiscordClassModules.Autocomplete.autocompleteRowContent);
emoteSelector.append(emoteContainer);
if (isEmote) {
const containerIcon = document.createElement('div');
this.addClasses(containerIcon, this.DiscordClassModules.Autocomplete.autocompleteRowIcon);
emoteContainer.append(containerIcon);
const containerImage = document.createElement('img');
containerImage.src = data;
containerImage.alt = name;
containerImage.title = name;
containerImage.style.minWidth = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
containerImage.style.minHeight = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
containerImage.style.width = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
containerImage.style.height = `${Math.round(this.settings.autocompleteEmoteSize)}px`;
this.addClasses(containerImage, this.DiscordClassModules.Autocomplete.emojiImage);
containerIcon.append(containerImage);
}
const containerContent = document.createElement('div');
containerContent.style.color = 'var(--interactive-active)';
this.addClasses(containerContent, this.DiscordClassModules.Autocomplete.autocompleteRowContentPrimary);
emoteContainer.append(containerContent);
if (isEmote || !data.info) {
containerContent.textContent = name;
} else {
containerContent.style.display = 'flex';
containerContent.style.flexDirection = 'column';
const containerContentName = document.createElement('span');
containerContentName.style.paddingBottom = '0.5em';
containerContentName.textContent = name;
containerContent.append(containerContentName);
const containerContentInfo = document.createElement('span');
containerContentInfo.style.color = 'var(--interactive-normal)';
containerContentInfo.textContent = data.info;
containerContent.append(containerContentInfo);
}
}
}, 250)
addClasses(element, ...classes) {
for (const curClass of classes) {
const split = curClass.split(' ');
for (const curClassItem of split) {
element.classList.add(curClassItem);
}
}
}
removeClasses(element, ...classes) {
for (const curClass of classes) {
const split = curClass.split(' ');
for (const curClassItem of split) {
element.classList.remove(curClassItem);
}
}
}
onRefreshClick() {
this.emoteNames = null;
BdApi.showToast('Reloading emote database...', { type: 'info' });
this.getEmoteNames()
.then((names) => {
this.setEmoteNames(names);
BdApi.showToast('Emote database reloaded!', { type: 'success' });
});
}
addListeners() {
let textArea = this.getTextAreaField();
if (textArea === undefined) return;
this.removeListeners();
const keydownListener = { element: textArea, name: 'keydown', callback: (e) => { this.browseCompletions(e) } };
textArea.addEventListener(keydownListener.name, keydownListener.callback);
this.listeners.push(keydownListener);
const wheelListener = { element: textArea, name: 'wheel', callback: (e) => { this.scrollCompletions(e) } };
textArea.addEventListener(wheelListener.name, wheelListener.callback);
this.listeners.push(wheelListener);
const blurListener = { element: textArea, name: 'blur', callback: (_e) => { this.destroyCompletions() } };
textArea.addEventListener(blurListener.name, blurListener.callback);
this.listeners.push(blurListener);
}
removeListeners() {
let textArea = this.getTextAreaField();
if (textArea === undefined) return;
for (const listener of this.listeners) {
if (!listener.element) continue;
listener.element.removeEventListener(listener.name, listener.callback);
}
this.listeners = [];
}
// getEmoteNames() {
// return new Promise((resolve, reject) => {
// require('https').get('https://raw.githubusercontent.com/Yentis/yentis.github.io/master/emotes/emotes.json', (res) => {
// let data = '';
// res.on('data', (chunk) => {
// data += chunk;
// });
// res.on('end', () => {
// if (res.statusCode !== 0 && (res.statusCode < 200 || res.statusCode >= 400)) {
// reject(new Error(res.statusMessage));
// return;
// }
// const emoteNames = JSON.parse(data);
// Object.keys(emoteNames).forEach((key) => {
// let split = emoteNames[key].split('.');
// let name = split[0];
// emoteNames[name] = 'https://raw.githubusercontent.com/Yentis/yentis.github.io/master/emotes/images/' + key + '.' + split[1];
// });
// resolve(emoteNames);
// });
// }).on('error', (error) => {
// reject(error);
// });
// });
// }
getEmoteNamesHelper(apiEndpoint, imageEndpoint) {
return new Promise((resolve, reject) => {
require('https').get(apiEndpoint, (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
if (res.statusCode !== 0 && (res.statusCode < 200 || res.statusCode >= 400)) {
reject(new Error(res.statusMessage));
return;
}
const emoteNames = JSON.parse(data);
Object.keys(emoteNames).forEach((key) => {
let split = emoteNames[key].split('.');
let name = split[0];
emoteNames[name] = imageEndpoint + key + '.' + split[1];
});
resolve(emoteNames);
});
}).on('error', (error) => {
reject(error);
});
});
}
getEmoteNames() {
return new Promise((resolve, reject) => {
this.getEmoteNamesHelper('https://raw.githubusercontent.com/Yentis/yentis.github.io/master/emotes/emotes.json', 'https://raw.githubusercontent.com/Yentis/yentis.github.io/master/emotes/images/').then(resp1 => {
this.getEmoteNamesHelper('https://sticker.shuga.co/bd_api.json', 'https://sticker.shuga.co/').then(resp2 => {
let finalObj = {};
Object.keys(resp1).forEach(key => {
finalObj[key] = resp1[key]
})
Object.keys(resp2).forEach(key => {
finalObj[key] = resp2[key]
})
resolve(finalObj)
})
})
})
}
setEmoteNames(emoteNames) {
const customEmotes = {};
Object.keys(this.settings.customEmotes).forEach((emoteName) => {
customEmotes[this.getPrefixedName(emoteName)] = this.settings.customEmotes[emoteName];
});
const standardNames = {};
Object.keys(emoteNames).forEach((emoteName) => {
const prefixedName = this.getPrefixedName(emoteName);
standardNames[prefixedName] = emoteNames[emoteName];
});
this.emoteNames = { ...standardNames, ...customEmotes };
}
getModifiers() {
return new Promise((resolve, reject) => {
require('https').get('https://raw.githubusercontent.com/Yentis/betterdiscord-emotereplacer/master/modifiers.json', (res) => {
let data = '';
res.on('data', (chunk) => {
data += chunk;
});
res.on('end', () => {
if (res.statusCode !== 0 && (res.statusCode < 200 || res.statusCode >= 400)) {
reject(new Error(res.statusMessage));
return;
}
resolve(JSON.parse(data));
});
}).on('error', (error) => {
reject(error);
});
});
}
getGifModifiers() {
let gifModifiers = [];
this.modifiers.forEach(modifier => {
if (modifier.type === 'gif') {
gifModifiers.push(modifier.name);
}
});
return gifModifiers;
}
browseCompletions(e) {
if (!this.shouldCompleteEmote(this.draft) && !this.shouldCompleteCommand(this.draft)) {
return;
}
let delta = 0, options;
const autocompleteItems = Math.round(this.settings.autocompleteItems);
switch (e.which) {
// Tab
case 9:
// Enter
case 13:
if (!this.prepareCompletions()) {
break;
}
// Prevent Discord's default behavior (send message)
e.stopPropagation();
// Prevent adding a tab or line break to text
e.preventDefault();
this.insertSelectedCompletion();
break;
// Up
case 38:
delta = -1;
break;
// Down
case 40:
delta = 1;
break;
// Page Up
case 33:
delta = -autocompleteItems;
options = { locked: true, clamped: true };
break;
// Page Down
case 34:
delta = autocompleteItems;
options = { locked: true, clamped: true };
break;
}
if (delta !== 0 && this.prepareCompletions()) {
// Prevent Discord's default behavior
e.stopPropagation();
// Prevent cursor movement
e.preventDefault();
this.scrollWindow(delta, options);
}
}
scrollLockedCompletions(e) {
this.scrollCompletions(e, { locked: true })
}
scrollCompletions(e, options) {
const delta = Math.sign(e.deltaY);
this.scrollWindow(delta, options);
}
scrollWindow(delta, { locked = false, clamped = false } = {}) {
if (!this.cached) return;
const preScroll = 2;
const { completions, selectedIndex: prevSel, windowOffset } = this.cached;
const autocompleteItems = Math.round(this.settings.autocompleteItems);
if (completions === undefined || completions.length === 0) {
return;
}
// Change selected index
const num = completions.length;
let sel = prevSel + delta;
if (clamped) {
sel = _.clamp(sel, 0, num - 1);
} else {
sel = (sel % num) + (sel < 0 ? num : 0);
}
this.cached.selectedIndex = sel;
// Clamp window position to bounds based on new selected index
const boundLower = _.clamp(sel + preScroll - (autocompleteItems - 1), 0, num - autocompleteItems);
const boundUpper = _.clamp(sel - preScroll, 0, num - autocompleteItems);
this.cached.windowOffset = _.clamp(windowOffset + (locked ? delta : 0), boundLower, boundUpper);
// Render immediately
this.renderCompletions();
this.renderCompletions.flush();
}
insertSelectedCompletion() {
const { completions, matchText, selectedIndex } = this.cached;
if (completions === undefined) {
return;
}
for (let i = 0; i < matchText?.length || 0; i++) {
document.execCommand('delete');
}
let selectedCompletion = completions[selectedIndex];
let suffix = ' ';
if (selectedCompletion[1].arguments) {
const argumentOptional = selectedCompletion[1].arguments.some((argument) => {
return argument === '';
});
if (!argumentOptional) suffix = '-';
}
selectedCompletion[0] += suffix;
document.execCommand('insertText', false, selectedCompletion[0]);
this.destroyCompletions();
}
destroyCompletions() {
const textAreaContainer = this.getTextAreaContainer();
if (textAreaContainer) {
for (const completion of this.getTextAreaContainer().querySelectorAll(`.${this.getName()}`)) {
completion.remove();
}
}
this.cached = {};
this.renderCompletions.cancel();
}
prepareCompletions() {
if (!this.cached) return false;
const candidateText = this.draft;
const { candidateText: lastText } = this.cached;
if (lastText !== candidateText) {
if (this.shouldCompleteEmote(candidateText)) {
const { completions, matchText, matchStart } = this.getCompletionsEmote(candidateText);
this.cached = { candidateText, completions, matchText, matchStart, selectedIndex: 0, windowOffset: 0 };
} else if (this.shouldCompleteCommand(candidateText)) {
const { completions, matchText, matchStart } = this.getCompletionsCommands(candidateText);
this.cached = { candidateText, completions, matchText, matchStart, selectedIndex: 0, windowOffset: 0 };
}
}
const { completions } = this.cached;
return (completions !== undefined && completions.length !== 0);
}
getCompletionsEmote(text) {
const prefix = this.settings.requirePrefix ? this.escapeRegExp(this.settings.prefix) : '';
const match = text.match(new RegExp("(^|\\s)(" + prefix + "\\w{2,})$"));
if (match === null) {
return { completions: [], matchText: null, matchStart: -1 };
}
let emoteArray = [];
for (let key in this.emoteNames) {
if (this.emoteNames.hasOwnProperty(key)) {
emoteArray.push([key, this.emoteNames[key]]);
}
}
const matchText = match[2];
const completions = emoteArray
.filter((emote) => {
const matchWithoutPrefix = matchText.startsWith(this.settings.prefix) ? matchText.replace(this.settings.prefix, '') : matchText;
if (emote[0].toLowerCase().search(matchWithoutPrefix) !== -1) {
return emote;
}
});
const matchStart = match.index + match[1].length;
return { completions, matchText, matchStart };
}
escapeRegExp(input) {
return input.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
getCompletionsCommands(text) {
const regex = this.getRegexCommand();
const match = text.match(regex);
if (match === null) {
return { completions: [], matchText: null, matchStart: -1 };
}
const commandPart = match[2].substring(match[2].lastIndexOf('.') + 1);
let commandArray = [];
this.modifiers.forEach((modifier, index) => {
commandArray.push([modifier.name, this.modifiers[index]]);
});
const completions = commandArray.filter((command) => {
return commandPart === '' || command[0].toLowerCase().search(commandPart) !== -1
});
const matchText = commandPart;
const matchStart = match.index + match[0].length;
return { completions, matchText, matchStart };
}
getTextPos(value, emoteCandidates) {
let foundEmotes = [];
for (let key of Object.keys(emoteCandidates)) {
let regex = new RegExp('(?<!\\/)' + key + '(?<=\\b|>)', 'g');
let regexCommand = new RegExp(key + '(\\.\\S{4,}\\b)+');
let matches = value.match(regex);
let command = value.match(regexCommand);
if (!matches || matches.length === 0) continue;
for (let i = 0; i < matches.length; i++) {
let pos = this.getNthIndexOf(value, key, i);
let emote = {
name: emoteCandidates[key].name || key,
nameAndCommand: key,
url: emoteCandidates[key].url || emoteCandidates[key],
emoteLength: key.length,
pos: pos,
spoiler: false,
commands: []
};
if (command) {
let commands = command[0].split('.');
emote.commands = commands
.filter((command) => command !== key)
.map(command => {
let split = command.split('-');
return [split[0], split[1] || null];
});
emote.nameAndCommand = command[0];
}
let beforeEmote = value.substring(0, pos);
let afterEmote = value.substring(pos + emote.nameAndCommand.length);
if (beforeEmote.includes('||') && afterEmote.includes('||')) {
let spoilerStart = beforeEmote.substring(beforeEmote.indexOf('||'))
emote.nameAndCommand = spoilerStart + emote.nameAndCommand;
emote.pos -= spoilerStart.length;
let spoilerEnd = afterEmote.substring(0, afterEmote.indexOf('||') + 2);
emote.nameAndCommand = emote.nameAndCommand + spoilerEnd;
emote.spoiler = true;
}
if (!beforeEmote.includes('`') || !afterEmote.includes('`')) {
foundEmotes.push(emote);
}
}
}
if (foundEmotes.length > 0) {
return foundEmotes.pop();
}
}
getNthIndexOf(input, search, nth) {
let firstIndex = input.indexOf(search);
let startPos = firstIndex + search.length;
if (nth == 0) {
return firstIndex;
} else {
let inputAfterFirstOccurrence = input.substring(startPos);
let nextOccurrence = this.getNthIndexOf(inputAfterFirstOccurrence, search, nth - 1);
if (nextOccurrence === -1) {
return -1;
} else {
return startPos + nextOccurrence;
}
}
}
fetchBlobAndUpload(emote) {
let url = emote.url, name = emote.name, commands = emote.commands ? emote.commands : [];
emote.channel = SelectedChannelStore.getChannelId();
if (url.endsWith('.gif') || this.findCommand(commands, this.getGifModifiers())) {
return this.getMetaAndModifyGif(emote);
}
return new Promise((resolve, reject) => {
require('https').get(url, (res) => {
const contentType = res.headers['content-type'] || '';
if (!contentType.startsWith('image')) {
reject(new Error('Emote URL was not an image'));
return;
}
const size = res.headers['content-length'] || 0;
if (size === 0) {
reject(new Error('Emote URL did not contain data'));
return;
}
const data = [];
res.on('data', (chunk) => {
data.push(chunk);
});
res.on('end', () => {
const buffer = Buffer.concat(data);
this.compress(new Blob([buffer], { type: contentType }), commands, (resultBlob) => {
this.uploadFile(resultBlob, name + '.png', emote);
resolve();
});
});
}).on('error', (error) => {
reject(error);
});
});
}
findCommand(commands, names) {
let found = false;
if (commands.length > 0) {
commands.forEach(command => {
names.forEach(name => {
if (command[0] === name) found = command;
})
});
}
return found;
}
getMetaAndModifyGif(emote) {
return new Promise((resolve, reject) => {
let url = emote.url, commands = emote.commands;
let image = new Image();
image.onload = async () => {
this.addResizeCommand(commands, image);
BdApi.showToast('Processing gif...', { type: 'info' });
try {
const buffer = await window.EmoteReplacer.GifUtils.modifyGif({ url: url, options: commands, gifsiclePath: this.gifsicle });
if (buffer.length === 0) throw Error('Failed to process gif');
this.uploadFile(buffer, emote.name + '.gif', emote);
resolve();
} catch (error) {
reject(error);
}
};
image.onerror = () => {
reject(new Error('Failed to load image'));
};
image.src = url;
})
}
addResizeCommand(commands, image) {
const scaleFactor = this.getScaleFactor(image, commands);
let wideCommand = this.findCommand(commands, ['wide']);
if (wideCommand) {
let wideness = this.getEmoteWideness(wideCommand);
scaleFactor = (scaleFactor * wideness) + 'x' + scaleFactor;
}
commands.push(['resize', scaleFactor]);
}
getScaleFactor(image, commands) {
const size = this.getEmoteSize(commands);
let scaleFactor;
if (this.settings.resizeMethod === 'largest') {
if (image.width > image.height) {
scaleFactor = size / image.width;
} else scaleFactor = size / image.height;
} else {
if (image.width < image.height) {
scaleFactor = size / image.width;
} else scaleFactor = size / image.height;
}
return scaleFactor;
}
getEmoteSize(commands) {
let resizeCommand;
let size;
commands.forEach((command, index, object) => {
if (command[0] === 'resize') {
resizeCommand = command;
object.splice(index, 1);
}
});
if (resizeCommand && resizeCommand[1]) {
size = resizeCommand[1];
} else {
size = Math.round(this.settings.emoteSize);
}
if (size === 'large' || size === 'big') {
return 128;
} else if (size === 'medium' || size === 'normal') {
return 64;
} else if (!isNaN(size)) {
return Math.min(Math.max(size, 32), 128);
} else {
return 48;
}
}
uploadFile(fileData, fullName, emote) {
// 1 = channel ID
// 2 = File
// 3 = no idea, this is usually 0
// 4 = message
// 5 = spoiler
// 6 = filename
Uploader.upload(
emote.channel,
new File([fileData], fullName),
0,
{ content: emote.content, invalidEmojis: [], tts: false },
emote.spoiler,
fullName
);
}
compress(originalFile, commands, callback) {
const reader = new FileReader();
reader.readAsDataURL(originalFile);
reader.onload = event => {
const img = new Image();
img.src = event.target.result;
img.onload = () => {
this.applyScaling(img, commands)
.then((canvas) => {
let ctx = canvas.getContext('2d');
ctx.canvas.toBlob(callback, 'image/png', 1);
});
};
};
reader.onerror = err => {
Logger.warn('Failed to compress image', err);
callback();
};
}
applyScaling(image, commands) {
return new Promise((resolve) => {
const scaleFactor = this.getScaleFactor(image, commands);
let canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = image.height;
let resizedCanvas = document.createElement('canvas');
if (commands.length > 0) {
canvas = this.applyCommands(image, canvas, commands);
} else {
canvas.getContext('2d').drawImage(image, 0, 0);
}
resizedCanvas.width = Math.ceil(canvas.width * scaleFactor);
resizedCanvas.height = Math.ceil(canvas.height * scaleFactor);
window.EmoteReplacer.pica.resize(canvas, resizedCanvas, { alpha: true, unsharpAmount: 70, unsharpRadius: 0.8, unsharpThreshold: 105 })
.then(result => resolve(result));
});
}
applyCommands(image, canvas, commands) {
let scaleH = 1,
scaleV = 1,
posX = 0,
posY = 0;
if (this.findCommand(commands, ['flip'])) {
scaleH = -1; // Set horizontal scale to -1 if flip horizontal
posX = canvas.width * -1; // Set x position to -100% if flip horizontal
}
if (this.findCommand(commands, ['flap'])) {
scaleV = -1; // Set vertical scale to -1 if flip vertical
posY = canvas.height * -1; // Set y position to -100% if flip vertical
}
let ctx = canvas.getContext('2d');
let wideCommand = this.findCommand(commands, ['wide']);
if (wideCommand) {
let wideness = this.getEmoteWideness(wideCommand);
image.width = image.width * wideness;
canvas.width = canvas.width * wideness;
}
let rotateCommand = this.findCommand(commands, ['rotate']);
if (rotateCommand) {
let angle = parseInt(rotateCommand[1]) * Math.PI / 180,
sin = Math.sin(angle),
cos = Math.cos(angle);
let newWidth = Math.abs(canvas.width * cos) + Math.abs(canvas.height * sin);
let newHeight = Math.abs(canvas.width * sin) + Math.abs(canvas.height * cos);
canvas.width = newWidth;
canvas.height = newHeight;
ctx.translate(canvas.width / 2, canvas.height / 2);
ctx.rotate(angle);
posX = -image.width / 2;
posY = -image.height / 2;
}
ctx.scale(scaleH, scaleV); // Set scale to flip the image
ctx.drawImage(image, posX, posY, image.width, image.height); // draw the image
return canvas;
};
getEmoteWideness(wideCommand) {
let param = wideCommand[1];
if (!isNaN(param)) {
return Math.max(Math.min(param, 8), 2);
} else if (param === 'extreme') {
return 8;
} else if (param === 'huge') {
return 6;
} else if (param === 'big') {
return 4;
} else {
return 2;
}
}
injectGifUtils() {
(()=>{var t={7228:t=>{t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=new Array(e);i<e;i++)r[i]=t[i];return r},t.exports.default=t.exports,t.exports.__esModule=!0},2858:t=>{t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},3646:(t,e,i)=>{var r=i(7228);t.exports=function(t){if(Array.isArray(t))return r(t)},t.exports.default=t.exports,t.exports.__esModule=!0},1506:t=>{t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0},4575:t=>{t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},9100:(t,e,i)=>{var r=i(9489),n=i(7067);function a(e,i,o){return n()?(t.exports=a=Reflect.construct,t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=a=function(t,e,i){var n=[null];n.push.apply(n,e);var a=new(Function.bind.apply(t,n));return i&&r(a,i.prototype),a},t.exports.default=t.exports,t.exports.__esModule=!0),a.apply(null,arguments)}t.exports=a,t.exports.default=t.exports,t.exports.__esModule=!0},3913:t=>{function e(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t},t.exports.default=t.exports,t.exports.__esModule=!0},9713:t=>{t.exports=function(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.default=t.exports,t.exports.__esModule=!0},7154:t=>{function e(){return t.exports=e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},t.exports.default=t.exports,t.exports.__esModule=!0,e.apply(this,arguments)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},9754:t=>{function e(i){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,e(i)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},2205:(t,e,i)=>{var r=i(9489);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},5318:t=>{t.exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.default=t.exports,t.exports.__esModule=!0},862:(t,e,i)=>{var r=i(8).default;function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}t.exports=function(t){if(t&&t.__esModule)return t;if(null===t||"object"!==r(t)&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var s=a?Object.getOwnPropertyDescriptor(t,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=t[o]}return i.default=t,e&&e.set(t,i),i},t.exports.default=t.exports,t.exports.__esModule=!0},7067:t=>{t.exports=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}},t.exports.default=t.exports,t.exports.__esModule=!0},6860:t=>{t.exports=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)},t.exports.default=t.exports,t.exports.__esModule=!0},3884:t=>{t.exports=function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],r=!0,n=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(i.push(o.value),!e||i.length!==e);r=!0);}catch(t){n=!0,a=t}finally{try{r||null==s.return||s.return()}finally{if(n)throw a}}return i}},t.exports.default=t.exports,t.exports.__esModule=!0},521:t=>{t.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.")},t.exports.default=t.exports,t.exports.__esModule=!0},8206:t=>{t.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.")},t.exports.default=t.exports,t.exports.__esModule=!0},8585:(t,e,i)=>{var r=i(8).default,n=i(1506);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?n(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},9489:t=>{function e(i,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,e(i,r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},3038:(t,e,i)=>{var r=i(2858),n=i(3884),a=i(379),o=i(521);t.exports=function(t,e){return r(t)||n(t,e)||a(t,e)||o()},t.exports.default=t.exports,t.exports.__esModule=!0},319:(t,e,i)=>{var r=i(3646),n=i(6860),a=i(379),o=i(8206);t.exports=function(t){return r(t)||n(t)||a(t)||o()},t.exports.default=t.exports,t.exports.__esModule=!0},8:t=>{function e(i){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(i)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0},379:(t,e,i)=>{var r=i(7228);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},7757:(t,e,i)=>{t.exports=i(5666)},2878:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(9713)),a=r(i(784)),o=i(1567),s="image/bmp",h="image/x-ms-bmp",u=function(t){return e=a.default.decode(t),(0,o.scan)({bitmap:e},0,0,e.width,e.height,(function(t,i,r){var n=this.bitmap.data[r+0],a=this.bitmap.data[r+1],o=this.bitmap.data[r+2],s=this.bitmap.data[r+3];this.bitmap.data[r+0]=s,this.bitmap.data[r+1]=o,this.bitmap.data[r+2]=a,this.bitmap.data[r+3]=e.is_with_alpha?n:255})).bitmap;var e},l=function(t){return a.default.encode(function(t){return(0,o.scan)(t,0,0,t.bitmap.width,t.bitmap.height,(function(t,e,i){var r=this.bitmap.data[i+0],n=this.bitmap.data[i+1],a=this.bitmap.data[i+2],o=this.bitmap.data[i+3];this.bitmap.data[i+0]=o,this.bitmap.data[i+1]=a,this.bitmap.data[i+2]=n,this.bitmap.data[i+3]=r})).bitmap}(t)).data};e.default=function(){var t,e;return{mime:(0,n.default)({},s,["bmp"]),constants:{MIME_BMP:s,MIME_X_MS_BMP:h},decoders:(t={},(0,n.default)(t,s,u),(0,n.default)(t,h,u),t),encoders:(e={},(0,n.default)(e,s,l),(0,n.default)(e,h,l),e)}}},4096:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.srcOver=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=(t.r*t.a+e.r*e.a*(1-t.a))/r,a=(t.g*t.a+e.g*e.a*(1-t.a))/r,o=(t.b*t.a+e.b*e.a*(1-t.a))/r;return{r:n,g:a,b:o,a:r}},e.dstOver=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=(e.r*e.a+t.r*t.a*(1-e.a))/r,a=(e.g*e.a+t.g*t.a*(1-e.a))/r,o=(e.b*e.a+t.b*t.a*(1-e.a))/r;return{r:n,g:a,b:o,a:r}},e.multiply=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(n*s+n*(1-e.a)+s*(1-t.a))/r,c=(a*h+a*(1-e.a)+h*(1-t.a))/r,f=(o*u+o*(1-e.a)+u*(1-t.a))/r;return{r:l,g:c,b:f,a:r}},e.screen=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(n*e.a+s*t.a-n*s+n*(1-e.a)+s*(1-t.a))/r,c=(a*e.a+h*t.a-a*h+a*(1-e.a)+h*(1-t.a))/r,f=(o*e.a+u*t.a-o*u+o*(1-e.a)+u*(1-t.a))/r;return{r:l,g:c,b:f,a:r}},e.overlay=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(2*s<=e.a?2*n*s+n*(1-e.a)+s*(1-t.a):n*(1+e.a)+s*(1+t.a)-2*s*n-e.a*t.a)/r,c=(2*h<=e.a?2*a*h+a*(1-e.a)+h*(1-t.a):a*(1+e.a)+h*(1+t.a)-2*h*a-e.a*t.a)/r,f=(2*u<=e.a?2*o*u+o*(1-e.a)+u*(1-t.a):o*(1+e.a)+u*(1+t.a)-2*u*o-e.a*t.a)/r;return{r:l,g:c,b:f,a:r}},e.darken=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(Math.min(n*e.a,s*t.a)+n*(1-e.a)+s*(1-t.a))/r,c=(Math.min(a*e.a,h*t.a)+a*(1-e.a)+h*(1-t.a))/r,f=(Math.min(o*e.a,u*t.a)+o*(1-e.a)+u*(1-t.a))/r;return{r:l,g:c,b:f,a:r}},e.lighten=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(Math.max(n*e.a,s*t.a)+n*(1-e.a)+s*(1-t.a))/r,c=(Math.max(a*e.a,h*t.a)+a*(1-e.a)+h*(1-t.a))/r,f=(Math.max(o*e.a,u*t.a)+o*(1-e.a)+u*(1-t.a))/r;return{r:l,g:c,b:f,a:r}},e.hardLight=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(2*n<=t.a?2*n*s+n*(1-e.a)+s*(1-t.a):n*(1+e.a)+s*(1+t.a)-2*s*n-e.a*t.a)/r,c=(2*a<=t.a?2*a*h+a*(1-e.a)+h*(1-t.a):a*(1+e.a)+h*(1+t.a)-2*h*a-e.a*t.a)/r,f=(2*o<=t.a?2*o*u+o*(1-e.a)+u*(1-t.a):o*(1+e.a)+u*(1+t.a)-2*u*o-e.a*t.a)/r;return{r:l,g:c,b:f,a:r}},e.difference=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(n+s-2*Math.min(n*e.a,s*t.a))/r,c=(a+h-2*Math.min(a*e.a,h*t.a))/r,f=(o+u-2*Math.min(o*e.a,u*t.a))/r;return{r:l,g:c,b:f,a:r}},e.exclusion=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t.a*=i;var r=e.a+t.a-e.a*t.a,n=t.r*t.a,a=t.g*t.a,o=t.b*t.a,s=e.r*e.a,h=e.g*e.a,u=e.b*e.a,l=(n*e.a+s*t.a-2*n*s+n*(1-e.a)+s*(1-t.a))/r,c=(a*e.a+h*t.a-2*a*h+a*(1-e.a)+h*(1-t.a))/r,f=(o*e.a+u*t.a-2*o*u+o*(1-e.a)+u*(1-t.a))/r;return{r:l,g:c,b:f,a:r}}},8859:(t,e,i)=>{"use strict";var r=i(862);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=arguments.length>4?arguments[4]:void 0;if("function"==typeof r&&(s=r,r={}),!(t instanceof this.constructor))return n.throwError.call(this,"The source must be a Jimp image",s);if("number"!=typeof e||"number"!=typeof i)return n.throwError.call(this,"x and y must be numbers",s);var h=r,u=h.mode,l=h.opacitySource,c=h.opacityDest;u||(u=a.BLEND_SOURCE_OVER),("number"!=typeof l||l<0||l>1)&&(l=1),("number"!=typeof c||c<0||c>1)&&(c=1);var f=o[u];e=Math.round(e),i=Math.round(i);var p=this;return 1!==c&&p.opacity(c),t.scanQuiet(0,0,t.bitmap.width,t.bitmap.height,(function(t,r,n){var o=p.getPixelIndex(e+t,i+r,a.EDGE_CROP),s=f({r:this.bitmap.data[n+0]/255,g:this.bitmap.data[n+1]/255,b:this.bitmap.data[n+2]/255,a:this.bitmap.data[n+3]/255},{r:p.bitmap.data[o+0]/255,g:p.bitmap.data[o+1]/255,b:p.bitmap.data[o+2]/255,a:p.bitmap.data[o+3]/255},l);p.bitmap.data[o+0]=this.constructor.limit255(255*s.r),p.bitmap.data[o+1]=this.constructor.limit255(255*s.g),p.bitmap.data[o+2]=this.constructor.limit255(255*s.b),p.bitmap.data[o+3]=this.constructor.limit255(255*s.a)})),(0,n.isNodePattern)(s)&&s.call(this,null,this),this};var n=i(1567),a=r(i(9215)),o=r(i(4096))},9215:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EDGE_CROP=e.EDGE_WRAP=e.EDGE_EXTEND=e.BLEND_EXCLUSION=e.BLEND_DIFFERENCE=e.BLEND_HARDLIGHT=e.BLEND_LIGHTEN=e.BLEND_DARKEN=e.BLEND_OVERLAY=e.BLEND_SCREEN=e.BLEND_MULTIPLY=e.BLEND_DESTINATION_OVER=e.BLEND_SOURCE_OVER=e.VERTICAL_ALIGN_BOTTOM=e.VERTICAL_ALIGN_MIDDLE=e.VERTICAL_ALIGN_TOP=e.HORIZONTAL_ALIGN_RIGHT=e.HORIZONTAL_ALIGN_CENTER=e.HORIZONTAL_ALIGN_LEFT=e.AUTO=void 0,e.AUTO=-1,e.HORIZONTAL_ALIGN_LEFT=1,e.HORIZONTAL_ALIGN_CENTER=2,e.HORIZONTAL_ALIGN_RIGHT=4,e.VERTICAL_ALIGN_TOP=8,e.VERTICAL_ALIGN_MIDDLE=16,e.VERTICAL_ALIGN_BOTTOM=32,e.BLEND_SOURCE_OVER="srcOver",e.BLEND_DESTINATION_OVER="dstOver",e.BLEND_MULTIPLY="multiply",e.BLEND_SCREEN="screen",e.BLEND_OVERLAY="overlay",e.BLEND_DARKEN="darken",e.BLEND_LIGHTEN="lighten",e.BLEND_HARDLIGHT="hardLight",e.BLEND_DIFFERENCE="difference",e.BLEND_EXCLUSION="exclusion",e.EDGE_EXTEND=1,e.EDGE_WRAP=2,e.EDGE_CROP=3},5859:(t,e,i)=>{"use strict";var r=i(862),n=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.addConstants=W,e.addJimpMethods=q,e.jimpEvMethod=V,e.jimpEvChange=Y,Object.defineProperty(e,"addType",{enumerable:!0,get:function(){return P.addType}}),e.default=void 0;for(var a=n(i(9100)),o=n(i(3038)),s=n(i(4575)),h=n(i(3913)),u=n(i(8585)),l=n(i(9754)),c=n(i(1506)),f=n(i(2205)),p=n(i(9713)),d=n(i(8)),m=n(i(5747)),g=n(i(5622)),b=n(i(8614)),v=i(1567),y=n(i(964)),_=n(i(1890)),w=n(i(148)),x=n(i(7621)),E=n(i(3547)),I=n(i(7967)),M=n(i(8859)),k=n(i(4388)),P=r(i(9658)),T=i(5915),S=r(i(9215)),A="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",O=[NaN,NaN],C=2;C<65;C++){var D=(0,y.default)(y.default.BIN,A.slice(0,C))(new Array(65).join("1"));O.push(D.length)}function B(){}function N(t){return Object.prototype.toString.call(t).toLowerCase().indexOf("arraybuffer")>-1}function L(t){for(var e=Buffer.alloc(t.byteLength),i=new Uint8Array(t),r=0;r<e.length;++r)e[r]=i[r];return e}function R(t,e){(0,I.default)(t,(function(i,r,n){if(i)return e(i);if("headers"in r&&"location"in r.headers)return t.url=r.headers.location,R(t,e);if("object"===(0,d.default)(n)&&Buffer.isBuffer(n))return e(null,n);var a="Could not load Buffer from <"+t.url+"> (HTTP: "+r.statusCode+")";return new Error(a)}))}function F(t,e){m.default&&"function"==typeof m.default.readFile&&!t.match(/^(http|ftp)s?:\/\/./)?m.default.readFile(t,e):R({url:t},e)}function z(t){return t&&"object"===(0,d.default)(t)&&"number"==typeof t.width&&"number"==typeof t.height&&(Buffer.isBuffer(t.data)||t.data instanceof Uint8Array||"function"==typeof Uint8ClampedArray&&t.data instanceof Uint8ClampedArray)&&(t.data.length===t.width*t.height*4||t.data.length===t.width*t.height*3)}function G(t){if(t.length%3!=0)throw new Error("Buffer length is incorrect");for(var e=Buffer.allocUnsafe(t.length/3*4),i=0,r=0;r<t.length;r++)e[i]=t[r],(r+1)%3==0&&(e[++i]=255),i++;return e}var U,j={data:null,width:null,height:null},H=function(t){function e(){for(var t,i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];(0,s.default)(this,e),t=(0,u.default)(this,(0,l.default)(e).call(this)),(0,p.default)((0,c.default)(t),"bitmap",j),(0,p.default)((0,c.default)(t),"_background",0),(0,p.default)((0,c.default)(t),"_originalMime",e.MIME_PNG),(0,p.default)((0,c.default)(t),"_exif",null),(0,p.default)((0,c.default)(t),"_rgba",!0),(0,p.default)((0,c.default)(t),"writeAsync",(function(e){return(0,k.default)(t.write,(0,c.default)(t),e)})),(0,p.default)((0,c.default)(t),"getBase64Async",(function(e){return(0,k.default)(t.getBase64,(0,c.default)(t),e)})),(0,p.default)((0,c.default)(t),"getBuffer",T.getBuffer),(0,p.default)((0,c.default)(t),"getBufferAsync",T.getBufferAsync),(0,p.default)((0,c.default)(t),"getPixelColour",t.getPixelColor),(0,p.default)((0,c.default)(t),"setPixelColour",t.setPixelColor);var a=(0,c.default)(t),o=B;function h(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var r=e[0],n=r||{};n.methodName="constructor",setTimeout((function(){var t;r&&o===B?a.emitError("constructor",r):r||a.emitMulti("constructor","initialized"),(t=o).call.apply(t,[a].concat(e))}),1)}if(N(r[0])&&(r[0]=L(r[0])),"number"==typeof r[0]&&"number"==typeof r[1]||parseInt(r[0],10)&&parseInt(r[1],10)){var f=parseInt(r[0],10),m=parseInt(r[1],10);if(o=r[2],"number"==typeof r[2]&&(t._background=r[2],o=r[3]),"string"==typeof r[2]&&(t._background=e.cssColorToHex(r[2]),o=r[3]),void 0===o&&(o=B),"function"!=typeof o)return(0,u.default)(t,v.throwError.call((0,c.default)(t),"cb must be a function",h));t.bitmap={data:Buffer.alloc(f*m*4),width:f,height:m};for(var g=0;g<t.bitmap.data.length;g+=4)t.bitmap.data.writeUInt32BE(t._background,g);h(null,(0,c.default)(t))}else if("object"===(0,d.default)(r[0])&&r[0].url){if("function"!=typeof(o=r[1]||B))return(0,u.default)(t,v.throwError.call((0,c.default)(t),"cb must be a function",h));R(r[0],(function(e,i){if(e)return v.throwError.call((0,c.default)(t),e,h);t.parseBitmap(i,r[0].url,h)}))}else if(r[0]instanceof e){var b=r[0];if(void 0===(o=r[1])&&(o=B),"function"!=typeof o)return(0,u.default)(t,v.throwError.call((0,c.default)(t),"cb must be a function",h));t.bitmap={data:Buffer.from(b.bitmap.data),width:b.bitmap.width,height:b.bitmap.height},t._quality=b._quality,t._deflateLevel=b._deflateLevel,t._deflateStrategy=b._deflateStrategy,t._filterType=b._filterType,t._rgba=b._rgba,t._background=b._background,t._originalMime=b._originalMime,h(null,(0,c.default)(t))}else if(z(r[0])){var y=r[0];o=r[1]||B;var _=y.width*y.height*4===y.data.length,w=_?Buffer.from(y.data):G(y.data);t.bitmap={data:w,width:y.width,height:y.height},h(null,(0,c.default)(t))}else if("string"==typeof r[0]){var x=r[0];if(void 0===(o=r[1])&&(o=B),"function"!=typeof o)return(0,u.default)(t,v.throwError.call((0,c.default)(t),"cb must be a function",h));F(x,(function(e,i){if(e)return v.throwError.call((0,c.default)(t),e,h);t.parseBitmap(i,x,h)}))}else if("object"===(0,d.default)(r[0])&&Buffer.isBuffer(r[0])){var E=r[0];if("function"!=typeof(o=r[1]))return(0,u.default)(t,v.throwError.call((0,c.default)(t),"cb must be a function",h));t.parseBitmap(E,null,h)}else{"function"!=typeof(o=r[r.length-1])&&"function"!=typeof(o=r[r.length-2])&&(o=B);var I=e.__extraConstructors.find((function(t){return t.test.apply(t,r)}));if(!I)return(0,u.default)(t,v.throwError.call((0,c.default)(t),"No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor.",h));new Promise((function(e,i){var n;return(n=I.run).call.apply(n,[(0,c.default)(t),e,i].concat(r))})).then((function(){return h(null,(0,c.default)(t))})).catch(h)}return t}return(0,f.default)(e,t),(0,h.default)(e,[{key:"parseBitmap",value:function(t,e,i){T.parseBitmap.call(this,t,null,i)}},{key:"rgba",value:function(t,e){return"boolean"!=typeof t?v.throwError.call(this,"bool must be a boolean, true for RGBA or false for RGB",e):(this._rgba=t,(0,v.isNodePattern)(e)&&e.call(this,null,this),this)}},{key:"emitMulti",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i=Object.assign(i,{methodName:t,eventName:e}),this.emit("any",i),t&&this.emit(t,i),this.emit(e,i)}},{key:"emitError",value:function(t,e){this.emitMulti(t,"error",e)}},{key:"getHeight",value:function(){return this.bitmap.height}},{key:"getWidth",value:function(){return this.bitmap.width}},{key:"inspect",value:function(){return"<Jimp "+(this.bitmap===j?"pending...":this.bitmap.width+"x"+this.bitmap.height)+">"}},{key:"toString",value:function(){return"[object Jimp]"}},{key:"getMIME",value:function(){return this._originalMime||e.MIME_PNG}},{key:"getExtension",value:function(){var t=this.getMIME();return P.getExtension(t)}},{key:"write",value:function(t,e){var i=this;if(!m.default||!m.default.createWriteStream)throw new Error("Cant access the filesystem. You can use the getBase64 method.");if("string"!=typeof t)return v.throwError.call(this,"path must be a string",e);if(void 0===e&&(e=B),"function"!=typeof e)return v.throwError.call(this,"cb must be a function",e);var r=P.getType(t)||this.getMIME(),n=g.default.parse(t);return n.dir&&_.default.sync(n.dir),this.getBuffer(r,(function(r,n){if(r)return v.throwError.call(i,r,e);var a=m.default.createWriteStream(t);a.on("open",(function(){a.write(n),a.end()})).on("error",(function(t){return v.throwError.call(i,t,e)})),a.on("finish",(function(){e.call(i,null,i)}))})),this}},{key:"getBase64",value:function(t,i){return t===e.AUTO&&(t=this.getMIME()),"string"!=typeof t?v.throwError.call(this,"mime must be a string",i):"function"!=typeof i?v.throwError.call(this,"cb must be a function",i):(this.getBuffer(t,(function(e,r){if(e)return v.throwError.call(this,e,i);var n="data:"+t+";base64,"+r.toString("base64");i.call(this,null,n)})),this)}},{key:"hash",value:function(t,e){if("function"==typeof(t=t||64)&&(e=t,t=64),"number"!=typeof t)return v.throwError.call(this,"base must be a number",e);if(t<2||t>64)return v.throwError.call(this,"base must be a number between 2 and 64",e);var i=this.pHash();for(i=(0,y.default)(y.default.BIN,A.slice(0,t))(i);i.length<O[t];)i="0"+i;return(0,v.isNodePattern)(e)&&e.call(this,null,i),i}},{key:"pHash",value:function(){return(new E.default).getHash(this)}},{key:"distanceFromHash",value:function(t){var e=new E.default,i=e.getHash(this);return e.distance(i,t)}},{key:"getPixelIndex",value:function(t,i,r,n){var a,o;if("function"==typeof r&&void 0===n&&(n=r,r=null),r||(r=e.EDGE_EXTEND),"number"!=typeof t||"number"!=typeof i)return v.throwError.call(this,"x and y must be numbers",n);a=t=Math.round(t),o=i=Math.round(i),r===e.EDGE_EXTEND&&(t<0&&(a=0),t>=this.bitmap.width&&(a=this.bitmap.width-1),i<0&&(o=0),i>=this.bitmap.height&&(o=this.bitmap.height-1)),r===e.EDGE_WRAP&&(t<0&&(a=this.bitmap.width+t),t>=this.bitmap.width&&(a=t%this.bitmap.width),i<0&&(a=this.bitmap.height+i),i>=this.bitmap.height&&(o=i%this.bitmap.height));var s=this.bitmap.width*o+a<<2;return(a<0||a>=this.bitmap.width)&&(s=-1),(o<0||o>=this.bitmap.height)&&(s=-1),(0,v.isNodePattern)(n)&&n.call(this,null,s),s}},{key:"getPixelColor",value:function(t,e,i){if("number"!=typeof t||"number"!=typeof e)return v.throwError.call(this,"x and y must be numbers",i);t=Math.round(t),e=Math.round(e);var r=this.getPixelIndex(t,e),n=this.bitmap.data.readUInt32BE(r);return(0,v.isNodePattern)(i)&&i.call(this,null,n),n}},{key:"setPixelColor",value:function(t,e,i,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof i)return v.throwError.call(this,"hex, x and y must be numbers",r);e=Math.round(e),i=Math.round(i);var n=this.getPixelIndex(e,i);return this.bitmap.data.writeUInt32BE(t,n),(0,v.isNodePattern)(r)&&r.call(this,null,this),this}},{key:"hasAlpha",value:function(){for(var t=0;t<this.bitmap.height;t++)for(var e=0;e<this.bitmap.width;e++){var i=this.bitmap.width*t+e<<2;if(255!==this.bitmap.data[i+3])return!0}return!1}},{key:"scanIterator",value:function(t,e,i,r){return"number"!=typeof t||"number"!=typeof e?v.throwError.call(this,"x and y must be numbers"):"number"!=typeof i||"number"!=typeof r?v.throwError.call(this,"w and h must be numbers"):(0,v.scanIterator)(this,t,e,i,r)}}]),e}(b.default);function W(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H;Object.entries(t).forEach((function(t){var i=(0,o.default)(t,2),r=i[0],n=i[1];e[r]=n}))}function q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H;Object.entries(t).forEach((function(t){var i=(0,o.default)(t,2),r=i[0],n=i[1];e.prototype[r]=n}))}function V(t,e,i){var r="before-"+e,n=e.replace(/e$/,"")+"ed";H.prototype[t]=function(){for(var e,a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var h,u=o[i.length-1],l=this;"function"==typeof u?(e=function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];var a=i[0],o=i[1];a?l.emitError(t,a):l.emitMulti(t,n,(0,p.default)({},t,o)),u.apply(this,i)},o[o.length-1]=e):e=!1,this.emitMulti(t,r);try{h=i.apply(this,o),e||this.emitMulti(t,n,(0,p.default)({},t,h))}catch(e){e.methodName=t,this.emitError(t,e)}return h},H.prototype[t+"Quiet"]=i}function Y(t,e){V(t,"change",e)}W(S),q({composite:M.default}),H.__extraConstructors=[],H.appendConstructorOption=function(t,e,i){H.__extraConstructors.push({name:t,test:e,run:i})},H.read=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return new Promise((function(t,i){(0,a.default)(H,e.concat([function(e,r){e?i(e):t(r)}]))}))},H.create=H.read,H.rgbaToInt=function(t,e,i,r,n){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof i||"number"!=typeof r)return v.throwError.call(this,"r, g, b and a must be numbers",n);if(t<0||t>255)return v.throwError.call(this,"r must be between 0 and 255",n);if((e<0||e>255)&&v.throwError.call(this,"g must be between 0 and 255",n),i<0||i>255)return v.throwError.call(this,"b must be between 0 and 255",n);if(r<0||r>255)return v.throwError.call(this,"a must be between 0 and 255",n);t=Math.round(t),i=Math.round(i),e=Math.round(e),r=Math.round(r);var a=t*Math.pow(256,3)+e*Math.pow(256,2)+i*Math.pow(256,1)+r*Math.pow(256,0);return(0,v.isNodePattern)(n)&&n.call(this,null,a),a},H.intToRGBA=function(t,e){if("number"!=typeof t)return v.throwError.call(this,"i must be a number",e);var i={};return i.r=Math.floor(t/Math.pow(256,3)),i.g=Math.floor((t-i.r*Math.pow(256,3))/Math.pow(256,2)),i.b=Math.floor((t-i.r*Math.pow(256,3)-i.g*Math.pow(256,2))/Math.pow(256,1)),i.a=Math.floor((t-i.r*Math.pow(256,3)-i.g*Math.pow(256,2)-i.b*Math.pow(256,1))/Math.pow(256,0)),(0,v.isNodePattern)(e)&&e.call(this,null,i),i},H.cssColorToHex=function(t){return"number"==typeof(t=t||0)?Number(t):parseInt((0,x.default)(t).toHex8(),16)},H.limit255=function(t){return t=Math.max(t,0),Math.min(t,255)},H.diff=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1;if(!(t instanceof H&&e instanceof H))return v.throwError.call(this,"img1 and img2 must be an Jimp images");var r=t.bitmap,n=e.bitmap;if(r.width===n.width&&r.height===n.height||(r.width*r.height>n.width*n.height?t=t.cloneQuiet().resize(n.width,n.height):e=e.cloneQuiet().resize(r.width,r.height)),"number"!=typeof i||i<0||i>1)return v.throwError.call(this,"threshold must be a number between 0 and 1");var a=new H(r.width,r.height,4294967295),o=(0,w.default)(r.data,n.data,a.bitmap.data,a.bitmap.width,a.bitmap.height,{threshold:i});return{percent:o/(a.bitmap.width*a.bitmap.height),image:a}},H.distance=function(t,e){var i=new E.default,r=i.getHash(t),n=i.getHash(e);return i.distance(r,n)},H.compareHashes=function(t,e){return(new E.default).distance(t,e)},H.colorDiff=function(t,e){var i=function(t){return Math.pow(t,2)},r=Math.max;return 0===t.a||t.a||(t.a=255),0===e.a||e.a||(e.a=255),(r(i(t.r-e.r),i(t.r-e.r-t.a+e.a))+r(i(t.g-e.g),i(t.g-e.g-t.a+e.a))+r(i(t.b-e.b),i(t.b-e.b-t.a+e.a)))/195075},V("clone","clone",(function(t){var e=new H(this);return(0,v.isNodePattern)(t)&&t.call(e,null,e),e})),Y("background",(function(t,e){return"number"!=typeof t?v.throwError.call(this,"hex must be a hexadecimal rgba value",e):(this._background=t,(0,v.isNodePattern)(e)&&e.call(this,null,this),this)})),Y("scan",(function(t,e,i,r,n,a){if("number"!=typeof t||"number"!=typeof e)return v.throwError.call(this,"x and y must be numbers",a);if("number"!=typeof i||"number"!=typeof r)return v.throwError.call(this,"w and h must be numbers",a);if("function"!=typeof n)return v.throwError.call(this,"f must be a function",a);var o=(0,v.scan)(this,t,e,i,r,n);return(0,v.isNodePattern)(a)&&a.call(this,null,o),o})),"BROWSER"===process.env.ENVIRONMENT&&("undefined"!=typeof window&&"object"===("undefined"==typeof window?"undefined":(0,d.default)(window))&&(U=window),"undefined"!=typeof self&&"object"===("undefined"==typeof self?"undefined":(0,d.default)(self))&&(U=self),U.Jimp=H,U.Buffer=Buffer);var Q=H;e.default=Q},3547:t=>{"use strict";function e(t,e){this.size=this.size||t,this.smallerSize=this.smallerSize||e,function(t){for(var e=1;e<t;e++)i[e]=1;i[0]=1/Math.sqrt(2)}(this.size)}e.prototype.size=32,e.prototype.smallerSize=8,e.prototype.distance=function(t,e){for(var i=0,r=0;r<t.length;r++)t[r]!==e[r]&&i++;return i/t.length},e.prototype.getHash=function(t){(t=t.clone().resize(this.size,this.size)).grayscale();for(var e=[],r=0;r<t.bitmap.width;r++){e[r]=[];for(var n=0;n<t.bitmap.height;n++)e[r][n]=(a=t.getPixelColor(r,n),o=void 0,o={},o.r=Math.floor(a/Math.pow(256,3)),o.g=Math.floor((a-o.r*Math.pow(256,3))/Math.pow(256,2)),o.b=Math.floor((a-o.r*Math.pow(256,3)-o.g*Math.pow(256,2))/Math.pow(256,1)),o.a=Math.floor((a-o.r*Math.pow(256,3)-o.g*Math.pow(256,2)-o.b*Math.pow(256,1))/Math.pow(256,0)),o).b}for(var a,o,s=function(t,e){for(var r=e,n=[],a=0;a<r;a++){n[a]=[];for(var o=0;o<r;o++){for(var s=0,h=0;h<r;h++)for(var u=0;u<r;u++)s+=Math.cos((2*h+1)/(2*r)*a*Math.PI)*Math.cos((2*u+1)/(2*r)*o*Math.PI)*t[h][u];s*=i[a]*i[o]/4,n[a][o]=s}}return n}(e,this.size),h=0,u=0;u<this.smallerSize;u++)for(var l=0;l<this.smallerSize;l++)h+=s[u][l];for(var c=h/(this.smallerSize*this.smallerSize),f="",p=0;p<this.smallerSize;p++)for(var d=0;d<this.smallerSize;d++)f+=s[p][d]>c?"1":"0";return f};var i=[];t.exports=e},7967:(t,e,i)=>{"use strict";var r=i(5318),n=r(i(9713)),a=r(i(7154));function o(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}process.browser||"BROWSER"===process.env.ENVIRONMENT||void 0!==process.versions.electron&&"renderer"===process.type&&"function"==typeof XMLHttpRequest?t.exports=function(t,e){var i=new XMLHttpRequest;i.open("GET",t.url,!0),i.responseType="arraybuffer",i.addEventListener("load",(function(){if(i.status<400)try{var r=Buffer.from(this.response);e(null,i,r)}catch(i){return e(new Error("Response is not a buffer for url "+t.url+". Error: "+i.message))}else e(new Error("HTTP Status "+i.status+" for url "+t.url))})),i.addEventListener("error",(function(t){e(t)})),i.send()}:t.exports=function(t,e){var r=(0,a.default)({},t);i(193)(function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?o(i,!0).forEach((function(e){(0,n.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):o(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({compression:!0},r),(function(t,i){null===t?e(null,i,i.body):e(t)}))}},5915:(t,e,i)=>{"use strict";var r=i(862),n=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.parseBitmap=function(t,e,i){var r=function(t,e){var i=(0,o.default)(t);return i?i.mime:e?l.getType(e):null}(t,e);if("string"!=typeof r)return i(new Error("Could not find MIME for Buffer <"+e+">"));this._originalMime=r.toLowerCase();try{var n=this.getMIME();if(!this.constructor.decoders[n])return h.throwError.call(this,"Unsupported MIME type: "+n,i);this.bitmap=this.constructor.decoders[n](t)}catch(t){return i.call(this,t,this)}try{this._exif=s.default.create(t).parse(),function(t){if(!(f(t)<2)){var e=function(t){var e=t.getWidth(),i=t.getHeight();switch(f(t)){case 1:return null;case 2:return function(t,i){return[e-t-1,i]};case 3:return function(t,r){return[e-t-1,i-r-1]};case 4:return function(t,e){return[t,i-e-1]};case 5:return function(t,e){return[e,t]};case 6:return function(t,e){return[e,i-t-1]};case 7:return function(t,r){return[e-r-1,i-t-1]};case 8:return function(t,i){return[e-i-1,t]};default:return null}}(t),i=f(t)>4;!function(t,e,i,r){for(var n=t.bitmap.data,o=t.bitmap.width,s=Buffer.alloc(n.length),h=0;h<e;h++)for(var u=0;u<i;u++){var l=r(h,u),c=(0,a.default)(l,2),f=c[0],p=e*u+h<<2,d=o*c[1]+f<<2,m=n.readUInt32BE(d);s.writeUInt32BE(m,p)}t.bitmap.data=s,t.bitmap.width=e,t.bitmap.height=i}(t,i?t.bitmap.height:t.bitmap.width,i?t.bitmap.width:t.bitmap.height,e)}}(this)}catch(t){}return i.call(this,null,this),this},e.getBuffer=p,e.getBufferAsync=function(t){return(0,c.default)(p,this,t)};var a=n(i(3038)),o=n(i(7769)),s=n(i(2594)),h=i(1567),u=r(i(9215)),l=r(i(9658)),c=n(i(4388));function f(t){return t._exif&&t._exif.tags&&t._exif.tags.Orientation||1}function p(t,e){if(t===u.AUTO&&(t=this.getMIME()),"string"!=typeof t)return h.throwError.call(this,"mime must be a string",e);if("function"!=typeof e)return h.throwError.call(this,"cb must be a function",e);var i,r;if(t=t.toLowerCase(),this._rgba&&this.constructor.hasAlpha[t]?this.bitmap.data=Buffer.from(this.bitmap.data):this.bitmap.data=(i=this.constructor,r=this,new i(r.bitmap.width,r.bitmap.height,r._background).composite(r,0,0).bitmap).data,this.constructor.encoders[t]){var n=this.constructor.encoders[t](this);e.call(this,null,n)}else e.call(this,"Unsupported MIME type: "+t);return this}},9658:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getExtension=e.getType=e.addType=void 0;var i={};e.addType=function(t,e){i[t]=e},e.getType=function(t){var e,r=t.split("/").slice(-1);return(e=r[r.length-1].split(".").pop(),Object.entries(i).find((function(t){return t[1].includes(e)}))||[])[0]},e.getExtension=function(t){return(i[t.toLowerCase()]||[])[0]}},4388:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t,e){for(var i=arguments.length,r=new Array(i>2?i-2:0),n=2;n<i;n++)r[n-2]=arguments[n];return new Promise((function(i,n){r.push((function(t,e){t&&n(t),i(e)})),t.bind(e).apply(void 0,r)}))}},3006:(t,e,i)=>{"use strict";var r=i(862),n=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.default,i={hasAlpha:{},encoders:{},decoders:{},class:{},constants:{}};function r(t){Object.entries(t).forEach((function(t){var e=(0,s.default)(t,2),r=e[0],n=e[1];i[r]=l({},i[r],{},n)}))}function n(t){var e=t();Array.isArray(e.mime)?h.addType.apply(void 0,(0,a.default)(e.mime)):Object.entries(e.mime).forEach((function(t){return h.addType.apply(void 0,(0,a.default)(t))})),delete e.mime,r(e)}function o(t){var e=t(h.jimpEvChange)||{};e.class||e.constants?r(e):r({class:e})}return t.types&&(t.types.forEach(n),e.decoders=l({},e.decoders,{},i.decoders),e.encoders=l({},e.encoders,{},i.encoders),e.hasAlpha=l({},e.hasAlpha,{},i.hasAlpha)),t.plugins&&t.plugins.forEach(o),(0,h.addJimpMethods)(i.class,e),(0,h.addConstants)(i.constants,e),h.default};var a=n(i(319)),o=n(i(9713)),s=n(i(3038)),h=r(i(5859));function u(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function l(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?u(i,!0).forEach((function(e){(0,o.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):u(i).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}},2744:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(9713)),a=r(i(1494)),o=i(1702),s="image/gif";e.default=function(){return{mime:(0,n.default)({},s,["gif"]),constants:{MIME_GIF:s},decoders:(0,n.default)({},s,(function(t){var e=new a.default.GifReader(t),i=Buffer.alloc(e.width*e.height*4);return e.decodeAndBlitFrameRGBA(0,i),{data:i,width:e.width,height:e.height}})),encoders:(0,n.default)({},s,(function(t){var e=new o.BitmapImage(t.bitmap);o.GifUtil.quantizeDekker(e,256);var i=new o.GifFrame(e);return(new o.GifCodec).encodeGif([i],{}).then((function(t){return t.buffer}))}))}}},3853:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(9713)),a=r(i(7870)),o=i(1567),s="image/jpeg";e.default=function(){return{mime:(0,n.default)({},s,["jpeg","jpg","jpe"]),constants:{MIME_JPEG:s},decoders:(0,n.default)({},s,a.default.decode),encoders:(0,n.default)({},s,(function(t){return a.default.encode(t.bitmap,t._quality).data})),class:{_quality:100,quality:function(t,e){return"number"!=typeof t?o.throwError.call(this,"n must be a number",e):t<0||t>100?o.throwError.call(this,"n must be a number 0 - 100",e):(this._quality=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)}}}}},2260:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(8)),a=i(1567);e.default=function(){return{blit:function(t,e,i,r,o,s,h,u){if(!(t instanceof this.constructor))return a.throwError.call(this,"The source must be a Jimp image",u);if("number"!=typeof e||"number"!=typeof i)return a.throwError.call(this,"x and y must be numbers",u);if("function"==typeof r)u=r,r=0,o=0,s=t.bitmap.width,h=t.bitmap.height;else{if((0,n.default)(r)!==(0,n.default)(o)||(0,n.default)(o)!==(0,n.default)(s)||(0,n.default)(s)!==(0,n.default)(h))return a.throwError.call(this,"srcx, srcy, srcw, srch must be numbers",u);r=r||0,o=o||0,s=s||t.bitmap.width,h=h||t.bitmap.height}e=Math.round(e),i=Math.round(i),r=Math.round(r),o=Math.round(o),s=Math.round(s),h=Math.round(h);var l=this.bitmap.width,c=this.bitmap.height,f=this;return t.scanQuiet(r,o,s,h,(function(t,n,a){var s=e+t-r,h=i+n-o;if(s>=0&&h>=0&&l-s>0&&c-h>0){var u=f.getPixelIndex(s,h),p={r:this.bitmap.data[a],g:this.bitmap.data[a+1],b:this.bitmap.data[a+2],a:this.bitmap.data[a+3]},d={r:f.bitmap.data[u],g:f.bitmap.data[u+1],b:f.bitmap.data[u+2],a:f.bitmap.data[u+3]};f.bitmap.data[u]=(p.a*(p.r-d.r)-d.r+255>>8)+d.r,f.bitmap.data[u+1]=(p.a*(p.g-d.g)-d.g+255>>8)+d.g,f.bitmap.data[u+2]=(p.a*(p.b-d.b)-d.b+255>>8)+d.b,f.bitmap.data[u+3]=this.constructor.limit255(d.a+p.a)}})),(0,a.isNodePattern)(u)&&u.call(this,null,this),this}}}},2430:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shgTable=e.mulTable=void 0,e.mulTable=[1,57,41,21,203,34,97,73,227,91,149,62,105,45,39,137,241,107,3,173,39,71,65,238,219,101,187,87,81,151,141,133,249,117,221,209,197,187,177,169,5,153,73,139,133,127,243,233,223,107,103,99,191,23,177,171,165,159,77,149,9,139,135,131,253,245,119,231,224,109,211,103,25,195,189,23,45,175,171,83,81,79,155,151,147,9,141,137,67,131,129,251,123,30,235,115,113,221,217,53,13,51,50,49,193,189,185,91,179,175,43,169,83,163,5,79,155,19,75,147,145,143,35,69,17,67,33,65,255,251,247,243,239,59,29,229,113,111,219,27,213,105,207,51,201,199,49,193,191,47,93,183,181,179,11,87,43,85,167,165,163,161,159,157,155,77,19,75,37,73,145,143,141,35,138,137,135,67,33,131,129,255,63,250,247,61,121,239,237,117,29,229,227,225,111,55,109,216,213,211,209,207,205,203,201,199,197,195,193,48,190,47,93,185,183,181,179,178,176,175,173,171,85,21,167,165,41,163,161,5,79,157,78,154,153,19,75,149,74,147,73,144,143,71,141,140,139,137,17,135,134,133,66,131,65,129,1],e.shgTable=[0,9,10,10,14,12,14,14,16,15,16,15,16,15,15,17,18,17,12,18,16,17,17,19,19,18,19,18,18,19,19,19,20,19,20,20,20,20,20,20,15,20,19,20,20,20,21,21,21,20,20,20,21,18,21,21,21,21,20,21,17,21,21,21,22,22,21,22,22,21,22,21,19,22,22,19,20,22,22,21,21,21,22,22,22,18,22,22,21,22,22,23,22,20,23,22,22,23,23,21,19,21,21,21,23,23,23,22,23,23,21,23,22,23,18,22,23,20,22,23,23,23,21,22,20,22,21,22,24,24,24,24,24,22,21,24,23,23,24,21,24,23,24,22,24,24,22,24,24,22,23,24,24,24,20,23,22,23,24,24,24,24,24,24,24,23,21,23,22,23,24,24,24,22,24,24,24,23,22,24,24,25,23,25,25,23,24,25,25,24,22,25,25,25,24,23,24,25,25,25,25,25,25,25,25,25,25,25,25,23,25,23,24,25,25,25,25,25,25,25,25,25,24,22,25,25,23,25,25,20,24,25,24,25,25,22,24,25,24,25,24,25,25,24,25,25,25,25,22,25,25,25,24,25,24,25,18]},7139:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567),n=i(2430);e.default=function(){return{blur:function(t,e){if("number"!=typeof t)return r.throwError.call(this,"r must be a number",e);if(t<1)return r.throwError.call(this,"r must be greater than 0",e);for(var i,a,o,s,h,u,l,c,f,p,d,m,g,b,v=this.bitmap.width-1,y=this.bitmap.height-1,_=t+1,w=n.mulTable[t],x=n.shgTable[t],E=[],I=[],M=[],k=[],P=[],T=[],S=2;S-- >0;){for(m=0,g=0,u=0;u<this.bitmap.height;u++){for(i=this.bitmap.data[g]*_,a=this.bitmap.data[g+1]*_,o=this.bitmap.data[g+2]*_,s=this.bitmap.data[g+3]*_,l=1;l<=t;l++)c=g+((l>v?v:l)<<2),i+=this.bitmap.data[c++],a+=this.bitmap.data[c++],o+=this.bitmap.data[c++],s+=this.bitmap.data[c];for(h=0;h<this.bitmap.width;h++)E[m]=i,I[m]=a,M[m]=o,k[m]=s,0===u&&(P[h]=((c=h+_)<v?c:v)<<2,T[h]=(c=h-t)>0?c<<2:0),f=g+P[h],p=g+T[h],i+=this.bitmap.data[f++]-this.bitmap.data[p++],a+=this.bitmap.data[f++]-this.bitmap.data[p++],o+=this.bitmap.data[f++]-this.bitmap.data[p++],s+=this.bitmap.data[f]-this.bitmap.data[p],m++;g+=this.bitmap.width<<2}for(h=0;h<this.bitmap.width;h++){for(i=E[d=h]*_,a=I[d]*_,o=M[d]*_,s=k[d]*_,l=1;l<=t;l++)i+=E[d+=l>y?0:this.bitmap.width],a+=I[d],o+=M[d],s+=k[d];for(m=h<<2,u=0;u<this.bitmap.height;u++)b=s*w>>>x,this.bitmap.data[m+3]=b,b>255&&(this.bitmap.data[m+3]=255),b>0?(b=255/b,this.bitmap.data[m]=(i*w>>>x)*b,this.bitmap.data[m+1]=(a*w>>>x)*b,this.bitmap.data[m+2]=(o*w>>>x)*b):(this.bitmap.data[m+2]=0,this.bitmap.data[m+1]=0,this.bitmap.data[m]=0),0===h&&(P[u]=((c=u+_)<y?c:y)*this.bitmap.width,T[u]=(c=u-t)>0?c*this.bitmap.width:0),f=h+P[u],p=h+T[u],i+=E[f]-E[p],a+=I[f]-I[p],o+=M[f]-M[p],s+=k[f]-k[p],m+=this.bitmap.width<<2}}return(0,r.isNodePattern)(e)&&e.call(this,null,this),this}}}},4650:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{circle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(e=t,t={});var i=t.radius||(this.bitmap.width>this.bitmap.height?this.bitmap.height:this.bitmap.width)/2,n={x:"number"==typeof t.x?t.x:this.bitmap.width/2,y:"number"==typeof t.y?t.y:this.bitmap.height/2};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,r){var a=Math.sqrt(Math.pow(t-n.x,2)+Math.pow(e-n.y,2));i-a<=0?this.bitmap.data[r+3]=0:i-a<1&&(this.bitmap.data[r+3]=255*(i-a))})),(0,r.isNodePattern)(e)&&e.call(this,null,this),this}}}},809:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(319)),a=r(i(7621)),o=i(1567);function s(t,e,i,r){for(var n=[0,0,0],a=(e.length-1)/2,o=0;o<e.length;o+=1)for(var s=0;s<e[o].length;s+=1){var h=t.getPixelIndex(i+o-a,r+s-a);n[0]+=t.bitmap.data[h]*e[o][s],n[1]+=t.bitmap.data[h+1]*e[o][s],n[2]+=t.bitmap.data[h+2]*e[o][s]}return n}var h=function(t){return null!=t};function u(t){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,i){var r=parseInt(.2126*this.bitmap.data[i]+.7152*this.bitmap.data[i+1]+.0722*this.bitmap.data[i+2],10);this.bitmap.data[i]=r,this.bitmap.data[i+1]=r,this.bitmap.data[i+2]=r})),(0,o.isNodePattern)(t)&&t.call(this,null,this),this}function l(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;return{r:(e.r-t.r)*(i/100)+t.r,g:(e.g-t.g)*(i/100)+t.g,b:(e.b-t.b)*(i/100)+t.b}}function c(t,e){var i=this;return t&&Array.isArray(t)?(t=t.map((function(t){return"xor"!==t.apply&&"mix"!==t.apply||(t.params[0]=(0,a.default)(t.params[0]).toRgb()),t})),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(r,s,h){var u={r:i.bitmap.data[h],g:i.bitmap.data[h+1],b:i.bitmap.data[h+2]},c=function(t,e){return i.constructor.limit255(u[t]+e)};t.forEach((function(t){if("mix"===t.apply)u=l(u,t.params[0],t.params[1]);else if("tint"===t.apply)u=l(u,{r:255,g:255,b:255},t.params[0]);else if("shade"===t.apply)u=l(u,{r:0,g:0,b:0},t.params[0]);else if("xor"===t.apply)u={r:u.r^t.params[0].r,g:u.g^t.params[0].g,b:u.b^t.params[0].b};else if("red"===t.apply)u.r=c("r",t.params[0]);else if("green"===t.apply)u.g=c("g",t.params[0]);else if("blue"===t.apply)u.b=c("b",t.params[0]);else{var r;if("hue"===t.apply&&(t.apply="spin"),!(u=(0,a.default)(u))[t.apply])return o.throwError.call(i,"action "+t.apply+" not supported",e);u=(r=u)[t.apply].apply(r,(0,n.default)(t.params)).toRgb()}})),i.bitmap.data[h]=u.r,i.bitmap.data[h+1]=u.g,i.bitmap.data[h+2]=u.b})),(0,o.isNodePattern)(e)&&e.call(this,null,this),this):o.throwError.call(this,"actions must be an array",e)}e.default=function(){return{brightness:function(t,e){return"number"!=typeof t?o.throwError.call(this,"val must be numbers",e):t<-1||t>1?o.throwError.call(this,"val must be a number between -1 and +1",e):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(e,i,r){t<0?(this.bitmap.data[r]=this.bitmap.data[r]*(1+t),this.bitmap.data[r+1]=this.bitmap.data[r+1]*(1+t),this.bitmap.data[r+2]=this.bitmap.data[r+2]*(1+t)):(this.bitmap.data[r]=this.bitmap.data[r]+(255-this.bitmap.data[r])*t,this.bitmap.data[r+1]=this.bitmap.data[r+1]+(255-this.bitmap.data[r+1])*t,this.bitmap.data[r+2]=this.bitmap.data[r+2]+(255-this.bitmap.data[r+2])*t)})),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},contrast:function(t,e){if("number"!=typeof t)return o.throwError.call(this,"val must be numbers",e);if(t<-1||t>1)return o.throwError.call(this,"val must be a number between -1 and +1",e);var i=(t+1)/(1-t);function r(t){return(t=Math.floor(i*(t-127)+127))<0?0:t>255?255:t}return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,i){this.bitmap.data[i]=r(this.bitmap.data[i]),this.bitmap.data[i+1]=r(this.bitmap.data[i+1]),this.bitmap.data[i+2]=r(this.bitmap.data[i+2])})),(0,o.isNodePattern)(e)&&e.call(this,null,this),this},posterize:function(t,e){return"number"!=typeof t?o.throwError.call(this,"n must be numbers",e):(t<2&&(t=2),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(e,i,r){this.bitmap.data[r]=Math.floor(this.bitmap.data[r]/255*(t-1))/(t-1)*255,this.bitmap.data[r+1]=Math.floor(this.bitmap.data[r+1]/255*(t-1))/(t-1)*255,this.bitmap.data[r+2]=Math.floor(this.bitmap.data[r+2]/255*(t-1))/(t-1)*255})),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},greyscale:u,grayscale:u,opacity:function(t,e){return"number"!=typeof t?o.throwError.call(this,"f must be a number",e):t<0||t>1?o.throwError.call(this,"f must be a number from 0 to 1",e):(this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(e,i,r){var n=this.bitmap.data[r+3]*t;this.bitmap.data[r+3]=n})),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},sepia:function(t){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,i){var r=this.bitmap.data[i],n=this.bitmap.data[i+1],a=this.bitmap.data[i+2];a=.272*(r=.393*r+.769*n+.189*a)+.534*(n=.349*r+.686*n+.168*a)+.131*a,this.bitmap.data[i]=r<255?r:255,this.bitmap.data[i+1]=n<255?n:255,this.bitmap.data[i+2]=a<255?a:255})),(0,o.isNodePattern)(t)&&t.call(this,null,this),this},fade:function(t,e){return"number"!=typeof t?o.throwError.call(this,"f must be a number",e):t<0||t>1?o.throwError.call(this,"f must be a number from 0 to 1",e):(this.opacity(1-t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},convolution:function(t,e,i){"function"==typeof e&&void 0===i&&(i=e,e=null),e||(e=this.constructor.EDGE_EXTEND);var r,n,a,s,h,u,l,c,f,p,d=Buffer.from(this.bitmap.data),m=t.length,g=t[0].length,b=Math.floor(m/2),v=Math.floor(g/2),y=-b,_=-v;return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(i,o,m){s=0,a=0,n=0;for(var g=y;g<=b;g++)for(var w=_;w<=v;w++)c=i+w,f=o+g,r=t[g+b][w+v],-1===(p=this.getPixelIndex(c,f,e))?(l=0,u=0,h=0):(h=this.bitmap.data[p+0],u=this.bitmap.data[p+1],l=this.bitmap.data[p+2]),n+=r*h,a+=r*u,s+=r*l;n<0&&(n=0),a<0&&(a=0),s<0&&(s=0),n>255&&(n=255),a>255&&(a=255),s>255&&(s=255),d[m+0]=n,d[m+1]=a,d[m+2]=s})),this.bitmap.data=d,(0,o.isNodePattern)(i)&&i.call(this,null,this),this},opaque:function(t){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,i){this.bitmap.data[i+3]=255})),(0,o.isNodePattern)(t)&&t.call(this,null,this),this},pixelate:function(t,e,i,r,n,a){if("function"==typeof e)a=e,n=null,r=null,i=null,e=null;else{if("number"!=typeof t)return o.throwError.call(this,"size must be a number",a);if(h(e)&&"number"!=typeof e)return o.throwError.call(this,"x must be a number",a);if(h(i)&&"number"!=typeof i)return o.throwError.call(this,"y must be a number",a);if(h(r)&&"number"!=typeof r)return o.throwError.call(this,"w must be a number",a);if(h(n)&&"number"!=typeof n)return o.throwError.call(this,"h must be a number",a)}var u=[[1/16,2/16,1/16],[2/16,.25,2/16],[1/16,2/16,1/16]];e=e||0,i=i||0,r=h(r)?r:this.bitmap.width-e,n=h(n)?n:this.bitmap.height-i;var l=this.cloneQuiet();return this.scanQuiet(e,i,r,n,(function(e,i,r){e=t*Math.floor(e/t),i=t*Math.floor(i/t);var n=s(l,u,e,i);this.bitmap.data[r]=n[0],this.bitmap.data[r+1]=n[1],this.bitmap.data[r+2]=n[2]})),(0,o.isNodePattern)(a)&&a.call(this,null,this),this},convolute:function(t,e,i,r,n,a){if(!Array.isArray(t))return o.throwError.call(this,"the kernel must be an array",a);if("function"==typeof e)a=e,e=null,i=null,r=null,n=null;else{if(h(e)&&"number"!=typeof e)return o.throwError.call(this,"x must be a number",a);if(h(i)&&"number"!=typeof i)return o.throwError.call(this,"y must be a number",a);if(h(r)&&"number"!=typeof r)return o.throwError.call(this,"w must be a number",a);if(h(n)&&"number"!=typeof n)return o.throwError.call(this,"h must be a number",a)}var u=(t.length-1)/2;e=h(e)?e:u,i=h(i)?i:u,r=h(r)?r:this.bitmap.width-e,n=h(n)?n:this.bitmap.height-i;var l=this.cloneQuiet();return this.scanQuiet(e,i,r,n,(function(e,i,r){var n=s(l,t,e,i);this.bitmap.data[r]=this.constructor.limit255(n[0]),this.bitmap.data[r+1]=this.constructor.limit255(n[1]),this.bitmap.data[r+2]=this.constructor.limit255(n[2])})),(0,o.isNodePattern)(a)&&a.call(this,null,this),this},color:c,colour:c}}},7890:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{contain:function(t,e,i,n,a){if("number"!=typeof t||"number"!=typeof e)return r.throwError.call(this,"w and h must be numbers",a);"string"==typeof i&&("function"==typeof n&&void 0===a&&(a=n),n=i,i=null),"function"==typeof i&&(void 0===a&&(a=i),n=null,i=null),"function"==typeof n&&void 0===a&&(a=n,n=null);var o=7&(i=i||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),s=i>>3;if((0===o||o&o-1)&&(0===s||s&s-1))return r.throwError.call(this,"only use one flag per alignment direction",a);var h=o>>1,u=s>>1,l=t/e>this.bitmap.width/this.bitmap.height?e/this.bitmap.height:t/this.bitmap.width,c=this.cloneQuiet().scale(l,n);return this.resize(t,e,n),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,i){this.bitmap.data.writeUInt32BE(this._background,i)})),this.blit(c,(this.bitmap.width-c.bitmap.width)/2*h,(this.bitmap.height-c.bitmap.height)/2*u),(0,r.isNodePattern)(a)&&a.call(this,null,this),this}}}},4587:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{cover:function(t,e,i,n,a){if("number"!=typeof t||"number"!=typeof e)return r.throwError.call(this,"w and h must be numbers",a);i&&"function"==typeof i&&void 0===a?(a=i,i=null,n=null):"function"==typeof n&&void 0===a&&(a=n,n=null);var o=7&(i=i||this.constructor.HORIZONTAL_ALIGN_CENTER|this.constructor.VERTICAL_ALIGN_MIDDLE),s=i>>3;if((0===o||o&o-1)&&(0===s||s&s-1))return r.throwError.call(this,"only use one flag per alignment direction",a);var h=o>>1,u=s>>1,l=t/e>this.bitmap.width/this.bitmap.height?t/this.bitmap.width:e/this.bitmap.height;return this.scale(l,n),this.crop((this.bitmap.width-t)/2*h,(this.bitmap.height-e)/2*u,t,e),(0,r.isNodePattern)(a)&&a.call(this,null,this),this}}}},6544:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t("crop",(function(t,e,i,r,n){if("number"!=typeof t||"number"!=typeof e)return a.throwError.call(this,"x and y must be numbers",n);if("number"!=typeof i||"number"!=typeof r)return a.throwError.call(this,"w and h must be numbers",n);if(t=Math.round(t),e=Math.round(e),i=Math.round(i),r=Math.round(r),0===t&&i===this.bitmap.width){var o=i*e+t<<2,s=o+r*i<<2;this.bitmap.data=this.bitmap.data.slice(o,s)}else{var h=Buffer.allocUnsafe(i*r*4),u=0;this.scanQuiet(t,e,i,r,(function(t,e,i){var r=this.bitmap.data.readUInt32BE(i,!0);h.writeUInt32BE(r,u,!0),u+=4})),this.bitmap.data=h}return this.bitmap.width=i,this.bitmap.height=r,(0,a.isNodePattern)(n)&&n.call(this,null,this),this})),{class:{autocrop:function(){for(var t,e=this.bitmap.width,i=this.bitmap.height,r=1,o=0,s=2e-4,h=!0,u=!1,l=arguments.length,c=new Array(l),f=0;f<l;f++)c[f]=arguments[f];for(var p=0,d=c.length;p<d;p++)if("number"==typeof c[p]&&(s=c[p]),"boolean"==typeof c[p]&&(h=c[p]),"function"==typeof c[p]&&(t=c[p]),"object"===(0,n.default)(c[p])){var m=c[p];void 0!==m.tolerance&&(s=m.tolerance),void 0!==m.cropOnlyFrames&&(h=m.cropOnlyFrames),void 0!==m.cropSymmetric&&(u=m.cropSymmetric),void 0!==m.leaveBorder&&(o=m.leaveBorder)}var g=this.getPixelColor(0,0),b=this.constructor.intToRGBA(g),v=0,y=0,_=0,w=0;g=this.getPixelColor(0,0);t:for(var x=0;x<i-r;x++){for(var E=0;E<e;E++){var I=this.getPixelColor(E,x),M=this.constructor.intToRGBA(I);if(this.constructor.colorDiff(b,M)>s)break t}v++}g=this.getPixelColor(e,0);t:for(var k=0;k<e-r;k++){for(var P=0+v;P<i;P++){var T=this.getPixelColor(k,P),S=this.constructor.intToRGBA(T);if(this.constructor.colorDiff(b,S)>s)break t}y++}g=this.getPixelColor(0,i);t:for(var A=i-1;A>=v+r;A--){for(var O=e-y-1;O>=0;O--){var C=this.getPixelColor(O,A),D=this.constructor.intToRGBA(C);if(this.constructor.colorDiff(b,D)>s)break t}_++}g=this.getPixelColor(e,i);t:for(var B=e-1;B>=0+y+r;B--){for(var N=i-1;N>=0+v;N--){var L=this.getPixelColor(B,N),R=this.constructor.intToRGBA(L);if(this.constructor.colorDiff(b,R)>s)break t}w++}if(w-=o,y-=o,v-=o,_-=o,u){var F=Math.min(y,w),z=Math.min(v,_);w=F,y=F,v=z,_=z}var G=e-((w=w>=0?w:0)+(y=y>=0?y:0)),U=i-((_=_>=0?_:0)+(v=v>=0?v:0));return(h?0!==y&&0!==v&&0!==w&&0!==_:0!==y||0!==v||0!==w||0!==_)&&this.crop(y,v,G,U),(0,a.isNodePattern)(t)&&t.call(this,null,this),this}}}};var n=r(i(8)),a=i(1567)},7679:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(8)),a=i(1567);e.default=function(){return{displace:function(t,e,i){if("object"!==(0,n.default)(t)||t.constructor!==this.constructor)return a.throwError.call(this,"The source must be a Jimp image",i);if("number"!=typeof e)return a.throwError.call(this,"factor must be a number",i);var r=this.cloneQuiet();return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(i,n,a){var o=t.bitmap.data[a]/256*e;o=Math.round(o);var s=this.getPixelIndex(i+o,n);this.bitmap.data[s]=r.bitmap.data[a],this.bitmap.data[s+1]=r.bitmap.data[a+1],this.bitmap.data[s+2]=r.bitmap.data[a+2]})),(0,a.isNodePattern)(i)&&i.call(this,null,this),this}}}},5380:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);function n(t){var e=[1,9,3,11,13,5,15,7,4,12,2,10,16,8,14,6];return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,i,r){var n=e[((3&i)<<2)+t%4];this.bitmap.data[r]=Math.min(this.bitmap.data[r]+n,255),this.bitmap.data[r+1]=Math.min(this.bitmap.data[r+1]+n,255),this.bitmap.data[r+2]=Math.min(this.bitmap.data[r+2]+n,255)})),(0,r.isNodePattern)(t)&&t.call(this,null,this),this}e.default=function(){return{dither565:n,dither16:n}}},9462:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{fisheye:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{r:2.5},i=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(i=e,e={r:2.5});var n=this.cloneQuiet(),a=n.bitmap,o=a.width,s=a.height;return n.scanQuiet(0,0,o,s,(function(i,r){var a=i/o,h=r/s,u=Math.sqrt(Math.pow(a-.5,2)+Math.pow(h-.5,2)),l=2*Math.pow(u,e.r),c=(a-.5)/u,f=(h-.5)/u,p=Math.round((l*c+.5)*o),d=Math.round((l*f+.5)*s),m=n.getPixelColor(p,d);t.setPixelColor(m,i,r)})),this.setPixelColor(n.getPixelColor(o/2,s/2),o/2,s/2),(0,r.isNodePattern)(i)&&i.call(this,null,this),this}}}},5980:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);function n(t,e,i){if("boolean"!=typeof t||"boolean"!=typeof e)return r.throwError.call(this,"horizontal and vertical must be Booleans",i);var n=Buffer.alloc(this.bitmap.data.length);return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(i,r,a){var o=t?this.bitmap.width-1-i:i,s=e?this.bitmap.height-1-r:r,h=this.bitmap.width*s+o<<2,u=this.bitmap.data.readUInt32BE(a);n.writeUInt32BE(u,h)})),this.bitmap.data=Buffer.from(n),(0,r.isNodePattern)(i)&&i.call(this,null,this),this}e.default=function(){return{flip:n,mirror:n}}},5092:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{gaussian:function(t,e){if("number"!=typeof t)return r.throwError.call(this,"r must be a number",e);if(t<1)return r.throwError.call(this,"r must be greater than 0",e);for(var i=Math.ceil(2.57*t),n=2*i+1,a=t*t*2,o=a*Math.PI,s=[],h=0;h<n;h++){s[h]=[];for(var u=0;u<n;u++){var l=Math.pow(u-i,2)+Math.pow(h-i,2);s[h][u]=Math.exp(-l/a)/o}}for(var c=0;c<this.bitmap.height;c++)for(var f=0;f<this.bitmap.width;f++)for(var p=0,d=0,m=0,g=0,b=0,v=0;v<n;v++){for(var y=0;y<n;y++){var _=Math.min(this.bitmap.width-1,Math.max(0,y+f-i)),w=Math.min(this.bitmap.height-1,Math.max(0,v+c-i)),x=s[v][y],E=w*this.bitmap.width+_<<2;p+=this.bitmap.data[E]*x,d+=this.bitmap.data[E+1]*x,m+=this.bitmap.data[E+2]*x,g+=this.bitmap.data[E+3]*x,b+=x}var I=c*this.bitmap.width+f<<2;this.bitmap.data[I]=Math.round(p/b),this.bitmap.data[I+1]=Math.round(d/b),this.bitmap.data[I+2]=Math.round(m/b),this.bitmap.data[I+3]=Math.round(g/b)}return(0,r.isNodePattern)(e)&&e.call(this,null,this),this}}}},9085:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{invert:function(t){return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,i){this.bitmap.data[i]=255-this.bitmap.data[i],this.bitmap.data[i+1]=255-this.bitmap.data[i+1],this.bitmap.data[i+2]=255-this.bitmap.data[i+2]})),(0,r.isNodePattern)(t)&&t.call(this,null,this),this}}}},6597:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{mask:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;if(!(t instanceof this.constructor))return r.throwError.call(this,"The source must be a Jimp image",n);if("number"!=typeof e||"number"!=typeof i)return r.throwError.call(this,"x and y must be numbers",n);e=Math.round(e),i=Math.round(i);var a=this.bitmap.width,o=this.bitmap.height,s=this;return t.scanQuiet(0,0,t.bitmap.width,t.bitmap.height,(function(t,r,n){var h=e+t,u=i+r;if(h>=0&&u>=0&&h<a&&u<o){var l=s.getPixelIndex(h,u),c=this.bitmap.data,f=(c[n+0]+c[n+1]+c[n+2])/3;s.bitmap.data[l+3]*=f/255}})),(0,r.isNodePattern)(n)&&n.call(this,null,this),this}}}},2042:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);function n(){var t={r:new Array(256).fill(0),g:new Array(256).fill(0),b:new Array(256).fill(0)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(e,i,r){t.r[this.bitmap.data[r+0]]++,t.g[this.bitmap.data[r+1]]++,t.b[this.bitmap.data[r+2]]++})),t}var a=function(t,e,i){return 255*(t-e)/(i-e)},o=function(t){return[t.findIndex((function(t){return t>0})),255-t.slice().reverse().findIndex((function(t){return t>0}))]};e.default=function(){return{normalize:function(t){var e=n.call(this),i={r:o(e.r),g:o(e.g),b:o(e.b)};return this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,r){var n=this.bitmap.data[r+0],o=this.bitmap.data[r+1],s=this.bitmap.data[r+2];this.bitmap.data[r+0]=a(n,i.r[0],i.r[1]),this.bitmap.data[r+1]=a(o,i.g[0],i.g[1]),this.bitmap.data[r+2]=a(s,i.b[0],i.b[1])})),(0,r.isNodePattern)(t)&&t.call(this,null,this),this}}}},8869:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(8)),a=r(i(319)),o=r(i(5622)),s=r(i(1120)),h=i(1567),u=i(6523);function l(t,e,i,r,n){if(n.width>0&&n.height>0){var a=e.pages[n.page];t.blit(a,i+n.xoffset,r+n.yoffset,n.x,n.y,n.width,n.height)}return t}function c(t,e,i,r,n){for(var a=0;a<r.length;a++){var o;o=t.chars[r[a]]?r[a]:/\s/.test(r[a])?"":"?";var s=t.chars[o]||{},h=t.kernings[o];l(this,t,e,i,s||{}),e+=(h&&h[r[a+1]]?h[r[a+1]]:0)+(s.xadvance||n)}}var f=process.env.DIRNAME||"".concat(__dirname,"/../");e.default=function(){return{constants:{measureText:u.measureText,measureTextHeight:u.measureTextHeight,FONT_SANS_8_BLACK:o.default.join(f,"fonts/open-sans/open-sans-8-black/open-sans-8-black.fnt"),FONT_SANS_10_BLACK:o.default.join(f,"fonts/open-sans/open-sans-10-black/open-sans-10-black.fnt"),FONT_SANS_12_BLACK:o.default.join(f,"fonts/open-sans/open-sans-12-black/open-sans-12-black.fnt"),FONT_SANS_14_BLACK:o.default.join(f,"fonts/open-sans/open-sans-14-black/open-sans-14-black.fnt"),FONT_SANS_16_BLACK:o.default.join(f,"fonts/open-sans/open-sans-16-black/open-sans-16-black.fnt"),FONT_SANS_32_BLACK:o.default.join(f,"fonts/open-sans/open-sans-32-black/open-sans-32-black.fnt"),FONT_SANS_64_BLACK:o.default.join(f,"fonts/open-sans/open-sans-64-black/open-sans-64-black.fnt"),FONT_SANS_128_BLACK:o.default.join(f,"fonts/open-sans/open-sans-128-black/open-sans-128-black.fnt"),FONT_SANS_8_WHITE:o.default.join(f,"fonts/open-sans/open-sans-8-white/open-sans-8-white.fnt"),FONT_SANS_16_WHITE:o.default.join(f,"fonts/open-sans/open-sans-16-white/open-sans-16-white.fnt"),FONT_SANS_32_WHITE:o.default.join(f,"fonts/open-sans/open-sans-32-white/open-sans-32-white.fnt"),FONT_SANS_64_WHITE:o.default.join(f,"fonts/open-sans/open-sans-64-white/open-sans-64-white.fnt"),FONT_SANS_128_WHITE:o.default.join(f,"fonts/open-sans/open-sans-128-white/open-sans-128-white.fnt"),loadFont:function(t,e){var i=this;return"string"!=typeof t?h.throwError.call(this,"file must be a string",e):new Promise((function(r,n){e=e||function(t,e){t?n(t):r(e)},(0,s.default)(t,(function(r,n){var a={},s={};if(r)return h.throwError.call(i,r,e);for(var u=0;u<n.chars.length;u++)a[String.fromCharCode(n.chars[u].id)]=n.chars[u];for(var l=0;l<n.kernings.length;l++){var c=String.fromCharCode(n.kernings[l].first);s[c]=s[c]||{},s[c][String.fromCharCode(n.kernings[l].second)]=n.kernings[l].amount}(function(t,e,i){var r=i.map((function(i){return t.read(e+"/"+i)}));return Promise.all(r)})(i,o.default.dirname(t),n.pages).then((function(t){e(null,{chars:a,kernings:s,pages:t,common:n.common,info:n.info})}))}))}))}},class:{print:function(t,e,i,r,o,s,l){var f,p,d=this;if("function"==typeof o&&void 0===l&&(l=o,o=1/0),void 0===o&&(o=1/0),"function"==typeof s&&void 0===l&&(l=s,s=1/0),void 0===s&&(s=1/0),"object"!==(0,n.default)(t))return h.throwError.call(this,"font must be a Jimp loadFont",l);if("number"!=typeof e||"number"!=typeof i||"number"!=typeof o)return h.throwError.call(this,"x, y and maxWidth must be numbers",l);if("number"!=typeof o)return h.throwError.call(this,"maxWidth must be a number",l);if("number"!=typeof s)return h.throwError.call(this,"maxHeight must be a number",l);"object"===(0,n.default)(r)&&null!==r.text&&void 0!==r.text?(f=r.alignmentX||this.constructor.HORIZONTAL_ALIGN_LEFT,p=r.alignmentY||this.constructor.VERTICAL_ALIGN_TOP,r=r.text):(f=this.constructor.HORIZONTAL_ALIGN_LEFT,p=this.constructor.VERTICAL_ALIGN_TOP,r=r.toString()),s!==1/0&&p===this.constructor.VERTICAL_ALIGN_BOTTOM?i+=s-(0,u.measureTextHeight)(t,r,o):s!==1/0&&p===this.constructor.VERTICAL_ALIGN_MIDDLE&&(i+=s/2-(0,u.measureTextHeight)(t,r,o)/2);var m=Object.entries(t.chars)[0][1].xadvance,g=function(t,e,i){var r=e.split(" "),n=[],o=[],s=0;return r.forEach((function(e){var r=[].concat((0,a.default)(o),[e]).join(" "),h=(0,u.measureText)(t,r);h<=i?(h>s&&(s=h),o.push(e)):(n.push(o),o=[e])})),n.push(o),{lines:n,longestLine:s}}(t,r,o),b=g.lines,v=g.longestLine;return b.forEach((function(r){var n=r.join(" "),a=function(t,e,i,r,n){return n===t.HORIZONTAL_ALIGN_LEFT?0:n===t.HORIZONTAL_ALIGN_CENTER?(r-(0,u.measureText)(e,i))/2:r-(0,u.measureText)(e,i)}(d.constructor,t,n,o,f);c.call(d,t,e+a,i,n,m),i+=t.common.lineHeight})),(0,h.isNodePattern)(l)&&l.call(this,null,this,{x:e+v,y:i}),this}}}}},6523:(t,e)=>{"use strict";function i(t,e){for(var i=0,r=0;r<e.length;r++)if(t.chars[e[r]]){var n=t.kernings[e[r]]&&t.kernings[e[r]][e[r+1]]?t.kernings[e[r]][e[r+1]]:0;i+=(t.chars[e[r]].xadvance||0)+n}return i}Object.defineProperty(e,"__esModule",{value:!0}),e.measureText=i,e.measureTextHeight=function(t,e,r){for(var n=e.split(" "),a="",o=t.common.lineHeight,s=0;s<n.length;s++){var h=a+n[s]+" ";i(t,h)>r&&s>0?(o+=t.common.lineHeight,a=n[s]+" "):a=h}return o}},90:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i(1567),a=r(i(9025)),o=r(i(8226));e.default=function(){return{constants:{RESIZE_NEAREST_NEIGHBOR:"nearestNeighbor",RESIZE_BILINEAR:"bilinearInterpolation",RESIZE_BICUBIC:"bicubicInterpolation",RESIZE_HERMITE:"hermiteInterpolation",RESIZE_BEZIER:"bezierInterpolation"},class:{resize:function(t,e,i,r){if("number"!=typeof t||"number"!=typeof e)return n.throwError.call(this,"w and h must be numbers",r);if("function"==typeof i&&void 0===r&&(r=i,i=null),t===this.constructor.AUTO&&e===this.constructor.AUTO)return n.throwError.call(this,"w and h cannot both be set to auto",r);if(t===this.constructor.AUTO&&(t=this.bitmap.width*(e/this.bitmap.height)),e===this.constructor.AUTO&&(e=this.bitmap.height*(t/this.bitmap.width)),t<0||e<0)return n.throwError.call(this,"w and h must be positive numbers",r);if(t=Math.round(t),e=Math.round(e),"function"==typeof o.default[i]){var s={data:Buffer.alloc(t*e*4),width:t,height:e};o.default[i](this.bitmap,s),this.bitmap=s}else{var h=this;new a.default(this.bitmap.width,this.bitmap.height,t,e,!0,!0,(function(i){h.bitmap.data=Buffer.from(i),h.bitmap.width=t,h.bitmap.height=e})).resize(this.bitmap.data)}return(0,n.isNodePattern)(r)&&r.call(this,null,this),this}}}}},9025:t=>{"use strict";function e(t,e,i,r,n,a,o){this.widthOriginal=Math.abs(Math.floor(t)||0),this.heightOriginal=Math.abs(Math.floor(e)||0),this.targetWidth=Math.abs(Math.floor(i)||0),this.targetHeight=Math.abs(Math.floor(r)||0),this.colorChannels=n?4:3,this.interpolationPass=Boolean(a),this.resizeCallback="function"==typeof o?o:function(){},this.targetWidthMultipliedByChannels=this.targetWidth*this.colorChannels,this.originalWidthMultipliedByChannels=this.widthOriginal*this.colorChannels,this.originalHeightMultipliedByChannels=this.heightOriginal*this.colorChannels,this.widthPassResultSize=this.targetWidthMultipliedByChannels*this.heightOriginal,this.finalResultSize=this.targetWidthMultipliedByChannels*this.targetHeight,this.initialize()}e.prototype.initialize=function(){if(!(this.widthOriginal>0&&this.heightOriginal>0&&this.targetWidth>0&&this.targetHeight>0))throw new Error("Invalid settings specified for the resizer.");this.configurePasses()},e.prototype.configurePasses=function(){this.widthOriginal===this.targetWidth?this.resizeWidth=this.bypassResizer:(this.ratioWeightWidthPass=this.widthOriginal/this.targetWidth,this.ratioWeightWidthPass<1&&this.interpolationPass?(this.initializeFirstPassBuffers(!0),this.resizeWidth=4===this.colorChannels?this.resizeWidthInterpolatedRGBA:this.resizeWidthInterpolatedRGB):(this.initializeFirstPassBuffers(!1),this.resizeWidth=4===this.colorChannels?this.resizeWidthRGBA:this.resizeWidthRGB)),this.heightOriginal===this.targetHeight?this.resizeHeight=this.bypassResizer:(this.ratioWeightHeightPass=this.heightOriginal/this.targetHeight,this.ratioWeightHeightPass<1&&this.interpolationPass?(this.initializeSecondPassBuffers(!0),this.resizeHeight=this.resizeHeightInterpolated):(this.initializeSecondPassBuffers(!1),this.resizeHeight=4===this.colorChannels?this.resizeHeightRGBA:this.resizeHeightRGB))},e.prototype._resizeWidthInterpolatedRGBChannels=function(t,e){var i,r,n=e?4:3,a=this.ratioWeightWidthPass,o=this.widthBuffer,s=0,h=0,u=0,l=0,c=0;for(i=0;s<1/3;i+=n,s+=a)for(h=i,u=0;h<this.widthPassResultSize;u+=this.originalWidthMultipliedByChannels,h+=this.targetWidthMultipliedByChannels)o[h]=t[u],o[h+1]=t[u+1],o[h+2]=t[u+2],e&&(o[h+3]=t[u+3]);for(s-=1/3,r=this.widthOriginal-1;s<r;i+=n,s+=a)for(l=1-(c=s%1),h=i,u=Math.floor(s)*n;h<this.widthPassResultSize;u+=this.originalWidthMultipliedByChannels,h+=this.targetWidthMultipliedByChannels)o[h+0]=t[u+0]*l+t[u+n+0]*c,o[h+1]=t[u+1]*l+t[u+n+1]*c,o[h+2]=t[u+2]*l+t[u+n+2]*c,e&&(o[h+3]=t[u+3]*l+t[u+n+3]*c);for(r=this.originalWidthMultipliedByChannels-n;i<this.targetWidthMultipliedByChannels;i+=n)for(h=i,u=r;h<this.widthPassResultSize;u+=this.originalWidthMultipliedByChannels,h+=this.targetWidthMultipliedByChannels)o[h]=t[u],o[h+1]=t[u+1],o[h+2]=t[u+2],e&&(o[h+3]=t[u+3]);return o},e.prototype._resizeWidthRGBChannels=function(t,e){var i=e?4:3,r=this.ratioWeightWidthPass,n=1/r,a=this.originalWidthMultipliedByChannels-i+1,o=this.targetWidthMultipliedByChannels-i+1,s=this.outputWidthWorkBench,h=this.widthBuffer,u=this.outputWidthWorkBenchOpaquePixelsCount,l=0,c=0,f=0,p=0,d=0,m=0,g=0,b=1,v=0,y=0,_=0,w=0;do{for(d=0;d<this.originalHeightMultipliedByChannels;)s[d++]=0,s[d++]=0,s[d++]=0,e&&(s[d++]=0,u[d/i-1]=0);l=r;do{for(c=1+f-p,b=Math.min(l,c),d=0,m=f;d<this.originalHeightMultipliedByChannels;m+=a)v=t[m],y=t[++m],_=t[++m],w=e?t[++m]:255,s[d++]+=(w?v:0)*b,s[d++]+=(w?y:0)*b,s[d++]+=(w?_:0)*b,e&&(s[d++]+=w*b,u[d/i-1]+=w?b:0);if(!(l>=c)){p+=l;break}p=f+=i,l-=c}while(l>0&&f<this.originalWidthMultipliedByChannels);for(d=0,m=g;d<this.originalHeightMultipliedByChannels;m+=o)l=e?u[d/i]:1,b=e?l?1/l:0:n,h[m]=s[d++]*b,h[++m]=s[d++]*b,h[++m]=s[d++]*b,e&&(h[++m]=s[d++]*n);g+=i}while(g<this.targetWidthMultipliedByChannels);return h},e.prototype._resizeHeightRGBChannels=function(t,e){var i=this.ratioWeightHeightPass,r=1/i,n=this.outputHeightWorkBench,a=this.heightBuffer,o=this.outputHeightWorkBenchOpaquePixelsCount,s=0,h=0,u=0,l=0,c=0,f=0,p=0,d=1,m=0,g=0,b=0,v=0;do{for(c=0;c<this.targetWidthMultipliedByChannels;)n[c++]=0,n[c++]=0,n[c++]=0,e&&(n[c++]=0,o[c/4-1]=0);s=i;do{for(h=1+u-l,d=Math.min(s,h),p=u,c=0;c<this.targetWidthMultipliedByChannels;)m=t[p++],g=t[p++],b=t[p++],v=e?t[p++]:255,n[c++]+=(v?m:0)*d,n[c++]+=(v?g:0)*d,n[c++]+=(v?b:0)*d,e&&(n[c++]+=v*d,o[c/4-1]+=v?d:0);if(!(s>=h)){l+=s;break}l=u=p,s-=h}while(s>0&&u<this.widthPassResultSize);for(c=0;c<this.targetWidthMultipliedByChannels;)s=e?o[c/4]:1,d=e?s?1/s:0:r,a[f++]=Math.round(n[c++]*d),a[f++]=Math.round(n[c++]*d),a[f++]=Math.round(n[c++]*d),e&&(a[f++]=Math.round(n[c++]*r))}while(f<this.finalResultSize);return a},e.prototype.resizeWidthInterpolatedRGB=function(t){return this._resizeWidthInterpolatedRGBChannels(t,!1)},e.prototype.resizeWidthInterpolatedRGBA=function(t){return this._resizeWidthInterpolatedRGBChannels(t,!0)},e.prototype.resizeWidthRGB=function(t){return this._resizeWidthRGBChannels(t,!1)},e.prototype.resizeWidthRGBA=function(t){return this._resizeWidthRGBChannels(t,!0)},e.prototype.resizeHeightInterpolated=function(t){for(var e,i=this.ratioWeightHeightPass,r=this.heightBuffer,n=0,a=0,o=0,s=0,h=0,u=0,l=0;n<1/3;n+=i)for(o=0;o<this.targetWidthMultipliedByChannels;)r[a++]=Math.round(t[o++]);for(n-=1/3,e=this.heightOriginal-1;n<e;n+=i)for(u=1-(l=n%1),h=(s=Math.floor(n)*this.targetWidthMultipliedByChannels)+this.targetWidthMultipliedByChannels,o=0;o<this.targetWidthMultipliedByChannels;++o)r[a++]=Math.round(t[s++]*u+t[h++]*l);for(;a<this.finalResultSize;)for(o=0,s=e*this.targetWidthMultipliedByChannels;o<this.targetWidthMultipliedByChannels;++o)r[a++]=Math.round(t[s++]);return r},e.prototype.resizeHeightRGB=function(t){return this._resizeHeightRGBChannels(t,!1)},e.prototype.resizeHeightRGBA=function(t){return this._resizeHeightRGBChannels(t,!0)},e.prototype.resize=function(t){this.resizeCallback(this.resizeHeight(this.resizeWidth(t)))},e.prototype.bypassResizer=function(t){return t},e.prototype.initializeFirstPassBuffers=function(t){this.widthBuffer=this.generateFloatBuffer(this.widthPassResultSize),t||(this.outputWidthWorkBench=this.generateFloatBuffer(this.originalHeightMultipliedByChannels),this.colorChannels>3&&(this.outputWidthWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.heightOriginal)))},e.prototype.initializeSecondPassBuffers=function(t){this.heightBuffer=this.generateUint8Buffer(this.finalResultSize),t||(this.outputHeightWorkBench=this.generateFloatBuffer(this.targetWidthMultipliedByChannels),this.colorChannels>3&&(this.outputHeightWorkBenchOpaquePixelsCount=this.generateFloat64Buffer(this.targetWidth)))},e.prototype.generateFloatBuffer=function(t){try{return new Float32Array(t)}catch(t){return[]}},e.prototype.generateFloat64Buffer=function(t){try{return new Float64Array(t)}catch(t){return[]}},e.prototype.generateUint8Buffer=function(t){try{return new Uint8Array(t)}catch(t){return[]}},t.exports=e},8226:t=>{"use strict";t.exports={nearestNeighbor:function(t,e){for(var i=t.width,r=t.height,n=e.width,a=e.height,o=t.data,s=e.data,h=0;h<a;h++)for(var u=0;u<n;u++){var l=4*(h*n+u),c=4*(Math.floor(h*r/a)*i+Math.floor(u*i/n));s[l++]=o[c++],s[l++]=o[c++],s[l++]=o[c++],s[l++]=o[c++]}},bilinearInterpolation:function(t,e){for(var i=t.width,r=t.height,n=e.width,a=e.height,o=t.data,s=e.data,h=function(t,e,i,r,n){return e===r?i:Math.round((t-e)*n+(r-t)*i)},u=function(t,e,r,n,a,u,l,c){var f=4*(l*i+n)+e,p=4*(l*i+a)+e,d=h(r,n,o[f],a,o[p]);if(c===l)s[t+e]=d;else{p=4*(c*i+a)+e;var m=h(r,n,o[f=4*(c*i+n)+e],a,o[p]);s[t+e]=h(u,l,d,c,m)}},l=0;l<a;l++)for(var c=0;c<n;c++){var f=4*(l*n+c),p=c*i/n,d=Math.floor(p),m=Math.min(Math.ceil(p),i-1),g=l*r/a,b=Math.floor(g),v=Math.min(Math.ceil(g),r-1);u(f,0,p,d,m,g,b,v),u(f,1,p,d,m,g,b,v),u(f,2,p,d,m,g,b,v),u(f,3,p,d,m,g,b,v)}},_interpolate2D:function(t,e,i,r){for(var n=t.data,a=e.data,o=t.width,s=t.height,h=e.width,u=e.height,l=Math.max(1,Math.floor(o/h)),c=h*l,f=Math.max(1,Math.floor(s/u)),p=u*f,d=Buffer.alloc(c*s*4),m=0;m<s;m++)for(var g=0;g<c;g++)for(var b=g*(o-1)/c,v=Math.floor(b),y=b-v,_=4*(m*o+v),w=4*(m*c+g),x=0;x<4;x++){var E=_+x,I=v>0?n[E-4]:2*n[E]-n[E+4],M=n[E],k=n[E+4],P=v<o-2?n[E+8]:2*n[E+4]-n[E];d[w+x]=r(I,M,k,P,y)}for(var T=Buffer.alloc(c*p*4),S=0;S<p;S++)for(var A=0;A<c;A++)for(var O=S*(s-1)/p,C=Math.floor(O),D=O-C,B=4*(C*c+A),N=4*(S*c+A),L=0;L<4;L++){var R=B+L,F=C>0?d[R-4*c]:2*d[R]-d[R+4*c],z=d[R],G=d[R+4*c],U=C<s-2?d[R+8*c]:2*d[R+4*c]-d[R];T[N+L]=r(F,z,G,U,D)}var j=l*f;if(j>1)for(var H=0;H<u;H++)for(var W=0;W<h;W++){for(var q=0,V=0,Y=0,Q=0,X=0,Z=0;Z<f;Z++)for(var J=H*f+Z,K=0;K<l;K++){var $=4*(J*c+(W*l+K)),tt=T[$+3];tt&&(q+=T[$],V+=T[$+1],Y+=T[$+2],X++),Q+=tt}var et=4*(H*h+W);a[et]=X?Math.round(q/X):0,a[et+1]=X?Math.round(V/X):0,a[et+2]=X?Math.round(Y/X):0,a[et+3]=Math.round(Q/j)}else e.data=T},bicubicInterpolation:function(t,e,i){return this._interpolate2D(t,e,i,(function(t,e,i,r,n){var a=r-i-t+e,o=t-e-a,s=i-t,h=e;return Math.max(0,Math.min(255,a*(n*n*n)+o*(n*n)+s*n+h))}))},hermiteInterpolation:function(t,e,i){return this._interpolate2D(t,e,i,(function(t,e,i,r,n){var a=e,o=.5*(i-t),s=t-2.5*e+2*i-.5*r,h=.5*(r-t)+1.5*(e-i);return Math.max(0,Math.min(255,Math.round(((h*n+s)*n+o)*n+a)))}))},bezierInterpolation:function(t,e,i){return this._interpolate2D(t,e,i,(function(t,e,i,r,n){var a=1-n,o=e*a*a*a,s=3*(e+(i-t)/4)*a*a*n,h=3*(i-(r-e)/4)*a*n*n,u=i*n*n*n;return Math.max(0,Math.min(255,Math.round(o+s+h+u)))}))}}},9814:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);function n(t,e){var i=(t%=360)*Math.PI/180,r=Math.cos(i),n=Math.sin(i),a=this.bitmap.width,o=this.bitmap.height;if(!0===e||"string"==typeof e){(a=Math.ceil(Math.abs(this.bitmap.width*r)+Math.abs(this.bitmap.height*n))+1)%2!=0&&a++,(o=Math.ceil(Math.abs(this.bitmap.width*n)+Math.abs(this.bitmap.height*r))+1)%2!=0&&o++;var s=this.cloneQuiet();this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,i){this.bitmap.data.writeUInt32BE(this._background,i)}));var h=Math.max(a,o,this.bitmap.width,this.bitmap.height);this.resize(h,h,e),this.blit(s,this.bitmap.width/2-s.bitmap.width/2,this.bitmap.height/2-s.bitmap.height/2)}var u=this.bitmap.width,l=this.bitmap.height,c=Buffer.alloc(this.bitmap.data.length);function f(t,e){return function(i,r){return{x:i+t,y:r+e}}}for(var p=f(-u/2,-l/2),d=f(u/2+.5,l/2+.5),m=1;m<=l;m++)for(var g=1;g<=u;g++){var b=p(g,m),v=d(r*b.x-n*b.y,r*b.y+n*b.x),y=u*(m-1)+g-1<<2;if(v.x>=0&&v.x<u&&v.y>=0&&v.y<l){var _=(u*(0|v.y)+v.x|0)<<2,w=this.bitmap.data.readUInt32BE(_);c.writeUInt32BE(w,y)}else c.writeUInt32BE(this._background,y)}if(this.bitmap.data=c,!0===e||"string"==typeof e){var x=u/2-a/2,E=l/2-o/2;this.crop(x,E,a,o)}}e.default=function(){return{rotate:function(t,e,i){return null==e&&(e=!0),"function"==typeof e&&void 0===i&&(i=e,e=!0),"number"!=typeof t?r.throwError.call(this,"deg must be a number",i):"boolean"!=typeof e&&"string"!=typeof e?r.throwError.call(this,"mode must be a boolean or a string",i):(n.call(this,t,e,i),(0,r.isNodePattern)(i)&&i.call(this,null,this),this)}}}},4246:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{scale:function(t,e,i){if("number"!=typeof t)return r.throwError.call(this,"f must be a number",i);if(t<0)return r.throwError.call(this,"f must be a positive number",i);"function"==typeof e&&void 0===i&&(i=e,e=null);var n=this.bitmap.width*t,a=this.bitmap.height*t;return this.resize(n,a,e),(0,r.isNodePattern)(i)&&i.call(this,null,this),this},scaleToFit:function(t,e,i,n){if("number"!=typeof t||"number"!=typeof e)return r.throwError.call(this,"w and h must be numbers",n);"function"==typeof i&&void 0===n&&(n=i,i=null);var a=t/e>this.bitmap.width/this.bitmap.height?e/this.bitmap.height:t/this.bitmap.width;return this.scale(a,i),(0,r.isNodePattern)(n)&&n.call(this,null,this),this}}}},2510:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{shadow:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(i=e,e={});var n=e,a=n.opacity,o=void 0===a?.7:a,s=n.size,h=void 0===s?1.1:s,u=n.x,l=void 0===u?-25:u,c=n.y,f=void 0===c?25:c,p=n.blur,d=void 0===p?5:p,m=this.clone(),g=this.clone();return g.scan(0,0,g.bitmap.width,g.bitmap.height,(function(e,i,r){g.bitmap.data[r]=0,g.bitmap.data[r+1]=0,g.bitmap.data[r+2]=0,g.bitmap.data[r+3]=g.constructor.limit255(g.bitmap.data[r+3]*o),t.bitmap.data[r]=0,t.bitmap.data[r+1]=0,t.bitmap.data[r+2]=0,t.bitmap.data[r+3]=0})),g.resize(g.bitmap.width*h,g.bitmap.height*h).blur(d),this.composite(g,l,f),this.composite(m,0,0),(0,r.isNodePattern)(i)&&i.call(this,null,this),this}}}},4538:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=i(1567);e.default=function(){return{threshold:function(t,e){var i=this,n=t.max,a=t.replace,o=void 0===a?255:a,s=t.autoGreyscale,h=void 0===s||s;return"number"!=typeof n?r.throwError.call(this,"max must be a number",e):"number"!=typeof o?r.throwError.call(this,"replace must be a number",e):"boolean"!=typeof h?r.throwError.call(this,"autoGreyscale must be a boolean",e):(n=this.constructor.limit255(n),o=this.constructor.limit255(o),h&&this.greyscale(),this.scanQuiet(0,0,this.bitmap.width,this.bitmap.height,(function(t,e,r){var a=i.bitmap.data[r]<n?i.bitmap.data[r]:o;i.bitmap.data[r]=a,i.bitmap.data[r+1]=a,i.bitmap.data[r+2]=a})),(0,r.isNodePattern)(e)&&e.call(this,null,this),this)}}}},6240:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(319)),a=i(7011),o=r(i(2260)),s=r(i(7139)),h=r(i(4650)),u=r(i(809)),l=r(i(7890)),c=r(i(4587)),f=r(i(6544)),p=r(i(7679)),d=r(i(5380)),m=r(i(9462)),g=r(i(5980)),b=r(i(5092)),v=r(i(9085)),y=r(i(6597)),_=r(i(2042)),w=r(i(8869)),x=r(i(90)),E=r(i(9814)),I=r(i(4246)),M=r(i(2510)),k=r(i(4538)),P=[o.default,s.default,h.default,u.default,l.default,c.default,f.default,p.default,d.default,m.default,g.default,b.default,v.default,y.default,_.default,w.default,x.default,E.default,I.default,M.default,k.default];e.default=function(t){var e=P.map((function(e){var i=e(t)||{};return i.class||i.constants||(i={class:i}),i}));return a.mergeDeep.apply(void 0,(0,n.default)(e))}},7447:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(9713)),a=i(5477),o=i(1567),s="image/png";e.default=function(){return{mime:(0,n.default)({},s,["png"]),constants:{MIME_PNG:s,PNG_FILTER_AUTO:-1,PNG_FILTER_NONE:0,PNG_FILTER_SUB:1,PNG_FILTER_UP:2,PNG_FILTER_AVERAGE:3,PNG_FILTER_PATH:4},hasAlpha:(0,n.default)({},s,!0),decoders:(0,n.default)({},s,a.PNG.sync.read),encoders:(0,n.default)({},s,(function(t){var e=new a.PNG({width:t.bitmap.width,height:t.bitmap.height});return e.data=t.bitmap.data,a.PNG.sync.write(e,{width:t.bitmap.width,height:t.bitmap.height,deflateLevel:t._deflateLevel,deflateStrategy:t._deflateStrategy,filterType:t._filterType,colorType:"number"==typeof t._colorType?t._colorType:t._rgba?6:2,inputHasAlpha:t._rgba})})),class:{_deflateLevel:9,_deflateStrategy:3,_filterType:-1,_colorType:null,deflateLevel:function(t,e){return"number"!=typeof t?o.throwError.call(this,"l must be a number",e):t<0||t>9?o.throwError.call(this,"l must be a number 0 - 9",e):(this._deflateLevel=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},deflateStrategy:function(t,e){return"number"!=typeof t?o.throwError.call(this,"s must be a number",e):t<0||t>3?o.throwError.call(this,"s must be a number 0 - 3",e):(this._deflateStrategy=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},filterType:function(t,e){return"number"!=typeof t?o.throwError.call(this,"n must be a number",e):t<-1||t>4?o.throwError.call(this,"n must be -1 (auto) or a number 0 - 4",e):(this._filterType=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)},colorType:function(t,e){return"number"!=typeof t?o.throwError.call(this,"s must be a number",e):0!==t&&2!==t&&4!==t&&6!==t?o.throwError.call(this,"s must be a number 0, 2, 4, 6.",e):(this._colorType=Math.round(t),(0,o.isNodePattern)(e)&&e.call(this,null,this),this)}}}}},1326:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(9713)),a=r(i(6173)),o="image/tiff";e.default=function(){return{mime:(0,n.default)({},o,["tiff","tif"]),constants:{MIME_TIFF:o},decoders:(0,n.default)({},o,(function(t){var e=a.default.decode(t),i=e[0];a.default.decodeImages(t,e);var r=a.default.toRGBA8(i);return{data:Buffer.from(r),width:i.t256[0],height:i.t257[0]}})),encoders:(0,n.default)({},o,(function(t){var e=a.default.encodeImage(t.bitmap.data,t.bitmap.width,t.bitmap.height);return Buffer.from(e)}))}}},7209:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i(7011),a=r(i(3853)),o=r(i(7447)),s=r(i(2878)),h=r(i(1326)),u=r(i(2744));e.default=function(){return(0,n.mergeDeep)((0,a.default)(),(0,o.default)(),(0,s.default)(),(0,h.default)(),(0,u.default)())}},1567:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.isNodePattern=function(t){if(void 0===t)return!1;if("function"!=typeof t)throw new TypeError("Callback must be a function");return!0},e.throwError=function(t,e){if("string"==typeof t&&(t=new Error(t)),"function"==typeof e)return e.call(this,t);throw t},e.scan=function(t,e,i,r,n,a){e=Math.round(e),i=Math.round(i),r=Math.round(r),n=Math.round(n);for(var o=i;o<i+n;o++)for(var s=e;s<e+r;s++){var h=t.bitmap.width*o+s<<2;a.call(t,s,o,h)}return t},e.scanIterator=o;var n=r(i(7757)),a=n.default.mark(o);function o(t,e,i,r,o){var s,h,u;return n.default.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:e=Math.round(e),i=Math.round(i),r=Math.round(r),o=Math.round(o),s=i;case 5:if(!(s<i+o)){n.next=17;break}h=e;case 7:if(!(h<e+r)){n.next=14;break}return u=t.bitmap.width*s+h<<2,n.next=11,{x:h,y:s,idx:u,image:t};case 11:h++,n.next=7;break;case 14:s++,n.next=5;break;case 17:case"end":return n.stop()}}),a)}},964:(t,e,i)=>{var r=i(2661);function n(t,e){var i=new r(t,e);return function(t){return i.convert(t)}}n.BIN="01",n.OCT="01234567",n.DEC="0123456789",n.HEX="0123456789abcdef",t.exports=n},2661:t=>{"use strict";function e(t,e){if(!(t&&e&&t.length&&e.length))throw new Error("Bad alphabet");this.srcAlphabet=t,this.dstAlphabet=e}e.prototype.convert=function(t){var e,i,r,n={},a=this.srcAlphabet.length,o=this.dstAlphabet.length,s=t.length,h="string"==typeof t?"":[];if(!this.isValid(t))throw new Error('Number "'+t+'" contains of non-alphabetic digits ('+this.srcAlphabet+")");if(this.srcAlphabet===this.dstAlphabet)return t;for(e=0;e<s;e++)n[e]=this.srcAlphabet.indexOf(t[e]);do{for(i=0,r=0,e=0;e<s;e++)(i=i*a+n[e])>=o?(n[r++]=parseInt(i/o,10),i%=o):r>0&&(n[r++]=0);s=r,h=this.dstAlphabet.slice(i,i+1).concat(h)}while(0!==r);return h},e.prototype.isValid=function(t){for(var e=0;e<t.length;++e)if(-1===this.srcAlphabet.indexOf(t[e]))return!1;return!0},t.exports=e},6561:t=>{"use strict";const e=new Set(["json","buffer","string"]);t.exports=t=>(...i)=>{const r=new Set;let n,a,o,s="";return i.forEach((t=>{if("string"==typeof t)if(t.toUpperCase()===t){if(n)throw new Error(`Can't set method to ${t}, already set to ${n}.`);n=t}else if(t.startsWith("http:")||t.startsWith("https:"))s=t;else{if(!e.has(t))throw new Error(`Unknown encoding, ${t}`);a=t}else if("number"==typeof t)r.add(t);else{if("object"!=typeof t)throw new Error("Unknown type: "+typeof t);if(Array.isArray(t)||t instanceof Set)t.forEach((t=>r.add(t)));else{if(o)throw new Error("Cannot set headers twice.");o=t}}})),n||(n="GET"),0===r.size&&r.add(200),t(r,n,a,o,s)}},86:(t,e,i)=>{"use strict";const r=i(8605),n=i(7211),{URL:a}=i(8835),o=i(4970),s=i(9894),h=i(1950),u=i(6561),l=i(8761),{PassThrough:c}=i(2413),f={};l.createBrotliDecompress&&(f.br=()=>l.createBrotliDecompress()),l.createGunzip&&(f.gzip=()=>l.createGunzip()),l.createInflate&&(f.deflate=()=>l.createInflate());const p=Object.keys(f).join(", ");class d extends Error{constructor(t,...e){let i;super(...e),Error.captureStackTrace(this,d),this.name="StatusError",this.message=t.statusMessage,this.statusCode=t.statusCode,this.json=t.json,this.text=t.text,this.arrayBuffer=t.arrayBuffer,this.headers=t.headers,Object.defineProperty(this,"responseBody",{get:()=>(i||(i=this.arrayBuffer()),i)})}}t.exports=u(((t,e,i,u,l)=>(m,g=null,b={})=>{const v=new a(m=l+(m||""));let y;if("https:"===v.protocol)y=n;else{if("http:"!==v.protocol)throw new Error(`Unknown protocol, ${v.protocol}`);y=r}const _={path:v.pathname+v.search,port:v.port,method:e,headers:{...u||{},...b},hostname:v.hostname};(v.username||v.password)&&(_.auth=[v.username,v.password].join(":"));const w=s(_.headers);return"json"===i&&(w.get("accept")||w.set("accept","application/json")),w.has("accept-encoding")||w.set("accept-encoding",p),new Promise(((e,r)=>{const n=y.request(_,(async n=>((n=(t=>{const e=new c;if(e.statusCode=t.statusCode,e.status=t.statusCode,e.statusMessage=t.statusMessage,e.headers=t.headers,e._response=t,e.headers["content-encoding"]){const i=e.headers["content-encoding"].split(", ").reverse();for(;i.length;){const r=i.shift();if(!f[r])break;{const i=f[r]();i.on("error",(t=>e.emit("error",new Error("ZBufError",t)))),t=t.pipe(i)}}}return t.pipe(e)})(n)).on("error",r),(t=>{let e;t.arrayBuffer=()=>{if(e)throw new Error("body stream is locked");return i=t,e=new Promise(((t,e)=>{const r=[];i.on("error",e),i.on("end",(()=>t(Buffer.concat(r)))),i.on("data",(t=>r.push(t)))})),e;var i},t.text=()=>t.arrayBuffer().then((t=>t.toString())),t.json=async()=>{const e=await t.text();try{return JSON.parse(e)}catch(t){throw t.message+=`str"${e}"`,t}}})(n),n.status=n.statusCode,t.has(n.statusCode)?i?void("buffer"===i?e(n.arrayBuffer()):"json"===i?e(n.json()):"string"===i&&e(n.text())):e(n):r(new d(n)))));n.on("error",r),g?((g instanceof ArrayBuffer||ArrayBuffer.isView(g))&&(g=h.native(g)),Buffer.isBuffer(g)||("string"==typeof g?g=Buffer.from(g):o(g)?(g.pipe(n),g=null):"object"==typeof g?(w.has("content-type")||n.setHeader("content-type","application/json"),g=Buffer.from(JSON.stringify(g))):r(new Error("Unknown body type."))),g&&(n.setHeader("content-length",g.length),n.end(g))):n.end()}))}))},784:(t,e,i)=>{var r=i(8232),n=i(6871);t.exports={encode:r,decode:n}},6871:t=>{function e(t,e){if(this.pos=0,this.buffer=t,this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=this.buffer.toString("utf-8",0,this.pos+=2),"BM"!=this.flag)throw new Error("Invalid BMP File");this.parseHeader(),this.parseRGBA()}e.prototype.parseHeader=function(){if(this.fileSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.reserved=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.offset=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.headerSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.width=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.height=this.buffer.readInt32LE(this.pos),this.pos+=4,this.planes=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.bitPP=this.buffer.readUInt16LE(this.pos),this.pos+=2,this.compress=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.rawSize=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.hr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.vr=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.colors=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.importantColors=this.buffer.readUInt32LE(this.pos),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var i=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++);this.palette[e]={red:n,green:r,blue:i,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},e.prototype.parseRGBA=function(){var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Buffer(e),this[t]()},e.prototype.bit1=function(){var t=Math.ceil(this.width/8),e=t%4,i=this.height>=0?this.height-1:-this.height;for(i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<t;n++)for(var a=this.buffer.readUInt8(this.pos++),o=r*this.width*4+8*n*4,s=0;s<8&&8*n+s<this.width;s++){var h=this.palette[a>>7-s&1];this.data[o+4*s]=0,this.data[o+4*s+1]=h.blue,this.data[o+4*s+2]=h.green,this.data[o+4*s+3]=h.red}0!=e&&(this.pos+=4-e)}},e.prototype.bit4=function(){if(2==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0,i=!1;t<this.data.length;){var r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++);if(0==r){if(0==n){this.bottom_up?e--:e++,t=e*this.width*4,i=!1;continue}if(1==n)break;if(2==n){var a=this.buffer.readUInt8(this.pos++),o=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=o:e+=o,t+=o*this.width*4+4*a}else{for(var s=this.buffer.readUInt8(this.pos++),h=0;h<n;h++)i?u.call(this,15&s):u.call(this,(240&s)>>4),1&h&&h+1<n&&(s=this.buffer.readUInt8(this.pos++)),i=!i;1==(n+1>>1&1)&&this.pos++}}else for(h=0;h<r;h++)i?u.call(this,15&n):u.call(this,(240&n)>>4),i=!i}function u(e){var i=this.palette[e];this.data[t]=0,this.data[t+1]=i.blue,this.data[t+2]=i.green,this.data[t+3]=i.red,t+=4}}else{var l=Math.ceil(this.width/2),c=l%4;for(o=this.height-1;o>=0;o--){var f=this.bottom_up?o:this.height-1-o;for(a=0;a<l;a++){n=this.buffer.readUInt8(this.pos++),t=f*this.width*4+2*a*4;var p=n>>4,d=15&n,m=this.palette[p];if(this.data[t]=0,this.data[t+1]=m.blue,this.data[t+2]=m.green,this.data[t+3]=m.red,2*a+1>=this.width)break;m=this.palette[d],this.data[t+4]=0,this.data[t+4+1]=m.blue,this.data[t+4+2]=m.green,this.data[t+4+3]=m.red}0!=c&&(this.pos+=4-c)}}},e.prototype.bit8=function(){if(1==this.compress){this.data.fill(255);for(var t=0,e=this.bottom_up?this.height-1:0;t<this.data.length;){var i=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++);if(0==i){if(0==r){this.bottom_up?e--:e++,t=e*this.width*4;continue}if(1==r)break;if(2==r){var n=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++);this.bottom_up?e-=a:e+=a,t+=a*this.width*4+4*n}else{for(var o=0;o<r;o++){var s=this.buffer.readUInt8(this.pos++);h.call(this,s)}!0&r&&this.pos++}}else for(o=0;o<i;o++)h.call(this,r)}function h(e){var i=this.palette[e];this.data[t]=0,this.data[t+1]=i.blue,this.data[t+2]=i.green,this.data[t+3]=i.red,t+=4}}else{var u=this.width%4;for(a=this.height-1;a>=0;a--){var l=this.bottom_up?a:this.height-1-a;for(n=0;n<this.width;n++)if(r=this.buffer.readUInt8(this.pos++),t=l*this.width*4+4*n,r<this.palette.length){var c=this.palette[r];this.data[t]=0,this.data[t+1]=c.blue,this.data[t+2]=c.green,this.data[t+3]=c.red}else this.data[t]=0,this.data[t+1]=255,this.data[t+2]=255,this.data[t+3]=255;0!=u&&(this.pos+=4-u)}}},e.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),i=this.height-1;i>=0;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<this.width;n++){var a=this.buffer.readUInt16LE(this.pos);this.pos+=2;var o=(a&e)/e*255|0,s=(a>>5&e)/e*255|0,h=(a>>10&e)/e*255|0,u=a>>15?255:0,l=r*this.width*4+4*n;this.data[l]=u,this.data[l+1]=o,this.data[l+2]=s,this.data[l+3]=h}this.pos+=t}},e.prototype.bit16=function(){var t=this.width%2*2;this.maskRed=31744,this.maskGreen=992,this.maskBlue=31,this.mask0=0,3==this.compress&&(this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4);for(var e=[0,0,0],i=0;i<16;i++)this.maskRed>>i&1&&e[0]++,this.maskGreen>>i&1&&e[1]++,this.maskBlue>>i&1&&e[2]++;e[1]+=e[0],e[2]+=e[1],e[0]=8-e[0],e[1]-=8,e[2]-=8;for(var r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var o=this.buffer.readUInt16LE(this.pos);this.pos+=2;var s=(o&this.maskBlue)<<e[0],h=(o&this.maskGreen)>>e[1],u=(o&this.maskRed)>>e[2],l=n*this.width*4+4*a;this.data[l]=0,this.data[l+1]=s,this.data[l+2]=h,this.data[l+3]=u}this.pos+=t}},e.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++),o=e*this.width*4+4*i;this.data[o]=0,this.data[o+1]=r,this.data[o+2]=n,this.data[o+3]=a}this.pos+=this.width%4}},e.prototype.bit32=function(){if(3==this.compress){this.maskRed=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskGreen=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.maskBlue=this.buffer.readUInt32LE(this.pos),this.pos+=4,this.mask0=this.buffer.readUInt32LE(this.pos),this.pos+=4;for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var r=this.buffer.readUInt8(this.pos++),n=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++),o=this.buffer.readUInt8(this.pos++),s=e*this.width*4+4*i;this.data[s]=r,this.data[s+1]=n,this.data[s+2]=a,this.data[s+3]=o}}else for(t=this.height-1;t>=0;t--)for(e=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++)n=this.buffer.readUInt8(this.pos++),a=this.buffer.readUInt8(this.pos++),o=this.buffer.readUInt8(this.pos++),r=this.buffer.readUInt8(this.pos++),s=e*this.width*4+4*i,this.data[s]=r,this.data[s+1]=n,this.data[s+2]=a,this.data[s+3]=o},e.prototype.getData=function(){return this.data},t.exports=function(t){return new e(t)}},8232:t=>{function e(t){this.buffer=t.data,this.width=t.width,this.height=t.height,this.extraBytes=this.width%4,this.rgbSize=this.height*(3*this.width+this.extraBytes),this.headerInfoSize=40,this.data=[],this.flag="BM",this.reserved=0,this.offset=54,this.fileSize=this.rgbSize+this.offset,this.planes=1,this.bitPP=24,this.compress=0,this.hr=0,this.vr=0,this.colors=0,this.importantColors=0}e.prototype.encode=function(){var t=new Buffer(this.offset+this.rgbSize);this.pos=0,t.write(this.flag,this.pos,2),this.pos+=2,t.writeUInt32LE(this.fileSize,this.pos),this.pos+=4,t.writeUInt32LE(this.reserved,this.pos),this.pos+=4,t.writeUInt32LE(this.offset,this.pos),this.pos+=4,t.writeUInt32LE(this.headerInfoSize,this.pos),this.pos+=4,t.writeUInt32LE(this.width,this.pos),this.pos+=4,t.writeInt32LE(-this.height,this.pos),this.pos+=4,t.writeUInt16LE(this.planes,this.pos),this.pos+=2,t.writeUInt16LE(this.bitPP,this.pos),this.pos+=2,t.writeUInt32LE(this.compress,this.pos),this.pos+=4,t.writeUInt32LE(this.rgbSize,this.pos),this.pos+=4,t.writeUInt32LE(this.hr,this.pos),this.pos+=4,t.writeUInt32LE(this.vr,this.pos),this.pos+=4,t.writeUInt32LE(this.colors,this.pos),this.pos+=4,t.writeUInt32LE(this.importantColors,this.pos),this.pos+=4;for(var e=0,i=3*this.width+this.extraBytes,r=0;r<this.height;r++){for(var n=0;n<this.width;n++){var a=this.pos+r*i+3*n;e++,t[a]=this.buffer[e++],t[a+1]=this.buffer[e++],t[a+2]=this.buffer[e++]}if(this.extraBytes>0){var o=this.pos+r*i+3*this.width;t.fill(0,o,o+this.extraBytes)}}return t},t.exports=function(t,i){return void 0===i&&(i=100),{data:new e(t).encode(),width:t.width,height:t.height}}},2369:(t,e,i)=>{var r=i(4293).Buffer;t.exports=function(t,e){if(r.isBuffer(t)&&r.isBuffer(e)){if("function"==typeof t.equals)return t.equals(e);if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}}},6394:(t,e,i)=>{"use strict";const r=i(9328);r.from=(t,e)=>{if(t instanceof DataView)return t;if(t instanceof ArrayBuffer)return new DataView(t);let i;if("string"==typeof t){if(e){if("base64"===e)return i=Uint8Array.from(atob(t),(t=>t.charCodeAt(0))).buffer,new DataView(i)}else e="utf-8";if("utf-8"!==e)throw new Error("Browser support for encodings other than utf-8 not implemented");return new DataView((new TextEncoder).encode(t).buffer)}if("object"==typeof t&&ArrayBuffer.isView(t))return t.byteLength===t.buffer.byteLength?new DataView(t.buffer):new DataView(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unkown type. Cannot convert to ArrayBuffer")},r.toString=(t,e)=>{t=r(t,e);const i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n=String.fromCharCode(...i);return"base64"===e?btoa(n):n},r.native=(t,e)=>t instanceof Uint8Array?t:(t=r.from(t,e),new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),process.browser&&(r._randomFill=(...t)=>crypto.getRandomValues(...t)),t.exports=r},9328:t=>{"use strict";const e=(t,i)=>e.from(t,i);e.sorter=(t,i)=>{const r=((t,e)=>t.byteLength===e.byteLength||t.byteLength>e.byteLength?t.byteLength:e.byteLength)(t=e(t),i=e(i));let n=0;for(;n<r-1;){if(n>=t.byteLength)return 1;if(n>=i.byteLength)return-1;if(t.getUint8(n)<i.getUint8(n))return-1;if(t.getUint8(n)>i.getUint8(n))return 1;n++}return 0},e.compare=(t,i)=>!e.sorter(t,i),e.memcopy=(t,i)=>{const r=e(t,i);return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)},e.arrayBuffer=(t,i)=>(t=e(t,i)).buffer.byteLength===t.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);const i=(t,i=0,r=null)=>(t=e(t),r=(null===r?t.byteLength:r)-i,[t.buffer,t.byteOffset+i,r]);e.slice=(t,e,r)=>new DataView(...i(t,e,r)),e.memcopySlice=(t,e,r)=>{const[n,a,o]=i(t,e,r);return n.slice(a,o+a)},e.typedArray=(t,i=Uint8Array)=>new i((t=e(t)).buffer,t.byteOffset,t.byteLength/i.BYTES_PER_ELEMENT),e.concat=t=>{const i=(t=(t=Array.from(t)).map((t=>e(t)))).reduce(((t,e)=>t+e.byteLength),0),r=new Uint8Array(i);let n=0;for(const i of t){const t=e.typedArray(i);r.set(t,n),n+=t.byteLength}return r.buffer};const r=65536;e.random=t=>{const i=new ArrayBuffer(t);if(t>r){let t=0;for(;t<i.byteLength;){let n;n=t+r>i.byteLength?i.byteLength-t:r;const a=new Uint8Array(i,t,n);t+=r,e._randomFill(a)}}else{const t=new Uint8Array(i);e._randomFill(t)}return i},t.exports=e},1950:(t,e,i)=>{"use strict";const r=i(6417),n=i(6394).from,a=i(9328);a.from=(t,e)=>t instanceof DataView?t:t instanceof ArrayBuffer?new DataView(t):("string"==typeof t&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)?new DataView(t.buffer,t.byteOffset,t.byteLength):n(t,e)),a.toString=(t,e)=>(t=a(t),Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString(e)),a.native=(t,e)=>Buffer.isBuffer(t)?t:(t=a(t,e),Buffer.from(t.buffer,t.byteOffset,t.byteLength)),a._randomFill=r.randomFillSync,t.exports=a},9894:t=>{function e(t){this.dict=t||{}}e.prototype.set=function(t,e,i){if("object"!=typeof t){void 0===i&&(i=!0);var r=this.has(t);return!i&&r?this.dict[r]=this.dict[r]+","+e:this.dict[r||t]=e,r}for(var n in t)this.set(n,t[n],e)},e.prototype.has=function(t){for(var e=Object.keys(this.dict),i=(t=t.toLowerCase(),0);i<e.length;i++)if(e[i].toLowerCase()===t)return e[i];return!1},e.prototype.get=function(t){var e,i;t=t.toLowerCase();var r=this.dict;return Object.keys(r).forEach((function(n){i=n.toLowerCase(),t===i&&(e=r[n])})),e},e.prototype.swap=function(t){var e=this.has(t);if(e!==t){if(!e)throw new Error('There is no header than matches "'+t+'"');this.dict[t]=this.dict[e],delete this.dict[e]}},e.prototype.del=function(t){var e=this.has(t);return delete this.dict[e||t]},t.exports=function(t){return new e(t)},t.exports.httpify=function(t,i){var r=new e(i);return t.setHeader=function(t,e,i){if(void 0!==e)return r.set(t,e,i)},t.hasHeader=function(t){return r.has(t)},t.getHeader=function(t){return r.get(t)},t.removeHeader=function(t){return r.del(t)},t.headers=r.dict,r}},2594:(t,e,i)=>{var r=i(3518);t.exports={create:function(t,e){if(t instanceof(e=e||(0,eval)("this")).ArrayBuffer){var n=i(9565);return new r(new n(t,0,t.byteLength,!0,e))}var a=i(1618);return new r(new a(t,0,t.length,!0))}}},1618:t=>{function e(t,e,i,r){this.buffer=t,this.offset=e||0,i="number"==typeof i?i:t.length,this.endPosition=this.offset+i,this.setBigEndian(r)}e.prototype={setBigEndian:function(t){this.bigEndian=!!t},nextUInt8:function(){var t=this.buffer.readUInt8(this.offset);return this.offset+=1,t},nextInt8:function(){var t=this.buffer.readInt8(this.offset);return this.offset+=1,t},nextUInt16:function(){var t=this.bigEndian?this.buffer.readUInt16BE(this.offset):this.buffer.readUInt16LE(this.offset);return this.offset+=2,t},nextUInt32:function(){var t=this.bigEndian?this.buffer.readUInt32BE(this.offset):this.buffer.readUInt32LE(this.offset);return this.offset+=4,t},nextInt16:function(){var t=this.bigEndian?this.buffer.readInt16BE(this.offset):this.buffer.readInt16LE(this.offset);return this.offset+=2,t},nextInt32:function(){var t=this.bigEndian?this.buffer.readInt32BE(this.offset):this.buffer.readInt32LE(this.offset);return this.offset+=4,t},nextFloat:function(){var t=this.bigEndian?this.buffer.readFloatBE(this.offset):this.buffer.readFloatLE(this.offset);return this.offset+=4,t},nextDouble:function(){var t=this.bigEndian?this.buffer.readDoubleBE(this.offset):this.buffer.readDoubleLE(this.offset);return this.offset+=8,t},nextBuffer:function(t){var e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},remainingLength:function(){return this.endPosition-this.offset},nextString:function(t){var e=this.buffer.toString("utf8",this.offset,this.offset+t);return this.offset+=t,e},mark:function(){var t=this;return{openWithOffset:function(i){return i=(i||0)+this.offset,new e(t.buffer,i,t.endPosition-i,t.bigEndian)},offset:this.offset}},offsetFrom:function(t){return this.offset-t.offset},skip:function(t){this.offset+=t},branch:function(t,i){return i="number"==typeof i?i:this.endPosition-(this.offset+t),new e(this.buffer,this.offset+t,i,this.bigEndian)}},t.exports=e},292:t=>{function e(t){return parseInt(t,10)}function i(t,i){t=t.map(e),i=i.map(e);var r=t[0],n=t[1]-1,a=t[2],o=i[0],s=i[1],h=i[2];return Date.UTC(r,n,a,o,s,h,0)/1e3}function r(t){var r=t.substr(0,10).split("-"),n=t.substr(11,8).split(":"),a=t.substr(19,6).split(":").map(e),o=3600*a[0]+60*a[1],s=i(r,n);if("number"==typeof(s-=o)&&!isNaN(s))return s}function n(t){var e=t.split(" "),r=i(e[0].split(":"),e[1].split(":"));if("number"==typeof r&&!isNaN(r))return r}t.exports={parseDateWithSpecFormat:n,parseDateWithTimezoneFormat:r,parseExifDate:function(t){var e=19===t.length&&":"===t.charAt(4);return 25===t.length&&"T"===t.charAt(10)?r(t):e?n(t):void 0}}},9565:t=>{function e(t,e,i,r,n,a){this.global=n,e=e||0,i=i||t.byteLength-e,this.arrayBuffer=t.slice(e,e+i),this.view=new n.DataView(this.arrayBuffer,0,this.arrayBuffer.byteLength),this.setBigEndian(r),this.offset=0,this.parentOffset=(a||0)+e}e.prototype={setBigEndian:function(t){this.littleEndian=!t},nextUInt8:function(){var t=this.view.getUint8(this.offset);return this.offset+=1,t},nextInt8:function(){var t=this.view.getInt8(this.offset);return this.offset+=1,t},nextUInt16:function(){var t=this.view.getUint16(this.offset,this.littleEndian);return this.offset+=2,t},nextUInt32:function(){var t=this.view.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},nextInt16:function(){var t=this.view.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},nextInt32:function(){var t=this.view.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},nextFloat:function(){var t=this.view.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},nextDouble:function(){var t=this.view.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},nextBuffer:function(t){var e=this.arrayBuffer.slice(this.offset,this.offset+t);return this.offset+=t,e},remainingLength:function(){return this.arrayBuffer.byteLength-this.offset},nextString:function(t){var e=this.arrayBuffer.slice(this.offset,this.offset+t);return e=String.fromCharCode.apply(null,new this.global.Uint8Array(e)),this.offset+=t,e},mark:function(){var t=this;return{openWithOffset:function(i){return i=(i||0)+this.offset,new e(t.arrayBuffer,i,t.arrayBuffer.byteLength-i,!t.littleEndian,t.global,t.parentOffset)},offset:this.offset,getParentOffset:function(){return t.parentOffset}}},offsetFrom:function(t){return this.parentOffset+this.offset-(t.offset+t.getParentOffset())},skip:function(t){this.offset+=t},branch:function(t,i){return i="number"==typeof i?i:this.arrayBuffer.byteLength-(this.offset+t),new e(this.arrayBuffer,this.offset+t,i,!this.littleEndian,this.global,this.parentOffset)}},t.exports=e},2108:t=>{t.exports={exif:{1:"InteropIndex",2:"InteropVersion",11:"ProcessingSoftware",254:"SubfileType",255:"OldSubfileType",256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:"Thresholding",264:"CellWidth",265:"CellLength",266:"FillOrder",269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",285:"PageName",286:"XPosition",287:"YPosition",288:"FreeOffsets",289:"FreeByteCounts",290:"GrayResponseUnit",291:"GrayResponseCurve",292:"T4Options",293:"T6Options",296:"ResolutionUnit",297:"PageNumber",300:"ColorResponseUnit",301:"TransferFunction",305:"Software",306:"ModifyDate",315:"Artist",316:"HostComputer",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",320:"ColorMap",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffsets",325:"TileByteCounts",326:"BadFaxLines",327:"CleanFaxData",328:"ConsecutiveBadFaxLines",330:"SubIFD",332:"InkSet",333:"InkNames",334:"NumberofInks",336:"DotRange",337:"TargetPrinter",338:"ExtraSamples",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",342:"TransferRange",343:"ClipPath",344:"XClipPathUnits",345:"YClipPathUnits",346:"Indexed",347:"JPEGTables",351:"OPIProxy",400:"GlobalParametersIFD",401:"ProfileType",402:"FaxProfile",403:"CodingMethods",404:"VersionYear",405:"ModeNumber",433:"Decode",434:"DefaultImageColor",435:"T82Options",437:"JPEGTables",512:"JPEGProc",513:"ThumbnailOffset",514:"ThumbnailLength",515:"JPEGRestartInterval",517:"JPEGLosslessPredictors",518:"JPEGPointTransforms",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",559:"StripRowCounts",700:"ApplicationNotes",999:"USPTOMiscellaneous",4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight",18246:"Rating",18247:"XP_DIP_XML",18248:"StitchInfo",18249:"RatingPercent",32781:"ImageID",32931:"WangTag1",32932:"WangAnnotation",32933:"WangTag3",32934:"WangTag4",32995:"Matteing",32996:"DataType",32997:"ImageDepth",32998:"TileDepth",33405:"Model2",33421:"CFARepeatPatternDim",33422:"CFAPattern2",33423:"BatteryLevel",33424:"KodakIFD",33432:"Copyright",33434:"ExposureTime",33437:"FNumber",33445:"MDFileTag",33446:"MDScalePixel",33447:"MDColorTable",33448:"MDLabName",33449:"MDSampleInfo",33450:"MDPrepDate",33451:"MDPrepTime",33452:"MDFileUnits",33550:"PixelScale",33589:"AdventScale",33590:"AdventRevision",33628:"UIC1Tag",33629:"UIC2Tag",33630:"UIC3Tag",33631:"UIC4Tag",33723:"IPTC-NAA",33918:"IntergraphPacketData",33919:"IntergraphFlagRegisters",33920:"IntergraphMatrix",33921:"INGRReserved",33922:"ModelTiePoint",34016:"Site",34017:"ColorSequence",34018:"IT8Header",34019:"RasterPadding",34020:"BitsPerRunLength",34021:"BitsPerExtendedRunLength",34022:"ColorTable",34023:"ImageColorIndicator",34024:"BackgroundColorIndicator",34025:"ImageColorValue",34026:"BackgroundColorValue",34027:"PixelIntensityRange",34028:"TransparencyIndicator",34029:"ColorCharacterization",34030:"HCUsage",34031:"TrapIndicator",34032:"CMYKEquivalent",34118:"SEMInfo",34152:"AFCP_IPTC",34232:"PixelMagicJBIGOptions",34264:"ModelTransform",34306:"WB_GRGBLevels",34310:"LeafData",34377:"PhotoshopSettings",34665:"ExifOffset",34675:"ICC_Profile",34687:"TIFF_FXExtensions",34688:"MultiProfiles",34689:"SharedData",34690:"T88Options",34732:"ImageLayer",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34850:"ExposureProgram",34852:"SpectralSensitivity",34853:"GPSInfo",34855:"ISO",34856:"Opto-ElectricConvFactor",34857:"Interlace",34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",34908:"FaxRecvParams",34909:"FaxSubAddress",34910:"FaxRecvTime",34954:"LeafSubIFD",36864:"ExifVersion",36867:"DateTimeOriginal",36868:"CreateDate",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureCompensation",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",37387:"FlashEnergy",37388:"SpatialFrequencyResponse",37389:"Noise",37390:"FocalPlaneXResolution",37391:"FocalPlaneYResolution",37392:"FocalPlaneResolutionUnit",37393:"ImageNumber",37394:"SecurityClassification",37395:"ImageHistory",37396:"SubjectArea",37397:"ExposureIndex",37398:"TIFF-EPStandardID",37399:"SensingMethod",37434:"CIP3DataFile",37435:"CIP3Sheet",37436:"CIP3Side",37439:"StoNits",37500:"MakerNote",37510:"UserComment",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37679:"MSDocumentText",37680:"MSPropertySetStorage",37681:"MSDocumentTextPosition",37724:"ImageSourceData",40091:"XPTitle",40092:"XPComment",40093:"XPAuthor",40094:"XPKeywords",40095:"XPSubject",40960:"FlashpixVersion",40961:"ColorSpace",40962:"ExifImageWidth",40963:"ExifImageHeight",40964:"RelatedSoundFile",40965:"InteropOffset",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41485:"Noise",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41489:"ImageNumber",41490:"SecurityClassification",41491:"ImageHistory",41492:"SubjectLocation",41493:"ExposureIndex",41494:"TIFF-EPStandardID",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFormat",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"OwnerName",42033:"SerialNumber",42034:"LensInfo",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42112:"GDALMetadata",42113:"GDALNoData",42240:"Gamma",44992:"ExpandSoftware",44993:"ExpandLens",44994:"ExpandFilm",44995:"ExpandFilterLens",44996:"ExpandScanner",44997:"ExpandFlashLamp",48129:"PixelFormat",48130:"Transformation",48131:"Uncompressed",48132:"ImageType",48256:"ImageWidth",48257:"ImageHeight",48258:"WidthResolution",48259:"HeightResolution",48320:"ImageOffset",48321:"ImageByteCount",48322:"AlphaOffset",48323:"AlphaByteCount",48324:"ImageDataDiscard",48325:"AlphaDataDiscard",50215:"OceScanjobDesc",50216:"OceApplicationSelector",50217:"OceIDNumber",50218:"OceImageLogic",50255:"Annotations",50341:"PrintIM",50560:"USPTOOriginalContentType",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50715:"BlackLevelDeltaH",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50733:"BayerGreenSplit",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50737:"ChromaBlurRadius",50738:"AntiAliasStrength",50739:"ShadowScale",50740:"DNGPrivateData",50741:"MakerNoteSafety",50752:"RawImageSegmentation",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50781:"RawDataUniqueID",50784:"AliasLayerMetadata",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50829:"ActiveArea",50830:"MaskedAreas",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50935:"NoiseReductionApplied",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:"ProfileEmbedPolicy",50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:"PreviewColorSpace",50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50974:"SubTileBlockSize",50975:"RowInterleaveFactor",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51008:"OpcodeList1",51009:"OpcodeList2",51022:"OpcodeList3",51041:"NoiseProfile",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:"ProfileHueSatMapEncoding",51108:"ProfileLookTableEncoding",51109:"BaselineExposureOffset",51110:"DefaultBlackRender",51111:"NewRawImageDigest",51112:"RawToPreviewGain",51125:"DefaultUserCrop",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65024:"KDC_IFD",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"}}},7315:t=>{function e(t,e){switch(t){case 1:return e.nextUInt8();case 3:return e.nextUInt16();case 4:return e.nextUInt32();case 5:return[e.nextUInt32(),e.nextUInt32()];case 6:return e.nextInt8();case 8:return e.nextUInt16();case 9:return e.nextUInt32();case 10:return[e.nextInt32(),e.nextInt32()];case 11:return e.nextFloat();case 12:return e.nextDouble();default:throw new Error("Invalid format while decoding: "+t)}}function i(t,i){var r,n,a=i.nextUInt16(),o=i.nextUInt16(),s=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}}(o),h=i.nextUInt32(),u=s*h;if(u>4&&(i=t.openWithOffset(i.nextUInt32())),2===o){var l=(r=i.nextString(h)).indexOf("\0");-1!==l&&(r=r.substr(0,l))}else if(7===o)r=i.nextBuffer(h);else if(0!==o)for(r=[],n=0;n<h;++n)r.push(e(o,i));return u<4&&i.skip(4-u),[a,r,o]}function r(t,e,r){var n,a,o=e.nextUInt16();for(a=0;a<o;++a)r((n=i(t,e))[0],n[1],n[2])}t.exports={IFD0:1,IFD1:2,GPSIFD:3,SubIFD:4,InteropIFD:5,parseTags:function(t,e){var i,n,a,o;try{i=function(t){if("Exif\0\0"!==t.nextString(6))throw new Error("Invalid EXIF header");var e=t.mark(),i=t.nextUInt16();if(18761===i)t.setBigEndian(!1);else{if(19789!==i)throw new Error("Invalid TIFF header");t.setBigEndian(!0)}if(42!==t.nextUInt16())throw new Error("Invalid TIFF data");return e}(t)}catch(t){return!1}var s=i.openWithOffset(t.nextUInt32()),h=this.IFD0;r(i,s,(function(t,i,r){switch(t){case 34853:a=i[0];break;case 34665:n=i[0];break;default:e(h,t,i,r)}}));var u=s.nextUInt32();if(0!==u){var l=i.openWithOffset(u);r(i,l,e.bind(null,this.IFD1))}if(a){var c=i.openWithOffset(a);r(i,c,e.bind(null,this.GPSIFD))}if(n){var f=i.openWithOffset(n),p=this.InteropIFD;r(i,f,(function(t,i,r){40965===t?o=i[0]:e(p,t,i,r)}))}if(o){var d=i.openWithOffset(o);r(i,d,e.bind(null,this.InteropIFD))}return!0}}},329:t=>{t.exports={parseSections:function(t,e){var i,r;for(t.setBigEndian(!0);t.remainingLength()>0&&218!==r;){if(255!==t.nextUInt8())throw new Error("Invalid JPEG section offset");i=(r=t.nextUInt8())>=208&&r<=217||218===r?0:t.nextUInt16()-2,e(r,t.branch(0,i)),t.skip(i)}},getSizeFromSOFSection:function(t){return t.skip(1),{height:t.nextUInt16(),width:t.nextUInt16()}},getSectionName:function(t){var e,i;switch(t){case 216:e="SOI";break;case 196:e="DHT";break;case 219:e="DQT";break;case 221:e="DRI";break;case 218:e="SOS";break;case 254:e="COM";break;case 217:e="EOI";break;default:t>=224&&t<=239?(e="APP",i=t-224):t>=192&&t<=207&&196!==t&&200!==t&&204!==t?(e="SOF",i=t-192):t>=208&&t<=215&&(e="RST",i=t-208)}var r={name:e};return"number"==typeof i&&(r.index=i),r}}},3518:(t,e,i)=>{var r=i(329),n=i(7315),a=i(2410);function o(t,e,i,r,n,a,o){this.startMarker=t,this.tags=e,this.imageSize=i,this.thumbnailOffset=r,this.thumbnailLength=n,this.thumbnailType=a,this.app1Offset=o}function s(t){this.stream=t,this.flags={readBinaryTags:!1,resolveTagNames:!0,simplifyValues:!0,imageSize:!0,hidePointers:!0,returnTags:!0}}o.prototype={hasThumbnail:function(t){return!(!this.thumbnailOffset||!this.thumbnailLength||"string"==typeof t&&("image/jpeg"===t.toLowerCase().trim()?6!==this.thumbnailType:"image/tiff"!==t.toLowerCase().trim()||1!==this.thumbnailType))},getThumbnailOffset:function(){return this.app1Offset+6+this.thumbnailOffset},getThumbnailLength:function(){return this.thumbnailLength},getThumbnailBuffer:function(){return this._getThumbnailStream().nextBuffer(this.thumbnailLength)},_getThumbnailStream:function(){return this.startMarker.openWithOffset(this.getThumbnailOffset())},getImageSize:function(){return this.imageSize},getThumbnailSize:function(){var t,e=this._getThumbnailStream();return r.parseSections(e,(function(e,i){"SOF"===r.getSectionName(e).name&&(t=r.getSizeFromSOFSection(i))})),t}},s.prototype={enableBinaryFields:function(t){return this.flags.readBinaryTags=!!t,this},enablePointers:function(t){return this.flags.hidePointers=!t,this},enableTagNames:function(t){return this.flags.resolveTagNames=!!t,this},enableImageSize:function(t){return this.flags.imageSize=!!t,this},enableReturnTags:function(t){return this.flags.returnTags=!!t,this},enableSimpleValues:function(t){return this.flags.simplifyValues=!!t,this},parse:function(){var t,e,s,h,u,l,c,f,p,d=this.stream.mark(),m=d.openWithOffset(0),g=this.flags;return g.resolveTagNames&&(c=i(2108)),g.resolveTagNames?(t={},f=function(e){return t[e.name]},p=function(e,i){t[e.name]=i}):(t=[],f=function(e){var i;for(i=0;i<t.length;++i)if(t[i].type===e.type&&t[i].section===e.section)return t.value},p=function(e,i){var r;for(r=0;r<t.length;++r)if(t[r].type===e.type&&t[r].section===e.section)return void(t.value=i)}),r.parseSections(m,(function(i,o){var f=o.offsetFrom(d);225===i?n.parseTags(o,(function(e,i,r,o){if(g.readBinaryTags||7!==o){if(513===i){if(s=r[0],g.hidePointers)return}else if(514===i){if(h=r[0],g.hidePointers)return}else if(259===i&&(u=r[0],g.hidePointers))return;if(g.returnTags)if(g.simplifyValues&&(r=a.simplifyValue(r,o)),g.resolveTagNames){var l=(e===n.GPSIFD?c.gps:c.exif)[i];l||(l=c.exif[i]),t.hasOwnProperty(l)||(t[l]=r)}else t.push({section:e,type:i,value:r})}}))&&(l=f):g.imageSize&&"SOF"===r.getSectionName(i).name&&(e=r.getSizeFromSOFSection(o))})),g.simplifyValues&&(a.castDegreeValues(f,p),a.castDateValues(f,p)),new o(d,t,e,s,h,u,l)}},t.exports=s},2410:(t,e,i)=>{var r=i(7315),n=i(292),a=[{section:r.GPSIFD,type:2,name:"GPSLatitude",refType:1,refName:"GPSLatitudeRef",posVal:"N"},{section:r.GPSIFD,type:4,name:"GPSLongitude",refType:3,refName:"GPSLongitudeRef",posVal:"E"}],o=[{section:r.SubIFD,type:306,name:"ModifyDate"},{section:r.SubIFD,type:36867,name:"DateTimeOriginal"},{section:r.SubIFD,type:36868,name:"CreateDate"},{section:r.SubIFD,type:306,name:"ModifyDate"}];t.exports={castDegreeValues:function(t,e){a.forEach((function(i){var r=t(i);if(r){var n=t({section:i.section,type:i.refType,name:i.refName})===i.posVal?1:-1,a=(r[0]+r[1]/60+r[2]/3600)*n;e(i,a)}}))},castDateValues:function(t,e){o.forEach((function(i){var r=t(i);if(r){var a=n.parseExifDate(r);void 0!==a&&e(i,a)}}))},simplifyValue:function(t,e){return Array.isArray(t)&&1===(t=t.map((function(t){return 10===e||5===e?t[0]/t[1]:t}))).length&&(t=t[0]),t}}},7769:t=>{"use strict";const e=t=>[...t].map((t=>t.charCodeAt(0))),i=e("META-INF/mozilla.rsa"),r=e("[Content_Types].xml"),n=e("_rels/.rels");t.exports=t=>{const a=t instanceof Uint8Array?t:new Uint8Array(t);if(!(a&&a.length>1))return null;const o=(t,e)=>{e=Object.assign({offset:0},e);for(let i=0;i<t.length;i++)if(e.mask){if(t[i]!==(e.mask[i]&a[i+e.offset]))return!1}else if(t[i]!==a[i+e.offset])return!1;return!0},s=(t,i)=>o(e(t),i);if(o([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(o([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(o([71,73,70]))return{ext:"gif",mime:"image/gif"};if(o([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(o([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((o([73,73,42,0])||o([77,77,0,42]))&&o([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(o([73,73,42,0])||o([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(o([66,77]))return{ext:"bmp",mime:"image/bmp"};if(o([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(o([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(o([80,75,3,4])){if(o([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(o(i,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(s("mimetypeapplication/vnd.oasis.opendocument.text",{offset:30}))return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};if(s("mimetypeapplication/vnd.oasis.opendocument.spreadsheet",{offset:30}))return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};if(s("mimetypeapplication/vnd.oasis.opendocument.presentation",{offset:30}))return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"};const t=(t,e=0)=>t.findIndex(((t,i,r)=>i>=e&&80===r[i]&&75===r[i+1]&&3===r[i+2]&&4===r[i+3]));let e=0,h=!1,u=null;do{const i=e+30;if(h||(h=o(r,{offset:i})||o(n,{offset:i})),u||(s("word/",{offset:i})?u={ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}:s("ppt/",{offset:i})?u={ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"}:s("xl/",{offset:i})&&(u={ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),h&&u)return u;e=t(a,i)}while(e>=0);if(u)return u}if(o([80,75])&&(3===a[2]||5===a[2]||7===a[2])&&(4===a[3]||6===a[3]||8===a[3]))return{ext:"zip",mime:"application/zip"};if(o([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(o([82,97,114,33,26,7])&&(0===a[6]||1===a[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(o([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(o([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(o([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(o([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(o([51,103,112,53])||o([0,0,0])&&o([102,116,121,112],{offset:4})&&(o([109,112,52,49],{offset:8})||o([109,112,52,50],{offset:8})||o([105,115,111,109],{offset:8})||o([105,115,111,50],{offset:8})||o([109,109,112,52],{offset:8})||o([77,52,86],{offset:8})||o([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};if(o([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(o([26,69,223,163])){const t=a.subarray(4,4100),e=t.findIndex(((t,e,i)=>66===i[e]&&130===i[e+1]));if(-1!==e){const i=e+3,r=e=>[...e].every(((e,r)=>t[i+r]===e.charCodeAt(0)));if(r("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(r("webm"))return{ext:"webm",mime:"video/webm"}}}if(o([0,0,0,20,102,116,121,112,113,116,32,32])||o([102,114,101,101],{offset:4})||o([102,116,121,112,113,116,32,32],{offset:4})||o([109,100,97,116],{offset:4})||o([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(o([82,73,70,70])){if(o([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(o([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(o([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(o([48,38,178,117,142,102,207,17,166,217]))return{ext:"wmv",mime:"video/x-ms-wmv"};if(o([0,0,1,186])||o([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(o([102,116,121,112,51,103],{offset:4}))return{ext:"3gp",mime:"video/3gpp"};for(let t=0;t<2&&t<a.length-16;t++){if(o([73,68,51],{offset:t})||o([255,226],{offset:t,mask:[255,226]}))return{ext:"mp3",mime:"audio/mpeg"};if(o([255,228],{offset:t,mask:[255,228]}))return{ext:"mp2",mime:"audio/mpeg"};if(o([255,248],{offset:t,mask:[255,252]}))return{ext:"mp2",mime:"audio/mpeg"};if(o([255,240],{offset:t,mask:[255,252]}))return{ext:"mp4",mime:"audio/mpeg"}}if(o([102,116,121,112,77,52,65],{offset:4})||o([77,52,65,32]))return{ext:"m4a",mime:"audio/mp4"};if(o([79,112,117,115,72,101,97,100],{offset:28}))return{ext:"opus",mime:"audio/opus"};if(o([79,103,103,83]))return o([128,116,104,101,111,114,97],{offset:28})?{ext:"ogv",mime:"video/ogg"}:o([1,118,105,100,101,111,0],{offset:28})?{ext:"ogm",mime:"video/ogg"}:o([127,70,76,65,67],{offset:28})?{ext:"oga",mime:"audio/ogg"}:o([83,112,101,101,120,32,32],{offset:28})?{ext:"spx",mime:"audio/ogg"}:o([1,118,111,114,98,105,115],{offset:28})?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"};if(o([102,76,97,67]))return{ext:"flac",mime:"audio/x-flac"};if(o([77,65,67,32]))return{ext:"ape",mime:"audio/ape"};if(o([119,118,112,107]))return{ext:"wv",mime:"audio/wavpack"};if(o([35,33,65,77,82,10]))return{ext:"amr",mime:"audio/amr"};if(o([37,80,68,70]))return{ext:"pdf",mime:"application/pdf"};if(o([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if((67===a[0]||70===a[0])&&o([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(o([123,92,114,116,102]))return{ext:"rtf",mime:"application/rtf"};if(o([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(o([119,79,70,70])&&(o([0,1,0,0],{offset:4})||o([79,84,84,79],{offset:4})))return{ext:"woff",mime:"font/woff"};if(o([119,79,70,50])&&(o([0,1,0,0],{offset:4})||o([79,84,84,79],{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(o([76,80],{offset:34})&&(o([0,0,1],{offset:8})||o([1,0,2],{offset:8})||o([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(o([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(o([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(o([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(o([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(o([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(o([37,33]))return{ext:"ps",mime:"application/postscript"};if(o([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(o([83,81,76,105]))return{ext:"sqlite",mime:"application/x-sqlite3"};if(o([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(o([67,114,50,52]))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(o([77,83,67,70])||o([73,83,99,40]))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(o([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121]))return{ext:"deb",mime:"application/x-deb"};if(o([33,60,97,114,99,104,62]))return{ext:"ar",mime:"application/x-unix-archive"};if(o([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(o([31,160])||o([31,157]))return{ext:"Z",mime:"application/x-compress"};if(o([76,90,73,80]))return{ext:"lz",mime:"application/x-lzip"};if(o([208,207,17,224,161,177,26,225]))return{ext:"msi",mime:"application/x-msi"};if(o([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(o([71],{offset:4})&&(o([71],{offset:192})||o([71],{offset:196})))return{ext:"mts",mime:"video/mp2t"};if(o([66,76,69,78,68,69,82]))return{ext:"blend",mime:"application/x-blender"};if(o([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(o([0,0,0,12,106,80,32,32,13,10,135,10])){if(o([106,112,50,32],{offset:20}))return{ext:"jp2",mime:"image/jp2"};if(o([106,112,120,32],{offset:20}))return{ext:"jpx",mime:"image/jpx"};if(o([106,112,109,32],{offset:20}))return{ext:"jpm",mime:"image/jpm"};if(o([109,106,112,50],{offset:20}))return{ext:"mj2",mime:"image/mj2"}}if(o([70,79,82,77,0]))return{ext:"aif",mime:"audio/aiff"};if(s("<?xml "))return{ext:"xml",mime:"application/xml"};if(o([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(o([102,116,121,112],{offset:4})){if(o([109,105,102,49],{offset:8}))return{ext:"heic",mime:"image/heif"};if(o([109,115,102,49],{offset:8}))return{ext:"heic",mime:"image/heif-sequence"};if(o([104,101,105,99],{offset:8})||o([104,101,105,120],{offset:8}))return{ext:"heic",mime:"image/heic"};if(o([104,101,118,99],{offset:8})||o([104,101,118,120],{offset:8}))return{ext:"heic",mime:"image/heic-sequence"}}return o([171,75,84,88,32,49,49,187,13,10,26,10])?{ext:"ktx",mime:"image/ktx"}:null}},1915:t=>{"use strict";class e{constructor(...t){if(0===t.length)throw new Error("constructor requires parameters");const i=t[0];if(null!==i&&"object"==typeof i)if(i instanceof e){const t=i.bitmap;this.bitmap={width:t.width,height:t.height,data:new Buffer(t.width*t.height*4)},t.data.copy(this.bitmap.data)}else{if(!(i.width&&i.height&&i.data))throw new Error("unrecognized constructor parameters");this.bitmap=i}else{if("number"!=typeof i||"number"!=typeof t[1])throw new Error("unrecognized constructor parameters");{const e=i,r=t[1],n=t[2];this.bitmap={width:e,height:r},Buffer.isBuffer(n)?this.bitmap.data=n:(this.bitmap.data=new Buffer(e*r*4),"number"==typeof n&&this.fillRGBA(n))}}}blit(t,e,i,r,n,a,o){if(r+a>this.bitmap.width)throw new Error("copy exceeds width of source bitmap");if(e+a>t.bitmap.width)throw new Error("copy exceeds width of target bitmap");if(n+o>this.bitmap.height)throw new Error("copy exceeds height of source bitmap");if(i+o>t.bitmap.height)throw new Erro("copy exceeds height of target bitmap");const s=this.bitmap.data,h=t.bitmap.data,u=4*this.bitmap.width,l=4*t.bitmap.width,c=4*a;let f=n*u+4*r,p=i*l+4*e;for(;--o>=0;)s.copy(h,p,f,f+c),f+=u,p+=l;return this}fillRGBA(t){const e=this.bitmap.data,i=4*this.bitmap.height;let r=0;for(;r<i;)e.writeUInt32BE(t,r),r+=4;for(;r<e.length;)e.copy(e,r,0,i),r+=i;return this}getRGBA(t,e){const i=4*(e*this.bitmap.width+t);return this.bitmap.data.readUInt32BE(i)}getRGBASet(){const t=new Set,e=this.bitmap.data;for(let i=0;i<e.length;i+=4)t.add(e.readUInt32BE(i,!0));return t}greyscale(){const t=this.bitmap.data;return this.scan(0,0,this.bitmap.width,this.bitmap.height,((e,i,r)=>{const n=Math.round(.299*t[r]+.587*t[r+1]+.114*t[r+2]);t[r]=n,t[r+1]=n,t[r+2]=n})),this}reframe(t,i,r,n,a){const o=t<0?0:t,s=i<0?0:i,h=r+o>this.bitmap.width?this.bitmap.width-o:r,u=n+s>this.bitmap.height?this.bitmap.height-s:n,l=t<0?-t:0,c=i<0?-i:0;let f;if(void 0===a){if(o!==t||s!=i||h!==r||u!==n)throw new GifError("fillRGBA required for this reframing");f=new e(r,n)}else f=new e(r,n,a);return this.blit(f,l,c,o,s,h,u),this.bitmap=f.bitmap,this}scale(t){if(1===t)return;if(!Number.isInteger(t)||t<1)throw new Error("the scale must be an integer >= 1");const e=this.bitmap.width,i=this.bitmap.height,r=e*t*4,n=this.bitmap.data,a=new Buffer(i*r*t);let o,s=0,h=0;for(let u=0;u<i;++u){o=h;for(let i=0;i<e;++i){const e=n.readUInt32BE(s,!0);for(let i=0;i<t;++i)a.writeUInt32BE(e,h),h+=4;s+=4}for(let e=1;e<t;++e)a.copy(a,h,o,h),h+=r,o+=r}return this.bitmap={width:e*t,height:i*t,data:a},this}scanAllCoords(t){const e=this.bitmap.width,i=this.bitmap.data.length;let r=0,n=0;for(let a=0;a<i;a+=4)t(r,n,a),++r===e&&(r=0,++n)}scanAllIndexes(t){const e=this.bitmap.data.length;for(let i=0;i<e;i+=4)t(i)}}t.exports=e},8932:(t,e)=>{"use strict";class i{constructor(t,e,i){this.width=i.width,this.height=i.height,this.loops=i.loops,this.usesTransparency=i.usesTransparency,this.colorScope=i.colorScope,this.frames=e,this.buffer=t}}i.GlobalColorsPreferred=0,i.GlobalColorsOnly=1,i.LocalColorsOnly=2;class r extends Error{constructor(t){super(t),t instanceof Error&&(this.stack="Gif"+t.stack)}}e.Gif=i,e.GifError=r},2527:(t,e,i)=>{"use strict";const r=i(1494),{Gif:n,GifError:a}=i(8932);let o;process.nextTick((()=>{o=i(8305)}));const{GifFrame:s}=i(3573);function h(t,e){const i=t.indexOf(e);return-1===i?null:i}function u(t,e){for(var i,r=0,n=t.length-1;r<=n;)if(t[i=Math.floor((r+n)/2)]>e)n=i-1;else{if(!(t[i]<e))return i;r=i+1}return null}function l(t){const e=t.colors;t.usesTransparency&&e.push(0);const i=e.length;let r=2;for(;i>r;)r<<=1;e.length=r,e.fill(0,i)}function c(t,e){let i=t.bitmap.width*t.bitmap.height;return i=Math.ceil(i*e/8),i+=Math.ceil(i/255),100+i+768}function f(t){let e=t.indexCount,i=0;for(--e;e;)++i,e>>=1;return i>0?i:1}function p(t,e,i,r,n){if(i.interlaced)throw new a("writing interlaced GIFs is not supported");const o=function(t,e,i){const r=i.colors,n=r.length<=8?h:u,o=e.bitmap.data,s=new Buffer(o.length/4);let l=r.length,c=0,f=0;for(;c<o.length;){if(0!==o[c+3]){const t=o.readUInt32BE(c,!0)>>8&16777215;s[f]=n(r,t)}else s[f]=l;c+=4,++f}if(i.usesTransparency){if(256===l)throw new a(`Frame ${t} already has 256 colorsand so can't use transparency`)}else l=null;return{buffer:s,transparentIndex:l}}(e,i,r),s={delay:i.delayCentisecs,disposal:i.disposalMethod,transparent:o.transparentIndex};n&&(l(r),s.palette=r.colors);try{let e,r=t.getOutputBuffer(),n=t.getOutputBufferPosition(),a=!0;for(;a;)if(e=t.addFrame(i.xOffset,i.yOffset,i.bitmap.width,i.bitmap.height,o.buffer,s),a=!1,e>=r.length-1){const e=new Buffer(1.5*r.length);r.copy(e),t.setOutputBuffer(e),t.setOutputBufferPosition(n),r=e,a=!0}return r}catch(t){throw new a(t)}}e.GifCodec=class{constructor(t={}){this._transparentRGB=null,"number"==typeof t.transparentRGB&&0!==t.transparentRGB&&(this._transparentRGBA=256*t.transparentRGB),this._testInitialBufferSize=0}decodeGif(t){try{let e;try{e=new r.GifReader(t)}catch(t){throw new a(t)}const i=e.numFrames(),o=[],s={width:e.width,height:e.height,loops:e.loopCount(),usesTransparency:!1};for(let t=0;t<i;++t){const i=this._decodeFrame(e,t,s.usesTransparency);o.push(i.frame),i.usesTransparency&&(s.usesTransparency=!0)}return Promise.resolve(new n(t,o,s))}catch(t){return Promise.reject(t)}}encodeGif(t,e={}){try{if(null===t||0===t.length)throw new a("there are no frames");const i=o.getMaxDimensions(t);return(e=Object.assign({},e)).width=i.maxWidth,e.height=i.maxHeight,e.loops=e.loops||0,e.colorScope=e.colorScope||n.GlobalColorsPreferred,Promise.resolve(this._encodeGif(t,e))}catch(t){return Promise.reject(t)}}_decodeFrame(t,e,i){let r,n;try{if(r=t.frameInfo(e),n=new Buffer(t.width*t.height*4),t.decodeAndBlitFrameRGBA(e,n),r.width!==t.width||r.height!==t.height){if(r.y&&(n=n.slice(r.y*t.width*4)),t.width>r.width)for(let e=0;e<r.height;++e)n.copy(n,e*r.width*4,4*(r.x+e*t.width),4*(r.x+e*t.width)+4*r.width);n=n.slice(0,r.width*r.height*4)}}catch(t){throw new a(t)}let o=!1;if(null===this._transparentRGBA){if(!i)for(let t=3;t<n.length;t+=4)0===n[t]&&(o=!0,t=n.length)}else for(let t=3;t<n.length;t+=4)0===n[t]&&(n.writeUInt32BE(this._transparentRGBA,t-3),o=!0);return{frame:new s(r.width,r.height,n,{xOffset:r.x,yOffset:r.y,disposalMethod:r.disposal,interlaced:r.interlaced,delayCentisecs:r.delay}),usesTransparency:o}}_encodeGif(t,e){let i;if(e.colorScope===n.LocalColorsOnly)i=o.getColorInfo(t,0);else if(i=o.getColorInfo(t,256),!i.colors){if(e.colorScope===n.GlobalColorsOnly)throw new a("Too many color indexes for global color table");e.colorScope=n.LocalColorsOnly}e.usesTransparency=i.usesTransparency;const s=i.palettes;return e.colorScope===n.LocalColorsOnly?function(t,e,i,o){const s={loop:e.loops};let h,u=new Buffer(2e3);try{h=new r.GifWriter(u,e.width,e.height,s)}catch(t){throw new a(t)}for(let e=0;e<t.length;++e)u=p(h,e,t[e],o[e],!0);return new n(u.slice(0,h.end()),t,e)}(t,e,0,s):function(t,e,i,o){const s={colors:o.colors.slice(),usesTransparency:o.usesTransparency};l(s);const h={palette:s.colors,loop:e.loops};let u,c=new Buffer(2e3);try{u=new r.GifWriter(c,e.width,e.height,h)}catch(t){throw new a(t)}for(let e=0;e<t.length;++e)c=p(u,e,t[e],o,!1);return new n(c.slice(0,u.end()),t,e)}(t,e,0,i)}_getSizeEstimateGlobal(t,e){if(this._testInitialBufferSize>0)return this._testInitialBufferSize;let i=968;const r=f(t);return e.forEach((t=>{i+=c(t,r)})),i}_getSizeEstimateLocal(t,e){if(this._testInitialBufferSize>0)return this._testInitialBufferSize;let i=200;for(let r=0;r<e.length;++r){const n=f(t[r]);i+=c(e[r],n)}return i}}},3573:(t,e,i)=>{"use strict";const r=i(1915),{GifError:n}=i(8932);class a extends r{constructor(...t){if(super(...t),t[0]instanceof a){const e=t[0];this.xOffset=e.xOffset,this.yOffset=e.yOffset,this.disposalMethod=e.disposalMethod,this.delayCentisecs=e.delayCentisecs,this.interlaced=e.interlaced}else{const e=t[t.length-1];let i={};"object"!=typeof e||e instanceof r||(i=e),this.xOffset=i.xOffset||0,this.yOffset=i.yOffset||0,this.disposalMethod=void 0!==i.disposalMethod?i.disposalMethod:a.DisposeToBackgroundColor,this.delayCentisecs=i.delayCentisecs||8,this.interlaced=i.interlaced||!1}}getPalette(){const t=new Set,e=this.bitmap.data;let i=0,r=!1;for(;i<e.length;){if(0===e[i+3])r=!0;else{const r=e.readUInt32BE(i,!0)>>8&16777215;t.add(r)}i+=4}const n=new Array(t.size),a=t.values();for(i=0;i<n.length;++i)n[i]=a.next().value;n.sort(((t,e)=>t-e));let o=n.length;return r&&++o,{colors:n,usesTransparency:r,indexCount:o}}}a.DisposeToAnything=0,a.DisposeNothing=1,a.DisposeToBackgroundColor=2,a.DisposeToPrevious=3,e.GifFrame=a},8305:(t,e,i)=>{"use strict";const r=i(5747),n=i(3194),a=i(1915),{GifFrame:o}=i(3573),{GifError:s}=i(8932),{GifCodec:h}=i(2527),u=[".jpg",".jpeg",".png",".bmp"],l=new h;function c(t,e,i,r,a){const o=Array.isArray(t)?t:[t];if(a){if(["FloydSteinberg","FalseFloydSteinberg","Stucki","Atkinson","Jarvis","Burkes","Sierra","TwoSierra","SierraLite"].indexOf(a.ditherAlgorithm)<0)throw new Error(`Invalid ditherAlgorithm '${a.ditherAlgorithm}'`);void 0===a.serpentine&&(a.serpentine=!0),void 0===a.minimumColorDistanceToDither&&(a.minimumColorDistanceToDither=0),void 0===a.calculateErrorLikeGIMP&&(a.calculateErrorLikeGIMP=!1)}const s=new n.distance.Euclidean,h=new n.palette[e](s,i,r);let u;u=a?new n.image.ErrorDiffusionArray(s,n.image.ErrorDiffusionArrayKernel[a.ditherAlgorithm],a.serpentine,a.minimumColorDistanceToDither,a.calculateErrorLikeGIMP):new n.image.NearestColor(s);const l=[];o.forEach((t=>{const e=t.bitmap.data,i=new ArrayBuffer(e.length),r=new Uint32Array(i);for(let t=0,i=0;t<e.length;t+=4,++i)r[i]=e.readUInt32LE(t,!0);const a=n.utils.PointContainer.fromUint32Array(r,t.bitmap.width,t.bitmap.height);h.sample(a),l.push(a)}));const c=h.quantize();for(let t=0;t<o.length;++t){const e=o[t].bitmap.data,i=u.quantize(l[t],c).toUint32Array();for(let t=0,r=0;t<e.length;t+=4,++r)e.writeUInt32LE(i[r],t)}}e.cloneFrames=function(t){let e=[];return t.forEach((t=>{e.push(new o(t))})),e},e.getColorInfo=function(t,e){let i=!1;const r=[];for(let e=0;e<t.length;++e){let n=t[e].getPalette();if(n.usesTransparency&&(i=!0),n.indexCount>256)throw new s(`Frame ${e} uses more than 256 color indexes`);r.push(n)}if(0===e)return{usesTransparency:i,palettes:r};const n=new Set;r.forEach((t=>{t.colors.forEach((t=>{n.add(t)}))}));let a=n.size;if(i&&++a,e&&a>e)return{usesTransparency:i,palettes:r};const o=new Array(n.size),h=n.values();for(let t=0;t<o.length;++t)o[t]=h.next().value;return o.sort(((t,e)=>t-e)),{colors:o,indexCount:a,usesTransparency:i,palettes:r}},e.copyAsJimp=function(t,i){return e.shareAsJimp(t,new a(i))},e.getMaxDimensions=function(t){let e=0,i=0;return t.forEach((t=>{const r=t.xOffset+t.bitmap.width;r>e&&(e=r);const n=t.yOffset+t.bitmap.height;n>i&&(i=n)})),{maxWidth:e,maxHeight:i}},e.quantizeDekker=function(t,e,i){c(t,"NeuQuantFloat",e=e||256,0,i)},e.quantizeSorokin=function(t,e,i,r){let n;switch(e=e||256,i=i||"min-pop"){case"min-pop":n=2;break;case"top-pop":n=1;break;default:throw new Error(`Invalid quantizeSorokin histogram '${i}'`)}c(t,"RGBQuant",e,n,r)},e.quantizeWu=function(t,e,i,r){if(e=e||256,(i=i||5)<1||i>8)throw new Error("Invalid quantization quality");c(t,"WuQuant",e,i,r)},e.read=function(t,e){return e=e||l,Buffer.isBuffer(t)?e.decodeGif(t):(i=t,new Promise(((t,e)=>{r.readFile(i,((i,r)=>i?e(i):t(r)))}))).then((t=>e.decodeGif(t)));var i},e.shareAsJimp=function(t,e){const i=new t(e.bitmap.width,e.bitmap.height,0);return i.bitmap.data=e.bitmap.data,i},e.write=function(t,e,i,n){n=n||l;const a=t.match(/\.[a-zA-Z]+$/);if(null!==a&&u.includes(a[0].toLowerCase()))throw new Error(`GIF '${t}' has an unexpected suffix`);return n.encodeGif(e,i).then((e=>function(t,e){return new Promise(((i,n)=>{r.writeFile(t,e,(t=>t?n(t):i()))}))}(t,e.buffer).then((()=>e))))}},1702:(t,e,i)=>{"use strict";const r=i(1915),{Gif:n,GifError:a}=i(8932),{GifCodec:o}=i(2527),{GifFrame:s}=i(3573),h=i(8305);t.exports={BitmapImage:r,Gif:n,GifCodec:o,GifFrame:s,GifUtil:h,GifError:a}},3194:function(t){var e;e=function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={exports:{},id:r,loaded:!1};return t[r].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}return i.m=t,i.c=e,i.p="",i(0)}([function(t,e,i){"use strict";var r=i(1);e.constants=r;var n=i(3);e.conversion=n;var a=i(12);e.distance=a;var o=i(20);e.palette=o;var s=i(30);e.image=s;var h=i(35);e.quality=h;var u=i(37);e.utils=u},function(t,e,i){"use strict";var r=i(2);e.bt709=r},function(t,e){"use strict";var i,r,n;!function(t){t[t.RED=.2126]="RED",t[t.GREEN=.7152]="GREEN",t[t.BLUE=.0722]="BLUE",t[t.WHITE=1]="WHITE"}(i||(i={})),e.Y=i,function(t){t[t.RED=.64]="RED",t[t.GREEN=.3]="GREEN",t[t.BLUE=.15]="BLUE",t[t.WHITE=.3127]="WHITE"}(r||(r={})),e.x=r,function(t){t[t.RED=.33]="RED",t[t.GREEN=.6]="GREEN",t[t.BLUE=.06]="BLUE",t[t.WHITE=.329]="WHITE"}(n||(n={})),e.y=n},function(t,e,i){"use strict";var r=i(4);e.rgb2xyz=r.rgb2xyz;var n=i(5);e.rgb2hsl=n.rgb2hsl;var a=i(7);e.rgb2lab=a.rgb2lab;var o=i(9);e.lab2xyz=o.lab2xyz;var s=i(10);e.lab2rgb=s.lab2rgb;var h=i(8);e.xyz2lab=h.xyz2lab;var u=i(11);e.xyz2rgb=u.xyz2rgb},function(t,e){"use strict";function i(t){return t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92}e.rgb2xyz=function(t,e,r){return{x:.4124*(t=i(t/255))+.3576*(e=i(e/255))+.1805*(r=i(r/255)),y:.2126*t+.7152*e+.0722*r,z:.0193*t+.1192*e+.9505*r}}},function(t,e,i){"use strict";var r=i(6);e.rgb2hsl=function(t,e,i){var n=r.min3(t,e,i),a=r.max3(t,e,i),o=a-n,s=(n+a)/510,h=0;s>0&&s<1&&(h=o/(s<.5?a+n:510-a-n));var u=0;return o>0&&(u=a===t?(e-i)/o:a===e?2+(i-t)/o:4+(t-e)/o,(u*=60)<0&&(u+=360)),{h:u,s:h,l:s}}},function(t,e){"use strict";e.degrees2radians=function(t){return t*(Math.PI/180)},e.max3=function(t,e,i){var r=t;return r<e&&(r=e),r<i&&(r=i),r},e.min3=function(t,e,i){var r=t;return r>e&&(r=e),r>i&&(r=i),r},e.intInRange=function(t,e,i){return t>i&&(t=i),t<e&&(t=e),0|t},e.inRange0to255Rounded=function(t){return(t=Math.round(t))>255?t=255:t<0&&(t=0),t},e.inRange0to255=function(t){return t>255?t=255:t<0&&(t=0),t},e.stableSort=function(t,e){var i,r=typeof t[0];if("number"===r||"string"===r){for(var n=Object.create(null),a=0,o=t.length;a<o;a++){var s=t[a];n[s]||0===n[s]||(n[s]=a)}i=t.sort((function(t,i){return e(t,i)||n[t]-n[i]}))}else{var h=t.slice(0);i=t.sort((function(t,i){return e(t,i)||h.indexOf(t)-h.indexOf(i)}))}return i}},function(t,e,i){"use strict";var r=i(4),n=i(8);e.rgb2lab=function(t,e,i){var a=r.rgb2xyz(t,e,i);return n.xyz2lab(a.x,a.y,a.z)}},function(t,e){"use strict";function i(t){return t>.008856?Math.pow(t,1/3):7.787*t+16/116}e.xyz2lab=function(t,e,r){if(t=i(t/.95047),e=i(e/1),r=i(r/1.08883),116*e-16<0)throw new Error("xxx");return{L:Math.max(0,116*e-16),a:500*(t-e),b:200*(e-r)}}},function(t,e){"use strict";function i(t){return t>.206893034?Math.pow(t,3):(t-16/116)/7.787}e.lab2xyz=function(t,e,r){var n=(t+16)/116,a=n-r/200;return{x:.95047*i(e/500+n),y:1*i(n),z:1.08883*i(a)}}},function(t,e,i){"use strict";var r=i(9),n=i(11);e.lab2rgb=function(t,e,i){var a=r.lab2xyz(t,e,i);return n.xyz2rgb(a.x,a.y,a.z)}},function(t,e,i){"use strict";var r=i(6);function n(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}e.xyz2rgb=function(t,e,i){var a=n(3.2406*t+-1.5372*e+-.4986*i),o=n(-.9689*t+1.8758*e+.0415*i),s=n(.0557*t+-.204*e+1.057*i);return{r:r.inRange0to255Rounded(255*a),g:r.inRange0to255Rounded(255*o),b:r.inRange0to255Rounded(255*s)}}},function(t,e,i){"use strict";var r=i(13);e.AbstractDistanceCalculator=r.AbstractDistanceCalculator;var n=i(14);e.CIE94Textiles=n.CIE94Textiles,e.CIE94GraphicArts=n.CIE94GraphicArts;var a=i(15);e.CIEDE2000=a.CIEDE2000;var o=i(16);e.CMETRIC=o.CMETRIC;var s=i(17);e.AbstractEuclidean=s.AbstractEuclidean,e.Euclidean=s.Euclidean,e.EuclideanRgbQuantWOAlpha=s.EuclideanRgbQuantWOAlpha,e.EuclideanRgbQuantWithAlpha=s.EuclideanRgbQuantWithAlpha;var h=i(18);e.AbstractManhattan=h.AbstractManhattan,e.Manhattan=h.Manhattan,e.ManhattanSRGB=h.ManhattanSRGB,e.ManhattanNommyde=h.ManhattanNommyde;var u=i(19);e.PNGQUANT=u.PNGQUANT},function(t,e){"use strict";var i=function(){function t(){this._setDefaults(),this.setWhitePoint(255,255,255,255)}return t.prototype.setWhitePoint=function(t,e,i,r){this._whitePoint={r:t>0?255/t:0,g:e>0?255/e:0,b:i>0?255/i:0,a:r>0?255/r:0},this._maxDistance=this.calculateRaw(t,e,i,r,0,0,0,0)},t.prototype.calculateNormalized=function(t,e){return this.calculateRaw(t.r,t.g,t.b,t.a,e.r,e.g,e.b,e.a)/this._maxDistance},t.prototype._setDefaults=function(){},t}();e.AbstractDistanceCalculator=i},function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=i(13),a=i(7),o=i(6),s=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype.calculateRaw=function(t,e,i,r,n,s,h,u){var l=a.rgb2lab(o.inRange0to255(t*this._whitePoint.r),o.inRange0to255(e*this._whitePoint.g),o.inRange0to255(i*this._whitePoint.b)),c=a.rgb2lab(o.inRange0to255(n*this._whitePoint.r),o.inRange0to255(s*this._whitePoint.g),o.inRange0to255(h*this._whitePoint.b)),f=l.L-c.L,p=l.a-c.a,d=l.b-c.b,m=Math.sqrt(l.a*l.a+l.b*l.b),g=m-Math.sqrt(c.a*c.a+c.b*c.b),b=p*p+d*d-g*g;b=b<0?0:Math.sqrt(b);var v=(u-r)*this._whitePoint.a*this._kA;return Math.sqrt(Math.pow(f/this._Kl,2)+Math.pow(g/(1+this._K1*m),2)+Math.pow(b/(1+this._K2*m),2)+Math.pow(v,2))},e}(n.AbstractDistanceCalculator);e.AbstractCIE94=s;var h=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._Kl=2,this._K1=.048,this._K2=.014,this._kA=12.5/255},e}(s);e.CIE94Textiles=h;var u=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._Kl=1,this._K1=.045,this._K2=.015,this._kA=25/255},e}(s);e.CIE94GraphicArts=u},function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=i(13),a=i(7),o=i(6),s=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype.calculateRaw=function(t,i,r,n,s,h,u,l){var c=a.rgb2lab(o.inRange0to255(t*this._whitePoint.r),o.inRange0to255(i*this._whitePoint.g),o.inRange0to255(r*this._whitePoint.b)),f=a.rgb2lab(o.inRange0to255(s*this._whitePoint.r),o.inRange0to255(h*this._whitePoint.g),o.inRange0to255(u*this._whitePoint.b)),p=(l-n)*this._whitePoint.a*e._kA,d=this.calculateRawInLab(c,f);return Math.sqrt(d+p*p)},e.prototype.calculateRawInLab=function(t,i){var r=t.L,n=t.a,a=t.b,o=i.L,s=i.a,h=i.b,u=Math.sqrt(n*n+a*a),l=Math.sqrt(s*s+h*h),c=Math.pow((u+l)/2,7),f=.5*(1-Math.sqrt(c/(c+e._pow25to7))),p=(1+f)*n,d=(1+f)*s,m=Math.sqrt(p*p+a*a),g=Math.sqrt(d*d+h*h),b=m*g,v=e._calculatehp(a,p),y=e._calculatehp(h,d),_=Math.abs(v-y),w=o-r,x=g-m,E=e._calculate_dHp(b,_,y,v),I=e._calculate_ahp(b,_,v,y),M=e._calculateT(I),k=(m+g)/2,P=Math.pow((r+o)/2-50,2),T=1+.015*P/Math.sqrt(20+P),S=1+.045*k,A=1+.015*M*k,O=e._calculateRT(I,k),C=w/T,D=x/S,B=E/A;return Math.pow(C,2)+Math.pow(D,2)+Math.pow(B,2)+O*D*B},e._calculatehp=function(t,i){var r=Math.atan2(t,i);return r>=0?r:r+e._deg360InRad},e._calculateRT=function(t,i){var r=Math.pow(i,7),n=2*Math.sqrt(r/(r+e._pow25to7)),a=e._deg30InRad*Math.exp(-Math.pow((t-e._deg275InRad)/e._deg25InRad,2));return-Math.sin(2*a)*n},e._calculateT=function(t){return 1-.17*Math.cos(t-e._deg30InRad)+.24*Math.cos(2*t)+.32*Math.cos(3*t+e._deg6InRad)-.2*Math.cos(4*t-e._deg63InRad)},e._calculate_ahp=function(t,i,r,n){var a=r+n;return 0==t?a:i<=e._deg180InRad?a/2:a<e._deg360InRad?(a+e._deg360InRad)/2:(a-e._deg360InRad)/2},e._calculate_dHp=function(t,i,r,n){var a;return a=0==t?0:i<=e._deg180InRad?r-n:r<=n?r-n+e._deg360InRad:r-n-e._deg360InRad,2*Math.sqrt(t)*Math.sin(a/2)},e._kA=25/255,e._pow25to7=Math.pow(25,7),e._deg360InRad=o.degrees2radians(360),e._deg180InRad=o.degrees2radians(180),e._deg30InRad=o.degrees2radians(30),e._deg6InRad=o.degrees2radians(6),e._deg63InRad=o.degrees2radians(63),e._deg275InRad=o.degrees2radians(275),e._deg25InRad=o.degrees2radians(25),e}(n.AbstractDistanceCalculator);e.CIEDE2000=s},function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype.calculateRaw=function(t,e,i,r,n,a,o,s){var h=(t+n)/2*this._whitePoint.r,u=(t-n)*this._whitePoint.r,l=(e-a)*this._whitePoint.g,c=(i-o)*this._whitePoint.b,f=((512+h)*u*u>>8)+4*l*l+((767-h)*c*c>>8),p=(s-r)*this._whitePoint.a;return Math.sqrt(f+p*p)},e}(i(13).AbstractDistanceCalculator);e.CMETRIC=n},function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=i(13),a=i(2),o=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype.calculateRaw=function(t,e,i,r,n,a,o,s){var h=n-t,u=a-e,l=o-i,c=s-r;return Math.sqrt(this._kR*h*h+this._kG*u*u+this._kB*l*l+this._kA*c*c)},e}(n.AbstractDistanceCalculator);e.AbstractEuclidean=o;var s=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._kR=1,this._kG=1,this._kB=1,this._kA=1},e}(o);e.Euclidean=s;var h=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._kR=a.Y.RED,this._kG=a.Y.GREEN,this._kB=a.Y.BLUE,this._kA=1},e}(o);e.EuclideanRgbQuantWithAlpha=h;var u=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._kR=a.Y.RED,this._kG=a.Y.GREEN,this._kB=a.Y.BLUE,this._kA=0},e}(o);e.EuclideanRgbQuantWOAlpha=u},function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=i(13),a=i(2),o=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype.calculateRaw=function(t,e,i,r,n,a,o,s){var h=n-t,u=a-e,l=o-i,c=s-r;return h<0&&(h=0-h),u<0&&(u=0-u),l<0&&(l=0-l),c<0&&(c=0-c),this._kR*h+this._kG*u+this._kB*l+this._kA*c},e}(n.AbstractDistanceCalculator);e.AbstractManhattan=o;var s=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._kR=1,this._kG=1,this._kB=1,this._kA=1},e}(o);e.Manhattan=s;var h=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._kR=.4984,this._kG=.8625,this._kB=.2979,this._kA=1},e}(o);e.ManhattanNommyde=h;var u=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype._setDefaults=function(){this._kR=a.Y.RED,this._kG=a.Y.GREEN,this._kB=a.Y.BLUE,this._kA=1},e}(o);e.ManhattanSRGB=u},function(t,e,i){"use strict";var r=this&&this.__extends||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);function r(){this.constructor=t}t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},n=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype.calculateRaw=function(t,e,i,r,n,a,o,s){var h=(s-r)*this._whitePoint.a;return this._colordifference_ch(t*this._whitePoint.r,n*this._whitePoint.r,h)+this._colordifference_ch(e*this._whitePoint.g,a*this._whitePoint.g,h)+this._colordifference_ch(i*this._whitePoint.b,o*this._whitePoint.b,h)},e.prototype._colordifference_ch=function(t,e,i){var r=t-e,n=r+i;return r*r+n*n},e}(i(13).AbstractDistanceCalculator);e.PNGQUANT=n},function(t,e,i){"use strict";var r=i(21);e.NeuQuant=r.NeuQuant;var n=i(25);e.NeuQuantFloat=n.NeuQuantFloat;var a=i(26);e.RGBQuant=a.RGBQuant;var o=i(27);e.ColorHistogram=o.ColorHistogram;var s=i(29);e.WuQuant=s.WuQuant,e.WuColorCube=s.WuColorCube},function(t,e,i){"use strict";var r=i(22),n=i(24),a=function(){function t(t){this.r=this.g=this.b=this.a=t}return t.prototype.toPoint=function(){return n.Point.createByRGBA(this.r>>3,this.g>>3,this.b>>3,this.a>>3)},t.prototype.subtract=function(t,e,i,r){this.r-=0|t,this.g-=0|e,this.b-=0|i,this.a-=0|r},t}(),o=function(){function t(t,e){void 0===e&&(e=256),this._distance=t,this._pointArray=[],this._sampleFactor=1,this._networkSize=e,this._distance.setWhitePoint(2040,2040,2040,2040)}return t.prototype.sample=function(t){this._pointArray=this._pointArray.concat(t.getPointArray())},t.prototype.quantize=function(){return this._init(),this._learn(),this._buildPalette()},t.prototype._init=function(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(var e=0;e<this._networkSize;e++)this._network[e]=new a((e<<11)/this._networkSize|0),this._freq[e]=t._initialBias/this._networkSize|0,this._bias[e]=0},t.prototype._learn=function(){var e=this._sampleFactor,i=this._pointArray.length;i<t._minpicturebytes&&(e=1);var r,n=30+(e-1)/3|0,a=i/e|0,o=a/t._nCycles|0,s=t._initAlpha,h=(this._networkSize>>3)*t._radiusBias,u=h>>t._radiusBiasShift;u<=1&&(u=0);for(var l=0;l<u;l++)this._radPower[l]=s*((u*u-l*l)*t._radBias/(u*u))>>>0;r=i<t._minpicturebytes?1:i%t._prime1!=0?t._prime1:i%t._prime2!=0?t._prime2:i%t._prime3!=0?t._prime3:t._prime4,l=0;for(var c=0;l<a;){var f=this._pointArray[c],p=f.b<<3,d=f.g<<3,m=f.r<<3,g=f.a<<3,b=this._contest(p,d,m,g);if(this._alterSingle(s,b,p,d,m,g),0!==u&&this._alterNeighbour(u,b,p,d,m,g),(c+=r)>=i&&(c-=i),0===o&&(o=1),++l%o==0){s-=s/n|0,(u=(h-=h/t._radiusDecrease|0)>>t._radiusBiasShift)<=1&&(u=0);for(var v=0;v<u;v++)this._radPower[v]=s*((u*u-v*v)*t._radBias/(u*u))>>>0}}},t.prototype._buildPalette=function(){var t=new r.Palette;return this._network.forEach((function(e){t.add(e.toPoint())})),t.sort(),t},t.prototype._alterNeighbour=function(e,i,r,n,a,o){var s=i-e;s<-1&&(s=-1);var h=i+e;h>this._networkSize&&(h=this._networkSize);for(var u=i+1,l=i-1,c=1;u<h||l>s;){var f,p=this._radPower[c++]/t._alphaRadBias;u<h&&(f=this._network[u++]).subtract(p*(f.r-a),p*(f.g-n),p*(f.b-r),p*(f.a-o)),l>s&&(f=this._network[l--]).subtract(p*(f.r-a),p*(f.g-n),p*(f.b-r),p*(f.a-o))}},t.prototype._alterSingle=function(e,i,r,n,a,o){e/=t._initAlpha;var s=this._network[i];s.subtract(e*(s.r-a),e*(s.g-n),e*(s.b-r),e*(s.a-o))},t.prototype._contest=function(e,i,r,n){for(var a=~(1<<31),o=a,s=-1,h=s,u=0;u<this._networkSize;u++){var l=this._network[u],c=8160*this._distance.calculateNormalized(l,{r,g:i,b:e,a:n})|0;c<a&&(a=c,s=u);var f=c-(this._bias[u]>>t._initialBiasShift-3);f<o&&(o=f,h=u);var p=this._freq[u]>>t._betaShift;this._freq[u]-=p,this._bias[u]+=p<<t._gammaShift}return this._freq[s]+=t._beta,this._bias[s]-=t._betaGamma,h},t._prime1=499,t._prime2=491,t._prime3=487,t._prime4=503,t._minpicturebytes=t._prime4,t._nCycles=100,t._initialBiasShift=16,t._initialBias=1<<t._initialBiasShift,t._gammaShift=10,t._betaShift=10,t._beta=t._initialBias>>t._betaShift,t._betaGamma=t._initialBias<<t._gammaShift-t._betaShift,t._radiusBiasShift=6,t._radiusBias=1<<t._radiusBiasShift,t._radiusDecrease=30,t._alphaBiasShift=10,t._initAlpha=1<<t._alphaBiasShift,t._radBiasShift=8,t._radBias=1<<t._radBiasShift,t._alphaRadBiasShift=t._alphaBiasShift+t._radBiasShift,t._alphaRadBias=1<<t._alphaRadBiasShift,t}();e.NeuQuant=o},function(t,e,i){"use strict";var r=i(23),n=i(5);function a(t,e){for(var i=360/e,r=1,n=i-i/2;r<e;r++,n+=i)if(t>=n&&t<n+i)return r;return 0}e.hueGroup=a;var o=function(){function t(){this._pointArray=[],this._i32idx={},this._pointContainer=new r.PointContainer,this._pointContainer.setHeight(1),this._pointArray=this._pointContainer.getPointArray()}return t.prototype.add=function(t){this._pointArray.push(t),this._pointContainer.setWidth(this._pointArray.length)},t.prototype.has=function(t){for(var e=this._pointArray.length-1;e>=0;e--)if(t.uint32===this._pointArray[e].uint32)return!0;return!1},t.prototype.getNearestColor=function(t,e){return this._pointArray[0|this.getNearestIndex(t,e)]},t.prototype.getPointContainer=function(){return this._pointContainer},t.prototype._nearestPointFromCache=function(t){return"number"==typeof this._i32idx[t]?this._i32idx[t]:-1},t.prototype.getNearestIndex=function(t,e){var i=this._nearestPointFromCache(""+e.uint32);if(i>=0)return i;var r=Number.MAX_VALUE;i=0;for(var n=0,a=this._pointArray.length;n<a;n++){var o=this._pointArray[n],s=t.calculateRaw(e.r,e.g,e.b,e.a,o.r,o.g,o.b,o.a);s<r&&(r=s,i=n)}return this._i32idx[e.uint32]=i,i},t.prototype.sort=function(){this._i32idx={},this._pointArray.sort((function(t,e){var i=n.rgb2hsl(t.r,t.g,t.b),r=n.rgb2hsl(e.r,e.g,e.b),o=t.r===t.g&&t.g===t.b?0:1+a(i.h,10),s=(e.r===e.g&&e.g===e.b?0:1+a(r.h,10))-o;if(s)return-s;var h=t.getLuminosity(!0),u=e.getLuminosity(!0);if(u-h!=0)return u-h;var l=(100*r.s|0)-(100*i.s|0);return l?-l:0}))},t}();e.Palette=o},function(t,e,i){"use strict";var r=i(24),n=function(){function t(){this._width=0,this._height=0,this._pointArray=[]}return t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t.prototype.setWidth=function(t){this._width=t},t.prototype.setHeight=function(t){this._height=t},t.prototype.getPointArray=function(){return this._pointArray},t.prototype.clone=function(){var e=new t;e._width=this._width,e._height=this._height;for(var i=0,n=this._pointArray.length;i<n;i++)e._pointArray[i]=r.Point.createByUint32(0|this._pointArray[i].uint32);return e},t.prototype.toUint32Array=function(){for(var t=this._pointArray.length,e=new Uint32Array(t),i=0;i<t;i++)e[i]=this._pointArray[i].uint32;return e},t.prototype.toUint8Array=function(){return new Uint8Array(this.toUint32Array().buffer)},t.fromHTMLImageElement=function(e){var i=e.naturalWidth,r=e.naturalHeight,n=document.createElement("canvas");return n.width=i,n.height=r,n.getContext("2d").drawImage(e,0,0,i,r,0,0,i,r),t.fromHTMLCanvasElement(n)},t.fromHTMLCanvasElement=function(e){var i=e.width,r=e.height,n=e.getContext("2d").getImageData(0,0,i,r);return t.fromImageData(n)},t.fromNodeCanvas=function(e){return t.fromHTMLCanvasElement(e)},t.fromImageData=function(e){var i=e.width,r=e.height;return t.fromCanvasPixelArray(e.data,i,r)},t.fromArray=function(e,i,r){var n=new Uint8Array(e);return t.fromUint8Array(n,i,r)},t.fromCanvasPixelArray=function(e,i,r){return t.fromArray(e,i,r)},t.fromUint8Array=function(e,i,r){return t.fromUint32Array(new Uint32Array(e.buffer),i,r)},t.fromUint32Array=function(e,i,n){var a=new t;a._width=i,a._height=n;for(var o=0,s=e.length;o<s;o++)a._pointArray[o]=r.Point.createByUint32(0|e[o]);return a},t}();e.PointContainer=n},function(t,e,i){"use strict";var r=i(2),n=function(){function t(){this.uint32=-1>>>0,this.r=this.g=this.b=this.a=0,this.rgba=new Array(4),this.rgba[0]=0,this.rgba[1]=0,this.rgba[2]=0,this.rgba[3]=0}return t.createByQuadruplet=function(e){var i=new t;return i.r=0|e[0],i.g=0|e[1],i.b=0|e[2],i.a=0|e[3],i._loadUINT32(),i._loadQuadruplet(),i},t.createByRGBA=function(e,i,r,n){var a=new t;return a.r=0|e,a.g=0|i,a.b=0|r,a.a=0|n,a._loadUINT32(),a._loadQuadruplet(),a},t.createByUint32=function(e){var i=new t;return i.uint32=e>>>0,i._loadRGBA(),i._loadQuadruplet(),i},t.prototype.from=function(t){this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this.uint32=t.uint32,this.rgba[0]=t.r,this.rgba[1]=t.g,this.rgba[2]=t.b,this.rgba[3]=t.a},t.prototype.getLuminosity=function(t){var e=this.r,i=this.g,n=this.b;return t&&(e=Math.min(255,255-this.a+this.a*e/255),i=Math.min(255,255-this.a+this.a*i/255),n=Math.min(255,255-this.a+this.a*n/255)),e*r.Y.RED+i*r.Y.GREEN+n*r.Y.BLUE},t.prototype._loadUINT32=function(){this.uint32=(this.a<<24|this.b<<16|this.g<<8|this.r)>>>0},t.prototype._loadRGBA=function(){this.r=255&this.uint32,this.g=this.uint32>>>8&255,this.b=this.uint32>>>16&255,this.a=this.uint32>>>24&255},t.prototype._loadQuadruplet=function(){this.rgba[0]=this.r,this.rgba[1]=this.g,this.rgba[2]=this.b,this.rgba[3]=this.a},t}();e.Point=n},function(t,e,i){"use strict";var r=i(22),n=i(24),a=function(){function t(t){this.r=this.g=this.b=this.a=t}return t.prototype.toPoint=function(){return n.Point.createByRGBA(this.r>>3,this.g>>3,this.b>>3,this.a>>3)},t.prototype.subtract=function(t,e,i,r){this.r-=t,this.g-=e,this.b-=i,this.a-=r},t}(),o=function(){function t(t,e){void 0===e&&(e=256),this._distance=t,this._pointArray=[],this._sampleFactor=1,this._networkSize=e,this._distance.setWhitePoint(2040,2040,2040,2040)}return t.prototype.sample=function(t){this._pointArray=this._pointArray.concat(t.getPointArray())},t.prototype.quantize=function(){return this._init(),this._learn(),this._buildPalette()},t.prototype._init=function(){this._freq=[],this._bias=[],this._radPower=[],this._network=[];for(var e=0;e<this._networkSize;e++)this._network[e]=new a((e<<11)/this._networkSize),this._freq[e]=t._initialBias/this._networkSize,this._bias[e]=0},t.prototype._learn=function(){var e=this._sampleFactor,i=this._pointArray.length;i<t._minpicturebytes&&(e=1);var r,n=30+(e-1)/3,a=i/e,o=a/t._nCycles|0,s=t._initAlpha,h=(this._networkSize>>3)*t._radiusBias,u=h>>t._radiusBiasShift;u<=1&&(u=0);for(var l=0;l<u;l++)this._radPower[l]=s*((u*u-l*l)*t._radBias/(u*u));r=i<t._minpicturebytes?1:i%t._prime1!=0?t._prime1:i%t._prime2!=0?t._prime2:i%t._prime3!=0?t._prime3:t._prime4,l=0;for(var c=0;l<a;){var f=this._pointArray[c],p=f.b<<3,d=f.g<<3,m=f.r<<3,g=f.a<<3,b=this._contest(p,d,m,g);if(this._alterSingle(s,b,p,d,m,g),0!=u&&this._alterNeighbour(u,b,p,d,m,g),(c+=r)>=i&&(c-=i),0==o&&(o=1),++l%o==0){s-=s/n,(u=(h-=h/t._radiusDecrease)>>t._radiusBiasShift)<=1&&(u=0);for(var v=0;v<u;v++)this._radPower[v]=s*((u*u-v*v)*t._radBias/(u*u))}}},t.prototype._buildPalette=function(){var t=new r.Palette;return this._network.forEach((function(e){t.add(e.toPoint())})),t.sort(),t},t.prototype._alterNeighbour=function(e,i,r,n,a,o){var s=i-e;s<-1&&(s=-1);var h=i+e;h>this._networkSize&&(h=this._networkSize);for(var u=i+1,l=i-1,c=1;u<h||l>s;){var f,p=this._radPower[c++]/t._alphaRadBias;u<h&&(f=this._network[u++]).subtract(p*(f.r-a),p*(f.g-n),p*(f.b-r),p*(f.a-o)),l>s&&(f=this._network[l--]).subtract(p*(f.r-a),p*(f.g-n),p*(f.b-r),p*(f.a-o))}},t.prototype._alterSingle=function(e,i,r,n,a,o){e/=t._initAlpha;var s=this._network[i];s.subtract(e*(s.r-a),e*(s.g-n),e*(s.b-r),e*(s.a-o))},t.prototype._contest=function(e,i,r,n){for(var a=~(1<<31),o=a,s=-1,h=s,u=0;u<this._networkSize;u++){var l=this._network[u],c=8160*this._distance.calculateNormalized(l,{r,g:i,b:e,a:n});c<a&&(a=c,s=u);var f=c-(this._bias[u]>>t._initialBiasShift-3);f<o&&(o=f,h=u);var p=this._freq[u]>>t._betaShift;this._freq[u]-=p,this._bias[u]+=p<<t._gammaShift}return this._freq[s]+=t._beta,this._bias[s]-=t._betaGamma,h},t._prime1=499,t._prime2=491,t._prime3=487,t._prime4=503,t._minpicturebytes=t._prime4,t._nCycles=100,t._initialBiasShift=16,t._initialBias=1<<t._initialBiasShift,t._gammaShift=10,t._betaShift=10,t._beta=t._initialBias>>t._betaShift,t._betaGamma=t._initialBias<<t._gammaShift-t._betaShift,t._radiusBiasShift=6,t._radiusBias=1<<t._radiusBiasShift,t._radiusDecrease=30,t._alphaBiasShift=10,t._initAlpha=1<<t._alphaBiasShift,t._radBiasShift=8,t._radBias=1<<t._radBiasShift,t._alphaRadBiasShift=t._alphaBiasShift+t._radBiasShift,t._alphaRadBias=1<<t._alphaRadBiasShift,t}();e.NeuQuantFloat=o},function(t,e,i){"use strict";var r=i(22),n=i(24),a=i(27),o=i(6),s=function(t,e,i){this.index=t,this.color=e,this.distance=i},h=function(){function t(t,e,i){void 0===e&&(e=256),void 0===i&&(i=2),this._distance=t,this._colors=e,this._histogram=new a.ColorHistogram(i,e),this._initialDistance=.01,this._distanceIncrement=.005}return t.prototype.sample=function(t){this._histogram.sample(t)},t.prototype.quantize=function(){var t=this._histogram.getImportanceSortedColorsIDXI32();if(0===t.length)throw new Error("No colors in image");var e=this._buildPalette(t);return e.sort(),e},t.prototype._buildPalette=function(t){for(var e=new r.Palette,i=e.getPointContainer().getPointArray(),a=new Array(t.length),h=0;h<t.length;h++)i.push(n.Point.createByUint32(t[h])),a[h]=1;for(var u=i.length,l=[],c=u,f=this._initialDistance;c>this._colors;){for(l.length=0,h=0;h<u;h++)if(0!==a[h])for(var p=i[h],d=h+1;d<u;d++)if(0!==a[d]){var m=i[d],g=this._distance.calculateNormalized(p,m);g<f&&(l.push(new s(d,m,g)),a[d]=0,c--)}f+=c>3*this._colors?this._initialDistance:this._distanceIncrement}if(c<this._colors){o.stableSort(l,(function(t,e){return e.distance-t.distance}));for(var b=0;c<this._colors&&b<l.length;)a[l[b].index]=1,c++,b++}for(var v=i.length,y=v-1;y>=0;y--)0===a[y]&&(y!==v-1&&(i[y]=i[v-1]),--v);return i.length=v,e},t}();e.RGBQuant=h},function(t,e,i){"use strict";var r=i(28),n=i(6),a=function(){function t(e,i){this._method=e,this._minHueCols=i<<2,this._initColors=i<<2,this._hueStats=new r.HueStatistics(t._hueGroups,this._minHueCols),this._histogram=Object.create(null)}return t.prototype.sample=function(t){switch(this._method){case 1:this._colorStats1D(t);break;case 2:this._colorStats2D(t)}},t.prototype.getImportanceSortedColorsIDXI32=function(){var t,e=this,i=n.stableSort(Object.keys(this._histogram),(function(t,i){return e._histogram[i]-e._histogram[t]}));if(0===i.length)return[];switch(this._method){case 1:var r=Math.min(i.length,this._initColors),a=i[r-1],o=this._histogram[a];t=i.slice(0,r);for(var s=r,h=i.length;s<h&&this._histogram[i[s]]==o;)t.push(i[s++]);this._hueStats.injectIntoArray(t);break;case 2:t=i;break;default:throw new Error("Incorrect method")}return t.map((function(t){return+t}))},t.prototype._colorStats1D=function(t){for(var e=this._histogram,i=t.getPointArray(),r=i.length,n=0;n<r;n++){var a=i[n].uint32;this._hueStats.check(a),a in e?e[a]++:e[a]=1}},t.prototype._colorStats2D=function(e){var i=this,r=e.getWidth(),n=e.getHeight(),a=e.getPointArray(),o=t._boxSize[0],s=t._boxSize[1],h=o*s,u=this._makeBoxes(r,n,o,s),l=this._histogram;u.forEach((function(e){var n=Math.round(e.w*e.h/h)*t._boxPixels;n<2&&(n=2);var o={};i._iterateBox(e,r,(function(t){var e=a[t].uint32;i._hueStats.check(e),e in l?l[e]++:e in o?++o[e]>=n&&(l[e]=o[e]):o[e]=1}))})),this._hueStats.injectIntoDictionary(l)},t.prototype._iterateBox=function(t,e,i){var r=t,n=r.y*e+r.x,a=(r.y+r.h-1)*e+(r.x+r.w-1),o=e-r.w+1,s=0,h=n;do{i.call(this,h),h+=++s%r.w==0?o:1}while(h<=a)},t.prototype._makeBoxes=function(t,e,i,r){for(var n=t%i,a=e%r,o=t-n,s=e-a,h=[],u=0;u<e;u+=r)for(var l=0;l<t;l+=i)h.push({x:l,y:u,w:l==o?n:i,h:u==s?a:r});return h},t._boxSize=[64,64],t._boxPixels=2,t._hueGroups=10,t}();e.ColorHistogram=a},function(t,e,i){"use strict";var r=i(5),n=i(22),a=function(){this.num=0,this.cols=[]},o=function(){function t(t,e){this._numGroups=t,this._minCols=e,this._stats=[];for(var i=0;i<=t;i++)this._stats[i]=new a;this._groupsFull=0}return t.prototype.check=function(t){this._groupsFull==this._numGroups+1&&(this.check=function(){});var e=255&t,i=t>>>8&255,a=t>>>16&255,o=e==i&&i==a?0:1+n.hueGroup(r.rgb2hsl(e,i,a).h,this._numGroups),s=this._stats[o],h=this._minCols;s.num++,s.num>h||(s.num==h&&this._groupsFull++,s.num<=h&&this._stats[o].cols.push(t))},t.prototype.injectIntoDictionary=function(t){for(var e=0;e<=this._numGroups;e++)this._stats[e].num<=this._minCols&&this._stats[e].cols.forEach((function(e){t[e]?t[e]++:t[e]=1}))},t.prototype.injectIntoArray=function(t){for(var e=0;e<=this._numGroups;e++)this._stats[e].num<=this._minCols&&this._stats[e].cols.forEach((function(e){-1==t.indexOf(e)&&t.push(e)}))},t}();e.HueStatistics=o},function(t,e,i){"use strict";var r=i(22),n=i(24);function a(t){for(var e=[],i=0;i<t;i++)e[i]=0;return e}function o(t,e,i,r){for(var n=new Array(t),a=0;a<t;a++){n[a]=new Array(e);for(var o=0;o<e;o++){n[a][o]=new Array(i);for(var s=0;s<i;s++){n[a][o][s]=new Array(r);for(var h=0;h<r;h++)n[a][o][s][h]=0}}}return n}function s(t,e,i){for(var r=new Array(t),n=0;n<t;n++){r[n]=new Array(e);for(var a=0;a<e;a++){r[n][a]=new Array(i);for(var o=0;o<i;o++)r[n][a][o]=0}}return r}function h(t,e,i,r,n){for(var a=0;a<e;a++){t[a]=[];for(var o=0;o<i;o++){t[a][o]=[];for(var s=0;s<r;s++)t[a][o][s]=n}}}function u(t,e,i){for(var r=0;r<e;r++)t[r]=i}var l=function(){};e.WuColorCube=l;var c=function(){function t(t,e,i){void 0===e&&(e=256),void 0===i&&(i=5),this._distance=t,this._setQuality(i),this._initialize(e)}return t.prototype.sample=function(t){for(var e=t.getPointArray(),i=0,r=e.length;i<r;i++)this._addColor(e[i]);this._pixels=this._pixels.concat(e)},t.prototype.quantize=function(){this._preparePalette();for(var t=new r.Palette,e=0;e<this._colors;e++)if(this._sums[e]>0){var i=this._sums[e],a=this._reds[e]/i,o=this._greens[e]/i,s=this._blues[e]/i,h=this._alphas[e]/i,u=n.Point.createByRGBA(0|a,0|o,0|s,0|h);t.add(u)}return t.sort(),t},t.prototype._preparePalette=function(){this._calculateMoments();for(var e=0,i=a(this._colors),r=1;r<this._colors;++r){this._cut(this._cubes[e],this._cubes[r])?(i[e]=this._cubes[e].volume>1?this._calculateVariance(this._cubes[e]):0,i[r]=this._cubes[r].volume>1?this._calculateVariance(this._cubes[r]):0):(i[e]=0,r--),e=0;for(var n=i[0],o=1;o<=r;++o)i[o]>n&&(n=i[o],e=o);if(n<=0){this._colors=r+1;break}}for(var s=[],h=[],u=[],l=[],c=0;c<this._colors;++c){var f=t._volume(this._cubes[c],this._weights);f>0?(s[c]=t._volume(this._cubes[c],this._momentsRed)/f|0,h[c]=t._volume(this._cubes[c],this._momentsGreen)/f|0,u[c]=t._volume(this._cubes[c],this._momentsBlue)/f|0,l[c]=t._volume(this._cubes[c],this._momentsAlpha)/f|0):(s[c]=0,h[c]=0,u[c]=0,l[c]=0)}this._reds=a(this._colors+1),this._greens=a(this._colors+1),this._blues=a(this._colors+1),this._alphas=a(this._colors+1),this._sums=a(this._colors+1),o=0;for(var p=this._pixels.length;o<p;o++){for(var d=this._pixels[o],m=-1,g=Number.MAX_VALUE,b=0;b<this._colors;b++){var v=s[b],y=h[b],_=u[b],w=l[b],x=this._distance.calculateRaw(v,y,_,w,d.r,d.g,d.b,d.a);x<g&&(g=x,m=b)}this._reds[m]+=d.r,this._greens[m]+=d.g,this._blues[m]+=d.b,this._alphas[m]+=d.a,this._sums[m]++}},t.prototype._addColor=function(t){var e=8-this._significantBitsPerChannel,i=1+(t.r>>e),r=1+(t.g>>e),n=1+(t.b>>e),a=1+(t.a>>e);this._weights[a][i][r][n]++,this._momentsRed[a][i][r][n]+=t.r,this._momentsGreen[a][i][r][n]+=t.g,this._momentsBlue[a][i][r][n]+=t.b,this._momentsAlpha[a][i][r][n]+=t.a,this._moments[a][i][r][n]+=this._table[t.r]+this._table[t.g]+this._table[t.b]+this._table[t.a]},t.prototype._calculateMoments=function(){for(var t=[],e=[],i=[],r=[],n=[],a=[],o=s(this._sideSize,this._sideSize,this._sideSize),l=s(this._sideSize,this._sideSize,this._sideSize),c=s(this._sideSize,this._sideSize,this._sideSize),f=s(this._sideSize,this._sideSize,this._sideSize),p=s(this._sideSize,this._sideSize,this._sideSize),d=s(this._sideSize,this._sideSize,this._sideSize),m=1;m<=this._alphaMaxSideIndex;++m){h(o,this._sideSize,this._sideSize,this._sideSize,0),h(l,this._sideSize,this._sideSize,this._sideSize,0),h(c,this._sideSize,this._sideSize,this._sideSize,0),h(f,this._sideSize,this._sideSize,this._sideSize,0),h(p,this._sideSize,this._sideSize,this._sideSize,0),h(d,this._sideSize,this._sideSize,this._sideSize,0);for(var g=1;g<=this._maxSideIndex;++g){u(t,this._sideSize,0),u(e,this._sideSize,0),u(i,this._sideSize,0),u(r,this._sideSize,0),u(n,this._sideSize,0),u(a,this._sideSize,0);for(var b=1;b<=this._maxSideIndex;++b)for(var v=0,y=0,_=0,w=0,x=0,E=0,I=1;I<=this._maxSideIndex;++I)v+=this._weights[m][g][b][I],y+=this._momentsRed[m][g][b][I],_+=this._momentsGreen[m][g][b][I],w+=this._momentsBlue[m][g][b][I],x+=this._momentsAlpha[m][g][b][I],E+=this._moments[m][g][b][I],t[I]+=v,e[I]+=y,i[I]+=_,r[I]+=w,n[I]+=x,a[I]+=E,o[g][b][I]=o[g-1][b][I]+t[I],l[g][b][I]=l[g-1][b][I]+e[I],c[g][b][I]=c[g-1][b][I]+i[I],f[g][b][I]=f[g-1][b][I]+r[I],p[g][b][I]=p[g-1][b][I]+n[I],d[g][b][I]=d[g-1][b][I]+a[I],this._weights[m][g][b][I]=this._weights[m-1][g][b][I]+o[g][b][I],this._momentsRed[m][g][b][I]=this._momentsRed[m-1][g][b][I]+l[g][b][I],this._momentsGreen[m][g][b][I]=this._momentsGreen[m-1][g][b][I]+c[g][b][I],this._momentsBlue[m][g][b][I]=this._momentsBlue[m-1][g][b][I]+f[g][b][I],this._momentsAlpha[m][g][b][I]=this._momentsAlpha[m-1][g][b][I]+p[g][b][I],this._moments[m][g][b][I]=this._moments[m-1][g][b][I]+d[g][b][I]}}},t._volumeFloat=function(t,e){return e[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMaximum]-e[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMaximum]-e[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMaximum]+e[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMaximum]-e[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMaximum]+e[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMaximum]+e[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMaximum]-e[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMaximum]-(e[t.alphaMaximum][t.redMaximum][t.greenMaximum][t.blueMinimum]-e[t.alphaMinimum][t.redMaximum][t.greenMaximum][t.blueMinimum]-e[t.alphaMaximum][t.redMaximum][t.greenMinimum][t.blueMinimum]+e[t.alphaMinimum][t.redMaximum][t.greenMinimum][t.blueMinimum]-e[t.alphaMaximum][t.redMinimum][t.greenMaximum][t.blueMinimum]+e[t.alphaMinimum][t.redMinimum][t.greenMaximum][t.blueMinimum]+e[t.alphaMaximum][t.redMinimum][t.greenMinimum][t.blueMinimum]-e[t.alphaMinimum][t.redMinimum][t.greenMinimum][t.blueMinimum])},t._volume=function(e,i){return 0|t._volumeFloat(e,i)},t._top=function(e,i,r,n){var a;switch(i){case t.alpha:a=n[r][e.redMaximum][e.greenMaximum][e.blueMaximum]-n[r][e.redMaximum][e.greenMinimum][e.blueMaximum]-n[r][e.redMinimum][e.greenMaximum][e.blueMaximum]+n[r][e.redMinimum][e.greenMinimum][e.blueMaximum]-(n[r][e.redMaximum][e.greenMaximum][e.blueMinimum]-n[r][e.redMaximum][e.greenMinimum][e.blueMinimum]-n[r][e.redMinimum][e.greenMaximum][e.blueMinimum]+n[r][e.redMinimum][e.greenMinimum][e.blueMinimum]);break;case t.red:a=n[e.alphaMaximum][r][e.greenMaximum][e.blueMaximum]-n[e.alphaMaximum][r][e.greenMinimum][e.blueMaximum]-n[e.alphaMinimum][r][e.greenMaximum][e.blueMaximum]+n[e.alphaMinimum][r][e.greenMinimum][e.blueMaximum]-(n[e.alphaMaximum][r][e.greenMaximum][e.blueMinimum]-n[e.alphaMaximum][r][e.greenMinimum][e.blueMinimum]-n[e.alphaMinimum][r][e.greenMaximum][e.blueMinimum]+n[e.alphaMinimum][r][e.greenMinimum][e.blueMinimum]);break;case t.green:a=n[e.alphaMaximum][e.redMaximum][r][e.blueMaximum]-n[e.alphaMaximum][e.redMinimum][r][e.blueMaximum]-n[e.alphaMinimum][e.redMaximum][r][e.blueMaximum]+n[e.alphaMinimum][e.redMinimum][r][e.blueMaximum]-(n[e.alphaMaximum][e.redMaximum][r][e.blueMinimum]-n[e.alphaMaximum][e.redMinimum][r][e.blueMinimum]-n[e.alphaMinimum][e.redMaximum][r][e.blueMinimum]+n[e.alphaMinimum][e.redMinimum][r][e.blueMinimum]);break;case t.blue:a=n[e.alphaMaximum][e.redMaximum][e.greenMaximum][r]-n[e.alphaMaximum][e.redMaximum][e.greenMinimum][r]-n[e.alphaMaximum][e.redMinimum][e.greenMaximum][r]+n[e.alphaMaximum][e.redMinimum][e.greenMinimum][r]-(n[e.alphaMinimum][e.redMaximum][e.greenMaximum][r]-n[e.alphaMinimum][e.redMaximum][e.greenMinimum][r]-n[e.alphaMinimum][e.redMinimum][e.greenMaximum][r]+n[e.alphaMinimum][e.redMinimum][e.greenMinimum][r]);break;default:throw new Error("impossible")}return 0|a},t._bottom=function(e,i,r){switch(i){case t.alpha:return-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMaximum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case t.red:return-r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMaximum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case t.green:return-r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMaximum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMaximum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMaximum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMaximum]-(-r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);case t.blue:return-r[e.alphaMaximum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMaximum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMaximum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMaximum][e.redMinimum][e.greenMinimum][e.blueMinimum]-(-r[e.alphaMinimum][e.redMaximum][e.greenMaximum][e.blueMinimum]+r[e.alphaMinimum][e.redMaximum][e.greenMinimum][e.blueMinimum]+r[e.alphaMinimum][e.redMinimum][e.greenMaximum][e.blueMinimum]-r[e.alphaMinimum][e.redMinimum][e.greenMinimum][e.blueMinimum]);default:return 0}},t.prototype._calculateVariance=function(e){var i=t._volume(e,this._momentsRed),r=t._volume(e,this._momentsGreen),n=t._volume(e,this._momentsBlue),a=t._volume(e,this._momentsAlpha);return t._volumeFloat(e,this._moments)-(i*i+r*r+n*n+a*a)/t._volume(e,this._weights)},t.prototype._maximize=function(e,i,r,n,a,o,s,h,u){for(var l=0|t._bottom(e,i,this._momentsRed),c=0|t._bottom(e,i,this._momentsGreen),f=0|t._bottom(e,i,this._momentsBlue),p=0|t._bottom(e,i,this._momentsAlpha),d=0|t._bottom(e,i,this._weights),m=0,g=-1,b=r;b<n;++b){var v=l+t._top(e,i,b,this._momentsRed),y=c+t._top(e,i,b,this._momentsGreen),_=f+t._top(e,i,b,this._momentsBlue),w=p+t._top(e,i,b,this._momentsAlpha),x=d+t._top(e,i,b,this._weights);if(0!=x){var E=v*v+y*y+_*_+w*w,I=E/x;v=a-v,y=o-y,_=s-_,w=h-w,0!=(x=u-x)&&(I+=(E=v*v+y*y+_*_+w*w)/x)>m&&(m=I,g=b)}}return{max:m,position:g}},t.prototype._cut=function(e,i){var r,n=t._volume(e,this._momentsRed),a=t._volume(e,this._momentsGreen),o=t._volume(e,this._momentsBlue),s=t._volume(e,this._momentsAlpha),h=t._volume(e,this._weights),u=this._maximize(e,t.red,e.redMinimum+1,e.redMaximum,n,a,o,s,h),l=this._maximize(e,t.green,e.greenMinimum+1,e.greenMaximum,n,a,o,s,h),c=this._maximize(e,t.blue,e.blueMinimum+1,e.blueMaximum,n,a,o,s,h),f=this._maximize(e,t.alpha,e.alphaMinimum+1,e.alphaMaximum,n,a,o,s,h);if(f.max>=u.max&&f.max>=l.max&&f.max>=c.max){if(r=t.alpha,f.position<0)return!1}else r=u.max>=f.max&&u.max>=l.max&&u.max>=c.max?t.red:l.max>=f.max&&l.max>=u.max&&l.max>=c.max?t.green:t.blue;switch(i.redMaximum=e.redMaximum,i.greenMaximum=e.greenMaximum,i.blueMaximum=e.blueMaximum,i.alphaMaximum=e.alphaMaximum,r){case t.red:i.redMinimum=e.redMaximum=u.position,i.greenMinimum=e.greenMinimum,i.blueMinimum=e.blueMinimum,i.alphaMinimum=e.alphaMinimum;break;case t.green:i.greenMinimum=e.greenMaximum=l.position,i.redMinimum=e.redMinimum,i.blueMinimum=e.blueMinimum,i.alphaMinimum=e.alphaMinimum;break;case t.blue:i.blueMinimum=e.blueMaximum=c.position,i.redMinimum=e.redMinimum,i.greenMinimum=e.greenMinimum,i.alphaMinimum=e.alphaMinimum;break;case t.alpha:i.alphaMinimum=e.alphaMaximum=f.position,i.blueMinimum=e.blueMinimum,i.redMinimum=e.redMinimum,i.greenMinimum=e.greenMinimum}return e.volume=(e.redMaximum-e.redMinimum)*(e.greenMaximum-e.greenMinimum)*(e.blueMaximum-e.blueMinimum)*(e.alphaMaximum-e.alphaMinimum),i.volume=(i.redMaximum-i.redMinimum)*(i.greenMaximum-i.greenMinimum)*(i.blueMaximum-i.blueMinimum)*(i.alphaMaximum-i.alphaMinimum),!0},t.prototype._initialize=function(t){this._colors=t,this._cubes=[];for(var e=0;e<t;e++)this._cubes[e]=new l;this._cubes[0].redMinimum=0,this._cubes[0].greenMinimum=0,this._cubes[0].blueMinimum=0,this._cubes[0].alphaMinimum=0,this._cubes[0].redMaximum=this._maxSideIndex,this._cubes[0].greenMaximum=this._maxSideIndex,this._cubes[0].blueMaximum=this._maxSideIndex,this._cubes[0].alphaMaximum=this._alphaMaxSideIndex,this._weights=o(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize),this._momentsRed=o(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize),this._momentsGreen=o(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize),this._momentsBlue=o(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize),this._momentsAlpha=o(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize),this._moments=o(this._alphaSideSize,this._sideSize,this._sideSize,this._sideSize),this._table=[];for(var i=0;i<256;++i)this._table[i]=i*i;this._pixels=[]},t.prototype._setQuality=function(t){void 0===t&&(t=5),this._significantBitsPerChannel=t,this._maxSideIndex=1<<this._significantBitsPerChannel,this._alphaMaxSideIndex=this._maxSideIndex,this._sideSize=this._maxSideIndex+1,this._alphaSideSize=this._alphaMaxSideIndex+1},t.alpha=3,t.red=2,t.green=1,t.blue=0,t}();e.WuQuant=c},function(t,e,i){"use strict";var r=i(31);e.NearestColor=r.NearestColor;var n=i(32);e.ErrorDiffusionArray=n.ErrorDiffusionArray,e.ErrorDiffusionArrayKernel=n.ErrorDiffusionArrayKernel;var a=i(33);e.ErrorDiffusionRiemersma=a.ErrorDiffusionRiemersma},function(t,e){"use strict";var i=function(){function t(t){this._distance=t}return t.prototype.quantize=function(t,e){for(var i=t.getPointArray(),r=t.getWidth(),n=t.getHeight(),a=0;a<n;a++)for(var o=0,s=a*r;o<r;o++,s++){var h=i[s];h.from(e.getNearestColor(this._distance,h))}return t},t}();e.NearestColor=i},function(t,e,i){"use strict";var r=i(24),n=i(6);!function(t){t[t.FloydSteinberg=0]="FloydSteinberg",t[t.FalseFloydSteinberg=1]="FalseFloydSteinberg",t[t.Stucki=2]="Stucki",t[t.Atkinson=3]="Atkinson",t[t.Jarvis=4]="Jarvis",t[t.Burkes=5]="Burkes",t[t.Sierra=6]="Sierra",t[t.TwoSierra=7]="TwoSierra",t[t.SierraLite=8]="SierraLite"}(e.ErrorDiffusionArrayKernel||(e.ErrorDiffusionArrayKernel={}));var a=e.ErrorDiffusionArrayKernel,o=function(){function t(t,e,i,r,n){void 0===i&&(i=!0),void 0===r&&(r=0),void 0===n&&(n=!1),this._setKernel(e),this._distance=t,this._minColorDistance=r,this._serpentine=i,this._calculateErrorLikeGIMP=n}return t.prototype.quantize=function(t,e){for(var i=t.getPointArray(),a=new r.Point,o=t.getWidth(),s=t.getHeight(),h=[],u=1,l=1,c=0;c<this._kernel.length;c++){var f=this._kernel[c][2]+1;l<f&&(l=f)}for(c=0;c<l;c++)this._fillErrorLine(h[c]=[],o);for(var p=0;p<s;p++){this._serpentine&&(u*=-1);var d=p*o,m=1==u?0:o-1,g=1==u?o:-1;this._fillErrorLine(h[0],o),h.push(h.shift());for(var b=h[0],v=m,y=d+m;v!==g;v+=u,y+=u){var _=i[y],w=b[v];a.from(_);var x=r.Point.createByRGBA(n.inRange0to255Rounded(_.r+w[0]),n.inRange0to255Rounded(_.g+w[1]),n.inRange0to255Rounded(_.b+w[2]),n.inRange0to255Rounded(_.a+w[3])),E=e.getNearestColor(this._distance,x);if(_.from(E),!(this._minColorDistance&&this._distance.calculateNormalized(_,E)<this._minColorDistance)){var I=void 0,M=void 0,k=void 0,P=void 0;this._calculateErrorLikeGIMP?(I=x.r-E.r,M=x.g-E.g,k=x.b-E.b,P=x.a-E.a):(I=a.r-E.r,M=a.g-E.g,k=a.b-E.b,P=a.a-E.a);var T=1==u?0:this._kernel.length-1,S=1==u?this._kernel.length:-1;for(c=T;c!==S;c+=u){var A=this._kernel[c][1]*u,O=this._kernel[c][2];if(A+v>=0&&A+v<o&&O+p>=0&&O+p<s){var C=this._kernel[c][0],D=h[O][A+v];D[0]=D[0]+I*C,D[1]=D[1]+M*C,D[2]=D[2]+k*C,D[3]=D[3]+P*C}}}}}return t},t.prototype._fillErrorLine=function(t,e){t.length>e&&(t.length=e);for(var i=t.length,r=0;r<i;r++){var n=t[r];n[0]=n[1]=n[2]=n[3]=0}for(r=i;r<e;r++)t[r]=[0,0,0,0]},t.prototype._setKernel=function(t){switch(t){case a.FloydSteinberg:this._kernel=[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]];break;case a.FalseFloydSteinberg:this._kernel=[[3/8,1,0],[3/8,0,1],[2/8,1,1]];break;case a.Stucki:this._kernel=[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]];break;case a.Atkinson:this._kernel=[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]];break;case a.Jarvis:this._kernel=[[7/48,1,0],[5/48,2,0],[3/48,-2,1],[5/48,-1,1],[7/48,0,1],[5/48,1,1],[3/48,2,1],[1/48,-2,2],[3/48,-1,2],[5/48,0,2],[3/48,1,2],[1/48,2,2]];break;case a.Burkes:this._kernel=[[.25,1,0],[4/32,2,0],[2/32,-2,1],[4/32,-1,1],[.25,0,1],[4/32,1,1],[2/32,2,1]];break;case a.Sierra:this._kernel=[[5/32,1,0],[3/32,2,0],[2/32,-2,1],[4/32,-1,1],[5/32,0,1],[4/32,1,1],[2/32,2,1],[2/32,-1,2],[3/32,0,2],[2/32,1,2]];break;case a.TwoSierra:this._kernel=[[.25,1,0],[3/16,2,0],[1/16,-2,1],[2/16,-1,1],[3/16,0,1],[2/16,1,1],[1/16,2,1]];break;case a.SierraLite:this._kernel=[[.5,1,0],[1/4,-1,1],[1/4,0,1]];break;default:throw new Error("ErrorDiffusionArray: unknown kernel = "+t)}},t}();e.ErrorDiffusionArray=o},function(t,e,i){"use strict";var r=i(34),n=i(24),a=i(6),o=function(){function t(t,e,i){void 0===e&&(e=16),void 0===i&&(i=1),this._distance=t,this._errorPropagation=i,this._errorQueueSize=e,this._max=this._errorQueueSize,this._createWeights()}return t.prototype.quantize=function(t,e){for(var i=this,o=new r.HilbertCurveBase,s=t.getPointArray(),h=t.getWidth(),u=t.getHeight(),l=[],c=0,f=0;f<this._errorQueueSize;f++)l[f]={r:0,g:0,b:0,a:0};return o.walk(h,u,(function(t,r){for(var o=s[t+r*h],u=o.r,f=o.g,p=o.b,d=o.a,m=0;m<i._errorQueueSize;m++){var g=i._weights[m],b=l[(m+c)%i._errorQueueSize];u+=b.r*g,f+=b.g*g,p+=b.b*g,d+=b.a*g}var v=n.Point.createByRGBA(a.inRange0to255Rounded(u),a.inRange0to255Rounded(f),a.inRange0to255Rounded(p),a.inRange0to255Rounded(d)),y=e.getNearestColor(i._distance,v),_=((c=(c+1)%i._errorQueueSize)+i._errorQueueSize-1)%i._errorQueueSize;l[_].r=o.r-y.r,l[_].g=o.g-y.g,l[_].b=o.b-y.b,l[_].a=o.a-y.a,o.from(y)})),t},t.prototype._createWeights=function(){this._weights=[];for(var t=Math.exp(Math.log(this._max)/(this._errorQueueSize-1)),e=0,i=1;e<this._errorQueueSize;e++)this._weights[e]=(i+.5|0)/this._max*this._errorPropagation,i*=t},t}();e.ErrorDiffusionRiemersma=o},function(t,e){"use strict";var i;!function(t){t[t.NONE=0]="NONE",t[t.UP=1]="UP",t[t.LEFT=2]="LEFT",t[t.RIGHT=3]="RIGHT",t[t.DOWN=4]="DOWN"}(i||(i={}));var r=function(){function t(){}return t.prototype.walk=function(t,e,r){this._x=0,this._y=0,this._d=0,this._width=t,this._height=e,this._callback=r;var n=Math.max(t,e);this._level=Math.log(n)/Math.log(2)+1|0,this._walkHilbert(i.UP),this._visit(i.NONE)},t.prototype._walkHilbert=function(t){if(!(this._level<1)){switch(this._level--,t){case i.LEFT:this._walkHilbert(i.UP),this._visit(i.RIGHT),this._walkHilbert(i.LEFT),this._visit(i.DOWN),this._walkHilbert(i.LEFT),this._visit(i.LEFT),this._walkHilbert(i.DOWN);break;case i.RIGHT:this._walkHilbert(i.DOWN),this._visit(i.LEFT),this._walkHilbert(i.RIGHT),this._visit(i.UP),this._walkHilbert(i.RIGHT),this._visit(i.RIGHT),this._walkHilbert(i.UP);break;case i.UP:this._walkHilbert(i.LEFT),this._visit(i.DOWN),this._walkHilbert(i.UP),this._visit(i.RIGHT),this._walkHilbert(i.UP),this._visit(i.UP),this._walkHilbert(i.RIGHT);break;case i.DOWN:this._walkHilbert(i.RIGHT),this._visit(i.UP),this._walkHilbert(i.DOWN),this._visit(i.LEFT),this._walkHilbert(i.DOWN),this._visit(i.DOWN),this._walkHilbert(i.LEFT)}this._level++}},t.prototype._visit=function(t){switch(this._x>=0&&this._x<this._width&&this._y>=0&&this._y<this._height&&(this._callback(this._x,this._y,this._d),this._d++),t){case i.LEFT:this._x--;break;case i.RIGHT:this._x++;break;case i.UP:this._y--;break;case i.DOWN:this._y++}},t}();e.HilbertCurveBase=r},function(t,e,i){"use strict";var r=i(36);e.SSIM=r.SSIM},function(t,e,i){"use strict";var r=i(2),n=function(){function t(){}return t.prototype.compare=function(t,e){if(t.getHeight()!==e.getHeight()||t.getWidth()!==e.getWidth())throw new Error("Images have different sizes!");var i=Math.pow(.01*255,2),r=Math.pow(.03*255,2),n=0,a=0;return this._iterate(t,e,(function(t,e,o,s){for(var h=0,u=0,l=0,c=0;c<t.length;c++)u+=Math.pow(t[c]-o,2),l+=Math.pow(e[c]-s,2),h+=(t[c]-o)*(e[c]-s);var f=t.length-1;u/=f,l/=f;var p=(2*o*s+i)*(2*(h/=f)+r),d=(Math.pow(o,2)+Math.pow(s,2)+i)*(u+l+r);a+=p/d,n++})),a/n},t.prototype._iterate=function(t,e,i){for(var r=t.getWidth(),n=t.getHeight(),a=0;a<n;a+=8)for(var o=0;o<r;o+=8){var s=Math.min(8,r-o),h=Math.min(8,n-a),u=this._calculateLumaValuesForWindow(t,o,a,s,h),l=this._calculateLumaValuesForWindow(e,o,a,s,h);i(u,l,this._calculateAverageLuma(u),this._calculateAverageLuma(l))}},t.prototype._calculateLumaValuesForWindow=function(t,e,i,n,a){for(var o=t.getPointArray(),s=[],h=0,u=i;u<i+a;u++)for(var l=u*t.getWidth(),c=e;c<e+n;c++){var f=o[l+c];s[h]=f.r*r.Y.RED+f.g*r.Y.GREEN+f.b*r.Y.BLUE,h++}return s},t.prototype._calculateAverageLuma=function(t){for(var e=0,i=0;i<t.length;i++)e+=t[i];return e/t.length},t}();e.SSIM=n},function(t,e,i){"use strict";var r=i(6);e.arithmetic=r;var n=i(28);e.HueStatistics=n.HueStatistics;var a=i(22);e.Palette=a.Palette;var o=i(24);e.Point=o.Point;var s=i(23);e.PointContainer=s.PointContainer}])},t.exports=e()},4970:t=>{"use strict";const e=t=>null!==t&&"object"==typeof t&&"function"==typeof t.pipe;e.writable=t=>e(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,e.readable=t=>e(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,e.duplex=t=>e.writable(t)&&e.readable(t),e.transform=t=>e.duplex(t)&&"function"==typeof t._transform&&"object"==typeof t._transformState,t.exports=e},5817:(t,e,i)=>{"use strict";var r=i(5318);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(i(3006)),a=r(i(7209)),o=r(i(6240)),s=(0,n.default)({types:[a.default],plugins:[o.default]});e.default=s},7870:(t,e,i)=>{var r=i(587),n=i(914);t.exports={encode:r,decode:n}},914:t=>{var e=function(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),e=4017,i=799,r=3406,n=2276,a=1567,o=3784,s=5793,h=2896;function u(){}function l(t,e){for(var i,r,n=0,a=[],o=16;o>0&&!t[o-1];)o--;a.push({children:[],index:0});var s,h=a[0];for(i=0;i<o;i++){for(r=0;r<t[i];r++){for((h=a.pop()).children[h.index]=e[n];h.index>0;){if(0===a.length)throw new Error("Could not recreate Huffman Table");h=a.pop()}for(h.index++,a.push(h);a.length<=i;)a.push(s={children:[],index:0}),h.children[h.index]=s.children,h=s;n++}i+1<o&&(a.push(s={children:[],index:0}),h.children[h.index]=s.children,h=s)}return a[0].children}function c(e,i,r,n,a,o,s,h,u,l){r.precision,r.samplesPerLine,r.scanLines;var c=r.mcusPerLine,f=r.progressive,p=(r.maxH,r.maxV,i),d=0,m=0;function g(){if(m>0)return m--,d>>m&1;if(255==(d=e[i++])){var t=e[i++];if(t)throw new Error("unexpected marker: "+(d<<8|t).toString(16))}return m=7,d>>>7}function b(t){for(var e,i=t;null!==(e=g());){if("number"==typeof(i=i[e]))return i;if("object"!=typeof i)throw new Error("invalid huffman sequence")}return null}function v(t){for(var e=0;t>0;){var i=g();if(null===i)return;e=e<<1|i,t--}return e}function y(t){var e=v(t);return e>=1<<t-1?e:e+(-1<<t)+1}var _,w=0,x=0;function E(t,e,i,r,n){var a=i%c,o=(i/c|0)*t.v+r,s=a*t.h+n;void 0===t.blocks[o]&&l.tolerantDecoding||e(t,t.blocks[o][s])}function I(t,e,i){var r=i/t.blocksPerLine|0,n=i%t.blocksPerLine;void 0===t.blocks[r]&&l.tolerantDecoding||e(t,t.blocks[r][n])}var M,k,P,T,S,A,O=n.length;A=f?0===o?0===h?function(t,e){var i=b(t.huffmanTableDC),r=0===i?0:y(i)<<u;e[0]=t.pred+=r}:function(t,e){e[0]|=g()<<u}:0===h?function(e,i){if(w>0)w--;else for(var r=o,n=s;r<=n;){var a=b(e.huffmanTableAC),h=15&a,l=a>>4;if(0!==h)i[t[r+=l]]=y(h)*(1<<u),r++;else{if(l<15){w=v(l)+(1<<l)-1;break}r+=16}}}:function(e,i){for(var r=o,n=s,a=0;r<=n;){var h=t[r],l=i[h]<0?-1:1;switch(x){case 0:var c=b(e.huffmanTableAC),f=15&c;if(a=c>>4,0===f)a<15?(w=v(a)+(1<<a),x=4):(a=16,x=1);else{if(1!==f)throw new Error("invalid ACn encoding");_=y(f),x=a?2:3}continue;case 1:case 2:i[h]?i[h]+=(g()<<u)*l:0==--a&&(x=2==x?3:0);break;case 3:i[h]?i[h]+=(g()<<u)*l:(i[h]=_<<u,x=0);break;case 4:i[h]&&(i[h]+=(g()<<u)*l)}r++}4===x&&0==--w&&(x=0)}:function(e,i){var r=b(e.huffmanTableDC),n=0===r?0:y(r);i[0]=e.pred+=n;for(var a=1;a<64;){var o=b(e.huffmanTableAC),s=15&o,h=o>>4;if(0!==s)i[t[a+=h]]=y(s),a++;else{if(h<15)break;a+=16}}};var C,D,B,N,L=0;for(D=1==O?n[0].blocksPerLine*n[0].blocksPerColumn:c*r.mcusPerColumn,a||(a=D);L<D;){for(k=0;k<O;k++)n[k].pred=0;if(w=0,1==O)for(M=n[0],S=0;S<a;S++)I(M,A,L),L++;else for(S=0;S<a;S++){for(k=0;k<O;k++)for(B=(M=n[k]).h,N=M.v,P=0;P<N;P++)for(T=0;T<B;T++)E(M,A,L,P,T);if(++L===D)break}if(L===D)do{if(255===e[i]&&0!==e[i+1])break;i+=1}while(i<e.length-2);if(m=0,(C=e[i]<<8|e[i+1])<65280)throw new Error("marker was not found");if(!(C>=65488&&C<=65495))break;i+=2}return i-p}function f(t,u){var l,c,f=[],p=u.blocksPerLine,d=u.blocksPerColumn,m=p<<3,b=new Int32Array(64),v=new Uint8Array(64);function y(t,l,c){var f,p,d,m,g,b,v,y,_,w,x=u.quantizationTable,E=c;for(w=0;w<64;w++)E[w]=t[w]*x[w];for(w=0;w<8;++w){var I=8*w;0!=E[1+I]||0!=E[2+I]||0!=E[3+I]||0!=E[4+I]||0!=E[5+I]||0!=E[6+I]||0!=E[7+I]?(f=s*E[0+I]+128>>8,p=s*E[4+I]+128>>8,d=E[2+I],m=E[6+I],g=h*(E[1+I]-E[7+I])+128>>8,y=h*(E[1+I]+E[7+I])+128>>8,b=E[3+I]<<4,v=E[5+I]<<4,_=f-p+1>>1,f=f+p+1>>1,p=_,_=d*o+m*a+128>>8,d=d*a-m*o+128>>8,m=_,_=g-v+1>>1,g=g+v+1>>1,v=_,_=y+b+1>>1,b=y-b+1>>1,y=_,_=f-m+1>>1,f=f+m+1>>1,m=_,_=p-d+1>>1,p=p+d+1>>1,d=_,_=g*n+y*r+2048>>12,g=g*r-y*n+2048>>12,y=_,_=b*i+v*e+2048>>12,b=b*e-v*i+2048>>12,v=_,E[0+I]=f+y,E[7+I]=f-y,E[1+I]=p+v,E[6+I]=p-v,E[2+I]=d+b,E[5+I]=d-b,E[3+I]=m+g,E[4+I]=m-g):(_=s*E[0+I]+512>>10,E[0+I]=_,E[1+I]=_,E[2+I]=_,E[3+I]=_,E[4+I]=_,E[5+I]=_,E[6+I]=_,E[7+I]=_)}for(w=0;w<8;++w){var M=w;0!=E[8+M]||0!=E[16+M]||0!=E[24+M]||0!=E[32+M]||0!=E[40+M]||0!=E[48+M]||0!=E[56+M]?(f=s*E[0+M]+2048>>12,p=s*E[32+M]+2048>>12,d=E[16+M],m=E[48+M],g=h*(E[8+M]-E[56+M])+2048>>12,y=h*(E[8+M]+E[56+M])+2048>>12,b=E[24+M],v=E[40+M],_=f-p+1>>1,f=f+p+1>>1,p=_,_=d*o+m*a+2048>>12,d=d*a-m*o+2048>>12,m=_,_=g-v+1>>1,g=g+v+1>>1,v=_,_=y+b+1>>1,b=y-b+1>>1,y=_,_=f-m+1>>1,f=f+m+1>>1,m=_,_=p-d+1>>1,p=p+d+1>>1,d=_,_=g*n+y*r+2048>>12,g=g*r-y*n+2048>>12,y=_,_=b*i+v*e+2048>>12,b=b*e-v*i+2048>>12,v=_,E[0+M]=f+y,E[56+M]=f-y,E[8+M]=p+v,E[48+M]=p-v,E[16+M]=d+b,E[40+M]=d-b,E[24+M]=m+g,E[32+M]=m-g):(_=s*c[w+0]+8192>>14,E[0+M]=_,E[8+M]=_,E[16+M]=_,E[24+M]=_,E[32+M]=_,E[40+M]=_,E[48+M]=_,E[56+M]=_)}for(w=0;w<64;++w){var k=128+(E[w]+8>>4);l[w]=k<0?0:k>255?255:k}}g(m*d*8);for(var _=0;_<d;_++){var w=_<<3;for(l=0;l<8;l++)f.push(new Uint8Array(m));for(var x=0;x<p;x++){y(u.blocks[_][x],v,b);var E=0,I=x<<3;for(c=0;c<8;c++){var M=f[w+c];for(l=0;l<8;l++)M[I+l]=v[E++]}}}return f}function p(t){return t<0?0:t>255?255:t}u.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var i=1e3*this.opts.maxResolutionInMP*1e3,r=0;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function a(t){var e,i,r=0,n=0;for(i in t.components)t.components.hasOwnProperty(i)&&(r<(e=t.components[i]).h&&(r=e.h),n<e.v&&(n=e.v));var a=Math.ceil(t.samplesPerLine/8/r),o=Math.ceil(t.scanLines/8/n);for(i in t.components)if(t.components.hasOwnProperty(i)){e=t.components[i];var s=Math.ceil(Math.ceil(t.samplesPerLine/8)*e.h/r),h=Math.ceil(Math.ceil(t.scanLines/8)*e.v/n),u=a*e.h,l=o*e.v,c=[];g(l*u*256);for(var f=0;f<l;f++){for(var p=[],d=0;d<u;d++)p.push(new Int32Array(64));c.push(p)}e.blocksPerLine=s,e.blocksPerColumn=h,e.blocks=c}t.maxH=r,t.maxV=n,t.mcusPerLine=a,t.mcusPerColumn=o}e.length;var o,s,h,u,p=null,d=null,m=[],b=[],v=[],y=[],_=n(),w=-1;if(this.comments=[],65496!=_)throw new Error("SOI not found");for(_=n();65497!=_;){switch(_){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var x=(h=void 0,u=void 0,h=n(),u=e.subarray(r,r+h-2),r+=u.length,u);if(65534===_){var E=String.fromCharCode.apply(null,x);this.comments.push(E)}65504===_&&74===x[0]&&70===x[1]&&73===x[2]&&70===x[3]&&0===x[4]&&(p={version:{major:x[5],minor:x[6]},densityUnits:x[7],xDensity:x[8]<<8|x[9],yDensity:x[10]<<8|x[11],thumbWidth:x[12],thumbHeight:x[13],thumbData:x.subarray(14,14+3*x[12]*x[13])}),65505===_&&69===x[0]&&120===x[1]&&105===x[2]&&102===x[3]&&0===x[4]&&(this.exifBuffer=x.subarray(5,x.length)),65518===_&&65===x[0]&&100===x[1]&&111===x[2]&&98===x[3]&&101===x[4]&&0===x[5]&&(d={version:x[6],flags0:x[7]<<8|x[8],flags1:x[9]<<8|x[10],transformCode:x[11]});break;case 65499:for(var I=n()+r-2;r<I;){var M=e[r++];g(256);var k=new Int32Array(64);if(M>>4==0)for(Q=0;Q<64;Q++)k[t[Q]]=e[r++];else{if(M>>4!=1)throw new Error("DQT: invalid table spec");for(Q=0;Q<64;Q++)k[t[Q]]=n()}m[15&M]=k}break;case 65472:case 65473:case 65474:n(),(o={}).extended=65473===_,o.progressive=65474===_,o.precision=e[r++],o.scanLines=n(),o.samplesPerLine=n(),o.components={},o.componentsOrder=[];var P=o.scanLines*o.samplesPerLine;if(P>i){var T=Math.ceil((P-i)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${T}MP`)}var S,A=e[r++];for(V=0;V<A;V++){S=e[r];var O=e[r+1]>>4,C=15&e[r+1],D=e[r+2];o.componentsOrder.push(S),o.components[S]={h:O,v:C,quantizationIdx:D},r+=3}a(o),b.push(o);break;case 65476:var B=n();for(V=2;V<B;){var N=e[r++],L=new Uint8Array(16),R=0;for(Q=0;Q<16;Q++,r++)R+=L[Q]=e[r];g(16+R);var F=new Uint8Array(R);for(Q=0;Q<R;Q++,r++)F[Q]=e[r];V+=17+R,(N>>4==0?y:v)[15&N]=l(L,F)}break;case 65501:n(),s=n();break;case 65500:n(),n();break;case 65498:n();var z=e[r++],G=[];for(V=0;V<z;V++){X=o.components[e[r++]];var U=e[r++];X.huffmanTableDC=y[U>>4],X.huffmanTableAC=v[15&U],G.push(X)}var j=e[r++],H=e[r++],W=e[r++],q=c(e,r,o,G,s,j,H,W>>4,15&W,this.opts);r+=q;break;case 65535:255!==e[r]&&r--;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[r-2]<=254){r-=3;break}if(224===_||225==_){if(-1!==w)throw new Error(`first unknown JPEG marker at offset ${w.toString(16)}, second unknown JPEG marker ${_.toString(16)} at offset ${(r-1).toString(16)}`);w=r-1;const t=n();if(255===e[r+t-2]){r+=t-2;break}}throw new Error("unknown JPEG marker "+_.toString(16))}_=n()}if(1!=b.length)throw new Error("only single frame JPEGs supported");for(var V=0;V<b.length;V++){var Y=b[V].components;for(var Q in Y)Y[Q].quantizationTable=m[Y[Q].quantizationIdx],delete Y[Q].quantizationIdx}for(this.width=o.samplesPerLine,this.height=o.scanLines,this.jfif=p,this.adobe=d,this.components=[],V=0;V<o.componentsOrder.length;V++){var X=o.components[o.componentsOrder[V]];this.components.push({lines:f(0,X),scaleX:X.h/o.maxH,scaleY:X.v/o.maxV})}},getData:function(t,e){var i,r,n,a,o,s,h,u,l,c,f,d,m,b,v,y,_,w,x,E,I,M=this.width/t,k=this.height/e,P=0,T=t*e*this.components.length;g(T);var S=new Uint8Array(T);switch(this.components.length){case 1:for(i=this.components[0],c=0;c<e;c++)for(o=i.lines[0|c*i.scaleY*k],l=0;l<t;l++)f=o[0|l*i.scaleX*M],S[P++]=f;break;case 2:for(i=this.components[0],r=this.components[1],c=0;c<e;c++)for(o=i.lines[0|c*i.scaleY*k],s=r.lines[0|c*r.scaleY*k],l=0;l<t;l++)f=o[0|l*i.scaleX*M],S[P++]=f,f=s[0|l*r.scaleX*M],S[P++]=f;break;case 3:for(I=!0,this.adobe&&this.adobe.transformCode?I=!0:void 0!==this.opts.colorTransform&&(I=!!this.opts.colorTransform),i=this.components[0],r=this.components[1],n=this.components[2],c=0;c<e;c++)for(o=i.lines[0|c*i.scaleY*k],s=r.lines[0|c*r.scaleY*k],h=n.lines[0|c*n.scaleY*k],l=0;l<t;l++)I?(f=o[0|l*i.scaleX*M],d=s[0|l*r.scaleX*M],w=p(f+1.402*((m=h[0|l*n.scaleX*M])-128)),x=p(f-.3441363*(d-128)-.71413636*(m-128)),E=p(f+1.772*(d-128))):(w=o[0|l*i.scaleX*M],x=s[0|l*r.scaleX*M],E=h[0|l*n.scaleX*M]),S[P++]=w,S[P++]=x,S[P++]=E;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(I=!1,this.adobe&&this.adobe.transformCode?I=!0:void 0!==this.opts.colorTransform&&(I=!!this.opts.colorTransform),i=this.components[0],r=this.components[1],n=this.components[2],a=this.components[3],c=0;c<e;c++)for(o=i.lines[0|c*i.scaleY*k],s=r.lines[0|c*r.scaleY*k],h=n.lines[0|c*n.scaleY*k],u=a.lines[0|c*a.scaleY*k],l=0;l<t;l++)I?(f=o[0|l*i.scaleX*M],d=s[0|l*r.scaleX*M],m=h[0|l*n.scaleX*M],b=u[0|l*a.scaleX*M],v=255-p(f+1.402*(m-128)),y=255-p(f-.3441363*(d-128)-.71413636*(m-128)),_=255-p(f+1.772*(d-128))):(v=o[0|l*i.scaleX*M],y=s[0|l*r.scaleX*M],_=h[0|l*n.scaleX*M],b=u[0|l*a.scaleX*M]),S[P++]=255-v,S[P++]=255-y,S[P++]=255-_,S[P++]=255-b;break;default:throw new Error("Unsupported color mode")}return S},copyToImageData:function(t,e){var i,r,n,a,o,s,h,u,l,c=t.width,f=t.height,d=t.data,m=this.getData(c,f),g=0,b=0;switch(this.components.length){case 1:for(r=0;r<f;r++)for(i=0;i<c;i++)n=m[g++],d[b++]=n,d[b++]=n,d[b++]=n,e&&(d[b++]=255);break;case 3:for(r=0;r<f;r++)for(i=0;i<c;i++)h=m[g++],u=m[g++],l=m[g++],d[b++]=h,d[b++]=u,d[b++]=l,e&&(d[b++]=255);break;case 4:for(r=0;r<f;r++)for(i=0;i<c;i++)o=m[g++],s=m[g++],n=m[g++],h=255-p(o*(1-(a=m[g++])/255)+a),u=255-p(s*(1-a/255)+a),l=255-p(n*(1-a/255)+a),d[b++]=h,d[b++]=u,d[b++]=l,e&&(d[b++]=255);break;default:throw new Error("Unsupported color mode")}}};var d=0,m=0;function g(t=0){var e=d+t;if(e>m){var i=Math.ceil((e-m)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${i}MB`)}d=e}return u.resetMaxMemoryUsage=function(t){d=0,m=t},u.getBytesAllocated=function(){return d},u.requestMemoryAllocation=g,u}();t.exports=function(t,i={}){var r={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512,...i},n=new Uint8Array(t),a=new e;a.opts=r,e.resetMaxMemoryUsage(1024*r.maxMemoryUsageInMB*1024),a.parse(n);var o=r.formatAsRGBA?4:3,s=a.width*a.height*o;try{e.requestMemoryAllocation(s);var h={width:a.width,height:a.height,exifBuffer:a.exifBuffer,data:r.useTArray?new Uint8Array(s):Buffer.alloc(s)};a.comments.length>0&&(h.comments=a.comments)}catch(t){throw t instanceof RangeError?new Error("Could not allocate enough memory for the image. Required: "+s):t}return a.copyToImageData(h,r.formatAsRGBA),h}},587:t=>{function e(t){Math.round;var e,i,r,n,a,o=Math.floor,s=new Array(64),h=new Array(64),u=new Array(64),l=new Array(64),c=new Array(65535),f=new Array(65535),p=new Array(64),d=new Array(64),m=[],g=0,b=7,v=new Array(64),y=new Array(64),_=new Array(64),w=new Array(256),x=new Array(2048),E=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],I=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],M=[0,1,2,3,4,5,6,7,8,9,10,11],k=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],P=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],T=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],S=[0,1,2,3,4,5,6,7,8,9,10,11],A=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],O=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function C(t,e){for(var i=0,r=0,n=new Array,a=1;a<=16;a++){for(var o=1;o<=t[a];o++)n[e[r]]=[],n[e[r]][0]=i,n[e[r]][1]=a,r++,i++;i*=2}return n}function D(t){for(var e=t[0],i=t[1]-1;i>=0;)e&1<<i&&(g|=1<<b),i--,--b<0&&(255==g?(B(255),B(0)):B(g),b=7,g=0)}function B(t){m.push(t)}function N(t){B(t>>8&255),B(255&t)}function L(t,e,i,r,n){for(var a,o=n[0],s=n[240],h=function(t,e){var i,r,n,a,o,s,h,u,l,c,f=0;for(l=0;l<8;++l){i=t[f],r=t[f+1],n=t[f+2],a=t[f+3],o=t[f+4],s=t[f+5],h=t[f+6];var d=i+(u=t[f+7]),m=i-u,g=r+h,b=r-h,v=n+s,y=n-s,_=a+o,w=a-o,x=d+_,E=d-_,I=g+v,M=g-v;t[f]=x+I,t[f+4]=x-I;var k=.707106781*(M+E);t[f+2]=E+k,t[f+6]=E-k;var P=.382683433*((x=w+y)-(M=b+m)),T=.5411961*x+P,S=1.306562965*M+P,A=.707106781*(I=y+b),O=m+A,C=m-A;t[f+5]=C+T,t[f+3]=C-T,t[f+1]=O+S,t[f+7]=O-S,f+=8}for(f=0,l=0;l<8;++l){i=t[f],r=t[f+8],n=t[f+16],a=t[f+24],o=t[f+32],s=t[f+40],h=t[f+48];var D=i+(u=t[f+56]),B=i-u,N=r+h,L=r-h,R=n+s,F=n-s,z=a+o,G=a-o,U=D+z,j=D-z,H=N+R,W=N-R;t[f]=U+H,t[f+32]=U-H;var q=.707106781*(W+j);t[f+16]=j+q,t[f+48]=j-q;var V=.382683433*((U=G+F)-(W=L+B)),Y=.5411961*U+V,Q=1.306562965*W+V,X=.707106781*(H=F+L),Z=B+X,J=B-X;t[f+40]=J+Y,t[f+24]=J-Y,t[f+8]=Z+Q,t[f+56]=Z-Q,f++}for(l=0;l<64;++l)c=t[l]*e[l],p[l]=c>0?c+.5|0:c-.5|0;return p}(t,e),u=0;u<64;++u)d[E[u]]=h[u];var l=d[0]-i;i=d[0],0==l?D(r[0]):(D(r[f[a=32767+l]]),D(c[a]));for(var m=63;m>0&&0==d[m];m--);if(0==m)return D(o),i;for(var g,b=1;b<=m;){for(var v=b;0==d[b]&&b<=m;++b);var y=b-v;if(y>=16){g=y>>4;for(var _=1;_<=g;++_)D(s);y&=15}a=32767+d[b],D(n[(y<<4)+f[a]]),D(c[a]),b++}return 63!=m&&D(o),i}function R(t){t<=0&&(t=1),t>100&&(t=100),a!=t&&(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var r=o((e[i]*t+50)/100);r<1?r=1:r>255&&(r=255),s[E[i]]=r}for(var n=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var c=o((n[a]*t+50)/100);c<1?c=1:c>255&&(c=255),h[E[a]]=c}for(var f=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],p=0,d=0;d<8;d++)for(var m=0;m<8;m++)u[p]=1/(s[E[p]]*f[d]*f[m]*8),l[p]=1/(h[E[p]]*f[d]*f[m]*8),p++}(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),a=t)}this.encode=function(t,a){(new Date).getTime(),a&&R(a),m=new Array,g=0,b=7,N(65496),N(65504),N(16),B(74),B(70),B(73),B(70),B(0),B(1),B(1),B(0),N(1),N(1),B(0),B(0),function(t){if(t){N(65505),69===t[0]&&120===t[1]&&105===t[2]&&102===t[3]?N(t.length+2):(N(t.length+5+2),B(69),B(120),B(105),B(102),B(0));for(var e=0;e<t.length;e++)B(t[e])}}(t.exifBuffer),function(){N(65499),N(132),B(0);for(var t=0;t<64;t++)B(s[t]);B(1);for(var e=0;e<64;e++)B(h[e])}(),function(t,e){N(65472),N(17),B(8),N(e),N(t),B(3),B(1),B(17),B(0),B(2),B(17),B(1),B(3),B(17),B(1)}(t.width,t.height),function(){N(65476),N(418),B(0);for(var t=0;t<16;t++)B(I[t+1]);for(var e=0;e<=11;e++)B(M[e]);B(16);for(var i=0;i<16;i++)B(k[i+1]);for(var r=0;r<=161;r++)B(P[r]);B(1);for(var n=0;n<16;n++)B(T[n+1]);for(var a=0;a<=11;a++)B(S[a]);B(17);for(var o=0;o<16;o++)B(A[o+1]);for(var s=0;s<=161;s++)B(O[s])}(),N(65498),N(12),B(3),B(1),B(0),B(2),B(17),B(3),B(17),B(0),B(63),B(0);var o=0,c=0,f=0;g=0,b=7,this.encode.displayName="_encode_";for(var p,d,w,E,C,F,z,G,U,j=t.data,H=t.width,W=t.height,q=4*H,V=0;V<W;){for(p=0;p<q;){for(F=C=q*V+p,z=-1,G=0,U=0;U<64;U++)F=C+(G=U>>3)*q+(z=4*(7&U)),V+G>=W&&(F-=q*(V+1+G-W)),p+z>=q&&(F-=p+z-q+4),d=j[F++],w=j[F++],E=j[F++],v[U]=(x[d]+x[w+256>>0]+x[E+512>>0]>>16)-128,y[U]=(x[d+768>>0]+x[w+1024>>0]+x[E+1280>>0]>>16)-128,_[U]=(x[d+1280>>0]+x[w+1536>>0]+x[E+1792>>0]>>16)-128;o=L(v,u,o,e,r),c=L(y,l,c,i,n),f=L(_,l,f,i,n),p+=32}V+=8}if(b>=0){var Y=[];Y[1]=b+1,Y[0]=(1<<b+1)-1,D(Y)}return N(65497),Buffer.from(m)},(new Date).getTime(),t||(t=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)w[e]=t(e)}(),e=C(I,M),i=C(T,S),r=C(k,P),n=C(A,O),function(){for(var t=1,e=2,i=1;i<=15;i++){for(var r=t;r<e;r++)f[32767+r]=i,c[32767+r]=[],c[32767+r][1]=i,c[32767+r][0]=r;for(var n=-(e-1);n<=-t;n++)f[32767+n]=i,c[32767+n]=[],c[32767+n][1]=i,c[32767+n][0]=e-1+n;t<<=1,e<<=1}}(),function(){for(var t=0;t<256;t++)x[t]=19595*t,x[t+256>>0]=38470*t,x[t+512>>0]=7471*t+32768,x[t+768>>0]=-11059*t,x[t+1024>>0]=-21709*t,x[t+1280>>0]=32768*t+8421375,x[t+1536>>0]=-27439*t,x[t+1792>>0]=-5329*t}(),R(t),(new Date).getTime()}t.exports=function(t,i){return void 0===i&&(i=50),{data:new e(i).encode(t,i),width:t.width,height:t.height}}},1120:(t,e,i)=>{var r=i(5747),n=i(8835),a=(i(5622),i(193)),o=i(3340),s=i(4109),h=i(3827),u=i(5518),l=function(){},c=i(5781);t.exports=function(t,e){e="function"==typeof e?e:l,"string"==typeof t?t={uri:t,url:t}:t||(t={});var i=t.uri||t.url;function f(t,r){if(t)return e(t);!function(t,e,i){var r,n;c(e)?("string"==typeof e&&(e=Buffer.from(e,"binary")),n=!0):e=e.toString().trim();try{r=n?h(e):/json/.test(u.lookup(t))||"{"===e.charAt(0)?JSON.parse(e):/xml/.test(u.lookup(t))||"<"===e.charAt(0)?s(e):o(e)}catch(t){i(t),i=l}i(null,r)}(i,r.body||r,e)}n.parse(i).host?a(t,f):r.readFile(i,t,f)}},5781:(t,e,i)=>{var r=i(2369),n=Buffer.from([66,77,70,3]);t.exports=function(t){return"string"==typeof t?"BMF"===t.substring(0,3):t.length>4&&r(t.slice(0,4),n)}},5518:(t,e,i)=>{i(5622);var r=i(5747);function n(){this.types=Object.create(null),this.extensions=Object.create(null)}n.prototype.define=function(t){for(var e in t){for(var i=t[e],r=0;r<i.length;r++)process.env.DEBUG_MIME&&this.types[i[r]]&&console.warn((this._loading||"define()").replace(/.*\//,""),'changes "'+i[r]+'" extension type from '+this.types[i[r]]+" to "+e),this.types[i[r]]=e;this.extensions[e]||(this.extensions[e]=i[0])}},n.prototype.load=function(t){this._loading=t;var e={};r.readFileSync(t,"ascii").split(/[\r\n]+/).forEach((function(t){var i=t.replace(/\s*#.*|^\s*|\s*$/g,"").split(/\s+/);e[i.shift()]=i})),this.define(e),this._loading=null},n.prototype.lookup=function(t,e){var i=t.replace(/^.*[\.\/\\]/,"").toLowerCase();return this.types[i]||e||this.default_type},n.prototype.extension=function(t){var e=t.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();return this.extensions[e]};var a=new n;a.define(i(2274)),a.default_type=a.lookup("bin"),a.Mime=n,a.charsets={lookup:function(t,e){return/^text\/|^application\/(javascript|json)/.test(t)?"UTF-8":e}},t.exports=a},2274:t=>{"use strict";t.exports=JSON.parse('{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}')},1890:(t,e,i)=>{var r=i(5622),n=i(5747),a=parseInt("0777",8);function o(t,e,i,s){"function"==typeof e?(i=e,e={}):e&&"object"==typeof e||(e={mode:e});var h=e.mode,u=e.fs||n;void 0===h&&(h=a),s||(s=null);var l=i||function(){};t=r.resolve(t),u.mkdir(t,h,(function(i){if(!i)return l(null,s=s||t);switch(i.code){case"ENOENT":if(r.dirname(t)===t)return l(i);o(r.dirname(t),e,(function(i,r){i?l(i,r):o(t,e,l,r)}));break;default:u.stat(t,(function(t,e){t||!e.isDirectory()?l(i,s):l(null,s)}))}}))}t.exports=o.mkdirp=o.mkdirP=o,o.sync=function t(e,i,o){i&&"object"==typeof i||(i={mode:i});var s=i.mode,h=i.fs||n;void 0===s&&(s=a),o||(o=null),e=r.resolve(e);try{h.mkdirSync(e,s),o=o||e}catch(n){switch(n.code){case"ENOENT":o=t(r.dirname(e),i,o),t(e,i,o);break;default:var u;try{u=h.statSync(e)}catch(t){throw n}if(!u.isDirectory())throw n}}return o}},1494:(t,e)=>{"use strict";function i(t,e,i,r){for(var n=t[e++],a=1<<n,o=a+1,s=o+1,h=n+1,u=(1<<h)-1,l=0,c=0,f=0,p=t[e++],d=new Int32Array(4096),m=null;;){for(;l<16&&0!==p;)c|=t[e++]<<l,l+=8,1===p?p=t[e++]:--p;if(l<h)break;var g=c&u;if(c>>=h,l-=h,g!==a){if(g===o)break;for(var b=g<s?g:m,v=0,y=b;y>a;)y=d[y]>>8,++v;var _=y;if(f+v+(b!==g?1:0)>r)return void console.log("Warning, gif stream longer than expected.");i[f++]=_;var w=f+=v;for(b!==g&&(i[f++]=_),y=b;v--;)y=d[y],i[--w]=255&y,y>>=8;null!==m&&s<4096&&(d[s++]=m<<8|_,s>=u+1&&h<12&&(++h,u=u<<1|1)),m=g}else s=o+1,u=(1<<(h=n+1))-1,m=null}return f!==r&&console.log("Warning, gif stream shorter than expected."),i}try{e.GifWriter=function(t,e,i,r){var n=0,a=void 0===(r=void 0===r?{}:r).loop?null:r.loop,o=void 0===r.palette?null:r.palette;if(e<=0||i<=0||e>65535||i>65535)throw new Error("Width/Height invalid.");function s(t){var e=t.length;if(e<2||e>256||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}t[n++]=71,t[n++]=73,t[n++]=70,t[n++]=56,t[n++]=57,t[n++]=97;var h=0,u=0;if(null!==o){for(var l=s(o);l>>=1;)++h;if(l=1<<h,--h,void 0!==r.background){if((u=r.background)>=l)throw new Error("Background index out of range.");if(0===u)throw new Error("Background index explicitly passed as 0.")}}if(t[n++]=255&e,t[n++]=e>>8&255,t[n++]=255&i,t[n++]=i>>8&255,t[n++]=(null!==o?128:0)|h,t[n++]=u,t[n++]=0,null!==o)for(var c=0,f=o.length;c<f;++c){var p=o[c];t[n++]=p>>16&255,t[n++]=p>>8&255,t[n++]=255&p}if(null!==a){if(a<0||a>65535)throw new Error("Loop count invalid.");t[n++]=33,t[n++]=255,t[n++]=11,t[n++]=78,t[n++]=69,t[n++]=84,t[n++]=83,t[n++]=67,t[n++]=65,t[n++]=80,t[n++]=69,t[n++]=50,t[n++]=46,t[n++]=48,t[n++]=3,t[n++]=1,t[n++]=255&a,t[n++]=a>>8&255,t[n++]=0}var d=!1;this.addFrame=function(e,i,r,a,h,u){if(!0===d&&(--n,d=!1),u=void 0===u?{}:u,e<0||i<0||e>65535||i>65535)throw new Error("x/y invalid.");if(r<=0||a<=0||r>65535||a>65535)throw new Error("Width/Height invalid.");if(h.length<r*a)throw new Error("Not enough pixels for the frame size.");var l=!0,c=u.palette;if(null==c&&(l=!1,c=o),null==c)throw new Error("Must supply either a local or global palette.");for(var f=s(c),p=0;f>>=1;)++p;f=1<<p;var m=void 0===u.delay?0:u.delay,g=void 0===u.disposal?0:u.disposal;if(g<0||g>3)throw new Error("Disposal out of range.");var b=!1,v=0;if(void 0!==u.transparent&&null!==u.transparent&&(b=!0,(v=u.transparent)<0||v>=f))throw new Error("Transparent color index.");if((0!==g||b||0!==m)&&(t[n++]=33,t[n++]=249,t[n++]=4,t[n++]=g<<2|(!0===b?1:0),t[n++]=255&m,t[n++]=m>>8&255,t[n++]=v,t[n++]=0),t[n++]=44,t[n++]=255&e,t[n++]=e>>8&255,t[n++]=255&i,t[n++]=i>>8&255,t[n++]=255&r,t[n++]=r>>8&255,t[n++]=255&a,t[n++]=a>>8&255,t[n++]=!0===l?128|p-1:0,!0===l)for(var y=0,_=c.length;y<_;++y){var w=c[y];t[n++]=w>>16&255,t[n++]=w>>8&255,t[n++]=255&w}return n=function(t,e,i,r){t[e++]=i;var n=e++,a=1<<i,o=a-1,s=a+1,h=s+1,u=i+1,l=0,c=0;function f(i){for(;l>=i;)t[e++]=255&c,c>>=8,l-=8,e===n+256&&(t[n]=255,n=e++)}function p(t){c|=t<<l,l+=u,f(8)}var d=r[0]&o,m={};p(a);for(var g=1,b=r.length;g<b;++g){var v=r[g]&o,y=d<<8|v,_=m[y];if(void 0===_){for(c|=d<<l,l+=u;l>=8;)t[e++]=255&c,c>>=8,l-=8,e===n+256&&(t[n]=255,n=e++);4096===h?(p(a),h=s+1,u=i+1,m={}):(h>=1<<u&&++u,m[y]=h++),d=v}else d=_}return p(d),p(s),f(1),n+1===e?t[n]=0:(t[n]=e-n-1,t[e++]=0),e}(t,n,p<2?2:p,h)},this.end=function(){return!1===d&&(t[n++]=59,d=!0),n},this.getOutputBuffer=function(){return t},this.setOutputBuffer=function(e){t=e},this.getOutputBufferPosition=function(){return n},this.setOutputBufferPosition=function(t){n=t}},e.GifReader=function(t){var e=0;if(71!==t[e++]||73!==t[e++]||70!==t[e++]||56!==t[e++]||56!=(t[e++]+1&253)||97!==t[e++])throw new Error("Invalid GIF 87a/89a header.");var r=t[e++]|t[e++]<<8,n=t[e++]|t[e++]<<8,a=t[e++],o=a>>7,s=1<<1+(7&a);t[e++],t[e++];var h=null,u=null;o&&(h=e,u=s,e+=3*s);var l=!0,c=[],f=0,p=null,d=0,m=null;for(this.width=r,this.height=n;l&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(11!==t[e]||78==t[e+1]&&69==t[e+2]&&84==t[e+3]&&83==t[e+4]&&67==t[e+5]&&65==t[e+6]&&80==t[e+7]&&69==t[e+8]&&50==t[e+9]&&46==t[e+10]&&48==t[e+11]&&3==t[e+12]&&1==t[e+13]&&0==t[e+16])e+=14,m=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((T=t[e++])>=0))throw Error("Invalid block size");if(0===T)break;e+=T}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var g=t[e++];f=t[e++]|t[e++]<<8,p=t[e++],0==(1&g)&&(p=null),d=g>>2&7,e++;break;case 254:for(;;){if(!((T=t[e++])>=0))throw Error("Invalid block size");if(0===T)break;e+=T}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var b=t[e++]|t[e++]<<8,v=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,_=t[e++]|t[e++]<<8,w=t[e++],x=w>>6&1,E=1<<1+(7&w),I=h,M=u,k=!1;w>>7&&(k=!0,I=e,M=E,e+=3*E);var P=e;for(e++;;){var T;if(!((T=t[e++])>=0))throw Error("Invalid block size");if(0===T)break;e+=T}c.push({x:b,y:v,width:y,height:_,has_local_palette:k,palette_offset:I,palette_size:M,data_offset:P,data_length:e-P,transparent_index:p,interlaced:!!x,delay:f,disposal:d});break;case 59:l=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return c.length},this.loopCount=function(){return m},this.frameInfo=function(t){if(t<0||t>=c.length)throw new Error("Frame index out of range.");return c[t]},this.decodeAndBlitFrameBGRA=function(e,n){var a=this.frameInfo(e),o=a.width*a.height,s=new Uint8Array(o);i(t,a.data_offset,s,o);var h=a.palette_offset,u=a.transparent_index;null===u&&(u=256);var l=a.width,c=r-l,f=l,p=4*(a.y*r+a.x),d=4*((a.y+a.height)*r+a.x),m=p,g=4*c;!0===a.interlaced&&(g+=4*r*7);for(var b=8,v=0,y=s.length;v<y;++v){var _=s[v];if(0===f&&(f=l,(m+=g)>=d&&(g=4*c+4*r*(b-1),m=p+(l+c)*(b<<1),b>>=1)),_===u)m+=4;else{var w=t[h+3*_],x=t[h+3*_+1],E=t[h+3*_+2];n[m++]=E,n[m++]=x,n[m++]=w,n[m++]=255}--f}},this.decodeAndBlitFrameRGBA=function(e,n){var a=this.frameInfo(e),o=a.width*a.height,s=new Uint8Array(o);i(t,a.data_offset,s,o);var h=a.palette_offset,u=a.transparent_index;null===u&&(u=256);var l=a.width,c=r-l,f=l,p=4*(a.y*r+a.x),d=4*((a.y+a.height)*r+a.x),m=p,g=4*c;!0===a.interlaced&&(g+=4*r*7);for(var b=8,v=0,y=s.length;v<y;++v){var _=s[v];if(0===f&&(f=l,(m+=g)>=d&&(g=4*c+4*r*(b-1),m=p+(l+c)*(b<<1),b>>=1)),_===u)m+=4;else{var w=t[h+3*_],x=t[h+3*_+1],E=t[h+3*_+2];n[m++]=w,n[m++]=x,n[m++]=E,n[m++]=255}--f}}}}catch(t){}},9591:(t,e,i)=>{"use strict";var r={};(0,i(4236).assign)(r,i(4555),i(8843),i(1619)),t.exports=r},4555:(t,e,i)=>{"use strict";var r=i(405),n=i(4236),a=i(9373),o=i(8898),s=i(2292),h=Object.prototype.toString;function u(t){if(!(this instanceof u))return new u(t);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var i=r.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==i)throw new Error(o[i]);if(e.header&&r.deflateSetHeader(this.strm,e.header),e.dictionary){var l;if(l="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(i=r.deflateSetDictionary(this.strm,l)))throw new Error(o[i]);this._dict_set=!0}}function l(t,e){var i=new u(e);if(i.push(t,!0),i.err)throw i.msg||o[i.err];return i.result}u.prototype.push=function(t,e){var i,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=e===~~e?e:!0===e?4:0,"string"==typeof t?s.input=a.string2buf(t):"[object ArrayBuffer]"===h.call(t)?s.input=new Uint8Array(t):s.input=t,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new n.Buf8(u),s.next_out=0,s.avail_out=u),1!==(i=r.deflate(s,o))&&0!==i)return this.onEnd(i),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==i);return 4===o?(i=r.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==o||(this.onEnd(0),s.avail_out=0,!0)},u.prototype.onData=function(t){this.chunks.push(t)},u.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=u,e.deflate=l,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,l(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,l(t,e)}},8843:(t,e,i)=>{"use strict";var r=i(7948),n=i(4236),a=i(9373),o=i(1619),s=i(8898),h=i(2292),u=i(2401),l=Object.prototype.toString;function c(t){if(!(this instanceof c))return new c(t);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var i=r.inflateInit2(this.strm,e.windowBits);if(i!==o.Z_OK)throw new Error(s[i]);if(this.header=new u,r.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=a.string2buf(e.dictionary):"[object ArrayBuffer]"===l.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=r.inflateSetDictionary(this.strm,e.dictionary))!==o.Z_OK))throw new Error(s[i])}function f(t,e){var i=new c(e);if(i.push(t,!0),i.err)throw i.msg||s[i.err];return i.result}c.prototype.push=function(t,e){var i,s,h,u,c,f=this.strm,p=this.options.chunkSize,d=this.options.dictionary,m=!1;if(this.ended)return!1;s=e===~~e?e:!0===e?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof t?f.input=a.binstring2buf(t):"[object ArrayBuffer]"===l.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new n.Buf8(p),f.next_out=0,f.avail_out=p),(i=r.inflate(f,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&d&&(i=r.inflateSetDictionary(this.strm,d)),i===o.Z_BUF_ERROR&&!0===m&&(i=o.Z_OK,m=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&i!==o.Z_STREAM_END&&(0!==f.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(h=a.utf8border(f.output,f.next_out),u=f.next_out-h,c=a.buf2string(f.output,h),f.next_out=u,f.avail_out=p-u,u&&n.arraySet(f.output,f.output,h,u,0),this.onData(c)):this.onData(n.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(m=!0)}while((f.avail_in>0||0===f.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(i=r.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),f.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=c,e.inflate=f,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,f(t,e)},e.ungzip=f},4236:(t,e)=>{"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var n in i)r(i,n)&&(t[n]=i[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,i,r,n){if(e.subarray&&t.subarray)t.set(e.subarray(i,i+r),n);else for(var a=0;a<r;a++)t[n+a]=e[i+a]},flattenChunks:function(t){var e,i,r,n,a,o;for(r=0,e=0,i=t.length;e<i;e++)r+=t[e].length;for(o=new Uint8Array(r),n=0,e=0,i=t.length;e<i;e++)a=t[e],o.set(a,n),n+=a.length;return o}},a={arraySet:function(t,e,i,r,n){for(var a=0;a<r;a++)t[n+a]=e[i+a]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,n)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(i)},9373:(t,e,i)=>{"use strict";var r=i(4236),n=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function h(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(t,e));for(var i="",o=0;o<e;o++)i+=String.fromCharCode(t[o]);return i}o[254]=o[254]=1,e.string2buf=function(t){var e,i,n,a,o,s=t.length,h=0;for(a=0;a<s;a++)55296==(64512&(i=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(n=t.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(n-56320),a++),h+=i<128?1:i<2048?2:i<65536?3:4;for(e=new r.Buf8(h),o=0,a=0;o<h;a++)55296==(64512&(i=t.charCodeAt(a)))&&a+1<s&&56320==(64512&(n=t.charCodeAt(a+1)))&&(i=65536+(i-55296<<10)+(n-56320),a++),i<128?e[o++]=i:i<2048?(e[o++]=192|i>>>6,e[o++]=128|63&i):i<65536?(e[o++]=224|i>>>12,e[o++]=128|i>>>6&63,e[o++]=128|63&i):(e[o++]=240|i>>>18,e[o++]=128|i>>>12&63,e[o++]=128|i>>>6&63,e[o++]=128|63&i);return e},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var e=new r.Buf8(t.length),i=0,n=e.length;i<n;i++)e[i]=t.charCodeAt(i);return e},e.buf2string=function(t,e){var i,r,n,a,s=e||t.length,u=new Array(2*s);for(r=0,i=0;i<s;)if((n=t[i++])<128)u[r++]=n;else if((a=o[n])>4)u[r++]=65533,i+=a-1;else{for(n&=2===a?31:3===a?15:7;a>1&&i<s;)n=n<<6|63&t[i++],a--;a>1?u[r++]=65533:n<65536?u[r++]=n:(n-=65536,u[r++]=55296|n>>10&1023,u[r++]=56320|1023&n)}return h(u,r)},e.utf8border=function(t,e){var i;for((e=e||t.length)>t.length&&(e=t.length),i=e-1;i>=0&&128==(192&t[i]);)i--;return i<0||0===i?e:i+o[t[i]]>e?i:e}},6069:t=>{"use strict";t.exports=function(t,e,i,r){for(var n=65535&t|0,a=t>>>16&65535|0,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{a=a+(n=n+e[r++]|0)|0}while(--o);n%=65521,a%=65521}return n|a<<16|0}},1619:t=>{"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:t=>{"use strict";var e=function(){for(var t,e=[],i=0;i<256;i++){t=i;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e}();t.exports=function(t,i,r,n){var a=e,o=n+r;t^=-1;for(var s=n;s<o;s++)t=t>>>8^a[255&(t^i[s])];return-1^t}},405:(t,e,i)=>{"use strict";var r,n=i(4236),a=i(342),o=i(6069),s=i(2869),h=i(8898),u=-2,l=258,c=262,f=103,p=113,d=666;function m(t,e){return t.msg=h[e],e}function g(t){return(t<<1)-(t>4?9:0)}function b(t){for(var e=t.length;--e>=0;)t[e]=0}function v(t){var e=t.state,i=e.pending;i>t.avail_out&&(i=t.avail_out),0!==i&&(n.arraySet(t.output,e.pending_buf,e.pending_out,i,t.next_out),t.next_out+=i,e.pending_out+=i,t.total_out+=i,t.avail_out-=i,e.pending-=i,0===e.pending&&(e.pending_out=0))}function y(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,v(t.strm)}function _(t,e){t.pending_buf[t.pending++]=e}function w(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function x(t,e){var i,r,n=t.max_chain_length,a=t.strstart,o=t.prev_length,s=t.nice_match,h=t.strstart>t.w_size-c?t.strstart-(t.w_size-c):0,u=t.window,f=t.w_mask,p=t.prev,d=t.strstart+l,m=u[a+o-1],g=u[a+o];t.prev_length>=t.good_match&&(n>>=2),s>t.lookahead&&(s=t.lookahead);do{if(u[(i=e)+o]===g&&u[i+o-1]===m&&u[i]===u[a]&&u[++i]===u[a+1]){a+=2,i++;do{}while(u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&u[++a]===u[++i]&&a<d);if(r=l-(d-a),a=d-l,r>o){if(t.match_start=e,o=r,r>=s)break;m=u[a+o-1],g=u[a+o]}}}while((e=p[e&f])>h&&0!=--n);return o<=t.lookahead?o:t.lookahead}function E(t){var e,i,r,a,h,u,l,f,p,d,m=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=m+(m-c)){n.arraySet(t.window,t.window,m,m,0),t.match_start-=m,t.strstart-=m,t.block_start-=m,e=i=t.hash_size;do{r=t.head[--e],t.head[e]=r>=m?r-m:0}while(--i);e=i=m;do{r=t.prev[--e],t.prev[e]=r>=m?r-m:0}while(--i);a+=m}if(0===t.strm.avail_in)break;if(u=t.strm,l=t.window,f=t.strstart+t.lookahead,p=a,d=void 0,(d=u.avail_in)>p&&(d=p),i=0===d?0:(u.avail_in-=d,n.arraySet(l,u.input,u.next_in,d,f),1===u.state.wrap?u.adler=o(u.adler,l,d,f):2===u.state.wrap&&(u.adler=s(u.adler,l,d,f)),u.next_in+=d,u.total_in+=d,d),t.lookahead+=i,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<c&&0!==t.strm.avail_in)}function I(t,e){for(var i,r;;){if(t.lookahead<c){if(E(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==i&&t.strstart-i<=t.w_size-c&&(t.match_length=x(t,i)),t.match_length>=3)if(r=a._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else r=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function M(t,e){for(var i,r,n;;){if(t.lookahead<c){if(E(t),t.lookahead<c&&0===e)return 1;if(0===t.lookahead)break}if(i=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==i&&t.prev_length<t.max_lazy_match&&t.strstart-i<=t.w_size-c&&(t.match_length=x(t,i),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,r=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,i=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((r=a._tr_tally(t,0,t.window[t.strstart-1]))&&y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}function k(t,e,i,r,n){this.good_length=t,this.max_lazy=e,this.nice_length=i,this.max_chain=r,this.func=n}function P(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),b(this.dyn_ltree),b(this.dyn_dtree),b(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),b(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),b(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function T(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:p,t.adler=2===e.wrap?0:1,e.last_flush=0,a._tr_init(e),0):m(t,u)}function S(t){var e,i=T(t);return 0===i&&((e=t.state).window_size=2*e.w_size,b(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i}function A(t,e,i,r,a,o){if(!t)return u;var s=1;if(-1===e&&(e=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),a<1||a>9||8!==i||r<8||r>15||e<0||e>9||o<0||o>4)return m(t,u);8===r&&(r=9);var h=new P;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=r,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=a+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new n.Buf8(2*h.w_size),h.head=new n.Buf16(h.hash_size),h.prev=new n.Buf16(h.w_size),h.lit_bufsize=1<<a+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new n.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=o,h.method=i,S(t)}r=[new k(0,0,0,0,(function(t,e){var i=65535;for(i>t.pending_buf_size-5&&(i=t.pending_buf_size-5);;){if(t.lookahead<=1){if(E(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+i;if((0===t.strstart||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-c&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(y(t,!1),t.strm.avail_out),1)})),new k(4,4,8,4,I),new k(4,5,16,8,I),new k(4,6,32,32,I),new k(4,4,16,16,M),new k(8,16,32,32,M),new k(8,16,128,128,M),new k(8,32,128,256,M),new k(32,128,258,1024,M),new k(32,258,258,4096,M)],e.deflateInit=function(t,e){return A(t,e,8,15,8,0)},e.deflateInit2=A,e.deflateReset=S,e.deflateResetKeep=T,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?u:(t.state.gzhead=e,0):u},e.deflate=function(t,e){var i,n,o,h;if(!t||!t.state||e>5||e<0)return t?m(t,u):u;if(n=t.state,!t.output||!t.input&&0!==t.avail_in||n.status===d&&4!==e)return m(t,0===t.avail_out?-5:u);if(n.strm=t,i=n.last_flush,n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,_(n,31),_(n,139),_(n,8),n.gzhead?(_(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),_(n,255&n.gzhead.time),_(n,n.gzhead.time>>8&255),_(n,n.gzhead.time>>16&255),_(n,n.gzhead.time>>24&255),_(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),_(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(_(n,255&n.gzhead.extra.length),_(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=s(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(_(n,0),_(n,0),_(n,0),_(n,0),_(n,0),_(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),_(n,3),n.status=p);else{var c=8+(n.w_bits-8<<4)<<8;c|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(c|=32),c+=31-c%31,n.status=p,w(n,c),0!==n.strstart&&(w(n,t.adler>>>16),w(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending!==n.pending_buf_size));)_(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,_(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),0===h&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),v(t),o=n.pending,n.pending===n.pending_buf_size)){h=1;break}h=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,_(n,h)}while(0!==h);n.gzhead.hcrc&&n.pending>o&&(t.adler=s(t.adler,n.pending_buf,n.pending-o,o)),0===h&&(n.status=f)}else n.status=f;if(n.status===f&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&v(t),n.pending+2<=n.pending_buf_size&&(_(n,255&t.adler),_(n,t.adler>>8&255),t.adler=0,n.status=p)):n.status=p),0!==n.pending){if(v(t),0===t.avail_out)return n.last_flush=-1,0}else if(0===t.avail_in&&g(e)<=g(i)&&4!==e)return m(t,-5);if(n.status===d&&0!==t.avail_in)return m(t,-5);if(0!==t.avail_in||0!==n.lookahead||0!==e&&n.status!==d){var x=2===n.strategy?function(t,e){for(var i;;){if(0===t.lookahead&&(E(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,i=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,i&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(n,e):3===n.strategy?function(t,e){for(var i,r,n,o,s=t.window;;){if(t.lookahead<=l){if(E(t),t.lookahead<=l&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(r=s[n=t.strstart-1])===s[++n]&&r===s[++n]&&r===s[++n]){o=t.strstart+l;do{}while(r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&r===s[++n]&&n<o);t.match_length=l-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(i=a._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(i=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),i&&(y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(y(t,!1),0===t.strm.avail_out)?1:2}(n,e):r[n.level].func(n,e);if(3!==x&&4!==x||(n.status=d),1===x||3===x)return 0===t.avail_out&&(n.last_flush=-1),0;if(2===x&&(1===e?a._tr_align(n):5!==e&&(a._tr_stored_block(n,0,0,!1),3===e&&(b(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),v(t),0===t.avail_out))return n.last_flush=-1,0}return 4!==e?0:n.wrap<=0?1:(2===n.wrap?(_(n,255&t.adler),_(n,t.adler>>8&255),_(n,t.adler>>16&255),_(n,t.adler>>24&255),_(n,255&t.total_in),_(n,t.total_in>>8&255),_(n,t.total_in>>16&255),_(n,t.total_in>>24&255)):(w(n,t.adler>>>16),w(n,65535&t.adler)),v(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==f&&e!==p&&e!==d?m(t,u):(t.state=null,e===p?m(t,-3):0):u},e.deflateSetDictionary=function(t,e){var i,r,a,s,h,l,c,f,p=e.length;if(!t||!t.state)return u;if(2===(s=(i=t.state).wrap)||1===s&&42!==i.status||i.lookahead)return u;for(1===s&&(t.adler=o(t.adler,e,p,0)),i.wrap=0,p>=i.w_size&&(0===s&&(b(i.head),i.strstart=0,i.block_start=0,i.insert=0),f=new n.Buf8(i.w_size),n.arraySet(f,e,p-i.w_size,i.w_size,0),e=f,p=i.w_size),h=t.avail_in,l=t.next_in,c=t.input,t.avail_in=p,t.next_in=0,t.input=e,E(i);i.lookahead>=3;){r=i.strstart,a=i.lookahead-2;do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[r+3-1])&i.hash_mask,i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++}while(--a);i.strstart=r,i.lookahead=2,E(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=l,t.input=c,t.avail_in=h,i.wrap=s,0},e.deflateInfo="pako deflate (from Nodeca project)"},2401:t=>{"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},4264:t=>{"use strict";t.exports=function(t,e){var i,r,n,a,o,s,h,u,l,c,f,p,d,m,g,b,v,y,_,w,x,E,I,M,k;i=t.state,r=t.next_in,M=t.input,n=r+(t.avail_in-5),a=t.next_out,k=t.output,o=a-(e-t.avail_out),s=a+(t.avail_out-257),h=i.dmax,u=i.wsize,l=i.whave,c=i.wnext,f=i.window,p=i.hold,d=i.bits,m=i.lencode,g=i.distcode,b=(1<<i.lenbits)-1,v=(1<<i.distbits)-1;t:do{d<15&&(p+=M[r++]<<d,d+=8,p+=M[r++]<<d,d+=8),y=m[p&b];e:for(;;){if(p>>>=_=y>>>24,d-=_,0==(_=y>>>16&255))k[a++]=65535&y;else{if(!(16&_)){if(0==(64&_)){y=m[(65535&y)+(p&(1<<_)-1)];continue e}if(32&_){i.mode=12;break t}t.msg="invalid literal/length code",i.mode=30;break t}w=65535&y,(_&=15)&&(d<_&&(p+=M[r++]<<d,d+=8),w+=p&(1<<_)-1,p>>>=_,d-=_),d<15&&(p+=M[r++]<<d,d+=8,p+=M[r++]<<d,d+=8),y=g[p&v];i:for(;;){if(p>>>=_=y>>>24,d-=_,!(16&(_=y>>>16&255))){if(0==(64&_)){y=g[(65535&y)+(p&(1<<_)-1)];continue i}t.msg="invalid distance code",i.mode=30;break t}if(x=65535&y,d<(_&=15)&&(p+=M[r++]<<d,(d+=8)<_&&(p+=M[r++]<<d,d+=8)),(x+=p&(1<<_)-1)>h){t.msg="invalid distance too far back",i.mode=30;break t}if(p>>>=_,d-=_,x>(_=a-o)){if((_=x-_)>l&&i.sane){t.msg="invalid distance too far back",i.mode=30;break t}if(E=0,I=f,0===c){if(E+=u-_,_<w){w-=_;do{k[a++]=f[E++]}while(--_);E=a-x,I=k}}else if(c<_){if(E+=u+c-_,(_-=c)<w){w-=_;do{k[a++]=f[E++]}while(--_);if(E=0,c<w){w-=_=c;do{k[a++]=f[E++]}while(--_);E=a-x,I=k}}}else if(E+=c-_,_<w){w-=_;do{k[a++]=f[E++]}while(--_);E=a-x,I=k}for(;w>2;)k[a++]=I[E++],k[a++]=I[E++],k[a++]=I[E++],w-=3;w&&(k[a++]=I[E++],w>1&&(k[a++]=I[E++]))}else{E=a-x;do{k[a++]=k[E++],k[a++]=k[E++],k[a++]=k[E++],w-=3}while(w>2);w&&(k[a++]=k[E++],w>1&&(k[a++]=k[E++]))}break}}break}}while(r<n&&a<s);r-=w=d>>3,p&=(1<<(d-=w<<3))-1,t.next_in=r,t.next_out=a,t.avail_in=r<n?n-r+5:5-(r-n),t.avail_out=a<s?s-a+257:257-(a-s),i.hold=p,i.bits=d}},7948:(t,e,i)=>{"use strict";var r=i(4236),n=i(6069),a=i(2869),o=i(4264),s=i(9241),h=-2,u=12,l=30;function c(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function f(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new r.Buf32(852),e.distcode=e.distdyn=new r.Buf32(592),e.sane=1,e.back=-1,0):h}function d(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,p(t)):h}function m(t,e){var i,r;return t&&t.state?(r=t.state,e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?h:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=i,r.wbits=e,d(t))):h}function g(t,e){var i,r;return t?(r=new f,t.state=r,r.window=null,0!==(i=m(t,e))&&(t.state=null),i):h}var b,v,y=!0;function _(t){if(y){var e;for(b=new r.Buf32(512),v=new r.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(1,t.lens,0,288,b,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(2,t.lens,0,32,v,0,t.work,{bits:5}),y=!1}t.lencode=b,t.lenbits=9,t.distcode=v,t.distbits=5}function w(t,e,i,n){var a,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),n>=o.wsize?(r.arraySet(o.window,e,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>n&&(a=n),r.arraySet(o.window,e,i-n,a,o.wnext),(n-=a)?(r.arraySet(o.window,e,i-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}e.inflateReset=d,e.inflateReset2=m,e.inflateResetKeep=p,e.inflateInit=function(t){return g(t,15)},e.inflateInit2=g,e.inflate=function(t,e){var i,f,p,d,m,g,b,v,y,x,E,I,M,k,P,T,S,A,O,C,D,B,N,L,R=0,F=new r.Buf8(4),z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;(i=t.state).mode===u&&(i.mode=13),m=t.next_out,p=t.output,b=t.avail_out,d=t.next_in,f=t.input,g=t.avail_in,v=i.hold,y=i.bits,x=g,E=b,B=0;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;y<16;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(2&i.wrap&&35615===v){i.check=0,F[0]=255&v,F[1]=v>>>8&255,i.check=a(i.check,F,2,0),v=0,y=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&v)<<8)+(v>>8))%31){t.msg="incorrect header check",i.mode=l;break}if(8!=(15&v)){t.msg="unknown compression method",i.mode=l;break}if(y-=4,D=8+(15&(v>>>=4)),0===i.wbits)i.wbits=D;else if(D>i.wbits){t.msg="invalid window size",i.mode=l;break}i.dmax=1<<D,t.adler=i.check=1,i.mode=512&v?10:u,v=0,y=0;break;case 2:for(;y<16;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(i.flags=v,8!=(255&i.flags)){t.msg="unknown compression method",i.mode=l;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=l;break}i.head&&(i.head.text=v>>8&1),512&i.flags&&(F[0]=255&v,F[1]=v>>>8&255,i.check=a(i.check,F,2,0)),v=0,y=0,i.mode=3;case 3:for(;y<32;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}i.head&&(i.head.time=v),512&i.flags&&(F[0]=255&v,F[1]=v>>>8&255,F[2]=v>>>16&255,F[3]=v>>>24&255,i.check=a(i.check,F,4,0)),v=0,y=0,i.mode=4;case 4:for(;y<16;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}i.head&&(i.head.xflags=255&v,i.head.os=v>>8),512&i.flags&&(F[0]=255&v,F[1]=v>>>8&255,i.check=a(i.check,F,2,0)),v=0,y=0,i.mode=5;case 5:if(1024&i.flags){for(;y<16;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}i.length=v,i.head&&(i.head.extra_len=v),512&i.flags&&(F[0]=255&v,F[1]=v>>>8&255,i.check=a(i.check,F,2,0)),v=0,y=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((I=i.length)>g&&(I=g),I&&(i.head&&(D=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),r.arraySet(i.head.extra,f,d,I,D)),512&i.flags&&(i.check=a(i.check,f,I,d)),g-=I,d+=I,i.length-=I),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===g)break t;I=0;do{D=f[d+I++],i.head&&D&&i.length<65536&&(i.head.name+=String.fromCharCode(D))}while(D&&I<g);if(512&i.flags&&(i.check=a(i.check,f,I,d)),g-=I,d+=I,D)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===g)break t;I=0;do{D=f[d+I++],i.head&&D&&i.length<65536&&(i.head.comment+=String.fromCharCode(D))}while(D&&I<g);if(512&i.flags&&(i.check=a(i.check,f,I,d)),g-=I,d+=I,D)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;y<16;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(v!==(65535&i.check)){t.msg="header crc mismatch",i.mode=l;break}v=0,y=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=u;break;case 10:for(;y<32;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}t.adler=i.check=c(v),v=0,y=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=m,t.avail_out=b,t.next_in=d,t.avail_in=g,i.hold=v,i.bits=y,2;t.adler=i.check=1,i.mode=u;case u:if(5===e||6===e)break t;case 13:if(i.last){v>>>=7&y,y-=7&y,i.mode=27;break}for(;y<3;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}switch(i.last=1&v,y-=1,3&(v>>>=1)){case 0:i.mode=14;break;case 1:if(_(i),i.mode=20,6===e){v>>>=2,y-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=l}v>>>=2,y-=2;break;case 14:for(v>>>=7&y,y-=7&y;y<32;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if((65535&v)!=(v>>>16^65535)){t.msg="invalid stored block lengths",i.mode=l;break}if(i.length=65535&v,v=0,y=0,i.mode=15,6===e)break t;case 15:i.mode=16;case 16:if(I=i.length){if(I>g&&(I=g),I>b&&(I=b),0===I)break t;r.arraySet(p,f,d,I,m),g-=I,d+=I,b-=I,m+=I,i.length-=I;break}i.mode=u;break;case 17:for(;y<14;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(i.nlen=257+(31&v),v>>>=5,y-=5,i.ndist=1+(31&v),v>>>=5,y-=5,i.ncode=4+(15&v),v>>>=4,y-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=l;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;y<3;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}i.lens[z[i.have++]]=7&v,v>>>=3,y-=3}for(;i.have<19;)i.lens[z[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},B=s(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,B){t.msg="invalid code lengths set",i.mode=l;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;T=(R=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,S=65535&R,!((P=R>>>24)<=y);){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(S<16)v>>>=P,y-=P,i.lens[i.have++]=S;else{if(16===S){for(L=P+2;y<L;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(v>>>=P,y-=P,0===i.have){t.msg="invalid bit length repeat",i.mode=l;break}D=i.lens[i.have-1],I=3+(3&v),v>>>=2,y-=2}else if(17===S){for(L=P+3;y<L;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}y-=P,D=0,I=3+(7&(v>>>=P)),v>>>=3,y-=3}else{for(L=P+7;y<L;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}y-=P,D=0,I=11+(127&(v>>>=P)),v>>>=7,y-=7}if(i.have+I>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=l;break}for(;I--;)i.lens[i.have++]=D}}if(i.mode===l)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=l;break}if(i.lenbits=9,N={bits:i.lenbits},B=s(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,B){t.msg="invalid literal/lengths set",i.mode=l;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},B=s(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,B){t.msg="invalid distances set",i.mode=l;break}if(i.mode=20,6===e)break t;case 20:i.mode=21;case 21:if(g>=6&&b>=258){t.next_out=m,t.avail_out=b,t.next_in=d,t.avail_in=g,i.hold=v,i.bits=y,o(t,E),m=t.next_out,p=t.output,b=t.avail_out,d=t.next_in,f=t.input,g=t.avail_in,v=i.hold,y=i.bits,i.mode===u&&(i.back=-1);break}for(i.back=0;T=(R=i.lencode[v&(1<<i.lenbits)-1])>>>16&255,S=65535&R,!((P=R>>>24)<=y);){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(T&&0==(240&T)){for(A=P,O=T,C=S;T=(R=i.lencode[C+((v&(1<<A+O)-1)>>A)])>>>16&255,S=65535&R,!(A+(P=R>>>24)<=y);){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}v>>>=A,y-=A,i.back+=A}if(v>>>=P,y-=P,i.back+=P,i.length=S,0===T){i.mode=26;break}if(32&T){i.back=-1,i.mode=u;break}if(64&T){t.msg="invalid literal/length code",i.mode=l;break}i.extra=15&T,i.mode=22;case 22:if(i.extra){for(L=i.extra;y<L;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}i.length+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;T=(R=i.distcode[v&(1<<i.distbits)-1])>>>16&255,S=65535&R,!((P=R>>>24)<=y);){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(0==(240&T)){for(A=P,O=T,C=S;T=(R=i.distcode[C+((v&(1<<A+O)-1)>>A)])>>>16&255,S=65535&R,!(A+(P=R>>>24)<=y);){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}v>>>=A,y-=A,i.back+=A}if(v>>>=P,y-=P,i.back+=P,64&T){t.msg="invalid distance code",i.mode=l;break}i.offset=S,i.extra=15&T,i.mode=24;case 24:if(i.extra){for(L=i.extra;y<L;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}i.offset+=v&(1<<i.extra)-1,v>>>=i.extra,y-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=l;break}i.mode=25;case 25:if(0===b)break t;if(I=E-b,i.offset>I){if((I=i.offset-I)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=l;break}I>i.wnext?(I-=i.wnext,M=i.wsize-I):M=i.wnext-I,I>i.length&&(I=i.length),k=i.window}else k=p,M=m-i.offset,I=i.length;I>b&&(I=b),b-=I,i.length-=I;do{p[m++]=k[M++]}while(--I);0===i.length&&(i.mode=21);break;case 26:if(0===b)break t;p[m++]=i.length,b--,i.mode=21;break;case 27:if(i.wrap){for(;y<32;){if(0===g)break t;g--,v|=f[d++]<<y,y+=8}if(E-=b,t.total_out+=E,i.total+=E,E&&(t.adler=i.check=i.flags?a(i.check,p,E,m-E):n(i.check,p,E,m-E)),E=b,(i.flags?v:c(v))!==i.check){t.msg="incorrect data check",i.mode=l;break}v=0,y=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;y<32;){if(0===g)break t;g--,v+=f[d++]<<y,y+=8}if(v!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=l;break}v=0,y=0}i.mode=29;case 29:B=1;break t;case l:B=-3;break t;case 31:return-4;case 32:default:return h}return t.next_out=m,t.avail_out=b,t.next_in=d,t.avail_in=g,i.hold=v,i.bits=y,(i.wsize||E!==t.avail_out&&i.mode<l&&(i.mode<27||4!==e))&&w(t,t.output,t.next_out,E-t.avail_out)?(i.mode=31,-4):(x-=t.avail_in,E-=t.avail_out,t.total_in+=x,t.total_out+=E,i.total+=E,i.wrap&&E&&(t.adler=i.check=i.flags?a(i.check,p,E,t.next_out-E):n(i.check,p,E,t.next_out-E)),t.data_type=i.bits+(i.last?64:0)+(i.mode===u?128:0)+(20===i.mode||15===i.mode?256:0),(0===x&&0===E||4===e)&&0===B&&(B=-5),B)},e.inflateEnd=function(t){if(!t||!t.state)return h;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var i;return t&&t.state?0==(2&(i=t.state).wrap)?h:(i.head=e,e.done=!1,0):h},e.inflateSetDictionary=function(t,e){var i,r=e.length;return t&&t.state?0!==(i=t.state).wrap&&11!==i.mode?h:11===i.mode&&n(1,e,r,0)!==i.check?-3:w(t,e,r,r)?(i.mode=31,-4):(i.havedict=1,0):h},e.inflateInfo="pako inflate (from Nodeca project)"},9241:(t,e,i)=>{"use strict";var r=i(4236),n=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,i,h,u,l,c,f){var p,d,m,g,b,v,y,_,w,x=f.bits,E=0,I=0,M=0,k=0,P=0,T=0,S=0,A=0,O=0,C=0,D=null,B=0,N=new r.Buf16(16),L=new r.Buf16(16),R=null,F=0;for(E=0;E<=15;E++)N[E]=0;for(I=0;I<h;I++)N[e[i+I]]++;for(P=x,k=15;k>=1&&0===N[k];k--);if(P>k&&(P=k),0===k)return u[l++]=20971520,u[l++]=20971520,f.bits=1,0;for(M=1;M<k&&0===N[M];M++);for(P<M&&(P=M),A=1,E=1;E<=15;E++)if(A<<=1,(A-=N[E])<0)return-1;if(A>0&&(0===t||1!==k))return-1;for(L[1]=0,E=1;E<15;E++)L[E+1]=L[E]+N[E];for(I=0;I<h;I++)0!==e[i+I]&&(c[L[e[i+I]]++]=I);if(0===t?(D=R=c,v=19):1===t?(D=n,B-=257,R=a,F-=257,v=256):(D=o,R=s,v=-1),C=0,I=0,E=M,b=l,T=P,S=0,m=-1,g=(O=1<<P)-1,1===t&&O>852||2===t&&O>592)return 1;for(;;){y=E-S,c[I]<v?(_=0,w=c[I]):c[I]>v?(_=R[F+c[I]],w=D[B+c[I]]):(_=96,w=0),p=1<<E-S,M=d=1<<T;do{u[b+(C>>S)+(d-=p)]=y<<24|_<<16|w|0}while(0!==d);for(p=1<<E-1;C&p;)p>>=1;if(0!==p?(C&=p-1,C+=p):C=0,I++,0==--N[E]){if(E===k)break;E=e[i+c[I]]}if(E>P&&(C&g)!==m){for(0===S&&(S=P),b+=M,A=1<<(T=E-S);T+S<k&&!((A-=N[T+S])<=0);)T++,A<<=1;if(O+=1<<T,1===t&&O>852||2===t&&O>592)return 1;u[m=C&g]=P<<24|T<<16|b-l|0}}return 0!==C&&(u[b+C]=E-S<<24|64<<16|0),f.bits=P,0}},8898:t=>{"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:(t,e,i)=>{"use strict";var r=i(4236);function n(t){for(var e=t.length;--e>=0;)t[e]=0}var a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],o=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);n(u);var l=new Array(60);n(l);var c=new Array(512);n(c);var f=new Array(256);n(f);var p=new Array(29);n(p);var d,m,g,b=new Array(30);function v(t,e,i,r,n){this.static_tree=t,this.extra_bits=e,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=t&&t.length}function y(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function _(t){return t<256?c[t]:c[256+(t>>>7)]}function w(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function x(t,e,i){t.bi_valid>16-i?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=i-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=i)}function E(t,e,i){x(t,i[2*e],i[2*e+1])}function I(t,e){var i=0;do{i|=1&t,t>>>=1,i<<=1}while(--e>0);return i>>>1}function M(t,e,i){var r,n,a=new Array(16),o=0;for(r=1;r<=15;r++)a[r]=o=o+i[r-1]<<1;for(n=0;n<=e;n++){var s=t[2*n+1];0!==s&&(t[2*n]=I(a[s]++,s))}}function k(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function P(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function T(t,e,i,r){var n=2*e,a=2*i;return t[n]<t[a]||t[n]===t[a]&&r[e]<=r[i]}function S(t,e,i){for(var r=t.heap[i],n=i<<1;n<=t.heap_len&&(n<t.heap_len&&T(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!T(e,r,t.heap[n],t.depth));)t.heap[i]=t.heap[n],i=n,n<<=1;t.heap[i]=r}function A(t,e,i){var r,n,s,h,u=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*u]<<8|t.pending_buf[t.d_buf+2*u+1],n=t.pending_buf[t.l_buf+u],u++,0===r?E(t,n,e):(E(t,(s=f[n])+256+1,e),0!==(h=a[s])&&x(t,n-=p[s],h),E(t,s=_(--r),i),0!==(h=o[s])&&x(t,r-=b[s],h))}while(u<t.last_lit);E(t,256,e)}function O(t,e){var i,r,n,a=e.dyn_tree,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,h=e.stat_desc.elems,u=-1;for(t.heap_len=0,t.heap_max=573,i=0;i<h;i++)0!==a[2*i]?(t.heap[++t.heap_len]=u=i,t.depth[i]=0):a[2*i+1]=0;for(;t.heap_len<2;)a[2*(n=t.heap[++t.heap_len]=u<2?++u:0)]=1,t.depth[n]=0,t.opt_len--,s&&(t.static_len-=o[2*n+1]);for(e.max_code=u,i=t.heap_len>>1;i>=1;i--)S(t,a,i);n=h;do{i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,a,1),r=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=r,a[2*n]=a[2*i]+a[2*r],t.depth[n]=(t.depth[i]>=t.depth[r]?t.depth[i]:t.depth[r])+1,a[2*i+1]=a[2*r+1]=n,t.heap[1]=n++,S(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var i,r,n,a,o,s,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,c=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(h[2*t.heap[t.heap_max]+1]=0,i=t.heap_max+1;i<573;i++)(a=h[2*h[2*(r=t.heap[i])+1]+1]+1)>d&&(a=d,m++),h[2*r+1]=a,r>u||(t.bl_count[a]++,o=0,r>=p&&(o=f[r-p]),s=h[2*r],t.opt_len+=s*(a+o),c&&(t.static_len+=s*(l[2*r+1]+o)));if(0!==m){do{for(a=d-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(a=d;0!==a;a--)for(r=t.bl_count[a];0!==r;)(n=t.heap[--i])>u||(h[2*n+1]!==a&&(t.opt_len+=(a-h[2*n+1])*h[2*n],h[2*n+1]=a),r--)}}(t,e),M(a,u,t.bl_count)}function C(t,e,i){var r,n,a=-1,o=e[1],s=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(i+1)+1]=65535,r=0;r<=i;r++)n=o,o=e[2*(r+1)+1],++s<h&&n===o||(s<u?t.bl_tree[2*n]+=s:0!==n?(n!==a&&t.bl_tree[2*n]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,a=n,0===o?(h=138,u=3):n===o?(h=6,u=3):(h=7,u=4))}function D(t,e,i){var r,n,a=-1,o=e[1],s=0,h=7,u=4;for(0===o&&(h=138,u=3),r=0;r<=i;r++)if(n=o,o=e[2*(r+1)+1],!(++s<h&&n===o)){if(s<u)do{E(t,n,t.bl_tree)}while(0!=--s);else 0!==n?(n!==a&&(E(t,n,t.bl_tree),s--),E(t,16,t.bl_tree),x(t,s-3,2)):s<=10?(E(t,17,t.bl_tree),x(t,s-3,3)):(E(t,18,t.bl_tree),x(t,s-11,7));s=0,a=n,0===o?(h=138,u=3):n===o?(h=6,u=3):(h=7,u=4)}}n(b);var B=!1;function N(t,e,i,n){x(t,0+(n?1:0),3),function(t,e,i,n){P(t),w(t,i),w(t,~i),r.arraySet(t.pending_buf,t.window,e,i,t.pending),t.pending+=i}(t,e,i)}e._tr_init=function(t){B||(function(){var t,e,i,r,n,h=new Array(16);for(i=0,r=0;r<28;r++)for(p[r]=i,t=0;t<1<<a[r];t++)f[i++]=r;for(f[i-1]=r,n=0,r=0;r<16;r++)for(b[r]=n,t=0;t<1<<o[r];t++)c[n++]=r;for(n>>=7;r<30;r++)for(b[r]=n<<7,t=0;t<1<<o[r]-7;t++)c[256+n++]=r;for(e=0;e<=15;e++)h[e]=0;for(t=0;t<=143;)u[2*t+1]=8,t++,h[8]++;for(;t<=255;)u[2*t+1]=9,t++,h[9]++;for(;t<=279;)u[2*t+1]=7,t++,h[7]++;for(;t<=287;)u[2*t+1]=8,t++,h[8]++;for(M(u,287,h),t=0;t<30;t++)l[2*t+1]=5,l[2*t]=I(t,5);d=new v(u,a,257,286,15),m=new v(l,o,0,30,15),g=new v(new Array(0),s,0,19,7)}(),B=!0),t.l_desc=new y(t.dyn_ltree,d),t.d_desc=new y(t.dyn_dtree,m),t.bl_desc=new y(t.bl_tree,g),t.bi_buf=0,t.bi_valid=0,k(t)},e._tr_stored_block=N,e._tr_flush_block=function(t,e,i,r){var n,a,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,i=4093624447;for(e=0;e<=31;e++,i>>>=1)if(1&i&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),O(t,t.l_desc),O(t,t.d_desc),o=function(t){var e;for(C(t,t.dyn_ltree,t.l_desc.max_code),C(t,t.dyn_dtree,t.d_desc.max_code),O(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),n=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=n&&(n=a)):n=a=i+5,i+4<=n&&-1!==e?N(t,e,i,r):4===t.strategy||a===n?(x(t,2+(r?1:0),3),A(t,u,l)):(x(t,4+(r?1:0),3),function(t,e,i,r){var n;for(x(t,e-257,5),x(t,i-1,5),x(t,r-4,4),n=0;n<r;n++)x(t,t.bl_tree[2*h[n]+1],3);D(t,t.dyn_ltree,e-1),D(t,t.dyn_dtree,i-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),A(t,t.dyn_ltree,t.dyn_dtree)),k(t),r&&P(t)},e._tr_tally=function(t,e,i){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&i,t.last_lit++,0===e?t.dyn_ltree[2*i]++:(t.matches++,e--,t.dyn_ltree[2*(f[i]+256+1)]++,t.dyn_dtree[2*_(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){x(t,2,3),E(t,256,u),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},2292:t=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},3340:t=>{function e(t,e){if(!(t=t.replace(/\t+/g," ").trim()))return null;var r=t.indexOf(" ");if(-1===r)throw new Error("no named row at line "+e);var n=t.substring(0,r);t=(t=(t=(t=t.substring(r+1)).replace(/letter=[\'\"]\S+[\'\"]/gi,"")).split("=")).map((function(t){return t.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)}));for(var a=[],o=0;o<t.length;o++){var s=t[o];0===o?a.push({key:s[0],data:""}):o===t.length-1?a[a.length-1].data=i(s[0]):(a[a.length-1].data=i(s[0]),a.push({key:s[1],data:""}))}var h={key:n,data:{}};return a.forEach((function(t){h.data[t.key]=t.data})),h}function i(t){return t&&0!==t.length?0===t.indexOf('"')||0===t.indexOf("'")?t.substring(1,t.length-1):-1!==t.indexOf(",")?function(t){return t.split(",").map((function(t){return parseInt(t,10)}))}(t):parseInt(t,10):""}t.exports=function(t){if(!t)throw new Error("no data provided");var i={pages:[],chars:[],kernings:[]},r=(t=t.toString().trim()).split(/\r\n?|\n/g);if(0===r.length)throw new Error("no data in BMFont file");for(var n=0;n<r.length;n++){var a=e(r[n],n);if(a)if("page"===a.key){if("number"!=typeof a.data.id)throw new Error("malformed file at line "+n+" -- needs page id=N");if("string"!=typeof a.data.file)throw new Error("malformed file at line "+n+' -- needs page file="path"');i.pages[a.data.id]=a.data.file}else"chars"===a.key||"kernings"===a.key||("char"===a.key?i.chars.push(a.data):"kerning"===a.key?i.kernings.push(a.data):i[a.key]=a.data)}return i}},3827:t=>{var e=[66,77,70];function i(t,e,i){if(i>e.length-1)return 0;var n=e.readUInt8(i++),a=e.readInt32LE(i);switch(i+=4,n){case 1:t.info=function(t,e){var i={};i.size=t.readInt16LE(e);var n=t.readUInt8(e+2);return i.smooth=n>>7&1,i.unicode=n>>6&1,i.italic=n>>5&1,i.bold=n>>4&1,n>>3&1&&(i.fixedHeight=1),i.charset=t.readUInt8(e+3)||"",i.stretchH=t.readUInt16LE(e+4),i.aa=t.readUInt8(e+6),i.padding=[t.readInt8(e+7),t.readInt8(e+8),t.readInt8(e+9),t.readInt8(e+10)],i.spacing=[t.readInt8(e+11),t.readInt8(e+12)],i.outline=t.readUInt8(e+13),i.face=function(t,e){return r(t,e).toString("utf8")}(t,e+14),i}(e,i);break;case 2:t.common=function(t,e){var i={};return i.lineHeight=t.readUInt16LE(e),i.base=t.readUInt16LE(e+2),i.scaleW=t.readUInt16LE(e+4),i.scaleH=t.readUInt16LE(e+6),i.pages=t.readUInt16LE(e+8),t.readUInt8(e+10),i.packed=0,i.alphaChnl=t.readUInt8(e+11),i.redChnl=t.readUInt8(e+12),i.greenChnl=t.readUInt8(e+13),i.blueChnl=t.readUInt8(e+14),i}(e,i);break;case 3:t.pages=function(t,e,i){for(var n=[],a=r(t,e),o=a.length+1,s=i/o,h=0;h<s;h++)n[h]=t.slice(e,e+a.length).toString("utf8"),e+=o;return n}(e,i,a);break;case 4:t.chars=function(t,e,i){for(var r=[],n=i/20,a=0;a<n;a++){var o={},s=20*a;o.id=t.readUInt32LE(e+0+s),o.x=t.readUInt16LE(e+4+s),o.y=t.readUInt16LE(e+6+s),o.width=t.readUInt16LE(e+8+s),o.height=t.readUInt16LE(e+10+s),o.xoffset=t.readInt16LE(e+12+s),o.yoffset=t.readInt16LE(e+14+s),o.xadvance=t.readInt16LE(e+16+s),o.page=t.readUInt8(e+18+s),o.chnl=t.readUInt8(e+19+s),r[a]=o}return r}(e,i,a);break;case 5:t.kernings=function(t,e,i){for(var r=[],n=i/10,a=0;a<n;a++){var o={},s=10*a;o.first=t.readUInt32LE(e+0+s),o.second=t.readUInt32LE(e+4+s),o.amount=t.readInt16LE(e+8+s),r[a]=o}return r}(e,i,a)}return 5+a}function r(t,e){for(var i=e;i<t.length&&0!==t[i];i++);return t.slice(e,i)}t.exports=function(t){if(t.length<6)throw new Error("invalid buffer length for BMFont");if(!e.every((function(e,i){return t.readUInt8(i)===e})))throw new Error("BMFont missing BMF byte header");var r=3;if(t.readUInt8(r++)>3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var n={kernings:[],chars:[]},a=0;a<5;a++)r+=i(n,t,r);return n}},4109:(t,e,i)=>{var r=i(5055),n=i(2195);t.exports=function(t){t=t.toString().trim();var e={pages:[],chars:[],kernings:[]};return r.parseString(t,(function(t,i){if(t)throw t;if(!i.font)throw"XML bitmap font doesn't have <font> root";i=i.font,e.common=n(i.common[0].$),e.info=n(i.info[0].$);for(var r=0;r<i.pages.length;r++){var a=i.pages[r].page[0].$;if(void 0===a.id)throw new Error("malformed file -- needs page id=N");if("string"!=typeof a.file)throw new Error('malformed file -- needs page file="path"');e.pages[parseInt(a.id,10)]=a.file}if(i.chars){var o=i.chars[0].char||[];for(r=0;r<o.length;r++)e.chars.push(n(o[r].$))}if(i.kernings){var s=i.kernings[0].kerning||[];for(r=0;r<s.length;r++)e.kernings.push(n(s[r].$))}})),e}},2195:t=>{t.exports=function(t){for(var e in"chasrset"in t&&(t.charset=t.chasrset,delete t.chasrset),t)"face"!==e&&"charset"!==e&&(t[e]="padding"===e||"spacing"===e?t[e].split(",").map((function(t){return parseInt(t,10)})):parseInt(t[e],10));return t}},193:(t,e,i)=>{"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=i(8605),a=i(7211),o=i(8835),s=i(1191),h=i(8761),u=i(1669),l=function(t,e){if("string"!=typeof t&&!t.hasOwnProperty("url"))throw new Error("Missing url option from options for request method.");var i="object"===(void 0===t?"undefined":r(t))?o.parse(t.url):o.parse(t),u={hostname:i.hostname,port:i.port||("http:"===i.protocol.toLowerCase()?80:443),path:i.path,method:"GET",headers:{},auth:i.auth||null,parse:"none",stream:!1};if("object"===(void 0===t?"undefined":r(t))&&(u=Object.assign(u,t)),u.port=Number(u.port),u.hasOwnProperty("timeout")&&delete u.timeout,!0===u.compressed&&(u.headers["accept-encoding"]="gzip, deflate"),t.hasOwnProperty("form")){if("object"!==r(t.form))throw new Error("phin 'form' option must be of type Object if present.");var l=s.stringify(t.form);u.headers["Content-Type"]="application/x-www-form-urlencoded",u.headers["Content-Length"]=Buffer.byteLength(l),t.data=l}var c=void 0,f=function(t){var i=t;!0===u.compressed&&("gzip"===t.headers["content-encoding"]?i=t.pipe(h.createGunzip()):"deflate"===t.headers["content-encoding"]&&(i=t.pipe(h.createInflate()))),!0===u.stream?(t.stream=i,e&&e(null,t)):(t.body=new Buffer([]),i.on("data",(function(e){t.body=Buffer.concat([t.body,e])})),i.on("end",(function(){if(e){if("json"===u.parse)try{t.body=JSON.parse(t.body.toString())}catch(i){return void e("Invalid JSON received.",t)}e(null,t)}})))};switch(i.protocol.toLowerCase()){case"http:":c=n.request(u,f);break;case"https:":c=a.request(u,f);break;default:return void(e&&e(new Error("Invalid / unknown URL protocol. Expected HTTP or HTTPS."),null))}if("number"==typeof t.timeout&&c.setTimeout(t.timeout,(function(){c.abort(),e&&e(new Error("Timeout has been reached."),null),e=null})),c.on("error",(function(t){e&&e(t,null)})),t.hasOwnProperty("data")){var p=t.data;if(!(t.data instanceof Buffer)&&"object"===r(t.data))if("application/x-www-form-urlencoded"===(u.headers["content-type"]||u.headers["Content-Type"]))p=s.stringify(t.data);else try{p=JSON.stringify(t.data)}catch(t){e&&e(new Error("Couldn't stringify object. (Likely due to a circular reference.)"),null)}c.write(p)}c.end()};l.promisified=function(t,e){return new Promise((function(e,i){l(t,(function(t,r){t?i(t):e(r)}))}))},u.promisify&&(l[u.promisify.custom]=l.promisified),t.exports=l},148:t=>{"use strict";function e(t,r,n,a,o,s){for(var h,u,l,c,f=Math.max(r-1,0),p=Math.max(n-1,0),d=Math.min(r+1,a-1),m=Math.min(n+1,o-1),g=4*(n*a+r),b=0,v=0,y=0,_=0,w=0,x=f;x<=d;x++)for(var E=p;E<=m;E++)if(x!==r||E!==n){var I=i(t,t,g,4*(E*a+x),!0);if(0===I?b++:I<0?y++:I>0&&v++,b>2)return!1;s&&(I<_&&(_=I,h=x,u=E),I>w&&(w=I,l=x,c=E))}return!s||0!==y&&0!==v&&(!e(t,h,u,a,o)&&!e(s,h,u,a,o)||!e(t,l,c,a,o)&&!e(s,l,c,a,o))}function i(t,e,i,s,h){var u=t[i+3]/255,l=e[s+3]/255,c=o(t[i+0],u),f=o(t[i+1],u),p=o(t[i+2],u),d=o(e[s+0],l),m=o(e[s+1],l),g=o(e[s+2],l),b=r(c,f,p)-r(d,m,g);if(h)return b;var v=n(c,f,p)-n(d,m,g),y=a(c,f,p)-a(d,m,g);return.5053*b*b+.299*v*v+.1957*y*y}function r(t,e,i){return.29889531*t+.58662247*e+.11448223*i}function n(t,e,i){return.59597799*t-.2741761*e-.32180189*i}function a(t,e,i){return.21147017*t-.52261711*e+.31114694*i}function o(t,e){return 255+(t-255)*e}function s(t,e,i,r,n){t[e+0]=i,t[e+1]=r,t[e+2]=n,t[e+3]=255}t.exports=function(t,n,a,h,u,l){l||(l={});for(var c=void 0===l.threshold?.1:l.threshold,f=35215*c*c,p=0,d=0;d<u;d++)for(var m=0;m<h;m++){var g=4*(d*h+m);if(i(t,n,g,g)>f)l.includeAA||!e(t,m,d,h,u,n)&&!e(n,m,d,h,u,t)?(a&&s(a,g,255,0,0),p++):a&&s(a,g,255,255,0);else if(a){var b=o((void 0,void 0,void 0,void 0,_=(v=t)[(y=g)+3]/255,r(o(v[y+0],_),o(v[y+1],_),o(v[y+2],_))),.1);s(a,g,b,b,b)}}var v,y,_;return p}},9983:(t,e,i)=>{"use strict";var r=i(7084),n=[function(){},function(t,e,i,r){if(r===e.length)throw new Error("Ran out of data");var n=e[r];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=255},function(t,e,i,r){if(r+1>=e.length)throw new Error("Ran out of data");var n=e[r];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=e[r+1]},function(t,e,i,r){if(r+2>=e.length)throw new Error("Ran out of data");t[i]=e[r],t[i+1]=e[r+1],t[i+2]=e[r+2],t[i+3]=255},function(t,e,i,r){if(r+3>=e.length)throw new Error("Ran out of data");t[i]=e[r],t[i+1]=e[r+1],t[i+2]=e[r+2],t[i+3]=e[r+3]}],a=[function(){},function(t,e,i,r){var n=e[0];t[i]=n,t[i+1]=n,t[i+2]=n,t[i+3]=r},function(t,e,i){var r=e[0];t[i]=r,t[i+1]=r,t[i+2]=r,t[i+3]=e[1]},function(t,e,i,r){t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=r},function(t,e,i){t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2],t[i+3]=e[3]}];function o(t,e,i,r,a,o){for(var s=t.width,h=t.height,u=t.index,l=0;l<h;l++)for(var c=0;c<s;c++){var f=i(c,l,u);n[r](e,a,f,o),o+=r}return o}function s(t,e,i,r,n,o){for(var s=t.width,h=t.height,u=t.index,l=0;l<h;l++){for(var c=0;c<s;c++){var f=n.get(r),p=i(c,l,u);a[r](e,f,p,o)}n.resetAfterLine()}}e.dataToBitMap=function(t,e){var i,n=e.width,a=e.height,h=e.depth,u=e.bpp,l=e.interlace;if(8!==h)var c=function(t,e){var i=[],r=0;function n(){if(r===t.length)throw new Error("Ran out of data");var n,a,o,s,h,u,l,c,f=t[r];switch(r++,e){default:throw new Error("unrecognised depth");case 16:l=t[r],r++,i.push((f<<8)+l);break;case 4:l=15&f,c=f>>4,i.push(c,l);break;case 2:h=3&f,u=f>>2&3,l=f>>4&3,c=f>>6&3,i.push(c,l,u,h);break;case 1:n=1&f,a=f>>1&1,o=f>>2&1,s=f>>3&1,h=f>>4&1,u=f>>5&1,l=f>>6&1,c=f>>7&1,i.push(c,l,u,h,s,o,a,n)}}return{get:function(t){for(;i.length<t;)n();var e=i.slice(0,t);return i=i.slice(t),e},resetAfterLine:function(){i.length=0},end:function(){if(r!==t.length)throw new Error("extra data found")}}}(t,h);i=h<=8?new Buffer(n*a*4):new Uint16Array(n*a*4);var f,p,d=Math.pow(2,h)-1,m=0;if(l)f=r.getImagePasses(n,a),p=r.getInterlaceIterator(n,a);else{var g=0;p=function(){var t=g;return g+=4,t},f=[{width:n,height:a}]}for(var b=0;b<f.length;b++)8===h?m=o(f[b],i,p,u,t,m):s(f[b],i,p,u,c,d);if(8===h){if(m!==t.length)throw new Error("extra data found")}else c.end();return i}},9027:(t,e,i)=>{"use strict";var r=i(3482);t.exports=function(t,e,i,n){var a,o=-1!==[r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(n.colorType);if(n.colorType===n.inputColorType){var s=(a=new ArrayBuffer(2),new DataView(a).setInt16(0,256,!0),256!==new Int16Array(a)[0]);if(8===n.bitDepth||16===n.bitDepth&&s)return t}var h=16!==n.bitDepth?t:new Uint16Array(t.buffer),u=255,l=r.COLORTYPE_TO_BPP_MAP[n.inputColorType];4!==l||n.inputHasAlpha||(l=3);var c=r.COLORTYPE_TO_BPP_MAP[n.colorType];16===n.bitDepth&&(u=65535,c*=2);var f=new Buffer(e*i*c),p=0,d=0,m=n.bgColor||{};function g(){var t,e,i,a=u;switch(n.inputColorType){case r.COLORTYPE_COLOR_ALPHA:a=h[p+3],t=h[p],e=h[p+1],i=h[p+2];break;case r.COLORTYPE_COLOR:t=h[p],e=h[p+1],i=h[p+2];break;case r.COLORTYPE_ALPHA:a=h[p+1],e=t=h[p],i=t;break;case r.COLORTYPE_GRAYSCALE:e=t=h[p],i=t;break;default:throw new Error("input color type:"+n.inputColorType+" is not supported at present")}return n.inputHasAlpha&&(o||(a/=u,t=Math.min(Math.max(Math.round((1-a)*m.red+a*t),0),u),e=Math.min(Math.max(Math.round((1-a)*m.green+a*e),0),u),i=Math.min(Math.max(Math.round((1-a)*m.blue+a*i),0),u))),{red:t,green:e,blue:i,alpha:a}}void 0===m.red&&(m.red=u),void 0===m.green&&(m.green=u),void 0===m.blue&&(m.blue=u);for(var b=0;b<i;b++)for(var v=0;v<e;v++){var y=g();switch(n.colorType){case r.COLORTYPE_COLOR_ALPHA:case r.COLORTYPE_COLOR:8===n.bitDepth?(f[d]=y.red,f[d+1]=y.green,f[d+2]=y.blue,o&&(f[d+3]=y.alpha)):(f.writeUInt16BE(y.red,d),f.writeUInt16BE(y.green,d+2),f.writeUInt16BE(y.blue,d+4),o&&f.writeUInt16BE(y.alpha,d+6));break;case r.COLORTYPE_ALPHA:case r.COLORTYPE_GRAYSCALE:var _=(y.red+y.green+y.blue)/3;8===n.bitDepth?(f[d]=_,o&&(f[d+1]=y.alpha)):(f.writeUInt16BE(_,d),o&&f.writeUInt16BE(y.alpha,d+2));break;default:throw new Error("unrecognised color Type "+n.colorType)}p+=l,d+=c}return f}},8442:(t,e,i)=>{"use strict";var r=i(1669),n=i(2413),a=t.exports=function(){n.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};r.inherits(a,n),a.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),process.nextTick(function(){this._process(),this._paused&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(i=Buffer.isBuffer(t)?t:new Buffer(t,e||this._encoding),this._buffers.push(i),this._buffered+=i.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1);var i},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("Unexpected end of input")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._processReadAllowingLess=function(t){this._reads.shift();var e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},a.prototype._processRead=function(t){this._reads.shift();for(var e=0,i=0,r=new Buffer(t.length);e<t.length;){var n=this._buffers[i++],a=Math.min(n.length,t.length-e);n.copy(r,e,0,a),e+=a,a!==n.length&&(this._buffers[--i]=n.slice(a))}i>0&&this._buffers.splice(0,i),this._buffered-=t.length,t.func.call(this,r)},a.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&!this.writable&&this._end()}catch(t){this.emit("error",t)}}},3482:t=>{"use strict";t.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},3500:t=>{"use strict";var e=[];!function(){for(var t=0;t<256;t++){for(var i=t,r=0;r<8;r++)1&i?i=3988292384^i>>>1:i>>>=1;e[t]=i}}();var i=t.exports=function(){this._crc=-1};i.prototype.write=function(t){for(var i=0;i<t.length;i++)this._crc=e[255&(this._crc^t[i])]^this._crc>>>8;return!0},i.prototype.crc32=function(){return-1^this._crc},i.crc32=function(t){for(var i=-1,r=0;r<t.length;r++)i=e[255&(i^t[r])]^i>>>8;return-1^i}},8876:(t,e,i)=>{"use strict";var r=i(6744),n={0:function(t,e,i,r,n){for(var a=0;a<i;a++)r[n+a]=t[e+a]},1:function(t,e,i,r,n,a){for(var o=0;o<i;o++){var s=o>=a?t[e+o-a]:0,h=t[e+o]-s;r[n+o]=h}},2:function(t,e,i,r,n){for(var a=0;a<i;a++){var o=e>0?t[e+a-i]:0,s=t[e+a]-o;r[n+a]=s}},3:function(t,e,i,r,n,a){for(var o=0;o<i;o++){var s=o>=a?t[e+o-a]:0,h=e>0?t[e+o-i]:0,u=t[e+o]-(s+h>>1);r[n+o]=u}},4:function(t,e,i,n,a,o){for(var s=0;s<i;s++){var h=s>=o?t[e+s-o]:0,u=e>0?t[e+s-i]:0,l=e>0&&s>=o?t[e+s-(i+o)]:0,c=t[e+s]-r(h,u,l);n[a+s]=c}}},a={0:function(t,e,i){for(var r=0,n=e+i,a=e;a<n;a++)r+=Math.abs(t[a]);return r},1:function(t,e,i,r){for(var n=0,a=0;a<i;a++){var o=a>=r?t[e+a-r]:0,s=t[e+a]-o;n+=Math.abs(s)}return n},2:function(t,e,i){for(var r=0,n=e+i,a=e;a<n;a++){var o=e>0?t[a-i]:0,s=t[a]-o;r+=Math.abs(s)}return r},3:function(t,e,i,r){for(var n=0,a=0;a<i;a++){var o=a>=r?t[e+a-r]:0,s=e>0?t[e+a-i]:0,h=t[e+a]-(o+s>>1);n+=Math.abs(h)}return n},4:function(t,e,i,n){for(var a=0,o=0;o<i;o++){var s=o>=n?t[e+o-n]:0,h=e>0?t[e+o-i]:0,u=e>0&&o>=n?t[e+o-(i+n)]:0,l=t[e+o]-r(s,h,u);a+=Math.abs(l)}return a}};t.exports=function(t,e,i,r,o){var s;if("filterType"in r&&-1!==r.filterType){if("number"!=typeof r.filterType)throw new Error("unrecognised filter types");s=[r.filterType]}else s=[0,1,2,3,4];16===r.bitDepth&&(o*=2);for(var h=e*o,u=0,l=0,c=new Buffer((h+1)*i),f=s[0],p=0;p<i;p++){if(s.length>1)for(var d=1/0,m=0;m<s.length;m++){var g=a[s[m]](t,l,h,o);g<d&&(f=s[m],d=g)}c[u]=f,u++,n[f](t,l,h,c,u,o),u+=h,l+=h}return c}},4603:(t,e,i)=>{"use strict";var r=i(1669),n=i(8442),a=i(2769),o=t.exports=function(t){n.call(this);var e=[],i=this;this._filter=new a(t,{read:this.read.bind(this),write:function(t){e.push(t)},complete:function(){i.emit("complete",Buffer.concat(e))}}),this._filter.start()};r.inherits(o,n)},8692:(t,e,i)=>{"use strict";var r=i(33),n=i(2769);e.process=function(t,e){var i=[],a=new r(t);return new n(e,{read:a.read.bind(a),write:function(t){i.push(t)},complete:function(){}}).start(),a.process(),Buffer.concat(i)}},2769:(t,e,i)=>{"use strict";var r=i(7084),n=i(6744);function a(t,e,i){var r=t*e;return 8!==i&&(r=Math.ceil(r/(8/i))),r}var o=t.exports=function(t,e){var i=t.width,n=t.height,o=t.interlace,s=t.bpp,h=t.depth;if(this.read=e.read,this.write=e.write,this.complete=e.complete,this._imageIndex=0,this._images=[],o)for(var u=r.getImagePasses(i,n),l=0;l<u.length;l++)this._images.push({byteWidth:a(u[l].width,s,h),height:u[l].height,lineIndex:0});else this._images.push({byteWidth:a(i,s,h),height:n,lineIndex:0});this._xComparison=8===h?s:16===h?2*s:1};o.prototype.start=function(){this.read(this._images[this._imageIndex].byteWidth+1,this._reverseFilterLine.bind(this))},o.prototype._unFilterType1=function(t,e,i){for(var r=this._xComparison,n=r-1,a=0;a<i;a++){var o=t[1+a],s=a>n?e[a-r]:0;e[a]=o+s}},o.prototype._unFilterType2=function(t,e,i){for(var r=this._lastLine,n=0;n<i;n++){var a=t[1+n],o=r?r[n]:0;e[n]=a+o}},o.prototype._unFilterType3=function(t,e,i){for(var r=this._xComparison,n=r-1,a=this._lastLine,o=0;o<i;o++){var s=t[1+o],h=a?a[o]:0,u=o>n?e[o-r]:0,l=Math.floor((u+h)/2);e[o]=s+l}},o.prototype._unFilterType4=function(t,e,i){for(var r=this._xComparison,a=r-1,o=this._lastLine,s=0;s<i;s++){var h=t[1+s],u=o?o[s]:0,l=s>a?e[s-r]:0,c=s>a&&o?o[s-r]:0,f=n(l,u,c);e[s]=h+f}},o.prototype._reverseFilterLine=function(t){var e,i=t[0],r=this._images[this._imageIndex],n=r.byteWidth;if(0===i)e=t.slice(1,n+1);else switch(e=new Buffer(n),i){case 1:this._unFilterType1(t,e,n);break;case 2:this._unFilterType2(t,e,n);break;case 3:this._unFilterType3(t,e,n);break;case 4:this._unFilterType4(t,e,n);break;default:throw new Error("Unrecognised filter type - "+i)}this.write(e),r.lineIndex++,r.lineIndex>=r.height?(this._lastLine=null,this._imageIndex++,r=this._images[this._imageIndex]):this._lastLine=e,r?this.read(r.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}},8417:t=>{"use strict";t.exports=function(t,e){var i=e.depth,r=e.width,n=e.height,a=e.colorType,o=e.transColor,s=e.palette,h=t;return 3===a?function(t,e,i,r,n){for(var a=0,o=0;o<r;o++)for(var s=0;s<i;s++){var h=n[t[a]];if(!h)throw new Error("index "+t[a]+" not in palette");for(var u=0;u<4;u++)e[a+u]=h[u];a+=4}}(t,h,r,n,s):(o&&function(t,e,i,r,n){for(var a=0,o=0;o<r;o++)for(var s=0;s<i;s++){var h=!1;if(1===n.length?n[0]===t[a]&&(h=!0):n[0]===t[a]&&n[1]===t[a+1]&&n[2]===t[a+2]&&(h=!0),h)for(var u=0;u<4;u++)e[a+u]=0;a+=4}}(t,h,r,n,o),8!==i&&(16===i&&(h=new Buffer(r*n*4)),function(t,e,i,r,n){for(var a=Math.pow(2,n)-1,o=0,s=0;s<r;s++)for(var h=0;h<i;h++){for(var u=0;u<4;u++)e[o+u]=Math.floor(255*t[o+u]/a+.5);o+=4}}(t,h,r,n,i))),h}},7084:(t,e)=>{"use strict";var i=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];e.getImagePasses=function(t,e){for(var r=[],n=t%8,a=e%8,o=(t-n)/8,s=(e-a)/8,h=0;h<i.length;h++){for(var u=i[h],l=o*u.x.length,c=s*u.y.length,f=0;f<u.x.length&&u.x[f]<n;f++)l++;for(f=0;f<u.y.length&&u.y[f]<a;f++)c++;l>0&&c>0&&r.push({width:l,height:c,index:h})}return r},e.getInterlaceIterator=function(t){return function(e,r,n){var a=e%i[n].x.length,o=(e-a)/i[n].x.length*8+i[n].x[a],s=r%i[n].y.length;return 4*o+((r-s)/i[n].y.length*8+i[n].y[s])*t*4}}},6838:(t,e,i)=>{"use strict";var r=i(1669),n=i(2413),a=i(3482),o=i(9432),s=t.exports=function(t){n.call(this);var e=t||{};this._packer=new o(e),this._deflate=this._packer.createDeflate(),this.readable=!0};r.inherits(s,n),s.prototype.pack=function(t,e,i,r){this.emit("data",new Buffer(a.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,i)),r&&this.emit("data",this._packer.packGAMA(r));var n=this._packer.filterData(t,e,i);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(n)}},8360:(t,e,i)=>{"use strict";var r=!0,n=i(8761);n.deflateSync||(r=!1);var a=i(3482),o=i(9432);t.exports=function(t,e){if(!r)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");var i=new o(e||{}),s=[];s.push(new Buffer(a.PNG_SIGNATURE)),s.push(i.packIHDR(t.width,t.height)),t.gamma&&s.push(i.packGAMA(t.gamma));var h=i.filterData(t.data,t.width,t.height),u=n.deflateSync(h,i.getDeflateOptions());if(h=null,!u||!u.length)throw new Error("bad png - invalid compressed data response");return s.push(i.packIDAT(u)),s.push(i.packIEND()),Buffer.concat(s)}},9432:(t,e,i)=>{"use strict";var r=i(3482),n=i(3500),a=i(9027),o=i(8876),s=i(8761),h=t.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:r.COLORTYPE_COLOR_ALPHA,t.inputColorType="number"==typeof t.inputColorType?t.inputColorType:r.COLORTYPE_COLOR_ALPHA,-1===[r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(t.colorType))throw new Error("option color type:"+t.colorType+" is not supported at present");if(-1===[r.COLORTYPE_GRAYSCALE,r.COLORTYPE_COLOR,r.COLORTYPE_COLOR_ALPHA,r.COLORTYPE_ALPHA].indexOf(t.inputColorType))throw new Error("option input color type:"+t.inputColorType+" is not supported at present");if(8!==t.bitDepth&&16!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};h.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},h.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},h.prototype.filterData=function(t,e,i){var n=a(t,e,i,this._options),s=r.COLORTYPE_TO_BPP_MAP[this._options.colorType];return o(n,e,i,this._options,s)},h.prototype._packChunk=function(t,e){var i=e?e.length:0,r=new Buffer(i+12);return r.writeUInt32BE(i,0),r.writeUInt32BE(t,4),e&&e.copy(r,8),r.writeInt32BE(n.crc32(r.slice(4,r.length-4)),r.length-4),r},h.prototype.packGAMA=function(t){var e=new Buffer(4);return e.writeUInt32BE(Math.floor(t*r.GAMMA_DIVISION),0),this._packChunk(r.TYPE_gAMA,e)},h.prototype.packIHDR=function(t,e){var i=new Buffer(13);return i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(r.TYPE_IHDR,i)},h.prototype.packIDAT=function(t){return this._packChunk(r.TYPE_IDAT,t)},h.prototype.packIEND=function(){return this._packChunk(r.TYPE_IEND,null)}},6744:t=>{"use strict";t.exports=function(t,e,i){var r=t+e-i,n=Math.abs(r-t),a=Math.abs(r-e),o=Math.abs(r-i);return n<=a&&n<=o?t:a<=o?e:i}},7900:(t,e,i)=>{"use strict";var r=i(1669),n=i(8761),a=i(8442),o=i(4603),s=i(8550),h=i(9983),u=i(8417),l=t.exports=function(t){a.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this),simpleTransparency:this._simpleTransparency.bind(this),headersFinished:this._headersFinished.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};r.inherits(l,a),l.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this._filter&&(this._filter.destroy(),this._filter.on("error",(function(){}))),this.errord=!0},l.prototype._inflateData=function(t){if(!this._inflate)if(this._bitmapInfo.interlace)this._inflate=n.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter);else{var e=(1+(this._bitmapInfo.width*this._bitmapInfo.bpp*this._bitmapInfo.depth+7>>3))*this._bitmapInfo.height,i=Math.max(e,n.Z_MIN_CHUNK);this._inflate=n.createInflate({chunkSize:i});var r=e,a=this.emit.bind(this,"error");this._inflate.on("error",(function(t){r&&a(t)})),this._filter.on("complete",this._complete.bind(this));var o=this._filter.write.bind(this._filter);this._inflate.on("data",(function(t){r&&(t.length>r&&(t=t.slice(0,r)),r-=t.length,o(t))})),this._inflate.on("end",this._filter.end.bind(this._filter))}this._inflate.write(t)},l.prototype._handleMetaData=function(t){this._metaData=t,this._bitmapInfo=Object.create(t),this._filter=new o(this._bitmapInfo)},l.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},l.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},l.prototype._simpleTransparency=function(){this._metaData.alpha=!0},l.prototype._headersFinished=function(){this.emit("metadata",this._metaData)},l.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},l.prototype._complete=function(t){if(!this.errord){try{var e=h.dataToBitMap(t,this._bitmapInfo),i=u(e,this._bitmapInfo);e=null}catch(t){return void this._handleError(t)}this.emit("parsed",i)}}},2416:(t,e,i)=>{"use strict";var r=!0,n=i(8761),a=i(9653);n.deflateSync||(r=!1);var o=i(33),s=i(8692),h=i(8550),u=i(9983),l=i(8417);t.exports=function(t,e){if(!r)throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");var i,c,f,p=[],d=new o(t);if(new h(e,{read:d.read.bind(d),error:function(t){i=t},metadata:function(t){c=t},gamma:function(t){f=t},palette:function(t){c.palette=t},transColor:function(t){c.transColor=t},inflateData:function(t){p.push(t)},simpleTransparency:function(){c.alpha=!0}}).start(),d.process(),i)throw i;var m,g=Buffer.concat(p);if(p.length=0,c.interlace)m=n.inflateSync(g);else{var b=(1+(c.width*c.bpp*c.depth+7>>3))*c.height;m=a(g,{chunkSize:b,maxLength:b})}if(g=null,!m||!m.length)throw new Error("bad png - invalid inflate data response");var v=s.process(m,c);g=null;var y=u.dataToBitMap(v,c);v=null;var _=l(y,c);return c.data=_,c.gamma=f||0,c}},8550:(t,e,i)=>{"use strict";var r=i(3482),n=i(3500),a=t.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._emittedHeadersFinished=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[r.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[r.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[r.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[r.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[r.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[r.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.finished=e.finished,this.simpleTransparency=e.simpleTransparency,this.headersFinished=e.headersFinished||function(){}};a.prototype.start=function(){this.read(r.PNG_SIGNATURE.length,this._parseSignature.bind(this))},a.prototype._parseSignature=function(t){for(var e=r.PNG_SIGNATURE,i=0;i<e.length;i++)if(t[i]!==e[i])return void this.error(new Error("Invalid file signature"));this.read(8,this._parseChunkBegin.bind(this))},a.prototype._parseChunkBegin=function(t){for(var e=t.readUInt32BE(0),i=t.readUInt32BE(4),a="",o=4;o<8;o++)a+=String.fromCharCode(t[o]);var s=Boolean(32&t[4]);if(this._hasIHDR||i===r.TYPE_IHDR){if(this._crc=new n,this._crc.write(new Buffer(a)),this._chunks[i])return this._chunks[i](e);s?this.read(e+4,this._skipChunk.bind(this)):this.error(new Error("Unsupported critical chunk type "+a))}else this.error(new Error("Expected IHDR on beggining"))},a.prototype._skipChunk=function(){this.read(8,this._parseChunkBegin.bind(this))},a.prototype._handleChunkEnd=function(){this.read(4,this._parseChunkEnd.bind(this))},a.prototype._parseChunkEnd=function(t){var e=t.readInt32BE(0),i=this._crc.crc32();this._options.checkCRC&&i!==e?this.error(new Error("Crc error - "+e+" - "+i)):this._hasIEND||this.read(8,this._parseChunkBegin.bind(this))},a.prototype._handleIHDR=function(t){this.read(t,this._parseIHDR.bind(this))},a.prototype._parseIHDR=function(t){this._crc.write(t);var e=t.readUInt32BE(0),i=t.readUInt32BE(4),n=t[8],a=t[9],o=t[10],s=t[11],h=t[12];if(8===n||4===n||2===n||1===n||16===n)if(a in r.COLORTYPE_TO_BPP_MAP)if(0===o)if(0===s)if(0===h||1===h){this._colorType=a;var u=r.COLORTYPE_TO_BPP_MAP[this._colorType];this._hasIHDR=!0,this.metadata({width:e,height:i,depth:n,interlace:Boolean(h),palette:Boolean(a&r.COLORTYPE_PALETTE),color:Boolean(a&r.COLORTYPE_COLOR),alpha:Boolean(a&r.COLORTYPE_ALPHA),bpp:u,colorType:a}),this._handleChunkEnd()}else this.error(new Error("Unsupported interlace method"));else this.error(new Error("Unsupported filter method"));else this.error(new Error("Unsupported compression method"));else this.error(new Error("Unsupported color type"));else this.error(new Error("Unsupported bit depth "+n))},a.prototype._handlePLTE=function(t){this.read(t,this._parsePLTE.bind(this))},a.prototype._parsePLTE=function(t){this._crc.write(t);for(var e=Math.floor(t.length/3),i=0;i<e;i++)this._palette.push([t[3*i],t[3*i+1],t[3*i+2],255]);this.palette(this._palette),this._handleChunkEnd()},a.prototype._handleTRNS=function(t){this.simpleTransparency(),this.read(t,this._parseTRNS.bind(this))},a.prototype._parseTRNS=function(t){if(this._crc.write(t),this._colorType===r.COLORTYPE_PALETTE_COLOR){if(0===this._palette.length)return void this.error(new Error("Transparency chunk must be after palette"));if(t.length>this._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var e=0;e<t.length;e++)this._palette[e][3]=t[e];this.palette(this._palette)}this._colorType===r.COLORTYPE_GRAYSCALE&&this.transColor([t.readUInt16BE(0)]),this._colorType===r.COLORTYPE_COLOR&&this.transColor([t.readUInt16BE(0),t.readUInt16BE(2),t.readUInt16BE(4)]),this._handleChunkEnd()},a.prototype._handleGAMA=function(t){this.read(t,this._parseGAMA.bind(this))},a.prototype._parseGAMA=function(t){this._crc.write(t),this.gamma(t.readUInt32BE(0)/r.GAMMA_DIVISION),this._handleChunkEnd()},a.prototype._handleIDAT=function(t){this._emittedHeadersFinished||(this._emittedHeadersFinished=!0,this.headersFinished()),this.read(-t,this._parseIDAT.bind(this,t))},a.prototype._parseIDAT=function(t,e){if(this._crc.write(e),this._colorType===r.COLORTYPE_PALETTE_COLOR&&0===this._palette.length)throw new Error("Expected palette not found");this.inflateData(e);var i=t-e.length;i>0?this._handleIDAT(i):this._handleChunkEnd()},a.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},a.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}},6117:(t,e,i)=>{"use strict";var r=i(2416),n=i(8360);e.read=function(t,e){return r(t,e||{})},e.write=function(t,e){return n(t,e)}},5477:(t,e,i)=>{"use strict";var r=i(1669),n=i(2413),a=i(7900),o=i(6838),s=i(6117),h=e.PNG=function(t){n.call(this),t=t||{},this.width=0|t.width,this.height=0|t.height,this.data=this.width>0&&this.height>0?new Buffer(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new o(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};r.inherits(h,n),h.sync=s,h.prototype.pack=function(){return this.data&&this.data.length?(process.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},h.prototype.parse=function(t,e){var i,r;return e&&(i=function(t){this.removeListener("error",r),this.data=t,e(null,this)}.bind(this),r=function(t){this.removeListener("parsed",i),e(t,null)}.bind(this),this.once("parsed",i),this.once("error",r)),this.end(t),this},h.prototype.write=function(t){return this._parser.write(t),!0},h.prototype.end=function(t){this._parser.end(t)},h.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},h.prototype._gamma=function(t){this.gamma=t},h.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},h.bitblt=function(t,e,i,r,n,a,o,s){if(r|=0,n|=0,a|=0,o|=0,s|=0,(i|=0)>t.width||r>t.height||i+n>t.width||r+a>t.height)throw new Error("bitblt reading outside image");if(o>e.width||s>e.height||o+n>e.width||s+a>e.height)throw new Error("bitblt writing outside image");for(var h=0;h<a;h++)t.data.copy(e.data,(s+h)*e.width+o<<2,(r+h)*t.width+i<<2,(r+h)*t.width+i+n<<2)},h.prototype.bitblt=function(t,e,i,r,n,a,o){return h.bitblt(this,t,e,i,r,n,a,o),this},h.adjustGamma=function(t){if(t.gamma){for(var e=0;e<t.height;e++)for(var i=0;i<t.width;i++)for(var r=t.width*e+i<<2,n=0;n<3;n++){var a=t.data[r+n]/255;a=Math.pow(a,1/2.2/t.gamma),t.data[r+n]=Math.round(255*a)}t.gamma=0}},h.prototype.adjustGamma=function(){h.adjustGamma(this)}},9653:(t,e,i)=>{"use strict";var r=i(2357).ok,n=i(8761),a=i(1669),o=i(4293).kMaxLength;function s(t){if(!(this instanceof s))return new s(t);t&&t.chunkSize<n.Z_MIN_CHUNK&&(t.chunkSize=n.Z_MIN_CHUNK),n.Inflate.call(this,t),this._offset=void 0===this._offset?this._outOffset:this._offset,this._buffer=this._buffer||this._outBuffer,t&&null!=t.maxLength&&(this._maxLength=t.maxLength)}function h(t,e){e&&process.nextTick(e),t._handle&&(t._handle.close(),t._handle=null)}function u(t,e){return function(t,e){if("string"==typeof e&&(e=Buffer.from(e)),!(e instanceof Buffer))throw new TypeError("Not a string or buffer");var i=t._finishFlushFlag;return null==i&&(i=n.Z_FINISH),t._processChunk(e,i)}(new s(e),t)}s.prototype._processChunk=function(t,e,i){if("function"==typeof i)return n.Inflate._processChunk.call(this,t,e,i);var a,s=this,u=t&&t.length,l=this._chunkSize-this._offset,c=this._maxLength,f=0,p=[],d=0;function m(t,e){if(!s._hadError){var i=l-e;if(r(i>=0,"have should not go down"),i>0){var n=s._buffer.slice(s._offset,s._offset+i);if(s._offset+=i,n.length>c&&(n=n.slice(0,c)),p.push(n),d+=n.length,0==(c-=n.length))return!1}return(0===e||s._offset>=s._chunkSize)&&(l=s._chunkSize,s._offset=0,s._buffer=Buffer.allocUnsafe(s._chunkSize)),0===e&&(f+=u-t,u=t,!0)}}this.on("error",(function(t){a=t})),r(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(e,t,f,u,this._buffer,this._offset,l);g=g||this._writeState}while(!this._hadError&&m(g[0],g[1]));if(this._hadError)throw a;if(d>=o)throw h(this),new RangeError("Cannot create final Buffer. It would be larger than 0x"+o.toString(16)+" bytes");var b=Buffer.concat(p,d);return h(this),b},a.inherits(s,n.Inflate),t.exports=e=u,e.Inflate=s,e.createInflate=function(t){return new s(t)},e.inflateSync=u},33:t=>{"use strict";var e=t.exports=function(t){this._buffer=t,this._reads=[]};e.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e})},e.prototype.process=function(){for(;this._reads.length>0&&this._buffer.length;){var t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;this._reads.shift();var e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},5666:t=>{var e=function(t){"use strict";var e,i=Object.prototype,r=i.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},a=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,i){return t[e]=i}}function u(t,e,i,r){var n=e&&e.prototype instanceof g?e:g,a=Object.create(n.prototype),o=new T(r||[]);return a._invoke=function(t,e,i){var r=c;return function(n,a){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===n)throw a;return A()}for(i.method=n,i.arg=a;;){var o=i.delegate;if(o){var s=M(o,i);if(s){if(s===m)continue;return s}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===c)throw r=d,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=p;var h=l(t,e,i);if("normal"===h.type){if(r=i.done?d:f,h.arg===m)continue;return{value:h.arg,done:i.done}}"throw"===h.type&&(r=d,i.method="throw",i.arg=h.arg)}}}(t,i,o),a}function l(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c="suspendedStart",f="suspendedYield",p="executing",d="completed",m={};function g(){}function b(){}function v(){}var y={};y[a]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(S([])));w&&w!==i&&r.call(w,a)&&(y=w);var x=v.prototype=g.prototype=Object.create(y);function E(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function i(n,a,o,s){var h=l(t[n],t,a);if("throw"!==h.type){var u=h.arg,c=u.value;return c&&"object"==typeof c&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(c).then((function(t){u.value=t,o(u)}),(function(t){return i("throw",t,o,s)}))}s(h.arg)}var n;this._invoke=function(t,r){function a(){return new e((function(e,n){i(t,r,e,n)}))}return n=n?n.then(a,a):a()}}function M(t,i){var r=t.iterator[i.method];if(r===e){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=e,M(t,i),"throw"===i.method))return m;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var n=l(r,t.iterator,i.arg);if("throw"===n.type)return i.method="throw",i.arg=n.arg,i.delegate=null,m;var a=n.arg;return a?a.done?(i[t.resultName]=a.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,m):a:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,m)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var i=t[a];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function i(){for(;++n<t.length;)if(r.call(t,n))return i.value=t[n],i.done=!1,i;return i.value=e,i.done=!0,i};return o.next=o}}return{next:A}}function A(){return{value:e,done:!0}}return b.prototype=x.constructor=v,v.constructor=b,b.displayName=h(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,h(t,s,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},E(I.prototype),I.prototype[o]=function(){return this},t.AsyncIterator=I,t.async=function(e,i,r,n,a){void 0===a&&(a=Promise);var o=new I(u(e,i,r,n),a);return t.isGeneratorFunction(i)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},E(x),h(x,s,"Generator"),x[a]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var r=e.pop();if(r in t)return i.value=r,i.done=!1,i}return i.done=!0,i}},t.values=S,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function n(r,n){return s.type="throw",s.arg=t,i.next=r,n&&(i.method="next",i.arg=e),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var h=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(h&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(h){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,m):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),P(i),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var r=i.completion;if("throw"===r.type){var n=r.arg;P(i)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,r){return this.delegate={iterator:S(t),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},6099:(t,e,i)=>{!function(t){t.parser=function(t,e){return new n(t,e)},t.SAXParser=n,t.SAXStream=o,t.createStream=function(t,e){return new o(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,r=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function n(e,i){if(!(this instanceof n))return new n(e,i);var a=this;!function(t){for(var e=0,i=r.length;e<i;e++)t[r[e]]=""}(a),a.q=a.c="",a.bufferCheckPosition=t.MAX_BUFFER_LENGTH,a.opt=i||{},a.opt.lowercase=a.opt.lowercase||a.opt.lowercasetags,a.looseCase=a.opt.lowercase?"toLowerCase":"toUpperCase",a.tags=[],a.closed=a.closedRoot=a.sawRoot=!1,a.tag=a.error=null,a.strict=!!e,a.noscript=!(!e&&!a.opt.noscript),a.state=x.BEGIN,a.strictEntities=a.opt.strictEntities,a.ENTITIES=a.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),a.attribList=[],a.opt.xmlns&&(a.ns=Object.create(u)),a.trackPosition=!1!==a.opt.position,a.trackPosition&&(a.position=a.line=a.column=0),I(a,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){}return e.prototype=t,new e}),Object.keys||(Object.keys=function(t){var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e}),n.prototype={end:function(){S(this)},write:function(e){var i=this;if(this.error)throw this.error;if(i.closed)return T(i,"Cannot write after close. Assign an onready handler.");if(null===e)return S(i);"object"==typeof e&&(e=e.toString());for(var n=0,a="";a=F(e,n++),i.c=a,a;)switch(i.trackPosition&&(i.position++,"\n"===a?(i.line++,i.column=0):i.column++),i.state){case x.BEGIN:if(i.state=x.BEGIN_WHITESPACE,"\ufeff"===a)continue;R(i,a);continue;case x.BEGIN_WHITESPACE:R(i,a);continue;case x.TEXT:if(i.sawRoot&&!i.closedRoot){for(var o=n-1;a&&"<"!==a&&"&"!==a;)(a=F(e,n++))&&i.trackPosition&&(i.position++,"\n"===a?(i.line++,i.column=0):i.column++);i.textNode+=e.substring(o,n-1)}"<"!==a||i.sawRoot&&i.closedRoot&&!i.strict?(d(a)||i.sawRoot&&!i.closedRoot||A(i,"Text data outside of root node."),"&"===a?i.state=x.TEXT_ENTITY:i.textNode+=a):(i.state=x.OPEN_WAKA,i.startTagPosition=i.position);continue;case x.SCRIPT:"<"===a?i.state=x.SCRIPT_ENDING:i.script+=a;continue;case x.SCRIPT_ENDING:"/"===a?i.state=x.CLOSE_TAG:(i.script+="<"+a,i.state=x.SCRIPT);continue;case x.OPEN_WAKA:if("!"===a)i.state=x.SGML_DECL,i.sgmlDecl="";else if(d(a));else if(b(l,a))i.state=x.OPEN_TAG,i.tagName=a;else if("/"===a)i.state=x.CLOSE_TAG,i.tagName="";else if("?"===a)i.state=x.PROC_INST,i.procInstName=i.procInstBody="";else{if(A(i,"Unencoded <"),i.startTagPosition+1<i.position){var s=i.position-i.startTagPosition;a=new Array(s).join(" ")+a}i.textNode+="<"+a,i.state=x.TEXT}continue;case x.SGML_DECL:"[CDATA["===(i.sgmlDecl+a).toUpperCase()?(M(i,"onopencdata"),i.state=x.CDATA,i.sgmlDecl="",i.cdata=""):i.sgmlDecl+a==="--"?(i.state=x.COMMENT,i.comment="",i.sgmlDecl=""):"DOCTYPE"===(i.sgmlDecl+a).toUpperCase()?(i.state=x.DOCTYPE,(i.doctype||i.sawRoot)&&A(i,"Inappropriately located doctype declaration"),i.doctype="",i.sgmlDecl=""):">"===a?(M(i,"onsgmldeclaration",i.sgmlDecl),i.sgmlDecl="",i.state=x.TEXT):m(a)?(i.state=x.SGML_DECL_QUOTED,i.sgmlDecl+=a):i.sgmlDecl+=a;continue;case x.SGML_DECL_QUOTED:a===i.q&&(i.state=x.SGML_DECL,i.q=""),i.sgmlDecl+=a;continue;case x.DOCTYPE:">"===a?(i.state=x.TEXT,M(i,"ondoctype",i.doctype),i.doctype=!0):(i.doctype+=a,"["===a?i.state=x.DOCTYPE_DTD:m(a)&&(i.state=x.DOCTYPE_QUOTED,i.q=a));continue;case x.DOCTYPE_QUOTED:i.doctype+=a,a===i.q&&(i.q="",i.state=x.DOCTYPE);continue;case x.DOCTYPE_DTD:i.doctype+=a,"]"===a?i.state=x.DOCTYPE:m(a)&&(i.state=x.DOCTYPE_DTD_QUOTED,i.q=a);continue;case x.DOCTYPE_DTD_QUOTED:i.doctype+=a,a===i.q&&(i.state=x.DOCTYPE_DTD,i.q="");continue;case x.COMMENT:"-"===a?i.state=x.COMMENT_ENDING:i.comment+=a;continue;case x.COMMENT_ENDING:"-"===a?(i.state=x.COMMENT_ENDED,i.comment=P(i.opt,i.comment),i.comment&&M(i,"oncomment",i.comment),i.comment=""):(i.comment+="-"+a,i.state=x.COMMENT);continue;case x.COMMENT_ENDED:">"!==a?(A(i,"Malformed comment"),i.comment+="--"+a,i.state=x.COMMENT):i.state=x.TEXT;continue;case x.CDATA:"]"===a?i.state=x.CDATA_ENDING:i.cdata+=a;continue;case x.CDATA_ENDING:"]"===a?i.state=x.CDATA_ENDING_2:(i.cdata+="]"+a,i.state=x.CDATA);continue;case x.CDATA_ENDING_2:">"===a?(i.cdata&&M(i,"oncdata",i.cdata),M(i,"onclosecdata"),i.cdata="",i.state=x.TEXT):"]"===a?i.cdata+="]":(i.cdata+="]]"+a,i.state=x.CDATA);continue;case x.PROC_INST:"?"===a?i.state=x.PROC_INST_ENDING:d(a)?i.state=x.PROC_INST_BODY:i.procInstName+=a;continue;case x.PROC_INST_BODY:if(!i.procInstBody&&d(a))continue;"?"===a?i.state=x.PROC_INST_ENDING:i.procInstBody+=a;continue;case x.PROC_INST_ENDING:">"===a?(M(i,"onprocessinginstruction",{name:i.procInstName,body:i.procInstBody}),i.procInstName=i.procInstBody="",i.state=x.TEXT):(i.procInstBody+="?"+a,i.state=x.PROC_INST_BODY);continue;case x.OPEN_TAG:b(c,a)?i.tagName+=a:(O(i),">"===a?B(i):"/"===a?i.state=x.OPEN_TAG_SLASH:(d(a)||A(i,"Invalid character in tag name"),i.state=x.ATTRIB));continue;case x.OPEN_TAG_SLASH:">"===a?(B(i,!0),N(i)):(A(i,"Forward-slash in opening tag not followed by >"),i.state=x.ATTRIB);continue;case x.ATTRIB:if(d(a))continue;">"===a?B(i):"/"===a?i.state=x.OPEN_TAG_SLASH:b(l,a)?(i.attribName=a,i.attribValue="",i.state=x.ATTRIB_NAME):A(i,"Invalid attribute name");continue;case x.ATTRIB_NAME:"="===a?i.state=x.ATTRIB_VALUE:">"===a?(A(i,"Attribute without value"),i.attribValue=i.attribName,D(i),B(i)):d(a)?i.state=x.ATTRIB_NAME_SAW_WHITE:b(c,a)?i.attribName+=a:A(i,"Invalid attribute name");continue;case x.ATTRIB_NAME_SAW_WHITE:if("="===a)i.state=x.ATTRIB_VALUE;else{if(d(a))continue;A(i,"Attribute without value"),i.tag.attributes[i.attribName]="",i.attribValue="",M(i,"onattribute",{name:i.attribName,value:""}),i.attribName="",">"===a?B(i):b(l,a)?(i.attribName=a,i.state=x.ATTRIB_NAME):(A(i,"Invalid attribute name"),i.state=x.ATTRIB)}continue;case x.ATTRIB_VALUE:if(d(a))continue;m(a)?(i.q=a,i.state=x.ATTRIB_VALUE_QUOTED):(A(i,"Unquoted attribute value"),i.state=x.ATTRIB_VALUE_UNQUOTED,i.attribValue=a);continue;case x.ATTRIB_VALUE_QUOTED:if(a!==i.q){"&"===a?i.state=x.ATTRIB_VALUE_ENTITY_Q:i.attribValue+=a;continue}D(i),i.q="",i.state=x.ATTRIB_VALUE_CLOSED;continue;case x.ATTRIB_VALUE_CLOSED:d(a)?i.state=x.ATTRIB:">"===a?B(i):"/"===a?i.state=x.OPEN_TAG_SLASH:b(l,a)?(A(i,"No whitespace between attributes"),i.attribName=a,i.attribValue="",i.state=x.ATTRIB_NAME):A(i,"Invalid attribute name");continue;case x.ATTRIB_VALUE_UNQUOTED:if(!g(a)){"&"===a?i.state=x.ATTRIB_VALUE_ENTITY_U:i.attribValue+=a;continue}D(i),">"===a?B(i):i.state=x.ATTRIB;continue;case x.CLOSE_TAG:if(i.tagName)">"===a?N(i):b(c,a)?i.tagName+=a:i.script?(i.script+="</"+i.tagName,i.tagName="",i.state=x.SCRIPT):(d(a)||A(i,"Invalid tagname in closing tag"),i.state=x.CLOSE_TAG_SAW_WHITE);else{if(d(a))continue;v(l,a)?i.script?(i.script+="</"+a,i.state=x.SCRIPT):A(i,"Invalid tagname in closing tag."):i.tagName=a}continue;case x.CLOSE_TAG_SAW_WHITE:if(d(a))continue;">"===a?N(i):A(i,"Invalid characters in closing tag");continue;case x.TEXT_ENTITY:case x.ATTRIB_VALUE_ENTITY_Q:case x.ATTRIB_VALUE_ENTITY_U:var h,u;switch(i.state){case x.TEXT_ENTITY:h=x.TEXT,u="textNode";break;case x.ATTRIB_VALUE_ENTITY_Q:h=x.ATTRIB_VALUE_QUOTED,u="attribValue";break;case x.ATTRIB_VALUE_ENTITY_U:h=x.ATTRIB_VALUE_UNQUOTED,u="attribValue"}";"===a?(i[u]+=L(i),i.entity="",i.state=h):b(i.entity.length?p:f,a)?i.entity+=a:(A(i,"Invalid character in entity name"),i[u]+="&"+i.entity+a,i.entity="",i.state=h);continue;default:throw new Error(i,"Unknown state: "+i.state)}return i.position>=i.bufferCheckPosition&&function(e){for(var i=Math.max(t.MAX_BUFFER_LENGTH,10),n=0,a=0,o=r.length;a<o;a++){var s=e[r[a]].length;if(s>i)switch(r[a]){case"textNode":k(e);break;case"cdata":M(e,"oncdata",e.cdata),e.cdata="";break;case"script":M(e,"onscript",e.script),e.script="";break;default:T(e,"Max buffer length exceeded: "+r[a])}n=Math.max(n,s)}var h=t.MAX_BUFFER_LENGTH-n;e.bufferCheckPosition=h+e.position}(i),i},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;k(t=this),""!==t.cdata&&(M(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(M(t,"onscript",t.script),t.script="")}};try{e=i(2413).Stream}catch(t){e=function(){}}var a=t.EVENTS.filter((function(t){return"error"!==t&&"end"!==t}));function o(t,i){if(!(this instanceof o))return new o(t,i);e.apply(this),this._parser=new n(t,i),this.writable=!0,this.readable=!0;var r=this;this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(t){r.emit("error",t),r._parser.error=null},this._decoder=null,a.forEach((function(t){Object.defineProperty(r,"on"+t,{get:function(){return r._parser["on"+t]},set:function(e){if(!e)return r.removeAllListeners(t),r._parser["on"+t]=e,e;r.on(t,e)},enumerable:!0,configurable:!1})}))}o.prototype=Object.create(e.prototype,{constructor:{value:o}}),o.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=i(4304).StringDecoder;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},o.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},o.prototype.on=function(t,i){var r=this;return r._parser["on"+t]||-1===a.indexOf(t)||(r._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),r.emit.apply(r,e)}),e.prototype.on.call(r,t,i)};var s="http://www.w3.org/XML/1998/namespace",h="http://www.w3.org/2000/xmlns/",u={xml:s,xmlns:h},l=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,c=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,f=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,p=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function d(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function m(t){return'"'===t||"'"===t}function g(t){return">"===t||d(t)}function b(t,e){return t.test(e)}function v(t,e){return!b(t,e)}var y,_,w,x=0;for(var E in t.STATE={BEGIN:x++,BEGIN_WHITESPACE:x++,TEXT:x++,TEXT_ENTITY:x++,OPEN_WAKA:x++,SGML_DECL:x++,SGML_DECL_QUOTED:x++,DOCTYPE:x++,DOCTYPE_QUOTED:x++,DOCTYPE_DTD:x++,DOCTYPE_DTD_QUOTED:x++,COMMENT_STARTING:x++,COMMENT:x++,COMMENT_ENDING:x++,COMMENT_ENDED:x++,CDATA:x++,CDATA_ENDING:x++,CDATA_ENDING_2:x++,PROC_INST:x++,PROC_INST_BODY:x++,PROC_INST_ENDING:x++,OPEN_TAG:x++,OPEN_TAG_SLASH:x++,ATTRIB:x++,ATTRIB_NAME:x++,ATTRIB_NAME_SAW_WHITE:x++,ATTRIB_VALUE:x++,ATTRIB_VALUE_QUOTED:x++,ATTRIB_VALUE_CLOSED:x++,ATTRIB_VALUE_UNQUOTED:x++,ATTRIB_VALUE_ENTITY_Q:x++,ATTRIB_VALUE_ENTITY_U:x++,CLOSE_TAG:x++,CLOSE_TAG_SAW_WHITE:x++,SCRIPT:x++,SCRIPT_ENDING:x++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach((function(e){var i=t.ENTITIES[e],r="number"==typeof i?String.fromCharCode(i):i;t.ENTITIES[e]=r})),t.STATE)t.STATE[t.STATE[E]]=E;function I(t,e,i){t[e]&&t[e](i)}function M(t,e,i){t.textNode&&k(t),I(t,e,i)}function k(t){t.textNode=P(t.opt,t.textNode),t.textNode&&I(t,"ontext",t.textNode),t.textNode=""}function P(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function T(t,e){return k(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,I(t,"onerror",e),t}function S(t){return t.sawRoot&&!t.closedRoot&&A(t,"Unclosed root tag"),t.state!==x.BEGIN&&t.state!==x.BEGIN_WHITESPACE&&t.state!==x.TEXT&&T(t,"Unexpected end"),k(t),t.c="",t.closed=!0,I(t,"onend"),n.call(t,t.strict,t.opt),t}function A(t,e){if("object"!=typeof t||!(t instanceof n))throw new Error("bad call to strictFail");t.strict&&T(t,e)}function O(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,i=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(i.ns=e.ns),t.attribList.length=0,M(t,"onopentagstart",i)}function C(t,e){var i=t.indexOf(":")<0?["",t]:t.split(":"),r=i[0],n=i[1];return e&&"xmlns"===t&&(r="xmlns",n=""),{prefix:r,local:n}}function D(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=C(t.attribName,!0),i=e.prefix,r=e.local;if("xmlns"===i)if("xml"===r&&t.attribValue!==s)A(t,"xml: prefix must be bound to "+s+"\nActual: "+t.attribValue);else if("xmlns"===r&&t.attribValue!==h)A(t,"xmlns: prefix must be bound to "+h+"\nActual: "+t.attribValue);else{var n=t.tag,a=t.tags[t.tags.length-1]||t;n.ns===a.ns&&(n.ns=Object.create(a.ns)),n.ns[r]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,M(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function B(t,e){if(t.opt.xmlns){var i=t.tag,r=C(t.tagName);i.prefix=r.prefix,i.local=r.local,i.uri=i.ns[r.prefix]||"",i.prefix&&!i.uri&&(A(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),i.uri=r.prefix);var n=t.tags[t.tags.length-1]||t;i.ns&&n.ns!==i.ns&&Object.keys(i.ns).forEach((function(e){M(t,"onopennamespace",{prefix:e,uri:i.ns[e]})}));for(var a=0,o=t.attribList.length;a<o;a++){var s=t.attribList[a],h=s[0],u=s[1],l=C(h,!0),c=l.prefix,f=l.local,p=""===c?"":i.ns[c]||"",d={name:h,value:u,prefix:c,local:f,uri:p};c&&"xmlns"!==c&&!p&&(A(t,"Unbound namespace prefix: "+JSON.stringify(c)),d.uri=c),t.tag.attributes[h]=d,M(t,"onattribute",d)}t.attribList.length=0}t.tag.isSelfClosing=!!e,t.sawRoot=!0,t.tags.push(t.tag),M(t,"onopentag",t.tag),e||(t.noscript||"script"!==t.tagName.toLowerCase()?t.state=x.TEXT:t.state=x.SCRIPT,t.tag=null,t.tagName=""),t.attribName=t.attribValue="",t.attribList.length=0}function N(t){if(!t.tagName)return A(t,"Weird empty close tag."),t.textNode+="</>",void(t.state=x.TEXT);if(t.script){if("script"!==t.tagName)return t.script+="</"+t.tagName+">",t.tagName="",void(t.state=x.SCRIPT);M(t,"onscript",t.script),t.script=""}var e=t.tags.length,i=t.tagName;t.strict||(i=i[t.looseCase]());for(var r=i;e--&&t.tags[e].name!==r;)A(t,"Unexpected close tag");if(e<0)return A(t,"Unmatched closing tag: "+t.tagName),t.textNode+="</"+t.tagName+">",void(t.state=x.TEXT);t.tagName=i;for(var n=t.tags.length;n-- >e;){var a=t.tag=t.tags.pop();t.tagName=t.tag.name,M(t,"onclosetag",t.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var h=t.tags[t.tags.length-1]||t;t.opt.xmlns&&a.ns!==h.ns&&Object.keys(a.ns).forEach((function(e){var i=a.ns[e];M(t,"onclosenamespace",{prefix:e,uri:i})}))}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=x.TEXT}function L(t){var e,i=t.entity,r=i.toLowerCase(),n="";return t.ENTITIES[i]?t.ENTITIES[i]:t.ENTITIES[r]?t.ENTITIES[r]:("#"===(i=r).charAt(0)&&("x"===i.charAt(1)?(i=i.slice(2),n=(e=parseInt(i,16)).toString(16)):(i=i.slice(1),n=(e=parseInt(i,10)).toString(10))),i=i.replace(/^0+/,""),isNaN(e)||n.toLowerCase()!==i?(A(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function R(t,e){"<"===e?(t.state=x.OPEN_WAKA,t.startTagPosition=t.position):d(e)||(A(t,"Non-whitespace before first tag."),t.textNode=e,t.state=x.TEXT)}function F(t,e){var i="";return e<t.length&&(i=t.charAt(e)),i}x=t.STATE,String.fromCodePoint||(y=String.fromCharCode,_=Math.floor,w=function(){var t,e,i=16384,r=[],n=-1,a=arguments.length;if(!a)return"";for(var o="";++n<a;){var s=Number(arguments[n]);if(!isFinite(s)||s<0||s>1114111||_(s)!==s)throw RangeError("Invalid code point: "+s);s<=65535?r.push(s):(t=55296+((s-=65536)>>10),e=s%1024+56320,r.push(t,e)),(n+1===a||r.length>i)&&(o+=y.apply(null,r),r.length=0)}return o},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(e)},7011:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clone=o,e.addLast=h,e.addFirst=u,e.removeLast=l,e.removeFirst=c,e.insert=f,e.removeAt=p,e.replaceAt=d,e.getIn=m,e.set=g,e.setIn=b,e.update=y,e.updateIn=_,e.merge=w,e.mergeDeep=x,e.mergeIn=E,e.omit=I,e.addDefaults=M,e.default=void 0;const i="INVALID_ARGS";function r(t){throw new Error(t)}function n(t){const e=Object.keys(t);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e}const a={}.hasOwnProperty;function o(t){if(Array.isArray(t))return t.slice();const e=t,i=n(e),r={};for(let t=0;t<i.length;t++){const n=i[t];r[n]=e[n]}return r}function s(t){return null!=t&&"object"==typeof t}function h(t,e){return Array.isArray(e)?t.concat(e):t.concat([e])}function u(t,e){return Array.isArray(e)?e.concat(t):[e].concat(t)}function l(t){return t.length?t.slice(0,t.length-1):t}function c(t){return t.length?t.slice(1):t}function f(t,e,i){return t.slice(0,e).concat(Array.isArray(i)?i:[i]).concat(t.slice(e))}function p(t,e){return e>=t.length||e<0?t:t.slice(0,e).concat(t.slice(e+1))}function d(t,e,i){if(t[e]===i)return t;const r=t.length,n=Array(r);for(let e=0;e<r;e++)n[e]=t[e];return n[e]=i,n}function m(t,e){if(Array.isArray(e)||r(i),null==t)return;let n=t;for(let t=0;t<e.length;t++){const i=e[t];if(n=null!=n?n[i]:void 0,void 0===n)return n}return n}function g(t,e,i){let r=t;if(null==r&&(r="number"==typeof e?[]:{}),r[e]===i)return r;const n=o(r);return n[e]=i,n}function b(t,e,i){return e.length?v(t,e,i,0):i}function v(t,e,i,r){let n;const a=e[r];return n=r===e.length-1?i:v(s(t)&&s(t[a])?t[a]:"number"==typeof e[r+1]?[]:{},e,i,r+1),g(t,a,n)}function y(t,e,i){return g(t,e,i(null==t?void 0:t[e]))}function _(t,e,i){return b(t,e,i(m(t,e)))}function w(t,e,i,r,n,a,...o){return o.length?k.call(null,!1,!1,t,e,i,r,n,a,...o):k(!1,!1,t,e,i,r,n,a)}function x(t,e,i,r,n,a,...o){return o.length?k.call(null,!1,!0,t,e,i,r,n,a,...o):k(!1,!0,t,e,i,r,n,a)}function E(t,e,i,r,n,a,o,...s){let h,u=m(t,e);return null==u&&(u={}),h=s.length?k.call(null,!1,!1,u,i,r,n,a,o,...s):k(!1,!1,u,i,r,n,a,o),b(t,e,h)}function I(t,e){const i=Array.isArray(e)?e:[e];let r=!1;for(let e=0;e<i.length;e++)if(a.call(t,i[e])){r=!0;break}if(!r)return t;const o={},s=n(t);for(let e=0;e<s.length;e++){const r=s[e];i.indexOf(r)>=0||(o[r]=t[r])}return o}function M(t,e,i,r,n,a,...o){return o.length?k.call(null,!0,!1,t,e,i,r,n,a,...o):k(!0,!1,t,e,i,r,n,a)}function k(t,e,a,...h){let u=a;null==u&&r(i);let l=!1;for(let i=0;i<h.length;i++){const r=h[i];if(null==r)continue;const a=n(r);if(a.length)for(let i=0;i<=a.length;i++){const n=a[i];if(t&&void 0!==u[n])continue;let h=r[n];e&&s(u[n])&&s(h)&&(h=k(t,e,u[n],h)),void 0!==h&&h!==u[n]&&(l||(l=!0,u=o(u)),u[n]=h)}}return u}var P={clone:o,addLast:h,addFirst:u,removeLast:l,removeFirst:c,insert:f,removeAt:p,replaceAt:d,getIn:m,set:g,setIn:b,update:y,updateIn:_,merge:w,mergeDeep:x,mergeIn:E,omit:I,addDefaults:M};e.default=P},7621:(t,e,i)=>{var r;!function(n){var a=/^\s+/,o=/\s+$/,s=0,h=n.round,u=n.min,l=n.max,c=n.random;function f(t,e){if(e=e||{},(t=t||"")instanceof f)return t;if(!(this instanceof f))return new f(t,e);var i=function(t){var e,i,r,s={r:0,g:0,b:0},h=1,c=null,f=null,p=null,d=!1,m=!1;return"string"==typeof t&&(t=function(t){t=t.replace(a,"").replace(o,"").toLowerCase();var e,i=!1;if(A[t])t=A[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=H.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=H.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=H.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=H.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=H.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=H.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=H.hex8.exec(t))?{r:N(e[1]),g:N(e[2]),b:N(e[3]),a:z(e[4]),format:i?"name":"hex8"}:(e=H.hex6.exec(t))?{r:N(e[1]),g:N(e[2]),b:N(e[3]),format:i?"name":"hex"}:(e=H.hex4.exec(t))?{r:N(e[1]+""+e[1]),g:N(e[2]+""+e[2]),b:N(e[3]+""+e[3]),a:z(e[4]+""+e[4]),format:i?"name":"hex8"}:!!(e=H.hex3.exec(t))&&{r:N(e[1]+""+e[1]),g:N(e[2]+""+e[2]),b:N(e[3]+""+e[3]),format:i?"name":"hex"}}(t)),"object"==typeof t&&(W(t.r)&&W(t.g)&&W(t.b)?(e=t.r,i=t.g,r=t.b,s={r:255*D(e,255),g:255*D(i,255),b:255*D(r,255)},d=!0,m="%"===String(t.r).substr(-1)?"prgb":"rgb"):W(t.h)&&W(t.s)&&W(t.v)?(c=R(t.s),f=R(t.v),s=function(t,e,i){t=6*D(t,360),e=D(e,100),i=D(i,100);var r=n.floor(t),a=t-r,o=i*(1-e),s=i*(1-a*e),h=i*(1-(1-a)*e),u=r%6;return{r:255*[i,s,o,o,h,i][u],g:255*[h,i,i,s,o,o][u],b:255*[o,o,h,i,i,s][u]}}(t.h,c,f),d=!0,m="hsv"):W(t.h)&&W(t.s)&&W(t.l)&&(c=R(t.s),p=R(t.l),s=function(t,e,i){var r,n,a;function o(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}if(t=D(t,360),e=D(e,100),i=D(i,100),0===e)r=n=a=i;else{var s=i<.5?i*(1+e):i+e-i*e,h=2*i-s;r=o(h,s,t+1/3),n=o(h,s,t),a=o(h,s,t-1/3)}return{r:255*r,g:255*n,b:255*a}}(t.h,c,p),d=!0,m="hsl"),t.hasOwnProperty("a")&&(h=t.a)),h=C(h),{ok:d,format:t.format||m,r:u(255,l(s.r,0)),g:u(255,l(s.g,0)),b:u(255,l(s.b,0)),a:h}}(t);this._originalInput=t,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=h(100*this._a)/100,this._format=e.format||i.format,this._gradientType=e.gradientType,this._r<1&&(this._r=h(this._r)),this._g<1&&(this._g=h(this._g)),this._b<1&&(this._b=h(this._b)),this._ok=i.ok,this._tc_id=s++}function p(t,e,i){t=D(t,255),e=D(e,255),i=D(i,255);var r,n,a=l(t,e,i),o=u(t,e,i),s=(a+o)/2;if(a==o)r=n=0;else{var h=a-o;switch(n=s>.5?h/(2-a-o):h/(a+o),a){case t:r=(e-i)/h+(e<i?6:0);break;case e:r=(i-t)/h+2;break;case i:r=(t-e)/h+4}r/=6}return{h:r,s:n,l:s}}function d(t,e,i){t=D(t,255),e=D(e,255),i=D(i,255);var r,n,a=l(t,e,i),o=u(t,e,i),s=a,h=a-o;if(n=0===a?0:h/a,a==o)r=0;else{switch(a){case t:r=(e-i)/h+(e<i?6:0);break;case e:r=(i-t)/h+2;break;case i:r=(t-e)/h+4}r/=6}return{h:r,s:n,v:s}}function m(t,e,i,r){var n=[L(h(t).toString(16)),L(h(e).toString(16)),L(h(i).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function g(t,e,i,r){return[L(F(r)),L(h(t).toString(16)),L(h(e).toString(16)),L(h(i).toString(16))].join("")}function b(t,e){e=0===e?0:e||10;var i=f(t).toHsl();return i.s-=e/100,i.s=B(i.s),f(i)}function v(t,e){e=0===e?0:e||10;var i=f(t).toHsl();return i.s+=e/100,i.s=B(i.s),f(i)}function y(t){return f(t).desaturate(100)}function _(t,e){e=0===e?0:e||10;var i=f(t).toHsl();return i.l+=e/100,i.l=B(i.l),f(i)}function w(t,e){e=0===e?0:e||10;var i=f(t).toRgb();return i.r=l(0,u(255,i.r-h(-e/100*255))),i.g=l(0,u(255,i.g-h(-e/100*255))),i.b=l(0,u(255,i.b-h(-e/100*255))),f(i)}function x(t,e){e=0===e?0:e||10;var i=f(t).toHsl();return i.l-=e/100,i.l=B(i.l),f(i)}function E(t,e){var i=f(t).toHsl(),r=(i.h+e)%360;return i.h=r<0?360+r:r,f(i)}function I(t){var e=f(t).toHsl();return e.h=(e.h+180)%360,f(e)}function M(t){var e=f(t).toHsl(),i=e.h;return[f(t),f({h:(i+120)%360,s:e.s,l:e.l}),f({h:(i+240)%360,s:e.s,l:e.l})]}function k(t){var e=f(t).toHsl(),i=e.h;return[f(t),f({h:(i+90)%360,s:e.s,l:e.l}),f({h:(i+180)%360,s:e.s,l:e.l}),f({h:(i+270)%360,s:e.s,l:e.l})]}function P(t){var e=f(t).toHsl(),i=e.h;return[f(t),f({h:(i+72)%360,s:e.s,l:e.l}),f({h:(i+216)%360,s:e.s,l:e.l})]}function T(t,e,i){e=e||6,i=i||30;var r=f(t).toHsl(),n=360/i,a=[f(t)];for(r.h=(r.h-(n*e>>1)+720)%360;--e;)r.h=(r.h+n)%360,a.push(f(r));return a}function S(t,e){e=e||6;for(var i=f(t).toHsv(),r=i.h,n=i.s,a=i.v,o=[],s=1/e;e--;)o.push(f({h:r,s:n,v:a})),a=(a+s)%1;return o}f.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,i,r=this.toRgb();return t=r.r/255,e=r.g/255,i=r.b/255,.2126*(t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:n.pow((e+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:n.pow((i+.055)/1.055,2.4))},setAlpha:function(t){return this._a=C(t),this._roundA=h(100*this._a)/100,this},toHsv:function(){var t=d(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=d(this._r,this._g,this._b),e=h(360*t.h),i=h(100*t.s),r=h(100*t.v);return 1==this._a?"hsv("+e+", "+i+"%, "+r+"%)":"hsva("+e+", "+i+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var t=p(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=p(this._r,this._g,this._b),e=h(360*t.h),i=h(100*t.s),r=h(100*t.l);return 1==this._a?"hsl("+e+", "+i+"%, "+r+"%)":"hsla("+e+", "+i+"%, "+r+"%, "+this._roundA+")"},toHex:function(t){return m(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,i,r,n){var a=[L(h(t).toString(16)),L(h(e).toString(16)),L(h(i).toString(16)),L(F(r))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:h(this._r),g:h(this._g),b:h(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+h(this._r)+", "+h(this._g)+", "+h(this._b)+")":"rgba("+h(this._r)+", "+h(this._g)+", "+h(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:h(100*D(this._r,255))+"%",g:h(100*D(this._g,255))+"%",b:h(100*D(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+h(100*D(this._r,255))+"%, "+h(100*D(this._g,255))+"%, "+h(100*D(this._b,255))+"%)":"rgba("+h(100*D(this._r,255))+"%, "+h(100*D(this._g,255))+"%, "+h(100*D(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(O[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+g(this._r,this._g,this._b,this._a),i=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var n=f(t);i="#"+g(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+i+")"},toString:function(t){var e=!!t;t=t||this._format;var i=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),i||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return f(this.toString())},_applyModification:function(t,e){var i=t.apply(null,[this].concat([].slice.call(e)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(_,arguments)},brighten:function(){return this._applyModification(w,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(b,arguments)},saturate:function(){return this._applyModification(v,arguments)},greyscale:function(){return this._applyModification(y,arguments)},spin:function(){return this._applyModification(E,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(T,arguments)},complement:function(){return this._applyCombination(I,arguments)},monochromatic:function(){return this._applyCombination(S,arguments)},splitcomplement:function(){return this._applyCombination(P,arguments)},triad:function(){return this._applyCombination(M,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},f.fromRatio=function(t,e){if("object"==typeof t){var i={};for(var r in t)t.hasOwnProperty(r)&&(i[r]="a"===r?t[r]:R(t[r]));t=i}return f(t,e)},f.equals=function(t,e){return!(!t||!e)&&f(t).toRgbString()==f(e).toRgbString()},f.random=function(){return f.fromRatio({r:c(),g:c(),b:c()})},f.mix=function(t,e,i){i=0===i?0:i||50;var r=f(t).toRgb(),n=f(e).toRgb(),a=i/100;return f({r:(n.r-r.r)*a+r.r,g:(n.g-r.g)*a+r.g,b:(n.b-r.b)*a+r.b,a:(n.a-r.a)*a+r.a})},f.readability=function(t,e){var i=f(t),r=f(e);return(n.max(i.getLuminance(),r.getLuminance())+.05)/(n.min(i.getLuminance(),r.getLuminance())+.05)},f.isReadable=function(t,e,i){var r,n,a,o,s,h=f.readability(t,e);switch(n=!1,(a=i,"AA"!==(o=((a=a||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==o&&(o="AA"),"small"!==(s=(a.size||"small").toLowerCase())&&"large"!==s&&(s="small"),r={level:o,size:s}).level+r.size){case"AAsmall":case"AAAlarge":n=h>=4.5;break;case"AAlarge":n=h>=3;break;case"AAAsmall":n=h>=7}return n},f.mostReadable=function(t,e,i){var r,n,a,o,s=null,h=0;n=(i=i||{}).includeFallbackColors,a=i.level,o=i.size;for(var u=0;u<e.length;u++)(r=f.readability(t,e[u]))>h&&(h=r,s=f(e[u]));return f.isReadable(t,s,{level:a,size:o})||!n?s:(i.includeFallbackColors=!1,f.mostReadable(t,["#fff","#000"],i))};var A=f.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},O=f.hexNames=function(t){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[t[i]]=i);return e}(A);function C(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function D(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var i=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=u(e,l(0,parseFloat(t))),i&&(t=parseInt(t*e,10)/100),n.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function B(t){return u(1,l(0,t))}function N(t){return parseInt(t,16)}function L(t){return 1==t.length?"0"+t:""+t}function R(t){return t<=1&&(t=100*t+"%"),t}function F(t){return n.round(255*parseFloat(t)).toString(16)}function z(t){return N(t)/255}var G,U,j,H=(U="[\\s|\\(]+("+(G="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+G+")[,|\\s]+("+G+")\\s*\\)?",j="[\\s|\\(]+("+G+")[,|\\s]+("+G+")[,|\\s]+("+G+")[,|\\s]+("+G+")\\s*\\)?",{CSS_UNIT:new RegExp(G),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+j),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+j),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+j),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function W(t){return!!H.CSS_UNIT.exec(t)}t.exports?t.exports=f:void 0===(r=function(){return f}.call(e,i,e,t))||(t.exports=r)}(Math)},6154:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(2413);e.default=function(t,e){var i,n=new r.Readable,a=n._readableState.highWaterMark,o=t.length,s=0;return i=!e||"number"!=typeof e||e<1||e>a?a:e,n._read=function(){for(var e=t.slice(s,s+=i);n.push(e);)if(s>=o){n.push(null);break}},n}},1169:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this.data=[]}return t.prototype.getData=function(){return Buffer.from(this.data)},t.prototype.writeByte=function(t){this.data.push(t)},t.prototype.writeUTFBytes=function(t){for(var e=t.length,i=0;i<e;i++)this.writeByte(t.charCodeAt(i))},t.prototype.writeBytes=function(t,e,i){for(var r=i||t.length,n=e||0;n<r;n++)this.writeByte(t[n])},t}();e.default=i},7233:function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(2413)),a=r(i(7986)),o=r(i(1595)),s=r(i(1169)),h=function(){function t(t,e){this.transIndex=0,this.repeat=-1,this.delay=0,this.usedEntry=[],this.palSize=7,this.dispose=-1,this.firstFrame=!0,this.sample=10,this.started=!1,this.readStreams=[],this.out=new s.default,this.width=~~t,this.height=~~e}return t.prototype.createReadStream=function(t){var e=t;return void 0===e&&((e=new n.default.Readable)._read=function(){}),this.readStreams.push(e),e},t.prototype.emit=function(){var t=this;0!==this.readStreams.length&&this.out.data.length&&(this.readStreams.forEach((function(e){e.push(Buffer.from(t.out.data))})),this.out.data=[])},t.prototype.start=function(){this.out.writeUTFBytes("GIF89a"),this.started=!0,this.emit()},t.prototype.getImagePixels=function(){var t=this.image;if(void 0!==t){var e=this.width,i=this.height;this.pixels=new Uint8Array(e*i*3);for(var r=0,n=0;n<i;n++)for(var a=0;a<e;a++){var o=n*e*4+4*a;this.pixels[r++]=t[o],this.pixels[r++]=t[o+1],this.pixels[r++]=t[o+2]}}},t.prototype.findClosest=function(t){if(void 0===this.colorTab)return-1;for(var e=(16711680&t)>>16,i=(65280&t)>>8,r=255&t,n=0,a=16777216,o=this.colorTab.length,s=0;s<o;){var h=s/3,u=e-(255&this.colorTab[s++]),l=i-(255&this.colorTab[s++]),c=r-(255&this.colorTab[s++]),f=u*u+l*l+c*c;this.usedEntry[h]&&f<a&&(a=f,n=h)}return n},t.prototype.analyzePixels=function(){if(void 0!==this.pixels&&void 0!==this.image){var t=this.pixels.length/3;this.indexedPixels=new Uint8Array(t);var e=new a.default(this.pixels,this.sample);e.buildColormap(),this.colorTab=e.getColormap();for(var i=0,r=0;r<t;r++){var n=e.lookupRGB(255&this.pixels[i++],255&this.pixels[i++],255&this.pixels[i++]);this.usedEntry[n]=!0,this.indexedPixels[r]=n}if(this.pixels=void 0,this.colorDepth=8,this.palSize=7,void 0!==this.transparent){this.transIndex=this.findClosest(this.transparent);for(var o=0;o<t;o++)0===this.image[4*o+3]&&(this.indexedPixels[o]=this.transIndex)}}},t.prototype.writeShort=function(t){this.out.writeByte(255&t),this.out.writeByte(t>>8&255)},t.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},t.prototype.writePalette=function(){if(void 0!==this.colorTab){this.out.writeBytes(this.colorTab);for(var t=768-this.colorTab.length,e=0;e<t;e++)this.out.writeByte(0)}},t.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},t.prototype.writeGraphicCtrlExt=function(){var t,e;this.out.writeByte(33),this.out.writeByte(249),this.out.writeByte(4),void 0===this.transparent?(t=0,e=0):(t=1,e=2),this.dispose>=0&&(e=7&this.dispose),e<<=2,this.out.writeByte(0|e|t),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},t.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},t.prototype.writePixels=function(){void 0!==this.indexedPixels&&void 0!==this.colorDepth&&new o.default(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this.out)},t.prototype.addFrame=function(t){Buffer.isBuffer(t)?this.image=t:this.image=t.getImageData(0,0,this.width,this.height).data,this.getImagePixels(),this.analyzePixels(),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.writePixels(),this.firstFrame=!1,this.emit()},t.prototype.setDelay=function(t){void 0!==t&&(this.delay=Math.round(t/10))},t.prototype.setFrameRate=function(t){void 0!==t&&(this.delay=Math.round(100/t))},t.prototype.setDispose=function(t){void 0!==t?t>=0&&(this.dispose=t):this.dispose=void 0===this.transparent?0:2},t.prototype.setRepeat=function(t){void 0===t&&(t=-1),this.repeat=t},t.prototype.setTransparent=function(t){this.transparent=t},t.prototype.end=function(){null!==this.readStreams.length&&(this.emit(),this.readStreams.forEach((function(t){t.push(null)})),this.readStreams=[])},t.prototype.finish=function(){this.out.writeByte(59),this.end()},t.prototype.setQuality=function(t){void 0===t&&(t=10);var e=t;e<1&&(e=1),this.sample=e},t}();e.default=h,t.exports=h},6287:function(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var a=i(2413),o=i(3129),s=function(t){function e(e,i){var r=t.call(this)||this;return r.path="",r.args=[],r.writable=!0,r.readable=!0,r.hasEnded=!1,r.seenDataOnStdout=!1,r.isPaused=!1,a.Stream.call(r),r.path=e,r.args=i,r}return n(e,t),e.prototype.onError=function(t){this.hasEnded||(this.hasEnded=!0,this.cleanUp(),this.emit("error",t))},e.prototype.getProcess=function(){var t=this;if(this.process)return this.process;if(!this.path)return this.onError(new Error("Unable to get the gifsicle binary file.")),null;this.seenDataOnStdout=!1;var e=o.spawn(this.path,this.args);return this.process=e,e.on("error",this.onError.bind(this)),e.stdin.on("error",this.onError.bind(this)),e.on("exit",(function(e){t.hasEnded||(e&&e>0&&!t.hasEnded&&t.onError(new Error("The gifsicle process exited with a non-zero exit code: "+e)),t.emit("end"),t.hasEnded=!0)})),e.stdout.on("data",(function(e){t.seenDataOnStdout=!0,t.emit("data",e)})).on("end",(function(){t.process=void 0,t.hasEnded||(t.seenDataOnStdout?t.emit("end"):t.onError(new Error("Gifsicle: STDOUT stream ended without emitting any data.")),t.hasEnded=!0)})),this.isPaused&&e.stdout.pause(),e},e.prototype.write=function(t){if(this.hasEnded)return!0;var e=this.getProcess();return!!e&&(e.stdin.write(t),!0)},e.prototype.cleanUp=function(){var t;null===(t=this.process)||void 0===t||t.kill(),this.process=void 0},e.prototype.destroy=function(){this.hasEnded||(this.hasEnded=!0,this.cleanUp())},e.prototype.end=function(t){t&&this.write(t),this.process?this.process.stdin.end():this.write(Buffer.from(""))},e.prototype.pause=function(){var t;null===(t=this.process)||void 0===t||t.stdout.pause(),this.isPaused=!0},e.prototype.resume=function(){var t;null===(t=this.process)||void 0===t||t.stdout.resume(),this.isPaused=!1},e}(a.Stream);e.default=s},1595:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=5003,r=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],n=function(){function t(t,e,r,n){this.accum=new Uint8Array(256),this.htab=new Int32Array(i),this.codetab=new Int32Array(i),this.curAccum=0,this.curBits=0,this.aCount=0,this.freeEnt=0,this.maxcode=0,this.clearFlg=!1,this.gInitBits=0,this.nBits=0,this.ClearCode=0,this.remaining=0,this.curPixel=0,this.width=t,this.height=e,this.pixels=r,this.colorDepth=n,this.initCodeSize=Math.max(2,n)}return t.prototype.flushChar=function(t){this.aCount>0&&(t.writeByte(this.aCount),t.writeBytes(this.accum,0,this.aCount),this.aCount=0)},t.prototype.charOut=function(t,e){this.accum[this.aCount++]=t,this.aCount>=254&&this.flushChar(e)},t.prototype.clHash=function(t){for(var e=0;e<t;++e)this.htab[e]=-1},t.MAXCODE=function(t){return(1<<t)-1},t.prototype.output=function(e,i){for(this.curAccum&=r[this.curBits],this.curBits>0?this.curAccum|=e<<this.curBits:this.curAccum=e,this.curBits+=this.nBits;this.curBits>=8;)this.charOut(255&this.curAccum,i),this.curAccum>>=8,this.curBits-=8;if((this.freeEnt>this.maxcode||this.clearFlg)&&(this.clearFlg?(this.maxcode=t.MAXCODE(this.nBits=this.gInitBits),this.clearFlg=!1):(++this.nBits,12===this.nBits?this.maxcode=4096:this.maxcode=t.MAXCODE(this.nBits))),e===this.EOFCode){for(;this.curBits>0;)this.charOut(255&this.curAccum,i),this.curAccum>>=8,this.curBits-=8;this.flushChar(i)}},t.prototype.clBlock=function(t){this.clHash(i),this.freeEnt=this.ClearCode+2,this.clearFlg=!0,this.output(this.ClearCode,t)},t.prototype.nextPixel=function(){return 0===this.remaining?-1:(--this.remaining,255&this.pixels[this.curPixel++])},t.prototype.compress=function(e,r){this.gInitBits=e,this.clearFlg=!1,this.nBits=this.gInitBits,this.maxcode=t.MAXCODE(this.nBits),this.ClearCode=1<<e-1,this.EOFCode=this.ClearCode+1,this.freeEnt=this.ClearCode+2,this.aCount=0;var n,a,o=this.nextPixel(),s=0;for(n=i;n<65536;n*=2)++s;s=8-s,this.clHash(i),this.output(this.ClearCode,r);t:do{n=((a=this.nextPixel())<<12)+o;var h=a<<s^o;if(this.htab[h]!==n){if(this.htab[h]>=0){var u=i-h;0===h&&(u=1);do{if((h-=u)<0&&(h+=i),this.htab[h]===n){o=this.codetab[h];continue t}}while(this.htab[h]>=0)}this.output(o,r),o=a,this.freeEnt<4096?(this.codetab[h]=this.freeEnt++,this.htab[h]=n):this.clBlock(r)}else o=this.codetab[h]}while(-1!==a);this.output(o,r),this.output(this.EOFCode,r)},t.prototype.encode=function(t){t.writeByte(this.initCodeSize),this.remaining=this.width*this.height,this.curPixel=0,this.compress(this.initCodeSize+1,t),t.writeByte(0)},t}();e.default=n},7986:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=256,r=1024,n=1<<18,a=function(){function t(t,e){this.network=[],this.netindex=new Int32Array(256),this.bias=new Int32Array(i),this.freq=new Int32Array(i),this.radpower=new Int32Array(32),this.pixels=t,this.samplefac=e}return t.prototype.init=function(){this.network=[],this.netindex=new Int32Array(256),this.bias=new Int32Array(i),this.freq=new Int32Array(i),this.radpower=new Int32Array(32);for(var t=0;t<i;t++){var e=(t<<12)/i;this.network[t]=new Float64Array([e,e,e,0]),this.freq[t]=256,this.bias[t]=0}},t.prototype.unbiasnet=function(){for(var t=0;t<i;t++)this.network[t][0]>>=4,this.network[t][1]>>=4,this.network[t][2]>>=4,this.network[t][3]=t},t.prototype.altersingle=function(t,e,i,n,a){this.network[e][0]-=t*(this.network[e][0]-i)/r,this.network[e][1]-=t*(this.network[e][1]-n)/r,this.network[e][2]-=t*(this.network[e][2]-a)/r},t.prototype.alterneigh=function(t,e,r,a,o){for(var s=Math.abs(e-t),h=Math.min(e+t,i),u=e+1,l=e-1,c=1;u<h||l>s;){var f=this.radpower[c++],p=void 0;u<h&&((p=this.network[u++])[0]-=f*(p[0]-r)/n,p[1]-=f*(p[1]-a)/n,p[2]-=f*(p[2]-o)/n),l>s&&((p=this.network[l--])[0]-=f*(p[0]-r)/n,p[1]-=f*(p[1]-a)/n,p[2]-=f*(p[2]-o)/n)}},t.prototype.contest=function(t,e,r){for(var n=~(1<<31),a=n,o=-1,s=o,h=0;h<i;h++){var u=this.network[h],l=Math.abs(u[0]-t)+Math.abs(u[1]-e)+Math.abs(u[2]-r);l<n&&(n=l,o=h);var c=l-(this.bias[h]>>12);c<a&&(a=c,s=h);var f=this.freq[h]>>10;this.freq[h]-=f,this.bias[h]+=f<<10}return this.freq[o]+=64,this.bias[o]-=65536,s},t.prototype.inxbuild=function(){for(var t,e=0,r=0,n=0;n<i;n++){var a=this.network[n],o=void 0,s=n,h=a[1];for(t=n+1;t<i;t++)(o=this.network[t])[1]<h&&(s=t,h=o[1]);if(o=this.network[s],n!==s&&(t=o[0],o[0]=a[0],a[0]=t,t=o[1],o[1]=a[1],a[1]=t,t=o[2],o[2]=a[2],a[2]=t,t=o[3],o[3]=a[3],a[3]=t),h!==e){for(this.netindex[e]=r+n>>1,t=e+1;t<h;t++)this.netindex[t]=n;e=h,r=n}}for(this.netindex[e]=r+255>>1,t=e+1;t<256;t++)this.netindex[t]=255},t.prototype.lookupRGB=function(t,e,r){for(var n,a,o,s=1e3,h=-1,u=this.netindex[e],l=u-1;u<i||l>=0;)u<i&&((o=(a=this.network[u])[1]-e)>=s?u=i:(u++,o<0&&(o=-o),(n=a[0]-t)<0&&(n=-n),(o+=n)<s&&((n=a[2]-r)<0&&(n=-n),(o+=n)<s&&(s=o,h=a[3])))),l>=0&&((o=e-(a=this.network[l])[1])>=s?l=-1:(l--,o<0&&(o=-o),(n=a[0]-t)<0&&(n=-n),(o+=n)<s&&((n=a[2]-r)<0&&(n=-n),(o+=n)<s&&(s=o,h=a[3]))));return h},t.prototype.learn=function(){var t,e,i,n,a,o,s=this.pixels.length,h=30+(this.samplefac-1)/3,u=s/(3*this.samplefac),l=~~(u/100),c=r,f=2048,p=f>>6;for(p<=1&&(p=0),t=0;t<p;t++)this.radpower[t]=c*(256*(p*p-t*t)/(p*p));s<1509?(this.samplefac=1,e=3):e=s%499!=0?1497:s%491!=0?1473:s%487!=0?1461:1509;var d=0;for(t=0;t<u;)if(i=(255&this.pixels[d])<<4,n=(255&this.pixels[d+1])<<4,a=(255&this.pixels[d+2])<<4,o=this.contest(i,n,a),this.altersingle(c,o,i,n,a),0!==p&&this.alterneigh(p,o,i,n,a),(d+=e)>=s&&(d-=s),0===l&&(l=1),++t%l==0)for(c-=c/h,(p=(f-=f/30)>>6)<=1&&(p=0),o=0;o<p;o++)this.radpower[o]=c*(256*(p*p-o*o)/(p*p))},t.prototype.buildColormap=function(){this.init(),this.learn(),this.unbiasnet(),this.inxbuild()},t.prototype.getColormap=function(){for(var t=[],e=[],r=0;r<i;r++)e[this.network[r][3]]=r;for(var n=0,a=0;a<i;a++){var o=e[a];t[n++]=this.network[o][0],t[n++]=this.network[o][1],t[n++]=this.network[o][2]}return t},t}();e.default=a},2378:function(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(e,t,i);return n(e,t),e},o=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},h=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.rainEmote=e.slideEmote=e.infiniteEmote=e.wiggleEmote=e.rainbowEmote=e.shakeEmote=e.spinEmote=e.rotateEmote=e.preparePNGVariables=e.setEncoderProperties=e.alignGif=e.getGifFromBuffer=e.getBuffer=void 0;var u=h(i(86)),l=i(1702),c=i(2413),f=h(i(7233)),p=h(i(6154)),d=a(i(1145)),m=a(i(1004)),g=a(i(9131)),b=a(i(5262)),v=a(i(4061)),y=a(i(7745)),_=a(i(6809)),w=a(i(7370));function x(t){return o(this,void 0,void 0,(function(){var e,i,r;return s(this,(function(n){switch(n.label){case 0:return e=[],Buffer.isBuffer(t)?(i=p.default(t),[3,4]):[3,1];case 1:return"string"!=typeof t?[3,3]:[4,u.default()(t)];case 2:return(r=n.sent())instanceof c.Stream?(i=r,[3,4]):[2,Buffer.concat([])];case 3:i=t,n.label=4;case 4:return[2,new Promise((function(t,r){i.on("data",(function(t){e.push(t)})).on("end",(function(){t(Buffer.concat(e))})).on("error",(function(t){r(t)}))}))]}}))}))}e.getBuffer=x,e.getGifFromBuffer=function(t){return o(this,void 0,void 0,(function(){var e,i;return s(this,(function(r){switch(r.label){case 0:return[4,x(t)];case 1:return e=r.sent(),[4,l.GifUtil.read(e)];case 2:if((i=r.sent()).frames.length>200)throw Error("Image too large, advanced modifiers not supported!");return[2,i]}}))}))},e.alignGif=function(t,e){for(var i=l.GifUtil.cloneFrames(t);i.length<e;)i=i.concat(l.GifUtil.cloneFrames(t));for(var r=i.length%e;r/i.length>.2;)r=(i=i.concat(l.GifUtil.cloneFrames(t))).length%e;for(var n=i.length/t.length,a=0,o=0;o<r;o++){var s=Math.floor(Math.random()*t.length-1)+1;i.splice(s+a*t.length,1),a=(a+1)%n}return i},e.setEncoderProperties=function(t,e){t.start(),t.setRepeat(0),t.setQuality(5),e&&t.setDelay(e),t.setTransparent(0)},e.preparePNGVariables=function(t,e){var i=function(t){var e=1,i=1;if(!t.isResized){var r=t.size;if(r.includes("x")){var n=r.split("x");e=parseFloat(n[0]),i=parseFloat(n[1])}else e=parseFloat(r),i=parseFloat(r)}return{widthModifier:e,heightModifier:i}}(t),r=i.widthModifier,n=i.heightModifier,a=Math.floor(r*e.width),o=Math.floor(n*e.height);return{width:a,height:o,encoder:new f.default(a,o)}},e.rotateEmote=function(t){return"gif"===t.type?d.createRotatedGIF(t):d.createRotatedPNG(t)},e.spinEmote=function(t){return"gif"===t.type?m.createSpinningGIF(t):m.createSpinningPNG(t)},e.shakeEmote=function(t){return"gif"===t.type?g.createShakingGIF(t):g.createShakingPNG(t)},e.rainbowEmote=function(t){return"gif"===t.type?b.createRainbowGIF(t):b.createRainbowPNG(t)},e.wiggleEmote=function(t){return"gif"===t.type?v.createWigglingGIF(t):v.createWigglingPNG(t)},e.infiniteEmote=function(t){return"gif"===t.type?y.createInfiniteGIF(t):y.createInfinitePNG(t)},e.slideEmote=function(t){return"gif"===t.type?_.createSlidingGIF(t):_.createSlidingPNG(t)},e.rainEmote=function(t){return"gif"===t.type?w.createRainingGIF(t):w.createRainingPNG(t)}},4945:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=a(i(86)),s=i(2413),h=a(i(6154)),u=a(i(6287)),l=i(2378);function c(t,e,i,a){return void 0===a&&(a=0),r(this,void 0,void 0,(function(){var r,l,f,p,d,m;return n(this,(function(n){switch(n.label){case 0:return 0===t.length?[2,Buffer.concat([])]:(r=a,l=[],e.forEach((function(t){l.push(t.name),t.param&&l.push(t.param.toString())})),f=new u.default(i,l),Buffer.isBuffer(t)?(p=h.default(t),[3,3]):[3,1]);case 1:return[4,o.default()(t)];case 2:if(!((d=n.sent())instanceof s.Stream))return[2,Buffer.concat([])];p=d,n.label=3;case 3:return m=[],[2,new Promise((function(n,a){p.pipe(f).on("data",(function(t){m.push(t)})).on("error",(function(t){return a(t)})).on("end",(function(){0===m.length&&r<5?(r++,n(c(t,e,i,r))):n(Buffer.concat(m))}))}))]}}))}))}function f(t,e){var i=t.findIndex((function(t){return t.name===e}));return-1!==i?i:null}function p(t){switch(console.info("EmoteReplacer: Command name: "+t.name),t.name){case"rotate":return l.rotateEmote(t);case"spin":case"spinrev":return l.spinEmote(t);case"shake":return l.shakeEmote(t);case"rainbow":return l.rainbowEmote(t);case"wiggle":return l.wiggleEmote(t);case"infinite":return l.infiniteEmote(t);case"slide":case"sliderev":return l.slideEmote(t);case"rain":return l.rainEmote(t);default:return Promise.resolve(t.buffer)}}function d(t){return r(this,void 0,void 0,(function(){var e,i,r,a,o;return n(this,(function(n){switch(n.label){case 0:e=t.commands,i=t.data,console.info("EmoteReplacer: Commands count: "+e.length),r=0,n.label=1;case 1:return r<e.length?(a=(e[r].param||0).toString(),o=(t.size||1).toString(),[4,p({name:e[r].name,value:parseFloat(a),buffer:i,type:0===r?t.fileType:"gif",size:o,isResized:r>0})]):[3,4];case 2:i=n.sent(),n.label=3;case 3:return r++,[3,1];case 4:return[2,i]}}))}))}function m(t,e,i){return r(this,void 0,void 0,(function(){var r,a,o;return n(this,(function(n){switch(n.label){case 0:return r=i,[4,c(e,[{name:"-I"}],t.gifsiclePath)];case 1:return a=n.sent(),r.unshift({name:"-U"}),null!==(o=f(r,"hyperspeed"))&&(r.splice(o,1),r=function(t,e,i){e.push({name:"-d2"});var r=i.toString("utf8").split("image #").length-1;if(r<=4)return e;e.push({name:"--delete"});for(var n=1;n<r;n+=2)e.push({name:"#"+n});return e}(0,r,a)),[2,c(e,r,t.gifsiclePath)]}}))}))}function g(t){return r(this,void 0,void 0,(function(){var e,i,r,a;return n(this,(function(n){switch(n.label){case 0:return e=t.url.endsWith("gif")?"gif":"png",i=t.url,"gif"!==e?[3,4]:t.commands.priority.length>0?[4,c(i,t.commands.priority,t.gifsiclePath)]:[3,2];case 1:i=n.sent(),n.label=2;case 2:return[4,c(i,[{name:"--unoptimize"}],t.gifsiclePath)];case 3:i=n.sent(),n.label=4;case 4:return"png"===e&&null!==(a=f(t.commands.priority,"--scale"))&&(r=t.commands.priority[a].param),t.commands.special.length>0?[4,d({data:i,commands:t.commands.special,fileType:e,size:r})]:[3,6];case 5:i=n.sent(),n.label=6;case 6:return t.commands.normal.length>0?[4,m(t,i,t.commands.normal)]:[3,8];case 7:i=n.sent(),n.label=8;case 8:if(!(i instanceof Buffer))throw Error("Did not process gif!");return[2,i]}}))}))}var b=function(){function t(){this.name="GifUtils"}return t.modifyGif=function(t){return r(this,void 0,void 0,(function(){var e,i;return n(this,(function(r){switch(r.label){case 0:return e=t,console.info("EmoteReplacer: Got request",JSON.stringify(e)),e.commands=(n=e.options,a=[],o=[],s=[],n.forEach((function(t){var e;switch(t[0]){case"resize":var i={name:"--scale",param:t[1]},r=null===(e=i.param)||void 0===e?void 0:e.toString().split("x");!0===(null==r?void 0:r.some((function(t){return parseFloat(t)>1})))?a.push(i):s.push(i);break;case"reverse":a.push({name:"#-1-0"});break;case"flip":a.push({name:"--flip-horizontal"});break;case"flap":a.push({name:"--flip-vertical"});break;case"speed":var n=t[1].toString();a.push({name:"-d"+Math.max(2,parseFloat(n))});break;case"hyperspeed":a.push({name:"hyperspeed"});break;case"rotate":o.push({name:t[0],param:t[1]});break;case"wiggle":var h=2;if(t[1]){var u=t[1];"big"===u?h=4:"bigger"===u?h=6:"huge"===u&&(h=10)}o.push({name:t[0],param:h});break;case"rain":o.push({name:t[0],param:"glitter"===t[1]?1:0});break;case"spin":case"spinrev":case"shake":case"rainbow":case"infinite":case"slide":case"sliderev":var l=8;if(t[1]){var c=t[1];"fast"===c?l=6:"faster"===c?l=4:"hyper"===c&&(l=2)}o.push({name:t[0],param:l})}})),{normal:a,special:o,priority:s}),console.info("EmoteReplacer: Processed request commands",e.commands),[4,g(e)];case 1:return i=r.sent(),console.info("EmoteReplacer: Processed modified emote",{length:i.length}),[2,i]}var n,a,o,s}))}))},t}();e.default=b},3607:function(t,e,i){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=r(i(4945));window.EmoteReplacer.GifUtils=n.default},7745:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createInfinitePNG=e.createInfiniteGIF=void 0;var o=a(i(5817)),s=a(i(7233)),h=i(2378);function u(t,e,i){for(var r=[],n=0;n<t;n++)r.push((t-n-1)*e+i);return r}function l(t,e){for(var i=new o.default(t.width,t.height,0),r=0;r<e.length;r++){var n=new o.default(t);n.scale(e[r]);var a=(n.bitmap.width-t.width)/2,s=(n.bitmap.height-t.height)/2;e[r]>1?i.blit(n,0,0,a,s,t.width,t.height):i.blit(n,-a,-s)}return i.bitmap}function c(t,e,i){var r=t;if(r[0]>=r.length*e)r=u(r.length,e,i);else for(var n=0;n<r.length;n++)r[n]+=i;return r}e.createInfiniteGIF=function(t){return r(this,void 0,void 0,(function(){var e,i;return n(this,(function(r){switch(r.label){case 0:return[4,h.getGifFromBuffer(t.buffer)];case 1:return e=r.sent(),i=new s.default(e.width,e.height),[2,new Promise((function(r,n){h.getBuffer(i.createReadStream()).then(r).catch(n),h.setEncoderProperties(i);for(var a=.24/t.value,o=u(5,.9,a),s=h.alignGif(e.frames,.9/a),f=0;f<s.length;f++){i.setDelay(10*s[f].delayCentisecs);var p=l(s[f].bitmap,o);i.addFrame(p.data),o=c(o,.9,a)}i.finish()}))]}}))}))},e.createInfinitePNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,s;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,o.default.read(t.buffer)];case 1:return e=n.sent(),i=h.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,s=i.encoder,e.resize(r,a),[2,new Promise((function(i,r){h.getBuffer(s.createReadStream()).then(i).catch(r),h.setEncoderProperties(s,10*t.value);for(var n=u(5,.9,.06),a=0;a<14.000000000000002;a++){var o=l(e.bitmap,n);s.addFrame(o.data),n=c(n,.9,.06)}s.finish()}))]}}))}))}},7370:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRainingPNG=e.createRainingGIF=void 0;var o=a(i(5817)),s=a(i(7233)),h=i(2378);function u(t){var e=Math.random(),i=Math.floor(5*e+1),r=Math.floor(2*e+1);return{speed:e=Math.floor(e*t+t),len:i,size:r}}var l=function(){function t(t,e,i){this.r=0,this.g=0,this.b=0,this.width=t,this.height=e,this.delay=i,this.x=Math.random()*t,this.y=Math.random()*e;var r=u(this.delay),n=r.speed,a=r.len,o=r.size;this.speed=n,this.len=a,this.size=o}return t.prototype.fall=function(){if(this.y+=this.speed,this.y>this.height){this.y=0;var t=u(this.delay),e=t.speed,i=t.len,r=t.size;this.speed=e,this.len=i,this.size=r}},t.prototype.setColor=function(t,e,i){this.r=t,this.g=e,this.b=i},t}();function c(t,e,i,r){for(var n=[],a=0,s=(t+e)/5;a<s;a++)n.push(new l(t,e,r));return i?n.forEach((function(t){t.setColor(256*Math.random(),256*Math.random(),256*Math.random())})):n.forEach((function(t){return t.setColor(0,120,255)})),{next:function(){for(var i=new o.default(t,e,0),r=0;r<n.length;r++){for(var a=n[r],s=0;s<a.len;s++)for(var h=0;h<a.size;h++){var u=4*(Math.floor(a.y+s)*t+Math.floor(a.x+h));i.bitmap.data[u+0]=a.r,i.bitmap.data[u+1]=a.g,i.bitmap.data[u+2]=a.b,i.bitmap.data[u+3]=255}a.fall()}return i}}}e.createRainingGIF=function(t){return r(this,void 0,void 0,(function(){var e,i;return n(this,(function(r){switch(r.label){case 0:return[4,h.getGifFromBuffer(t.buffer)];case 1:return e=r.sent(),i=new s.default(e.width,e.height),[2,new Promise((function(r,n){h.getBuffer(i.createReadStream()).then((function(t){return r(t)})).catch(n),h.setEncoderProperties(i);for(var a=e.frames,s=1===t.value,u=c(e.width,e.height,s,a[0].delayCentisecs),l=0;l<a.length;l++){i.setDelay(10*a[l].delayCentisecs);var f=new o.default(a[l].bitmap);f.blit(u.next(),0,0),i.addFrame(f.bitmap.data)}i.finish()}))]}}))}))},e.createRainingPNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,s;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,o.default.read(t.buffer)];case 1:return e=n.sent(),i=h.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,s=i.encoder,e.resize(r,a),[2,new Promise((function(i,n){h.getBuffer(s.createReadStream()).then(i).catch(n),h.setEncoderProperties(s,80);for(var u=1===t.value,l=c(r,a,u,8),f=0;f<12;f++){var p=new o.default(e.bitmap);p.blit(l.next(),0,0),s.addFrame(p.bitmap.data)}s.finish()}))]}}))}))}},5262:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRainbowPNG=e.createRainbowGIF=void 0;var o=a(i(5817)),s=a(i(7233)),h=i(2378);function u(t,e,i,r,n){var a,o=[t[e],t[e+1],t[e+2]];return(a=o[0]<=30&&o[1]<=30&&o[2]<=30?[n,.5,.2]:o[0]>=220&&o[1]>=220&&o[2]>=220?[r,.5,.8]:function(t,e,i){var r,n,a=t/255,o=e/255,s=i/255,h=Math.max(a,o,s),u=Math.min(a,o,s),l=(h+u)/2;if(h===u)r=0,n=0;else{var c=h-u;switch(n=l>.5?c/(2-h-u):c/(h+u),h){case a:r=(o-s)/c+(o<s?6:0);break;case o:r=(s-a)/c+2;break;case s:r=(a-o)/c+4;break;default:r=0}r/=6}return[r,n,l]}(o[0],o[1],o[2]))[0]+=i,a}function l(t,e,i){var r=i;return r<0?r++:r>1&&r--,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function c(t,e,i,r){for(var n=0;n<t.data.length;n+=4)if(t.data[n+3]>0){for(var a=u(t.data,n,e,i,r);a[0]>1;)a[0]--;o=a[0],s=a[1],h=a[2],c=void 0,f=void 0,p=void 0,d=void 0,m=void 0,0===s?(c=h,f=h,p=h):(c=l(m=2*h-(d=h<.5?h*(1+s):h+s-h*s),d,o+1/3),f=l(m,d,o),p=l(m,d,o-1/3)),a=[255*c,255*f,255*p],t.data.set(a,n)}var o,s,h,c,f,p,d,m}e.createRainbowGIF=function(t){return r(this,void 0,void 0,(function(){var e,i;return n(this,(function(r){switch(r.label){case 0:return[4,h.getGifFromBuffer(t.buffer)];case 1:return e=r.sent(),i=new s.default(e.width,e.height),[2,new Promise((function(r,n){h.getBuffer(i.createReadStream()).then((function(t){return r(t)})).catch(n),h.setEncoderProperties(i);for(var a=32*t.value,o=h.alignGif(e.frames,a),s=Math.random(),u=Math.random(),l=0;l<o.length;l++){i.setDelay(10*o[l].delayCentisecs);var f=o[l];c(f.bitmap,l%a/a,s,u),i.addFrame(f.bitmap.data)}i.finish()}))]}}))}))},e.createRainbowPNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,s;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,o.default.read(t.buffer)];case 1:return e=n.sent(),i=h.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,s=i.encoder,e.resize(r,a),[2,new Promise((function(i,r){h.getBuffer(s.createReadStream()).then((function(t){return i(t)})).catch(r),h.setEncoderProperties(s,10*t.value);for(var n=Math.random(),a=Math.random(),o=0;o<32;o++)c(e.bitmap,.03125,n,a),s.addFrame(e.bitmap.data);s.finish()}))]}}))}))}},1145:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createRotatedPNG=e.createRotatedGIF=void 0;var o=a(i(5817)),s=a(i(7233)),h=i(2378);function u(t,e){var i=(t-e)/2;return e>t&&(i*=-1),{max:Math.max(t,e),margin:i}}e.createRotatedGIF=function(t){return r(this,void 0,void 0,(function(){var e,i,r;return n(this,(function(n){switch(n.label){case 0:return[4,h.getGifFromBuffer(t.buffer)];case 1:return e=n.sent(),i=Math.max(e.width,e.height),r=new s.default(i,i),[2,new Promise((function(n,a){h.getBuffer(r.createReadStream()).then((function(t){return n(t)})).catch(a),h.setEncoderProperties(r);for(var s=-t.value,l=u(e.width,e.height).margin,c=e.frames,f=0;f<c.length;f++){r.setDelay(10*c[f].delayCentisecs);var p=new o.default(i,i);e.width>e.height?p.blit(new o.default(c[f].bitmap),0,l):p.blit(new o.default(c[f].bitmap),l,0),p.rotate(s,!1),r.addFrame(p.bitmap.data)}r.finish()}))]}}))}))},e.createRotatedPNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,l,c,f,p,d,m;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,o.default.read(t.buffer)];case 1:return e=n.sent(),i=h.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,l=t.value,c=u(r,a),f=c.max,p=c.margin,d=new s.default(f,f),e.resize(r,a),m=new o.default(f,f),e=r>a?m.blit(e,0,p):m.blit(e,p,0),[2,new Promise((function(e,i){h.getBuffer(d.createReadStream()).then((function(t){return e(t)})).catch(i),h.setEncoderProperties(d,10*t.value);var r=new o.default(m.bitmap);r.rotate(l,!1),d.addFrame(r.bitmap.data),d.finish()}))]}}))}))}},9131:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createShakingPNG=e.createShakingGIF=void 0;var o=i(1702),s=a(i(5817)),h=a(i(7233)),u=i(2378);function l(t,e){return e?l(e,t%e):t}e.createShakingGIF=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,c,f,p,d,m,g,b,v,y,_,w;return n(this,(function(n){switch(n.label){case 0:return[4,u.getGifFromBuffer(t.buffer)];case 1:return e=n.sent(),i=Math.max(2,t.value),r=e.frames[0].delayCentisecs,a=e.frames,c=1,f=1,r!==i&&(p=(x=r)*(E=i)/l(x,E)/i,a.length*p>800&&(a=a.filter((function(t,e){return e%2==0})),r*=2,i*=2),a=function(t,e){if(e<2)return o.GifUtil.cloneFrames(t);for(var i=[],r=0;r<t.length;r++)for(var n=0;n<e;n++)i.push(new o.GifFrame(t[r].bitmap));return i}(a,p),r>i?(c=i/l(r/=p,i),1===r&&(c/=2)):r<i&&(f=l(r/=p,i)/i,1===r&&(f/=2)),1===r&&(a.length%2!=0&&(d=Math.floor(Math.random()*a.length-1)+1,a.splice(d,1)),a=a.filter((function(t,e){return e%2==0})),r=2),f*=4),m=0,g=0,b=1,v=1,y=3,_=0,w=new h.default(e.width,e.height),[2,new Promise((function(t,i){u.getBuffer(w.createReadStream()).then((function(e){return t(e)})).catch(i),u.setEncoderProperties(w,10*r);for(var n=0;n<a.length;n++){(_+=f)>=c&&(_-=c,(y<<=1)>16&&(y-=15),m=y>>3,g=y>>2&1,b=y>>1&1,v=1&y);var o=new s.default(e.width,e.height,0);o.blit(new s.default(a[n].bitmap),m,g,b,v,e.width-1,e.height-1),w.addFrame(o.bitmap.data)}w.finish()}))]}var x,E}))}))},e.createShakingPNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,o;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,s.default.read(t.buffer)];case 1:return e=n.sent(),i=u.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,o=i.encoder,e.resize(r,a),[2,new Promise((function(i,n){u.getBuffer(o.createReadStream()).then((function(t){return i(t)})).catch(n),u.setEncoderProperties(o,10*t.value);for(var h=0;h<4;h++){var l=new s.default(r,a,0);switch(h){case 0:l.blit(new s.default(e.bitmap),0,0,1,1,r-1,a-1);break;case 1:l.blit(new s.default(e.bitmap),0,1,1,0,r-1,a-1);break;case 2:l.blit(new s.default(e.bitmap),1,1,0,0,r-1,a-1);break;case 3:l.blit(new s.default(e.bitmap),1,0,0,1,r-1,a-1)}o.addFrame(l.bitmap.data)}o.finish()}))]}}))}))}},6809:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createSlidingPNG=e.createSlidingGIF=void 0;var o=a(i(5817)),s=a(i(7233)),h=i(2378);function u(t,e){var i=2*e;return{interval:i,shift:0,shiftSize:t/i}}function l(t,e){var i=t.bitmap.width,r=t.bitmap.height,n=new o.default(i,r,0);return n.blit(t,e,0,0,0,i-e,r),n.blit(t,0,0,i-e,0,e,r),n.bitmap}e.createSlidingGIF=function(t){return r(this,void 0,void 0,(function(){var e,i;return n(this,(function(r){switch(r.label){case 0:return[4,h.getGifFromBuffer(t.buffer)];case 1:return e=r.sent(),i=new s.default(e.width,e.height),[2,new Promise((function(r,n){h.getBuffer(i.createReadStream()).then(r).catch(n),h.setEncoderProperties(i);for(var a=e.width,s=u(a,t.value),c=s.interval,f=s.shiftSize,p=s.shift,d=h.alignGif(e.frames,c),m="sliderev"===t.name?1:-1,g=0;g<d.length;g++){i.setDelay(10*d[g].delayCentisecs);var b=l(new o.default(d[g].bitmap),p);i.addFrame(b.data),p=(p+m*f)%a}i.finish()}))]}}))}))},e.createSlidingPNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,s,c,f,p,d;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,o.default.read(t.buffer)];case 1:return e=n.sent(),i=h.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,s=i.encoder,e.resize(r,a),c=u(r,t.value),f=c.interval,p=c.shiftSize,d=c.shift,[2,new Promise((function(i,n){h.getBuffer(s.createReadStream()).then(i).catch(n),h.setEncoderProperties(s,40);for(var a="sliderev"===t.name?1:-1,o=0;o<f;o++){var u=l(e,d);s.addFrame(u.data),d=(d+a*p)%r}s.finish()}))]}}))}))}},1004:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createSpinningPNG=e.createSpinningGIF=void 0;var o=a(i(5817)),s=a(i(7233)),h=i(2378);function u(t,e,i,r,n){var a=360*t/e,o=Math.floor(360/a),s=(r-n)/2;return n>r&&(s*=-1),{degrees:a*=i?1:-1,interval:o,max:Math.max(r,n),margin:s}}e.createSpinningGIF=function(t){return r(this,void 0,void 0,(function(){var e,i,r;return n(this,(function(n){switch(n.label){case 0:return[4,h.getGifFromBuffer(t.buffer)];case 1:return e=n.sent(),i=Math.max(e.width,e.height),r=new s.default(i,i),[2,new Promise((function(n,a){h.getBuffer(r.createReadStream()).then((function(t){return n(t)})).catch(a),h.setEncoderProperties(r);for(var s=u(e.frames[0].delayCentisecs,200*t.value/8,"spinrev"===t.name,e.width,e.height),l=s.degrees,c=s.interval,f=s.margin,p=h.alignGif(e.frames,c),d=0;d<p.length;d++){r.setDelay(10*p[d].delayCentisecs);var m=new o.default(i,i);e.width>e.height?m.blit(new o.default(p[d].bitmap),0,f):m.blit(new o.default(p[d].bitmap),f,0),m.rotate(d*l%360,!1),r.addFrame(m.bitmap.data)}r.finish()}))]}}))}))},e.createSpinningPNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,l,c,f,p,d,m,g;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,o.default.read(t.buffer)];case 1:return e=n.sent(),i=h.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,l=u(t.value,200*t.value/8,"spinrev"===t.name,r,a),c=l.degrees,f=l.interval,p=l.max,d=l.margin,m=new s.default(p,p),e.resize(r,a),g=new o.default(p,p),e=r>a?g.blit(e,0,d):g.blit(e,d,0),[2,new Promise((function(e,i){h.getBuffer(m.createReadStream()).then((function(t){return e(t)})).catch(i),h.setEncoderProperties(m,10*t.value);for(var r=0;r<f;r++){var n=new o.default(g.bitmap);n.rotate(r*c,!1),m.addFrame(n.bitmap.data)}m.finish()}))]}}))}))}},4061:function(t,e,i){"use strict";var r=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{h(r.next(t))}catch(t){a(t)}}function s(t){try{h(r.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}h((r=r.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var i,r,n,a,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&a[0]?r.return:a[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,a[1])).done)return n;switch(r=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(6===a[0]&&o.label<n[1]){o.label=n[1],n=a;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(a);break}n[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{i=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.createWigglingPNG=e.createWigglingGIF=void 0;var o=a(i(5817)),s=a(i(7233)),h=i(2378);function u(t,e){var i=Math.max(1,t/6);return{shiftSize:i,interval:2*(t/i+4),stripeHeight:Math.max(1,Math.floor(e/32)),shift:t/2,left:!0}}function l(t,e,i,r){var n=t,a=e;return a?(n-=r)<-r&&(a=!1):(n+=r)>i+r&&(a=!0),[n,a]}function c(t,e,i,r){for(var n,a=new o.default(r.width,t.bitmap.height),s=e,h=i,u=0;u<t.bitmap.height;u+=r.stripeHeight)a.blit(t,s,u,0,u,t.bitmap.width,r.stripeHeight),s=(n=l(s,h,r.margin,r.shiftSize))[0],h=n[1];return a.bitmap}e.createWigglingGIF=function(t){return r(this,void 0,void 0,(function(){var e,i;return n(this,(function(r){switch(r.label){case 0:return[4,h.getGifFromBuffer(t.buffer)];case 1:return e=r.sent(),i=new s.default(e.width,e.height),[2,new Promise((function(r,n){var a;h.getBuffer(i.createReadStream()).then(r).catch(n),h.setEncoderProperties(i);for(var s=e.width+2*Math.floor(e.width*t.value*.1/15)-e.width,f=u(s,e.height),p=f.shiftSize,d=f.interval,m=f.stripeHeight,g=f.shift,b=f.left,v=h.alignGif(e.frames,d),y=0;y<v.length;y++){i.setDelay(10*v[y].delayCentisecs);var _=c(new o.default(v[y].bitmap),g,b,{stripeHeight:m,shiftSize:p,width:e.width,margin:s});i.addFrame(_.data),g=(a=l(g,b,s,p))[0],b=a[1]}i.finish()}))]}}))}))},e.createWigglingPNG=function(t){return r(this,void 0,void 0,(function(){var e,i,r,a,f,p,d,m,g,b,v,y,_;return n(this,(function(n){switch(n.label){case 0:if(t.buffer instanceof Buffer)throw Error("Was given a buffer instead of a path");return[4,o.default.read(t.buffer)];case 1:return e=n.sent(),i=h.preparePNGVariables(t,e.bitmap),r=i.width,a=i.height,e.resize(r,a),f=r+2*Math.floor(r*t.value*.1/15),p=f-r,d=new s.default(f,a),m=u(p,a),g=m.shiftSize,b=m.interval,v=m.stripeHeight,y=m.shift,_=m.left,[2,new Promise((function(t,i){var r;h.getBuffer(d.createReadStream()).then(t).catch(i),h.setEncoderProperties(d,80);for(var n=0;n<b;n++){var a=c(e,y,_,{stripeHeight:v,shiftSize:g,width:f,margin:p});d.addFrame(a.data),r=l(y,_,p,g),y=r[0],_=r[1]}d.finish()}))]}}))}))}},6173:(t,e,i)=>{!function(){var e={};function r(){"undefined"==typeof process&&console.log.apply(console,arguments)}t.exports=e,function(t,e){var i,n,a;i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(){function t(t){this.message="JPEG error: "+t}return t.prototype=Error(),t.prototype.name="JpegError",t.constructor=t}(),a=function(){function t(t,e){this.message=t,this.g=e}return t.prototype=Error(),t.prototype.name="DNLMarkerError",t.constructor=t}(),function(){function e(){this.M=null,this.B=-1}function r(t,e){for(var i,r,n=0,a=[],o=16;0<o&&!t[o-1];)o--;a.push({children:[],index:0});var s,h=a[0];for(i=0;i<o;i++){for(r=0;r<t[i];r++){for((h=a.pop()).children[h.index]=e[n];0<h.index;)h=a.pop();for(h.index++,a.push(h);a.length<=i;)a.push(s={children:[],index:0}),h.children[h.index]=s.children,h=s;n++}i+1<o&&(a.push(s={children:[],index:0}),h.children[h.index]=s.children,h=s)}return a[0].children}function o(t,e,r,o,s,l,c,f,p){function d(){if(0<B)return B--,D>>B&1;if(255===(D=t[e++])){var i=t[e++];if(i){if(220===i&&A){e+=2;var o=t[e++]<<8|t[e++];if(0<o&&o!==r.g)throw new a("Found DNL marker (0xFFDC) while parsing scan data",o)}throw new n("unexpected marker "+(D<<8|i).toString(16))}}return B=7,D>>>7}function m(t){for(;;){if("number"==typeof(t=t[d()]))return t;if("object"!==(void 0===t?"undefined":i(t)))throw new n("invalid huffman sequence")}}function g(t){for(var e=0;0<t;)e=e<<1|d(),t--;return e}function b(t){if(1===t)return 1===d()?1:-1;var e=g(t);return e>=1<<t-1?e:e+(-1<<t)+1}function v(t,e){var i=m(t.D);for(i=0===i?0:b(i),t.a[e]=t.m+=i,i=1;64>i;){var r=m(t.o),n=15&r;if(r>>=4,0===n){if(15>r)break;i+=16}else i+=r,t.a[e+u[i]]=b(n),i++}}function y(t,e){var i=m(t.D);i=0===i?0:b(i)<<p,t.a[e]=t.m+=i}function _(t,e){t.a[e]|=d()<<p}function w(t,e){if(0<N)N--;else for(var i=l;i<=c;){var r=m(t.o),n=15&r;if(r>>=4,0===n){if(15>r){N=g(r)+(1<<r)-1;break}i+=16}else i+=r,t.a[e+u[i]]=b(n)*(1<<p),i++}}function x(t,e){for(var i,r=l,a=0;r<=c;){i=e+u[r];var o=0>t.a[i]?-1:1;switch(L){case 0:if(i=15&(a=m(t.o)),a>>=4,0===i)15>a?(N=g(a)+(1<<a),L=4):(a=16,L=1);else{if(1!==i)throw new n("invalid ACn encoding");E=b(i),L=a?2:3}continue;case 1:case 2:t.a[i]?t.a[i]+=o*(d()<<p):0==--a&&(L=2===L?3:0);break;case 3:t.a[i]?t.a[i]+=o*(d()<<p):(t.a[i]=E<<p,L=0);break;case 4:t.a[i]&&(t.a[i]+=o*(d()<<p))}r++}4===L&&0==--N&&(L=0)}for(var E,I,M,k,P,T,S,A=9<arguments.length&&void 0!==arguments[9]&&arguments[9],O=r.P,C=e,D=0,B=0,N=0,L=0,R=o.length,F=r.S?0===l?0===f?y:_:0===f?w:x:v,z=0,G=1===R?o[0].c*o[0].l:O*r.O;z<G;){var U=s?Math.min(G-z,s):G;for(I=0;I<R;I++)o[I].m=0;if(N=0,1===R){var j=o[0];for(P=0;P<U;P++)F(j,64*((j.c+1)*(z/j.c|0)+z%j.c)),z++}else for(P=0;P<U;P++){for(I=0;I<R;I++)for(T=(j=o[I]).h,S=j.j,M=0;M<S;M++)for(k=0;k<T;k++)F(j,64*((j.c+1)*((z/O|0)*j.j+M)+(z%O*j.h+k)));z++}if(B=0,(j=h(t,e))&&j.f&&((0,_util.warn)("decodeScan - unexpected MCU data, current marker is: "+j.f),e=j.offset),!(j=j&&j.F)||65280>=j)throw new n("marker was not found");if(!(65488<=j&&65495>=j))break;e+=2}return(j=h(t,e))&&j.f&&((0,_util.warn)("decodeScan - unexpected Scan data, current marker is: "+j.f),e=j.offset),e-C}function s(t,e){for(var i=e.c,r=e.l,a=new Int16Array(64),o=0;o<r;o++)for(var s=0;s<i;s++){var h=64*((e.c+1)*o+s),u=a,l=e.G,c=e.a;if(!l)throw new n("missing required Quantization Table.");for(var f=0;64>f;f+=8){var p=c[h+f],d=c[h+f+1],m=c[h+f+2],g=c[h+f+3],b=c[h+f+4],v=c[h+f+5],y=c[h+f+6],_=c[h+f+7];if(p*=l[f],0==(d|m|g|b|v|y|_))p=5793*p+512>>10,u[f]=p,u[f+1]=p,u[f+2]=p,u[f+3]=p,u[f+4]=p,u[f+5]=p,u[f+6]=p,u[f+7]=p;else{d*=l[f+1],m*=l[f+2],g*=l[f+3],b*=l[f+4],v*=l[f+5];var w=5793*p+128>>8,x=5793*b+128>>8,E=m,I=y*=l[f+6];x=(w=w+x+1>>1)-x,p=3784*E+1567*I+128>>8,E=1567*E-3784*I+128>>8,v=(b=(b=2896*(d-(_*=l[f+7]))+128>>8)+(v<<=4)+1>>1)-v,g=(_=(_=2896*(d+_)+128>>8)+(g<<=4)+1>>1)-g,I=(w=w+(I=p)+1>>1)-I,E=(x=x+E+1>>1)-E,p=2276*b+3406*_+2048>>12,b=3406*b-2276*_+2048>>12,_=p,p=799*g+4017*v+2048>>12,g=4017*g-799*v+2048>>12,v=p,u[f]=w+_,u[f+7]=w-_,u[f+1]=x+v,u[f+6]=x-v,u[f+2]=E+g,u[f+5]=E-g,u[f+3]=I+b,u[f+4]=I-b}}for(l=0;8>l;++l)p=u[l],0==((d=u[l+8])|(m=u[l+16])|(g=u[l+24])|(b=u[l+32])|(v=u[l+40])|(y=u[l+48])|(_=u[l+56]))?(p=-2040>(p=5793*p+8192>>14)?0:2024<=p?255:p+2056>>4,c[h+l]=p,c[h+l+8]=p,c[h+l+16]=p,c[h+l+24]=p,c[h+l+32]=p,c[h+l+40]=p,c[h+l+48]=p,c[h+l+56]=p):(w=5793*p+2048>>12,x=5793*b+2048>>12,p=3784*(E=m)+1567*(I=y)+2048>>12,E=1567*E-3784*I+2048>>12,I=p,v=(b=(b=2896*(d-_)+2048>>12)+v+1>>1)-v,g=(_=(_=2896*(d+_)+2048>>12)+g+1>>1)-g,p=2276*b+3406*_+2048>>12,b=3406*b-2276*_+2048>>12,_=p,p=799*g+4017*v+2048>>12,g=4017*g-799*v+2048>>12,d=(x=(x=(w=4112+(w+x+1>>1))-x)+E+1>>1)+(v=p),y=x-v,v=(E=x-E)-g,p=16>(p=(w=w+I+1>>1)+_)?0:4080<=p?255:p>>4,d=16>d?0:4080<=d?255:d>>4,m=16>(m=E+g)?0:4080<=m?255:m>>4,g=16>(g=(I=w-I)+b)?0:4080<=g?255:g>>4,b=16>(b=I-b)?0:4080<=b?255:b>>4,v=16>v?0:4080<=v?255:v>>4,y=16>y?0:4080<=y?255:y>>4,_=16>(_=w-_)?0:4080<=_?255:_>>4,c[h+l]=p,c[h+l+8]=d,c[h+l+16]=m,c[h+l+24]=g,c[h+l+32]=b,c[h+l+40]=v,c[h+l+48]=y,c[h+l+56]=_)}return e.a}function h(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:e,r=t.length-1;if(i=i<e?i:e,e>=r)return null;var n=t[e]<<8|t[e+1];if(65472<=n&&65534>=n)return{f:null,F:n,offset:e};for(var a=t[i]<<8|t[i+1];!(65472<=a&&65534>=a);){if(++i>=r)return null;a=t[i]<<8|t[i+1]}return{f:n.toString(16),F:a,offset:i}}var u=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]);e.prototype={parse:function(t){function e(){var e=t[p]<<8|t[p+1];return p+=2,e}function i(){var i=e(),r=h(t,i=p+i-2,p);return r&&r.f&&((0,_util.warn)("readDataBlock - incorrect length, current marker is: "+r.f),i=r.offset),i=t.subarray(p,i),p+=i.length,i}function l(t){for(var e=Math.ceil(t.v/8/t.s),i=Math.ceil(t.g/8/t.u),r=0;r<t.b.length;r++){P=t.b[r];var n=Math.ceil(Math.ceil(t.v/8)*P.h/t.s),a=Math.ceil(Math.ceil(t.g/8)*P.j/t.u);P.a=new Int16Array(64*i*P.j*(e*P.h+1)),P.c=n,P.l=a}t.P=e,t.O=i}var c=(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}).N,f=void 0===c?null:c,p=0,d=null,m=0;c=[];var g=[],b=[],v=e();if(65496!==v)throw new n("SOI not found");for(v=e();65497!==v;){switch(v){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var y=i();65518===v&&65===y[0]&&100===y[1]&&111===y[2]&&98===y[3]&&101===y[4]&&(d={version:y[5]<<8|y[6],Y:y[7]<<8|y[8],Z:y[9]<<8|y[10],W:y[11]});break;case 65499:v=e()+p-2;for(var _;p<v;){var w=t[p++],x=new Uint16Array(64);if(0==w>>4)for(y=0;64>y;y++)x[_=u[y]]=t[p++];else{if(1!=w>>4)throw new n("DQT - invalid table spec");for(y=0;64>y;y++)x[_=u[y]]=e()}c[15&w]=x}break;case 65472:case 65473:case 65474:if(E)throw new n("Only single frame JPEGs supported");e();var E={};for(E.X=65473===v,E.S=65474===v,E.precision=t[p++],v=e(),E.g=f||v,E.v=e(),E.b=[],E.C={},y=t[p++],v=x=w=0;v<y;v++){_=t[p];var I=t[p+1]>>4,M=15&t[p+1];w<I&&(w=I),x<M&&(x=M),I=E.b.push({h:I,j:M,T:t[p+2],G:null}),E.C[_]=I-1,p+=3}E.s=w,E.u=x,l(E);break;case 65476:for(_=e(),v=2;v<_;){for(w=t[p++],x=new Uint8Array(16),y=I=0;16>y;y++,p++)I+=x[y]=t[p];for(M=new Uint8Array(I),y=0;y<I;y++,p++)M[y]=t[p];v+=17+I,(0==w>>4?b:g)[15&w]=r(x,M)}break;case 65501:e();var k=e();break;case 65498:for(y=1==++m&&!f,e(),w=t[p++],_=[],v=0;v<w;v++){x=E.C[t[p++]];var P=E.b[x];x=t[p++],P.D=b[x>>4],P.o=g[15&x],_.push(P)}v=t[p++],w=t[p++],x=t[p++];try{var T=o(t,p,E,_,k,v,w,x>>4,15&x,y);p+=T}catch(e){if(e instanceof a)return(0,_util.warn)('Attempting to re-parse JPEG image using "scanLines" parameter found in DNL marker (0xFFDC) segment.'),this.parse(t,{N:e.g});throw e}break;case 65500:p+=4;break;case 65535:255!==t[p]&&p--;break;default:if(255===t[p-3]&&192<=t[p-2]&&254>=t[p-2])p-=3;else{if(!(y=h(t,p-2))||!y.f)throw new n("unknown marker "+v.toString(16));(0,_util.warn)("JpegImage.parse - unexpected data, current marker is: "+y.f),p=y.offset}}v=e()}for(this.width=E.v,this.height=E.g,this.A=d,this.b=[],v=0;v<E.b.length;v++)(k=c[(P=E.b[v]).T])&&(P.G=k),this.b.push({R:s(0,P),U:P.h/E.s,V:P.j/E.u,c:P.c,l:P.l});this.i=this.b.length},L:function(t,e){var i,r,n=this.width/t,a=this.height/e,o=this.b.length,s=t*e*o,h=new Uint8ClampedArray(s),u=new Uint32Array(t);for(r=0;r<o;r++){var l=this.b[r],c=l.U*n,f=l.V*a,p=r,d=l.R,m=l.c+1<<3;for(i=0;i<t;i++)l=0|i*c,u[i]=(4294967288&l)<<3|7&l;for(c=0;c<e;c++)for(l=m*(4294967288&(l=0|c*f))|(7&l)<<3,i=0;i<t;i++)h[p]=d[l+u[i]],p+=o}if(a=this.M)for(r=0;r<s;)for(n=l=0;l<o;l++,r++,n+=2)h[r]=(h[r]*a[n]>>8)+a[n+1];return h},w:function(){return this.A?!!this.A.W:3===this.i?0!==this.B:1===this.B},I:function(t){for(var e,i,r,n=0,a=t.length;n<a;n+=3)e=t[n],i=t[n+1],r=t[n+2],t[n]=e-179.456+1.402*r,t[n+1]=e+135.459-.344*i-.714*r,t[n+2]=e-226.816+1.772*i;return t},K:function(t){for(var e,i,r,n,a=0,o=0,s=t.length;o<s;o+=4)e=t[o],i=t[o+1],r=t[o+2],n=t[o+3],t[a++]=i*(-660635669420364e-19*i+.000437130475926232*r-54080610064599e-18*e+.00048449797120281*n-.154362151871126)-122.67195406894+r*(-.000957964378445773*r+.000817076911346625*e-.00477271405408747*n+1.53380253221734)+e*(.000961250184130688*e-.00266257332283933*n+.48357088451265)+n*(-.000336197177618394*n+.484791561490776),t[a++]=107.268039397724+i*(219927104525741e-19*i-.000640992018297945*r+.000659397001245577*e+.000426105652938837*n-.176491792462875)+r*(-.000778269941513683*r+.00130872261408275*e+.000770482631801132*n-.151051492775562)+e*(.00126935368114843*e-.00265090189010898*n+.25802910206845)+n*(-.000318913117588328*n-.213742400323665),t[a++]=i*(-.000570115196973677*i-263409051004589e-19*r+.0020741088115012*e-.00288260236853442*n+.814272968359295)-20.810012546947+r*(-153496057440975e-19*r-.000132689043961446*e+.000560833691242812*n-.195152027534049)+e*(.00174418132927582*e-.00255243321439347*n+.116935020465145)+n*(-.000343531996510555*n+.24165260232407);return t.subarray(0,a)},J:function(t){for(var e,i,r,n=0,a=t.length;n<a;n+=4)e=t[n],i=t[n+1],r=t[n+2],t[n]=434.456-e-1.402*r,t[n+1]=119.541-e+.344*i+.714*r,t[n+2]=481.816-e-1.772*i;return t},H:function(t){for(var e,i,r,n,a=0,o=1/255,s=0,h=t.length;s<h;s+=4)e=t[s]*o,i=t[s+1]*o,r=t[s+2]*o,n=t[s+3]*o,t[a++]=255+e*(-4.387332384609988*e+54.48615194189176*i+18.82290502165302*r+212.25662451639585*n-285.2331026137004)+i*(1.7149763477362134*i-5.6096736904047315*r-17.873870861415444*n-5.497006427196366)+r*(-2.5217340131683033*r-21.248923337353073*n+17.5119270841813)-n*(21.86122147463605*n+189.48180835922747),t[a++]=255+e*(8.841041422036149*e+60.118027045597366*i+6.871425592049007*r+31.159100130055922*n-79.2970844816548)+i*(-15.310361306967817*i+17.575251261109482*r+131.35250912493976*n-190.9453302588951)+r*(4.444339102852739*r+9.8632861493405*n-24.86741582555878)-n*(20.737325471181034*n+187.80453709719578),t[a++]=255+e*(.8842522430003296*e+8.078677503112928*i+30.89978309703729*r-.23883238689178934*n-14.183576799673286)+i*(10.49593273432072*i+63.02378494754052*r+50.606957656360734*n-112.23884253719248)+r*(.03296041114873217*r+115.60384449646641*n-193.58209356861505)-n*(22.33816807309886*n+180.12613974708367);return t.subarray(0,a)},getData:function(t,e,i){if(4<this.i)throw new n("Unsupported color mode");if(t=this.L(t,e),1===this.i&&i){i=t.length,e=new Uint8ClampedArray(3*i);for(var r=0,a=0;a<i;a++){var o=t[a];e[r++]=o,e[r++]=o,e[r++]=o}return e}if(3===this.i&&this.w())return this.I(t);if(4===this.i){if(this.w())return i?this.K(t):this.J(t);if(i)return this.H(t)}return t}},t.JpegDecoder=e}(),t.encodeImage=function(e,i,r,n){var a={t256:[i],t257:[r],t258:[8,8,8,8],t259:[1],t262:[2],t273:[1e3],t277:[4],t278:[r],t279:[i*r*4],t282:[1],t283:[1],t284:[1],t286:[0],t287:[0],t296:[1],t305:["Photopea (UTIF.js)"],t338:[1]};if(n)for(var o in n)a[o]=n[o];var s=new Uint8Array(t.encode([a])),h=new Uint8Array(e),u=new Uint8Array(1e3+i*r*4);for(o=0;o<s.length;o++)u[o]=s[o];for(o=0;o<h.length;o++)u[1e3+o]=h[o];return u.buffer},t.encode=function(e){var i=new Uint8Array(2e4),r=4,n=t._binBE;i[0]=77,i[1]=77,i[3]=42;var a=8;n.writeUint(i,r,a),r+=4;for(var o=0;o<e.length;o++){var s=t._writeIFD(n,i,a,e[o]);a=s[1],o<e.length-1&&n.writeUint(i,s[0],a)}return i.slice(0,a).buffer},t.decode=function(e){t.decode._decodeG3.allow2D=null;var i=new Uint8Array(e),r=0,n=t._binBE.readASCII(i,r,2);r+=2;var a="II"==n?t._binLE:t._binBE;a.readUshort(i,r),r+=2;var o=a.readUint(i,r);r+=4;for(var s=[];;){var h=t._readIFD(a,i,o,s);if(0==(o=a.readUint(i,h)))break}return s},t.decodeImages=function(e,i){for(var n=new Uint8Array(e),a=t._binBE.readASCII(n,0,2),o=0;o<i.length;o++){var s=i[o];if(null!=s.t256){s.isLE="II"==a,s.width=s.t256[0],s.height=s.t257[0];var h=s.t259?s.t259[0]:1,u=s.t266?s.t266[0]:1;s.t284&&2==s.t284[0]&&r("PlanarConfiguration 2 should not be used!");var l=(s.t258?Math.min(32,s.t258[0]):1)*(s.t277?s.t277[0]:1),c=8*Math.ceil(s.width*l/8),f=s.t273;null==f&&(f=s.t324);var p=s.t279;1==h&&1==f.length&&(p=[s.height*(c>>>3)]),null==p&&(p=s.t325);var d=new Uint8Array(s.height*(c>>>3)),m=0;if(null!=s.t322){for(var g=s.t322[0],b=s.t323[0],v=Math.floor((s.width+g-1)/g),y=Math.floor((s.height+b-1)/b),_=new Uint8Array(0|Math.ceil(g*b*l/8)),w=0;w<y;w++)for(var x=0;x<v;x++){for(var E=w*v+x,I=0;I<_.length;I++)_[I]=0;t.decode._decompress(s,n,f[E],p[E],h,_,0,u),6==h?d=_:t._copyTile(_,0|Math.ceil(g*l/8),b,d,0|Math.ceil(s.width*l/8),s.height,0|Math.ceil(x*g*l/8),w*b)}m=8*d.length}else{var M=s.t278?s.t278[0]:s.height;for(M=Math.min(M,s.height),E=0;E<f.length;E++)t.decode._decompress(s,n,f[E],p[E],h,d,0|Math.ceil(m/8),u),m+=c*M;m=Math.min(m,8*d.length)}s.data=new Uint8Array(d.buffer,0,0|Math.ceil(m/8))}}},t.decode._decompress=function(i,n,a,o,s,h,u,l){if(1==s)for(var c=0;c<o;c++)h[u+c]=n[a+c];else if(3==s)t.decode._decodeG3(n,a,o,h,u,i.width,l);else if(4==s)t.decode._decodeG4(n,a,o,h,u,i.width,l);else if(5==s)t.decode._decodeLZW(n,a,h,u);else if(6==s)t.decode._decodeOldJPEG(i,n,a,o,h,u);else if(7==s)t.decode._decodeNewJPEG(i,n,a,o,h,u);else if(8==s)for(var f=new Uint8Array(n.buffer,a,o),p=e.inflate(f),d=0;d<p.length;d++)h[u+d]=p[d];else 32773==s?t.decode._decodePackBits(n,a,o,h,u):32809==s?t.decode._decodeThunder(n,a,o,h,u):r("Unknown compression",s);if(i.t317&&2==i.t317[0])for(var m=i.t277?i.t277[0]:1,g=i.t278?i.t278[0]:i.height,b=i.width*m,v=0;v<g;v++){var y=u+v*b;if(3==m)for(c=3;c<b;c+=3)h[y+c]=h[y+c]+h[y+c-3]&255,h[y+c+1]=h[y+c+1]+h[y+c-2]&255,h[y+c+2]=h[y+c+2]+h[y+c-1]&255;else for(c=m;c<b;c++)h[y+c]=h[y+c]+h[y+c-m]&255}},t.decode._decodeNikon=function(t,e,i,n,a){var o,s;r(t.slice(e,e+100)),o=t[e],s=t[++e],e++,r(o.toString(16),s.toString(16),i)},t.decode._decodeNewJPEG=function(e,i,r,n,a,o){var s=e.t347,h=s?s.length:0,u=new Uint8Array(h+n);if(s){for(var l=0,c=0;c<h-1&&(255!=s[c]||217!=s[c+1]);c++)u[l++]=s[c];var f=i[r],p=i[r+1];for(255==f&&216==p||(u[l++]=f,u[l++]=p),c=2;c<n;c++)u[l++]=i[r+c]}else for(c=0;c<n;c++)u[c]=i[r+c];if(32803==e.t262){var d=e.t258[0],m=(new LosslessJpegDecoder).decode(u),g=m.length;if(16==d)for(c=0;c<g;c++)a[o++]=255&m[c],a[o++]=m[c]>>>8;else{if(12!=d)throw new Error("unsupported bit depth "+d);for(c=0;c<g;c+=2)a[o++]=m[c]>>>4,a[o++]=255&(m[c]<<4|m[c+1]>>>8),a[o++]=255&m[c+1]}}else{var b=new t.JpegDecoder;b.parse(u);var v=b.getData(b.width,b.height);for(c=0;c<v.length;c++)a[o+c]=v[c]}6==e.t262[0]&&(e.t262[0]=2)},t.decode._decodeOldJPEGInit=function(t,e,i,n){var a,o,s,h,u,l=216,c=0,f=0,p=!1,d=t.t513,m=d?d[0]:0,g=t.t514,b=g?g[0]:0,v=t.t324||t.t273||d,y=t.t530,_=0,w=0,x=t.t277?t.t277[0]:1,E=t.t515;if(v&&(f=v[0],p=v.length>1),!p){if(255==e[i]&&e[i+1]==l)return{jpegOffset:i};if(null!=d&&(255==e[i+m]&&e[i+m+1]==l?c=i+m:r("JPEGInterchangeFormat does not point to SOI"),null==g?r("JPEGInterchangeFormatLength field is missing"):(m>=f||m+b<=f)&&r("JPEGInterchangeFormatLength field value is invalid"),null!=c))return{jpegOffset:c}}if(null!=y&&(_=y[0],w=y[1]),null!=d&&null!=g)if(b>=2&&m+b<=f){for(a=255==e[i+m+b-2]&&e[i+m+b-1]==l?new Uint8Array(b-2):new Uint8Array(b),s=0;s<a.length;s++)a[s]=e[i+m+s];r("Incorrect JPEG interchange format: using JPEGInterchangeFormat offset to derive tables")}else r("JPEGInterchangeFormat+JPEGInterchangeFormatLength > offset to first strip or tile");if(null==a){var I=0,M=[];M[I++]=255,M[I++]=l;var k=t.t519;if(null==k)throw new Error("JPEGQTables tag is missing");for(s=0;s<k.length;s++)for(M[I++]=255,M[I++]=219,M[I++]=0,M[I++]=67,M[I++]=s,h=0;h<64;h++)M[I++]=e[i+k[s]+h];for(u=0;u<2;u++){var P=t[0==u?"t520":"t521"];if(null==P)throw new Error((0==u?"JPEGDCTables":"JPEGACTables")+" tag is missing");for(s=0;s<P.length;s++){M[I++]=255,M[I++]=196;var T=19;for(h=0;h<16;h++)T+=e[i+P[s]+h];for(M[I++]=T>>>8,M[I++]=255&T,M[I++]=s|u<<4,h=0;h<16;h++)M[I++]=e[i+P[s]+h];for(h=0;h<T;h++)M[I++]=e[i+P[s]+16+h]}}if(M[I++]=255,M[I++]=192,M[I++]=0,M[I++]=8+3*x,M[I++]=8,M[I++]=t.height>>>8&255,M[I++]=255&t.height,M[I++]=t.width>>>8&255,M[I++]=255&t.width,M[I++]=x,1==x)M[I++]=1,M[I++]=17,M[I++]=0;else for(s=0;s<3;s++)M[I++]=s+1,M[I++]=0!=s?17:(15&_)<<4|15&w,M[I++]=s;null!=E&&0!=E[0]&&(M[I++]=255,M[I++]=221,M[I++]=0,M[I++]=4,M[I++]=E[0]>>>8&255,M[I++]=255&E[0]),a=new Uint8Array(M)}var S=-1;for(s=0;s<a.length-1;){if(255==a[s]&&192==a[s+1]){S=s;break}s++}if(-1==S){var A=new Uint8Array(a.length+10+3*x);A.set(a);var O=a.length;if(S=a.length,(a=A)[O++]=255,a[O++]=192,a[O++]=0,a[O++]=8+3*x,a[O++]=8,a[O++]=t.height>>>8&255,a[O++]=255&t.height,a[O++]=t.width>>>8&255,a[O++]=255&t.width,a[O++]=x,1==x)a[O++]=1,a[O++]=17,a[O++]=0;else for(s=0;s<3;s++)a[O++]=s+1,a[O++]=0!=s?17:(15&_)<<4|15&w,a[O++]=s}if(255==e[f]&&218==e[f+1]){var C=e[f+2]<<8|e[f+3];for((o=new Uint8Array(C+2))[0]=e[f],o[1]=e[f+1],o[2]=e[f+2],o[3]=e[f+3],s=0;s<C-2;s++)o[s+4]=e[f+s+4]}else{var D=0;if((o=new Uint8Array(8+2*x))[D++]=255,o[D++]=218,o[D++]=0,o[D++]=6+2*x,o[D++]=x,1==x)o[D++]=1,o[D++]=0;else for(s=0;s<3;s++)o[D++]=s+1,o[D++]=s<<4|s;o[D++]=0,o[D++]=63,o[D++]=0}return{jpegOffset:i,tables:a,sosMarker:o,sofPosition:S}},t.decode._decodeOldJPEG=function(e,i,r,n,a,o){var s,h,u,l=t.decode._decodeOldJPEGInit(e,i,r,n);if(null!=l.jpegOffset)for(s=r+n-l.jpegOffset,u=new Uint8Array(s),p=0;p<s;p++)u[p]=i[l.jpegOffset+p];else{for(h=l.tables.length,(u=new Uint8Array(h+l.sosMarker.length+n+2)).set(l.tables),u[l.sofPosition+5]=e.height>>>8&255,u[l.sofPosition+6]=255&e.height,u[l.sofPosition+7]=e.width>>>8&255,u[l.sofPosition+8]=255&e.width,255==i[r]&&i[r+1]==SOS||(u.set(l.sosMarker,bufoff),bufoff+=sosMarker.length),p=0;p<n;p++)u[bufoff++]=i[r+p];u[bufoff++]=255,u[bufoff++]=EOI}var c=new t.JpegDecoder;c.parse(u);for(var f=c.getData(c.width,c.height),p=0;p<f.length;p++)a[o+p]=f[p];6==e.t262[0]&&(e.t262[0]=2)},t.decode._decodePackBits=function(t,e,i,r,n){for(var a=new Int8Array(t.buffer),o=new Int8Array(r.buffer),s=e+i;e<s;){var h=a[e];if(e++,h>=0&&h<128)for(var u=0;u<h+1;u++)o[n]=a[e],n++,e++;if(h>=-127&&h<0){for(u=0;u<1-h;u++)o[n]=a[e],n++;e++}}},t.decode._decodeThunder=function(t,e,i,r,n){for(var a=[0,1,0,-1],o=[0,1,2,3,0,-3,-2,-1],s=e+i,h=2*n,u=0;e<s;){var l=t[e],c=l>>>6,f=63&l;if(e++,3==c&&(u=15&f,r[h>>>1]|=u<<4*(1-h&1),h++),0==c)for(var p=0;p<f;p++)r[h>>>1]|=u<<4*(1-h&1),h++;if(2==c)for(p=0;p<2;p++)4!=(d=f>>>3*(1-p)&7)&&(u+=o[d],r[h>>>1]|=u<<4*(1-h&1),h++);if(1==c)for(p=0;p<3;p++){var d;2!=(d=f>>>2*(2-p)&3)&&(u+=a[d],r[h>>>1]|=u<<4*(1-h&1),h++)}}},t.decode._dmap={1:0,"011":1,"000011":2,"0000011":3,"010":-1,"000010":-2,"0000010":-3},t.decode._lens=function(){var t=function(t,e,i,r){for(var n=0;n<e.length;n++)t[e[n]]=i+n*r},e="00110101,000111,0111,1000,1011,1100,1110,1111,10011,10100,00111,01000,001000,000011,110100,110101,101010,101011,0100111,0001100,0001000,0010111,0000011,0000100,0101000,0101011,0010011,0100100,0011000,00000010,00000011,00011010,00011011,00010010,00010011,00010100,00010101,00010110,00010111,00101000,00101001,00101010,00101011,00101100,00101101,00000100,00000101,00001010,00001011,01010010,01010011,01010100,01010101,00100100,00100101,01011000,01011001,01011010,01011011,01001010,01001011,00110010,00110011,00110100",i="0000110111,010,11,10,011,0011,0010,00011,000101,000100,0000100,0000101,0000111,00000100,00000111,000011000,0000010111,0000011000,0000001000,00001100111,00001101000,00001101100,00000110111,00000101000,00000010111,00000011000,000011001010,000011001011,000011001100,000011001101,000001101000,000001101001,000001101010,000001101011,000011010010,000011010011,000011010100,000011010101,000011010110,000011010111,000001101100,000001101101,000011011010,000011011011,000001010100,000001010101,000001010110,000001010111,000001100100,000001100101,000001010010,000001010011,000000100100,000000110111,000000111000,000000100111,000000101000,000001011000,000001011001,000000101011,000000101100,000001011010,000001100110,000001100111",r="11011,10010,010111,0110111,00110110,00110111,01100100,01100101,01101000,01100111,011001100,011001101,011010010,011010011,011010100,011010101,011010110,011010111,011011000,011011001,011011010,011011011,010011000,010011001,010011010,011000,010011011",n="0000001111,000011001000,000011001001,000001011011,000000110011,000000110100,000000110101,0000001101100,0000001101101,0000001001010,0000001001011,0000001001100,0000001001101,0000001110010,0000001110011,0000001110100,0000001110101,0000001110110,0000001110111,0000001010010,0000001010011,0000001010100,0000001010101,0000001011010,0000001011011,0000001100100,0000001100101",a="00000001000,00000001100,00000001101,000000010010,000000010011,000000010100,000000010101,000000010110,000000010111,000000011100,000000011101,000000011110,000000011111";e=e.split(","),i=i.split(","),r=r.split(","),n=n.split(","),a=a.split(",");var o={},s={};return t(o,e,0,1),t(o,r,64,64),t(o,a,1792,64),t(s,i,0,1),t(s,n,64,64),t(s,a,1792,64),[o,s]}(),t.decode._decodeG4=function(e,i,r,n,a,o,s){for(var h=t.decode,u=i<<3,l=0,c="",f=[],p=[],d=0;d<o;d++)p.push(0);p=h._makeDiff(p);for(var m=0,g=0,b=0,v=0,y=0,_=0,w="",x=0,E=8*Math.ceil(o/8);u>>>3<i+r;){b=h._findDiff(p,m+(0==m?0:1),1-y),v=h._findDiff(p,b,y);var I=0;if(1==s&&(I=e[u>>>3]>>>7-(7&u)&1),2==s&&(I=e[u>>>3]>>>(7&u)&1),u++,c+=I,"H"==w){if(null!=h._lens[y][c]){var M=h._lens[y][c];c="",l+=M,M<64&&(h._addNtimes(f,l,y),m+=l,y=1-y,l=0,0==--x&&(w=""))}}else"0001"==c&&(c="",h._addNtimes(f,v-m,y),m=v),"001"==c&&(c="",w="H",x=2),null!=h._dmap[c]&&(g=b+h._dmap[c],h._addNtimes(f,g-m,y),m=g,c="",y=1-y);f.length==o&&""==w&&(h._writeBits(f,n,8*a+_*E),y=0,_++,m=0,p=h._makeDiff(f),f=[])}},t.decode._findDiff=function(t,e,i){for(var r=0;r<t.length;r+=2)if(t[r]>=e&&t[r+1]==i)return t[r]},t.decode._makeDiff=function(t){var e=[];1==t[0]&&e.push(0,1);for(var i=1;i<t.length;i++)t[i-1]!=t[i]&&e.push(i,t[i]);return e.push(t.length,0,t.length,1),e},t.decode._decodeG3=function(e,i,r,n,a,o,s){for(var h=t.decode,u=i<<3,l=0,c="",f=[],p=[],d=0;d<o;d++)f.push(0);for(var m=0,g=0,b=0,v=0,y=0,_=-1,w="",x=0,E=!1,I=8*Math.ceil(o/8);u>>>3<i+r;){b=h._findDiff(p,m+(0==m?0:1),1-y),v=h._findDiff(p,b,y);var M=0;if(1==s&&(M=e[u>>>3]>>>7-(7&u)&1),2==s&&(M=e[u>>>3]>>>(7&u)&1),u++,c+=M,E){if(null!=h._lens[y][c]){var k=h._lens[y][c];c="",l+=k,k<64&&(h._addNtimes(f,l,y),y=1-y,l=0)}}else"H"==w?null!=h._lens[y][c]&&(k=h._lens[y][c],c="",l+=k,k<64&&(h._addNtimes(f,l,y),m+=l,y=1-y,l=0,0==--x&&(w=""))):("0001"==c&&(c="",h._addNtimes(f,v-m,y),m=v),"001"==c&&(c="",w="H",x=2),null!=h._dmap[c]&&(g=b+h._dmap[c],h._addNtimes(f,g-m,y),m=g,c="",y=1-y));c.endsWith("000000000001")&&(_>=0&&h._writeBits(f,n,8*a+_*I),1==s&&(E=1==(e[u>>>3]>>>7-(7&u)&1)),2==s&&(E=1==(e[u>>>3]>>>(7&u)&1)),u++,null==h._decodeG3.allow2D&&(h._decodeG3.allow2D=E),h._decodeG3.allow2D||(E=!0,u--),c="",y=0,_++,m=0,p=h._makeDiff(f),f=[])}f.length==o&&h._writeBits(f,n,8*a+_*I)},t.decode._addNtimes=function(t,e,i){for(var r=0;r<e;r++)t.push(i)},t.decode._writeBits=function(t,e,i){for(var r=0;r<t.length;r++)e[i+r>>>3]|=t[r]<<7-(i+r&7)},t.decode._decodeLZW=function(e,i,r,n){if(null==t.decode._lzwTab){for(var a=new Uint32Array(65535),o=new Uint16Array(65535),s=new Uint8Array(2e6),h=0;h<256;h++)s[h<<2]=h,a[h]=h<<2,o[h]=1;t.decode._lzwTab=[a,o,s]}for(var u=t.decode._copyData,l=t.decode._lzwTab[0],c=t.decode._lzwTab[1],f=(s=t.decode._lzwTab[2],258),p=1032,d=9,m=i<<3,g=0,b=0;g=(e[m>>>3]<<16|e[m+8>>>3]<<8|e[m+16>>>3])>>24-(7&m)-d&(1<<d)-1,m+=d,257!=g;){if(256==g){if(d=9,f=258,p=1032,g=(e[m>>>3]<<16|e[m+8>>>3]<<8|e[m+16>>>3])>>24-(7&m)-d&(1<<d)-1,m+=d,257==g)break;r[n]=g,n++}else if(g<f){var v=l[g],y=c[g];u(s,v,r,n,y),n+=y,b>=f?(l[f]=p,s[l[f]]=v[0],c[f]=1,p=p+1+3&-4,f++):(l[f]=p,u(s,l[b],s,p,_=c[b]),s[p+_]=s[v],_++,c[f]=_,f++,p=p+_+3&-4),f+1==1<<d&&d++}else{var _;b>=f?(l[f]=p,c[f]=0,f++):(l[f]=p,u(s,l[b],s,p,_=c[b]),s[p+_]=s[p],_++,c[f]=_,f++,u(s,p,r,n,_),n+=_,p=p+_+3&-4),f+1==1<<d&&d++}b=g}},t.decode._copyData=function(t,e,i,r,n){for(var a=0;a<n;a+=4)i[r+a]=t[e+a],i[r+a+1]=t[e+a+1],i[r+a+2]=t[e+a+2],i[r+a+3]=t[e+a+3]},t.tags={254:"NewSubfileType",255:"SubfileType",256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",266:"FillOrder",269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffset",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",285:"PageName",286:"XPosition",287:"YPosition",292:"T4Options",296:"ResolutionUnit",297:"PageNumber",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:"WhitePoint",319:"PrimaryChromaticities",320:"ColorMap",321:"HalftoneHints",322:"TileWidth",323:"TileLength",324:"TileOffset",325:"TileByteCounts",330:"SubIFDs",336:"DotRange",338:"ExtraSample",339:"SampleFormat",347:"JPEGTables",512:"JPEGProc",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",519:"JPEGQTables",520:"JPEGDCTables",521:"JPEGACTables",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite",700:"XMP",33421:"CFARepeatPatternDim",33422:"CFAPattern",33432:"Copyright",33434:"ExposureTime",33437:"FNumber",33723:"IPTC/NAA",34377:"Photoshop",34665:"ExifIFD",34675:"ICC Profile",34850:"ExposureProgram",34853:"GPSInfo",34855:"ISOSpeedRatings",34858:"TimeZoneOffset",34859:"SelfTimeMode",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37377:"ShutterSpeedValue",37378:"ApertureValue",37380:"ExposureBiasValue",37383:"MeteringMode",37385:"Flash",37386:"FocalLength",37390:"FocalPlaneXResolution",37391:"FocalPlaneYResolution",37392:"FocalPlaneResolutionUnit",37393:"ImageNumber",37398:"TIFF/EPStandardID",37399:"SensingMethod",37500:"MakerNote",37510:"UserComment",37724:"ImageSourceData",40092:"XPComment",40094:"XPKeywords",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelXDimension",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",50706:"DNGVersion",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50710:"CFAPlaneColor",50711:"CFALayout",50712:"LinearizationTable",50713:"BlackLevelRepeatDim",50714:"BlackLevel",50716:"BlackLevelDeltaV",50717:"WhiteLevel",50718:"DefaultScale",50719:"DefaultCropOrigin",50720:"DefaultCropSize",50733:"BayerGreenSplit",50738:"AntiAliasStrength",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50727:"AnalogBalance",50728:"AsShotNeutral",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"LensInfo",50739:"ShadowScale",50740:"DNGPrivateData",50741:"MakerNoteSafety",50778:"CalibrationIlluminant1",50779:"CalibrationIlluminant2",50780:"BestQualityScale",50781:"RawDataUniqueID",50827:"OriginalRawFileName",50829:"ActiveArea",50830:"MaskedAreas",50931:"CameraCalibrationSignature",50932:"ProfileCalibrationSignature",50935:"NoiseReductionApplied",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:"ProfileEmbedPolicy",50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50969:"PreviewSettingsDigest",50970:"PreviewColorSpace",50971:"PreviewDateTime",50972:"RawImageDigest",51008:"OpcodeList1",51009:"OpcodeList2",51022:"OpcodeList3",51041:"NoiseProfile",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualityFinalSize",51091:"OriginalDefaultCropSize",51125:"DefaultUserCrop"},t.ttypes={256:3,257:3,258:3,259:3,262:3,273:4,274:3,277:3,278:4,279:4,282:5,283:5,284:3,286:5,287:5,296:3,305:2,306:2,338:3,513:4,514:4,34665:4},t._readIFD=function(e,i,n,a){var o=e.readUshort(i,n);n+=2;var s={};a.push(s);for(var h=0;h<o;h++){var u=e.readUshort(i,n);n+=2;var l=e.readUshort(i,n);n+=2;var c=e.readUint(i,n);n+=4;var f=e.readUint(i,n);n+=4;var p=[];if(s["t"+u]=p,1==l||7==l)for(var d=0;d<c;d++)p.push(i[(c<5?n-4:f)+d]);if(2==l&&p.push(e.readASCII(i,c<5?n-4:f,c-1)),3==l)for(d=0;d<c;d++)p.push(e.readUshort(i,(c<3?n-4:f)+2*d));if(4==l)for(d=0;d<c;d++)p.push(e.readUint(i,(c<2?n-4:f)+4*d));if(5==l)for(d=0;d<c;d++)p.push(e.readUint(i,f+8*d)/e.readUint(i,f+8*d+4));if(8==l)for(d=0;d<c;d++)p.push(e.readShort(i,(c<3?n-4:f)+2*d));if(9==l)for(d=0;d<c;d++)p.push(e.readInt(i,(c<2?n-4:f)+4*d));if(10==l)for(d=0;d<c;d++)p.push(e.readInt(i,f+8*d)/e.readInt(i,f+8*d+4));if(11==l)for(d=0;d<c;d++)p.push(e.readFloat(i,f+4*d));if(12==l)for(d=0;d<c;d++)p.push(e.readDouble(i,f+8*d));if(0!=c&&0==p.length&&r("unknown TIFF tag type: ",l,"num:",c),330==u)for(d=0;d<c;d++)t._readIFD(e,i,p[d],a)}return n},t._writeIFD=function(e,i,r,n){var a=Object.keys(n);e.writeUshort(i,r,a.length);for(var o=(r+=2)+12*a.length+4,s=0;s<a.length;s++){var h=a[s],u=parseInt(h.slice(1)),l=t.ttypes[u];if(null==l)throw new Error("unknown type of tag: "+u);var c=n[h];2==l&&(c=c[0]+"\0");var f=c.length;e.writeUshort(i,r,u),r+=2,e.writeUshort(i,r,l),r+=2,e.writeUint(i,r,f);var p=[-1,1,1,2,4,8,0,0,0,0,0,0,8][l]*f,d=r+=4;if(p>4&&(e.writeUint(i,r,o),d=o),2==l&&e.writeASCII(i,d,c),3==l)for(var m=0;m<f;m++)e.writeUshort(i,d+2*m,c[m]);if(4==l)for(m=0;m<f;m++)e.writeUint(i,d+4*m,c[m]);if(5==l)for(m=0;m<f;m++)e.writeUint(i,d+8*m,Math.round(1e4*c[m])),e.writeUint(i,d+8*m+4,1e4);if(12==l)for(m=0;m<f;m++)e.writeDouble(i,d+8*m,c[m]);p>4&&(o+=p+=1&p),r+=4}return[r,o]},t.toRGBA8=function(t){var e=t.width,i=t.height,n=e*i,a=4*n,o=t.data,s=new Uint8Array(4*n),h=t.t262[0],u=t.t258?Math.min(32,t.t258[0]):1,l=t.isLE?1:0;if(0==h)for(var c=Math.ceil(u*e/8),f=0;f<i;f++){var p=f*c,d=f*e;if(1==u)for(var m=0;m<e;m++){var g=d+m<<2,b=o[p+(m>>3)]>>7-(7&m)&1;s[g]=s[g+1]=s[g+2]=255*(1-b),s[g+3]=255}if(4==u)for(m=0;m<e;m++)g=d+m<<2,b=o[p+(m>>1)]>>4-4*(1&m)&15,s[g]=s[g+1]=s[g+2]=17*(15-b),s[g+3]=255;if(8==u)for(m=0;m<e;m++)g=d+m<<2,b=o[p+m],s[g]=s[g+1]=s[g+2]=255-b,s[g+3]=255}else if(1==h)for(c=Math.ceil(u*e/8),f=0;f<i;f++){if(p=f*c,d=f*e,1==u)for(m=0;m<e;m++)g=d+m<<2,b=o[p+(m>>3)]>>7-(7&m)&1,s[g]=s[g+1]=s[g+2]=255*b,s[g+3]=255;if(2==u)for(m=0;m<e;m++)g=d+m<<2,b=o[p+(m>>2)]>>6-2*(3&m)&3,s[g]=s[g+1]=s[g+2]=85*b,s[g+3]=255;if(8==u)for(m=0;m<e;m++)g=d+m<<2,b=o[p+m],s[g]=s[g+1]=s[g+2]=b,s[g+3]=255;if(16==u)for(m=0;m<e;m++)g=d+m<<2,b=o[p+(2*m+l)],s[g]=s[g+1]=s[g+2]=Math.min(255,b),s[g+3]=255}else if(2==h)if(8==u)if(t.t338)if(t.t338[0]>0)for(m=0;m<a;m++)s[m]=o[m];else for(m=0;m<a;m+=4)s[m]=o[m],s[m+1]=o[m+1],s[m+2]=o[m+2],s[m+3]=255;else{if(4==(w=t.t258?t.t258.length:3))for(m=0;m<a;m++)s[m]=o[m];if(3==w)for(m=0;m<n;m++){var v=3*m;s[g=m<<2]=o[v],s[g+1]=o[v+1],s[g+2]=o[v+2],s[g+3]=255}}else for(m=0;m<n;m++)v=6*m,s[g=m<<2]=o[v],s[g+1]=o[v+2],s[g+2]=o[v+4],s[g+3]=255;else if(3==h){var y=t.t320;for(m=0;m<n;m++){g=m<<2;var _=o[m];s[g]=y[_]>>8,s[g+1]=y[256+_]>>8,s[g+2]=y[512+_]>>8,s[g+3]=255}}else if(5==h){var w,x=(w=t.t258?t.t258.length:4)>4?1:0;for(m=0;m<n;m++){g=m<<2;var E=m*w,I=255-o[E],M=255-o[E+1],k=255-o[E+2],P=(255-o[E+3])*(1/255);s[g]=~~(I*P+.5),s[g+1]=~~(M*P+.5),s[g+2]=~~(k*P+.5),s[g+3]=255*(1-x)+o[E+4]*x}}else r("Unknown Photometric interpretation: "+h);return s},t.replaceIMG=function(){for(var e=document.getElementsByTagName("img"),i=0;i<e.length;i++){var r=e[i],n=r.getAttribute("src");if(null!=n){var a=n.split(".").pop().toLowerCase();if("tif"==a||"tiff"==a){var o=new XMLHttpRequest;t._xhrs.push(o),t._imgs.push(r),o.open("GET",n),o.responseType="arraybuffer",o.onload=t._imgLoaded,o.send()}}}},t._xhrs=[],t._imgs=[],t._imgLoaded=function(e){var i=e.target.response,r=t.decode(i),n=r[0];t.decodeImages(i,r);var a=t.toRGBA8(n),o=n.width,s=n.height,h=t._xhrs.indexOf(e.target),u=t._imgs[h];t._xhrs.splice(h,1),t._imgs.splice(h,1);var l=document.createElement("canvas");l.width=o,l.height=s;for(var c=l.getContext("2d"),f=c.createImageData(o,s),p=0;p<a.length;p++)f.data[p]=a[p];c.putImageData(f,0,0);var d=["style","class","id"];for(p=0;p<d.length;p++)l.setAttribute(d[p],u.getAttribute(d[p]));u.parentNode.replaceChild(l,u)},t._binBE={nextZero:function(t,e){for(;0!=t[e];)e++;return e},readUshort:function(t,e){return t[e]<<8|t[e+1]},readShort:function(e,i){var r=t._binBE.ui8;return r[0]=e[i+1],r[1]=e[i+0],t._binBE.i16[0]},readInt:function(e,i){var r=t._binBE.ui8;return r[0]=e[i+3],r[1]=e[i+2],r[2]=e[i+1],r[3]=e[i+0],t._binBE.i32[0]},readUint:function(e,i){var r=t._binBE.ui8;return r[0]=e[i+3],r[1]=e[i+2],r[2]=e[i+1],r[3]=e[i+0],t._binBE.ui32[0]},readASCII:function(t,e,i){for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[e+n]);return r},readFloat:function(e,i){for(var r=t._binBE.ui8,n=0;n<4;n++)r[n]=e[i+3-n];return t._binBE.fl32[0]},readDouble:function(e,i){for(var r=t._binBE.ui8,n=0;n<8;n++)r[n]=e[i+7-n];return t._binBE.fl64[0]},writeUshort:function(t,e,i){t[e]=i>>8&255,t[e+1]=255&i},writeUint:function(t,e,i){t[e]=i>>24&255,t[e+1]=i>>16&255,t[e+2]=i>>8&255,t[e+3]=i>>0&255},writeASCII:function(t,e,i){for(var r=0;r<i.length;r++)t[e+r]=i.charCodeAt(r)},writeDouble:function(e,i,r){t._binBE.fl64[0]=r;for(var n=0;n<8;n++)e[i+n]=t._binBE.ui8[7-n]}},t._binBE.ui8=new Uint8Array(8),t._binBE.i16=new Int16Array(t._binBE.ui8.buffer),t._binBE.i32=new Int32Array(t._binBE.ui8.buffer),t._binBE.ui32=new Uint32Array(t._binBE.ui8.buffer),t._binBE.fl32=new Float32Array(t._binBE.ui8.buffer),t._binBE.fl64=new Float64Array(t._binBE.ui8.buffer),t._binLE={nextZero:t._binBE.nextZero,readUshort:function(t,e){return t[e+1]<<8|t[e]},readShort:function(e,i){var r=t._binBE.ui8;return r[0]=e[i+0],r[1]=e[i+1],t._binBE.i16[0]},readInt:function(e,i){var r=t._binBE.ui8;return r[0]=e[i+0],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t._binBE.i32[0]},readUint:function(e,i){var r=t._binBE.ui8;return r[0]=e[i+0],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t._binBE.ui32[0]},readASCII:t._binBE.readASCII,readFloat:function(e,i){for(var r=t._binBE.ui8,n=0;n<4;n++)r[n]=e[i+n];return t._binBE.fl32[0]},readDouble:function(e,i){for(var r=t._binBE.ui8,n=0;n<8;n++)r[n]=e[i+n];return t._binBE.fl64[0]}},t._copyTile=function(t,e,i,r,n,a,o,s){for(var h=Math.min(e,n-o),u=Math.min(i,a-s),l=0;l<u;l++)for(var c=(s+l)*n+o,f=l*e,p=0;p<h;p++)r[c+p]=t[f+p]}}(e,i(9591))}()},306:function(t,e){(function(){"use strict";e.stripBOM=function(t){return"\ufeff"===t[0]?t.substring(1):t}}).call(this)},5396:function(t,e,i){(function(){"use strict";var t,r,n,a,o,s={}.hasOwnProperty;t=i(5532),r=i(8381).defaults,a=function(t){return"string"==typeof t&&(t.indexOf("&")>=0||t.indexOf(">")>=0||t.indexOf("<")>=0)},o=function(t){return"<![CDATA["+n(t)+"]]>"},n=function(t){return t.replace("]]>","]]]]><![CDATA[>")},e.Builder=function(){function e(t){var e,i,n;for(e in this.options={},i=r[.2])s.call(i,e)&&(n=i[e],this.options[e]=n);for(e in t)s.call(t,e)&&(n=t[e],this.options[e]=n)}return e.prototype.buildObject=function(e){var i,n,h,u,l,c;return i=this.options.attrkey,n=this.options.charkey,1===Object.keys(e).length&&this.options.rootName===r[.2].rootName?e=e[l=Object.keys(e)[0]]:l=this.options.rootName,c=this,h=function(t,e){var r,u,l,f,p,d;if("object"!=typeof e)c.options.cdata&&a(e)?t.raw(o(e)):t.txt(e);else if(Array.isArray(e)){for(f in e)if(s.call(e,f))for(p in u=e[f])l=u[p],t=h(t.ele(p),l).up()}else for(p in e)if(s.call(e,p))if(u=e[p],p===i){if("object"==typeof u)for(r in u)d=u[r],t=t.att(r,d)}else if(p===n)t=c.options.cdata&&a(u)?t.raw(o(u)):t.txt(u);else if(Array.isArray(u))for(f in u)s.call(u,f)&&(t="string"==typeof(l=u[f])?c.options.cdata&&a(l)?t.ele(p).raw(o(l)).up():t.ele(p,l).up():h(t.ele(p),l).up());else"object"==typeof u?t=h(t.ele(p),u).up():"string"==typeof u&&c.options.cdata&&a(u)?t=t.ele(p).raw(o(u)).up():(null==u&&(u=""),t=t.ele(p,u.toString()).up());return t},u=t.create(l,this.options.xmldec,this.options.doctype,{headless:this.options.headless,allowSurrogateChars:this.options.allowSurrogateChars}),h(u,e).end(this.options.renderOpts)},e}()}).call(this)},8381:function(t,e){(function(){e.defaults={.1:{explicitCharkey:!1,trim:!0,normalize:!0,normalizeTags:!1,attrkey:"@",charkey:"#",explicitArray:!1,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!1,validator:null,xmlns:!1,explicitChildren:!1,childkey:"@@",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,emptyTag:""},.2:{explicitCharkey:!1,trim:!1,normalize:!1,normalizeTags:!1,attrkey:"$",charkey:"_",explicitArray:!0,ignoreAttrs:!1,mergeAttrs:!1,explicitRoot:!0,validator:null,xmlns:!1,explicitChildren:!1,preserveChildrenOrder:!1,childkey:"$$",charsAsChildren:!1,includeWhiteChars:!1,async:!1,strict:!0,attrNameProcessors:null,attrValueProcessors:null,tagNameProcessors:null,valueProcessors:null,rootName:"root",xmldec:{version:"1.0",encoding:"UTF-8",standalone:!0},doctype:null,renderOpts:{pretty:!0,indent:" ",newline:"\n"},headless:!1,chunkSize:1e4,emptyTag:"",cdata:!1}}}).call(this)},9082:function(t,e,i){(function(){"use strict";var t,r,n,a,o,s,h,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;h=i(6099),n=i(8614),t=i(306),s=i(7526),u=i(8213).setImmediate,r=i(8381).defaults,a=function(t){return"object"==typeof t&&null!=t&&0===Object.keys(t).length},o=function(t,e,i){var r,n;for(r=0,n=t.length;r<n;r++)e=(0,t[r])(e,i);return e},e.Parser=function(i){function n(t){var i,n,a;if(this.parseStringPromise=l(this.parseStringPromise,this),this.parseString=l(this.parseString,this),this.reset=l(this.reset,this),this.assignOrPush=l(this.assignOrPush,this),this.processAsync=l(this.processAsync,this),!(this instanceof e.Parser))return new e.Parser(t);for(i in this.options={},n=r[.2])c.call(n,i)&&(a=n[i],this.options[i]=a);for(i in t)c.call(t,i)&&(a=t[i],this.options[i]=a);this.options.xmlns&&(this.options.xmlnskey=this.options.attrkey+"ns"),this.options.normalizeTags&&(this.options.tagNameProcessors||(this.options.tagNameProcessors=[]),this.options.tagNameProcessors.unshift(s.normalize)),this.reset()}return function(t,e){for(var i in e)c.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(n,i),n.prototype.processAsync=function(){var t,e;try{return this.remaining.length<=this.options.chunkSize?(t=this.remaining,this.remaining="",this.saxParser=this.saxParser.write(t),this.saxParser.close()):(t=this.remaining.substr(0,this.options.chunkSize),this.remaining=this.remaining.substr(this.options.chunkSize,this.remaining.length),this.saxParser=this.saxParser.write(t),u(this.processAsync))}catch(t){if(e=t,!this.saxParser.errThrown)return this.saxParser.errThrown=!0,this.emit(e)}},n.prototype.assignOrPush=function(t,e,i){return e in t?(t[e]instanceof Array||(t[e]=[t[e]]),t[e].push(i)):this.options.explicitArray?t[e]=[i]:t[e]=i},n.prototype.reset=function(){var t,e,i,r,n;return this.removeAllListeners(),this.saxParser=h.parser(this.options.strict,{trim:!1,normalize:!1,xmlns:this.options.xmlns}),this.saxParser.errThrown=!1,this.saxParser.onerror=(n=this,function(t){if(n.saxParser.resume(),!n.saxParser.errThrown)return n.saxParser.errThrown=!0,n.emit("error",t)}),this.saxParser.onend=function(t){return function(){if(!t.saxParser.ended)return t.saxParser.ended=!0,t.emit("end",t.resultObject)}}(this),this.saxParser.ended=!1,this.EXPLICIT_CHARKEY=this.options.explicitCharkey,this.resultObject=null,r=[],t=this.options.attrkey,e=this.options.charkey,this.saxParser.onopentag=function(i){return function(n){var a,s,h,u,l;if((h={})[e]="",!i.options.ignoreAttrs)for(a in l=n.attributes)c.call(l,a)&&(t in h||i.options.mergeAttrs||(h[t]={}),s=i.options.attrValueProcessors?o(i.options.attrValueProcessors,n.attributes[a],a):n.attributes[a],u=i.options.attrNameProcessors?o(i.options.attrNameProcessors,a):a,i.options.mergeAttrs?i.assignOrPush(h,u,s):h[t][u]=s);return h["#name"]=i.options.tagNameProcessors?o(i.options.tagNameProcessors,n.name):n.name,i.options.xmlns&&(h[i.options.xmlnskey]={uri:n.uri,local:n.local}),r.push(h)}}(this),this.saxParser.onclosetag=function(t){return function(){var i,n,s,h,u,l,f,p,d,m;if(l=r.pop(),u=l["#name"],t.options.explicitChildren&&t.options.preserveChildrenOrder||delete l["#name"],!0===l.cdata&&(i=l.cdata,delete l.cdata),d=r[r.length-1],l[e].match(/^\s*$/)&&!i?(n=l[e],delete l[e]):(t.options.trim&&(l[e]=l[e].trim()),t.options.normalize&&(l[e]=l[e].replace(/\s{2,}/g," ").trim()),l[e]=t.options.valueProcessors?o(t.options.valueProcessors,l[e],u):l[e],1===Object.keys(l).length&&e in l&&!t.EXPLICIT_CHARKEY&&(l=l[e])),a(l)&&(l=""!==t.options.emptyTag?t.options.emptyTag:n),null!=t.options.validator&&(m="/"+function(){var t,e,i;for(i=[],t=0,e=r.length;t<e;t++)h=r[t],i.push(h["#name"]);return i}().concat(u).join("/"),function(){var e;try{l=t.options.validator(m,d&&d[u],l)}catch(i){return e=i,t.emit("error",e)}}()),t.options.explicitChildren&&!t.options.mergeAttrs&&"object"==typeof l)if(t.options.preserveChildrenOrder){if(d){for(s in d[t.options.childkey]=d[t.options.childkey]||[],f={},l)c.call(l,s)&&(f[s]=l[s]);d[t.options.childkey].push(f),delete l["#name"],1===Object.keys(l).length&&e in l&&!t.EXPLICIT_CHARKEY&&(l=l[e])}}else h={},t.options.attrkey in l&&(h[t.options.attrkey]=l[t.options.attrkey],delete l[t.options.attrkey]),!t.options.charsAsChildren&&t.options.charkey in l&&(h[t.options.charkey]=l[t.options.charkey],delete l[t.options.charkey]),Object.getOwnPropertyNames(l).length>0&&(h[t.options.childkey]=l),l=h;return r.length>0?t.assignOrPush(d,u,l):(t.options.explicitRoot&&(p=l,(l={})[u]=p),t.resultObject=l,t.saxParser.ended=!0,t.emit("end",t.resultObject))}}(this),i=function(t){return function(i){var n,a;if(a=r[r.length-1])return a[e]+=i,t.options.explicitChildren&&t.options.preserveChildrenOrder&&t.options.charsAsChildren&&(t.options.includeWhiteChars||""!==i.replace(/\\n/g,"").trim())&&(a[t.options.childkey]=a[t.options.childkey]||[],(n={"#name":"__text__"})[e]=i,t.options.normalize&&(n[e]=n[e].replace(/\s{2,}/g," ").trim()),a[t.options.childkey].push(n)),a}}(this),this.saxParser.ontext=i,this.saxParser.oncdata=function(t){var e;if(e=i(t))return e.cdata=!0}},n.prototype.parseString=function(e,i){var r;null!=i&&"function"==typeof i&&(this.on("end",(function(t){return this.reset(),i(null,t)})),this.on("error",(function(t){return this.reset(),i(t)})));try{return""===(e=e.toString()).trim()?(this.emit("end",null),!0):(e=t.stripBOM(e),this.options.async?(this.remaining=e,u(this.processAsync),this.saxParser):this.saxParser.write(e).close())}catch(t){if(r=t,!this.saxParser.errThrown&&!this.saxParser.ended)return this.emit("error",r),this.saxParser.errThrown=!0;if(this.saxParser.ended)throw r}},n.prototype.parseStringPromise=function(t){return new Promise((e=this,function(i,r){return e.parseString(t,(function(t,e){return t?r(t):i(e)}))}));var e},n}(n),e.parseString=function(t,i,r){var n,a;return null!=r?("function"==typeof r&&(n=r),"object"==typeof i&&(a=i)):("function"==typeof i&&(n=i),a={}),new e.Parser(a).parseString(t,n)},e.parseStringPromise=function(t,i){var r;return"object"==typeof i&&(r=i),new e.Parser(r).parseStringPromise(t)}}).call(this)},7526:function(t,e){(function(){"use strict";var t;t=new RegExp(/(?!xmlns)^.*:/),e.normalize=function(t){return t.toLowerCase()},e.firstCharLowerCase=function(t){return t.charAt(0).toLowerCase()+t.slice(1)},e.stripPrefix=function(e){return e.replace(t,"")},e.parseNumbers=function(t){return isNaN(t)||(t=t%1==0?parseInt(t,10):parseFloat(t)),t},e.parseBooleans=function(t){return/^(?:true|false)$/i.test(t)&&(t="true"===t.toLowerCase()),t}}).call(this)},5055:function(t,e,i){(function(){"use strict";var t,r,n,a,o={}.hasOwnProperty;r=i(8381),t=i(5396),n=i(9082),a=i(7526),e.defaults=r.defaults,e.processors=a,e.ValidationError=function(t){function e(t){this.message=t}return function(t,e){for(var i in e)o.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(e,Error),e}(),e.Builder=t.Builder,e.Parser=n.Parser,e.parseString=n.parseString,e.parseStringPromise=n.parseStringPromise}).call(this)},7557:function(t){(function(){t.exports={Disconnected:1,Preceding:2,Following:4,Contains:8,ContainedBy:16,ImplementationSpecific:32}}).call(this)},9335:function(t){(function(){t.exports={Element:1,Attribute:2,Text:3,CData:4,EntityReference:5,EntityDeclaration:6,ProcessingInstruction:7,Comment:8,Document:9,DocType:10,DocumentFragment:11,NotationDeclaration:12,Declaration:201,Raw:202,AttributeDeclaration:203,ElementDeclaration:204,Dummy:205}}).call(this)},8369:function(t){(function(){var e,i,r,n,a,o,s,h=[].slice,u={}.hasOwnProperty;e=function(){var t,e,i,r,n,o;if(o=arguments[0],n=2<=arguments.length?h.call(arguments,1):[],a(Object.assign))Object.assign.apply(null,arguments);else for(t=0,i=n.length;t<i;t++)if(null!=(r=n[t]))for(e in r)u.call(r,e)&&(o[e]=r[e]);return o},a=function(t){return!!t&&"[object Function]"===Object.prototype.toString.call(t)},o=function(t){var e;return!!t&&("function"==(e=typeof t)||"object"===e)},r=function(t){return a(Array.isArray)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)},n=function(t){var e;if(r(t))return!t.length;for(e in t)if(u.call(t,e))return!1;return!0},s=function(t){var e,i;return o(t)&&(i=Object.getPrototypeOf(t))&&(e=i.constructor)&&"function"==typeof e&&e instanceof e&&Function.prototype.toString.call(e)===Function.prototype.toString.call(Object)},i=function(t){return a(t.valueOf)?t.valueOf():t},t.exports.assign=e,t.exports.isFunction=a,t.exports.isObject=o,t.exports.isArray=r,t.exports.isEmpty=n,t.exports.isPlainObject=s,t.exports.getValue=i}).call(this)},594:function(t){(function(){t.exports={None:0,OpenTag:1,InsideTag:2,CloseTag:3}}).call(this)},2750:function(t,e,i){(function(){var e;e=i(9335),i(2026),t.exports=function(){function t(t,i,r){if(this.parent=t,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),null==i)throw new Error("Missing attribute name. "+this.debugInfo(i));this.name=this.stringify.name(i),this.value=this.stringify.attValue(r),this.type=e.Attribute,this.isId=!1,this.schemaTypeInfo=null}return Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(t.prototype,"ownerElement",{get:function(){return this.parent}}),Object.defineProperty(t.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(t.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(t.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(t.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(t.prototype,"specified",{get:function(){return!0}}),t.prototype.clone=function(){return Object.create(this)},t.prototype.toString=function(t){return this.options.writer.attribute(this,this.options.writer.filterOptions(t))},t.prototype.debugInfo=function(t){return null==(t=t||this.name)?"parent: <"+this.parent.name+">":"attribute: {"+t+"}, parent: <"+this.parent.name+">"},t.prototype.isEqualNode=function(t){return t.namespaceURI===this.namespaceURI&&t.prefix===this.prefix&&t.localName===this.localName&&t.value===this.value},t}()}).call(this)},6170:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;e=i(9335),r=i(6488),t.exports=function(t){function i(t,r){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing CDATA text. "+this.debugInfo());this.name="#cdata-section",this.type=e.CData,this.value=this.stringify.cdata(r)}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(t){return this.options.writer.cdata(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},6488:function(t,e,i){(function(){var e,r={}.hasOwnProperty;e=i(2026),t.exports=function(t){function e(t){e.__super__.constructor.call(this,t),this.value=""}return function(t,e){for(var i in e)r.call(e,i)&&(t[i]=e[i]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,t),Object.defineProperty(e.prototype,"data",{get:function(){return this.value},set:function(t){return this.value=t||""}}),Object.defineProperty(e.prototype,"length",{get:function(){return this.value.length}}),Object.defineProperty(e.prototype,"textContent",{get:function(){return this.value},set:function(t){return this.value=t||""}}),e.prototype.clone=function(){return Object.create(this)},e.prototype.substringData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.appendData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.insertData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.deleteData=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.replaceData=function(t,e,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},e.prototype.isEqualNode=function(t){return!!e.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)&&t.data===this.data},e}(e)}).call(this)},2096:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;e=i(9335),r=i(6488),t.exports=function(t){function i(t,r){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing comment text. "+this.debugInfo());this.name="#comment",this.type=e.Comment,this.value=this.stringify.comment(r)}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(t){return this.options.writer.comment(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},383:function(t,e,i){(function(){var e,r;e=i(3933),r=i(6210),t.exports=function(){function t(){this.defaultParams={"canonical-form":!1,"cdata-sections":!1,comments:!1,"datatype-normalization":!1,"element-content-whitespace":!0,entities:!0,"error-handler":new e,infoset:!0,"validate-if-schema":!1,namespaces:!0,"namespace-declarations":!0,"normalize-characters":!1,"schema-location":"","schema-type":"","split-cdata-sections":!0,validate:!1,"well-formed":!0},this.params=Object.create(this.defaultParams)}return Object.defineProperty(t.prototype,"parameterNames",{get:function(){return new r(Object.keys(this.defaultParams))}}),t.prototype.getParameter=function(t){return this.params.hasOwnProperty(t)?this.params[t]:null},t.prototype.canSetParameter=function(t,e){return!0},t.prototype.setParameter=function(t,e){return null!=e?this.params[t]=e:delete this.params[t]},t}()}).call(this)},3933:function(t){(function(){t.exports=function(){function t(){}return t.prototype.handleError=function(t){throw new Error(t)},t}()}).call(this)},1770:function(t){(function(){t.exports=function(){function t(){}return t.prototype.hasFeature=function(t,e){return!0},t.prototype.createDocumentType=function(t,e,i){throw new Error("This DOM method is not implemented.")},t.prototype.createDocument=function(t,e,i){throw new Error("This DOM method is not implemented.")},t.prototype.createHTMLDocument=function(t){throw new Error("This DOM method is not implemented.")},t.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented.")},t}()}).call(this)},6210:function(t){(function(){t.exports=function(){function t(t){this.arr=t||[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this.arr.length}}),t.prototype.item=function(t){return this.arr[t]||null},t.prototype.contains=function(t){return-1!==this.arr.indexOf(t)},t}()}).call(this)},1179:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;r=i(2026),e=i(9335),t.exports=function(t){function i(t,r,n,a,o,s){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());if(null==n)throw new Error("Missing DTD attribute name. "+this.debugInfo(r));if(!a)throw new Error("Missing DTD attribute type. "+this.debugInfo(r));if(!o)throw new Error("Missing DTD attribute default. "+this.debugInfo(r));if(0!==o.indexOf("#")&&(o="#"+o),!o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/))throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT. "+this.debugInfo(r));if(s&&!o.match(/^(#FIXED|#DEFAULT)$/))throw new Error("Default value only applies to #FIXED or #DEFAULT. "+this.debugInfo(r));this.elementName=this.stringify.name(r),this.type=e.AttributeDeclaration,this.attributeName=this.stringify.name(n),this.attributeType=this.stringify.dtdAttType(a),s&&(this.defaultValue=this.stringify.dtdAttDefault(s)),this.defaultValueType=o}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.toString=function(t){return this.options.writer.dtdAttList(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},6347:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;r=i(2026),e=i(9335),t.exports=function(t){function i(t,r,n){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD element name. "+this.debugInfo());n||(n="(#PCDATA)"),Array.isArray(n)&&(n="("+n.join(",")+")"),this.name=this.stringify.name(r),this.type=e.ElementDeclaration,this.value=this.stringify.dtdElementValue(n)}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.toString=function(t){return this.options.writer.dtdElement(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},9078:function(t,e,i){(function(){var e,r,n,a={}.hasOwnProperty;n=i(8369).isObject,r=i(2026),e=i(9335),t.exports=function(t){function i(t,r,a,o){if(i.__super__.constructor.call(this,t),null==a)throw new Error("Missing DTD entity name. "+this.debugInfo(a));if(null==o)throw new Error("Missing DTD entity value. "+this.debugInfo(a));if(this.pe=!!r,this.name=this.stringify.name(a),this.type=e.EntityDeclaration,n(o)){if(!o.pubID&&!o.sysID)throw new Error("Public and/or system identifiers are required for an external entity. "+this.debugInfo(a));if(o.pubID&&!o.sysID)throw new Error("System identifier is required for a public external entity. "+this.debugInfo(a));if(this.internal=!1,null!=o.pubID&&(this.pubID=this.stringify.dtdPubID(o.pubID)),null!=o.sysID&&(this.sysID=this.stringify.dtdSysID(o.sysID)),null!=o.nData&&(this.nData=this.stringify.dtdNData(o.nData)),this.pe&&this.nData)throw new Error("Notation declaration is not allowed in a parameter entity. "+this.debugInfo(a))}else this.value=this.stringify.dtdEntityValue(o),this.internal=!0}return function(t,e){for(var i in e)a.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(i.prototype,"notationName",{get:function(){return this.nData||null}}),Object.defineProperty(i.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"xmlVersion",{get:function(){return null}}),i.prototype.toString=function(t){return this.options.writer.dtdEntity(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},4777:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;r=i(2026),e=i(9335),t.exports=function(t){function i(t,r,n){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing DTD notation name. "+this.debugInfo(r));if(!n.pubID&&!n.sysID)throw new Error("Public or system identifiers are required for an external entity. "+this.debugInfo(r));this.name=this.stringify.name(r),this.type=e.NotationDeclaration,null!=n.pubID&&(this.pubID=this.stringify.dtdPubID(n.pubID)),null!=n.sysID&&(this.sysID=this.stringify.dtdSysID(n.sysID))}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),i.prototype.toString=function(t){return this.options.writer.dtdNotation(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},9077:function(t,e,i){(function(){var e,r,n,a={}.hasOwnProperty;n=i(8369).isObject,r=i(2026),e=i(9335),t.exports=function(t){function i(t,r,a,o){var s;i.__super__.constructor.call(this,t),n(r)&&(r=(s=r).version,a=s.encoding,o=s.standalone),r||(r="1.0"),this.type=e.Declaration,this.version=this.stringify.xmlVersion(r),null!=a&&(this.encoding=this.stringify.xmlEncoding(a)),null!=o&&(this.standalone=this.stringify.xmlStandalone(o))}return function(t,e){for(var i in e)a.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.toString=function(t){return this.options.writer.declaration(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},8225:function(t,e,i){(function(){var e,r,n,a,o,s,h,u,l={}.hasOwnProperty;u=i(8369).isObject,h=i(2026),e=i(9335),r=i(1179),a=i(9078),n=i(6347),o=i(4777),s=i(663),t.exports=function(t){function i(t,r,n){var a,o,s,h,l,c;if(i.__super__.constructor.call(this,t),this.type=e.DocType,t.children)for(o=0,s=(h=t.children).length;o<s;o++)if((a=h[o]).type===e.Element){this.name=a.name;break}this.documentObject=t,u(r)&&(r=(l=r).pubID,n=l.sysID),null==n&&(n=(c=[r,n])[0],r=c[1]),null!=r&&(this.pubID=this.stringify.dtdPubID(r)),null!=n&&(this.sysID=this.stringify.dtdSysID(n))}return function(t,e){for(var i in e)l.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),Object.defineProperty(i.prototype,"entities",{get:function(){var t,i,r,n,a;for(n={},i=0,r=(a=this.children).length;i<r;i++)(t=a[i]).type!==e.EntityDeclaration||t.pe||(n[t.name]=t);return new s(n)}}),Object.defineProperty(i.prototype,"notations",{get:function(){var t,i,r,n,a;for(n={},i=0,r=(a=this.children).length;i<r;i++)(t=a[i]).type===e.NotationDeclaration&&(n[t.name]=t);return new s(n)}}),Object.defineProperty(i.prototype,"publicId",{get:function(){return this.pubID}}),Object.defineProperty(i.prototype,"systemId",{get:function(){return this.sysID}}),Object.defineProperty(i.prototype,"internalSubset",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),i.prototype.element=function(t,e){var i;return i=new n(this,t,e),this.children.push(i),this},i.prototype.attList=function(t,e,i,n,a){var o;return o=new r(this,t,e,i,n,a),this.children.push(o),this},i.prototype.entity=function(t,e){var i;return i=new a(this,!1,t,e),this.children.push(i),this},i.prototype.pEntity=function(t,e){var i;return i=new a(this,!0,t,e),this.children.push(i),this},i.prototype.notation=function(t,e){var i;return i=new o(this,t,e),this.children.push(i),this},i.prototype.toString=function(t){return this.options.writer.docType(this,this.options.writer.filterOptions(t))},i.prototype.ele=function(t,e){return this.element(t,e)},i.prototype.att=function(t,e,i,r,n){return this.attList(t,e,i,r,n)},i.prototype.ent=function(t,e){return this.entity(t,e)},i.prototype.pent=function(t,e){return this.pEntity(t,e)},i.prototype.not=function(t,e){return this.notation(t,e)},i.prototype.up=function(){return this.root()||this.documentObject},i.prototype.isEqualNode=function(t){return!!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)&&t.name===this.name&&t.publicId===this.publicId&&t.systemId===this.systemId},i}(h)}).call(this)},6934:function(t,e,i){(function(){var e,r,n,a,o,s,h,u={}.hasOwnProperty;h=i(8369).isPlainObject,n=i(1770),r=i(383),a=i(2026),e=i(9335),s=i(5549),o=i(6434),t.exports=function(t){function i(t){i.__super__.constructor.call(this,null),this.name="#document",this.type=e.Document,this.documentURI=null,this.domConfig=new r,t||(t={}),t.writer||(t.writer=new o),this.options=t,this.stringify=new s(t)}return function(t,e){for(var i in e)u.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),Object.defineProperty(i.prototype,"implementation",{value:new n}),Object.defineProperty(i.prototype,"doctype",{get:function(){var t,i,r,n;for(i=0,r=(n=this.children).length;i<r;i++)if((t=n[i]).type===e.DocType)return t;return null}}),Object.defineProperty(i.prototype,"documentElement",{get:function(){return this.rootObject||null}}),Object.defineProperty(i.prototype,"inputEncoding",{get:function(){return null}}),Object.defineProperty(i.prototype,"strictErrorChecking",{get:function(){return!1}}),Object.defineProperty(i.prototype,"xmlEncoding",{get:function(){return 0!==this.children.length&&this.children[0].type===e.Declaration?this.children[0].encoding:null}}),Object.defineProperty(i.prototype,"xmlStandalone",{get:function(){return 0!==this.children.length&&this.children[0].type===e.Declaration&&"yes"===this.children[0].standalone}}),Object.defineProperty(i.prototype,"xmlVersion",{get:function(){return 0!==this.children.length&&this.children[0].type===e.Declaration?this.children[0].version:"1.0"}}),Object.defineProperty(i.prototype,"URL",{get:function(){return this.documentURI}}),Object.defineProperty(i.prototype,"origin",{get:function(){return null}}),Object.defineProperty(i.prototype,"compatMode",{get:function(){return null}}),Object.defineProperty(i.prototype,"characterSet",{get:function(){return null}}),Object.defineProperty(i.prototype,"contentType",{get:function(){return null}}),i.prototype.end=function(t){var e;return e={},t?h(t)&&(e=t,t=this.options.writer):t=this.options.writer,t.document(this,t.filterOptions(e))},i.prototype.toString=function(t){return this.options.writer.document(this,this.options.writer.filterOptions(t))},i.prototype.createElement=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createDocumentFragment=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createTextNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createComment=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createCDATASection=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createProcessingInstruction=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createAttribute=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createEntityReference=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.importNode=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createElementNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagNameNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementById=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.adoptNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.normalizeDocument=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.renameNode=function(t,e,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByClassName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createEvent=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createRange=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createNodeIterator=function(t,e,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.createTreeWalker=function(t,e,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(a)}).call(this)},9227:function(t,e,i){(function(){var e,r,n,a,o,s,h,u,l,c,f,p,d,m,g,b,v,y,_,w,x,E,I,M={}.hasOwnProperty;I=i(8369),x=I.isObject,w=I.isFunction,E=I.isPlainObject,_=I.getValue,e=i(9335),p=i(6934),d=i(2161),a=i(6170),o=i(2096),g=i(9406),y=i(3595),m=i(9181),c=i(9077),f=i(8225),s=i(1179),u=i(9078),h=i(6347),l=i(4777),n=i(2750),v=i(5549),b=i(6434),r=i(594),t.exports=function(){function t(t,i,r){var n;this.name="?xml",this.type=e.Document,t||(t={}),n={},t.writer?E(t.writer)&&(n=t.writer,t.writer=new b):t.writer=new b,this.options=t,this.writer=t.writer,this.writerOptions=this.writer.filterOptions(n),this.stringify=new v(t),this.onDataCallback=i||function(){},this.onEndCallback=r||function(){},this.currentNode=null,this.currentLevel=-1,this.openTags={},this.documentStarted=!1,this.documentCompleted=!1,this.root=null}return t.prototype.createChildNode=function(t){var i,r,n,a,o,s,h,u;switch(t.type){case e.CData:this.cdata(t.value);break;case e.Comment:this.comment(t.value);break;case e.Element:for(r in n={},h=t.attribs)M.call(h,r)&&(i=h[r],n[r]=i.value);this.node(t.name,n);break;case e.Dummy:this.dummy();break;case e.Raw:this.raw(t.value);break;case e.Text:this.text(t.value);break;case e.ProcessingInstruction:this.instruction(t.target,t.value);break;default:throw new Error("This XML node type is not supported in a JS object: "+t.constructor.name)}for(o=0,s=(u=t.children).length;o<s;o++)a=u[o],this.createChildNode(a),a.type===e.Element&&this.up();return this},t.prototype.dummy=function(){return this},t.prototype.node=function(t,e,i){var r;if(null==t)throw new Error("Missing node name.");if(this.root&&-1===this.currentLevel)throw new Error("Document can only have one root node. "+this.debugInfo(t));return this.openCurrent(),t=_(t),null==e&&(e={}),e=_(e),x(e)||(i=(r=[e,i])[0],e=r[1]),this.currentNode=new d(this,t,e),this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,null!=i&&this.text(i),this},t.prototype.element=function(t,i,r){var n,a,o,s,h,u;if(this.currentNode&&this.currentNode.type===e.DocType)this.dtdElement.apply(this,arguments);else if(Array.isArray(t)||x(t)||w(t))for(s=this.options.noValidation,this.options.noValidation=!0,(u=new p(this.options).element("TEMP_ROOT")).element(t),this.options.noValidation=s,a=0,o=(h=u.children).length;a<o;a++)n=h[a],this.createChildNode(n),n.type===e.Element&&this.up();else this.node(t,i,r);return this},t.prototype.attribute=function(t,e){var i,r;if(!this.currentNode||this.currentNode.children)throw new Error("att() can only be used immediately after an ele() call in callback mode. "+this.debugInfo(t));if(null!=t&&(t=_(t)),x(t))for(i in t)M.call(t,i)&&(r=t[i],this.attribute(i,r));else w(e)&&(e=e.apply()),this.options.keepNullAttributes&&null==e?this.currentNode.attribs[t]=new n(this,t,""):null!=e&&(this.currentNode.attribs[t]=new n(this,t,e));return this},t.prototype.text=function(t){var e;return this.openCurrent(),e=new y(this,t),this.onData(this.writer.text(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.cdata=function(t){var e;return this.openCurrent(),e=new a(this,t),this.onData(this.writer.cdata(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.comment=function(t){var e;return this.openCurrent(),e=new o(this,t),this.onData(this.writer.comment(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.raw=function(t){var e;return this.openCurrent(),e=new g(this,t),this.onData(this.writer.raw(e,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.instruction=function(t,e){var i,r,n,a,o;if(this.openCurrent(),null!=t&&(t=_(t)),null!=e&&(e=_(e)),Array.isArray(t))for(i=0,a=t.length;i<a;i++)r=t[i],this.instruction(r);else if(x(t))for(r in t)M.call(t,r)&&(n=t[r],this.instruction(r,n));else w(e)&&(e=e.apply()),o=new m(this,t,e),this.onData(this.writer.processingInstruction(o,this.writerOptions,this.currentLevel+1),this.currentLevel+1);return this},t.prototype.declaration=function(t,e,i){var r;if(this.openCurrent(),this.documentStarted)throw new Error("declaration() must be the first node.");return r=new c(this,t,e,i),this.onData(this.writer.declaration(r,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.doctype=function(t,e,i){if(this.openCurrent(),null==t)throw new Error("Missing root node name.");if(this.root)throw new Error("dtd() must come before the root node.");return this.currentNode=new f(this,e,i),this.currentNode.rootNodeName=t,this.currentNode.children=!1,this.currentLevel++,this.openTags[this.currentLevel]=this.currentNode,this},t.prototype.dtdElement=function(t,e){var i;return this.openCurrent(),i=new h(this,t,e),this.onData(this.writer.dtdElement(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.attList=function(t,e,i,r,n){var a;return this.openCurrent(),a=new s(this,t,e,i,r,n),this.onData(this.writer.dtdAttList(a,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.entity=function(t,e){var i;return this.openCurrent(),i=new u(this,!1,t,e),this.onData(this.writer.dtdEntity(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.pEntity=function(t,e){var i;return this.openCurrent(),i=new u(this,!0,t,e),this.onData(this.writer.dtdEntity(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.notation=function(t,e){var i;return this.openCurrent(),i=new l(this,t,e),this.onData(this.writer.dtdNotation(i,this.writerOptions,this.currentLevel+1),this.currentLevel+1),this},t.prototype.up=function(){if(this.currentLevel<0)throw new Error("The document node has no parent.");return this.currentNode?(this.currentNode.children?this.closeNode(this.currentNode):this.openNode(this.currentNode),this.currentNode=null):this.closeNode(this.openTags[this.currentLevel]),delete this.openTags[this.currentLevel],this.currentLevel--,this},t.prototype.end=function(){for(;this.currentLevel>=0;)this.up();return this.onEnd()},t.prototype.openCurrent=function(){if(this.currentNode)return this.currentNode.children=!0,this.openNode(this.currentNode)},t.prototype.openNode=function(t){var i,n,a,o;if(!t.isOpen){if(this.root||0!==this.currentLevel||t.type!==e.Element||(this.root=t),n="",t.type===e.Element){for(a in this.writerOptions.state=r.OpenTag,n=this.writer.indent(t,this.writerOptions,this.currentLevel)+"<"+t.name,o=t.attribs)M.call(o,a)&&(i=o[a],n+=this.writer.attribute(i,this.writerOptions,this.currentLevel));n+=(t.children?">":"/>")+this.writer.endline(t,this.writerOptions,this.currentLevel),this.writerOptions.state=r.InsideTag}else this.writerOptions.state=r.OpenTag,n=this.writer.indent(t,this.writerOptions,this.currentLevel)+"<!DOCTYPE "+t.rootNodeName,t.pubID&&t.sysID?n+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(n+=' SYSTEM "'+t.sysID+'"'),t.children?(n+=" [",this.writerOptions.state=r.InsideTag):(this.writerOptions.state=r.CloseTag,n+=">"),n+=this.writer.endline(t,this.writerOptions,this.currentLevel);return this.onData(n,this.currentLevel),t.isOpen=!0}},t.prototype.closeNode=function(t){var i;if(!t.isClosed)return"",this.writerOptions.state=r.CloseTag,i=t.type===e.Element?this.writer.indent(t,this.writerOptions,this.currentLevel)+"</"+t.name+">"+this.writer.endline(t,this.writerOptions,this.currentLevel):this.writer.indent(t,this.writerOptions,this.currentLevel)+"]>"+this.writer.endline(t,this.writerOptions,this.currentLevel),this.writerOptions.state=r.None,this.onData(i,this.currentLevel),t.isClosed=!0},t.prototype.onData=function(t,e){return this.documentStarted=!0,this.onDataCallback(t,e+1)},t.prototype.onEnd=function(){return this.documentCompleted=!0,this.onEndCallback()},t.prototype.debugInfo=function(t){return null==t?"":"node: <"+t+">"},t.prototype.ele=function(){return this.element.apply(this,arguments)},t.prototype.nod=function(t,e,i){return this.node(t,e,i)},t.prototype.txt=function(t){return this.text(t)},t.prototype.dat=function(t){return this.cdata(t)},t.prototype.com=function(t){return this.comment(t)},t.prototype.ins=function(t,e){return this.instruction(t,e)},t.prototype.dec=function(t,e,i){return this.declaration(t,e,i)},t.prototype.dtd=function(t,e,i){return this.doctype(t,e,i)},t.prototype.e=function(t,e,i){return this.element(t,e,i)},t.prototype.n=function(t,e,i){return this.node(t,e,i)},t.prototype.t=function(t){return this.text(t)},t.prototype.d=function(t){return this.cdata(t)},t.prototype.c=function(t){return this.comment(t)},t.prototype.r=function(t){return this.raw(t)},t.prototype.i=function(t,e){return this.instruction(t,e)},t.prototype.att=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.a=function(){return this.currentNode&&this.currentNode.type===e.DocType?this.attList.apply(this,arguments):this.attribute.apply(this,arguments)},t.prototype.ent=function(t,e){return this.entity(t,e)},t.prototype.pent=function(t,e){return this.pEntity(t,e)},t.prototype.not=function(t,e){return this.notation(t,e)},t}()}).call(this)},8833:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;r=i(2026),e=i(9335),t.exports=function(t){function i(t){i.__super__.constructor.call(this,t),this.type=e.Dummy}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(t){return""},i}(r)}).call(this)},2161:function(t,e,i){(function(){var e,r,n,a,o,s,h,u,l={}.hasOwnProperty;u=i(8369),h=u.isObject,s=u.isFunction,o=u.getValue,a=i(2026),e=i(9335),r=i(2750),n=i(663),t.exports=function(t){function i(t,r,n){var a,o,s,h;if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing element name. "+this.debugInfo());if(this.name=this.stringify.name(r),this.type=e.Element,this.attribs={},this.schemaTypeInfo=null,null!=n&&this.attribute(n),t.type===e.Document&&(this.isRoot=!0,this.documentObject=t,t.rootObject=this,t.children))for(o=0,s=(h=t.children).length;o<s;o++)if((a=h[o]).type===e.DocType){a.name=this.name;break}}return function(t,e){for(var i in e)l.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),Object.defineProperty(i.prototype,"tagName",{get:function(){return this.name}}),Object.defineProperty(i.prototype,"namespaceURI",{get:function(){return""}}),Object.defineProperty(i.prototype,"prefix",{get:function(){return""}}),Object.defineProperty(i.prototype,"localName",{get:function(){return this.name}}),Object.defineProperty(i.prototype,"id",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"className",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"classList",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"attributes",{get:function(){return this.attributeMap&&this.attributeMap.nodes||(this.attributeMap=new n(this.attribs)),this.attributeMap}}),i.prototype.clone=function(){var t,e,i,r;for(e in(i=Object.create(this)).isRoot&&(i.documentObject=null),i.attribs={},r=this.attribs)l.call(r,e)&&(t=r[e],i.attribs[e]=t.clone());return i.children=[],this.children.forEach((function(t){var e;return(e=t.clone()).parent=i,i.children.push(e)})),i},i.prototype.attribute=function(t,e){var i,n;if(null!=t&&(t=o(t)),h(t))for(i in t)l.call(t,i)&&(n=t[i],this.attribute(i,n));else s(e)&&(e=e.apply()),this.options.keepNullAttributes&&null==e?this.attribs[t]=new r(this,t,""):null!=e&&(this.attribs[t]=new r(this,t,e));return this},i.prototype.removeAttribute=function(t){var e,i,r;if(null==t)throw new Error("Missing attribute name. "+this.debugInfo());if(t=o(t),Array.isArray(t))for(i=0,r=t.length;i<r;i++)e=t[i],delete this.attribs[e];else delete this.attribs[t];return this},i.prototype.toString=function(t){return this.options.writer.element(this,this.options.writer.filterOptions(t))},i.prototype.att=function(t,e){return this.attribute(t,e)},i.prototype.a=function(t,e){return this.attribute(t,e)},i.prototype.getAttribute=function(t){return this.attribs.hasOwnProperty(t)?this.attribs[t].value:null},i.prototype.setAttribute=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getAttributeNode=function(t){return this.attribs.hasOwnProperty(t)?this.attribs[t]:null},i.prototype.setAttributeNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.removeAttributeNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setAttributeNS=function(t,e,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.removeAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getAttributeNodeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setAttributeNodeNS=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagNameNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.hasAttribute=function(t){return this.attribs.hasOwnProperty(t)},i.prototype.hasAttributeNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setIdAttribute=function(t,e){return this.attribs.hasOwnProperty(t)?this.attribs[t].isId:e},i.prototype.setIdAttributeNS=function(t,e,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.setIdAttributeNode=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByTagNameNS=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.getElementsByClassName=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.isEqualNode=function(t){var e,r,n;if(!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(t))return!1;if(t.namespaceURI!==this.namespaceURI)return!1;if(t.prefix!==this.prefix)return!1;if(t.localName!==this.localName)return!1;if(t.attribs.length!==this.attribs.length)return!1;for(e=r=0,n=this.attribs.length-1;0<=n?r<=n:r>=n;e=0<=n?++r:--r)if(!this.attribs[e].isEqualNode(t.attribs[e]))return!1;return!0},i}(a)}).call(this)},663:function(t){(function(){t.exports=function(){function t(t){this.nodes=t}return Object.defineProperty(t.prototype,"length",{get:function(){return Object.keys(this.nodes).length||0}}),t.prototype.clone=function(){return this.nodes=null},t.prototype.getNamedItem=function(t){return this.nodes[t]},t.prototype.setNamedItem=function(t){var e;return e=this.nodes[t.nodeName],this.nodes[t.nodeName]=t,e||null},t.prototype.removeNamedItem=function(t){var e;return e=this.nodes[t],delete this.nodes[t],e||null},t.prototype.item=function(t){return this.nodes[Object.keys(this.nodes)[t]]||null},t.prototype.getNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},t.prototype.setNamedItemNS=function(t){throw new Error("This DOM method is not implemented.")},t.prototype.removeNamedItemNS=function(t,e){throw new Error("This DOM method is not implemented.")},t}()}).call(this)},2026:function(t,e,i){(function(){var e,r,n,a,o,s,h,u,l,c,f,p,d,m,g,b,v,y={}.hasOwnProperty;v=i(8369),b=v.isObject,g=v.isFunction,m=v.isEmpty,d=v.getValue,u=null,n=null,a=null,o=null,s=null,f=null,p=null,c=null,h=null,r=null,l=null,e=null,t.exports=function(){function t(t){this.parent=t,this.parent&&(this.options=this.parent.options,this.stringify=this.parent.stringify),this.value=null,this.children=[],this.baseURI=null,u||(u=i(2161),n=i(6170),a=i(2096),o=i(9077),s=i(8225),f=i(9406),p=i(3595),c=i(9181),h=i(8833),r=i(9335),l=i(2390),i(663),e=i(7557))}return Object.defineProperty(t.prototype,"nodeName",{get:function(){return this.name}}),Object.defineProperty(t.prototype,"nodeType",{get:function(){return this.type}}),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.value}}),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.parent}}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.childNodeList&&this.childNodeList.nodes||(this.childNodeList=new l(this.children)),this.childNodeList}}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.children[0]||null}}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null}}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){var t;return t=this.parent.children.indexOf(this),this.parent.children[t-1]||null}}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){var t;return t=this.parent.children.indexOf(this),this.parent.children[t+1]||null}}),Object.defineProperty(t.prototype,"ownerDocument",{get:function(){return this.document()||null}}),Object.defineProperty(t.prototype,"textContent",{get:function(){var t,e,i,n,a;if(this.nodeType===r.Element||this.nodeType===r.DocumentFragment){for(a="",e=0,i=(n=this.children).length;e<i;e++)(t=n[e]).textContent&&(a+=t.textContent);return a}return null},set:function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),t.prototype.setParent=function(t){var e,i,r,n,a;for(this.parent=t,t&&(this.options=t.options,this.stringify=t.stringify),a=[],i=0,r=(n=this.children).length;i<r;i++)e=n[i],a.push(e.setParent(this));return a},t.prototype.element=function(t,e,i){var r,n,a,o,s,h,u,l,c,f,p;if(h=null,null===e&&null==i&&(e=(c=[{},null])[0],i=c[1]),null==e&&(e={}),e=d(e),b(e)||(i=(f=[e,i])[0],e=f[1]),null!=t&&(t=d(t)),Array.isArray(t))for(a=0,u=t.length;a<u;a++)n=t[a],h=this.element(n);else if(g(t))h=this.element(t.apply());else if(b(t)){for(s in t)if(y.call(t,s))if(p=t[s],g(p)&&(p=p.apply()),!this.options.ignoreDecorators&&this.stringify.convertAttKey&&0===s.indexOf(this.stringify.convertAttKey))h=this.attribute(s.substr(this.stringify.convertAttKey.length),p);else if(!this.options.separateArrayItems&&Array.isArray(p)&&m(p))h=this.dummy();else if(b(p)&&m(p))h=this.element(s);else if(this.options.keepNullNodes||null!=p)if(!this.options.separateArrayItems&&Array.isArray(p))for(o=0,l=p.length;o<l;o++)n=p[o],(r={})[s]=n,h=this.element(r);else b(p)?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===s.indexOf(this.stringify.convertTextKey)?h=this.element(p):(h=this.element(s)).element(p):h=this.element(s,p);else h=this.dummy()}else h=this.options.keepNullNodes||null!==i?!this.options.ignoreDecorators&&this.stringify.convertTextKey&&0===t.indexOf(this.stringify.convertTextKey)?this.text(i):!this.options.ignoreDecorators&&this.stringify.convertCDataKey&&0===t.indexOf(this.stringify.convertCDataKey)?this.cdata(i):!this.options.ignoreDecorators&&this.stringify.convertCommentKey&&0===t.indexOf(this.stringify.convertCommentKey)?this.comment(i):!this.options.ignoreDecorators&&this.stringify.convertRawKey&&0===t.indexOf(this.stringify.convertRawKey)?this.raw(i):!this.options.ignoreDecorators&&this.stringify.convertPIKey&&0===t.indexOf(this.stringify.convertPIKey)?this.instruction(t.substr(this.stringify.convertPIKey.length),i):this.node(t,e,i):this.dummy();if(null==h)throw new Error("Could not create any elements with: "+t+". "+this.debugInfo());return h},t.prototype.insertBefore=function(t,e,i){var r,n,a,o,s;if(null!=t?t.type:void 0)return o=e,(a=t).setParent(this),o?(n=children.indexOf(o),s=children.splice(n),children.push(a),Array.prototype.push.apply(children,s)):children.push(a),a;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(t));return n=this.parent.children.indexOf(this),s=this.parent.children.splice(n),r=this.parent.element(t,e,i),Array.prototype.push.apply(this.parent.children,s),r},t.prototype.insertAfter=function(t,e,i){var r,n,a;if(this.isRoot)throw new Error("Cannot insert elements at root level. "+this.debugInfo(t));return n=this.parent.children.indexOf(this),a=this.parent.children.splice(n+1),r=this.parent.element(t,e,i),Array.prototype.push.apply(this.parent.children,a),r},t.prototype.remove=function(){var t;if(this.isRoot)throw new Error("Cannot remove the root element. "+this.debugInfo());return t=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[t,t-t+1].concat([])),this.parent},t.prototype.node=function(t,e,i){var r,n;return null!=t&&(t=d(t)),e||(e={}),e=d(e),b(e)||(i=(n=[e,i])[0],e=n[1]),r=new u(this,t,e),null!=i&&r.text(i),this.children.push(r),r},t.prototype.text=function(t){var e;return b(t)&&this.element(t),e=new p(this,t),this.children.push(e),this},t.prototype.cdata=function(t){var e;return e=new n(this,t),this.children.push(e),this},t.prototype.comment=function(t){var e;return e=new a(this,t),this.children.push(e),this},t.prototype.commentBefore=function(t){var e,i;return e=this.parent.children.indexOf(this),i=this.parent.children.splice(e),this.parent.comment(t),Array.prototype.push.apply(this.parent.children,i),this},t.prototype.commentAfter=function(t){var e,i;return e=this.parent.children.indexOf(this),i=this.parent.children.splice(e+1),this.parent.comment(t),Array.prototype.push.apply(this.parent.children,i),this},t.prototype.raw=function(t){var e;return e=new f(this,t),this.children.push(e),this},t.prototype.dummy=function(){return new h(this)},t.prototype.instruction=function(t,e){var i,r,n,a,o;if(null!=t&&(t=d(t)),null!=e&&(e=d(e)),Array.isArray(t))for(a=0,o=t.length;a<o;a++)i=t[a],this.instruction(i);else if(b(t))for(i in t)y.call(t,i)&&(r=t[i],this.instruction(i,r));else g(e)&&(e=e.apply()),n=new c(this,t,e),this.children.push(n);return this},t.prototype.instructionBefore=function(t,e){var i,r;return i=this.parent.children.indexOf(this),r=this.parent.children.splice(i),this.parent.instruction(t,e),Array.prototype.push.apply(this.parent.children,r),this},t.prototype.instructionAfter=function(t,e){var i,r;return i=this.parent.children.indexOf(this),r=this.parent.children.splice(i+1),this.parent.instruction(t,e),Array.prototype.push.apply(this.parent.children,r),this},t.prototype.declaration=function(t,e,i){var n,a;return n=this.document(),a=new o(n,t,e,i),0===n.children.length?n.children.unshift(a):n.children[0].type===r.Declaration?n.children[0]=a:n.children.unshift(a),n.root()||n},t.prototype.dtd=function(t,e){var i,n,a,o,h,u,l,c,f;for(i=this.document(),n=new s(i,t,e),a=o=0,u=(c=i.children).length;o<u;a=++o)if(c[a].type===r.DocType)return i.children[a]=n,n;for(a=h=0,l=(f=i.children).length;h<l;a=++h)if(f[a].isRoot)return i.children.splice(a,0,n),n;return i.children.push(n),n},t.prototype.up=function(){if(this.isRoot)throw new Error("The root node has no parent. Use doc() if you need to get the document object.");return this.parent},t.prototype.root=function(){var t;for(t=this;t;){if(t.type===r.Document)return t.rootObject;if(t.isRoot)return t;t=t.parent}},t.prototype.document=function(){var t;for(t=this;t;){if(t.type===r.Document)return t;t=t.parent}},t.prototype.end=function(t){return this.document().end(t)},t.prototype.prev=function(){var t;if((t=this.parent.children.indexOf(this))<1)throw new Error("Already at the first node. "+this.debugInfo());return this.parent.children[t-1]},t.prototype.next=function(){var t;if(-1===(t=this.parent.children.indexOf(this))||t===this.parent.children.length-1)throw new Error("Already at the last node. "+this.debugInfo());return this.parent.children[t+1]},t.prototype.importDocument=function(t){var e;return(e=t.root().clone()).parent=this,e.isRoot=!1,this.children.push(e),this},t.prototype.debugInfo=function(t){var e,i;return null!=(t=t||this.name)||(null!=(e=this.parent)?e.name:void 0)?null==t?"parent: <"+this.parent.name+">":(null!=(i=this.parent)?i.name:void 0)?"node: <"+t+">, parent: <"+this.parent.name+">":"node: <"+t+">":""},t.prototype.ele=function(t,e,i){return this.element(t,e,i)},t.prototype.nod=function(t,e,i){return this.node(t,e,i)},t.prototype.txt=function(t){return this.text(t)},t.prototype.dat=function(t){return this.cdata(t)},t.prototype.com=function(t){return this.comment(t)},t.prototype.ins=function(t,e){return this.instruction(t,e)},t.prototype.doc=function(){return this.document()},t.prototype.dec=function(t,e,i){return this.declaration(t,e,i)},t.prototype.e=function(t,e,i){return this.element(t,e,i)},t.prototype.n=function(t,e,i){return this.node(t,e,i)},t.prototype.t=function(t){return this.text(t)},t.prototype.d=function(t){return this.cdata(t)},t.prototype.c=function(t){return this.comment(t)},t.prototype.r=function(t){return this.raw(t)},t.prototype.i=function(t,e){return this.instruction(t,e)},t.prototype.u=function(){return this.up()},t.prototype.importXMLBuilder=function(t){return this.importDocument(t)},t.prototype.replaceChild=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.removeChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.appendChild=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.hasChildNodes=function(){return 0!==this.children.length},t.prototype.cloneNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.normalize=function(){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isSupported=function(t,e){return!0},t.prototype.hasAttributes=function(){return 0!==this.attribs.length},t.prototype.compareDocumentPosition=function(t){var i,r;return(i=this)===t?0:this.document()!==t.document()?(r=e.Disconnected|e.ImplementationSpecific,Math.random()<.5?r|=e.Preceding:r|=e.Following,r):i.isAncestor(t)?e.Contains|e.Preceding:i.isDescendant(t)?e.Contains|e.Following:i.isPreceding(t)?e.Preceding:e.Following},t.prototype.isSameNode=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.lookupPrefix=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isDefaultNamespace=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.lookupNamespaceURI=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.isEqualNode=function(t){var e,i,r;if(t.nodeType!==this.nodeType)return!1;if(t.children.length!==this.children.length)return!1;for(e=i=0,r=this.children.length-1;0<=r?i<=r:i>=r;e=0<=r?++i:--i)if(!this.children[e].isEqualNode(t.children[e]))return!1;return!0},t.prototype.getFeature=function(t,e){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.setUserData=function(t,e,i){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.getUserData=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},t.prototype.contains=function(t){return!!t&&(t===this||this.isDescendant(t))},t.prototype.isDescendant=function(t){var e,i,r,n;for(i=0,r=(n=this.children).length;i<r;i++){if(t===(e=n[i]))return!0;if(e.isDescendant(t))return!0}return!1},t.prototype.isAncestor=function(t){return t.isDescendant(this)},t.prototype.isPreceding=function(t){var e,i;return e=this.treePosition(t),i=this.treePosition(this),-1!==e&&-1!==i&&e<i},t.prototype.isFollowing=function(t){var e,i;return e=this.treePosition(t),i=this.treePosition(this),-1!==e&&-1!==i&&e>i},t.prototype.treePosition=function(t){var e,i;return i=0,e=!1,this.foreachTreeNode(this.document(),(function(r){if(i++,!e&&r===t)return e=!0})),e?i:-1},t.prototype.foreachTreeNode=function(t,e){var i,r,n,a,o;for(t||(t=this.document()),r=0,n=(a=t.children).length;r<n;r++){if(o=e(i=a[r]))return o;if(o=this.foreachTreeNode(i,e))return o}},t}()}).call(this)},2390:function(t){(function(){t.exports=function(){function t(t){this.nodes=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.nodes.length||0}}),t.prototype.clone=function(){return this.nodes=null},t.prototype.item=function(t){return this.nodes[t]||null},t}()}).call(this)},9181:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;e=i(9335),r=i(6488),t.exports=function(t){function i(t,r,n){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing instruction target. "+this.debugInfo());this.type=e.ProcessingInstruction,this.target=this.stringify.insTarget(r),this.name=this.target,n&&(this.value=this.stringify.insValue(n))}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(t){return this.options.writer.processingInstruction(this,this.options.writer.filterOptions(t))},i.prototype.isEqualNode=function(t){return!!i.__super__.isEqualNode.apply(this,arguments).isEqualNode(t)&&t.target===this.target},i}(r)}).call(this)},9406:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;e=i(9335),r=i(2026),t.exports=function(t){function i(t,r){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing raw text. "+this.debugInfo());this.type=e.Raw,this.value=this.stringify.raw(r)}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(t){return this.options.writer.raw(this,this.options.writer.filterOptions(t))},i}(r)}).call(this)},1996:function(t,e,i){(function(){var e,r,n,a={}.hasOwnProperty;e=i(9335),n=i(751),r=i(594),t.exports=function(t){function i(t,e){this.stream=t,i.__super__.constructor.call(this,e)}return function(t,e){for(var i in e)a.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),i.prototype.endline=function(t,e,n){return t.isLastRootNode&&e.state===r.CloseTag?"":i.__super__.endline.call(this,t,e,n)},i.prototype.document=function(t,e){var i,r,n,a,o,s,h,u,l;for(r=n=0,o=(h=t.children).length;n<o;r=++n)(i=h[r]).isLastRootNode=r===t.children.length-1;for(e=this.filterOptions(e),l=[],a=0,s=(u=t.children).length;a<s;a++)i=u[a],l.push(this.writeChildNode(i,e,0));return l},i.prototype.attribute=function(t,e,r){return this.stream.write(i.__super__.attribute.call(this,t,e,r))},i.prototype.cdata=function(t,e,r){return this.stream.write(i.__super__.cdata.call(this,t,e,r))},i.prototype.comment=function(t,e,r){return this.stream.write(i.__super__.comment.call(this,t,e,r))},i.prototype.declaration=function(t,e,r){return this.stream.write(i.__super__.declaration.call(this,t,e,r))},i.prototype.docType=function(t,e,i){var n,a,o,s;if(i||(i=0),this.openNode(t,e,i),e.state=r.OpenTag,this.stream.write(this.indent(t,e,i)),this.stream.write("<!DOCTYPE "+t.root().name),t.pubID&&t.sysID?this.stream.write(' PUBLIC "'+t.pubID+'" "'+t.sysID+'"'):t.sysID&&this.stream.write(' SYSTEM "'+t.sysID+'"'),t.children.length>0){for(this.stream.write(" ["),this.stream.write(this.endline(t,e,i)),e.state=r.InsideTag,a=0,o=(s=t.children).length;a<o;a++)n=s[a],this.writeChildNode(n,e,i+1);e.state=r.CloseTag,this.stream.write("]")}return e.state=r.CloseTag,this.stream.write(e.spaceBeforeSlash+">"),this.stream.write(this.endline(t,e,i)),e.state=r.None,this.closeNode(t,e,i)},i.prototype.element=function(t,i,n){var o,s,h,u,l,c,f,p,d;for(f in n||(n=0),this.openNode(t,i,n),i.state=r.OpenTag,this.stream.write(this.indent(t,i,n)+"<"+t.name),p=t.attribs)a.call(p,f)&&(o=p[f],this.attribute(o,i,n));if(u=0===(h=t.children.length)?null:t.children[0],0===h||t.children.every((function(t){return(t.type===e.Text||t.type===e.Raw)&&""===t.value})))i.allowEmpty?(this.stream.write(">"),i.state=r.CloseTag,this.stream.write("</"+t.name+">")):(i.state=r.CloseTag,this.stream.write(i.spaceBeforeSlash+"/>"));else if(!i.pretty||1!==h||u.type!==e.Text&&u.type!==e.Raw||null==u.value){for(this.stream.write(">"+this.endline(t,i,n)),i.state=r.InsideTag,l=0,c=(d=t.children).length;l<c;l++)s=d[l],this.writeChildNode(s,i,n+1);i.state=r.CloseTag,this.stream.write(this.indent(t,i,n)+"</"+t.name+">")}else this.stream.write(">"),i.state=r.InsideTag,i.suppressPrettyCount++,this.writeChildNode(u,i,n+1),i.suppressPrettyCount--,i.state=r.CloseTag,this.stream.write("</"+t.name+">");return this.stream.write(this.endline(t,i,n)),i.state=r.None,this.closeNode(t,i,n)},i.prototype.processingInstruction=function(t,e,r){return this.stream.write(i.__super__.processingInstruction.call(this,t,e,r))},i.prototype.raw=function(t,e,r){return this.stream.write(i.__super__.raw.call(this,t,e,r))},i.prototype.text=function(t,e,r){return this.stream.write(i.__super__.text.call(this,t,e,r))},i.prototype.dtdAttList=function(t,e,r){return this.stream.write(i.__super__.dtdAttList.call(this,t,e,r))},i.prototype.dtdElement=function(t,e,r){return this.stream.write(i.__super__.dtdElement.call(this,t,e,r))},i.prototype.dtdEntity=function(t,e,r){return this.stream.write(i.__super__.dtdEntity.call(this,t,e,r))},i.prototype.dtdNotation=function(t,e,r){return this.stream.write(i.__super__.dtdNotation.call(this,t,e,r))},i}(n)}).call(this)},6434:function(t,e,i){(function(){var e,r={}.hasOwnProperty;e=i(751),t.exports=function(t){function e(t){e.__super__.constructor.call(this,t)}return function(t,e){for(var i in e)r.call(e,i)&&(t[i]=e[i]);function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,t),e.prototype.document=function(t,e){var i,r,n,a,o;for(e=this.filterOptions(e),a="",r=0,n=(o=t.children).length;r<n;r++)i=o[r],a+=this.writeChildNode(i,e,0);return e.pretty&&a.slice(-e.newline.length)===e.newline&&(a=a.slice(0,-e.newline.length)),a},e}(e)}).call(this)},5549:function(t){(function(){var e=function(t,e){return function(){return t.apply(e,arguments)}},i={}.hasOwnProperty;t.exports=function(){function t(t){var r,n,a;for(r in this.assertLegalName=e(this.assertLegalName,this),this.assertLegalChar=e(this.assertLegalChar,this),t||(t={}),this.options=t,this.options.version||(this.options.version="1.0"),n=t.stringify||{})i.call(n,r)&&(a=n[r],this[r]=a)}return t.prototype.name=function(t){return this.options.noValidation?t:this.assertLegalName(""+t||"")},t.prototype.text=function(t){return this.options.noValidation?t:this.assertLegalChar(this.textEscape(""+t||""))},t.prototype.cdata=function(t){return this.options.noValidation?t:(t=(t=""+t||"").replace("]]>","]]]]><![CDATA[>"),this.assertLegalChar(t))},t.prototype.comment=function(t){if(this.options.noValidation)return t;if((t=""+t||"").match(/--/))throw new Error("Comment text cannot contain double-hypen: "+t);return this.assertLegalChar(t)},t.prototype.raw=function(t){return this.options.noValidation?t:""+t||""},t.prototype.attValue=function(t){return this.options.noValidation?t:this.assertLegalChar(this.attEscape(t=""+t||""))},t.prototype.insTarget=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.insValue=function(t){if(this.options.noValidation)return t;if((t=""+t||"").match(/\?>/))throw new Error("Invalid processing instruction value: "+t);return this.assertLegalChar(t)},t.prototype.xmlVersion=function(t){if(this.options.noValidation)return t;if(!(t=""+t||"").match(/1\.[0-9]+/))throw new Error("Invalid version number: "+t);return t},t.prototype.xmlEncoding=function(t){if(this.options.noValidation)return t;if(!(t=""+t||"").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/))throw new Error("Invalid encoding: "+t);return this.assertLegalChar(t)},t.prototype.xmlStandalone=function(t){return this.options.noValidation?t:t?"yes":"no"},t.prototype.dtdPubID=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdSysID=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdElementValue=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdAttType=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdAttDefault=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdEntityValue=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.dtdNData=function(t){return this.options.noValidation?t:this.assertLegalChar(""+t||"")},t.prototype.convertAttKey="@",t.prototype.convertPIKey="?",t.prototype.convertTextKey="#text",t.prototype.convertCDataKey="#cdata",t.prototype.convertCommentKey="#comment",t.prototype.convertRawKey="#raw",t.prototype.assertLegalChar=function(t){var e,i;if(this.options.noValidation)return t;if(e="","1.0"===this.options.version){if(e=/[\0-\x08\x0B\f\x0E-\x1F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=t.match(e))throw new Error("Invalid character in string: "+t+" at index "+i.index)}else if("1.1"===this.options.version&&(e=/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,i=t.match(e)))throw new Error("Invalid character in string: "+t+" at index "+i.index);return t},t.prototype.assertLegalName=function(t){var e;if(this.options.noValidation)return t;if(this.assertLegalChar(t),e=/^([:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])([\x2D\.0-:A-Z_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,!t.match(e))throw new Error("Invalid character in name");return t},t.prototype.textEscape=function(t){var e;return this.options.noValidation?t:(e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,t.replace(e,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\r/g,"&#xD;"))},t.prototype.attEscape=function(t){var e;return this.options.noValidation?t:(e=this.options.noDoubleEncoding?/(?!&\S+;)&/g:/&/g,t.replace(e,"&amp;").replace(/</g,"&lt;").replace(/"/g,"&quot;").replace(/\t/g,"&#x9;").replace(/\n/g,"&#xA;").replace(/\r/g,"&#xD;"))},t}()}).call(this)},3595:function(t,e,i){(function(){var e,r,n={}.hasOwnProperty;e=i(9335),r=i(6488),t.exports=function(t){function i(t,r){if(i.__super__.constructor.call(this,t),null==r)throw new Error("Missing element text. "+this.debugInfo());this.name="#text",this.type=e.Text,this.value=this.stringify.text(r)}return function(t,e){for(var i in e)n.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype}(i,t),Object.defineProperty(i.prototype,"isElementContentWhitespace",{get:function(){throw new Error("This DOM method is not implemented."+this.debugInfo())}}),Object.defineProperty(i.prototype,"wholeText",{get:function(){var t,e,i;for(i="",e=this.previousSibling;e;)i=e.data+i,e=e.previousSibling;for(i+=this.data,t=this.nextSibling;t;)i+=t.data,t=t.nextSibling;return i}}),i.prototype.clone=function(){return Object.create(this)},i.prototype.toString=function(t){return this.options.writer.text(this,this.options.writer.filterOptions(t))},i.prototype.splitText=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i.prototype.replaceWholeText=function(t){throw new Error("This DOM method is not implemented."+this.debugInfo())},i}(r)}).call(this)},751:function(t,e,i){(function(){var e,r,n,a={}.hasOwnProperty;n=i(8369).assign,e=i(9335),i(9077),i(8225),i(6170),i(2096),i(2161),i(9406),i(3595),i(9181),i(8833),i(1179),i(6347),i(9078),i(4777),r=i(594),t.exports=function(){function t(t){var e,i,r;for(e in t||(t={}),this.options=t,i=t.writer||{})a.call(i,e)&&(r=i[e],this["_"+e]=this[e],this[e]=r)}return t.prototype.filterOptions=function(t){var e,i,a,o,s,h,u,l;return t||(t={}),t=n({},this.options,t),(e={writer:this}).pretty=t.pretty||!1,e.allowEmpty=t.allowEmpty||!1,e.indent=null!=(i=t.indent)?i:" ",e.newline=null!=(a=t.newline)?a:"\n",e.offset=null!=(o=t.offset)?o:0,e.dontPrettyTextNodes=null!=(s=null!=(h=t.dontPrettyTextNodes)?h:t.dontprettytextnodes)?s:0,e.spaceBeforeSlash=null!=(u=null!=(l=t.spaceBeforeSlash)?l:t.spacebeforeslash)?u:"",!0===e.spaceBeforeSlash&&(e.spaceBeforeSlash=" "),e.suppressPrettyCount=0,e.user={},e.state=r.None,e},t.prototype.indent=function(t,e,i){var r;return!e.pretty||e.suppressPrettyCount?"":e.pretty&&(r=(i||0)+e.offset+1)>0?new Array(r).join(e.indent):""},t.prototype.endline=function(t,e,i){return!e.pretty||e.suppressPrettyCount?"":e.newline},t.prototype.attribute=function(t,e,i){var r;return this.openAttribute(t,e,i),r=" "+t.name+'="'+t.value+'"',this.closeAttribute(t,e,i),r},t.prototype.cdata=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"<![CDATA[",e.state=r.InsideTag,n+=t.value,e.state=r.CloseTag,n+="]]>"+this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.comment=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"\x3c!-- ",e.state=r.InsideTag,n+=t.value,e.state=r.CloseTag,n+=" --\x3e"+this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.declaration=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"<?xml",e.state=r.InsideTag,n+=' version="'+t.version+'"',null!=t.encoding&&(n+=' encoding="'+t.encoding+'"'),null!=t.standalone&&(n+=' standalone="'+t.standalone+'"'),e.state=r.CloseTag,n+=e.spaceBeforeSlash+"?>",n+=this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.docType=function(t,e,i){var n,a,o,s,h;if(i||(i=0),this.openNode(t,e,i),e.state=r.OpenTag,s=this.indent(t,e,i),s+="<!DOCTYPE "+t.root().name,t.pubID&&t.sysID?s+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(s+=' SYSTEM "'+t.sysID+'"'),t.children.length>0){for(s+=" [",s+=this.endline(t,e,i),e.state=r.InsideTag,a=0,o=(h=t.children).length;a<o;a++)n=h[a],s+=this.writeChildNode(n,e,i+1);e.state=r.CloseTag,s+="]"}return e.state=r.CloseTag,s+=e.spaceBeforeSlash+">",s+=this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),s},t.prototype.element=function(t,i,n){var o,s,h,u,l,c,f,p,d,m,g,b,v,y;for(d in n||(n=0),m=!1,g="",this.openNode(t,i,n),i.state=r.OpenTag,g+=this.indent(t,i,n)+"<"+t.name,b=t.attribs)a.call(b,d)&&(o=b[d],g+=this.attribute(o,i,n));if(u=0===(h=t.children.length)?null:t.children[0],0===h||t.children.every((function(t){return(t.type===e.Text||t.type===e.Raw)&&""===t.value})))i.allowEmpty?(g+=">",i.state=r.CloseTag,g+="</"+t.name+">"+this.endline(t,i,n)):(i.state=r.CloseTag,g+=i.spaceBeforeSlash+"/>"+this.endline(t,i,n));else if(!i.pretty||1!==h||u.type!==e.Text&&u.type!==e.Raw||null==u.value){if(i.dontPrettyTextNodes)for(l=0,f=(v=t.children).length;l<f;l++)if(((s=v[l]).type===e.Text||s.type===e.Raw)&&null!=s.value){i.suppressPrettyCount++,m=!0;break}for(g+=">"+this.endline(t,i,n),i.state=r.InsideTag,c=0,p=(y=t.children).length;c<p;c++)s=y[c],g+=this.writeChildNode(s,i,n+1);i.state=r.CloseTag,g+=this.indent(t,i,n)+"</"+t.name+">",m&&i.suppressPrettyCount--,g+=this.endline(t,i,n),i.state=r.None}else g+=">",i.state=r.InsideTag,i.suppressPrettyCount++,m=!0,g+=this.writeChildNode(u,i,n+1),i.suppressPrettyCount--,m=!1,i.state=r.CloseTag,g+="</"+t.name+">"+this.endline(t,i,n);return this.closeNode(t,i,n),g},t.prototype.writeChildNode=function(t,i,r){switch(t.type){case e.CData:return this.cdata(t,i,r);case e.Comment:return this.comment(t,i,r);case e.Element:return this.element(t,i,r);case e.Raw:return this.raw(t,i,r);case e.Text:return this.text(t,i,r);case e.ProcessingInstruction:return this.processingInstruction(t,i,r);case e.Dummy:return"";case e.Declaration:return this.declaration(t,i,r);case e.DocType:return this.docType(t,i,r);case e.AttributeDeclaration:return this.dtdAttList(t,i,r);case e.ElementDeclaration:return this.dtdElement(t,i,r);case e.EntityDeclaration:return this.dtdEntity(t,i,r);case e.NotationDeclaration:return this.dtdNotation(t,i,r);default:throw new Error("Unknown XML node type: "+t.constructor.name)}},t.prototype.processingInstruction=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"<?",e.state=r.InsideTag,n+=t.target,t.value&&(n+=" "+t.value),e.state=r.CloseTag,n+=e.spaceBeforeSlash+"?>",n+=this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.raw=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i),e.state=r.InsideTag,n+=t.value,e.state=r.CloseTag,n+=this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.text=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i),e.state=r.InsideTag,n+=t.value,e.state=r.CloseTag,n+=this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.dtdAttList=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"<!ATTLIST",e.state=r.InsideTag,n+=" "+t.elementName+" "+t.attributeName+" "+t.attributeType,"#DEFAULT"!==t.defaultValueType&&(n+=" "+t.defaultValueType),t.defaultValue&&(n+=' "'+t.defaultValue+'"'),e.state=r.CloseTag,n+=e.spaceBeforeSlash+">"+this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.dtdElement=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"<!ELEMENT",e.state=r.InsideTag,n+=" "+t.name+" "+t.value,e.state=r.CloseTag,n+=e.spaceBeforeSlash+">"+this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.dtdEntity=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"<!ENTITY",e.state=r.InsideTag,t.pe&&(n+=" %"),n+=" "+t.name,t.value?n+=' "'+t.value+'"':(t.pubID&&t.sysID?n+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.sysID&&(n+=' SYSTEM "'+t.sysID+'"'),t.nData&&(n+=" NDATA "+t.nData)),e.state=r.CloseTag,n+=e.spaceBeforeSlash+">"+this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.dtdNotation=function(t,e,i){var n;return this.openNode(t,e,i),e.state=r.OpenTag,n=this.indent(t,e,i)+"<!NOTATION",e.state=r.InsideTag,n+=" "+t.name,t.pubID&&t.sysID?n+=' PUBLIC "'+t.pubID+'" "'+t.sysID+'"':t.pubID?n+=' PUBLIC "'+t.pubID+'"':t.sysID&&(n+=' SYSTEM "'+t.sysID+'"'),e.state=r.CloseTag,n+=e.spaceBeforeSlash+">"+this.endline(t,e,i),e.state=r.None,this.closeNode(t,e,i),n},t.prototype.openNode=function(t,e,i){},t.prototype.closeNode=function(t,e,i){},t.prototype.openAttribute=function(t,e,i){},t.prototype.closeAttribute=function(t,e,i){},t}()}).call(this)},5532:function(t,e,i){(function(){var e,r,n,a,o,s,h,u,l,c;c=i(8369),u=c.assign,l=c.isFunction,n=i(1770),a=i(6934),o=i(9227),h=i(6434),s=i(1996),e=i(9335),r=i(594),t.exports.create=function(t,e,i,r){var n,o;if(null==t)throw new Error("Root element needs a name.");return r=u({},e,i,r),o=(n=new a(r)).element(t),r.headless||(n.declaration(r),null==r.pubID&&null==r.sysID||n.dtd(r)),o},t.exports.begin=function(t,e,i){var r;return l(t)&&(e=(r=[t,e])[0],i=r[1],t={}),e?new o(t,e,i):new a(t)},t.exports.stringWriter=function(t){return new h(t)},t.exports.streamWriter=function(t,e){return new s(t,e)},t.exports.implementation=new n,t.exports.nodeType=e,t.exports.writerState=r}).call(this)},2357:t=>{"use strict";t.exports=require("assert")},4293:t=>{"use strict";t.exports=require("buffer")},3129:t=>{"use strict";t.exports=require("child_process")},6417:t=>{"use strict";t.exports=require("crypto")},8614:t=>{"use strict";t.exports=require("events")},5747:t=>{"use strict";t.exports=require("fs")},8605:t=>{"use strict";t.exports=require("http")},7211:t=>{"use strict";t.exports=require("https")},5622:t=>{"use strict";t.exports=require("path")},1191:t=>{"use strict";t.exports=require("querystring")},2413:t=>{"use strict";t.exports=require("stream")},4304:t=>{"use strict";t.exports=require("string_decoder")},8213:t=>{"use strict";t.exports=require("timers")},8835:t=>{"use strict";t.exports=require("url")},1669:t=>{"use strict";t.exports=require("util")},8761:t=>{"use strict";t.exports=require("zlib")}},e={};!function i(r){var n=e[r];if(void 0!==n)return n.exports;var a=e[r]={exports:{}};return t[r].call(a.exports,a,a.exports,i),a.exports}(3607)})();
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment