diff --git a/LICENSE b/LICENSE index 6cd5749..bc95ef4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2025 PDF转图片工具 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +MIT License + +Copyright (c) 2025 PDF转图片工具 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index b7b400b..01d96f1 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,79 @@ -# PDF转图片工具 - -一个纯前端的PDF转图片工具,所有处理均在浏览器中完成,无需上传文件到服务器,保证用户数据安全。 - -## 功能特点 - -- 🔒 **安全可靠**:所有处理均在本地浏览器中完成,无需上传文件到服务器 -- 🚀 **高效转换**:快速将PDF文件转换为高质量图片 -- 📱 **响应式设计**:适配各种设备屏幕 -- 🖼️ **多种导出选项**:支持导出单页图片或合并为单张长图 -- 🔍 **实时预览**:转换前可预览PDF内容 -- 📦 **批量处理**:支持多页PDF一次性处理 - -## 使用方法 - -1. 打开网页应用 -2. 拖放PDF文件到指定区域或点击"选择文件"按钮 -3. 等待PDF加载和预览生成 -4. 选择导出选项(单页图片或合并为单张图片) -5. 点击"导出图片"按钮 -6. 下载生成的图片文件 - -## 本地部署 - -1. 克隆本仓库 -2. 确保`cssjs/js`目录下包含所有必要的JS库文件 -3. 使用Web服务器(如Nginx、Apache等)提供静态文件服务 -4. 访问index.html即可使用 - -### NGINX 配置示例 - -如果使用 NGINX 服务器,可以添加以下配置以支持 `.mjs` 文件: - -``` -nginx -types { - # 其他 MIME 类型... - text/javascript mjs; -} -``` -## 浏览器兼容性 - -本工具支持所有现代浏览器,包括: - -- Chrome 60+ -- Firefox 60+ -- Safari 11+ -- Edge 79+ - -## 隐私说明 - -- 所有文件处理均在本地浏览器中完成 -- 不会将您的 PDF 文件或生成的图片上传到任何服务器 -- 不会收集任何个人信息或使用情况数据 - -## 致谢 - -- PDF.js -- JSZip -- FileSaver.js -- Bootstrap - -本项目基于原始的PDF转图片工具进行了重构和改进,感谢[原项目](https://github.com/xxlllq/pdf2img)开发者提供的基础功能和灵感。 - -## 技术栈 - -- HTML5 / CSS3 -- JavaScript (ES6+) -- [PDF.js](https://mozilla.github.io/pdf.js/) - Mozilla的PDF渲染库 -- [JSZip](https://stuk.github.io/jszip/) - 用于创建ZIP文件的JavaScript库 -- [FileSaver.js](https://github.com/eligrey/FileSaver.js/) - 客户端保存文件的解决方案 -- [Bootstrap 5](https://getbootstrap.com/) - 用于UI组件和响应式设计 -- [Bootstrap Icons](https://icons.getbootstrap.com/) - 图标库 - -## 许可证 - +# PDF转换工具 + +一个纯前端的PDF转换工具,支持将PDF转换为图片或Word文档,所有处理均在浏览器中完成,无需上传文件到服务器,保证用户数据安全。 + +## 功能特点 + +- 🔒 **安全可靠**:所有处理均在本地浏览器中完成,无需上传文件到服务器 +- 🚀 **高效转换**:快速将PDF文件转换为高质量图片或Word文档 +- 📱 **响应式设计**:适配各种设备屏幕 +- 🖼️ **多种导出选项**:支持导出单页图片、合并为单张长图或转换为Word文档 +- 🔍 **实时预览**:转换前可预览PDF内容 +- 📦 **批量处理**:支持多页PDF一次性处理 +- 📄 **Word转换**:支持将PDF转换为可编辑的Word文档 + +## 使用方法 + +1. 打开网页应用 +2. 拖放PDF文件到指定区域或点击"选择文件"按钮 +3. 等待PDF加载和预览生成 +4. 选择导出类型(图片或Word)和相关选项 +5. 点击"导出文件"按钮 +6. 下载生成的图片或Word文档 + +## 本地部署 + +1. 克隆本仓库 +2. 确保`cssjs/js`目录下包含所有必要的JS库文件 +3. 使用Web服务器(如Nginx、Apache等)提供静态文件服务 +4. 访问index.html即可使用 + +### NGINX 配置示例 + +如果使用 NGINX 服务器,可以添加以下配置以支持 `.mjs` 文件: + +``` +nginx +types { + # 其他 MIME 类型... + text/javascript mjs; +} +``` +## 浏览器兼容性 + +本工具支持所有现代浏览器,包括: + +- Chrome 60+ +- Firefox 60+ +- Safari 11+ +- Edge 79+ + +## 隐私说明 + +- 所有文件处理均在本地浏览器中完成 +- 不会将您的 PDF 文件或生成的图片上传到任何服务器 +- 不会收集任何个人信息或使用情况数据 + +## 致谢 + +- PDF.js +- JSZip +- FileSaver.js +- Bootstrap + +本项目基于原始的PDF转图片工具进行了重构和改进,感谢[原项目](https://github.com/xxlllq/pdf2img)开发者提供的基础功能和灵感。 + +## 技术栈 + +- HTML5 / CSS3 +- JavaScript (ES6+) +- [PDF.js](https://mozilla.github.io/pdf.js/) - Mozilla的PDF渲染库 +- [JSZip](https://stuk.github.io/jszip/) - 用于创建ZIP文件的JavaScript库 +- [FileSaver.js](https://github.com/eligrey/FileSaver.js/) - 客户端保存文件的解决方案 +- [docx](https://github.com/dolanmiu/docx) - 用于生成Word文档的JavaScript库 +- [Bootstrap 5](https://getbootstrap.com/) - 用于UI组件和响应式设计 +- [Bootstrap Icons](https://icons.getbootstrap.com/) - 图标库 + +## 许可证 + 本项目采用MIT许可证,详情请查看[LICENSE](LICENSE)文件。 \ No newline at end of file diff --git a/cssjs/css/style.css b/cssjs/css/style.css index a9f7989..01d340c 100644 --- a/cssjs/css/style.css +++ b/cssjs/css/style.css @@ -1,211 +1,225 @@ -:root { - --primary-color: #4361ee; - --secondary-color: #3f37c9; - --accent-color: #4895ef; - --light-color: #f8f9fa; - --dark-color: #212529; -} - -body { - font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; - background-color: #f5f7fa; - color: var(--dark-color); - line-height: 1.6; -} - -.app-container { - max-width: 1200px; - margin: 0 auto; - padding: 2rem 1rem; -} - -.header { - text-align: center; - margin-bottom: 2rem; -} - -.header h1 { - font-weight: 700; - color: var(--primary-color); - margin-bottom: 0.5rem; -} - -.header p { - color: #6c757d; - font-size: 1.1rem; -} - -.card { - border-radius: 12px; - box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); - border: none; - overflow: hidden; - transition: transform 0.3s ease; -} - -.card:hover { - transform: translateY(-5px); -} - -.card-header { - background-color: var(--primary-color); - color: white; - font-weight: 600; - padding: 1rem; -} - -.upload-area { - border: 2px dashed #dee2e6; - border-radius: 8px; - padding: 3rem 2rem; - text-align: center; - cursor: pointer; - transition: all 0.3s ease; - background-color: #f8f9fa; -} - -.upload-area:hover, .upload-area.dragover { - border-color: var(--primary-color); - background-color: rgba(67, 97, 238, 0.05); -} - -.upload-icon { - font-size: 3rem; - color: var(--primary-color); - margin-bottom: 1rem; -} - -.btn-primary { - background-color: var(--primary-color); - border-color: var(--primary-color); -} - -.btn-primary:hover { - background-color: var(--secondary-color); - border-color: var(--secondary-color); -} - -.btn-outline-primary { - color: var(--primary-color); - border-color: var(--primary-color); -} - -.btn-outline-primary:hover { - background-color: var(--primary-color); - color: white; -} - -.progress { - height: 10px; - border-radius: 5px; -} - -.pdf-info { - display: flex; - justify-content: space-between; - margin-bottom: 1rem; -} - -.pdf-info-item { - text-align: center; - padding: 0.5rem; - background-color: #f8f9fa; - border-radius: 8px; - flex: 1; - margin: 0 0.5rem; -} - -.pdf-info-item .value { - font-size: 1.2rem; - font-weight: 600; - color: var(--primary-color); -} - -.pdf-info-item .label { - font-size: 0.9rem; - color: #6c757d; -} - -.preview-container { - margin-top: 2rem; -} - -.preview-item { - margin-bottom: 2rem; - position: relative; -} - -.preview-item canvas { - width: 100%; - border-radius: 8px; - box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); -} - -.preview-item .page-number { - position: absolute; - top: 10px; - right: 10px; - background-color: rgba(0, 0, 0, 0.7); - color: white; - padding: 0.25rem 0.5rem; - border-radius: 4px; - font-size: 0.8rem; -} - -.export-options { - margin-top: 1rem; - display: flex; - align-items: center; -} - -.export-options .form-check { - margin-right: 1.5rem; -} - -footer { - text-align: center; - margin-top: 3rem; - padding-top: 1rem; - border-top: 1px solid #dee2e6; - color: #6c757d; -} - -@media (max-width: 768px) { - .pdf-info { - flex-direction: column; - } - - .pdf-info-item { - margin: 0.5rem 0; - } - - .export-options { - flex-direction: column; - align-items: flex-start; - } - - .export-options .form-check { - margin-bottom: 0.5rem; - } -} - -/* 加载动画 */ -.spinner { - width: 40px; - height: 40px; - margin: 100px auto; - background-color: var(--primary-color); - border-radius: 100%; - -webkit-animation: sk-scaleout 1.0s infinite ease-in-out; - animation: sk-scaleout 1.0s infinite ease-in-out; -} - -@-webkit-keyframes sk-scaleout { - 0% { -webkit-transform: scale(0) } - 100% { -webkit-transform: scale(1.0); opacity: 0; } -} - -@keyframes sk-scaleout { - 0% { transform: scale(0); -webkit-transform: scale(0); } - 100% { transform: scale(1.0); -webkit-transform: scale(1.0); opacity: 0; } +:root { + --primary-color: #4361ee; + --secondary-color: #3f37c9; + --accent-color: #4895ef; + --light-color: #f8f9fa; + --dark-color: #212529; +} + +body { + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + background-color: #f5f7fa; + color: var(--dark-color); + line-height: 1.6; +} + +.app-container { + max-width: 1200px; + margin: 0 auto; + padding: 2rem 1rem; +} + +.header { + text-align: center; + margin-bottom: 2rem; +} + +.header h1 { + font-weight: 700; + color: var(--primary-color); + margin-bottom: 0.5rem; +} + +.header p { + color: #6c757d; + font-size: 1.1rem; +} + +.card { + border-radius: 12px; + box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); + border: none; + overflow: hidden; + transition: transform 0.3s ease; +} + +.card:hover { + transform: translateY(-5px); +} + +.card-header { + background-color: var(--primary-color); + color: white; + font-weight: 600; + padding: 1rem; +} + +.upload-area { + border: 2px dashed #dee2e6; + border-radius: 8px; + padding: 3rem 2rem; + text-align: center; + cursor: pointer; + transition: all 0.3s ease; + background-color: #f8f9fa; +} + +.upload-area:hover, .upload-area.dragover { + border-color: var(--primary-color); + background-color: rgba(67, 97, 238, 0.05); +} + +.upload-icon { + font-size: 3rem; + color: var(--primary-color); + margin-bottom: 1rem; +} + +.btn-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); +} + +.btn-primary:hover { + background-color: var(--secondary-color); + border-color: var(--secondary-color); +} + +.btn-outline-primary { + color: var(--primary-color); + border-color: var(--primary-color); +} + +.btn-outline-primary:hover { + background-color: var(--primary-color); + color: white; +} + +.progress { + height: 10px; + border-radius: 5px; +} + +.pdf-info { + display: flex; + justify-content: space-between; + margin-bottom: 1rem; +} + +.pdf-info-item { + text-align: center; + padding: 0.5rem; + background-color: #f8f9fa; + border-radius: 8px; + flex: 1; + margin: 0 0.5rem; +} + +.pdf-info-item .value { + font-size: 1.2rem; + font-weight: 600; + color: var(--primary-color); +} + +.pdf-info-item .label { + font-size: 0.9rem; + color: #6c757d; +} + +.preview-container { + margin-top: 2rem; +} + +.preview-item { + margin-bottom: 2rem; + position: relative; +} + +.preview-item canvas { + width: 100%; + border-radius: 8px; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); +} + +.preview-item .page-number { + position: absolute; + top: 10px; + right: 10px; + background-color: rgba(0, 0, 0, 0.7); + color: white; + padding: 0.25rem 0.5rem; + border-radius: 4px; + font-size: 0.8rem; +} + +.export-options { + margin-top: 1rem; +} + +.export-options .form-check { + margin-right: 1.5rem; + margin-bottom: 0.5rem; +} + +.export-type-selector { + margin-bottom: 1rem; +} + +.btn-outline-primary { + color: var(--primary-color); + border-color: var(--primary-color); +} + +.btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary { + background-color: var(--primary-color); + border-color: var(--primary-color); + color: white; +} + +footer { + text-align: center; + margin-top: 3rem; + padding-top: 1rem; + border-top: 1px solid #dee2e6; + color: #6c757d; +} + +@media (max-width: 768px) { + .pdf-info { + flex-direction: column; + } + + .pdf-info-item { + margin: 0.5rem 0; + } + + .export-options { + flex-direction: column; + align-items: flex-start; + } + + .export-options .form-check { + margin-bottom: 0.5rem; + } +} + +/* 加载动画 */ +.spinner { + width: 40px; + height: 40px; + margin: 100px auto; + background-color: var(--primary-color); + border-radius: 100%; + -webkit-animation: sk-scaleout 1.0s infinite ease-in-out; + animation: sk-scaleout 1.0s infinite ease-in-out; +} + +@-webkit-keyframes sk-scaleout { + 0% { -webkit-transform: scale(0) } + 100% { -webkit-transform: scale(1.0); opacity: 0; } +} + +@keyframes sk-scaleout { + 0% { transform: scale(0); -webkit-transform: scale(0); } + 100% { transform: scale(1.0); -webkit-transform: scale(1.0); opacity: 0; } } \ No newline at end of file diff --git a/cssjs/js/docx.esm.js b/cssjs/js/docx.esm.js new file mode 100644 index 0000000..9e7499c --- /dev/null +++ b/cssjs/js/docx.esm.js @@ -0,0 +1,19 @@ +// 等待 docx.min.js 加载完成 +const waitForDocx = new Promise((resolve) => { + const checkDocx = () => { + if (window.docx && window.docx.Document) { + resolve(); + } else { + setTimeout(checkDocx, 100); + } + }; + checkDocx(); +}); + +// 导出 docx 库的所有必要组件 +export const Document = waitForDocx.then(() => window.docx.Document); +export const Paragraph = waitForDocx.then(() => window.docx.Paragraph); +export const ImageRun = waitForDocx.then(() => window.docx.ImageRun); +export const HeadingLevel = waitForDocx.then(() => window.docx.HeadingLevel); +export const AlignmentType = waitForDocx.then(() => window.docx.AlignmentType); +export const Packer = waitForDocx.then(() => window.docx.Packer); \ No newline at end of file diff --git a/cssjs/js/docx.min.js b/cssjs/js/docx.min.js new file mode 100644 index 0000000..147105c --- /dev/null +++ b/cssjs/js/docx.min.js @@ -0,0 +1,21620 @@ +(function(global2, factory) { + typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.docx = {})); +})(this, function(exports2) { + "use strict";var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var __objRest = (source, exclude) => { + var target = {}; + for (var prop in source) + if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) + target[prop] = source[prop]; + if (source != null && __getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(source)) { + if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) + target[prop] = source[prop]; + } + return target; +}; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + + class BaseXmlComponent { + constructor(rootKey) { + __publicField(this, "rootKey"); + this.rootKey = rootKey; + } + } + const EMPTY_OBJECT = Object.seal({}); + class XmlComponent extends BaseXmlComponent { + constructor(rootKey) { + super(rootKey); + // eslint-disable-next-line functional/prefer-readonly-type, @typescript-eslint/no-explicit-any + __publicField(this, "root"); + this.root = new Array(); + } + // This method is called by the formatter to get the XML representation of this component. + // It is called recursively for all child components. + // It is a serializer to be used in the xml library. + // https://www.npmjs.com/package/xml + // Child components can override this method to customize the XML representation, or execute side effects. + prepForXml(context) { + var _a; + context.stack.push(this); + const children = this.root.map((comp) => { + if (comp instanceof BaseXmlComponent) { + return comp.prepForXml(context); + } + return comp; + }).filter((comp) => comp !== void 0); + context.stack.pop(); + return { + [this.rootKey]: children.length ? children.length === 1 && ((_a = children[0]) == null ? void 0 : _a._attr) ? children[0] : children : EMPTY_OBJECT + }; + } + /** + * @deprecated Do not use this method. It is only used internally by the library. It will be removed in a future version. + */ + addChildElement(child) { + this.root.push(child); + return this; + } + } + class IgnoreIfEmptyXmlComponent extends XmlComponent { + prepForXml(context) { + const result = super.prepForXml(context); + if (result && (typeof result[this.rootKey] !== "object" || Object.keys(result[this.rootKey]).length)) { + return result; + } + return void 0; + } + } + class XmlAttributeComponent extends BaseXmlComponent { + constructor(root) { + super("_attr"); + __publicField(this, "xmlKeys"); + this.root = root; + } + prepForXml(_) { + const attrs = {}; + Object.entries(this.root).forEach(([key, value]) => { + if (value !== void 0) { + const newKey = this.xmlKeys && this.xmlKeys[key] || key; + attrs[newKey] = value; + } + }); + return { _attr: attrs }; + } + } + class NextAttributeComponent extends BaseXmlComponent { + constructor(root) { + super("_attr"); + this.root = root; + } + prepForXml(_) { + const attrs = Object.values(this.root).filter(({ value }) => value !== void 0).reduce((acc, { key, value }) => __spreadProps(__spreadValues({}, acc), { [key]: value }), {}); + return { _attr: attrs }; + } + } + class Attributes extends XmlAttributeComponent { + constructor() { + super(...arguments); + __publicField(this, "xmlKeys", { + val: "w:val", + color: "w:color", + fill: "w:fill", + space: "w:space", + sz: "w:sz", + type: "w:type", + rsidR: "w:rsidR", + rsidRPr: "w:rsidRPr", + rsidSect: "w:rsidSect", + w: "w:w", + h: "w:h", + top: "w:top", + right: "w:right", + bottom: "w:bottom", + left: "w:left", + header: "w:header", + footer: "w:footer", + gutter: "w:gutter", + linePitch: "w:linePitch", + pos: "w:pos" + }); + } + } + var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; + function getDefaultExportFromCjs$1(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; + } + var sax = {}; + var events = { exports: {} }; + var hasRequiredEvents; + function requireEvents() { + if (hasRequiredEvents) return events.exports; + hasRequiredEvents = 1; + var R = typeof Reflect === "object" ? Reflect : null; + var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + }; + var ReflectOwnKeys; + if (R && typeof R.ownKeys === "function") { + ReflectOwnKeys = R.ownKeys; + } else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys2(target) { + return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); + }; + } else { + ReflectOwnKeys = function ReflectOwnKeys2(target) { + return Object.getOwnPropertyNames(target); + }; + } + function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); + } + var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) { + return value !== value; + }; + function EventEmitter() { + EventEmitter.init.call(this); + } + events.exports = EventEmitter; + events.exports.once = once; + EventEmitter.EventEmitter = EventEmitter; + EventEmitter.prototype._events = void 0; + EventEmitter.prototype._eventsCount = 0; + EventEmitter.prototype._maxListeners = void 0; + var defaultMaxListeners = 10; + function checkListener(listener) { + if (typeof listener !== "function") { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + } + Object.defineProperty(EventEmitter, "defaultMaxListeners", { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + "."); + } + defaultMaxListeners = arg; + } + }); + EventEmitter.init = function() { + if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) { + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + } + this._maxListeners = this._maxListeners || void 0; + }; + EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + "."); + } + this._maxListeners = n; + return this; + }; + function _getMaxListeners(that) { + if (that._maxListeners === void 0) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; + } + EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); + }; + EventEmitter.prototype.emit = function emit(type2) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = type2 === "error"; + var events2 = this._events; + if (events2 !== void 0) + doError = doError && events2.error === void 0; + else if (!doError) + return false; + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + throw er; + } + var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : "")); + err.context = er; + throw err; + } + var handler = events2[type2]; + if (handler === void 0) + return false; + if (typeof handler === "function") { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + return true; + }; + function _addListener(target, type2, listener, prepend) { + var m; + var events2; + var existing; + checkListener(listener); + events2 = target._events; + if (events2 === void 0) { + events2 = target._events = /* @__PURE__ */ Object.create(null); + target._eventsCount = 0; + } else { + if (events2.newListener !== void 0) { + target.emit( + "newListener", + type2, + listener.listener ? listener.listener : listener + ); + events2 = target._events; + } + existing = events2[type2]; + } + if (existing === void 0) { + existing = events2[type2] = listener; + ++target._eventsCount; + } else { + if (typeof existing === "function") { + existing = events2[type2] = prepend ? [listener, existing] : [existing, listener]; + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit"); + w.name = "MaxListenersExceededWarning"; + w.emitter = target; + w.type = type2; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + return target; + } + EventEmitter.prototype.addListener = function addListener(type2, listener) { + return _addListener(this, type2, listener, false); + }; + EventEmitter.prototype.on = EventEmitter.prototype.addListener; + EventEmitter.prototype.prependListener = function prependListener(type2, listener) { + return _addListener(this, type2, listener, true); + }; + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } + } + function _onceWrap(target, type2, listener) { + var state2 = { fired: false, wrapFn: void 0, target, type: type2, listener }; + var wrapped = onceWrapper.bind(state2); + wrapped.listener = listener; + state2.wrapFn = wrapped; + return wrapped; + } + EventEmitter.prototype.once = function once2(type2, listener) { + checkListener(listener); + this.on(type2, _onceWrap(this, type2, listener)); + return this; + }; + EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) { + checkListener(listener); + this.prependListener(type2, _onceWrap(this, type2, listener)); + return this; + }; + EventEmitter.prototype.removeListener = function removeListener(type2, listener) { + var list, events2, position, i, originalListener; + checkListener(listener); + events2 = this._events; + if (events2 === void 0) + return this; + list = events2[type2]; + if (list === void 0) + return this; + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = /* @__PURE__ */ Object.create(null); + else { + delete events2[type2]; + if (events2.removeListener) + this.emit("removeListener", type2, list.listener || listener); + } + } else if (typeof list !== "function") { + position = -1; + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + if (position < 0) + return this; + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + if (list.length === 1) + events2[type2] = list[0]; + if (events2.removeListener !== void 0) + this.emit("removeListener", type2, originalListener || listener); + } + return this; + }; + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) { + var listeners, events2, i; + events2 = this._events; + if (events2 === void 0) + return this; + if (events2.removeListener === void 0) { + if (arguments.length === 0) { + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + } else if (events2[type2] !== void 0) { + if (--this._eventsCount === 0) + this._events = /* @__PURE__ */ Object.create(null); + else + delete events2[type2]; + } + return this; + } + if (arguments.length === 0) { + var keys = Object.keys(events2); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === "removeListener") continue; + this.removeAllListeners(key); + } + this.removeAllListeners("removeListener"); + this._events = /* @__PURE__ */ Object.create(null); + this._eventsCount = 0; + return this; + } + listeners = events2[type2]; + if (typeof listeners === "function") { + this.removeListener(type2, listeners); + } else if (listeners !== void 0) { + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type2, listeners[i]); + } + } + return this; + }; + function _listeners(target, type2, unwrap) { + var events2 = target._events; + if (events2 === void 0) + return []; + var evlistener = events2[type2]; + if (evlistener === void 0) + return []; + if (typeof evlistener === "function") + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); + } + EventEmitter.prototype.listeners = function listeners(type2) { + return _listeners(this, type2, true); + }; + EventEmitter.prototype.rawListeners = function rawListeners(type2) { + return _listeners(this, type2, false); + }; + EventEmitter.listenerCount = function(emitter, type2) { + if (typeof emitter.listenerCount === "function") { + return emitter.listenerCount(type2); + } else { + return listenerCount.call(emitter, type2); + } + }; + EventEmitter.prototype.listenerCount = listenerCount; + function listenerCount(type2) { + var events2 = this._events; + if (events2 !== void 0) { + var evlistener = events2[type2]; + if (typeof evlistener === "function") { + return 1; + } else if (evlistener !== void 0) { + return evlistener.length; + } + } + return 0; + } + EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; + }; + function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; + } + function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); + } + function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; + } + function once(emitter, name) { + return new Promise(function(resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + function resolver() { + if (typeof emitter.removeListener === "function") { + emitter.removeListener("error", errorListener); + } + resolve([].slice.call(arguments)); + } + eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); + if (name !== "error") { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); + } + }); + } + function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === "function") { + eventTargetAgnosticAddListener(emitter, "error", handler, flags); + } + } + function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === "function") { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === "function") { + emitter.addEventListener(name, function wrapListener(arg) { + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } + } + return events.exports; + } + var inherits_browser = { exports: {} }; + var hasRequiredInherits_browser; + function requireInherits_browser() { + if (hasRequiredInherits_browser) return inherits_browser.exports; + hasRequiredInherits_browser = 1; + if (typeof Object.create === "function") { + inherits_browser.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + inherits_browser.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + return inherits_browser.exports; + } + function getDefaultExportFromCjs(x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x; + } + var browser$1 = { exports: {} }; + var process = browser$1.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error("setTimeout has not been defined"); + } + function defaultClearTimeout() { + throw new Error("clearTimeout has not been defined"); + } + (function() { + try { + if (typeof setTimeout === "function") { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === "function") { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + })(); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e2) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e2) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function(fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function() { + this.fun.apply(null, this.array); + }; + process.title = "browser"; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ""; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function(name) { + return []; + }; + process.binding = function(name) { + throw new Error("process.binding is not supported"); + }; + process.cwd = function() { + return "/"; + }; + process.chdir = function(dir) { + throw new Error("process.chdir is not supported"); + }; + process.umask = function() { + return 0; + }; + var browserExports = browser$1.exports; + const process$1 = /* @__PURE__ */ getDefaultExportFromCjs(browserExports); + var streamBrowser; + var hasRequiredStreamBrowser; + function requireStreamBrowser() { + if (hasRequiredStreamBrowser) return streamBrowser; + hasRequiredStreamBrowser = 1; + streamBrowser = requireEvents().EventEmitter; + return streamBrowser; + } + var buffer = {}; + var base64Js = {}; + var hasRequiredBase64Js; + function requireBase64Js() { + if (hasRequiredBase64Js) return base64Js; + hasRequiredBase64Js = 1; + base64Js.byteLength = byteLength; + base64Js.toByteArray = toByteArray; + base64Js.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num) { + return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push( + lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" + ); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push( + lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" + ); + } + return parts.join(""); + } + return base64Js; + } + var ieee754 = {}; + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + var hasRequiredIeee754; + function requireIeee754() { + if (hasRequiredIeee754) return ieee754; + hasRequiredIeee754 = 1; + ieee754.read = function(buffer2, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer2[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer2[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer2[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + ieee754.write = function(buffer2, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer2[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer2[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer2[offset + i - d] |= s * 128; + }; + return ieee754; + } + /*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + var hasRequiredBuffer; + function requireBuffer() { + if (hasRequiredBuffer) return buffer; + hasRequiredBuffer = 1; + (function(exports3) { + var base64 = requireBase64Js(); + var ieee7542 = requireIeee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports3.Buffer = Buffer2; + exports3.SlowBuffer = SlowBuffer; + exports3.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports3.kMaxLength = K_MAX_LENGTH; + Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer2.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") { + console.error( + "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support." + ); + } + function typedArraySupport() { + try { + var arr = new Uint8Array(1); + var proto = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + Object.defineProperty(Buffer2.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer2.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer2.isBuffer(this)) return void 0; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function Buffer2(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ); + } + return allocUnsafe(arg); + } + return from(arg, encodingOrOffset, length); + } + Buffer2.poolSize = 8192; + function from(value, encodingOrOffset, length) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value + ); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === "number") { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ); + } + var valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer2.from(valueOf, encodingOrOffset, length); + } + var b = fromObject(value); + if (b) return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer2.from( + value[Symbol.toPrimitive]("string"), + encodingOrOffset, + length + ); + } + throw new TypeError( + "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value + ); + } + Buffer2.from = function(value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; + Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer2, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer2.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer2.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer2.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + if (actual !== length) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + var buf; + if (byteOffset === void 0 && length === void 0) { + buf = new Uint8Array(array); + } else if (length === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + Object.setPrototypeOf(buf, Buffer2.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer2.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + if (length >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length | 0; + } + function SlowBuffer(length) { + if (+length != length) { + length = 0; + } + return Buffer2.alloc(+length); + } + Buffer2.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer2.prototype; + }; + Buffer2.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer2.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer2.from(b, b.offset, b.byteLength); + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ); + } + if (a === b) return 0; + var x = a.length; + var y = b.length; + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + Buffer2.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; + } + }; + Buffer2.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer2.alloc(0); + } + var i; + if (length === void 0) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + var buffer2 = Buffer2.allocUnsafe(length); + var pos = 0; + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer2.length) { + Buffer2.from(buf).copy(buffer2, pos); + } else { + Uint8Array.prototype.set.call( + buffer2, + buf, + pos + ); + } + } else if (!Buffer2.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer2, pos); + } + pos += buf.length; + } + return buffer2; + }; + function byteLength(string, encoding) { + if (Buffer2.isBuffer(string)) { + return string.length; + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + if (typeof string !== "string") { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string + ); + } + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; + var loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.byteLength = byteLength; + function slowToString(encoding, start, end) { + var loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer2.prototype._isBuffer = true; + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer2.prototype.swap16 = function swap16() { + var len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer2.prototype.swap32 = function swap32() { + var len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer2.prototype.swap64 = function swap64() { + var len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer2.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ""; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; + Buffer2.prototype.equals = function equals(b) { + if (!Buffer2.isBuffer(b)) throw new TypeError("Argument must be a Buffer"); + if (this === b) return true; + return Buffer2.compare(this, b) === 0; + }; + Buffer2.prototype.inspect = function inspect() { + var str = ""; + var max = exports3.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; + } + Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer2.from(target, target.offset, target.byteLength); + } + if (!Buffer2.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target + ); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) { + if (buffer2.length === 0) return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer2.length - 1; + } + if (byteOffset < 0) byteOffset = buffer2.length + byteOffset; + if (byteOffset >= buffer2.length) { + if (dir) return -1; + else byteOffset = buffer2.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return -1; + } + if (typeof val === "string") { + val = Buffer2.from(val, encoding); + } + if (Buffer2.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer2, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); + } + } + return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + var i; + if (dir) { + var foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + var found = true; + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + if (found) return i; + } + } + return -1; + } + Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + var strLen = string.length; + if (length > strLen / 2) { + length = strLen / 2; + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + Buffer2.prototype.write = function write(string, offset, length, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length = this.length; + offset = 0; + } else if (length === void 0 && typeof offset === "string") { + encoding = offset; + length = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === void 0) encoding = "utf8"; + } else { + encoding = length; + length = void 0; + } + } else { + throw new Error( + "Buffer.write(string, encoding, offset[, length]) is no longer supported" + ); + } + var remaining = this.length - offset; + if (length === void 0 || length > remaining) length = remaining; + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) encoding = "utf8"; + var loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string, offset, length); + case "utf8": + case "utf-8": + return utf8Write(this, string, offset, length); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string, offset, length); + case "base64": + return base64Write(this, string, offset, length); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string, offset, length); + default: + if (loweredCase) throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + Buffer2.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + var res = ""; + var i = 0; + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ); + } + return res; + } + function asciiSlice(buf, start, end) { + var ret = ""; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + var ret = ""; + end = Math.min(buf.length, end); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ""; + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ""; + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer2.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + if (end < start) end = start; + var newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer2.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint"); + if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length"); + } + Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) checkOffset(offset, byteLength2, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + var val = this[offset + --byteLength2]; + var mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) checkOffset(offset, byteLength2, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) checkOffset(offset, byteLength2, this.length); + var i = byteLength2; + var mul = 1; + var val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee7542.read(this, offset, true, 23, 4); + }; + Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee7542.read(this, offset, false, 23, 4); + }; + Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee7542.read(this, offset, true, 52, 8); + }; + Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee7542.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer2.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError("Index out of range"); + } + Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + var mul = 1; + var i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + var i = byteLength2 - 1; + var mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + var i = byteLength2 - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 127, -128); + if (value < 0) value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError("Index out of range"); + if (offset < 0) throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + ieee7542.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + ieee7542.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer2.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer2.isBuffer(target)) throw new TypeError("argument should be a Buffer"); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) throw new RangeError("Index out of range"); + if (end < 0) throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + var len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ); + } + return len; + }; + Buffer2.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + var code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) val = 0; + var i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); + var len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) break; + bytes.push( + codePoint >> 6 | 192, + codePoint & 63 | 128 + ); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) break; + bytes.push( + codePoint >> 12 | 224, + codePoint >> 6 & 63 | 128, + codePoint & 63 | 128 + ); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) break; + bytes.push( + codePoint >> 18 | 240, + codePoint >> 12 & 63 | 128, + codePoint >> 6 & 63 | 128, + codePoint & 63 | 128 + ); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + return i; + } + function isInstance(obj, type2) { + return obj instanceof type2 || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type2.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + var alphabet = "0123456789abcdef"; + var table = new Array(256); + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + })(buffer); + return buffer; + } + var util = {}; + var types = {}; + var shams$1; + var hasRequiredShams$1; + function requireShams$1() { + if (hasRequiredShams$1) return shams$1; + hasRequiredShams$1 = 1; + shams$1 = function hasSymbols2() { + if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { + return false; + } + if (typeof Symbol.iterator === "symbol") { + return true; + } + var obj = {}; + var sym = Symbol("test"); + var symObj = Object(sym); + if (typeof sym === "string") { + return false; + } + if (Object.prototype.toString.call(sym) !== "[object Symbol]") { + return false; + } + if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { + return false; + } + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { + return false; + } + if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { + return false; + } + if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + if (typeof Object.getOwnPropertyDescriptor === "function") { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + return true; + }; + return shams$1; + } + var shams; + var hasRequiredShams; + function requireShams() { + if (hasRequiredShams) return shams; + hasRequiredShams = 1; + var hasSymbols2 = requireShams$1(); + shams = function hasToStringTagShams() { + return hasSymbols2() && !!Symbol.toStringTag; + }; + return shams; + } + var esErrors; + var hasRequiredEsErrors; + function requireEsErrors() { + if (hasRequiredEsErrors) return esErrors; + hasRequiredEsErrors = 1; + esErrors = Error; + return esErrors; + } + var _eval; + var hasRequired_eval; + function require_eval() { + if (hasRequired_eval) return _eval; + hasRequired_eval = 1; + _eval = EvalError; + return _eval; + } + var range; + var hasRequiredRange; + function requireRange() { + if (hasRequiredRange) return range; + hasRequiredRange = 1; + range = RangeError; + return range; + } + var ref; + var hasRequiredRef; + function requireRef() { + if (hasRequiredRef) return ref; + hasRequiredRef = 1; + ref = ReferenceError; + return ref; + } + var syntax; + var hasRequiredSyntax; + function requireSyntax() { + if (hasRequiredSyntax) return syntax; + hasRequiredSyntax = 1; + syntax = SyntaxError; + return syntax; + } + var type; + var hasRequiredType; + function requireType() { + if (hasRequiredType) return type; + hasRequiredType = 1; + type = TypeError; + return type; + } + var uri; + var hasRequiredUri; + function requireUri() { + if (hasRequiredUri) return uri; + hasRequiredUri = 1; + uri = URIError; + return uri; + } + var hasSymbols; + var hasRequiredHasSymbols; + function requireHasSymbols() { + if (hasRequiredHasSymbols) return hasSymbols; + hasRequiredHasSymbols = 1; + var origSymbol = typeof Symbol !== "undefined" && Symbol; + var hasSymbolSham = requireShams$1(); + hasSymbols = function hasNativeSymbols() { + if (typeof origSymbol !== "function") { + return false; + } + if (typeof Symbol !== "function") { + return false; + } + if (typeof origSymbol("foo") !== "symbol") { + return false; + } + if (typeof Symbol("bar") !== "symbol") { + return false; + } + return hasSymbolSham(); + }; + return hasSymbols; + } + var hasProto; + var hasRequiredHasProto; + function requireHasProto() { + if (hasRequiredHasProto) return hasProto; + hasRequiredHasProto = 1; + var test = { + __proto__: null, + foo: {} + }; + var $Object = Object; + hasProto = function hasProto2() { + return { __proto__: test }.foo === test.foo && !(test instanceof $Object); + }; + return hasProto; + } + var implementation; + var hasRequiredImplementation; + function requireImplementation() { + if (hasRequiredImplementation) return implementation; + hasRequiredImplementation = 1; + var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; + var toStr = Object.prototype.toString; + var max = Math.max; + var funcType = "[object Function]"; + var concatty = function concatty2(a, b) { + var arr = []; + for (var i = 0; i < a.length; i += 1) { + arr[i] = a[i]; + } + for (var j = 0; j < b.length; j += 1) { + arr[j + a.length] = b[j]; + } + return arr; + }; + var slicy = function slicy2(arrLike, offset) { + var arr = []; + for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) { + arr[j] = arrLike[i]; + } + return arr; + }; + var joiny = function(arr, joiner) { + var str = ""; + for (var i = 0; i < arr.length; i += 1) { + str += arr[i]; + if (i + 1 < arr.length) { + str += joiner; + } + } + return str; + }; + implementation = function bind(that) { + var target = this; + if (typeof target !== "function" || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + var bound; + var binder = function() { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); + }; + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i = 0; i < boundLength; i++) { + boundArgs[i] = "$" + i; + } + bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); + if (target.prototype) { + var Empty = function Empty2() { + }; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; + return implementation; + } + var functionBind; + var hasRequiredFunctionBind; + function requireFunctionBind() { + if (hasRequiredFunctionBind) return functionBind; + hasRequiredFunctionBind = 1; + var implementation2 = requireImplementation(); + functionBind = Function.prototype.bind || implementation2; + return functionBind; + } + var hasown; + var hasRequiredHasown; + function requireHasown() { + if (hasRequiredHasown) return hasown; + hasRequiredHasown = 1; + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; + var bind = requireFunctionBind(); + hasown = bind.call(call, $hasOwn); + return hasown; + } + var getIntrinsic; + var hasRequiredGetIntrinsic; + function requireGetIntrinsic() { + if (hasRequiredGetIntrinsic) return getIntrinsic; + hasRequiredGetIntrinsic = 1; + var undefined$1; + var $Error = /* @__PURE__ */ requireEsErrors(); + var $EvalError = /* @__PURE__ */ require_eval(); + var $RangeError = /* @__PURE__ */ requireRange(); + var $ReferenceError = /* @__PURE__ */ requireRef(); + var $SyntaxError = /* @__PURE__ */ requireSyntax(); + var $TypeError = /* @__PURE__ */ requireType(); + var $URIError = /* @__PURE__ */ requireUri(); + var $Function = Function; + var getEvalledConstructor = function(expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); + } catch (e) { + } + }; + var $gOPD = Object.getOwnPropertyDescriptor; + if ($gOPD) { + try { + $gOPD({}, ""); + } catch (e) { + $gOPD = null; + } + } + var throwTypeError = function() { + throw new $TypeError(); + }; + var ThrowTypeError = $gOPD ? function() { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, "callee").get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }() : throwTypeError; + var hasSymbols2 = requireHasSymbols()(); + var hasProto2 = /* @__PURE__ */ requireHasProto()(); + var getProto = Object.getPrototypeOf || (hasProto2 ? function(x) { + return x.__proto__; + } : null); + var needsEval = {}; + var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array); + var INTRINSICS = { + __proto__: null, + "%AggregateError%": typeof AggregateError === "undefined" ? undefined$1 : AggregateError, + "%Array%": Array, + "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined$1 : ArrayBuffer, + "%ArrayIteratorPrototype%": hasSymbols2 && getProto ? getProto([][Symbol.iterator]()) : undefined$1, + "%AsyncFromSyncIteratorPrototype%": undefined$1, + "%AsyncFunction%": needsEval, + "%AsyncGenerator%": needsEval, + "%AsyncGeneratorFunction%": needsEval, + "%AsyncIteratorPrototype%": needsEval, + "%Atomics%": typeof Atomics === "undefined" ? undefined$1 : Atomics, + "%BigInt%": typeof BigInt === "undefined" ? undefined$1 : BigInt, + "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined$1 : BigInt64Array, + "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined$1 : BigUint64Array, + "%Boolean%": Boolean, + "%DataView%": typeof DataView === "undefined" ? undefined$1 : DataView, + "%Date%": Date, + "%decodeURI%": decodeURI, + "%decodeURIComponent%": decodeURIComponent, + "%encodeURI%": encodeURI, + "%encodeURIComponent%": encodeURIComponent, + "%Error%": $Error, + "%eval%": eval, + // eslint-disable-line no-eval + "%EvalError%": $EvalError, + "%Float32Array%": typeof Float32Array === "undefined" ? undefined$1 : Float32Array, + "%Float64Array%": typeof Float64Array === "undefined" ? undefined$1 : Float64Array, + "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined$1 : FinalizationRegistry, + "%Function%": $Function, + "%GeneratorFunction%": needsEval, + "%Int8Array%": typeof Int8Array === "undefined" ? undefined$1 : Int8Array, + "%Int16Array%": typeof Int16Array === "undefined" ? undefined$1 : Int16Array, + "%Int32Array%": typeof Int32Array === "undefined" ? undefined$1 : Int32Array, + "%isFinite%": isFinite, + "%isNaN%": isNaN, + "%IteratorPrototype%": hasSymbols2 && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1, + "%JSON%": typeof JSON === "object" ? JSON : undefined$1, + "%Map%": typeof Map === "undefined" ? undefined$1 : Map, + "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols2 || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), + "%Math%": Math, + "%Number%": Number, + "%Object%": Object, + "%parseFloat%": parseFloat, + "%parseInt%": parseInt, + "%Promise%": typeof Promise === "undefined" ? undefined$1 : Promise, + "%Proxy%": typeof Proxy === "undefined" ? undefined$1 : Proxy, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, + "%Reflect%": typeof Reflect === "undefined" ? undefined$1 : Reflect, + "%RegExp%": RegExp, + "%Set%": typeof Set === "undefined" ? undefined$1 : Set, + "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols2 || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), + "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined$1 : SharedArrayBuffer, + "%String%": String, + "%StringIteratorPrototype%": hasSymbols2 && getProto ? getProto(""[Symbol.iterator]()) : undefined$1, + "%Symbol%": hasSymbols2 ? Symbol : undefined$1, + "%SyntaxError%": $SyntaxError, + "%ThrowTypeError%": ThrowTypeError, + "%TypedArray%": TypedArray, + "%TypeError%": $TypeError, + "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined$1 : Uint8Array, + "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined$1 : Uint8ClampedArray, + "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined$1 : Uint16Array, + "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined$1 : Uint32Array, + "%URIError%": $URIError, + "%WeakMap%": typeof WeakMap === "undefined" ? undefined$1 : WeakMap, + "%WeakRef%": typeof WeakRef === "undefined" ? undefined$1 : WeakRef, + "%WeakSet%": typeof WeakSet === "undefined" ? undefined$1 : WeakSet + }; + if (getProto) { + try { + null.error; + } catch (e) { + var errorProto = getProto(getProto(e)); + INTRINSICS["%Error.prototype%"] = errorProto; + } + } + var doEval = function doEval2(name) { + var value; + if (name === "%AsyncFunction%") { + value = getEvalledConstructor("async function () {}"); + } else if (name === "%GeneratorFunction%") { + value = getEvalledConstructor("function* () {}"); + } else if (name === "%AsyncGeneratorFunction%") { + value = getEvalledConstructor("async function* () {}"); + } else if (name === "%AsyncGenerator%") { + var fn = doEval2("%AsyncGeneratorFunction%"); + if (fn) { + value = fn.prototype; + } + } else if (name === "%AsyncIteratorPrototype%") { + var gen = doEval2("%AsyncGenerator%"); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + INTRINSICS[name] = value; + return value; + }; + var LEGACY_ALIASES = { + __proto__: null, + "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], + "%ArrayPrototype%": ["Array", "prototype"], + "%ArrayProto_entries%": ["Array", "prototype", "entries"], + "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], + "%ArrayProto_keys%": ["Array", "prototype", "keys"], + "%ArrayProto_values%": ["Array", "prototype", "values"], + "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], + "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], + "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], + "%BooleanPrototype%": ["Boolean", "prototype"], + "%DataViewPrototype%": ["DataView", "prototype"], + "%DatePrototype%": ["Date", "prototype"], + "%ErrorPrototype%": ["Error", "prototype"], + "%EvalErrorPrototype%": ["EvalError", "prototype"], + "%Float32ArrayPrototype%": ["Float32Array", "prototype"], + "%Float64ArrayPrototype%": ["Float64Array", "prototype"], + "%FunctionPrototype%": ["Function", "prototype"], + "%Generator%": ["GeneratorFunction", "prototype"], + "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], + "%Int8ArrayPrototype%": ["Int8Array", "prototype"], + "%Int16ArrayPrototype%": ["Int16Array", "prototype"], + "%Int32ArrayPrototype%": ["Int32Array", "prototype"], + "%JSONParse%": ["JSON", "parse"], + "%JSONStringify%": ["JSON", "stringify"], + "%MapPrototype%": ["Map", "prototype"], + "%NumberPrototype%": ["Number", "prototype"], + "%ObjectPrototype%": ["Object", "prototype"], + "%ObjProto_toString%": ["Object", "prototype", "toString"], + "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], + "%PromisePrototype%": ["Promise", "prototype"], + "%PromiseProto_then%": ["Promise", "prototype", "then"], + "%Promise_all%": ["Promise", "all"], + "%Promise_reject%": ["Promise", "reject"], + "%Promise_resolve%": ["Promise", "resolve"], + "%RangeErrorPrototype%": ["RangeError", "prototype"], + "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], + "%RegExpPrototype%": ["RegExp", "prototype"], + "%SetPrototype%": ["Set", "prototype"], + "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], + "%StringPrototype%": ["String", "prototype"], + "%SymbolPrototype%": ["Symbol", "prototype"], + "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], + "%TypedArrayPrototype%": ["TypedArray", "prototype"], + "%TypeErrorPrototype%": ["TypeError", "prototype"], + "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], + "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], + "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], + "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], + "%URIErrorPrototype%": ["URIError", "prototype"], + "%WeakMapPrototype%": ["WeakMap", "prototype"], + "%WeakSetPrototype%": ["WeakSet", "prototype"] + }; + var bind = requireFunctionBind(); + var hasOwn = /* @__PURE__ */ requireHasown(); + var $concat = bind.call(Function.call, Array.prototype.concat); + var $spliceApply = bind.call(Function.apply, Array.prototype.splice); + var $replace = bind.call(Function.call, String.prototype.replace); + var $strSlice = bind.call(Function.call, String.prototype.slice); + var $exec = bind.call(Function.call, RegExp.prototype.exec); + var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + var reEscapeChar = /\\(\\)?/g; + var stringToPath = function stringToPath2(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === "%" && last !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); + } else if (last === "%" && first !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); + } + var result = []; + $replace(string, rePropName, function(match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; + }); + return result; + }; + var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = "%" + alias[0] + "%"; + } + if (hasOwn(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === "undefined" && !allowMissing) { + throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); + } + return { + alias, + name: intrinsicName, + value + }; + } + throw new $SyntaxError("intrinsic " + name + " does not exist!"); + }; + getIntrinsic = function GetIntrinsic(name, allowMissing) { + if (typeof name !== "string" || name.length === 0) { + throw new $TypeError("intrinsic name must be a non-empty string"); + } + if (arguments.length > 1 && typeof allowMissing !== "boolean") { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; + var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + for (var i = 1, isOwn = true; i < parts.length; i += 1) { + var part = parts[i]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { + throw new $SyntaxError("property names with quotes must have matching quotes"); + } + if (part === "constructor" || !isOwn) { + skipFurtherCaching = true; + } + intrinsicBaseName += "." + part; + intrinsicRealName = "%" + intrinsicBaseName + "%"; + if (hasOwn(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); + } + return void 0; + } + if ($gOPD && i + 1 >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + if (isOwn && "get" in desc && !("originalValue" in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn(value, part); + value = value[part]; + } + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; + }; + return getIntrinsic; + } + var callBind = { exports: {} }; + var esDefineProperty; + var hasRequiredEsDefineProperty; + function requireEsDefineProperty() { + if (hasRequiredEsDefineProperty) return esDefineProperty; + hasRequiredEsDefineProperty = 1; + var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic(); + var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false; + if ($defineProperty) { + try { + $defineProperty({}, "a", { value: 1 }); + } catch (e) { + $defineProperty = false; + } + } + esDefineProperty = $defineProperty; + return esDefineProperty; + } + var gopd; + var hasRequiredGopd; + function requireGopd() { + if (hasRequiredGopd) return gopd; + hasRequiredGopd = 1; + var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic(); + var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e) { + $gOPD = null; + } + } + gopd = $gOPD; + return gopd; + } + var defineDataProperty; + var hasRequiredDefineDataProperty; + function requireDefineDataProperty() { + if (hasRequiredDefineDataProperty) return defineDataProperty; + hasRequiredDefineDataProperty = 1; + var $defineProperty = /* @__PURE__ */ requireEsDefineProperty(); + var $SyntaxError = /* @__PURE__ */ requireSyntax(); + var $TypeError = /* @__PURE__ */ requireType(); + var gopd2 = /* @__PURE__ */ requireGopd(); + defineDataProperty = function defineDataProperty2(obj, property, value) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new $TypeError("`obj` must be an object or a function`"); + } + if (typeof property !== "string" && typeof property !== "symbol") { + throw new $TypeError("`property` must be a string or a symbol`"); + } + if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { + throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); + } + if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { + throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); + } + if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { + throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); + } + if (arguments.length > 6 && typeof arguments[6] !== "boolean") { + throw new $TypeError("`loose`, if provided, must be a boolean"); + } + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + var desc = !!gopd2 && gopd2(obj, property); + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { + obj[property] = value; + } else { + throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + } + }; + return defineDataProperty; + } + var hasPropertyDescriptors_1; + var hasRequiredHasPropertyDescriptors; + function requireHasPropertyDescriptors() { + if (hasRequiredHasPropertyDescriptors) return hasPropertyDescriptors_1; + hasRequiredHasPropertyDescriptors = 1; + var $defineProperty = /* @__PURE__ */ requireEsDefineProperty(); + var hasPropertyDescriptors = function hasPropertyDescriptors2() { + return !!$defineProperty; + }; + hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], "length", { value: 1 }).length !== 1; + } catch (e) { + return true; + } + }; + hasPropertyDescriptors_1 = hasPropertyDescriptors; + return hasPropertyDescriptors_1; + } + var setFunctionLength; + var hasRequiredSetFunctionLength; + function requireSetFunctionLength() { + if (hasRequiredSetFunctionLength) return setFunctionLength; + hasRequiredSetFunctionLength = 1; + var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic(); + var define2 = /* @__PURE__ */ requireDefineDataProperty(); + var hasDescriptors = /* @__PURE__ */ requireHasPropertyDescriptors()(); + var gOPD = /* @__PURE__ */ requireGopd(); + var $TypeError = /* @__PURE__ */ requireType(); + var $floor = GetIntrinsic("%Math.floor%"); + setFunctionLength = function setFunctionLength2(fn, length) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + throw new $TypeError("`length` must be a positive 32-bit integer"); + } + var loose = arguments.length > 2 && !!arguments[2]; + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ("length" in fn && gOPD) { + var desc = gOPD(fn, "length"); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length, + true, + true + ); + } else { + define2( + /** @type {Parameters[0]} */ + fn, + "length", + length + ); + } + } + return fn; + }; + return setFunctionLength; + } + var hasRequiredCallBind; + function requireCallBind() { + if (hasRequiredCallBind) return callBind.exports; + hasRequiredCallBind = 1; + (function(module2) { + var bind = requireFunctionBind(); + var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic(); + var setFunctionLength2 = /* @__PURE__ */ requireSetFunctionLength(); + var $TypeError = /* @__PURE__ */ requireType(); + var $apply = GetIntrinsic("%Function.prototype.apply%"); + var $call = GetIntrinsic("%Function.prototype.call%"); + var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply); + var $defineProperty = /* @__PURE__ */ requireEsDefineProperty(); + var $max = GetIntrinsic("%Math.max%"); + module2.exports = function callBind2(originalFunction) { + if (typeof originalFunction !== "function") { + throw new $TypeError("a function is required"); + } + var func = $reflectApply(bind, $call, arguments); + return setFunctionLength2( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); + }; + var applyBind = function applyBind2() { + return $reflectApply(bind, $apply, arguments); + }; + if ($defineProperty) { + $defineProperty(module2.exports, "apply", { value: applyBind }); + } else { + module2.exports.apply = applyBind; + } + })(callBind); + return callBind.exports; + } + var callBound; + var hasRequiredCallBound; + function requireCallBound() { + if (hasRequiredCallBound) return callBound; + hasRequiredCallBound = 1; + var GetIntrinsic = /* @__PURE__ */ requireGetIntrinsic(); + var callBind2 = requireCallBind(); + var $indexOf = callBind2(GetIntrinsic("String.prototype.indexOf")); + callBound = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { + return callBind2(intrinsic); + } + return intrinsic; + }; + return callBound; + } + var isArguments; + var hasRequiredIsArguments; + function requireIsArguments() { + if (hasRequiredIsArguments) return isArguments; + hasRequiredIsArguments = 1; + var hasToStringTag = requireShams()(); + var callBound2 = requireCallBound(); + var $toString = callBound2("Object.prototype.toString"); + var isStandardArguments = function isArguments2(value) { + if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) { + return false; + } + return $toString(value) === "[object Arguments]"; + }; + var isLegacyArguments = function isArguments2(value) { + if (isStandardArguments(value)) { + return true; + } + return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]"; + }; + var supportsStandardArguments = function() { + return isStandardArguments(arguments); + }(); + isStandardArguments.isLegacyArguments = isLegacyArguments; + isArguments = supportsStandardArguments ? isStandardArguments : isLegacyArguments; + return isArguments; + } + var isGeneratorFunction; + var hasRequiredIsGeneratorFunction; + function requireIsGeneratorFunction() { + if (hasRequiredIsGeneratorFunction) return isGeneratorFunction; + hasRequiredIsGeneratorFunction = 1; + var toStr = Object.prototype.toString; + var fnToStr = Function.prototype.toString; + var isFnRegex = /^\s*(?:function)?\*/; + var hasToStringTag = requireShams()(); + var getProto = Object.getPrototypeOf; + var getGeneratorFunc = function() { + if (!hasToStringTag) { + return false; + } + try { + return Function("return function*() {}")(); + } catch (e) { + } + }; + var GeneratorFunction; + isGeneratorFunction = function isGeneratorFunction2(fn) { + if (typeof fn !== "function") { + return false; + } + if (isFnRegex.test(fnToStr.call(fn))) { + return true; + } + if (!hasToStringTag) { + var str = toStr.call(fn); + return str === "[object GeneratorFunction]"; + } + if (!getProto) { + return false; + } + if (typeof GeneratorFunction === "undefined") { + var generatorFunc = getGeneratorFunc(); + GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false; + } + return getProto(fn) === GeneratorFunction; + }; + return isGeneratorFunction; + } + var isCallable; + var hasRequiredIsCallable; + function requireIsCallable() { + if (hasRequiredIsCallable) return isCallable; + hasRequiredIsCallable = 1; + var fnToStr = Function.prototype.toString; + var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; + var badArrayLike; + var isCallableMarker; + if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { + try { + badArrayLike = Object.defineProperty({}, "length", { + get: function() { + throw isCallableMarker; + } + }); + isCallableMarker = {}; + reflectApply(function() { + throw 42; + }, null, badArrayLike); + } catch (_) { + if (_ !== isCallableMarker) { + reflectApply = null; + } + } + } else { + reflectApply = null; + } + var constructorRegex = /^\s*class\b/; + var isES6ClassFn = function isES6ClassFunction(value) { + try { + var fnStr = fnToStr.call(value); + return constructorRegex.test(fnStr); + } catch (e) { + return false; + } + }; + var tryFunctionObject = function tryFunctionToStr(value) { + try { + if (isES6ClassFn(value)) { + return false; + } + fnToStr.call(value); + return true; + } catch (e) { + return false; + } + }; + var toStr = Object.prototype.toString; + var objectClass = "[object Object]"; + var fnClass = "[object Function]"; + var genClass = "[object GeneratorFunction]"; + var ddaClass = "[object HTMLAllCollection]"; + var ddaClass2 = "[object HTML document.all class]"; + var ddaClass3 = "[object HTMLCollection]"; + var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; + var isIE68 = !(0 in [,]); + var isDDA = function isDocumentDotAll() { + return false; + }; + if (typeof document === "object") { + var all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value) { + if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) { + try { + var str = toStr.call(value); + return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null; + } catch (e) { + } + } + return false; + }; + } + } + isCallable = reflectApply ? function isCallable2(value) { + if (isDDA(value)) { + return true; + } + if (!value) { + return false; + } + if (typeof value !== "function" && typeof value !== "object") { + return false; + } + try { + reflectApply(value, null, badArrayLike); + } catch (e) { + if (e !== isCallableMarker) { + return false; + } + } + return !isES6ClassFn(value) && tryFunctionObject(value); + } : function isCallable2(value) { + if (isDDA(value)) { + return true; + } + if (!value) { + return false; + } + if (typeof value !== "function" && typeof value !== "object") { + return false; + } + if (hasToStringTag) { + return tryFunctionObject(value); + } + if (isES6ClassFn(value)) { + return false; + } + var strClass = toStr.call(value); + if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { + return false; + } + return tryFunctionObject(value); + }; + return isCallable; + } + var forEach_1; + var hasRequiredForEach; + function requireForEach() { + if (hasRequiredForEach) return forEach_1; + hasRequiredForEach = 1; + var isCallable2 = requireIsCallable(); + var toStr = Object.prototype.toString; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var forEachArray = function forEachArray2(array, iterator, receiver) { + for (var i = 0, len = array.length; i < len; i++) { + if (hasOwnProperty.call(array, i)) { + if (receiver == null) { + iterator(array[i], i, array); + } else { + iterator.call(receiver, array[i], i, array); + } + } + } + }; + var forEachString = function forEachString2(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); + } + } + }; + var forEachObject = function forEachObject2(object, iterator, receiver) { + for (var k in object) { + if (hasOwnProperty.call(object, k)) { + if (receiver == null) { + iterator(object[k], k, object); + } else { + iterator.call(receiver, object[k], k, object); + } + } + } + }; + var forEach = function forEach2(list, iterator, thisArg) { + if (!isCallable2(iterator)) { + throw new TypeError("iterator must be a function"); + } + var receiver; + if (arguments.length >= 3) { + receiver = thisArg; + } + if (toStr.call(list) === "[object Array]") { + forEachArray(list, iterator, receiver); + } else if (typeof list === "string") { + forEachString(list, iterator, receiver); + } else { + forEachObject(list, iterator, receiver); + } + }; + forEach_1 = forEach; + return forEach_1; + } + var possibleTypedArrayNames; + var hasRequiredPossibleTypedArrayNames; + function requirePossibleTypedArrayNames() { + if (hasRequiredPossibleTypedArrayNames) return possibleTypedArrayNames; + hasRequiredPossibleTypedArrayNames = 1; + possibleTypedArrayNames = [ + "Float32Array", + "Float64Array", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "BigInt64Array", + "BigUint64Array" + ]; + return possibleTypedArrayNames; + } + var availableTypedArrays; + var hasRequiredAvailableTypedArrays; + function requireAvailableTypedArrays() { + if (hasRequiredAvailableTypedArrays) return availableTypedArrays; + hasRequiredAvailableTypedArrays = 1; + var possibleNames = /* @__PURE__ */ requirePossibleTypedArrayNames(); + var g = typeof globalThis === "undefined" ? commonjsGlobal : globalThis; + availableTypedArrays = function availableTypedArrays2() { + var out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === "function") { + out[out.length] = possibleNames[i]; + } + } + return out; + }; + return availableTypedArrays; + } + var whichTypedArray; + var hasRequiredWhichTypedArray; + function requireWhichTypedArray() { + if (hasRequiredWhichTypedArray) return whichTypedArray; + hasRequiredWhichTypedArray = 1; + var forEach = requireForEach(); + var availableTypedArrays2 = /* @__PURE__ */ requireAvailableTypedArrays(); + var callBind2 = requireCallBind(); + var callBound2 = requireCallBound(); + var gOPD = /* @__PURE__ */ requireGopd(); + var $toString = callBound2("Object.prototype.toString"); + var hasToStringTag = requireShams()(); + var g = typeof globalThis === "undefined" ? commonjsGlobal : globalThis; + var typedArrays = availableTypedArrays2(); + var $slice = callBound2("String.prototype.slice"); + var getPrototypeOf = Object.getPrototypeOf; + var $indexOf = callBound2("Array.prototype.indexOf", true) || function indexOf(array, value) { + for (var i = 0; i < array.length; i += 1) { + if (array[i] === value) { + return i; + } + } + return -1; + }; + var cache = { __proto__: null }; + if (hasToStringTag && gOPD && getPrototypeOf) { + forEach(typedArrays, function(typedArray) { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr) { + var proto = getPrototypeOf(arr); + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor) { + var superProto = getPrototypeOf(proto); + descriptor = gOPD(superProto, Symbol.toStringTag); + } + cache["$" + typedArray] = callBind2(descriptor.get); + } + }); + } else { + forEach(typedArrays, function(typedArray) { + var arr = new g[typedArray](); + var fn = arr.slice || arr.set; + if (fn) { + cache["$" + typedArray] = callBind2(fn); + } + }); + } + var tryTypedArrays = function tryAllTypedArrays(value) { + var found = false; + forEach( + // eslint-disable-next-line no-extra-parens + /** @type {Record<`\$${TypedArrayName}`, Getter>} */ + /** @type {any} */ + cache, + /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ + function(getter, typedArray) { + if (!found) { + try { + if ("$" + getter(value) === typedArray) { + found = $slice(typedArray, 1); + } + } catch (e) { + } + } + } + ); + return found; + }; + var trySlices = function tryAllSlices(value) { + var found = false; + forEach( + // eslint-disable-next-line no-extra-parens + /** @type {Record<`\$${TypedArrayName}`, Getter>} */ + /** @type {any} */ + cache, + /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */ + function(getter, name) { + if (!found) { + try { + getter(value); + found = $slice(name, 1); + } catch (e) { + } + } + } + ); + return found; + }; + whichTypedArray = function whichTypedArray2(value) { + if (!value || typeof value !== "object") { + return false; + } + if (!hasToStringTag) { + var tag = $slice($toString(value), 8, -1); + if ($indexOf(typedArrays, tag) > -1) { + return tag; + } + if (tag !== "Object") { + return false; + } + return trySlices(value); + } + if (!gOPD) { + return null; + } + return tryTypedArrays(value); + }; + return whichTypedArray; + } + var isTypedArray; + var hasRequiredIsTypedArray; + function requireIsTypedArray() { + if (hasRequiredIsTypedArray) return isTypedArray; + hasRequiredIsTypedArray = 1; + var whichTypedArray2 = /* @__PURE__ */ requireWhichTypedArray(); + isTypedArray = function isTypedArray2(value) { + return !!whichTypedArray2(value); + }; + return isTypedArray; + } + var hasRequiredTypes; + function requireTypes() { + if (hasRequiredTypes) return types; + hasRequiredTypes = 1; + (function(exports3) { + var isArgumentsObject = requireIsArguments(); + var isGeneratorFunction2 = requireIsGeneratorFunction(); + var whichTypedArray2 = /* @__PURE__ */ requireWhichTypedArray(); + var isTypedArray2 = /* @__PURE__ */ requireIsTypedArray(); + function uncurryThis(f) { + return f.call.bind(f); + } + var BigIntSupported = typeof BigInt !== "undefined"; + var SymbolSupported = typeof Symbol !== "undefined"; + var ObjectToString = uncurryThis(Object.prototype.toString); + var numberValue = uncurryThis(Number.prototype.valueOf); + var stringValue = uncurryThis(String.prototype.valueOf); + var booleanValue = uncurryThis(Boolean.prototype.valueOf); + if (BigIntSupported) { + var bigIntValue = uncurryThis(BigInt.prototype.valueOf); + } + if (SymbolSupported) { + var symbolValue = uncurryThis(Symbol.prototype.valueOf); + } + function checkBoxedPrimitive(value, prototypeValueOf) { + if (typeof value !== "object") { + return false; + } + try { + prototypeValueOf(value); + return true; + } catch (e) { + return false; + } + } + exports3.isArgumentsObject = isArgumentsObject; + exports3.isGeneratorFunction = isGeneratorFunction2; + exports3.isTypedArray = isTypedArray2; + function isPromise(input) { + return typeof Promise !== "undefined" && input instanceof Promise || input !== null && typeof input === "object" && typeof input.then === "function" && typeof input.catch === "function"; + } + exports3.isPromise = isPromise; + function isArrayBufferView(value) { + if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { + return ArrayBuffer.isView(value); + } + return isTypedArray2(value) || isDataView(value); + } + exports3.isArrayBufferView = isArrayBufferView; + function isUint8Array(value) { + return whichTypedArray2(value) === "Uint8Array"; + } + exports3.isUint8Array = isUint8Array; + function isUint8ClampedArray(value) { + return whichTypedArray2(value) === "Uint8ClampedArray"; + } + exports3.isUint8ClampedArray = isUint8ClampedArray; + function isUint16Array(value) { + return whichTypedArray2(value) === "Uint16Array"; + } + exports3.isUint16Array = isUint16Array; + function isUint32Array(value) { + return whichTypedArray2(value) === "Uint32Array"; + } + exports3.isUint32Array = isUint32Array; + function isInt8Array(value) { + return whichTypedArray2(value) === "Int8Array"; + } + exports3.isInt8Array = isInt8Array; + function isInt16Array(value) { + return whichTypedArray2(value) === "Int16Array"; + } + exports3.isInt16Array = isInt16Array; + function isInt32Array(value) { + return whichTypedArray2(value) === "Int32Array"; + } + exports3.isInt32Array = isInt32Array; + function isFloat32Array(value) { + return whichTypedArray2(value) === "Float32Array"; + } + exports3.isFloat32Array = isFloat32Array; + function isFloat64Array(value) { + return whichTypedArray2(value) === "Float64Array"; + } + exports3.isFloat64Array = isFloat64Array; + function isBigInt64Array(value) { + return whichTypedArray2(value) === "BigInt64Array"; + } + exports3.isBigInt64Array = isBigInt64Array; + function isBigUint64Array(value) { + return whichTypedArray2(value) === "BigUint64Array"; + } + exports3.isBigUint64Array = isBigUint64Array; + function isMapToString(value) { + return ObjectToString(value) === "[object Map]"; + } + isMapToString.working = typeof Map !== "undefined" && isMapToString(/* @__PURE__ */ new Map()); + function isMap(value) { + if (typeof Map === "undefined") { + return false; + } + return isMapToString.working ? isMapToString(value) : value instanceof Map; + } + exports3.isMap = isMap; + function isSetToString(value) { + return ObjectToString(value) === "[object Set]"; + } + isSetToString.working = typeof Set !== "undefined" && isSetToString(/* @__PURE__ */ new Set()); + function isSet(value) { + if (typeof Set === "undefined") { + return false; + } + return isSetToString.working ? isSetToString(value) : value instanceof Set; + } + exports3.isSet = isSet; + function isWeakMapToString(value) { + return ObjectToString(value) === "[object WeakMap]"; + } + isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(/* @__PURE__ */ new WeakMap()); + function isWeakMap(value) { + if (typeof WeakMap === "undefined") { + return false; + } + return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap; + } + exports3.isWeakMap = isWeakMap; + function isWeakSetToString(value) { + return ObjectToString(value) === "[object WeakSet]"; + } + isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(/* @__PURE__ */ new WeakSet()); + function isWeakSet(value) { + return isWeakSetToString(value); + } + exports3.isWeakSet = isWeakSet; + function isArrayBufferToString(value) { + return ObjectToString(value) === "[object ArrayBuffer]"; + } + isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer()); + function isArrayBuffer(value) { + if (typeof ArrayBuffer === "undefined") { + return false; + } + return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer; + } + exports3.isArrayBuffer = isArrayBuffer; + function isDataViewToString(value) { + return ObjectToString(value) === "[object DataView]"; + } + isDataViewToString.working = typeof ArrayBuffer !== "undefined" && typeof DataView !== "undefined" && isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1)); + function isDataView(value) { + if (typeof DataView === "undefined") { + return false; + } + return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView; + } + exports3.isDataView = isDataView; + var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : void 0; + function isSharedArrayBufferToString(value) { + return ObjectToString(value) === "[object SharedArrayBuffer]"; + } + function isSharedArrayBuffer(value) { + if (typeof SharedArrayBufferCopy === "undefined") { + return false; + } + if (typeof isSharedArrayBufferToString.working === "undefined") { + isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy()); + } + return isSharedArrayBufferToString.working ? isSharedArrayBufferToString(value) : value instanceof SharedArrayBufferCopy; + } + exports3.isSharedArrayBuffer = isSharedArrayBuffer; + function isAsyncFunction(value) { + return ObjectToString(value) === "[object AsyncFunction]"; + } + exports3.isAsyncFunction = isAsyncFunction; + function isMapIterator(value) { + return ObjectToString(value) === "[object Map Iterator]"; + } + exports3.isMapIterator = isMapIterator; + function isSetIterator(value) { + return ObjectToString(value) === "[object Set Iterator]"; + } + exports3.isSetIterator = isSetIterator; + function isGeneratorObject(value) { + return ObjectToString(value) === "[object Generator]"; + } + exports3.isGeneratorObject = isGeneratorObject; + function isWebAssemblyCompiledModule(value) { + return ObjectToString(value) === "[object WebAssembly.Module]"; + } + exports3.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule; + function isNumberObject(value) { + return checkBoxedPrimitive(value, numberValue); + } + exports3.isNumberObject = isNumberObject; + function isStringObject(value) { + return checkBoxedPrimitive(value, stringValue); + } + exports3.isStringObject = isStringObject; + function isBooleanObject(value) { + return checkBoxedPrimitive(value, booleanValue); + } + exports3.isBooleanObject = isBooleanObject; + function isBigIntObject(value) { + return BigIntSupported && checkBoxedPrimitive(value, bigIntValue); + } + exports3.isBigIntObject = isBigIntObject; + function isSymbolObject(value) { + return SymbolSupported && checkBoxedPrimitive(value, symbolValue); + } + exports3.isSymbolObject = isSymbolObject; + function isBoxedPrimitive(value) { + return isNumberObject(value) || isStringObject(value) || isBooleanObject(value) || isBigIntObject(value) || isSymbolObject(value); + } + exports3.isBoxedPrimitive = isBoxedPrimitive; + function isAnyArrayBuffer(value) { + return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value)); + } + exports3.isAnyArrayBuffer = isAnyArrayBuffer; + ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(method) { + Object.defineProperty(exports3, method, { + enumerable: false, + value: function() { + throw new Error(method + " is not supported in userland"); + } + }); + }); + })(types); + return types; + } + var isBufferBrowser; + var hasRequiredIsBufferBrowser; + function requireIsBufferBrowser() { + if (hasRequiredIsBufferBrowser) return isBufferBrowser; + hasRequiredIsBufferBrowser = 1; + isBufferBrowser = function isBuffer(arg) { + return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function"; + }; + return isBufferBrowser; + } + var hasRequiredUtil; + function requireUtil() { + if (hasRequiredUtil) return util; + hasRequiredUtil = 1; + (function(exports3) { + var getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors2(obj) { + var keys = Object.keys(obj); + var descriptors = {}; + for (var i = 0; i < keys.length; i++) { + descriptors[keys[i]] = Object.getOwnPropertyDescriptor(obj, keys[i]); + } + return descriptors; + }; + var formatRegExp = /%[sdj%]/g; + exports3.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(" "); + } + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x2) { + if (x2 === "%%") return "%"; + if (i >= len) return x2; + switch (x2) { + case "%s": + return String(args[i++]); + case "%d": + return Number(args[i++]); + case "%j": + try { + return JSON.stringify(args[i++]); + } catch (_) { + return "[Circular]"; + } + default: + return x2; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += " " + x; + } else { + str += " " + inspect(x); + } + } + return str; + }; + exports3.deprecate = function(fn, msg) { + if (typeof process$1 !== "undefined" && process$1.noDeprecation === true) { + return fn; + } + if (typeof process$1 === "undefined") { + return function() { + return exports3.deprecate(fn, msg).apply(this, arguments); + }; + } + var warned = false; + function deprecated() { + if (!warned) { + if (process$1.throwDeprecation) { + throw new Error(msg); + } else if (process$1.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + return deprecated; + }; + var debugs = {}; + var debugEnvRegex = /^$/; + if (process$1.env.NODE_DEBUG) { + var debugEnv = process$1.env.NODE_DEBUG; + debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*").replace(/,/g, "$|^").toUpperCase(); + debugEnvRegex = new RegExp("^" + debugEnv + "$", "i"); + } + exports3.debuglog = function(set) { + set = set.toUpperCase(); + if (!debugs[set]) { + if (debugEnvRegex.test(set)) { + var pid = process$1.pid; + debugs[set] = function() { + var msg = exports3.format.apply(exports3, arguments); + console.error("%s %d: %s", set, pid, msg); + }; + } else { + debugs[set] = function() { + }; + } + } + return debugs[set]; + }; + function inspect(obj, opts) { + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + ctx.showHidden = opts; + } else if (opts) { + exports3._extend(ctx, opts); + } + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); + } + exports3.inspect = inspect; + inspect.colors = { + "bold": [1, 22], + "italic": [3, 23], + "underline": [4, 24], + "inverse": [7, 27], + "white": [37, 39], + "grey": [90, 39], + "black": [30, 39], + "blue": [34, 39], + "cyan": [36, 39], + "green": [32, 39], + "magenta": [35, 39], + "red": [31, 39], + "yellow": [33, 39] + }; + inspect.styles = { + "special": "cyan", + "number": "yellow", + "boolean": "yellow", + "undefined": "grey", + "null": "bold", + "string": "green", + "date": "magenta", + // "name": intentionally not styling + "regexp": "red" + }; + function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + if (style) { + return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m"; + } else { + return str; + } + } + function stylizeNoColor(str, styleType) { + return str; + } + function arrayToHash(array) { + var hash2 = {}; + array.forEach(function(val, idx) { + hash2[val] = true; + }); + return hash2; + } + function formatValue(ctx, value, recurseTimes) { + if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special + value.inspect !== exports3.inspect && // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) { + return formatError(value); + } + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ": " + value.name : ""; + return ctx.stylize("[Function" + name + "]", "special"); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), "regexp"); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), "date"); + } + if (isError(value)) { + return formatError(value); + } + } + var base = "", array = false, braces = ["{", "}"]; + if (isArray(value)) { + array = true; + braces = ["[", "]"]; + } + if (isFunction(value)) { + var n = value.name ? ": " + value.name : ""; + base = " [Function" + n + "]"; + } + if (isRegExp(value)) { + base = " " + RegExp.prototype.toString.call(value); + } + if (isDate(value)) { + base = " " + Date.prototype.toUTCString.call(value); + } + if (isError(value)) { + base = " " + formatError(value); + } + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), "regexp"); + } else { + return ctx.stylize("[Object]", "special"); + } + } + ctx.seen.push(value); + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + ctx.seen.pop(); + return reduceToSingleString(output, base, braces); + } + function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize("undefined", "undefined"); + if (isString(value)) { + var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; + return ctx.stylize(simple, "string"); + } + if (isNumber(value)) + return ctx.stylize("" + value, "number"); + if (isBoolean(value)) + return ctx.stylize("" + value, "boolean"); + if (isNull(value)) + return ctx.stylize("null", "null"); + } + function formatError(value) { + return "[" + Error.prototype.toString.call(value) + "]"; + } + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty( + ctx, + value, + recurseTimes, + visibleKeys, + String(i), + true + )); + } else { + output.push(""); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty( + ctx, + value, + recurseTimes, + visibleKeys, + key, + true + )); + } + }); + return output; + } + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize("[Getter/Setter]", "special"); + } else { + str = ctx.stylize("[Getter]", "special"); + } + } else { + if (desc.set) { + str = ctx.stylize("[Setter]", "special"); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = "[" + key + "]"; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf("\n") > -1) { + if (array) { + str = str.split("\n").map(function(line) { + return " " + line; + }).join("\n").slice(2); + } else { + str = "\n" + str.split("\n").map(function(line) { + return " " + line; + }).join("\n"); + } + } + } else { + str = ctx.stylize("[Circular]", "special"); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify("" + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.slice(1, -1); + name = ctx.stylize(name, "name"); + } else { + name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, "string"); + } + } + return name + ": " + str; + } + function reduceToSingleString(output, base, braces) { + var length = output.reduce(function(prev, cur) { + if (cur.indexOf("\n") >= 0) ; + return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1; + }, 0); + if (length > 60) { + return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1]; + } + return braces[0] + base + " " + output.join(", ") + " " + braces[1]; + } + exports3.types = requireTypes(); + function isArray(ar) { + return Array.isArray(ar); + } + exports3.isArray = isArray; + function isBoolean(arg) { + return typeof arg === "boolean"; + } + exports3.isBoolean = isBoolean; + function isNull(arg) { + return arg === null; + } + exports3.isNull = isNull; + function isNullOrUndefined(arg) { + return arg == null; + } + exports3.isNullOrUndefined = isNullOrUndefined; + function isNumber(arg) { + return typeof arg === "number"; + } + exports3.isNumber = isNumber; + function isString(arg) { + return typeof arg === "string"; + } + exports3.isString = isString; + function isSymbol(arg) { + return typeof arg === "symbol"; + } + exports3.isSymbol = isSymbol; + function isUndefined(arg) { + return arg === void 0; + } + exports3.isUndefined = isUndefined; + function isRegExp(re) { + return isObject(re) && objectToString(re) === "[object RegExp]"; + } + exports3.isRegExp = isRegExp; + exports3.types.isRegExp = isRegExp; + function isObject(arg) { + return typeof arg === "object" && arg !== null; + } + exports3.isObject = isObject; + function isDate(d) { + return isObject(d) && objectToString(d) === "[object Date]"; + } + exports3.isDate = isDate; + exports3.types.isDate = isDate; + function isError(e) { + return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error); + } + exports3.isError = isError; + exports3.types.isNativeError = isError; + function isFunction(arg) { + return typeof arg === "function"; + } + exports3.isFunction = isFunction; + function isPrimitive(arg) { + return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || // ES6 symbol + typeof arg === "undefined"; + } + exports3.isPrimitive = isPrimitive; + exports3.isBuffer = requireIsBufferBrowser(); + function objectToString(o) { + return Object.prototype.toString.call(o); + } + function pad(n) { + return n < 10 ? "0" + n.toString(10) : n.toString(10); + } + var months = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" + ]; + function timestamp() { + var d = /* @__PURE__ */ new Date(); + var time = [ + pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds()) + ].join(":"); + return [d.getDate(), months[d.getMonth()], time].join(" "); + } + exports3.log = function() { + console.log("%s - %s", timestamp(), exports3.format.apply(exports3, arguments)); + }; + exports3.inherits = requireInherits_browser(); + exports3._extend = function(origin, add) { + if (!add || !isObject(add)) return origin; + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; + }; + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + var kCustomPromisifiedSymbol = typeof Symbol !== "undefined" ? Symbol("util.promisify.custom") : void 0; + exports3.promisify = function promisify(original) { + if (typeof original !== "function") + throw new TypeError('The "original" argument must be of type Function'); + if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) { + var fn = original[kCustomPromisifiedSymbol]; + if (typeof fn !== "function") { + throw new TypeError('The "util.promisify.custom" argument must be of type Function'); + } + Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, + enumerable: false, + writable: false, + configurable: true + }); + return fn; + } + function fn() { + var promiseResolve, promiseReject; + var promise = new Promise(function(resolve, reject) { + promiseResolve = resolve; + promiseReject = reject; + }); + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + args.push(function(err, value) { + if (err) { + promiseReject(err); + } else { + promiseResolve(value); + } + }); + try { + original.apply(this, args); + } catch (err) { + promiseReject(err); + } + return promise; + } + Object.setPrototypeOf(fn, Object.getPrototypeOf(original)); + if (kCustomPromisifiedSymbol) Object.defineProperty(fn, kCustomPromisifiedSymbol, { + value: fn, + enumerable: false, + writable: false, + configurable: true + }); + return Object.defineProperties( + fn, + getOwnPropertyDescriptors(original) + ); + }; + exports3.promisify.custom = kCustomPromisifiedSymbol; + function callbackifyOnRejected(reason, cb) { + if (!reason) { + var newReason = new Error("Promise was rejected with a falsy value"); + newReason.reason = reason; + reason = newReason; + } + return cb(reason); + } + function callbackify(original) { + if (typeof original !== "function") { + throw new TypeError('The "original" argument must be of type Function'); + } + function callbackified() { + var args = []; + for (var i = 0; i < arguments.length; i++) { + args.push(arguments[i]); + } + var maybeCb = args.pop(); + if (typeof maybeCb !== "function") { + throw new TypeError("The last argument must be of type Function"); + } + var self2 = this; + var cb = function() { + return maybeCb.apply(self2, arguments); + }; + original.apply(this, args).then( + function(ret) { + process$1.nextTick(cb.bind(null, null, ret)); + }, + function(rej) { + process$1.nextTick(callbackifyOnRejected.bind(null, rej, cb)); + } + ); + } + Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)); + Object.defineProperties( + callbackified, + getOwnPropertyDescriptors(original) + ); + return callbackified; + } + exports3.callbackify = callbackify; + })(util); + return util; + } + var buffer_list; + var hasRequiredBuffer_list; + function requireBuffer_list() { + if (hasRequiredBuffer_list) return buffer_list; + hasRequiredBuffer_list = 1; + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + if (i % 2) { + ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + return target; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + return Constructor; + } + var _require = requireBuffer(), Buffer2 = _require.Buffer; + var _require2 = requireUtil(), inspect = _require2.inspect; + var custom = inspect && inspect.custom || "inspect"; + function copyBuffer(src, target, offset) { + Buffer2.prototype.copy.call(src, target, offset); + } + buffer_list = /* @__PURE__ */ function() { + function BufferList() { + _classCallCheck(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) this.tail.next = entry; + else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null; + else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join(s) { + if (this.length === 0) return ""; + var p = this.head; + var ret = "" + p.data; + while (p = p.next) { + ret += s + p.data; + } + return ret; + } + }, { + key: "concat", + value: function concat(n) { + if (this.length === 0) return Buffer2.alloc(0); + var ret = Buffer2.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n, hasStrings) { + var ret; + if (n < this.head.data.length) { + ret = this.head.data.slice(0, n); + this.head.data = this.head.data.slice(n); + } else if (n === this.head.data.length) { + ret = this.shift(); + } else { + ret = hasStrings ? this._getString(n) : this._getBuffer(n); + } + return ret; + } + }, { + key: "first", + value: function first() { + return this.head.data; + } + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n) { + var p = this.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str; + else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) this.head = p.next; + else this.head = this.tail = null; + } else { + this.head = p; + p.data = str.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n) { + var ret = Buffer2.allocUnsafe(n); + var p = this.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) this.head = p.next; + else this.head = this.tail = null; + } else { + this.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + this.length -= c; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread({}, options, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; + }(); + return buffer_list; + } + var destroy_1; + var hasRequiredDestroy; + function requireDestroy() { + if (hasRequiredDestroy) return destroy_1; + hasRequiredDestroy = 1; + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process$1.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process$1.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + process$1.nextTick(emitErrorAndCloseNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process$1.nextTick(emitErrorAndCloseNT, _this, err2); + } else { + process$1.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process$1.nextTick(emitCloseNT, _this); + cb(err2); + } else { + process$1.nextTick(emitCloseNT, _this); + } + }); + return this; + } + function emitErrorAndCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + if (self2._writableState && !self2._writableState.emitClose) return; + if (self2._readableState && !self2._readableState.emitClose) return; + self2.emit("close"); + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + function errorOrDestroy(stream, err) { + var rState = stream._readableState; + var wState = stream._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream.destroy(err); + else stream.emit("error", err); + } + destroy_1 = { + destroy, + undestroy, + errorOrDestroy + }; + return destroy_1; + } + var errorsBrowser = {}; + var hasRequiredErrorsBrowser; + function requireErrorsBrowser() { + if (hasRequiredErrorsBrowser) return errorsBrowser; + hasRequiredErrorsBrowser = 1; + function _inheritsLoose(subClass, superClass) { + subClass.prototype = Object.create(superClass.prototype); + subClass.prototype.constructor = subClass; + subClass.__proto__ = superClass; + } + var codes = {}; + function createErrorType(code, message, Base) { + if (!Base) { + Base = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message === "string") { + return message; + } else { + return message(arg1, arg2, arg3); + } + } + var NodeError = /* @__PURE__ */ function(_Base) { + _inheritsLoose(NodeError2, _Base); + function NodeError2(arg1, arg2, arg3) { + return _Base.call(this, getMessage(arg1, arg2, arg3)) || this; + } + return NodeError2; + }(Base); + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + codes[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + var len = expected.length; + expected = expected.map(function(i) { + return String(i); + }); + if (len > 2) { + return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1]; + } else if (len === 2) { + return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]); + } else { + return "of ".concat(thing, " ").concat(expected[0]); + } + } else { + return "of ".concat(thing, " ").concat(String(expected)); + } + } + function startsWith(str, search, pos) { + return str.substr(0, search.length) === search; + } + function endsWith(str, search, this_len) { + if (this_len === void 0 || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; + } + function includes(str, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"'; + }, TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { + var determiner; + if (typeof expected === "string" && startsWith(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + var msg; + if (endsWith(name, " argument")) { + msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type")); + } else { + var type2 = includes(name, ".") ? "property" : "argument"; + msg = 'The "'.concat(name, '" ').concat(type2, " ").concat(determiner, " ").concat(oneOf(expected, "type")); + } + msg += ". Received type ".concat(typeof actual); + return msg; + }, TypeError); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { + return "The " + name + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function(name) { + return "Cannot call " + name + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { + return "Unknown encoding: " + arg; + }, TypeError); + createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); + errorsBrowser.codes = codes; + return errorsBrowser; + } + var state; + var hasRequiredState; + function requireState() { + if (hasRequiredState) return state; + hasRequiredState = 1; + var ERR_INVALID_OPT_VALUE = requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getHighWaterMark(state2, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name, hwm); + } + return Math.floor(hwm); + } + return state2.objectMode ? 16 : 16 * 1024; + } + state = { + getHighWaterMark + }; + return state; + } + var browser; + var hasRequiredBrowser; + function requireBrowser() { + if (hasRequiredBrowser) return browser; + hasRequiredBrowser = 1; + browser = deprecate; + function deprecate(fn, msg) { + if (config("noDeprecation")) { + return fn; + } + var warned = false; + function deprecated() { + if (!warned) { + if (config("throwDeprecation")) { + throw new Error(msg); + } else if (config("traceDeprecation")) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + return deprecated; + } + function config(name) { + try { + if (!commonjsGlobal.localStorage) return false; + } catch (_) { + return false; + } + var val = commonjsGlobal.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === "true"; + } + return browser; + } + var _stream_writable; + var hasRequired_stream_writable; + function require_stream_writable() { + if (hasRequired_stream_writable) return _stream_writable; + hasRequired_stream_writable = 1; + _stream_writable = Writable; + function CorkedRequest(state2) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state2); + }; + } + var Duplex; + Writable.WritableState = WritableState; + var internalUtil = { + deprecate: requireBrowser() + }; + var Stream = requireStreamBrowser(); + var Buffer2 = requireBuffer().Buffer; + var OurUint8Array = commonjsGlobal.Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = requireDestroy(); + var _require = requireState(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED, ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES, ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END, ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + var errorOrDestroy = destroyImpl.errorOrDestroy; + requireInherits_browser()(Writable, Stream); + function nop() { + } + function WritableState(options, stream, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function realHasInstance2(object) { + return object instanceof this; + }; + } + function Writable(options) { + Duplex = Duplex || require_stream_duplex(); + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); + this.writable = true; + if (options) { + if (typeof options.write === "function") this._write = options.write; + if (typeof options.writev === "function") this._writev = options.writev; + if (typeof options.destroy === "function") this._destroy = options.destroy; + if (typeof options.final === "function") this._final = options.final; + } + Stream.call(this); + } + Writable.prototype.pipe = function() { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + }; + function writeAfterEnd(stream, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + errorOrDestroy(stream, er); + process$1.nextTick(cb, er); + } + function validChunk(stream, state2, chunk, cb) { + var er; + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== "string" && !state2.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); + } + if (er) { + errorOrDestroy(stream, er); + process$1.nextTick(cb, er); + return false; + } + return true; + } + Writable.prototype.write = function(chunk, encoding, cb) { + var state2 = this._writableState; + var ret = false; + var isBuf = !state2.objectMode && _isUint8Array(chunk); + if (isBuf && !Buffer2.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) encoding = "buffer"; + else if (!encoding) encoding = state2.defaultEncoding; + if (typeof cb !== "function") cb = nop; + if (state2.ending) writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state2, chunk, cb)) { + state2.pendingcb++; + ret = writeOrBuffer(this, state2, isBuf, chunk, encoding, cb); + } + return ret; + }; + Writable.prototype.cork = function() { + this._writableState.corked++; + }; + Writable.prototype.uncork = function() { + var state2 = this._writableState; + if (state2.corked) { + state2.corked--; + if (!state2.writing && !state2.corked && !state2.bufferProcessing && state2.bufferedRequest) clearBuffer(this, state2); + } + }; + Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + Object.defineProperty(Writable.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } + }); + function decodeChunk(state2, chunk, encoding) { + if (!state2.objectMode && state2.decodeStrings !== false && typeof chunk === "string") { + chunk = Buffer2.from(chunk, encoding); + } + return chunk; + } + Object.defineProperty(Writable.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream, state2, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state2, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk = newChunk; + } + } + var len = state2.objectMode ? 1 : chunk.length; + state2.length += len; + var ret = state2.length < state2.highWaterMark; + if (!ret) state2.needDrain = true; + if (state2.writing || state2.corked) { + var last = state2.lastBufferedRequest; + state2.lastBufferedRequest = { + chunk, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last) { + last.next = state2.lastBufferedRequest; + } else { + state2.bufferedRequest = state2.lastBufferedRequest; + } + state2.bufferedRequestCount += 1; + } else { + doWrite(stream, state2, false, len, chunk, encoding, cb); + } + return ret; + } + function doWrite(stream, state2, writev, len, chunk, encoding, cb) { + state2.writelen = len; + state2.writecb = cb; + state2.writing = true; + state2.sync = true; + if (state2.destroyed) state2.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) stream._writev(chunk, state2.onwrite); + else stream._write(chunk, encoding, state2.onwrite); + state2.sync = false; + } + function onwriteError(stream, state2, sync, er, cb) { + --state2.pendingcb; + if (sync) { + process$1.nextTick(cb, er); + process$1.nextTick(finishMaybe, stream, state2); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + } else { + cb(er); + stream._writableState.errorEmitted = true; + errorOrDestroy(stream, er); + finishMaybe(stream, state2); + } + } + function onwriteStateUpdate(state2) { + state2.writing = false; + state2.writecb = null; + state2.length -= state2.writelen; + state2.writelen = 0; + } + function onwrite(stream, er) { + var state2 = stream._writableState; + var sync = state2.sync; + var cb = state2.writecb; + if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state2); + if (er) onwriteError(stream, state2, sync, er, cb); + else { + var finished = needFinish(state2) || stream.destroyed; + if (!finished && !state2.corked && !state2.bufferProcessing && state2.bufferedRequest) { + clearBuffer(stream, state2); + } + if (sync) { + process$1.nextTick(afterWrite, stream, state2, finished, cb); + } else { + afterWrite(stream, state2, finished, cb); + } + } + } + function afterWrite(stream, state2, finished, cb) { + if (!finished) onwriteDrain(stream, state2); + state2.pendingcb--; + cb(); + finishMaybe(stream, state2); + } + function onwriteDrain(stream, state2) { + if (state2.length === 0 && state2.needDrain) { + state2.needDrain = false; + stream.emit("drain"); + } + } + function clearBuffer(stream, state2) { + state2.bufferProcessing = true; + var entry = state2.bufferedRequest; + if (stream._writev && entry && entry.next) { + var l = state2.bufferedRequestCount; + var buffer2 = new Array(l); + var holder = state2.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; + while (entry) { + buffer2[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer2.allBuffers = allBuffers; + doWrite(stream, state2, true, state2.length, buffer2, "", holder.finish); + state2.pendingcb++; + state2.lastBufferedRequest = null; + if (holder.next) { + state2.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state2.corkedRequestsFree = new CorkedRequest(state2); + } + state2.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state2.objectMode ? 1 : chunk.length; + doWrite(stream, state2, false, len, chunk, encoding, cb); + entry = entry.next; + state2.bufferedRequestCount--; + if (state2.writing) { + break; + } + } + if (entry === null) state2.lastBufferedRequest = null; + } + state2.bufferedRequest = entry; + state2.bufferProcessing = false; + } + Writable.prototype._write = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; + Writable.prototype._writev = null; + Writable.prototype.end = function(chunk, encoding, cb) { + var state2 = this._writableState; + if (typeof chunk === "function") { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); + if (state2.corked) { + state2.corked = 1; + this.uncork(); + } + if (!state2.ending) endWritable(this, state2, cb); + return this; + }; + Object.defineProperty(Writable.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } + }); + function needFinish(state2) { + return state2.ending && state2.length === 0 && state2.bufferedRequest === null && !state2.finished && !state2.writing; + } + function callFinal(stream, state2) { + stream._final(function(err) { + state2.pendingcb--; + if (err) { + errorOrDestroy(stream, err); + } + state2.prefinished = true; + stream.emit("prefinish"); + finishMaybe(stream, state2); + }); + } + function prefinish(stream, state2) { + if (!state2.prefinished && !state2.finalCalled) { + if (typeof stream._final === "function" && !state2.destroyed) { + state2.pendingcb++; + state2.finalCalled = true; + process$1.nextTick(callFinal, stream, state2); + } else { + state2.prefinished = true; + stream.emit("prefinish"); + } + } + } + function finishMaybe(stream, state2) { + var need = needFinish(state2); + if (need) { + prefinish(stream, state2); + if (state2.pendingcb === 0) { + state2.finished = true; + stream.emit("finish"); + if (state2.autoDestroy) { + var rState = stream._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream.destroy(); + } + } + } + } + return need; + } + function endWritable(stream, state2, cb) { + state2.ending = true; + finishMaybe(stream, state2); + if (cb) { + if (state2.finished) process$1.nextTick(cb); + else stream.once("finish", cb); + } + state2.ended = true; + stream.writable = false; + } + function onCorkedFinish(corkReq, state2, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state2.pendingcb--; + cb(err); + entry = entry.next; + } + state2.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function set(value) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value; + } + }); + Writable.prototype.destroy = destroyImpl.destroy; + Writable.prototype._undestroy = destroyImpl.undestroy; + Writable.prototype._destroy = function(err, cb) { + cb(err); + }; + return _stream_writable; + } + var _stream_duplex; + var hasRequired_stream_duplex; + function require_stream_duplex() { + if (hasRequired_stream_duplex) return _stream_duplex; + hasRequired_stream_duplex = 1; + var objectKeys = Object.keys || function(obj) { + var keys2 = []; + for (var key in obj) { + keys2.push(key); + } + return keys2; + }; + _stream_duplex = Duplex; + var Readable = require_stream_readable(); + var Writable = require_stream_writable(); + requireInherits_browser()(Duplex, Readable); + { + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } + } + function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); + } + } + } + Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.highWaterMark; + } + }); + Object.defineProperty(Duplex.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState && this._writableState.getBuffer(); + } + }); + Object.defineProperty(Duplex.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._writableState.length; + } + }); + function onend() { + if (this._writableState.ended) return; + process$1.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } + }); + return _stream_duplex; + } + var string_decoder = {}; + var safeBuffer = { exports: {} }; + var hasRequiredSafeBuffer; + function requireSafeBuffer() { + if (hasRequiredSafeBuffer) return safeBuffer.exports; + hasRequiredSafeBuffer = 1; + (function(module2, exports3) { + var buffer2 = requireBuffer(); + var Buffer2 = buffer2.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { + module2.exports = buffer2; + } else { + copyProps(buffer2, exports3); + exports3.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer2(arg, encodingOrOffset, length); + } + copyProps(Buffer2, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer2(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size, fill, encoding) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer2(size); + if (fill !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill, encoding); + } else { + buf.fill(fill); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer2(size); + }; + SafeBuffer.allocUnsafeSlow = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer2.SlowBuffer(size); + }; + })(safeBuffer, safeBuffer.exports); + return safeBuffer.exports; + } + var hasRequiredString_decoder; + function requireString_decoder() { + if (hasRequiredString_decoder) return string_decoder; + hasRequiredString_decoder = 1; + var Buffer2 = requireSafeBuffer().Buffer; + var isEncoding = Buffer2.isEncoding || function(encoding) { + encoding = "" + encoding; + switch (encoding && encoding.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; + } + }; + function _normalizeEncoding(enc) { + if (!enc) return "utf8"; + var retried; + while (true) { + switch (enc) { + case "utf8": + case "utf-8": + return "utf8"; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return "utf16le"; + case "latin1": + case "binary": + return "latin1"; + case "base64": + case "ascii": + case "hex": + return enc; + default: + if (retried) return; + enc = ("" + enc).toLowerCase(); + retried = true; + } + } + } + function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + return nenc || enc; + } + string_decoder.StringDecoder = StringDecoder; + function StringDecoder(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case "utf16le": + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case "utf8": + this.fillLast = utf8FillLast; + nb = 4; + break; + case "base64": + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer2.allocUnsafe(nb); + } + StringDecoder.prototype.write = function(buf) { + if (buf.length === 0) return ""; + var r; + var i; + if (this.lastNeed) { + r = this.fillLast(buf); + if (r === void 0) return ""; + i = this.lastNeed; + this.lastNeed = 0; + } else { + i = 0; + } + if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i); + return r || ""; + }; + StringDecoder.prototype.end = utf8End; + StringDecoder.prototype.text = utf8Text; + StringDecoder.prototype.fillLast = function(buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; + }; + function utf8CheckByte(byte) { + if (byte <= 127) return 0; + else if (byte >> 5 === 6) return 2; + else if (byte >> 4 === 14) return 3; + else if (byte >> 3 === 30) return 4; + return byte >> 6 === 2 ? -1 : -2; + } + function utf8CheckIncomplete(self2, buf, i) { + var j = buf.length - 1; + if (j < i) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self2.lastNeed = nb - 1; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self2.lastNeed = nb - 2; + return nb; + } + if (--j < i || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0; + else self2.lastNeed = nb - 3; + } + return nb; + } + return 0; + } + function utf8CheckExtraBytes(self2, buf, p) { + if ((buf[0] & 192) !== 128) { + self2.lastNeed = 0; + return "�"; + } + if (self2.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 192) !== 128) { + self2.lastNeed = 1; + return "�"; + } + if (self2.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 192) !== 128) { + self2.lastNeed = 2; + return "�"; + } + } + } + } + function utf8FillLast(buf) { + var p = this.lastTotal - this.lastNeed; + var r = utf8CheckExtraBytes(this, buf); + if (r !== void 0) return r; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p, 0, buf.length); + this.lastNeed -= buf.length; + } + function utf8Text(buf, i) { + var total = utf8CheckIncomplete(this, buf, i); + if (!this.lastNeed) return buf.toString("utf8", i); + this.lastTotal = total; + var end = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end); + return buf.toString("utf8", i, end); + } + function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) return r + "�"; + return r; + } + function utf16Text(buf, i) { + if ((buf.length - i) % 2 === 0) { + var r = buf.toString("utf16le", i); + if (r) { + var c = r.charCodeAt(r.length - 1); + if (c >= 55296 && c <= 56319) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r.slice(0, -1); + } + } + return r; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString("utf16le", i, buf.length - 1); + } + function utf16End(buf) { + var r = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) { + var end = this.lastTotal - this.lastNeed; + return r + this.lastChar.toString("utf16le", 0, end); + } + return r; + } + function base64Text(buf, i) { + var n = (buf.length - i) % 3; + if (n === 0) return buf.toString("base64", i); + this.lastNeed = 3 - n; + this.lastTotal = 3; + if (n === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString("base64", i, buf.length - n); + } + function base64End(buf) { + var r = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed); + return r; + } + function simpleWrite(buf) { + return buf.toString(this.encoding); + } + function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ""; + } + return string_decoder; + } + var endOfStream; + var hasRequiredEndOfStream; + function requireEndOfStream() { + if (hasRequiredEndOfStream) return endOfStream; + hasRequiredEndOfStream = 1; + var ERR_STREAM_PREMATURE_CLOSE = requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE; + function once(callback) { + var called = false; + return function() { + if (called) return; + called = true; + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + callback.apply(this, args); + }; + } + function noop2() { + } + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } + function eos(stream, opts, callback) { + if (typeof opts === "function") return eos(stream, null, opts); + if (!opts) opts = {}; + callback = once(callback || noop2); + var readable = opts.readable || opts.readable !== false && stream.readable; + var writable = opts.writable || opts.writable !== false && stream.writable; + var onlegacyfinish = function onlegacyfinish2() { + if (!stream.writable) onfinish(); + }; + var writableEnded = stream._writableState && stream._writableState.finished; + var onfinish = function onfinish2() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream); + }; + var readableEnded = stream._readableState && stream._readableState.endEmitted; + var onend = function onend2() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream); + }; + var onerror = function onerror2(err) { + callback.call(stream, err); + }; + var onclose = function onclose2() { + var err; + if (readable && !readableEnded) { + if (!stream._readableState || !stream._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + if (writable && !writableEnded) { + if (!stream._writableState || !stream._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream, err); + } + }; + var onrequest = function onrequest2() { + stream.req.on("finish", onfinish); + }; + if (isRequest(stream)) { + stream.on("complete", onfinish); + stream.on("abort", onclose); + if (stream.req) onrequest(); + else stream.on("request", onrequest); + } else if (writable && !stream._writableState) { + stream.on("end", onlegacyfinish); + stream.on("close", onlegacyfinish); + } + stream.on("end", onend); + stream.on("finish", onfinish); + if (opts.error !== false) stream.on("error", onerror); + stream.on("close", onclose); + return function() { + stream.removeListener("complete", onfinish); + stream.removeListener("abort", onclose); + stream.removeListener("request", onrequest); + if (stream.req) stream.req.removeListener("finish", onfinish); + stream.removeListener("end", onlegacyfinish); + stream.removeListener("close", onlegacyfinish); + stream.removeListener("finish", onfinish); + stream.removeListener("end", onend); + stream.removeListener("error", onerror); + stream.removeListener("close", onclose); + }; + } + endOfStream = eos; + return endOfStream; + } + var async_iterator; + var hasRequiredAsync_iterator; + function requireAsync_iterator() { + if (hasRequiredAsync_iterator) return async_iterator; + hasRequiredAsync_iterator = 1; + var _Object$setPrototypeO; + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + var finished = requireEndOfStream(); + var kLastResolve = Symbol("lastResolve"); + var kLastReject = Symbol("lastReject"); + var kError = Symbol("error"); + var kEnded = Symbol("ended"); + var kLastPromise = Symbol("lastPromise"); + var kHandlePromise = Symbol("handlePromise"); + var kStream = Symbol("stream"); + function createIterResult(value, done) { + return { + value, + done + }; + } + function readAndResolve(iter) { + var resolve = iter[kLastResolve]; + if (resolve !== null) { + var data = iter[kStream].read(); + if (data !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve(createIterResult(data, false)); + } + } + } + function onReadable(iter) { + process$1.nextTick(readAndResolve, iter); + } + function wrapForNext(lastPromise, iter) { + return function(resolve, reject) { + lastPromise.then(function() { + if (iter[kEnded]) { + resolve(createIterResult(void 0, true)); + return; + } + iter[kHandlePromise](resolve, reject); + }, reject); + }; + } + var AsyncIteratorPrototype = Object.getPrototypeOf(function() { + }); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next() { + var _this = this; + var error = this[kError]; + if (error !== null) { + return Promise.reject(error); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult(void 0, true)); + } + if (this[kStream].destroyed) { + return new Promise(function(resolve, reject) { + process$1.nextTick(function() { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve(createIterResult(void 0, true)); + } + }); + }); + } + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + var data = this[kStream].read(); + if (data !== null) { + return Promise.resolve(createIterResult(data, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } + }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { + return this; + }), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + return new Promise(function(resolve, reject) { + _this2[kStream].destroy(null, function(err) { + if (err) { + reject(err); + return; + } + resolve(createIterResult(void 0, true)); + }); + }); + }), _Object$setPrototypeO), AsyncIteratorPrototype); + var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve, reject) { + var data = iterator[kStream].read(); + if (data) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(data, false)); + } else { + iterator[kLastResolve] = resolve; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream, function(err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject = iterator[kLastReject]; + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + iterator[kError] = err; + return; + } + var resolve = iterator[kLastResolve]; + if (resolve !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve(createIterResult(void 0, true)); + } + iterator[kEnded] = true; + }); + stream.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + async_iterator = createReadableStreamAsyncIterator; + return async_iterator; + } + var fromBrowser; + var hasRequiredFromBrowser; + function requireFromBrowser() { + if (hasRequiredFromBrowser) return fromBrowser; + hasRequiredFromBrowser = 1; + fromBrowser = function() { + throw new Error("Readable.from is not available in the browser"); + }; + return fromBrowser; + } + var _stream_readable; + var hasRequired_stream_readable; + function require_stream_readable() { + if (hasRequired_stream_readable) return _stream_readable; + hasRequired_stream_readable = 1; + _stream_readable = Readable; + var Duplex; + Readable.ReadableState = ReadableState; + requireEvents().EventEmitter; + var EElistenerCount = function EElistenerCount2(emitter, type2) { + return emitter.listeners(type2).length; + }; + var Stream = requireStreamBrowser(); + var Buffer2 = requireBuffer().Buffer; + var OurUint8Array = commonjsGlobal.Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var debugUtil = requireUtil(); + var debug; + if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog("stream"); + } else { + debug = function debug2() { + }; + } + var BufferList = requireBuffer_list(); + var destroyImpl = requireDestroy(); + var _require = requireState(), getHighWaterMark = _require.getHighWaterMark; + var _require$codes = requireErrorsBrowser().codes, ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE, ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + var StringDecoder; + var createReadableStreamAsyncIterator; + var from; + requireInherits_browser()(Readable, Stream); + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener(emitter, event, fn) { + if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn); + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn); + else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn); + else emitter._events[event] = [fn, emitter._events[event]]; + } + function ReadableState(options, stream, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") isDuplex = stream instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = requireString_decoder().StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } + } + function Readable(options) { + Duplex = Duplex || require_stream_duplex(); + if (!(this instanceof Readable)) return new Readable(options); + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); + this.readable = true; + if (options) { + if (typeof options.read === "function") this._read = options.read; + if (typeof options.destroy === "function") this._destroy = options.destroy; + } + Stream.call(this); + } + Object.defineProperty(Readable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function set(value) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value; + } + }); + Readable.prototype.destroy = destroyImpl.destroy; + Readable.prototype._undestroy = destroyImpl.undestroy; + Readable.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable.prototype.push = function(chunk, encoding) { + var state2 = this._readableState; + var skipChunkCheck; + if (!state2.objectMode) { + if (typeof chunk === "string") { + encoding = encoding || state2.defaultEncoding; + if (encoding !== state2.encoding) { + chunk = Buffer2.from(chunk, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); + }; + Readable.prototype.unshift = function(chunk) { + return readableAddChunk(this, chunk, null, true, false); + }; + function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + debug("readableAddChunk", chunk); + var state2 = stream._readableState; + if (chunk === null) { + state2.reading = false; + onEofChunk(stream, state2); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state2, chunk); + if (er) { + errorOrDestroy(stream, er); + } else if (state2.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== "string" && !state2.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (addToFront) { + if (state2.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else addChunk(stream, state2, chunk, true); + } else if (state2.ended) { + errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state2.destroyed) { + return false; + } else { + state2.reading = false; + if (state2.decoder && !encoding) { + chunk = state2.decoder.write(chunk); + if (state2.objectMode || chunk.length !== 0) addChunk(stream, state2, chunk, false); + else maybeReadMore(stream, state2); + } else { + addChunk(stream, state2, chunk, false); + } + } + } else if (!addToFront) { + state2.reading = false; + maybeReadMore(stream, state2); + } + } + return !state2.ended && (state2.length < state2.highWaterMark || state2.length === 0); + } + function addChunk(stream, state2, chunk, addToFront) { + if (state2.flowing && state2.length === 0 && !state2.sync) { + state2.awaitDrain = 0; + stream.emit("data", chunk); + } else { + state2.length += state2.objectMode ? 1 : chunk.length; + if (addToFront) state2.buffer.unshift(chunk); + else state2.buffer.push(chunk); + if (state2.needReadable) emitReadable(stream); + } + maybeReadMore(stream, state2); + } + function chunkInvalid(state2, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state2.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); + } + return er; + } + Readable.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) StringDecoder = requireString_decoder().StringDecoder; + var decoder = new StringDecoder(enc); + this._readableState.decoder = decoder; + this._readableState.encoding = this._readableState.decoder.encoding; + var p = this._readableState.buffer.head; + var content = ""; + while (p !== null) { + content += decoder.write(p.data); + p = p.next; + } + this._readableState.buffer.clear(); + if (content !== "") this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; + var MAX_HWM = 1073741824; + function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; + } + function howMuchToRead(n, state2) { + if (n <= 0 || state2.length === 0 && state2.ended) return 0; + if (state2.objectMode) return 1; + if (n !== n) { + if (state2.flowing && state2.length) return state2.buffer.head.data.length; + else return state2.length; + } + if (n > state2.highWaterMark) state2.highWaterMark = computeNewHighWaterMark(n); + if (n <= state2.length) return n; + if (!state2.ended) { + state2.needReadable = true; + return 0; + } + return state2.length; + } + Readable.prototype.read = function(n) { + debug("read", n); + n = parseInt(n, 10); + var state2 = this._readableState; + var nOrig = n; + if (n !== 0) state2.emittedReadable = false; + if (n === 0 && state2.needReadable && ((state2.highWaterMark !== 0 ? state2.length >= state2.highWaterMark : state2.length > 0) || state2.ended)) { + debug("read: emitReadable", state2.length, state2.ended); + if (state2.length === 0 && state2.ended) endReadable(this); + else emitReadable(this); + return null; + } + n = howMuchToRead(n, state2); + if (n === 0 && state2.ended) { + if (state2.length === 0) endReadable(this); + return null; + } + var doRead = state2.needReadable; + debug("need readable", doRead); + if (state2.length === 0 || state2.length - n < state2.highWaterMark) { + doRead = true; + debug("length less than watermark", doRead); + } + if (state2.ended || state2.reading) { + doRead = false; + debug("reading or ended", doRead); + } else if (doRead) { + debug("do read"); + state2.reading = true; + state2.sync = true; + if (state2.length === 0) state2.needReadable = true; + this._read(state2.highWaterMark); + state2.sync = false; + if (!state2.reading) n = howMuchToRead(nOrig, state2); + } + var ret; + if (n > 0) ret = fromList(n, state2); + else ret = null; + if (ret === null) { + state2.needReadable = state2.length <= state2.highWaterMark; + n = 0; + } else { + state2.length -= n; + state2.awaitDrain = 0; + } + if (state2.length === 0) { + if (!state2.ended) state2.needReadable = true; + if (nOrig !== n && state2.ended) endReadable(this); + } + if (ret !== null) this.emit("data", ret); + return ret; + }; + function onEofChunk(stream, state2) { + debug("onEofChunk"); + if (state2.ended) return; + if (state2.decoder) { + var chunk = state2.decoder.end(); + if (chunk && chunk.length) { + state2.buffer.push(chunk); + state2.length += state2.objectMode ? 1 : chunk.length; + } + } + state2.ended = true; + if (state2.sync) { + emitReadable(stream); + } else { + state2.needReadable = false; + if (!state2.emittedReadable) { + state2.emittedReadable = true; + emitReadable_(stream); + } + } + } + function emitReadable(stream) { + var state2 = stream._readableState; + debug("emitReadable", state2.needReadable, state2.emittedReadable); + state2.needReadable = false; + if (!state2.emittedReadable) { + debug("emitReadable", state2.flowing); + state2.emittedReadable = true; + process$1.nextTick(emitReadable_, stream); + } + } + function emitReadable_(stream) { + var state2 = stream._readableState; + debug("emitReadable_", state2.destroyed, state2.length, state2.ended); + if (!state2.destroyed && (state2.length || state2.ended)) { + stream.emit("readable"); + state2.emittedReadable = false; + } + state2.needReadable = !state2.flowing && !state2.ended && state2.length <= state2.highWaterMark; + flow(stream); + } + function maybeReadMore(stream, state2) { + if (!state2.readingMore) { + state2.readingMore = true; + process$1.nextTick(maybeReadMore_, stream, state2); + } + } + function maybeReadMore_(stream, state2) { + while (!state2.reading && !state2.ended && (state2.length < state2.highWaterMark || state2.flowing && state2.length === 0)) { + var len = state2.length; + debug("maybeReadMore read 0"); + stream.read(0); + if (len === state2.length) + break; + } + state2.readingMore = false; + } + Readable.prototype._read = function(n) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); + }; + Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state2 = this._readableState; + switch (state2.pipesCount) { + case 0: + state2.pipes = dest; + break; + case 1: + state2.pipes = [state2.pipes, dest]; + break; + default: + state2.pipes.push(dest); + break; + } + state2.pipesCount += 1; + debug("pipe count=%d opts=%j", state2.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process$1.stdout && dest !== process$1.stderr; + var endFn = doEnd ? onend : unpipe; + if (state2.endEmitted) process$1.nextTick(endFn); + else src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state2.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + src.on("data", ondata); + function ondata(chunk) { + debug("ondata"); + var ret = dest.write(chunk); + debug("dest.write", ret); + if (ret === false) { + if ((state2.pipesCount === 1 && state2.pipes === dest || state2.pipesCount > 1 && indexOf(state2.pipes, dest) !== -1) && !cleanedUp) { + debug("false write response, pause", state2.awaitDrain); + state2.awaitDrain++; + } + src.pause(); + } + } + function onerror(er) { + debug("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er); + } + prependListener(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state2.flowing) { + debug("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state2 = src._readableState; + debug("pipeOnDrain", state2.awaitDrain); + if (state2.awaitDrain) state2.awaitDrain--; + if (state2.awaitDrain === 0 && EElistenerCount(src, "data")) { + state2.flowing = true; + flow(src); + } + }; + } + Readable.prototype.unpipe = function(dest) { + var state2 = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state2.pipesCount === 0) return this; + if (state2.pipesCount === 1) { + if (dest && dest !== state2.pipes) return this; + if (!dest) dest = state2.pipes; + state2.pipes = null; + state2.pipesCount = 0; + state2.flowing = false; + if (dest) dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state2.pipes; + var len = state2.pipesCount; + state2.pipes = null; + state2.pipesCount = 0; + state2.flowing = false; + for (var i = 0; i < len; i++) { + dests[i].emit("unpipe", this, { + hasUnpiped: false + }); + } + return this; + } + var index = indexOf(state2.pipes, dest); + if (index === -1) return this; + state2.pipes.splice(index, 1); + state2.pipesCount -= 1; + if (state2.pipesCount === 1) state2.pipes = state2.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + var state2 = this._readableState; + if (ev === "data") { + state2.readableListening = this.listenerCount("readable") > 0; + if (state2.flowing !== false) this.resume(); + } else if (ev === "readable") { + if (!state2.endEmitted && !state2.readableListening) { + state2.readableListening = state2.needReadable = true; + state2.flowing = false; + state2.emittedReadable = false; + debug("on readable", state2.length, state2.reading); + if (state2.length) { + emitReadable(this); + } else if (!state2.reading) { + process$1.nextTick(nReadingNextTick, this); + } + } + } + return res; + }; + Readable.prototype.addListener = Readable.prototype.on; + Readable.prototype.removeListener = function(ev, fn) { + var res = Stream.prototype.removeListener.call(this, ev, fn); + if (ev === "readable") { + process$1.nextTick(updateReadableListening, this); + } + return res; + }; + Readable.prototype.removeAllListeners = function(ev) { + var res = Stream.prototype.removeAllListeners.apply(this, arguments); + if (ev === "readable" || ev === void 0) { + process$1.nextTick(updateReadableListening, this); + } + return res; + }; + function updateReadableListening(self2) { + var state2 = self2._readableState; + state2.readableListening = self2.listenerCount("readable") > 0; + if (state2.resumeScheduled && !state2.paused) { + state2.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } + } + function nReadingNextTick(self2) { + debug("readable nexttick read 0"); + self2.read(0); + } + Readable.prototype.resume = function() { + var state2 = this._readableState; + if (!state2.flowing) { + debug("resume"); + state2.flowing = !state2.readableListening; + resume(this, state2); + } + state2.paused = false; + return this; + }; + function resume(stream, state2) { + if (!state2.resumeScheduled) { + state2.resumeScheduled = true; + process$1.nextTick(resume_, stream, state2); + } + } + function resume_(stream, state2) { + debug("resume", state2.reading); + if (!state2.reading) { + stream.read(0); + } + state2.resumeScheduled = false; + stream.emit("resume"); + flow(stream); + if (state2.flowing && !state2.reading) stream.read(0); + } + Readable.prototype.pause = function() { + debug("call pause flowing=%j", this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + this._readableState.paused = true; + return this; + }; + function flow(stream) { + var state2 = stream._readableState; + debug("flow", state2.flowing); + while (state2.flowing && stream.read() !== null) { + } + } + Readable.prototype.wrap = function(stream) { + var _this = this; + var state2 = this._readableState; + var paused = false; + stream.on("end", function() { + debug("wrapped end"); + if (state2.decoder && !state2.ended) { + var chunk = state2.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + _this.push(null); + }); + stream.on("data", function(chunk) { + debug("wrapped data"); + if (state2.decoder) chunk = state2.decoder.write(chunk); + if (state2.objectMode && (chunk === null || chunk === void 0)) return; + else if (!state2.objectMode && (!chunk || !chunk.length)) return; + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + for (var i in stream) { + if (this[i] === void 0 && typeof stream[i] === "function") { + this[i] = /* @__PURE__ */ function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + this._read = function(n2) { + debug("wrapped _read", n2); + if (paused) { + paused = false; + stream.resume(); + } + }; + return this; + }; + if (typeof Symbol === "function") { + Readable.prototype[Symbol.asyncIterator] = function() { + if (createReadableStreamAsyncIterator === void 0) { + createReadableStreamAsyncIterator = requireAsync_iterator(); + } + return createReadableStreamAsyncIterator(this); + }; + } + Object.defineProperty(Readable.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.highWaterMark; + } + }); + Object.defineProperty(Readable.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState && this._readableState.buffer; + } + }); + Object.defineProperty(Readable.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.flowing; + }, + set: function set(state2) { + if (this._readableState) { + this._readableState.flowing = state2; + } + } + }); + Readable._fromList = fromList; + Object.defineProperty(Readable.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get() { + return this._readableState.length; + } + }); + function fromList(n, state2) { + if (state2.length === 0) return null; + var ret; + if (state2.objectMode) ret = state2.buffer.shift(); + else if (!n || n >= state2.length) { + if (state2.decoder) ret = state2.buffer.join(""); + else if (state2.buffer.length === 1) ret = state2.buffer.first(); + else ret = state2.buffer.concat(state2.length); + state2.buffer.clear(); + } else { + ret = state2.buffer.consume(n, state2.decoder); + } + return ret; + } + function endReadable(stream) { + var state2 = stream._readableState; + debug("endReadable", state2.endEmitted); + if (!state2.endEmitted) { + state2.ended = true; + process$1.nextTick(endReadableNT, state2, stream); + } + } + function endReadableNT(state2, stream) { + debug("endReadableNT", state2.endEmitted, state2.length); + if (!state2.endEmitted && state2.length === 0) { + state2.endEmitted = true; + stream.readable = false; + stream.emit("end"); + if (state2.autoDestroy) { + var wState = stream._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream.destroy(); + } + } + } + } + if (typeof Symbol === "function") { + Readable.from = function(iterable, opts) { + if (from === void 0) { + from = requireFromBrowser(); + } + return from(Readable, iterable, opts); + }; + } + function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; + } + return _stream_readable; + } + var _stream_transform; + var hasRequired_stream_transform; + function require_stream_transform() { + if (hasRequired_stream_transform) return _stream_transform; + hasRequired_stream_transform = 1; + _stream_transform = Transform; + var _require$codes = requireErrorsBrowser().codes, ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED, ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK, ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING, ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex = require_stream_duplex(); + requireInherits_browser()(Transform, Duplex); + function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data != null) + this.push(data); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } + function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") this._transform = options.transform; + if (typeof options.flush === "function") this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function(er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); + } + } + Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); + }; + Transform.prototype._transform = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; + Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } + }; + Transform.prototype._read = function(n) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform.prototype._destroy = function(err, cb) { + Duplex.prototype._destroy.call(this, err, function(err2) { + cb(err2); + }); + }; + function done(stream, er, data) { + if (er) return stream.emit("error", er); + if (data != null) + stream.push(data); + if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream.push(null); + } + return _stream_transform; + } + var _stream_passthrough; + var hasRequired_stream_passthrough; + function require_stream_passthrough() { + if (hasRequired_stream_passthrough) return _stream_passthrough; + hasRequired_stream_passthrough = 1; + _stream_passthrough = PassThrough; + var Transform = require_stream_transform(); + requireInherits_browser()(PassThrough, Transform); + function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); + } + PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); + }; + return _stream_passthrough; + } + var pipeline_1; + var hasRequiredPipeline; + function requirePipeline() { + if (hasRequiredPipeline) return pipeline_1; + hasRequiredPipeline = 1; + var eos; + function once(callback) { + var called = false; + return function() { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; + } + var _require$codes = requireErrorsBrowser().codes, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + function noop2(err) { + if (err) throw err; + } + function isRequest(stream) { + return stream.setHeader && typeof stream.abort === "function"; + } + function destroyer(stream, reading, writing, callback) { + callback = once(callback); + var closed = false; + stream.on("close", function() { + closed = true; + }); + if (eos === void 0) eos = requireEndOfStream(); + eos(stream, { + readable: reading, + writable: writing + }, function(err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function(err) { + if (closed) return; + if (destroyed) return; + destroyed = true; + if (isRequest(stream)) return stream.abort(); + if (typeof stream.destroy === "function") return stream.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); + }; + } + function call(fn) { + fn(); + } + function pipe(from, to) { + return from.pipe(to); + } + function popCallback(streams) { + if (!streams.length) return noop2; + if (typeof streams[streams.length - 1] !== "function") return noop2; + return streams.pop(); + } + function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + var error; + var destroys = streams.map(function(stream, i) { + var reading = i < streams.length - 1; + var writing = i > 0; + return destroyer(stream, reading, writing, function(err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); + } + pipeline_1 = pipeline; + return pipeline_1; + } + var streamBrowserify; + var hasRequiredStreamBrowserify; + function requireStreamBrowserify() { + if (hasRequiredStreamBrowserify) return streamBrowserify; + hasRequiredStreamBrowserify = 1; + streamBrowserify = Stream; + var EE = requireEvents().EventEmitter; + var inherits = requireInherits_browser(); + inherits(Stream, EE); + Stream.Readable = require_stream_readable(); + Stream.Writable = require_stream_writable(); + Stream.Duplex = require_stream_duplex(); + Stream.Transform = require_stream_transform(); + Stream.PassThrough = require_stream_passthrough(); + Stream.finished = requireEndOfStream(); + Stream.pipeline = requirePipeline(); + Stream.Stream = Stream; + function Stream() { + EE.call(this); + } + Stream.prototype.pipe = function(dest, options) { + var source = this; + function ondata(chunk) { + if (dest.writable) { + if (false === dest.write(chunk) && source.pause) { + source.pause(); + } + } + } + source.on("data", ondata); + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + dest.on("drain", ondrain); + if (!dest._isStdio && (!options || options.end !== false)) { + source.on("end", onend); + source.on("close", onclose); + } + var didOnEnd = false; + function onend() { + if (didOnEnd) return; + didOnEnd = true; + dest.end(); + } + function onclose() { + if (didOnEnd) return; + didOnEnd = true; + if (typeof dest.destroy === "function") dest.destroy(); + } + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, "error") === 0) { + throw er; + } + } + source.on("error", onerror); + dest.on("error", onerror); + function cleanup() { + source.removeListener("data", ondata); + dest.removeListener("drain", ondrain); + source.removeListener("end", onend); + source.removeListener("close", onclose); + source.removeListener("error", onerror); + dest.removeListener("error", onerror); + source.removeListener("end", cleanup); + source.removeListener("close", cleanup); + dest.removeListener("close", cleanup); + } + source.on("end", cleanup); + source.on("close", cleanup); + dest.on("close", cleanup); + dest.emit("pipe", source); + return dest; + }; + return streamBrowserify; + } + var hasRequiredSax; + function requireSax() { + if (hasRequiredSax) return sax; + hasRequiredSax = 1; + (function(exports3) { + (function(sax2) { + sax2.parser = function(strict, opt) { + return new SAXParser(strict, opt); + }; + sax2.SAXParser = SAXParser; + sax2.SAXStream = SAXStream; + sax2.createStream = createStream; + sax2.MAX_BUFFER_LENGTH = 64 * 1024; + var buffers = [ + "comment", + "sgmlDecl", + "textNode", + "tagName", + "doctype", + "procInstName", + "procInstBody", + "entity", + "attribName", + "attribValue", + "cdata", + "script" + ]; + sax2.EVENTS = [ + "text", + "processinginstruction", + "sgmldeclaration", + "doctype", + "comment", + "opentagstart", + "attribute", + "opentag", + "closetag", + "opencdata", + "cdata", + "closecdata", + "error", + "end", + "ready", + "script", + "opennamespace", + "closenamespace" + ]; + function SAXParser(strict, opt) { + if (!(this instanceof SAXParser)) { + return new SAXParser(strict, opt); + } + var parser = this; + clearBuffers(parser); + parser.q = parser.c = ""; + parser.bufferCheckPosition = sax2.MAX_BUFFER_LENGTH; + parser.opt = opt || {}; + parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags; + parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"; + parser.tags = []; + parser.closed = parser.closedRoot = parser.sawRoot = false; + parser.tag = parser.error = null; + parser.strict = !!strict; + parser.noscript = !!(strict || parser.opt.noscript); + parser.state = S.BEGIN; + parser.strictEntities = parser.opt.strictEntities; + parser.ENTITIES = parser.strictEntities ? Object.create(sax2.XML_ENTITIES) : Object.create(sax2.ENTITIES); + parser.attribList = []; + if (parser.opt.xmlns) { + parser.ns = Object.create(rootNS); + } + parser.trackPosition = parser.opt.position !== false; + if (parser.trackPosition) { + parser.position = parser.line = parser.column = 0; + } + emit(parser, "onready"); + } + if (!Object.create) { + Object.create = function(o) { + function F() { + } + F.prototype = o; + var newf = new F(); + return newf; + }; + } + if (!Object.keys) { + Object.keys = function(o) { + var a = []; + for (var i in o) if (o.hasOwnProperty(i)) a.push(i); + return a; + }; + } + function checkBufferLength(parser) { + var maxAllowed = Math.max(sax2.MAX_BUFFER_LENGTH, 10); + var maxActual = 0; + for (var i = 0, l = buffers.length; i < l; i++) { + var len = parser[buffers[i]].length; + if (len > maxAllowed) { + switch (buffers[i]) { + case "textNode": + closeText(parser); + break; + case "cdata": + emitNode(parser, "oncdata", parser.cdata); + parser.cdata = ""; + break; + case "script": + emitNode(parser, "onscript", parser.script); + parser.script = ""; + break; + default: + error(parser, "Max buffer length exceeded: " + buffers[i]); + } + } + maxActual = Math.max(maxActual, len); + } + var m = sax2.MAX_BUFFER_LENGTH - maxActual; + parser.bufferCheckPosition = m + parser.position; + } + function clearBuffers(parser) { + for (var i = 0, l = buffers.length; i < l; i++) { + parser[buffers[i]] = ""; + } + } + function flushBuffers(parser) { + closeText(parser); + if (parser.cdata !== "") { + emitNode(parser, "oncdata", parser.cdata); + parser.cdata = ""; + } + if (parser.script !== "") { + emitNode(parser, "onscript", parser.script); + parser.script = ""; + } + } + SAXParser.prototype = { + end: function() { + end(this); + }, + write, + resume: function() { + this.error = null; + return this; + }, + close: function() { + return this.write(null); + }, + flush: function() { + flushBuffers(this); + } + }; + var Stream; + try { + Stream = requireStreamBrowserify().Stream; + } catch (ex) { + Stream = function() { + }; + } + var streamWraps = sax2.EVENTS.filter(function(ev) { + return ev !== "error" && ev !== "end"; + }); + function createStream(strict, opt) { + return new SAXStream(strict, opt); + } + function SAXStream(strict, opt) { + if (!(this instanceof SAXStream)) { + return new SAXStream(strict, opt); + } + Stream.apply(this); + this._parser = new SAXParser(strict, opt); + this.writable = true; + this.readable = true; + var me = this; + this._parser.onend = function() { + me.emit("end"); + }; + this._parser.onerror = function(er) { + me.emit("error", er); + me._parser.error = null; + }; + this._decoder = null; + streamWraps.forEach(function(ev) { + Object.defineProperty(me, "on" + ev, { + get: function() { + return me._parser["on" + ev]; + }, + set: function(h) { + if (!h) { + me.removeAllListeners(ev); + me._parser["on" + ev] = h; + return h; + } + me.on(ev, h); + }, + enumerable: true, + configurable: false + }); + }); + } + SAXStream.prototype = Object.create(Stream.prototype, { + constructor: { + value: SAXStream + } + }); + SAXStream.prototype.write = function(data) { + if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data)) { + if (!this._decoder) { + var SD = requireString_decoder().StringDecoder; + this._decoder = new SD("utf8"); + } + data = this._decoder.write(data); + } + this._parser.write(data.toString()); + this.emit("data", data); + return true; + }; + SAXStream.prototype.end = function(chunk) { + if (chunk && chunk.length) { + this.write(chunk); + } + this._parser.end(); + return true; + }; + SAXStream.prototype.on = function(ev, handler) { + var me = this; + if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) { + me._parser["on" + ev] = function() { + var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments); + args.splice(0, 0, ev); + me.emit.apply(me, args); + }; + } + return Stream.prototype.on.call(me, ev, handler); + }; + var CDATA = "[CDATA["; + var DOCTYPE = "DOCTYPE"; + var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"; + var XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"; + var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }; + var nameStart = /[:_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]/; + var nameBody = /[:_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-]/; + var entityStart = /[#:_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]/; + var entityBody = /[#:_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 isWhitespace(c) { + return c === " " || c === "\n" || c === "\r" || c === " "; + } + function isQuote(c) { + return c === '"' || c === "'"; + } + function isAttribEnd(c) { + return c === ">" || isWhitespace(c); + } + function isMatch(regex, c) { + return regex.test(c); + } + function notMatch(regex, c) { + return !isMatch(regex, c); + } + var S = 0; + sax2.STATE = { + BEGIN: S++, + // leading byte order mark or whitespace + BEGIN_WHITESPACE: S++, + // leading whitespace + TEXT: S++, + // general stuff + TEXT_ENTITY: S++, + // & and such. + OPEN_WAKA: S++, + // < + SGML_DECL: S++, + // + SCRIPT: S++, + // +
-

PDF转图片工具

-

安全、高效地将PDF文件转换为高质量图片,所有处理均在浏览器中完成

+

PDF转换工具

+

安全、高效地将PDF文件转换为高质量图片或Word文档,所有处理均在浏览器中完成

@@ -58,19 +75,38 @@
-
- - +
+
+ + + + + +
-
- - +
+
+ + +
+ +
+ + +
-
+ + +
@@ -84,7 +120,7 @@